auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>public long get6ByteLong( long index, int offset ) { long pageId = pageId( index ); offset += offset( index ); try ( PageCursor cursor = pagedFile.io( pageId, PF_SHARED_READ_LOCK ) ) { cursor.next(); long result; do { long low4b = cursor.getInt( offset ) & 0xFFFFFFFFL; long high2b = cursor.getShort( offset + Integer.BYTES ); <START> result = low4b | (high2b << 32); <END> } while ( cursor.shouldRetry() ); checkBounds( cursor ); return result; } catch ( IOException e ) { throw new UncheckedIOException( e ); } }</code><technical_language>32 replaced Integer.SIZE</technical_language>

Target:
public long get6ByteLong( long index, int offset ) { long pageId = pageId( index ); offset += offset( index ); try ( PageCursor cursor = pagedFile.io( pageId, PF_SHARED_READ_LOCK ) ) { cursor.next(); long result; do { long low4b = cursor.getInt( offset ) & 0xFFFFFFFFL; long high2b = cursor.getShort( offset + Integer.BYTES ); result = low4b | (high2b << Integer.SIZE); } while ( cursor.shouldRetry() ); checkBounds( cursor ); return result; } catch ( IOException e ) { throw new UncheckedIOException( e ); } }
Source:
<code>public EventWithLocalDate() { <START> super(); <END> }</code><technical_language>this present - super() base class is Object a special constructor call</technical_language>

Target:
public EventWithLocalDate()
Source:
<code>public Repository getRepository() throws IOException { if (repo == null) { <START> this.repo = repoManager.openRepository(project); <END> inserter = repo.newObjectInserter(); revWalk = new RevWalk(inserter.newReader()); batchRefUpdate = repo.getRefDatabase().newBatchUpdate(); } return repo; }</code><technical_language>closeRepo set true, repo is closed</technical_language>

Target:
public Repository getRepository() throws IOException { if (repo == null) { this.repo = repoManager.openRepository(project); closeRepo = true; inserter = repo.newObjectInserter(); revWalk = new RevWalk(inserter.newReader()); batchRefUpdate = repo.getRefDatabase().newBatchUpdate(); } return repo; }
Source:
<code>private void maybeExecuteBashScripts() { if (executeScripts()) { <START> Path dirPath = Paths.get(getLogDirPath(), dirName) <END> .toAbsolutePath(); for(String path : getPathsToScriptsToExecute()) { Path scriptPath = Paths.get(path).toAbsolutePath(); try { logger.info("executing " + scriptPath + " with arguments '" + dirPath + "'"); Process p = new ProcessBuilder(scriptPath.toString(), dirPath.toString()).start(); } catch (IOException e) { logger.error("Could not execute " + scriptPath, e); } } } }</code><technical_language>Whitespace: brake "=" a new line</technical_language>

Target:
private void maybeExecuteBashScripts() { if (shouldExecuteScripts()) { Path absDirPath = Paths.get(getLogDirPath(), dirName).toAbsolutePath(); for(String scriptPath : getPathsToScriptsToExecute()) { Path absScriptPath = Paths.get(scriptPath).toAbsolutePath(); try { logger.info("executing " + scriptPath + " with arguments '" + absDirPath + "'"); new ProcessBuilder(scriptPath.toString(), absDirPath.toString()).start(); } catch (IOException e) { logger.error("Could not execute " + scriptPath, e); } } } }
Source:
<code>public void setLastCancelAllTimeMillis(final long timeMillis) { <START> mWorkDatabase.beginTransaction(); <END> try { Preference preference = new Preference(KEY_LAST_CANCEL_ALL_TIME_MS, timeMillis); mWorkDatabase.preferenceDao().insertPreference(preference); mWorkDatabase.setTransactionSuccessful(); } finally { mWorkDatabase.endTransaction(); } }</code><technical_language>Single statements need a transaction</technical_language>

Target:
public void setLastCancelAllTimeMillis(final long timeMillis) { Preference preference = new Preference(KEY_LAST_CANCEL_ALL_TIME_MS, timeMillis); mWorkDatabase.preferenceDao().insertPreference(preference); }
Source:
<code>public static void run() { if (!ok) { return; } System.out.println("............................................"); if (generate) { generateWorlds(); } else { InferenceEngine engine = InferenceEngine.constructEngine(model, inferenceProps); engine.setEvidence(evidence); engine.setQueries(queries); engine.answerQueries(); System.out.println("======== Query Results ========="); System.out.println("Iteration: " + numSamples); for (Iterator iter = queries.iterator(); iter.hasNext();) { Query q = (Query) iter.next(); <START> q.printResults(System.out); <END> } System.out.println("======== Done ========"); System.out.println(); if (outputPath != null) { writeResultsJson(queries, outputPath); } } Timer.printAllTimers(); }</code><technical_language>this improved well. a ways format query results format. JSON is one, this plain format is another. 1. Create a seperate class ResultSet (basically a table), reference Query 2. Query immutable 3. Add ResultWriter implementations JSONWriter, TableWriter</technical_language>

Target:
public static void run() { if (!ok) { return; } System.out.println("............................................"); if (generate) { generateWorlds(); } else { InferenceEngine engine = InferenceEngine.constructEngine(model, inferenceProps); engine.setEvidence(evidence); engine.setQueries(queries); engine.answerQueries(); TableWriter tableWriter = new TableWriter(queries); tableWriter.setHeader("Iteration: " + numSamples); tableWriter.writeResults(System.out); if (outputPath != null) { System.out.println("Writing query results to " + outputPath + "..."); JsonWriter jsonWriter = new JsonWriter(queries); jsonWriter.writeResults(outputPath); System.out.println("Done."); } } Timer.printAllTimers(); }
Source:
<code>public RelOptPredicateList getPredicates(Intersect intersect, RelMetadataQuery mq) { final RexBuilder rexBuilder = intersect.getCluster().getRexBuilder(); final RexExecutorImpl rexImpl = (RexExecutorImpl) (intersect.getCluster().getPlanner().getExecutor()); final RexImplicationChecker rexImplicationChecker = new RexImplicationChecker( <START> intersect.getCluster().getRexBuilder(), rexImpl, intersect.getRowType()); <END> Set<RexNode> finalPredicates = new HashSet<>(); for (Ord<RelNode> input : Ord.zip(intersect.getInputs())) { RelOptPredicateList info = mq.getPulledUpPredicates(input.e); if (info == null || info.pulledUpPredicates.isEmpty()) { continue; } for (RexNode pred: info.pulledUpPredicates) { if (finalPredicates.stream().anyMatch( finalPred -> rexImplicationChecker.implies(finalPred, pred))) { continue; } finalPredicates = finalPredicates.stream() .filter(finalPred -> !rexImplicationChecker.implies(pred, finalPred)) .collect(Collectors.toSet()); finalPredicates.add(pred); } } return RelOptPredicateList.of(rexBuilder, finalPredicates); }</code><technical_language>rexBuilder</technical_language>

Target:
public RelOptPredicateList getPredicates(Intersect intersect, RelMetadataQuery mq) { final RexBuilder rexBuilder = intersect.getCluster().getRexBuilder(); final RexExecutorImpl rexImpl = (RexExecutorImpl) (intersect.getCluster().getPlanner().getExecutor()); final RexImplicationChecker rexImplicationChecker = new RexImplicationChecker(rexBuilder, rexImpl, intersect.getRowType()); Set<RexNode> finalPredicates = new HashSet<>(); for (Ord<RelNode> input : Ord.zip(intersect.getInputs())) { RelOptPredicateList info = mq.getPulledUpPredicates(input.e); if (info == null || info.pulledUpPredicates.isEmpty()) { continue; } for (RexNode pred: info.pulledUpPredicates) { if (finalPredicates.stream().anyMatch( finalPred -> rexImplicationChecker.implies(finalPred, pred))) { continue; } finalPredicates = finalPredicates.stream() .filter(finalPred -> !rexImplicationChecker.implies(pred, finalPred)) .collect(Collectors.toSet()); finalPredicates.add(pred); } } return RelOptPredicateList.of(rexBuilder, finalPredicates); }
Source:
<code>private String getQueryString(Query query, Table table) { final OrderByClause orderByClause = query.getOrderByClause(); <START> if(orderByClause.isEmpty()) { <END> query.orderBy(table.getColumnByName("id"), Direction.ASC); } String queryString = query.toSql(); return queryString.replace(table.getName() + ".", ""); }</code><technical_language>beware queries _can_ order clause. For instance a "SELECT COUNT(*) table" appended order</technical_language>

Target:
private String getQueryString(Query query, Table table) { if (isPlainSelectOfColumns(query)) { addOrderByClauseIfMissing(query, table); } String queryString = query.toSql(); return queryString.replace(table.getName() + ".", ""); }
Source:
<code>public IndexBuilder fillIndexBuilder(final Path path) throws Exception { InputStream inputStream = null; try { inputStream = ioService.newInputStream(path, StandardOpenOption.READ); <START> final String drl = DecisionTableFactory.loadFromInputStream(inputStream, <END> null); return fillDrlIndexBuilder(path, drl); } finally { if (inputStream != null) { try { inputStream.close(); } catch (IOException e) { } } } }</code><technical_language>Worth try resources: java try (final InputStream inputStream = ioService.newInputStream(path, StandardOpenOption.READ)) { final String drl = DecisionTableFactory.loadFromInputStream(inputStream, null); return fillDrlIndexBuilder(path, drl); }</technical_language>

Target:
public IndexBuilder fillIndexBuilder(final Path path) throws Exception { try (final InputStream inputStream = ioService.newInputStream(path, StandardOpenOption.READ)) { final String drl = DecisionTableFactory.loadFromInputStream(inputStream, null); return fillDrlIndexBuilder(path, drl); } }
Source:
<code>public Optional<MemorySegment> getUnconsumedSegment() { <START> if (hasRemaining()) { MemorySegment target = MemorySegmentFactory.allocateUnpooledSegment(remaining()); segment.copyTo(position, target, 0, remaining()); return Optional.of(target); } else { return Optional.empty(); <END> } }</code><technical_language>if simpler/shorter branch</technical_language>

Target:
CloseableIterator<Buffer> getUnconsumedSegment() { if (!hasRemaining()) { return CloseableIterator.empty(); } MemorySegment segment = MemorySegmentFactory.allocateUnpooledSegment(remaining()); this.segment.copyTo(position, segment, 0, remaining()); return singleBufferIterator(segment); }
Source:
<code>public void scanHttpResponseReceive(HttpMessage msg, int id, Source source) { String siteIdentifier = getSiteIdentifier(msg); <START> if (alreadySeen(msg)) { <END> if(LOGGER.isDebugEnabled()) { LOGGER.debug("Skipping analyse, because already seen " + siteIdentifier); } return; } if(siteIdentifier != null){ visitedSiteIdentifiers.add(siteIdentifier); } long startTime = System.currentTimeMillis(); for (Application app : this.getApps()) { this.currentApp = app; checkAppMatches(msg, source); if(appMatch != null) { String site = msg.getRequestHeader().getHostName() + ":" + msg.getRequestHeader().getHostPort(); if(LOGGER.isDebugEnabled()) { LOGGER.debug("Adding " + app.getName() + " to " + site); } addApplicationsToSite(site, appMatch); this.appMatch = null; } this.currentApp = null; } if(LOGGER.isDebugEnabled()) { LOGGER.debug("Analyse took " + (System.currentTimeMillis() - startTime) + "ms"); } }</code><technical_language>siteIdentifier is unique enough need check history anymore (IMO)</technical_language>

Target:
public void scanHttpResponseReceive(HttpMessage msg, int id, Source source) { String siteIdentifier = getSiteIdentifier(msg); if (!visitedSiteIdentifiers.add(siteIdentifier)) { return; } long startTime = System.currentTimeMillis(); for (Application app : this.getApps()) { this.currentApp = app; checkAppMatches(msg, source); if(appMatch != null) { String site = msg.getRequestHeader().getHostName() + ":" + msg.getRequestHeader().getHostPort(); if(LOGGER.isDebugEnabled()) { LOGGER.debug("Adding " + app.getName() + " to " + site); } addApplicationsToSite(site, appMatch); this.appMatch = null; } this.currentApp = null; } if(LOGGER.isDebugEnabled()) { LOGGER.debug("Analyse took " + (System.currentTimeMillis() - startTime) + "ms"); } }
Source:
<code><START> public boolean loadSqlCipher(Context context) { <END> try { loadLibs(context); } catch (UnsatisfiedLinkError ule) { return extractAndLoadAgain(context, DATABASE_SQLCIPHER, getSupportedAbis()); } catch (Exception ex) { Log.e(TAG, "Error loading native libraries for Sqlcipher", ex); return false; } return true; }</code><technical_language>This static</technical_language>

Target:
public static boolean loadSqlCipher(Context context) { try { loadLibs(context); } catch (UnsatisfiedLinkError ule) { return extractAndLoadAgain(context, DATABASE_SQLCIPHER, getSupportedAbis()); } catch (Exception ex) { Log.e(TAG, "Error loading native libraries for Sqlcipher", ex); return false; } return true; }
Source:
<code>public ITreeEditor openWithResourceSet(final ResourceSet resourceSet) throws TreeEditorOpenerException { <START> final ResourceImpl newResource = new ResourceImpl(); for (Resource resource : resourceSet.getResources()) { final EList<EObject> contents = resource.getContents(); newResource.getContents().addAll(contents); } <END> return openEditor(newResource); }</code><technical_language>move eObjects another resource this side effect other tools (using resourceSet)</technical_language>

Target:
public ITreeEditor openWithResourceSet(final ResourceSet resourceSet) throws TreeEditorOpenerException { final ResourceSetEditorInput editorInput = new ResourceSetEditorInput( resourceSet); return openEditor(editorInput); }
Source:
<code>Map<String, String> getCanonicalHeaders() { <START> return canonicalHeaders; <END> }</code><technical_language>This exposes mutable internal state. A copy is needed</technical_language>

Target:
Map<String, String> getCanonicalHeaders() { return new HashMap<>(canonicalHeaders); }
Source:
<code>private void makeChangeLogForIndices(List<Index> originalIndices, List<Index> updatedIndices, Library target) throws IOException { Set<String> added = new TreeSet<>(stringifyIndices(updatedIndices)); <START> added.removeAll(originalIndices); <END> Set<String> removed = new TreeSet<>(stringifyIndices(originalIndices)); removed.removeAll(updatedIndices); if (!added.isEmpty() || !removed.isEmpty()) { StringBuilder message = new StringBuilder(); message.append("Indices"); LimsUtils.appendSet(message, removed, "removed"); LimsUtils.appendSet(message, added, " Added"); LibraryChangeLog changeLog = new LibraryChangeLog(); changeLog.setLibrary(target); changeLog.setColumnsChanged("indices"); changeLog.setSummary(message.toString()); changeLog.setTime(new Date()); changeLog.setUser(authorizationManager.getCurrentUser()); changeLogDao.create(changeLog); } }</code><technical_language>removing Index objects a set strings. want do: Set<String> original = stringifyIndices(originalIndices); Set<String> updated = stringifyIndices(updatedIndices); Set<String> added = new TreeSet<>(updated); added.removeAll(original); Set<String> removed = new TreeSet<>(original); removed.removeAll(updated);</technical_language>

Target:
private void makeChangeLogForIndices(List<Index> originalIndices, List<Index> updatedIndices, Library target) throws IOException { Set<String> original = stringifyIndices(originalIndices); Set<String> updated = stringifyIndices(updatedIndices); Set<String> added = new TreeSet<>(updated); added.removeAll(originalIndices); Set<String> removed = new TreeSet<>(original); removed.removeAll(updatedIndices); if (!added.isEmpty() || !removed.isEmpty()) { StringBuilder message = new StringBuilder(); message.append("Indices"); LimsUtils.appendSet(message, removed, "removed"); LimsUtils.appendSet(message, added, (removed.isEmpty() ? "" : "; ") + "added"); LibraryChangeLog changeLog = new LibraryChangeLog(); changeLog.setLibrary(target); changeLog.setColumnsChanged("indices"); changeLog.setSummary(message.toString()); changeLog.setTime(new Date()); changeLog.setUser(authorizationManager.getCurrentUser()); changeLogDao.create(changeLog); } }
Source:
<code>private void testContextLiteral( final SqlOperator operator, final DataContext.Variable variable, final Object value) { Frameworks.withPrepare(new Frameworks.PrepareAction<Void>() { public Void apply(final RelOptCluster cluster, final RelOptSchema relOptSchema, final SchemaPlus rootSchema, final CalciteServerStatement statement) { final RexBuilder rexBuilder = cluster.getRexBuilder(); final RexExecutorImpl executor = new RexExecutorImpl( new SingleValueDataContext(variable.camelName, value)); try { checkConstant(value, new Function<RexBuilder, RexNode>() { public RexNode apply(RexBuilder builder) { List<RexNode> output = new ArrayList<>(); executor.reduce(rexBuilder, ImmutableList.of(rexBuilder.makeCall(operator)), output); return output.get(0); } }); } catch (Exception e) { <START> throw new RuntimeException(e); <END> } return null; } }); }</code><technical_language>a minor note: throw org.apache.calcite.util.TestUtil#rethrow(java.lang.Throwable) rethrow exceptions in test code</technical_language>

Target:
private void testContextLiteral( final SqlOperator operator, final DataContext.Variable variable, final Object value) { Frameworks.withPrepare(new Frameworks.PrepareAction<Void>() { public Void apply(final RelOptCluster cluster, final RelOptSchema relOptSchema, final SchemaPlus rootSchema, final CalciteServerStatement statement) { final RexBuilder rexBuilder = cluster.getRexBuilder(); final RexExecutorImpl executor = new RexExecutorImpl( new SingleValueDataContext(variable.camelName, value)); try { checkConstant(value, builder -> { final List<RexNode> output = new ArrayList<>(); executor.reduce(rexBuilder, ImmutableList.of(rexBuilder.makeCall(operator)), output); return output.get(0); }); } catch (Exception e) { throw TestUtil.rethrow(e); } return null; } }); }
Source:
<code>public void run() { LOG.info("Background ContainerMetadataScanner starting up"); while (!stopping) { scrub(); if (!stopping) { try { <START> Thread.sleep(300000); <END> } catch (InterruptedException e) { LOG.info("Background ContainerMetadataScanner interrupted." + " Going to exit"); } } } }</code><technical_language>This configurable, no</technical_language>

Target:
public void run() { LOG.info("Background ContainerMetadataScanner starting up"); while (!stopping) { long start = System.nanoTime(); scrub(); long interval = TimeUnit.NANOSECONDS.toMillis(System.nanoTime()-start); if (!stopping && interval < metadataScanInterval) { try { Thread.sleep(metadataScanInterval - interval); } catch (InterruptedException e) { LOG.info("Background ContainerMetadataScanner interrupted." + " Going to exit"); } } } }
Source:
<code>public List<String> validateItemTriple(Statement itemTriple) { List<String> invalid = new ArrayList<>(); String subject = itemTriple.getSubject().stringValue(); <START> if (!isValidTripleComponent(subject, VALID_NAMESPACES.entity(), "item")) { <END> invalid.add(subject); } String predicate = itemTriple.getPredicate().stringValue(); if (!isValidTripleComponent(predicate, VALID_NAMESPACES.property(WikibaseUris.PropertyType.CLAIM), "property")) { invalid.add(predicate); } String object = itemTriple.getObject().stringValue(); if (!isValidTripleComponent(object, VALID_NAMESPACES.statement(), "statement")) { invalid.add(object); } return invalid; }</code><technical_language>statements items, properties - validating somewhere</technical_language>

Target:
public List<String> validateItemTriple(Statement itemTriple) { List<String> invalid = new ArrayList<>(); String subject = itemTriple.getSubject().stringValue(); checkNode(subject, VALID_NAMESPACES.entity(), "item", invalid); String predicate = itemTriple.getPredicate().stringValue(); checkNode(predicate, VALID_NAMESPACES.property(WikibaseUris.PropertyType.CLAIM), "property", invalid); String object = itemTriple.getObject().stringValue(); checkNode(object, VALID_NAMESPACES.statement(), "statement", invalid); return invalid; }
Source:
<code>protected HttpContext createHttpContext(HttpMethod httpMethod, URI uri) { <START> HttpHost targetHost = new HttpHost(uri.getHost(), uri.getPort(), uri.getScheme()); <END> BasicScheme basicScheme = new BasicScheme(); BasicAuthCache authCache = new BasicAuthCache(); authCache.put(targetHost, basicScheme); BasicHttpContext localContext = new BasicHttpContext(); localContext.setAttribute(ClientContext.AUTH_CACHE, authCache); return createHttpContext(localContext); }</code><technical_language>this configurable in properties file, a property called http.auth.preemptive=true/false</technical_language>

Target:
protected HttpContext createHttpContext(HttpMethod httpMethod, URI uri) { BasicHttpContext localContext = new BasicHttpContext(); if (Boolean.valueOf(settings.getProperty(HTTP_AUTH_PREEMPTIVE))) { HttpHost targetHost = new HttpHost(uri.getHost(), uri.getPort(), uri.getScheme()); BasicScheme basicScheme = new BasicScheme(); BasicAuthCache authCache = new BasicAuthCache(); authCache.put(targetHost, basicScheme); localContext.setAttribute(ClientContext.AUTH_CACHE, authCache); } return createHttpContext(localContext); }
Source:
<code>public synchronized void stop(StopContext context) { <START> context.asynchronous(); <END> final DeploymentScanner scanner = this.scanner; this.scanner = null; scanner.stopScanner(); scheduledExecutorValue.getValue().shutdown(); if (callbackHandle != null) { callbackHandle.remove(); } context.complete(); }</code><technical_language>I super familiar this usage pattern 1) inject executor 2) Call context.asynchronous() 3) Perform work block in a Runnable 4) Call context context.complete() end of Runnable i.e. heavy work happen in a thread</technical_language>

Target:
public synchronized void stop(StopContext context) { final DeploymentScanner scanner = this.scanner; this.scanner = null; scanner.stopScanner(); scheduledExecutorValue.getValue().shutdown(); if (callbackHandle != null) { callbackHandle.remove(); } }
Source:
<code>public Object visitKeySetCommand(InvocationContext ctx, KeySetCommand command) throws Throwable { Object keys = super.visitKeySetCommand(ctx, command); if (enabled && !shouldSkipCacheLoader(command)) { Set<Object> keysSet = (Set<Object>) keys; <START> final ConcurrentHashSet<Object> union = new ConcurrentHashSet<Object>(keysSet.size()); <END> union.addAll(keysSet); persistenceManager.processOnAllStores(new CollectionKeyFilter(union), new AdvancedCacheLoader.CacheLoaderTask() { @Override public void processEntry(MarshalledEntry marshalledEntry, AdvancedCacheLoader.TaskContext taskContext) throws InterruptedException { union.add(marshalledEntry.getKey()); } }, false, false); return Collections.unmodifiableSet(union); } return keys; }</code><technical_language>int is concurrency level size of collection, default constructor. of declared ConcurrentHashSet, I nicer declare Set instead - is API difference prefer interfaces</technical_language>

Target:
public Object visitKeySetCommand(InvocationContext ctx, KeySetCommand command) throws Throwable { Object keys = super.visitKeySetCommand(ctx, command); if (enabled && !shouldSkipCacheLoader(command)) { Set<Object> keysSet = (Set<Object>) keys; final ConcurrentHashSet<Object> union = new ConcurrentHashSet<Object>(); for (Object k : keysSet) union.add(k); persistenceManager.processOnAllStores(new CollectionKeyFilter(union), new AdvancedCacheLoader.CacheLoaderTask() { @Override public void processEntry(MarshalledEntry marshalledEntry, AdvancedCacheLoader.TaskContext taskContext) throws InterruptedException { union.add(marshalledEntry.getKey()); } }, false, false); return Collections.unmodifiableSet(union); } return keys; }
Source:
<code>public void testSslWithClientAuthenticationFailsWithoutProperServerTrustStore() { SslConfiguration serverConfig = SslConfiguration.builder() .trustStorePath(TestConstants.SERVER_KEY_STORE_JKS_PATH) .keyStorePath(TestConstants.SERVER_KEY_STORE_JKS_PATH) .keyStorePassword(TestConstants.SERVER_KEY_STORE_JKS_PASSWORD) .build(); SslConfiguration clientConfig = SslConfiguration.builder() .trustStorePath(TestConstants.CLIENT_KEY_STORE_JKS_PATH) .build(); try { <START> runSslConnectionTest(serverConfig, clientConfig, false); <END> fail(); } catch (RuntimeException ex) { assertThat(ex.getCause(), is(instanceOf(SSLHandshakeException.class))); assertThat(ex.getMessage(), containsString("PKIX path building failed")); } }</code><technical_language>this true test is WithClientAuthentication</technical_language>

Target:
public void testSslWithClientAuthenticationFailsWithoutProperServerTrustStore() { TrustStoreConfiguration serverTrustStoreConfig = TrustStoreConfiguration.of( TestConstants.SERVER_KEY_STORE_JKS_PATH); KeyStoreConfiguration serverKeyStoreConfig = KeyStoreConfiguration.of( TestConstants.SERVER_KEY_STORE_JKS_PATH, TestConstants.SERVER_KEY_STORE_JKS_PASSWORD); SslConfiguration serverConfig = SslConfiguration.of(serverTrustStoreConfig, serverKeyStoreConfig); TrustStoreConfiguration clientTrustStoreConfig = TrustStoreConfiguration.of(TestConstants.CA_TRUST_STORE_PATH); KeyStoreConfiguration clientKeyStoreConfig = KeyStoreConfiguration.of( TestConstants.CLIENT_KEY_STORE_JKS_PATH, TestConstants.CLIENT_KEY_STORE_JKS_PASSWORD); SslConfiguration clientConfig = SslConfiguration.of(clientTrustStoreConfig, clientKeyStoreConfig); try { runSslConnectionTest(serverConfig, clientConfig, ClientAuth.WITH_CLIENT_AUTH); fail(); } catch (RuntimeException ex) { assertThat(ex.getCause(), is(instanceOf(SSLHandshakeException.class))); assertThat(ex.getMessage(), containsString("bad_certificate")); } }
Source:
<code>public AsyncTableLayoutUpdater( final AsyncKiji kiji, final KijiURI tableURI, final TableLayoutDesc layoutUpdate <START> ) <END> throws IOException, KeeperException { this(kiji, tableURI, new Function<KijiTableLayout, TableLayoutDesc>() { @Override public TableLayoutDesc apply(KijiTableLayout input) { return layoutUpdate; } }); }</code><technical_language>line: ) throws ..</technical_language>

Target:
public AsyncTableLayoutUpdater( final AsyncKiji kiji, final KijiURI tableURI, final TableLayoutDesc layoutUpdate ) throws IOException { this(kiji, tableURI, new Function<KijiTableLayout, TableLayoutDesc>() { @Override public TableLayoutDesc apply(KijiTableLayout input) { return layoutUpdate; } }); }
Source:
<code><START> protected void doGet(final HttpServletRequest req, final HttpServletResponse resp) <END> throws ServletException, IOException { resp.setStatus(HttpServletResponse.SC_OK); resp.setContentType(TextFormat.contentType004); Writer writer = resp.getWriter(); TextFormat.write004(writer, registry.metricFamilySamples()); writer.flush(); writer.close(); }</code><technical_language>A test nice here. If TextFormat interface static methods mocked</technical_language>

Target:
protected void doGet(final HttpServletRequest req, final HttpServletResponse resp) throws ServletException, IOException { resp.setStatus(HttpServletResponse.SC_OK); resp.setContentType(TextFormat.CONTENT_TYPE_004); Writer writer = resp.getWriter(); TextFormat.write004(writer, registry.metricFamilySamples()); writer.flush(); writer.close(); }
Source:
<code>String join(String... packageNames) { <START> checkNonNullArgument(packageNames, "'packageNames' cannot be null"); <END> return Stream.of(packageNames).collect(Collectors.joining(",")); }</code><technical_language>compiler guarantees this is null</technical_language>

Target:
String join(String... packageNames) { requireNonNull(packageNames, "'packageNames' cannot be null"); return Stream.of(packageNames).collect(Collectors.joining(",")); }
Source:
<code>public void testOpenSSL() throws IOException { assumeTrue(NativeCodeLoader.buildSupportsOpenssl()); Configuration conf = new Configuration(); conf.setEnum(Constants.SSL_CHANNEL_MODE, OpenSSLSocketFactory.SSLChannelMode.OpenSSL); <START> S3AFileSystem fs = S3ATestUtils.createTestFileSystem(conf); <END> writeThenReadFile(fs, path("ITestS3ASSL/testOpenSSL")); }</code><technical_language>in try-with-resources avoid leaking FS instances</technical_language>

Target:
public void testOpenSSL() throws IOException { assumeTrue(NativeCodeLoader.buildSupportsOpenssl()); Configuration conf = new Configuration(getConfiguration()); conf.setEnum(Constants.SSL_CHANNEL_MODE, OpenSSLSocketFactory.SSLChannelMode.OpenSSL); try (S3AFileSystem fs = S3ATestUtils.createTestFileSystem(conf)) { writeThenReadFile(fs, path("ITestS3ASSL/testOpenSSL")); } }
Source:
<code>public ContainerInfo inspectContainer(String container) throws IOException { ContainerInfo info = super.inspectContainer(container); if (info == null) { return null; } Pod pod = getChePodByContainerId(info.getId()); if (pod == null ) { <START> LOG.warn("No Pod found by container ID " + info.getId()); <END> return null; } String deploymentName = pod.getMetadata().getLabels().get(OPENSHIFT_DEPLOYMENT_LABEL); if (deploymentName == null ) { LOG.warn("No label " + OPENSHIFT_DEPLOYMENT_LABEL + " found for Pod " + pod.getMetadata().getName()); return null; } Service svc = getCheServiceBySelector(OPENSHIFT_DEPLOYMENT_LABEL, deploymentName); if (svc == null) { LOG.warn("No Service found by selector " + OPENSHIFT_DEPLOYMENT_LABEL + "=" + deploymentName); return null; } Map<String, String> annotations = kubernetesLabelConverter.namesToLabels(svc.getMetadata().getAnnotations()); Map<String, String> containerLabels = info.getConfig().getLabels(); Map<String, String> labels = Stream.concat(annotations.entrySet().stream(), containerLabels.entrySet().stream()) .filter(e -> e.getKey().startsWith(kubernetesLabelConverter.getCheServerLabelPrefix())) .collect(Collectors.toMap(e -> e.getKey(), e -> e.getValue())); info.getConfig().setLabels(labels); LOG.info("Container labels:"); info.getConfig().getLabels().entrySet() .stream().forEach(e -> LOG.info("- " + e.getKey() + "=" + e.getValue())); replaceNetworkSettings(info); return info; }</code><technical_language>{} parameters instead of string concatenation</technical_language>

Target:
public ContainerInfo inspectContainer(String container) throws IOException { ContainerInfo info = super.inspectContainer(container); if (info == null) { return null; } Pod pod = getChePodByContainerId(info.getId()); if (pod == null ) { LOG.warn("No Pod found by container ID {}", info.getId()); return null; } String deploymentName = pod.getMetadata().getLabels().get(OPENSHIFT_DEPLOYMENT_LABEL); if (deploymentName == null ) { LOG.warn("No label found for Pod {}", OPENSHIFT_DEPLOYMENT_LABEL, pod.getMetadata().getName()); return null; } Service svc = getCheServiceBySelector(OPENSHIFT_DEPLOYMENT_LABEL, deploymentName); if (svc == null) { LOG.warn("No Service found by selector {}={}", OPENSHIFT_DEPLOYMENT_LABEL, deploymentName); return null; } Map<String, String> annotations = kubernetesLabelConverter.namesToLabels(svc.getMetadata().getAnnotations()); Map<String, String> containerLabels = info.getConfig().getLabels(); Map<String, String> labels = Stream.concat(annotations.entrySet().stream(), containerLabels.entrySet().stream()) .filter(e -> e.getKey().startsWith(kubernetesLabelConverter.getCheServerLabelPrefix())) .collect(Collectors.toMap(e -> e.getKey(), e -> e.getValue())); info.getConfig().setLabels(labels); LOG.info("Container labels:"); info.getConfig().getLabels().entrySet() .stream().forEach(e -> LOG.info("- {}={}", e.getKey(), e.getValue())); replaceNetworkSettings(info); return info; }
Source:
<code>public void updateStockPrice(String symbol, double newPrice) throws StockMarketExpection { <START> if (getStockForSymbol(symbol) == null) { throw new StockMarketExpection("Stock not present (" + symbol + ")"); } if (newPrice < 0.0) { throw new StockMarketExpection( "Stock price cannot be set to a negative value (" + symbol + ", " + getStockForSymbol(symbol).getPrice() + ") -> " + newPrice + " X Not Allowed "); } <END> Stock StockToUpdate = removeStockFromStockList(symbol); StockToUpdate.setPrice(newPrice); addStock(StockToUpdate); }</code><technical_language>parts extracted</technical_language>

Target:
public void updateStockPrice(String symbol, double newPrice) throws StockMarketExpection { datacheck(String symbol, double newPrice) Stock StockToUpdate = removeStockFromStockList(symbol); StockToUpdate.setPrice(newPrice); addStock(StockToUpdate); }
Source:
<code>private Action toAction() { try { <START> return new ActionImpl(getId(), title, description != null ? description : "", new URL(url)); <END> } catch (MalformedURLException e) { LOGGER.debug("Unable to parse the action url: url={}", url, e); return null; } }</code><technical_language>description setter handle null-checking logic do here</technical_language>

Target:
private Action toAction() { try { return new ActionImpl(getId(), title, description, new URL(url)); } catch (MalformedURLException e) { LOGGER.debug("Unable to parse the action url: url={}", url, e); return null; } }
Source:
<code>public void testGetResourceBundleNoResourceBundle() { String resourcePath = "/path/to/resource"; <START> Locale locale = Locale.getDefault(); <END> setupGetResourceBundleTest( resourcePath, locale ); ResourceBundle actualResourceBundle = this.pwpLocalizationService .getResourceBundle( getModuleID( "/path/to/other/resource" ), locale.toLanguageTag() ); assertNull( actualResourceBundle ); }</code><technical_language>@davidmsantos90 a fixed Locale? getDefault() varies form computer computer is want test in this test</technical_language>

Target:
public void testGetResourceBundleNoResourceBundle() { String resourcePath = "/path/to/resource"; Locale locale = Locale.ENGLISH; setupGetResourceBundleTest( resourcePath, locale ); ResourceBundle actualResourceBundle = this.pwpLocalizationService .getResourceBundle( getModuleID( "/path/to/other/resource" ), locale.toLanguageTag() ); assertNull( actualResourceBundle ); }
Source:
<code>public Change perform(IProgressMonitor pm) throws CoreException { pm.beginTask("", 1); try { ITestSuite suiteCopy = (ITestSuite) getTestSuite().getWorkingCopy( new NullProgressMonitor()); List<TestSuiteItem> references = getReferences(suiteCopy); Map<Integer, TestSuiteItem> deletedItems = new HashMap<Integer, TestSuiteItem>(); for (TestSuiteItem item : references) { int idx = suiteCopy.getTestSuite().getItems().indexOf(item); deletedItems.put(idx, item); } try { TestSuite suiteNamedElement = (TestSuite) suiteCopy .getModifiedNamedElement(); for (TestSuiteItem item : references) { suiteNamedElement.getItems().remove(item); } WriteAccessChecker writeAccessChecker = new WriteAccessChecker(); <START> if (writeAccessChecker.makeResourceWritable(suiteCopy)) { <END> suiteCopy.commitWorkingCopy(true, new NullProgressMonitor()); } } finally { suiteCopy.discardWorkingCopy(); } return new UndoDeleteTestReferenceChange(getTestSuite(), getQ7Element(), deletedItems); } finally { pm.done(); } }</code><technical_language>questions refactoring progress</technical_language>

Target:
public Change perform(IProgressMonitor pm) throws CoreException { pm.beginTask("", 1); try { ITestSuite suiteCopy = (ITestSuite) getTestSuite().getWorkingCopy( new NullProgressMonitor()); List<TestSuiteItem> references = getReferences(suiteCopy); Map<Integer, TestSuiteItem> deletedItems = new HashMap<Integer, TestSuiteItem>(); for (TestSuiteItem item : references) { int idx = suiteCopy.getTestSuite().getItems().indexOf(item); deletedItems.put(idx, item); } try { TestSuite suiteNamedElement = (TestSuite) suiteCopy .getModifiedNamedElement(); for (TestSuiteItem item : references) { suiteNamedElement.getItems().remove(item); } suiteCopy.commitWorkingCopy(true, new NullProgressMonitor()); } finally { suiteCopy.discardWorkingCopy(); } return new UndoDeleteTestReferenceChange(getTestSuite(), getQ7Element(), deletedItems); } finally { pm.done(); } }
Source:
<code>public void testCanGetConfiguredZones() { HttpRequest authenticate = HttpRequest.builder().method("POST") .endpoint("<LINK_0>") .addHeader("Accept", "application/json") .payload(payloadFromStringWithContentType( "{\"auth\":{\"passwordCredentials\":{\"username\":\"myUsername\", \"password\":\"myPassword\"}, \"tenantName\":\"myTenantName\"}}" <START> , "application/json")).build(); <END> HttpResponse authenticationResponse = HttpResponse.builder() .statusCode(200) .payload(payloadFromResourceWithContentType("/access_hpcloud.json", "application/json")) .build(); CinderApi whenNovaRegionExists = requestSendsResponse(authenticate, authenticationResponse); assertEquals(whenNovaRegionExists.getConfiguredZones(), ImmutableSet.of("region-a.geo-1", "region-b.geo-1")); }</code><technical_language>this test consistent default authentication type, change api key credentials</technical_language>

Target:
public void testCanGetConfiguredZones() { HttpRequest authenticate = HttpRequest.builder().method("POST") .endpoint("<LINK_0>") .addHeader("Accept", "application/json") .payload(payloadFromResourceWithContentType("/auth_post_req.json", "application/json")) .build(); HttpResponse authenticationResponse = HttpResponse.builder() .statusCode(200) .payload(payloadFromResourceWithContentType("/access_hpcloud.json", "application/json")) .build(); CinderApi whenNovaRegionExists = requestSendsResponse(authenticate, authenticationResponse); assertEquals(whenNovaRegionExists.getConfiguredZones(), ImmutableSet.of("region-a.geo-1", "region-b.geo-1")); }
Source:
<code>public PayloadSlice(Payload payload, ContentRange range, int part) { this.payload = checkNotNull(payload, "payload"); this.range = checkNotNull(range, "range"); <START> this.part = part; <END> }</code><technical_language>checkArgument for negative numbers</technical_language>

Target:
public PayloadSlice(Payload payload, ContentRange range, int part) { this.payload = checkNotNull(payload, "payload"); this.range = checkNotNull(range, "range"); checkArgument(part >= 0, "The part number cannot be negative"); this.part = part; }
Source:
<code>public static void <START> setSharedIndexLocation(String <END> value, Class<?> clazz) { if (clazz != null && "org.eclipse.jdt.core.tests.model.JavaIndexTests".equals(clazz.getName())) { SHARED_INDEX_LOCATION = value; } }</code><technical_language>IllegalArgumentException thrown</technical_language>

Target:
public static void setSharedIndexLocation(String value, Class<?> clazz) throws IllegalArgumentException{ if (clazz != null && "org.eclipse.jdt.core.tests.model.JavaIndexTests".equals(clazz.getName())) { SHARED_INDEX_LOCATION = value; } else { throw new IllegalArgumentException("Cannot set index location for specified test class"); } }
Source:
<code>private void maintainDepth(JsonToken currentToken) { if (currentToken == JsonToken.START_ARRAY || currentToken == JsonToken.START_OBJECT) { depth++; } if (currentToken == JsonToken.END_ARRAY || currentToken == JsonToken.END_OBJECT) { depth--; <START> } <END> }</code><technical_language>a switch easier understand? cases treated fall through, in: switch(currentToken) { case START_ARRAY: case START_OBJECT: depth++; break; ... }</technical_language>

Target:
private void maintainDepth(JsonToken currentToken) { switch(currentToken) { case START_OBJECT: case START_ARRAY: depth++; break; case END_OBJECT: case END_ARRAY: depth--; break; } }
Source:
<code>public void testExceptionSuppression() throws Exception { Cache<String, String> cache1 = cache(0, CACHE_NAME); Cache<String, String> cache2 = cache(1, CACHE_NAME); <START> assert cache1.getAdvancedCache().addInterceptorBefore(new CommandInterceptor() { <END> @Override public Object visitPutKeyValueCommand(InvocationContext ctx, PutKeyValueCommand command) throws Throwable { throw new RuntimeException("Barf!"); } @Override public Object visitRemoveCommand(InvocationContext ctx, RemoveCommand command) throws Throwable { throw new RuntimeException("Barf!"); } }, CallInterceptor.class); try { cache1.put(key, value); fail("Should have barfed"); } catch (RuntimeException re) { } try { cache1.remove(key); fail("Should have barfed"); } catch (RuntimeException re) { } assertNull("Should have cleaned up", cache1.get(key)); assertNull("Should have cleaned up", cache1.getAdvancedCache().getDataContainer().get(key)); assertNull("Should have cleaned up", cache2.get(key)); assertNull("Should have cleaned up", cache2.getAdvancedCache().getDataContainer().get(key)); cache1.putForExternalRead(key, value); }</code><technical_language>another note: want new command interceptor in testKeyOnlyWrittenOnceOnOriginator</technical_language>

Target:
public void testExceptionSuppression() throws Exception { Cache<String, String> cache1 = cache(0, CACHE_NAME); Cache<String, String> cache2 = cache(1, CACHE_NAME); assertTrue(cache1.getAdvancedCache().getSequentialInterceptorChain().addInterceptorBefore(new BaseSequentialInterceptor() { @Override public CompletableFuture<Void> visitCommand(InvocationContext ctx, VisitableCommand command) throws Throwable { if (command instanceof PutKeyValueCommand || command instanceof RemoveCommand) { throw new RuntimeException("Barf!"); } return ctx.continueInvocation(); } }, CallInterceptor.class)); try { cache1.put(key, value); fail("Should have barfed"); } catch (RuntimeException re) { } try { cache1.remove(key); fail("Should have barfed"); } catch (RuntimeException re) { } assertNull("Should have cleaned up", cache1.get(key)); assertNull("Should have cleaned up", cache1.getAdvancedCache().getDataContainer().get(key)); assertNull("Should have cleaned up", cache2.get(key)); assertNull("Should have cleaned up", cache2.getAdvancedCache().getDataContainer().get(key)); cache1.putForExternalRead(key, value); }
Source:
<code>public static URLClassLoader loadLegacyJar() throws MalformedURLException { <START> return new URLClassLoader(new URL[] {Common.MA_HOME_PATH.resolve("libs/h2-1.4.196.jar").toUri().toURL()}); <END> }</code><technical_language>this "boot/h2-1.4.196.jar"</technical_language>

Target:
public static URLClassLoader loadLegacyJar() throws MalformedURLException { return new URLClassLoader(new URL[] {Common.MA_HOME_PATH.resolve("boot/h2-1.4.196.jar").toUri().toURL()}); }
Source:
<code><START> public static <T> GenericMapMapper<T> getMapperForValueType(Class<T> valueType, ConfigRegistry config) { <END> return config.get(ColumnMappers.class) .findFor(valueType) .map(GenericMapMapper::new) .orElseThrow(() -> new RuntimeException("no column mapper found for type " + valueType)); }</code><technical_language>This return RowMapper<String, T></technical_language>

Target:
public static <T> RowMapper<Map<String, T>> getMapperForValueType(Class<T> valueType, ConfigRegistry config) { return config.get(ColumnMappers.class) .findFor(valueType) .map(GenericMapMapper::new) .orElseThrow(() -> new RuntimeException("no column mapper found for type " + valueType)); }
Source:
<code>private void testSanitization() throws IOException { ______TS("Test sanitization for edit page"); instructorId = testData.accounts.get("instructor1OfTestingSanitizationCourse").googleId; FeedbackSessionAttributes session = testData.feedbackSessions.get("session1InTestingSanitizationCourse"); courseId = session.getCourseId(); feedbackSessionName = session.getFeedbackSessionName(); feedbackEditPage = getFeedbackEditPage(); <START> feedbackEditPage.verifyHtmlMainContent("instructorFeedbackEditPageTestingSanitization.html"); <END> ______TS("Test sanitization for copy question modal"); feedbackEditPage.clickCopyButton(); feedbackEditPage.waitForCopyTableToLoad(); feedbackEditPage.verifyHtmlPart(By.id("copyModal"), "/instructorFeedbackCopyQuestionModalTestingSanitization.html"); }</code><technical_language>/ is missing file name. a result, file is in root directory. :rofl:</technical_language>

Target:
private void testSanitization() throws IOException { ______TS("Test sanitization for edit page"); instructorId = testData.accounts.get("instructor1OfTestingSanitizationCourse").googleId; FeedbackSessionAttributes session = testData.feedbackSessions.get("session1InTestingSanitizationCourse"); courseId = session.getCourseId(); feedbackSessionName = session.getFeedbackSessionName(); feedbackEditPage = getFeedbackEditPage(); feedbackEditPage.verifyHtmlMainContent("/instructorFeedbackEditPageTestingSanitization.html"); ______TS("Test sanitization for copy question modal"); feedbackEditPage.clickCopyButton(); feedbackEditPage.waitForCopyTableToLoad(); feedbackEditPage.verifyHtmlPart(By.id("copyModal"), "/instructorFeedbackCopyQuestionModalTestingSanitization.html"); }
Source:
<code>protected void done() { try { get(); } catch (InterruptedException | ExecutionException ex) { domainWrapper.setThumnail(null); logger.log(Level.WARNING, "Document Worker Exception", ex); } catch (CancellationException ignored) { domainWrapper.setThumnail(null); } <START> documentPreviewViewer.repaint(); <END> }</code><technical_language>Cut paste error</technical_language>

Target:
protected void done() { try { get(); } catch (InterruptedException | ExecutionException ex) { domainWrapper.setThumbnail(null); logger.log(Level.WARNING, "Document Worker Exception", ex); } catch (CancellationException ignored) { domainWrapper.setThumbnail(null); } domainSummaryViewer.repaint(); }
Source:
<code>public void scheduleOnDemandRebalance(long delay) { if (_helixManager == null) { <START> logger.warn("Failed to schedule a future pipeline run for cluster {}. Helix manager is null!", <END> _clusterName); return; } long current = System.currentTimeMillis(); long rebalanceTime = current + delay; if (delay > 0) { RebalanceTask preTask = _nextRebalanceTask.get(); if (preTask != null && preTask.getNextRebalanceTime() > current && preTask.getNextRebalanceTime() < rebalanceTime) { return; } } RebalanceTask newTask = new RebalanceTask(_helixManager, ClusterEventType.OnDemandRebalance, rebalanceTime); _onDemandRebalanceTimer.schedule(newTask, delay); logger.info("Scheduled instant pipeline run for cluster {}." , _helixManager.getClusterName()); RebalanceTask preTask = _nextRebalanceTask.getAndSet(newTask); if (preTask != null) { preTask.cancel(); } }</code><technical_language>This ERROR</technical_language>

Target:
public void scheduleOnDemandRebalance(long delay) { if (_helixManager == null) { logger.error("Failed to schedule a future pipeline run for cluster {}. Helix manager is null!", _clusterName); return; } long currentTime = System.currentTimeMillis(); long rebalanceTime = currentTime + delay; if (delay > 0) { RebalanceTask preTask = _nextRebalanceTask.get(); if (preTask != null && preTask.getNextRebalanceTime() > currentTime && preTask.getNextRebalanceTime() < rebalanceTime) { return; } } RebalanceTask newTask = new RebalanceTask(_helixManager, ClusterEventType.OnDemandRebalance, rebalanceTime); _onDemandRebalanceTimer.schedule(newTask, delay); logger.info("Scheduled instant pipeline run for cluster {}." , _helixManager.getClusterName()); RebalanceTask preTask = _nextRebalanceTask.getAndSet(newTask); if (preTask != null) { preTask.cancel(); } }
Source:
<code>private void send(String data) { if (socket == null) { try { <START> log.info(String.format("Connecting to ATSD at %s:%s", serverName, port)); <END> socket = recreateSocket(); writer = recreateWriter(socket); } catch (IOException e) { throw new AtsdClientException( String.format("Error while connecting to ATSD at %s:%s", serverName, port), e); } } try { writer.write(data); writer.flush(); return; } catch (Exception e) { log.warn(String.format( "Error while sending commands to ATSD at %s:%s. Trying to reconnect", serverName, port), e); } try { socket = recreateSocket(); writer = recreateWriter(socket); writer.write(data); writer.flush(); } catch (Exception e) { throw new AtsdClientException( String.format("Error while sending command to ATSD at %s:%s", serverName, port), e); } }</code><technical_language>Slf4j API: log.info("Connecting ATSD {}:{}", serverName, port);</technical_language>

Target:
private void send(String data) { if (socket == null) { try { log.info("Connecting to ATSD at {}:{}", serverName, port); socket = recreateSocket(); writer = recreateWriter(socket); } catch (IOException e) { throw new AtsdClientException( String.format("Error while connecting to ATSD at %s:%s", serverName, port), e); } } try { writeData(data); return; } catch (Exception e) { log.warn("Error while sending commands to ATSD at {}:{}. Trying to reconnect", serverName, port, e); } try { socket = recreateSocket(); writer = recreateWriter(socket); writeData(data); } catch (Exception e) { throw new AtsdClientException( String.format("Error while sending command to ATSD at %s:%s", serverName, port), e); } }