auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>public JsonRuntimeReporterHelper() { try { File workingDir = new File(Config.getConfigProperty(ConfigProperty.WORK_DIR)); boolean isCreated = workingDir.mkdirs(); <START> logger.log(Level.FINER,"Is working directory creation successful:"+ isCreated); <END> jsonCompletedTest = File.createTempFile("selion-rrct", null, workingDir); jsonCompletedTest.deleteOnExit(); jsonCompletedConfig = File.createTempFile("selion-rrcf", null, workingDir); jsonCompletedConfig.deleteOnExit(); } catch (IOException e) { logger.log(Level.SEVERE, e.getMessage(), e); throw new ReporterException(e); } }</code><technical_language>Please reword this message fix formatting. I suggest; java logger.log(Level.FINER, "Working directory created successfully: " + isCreated); said, if successfully created. be? If not, bother logging message</technical_language>

Target:
public JsonRuntimeReporterHelper() { try { File workingDir = new File(Config.getConfigProperty(ConfigProperty.WORK_DIR)); boolean isCreated = workingDir.mkdirs(); logger.log(Level.FINER, "Working directory created successfully: " + isCreated); jsonCompletedTest = File.createTempFile("selion-rrct", null, workingDir); jsonCompletedTest.deleteOnExit(); jsonCompletedConfig = File.createTempFile("selion-rrcf", null, workingDir); jsonCompletedConfig.deleteOnExit(); } catch (IOException e) { logger.log(Level.SEVERE, e.getMessage(), e); throw new ReporterException(e); } }
Source:
<code>public void uploadSnapshotTest_alreadyExistingIndex() throws IOException, InterruptedException, ExecutionException{ String indexName = getLiveIndex(); File snapshot = null; try { snapshot = esIndexAPI.createSnapshot(ESIndexAPI.BACKUP_REPOSITORY, "backup", indexName); ZipFile file = new ZipFile(snapshot.getAbsolutePath()); String pathToRepo = Config.getStringProperty("es.path.repo","test-resources"); File tempDir = new File(pathToRepo); esIndexAPI.uploadSnapshot(file, tempDir.getAbsolutePath(), "backup"); } catch (DotStateException | IllegalArgumentException | IOException e) { <START> e.printStackTrace(); <END> }finally{ snapshot.delete(); } }</code><technical_language>Remove catch</technical_language>

Target:
public void uploadSnapshotTest_alreadyExistingIndex() throws IOException, InterruptedException, ExecutionException{ String indexName = getLiveIndex(); File snapshot = null; snapshot = esIndexAPI.createSnapshot(ESIndexAPI.BACKUP_REPOSITORY, "backup", indexName); ZipFile file = new ZipFile(snapshot.getAbsolutePath()); String pathToRepo = Config.getStringProperty("es.path.repo","test-resources"); File tempDir = new File(pathToRepo); esIndexAPI.uploadSnapshot(file, tempDir.getAbsolutePath()); if(snapshot!=null){ snapshot.delete(); } }
Source:
<code>public void before() throws IOException, MembershipConfigurationException { <START> localHost = InetAddress.getLocalHost(); <END> dsfidSerializer = new DSFIDSerializerImpl(); socketCreator = new TcpSocketCreatorImpl(); }</code><technical_language>This LocalHostUtil.getLocalHost()</technical_language>

Target:
public void before() throws IOException, MembershipConfigurationException { localHost = LocalHostUtil.getLocalHost(); dsfidSerializer = new DSFIDSerializerImpl(); socketCreator = new TcpSocketCreatorImpl(); }
Source:
<code>private void toggleDivider() { if (divider == null) return; if (!showDivider) { divider.setVisibility(GONE); } boolean shallHide = ( date != null && date.getVisibility() != VISIBLE && weatherLayout.getVisibility() != VISIBLE ); if (shallHide) { if (showDivider) { divider.setVisibility(INVISIBLE); } setBackgroundColor(Color.parseColor("#00000000")); } else { if (showDivider) { divider.setVisibility(VISIBLE); } GradientDrawable shape = new GradientDrawable(); <START> shape.setCornerRadius( Settings.getRoundCorners(context) ); <END> shape.setColor(Color.parseColor("#44000000")); setBackground(shape); } }</code><technical_language>suggestion is remove preference set radius 50 suggestion shape.setCornerRadius(50);</technical_language>

Target:
private void toggleDivider() { if (divider == null) return; if (!showDivider) { divider.setVisibility(GONE); } boolean shallHide = ( date != null && date.getVisibility() != VISIBLE && weatherLayout.getVisibility() != VISIBLE ); if (shallHide) { if (showDivider) { divider.setVisibility(INVISIBLE); } setBackgroundColor(Color.parseColor("#00000000")); } else { if (showDivider) { divider.setVisibility(VISIBLE); } GradientDrawable shape = new GradientDrawable(); shape.setCornerRadius(30); shape.setColor(Color.parseColor("#44000000")); setBackground(shape); } }
Source:
<code>public void testMissingValueReplacement() { String regex = "(a\\w*)"; ExtractionFn extractionFn = new RegexDimExtractionFn(regex, true, "foobar", false); Set<String> extracted = Sets.newHashSet(); for (String testString : testStrings) { extracted.add(extractionFn.apply(testString)); } Assert.assertEquals(4, extracted.size()); Assert.assertTrue(extracted.contains("apple")); Assert.assertTrue(extracted.contains("awesome")); Assert.assertTrue(extracted.contains("asylum")); Assert.assertTrue(extracted.contains("foobar")); byte[] cacheKey = extractionFn.getCacheKey(); <START> Assert.assertEquals(17, cacheKey.length); <END> ExtractionFn nullExtractionFn = new RegexDimExtractionFn(regex, true, null, false); Set<String> extracted2 = Sets.newHashSet(); for (String testString : testStrings) { extracted2.add(nullExtractionFn.apply(testString)); } Assert.assertEquals(4, extracted2.size()); Assert.assertTrue(extracted2.contains("apple")); Assert.assertTrue(extracted2.contains("awesome")); Assert.assertTrue(extracted2.contains("asylum")); Assert.assertTrue(extracted2.contains(null)); cacheKey = nullExtractionFn.getCacheKey(); Assert.assertEquals(11, cacheKey.length); }</code><technical_language>arrays compare bytes</technical_language>

Target:
public void testMissingValueReplacement() { String regex = "(a\\w*)"; ExtractionFn extractionFn = new RegexDimExtractionFn(regex, true, "foobar"); Set<String> extracted = Sets.newLinkedHashSet(); for (String testString : testStrings) { extracted.add(extractionFn.apply(testString)); } Set<String> expected = Sets.newLinkedHashSet(ImmutableList.of("apple", "awesome", "asylum", "foobar")); Assert.assertEquals(expected, extracted); byte[] cacheKey = extractionFn.getCacheKey(); byte[] expectedCacheKey = new byte[]{ 0x01, 0x28, 0x61, 0x5C, 0x77, 0x2A, 0x29, (byte) 0xFF, 0x66, 0x6F, 0x6F, 0x62, 0x61, 0x72, (byte) 0xFF, 0x01 }; Assert.assertArrayEquals(expectedCacheKey, cacheKey); ExtractionFn nullExtractionFn = new RegexDimExtractionFn(regex, true, null); Set<String> extracted2 = Sets.newLinkedHashSet(); for (String testString : testStrings) { extracted2.add(nullExtractionFn.apply(testString)); } Set<String> expected2 = Sets.newLinkedHashSet(ImmutableList.of("apple", "awesome", "asylum")); expected2.add(null); Assert.assertEquals(expected2, extracted2); cacheKey = nullExtractionFn.getCacheKey(); expectedCacheKey = new byte[]{0x01, 0x28, 0x61, 0x5C, 0x77, 0x2A, 0x29, (byte) 0xFF, (byte) 0xFF, 0x01}; Assert.assertArrayEquals(expectedCacheKey, cacheKey); }
Source:
<code>public boolean next() { try { final JSONArray resultsArray = _resultJSONObject.getJSONArray("results"); if (resultsArray.length() > 0) { final JSONObject results = resultsArray.getJSONObject(0); final JSONArray data = results.getJSONArray("data"); if (_currentRowIndex < data.length()) { final JSONObject row = data.getJSONObject(_currentRowIndex); final JSONArray jsonValues = row.getJSONArray("row"); final Object[] objectValues = new Object[jsonValues.length()]; for (int i = 0; i < jsonValues.length(); i++) { <START> objectValues[i] = jsonValues.get(i); <END> } _row = new DefaultRow(new SimpleDataSetHeader(getSelectItems()), objectValues); _currentRowIndex++; return true; } } else { final JSONArray errorArray = _resultJSONObject.getJSONArray("errors"); final JSONObject error = errorArray.getJSONObject(0); throw new IllegalStateException(error.toString()); } } catch (final JSONException e) { throw new IllegalStateException(e); } return false; }</code><technical_language>ColumnTypeResolver resolves JSONArray objects List objects, add some logic values returned of type List</technical_language>

Target:
public boolean next() { try { final JSONArray resultsArray = _resultJSONObject.getJSONArray(NEO4J_KEY_RESPONSE_RESULTS); if (resultsArray.length() > 0) { final JSONObject results = resultsArray.getJSONObject(0); final JSONArray data = results.getJSONArray(NEO4J_KEY_DATA); if (_currentRowIndex < data.length()) { final JSONObject row = data.getJSONObject(_currentRowIndex); final JSONArray jsonValues = row.getJSONArray(NEO4J_KEY_RESPONSE_ROW); final Object[] objectValues = new Object[jsonValues.length()]; for (int i = 0; i < jsonValues.length(); i++) { final Object value = jsonValues.get(i); if (value instanceof JSONArray) { objectValues[i] = convertJSONArrayToList((JSONArray) value); } else { objectValues[i] = value; } } _row = new DefaultRow(new SimpleDataSetHeader(getSelectItems()), objectValues); _currentRowIndex++; return true; } } else { final JSONArray errorArray = _resultJSONObject.getJSONArray("errors"); final JSONObject error = errorArray.getJSONObject(0); throw new IllegalStateException(error.toString()); } } catch (final JSONException e) { throw new IllegalStateException(e); } return false; }
Source:
<code>public ResponseEntity publish(@RepositoryMapping Repository repository, @PathVariable(name = "name") String name, HttpServletRequest request) throws Exception { <START> if (nameContainsRevision(name)) { <END> return ResponseEntity.status(HttpStatus.OK) .body(""); } final String storageId = repository.getStorage().getId(); final String repositoryId = repository.getId(); logger.info("npm publish request for {}/{}/{}", storageId, repositoryId, name); Pair<PackageVersion, Path> packageEntry; try { packageEntry = extractPackage(name, request.getInputStream()); } catch (IllegalArgumentException e) { logger.error("Failed to extract npm package data", e); return ResponseEntity.badRequest().build(); } PackageVersion packageJson = packageEntry.getValue0(); Path packageTgz = packageEntry.getValue1(); NpmArtifactCoordinates coordinates = NpmArtifactCoordinates.of(name, packageJson.getVersion()); storeNpmPackage(repository, coordinates, packageJson, packageTgz); return ResponseEntity.ok(""); }</code><technical_language>Cosmetic: Braces new lines please. :)</technical_language>

Target:
public ResponseEntity publish(@RepositoryMapping Repository repository, @PathVariable(name = "name") String name, HttpServletRequest request) throws Exception { if (nameContainsRevision(name)) { return ResponseEntity.status(HttpStatus.OK).build(); } final String storageId = repository.getStorage().getId(); final String repositoryId = repository.getId(); logger.info("npm publish request for {}/{}/{}", storageId, repositoryId, name); Pair<PackageVersion, Path> packageEntry; try { packageEntry = extractPackage(name, request.getInputStream()); } catch (IllegalArgumentException e) { logger.error("Failed to extract npm package data", e); return ResponseEntity.badRequest().build(); } PackageVersion packageJson = packageEntry.getValue0(); Path packageTgz = packageEntry.getValue1(); NpmArtifactCoordinates coordinates = NpmArtifactCoordinates.of(name, packageJson.getVersion()); storeNpmPackage(repository, coordinates, packageJson, packageTgz); return ResponseEntity.ok(""); }
Source:
<code>public synchronized List<Datastream> getAllDatastreams(boolean flushCache) { <START> if (flushCache || _datastreams.isEmpty()) { <END> _datastreamNames = fetchAllDatastreamNamesFromZk(); } return _datastreamNames.stream().map(x -> this.getDatastream(x, flushCache)).collect(Collectors.toList()); }</code><technical_language>it. I this is necessary. change _datastreamNames in invalidateAllCache</technical_language>

Target:
public synchronized List<Datastream> getAllDatastreams(boolean flushCache) { if (flushCache) { _datastreamNames = fetchAllDatastreamNamesFromZk(); } return _datastreamNames.stream() .map(x -> this.getDatastream(x, flushCache)) .filter(Objects::nonNull) .collect(Collectors.toList()); }
Source:
<code>private ByteArrayInputStream uploadPackV2(String... inputLines) throws Exception { ByteArrayOutputStream send = new ByteArrayOutputStream(); PacketLineOut pckOut = new PacketLineOut(send); for (String line : inputLines) { if (line == PacketLineIn.END) { pckOut.end(); } else if (line == PacketLineIn.DELIM) { pckOut.writeDelim(); } else { pckOut.writeString(line); } } UploadPack up = new UploadPack(server); up.setUseProtocolV2(true); ByteArrayOutputStream recv = new ByteArrayOutputStream(); up.upload(new ByteArrayInputStream(send.toByteArray()), recv, null); ByteArrayInputStream recvStream = new ByteArrayInputStream(recv.toByteArray()); PacketLineIn pckIn = new PacketLineIn(recvStream); assertThat(pckIn.readString(), is("version 2")); <START> assertThat(pckIn.readString(), is("ls-refs")); assertThat(pckIn.readString(), is("fetch")); <END> assertTrue(pckIn.readString() == PacketLineIn.END); return recvStream; }</code><technical_language>Is this order guaranteed, ls-refs fetch</technical_language>

Target:
private ByteArrayInputStream uploadPackV2(String... inputLines) throws Exception { ByteArrayOutputStream send = new ByteArrayOutputStream(); PacketLineOut pckOut = new PacketLineOut(send); for (String line : inputLines) { if (line == PacketLineIn.END) { pckOut.end(); } else if (line == PacketLineIn.DELIM) { pckOut.writeDelim(); } else { pckOut.writeString(line); } } UploadPack up = new UploadPack(server); up.setUseProtocolV2(true); ByteArrayOutputStream recv = new ByteArrayOutputStream(); up.upload(new ByteArrayInputStream(send.toByteArray()), recv, null); ByteArrayInputStream recvStream = new ByteArrayInputStream(recv.toByteArray()); PacketLineIn pckIn = new PacketLineIn(recvStream); assertThat(pckIn.readString(), is("version 2")); assertThat( Arrays.asList(pckIn.readString(), pckIn.readString()), hasItems("ls-refs", "fetch")); assertTrue(pckIn.readString() == PacketLineIn.END); return recvStream; }
Source:
<code>public void testGetConnectableFileStorageConnectionsByStorageType() { List<StorageServerConnections> conns = dao.getConnectableStorageConnectionsByStorageType(FixturesTool.STORAGE_POOL_NFS_2, StorageType.NFS); assertNotNull(conns); assertEquals(1, conns.size()); for (StorageServerConnections conn : conns) { <START> assertTrue(conn.getstorage_type() == StorageType.NFS); <END> } }</code><technical_language>please user assertEquals</technical_language>

Target:
public void testGetConnectableFileStorageConnectionsByStorageType() { List<StorageServerConnections> conns = dao.getConnectableStorageConnectionsByStorageType(FixturesTool.STORAGE_POOL_NFS_2, StorageType.NFS); assertNotNull(conns); assertEquals(1, conns.size()); for (StorageServerConnections conn : conns) { assertEquals(StorageType.NFS, conn.getstorage_type()); } }
Source:
<code>protected void applyUnchangeableFeature() { <START> getVElement().setEnabled(false); <END> }</code><technical_language>if feature is unchangeable, user do it, set readonly, I misunderstanding unchangeable feature</technical_language>

Target:
protected void applyUnchangeableFeature() { getVElement().setReadonly(true); }
Source:
<code>public boolean isProxyCommand() { <START> String commandName = message.split(" ",2)[0].substring( 1 ); <END> boolean checkDisabled = getSender() instanceof ProxiedPlayer; return ProxyServer.getInstance().getPluginManager().isRunnableCommand( commandName, checkDisabled ); }</code><technical_language>indexOf(" ") -> substring</technical_language>

Target:
public boolean isProxyCommand() { if ( !isCommand() ) { return false; } int index = message.indexOf( " " ); String commandName; if ( index == -1 ) { commandName = message.substring( 1 ); } else { commandName = message.substring( 1, index ); } CommandSender sender; if (getSender() instanceof CommandSender) { sender = (CommandSender) getSender(); } else { sender = null; } return ProxyServer.getInstance().getPluginManager().isRunnableCommand( commandName, sender ); }
Source:
<code>public void define(WebService.NewController context) { WebService.NewAction action = context.createAction(ACTION_GET_BY_PROJECT) .setInternal(true) .setSince("6.1") <START> .setDescription("Get the quality gate of a project.") <END> .setResponseExample(getClass().getResource("get_by_project-example.json")) .setHandler(this) .setChangelog( new Change("6.6", "The parameter 'projectId' has been removed"), new Change("6.6", "The parameter 'projectKey' has been renamed to 'project'"), new Change("6.6", "This webservice is now part of the public API") ); action.createParam(PARAM_PROJECT) .setDescription("Project key") .setExampleValue(KEY_PROJECT_EXAMPLE_001) .setRequired(true); }</code><technical_language>permission description updated format: Requires of permissions:<br></technical_language>

Target:
public void define(WebService.NewController context) { WebService.NewAction action = context.createAction(ACTION_GET_BY_PROJECT) .setInternal(false) .setSince("6.1") .setDescription("Get the quality gate of a project.<br />" + "Requires one of the following permissions:" + "<ul>" + "<li>'Administer System'</li>" + "<li>'Administer' rights on the specified project</li>" + "<li>'Browse' on the specified project</li>" + "</ul>") .setResponseExample(getClass().getResource("get_by_project-example.json")) .setHandler(this) .setChangelog( new Change("6.6", "The parameter 'projectId' has been removed"), new Change("6.6", "The parameter 'projectKey' has been renamed to 'project'"), new Change("6.6", "This webservice is now part of the public API") ); action.createParam(PARAM_PROJECT) .setDescription("Project key") .setExampleValue(KEY_PROJECT_EXAMPLE_001) .setRequired(true); }
Source:
<code>protected void updateDetailsAvailability() { super.updateDetailsAvailability(); Cluster cluster = getSelectedItem(); getClusterVmListModel().setIsAvailable(cluster != null && cluster.supportsVirtService()); getClusterServiceModel().setIsAvailable(cluster != null && cluster.supportsGlusterService()); getClusterGlusterHookListModel().setIsAvailable(cluster != null && cluster.supportsGlusterService()); getAffinityGroupListModel().setIsAvailable(cluster != null && cluster.supportsVirtService()); getCpuProfileListModel().setIsAvailable(cluster != null && cluster.supportsVirtService()); <START> getAffinityLabelListModel().setIsAvailable(cluster != null && cluster.supportsVirtService()); <END> }</code><technical_language>this calculated for this method</technical_language>

Target:
protected void updateDetailsAvailability() { super.updateDetailsAvailability(); Cluster cluster = getSelectedItem(); boolean clusterSupportsVirtService = cluster != null && cluster.supportsVirtService(); getClusterVmListModel().setIsAvailable(clusterSupportsVirtService); getClusterServiceModel().setIsAvailable(clusterSupportsVirtService); getClusterGlusterHookListModel().setIsAvailable(clusterSupportsVirtService); getAffinityGroupListModel().setIsAvailable(clusterSupportsVirtService); getCpuProfileListModel().setIsAvailable(clusterSupportsVirtService); getAffinityLabelListModel().setIsAvailable(clusterSupportsVirtService); }
Source:
<code>public boolean canMoveToMaintenance(VDS vds) { if (!Config.<Boolean>getValue(ConfigValues.MaintenanceVdsIgnoreExternalVms)) { return vds.getVmCount() == 0 && !isAnyVmRunOnVdsInDb(vds.getId()); } List<VM> vms = vmDao.getAllRunningForVds(vds.getId()) .stream() .filter(vm -> !vm.isExternalVm()) <START> .collect(Collectors.toList()); <END> return vms.isEmpty() && !isAnyVmRunOnVdsInDb(vds.getId()); }</code><technical_language>replace findAny/findFirst need vms</technical_language>

Target:
public boolean canMoveToMaintenance(VDS vds) { if (!Config.<Boolean>getValue(ConfigValues.MaintenanceVdsIgnoreExternalVms)) { return vds.getVmCount() == 0 && !isAnyVmRunOnVdsInDb(vds.getId()); } Optional<VM> runningVm = vmDao.getAllRunningForVds(vds.getId()) .stream() .filter(vm -> !vm.isExternalVm()) .findFirst(); return !runningVm.isPresent() && !isAnyVmRunOnVdsInDb(vds.getId()); }
Source:
<code>public void checkQueryIntegrity(Identity identity, String query) { <START> requireNonNull(identity, "extraCredentials is null"); <END> requireNonNull(query, "query is null"); authenticationCheck(() -> systemAccessControl.get().checkQueryIntegrity(identity, query)); }</code><technical_language>@mayankgarg1990 , I need for null checking params in public methods. in presto do null check method parameters requireNonNull. do for constructor arguments. cc @mbasmanova</technical_language>

Target:
public void checkQueryIntegrity(Identity identity, String query) { requireNonNull(identity, "identity is null"); requireNonNull(query, "query is null"); authenticationCheck(() -> systemAccessControl.get().checkQueryIntegrity(identity, query)); }
Source:
<code>public void close() { records.clear(); <START> if (countingInputStream != null) <END> countingInputStream.close(); }</code><technical_language>{}</technical_language>

Target:
public void close() { records.clear(); try { if (countingInputStream != null) { countingInputStream.close(); } } catch (final RuntimeIOException e) { } }
Source:
<code>public void showFindInPage() { final PageActivity pageActivity = (PageActivity) getActivity(); final FindInPageActionProvider findInPageActionProvider = new FindInPageActionProvider(pageActivity); pageActivity.startSupportActionMode(new ActionMode.Callback() { @Override public boolean onCreateActionMode(ActionMode mode, Menu menu) { findInPageActionMode = mode; MenuItem menuItem = menu.add(R.string.find_in_page); MenuItemCompat.setActionProvider(menuItem, findInPageActionProvider); return true; } @Override public boolean onPrepareActionMode(ActionMode mode, Menu menu) { return false; } @Override public boolean onActionItemClicked(ActionMode mode, MenuItem item) { return false; } @Override public void onDestroyActionMode(ActionMode mode) { webView.clearMatches(); <START> findInPageActionMode = null; <END> } }); }</code><technical_language>Consider explicitly hiding keyboard here, ensuring ActionBar is visible. I able get some (edge case) weird behavior following: - a page scrolled top. - enable find-in-page - scroll page a large amount (while finding-in-page) - scroll top - dismiss find-in-page clicking check box left - ActionBar gone, keyboard is dismissed</technical_language>

Target:
public void showFindInPage() { final PageActivity pageActivity = (PageActivity) getActivity(); final FindInPageActionProvider findInPageActionProvider = new FindInPageActionProvider(pageActivity); pageActivity.startSupportActionMode(new ActionMode.Callback() { @Override public boolean onCreateActionMode(ActionMode mode, Menu menu) { findInPageActionMode = mode; MenuItem menuItem = menu.add(R.string.find_in_page); MenuItemCompat.setActionProvider(menuItem, findInPageActionProvider); return true; } @Override public boolean onPrepareActionMode(ActionMode mode, Menu menu) { return false; } @Override public boolean onActionItemClicked(ActionMode mode, MenuItem item) { return false; } @Override public void onDestroyActionMode(ActionMode mode) { findInPageActionMode = null; webView.clearMatches(); if (!pageActivity.getSupportActionBar().isShowing()) { pageActivity.getSupportActionBar().show(); } Utils.hideSoftKeyboard(pageActivity); } }); }
Source:
<code>public String choose(VolumeChooserEnvironment env, String[] options) throws VolumeChooserException { WeightedRandomCollection<String> weightedOptions = new WeightedRandomCollection<>(); if (options.length < 1) { throw new IllegalStateException("Options was empty! No valid volumes to choose from."); } if (options.length == 1) { return options[0]; } VolumeManager manager = env.getServerContext().getVolumeManager(); for (String option : options) { FileSystem pathFs = manager.getVolumeByPath(new Path(option)).getFileSystem(); try { <START> FsStatus optionStatus = pathFs.getStatus(); <END> double percentFree = ((double) optionStatus.getRemaining() / optionStatus.getCapacity()); weightedOptions.add(percentFree, option); } catch (IOException e) { log.error("Unable to get file system status", e); } } if (weightedOptions.map.size() < 1) { throw new IllegalStateException( "Weighted options was empty!" + " Could indicate an issue getting file system status"); } return weightedOptions.next(); }</code><technical_language>this a call name node time? If so, time volume chooser is called multiple NN calls. sense cache this for short periods</technical_language>

Target:
public String choose(VolumeChooserEnvironment env, String[] options) throws VolumeChooserException { options = getPreferredVolumes(env, options); try { return getCache(env).get(Arrays.asList(options)).next(); } catch (ExecutionException e) { throw new IllegalStateException("Execution exception when attempting to cache choice", e); } }
Source:
<code><START> public Object visitClearCommand(InvocationContext ctx, ClearCommand command) throws Throwable { <END> VisitableCommand cmd = commandsFactory.buildLockControlCommand(ERRORS_KEY_SUFFIX, null, null); invoker.invoke(ctx, cmd); SerializationContext serializationContext = protobufMetadataManager.getSerializationContext(); for (String fileName : serializationContext.getFileDescriptors().keySet()) { serializationContext.unregisterProtoFile(fileName); } return invokeNextInterceptor(ctx, command); }</code><technical_language>clear remove error messages</technical_language>

Target:
public Object visitClearCommand(InvocationContext ctx, ClearCommand command) throws Throwable { VisitableCommand cmd = commandsFactory.buildLockControlCommand(ERRORS_KEY_SUFFIX, null, null); invoker.invoke(ctx, cmd); for (String fileName : serializationContext.getFileDescriptors().keySet()) { serializationContext.unregisterProtoFile(fileName); } return invokeNextInterceptor(ctx, command); }
Source:
<code>public static String getGeometryInvalidReason(org.locationtech.jts.geom.Geometry geometry) { IsValidOp validOp = new IsValidOp(geometry); IsSimpleOp simpleOp = new IsSimpleOp(geometry); try { TopologyValidationError err = validOp.getValidationError(); if (err != null) { return err.getMessage(); } if (!simpleOp.isSimple()) { String errorDescription; String geometryType = geometry.getGeometryType(); switch (GeometryType.getForJtsGeometryType(geometryType)) { case POINT: errorDescription = "Invalid point"; break; case MULTI_POINT: errorDescription = "Repeated point"; break; case LINE_STRING: case MULTI_LINE_STRING: errorDescription = "Self-intersection at or near"; break; default: <START> throw new PrestoException(INVALID_FUNCTION_ARGUMENT, format("Unknown geometry type: %s", geometryType)); <END> } org.locationtech.jts.geom.Coordinate nonSimpleLocation = simpleOp.getNonSimpleLocation(); return format("[%s] %s: (%s %s)", geometryType, errorDescription, nonSimpleLocation.getX(), nonSimpleLocation.getY()); } return null; } catch (UnsupportedOperationException e) { throw new PrestoException(INVALID_FUNCTION_ARGUMENT, "Geometry type not valid", e); } }</code><technical_language>POLYGON, MULTI_POLYGON GEOMETRY_COLLECTION</technical_language>

Target:
public static String getGeometryInvalidReason(org.locationtech.jts.geom.Geometry geometry) { IsValidOp validOp = new IsValidOp(geometry); IsSimpleOp simpleOp = new IsSimpleOp(geometry); try { TopologyValidationError err = validOp.getValidationError(); if (err != null) { return err.getMessage(); } } catch (UnsupportedOperationException e) { throw new PrestoException(INVALID_FUNCTION_ARGUMENT, "Geometry type not valid", e); } if (!simpleOp.isSimple()) { String errorDescription; String geometryType = geometry.getGeometryType(); switch (GeometryType.getForJtsGeometryType(geometryType)) { case POINT: errorDescription = "Invalid point"; break; case MULTI_POINT: errorDescription = "Repeated point"; break; case LINE_STRING: case MULTI_LINE_STRING: errorDescription = "Self-intersection at or near"; break; case POLYGON: case MULTI_POLYGON: case GEOMETRY_COLLECTION: errorDescription = "Topology exception at or near"; break; default: throw new PrestoException(INVALID_FUNCTION_ARGUMENT, format("Unknown geometry type: %s", geometryType)); } org.locationtech.jts.geom.Coordinate nonSimpleLocation = simpleOp.getNonSimpleLocation(); return format("[%s] %s: (%s %s)", geometryType, errorDescription, nonSimpleLocation.getX(), nonSimpleLocation.getY()); } return null; }
Source:
<code><START> private Collection <IJaxrsElement> searchJaxrsElements(final IJavaElement element) throws JavaModelException { <END> if (element == null) { return Collections.emptyList(); } try { readWriteLock.readLock().lock(); final List<IJaxrsElement> result = new ArrayList<IJaxrsElement>(); final Term javaElementTerm = new Term(FIELD_JAVA_ELEMENT, Boolean.TRUE.toString()); switch (element.getElementType()) { case IJavaElement.PACKAGE_FRAGMENT_ROOT: final Term packageFragmentRootIdentifier = new Term(FIELD_PACKAGE_FRAGMENT_ROOT_IDENTIFIER, element.getHandleIdentifier()); result.addAll(searchJaxrsElements(IJaxrsElement.class, javaElementTerm, packageFragmentRootIdentifier)); break; case IJavaElement.COMPILATION_UNIT: final Term compilationUnitTerm = new Term(FIELD_COMPILATION_UNIT_IDENTIFIER, element.getHandleIdentifier()); result.addAll(searchJaxrsElements(IJaxrsElement.class, javaElementTerm, compilationUnitTerm)); break; case IJavaElement.TYPE: case IJavaElement.FIELD: case IJavaElement.METHOD: final IJaxrsElement foundElement = this.elements.get(element.getHandleIdentifier()); if (foundElement != null) { result.add(foundElement); } break; } return result; } finally { readWriteLock.readLock().unlock(); } }</code><technical_language>change ? clients assume ordering is deterministic or</technical_language>

Target:
private List<IJaxrsElement> searchJaxrsElements(final IJavaElement element) throws JavaModelException { if (element == null) { return Collections.emptyList(); } try { readWriteLock.readLock().lock(); final List<IJaxrsElement> result = new ArrayList<IJaxrsElement>(); final Term javaElementTerm = new Term(FIELD_JAVA_ELEMENT, Boolean.TRUE.toString()); switch (element.getElementType()) { case IJavaElement.PACKAGE_FRAGMENT_ROOT: final Term packageFragmentRootIdentifier = new Term(FIELD_PACKAGE_FRAGMENT_ROOT_IDENTIFIER, element.getHandleIdentifier()); result.addAll(searchJaxrsElements(javaElementTerm, packageFragmentRootIdentifier)); break; case IJavaElement.COMPILATION_UNIT: final Term compilationUnitTerm = new Term(FIELD_COMPILATION_UNIT_IDENTIFIER, element.getHandleIdentifier()); result.addAll(searchJaxrsElements(javaElementTerm, compilationUnitTerm)); break; case IJavaElement.TYPE: case IJavaElement.FIELD: case IJavaElement.METHOD: final IJaxrsElement foundElement = this.elements.get(element.getHandleIdentifier()); if (foundElement != null) { result.add(foundElement); } break; } return result; } finally { readWriteLock.readLock().unlock(); } }
Source:
<code>public JoinToCorrelateRule(RelBuilderFactory relBuilderFactory) { <START> this(LogicalJoin.class, relBuilderFactory, null, Join::getJoinType); <END> }</code><technical_language>I remove this rule! is useful able transform a semi join a correlate currently is other do it</technical_language>

Target:
public JoinToCorrelateRule(RelBuilderFactory relBuilderFactory) { this(LogicalJoin.class, relBuilderFactory, null); }
Source:
<code>void reset() { serverEnvironment.reset(); Environment.instance() <START> .register(new Local()); <END> Environment.instance() .setTo(new Local()); Local.enable(); }</code><technical_language>if this piece is migrated latest base API yet, easily a ctor instead of a new instance here</technical_language>

Target:
void reset() { serverEnvironment.reset(); Environment.instance() .setTo(Local.class); Local.enable(); }
Source:
<code>protected void doHead(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { final Matcher matcher = URL_PATTERN.matcher(request.getRequestURI()); if (matcher.matches()) { response.setHeader("X-Frame-Options", "ALLOWALL"); final String planKeyString = matcher.group(1); final String buildNumber = matcher.group(2); final String filePath = matcher.group(3); final PlanResultKey planResultKey = getPlanResultKey(planKeyString, parseInt(buildNumber)); <START> ofNullable(resultsSummaryManager.getResultsSummary(planResultKey)).ifPresent(results -> { <END> final AllureBuildResult uploadResult = fromCustomData(results.getCustomBuildData()); if (uploadResult.isSuccess()) { artifactsManager.getArtifactUrl(planKeyString, buildNumber, filePath).ifPresent(file -> { try (final InputStream input = new URL(file).openStream()) { response.setStatus(HttpServletResponse.SC_OK); } catch (IOException e) { response.setStatus(HttpServletResponse.SC_NOT_FOUND); LOGGER.error("Failed to send file of Allure Report ", file); } }); } else { uploadResultIsNotSuccess(response, uploadResult); } }); } else { LOGGER.info("Path does not match pattern", request.getRequestURI()); } }</code><technical_language>reduce complexity of this method</technical_language>

Target:
protected void doHead(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { getArtifactUrl(request, response).ifPresent(file -> { try(InputStream inputStream = new URL(file).openStream()) { setResponseHeaders(response, file); } catch (IOException e) { response.setStatus(HttpServletResponse.SC_NOT_FOUND); LOGGER.error("Failed to send file of Allure Report ", file); } }); }
Source:
<code>public void validateHashtags(Change change, Set<String> toAdd, Set<String> toRemove) throws ValidationException { try { if (toRemove != null && !toRemove.isEmpty()) { Set<String> intersection = Sets.intersection( hashtagsUtil.getHashtagsInCurrentPSCommitMessage(change), toRemove); if (!intersection.isEmpty()) { throw new ValidationException(String.format( <START> "Need delete [ %s ] from commit message firstly", <END> intersection.toArray())); } } } catch (OrmException | IOException e) { log.error("Can not remove hashtags in commit messages", e); throw new ValidationException( "Can not remove hashtags in commit message", e); } }</code><technical_language>"Hashtags in commit message removed"</technical_language>

Target:
public void validateHashtags(Change change, Set<String> toAdd, Set<String> toRemove) throws HashtagsValidationException { if (change != null && toRemove != null && !toRemove.isEmpty()) { Set<String> cmHashtags = null; try { cmHashtags = hashtagsUtil.getHashtagsInCurrentPSCommitMessage(change); } catch (OrmException | IOException e) { throw new HashtagsValidationException(String.format( "Cannot get hashtags specified in the commit message of Change %s", change.getId().get()), e); } if (cmHashtags != null && !cmHashtags.isEmpty() && !Sets.intersection(cmHashtags, toRemove).isEmpty()) { throw new HashtagsValidationException( "Hashtags specified in the commit message cannot be removed"); } } }
Source:
<code>public void update() throws Exception { Venue venue = new Venue(new VenueGroup("group"), new VenueType("type"), Lists.newArrayList(new VenueNameInformation("info", new Language("en")))); <START> VenueDTO venueDTO = new VenueDTO("group", "type", Lists.newArrayList(new VenueNameInformationDTO("info","en"))); <END> final AccessPoint ap = new AccessPoint(1, "ip", new MacAddress("aa:bb"), "sn", "model", venue); final AccessPointDTO dto = new AccessPointDTO(1, "ip", "aa:bb", "sn", "model", venueDTO); context.checking(new Expectations() {{ oneOf(repository).update(with(matching(ap))); }}); Request request = makeRequestThatContains(dto); Reply<?> reply = service.update(1, request); assertThat(reply, isOk()); }</code><technical_language>unreadable</technical_language>

Target:
public void update() throws Exception { Venue venue = new Venue(new VenueGroup("group"), new VenueType("type"), Lists.newArrayList(new VenueName("info", new Language("en")))); VenueDTO venueDTO = new VenueDTO("group", "type", Lists.newArrayList(new VenueNameDTO("info","en"))); final AccessPoint ap = new AccessPoint(1, "ip", new MacAddress("aa:bb"), "sn", "model", venue); final AccessPointDTO dto = new AccessPointDTO(1, "ip", "aa:bb", "sn", "model", venueDTO); context.checking(new Expectations() {{ oneOf(repository).update(with(matching(ap))); }}); Request request = makeRequestThatContains(dto); Reply<?> reply = service.update(1, request); assertThat(reply, isOk()); }
Source:
<code>public int getPageNumber() { <START> String number = driver.findElement(By.xpath(" END> return Integer.parseInt(number); }</code><technical_language>extract this a constant</technical_language>

Target:
public int getPageNumber() { String number = driver.findElement(By.xpath(PAGE_NUMBER)).getText(); return Integer.parseInt(number); }
Source:
<code>public CompressedByteBufferObjectStrategy( ByteOrder order, CompressionStrategy compression, final int sizePer ) { super( order, new BufferConverter<ByteBuffer>() { @Override public ByteBuffer convert(ByteBuffer buf) { return buf; } @Override public int compare(ByteBuffer lhs, ByteBuffer rhs) { <START> return Ordering.natural().nullsFirst().compare(lhs, rhs); <END> } @Override public int sizeOf(int count) { return count; } @Override public ByteBuffer combine(ByteBuffer into, ByteBuffer from) { return into.put(from); } }, compression, sizePer ); }</code><technical_language>Is useful store this ordering a static</technical_language>

Target:
public CompressedByteBufferObjectStrategy( ByteOrder order, CompressionStrategy compression, final int sizePer ) { super( order, new BufferConverter<ByteBuffer>() { @Override public ByteBuffer convert(ByteBuffer buf) { return buf; } @Override public int compare(ByteBuffer lhs, ByteBuffer rhs) { return ORDERING.compare(lhs, rhs); } @Override public int sizeOf(int count) { return count; } @Override public ByteBuffer combine(ByteBuffer into, ByteBuffer from) { return into.put(from); } }, compression, sizePer ); }
Source:
<code>public void initialize() { super.initialize(); JavaFxUtil.fixScrollSpeed(scrollPane); modDetailController = uiService.loadFxml("theme/vault/mod/mod_detail.fxml"); Node modDetailRoot = modDetailController.getRoot(); vaultRoot.getChildren().add(modDetailRoot); AnchorPane.setTopAnchor(modDetailRoot, 0d); AnchorPane.setRightAnchor(modDetailRoot, 0d); AnchorPane.setBottomAnchor(modDetailRoot, 0d); AnchorPane.setLeftAnchor(modDetailRoot, 0d); modDetailRoot.setVisible(false); <START> manageModButton = new Button(i18n.get("modVault.manageMods")); manageModButton.getStyleClass().add("button-raised"); manageModButton.setOnAction((event -> manageMods())); searchBox.getChildren().add(manageModButton); <END> eventBus.register(this); searchController.setRootType(com.faforever.client.api.dto.Mod.class); searchController.setSearchableProperties(SearchablePropertyMappings.MOD_PROPERTY_MAPPING); searchController.setSortConfig(preferencesService.getPreferences().getVaultPrefs().modVaultConfigProperty()); searchController.setOnlyShowLastYearCheckBoxVisible(false, false); modShowRoomController = uiService.loadFxml("theme/vault/mod/mod_showroom.fxml"); showRoomGroup = modShowRoomController.getRoot(); showRoomGroup.managedProperty().bind(showRoomGroup.visibleProperty()); modShowRoomController.moreHighestRatedButton.setOnAction((event -> { searchType = SearchType.HIGHEST_RATED; onFirstPageOpened(null); })); modShowRoomController.moreHighestRatedUiButton.setOnAction((event -> { searchType = SearchType.HIGHEST_RATED_UI; onFirstPageOpened(null); })); modShowRoomController.moreNewestButton.setOnAction((event -> { searchType = SearchType.NEWEST; onFirstPageOpened(null); })); contentPane.getChildren().add(showRoomGroup); }</code><technical_language>Avoid defining UI Elements in java code</technical_language>

Target:
public void initialize() { super.initialize(); JavaFxUtil.fixScrollSpeed(scrollPane); eventBus.register(this); searchController.setRootType(com.faforever.client.api.dto.Mod.class); searchController.setSearchableProperties(SearchablePropertyMappings.MOD_PROPERTY_MAPPING); searchController.setSortConfig(preferencesService.getPreferences().getVaultPrefs().modVaultConfigProperty()); searchController.setOnlyShowLastYearCheckBoxVisible(false, false); manageModsButton.setVisible(true); manageModsButton.setOnAction(event -> manageMods()); }
Source:
<code>public int isApplicable(VElement vElement, ViewModelContext viewModelContext) { if (!VControl.class.isInstance(vElement)) { return NOT_APPLICABLE; } final VControl control = (VControl) vElement; final IObservableValue observableValue = Activator.getDefault().getEMFFormsDatabinding() .getObservableValue(control.getDomainModelReference(), viewModelContext.getDomainModel()); final EStructuralFeature feature = (EStructuralFeature) observableValue.getValueType(); final EObject eObject = (EObject) ((IObserving) observableValue).getObserved(); <START> if (VKeyAttributeDomainModelReference.class.isInstance(eObject) <END> && VKeyattributedmrPackage.eINSTANCE.getKeyAttributeDomainModelReference_KeyValue() == feature) { return 6; } return NOT_APPLICABLE; }</code><technical_language>check unnecessary</technical_language>

Target:
public int isApplicable(VElement vElement, ViewModelContext viewModelContext) { if (!VControl.class.isInstance(vElement)) { return NOT_APPLICABLE; } final VControl control = (VControl) vElement; final IValueProperty valueProperty = Activator.getDefault().getEMFFormsDatabinding() .getValueProperty(control.getDomainModelReference()); final EStructuralFeature feature = (EStructuralFeature) valueProperty.getValueType(); if (VKeyattributedmrPackage.eINSTANCE.getKeyAttributeDomainModelReference_KeyValue() == feature) { return 6; } return NOT_APPLICABLE; }
Source:
<code>public boolean createUser(UserLogin createUser) { System.out.println("inside the daoimpl createuser"); Session session = null; Transaction tx = null; boolean result = true; try { <START> System.out.println("Username to insert"+createUser.getUserName()); <END> System.out.println("sha1 value to insert"+createUser.getSha1()); System.out.println("salt value to insert"+createUser.getSalt()); session = this.sessionFactory.openSession(); tx = session.beginTransaction(); session.persist(createUser); System.out.println("after inserting the record"); LOG.info("create user record Inserted successfully from dao impl..."); tx.commit(); } catch (HibernateException e) { result = false; transactionRollback(tx); LOG.error("Exception during insertion caused by :" + e.getMessage(), e); } finally { closeSession(session, false); } return result; }</code><technical_language>remove statements</technical_language>

Target:
public boolean createUser(UserLogin createUser) { Session session = null; Transaction tx = null; boolean result = true; try { session = this.sessionFactory.openSession(); tx = session.beginTransaction(); session.persist(createUser); LOG.info("create user record Inserted successfully from dao impl..."); tx.commit(); } catch (HibernateException e) { result = false; transactionRollback(tx); LOG.error("Exception during insertion caused by :" + e.getMessage(), e); } finally { closeSession(session, false); } return result; }
Source:
<code>public ImmutableDruidServer toImmutableDruidServer() { return new ImmutableDruidServer( metadata, currSize, <START> Collections.unmodifiableMap( <END> Maps.transformValues( dataSources, new Function<DruidDataSource, ImmutableDruidDataSource>() { @Override public ImmutableDruidDataSource apply(DruidDataSource input) { return input.toImmutableDruidDataSource(); } } ) ), Collections.unmodifiableMap(segments) ); }</code><technical_language>Maps.transformValues Collections.unmodifiableMap return views copies, this immutable</technical_language>

Target:
public ImmutableDruidServer toImmutableDruidServer() { return new ImmutableDruidServer( metadata, currSize, ImmutableMap.copyOf( Maps.transformValues( dataSources, new Function<DruidDataSource, ImmutableDruidDataSource>() { @Override public ImmutableDruidDataSource apply(DruidDataSource input) { return input.toImmutableDruidDataSource(); } } ) ), ImmutableMap.copyOf(segments) ); }
Source:
<code>private static String getRefFromHgvs(String hgvs, Type type) { if (type.equals(Type.DELETION)){ String ref = getPattern("(?<=[a-z+>])[ATCG]*$", hgvs); <START> if (ref.equals(null)) return ""; <END> return ref; } if (type.equals(Type.SUBSTITUTION)) return getPattern("(?<=\\d+)[ATCG]+(?=>)", hgvs); String ans = ""; while (ans.length() < getPattern("(?<=[a-z+>])[ATCG]+$", hgvs).length()) ans += "X"; return ans; }</code><technical_language>suggestion if (ref.equals(null)) { return ""; }</technical_language>

Target:
private static String getRefFromHgvs(String hgvs, Type type) { if (type.equals(Type.DELETION)) { String ref = getPattern("(?<=[a-z+>])[ATCG]*$", hgvs); if (ref.equals(null)) { return ""; } return ref; } else if (type.equals(Type.SUBSTITUTION)) { return getPattern("(?<=\\d+)[ATCG]+(?=>)", hgvs); } String ans = ""; while (ans.length() < getPattern("(?<=[a-z+>])[ATCG]+$", hgvs).length()) { ans += "X"; } return ans; }
Source:
<code>public LogPosition position() { <START> throw new UnsupportedOperationException( "Perhaps not required" ); <END> }</code><technical_language>This guy a error message</technical_language>

Target:
public LogPosition position() { throw new UnsupportedOperationException( "Should not be called" ); }
Source:
<code>@Test public void doubleEqualityDifferentTypes() { <START> ASSERT.that(MathUtil.equals(1.3d, 1.3f, 0.00000000000001d)).isFalse(); <END> }</code><technical_language>other too? 1.3f, 1.3d</technical_language>

Target:
@Test public void doubleEqualityDifferentTypes() { ASSERT.that(MathUtil.equals(1.3d, 1.3f, 0.00000000000001d)).isFalse(); ASSERT.that(MathUtil.equals(1.3f, 1.3d, 0.00000000000001f)).isFalse(); }
Source:
<code>public MutableList<?> sorted(Object self, final Object key, Boolean reverse, final Location loc, final Environment env) throws EvalException, InterruptedException { ArrayList list = new ArrayList(EvalUtils.toCollection(self, loc, env)); if (key == Runtime.NONE) { try { Collections.sort(list, EvalUtils.SKYLARK_COMPARATOR); } catch (EvalUtils.ComparisonException e) { throw new EvalException(loc, e); } } else { checkValidKeyFunc(key, loc); final FuncallExpression ast = new FuncallExpression(Identifier.of(""), ImmutableList.of()); class KeyComparator implements Comparator<Object> { <START> public Exception e; <END> @Override public int compare(Object o1, Object o2) { try { return EvalUtils.SKYLARK_COMPARATOR.compare( evalKeyFunc(o1, key, loc, env, ast), evalKeyFunc(o2, key, loc, env, ast)); } catch (InterruptedException | EvalException e) { if (this.e == null) { this.e = (Exception) e; } return 0; } } } KeyComparator comp= new KeyComparator(); try { Collections.sort(list, comp); } catch (EvalUtils.ComparisonException e) { throw new EvalException(loc, e); } if (comp.e != null) { if (comp.e instanceof InterruptedException) { throw (InterruptedException) comp.e; } throw (EvalException) comp.e; } } if (reverse) { Collections.reverse(list); } return MutableList.wrapUnsafe(env, list); }</code><technical_language>Delete 'public'</technical_language>

Target:
public MutableList<?> sorted(Object self, final Object key, Boolean reverse, final Location loc, final Environment env) throws EvalException, InterruptedException { ArrayList list = new ArrayList(EvalUtils.toCollection(self, loc, env)); if (key == Runtime.NONE) { try { Collections.sort(list, EvalUtils.SKYLARK_COMPARATOR); } catch (EvalUtils.ComparisonException e) { throw new EvalException(loc, e); } } else { checkValidKeyFunc(key, loc); final FuncallExpression ast = new FuncallExpression(Identifier.of(""), ImmutableList.of()); class KeyComparator implements Comparator<Object> { Exception e; @Override public int compare(Object x, Object y) { try { return EvalUtils.SKYLARK_COMPARATOR.compare( evalKeyFunc(x, key, loc, env, ast), evalKeyFunc(y, key, loc, env, ast)); } catch (InterruptedException | EvalException e) { if (this.e == null) { this.e = e; } return 0; } } } KeyComparator comp = new KeyComparator(); try { Collections.sort(list, comp); } catch (EvalUtils.ComparisonException e) { throw new EvalException(loc, e); } if (comp.e != null) { if (comp.e instanceof InterruptedException) { throw (InterruptedException) comp.e; } throw (EvalException) comp.e; } } if (reverse) { Collections.reverse(list); } return MutableList.wrapUnsafe(env, list); }
Source:
<code>public void end(boolean interrupted) { <START> LogKitten.d("MotorPositionControl interrupted"); <END> }</code><technical_language>before, want log "interrupted" command interrupted ended normally</technical_language>

Target:
public void end(boolean interrupted) { if (interrupted) { LogKitten.d("MotorPositionControl interrupted"); } }