auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>public void setFile(AbstractFile file) { try { if (file == null) { resetComponent(); return; } if (file.equals(lastFile)) { return; } lastFile = file; if (mediaPlayerPanelInited && mediaPlayerPanel.isSupported(file)) { <START> mediaPlayerPanel.loadFile(file); <END> this.showVideoPanel(); } else if (imagePanelInited && imagePanel.isSupported(file)) { imagePanel.showImageFx(file); this.showImagePanel(); } } catch (Exception e) { LOGGER.log(Level.SEVERE, "Exception while setting node", e); } }</code><technical_language>removing this unnecessary parameter import for java.awt.Dimension unnecessary</technical_language>

Target:
public void setFile(AbstractFile file) { try { if (file == null) { resetComponent(); return; } if (file.equals(lastFile)) { return; } lastFile = file; if (mediaPlayerPanel != null && mediaPlayerPanel.isSupported(file)) { mediaPlayerPanel.loadFile(file); this.showVideoPanel(); } else if (imagePanelInited && imagePanel.isSupported(file)) { imagePanel.showImageFx(file); this.showImagePanel(); } } catch (Exception e) { LOGGER.log(Level.SEVERE, "Exception while setting node", e); } }
Source:
<code>public void should_instanciate_a_process_with_given_inputs_for_a_specific_user() throws Exception { final Map<String, Serializable> expectedComplexInput = aComplexInput(); when(processAPI.startProcessWithInputs(1L, PROCESS_DEFINITION_ID, expectedComplexInput)).thenReturn(new ProcessInstanceImpl("complexProcessInstance")); when(processAPI.getProcessContract(PROCESS_DEFINITION_ID)).thenReturn(contractDefinition); final Response response = request(URL_API_PROCESS_INSTANTIATION_TEST_WITH_USER).post(VALID_COMPLEX_POST_BODY); assertThat(response).hasStatus(Status.SUCCESS_OK); assertThat(response.getEntityAsText()) .isEqualTo( <START> "{\"processInstanceId\":0}"); <END> verify(processAPI).startProcessWithInputs(1L, PROCESS_DEFINITION_ID, expectedComplexInput); verify(processAPI, times(0)).startProcessWithInputs(PROCESS_DEFINITION_ID, expectedComplexInput); }</code><technical_language>caseId instead of processInstanceId antyhing web side,</technical_language>

Target:
public void should_instanciate_a_process_with_given_inputs_for_a_specific_user() throws Exception { final Map<String, Serializable> expectedComplexInput = aComplexInput(); when(processAPI.startProcessWithInputs(1L, PROCESS_DEFINITION_ID, expectedComplexInput)).thenReturn(new ProcessInstanceImpl("complexProcessInstance")); when(processAPI.getProcessContract(PROCESS_DEFINITION_ID)).thenReturn(contractDefinition); final Response response = request(URL_API_PROCESS_INSTANTIATION_TEST_WITH_USER).post(VALID_COMPLEX_POST_BODY); assertThat(response).hasStatus(Status.SUCCESS_OK); assertThat(response.getEntityAsText()) .isEqualTo( "{\"caseId\":0}"); verify(processAPI).startProcessWithInputs(1L, PROCESS_DEFINITION_ID, expectedComplexInput); verify(processAPI, times(0)).startProcessWithInputs(PROCESS_DEFINITION_ID, expectedComplexInput); }
Source:
<code>private static boolean isSelectedCategory(CustomXmlTraceDefinition[] customXmlTraceDefinitions, Set<String> selectedTraceTypes) { for (CustomXmlTraceDefinition def : customXmlTraceDefinitions) { <START> String traceTypeId = CustomXmlTrace.class.getCanonicalName() + ":" + def.definitionName; END> if (selectedTraceTypes.contains(traceTypeId)) { return true; } } return false; }</code><technical_language>':'</technical_language>

Target:
private static boolean isSelectedCategory(CustomXmlTraceDefinition[] customXmlTraceDefinitions, Set<String> selectedTraceTypes) { for (CustomXmlTraceDefinition def : customXmlTraceDefinitions) { String traceTypeId = CustomXmlTrace.class.getCanonicalName() + ':' + def.definitionName; if (selectedTraceTypes.contains(traceTypeId)) { return true; } } return false; }
Source:
<code>public void startup() { this.tileRendererManager = new TileRendererManager(this.graph); this.defaultRoutingRequest = routerConfig.routingRequestDefaults(); if (routerConfig.requestLogFile() != null) { this.requestLogger = createLogger(routerConfig.requestLogFile()); LOG.info("Logging incoming requests at '{}'", routerConfig.requestLogFile()); } else { LOG.info("Incoming requests will not be logged."); } LOG.info("Creating transit layer for Raptor routing."); if (graph.hasTransit && graph.index != null) { graph.setTransitLayer(TransitLayerMapper.map(routerConfig.transitTuningParameters(), graph)); graph.setRealtimeTransitLayer(new TransitLayer(graph.getTransitLayer())); graph.transitLayerUpdater = new TransitLayerUpdater( graph, graph.index.getServiceCodesRunningForDate() ); } else { LOG.warn("Cannot create Raptor data, that requires the graph to have transit data and be indexed."); } GraphUpdaterConfigurator.setupGraph( this.graph, routerConfig.updaterConfig(), <START> routerConfig.getBikeShareUpdaterEndpoint() <END> ); try { WorldEnvelope env = graph.getEnvelope(); double lat = (env.getLowerLeftLatitude() + env.getUpperRightLatitude()) / 2; double lon = (env.getLowerLeftLongitude() + env.getUpperRightLongitude()) / 2; graph.ellipsoidToGeoidDifference = ElevationUtils.computeEllipsoidToGeoidDifference(lat, lon); LOG.info("Computed ellipsoid/geoid offset at (" + lat + ", " + lon + ") as " + graph.ellipsoidToGeoidDifference); } catch (Exception e) { LOG.error("Error computing ellipsoid/geoid difference"); } }</code><technical_language>gbfsBikeRentalServiceDirectory part of UpdaterConfig</technical_language>

Target:
public void startup() { this.tileRendererManager = new TileRendererManager(this.graph); this.defaultRoutingRequest = routerConfig.routingRequestDefaults(); if (routerConfig.requestLogFile() != null) { this.requestLogger = createLogger(routerConfig.requestLogFile()); LOG.info("Logging incoming requests at '{}'", routerConfig.requestLogFile()); } else { LOG.info("Incoming requests will not be logged."); } LOG.info("Creating transit layer for Raptor routing."); if (graph.hasTransit && graph.index != null) { graph.setTransitLayer(TransitLayerMapper.map(routerConfig.transitTuningParameters(), graph)); graph.setRealtimeTransitLayer(new TransitLayer(graph.getTransitLayer())); graph.transitLayerUpdater = new TransitLayerUpdater( graph, graph.index.getServiceCodesRunningForDate() ); } else { LOG.warn("Cannot create Raptor data, that requires the graph to have transit data and be indexed."); } GraphUpdaterConfigurator.setupGraph( this.graph, routerConfig.updaterConfig(), routerConfig.getBikeRentalServiceDirectoryUrl() ); try { WorldEnvelope env = graph.getEnvelope(); double lat = (env.getLowerLeftLatitude() + env.getUpperRightLatitude()) / 2; double lon = (env.getLowerLeftLongitude() + env.getUpperRightLongitude()) / 2; graph.ellipsoidToGeoidDifference = ElevationUtils.computeEllipsoidToGeoidDifference(lat, lon); LOG.info("Computed ellipsoid/geoid offset at (" + lat + ", " + lon + ") as " + graph.ellipsoidToGeoidDifference); } catch (Exception e) { LOG.error("Error computing ellipsoid/geoid difference"); } }
Source:
<code>private Set<Feature> determineEnabledFeatures(TableViewerSWTCustomization<V> customization) { final Set<Feature> enabled = new LinkedHashSet<Feature>(); enabled.addAll(customization.getTableConfiguration().getEnabledFeatures()); for (final ColumnConfiguration columnConfig : customization.getConfiguredColumns()) { <START> enabled.addAll(columnConfig.getEnabledFeatures()); <END> } return enabled; }</code><technical_language>sense add column features enabled features a table? add features twice, hideShow tableconfig hideshow columnconfig</technical_language>

Target:
private Set<Feature> determineEnabledFeatures(TableViewerSWTCustomization<V> customization) { final Set<Feature> enabled = new LinkedHashSet<Feature>(); enabled.addAll(customization.getTableConfiguration().getEnabledFeatures()); for (final ColumnConfiguration columnConfig : customization.getColumnConfigurations()) { enabled.addAll(columnConfig.getEnabledFeatures()); } return enabled; }
Source:
<code>public static IStatus validateRefName(String refNameInput, final Repository repo, final String refPrefix, final boolean errorOnEmptyName) { if (refNameInput.isEmpty()) { <START> if (errorOnEmptyName) <END> return new Status(ERROR, Activator.getPluginId(), CoreText.ValidationUtils_PleaseEnterNameMessage); else return OK_STATUS; } String testFor = refPrefix + refNameInput; if (!Repository.isValidRefName(testFor)) return new Status(ERROR, Activator.getPluginId(), NLS.bind( CoreText.ValidationUtils_InvalidRefNameMessage, testFor)); try { if (repo.resolve(testFor) != null) return new Status(ERROR, Activator.getPluginId(), NLS.bind( CoreText.ValidationUtils_RefAlreadyExistsMessage, testFor)); RefDatabase refDatabase = repo.getRefDatabase(); Collection<String> conflictingNames = refDatabase .getConflictingNames(testFor); if (!conflictingNames.isEmpty()) { String joined = conflictingNames.stream().sorted() .collect(joining(", ")); return new Status(ERROR, Activator.getPluginId(), NLS.bind( CoreText.ValidationUtils_RefNameConflictsWithExistingMessage, joined)); } } catch (IOException e) { return Activator.error(e.getMessage(), e); } catch (RevisionSyntaxException e) { String m = MessageFormat .format(CoreText.ValidationUtils_InvalidRevision, testFor); return Activator.error(m, e); } return OK_STATUS; }</code><technical_language>Missing curly braces in other ifs</technical_language>

Target:
public static IStatus validateRefName(String refNameInput, final Repository repo, final String refPrefix, final boolean errorOnEmptyName) { if (refNameInput.isEmpty()) { if (errorOnEmptyName) { return Activator.error( CoreText.ValidationUtils_PleaseEnterNameMessage, null); } else { return OK_STATUS; } } String testFor = refPrefix + refNameInput; if (!Repository.isValidRefName(testFor)) return Activator.error(MessageFormat.format( CoreText.ValidationUtils_InvalidRefNameMessage, testFor), null); try { if (repo.resolve(testFor) != null) return Activator.error(MessageFormat.format( CoreText.ValidationUtils_RefAlreadyExistsMessage, testFor), null); RefDatabase refDatabase = repo.getRefDatabase(); Collection<String> conflictingNames = refDatabase .getConflictingNames(testFor); if (!conflictingNames.isEmpty()) { String joined = conflictingNames.stream().sorted() .collect(joining(", ")); return Activator.error(MessageFormat.format( CoreText.ValidationUtils_RefNameConflictsWithExistingMessage, joined), null); } } catch (IOException e) { return Activator.error(e.getMessage(), e); } catch (RevisionSyntaxException e) { String m = MessageFormat .format(CoreText.ValidationUtils_InvalidRevision, testFor); return Activator.error(m, e); } return OK_STATUS; }
Source:
<code>public int getFlags() { for (LazyFlag flag : LazyFlag.values()) { if (initializedFlags.contains(flag)) { continue; } FlagGetter flagGetter = lazyFlagsGetters.get(flag); if (flagGetter == null) { throw new RuntimeException("No flag " + flag + " getter specified"); } try { if (flagGetter.canCallOnNotPaired || getReadPairedFlag()) { <START> this.getClass().getMethod(flagGetter.getterName).invoke(this); <END> } } catch (IllegalAccessException e) { throw new RuntimeException(e); } catch (NoSuchMethodException e) { throw new RuntimeException(e); } catch (InvocationTargetException e) { throw new RuntimeException(e); } } return super.getFlags(); }</code><technical_language>Invoking methods reflection this is slower invoking directly. If htsjdk supported Java 8 method references, do instead is abstract getFlag() operation in LazyFlag() enum, implementation for enum calls correct method</technical_language>

Target:
public int getFlags() { for (LazyFlag flag : LazyFlag.values()) { if (initializedFlags.contains(flag)) { continue; } if (flag.canCallOnNotPaired() || getReadPairedFlag()) { flag.getFlag(this); } } return super.getFlags(); }
Source:
<code>private OpenTok(int apiKey, String apiSecret, HttpClient httpClient) { this.apiKey = apiKey; this.apiSecret = apiSecret; <START> this.client=httpClient; <END> }</code><technical_language>spacing</technical_language>

Target:
private OpenTok(int apiKey, String apiSecret, HttpClient httpClient) { this.apiKey = apiKey; this.apiSecret = apiSecret.trim(); this.client = httpClient; }
Source:
<code>private TypeConfigurator(Class<? extends EnvironmentType> type) { this.se = instance(); <START> if (CustomEnvironmentType.class.isAssignableFrom(type)) { @SuppressWarnings("unchecked") Class<? extends CustomEnvironmentType> customType = (Class<? extends CustomEnvironmentType>) type; Environment.instance() .register(customType); } <END> this.type = checkNotNull(type); }</code><technical_language>extract this a named method</technical_language>

Target:
private TypeConfigurator(Class<? extends EnvironmentType> type) { this.se = instance(); if (CustomEnvironmentType.class.isAssignableFrom(type)) { registerCustomType(type); } this.type = checkNotNull(type); }
Source:
<code>public MentionsFormatter get(String type) { String hint = type; if (type == null) { <START> hint = "user"; <END> } MentionsFormatter ret; try { ret = this.componentManager.getInstance(MentionsFormatter.class, hint); } catch (ComponentLookupException e) { this.logger .debug("Unable to find a formatter with type [{}]. Fallback to the default formatter. Cause: [{}]", type, getRootCauseMessage(e)); ret = this.defaultFormatter; } return ret; }</code><technical_language>wondering if correct, if default formatter in case. this happen default consumer</technical_language>

Target:
public MentionsFormatter get(String type) { String hint = type; if (StringUtils.isEmpty(type)) { hint = USER_MENTION_TYPE; } MentionsFormatter ret; try { ret = this.componentManager.getInstance(MentionsFormatter.class, hint); } catch (ComponentLookupException e) { this.logger .debug("Unable to find a formatter with type [{}]. Fallback to the default formatter. Cause: [{}]", type, getRootCauseMessage(e)); ret = this.defaultFormatter; } return ret; }
Source:
<code>public void registerPill(@Scope(OAuthScope.ADMINISTRATION_WRITE) final AccessToken accessToken, @Valid final PillRegistration pillRegistration) { try { final Long trackerId = deviceDAO.registerTracker(accessToken.accountId, pillRegistration.pillId); LOGGER.info("Account registered pill with internal id = {}", accessToken.accountId, pillRegistration.pillId, trackerId); final List<DeviceAccountPair> sensePairedWithAccount = this.deviceDAO.getSensesForAccountId(accessToken.accountId); if(sensePairedWithAccount.size() == 0){ LOGGER.error("No sense paired with account {}", accessToken.accountId); throw new WebApplicationException(Response.Status.BAD_REQUEST); <START> }else { <END> final String senseId = sensePairedWithAccount.get(0).externalDeviceId; this.mergedUserInfoDynamoDB.setNextPillColor(senseId, accessToken.accountId, pillRegistration.pillId); } return; } catch (UnableToExecuteStatementException exception) { final Matcher matcher = MatcherPatternsDB.PG_UNIQ_PATTERN.matcher(exception.getMessage()); if(matcher.find()) { LOGGER.error("Failed to register pill for account id = and pill id = : {}", accessToken.accountId, pillRegistration.pillId, exception.getMessage()); throw new WebApplicationException(Response.status(Response.Status.CONFLICT) .entity(new JsonError(409, "Pill already exists for this account.")).build()); } } catch (AmazonServiceException awsEx){ LOGGER.error("Set pill color failed for pill {}, error: {}", pillRegistration.pillId, awsEx.getMessage()); } throw new WebApplicationException(Response.Status.BAD_REQUEST); }</code><technical_language>need else throwing exception</technical_language>

Target:
public void registerPill(@Scope(OAuthScope.ADMINISTRATION_WRITE) final AccessToken accessToken, @Valid final PillRegistration pillRegistration) { try { final Long trackerId = deviceDAO.registerTracker(accessToken.accountId, pillRegistration.pillId); LOGGER.info("Account registered pill with internal id = {}", accessToken.accountId, pillRegistration.pillId, trackerId); final List<DeviceAccountPair> sensePairedWithAccount = this.deviceDAO.getSensesForAccountId(accessToken.accountId); if(sensePairedWithAccount.size() == 0){ LOGGER.error("No sense paired with account {}", accessToken.accountId); throw new WebApplicationException(Response.Status.BAD_REQUEST); } final String senseId = sensePairedWithAccount.get(0).externalDeviceId; this.mergedUserInfoDynamoDB.setNextPillColor(senseId, accessToken.accountId, pillRegistration.pillId); return; } catch (UnableToExecuteStatementException exception) { final Matcher matcher = MatcherPatternsDB.PG_UNIQ_PATTERN.matcher(exception.getMessage()); if(matcher.find()) { LOGGER.error("Failed to register pill for account id = and pill id = : {}", accessToken.accountId, pillRegistration.pillId, exception.getMessage()); throw new WebApplicationException(Response.status(Response.Status.CONFLICT) .entity(new JsonError(409, "Pill already exists for this account.")).build()); } } catch (AmazonServiceException awsEx){ LOGGER.error("Set pill color failed for pill {}, error: {}", pillRegistration.pillId, awsEx.getMessage()); } throw new WebApplicationException(Response.Status.BAD_REQUEST); }
Source:
<code>private void validateCloudLocationScheme(String cloudPlatform, String location, ValidationResult.ValidationResultBuilder resultBuilder) { try { URI uri = new URI(location); if (AWS.equalsIgnoreCase(cloudPlatform)) { if (uri.getScheme() != null) { <START> Matcher matcher = Pattern.compile(AWS_PATTERN, Pattern.CASE_INSENSITIVE).matcher(uri.getScheme()); <END> if (!matcher.find()) { resultBuilder.error("Incorrect URL scheme for AWS cloud platform: " + location); } } } else if (AZURE.equalsIgnoreCase(cloudPlatform)) { if (uri.getScheme() != null) { Matcher matcher = Pattern.compile(AZURE_PATTERN, Pattern.CASE_INSENSITIVE).matcher(uri.getScheme()); if (!matcher.find()) { resultBuilder.error("Incorrect URL scheme for Azure cloud platform: " + location); } } } else { resultBuilder.error("Cloud platform " + cloudPlatform + " not supported for backup/restore"); } } catch (URISyntaxException e) { resultBuilder.error("Unable to parse URI for location: " + location); } }</code><technical_language>azure aws patterns compiled static final, like: private static final Pattern AWS_PATTERN_COMPILED = Pattern.compile(AWS_PATTERN, Pattern.CASE_INSENSITIVE);</technical_language>

Target:
private void validateCloudLocationScheme(String cloudPlatform, String location, ValidationResult.ValidationResultBuilder resultBuilder) { try { URI uri = new URI(location); if (AWS.equalsIgnoreCase(cloudPlatform)) { if (uri.getScheme() != null) { Matcher matcher = AWS_PATTERN.matcher(uri.getScheme()); if (!matcher.find()) { resultBuilder.error("Incorrect URL scheme for AWS cloud platform: " + location); } } } else if (AZURE.equalsIgnoreCase(cloudPlatform)) { if (uri.getScheme() != null) { Matcher matcher = AZURE_PATTERN.matcher(uri.getScheme()); if (!matcher.find()) { resultBuilder.error("Incorrect URL scheme for Azure cloud platform: " + location); } } } else { resultBuilder.error("Cloud platform " + cloudPlatform + " not supported for backup/restore"); } } catch (URISyntaxException e) { resultBuilder.error("Unable to parse URI for location: " + location); } }
Source:
<code>public Object visitClearCommand(InvocationContext ctx, ClearCommand command) throws Throwable { svm.clearInvalidations(); if (ctx.isOriginLocal() && !isLocalModeForced(command)) { <START> if (!isSynchronous(command)) { <END> rpcManager.sendToAll(command, DeliverOrder.PER_SENDER); return invokeNextThenAccept(ctx, command, clearHandler); } RpcOptions rpcOptions = rpcManager.getSyncRpcOptions(); MapResponseCollector collector = MapResponseCollector.ignoreLeavers(); return makeStage(asyncInvokeNext(ctx, command, rpcManager.invokeCommandOnAll(command, collector, rpcOptions))) .thenAccept(ctx, command, clearHandler); } else { return invokeNextThenAccept(ctx, command, clearHandler); } }</code><technical_language>I invert if</technical_language>

Target:
public Object visitClearCommand(InvocationContext ctx, ClearCommand command) throws Throwable { svm.clearInvalidations(); if (ctx.isOriginLocal() && !isLocalModeForced(command)) { if (isSynchronous(command)) { RpcOptions rpcOptions = rpcManager.getSyncRpcOptions(); MapResponseCollector collector = MapResponseCollector.ignoreLeavers(); return makeStage( asyncInvokeNext(ctx, command, rpcManager.invokeCommandOnAll(command, collector, rpcOptions))) .thenAccept(ctx, command, clearHandler); } else { rpcManager.sendToAll(command, DeliverOrder.PER_SENDER); return invokeNextThenAccept(ctx, command, clearHandler); } } else { return invokeNextThenAccept(ctx, command, clearHandler); } }
Source:
<code>public static Object withBundle(Bundle aBundle, RunnableWithException aCode, List<URL> additionalURLs) throws RuntimeException { <START> if (Thread.currentThread().isInterrupted() || CCWPlugin.canLoadCodeInBundle()) { <END> return null; } initialize(); DynamicClassLoader loader = getDynamicClassLoader(aBundle, additionalURLs); IPersistentMap bindings = RT.map(Compiler.LOADER, loader); bindings = bindings.assoc(RT.USE_CONTEXT_CLASSLOADER, true); boolean pushed = true; ClassLoader saved = Thread.currentThread().getContextClassLoader(); try { Thread.currentThread().setContextClassLoader(loader); try { Var.pushThreadBindings(bindings); } catch (RuntimeException aEx) { pushed = false; throw aEx; } return aCode.run(); } catch (Exception e) { String msg = "Exception while executing code from bundle " + aBundle.getSymbolicName(); CCWPlugin.getTracer().trace(TraceOptions.CLOJURE_OSGI, e, msg); throw new RuntimeException(msg, e); } finally { if (pushed) { Var.popThreadBindings(); } Thread.currentThread().setContextClassLoader(saved); } }</code><technical_language>test !CCWPlugin.canLoadCodeInBundle()</technical_language>

Target:
public static Object withBundle(Bundle aBundle, RunnableWithException aCode, List<URL> additionalURLs) throws RuntimeException { if (Thread.currentThread().isInterrupted() || !CCWPlugin.canLoadCodeInBundle()) { return null; } initialize(); DynamicClassLoader loader = getDynamicClassLoader(aBundle, additionalURLs); IPersistentMap bindings = RT.map(Compiler.LOADER, loader); bindings = bindings.assoc(RT.USE_CONTEXT_CLASSLOADER, true); boolean pushed = true; ClassLoader saved = Thread.currentThread().getContextClassLoader(); try { Thread.currentThread().setContextClassLoader(loader); try { Var.pushThreadBindings(bindings); } catch (RuntimeException aEx) { pushed = false; throw aEx; } return aCode.run(); } catch (Exception e) { String msg = "Exception while executing code from bundle " + aBundle.getSymbolicName(); CCWPlugin.getTracer().trace(TraceOptions.CLOJURE_OSGI, e, msg); throw new RuntimeException(msg, e); } finally { if (pushed) { Var.popThreadBindings(); } Thread.currentThread().setContextClassLoader(saved); } }
Source:
<code>private static ExprEval evalAsString(ExprEval eval) { String stringValue = eval.asString(); if (stringValue == null) { return eval; } try { <START> long longValue = Long.parseLong(stringValue); <END> return evalLong(longValue); } catch (NumberFormatException ignored) { } return ExprEval.of(IPv4AddressExprUtils.extractIPv4Address(stringValue)); }</code><technical_language>this method is sort of duplicating functionality in StringExprEval.asLong, instead</technical_language>

Target:
private static ExprEval evalAsString(ExprEval eval) { if (IPv4AddressExprUtils.isValidAddress(eval.asString())) { return eval; } return ExprEval.of(null); }
Source:
<code>public KnoxShellTable lessThanOrEqualTo(Comparable<? extends Object> comparable) throws KnoxShellTableFilterException { <START> return filter(s -> s.compareTo(comparable) < 0 || s.compareTo(comparable) == 0); <END> }</code><technical_language>equals() for gt lt</technical_language>

Target:
public KnoxShellTable lessThanOrEqualTo(Comparable<? extends Object> comparable) throws KnoxShellTableFilterException { return filter(s -> s.compareTo(comparable) < 0 || s.equals(comparable)); }
Source:
<code><START> public Mono<Response<IndexDocumentsResult>> uploadDocumentsWithResponse(Iterable<?> documents) { <END> return withContext(context -> uploadDocumentsWithResponse(documents, context)); }</code><technical_language>@JonathanGiles TextAnalytics List input param for collection while Search Iterable. Do guidance used</technical_language>

Target:
public Mono<Response<IndexDocumentsResult>> uploadDocumentsWithResponse(Iterable<?> documents) { try { return withContext(context -> uploadDocumentsWithResponse(documents, context)); } catch (RuntimeException ex) { return monoError(logger, ex); } }
Source:
<code>public List<Double> getAverageOrderingOfTasksForNotTemplateProcessesForProjectIdOrderByOrdering(Integer projectId) { return getAverage("SELECT AVG(t.ordering) FROM Task AS t INNER JOIN t.process AS p INNER JOIN p.project AS pr " <START> + "WITH pr.id = " + projectId + " GROUP BY t.title ORDER BY t.ordering"); <END> }</code><technical_language>change query parameters other places</technical_language>

Target:
public List<Double> getAverageOrderingOfTasksForNotTemplateProcessesForProjectIdOrderByOrdering(Integer projectId) { Map<String, Object> parameters = new HashMap<>(); parameters.put("projectId", projectId); return getAverage("SELECT AVG(t.ordering) FROM Task AS t INNER JOIN t.process AS p INNER JOIN p.project AS pr " + "WITH pr.id = :projectId GROUP BY t.title ORDER BY t.ordering", parameters); }
Source:
<code><START> public VCFIterator open(final File file) throws IOException { <END> IOUtil.assertFileIsReadable(file); return open(new FileInputStream(file)); }</code><technical_language>I love a java.nio.Path method too</technical_language>

Target:
public VCFIterator open(final File file) throws IOException { return this.open(file.toPath()); }
Source:
<code>protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_edit_profile); ButterKnife.bind(this); firstNameInput = (TextInputEditText) firstNameWrapper.getEditText(); lastNameInput = (TextInputEditText) lastNameWrapper.getEditText(); getSupportActionBar().setDisplayHomeAsUpEnabled(true); editProfileActivityViewModel = ViewModelProviders.of(this).get(EditProfileActivityViewModel.class); editProfileActivityViewModel.getUser().observe(this, user -> { this.user = user; showUserData(user); }); avatar.setOnClickListener(v -> showFileChooser()); save.setOnClickListener(v -> { Views.hideKeyboard(this, this.getCurrentFocus()); saveChanges(); }); ActivityCompat.requestPermissions(EditProfileActivity.this, new String[]{Manifest.permission.READ_EXTERNAL_STORAGE},1); <START> } <END></code><technical_language>Poor code formatting. Please check Java code style guidelines</technical_language>

Target:
protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_edit_profile); ButterKnife.bind(this); firstNameInput = (TextInputEditText) firstNameWrapper.getEditText(); lastNameInput = (TextInputEditText) lastNameWrapper.getEditText(); getSupportActionBar().setDisplayHomeAsUpEnabled(true); editProfileActivityViewModel = ViewModelProviders.of(this).get(EditProfileActivityViewModel.class); editProfileActivityViewModel.getUser().observe(this, user -> { this.user = user; showUserData(user); }); permissionGranted = checkReadExternalPermission(); avatar.setOnClickListener(v -> { if (permissionGranted) { showFileChooser(); } else { ActivityCompat.requestPermissions(EditProfileActivity.this, READ_STORAGE, REQUEST_CODE); } }); save.setOnClickListener(v -> { Views.hideKeyboard(this, this.getCurrentFocus()); saveChanges(); }); }
Source:
<code>public void hashcodeTest() { VariantDeclaration a = new VariantDeclaration(); VariantDeclaration b = new VariantDeclaration(); b.addField("hi", StringDeclaration.getStringDeclaration(Encoding.UTF8)); VariantDeclaration c = new VariantDeclaration(); c.addField("hi", StringDeclaration.getStringDeclaration(Encoding.UTF8)); <START> assertEquals(fixture.hashCode(), a.hashCode()); <END> assertEquals(b.hashCode(), c.hashCode()); }</code><technical_language>move this line "VariantDeclaration a = ..." line, empty line after. clearer parts of test</technical_language>

Target:
public void hashcodeTest() { VariantDeclaration a = new VariantDeclaration(); assertEquals(fixture.hashCode(), a.hashCode()); VariantDeclaration b = new VariantDeclaration(); b.addField("hi", StringDeclaration.getStringDeclaration(Encoding.UTF8)); VariantDeclaration c = new VariantDeclaration(); c.addField("hi", StringDeclaration.getStringDeclaration(Encoding.UTF8)); assertEquals(b.hashCode(), c.hashCode()); }
Source:
<code>public Page<String> findInStatusSince( long timestamp, WorkspaceStatus status, int maxItems, long skipCount) { List<String> all = workspaceActivities .values() .stream() .filter(a -> a.getStatus() == status) .filter( <START> a -> { <END> switch (status) { case STOPPED: case STOPPING: case RUNNING: case STARTING: return isGreater(a.getLastStopped(), timestamp); default: return false; } }) .map(WorkspaceActivity::getWorkspaceId) .collect(toList()); int total = all.size(); int from = skipCount > total ? total : (int) skipCount; int to = from + maxItems; if (to > total) { to = total; } List<String> page = all.subList(from, to); return new Page<>(page, skipCount, maxItems, all.size()); }</code><technical_language>This filter simplified a -> a.getStatus() == status && isGreater(a.getLastStopped(), timestamp)</technical_language>

Target:
public Page<String> findInStatusSince( long timestamp, WorkspaceStatus status, int maxItems, long skipCount) { List<String> all = workspaceActivities .values() .stream() .filter(a -> a.getStatus() == status && isGreater(a.getLastStopped(), timestamp)) .map(WorkspaceActivity::getWorkspaceId) .collect(toList()); int total = all.size(); int from = skipCount > total ? total : (int) skipCount; int to = from + maxItems; if (to > total) { to = total; } List<String> page = all.subList(from, to); return new Page<>(page, skipCount, maxItems, all.size()); }
Source:
<code>private void updateBusText(View view) { final TextView textView = (TextView) view.findViewById(R.id.textViewBusInformation); WifiHelper wifiHelper = new WifiHelper(this.getActivity()); if (this.busManager.isOnBus()) { textView.setText(this.busManager.getCurrentBus().getDGW()); } else if (wifiHelper.isWifiEnabled()) { textView.setText(R.string.loading_looking_for_vehicle); } else { textView.setText(R.string.you_must_activate_wifi); <START> } <END> }</code><technical_language>This hold if buses near. message displayed? (Should be?)</technical_language>

Target:
private void updateBusText(View view) { final TextView textView = (TextView) view.findViewById(R.id.textViewBusInformation); WifiHelper wifiHelper = new WifiHelper(this.getActivity()); if (this.busManager.isOnBus()) { textView.setText(this.busManager.getCurrentBus().getDGW()); } else if (!wifiHelper.isWifiEnabled()) { textView.setText(R.string.you_must_activate_wifi); } else { textView.setText(R.string.no_buses_near); } }
Source:
<code>public void doPost(HttpServletRequest req, HttpServletResponse resp) throws IOException { String candidate_str = req.getParameter("candidate"); Vote vote = new Vote(Candidate.valueOf(candidate_str).ordinal()); ofy().save().entity(vote).now(); ArrayList<Vote> fakeVotes = new ArrayList<Vote>(); for (Candidate c: Candidate.values()) { Vote fakeVote = new Vote(c.ordinal()); <START> ofy().save().entity(fakeVote).now(); <END> fakeVotes.add(fakeVote); } req.setAttribute("realVote", vote); req.setAttribute("fakeVotes", fakeVotes); req.setAttribute("numFakeVoteBatches", 1); RequestDispatcher dispatcher = getServletContext().getRequestDispatcher("/displayVoteKeys.jsp"); try { dispatcher.forward(req, resp); } catch (ServletException e) { e.printStackTrace(); } }</code><technical_language>Style: tab please :)</technical_language>

Target:
public void doPost(HttpServletRequest req, HttpServletResponse resp) throws IOException { String candidate_str = req.getParameter("candidate"); ArrayList<Vote> votes = new ArrayList<Vote>(); Vote vote = new Vote(Candidate.valueOf(candidate_str).ordinal()); ofy().save().entity(vote).now(); votes.add(vote); for (Candidate c: Candidate.values()) { Vote fakeVote = new Vote(c.ordinal()); ofy().save().entity(fakeVote).now(); votes.add(fakeVote); } req.setAttribute("votes", votes); req.setAttribute("numFakeVoteBatches", 1); RequestDispatcher dispatcher = getServletContext().getRequestDispatcher("/displayVoteKeys.jsp"); try { dispatcher.forward(req, resp); } catch (ServletException e) { e.printStackTrace(); } }
Source:
<code>public RawStatement(CFName name, boolean ifNotExists) { super(name); this.ifNotExists = ifNotExists; this.isVirtual = false; this.klass = null; <START> assert isVirtual == (klass != null); <END> }</code><technical_language>Sorta OT, stop this Preconditions throw IAEs. I hate fact a user disable of error checking w. a command line arg</technical_language>

Target:
public RawStatement(CFName name, boolean ifNotExists) { super(name); this.ifNotExists = ifNotExists; this.isVirtual = false; this.klass = null; Preconditions.checkArgument(isVirtual == (klass != null)); }
Source:
<code>public void executeCommand() { Pair<Boolean, VmJob> isMergeRunning = isMergeRunning(); if (isMergeRunning.getFirst()) { <START> log.debug("Merge <END> is already running, job id is: {}", isMergeRunning.getSecond().getId()); continueCommandExecution(isMergeRunning.getSecond().getId()); } else { VDSReturnValue vdsReturnValue = runVdsCommand(VDSCommandType.Merge, createVDSParameters()); if (vdsReturnValue.getSucceeded()) { continueCommandExecution((Guid)vdsReturnValue.getReturnValue()); log.debug("Merge started successfully"); } else { log.error("Failed to start Merge on VDS"); setCommandStatus(CommandStatus.FAILED); } } }</code><technical_language>This rare is kind of exceptional, worth info level IMO</technical_language>

Target:
public void executeCommand() { Pair<Boolean, VmBlockJob> isMergeRunning = isMergeRunning(); if (isMergeRunning.getFirst()) { log.info("Merge is already running, job id is: {}", isMergeRunning.getSecond().getId()); continueCommandExecution(isMergeRunning.getSecond().getId()); } else { VDSReturnValue vdsReturnValue = runVdsCommand(VDSCommandType.Merge, createVDSParameters()); isMergeRunning = isMergeRunning(); if (vdsReturnValue.getSucceeded()) { continueCommandExecution((Guid)vdsReturnValue.getReturnValue()); log.debug("Merge started successfully"); } else { log.error("Failed to start Merge on VDS"); setCommandStatus(CommandStatus.FAILED); } } }
Source:
<code>private static boolean containsRemoteForUrl(Config config, URIish url) throws URISyntaxException { Set<String> remotes = config.getSubsections(ConfigConstants.CONFIG_REMOTE_SECTION); for (String remote : remotes) { String remoteUrl = config.getString( ConfigConstants.CONFIG_REMOTE_SECTION, remote, ConfigConstants.CONFIG_KEY_URL); URIish existingUrl = new URIish(remoteUrl); <START> if (existingUrl.equals(url)) { <END> return true; } } return false; }</code><technical_language>style-nit: curly brackets single line blocks</technical_language>

Target:
private static boolean containsRemoteForUrl(Config config, URIish url) throws URISyntaxException { Set<String> remotes = config.getSubsections(ConfigConstants.CONFIG_REMOTE_SECTION); for (String remote : remotes) { String remoteUrl = config.getString( ConfigConstants.CONFIG_REMOTE_SECTION, remote, ConfigConstants.CONFIG_KEY_URL); URIish existingUrl = new URIish(remoteUrl); if (existingUrl.equals(url)) return true; } return false; }
Source:
<code>public void testPartitionMergePolicy() throws Throwable { final List<ViewChangedHandler> listeners = new ArrayList<>(); for (int i = 0; i < caches().size(); i++) { ViewChangedHandler listener = new ViewChangedHandler(); cache(i).getCacheManager().addListener(listener); listeners.add(listener); } beforeSplit(); splitCluster(new int[]{0, 1}, new int[]{2, 3}); eventually(() -> { <START> for (ViewChangedHandler l : listeners) <END> if (!l.isNotified()) return false; return true; }); eventuallyEquals(2, () -> advancedCache(0).getRpcManager().getTransport().getMembers().size()); eventually(() -> clusterAndChFormed(0, 2)); eventually(() -> clusterAndChFormed(1, 2)); eventually(() -> clusterAndChFormed(2, 2)); eventually(() -> clusterAndChFormed(3, 2)); duringSplit(); partition(0).merge(partition(1)); assertTrue(clusterAndChFormed(0, 4)); assertTrue(clusterAndChFormed(1, 4)); assertTrue(clusterAndChFormed(2, 4)); assertTrue(clusterAndChFormed(3, 4)); TestingUtil.waitForNoRebalance(caches()); afterMerge(); }</code><technical_language>listeners.stream().allMatch(ViewChangedHandler::isNotified)</technical_language>

Target:
public void testPartitionMergePolicy() throws Throwable { final List<ViewChangedHandler> listeners = new ArrayList<>(); for (int i = 0; i < caches().size(); i++) { ViewChangedHandler listener = new ViewChangedHandler(); cache(i).getCacheManager().addListener(listener); listeners.add(listener); } beforeSplit(); splitCluster(new int[]{0, 1}, new int[]{2, 3}); eventually(() -> listeners.stream().allMatch(ViewChangedHandler::isNotified)); eventuallyEquals(2, () -> advancedCache(0).getRpcManager().getTransport().getMembers().size()); eventually(() -> clusterAndChFormed(0, 2)); eventually(() -> clusterAndChFormed(1, 2)); eventually(() -> clusterAndChFormed(2, 2)); eventually(() -> clusterAndChFormed(3, 2)); duringSplit(); performMerge(); afterMerge(); }
Source:
<code>public void refresh() throws IOException { synchronized (lock) { <START> JsonWebSignature.Header header = new JsonWebSignature.Header(); <END> header.setAlgorithm("RS256"); header.setType("JWT"); header.setKeyId(privateKeyId); JsonWebToken.Payload payload = new JsonWebToken.Payload(); long currentTime = clock.currentTimeMillis(); payload.setAudience(claims.getAudience()); payload.setIssuer(claims.getIssuer()); payload.setSubject(claims.getSubject()); payload.setIssuedAtTimeSeconds(currentTime / 1000); expiryInSeconds = currentTime / 1000 + lifeSpanSeconds; payload.setExpirationTimeSeconds(expiryInSeconds); JsonFactory jsonFactory = OAuth2Utils.JSON_FACTORY; try { jwt = JsonWebSignature.signUsingRsaSha256(privateKey, jsonFactory, header, payload); } catch (GeneralSecurityException e) { throw new IOException("Error signing service account JWT access header with private key.", e); } } }</code><technical_language>could/should some of this--setting local variables--be moved of synchronized block short possible</technical_language>

Target:
public void refresh() throws IOException { JsonWebSignature.Header header = new JsonWebSignature.Header(); header.setAlgorithm("RS256"); header.setType("JWT"); header.setKeyId(privateKeyId); JsonWebToken.Payload payload = new JsonWebToken.Payload(); payload.setAudience(jwtClaims.getAudience()); payload.setIssuer(jwtClaims.getIssuer()); payload.setSubject(jwtClaims.getSubject()); long currentTime = clock.currentTimeMillis(); payload.setIssuedAtTimeSeconds(currentTime / 1000); payload.setExpirationTimeSeconds(currentTime / 1000 + lifeSpanSeconds); synchronized (lock) { this.expiryInSeconds = payload.getExpirationTimeSeconds(); try { this.jwt = JsonWebSignature.signUsingRsaSha256( privateKey, OAuth2Utils.JSON_FACTORY, header, payload); } catch (GeneralSecurityException e) { throw new IOException( "Error signing service account JWT access header with private key.", e); } } }
Source:
<code>public OngoingConfiguration respondsWithDefaultStatus(final int defaultStatus) { <START> jadlerMockerContainer.get().setDefaultStatus(defaultStatus); <END> return this; }</code><technical_language>Duplicate code, call with\* method</technical_language>

Target:
public OngoingConfiguration respondsWithDefaultStatus(final int defaultStatus) { return this.withDefaultResponseStatus(defaultStatus); }
Source:
<code>public void should_print_deprecation_warning_if_legacy_properties_used_from_6_2() throws Exception { context.setRuntime(SONAR_QUBE_6_2); context.settings().setProperty(COVERAGE_KEY, "coverage report"); assertThat(importersFactory.deprecationWarnings()).containsExactly( String.format(DEPRECATION_WARNING_TEMPLATE, COVERAGE_KEY)); context.settings().setProperty(IT_COVERAGE_KEY, "integration coverage report"); context.settings().setProperty(OVERALL_COVERAGE_KEY, "overall coverage report"); <START> assertThat(importersFactory.deprecationWarnings()).containsExactly( <END> String.format(DEPRECATION_WARNING_TEMPLATE, COVERAGE_KEY), String.format(DEPRECATION_WARNING_TEMPLATE, IT_COVERAGE_KEY), String.format(DEPRECATION_WARNING_TEMPLATE, OVERALL_COVERAGE_KEY)); }</code><technical_language>@inverno hard read 2 groups of assertions method empty line</technical_language>

Target:
public void should_print_deprecation_warning_if_legacy_properties_used_from_6_2() throws Exception { context.setRuntime(SONARQUBE_6_2); context.settings().setProperty(COVERAGE_KEY, "coverage report"); assertThat(importersFactory.deprecationWarnings()).containsExactly( String.format(DEPRECATION_WARNING_TEMPLATE, COVERAGE_KEY)); context.settings().setProperty(IT_COVERAGE_KEY, "integration coverage report"); context.settings().setProperty(OVERALL_COVERAGE_KEY, "overall coverage report"); assertThat(importersFactory.deprecationWarnings()).containsExactly( String.format(DEPRECATION_WARNING_TEMPLATE, COVERAGE_KEY), String.format(DEPRECATION_WARNING_TEMPLATE, IT_COVERAGE_KEY), String.format(DEPRECATION_WARNING_TEMPLATE, OVERALL_COVERAGE_KEY)); }
Source:
<code>public void setup() throws Exception { SpatialCRSSchemaIndex.Supplier indexSupplier = mock( SpatialCRSSchemaIndex.Supplier.class ); IndexDescriptor descriptor = IndexDescriptorFactory.forLabel( 42, 1337 ); for ( CoordinateReferenceSystem crs : asList( CoordinateReferenceSystem.WGS84, CoordinateReferenceSystem.Cartesian, <START> CoordinateReferenceSystem.Cartesian_3D ) ) <END> { indexMap.put( crs, mock( SpatialCRSSchemaIndex.class ) ); when( indexSupplier.get( descriptor, indexMap, 0, crs ) ).thenReturn( indexMap.get( crs ) ); } IndexSamplingConfig samplingConfig = mock( IndexSamplingConfig.class ); when( samplingConfig.sampleSizeLimit() ).thenReturn( 8_000_000 ); fusionIndexPopulator = new SpatialFusionIndexPopulator( indexMap, 0, descriptor, samplingConfig, indexSupplier ); }</code><technical_language>is reason WGS84-3D is excluded</technical_language>

Target:
public void setup() throws Exception { SpatialCRSSchemaIndex.Supplier indexSupplier = mock( SpatialCRSSchemaIndex.Supplier.class ); SchemaIndexDescriptor descriptor = SchemaIndexDescriptorFactory.forLabel( 42, 1337 ); for ( CoordinateReferenceSystem crs : asList( CoordinateReferenceSystem.WGS84, CoordinateReferenceSystem.Cartesian, CoordinateReferenceSystem.Cartesian_3D ) ) { indexMap.put( crs, mock( SpatialCRSSchemaIndex.class ) ); when( indexSupplier.get( descriptor, indexMap, 0, crs ) ).thenReturn( indexMap.get( crs ) ); } IndexSamplingConfig samplingConfig = mock( IndexSamplingConfig.class ); when( samplingConfig.sampleSizeLimit() ).thenReturn( 8_000_000 ); fusionIndexPopulator = new SpatialFusionIndexPopulator( indexMap, 0, descriptor, samplingConfig, indexSupplier ); }
Source:
<code>public void testParseModeEnum() { assertEquals("Plain Java", ParseMode.PLAIN_JAVA.toString()); assertEquals("Java with comments", ParseMode.JAVA_WITH_COMMENTS.toString()); assertEquals("Java with comments and Javadocs", ParseMode.JAVA_WITH_JAVADOC_AND_COMMENTS.toString()); final int expectedEnumerations = 3; <START> assertEquals(expectedEnumerations, ParseMode.values().length); <END> }</code><technical_language>please remove this "assert", is required , do good in future updates</technical_language>

Target:
public void testParseModeEnum() { for (final ParseMode parseMode : ParseMode.values()) { switch (parseMode) { case PLAIN_JAVA: assertEquals("Plain Java", parseMode.toString()); break; case JAVA_WITH_COMMENTS: assertEquals("Java with comments", parseMode.toString()); break; case JAVA_WITH_JAVADOC_AND_COMMENTS: assertEquals("Java with comments and Javadocs", parseMode.toString()); break; default: fail("Unexpected enum value"); } } }
Source:
<code>public View getCurrentView(OptionsProvider options) throws BrokenDiffAwarenessException { boolean watchFs = options.getOptions(Options.class).watchFS && (OS.getCurrent() != OS.WINDOWS || options.getOptions(Options.class).windowsWatchFS); if (watchFs && watchService == null) { init(); } else if (!watchFs && (watchService != null)) { close(); throw new BrokenDiffAwarenessException("Switched off --watchfs again"); } if (watchService == null) { return EVERYTHING_MODIFIED; } Set<Path> modifiedAbsolutePaths; if (isFirstCall()) { try { <START> if(OS.getCurrent() == OS.WINDOWS) { <END> WatchKey key = watchRootPath.register( watchService, new WatchEvent.Kind[] { StandardWatchEventKinds.ENTRY_CREATE, StandardWatchEventKinds.ENTRY_MODIFY, StandardWatchEventKinds.ENTRY_DELETE, }, ExtendedWatchEventModifier.FILE_TREE); watchKeyToDirBiMap.put(key, watchRootPath); } else { registerSubDirectoriesAndReturnContents(watchRootPath); } } catch (IOException e) { close(); throw new BrokenDiffAwarenessException( "Error encountered with local file system watcher " + e); } modifiedAbsolutePaths = ImmutableSet.of(); } else { try { modifiedAbsolutePaths = collectChanges(); } catch (BrokenDiffAwarenessException e) { close(); throw e; } catch (IOException e) { close(); throw new BrokenDiffAwarenessException( "Error encountered with local file system watcher " + e); } catch (ClosedWatchServiceException e) { throw new BrokenDiffAwarenessException( "Internal error with the local file system watcher " + e); } } return newView(modifiedAbsolutePaths); }</code><technical_language>good call OS.getCurrent() in constructor, store in a field, here</technical_language>

Target:
public View getCurrentView(OptionsProvider options) throws BrokenDiffAwarenessException { boolean watchFs = options.getOptions(Options.class).watchFS && (!isWindows || options.getOptions(Options.class).windowsWatchFS); if (watchFs && watchService == null) { init(); } else if (!watchFs && (watchService != null)) { close(); throw new BrokenDiffAwarenessException("Switched off --watchfs again"); } if (watchService == null) { return EVERYTHING_MODIFIED; } Set<Path> modifiedAbsolutePaths; if (isFirstCall()) { try { if(isWindows) { WatchKey key = watchRootPath.register( watchService, new Kind<?>[] { StandardWatchEventKinds.ENTRY_CREATE, StandardWatchEventKinds.ENTRY_MODIFY, StandardWatchEventKinds.ENTRY_DELETE, }, ExtendedWatchEventModifier.FILE_TREE); watchKeyToDirBiMap.put(key, watchRootPath); } else { registerSubDirectoriesAndReturnContents(watchRootPath); } } catch (IOException e) { close(); throw new BrokenDiffAwarenessException( "Error encountered with local file system watcher " + e); } modifiedAbsolutePaths = ImmutableSet.of(); } else { try { modifiedAbsolutePaths = collectChanges(); } catch (BrokenDiffAwarenessException e) { close(); throw e; } catch (IOException e) { close(); throw new BrokenDiffAwarenessException( "Error encountered with local file system watcher " + e); } catch (ClosedWatchServiceException e) { throw new BrokenDiffAwarenessException( "Internal error with the local file system watcher " + e); } } return newView(modifiedAbsolutePaths); }