auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>public void scmSourceShouldContainCorrectData() { <START> given().when().get(VERSION_RESOURCE).then().statusCode(HttpStatus.SC_OK).body(is(new Matcher<Object>() { <END> String error = null; @Override public boolean matches(final Object item) { try { final Map info = mapper.readValue( new ByteArrayInputStream(item.toString().getBytes()), Map.class); if (null == info) { error = "Failed to read data from version " + item; return false; } else { final Map scmSource = (Map) info.get("scm_source"); if (null == scmSource) { error = "Scm source is not specified in " + item; return false; } for (final String key : new String[]{"revision", "url", "author"}) { final String value = (String) scmSource.get(key); if (StringUtils.isEmpty(value)) { error = "field scm_source." + key + " is " + value + ", but content expected"; return false; } } if (scmSource.get("status") == null) { error = "scm_source.status field in null"; return false; } return true; } } catch (final IOException e) { error = "Failed to read versionInfo from json: " + e.getMessage(); return false; } } @Override public void describeMismatch(Object item, Description mismatchDescription) { mismatchDescription.appendText("Error: " + error + " for " + item); } @Override public void _dont_implement_Matcher___instead_extend_BaseMatcher_() { } @Override public void describeTo(Description description) { description.appendText(error); } })); }</code><technical_language>I expected a custom matcher for assertions. check if json structure matches expected one, right? achieve some existing json matcher</technical_language>

Target:
public void scmSourceShouldContainCorrectData() { given().when().get(VERSION_RESOURCE).then() .assertThat().statusCode(HttpStatus.SC_OK) .and().assertThat().body("scm_source.revision", allOf(notNullValue(), not(""))) .and().assertThat().body("scm_source.url", allOf(notNullValue(), not(""))) .and().assertThat().body("scm_source.author", allOf(notNullValue(), not(""))) .and().assertThat().body("scm_source.status", notNullValue()); }
Source:
<code>public void refresh() { nativeRefresh(nativePtr); <START> invokeListenerIfSchemaChanged(); <END> }</code><technical_language>Realm Object Store's Realm::add_schema_change_handler() for useful here</technical_language>

Target:
public void refresh() { nativeRefresh(nativePtr); invokeSchemaChangeListenerIfSchemaChanged(); }
Source:
<code>private IAction createHierarchicalAction() { IAction action = new Action(Messages.ControlFlowView_hierarchicalViewLabel, IAction.AS_RADIO_BUTTON) { @Override public void run() { <START> ITmfTrace parentTrace = getTrace(); synchronized (fFlatTraces) { fFlatTraces.remove(parentTrace); for (ITmfTrace trace : TmfTraceManager.getTraceSet(parentTrace)) { final ITmfStateSystem ss = TmfStateSystemAnalysisModule.getStateSystem(trace, KernelAnalysisModule.ID); for (TimeGraphEntry traceEntry : getEntryList(ss)) { List<ControlFlowEntry> currentRootList = traceEntry.getChildren().stream() .filter(e -> e instanceof ControlFlowEntry) .map(e -> (ControlFlowEntry) e) .collect(Collectors.toList()); addEntriesToHierarchicalTree(currentRootList, traceEntry); } } } <END> refresh(); } }; action.setChecked(true); action.setToolTipText(Messages.ControlFlowView_hierarchicalViewToolTip); return action; }</code><technical_language>please for symmetry's sake extract this too</technical_language>

Target:
private IAction createHierarchicalAction() { IAction action = new Action(Messages.ControlFlowView_hierarchicalViewLabel, IAction.AS_RADIO_BUTTON) { @Override public void run() { ITmfTrace parentTrace = getTrace(); synchronized (fFlatTraces) { fFlatTraces.remove(parentTrace); List<@NonNull TimeGraphEntry> entryList = getEntryList(parentTrace); if (entryList != null) { for (TimeGraphEntry traceEntry : entryList) { addEntriesToHierarchicalTree(Iterables.filter(traceEntry.getChildren(), ControlFlowEntry.class), traceEntry); } } } refresh(); } }; action.setChecked(true); action.setToolTipText(Messages.ControlFlowView_hierarchicalViewToolTip); return action; }
Source:
<code>public void spec307_afterSubscriptionIsCancelledAdditionalCancelationsMustBeNops_shouldFailBy_unexpectedErrorInCancelling() throws Throwable { requireTestFailure(new ThrowingRunnable() { @Override public void run() throws Throwable { customPublisherVerification(new Publisher<Integer>() { @Override public void subscribe(final Subscriber<? super Integer> s) { s.onSubscribe(new Subscription() { @Override public void request(long n) { } @Override public void cancel() { <START> s.onError(new RuntimeException("Invalid, don't do this!")); END> } }); } }).spec307_afterSubscriptionIsCancelledAdditionalCancelationsMustBeNops(); } }, "Async error during test execution: Invalid, don't do this!"); }</code><technical_language>improve this message</technical_language>

Target:
public void spec307_afterSubscriptionIsCancelledAdditionalCancelationsMustBeNops_shouldFailBy_unexpectedErrorInCancelling() throws Throwable { requireTestFailure(new ThrowingRunnable() { @Override public void run() throws Throwable { customPublisherVerification(new Publisher<Integer>() { @Override public void subscribe(final Subscriber<? super Integer> s) { s.onSubscribe(new Subscription() { @Override public void request(long n) { } @Override public void cancel() { s.onError(new TestException()); } }); } }).spec307_afterSubscriptionIsCancelledAdditionalCancelationsMustBeNops(); } }, "Async error during test execution: Test Exception: Boom!"); }
Source:
<code>public MetadataSchema getSchema(@PathParam("schema_prefix") String schemaPrefix, @QueryParam("expand") @DefaultValue("fields") String expand, @QueryParam("userIP") String user_ip, @QueryParam("userAgent") String user_agent, @QueryParam("xforwarderfor") String xforwarderfor, @Context HttpHeaders headers, @Context HttpServletRequest request) throws WebApplicationException { log.info("Reading metadata schemas."); org.dspace.core.Context context = null; MetadataSchema metadataSchema = null; try { context = createContext(getUser(headers)); org.dspace.content.MetadataSchema schema = metadataSchemaService.find(context, schemaPrefix); metadataSchema = new MetadataSchema(schema, expand, context); if (schema == null) { log.error(String.format("Schema not found for index %s", schemaPrefix)); throw new WebApplicationException(Response.Status.NOT_FOUND); } context.complete(); } catch (SQLException e) { processException("Could not read metadata schema, SQLException. Message:" + e, context); <START> log.error(e.getMessage()); <END> throw new WebApplicationException(Response.Status.INTERNAL_SERVER_ERROR); } catch (ContextException e) { processException("Could not read metadata schema, ContextException. Message:" + e.getMessage(), context); } finally { processFinally(context); } log.trace("Metadata schemas successfully read."); return metadataSchema; }</code><technical_language>log stacktrace, is useful in a lot of cases</technical_language>

Target:
public MetadataSchema getSchema(@PathParam("schema_prefix") String schemaPrefix, @QueryParam("expand") @DefaultValue("fields") String expand, @QueryParam("userIP") String user_ip, @QueryParam("userAgent") String user_agent, @QueryParam("xforwarderfor") String xforwarderfor, @Context HttpHeaders headers, @Context HttpServletRequest request) throws WebApplicationException { log.info("Reading metadata schemas."); org.dspace.core.Context context = null; MetadataSchema metadataSchema = null; try { context = createContext(getUser(headers)); org.dspace.content.MetadataSchema schema = metadataSchemaService.find(context, schemaPrefix); metadataSchema = new MetadataSchema(schema, expand, context); if (schema == null) { processException(String.format("Schema not found for index %s", schemaPrefix), context); } context.complete(); } catch (SQLException e) { processException("Could not read metadata schema, SQLException. Message:" + e, context); } catch (ContextException e) { processException("Could not read metadata schema, ContextException. Message:" + e.getMessage(), context); } finally { processFinally(context); } log.trace("Metadata schemas successfully read."); return metadataSchema; }
Source:
<code>public final List<JSONObject> handle(R photonRequest) { TagFilterQueryBuilder queryBuilder = buildQuery(photonRequest); Integer limit = photonRequest.getLimit(); SearchResponse results = elasticsearchSearcher.search(queryBuilder.buildQuery(), limit); if (results.getHits().getTotalHits() == 0) { <START> results = elasticsearchSearcher.search(queryBuilder.withStrictMatch().buildQuery(), limit); <END> } List<JSONObject> resultJsonObjects = new ConvertToJson(photonRequest.getLanguage()).convert(results); StreetDupesRemover streetDupesRemover = new StreetDupesRemover(photonRequest.getLanguage()); resultJsonObjects = streetDupesRemover.execute(resultJsonObjects); if (resultJsonObjects.size() > limit) { resultJsonObjects = resultJsonObjects.subList(0, limit); } return resultJsonObjects; }</code><technical_language>other around? a strict match query. if is match, a strict query</technical_language>

Target:
public final List<JSONObject> handle(R photonRequest) { TagFilterQueryBuilder queryBuilder = buildQuery(photonRequest); Integer limit = photonRequest.getLimit(); SearchResponse results = elasticsearchSearcher.search(queryBuilder.buildQuery(), limit); if (results.getHits().getTotalHits() == 0) { results = elasticsearchSearcher.search(queryBuilder.withLenientMatch().buildQuery(), limit); } List<JSONObject> resultJsonObjects = new ConvertToJson(photonRequest.getLanguage()).convert(results); StreetDupesRemover streetDupesRemover = new StreetDupesRemover(photonRequest.getLanguage()); resultJsonObjects = streetDupesRemover.execute(resultJsonObjects); if (resultJsonObjects.size() > limit) { resultJsonObjects = resultJsonObjects.subList(0, limit); } return resultJsonObjects; }
Source:
<code>public void testPopulatesInitialSeeds() throws Exception { cluster = app.createAndManageChild(EntitySpec.create(CassandraDatacenter.class) .configure(CassandraDatacenter.INITIAL_SIZE, 2) .configure(CassandraDatacenter.TOKEN_SHIFT, BigInteger.ZERO) .configure(CassandraDatacenter.DELAY_BEFORE_ADVERTISING_CLUSTER, Duration.ZERO) .configure(CassandraDatacenter.MEMBER_SPEC, EntitySpec.create(EmptySoftwareProcess.class))); app.start(ImmutableList.of(loc)); <START> Thread.sleep(Duration.seconds(1).toMilliseconds()); <END> EmptySoftwareProcess e1 = (EmptySoftwareProcess) Iterables.get(cluster.getMembers(), 0); EmptySoftwareProcess e2 = (EmptySoftwareProcess) Iterables.get(cluster.getMembers(), 1); EntityTestUtils.assertAttributeEqualsEventually(cluster, CassandraDatacenter.CURRENT_SEEDS, ImmutableSet.<Entity>of(e1, e2)); }</code><technical_language>sleep</technical_language>

Target:
public void testPopulatesInitialSeeds() throws Exception { cluster = app.createAndManageChild(EntitySpec.create(CassandraDatacenter.class) .configure(CassandraDatacenter.INITIAL_SIZE, 2) .configure(CassandraDatacenter.TOKEN_SHIFT, BigInteger.ZERO) .configure(CassandraDatacenter.DELAY_BEFORE_ADVERTISING_CLUSTER, Duration.ZERO) .configure(CassandraDatacenter.MEMBER_SPEC, EntitySpec.create(EmptySoftwareProcess.class))); app.start(ImmutableList.of(loc)); EmptySoftwareProcess e1 = (EmptySoftwareProcess) Iterables.get(cluster.getMembers(), 0); EmptySoftwareProcess e2 = (EmptySoftwareProcess) Iterables.get(cluster.getMembers(), 1); EntityTestUtils.assertAttributeEqualsEventually(cluster, CassandraDatacenter.CURRENT_SEEDS, ImmutableSet.<Entity>of(e1, e2)); }
Source:
<code><START> public AsyncDocumentClient getAsyncDocumentClient() { <END> return asyncDocumentClient; }</code><technical_language>This package private, no</technical_language>

Target:
AsyncDocumentClient getAsyncDocumentClient() { return asyncDocumentClient; }
Source:
<code>public void start(Future<Void> startFuture) { <START> PfxOptions pfxOptions = new PfxOptions().setValue(Buffer.buffer("boom")); <END> HttpServerOptions httpServerOptions = new HttpServerOptions(); httpServerOptions .setSsl(true) .setPfxTrustOptions(pfxOptions); vertx.createHttpServer(httpServerOptions).requestHandler(req -> { req.response().end("Hello World!"); }).listen(8443, ar -> { if (ar.succeeded()) { startFuture.complete(); } else { startFuture.fail(ar.cause()); } }); }</code><technical_language>rename _invalidOptions_ clearer correct (took some time figure this it)</technical_language>

Target:
public void start(Future<Void> startFuture) { HttpServerOptions invalidOptions = new HttpServerOptions() .setSsl(true) .setPfxTrustOptions(new PfxOptions().setValue(Buffer.buffer("boom"))); vertx.createHttpServer(invalidOptions).requestHandler(req -> { req.response().end("Hello World!"); }).listen(8443, ar -> { if (ar.succeeded()) { startFuture.complete(); } else { startFuture.fail(ar.cause()); } }); }
Source:
<code>public void publish(String jsonMessage) { LOG.debug("Received request {}", jsonMessage); try { JsonNode messageAsNode = jsonReader.read(jsonMessage); <START> if (messageAsNode.has("topics")) { <END> String topicsTo = messageAsNode.get("topics").get("to").asText(); pushRequestMessage(topicsTo, jsonMessage); } } catch (IOException e) { LOG.error("Received message can not be parsed"); } }</code><technical_language>if wit topics? throw exception</technical_language>

Target:
public void publish(String jsonMessage) { LOG.debug("Received request {}", jsonMessage); try { JsonNode messageAsNode = jsonReader.read(jsonMessage); if (!messageAsNode.has("topics")) { throw new JsonSchemaValidationException(String.format("missing topics in message %s", jsonMessage)); } JsonNode topicsAsNode = messageAsNode.get("topics"); if (!topicsAsNode.has("to")) { throw new JsonSchemaValidationException(String.format("missing topics.to in message %s", jsonMessage)); } String topicsTo = topicsAsNode.get("to").asText(); pushRequestMessage(topicsTo, jsonMessage); } catch (IOException e) { LOG.error("Received message can not be parsed"); } }
Source:
<code>private static InputStream nodeToInputStream(Node node) throws Exception { <START> final ByteArrayOutputStream outputStream = new ByteArrayOutputStream(); <END> TransformerFactory.newInstance().newTransformer().transform(new DOMSource(node), new StreamResult(outputStream)); return new ByteArrayInputStream(outputStream.toByteArray()); }</code><technical_language>output stream need closed</technical_language>

Target:
private static InputStream nodeToInputStream(Node node) throws Exception { try (ByteArrayOutputStream outputStream = new ByteArrayOutputStream()) { TransformerFactory.newInstance().newTransformer().transform(new DOMSource(node), new StreamResult(outputStream)); return new ByteArrayInputStream(outputStream.toByteArray()); } }
Source:
<code><START> public void expand(IProgressMonitor monitor) { <END> item.setExpanded(true); refreshContent(); }</code><technical_language>monitor parameter used, it, especially in refreshContent() is longer in time</technical_language>

Target:
public void expand(IProgressMonitor monitor) { item.setExpanded(true); refreshContent(false, monitor); }
Source:
<code>protected boolean hasPermission(String nxuser) { NuxeoPrincipal principal = ((NuxeoPrincipal) getContext().getCoreSession().getPrincipal()); <START> return principal.isAdministrator() || (nxuser == null ? false : principal.getName().equals(nxuser)); <END> }</code><technical_language>change nxuser.equals(principal.getName()), nxuser is null</technical_language>

Target:
protected boolean hasPermission(String nxuser) { NuxeoPrincipal principal = ((NuxeoPrincipal) getContext().getCoreSession().getPrincipal()); return principal.isAdministrator() || (nxuser == null ? false : nxuser.equals(principal.getName())); }
Source:
<code>private static OptionalDouble mergeAverage(OptionalDouble first, OptionalLong firstRowCount, OptionalDouble second, OptionalLong secondRowCount) { if (first.isPresent() && second.isPresent()) { if (!(firstRowCount.isPresent() && secondRowCount.isPresent())) { return OptionalDouble.empty(); } long totalRowCount = firstRowCount.getAsLong() + secondRowCount.getAsLong(); if (totalRowCount == 0) { <START> return OptionalDouble.empty(); <END> } double sumFirst = first.getAsDouble() * firstRowCount.getAsLong(); double sumSecond = second.getAsDouble() * secondRowCount.getAsLong(); return OptionalDouble.of((sumFirst + sumSecond) / totalRowCount); } return first.isPresent() ? first : second; }</code><technical_language>if is present, is not, return if is present, lacks row count, return empty Why? Leave some explanation in code</technical_language>

Target:
private static OptionalDouble mergeAverage(OptionalDouble first, OptionalLong firstRowCount, OptionalDouble second, OptionalLong secondRowCount) { if (first.isPresent() && second.isPresent()) { if (!firstRowCount.isPresent() || !secondRowCount.isPresent()) { return OptionalDouble.empty(); } long totalRowCount = firstRowCount.getAsLong() + secondRowCount.getAsLong(); if (totalRowCount == 0) { return OptionalDouble.empty(); } double sumFirst = first.getAsDouble() * firstRowCount.getAsLong(); double sumSecond = second.getAsDouble() * secondRowCount.getAsLong(); return OptionalDouble.of((sumFirst + sumSecond) / totalRowCount); } return first.isPresent() ? first : second; }
Source:
<code>public void init(final DeleteProjectPopUpScreen presenter) { <START> domUtil = new Elemental2DomUtil(); <END> this.presenter = presenter; modalSetup(); }</code><technical_language>inject this</technical_language>

Target:
public void init(final DeleteProjectPopUpScreen presenter) { this.presenter = presenter; modalSetup(); }
Source:
<code>public synchronized void send(Message<?> message) throws Exception { if (this.socketOutputStream == null) { int writeBufferSize = this.socket.getSendBufferSize(); this.socketOutputStream = new BufferedOutputStream(this.socket.getOutputStream(), writeBufferSize > 0 ? writeBufferSize : 8192); } Object object = getMapper().fromMessage(message); <START> Assert.state(object != null, "Mapper mapped the message to 'null."); <END> this.lastSend = System.currentTimeMillis(); try { ((Serializer<Object>) getSerializer()).serialize(object, this.socketOutputStream); this.socketOutputStream.flush(); } catch (Exception e) { this.publishConnectionExceptionEvent(new MessagingException(message, "Failed TCP serialization", e)); this.closeConnection(true); throw e; } if (logger.isDebugEnabled()) { logger.debug(getConnectionId() + " Message sent " + message); } }</code><technical_language>Missed closing quote: suggestion Assert.state(object != null, "Mapper mapped message 'null'.");</technical_language>

Target:
public synchronized void send(Message<?> message) throws Exception { if (this.socketOutputStream == null) { int writeBufferSize = this.socket.getSendBufferSize(); this.socketOutputStream = new BufferedOutputStream(this.socket.getOutputStream(), writeBufferSize > 0 ? writeBufferSize : 8192); } Object object = getMapper().fromMessage(message); Assert.state(object != null, "Mapper mapped the message to 'null'."); this.lastSend = System.currentTimeMillis(); try { ((Serializer<Object>) getSerializer()).serialize(object, this.socketOutputStream); this.socketOutputStream.flush(); } catch (Exception e) { this.publishConnectionExceptionEvent(new MessagingException(message, "Failed TCP serialization", e)); this.closeConnection(true); throw e; } if (logger.isDebugEnabled()) { logger.debug(getConnectionId() + " Message sent " + message); } }
Source:
<code>public boolean isClusterUp() { String llapAppID = variablesFacade.getVariableValue(Settings.VARIABLE_LLAP_APP_ID); if (llapAppID == null || llapAppID.isEmpty()) { return false; } ApplicationId appId = ApplicationId.fromString(llapAppID); YarnClient yClient = yarnClientService.getYarnClientSuper(settings.getConfiguration()).getYarnClient(); ApplicationReport applicationReport = null; try { applicationReport = yClient.getApplicationReport(appId); } catch (IOException | YarnException e) { logger.log(Level.SEVERE, "Could not retrieve application state for llap cluster with appId: " + appId.toString(), e); return false; } YarnApplicationState appState = applicationReport.getYarnApplicationState(); return appState == YarnApplicationState.RUNNING || <START> appState == YarnApplicationState.SUBMITTED || <END> appState == YarnApplicationState.ACCEPTED || appState == YarnApplicationState.NEW || appState == YarnApplicationState.NEW_SAVING; }</code><technical_language>Close YarnClient in a finally block</technical_language>

Target:
public boolean isClusterUp() { String llapAppID = variablesFacade.getVariableValue(Settings.VARIABLE_LLAP_APP_ID); if (llapAppID == null || llapAppID.isEmpty()) { return false; } ApplicationId appId = ApplicationId.fromString(llapAppID); YarnClient yarnClient = yarnClientService.getYarnClientSuper(settings.getConfiguration()).getYarnClient(); ApplicationReport applicationReport = null; try { applicationReport = yarnClient.getApplicationReport(appId); } catch (IOException | YarnException e) { logger.log(Level.SEVERE, "Could not retrieve application state for llap cluster with appId: " + appId.toString(), e); return false; } finally { try { yarnClient.close(); } catch (IOException ex) } YarnApplicationState appState = applicationReport.getYarnApplicationState(); return appState == YarnApplicationState.RUNNING || appState == YarnApplicationState.SUBMITTED || appState == YarnApplicationState.ACCEPTED || appState == YarnApplicationState.NEW || appState == YarnApplicationState.NEW_SAVING; }
Source:
<code>public void copyObject( String bucketName, String objectName, Map<String, String> headerMap, ServerSideEncryption sse, String srcBucketName, String srcObjectName, ServerSideEncryption srcSse, CopyConditions copyConditions) throws ErrorResponseException, IllegalArgumentException, InsufficientDataException, InternalException, InvalidBucketNameException, InvalidKeyException, InvalidResponseException, IOException, NoSuchAlgorithmException, XmlParserException { checkBucketName(bucketName); checkObjectName(objectName); checkWriteRequestSse(sse); try { checkBucketName(srcBucketName); } catch (InvalidBucketNameException e) { <START> throw new IllegalArgumentException("invalid source bucket name"); <END> } if (srcObjectName == null) { srcObjectName = objectName; } checkReadRequestSse(srcSse); if (headerMap == null) { headerMap = new HashMap<>(); } headerMap.put("x-amz-copy-source", S3Escaper.encodePath(srcBucketName + "/" + srcObjectName)); if (sse != null) { headerMap.putAll(sse.headers()); } if (srcSse != null) { headerMap.putAll(srcSse.copySourceHeaders()); } if (copyConditions != null) { headerMap.putAll(copyConditions.getConditions()); } Response response = executePut(bucketName, objectName, headerMap, null, "", 0); try (ResponseBody body = response.body()) { Xml.unmarshal(CopyObjectResult.class, body.charStream()); } }</code><technical_language>this invalid bucket names raise exceptions for bucketName srcBucketName</technical_language>

Target:
public void copyObject( String bucketName, String objectName, Map<String, String> headerMap, ServerSideEncryption sse, String srcBucketName, String srcObjectName, ServerSideEncryption srcSse, CopyConditions copyConditions) throws ErrorResponseException, IllegalArgumentException, InsufficientDataException, InternalException, InvalidBucketNameException, InvalidKeyException, InvalidResponseException, IOException, NoSuchAlgorithmException, XmlParserException { if ((bucketName == null) || (bucketName.isEmpty())) { throw new IllegalArgumentException("bucket name cannot be empty"); } checkObjectName(objectName); checkWriteRequestSse(sse); if ((srcBucketName == null) || (srcBucketName.isEmpty())) { throw new IllegalArgumentException("Source bucket name cannot be empty"); } if (srcObjectName == null) { srcObjectName = objectName; } checkReadRequestSse(srcSse); if (headerMap == null) { headerMap = new HashMap<>(); } headerMap.put("x-amz-copy-source", S3Escaper.encodePath(srcBucketName + "/" + srcObjectName)); if (sse != null) { headerMap.putAll(sse.headers()); } if (srcSse != null) { headerMap.putAll(srcSse.copySourceHeaders()); } if (copyConditions != null) { headerMap.putAll(copyConditions.getConditions()); } Response response = executePut(bucketName, objectName, headerMap, null, "", 0); try (ResponseBody body = response.body()) { Xml.unmarshal(CopyObjectResult.class, body.charStream()); } }
Source:
<code>public static ExtensionInfo noExtInfoSeen() { <START> return new ExtensionInfo(Collections.emptySet()); <END> }</code><technical_language>Java 7 a problem this. fixed with: java Collections.<String>emptySet()</technical_language>

Target:
public static ExtensionInfo noExtInfoSeen() { return new ExtensionInfo(Collections.<String>emptySet()); }
Source:
<code>public ProcessingDirective process(final Item<AvroRecordBuffer> item) { final long time = System.currentTimeMillis(); try { <START> final TrackedFile trackedFile = currentTrackedFile.get(); <END> trackedFile.divolteFile.append(item.payload); trackedFile.recordsSinceLastSync += 1; possiblySyncAndOrRoll(time); return CONTINUE; } catch(final IOException ioe) { markFileSystemUnavailable(time); logger.error("File system connection error. Marking file system as unavailable. Attempting reconnect after " + reconnectDelay + " ms.", ioe); return PAUSE; } }</code><technical_language>I this .orThrow() throw IllegalStateException illegal invoke process while in error state, this empty indicates</technical_language>

Target:
public ProcessingDirective process(final Item<AvroRecordBuffer> item) { final long nanoTime = System.nanoTime(); try { final TrackedFile trackedFile = currentTrackedFile.orElseThrow(IllegalStateException::new); trackedFile.divolteFile.append(item.payload); trackedFile.recordsSinceLastSync += 1; possiblySyncAndOrRoll(nanoTime); return CONTINUE; } catch(final IOException ioe) { markFileSystemUnavailable(nanoTime); logger.error("File system connection error. Marking file system as unavailable. Attempting reconnect after " + reconnectDelayNanos + " ns.", ioe); return PAUSE; } }
Source:
<code>public static boolean[] validate(String[] files) throws IOException { if (files == null || files.length == 0) { throw new IllegalArgumentException("No files to validate"); } boolean[] results = new boolean[files.length]; for (int i = 0; i < files.length; i++) { String file = files[i]; if (file == null || file.trim().length() == 0) { results[i] = false; } else{ String f = file.toLowerCase(); boolean b; <START> if (f.endsWith("tif") || f.endsWith("tiff")) { <END> String comment = ""; try(RandomAccessInputStream stream = new RandomAccessInputStream(file)) { comment = new TiffParser(stream).getComment(); } b = validate(f, new BufferedReader(new StringReader(comment))); } else { b = validate(f, new BufferedReader(new InputStreamReader( new FileInputStream(f), Constants.ENCODING))); } results[i] = b; } } return results; }</code><technical_language>RFE (outside scope of this PR), extend scope of this check support of TiffReader.TIFF_SUFFIXES <LINK_0></technical_language>

Target:
public static boolean[] validate(String[] files) throws IOException { if (files == null || files.length == 0) { throw new IllegalArgumentException("No files to validate"); } boolean[] results = new boolean[files.length]; List<String> extensions = Arrays.asList(TiffReader.TIFF_SUFFIXES); for (int i = 0; i < files.length; i++) { String file = files[i]; if (file == null || file.trim().length() == 0) { results[i] = false; } else{ String f = file.toLowerCase(); boolean b; String extension = f.substring(f.lastIndexOf(".")+1); if (extensions.contains(extension)) { String comment = ""; try (RandomAccessInputStream stream = new RandomAccessInputStream(file)) { comment = new TiffParser(stream).getComment(); } b = validate(new BufferedReader(new StringReader(comment)), f); } else { b = validate(new BufferedReader(new InputStreamReader( new FileInputStream(f), Constants.ENCODING)), f); } results[i] = b; } } return results; }
Source:
<code>public static OS guess() { final String osName = System.getProperty("os.name"); <START> if (osName==null) return OS.Windows; <END> return osName.contains("Windows") ? OS.Windows : osName.contains("Mac") ? OS.Mac : osName.contains("SunOS") ? OS.SunOS : OS.Linux; }</code><technical_language>In cases this system property is null ? Windows (this developer unfriendly OS) default ? :)</technical_language>

Target:
public static Architecture guess(){ return System.getProperty("os.arch").contains("64") ? x64 : x86; }
Source:
<code>protected void executeQueryCommand() { Guid tryingImage = Guid.Empty; DiskImage activeDisk = findImageForDrive(SnapshotType.ACTIVE); <START> DiskImage inactiveDisk = findImageForDrive(SnapshotType.PREVIEW);; <END> if (getDiskImageDao().getAllForVm(getParameters().getId(), getUserID(), getParameters().isFiltered()).isEmpty() || activeDisk == null || imageBeforePreviewIsMissing(activeDisk, inactiveDisk)) { log.warnFormat("Vm {0} images data incorrect", getParameters().getId()); getQueryReturnValue().setReturnValue(new ArrayList<DiskImage>()); return; } if (inactiveDisk != null) { tryingImage = activeDisk.getParentId(); } Guid topmostImageGuid = inactiveDisk == null ? activeDisk.getId() : inactiveDisk.getId(); getQueryReturnValue().setReturnValue( ImagesHandler.getAllImageSnapshots(topmostImageGuid, activeDisk.getit_guid())); getQueryReturnValue().setTryingImage(tryingImage); }</code><technical_language>2 semicolons here</technical_language>

Target:
protected void executeQueryCommand() { Guid tryingImage = Guid.Empty; DiskImage activeDisk = findImageForDrive(SnapshotType.ACTIVE); DiskImage inactiveDisk = findImageForDrive(SnapshotType.PREVIEW); if (getDiskImageDao().getAllForVm(getParameters().getId(), getUserID(), getParameters().isFiltered()).isEmpty() || activeDisk == null || imageBeforePreviewIsMissing(activeDisk, inactiveDisk)) { log.warnFormat("Vm {0} images data incorrect", getParameters().getId()); getQueryReturnValue().setReturnValue(new ArrayList<DiskImage>()); return; } if (inactiveDisk != null) { tryingImage = activeDisk.getParentId(); } Guid topmostImageGuid = inactiveDisk == null ? activeDisk.getId() : inactiveDisk.getId(); getQueryReturnValue().setReturnValue( ImagesHandler.getAllImageSnapshots(topmostImageGuid, activeDisk.getit_guid())); getQueryReturnValue().setTryingImage(tryingImage); }
Source:
<code>protected ActionResult execute() { new GateKeeper().verifyAdminPrivileges(account); AdminEmailComposePageData data = new AdminEmailComposePageData(account); String emailContent = getRequestParamValue(Const.ParamsNames.ADMIN_EMAIL_CONTENT); String subject = getRequestParamValue(Const.ParamsNames.ADMIN_EMAIL_SUBJECT); String addressReceiverListString = getRequestParamValue(Const.ParamsNames.ADMIN_EMAIL_ADDRESS_RECEVIERS); String groupReceiverListFileKey = getRequestParamValue(Const.ParamsNames.ADMIN_EMAIL_GROUP_RECEIVER_LIST_FILE_KEY); String emailId = getRequestParamValue(Const.ParamsNames.ADMIN_EMAIL_ID); addressReceiver.add(addressReceiverListString); if(groupReceiverListFileKey != null && !groupReceiverListFileKey.isEmpty()){ groupReceiver.add(groupReceiverListFileKey); } <START> boolean isNewDraft = emailId == null; <END> if(isNewDraft){ createAndSaveNewDraft(subject, addressReceiver, groupReceiver, emailContent); } else { AdminEmailAttributes previousDraft = logic.getAdminEmailById(emailId); if(previousDraft == null){ createAndSaveNewDraft(subject, addressReceiver, groupReceiver, emailContent); } else { updatePreviousEmailDraft(previousDraft.getEmailId(), subject, addressReceiver, groupReceiver, emailContent); } statusToAdmin = "Email draft has been saved: <br>" + "Subject: " + subject; statusToUser.add("Email draft has been saved"); } return this.createShowPageResult(Const.ViewURIs.ADMIN_EMAIL, data); }</code><technical_language>isNewDraft = (emailId == null)</technical_language>

Target:
protected ActionResult execute() { new GateKeeper().verifyAdminPrivileges(account); AdminEmailComposePageData data = new AdminEmailComposePageData(account); String emailContent = getRequestParamValue(Const.ParamsNames.ADMIN_EMAIL_CONTENT); String subject = getRequestParamValue(Const.ParamsNames.ADMIN_EMAIL_SUBJECT); String addressReceiverListString = getRequestParamValue(Const.ParamsNames.ADMIN_EMAIL_ADDRESS_RECEVIERS); String groupReceiverListFileKey = getRequestParamValue(Const.ParamsNames.ADMIN_EMAIL_GROUP_RECEIVER_LIST_FILE_KEY); String emailId = getRequestParamValue(Const.ParamsNames.ADMIN_EMAIL_ID); addressReceiver.add(addressReceiverListString); if(groupReceiverListFileKey != null && !groupReceiverListFileKey.isEmpty()){ groupReceiver.add(groupReceiverListFileKey); } boolean isNewDraft = (emailId == null); if(isNewDraft){ createAndSaveNewDraft(subject, addressReceiver, groupReceiver, emailContent); } else { AdminEmailAttributes previousDraft = logic.getAdminEmailById(emailId); if(previousDraft == null){ createAndSaveNewDraft(subject, addressReceiver, groupReceiver, emailContent); } else { updatePreviousEmailDraft(previousDraft.getEmailId(), subject, addressReceiver, groupReceiver, emailContent); } } if(isError){ data.emailToEdit = new AdminEmailAttributes(subject, addressReceiver, groupReceiver, new Text(emailContent), null); data.emailToEdit.emailId = emailId; } else { statusToAdmin = "Email draft has been saved: <br>" + "Subject: " + subject; statusToUser.add("Email draft has been saved"); } return createShowPageResult(Const.ViewURIs.ADMIN_EMAIL, data); }
Source:
<code><START> public PartIdsFromHttpResponseFull(DateService dateParser) { <END> this.dateParser = dateParser; }</code><technical_language>[minor] Guice practices, reduce visibility of injection constructors. leave public modifier, in default scope</technical_language>

Target:
PartIdsFromHttpResponseFull(DateService dateParser) { this.dateParser = dateParser; }
Source:
<code>public Builder(String context, Configuration conf) { if (isValid(context)) { sb.append(context); } <START> fieldSeparator = conf.get(HADOOP_CALLER_CONTEXT_SEPARATOR_KEY, HADOOP_CALLER_CONTEXT_SEPARATOR_DEFAULT); <END> }</code><technical_language>throw illegal argument exception if fieldSeparator \t, \n, =? Thanks,</technical_language>

Target:
public Builder(String context, Configuration conf) { if (isValid(context)) { sb.append(context); } fieldSeparator = conf.get(HADOOP_CALLER_CONTEXT_SEPARATOR_KEY, HADOOP_CALLER_CONTEXT_SEPARATOR_DEFAULT); checkFieldSeparator(fieldSeparator); }
Source:
<code>public Iterable<String> getEdgeIds(final Direction direction, final String[] labels, final Authorizations authorizations) { <START> getFetchHints().validateHasEdgeFetchHints(direction); <END> return getEdgeIdsWithOtherVertexId(null, direction, labels, authorizations); }</code><technical_language>checking labels</technical_language>

Target:
public Iterable<String> getEdgeIds(final Direction direction, final String[] labels, final Authorizations authorizations) { getFetchHints().validateHasEdgeFetchHints(direction, labels); return getEdgeIdsWithOtherVertexId(null, direction, labels, authorizations); }
Source:
<code>private boolean descriptionMatch(Item subject, Item candidate) { Set<String> candidateList = descriptionToProcessedList(candidate.getDescription()); Set<String> subjectList = descriptionToProcessedList(subject.getDescription()); Set<String> allCapitalisedWordsList = Sets.newHashSet(candidateList); <START> allCapitalisedWordsList.addAll( <END> subjectList.stream() .filter(word -> !candidateList.contains(word)) .collect(Collectors.toSet()) ); Set<String> capitalisedWordsFoundInBoth = Sets.newHashSet(subjectList); capitalisedWordsFoundInBoth.retainAll(candidateList); return (new Double(capitalisedWordsFoundInBoth.size()) / new Double(allCapitalisedWordsList.size())) > PROPORTION_CROSSOVER; }</code><technical_language>This logic needs simplified. speak f2f</technical_language>

Target:
private boolean descriptionMatch(Item subject, Item candidate) { Set<String> candidateList = descriptionToProcessedList(candidate.getDescription()); Set<String> subjectList = descriptionToProcessedList(subject.getDescription()); Set<String> allWords = Sets.union(candidateList, subjectList); Set<String> commonWords = Sets.intersection(subjectList, candidateList); double proportionOfCommonWords = (commonWords.size() + 0.0) / allWords.size(); return proportionOfCommonWords > COMMON_WORDS_PROPORTION_THRESHOLD; }
Source:
<code>public FileInfo(FileSystem srcFs, Path sourcePath, String subDir) { this.srcFs = srcFs; this.sourcePath = sourcePath; <START> this.cmPath = null; <END> this.checkSum = null; this.useSourcePath = true; this.subDir = subDir; }</code><technical_language>this constructor call</technical_language>

Target:
public FileInfo(FileSystem srcFs, Path sourcePath, String subDir) { this(srcFs, sourcePath, null, null, true, subDir); }
Source:
<code>public void updateDevices() { <START> mUSBMonitor.dumpDevices(); <END> final List<DeviceFilter> filter = DeviceFilter.getDeviceFilters(getActivity(), R.xml.uvc_device_filter); mDeviceListAdapter = new DeviceListAdapter(getActivity(), mUSBMonitor.getDeviceList(filter.get(0))); mSpinner.setAdapter(mDeviceListAdapter); }</code><technical_language>@guiseco well, check mUSBMonitor, getActivity() null dereferencing them</technical_language>

Target:
public void updateDevices() { if (getActivity() != null && mUSBMonitor != null){ final List<DeviceFilter> filter = DeviceFilter.getDeviceFilters(getActivity(), R.xml.uvc_device_filter); if (!filter.isEmpty()){ mDeviceListAdapter = new DeviceListAdapter(getActivity(), mUSBMonitor.getDeviceList(filter.get(0))); mSpinner.setAdapter(mDeviceListAdapter); } } }
Source:
<code>boolean supportsTarget(ILaunchDescriptor descriptor, IRemoteConnection target) throws CoreException { String descriptorTypeId = getDescriptorTypeId(descriptor.getType()); for (LaunchConfigProviderInfo provider : configProviders.get(descriptorTypeId)) { try { Ternary supports = provider.getProvider().supports(descriptor, target); <START> if (supports == Ternary.TRUE) { <END> return true; } if (supports == Ternary.FALSE) { return false; } } catch (Throwable e) { Activator.log(e); } } return false; }</code><technical_language>This a switch</technical_language>

Target:
boolean supportsTarget(ILaunchDescriptor descriptor, IRemoteConnection target) throws CoreException { String descriptorTypeId = getDescriptorTypeId(descriptor.getType()); for (LaunchConfigProviderInfo provider : configProviders.get(descriptorTypeId)) { try { if (provider.getProvider().supports(descriptor, target)) { return true; } } catch (Throwable e) { Activator.log(e); } } return false; }
Source:
<code>public View getView(Context context) { super.getView(context); ArrayAdapter<CharSequence> spinnerAdapter = ArrayAdapter <START> .createFromResource(context, R.array.ev3_stop_motor_chooser, android.R.layout.simple_spinner_item); <END> spinnerAdapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item); Spinner spinner = view.findViewById(R.id.stop_motor_spinner); spinner.setAdapter(spinnerAdapter); spinner.setOnItemSelectedListener(new AdapterView.OnItemSelectedListener() { @Override public void onItemSelected(AdapterView<?> arg0, View arg1, int position, long arg3) { motor = Motor.values()[position].name(); } @Override public void onNothingSelected(AdapterView<?> arg0) { } }); spinner.setSelection(Motor.valueOf(motor).ordinal()); return view; }</code><technical_language>R.array.nxt_stop_motor_chooser</technical_language>

Target:
public View getView(Context context) { super.getView(context); ArrayAdapter<CharSequence> spinnerAdapter = ArrayAdapter .createFromResource(context, R.array.nxt_stop_motor_chooser, android.R.layout.simple_spinner_item); spinnerAdapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item); Spinner spinner = view.findViewById(R.id.stop_motor_spinner); spinner.setAdapter(spinnerAdapter); spinner.setOnItemSelectedListener(new AdapterView.OnItemSelectedListener() { @Override public void onItemSelected(AdapterView<?> arg0, View arg1, int position, long arg3) { motor = Motor.values()[position].name(); } @Override public void onNothingSelected(AdapterView<?> arg0) { } }); spinner.setSelection(Motor.valueOf(motor).ordinal()); return view; }
Source:
<code>private void hotSetMemory(int newAmountOfMemory) { int currentMemory = getVm().getMemSizeMb(); <START> if (getVm().getStatus() == VMStatus.Down) { <END> newVmStatic.setMemSizeMb(newAmountOfMemory); return; } if (getVm().getStatus() == VMStatus.Up && currentMemory != newAmountOfMemory) { HotSetAmountOfMemoryParameters params = new HotSetAmountOfMemoryParameters( newVmStatic, currentMemory < newAmountOfMemory ? PlugAction.PLUG : PlugAction.UNPLUG, 0); VdcReturnValueBase setAmountOfMemoryResult = runInternalAction( VdcActionType.HotSetAmountOfMemory, params, cloneContextAndDetachFromParent()); newVmStatic.setMemSizeMb(setAmountOfMemoryResult.getSucceeded() ? newAmountOfMemory : currentMemory); hotSetMemlog(params, setAmountOfMemoryResult); return; } newVmStatic.setMemSizeMb(currentMemory); }</code><technical_language>necessarily right? VmStatus#isNotRunning</technical_language>

Target:
private void hotSetMemory(int newAmountOfMemory) { int currentMemory = getVm().getMemSizeMb(); HotSetAmountOfMemoryParameters params = new HotSetAmountOfMemoryParameters( newVmStatic, currentMemory < newAmountOfMemory ? PlugAction.PLUG : PlugAction.UNPLUG, 0); VdcReturnValueBase setAmountOfMemoryResult = runInternalAction( VdcActionType.HotSetAmountOfMemory, params, cloneContextAndDetachFromParent()); newVmStatic.setMemSizeMb(setAmountOfMemoryResult.getSucceeded() ? newAmountOfMemory : currentMemory); hotSetMemlog(params, setAmountOfMemoryResult); }
Source:
<code>default public D build(Stream<UpstreamEntry<K, V>> upstreamData, long upstreamDataSize, C ctx) { <START> return build(upstreamData.iterator(), upstreamDataSize, ctx); <END> }</code><technical_language>commend upstreamDataSize</technical_language>

Target:
public default D build(Stream<UpstreamEntry<K, V>> upstreamData, long upstreamDataSize, C ctx) { return build(upstreamData.iterator(), upstreamDataSize, ctx); }
Source:
<code>public HandlerResult handle(ProcessState state, ProcessInstance process) { Instance instance = (Instance) state.getResource(); if (instance == null) { return null; } ServiceExposeMap smap = objectManager.findAny(ServiceExposeMap.class, SERVICE_EXPOSE_MAP.INSTANCE_ID, instance.getId(), SERVICE_EXPOSE_MAP.REMOVED, null); if (smap == null) { return null; } Service service = getObjectManager().loadResource(Service.class, smap.getServiceId()); if (service == null) { return null; } List<Service> activeLbServices = lookupAllActiveLBServices(service); List<? extends Instance> lbInstances = getLBServiceInstances(activeLbServices); for (Instance lbInstance : lbInstances) { for (InstanceHostMap ihm : mapDao.findNonPurged(InstanceHostMap.class, Instance.class, lbInstance.getId())) { <START> Object agentResource = getObjectByRelationship("host", ihm); <END> if (ObjectUtils.getRemoved(agentResource) != null) continue; RemoteAgent agent = agentLocator.lookupAgent(agentResource); if (agent == null) continue; handleEvent(state, process, ihm, ihm, agentResource, agent); } } return null; }</code><technical_language>Dont do this line. Actually, dont need this ihm loop all. I want pass lbInstance lookupAgent</technical_language>

Target:
public HandlerResult handle(ProcessState state, ProcessInstance process) { Instance instance = (Instance) state.getResource(); if (instance == null) { return null; } ServiceExposeMap smap = objectManager.findAny(ServiceExposeMap.class, SERVICE_EXPOSE_MAP.INSTANCE_ID, instance.getId(), SERVICE_EXPOSE_MAP.REMOVED, null); if (smap == null) { return null; } Service service = getObjectManager().loadResource(Service.class, smap.getServiceId()); if (service == null) { return null; } List<Service> activeLbServices = lookupAllActiveLBServices(service); List<? extends Instance> lbInstances = getLBServiceInstances(activeLbServices); for (Instance lbInstance : lbInstances) { RemoteAgent agent = agentLocator.lookupAgent(lbInstance); if (agent == null) continue; handleEvent(state, process, instance, instance, lbInstance, agent); } return null; }
Source:
<code>public ItemStack getPickBlock(IBlockState state, RayTraceResult target, World world, BlockPos pos, EntityPlayer player) { <START> if(gadgetsLoaded) { <END> return new ItemStack(TinkerGadgets.throwball, 1, ItemThrowball.ThrowballType.GLOW.ordinal()); } return null; }</code><technical_language>reduce this a simple if(TinkerGadgets.throwball != null). is hard dependency pulse</technical_language>

Target:
public ItemStack getPickBlock(IBlockState state, RayTraceResult target, World world, BlockPos pos, EntityPlayer player) { if(TinkerGadgets.throwball != null) { return new ItemStack(TinkerGadgets.throwball, 1, ItemThrowball.ThrowballType.GLOW.ordinal()); } return null; }
Source:
<code>public void moveMaterialTo(FileKeyMaterialStore keyMaterialStore) throws ParquetCryptoRuntimeException { <START> HadoopFSKeyMaterialStore targetStore = (HadoopFSKeyMaterialStore) keyMaterialStore; <END> Path targetKeyMaterialFile = targetStore.getStorageFilePath(); try { hadoopFileSystem.rename(keyMaterialFile, targetKeyMaterialFile); } catch (IOException e) { throw new ParquetCryptoRuntimeException("Failed to rename file " + keyMaterialFile, e); } }</code><technical_language>describe supports this implementation of FileKeyMaterialStore objects. nice in addition throw a specific exception instead of a ClassCastException (e.g. IllegalArgumentException proper messaging)</technical_language>

Target:
public void moveMaterialTo(FileKeyMaterialStore keyMaterialStore) throws ParquetCryptoRuntimeException { HadoopFSKeyMaterialStore targetStore; try { targetStore = (HadoopFSKeyMaterialStore) keyMaterialStore; } catch (ClassCastException e) { throw new IllegalArgumentException("Currently supports only moving to HadoopFSKeyMaterialStore, not to " + keyMaterialStore.getClass(), e); } Path targetKeyMaterialFile = targetStore.getStorageFilePath(); try { hadoopFileSystem.rename(keyMaterialFile, targetKeyMaterialFile); } catch (IOException e) { throw new ParquetCryptoRuntimeException("Failed to rename file " + keyMaterialFile, e); } }
Source:
<code>void doChangeUserName() { if (!canEditSshUserName()) { return; } String newName = userNameTxt.getText(); if ("".equals(newName)) { newName = null; } if (newName != null && !newName.matches(Account.SSH_USER_NAME_PATTERN)) { invalidUserName(); return; } userNameTxt.setEnabled(false); changeUserName.setEnabled(false); final String newSshUserName = newName; Util.ACCOUNT_SEC.changeSshUserName(newSshUserName, new GerritCallback<VoidResult>() { public void onSuccess(final VoidResult result) { userNameTxt.setEnabled(true); changeUserName.setEnabled(false); if (Gerrit.isSignedIn()) { Gerrit.getUserAccount().setSshUserName(newSshUserName); } } @Override public void onFailure(final Throwable caught) { userNameTxt.setEnabled(true); changeUserName.setEnabled(true); <START> if (InvalidSshUserNameException.MESSAGE.equals(caught)) { <END> invalidUserName(); } else { super.onFailure(caught); } } }); }</code><technical_language>Is testing a message instead of testing instance a good idea</technical_language>

Target:
void doChangeUserName() { if (!canEditSshUserName()) { return; } String newName = userNameTxt.getText(); if ("".equals(newName)) { newName = null; } if (newName != null && !newName.matches(Account.SSH_USER_NAME_PATTERN)) { invalidUserName(); return; } userNameTxt.setEnabled(false); changeUserName.setEnabled(false); final String newSshUserName = newName; Util.ACCOUNT_SEC.changeSshUserName(newSshUserName, new GerritCallback<VoidResult>() { public void onSuccess(final VoidResult result) { userNameTxt.setEnabled(true); changeUserName.setEnabled(false); if (Gerrit.isSignedIn()) { Gerrit.getUserAccount().setSshUserName(newSshUserName); } } @Override public void onFailure(final Throwable caught) { userNameTxt.setEnabled(true); changeUserName.setEnabled(true); if (InvalidSshUserNameException.MESSAGE.equals(caught.getMessage())) { invalidUserName(); } else { super.onFailure(caught); } } }); }
Source:
<code>public void start() throws ServerConnectorException { if (listenerConfiguration.isBindOnStartup()) { return; } <START> serverConnectorController.bindInterface(this); <END> }</code><technical_language>exception handling removed</technical_language>

Target:
public void start() throws ServerConnectorException { if (listenerConfiguration.isBindOnStartup()) { return; } try { serverConnectorController.bindInterface(this); } catch (Exception e) { throw new ServerConnectorException("Cannot bind to " + this + " : " + e.getMessage(), e); } }