auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>public OutputStream decorateLogger(AbstractBuild build, final OutputStream logger) { final AnsiColorMap colorMap = getDescriptor().getColorMap(getColorMapName()); <START> if (logger != null) <END> return new LineTransformationOutputStream() { AnsiHtmlOutputStream ansi = new AnsiHtmlOutputStream(logger, colorMap, defaultFg, defaultBg, new AnsiAttributeElement.Emitter() { public void emitHtml(String html) { try { new SimpleHtmlNote(html).encodeTo(logger); } catch (IOException e) { LOG.log(Level.WARNING, "Failed to add HTML markup '" + html + "'", e); } } }); @Override protected void eol(byte[] b, int len) throws IOException { ansi.write(b, 0, len); ansi.flush(); logger.flush(); } @Override public void close() throws IOException { ansi.close(); logger.close(); super.close(); } }; else return null; }</code><technical_language>this a bit more readable some if (logger == null) { return ... }</technical_language>

Target:
public OutputStream decorateLogger(AbstractBuild build, final OutputStream logger) { final AnsiColorMap colorMap = getDescriptor().getColorMap(getColorMapName()); if (logger == null) { return null; } return new LineTransformationOutputStream() { AnsiHtmlOutputStream ansi = new AnsiHtmlOutputStream(logger, colorMap, new AnsiAttributeElement.Emitter() { public void emitHtml(String html) { try { new SimpleHtmlNote(html).encodeTo(logger); } catch (IOException e) { LOG.log(Level.WARNING, "Failed to add HTML markup '" + html + "'", e); } } }); @Override protected void eol(byte[] b, int len) throws IOException { ansi.write(b, 0, len); ansi.flush(); logger.flush(); } @Override public void close() throws IOException { ansi.close(); logger.close(); super.close(); } }; }
Source:
<code>public void testGetLocation() { CtfLocationInfo location = fixture.getLocationInfo(); long result = location.getTimestamp(); <START> assertEquals(1337L, result); <END> }</code><technical_language>results changed?!?!?!?!?! this is good. need do a seek before, rely a "fixture" changes depending order tests</technical_language>

Target:
public void testGetLocation() { fixture = new CtfLocation(new CtfLocationInfo(1, 0)); CtfLocationInfo location = fixture.getLocationInfo(); long result = location.getTimestamp(); assertEquals(1L, result); }
Source:
<code>public RowType returnType() { <START> assert info.returnType() instanceof RowType <END> : "table functions must have the row return type"; return (RowType) info.returnType(); }</code><technical_language><LINK_0> is merged signature's return type. FunctionInfo functions signature registry. wait a bit for #9853 merged soon</technical_language>

Target:
public RowType returnType() { return RowType.EMPTY; }
Source:
<code>public void before() { <START> SetTraceTypePreferences(CHECK_ALL, ""); <END> }</code><technical_language>omit this, method receives empty String[0] need check if array elements empty</technical_language>

Target:
public void before() { setTraceTypePreferences(CHECK_ALL); }
Source:
<code>NameChoosingHistoryManager(ListInfo listInfo, Context context) { this.listInfo = listInfo; dialog = new MaterialDialog.Builder(context) .title(R.string.chosen_names_history) <START> .positiveText(android.R.string.yes) <END> .neutralText(R.string.clear) .negativeText(R.string.copy_text) .onNeutral((dialog, which) -> { listInfo.clearNameHistory(); UIUtils.showShortToast(R.string.name_history_cleared, dialog.getContext()); }) .onNegative((dialog, which) -> NameUtils.copyNamesToClipboard( listInfo.getNameHistoryFormatted(), null, 0, true, dialog.getContext())) .build(); }</code><technical_language>I R.string.okay use. Otherwise, define in common strings.xml file it. Android defaults super readable IMHO (yes is "Ok") leaves vulnerable SDK changes</technical_language>

Target:
NameChoosingHistoryManager(ListInfo listInfo, Context context) { this.listInfo = listInfo; dialog = new MaterialDialog.Builder(context) .title(R.string.chosen_names_history) .positiveText(R.string.okay) .neutralText(R.string.clear) .negativeText(R.string.copy_text) .onNeutral((dialog, which) -> { listInfo.clearNameHistory(); UIUtils.showShortToast(R.string.name_history_cleared, dialog.getContext()); }) .onNegative((dialog, which) -> NameUtils.copyNamesToClipboard( listInfo.getNameHistoryFormatted(), null, 0, true, dialog.getContext())) .build(); }
Source:
<code><START> public void testCsvMetacardTransformer() throws CatalogTransformerException { <END> BinaryContent binaryContent = transformer.transform(normalMC, arguments); assertThat(binaryContent.getMimeType().toString(), is("text/csv")); }</code><technical_language>method's name describe does. testCsvMetacardTransformerMimeType</technical_language>

Target:
public void testCsvMetacardTransformer() throws CatalogTransformerException, IOException { BinaryContent binaryContent = transformer.transform(normalMC, arguments); assertThat(binaryContent.getMimeType().toString(), is("text/csv")); List<String> attributes = Arrays.asList(new String(binaryContent.getByteArray()).split("\r\n")); List<String> attNames = Arrays.asList(attributes.get(0).split(",")); List<String> attValues = Arrays.asList(attributes.get(1).split(",")); for (int i = 0; i < attNames.size(); i++) { String attributeValue = attValues.get(i); assertThat(VALUES.contains(attributeValue), is(true)); } }
Source:
<code>public void testComposedFunction() { ApplicationContext context = new SpringApplicationBuilder( TestChannelBinderConfiguration.getCompleteConfiguration(FunctionsConfiguration.class)).web( WebApplicationType.NONE) .run("--spring.cloud.stream.function.definition=toUpperCase|concatWithSelf", "--spring.jmx" + ".enabled=false", "--logging.level.org.springframework.integration=DEBUG"); InputDestination source = context.getBean(InputDestination.class); OutputDestination target = context.getBean(OutputDestination.class); source.send(new GenericMessage<byte[]>("hello".getBytes(StandardCharsets.UTF_8))); byte[] result = target.receive(1000).getPayload(); <START> System.out.println(new String(result)); <END> assertThat(result).isEqualTo("HELLO:HELLO".getBytes(StandardCharsets.UTF_8)); }</code><technical_language>try avoid SOUT possible. In Spring Integration special Checkstyle rule: <module name="Regexp"> <property name="format" value="System.(out|err).print" /> <property name="illegalPattern" value="true" /> <property name="message" value="System.out .err" /> </module> I remember "Why?", for main reason noise in output CI plans give clues is source of a message. @garyrussell , recall allow SOUTs? Thanks</technical_language>

Target:
public void testComposedFunction() { context = new SpringApplicationBuilder( TestChannelBinderConfiguration.getCompleteConfiguration(FunctionsConfiguration.class)).web( WebApplicationType.NONE) .run("--spring.cloud.stream.function.definition=toUpperCase|concatWithSelf", "--spring.jmx" + ".enabled=false", "--logging.level.org.springframework.integration=DEBUG"); InputDestination source = context.getBean(InputDestination.class); OutputDestination target = context.getBean(OutputDestination.class); source.send(new GenericMessage<byte[]>("hello".getBytes(StandardCharsets.UTF_8))); assertThat(target.receive(1000).getPayload()).isEqualTo("HELLO:HELLO".getBytes(StandardCharsets.UTF_8)); }
Source:
<code>public HttpMethodInfo handle(HttpRequest request, HttpResponder responder, Map<String, String> groupValues) throws Exception { try { if (httpMethods.contains(request.getMethod())) { Object args = new Object[paramsInfo.size()]; int idx = 0; for (Map<Class<? extends Annotation>, ParameterInfo<?>> info : paramsInfo) { if (info.containsKey(PathParam.class)) { args[idx] = getPathParamValue(info, groupValues); } if (info.containsKey(QueryParam.class)) { args[idx] = getQueryParamValue(info, request.getUri()); } if (info.containsKey(HeaderParam.class)) { args[idx] = getHeaderParamValue(info, request); } idx++; } return new HttpMethodInfo(method, handler, request, responder, args); } else { throw new HandlerException(HttpResponseStatus.METHOD_NOT_ALLOWED, String.format ("Problem accessing: %s. Reason: Method Not Allowed", request.getUri())); } } catch (Throwable e) { <START> throw new HandlerException(HttpResponseStatus.INTERNAL_SERVER_ERROR, "Error in executing path", e); <END> } }</code><technical_language>Includes request URI request method well</technical_language>

Target:
public HttpMethodInfo handle(HttpRequest request, HttpResponder responder, Map<String, String> groupValues) throws Exception { try { if (httpMethods.contains(request.getMethod())) { Object args = new Object[paramsInfo.size()]; int idx = 0; for (Map<Class<? extends Annotation>, ParameterInfo<?>> info : paramsInfo) { if (info.containsKey(PathParam.class)) { args[idx] = getPathParamValue(info, groupValues); } if (info.containsKey(QueryParam.class)) { args[idx] = getQueryParamValue(info, request.getUri()); } if (info.containsKey(HeaderParam.class)) { args[idx] = getHeaderParamValue(info, request); } idx++; } return new HttpMethodInfo(method, handler, request, responder, args); } else { throw new HandlerException(HttpResponseStatus.METHOD_NOT_ALLOWED, String.format ("Problem accessing: %s. Reason: Method Not Allowed", request.getUri())); } } catch (Throwable e) { throw new HandlerException(HttpResponseStatus.INTERNAL_SERVER_ERROR, String.format("Error in executing request: %s %s", request.getMethod(), request.getUri()), e); } }
Source:
<code>public void addSubmoduleWithInvalidPath() throws Exception { SubmoduleAddCommand command = new SubmoduleAddCommand(db); command.setPath("-invalid-path"); command.setURI("<LINK_0>"); try { command.call().close(); fail("Exception not thrown"); } catch (IllegalArgumentException e) { assertEquals(e.getMessage(), <START> "Invalid submodule path '-invalid-path'"); <END> } }</code><technical_language>* this fails name set in 4.7 name check is done * wrong order of arguments, is expected, actual</technical_language>

Target:
public void addSubmoduleWithInvalidPath() throws Exception { SubmoduleAddCommand command = new SubmoduleAddCommand(db); command.setPath("-invalid-path"); command.setURI("<LINK_0>"); try { command.call().close(); fail("Exception not thrown"); } catch (IllegalArgumentException e) { assertEquals("Invalid submodule name '-invalid-path'", e.getMessage()); } }
Source:
<code>public String createConstantVariable(boolean negative, XNumberLiteral numberLiteral) { NumberLiterals literals = new NumberLiterals(); Number value = literals.numberValue(numberLiteral, literals.getJavaType(numberLiteral)); final Class<? extends Number> numberType = value.getClass(); if (negative) { if (numberType == Integer.TYPE || numberType == Integer.class) { value = <START> value.intValue() * -1; <END> } else if (numberType == Double.TYPE || numberType == Double.class) { value = value.doubleValue() * -1; } else if (numberType == Long.TYPE || numberType == Long.class) { value = value.longValue() * -1; } else if (numberType == Float.TYPE || numberType == Float.class) value = value.floatValue() * -1; else if (numberType == BigInteger.class) ((BigInteger)value).negate(); else if (numberType == BigDecimal.class) ((BigDecimal)value).negate(); else throw new IllegalArgumentException("Cannot convert number literal to type" + numberType.getCanonicalName()); } return createConstantVariable(value); }</code><technical_language>'-value.intValue()'? I a multiplication is more readable, slightly more expensive (at in bytecode, optimized dutring JIT compilation, unsure counts here)</technical_language>

Target:
public String createConstantVariable(boolean negative, XNumberLiteral numberLiteral) { NumberLiterals literals = new NumberLiterals(); Number value = literals.numberValue(numberLiteral, literals.getJavaType(numberLiteral)); final Class<? extends Number> numberType = value.getClass(); if (negative) { if (numberType == Integer.TYPE || numberType == Integer.class) { value = -value.intValue(); } else if (numberType == Double.TYPE || numberType == Double.class) { value = -value.doubleValue(); } else if (numberType == Long.TYPE || numberType == Long.class) { value = -value.longValue(); } else if (numberType == Float.TYPE || numberType == Float.class) value = -value.floatValue(); else if (numberType == BigInteger.class) ((BigInteger)value).negate(); else if (numberType == BigDecimal.class) ((BigDecimal)value).negate(); else throw new IllegalArgumentException("Cannot convert number literal to type" + numberType.getCanonicalName()); } return createConstantVariable(value); }
Source:
<code>private static Value listGet(Value first, Value second) { <START> if (!second.type.canBeLong()) { <END> throw new IllegalArgumentException("Invalid index argument " + second + ", natural number expected"); } if (ValueType.LIST == first.type) { List<Value> list = first.getList(); if (list.size() <= second.getLong()) { throw new IllegalArgumentException("Out of bounds index value " + second.getLong() + ", list size " + list.size()); } return new Value(list.get((int) second.getLong()).toString()); } else { if (second.getLong() != 0) { throw new IllegalArgumentException("Out of bounds index value " + second.getLong() + ", list size " + 1); } return new Value(first.objectValue.toString()); } }</code><technical_language>If argument is a list, treat this a multi select, e.g. (1, 2, 3, 4).get(1, 3) -> (2, 4)</technical_language>

Target:
private static Value listGet(Value first, Value second) { if (!second.type.canBeLong()) { throw new IllegalArgumentException("Invalid index argument " + second + ", natural number expected"); } List<Value> valueList = ValueType.LIST == first.type ? first.getList() : convertToList(first.objectValue); if (valueList.size() > 1) { if (valueList.size() <= second.getLong()) { throw new IllegalArgumentException("Out of bounds index value " + second.getLong() + ", list size " + valueList.size()); } return new Value(valueList.get((int) second.getLong()).toString()); } else { if (second.getLong() != 0) { throw new IllegalArgumentException("Out of bounds index value " + second.getLong() + ", list size " + 1); } return new Value(first.objectValue.toString()); } }
Source:
<code>private static String urlFromImagefapDirectoryName(String dir) { if (!dir.startsWith("imagefap")) return null; String url; String directory = dir.substring("imagefap_".length()); if (NumberUtils.isDigits(directory)) url = "<LINK_0>" + directory; else <START> url = "<LINK_1>" + directory; <END> return url; }</code><technical_language>Please braces</technical_language>

Target:
private static String urlFromImagefapDirectoryName(String dir) { if (!dir.startsWith("imagefap")) { return null; } String url; String directory = dir.substring("imagefap_".length()); if (NumberUtils.isDigits(directory)) { url = "<LINK_0>" + directory; } else { url = "<LINK_1>" + directory; } return url; }
Source:
<code>public CopyImageToScreenNode(Context context) { WorldRenderer worldRenderer = context.get(WorldRenderer.class); displayResolutionDependentFBOs = context.get(DisplayResolutionDependentFBOs.class); <START> requiresCondition(() -> worldRenderer.getCurrentRenderStage() == MONO || worldRenderer.getCurrentRenderStage() == LEFT_EYE); <END> addDesiredStateChange(new BindFBO(DEFAULT_FBO, displayResolutionDependentFBOs)); update(); displayResolutionDependentFBOs.subscribe(this); addDesiredStateChange(new EnableMaterial(DEFAULT_TEXTURED_MATERIAL)); }</code><technical_language>this line worldRenderer variable assignment</technical_language>

Target:
public CopyImageToScreenNode(Context context) { super(context); WorldRenderer worldRenderer = context.get(WorldRenderer.class); requiresCondition(() -> worldRenderer.getCurrentRenderStage() == MONO || worldRenderer.getCurrentRenderStage() == LEFT_EYE); displayResolutionDependentFBOs = context.get(DisplayResolutionDependentFBOs.class); addDesiredStateChange(new BindFBO(DEFAULT_FBO, displayResolutionDependentFBOs)); update(); displayResolutionDependentFBOs.subscribe(this); addDesiredStateChange(new EnableMaterial(DEFAULT_TEXTURED_MATERIAL)); }
Source:
<code>public static String[] getErrorParserExtensionIds() { <START> return fExtensionErrorParsers.keySet().toArray(new String[0]); <END> }</code><technical_language>Better: new String[fExtensionErrorParsers.size()]</technical_language>

Target:
public static String[] getErrorParserExtensionIds() { return fExtensionErrorParsers.keySet().toArray(new String[fExtensionErrorParsers.size()]); }
Source:
<code>public void logsIfFailedOperationsAreSlow() { RuntimeException exception = new RuntimeException("kaboom"); when(profilingTimelockService.getFreshTimestamp()).thenThrow(exception); makeOperationsTakeSpecifiedDuration(LONG_DURATION); allowLogging(); <START> assertThatThrownBy(profilingTimelockService::getFreshTimestamp).isEqualTo(exception); <END> verify(delegate).getFreshTimestamp(); verifyLoggerInvokedWithSpecificProfile("getFreshTimestamp", LONG_DURATION); }</code><technical_language>want check exception is logged</technical_language>

Target:
public void logsIfFailedOperationsAreSlow() { RuntimeException exception = new RuntimeException("kaboom"); when(profilingTimelockService.getFreshTimestamp()).thenThrow(exception); assertThatThrownBy(() -> flushLogsWithCall(LONG_DURATION, profilingTimelockService::getFreshTimestamp)) .isEqualTo(exception); verify(delegate).getFreshTimestamp(); verifyLoggerInvokedOnceWithSpecificProfile("getFreshTimestamp", LONG_DURATION); verifyLoggerInvokedOnceWithException(exception); }
Source:
<code>public SmeltingRecipeRegistry getSmeltingRecipeRegistry() { <START> throw new UnsupportedOperationException(); END> }</code><technical_language>this PR implement smelting recipe registry</technical_language>

Target:
public SmeltingRecipeRegistry getSmeltingRecipeRegistry() { return (SmeltingRecipeRegistry) FurnaceRecipes.instance(); }
Source:
<code>private QueryParameters parseQuery(String query) throws ParseException, InvalidParametersException { QueryParameters q = new QueryParameters(); versions = new ArrayList<>(); if (query == null || query.isEmpty()) { return q; } String[] tokens = query.replaceAll(" and ", "|") .replaceAll(", ", ",") .replaceAll(": ", ":") .split("\\|", -1); for (String token : tokens) { String[] pair = token.split(":", -1); if (pair.length != 2) { throw new InvalidParametersException("Invalid format"); } String[] values = pair[1].split(",", -1); values = StringHelper.trim(values); String label = pair[0].trim(); if ("version".equals(label)) { for (String value : values) { versions.add(value.replace(".", "-")); } } else if ("from".equals(label)) { DateTimeFormatter formatter = DateTimeFormatter.ofPattern("dd/MM/yy"); fromDateValue = LocalDate.parse(values[0], formatter) .atStartOfDay(Const.SystemParams.ADMIN_TIME_ZONE_ID).toInstant().toEpochMilli(); isFromDateSpecifiedInQuery = true; } else if ("to".equals(label)) { DateTimeFormatter formatter = DateTimeFormatter.ofPattern("dd/MM/yy"); <START> toDateValue = LocalDate.parse(values[0], formatter).atTime(23, 59) <END> .atZone(Const.SystemParams.ADMIN_TIME_ZONE_ID).toInstant().toEpochMilli(); } else { q.add(label, values); } } return q; }</code><technical_language>atTime(LocalTime.MAX)</technical_language>

Target:
private QueryParameters parseQuery(String query) throws ParseException, InvalidParametersException { QueryParameters q = new QueryParameters(); versions = new ArrayList<>(); if (query == null || query.isEmpty()) { return q; } String[] tokens = query.replaceAll(" and ", "|") .replaceAll(", ", ",") .replaceAll(": ", ":") .split("\\|", -1); for (String token : tokens) { String[] pair = token.split(":", -1); if (pair.length != 2) { throw new InvalidParametersException("Invalid format"); } String[] values = pair[1].split(",", -1); values = StringHelper.trim(values); String label = pair[0].trim(); if ("version".equals(label)) { for (String value : values) { versions.add(value.replace(".", "-")); } } else if ("from".equals(label)) { fromDateValue = LocalDate.parse(values[0], DateTimeFormatter.ofPattern("dd/MM/yy")) .atStartOfDay(Const.SystemParams.ADMIN_TIME_ZONE_ID).toInstant().toEpochMilli(); isFromDateSpecifiedInQuery = true; } else if ("to".equals(label)) { toDateValue = LocalDate.parse(values[0], DateTimeFormatter.ofPattern("dd/MM/yy")) .atTime(LocalTime.MAX).atZone(Const.SystemParams.ADMIN_TIME_ZONE_ID).toInstant().toEpochMilli(); } else { q.add(label, values); } } return q; }
Source:
<code>protected void doAccept(HandlerEvent event) { LOGGER.debug("Accepting Database restore event..."); DatabaseRestoreRequest request = event.getData(); Selectable result; Long stackId = request.getResourceId(); try { Stack stack = stackService.getByIdWithListsInTransaction(stackId); Cluster cluster = stack.getCluster(); InstanceMetaData gatewayInstance = stack.getPrimaryGatewayInstance(); <START> GatewayConfig gatewayConfig = gatewayConfigService.getGatewayConfig(stack, gatewayInstance, cluster.getGateway() != null); <END> Set<String> gatewayFQDN = Collections.singleton(gatewayInstance.getDiscoveryFQDN()); ExitCriteriaModel exitModel = ClusterDeletionBasedExitCriteriaModel.clusterDeletionBasedModel(stackId, cluster.getId()); SaltConfig saltConfig = saltConfigGenerator.createSaltConfig(request.getBackupLocation(), request.getBackupId(), stack.getCloudPlatform()); hostOrchestrator.restoreDatabase(gatewayConfig, gatewayFQDN, stackUtil.collectReachableNodes(stack), saltConfig, exitModel); result = new DatabaseRestoreSuccess(stackId); } catch (Exception e) { LOGGER.error("Database restore event failed", e); result = new DatabaseRestoreFailedEvent(stackId, e, DetailedStackStatus.DATABASE_RESTORE_FAILED); } sendEvent(result, event); }</code><technical_language>please Cluster#hasGateway</technical_language>

Target:
protected void doAccept(HandlerEvent event) { DatabaseRestoreRequest request = event.getData(); Selectable result; Long stackId = request.getResourceId(); LOGGER.debug("Restoring database on stack {}, backup id {}", stackId, request.getBackupId()); try { Stack stack = stackService.getByIdWithListsInTransaction(stackId); Cluster cluster = stack.getCluster(); InstanceMetaData gatewayInstance = stack.getPrimaryGatewayInstance(); GatewayConfig gatewayConfig = gatewayConfigService.getGatewayConfig(stack, gatewayInstance, cluster.hasGateway()); Set<String> gatewayFQDN = Collections.singleton(gatewayInstance.getDiscoveryFQDN()); ExitCriteriaModel exitModel = ClusterDeletionBasedExitCriteriaModel.clusterDeletionBasedModel(stackId, cluster.getId()); SaltConfig saltConfig = saltConfigGenerator.createSaltConfig(request.getBackupLocation(), request.getBackupId(), stack.getCloudPlatform()); hostOrchestrator.restoreDatabase(gatewayConfig, gatewayFQDN, stackUtil.collectReachableNodes(stack), saltConfig, exitModel); result = new DatabaseRestoreSuccess(stackId); } catch (Exception e) { LOGGER.error("Database restore event failed", e); result = new DatabaseRestoreFailedEvent(stackId, e, DetailedStackStatus.DATABASE_RESTORE_FAILED); } sendEvent(result, event); }
Source:
<code>private void runAutodefineForOneProvider(Guid providerId, int index) { Network externalNetwork = createExternalNetwork(getNetworkName(index), providerId); AddNetworkStoragePoolParameters storagePoolParameters = new AddNetworkStoragePoolParameters(getNetwork().getStoragePoolId(), externalNetwork); storagePoolParameters.setVnicProfileRequired(false); <START> ActionReturnValue returnValue = runInternalAction(ActionType.AddNetworkOnProvider, storagePoolParameters); <END> if (returnValue.getSucceeded()) { Guid networkId = returnValue.getActionReturnValue(); networkHelper.attachNetworkToClusters(networkId, listOfClustersByProvider.get(providerId)); externalNetwork.setId(networkId); addVnicProfile(externalNetwork); } }</code><technical_language>, getContext().clone().withoutLock()); Maybe, I warnings executing this, locking is working expected. I invest more effort locate problem</technical_language>

Target:
private void runAutodefineForOneProvider(Guid providerId, int index) { Network externalNetwork = createExternalNetwork(getNetworkName(index), providerId); AddNetworkStoragePoolParameters storagePoolParameters = new AddNetworkStoragePoolParameters(getNetwork().getStoragePoolId(), externalNetwork); storagePoolParameters.setVnicProfileRequired(false); ActionReturnValue returnValue = runInternalAction(ActionType.AddNetworkOnProvider, storagePoolParameters); if (returnValue.getSucceeded()) { Guid networkId = returnValue.getActionReturnValue(); networkHelper.attachNetworkToClusters(networkId, clustersByProvider.get(providerId)); externalNetwork.setId(networkId); networkHelper.addVnicProfileWithoutFilter(externalNetwork, true); } }
Source:
<code>public void testIssue827() { RMap<String, Object> mapCache = redisson.getMap("test_put_if_absent", StringCodec.INSTANCE); mapCache.putIfAbsent("4", 0L); mapCache.addAndGet("4", 1L); mapCache.putIfAbsent("4", 0L); <START> System.out.println(mapCache.get("4")); <END> }</code><technical_language>@jackygurui Assertion instead</technical_language>

Target:
public void testIssue827() { RMapCache<String, Object> mapCache = redisson.getMapCache("test_put_if_absent", StringCodec.INSTANCE); mapCache.putIfAbsent("4", 0L, 10000L, TimeUnit.SECONDS); mapCache.addAndGet("4", 1L); mapCache.putIfAbsent("4", 0L); Assert.assertEquals("1", mapCache.get("4")); mapCache = redisson.getMapCache("test_put_if_absent_1", StringCodec.INSTANCE); mapCache.putIfAbsent("4", 0L); mapCache.addAndGet("4", 1L); mapCache.putIfAbsent("4", 0L); Assert.assertEquals("1", mapCache.get("4")); RMap map = redisson.getMap("test_put_if_absent_2", StringCodec.INSTANCE); map.putIfAbsent("4", 0L); map.addAndGet("4", 1L); map.putIfAbsent("4", 0L); Assert.assertEquals("1", map.get("4")); RMapCache<String, Object> mapCache1 = redisson.getMapCache("test_put_if_absent_3"); Object currValue = mapCache1.putIfAbsent("4", 1.23, 10000L, TimeUnit.SECONDS); Object updatedValue = mapCache1.addAndGet("4", 1D); System.out.println("updatedValue: " + updatedValue); Assert.assertEquals(2.23, mapCache1.get("4")); }
Source:
<code>public IStatus runInWorkspace(IProgressMonitor monitor) { long start = System.currentTimeMillis(); String msg = Messages.refresh_refreshErr; MultiStatus errors = new MultiStatus(ResourcesPlugin.PI_RESOURCES, 1, msg, null); long longestRefresh = 0; SubMonitor subMonitor = SubMonitor.convert(monitor); try { if (Policy.DEBUG_AUTO_REFRESH) Policy.debug(RefreshManager.DEBUG_PREFIX + " starting refresh job"); int refreshCount = 0; int depth = 2; IResource toRefresh; while ((toRefresh = nextRequest()) != null) { try { <START> subMonitor.setWorkRemaining(fRequests.size()); <END> refreshCount++; long refreshTime = -System.currentTimeMillis(); toRefresh.refreshLocal(1000 + depth, subMonitor.split(1)); refreshTime += System.currentTimeMillis(); if (refreshTime > longestRefresh) longestRefresh = refreshTime; if (refreshCount % 1000 == 0) { Thread.yield(); if (longestRefresh > 2000 && depth > 1) { depth = 1; } if (longestRefresh < 1000) { depth *= 2; } longestRefresh = 0; } addRequests(collectChildrenToDepth(toRefresh, new ArrayList<IResource>(), depth)); } catch (CoreException e) { errors.merge(new Status(IStatus.ERROR, ResourcesPlugin.PI_RESOURCES, 1, errors.getMessage(), e)); } } } finally { pathPrefixHistory = null; rootPathHistory = null; subMonitor.setWorkRemaining(0); if (Policy.DEBUG_AUTO_REFRESH) Policy.debug(RefreshManager.DEBUG_PREFIX + " finished refresh job in: " + (System.currentTimeMillis() - start) + "ms"); } if (!errors.isOK()) return errors; return Status.OK_STATUS; }</code><technical_language>Change this: setWorkRemaining(Math.max(fRequests.size(), 10)) consume entire progress monitor if fRequests contains a small number of items iteration</technical_language>

Target:
public IStatus runInWorkspace(IProgressMonitor monitor) { long start = System.currentTimeMillis(); String msg = Messages.refresh_refreshErr; MultiStatus errors = new MultiStatus(ResourcesPlugin.PI_RESOURCES, 1, msg, null); long longestRefresh = 0; SubMonitor subMonitor = SubMonitor.convert(monitor); try { if (Policy.DEBUG_AUTO_REFRESH) Policy.debug(RefreshManager.DEBUG_PREFIX + " starting refresh job"); int refreshCount = 0; int depth = 2; IResource toRefresh; while ((toRefresh = nextRequest()) != null) { try { subMonitor.setWorkRemaining(Math.max(fRequests.size(), 10)); refreshCount++; long refreshTime = -System.currentTimeMillis(); toRefresh.refreshLocal(1000 + depth, subMonitor.split(1)); refreshTime += System.currentTimeMillis(); if (refreshTime > longestRefresh) longestRefresh = refreshTime; if (refreshCount % 1000 == 0) { Thread.yield(); if (longestRefresh > 2000 && depth > 1) { depth = 1; } if (longestRefresh < 1000) { depth *= 2; } longestRefresh = 0; } addRequests(collectChildrenToDepth(toRefresh, new ArrayList<IResource>(), depth)); } catch (CoreException e) { errors.merge(new Status(IStatus.ERROR, ResourcesPlugin.PI_RESOURCES, 1, errors.getMessage(), e)); } } } finally { pathPrefixHistory = null; rootPathHistory = null; if (Policy.DEBUG_AUTO_REFRESH) Policy.debug(RefreshManager.DEBUG_PREFIX + " finished refresh job in: " + (System.currentTimeMillis() - start) + "ms"); } if (!errors.isOK()) return errors; return Status.OK_STATUS; }
Source:
<code>private Pair<DiskImage, Long> getLatestOVFDisk(List<Disk> disks) { <START> Date lastUpdate = new Date(); <END> boolean lastIsUpdated = false; Long size = 0L; Disk diskToGetOVF = null; for (Disk disk : disks) { boolean isDiskLastUpdated = false; String diskDecription = ((DiskImage) disk).getDescription(); if (diskDecription.contains(OvfInfoFileConstants.OvfStoreDescriptionLabel)) { Map<String, Object> diskDescriptionMap = buildJson(diskDecription); if (!isDomainExistsInDiskDescription(diskDescriptionMap, getParameters().getStorageDomainId())) { break; } boolean isUpdated = Boolean.valueOf(diskDescriptionMap.get(OvfInfoFileConstants.IsUpdated).toString()); Date date = getDateFromDiskDescription(diskDescriptionMap); if (!lastIsUpdated && isUpdated) { isDiskLastUpdated = true; } else if (!isUpdated && date.after(lastUpdate)) { isDiskLastUpdated = true; } else if (lastIsUpdated && isUpdated && date.after(lastUpdate)) { isDiskLastUpdated = true; } if (isDiskLastUpdated) { lastIsUpdated = isUpdated; lastUpdate = date; diskToGetOVF = disk; size = new Long(diskDescriptionMap.get(OvfInfoFileConstants.Size).toString()); } } } return new Pair<>((DiskImage)diskToGetOVF, size); }</code><technical_language>rename foundOvfDiskUpdateDate</technical_language>

Target:
private Pair<DiskImage, Long> getLatestOVFDisk(List<Disk> disks) { Date foundOvfDiskUpdateDate = new Date(); boolean isFoundOvfDiskUpdated = false; Long size = 0L; Disk ovfDisk = null; for (Disk disk : disks) { boolean isBetterOvfDiskFound = false; String diskDecription = ((DiskImage) disk).getDescription(); if (diskDecription.contains(OvfInfoFileConstants.OvfStoreDescriptionLabel)) { Map<String, Object> diskDescriptionMap; try { diskDescriptionMap = JsonHelper.jsonToMap(diskDecription); } catch (IOException e) { log.errorFormat("Exception while generating json containing ovf store info. Exception: {0}", e); continue; } if (!isDomainExistsInDiskDescription(diskDescriptionMap, getParameters().getStorageDomainId())) { log.warnFormat("The disk description does not contain the storage domain id {0}", getParameters().getStorageDomainId()); continue; } boolean isUpdated = Boolean.valueOf(diskDescriptionMap.get(OvfInfoFileConstants.IsUpdated).toString()); Date date = getDateFromDiskDescription(diskDescriptionMap); if (!isFoundOvfDiskUpdated && isUpdated) { isBetterOvfDiskFound = true; } else if (!isUpdated && date.after(foundOvfDiskUpdateDate)) { isBetterOvfDiskFound = true; } else if (isFoundOvfDiskUpdated && isUpdated && date.after(foundOvfDiskUpdateDate)) { isBetterOvfDiskFound = true; } if (isBetterOvfDiskFound) { isFoundOvfDiskUpdated = isUpdated; foundOvfDiskUpdateDate = date; ovfDisk = disk; size = new Long(diskDescriptionMap.get(OvfInfoFileConstants.Size).toString()); } } } return new Pair<>((DiskImage)ovfDisk, size); }
Source:
<code>public IterableStream<EventData> receive(int maximumMessageCount, Duration maximumWaitTime) { Objects.requireNonNull(maximumWaitTime, "'maximumWaitTime' cannot be null."); if (maximumMessageCount < 1) { throw new IllegalArgumentException("'maximumMessageCount' cannot be less than 1."); } else if (maximumWaitTime.isNegative() || maximumWaitTime.isZero()) { <START> throw new IllegalArgumentException("'maximumWaitTime' cannot be zero or less."); <END> } final Flux<EventData> events = Flux.create(emitter -> { queueWork(maximumMessageCount, maximumWaitTime, emitter); }); final Flux<EventData> map = events.collectList().map(Flux::fromIterable).block(); return new IterableStream<>(map); }</code><technical_language>(extreme) nit: error condition for exceptions, wording. helpful, if superfluous, consistent verbiage</technical_language>

Target:
public IterableStream<EventData> receive(int maximumMessageCount, Duration maximumWaitTime) { Objects.requireNonNull(maximumWaitTime, "'maximumWaitTime' cannot be null."); if (maximumMessageCount < 1) { throw logger.logExceptionAsError( new IllegalArgumentException("'maximumMessageCount' cannot be less than 1.")); } else if (maximumWaitTime.isNegative() || maximumWaitTime.isZero()) { throw logger.logExceptionAsError( new IllegalArgumentException("'maximumWaitTime' cannot be zero or less.")); } final Flux<EventData> events = Flux.create(emitter -> { queueWork(maximumMessageCount, maximumWaitTime, emitter); }); final Flux<EventData> map = events.collectList().map(x -> { logger.info("Number of events received: {}", x.size()); return Flux.fromIterable(x); }).block(); return new IterableStream<>(map); }
Source:
<code><START> public void generateAndWrite(AnnotationExtractionRequest request) throws IOException { <END> AnnotationExtractionResponse response = annotationExtractionService.extract(request); writerGenerator.generateWriters(request.getElement(), response).forEach(writer -> { try { writer.write(); } catch (IOException e) { e.printStackTrace(); } }); }</code><technical_language>Is this a convenience method do genuine for generateWriters() generateAndWrite()? Put in alternative way, this delegate generateWriters()</technical_language>

Target:
public void generateAndWrite(AnnotationExtractionRequest request) throws IOException { this.generateWriters(request).forEach(writer -> { try { writer.write(); } catch (IOException e) { e.printStackTrace(); } }); }
Source:
<code>private void mergeAndPush() { final Granularity segmentGranularity = schema.getGranularitySpec().getSegmentGranularity(); final Period windowPeriod = config.getWindowPeriod(); final long windowMillis = windowPeriod.toStandardDuration().getMillis(); log.info("Starting merge and push."); DateTime minTimestampAsDate; try { minTimestampAsDate = segmentGranularity.truncate(rejectionPolicy.getCurrMaxTime().minus(windowMillis)); } catch (ArithmeticException e) { <START> minTimestampAsDate = segmentGranularity.truncate(rejectionPolicy.getCurrMaxTime()); <END> } long minTimestamp = minTimestampAsDate.getMillis(); log.info("Found [%,d] sinks. minTimestamp [%s]", sinks.size(), minTimestampAsDate); List<Map.Entry<Long, Sink>> sinksToPush = Lists.newArrayList(); for (Map.Entry<Long, Sink> entry : sinks.entrySet()) { final Long intervalStart = entry.getKey(); if (intervalStart < minTimestamp) { log.info("Adding entry[%s] for merge and push.", entry); sinksToPush.add(entry); } else { log.warn( "[%s] < [%s] Skipping persist and merge.", new DateTime(intervalStart), minTimestampAsDate ); } } log.info("Found [%,d] sinks to persist and merge", sinksToPush.size()); for (final Map.Entry<Long, Sink> entry : sinksToPush) { persistAndMerge(entry.getKey(), entry.getValue()); } }</code><technical_language>Instead of try/catch, replacing rejectionPolicy.getCurrMaxTime().minus(windowMillis) new DateTime(Math.max(windowMillis, rejectionPolicy.getCurrMaxTime().getMillis()) - windowMillis)? if convinced is cleaner, this cool is I ok merging it</technical_language>

Target:
private void mergeAndPush() { final Granularity segmentGranularity = schema.getGranularitySpec().getSegmentGranularity(); final Period windowPeriod = config.getWindowPeriod(); final long windowMillis = windowPeriod.toStandardDuration().getMillis(); log.info("Starting merge and push."); DateTime minTimestampAsDate = new DateTime(Math.max(windowMillis, rejectionPolicy.getCurrMaxTime().getMillis()) - windowMillis); long minTimestamp = minTimestampAsDate.getMillis(); log.info("Found [%,d] sinks. minTimestamp [%s]", sinks.size(), minTimestampAsDate); List<Map.Entry<Long, Sink>> sinksToPush = Lists.newArrayList(); for (Map.Entry<Long, Sink> entry : sinks.entrySet()) { final Long intervalStart = entry.getKey(); if (intervalStart < minTimestamp) { log.info("Adding entry[%s] for merge and push.", entry); sinksToPush.add(entry); } else { log.warn( "[%s] < [%s] Skipping persist and merge.", new DateTime(intervalStart), minTimestampAsDate ); } } log.info("Found [%,d] sinks to persist and merge", sinksToPush.size()); for (final Map.Entry<Long, Sink> entry : sinksToPush) { persistAndMerge(entry.getKey(), entry.getValue()); } }
Source:
<code>protected RetryState getRetryState(BackOff backoff) { long nextBackOffMillis = 0; try { <START> nextBackOffMillis = backoff.nextBackOffMillis(); <END> if (nextBackOffMillis == BackOff.STOP) { return RetryState.RetriesExhausted; } else { try { sleeper.sleep(nextBackOffMillis); } catch (InterruptedException e) { Thread.interrupted(); return RetryState.Interrupted; } return RetryState.PerformRetry; } } catch (IOException e) { return RetryState.UnknownException; } }</code><technical_language>long nextBackOffMillis = backoff.nextBackOffMillis();</technical_language>

Target:
protected RetryState getRetryState(BackOff backoff) throws IOException{ long nextBackOffMillis = backoff.nextBackOffMillis(); if (nextBackOffMillis == BackOff.STOP) { LOG.warn("Exhausted the number of retries for credentials refresh after " + this.retryOptions.getMaxElaspedBackoffMillis() + " milliseconds."); return RetryState.RetriesExhausted; } try { sleeper.sleep(nextBackOffMillis); return RetryState.PerformRetry; } catch (InterruptedException e) { LOG.warn("Interrupted while trying to refresh credentials."); Thread.interrupted(); return RetryState.Interrupted; } }
Source:
<code>public static List<String> loadRerunFile(ResourceLoader resourceLoader, String rerunPath) { List<String> featurePaths = new ArrayList<String>(); Iterable<Resource> resources = resourceLoader.resources(rerunPath, null); for (Resource resource : resources) { String source = read(resource); if (!source.isEmpty()) { Matcher matcher = RERUN_PATH_SPECIFICATION.matcher(source); while(matcher.find()){ featurePaths.add(matcher.group(1)); } } <START> } <END> return featurePaths; }</code><technical_language>Gherkin v2 filters passed parser filtering done there, straightforward add line filters rerun file filters passed load method. Gherkin v4 filtering is instead done compiling of features pickles, reading rerun file twice, find feature files parsed, get line filters pickle filter chain. This duplication caused fixed times in work upgrading Gherkin v4 (and extract method refactoring missed)</technical_language>

Target:
public static List<PathWithLines> loadRerunFile(ResourceLoader resourceLoader, String rerunPath) { List<PathWithLines> featurePaths = new ArrayList<PathWithLines>(); Iterable<Resource> resources = resourceLoader.resources(rerunPath, null); for (Resource resource : resources) { String source = read(resource); if (!source.isEmpty()) { Matcher matcher = RERUN_PATH_SPECIFICATION.matcher(source); while(matcher.find()){ featurePaths.add(new PathWithLines(matcher.group(1))); } } } return featurePaths; }
Source:
<code>public void close() throws SQLException { keyIterator = null; keyList = null; hash = null; <START> memoryChunk.resize(0); <END> resultIterator.close(); }</code><technical_language>Instead of memoryChunk.resize(0), replace memoryChunk.close(). do other close calls in nested finally blocks</technical_language>

Target:
public void close() throws SQLException { keyIterator = null; keyList = null; hash = null; try { memoryChunk.close(); } finally { resultIterator.close(); } }
Source:
<code>public void performAlign(int offset, int width) { int plotAreaOffset = fChartViewer.getPointAreaOffset(); int sashOffset = Math.max(1, offset - plotAreaOffset); int total = fSashForm.getBounds().width; int width1 = (int) (sashOffset / (float) total * 1000); int width2 = (int) ((total - sashOffset) / (float) total * 1000); <START> fSashForm.setWeights(new int[] { width1, width2 }); <END> fSashForm.layout(); }</code><technical_language>need calculate righ margin account for width</technical_language>

Target:
public void performAlign(int offset, int width) { int plotAreaOffset = fChartViewer.getPointAreaOffset(); int sashOffset = Math.max(1, offset - plotAreaOffset); int total = fSashForm.getBounds().width; int width1 = (int) (sashOffset / (float) total * 1000); int width2 = (int) ((total - sashOffset) / (float) total * 1000); fSashForm.setWeights(new int[] { width1, width2 }); fSashForm.layout(); Composite composite = fXYViewerContainer; GridLayout layout = (GridLayout) composite.getLayout(); int timeAxisWidth = getAvailableWidth(offset); int marginSize = timeAxisWidth - width; layout.marginRight = Math.max(0, marginSize); composite.layout(); }
Source:
<code>public void startup( Workspace workspace ) { this.workspace = workspace; try { for ( Driver d : ServiceLoader.load( Driver.class, workspace.getModuleClassLoader() ) ) { registerDriver( new DriverWrapper( d ) ); <START> registerDriver( new DriverWrapper( new org.sqlite.JDBC() ) ); <END> LOG.info( "Found and loaded {}", d.getClass().getName() ); } } catch ( SQLException e ) { LOG.debug( "Unable to load driver: {}", e.getLocalizedMessage() ); } super.startup( workspace ); }</code><technical_language>if instantiating driver manually is a good idea</technical_language>

Target:
public void startup( Workspace workspace ) { this.workspace = workspace; try { for ( Driver d : ServiceLoader.load( Driver.class, workspace.getModuleClassLoader() ) ) { registerDriver( new DriverWrapper( d ) ); LOG.info( "Found and loaded {}", d.getClass().getName() ); } } catch ( SQLException e ) { LOG.debug( "Unable to load driver: {}", e.getLocalizedMessage() ); ClassLoader moduleClassLoader = workspace.getModuleClassLoader(); for ( Driver d : ServiceLoader.load( Driver.class, moduleClassLoader ) ) { warnIfDriversAreRegisteredInModulesClassLoader( moduleClassLoader, d ); } super.startup( workspace ); } @Override public void shutdown() { } private void warnIfDriversAreRegisteredInModulesClassLoader( ClassLoader moduleClassLoader, Driver d ) { final String clsName = d.getClass().getName(); String clsFile = createClsFile( moduleClassLoader, clsName ); LOG.warn( "The JDBC driver has been found in the modules directory.", clsName ); LOG.warn( "This method of loading JDBC drivers is not supported in deegree any more." ); LOG.warn( "Please check the webservices handbook for more infomation." ); if ( clsFile != null ) { LOG.warn( "The jdbc driver has been found at {}", clsFile ); } } private String createClsFile( ClassLoader moduleClassLoader, final String clsName ) { String clsFile; try { clsFile = moduleClassLoader.getResource( clsName.replace( '.', '/' ) + ".class" ).toString(); } catch ( Exception ign ) { return null; } if ( clsFile == null || clsFile.length() == 0 ) return null; int jarpos = clsFile.indexOf( ".jar" ); if ( jarpos != -1 ) { clsFile = clsFile.substring( 0, jarpos + 4 ); } return clsFile; } }
Source:
<code>private String[] getSubclassNameClosureBySubclassTable(int subclassTableNumber) { final int index = subclassTableNumber - getTableSpan(); if ( index >= subclassNamesBySubclassTable.length ) { throw new IllegalArgumentException( "Given subclass table number is outside expected range [" + subclassNamesBySubclassTable.length <START> + "] as defined by subclassTableNameClosure/subclassClosure" <END> ); } return subclassNamesBySubclassTable[index]; }</code><technical_language>upper limit corrected in error message subclassNamesBySubclassTable - 1</technical_language>

Target:
private String[] getSubclassNameClosureBySubclassTable(int subclassTableNumber) { final int index = subclassTableNumber - getTableSpan(); if ( index >= subclassNamesBySubclassTable.length ) { throw new IllegalArgumentException( "Given subclass table number is outside expected range [" + (subclassNamesBySubclassTable.length -1) + "] as defined by subclassTableNameClosure/subclassClosure" ); } return subclassNamesBySubclassTable[index]; }
Source:
<code>private String getTemplateExclusiveLockMessage() { <START> if (getVmTemplate() != null) { <END> return new StringBuilder(VdcBllMessages.ACTION_TYPE_FAILED_TEMPLATE_IS_BEING_REMOVED.name()) .append(String.format("$TemplateName %1$s", getVmTemplate().getName())) .toString(); } return VdcBllMessages.ACTION_TYPE_FAILED_OBJECT_LOCKED.name(); }</code><technical_language>if template is null, can-do-action checks fail command. check template is null in #getExclusiveLocks(), in case is null return null there, build engine lock acquire it</technical_language>

Target:
private String getTemplateExclusiveLockMessage() { return new StringBuilder(VdcBllMessages.ACTION_TYPE_FAILED_TEMPLATE_IS_BEING_REMOVED.name()) .append(String.format("$TemplateName %1$s", getVmTemplate().getName())) .toString(); }
Source:
<code>private void createStoreThumb(String dsIrodsPath, int width, int height, String dsname, boolean exists, List<String> thumbRels) throws Exception { <START> long start = System.currentTimeMillis(); <END> String resultPath = runConvertScaleStage(dsIrodsPath, "PNG", width, height); LOG.debug("Generated image in {}ms", dsname, (System.currentTimeMillis() - start)); String resultURI = ((AbstractIrodsObjectEnhancementService) service).makeIrodsURIFromPath(resultPath); start = System.currentTimeMillis(); if (!exists) { String message = "adding thumbnail"; client.addManagedDatastream(pid, dsname, false, message, Collections.<String> emptyList(), "Thumbnail Image", false, "image/png", resultURI); } else { String message = "updating thumbnail"; client.modifyDatastreamByReference(pid, dsname, false, message, new ArrayList<String>(), "Thumbnail Image", "image/png", null, null, resultURI); } LOG.debug("Added datastream in {}ms", dsname, (System.currentTimeMillis() - start)); start = System.currentTimeMillis(); ((AbstractIrodsObjectEnhancementService) service).deleteIRODSFile(resultPath); LOG.debug("Cleaned up irods file in {}ms", dsname, (System.currentTimeMillis() - start)); }</code><technical_language>mind naming long vars more specifically this method? e.g., imageStart, datastreamStart, cleanupStart</technical_language>

Target:
private void createStoreThumb(String dsIrodsPath, int width, int height, String dsname, boolean exists, List<String> thumbRels) throws Exception { long convertStart = System.currentTimeMillis(); String resultPath = runConvertScaleStage(dsIrodsPath, "PNG", width, height); LOG.debug("Generated image in {}ms", dsname, (System.currentTimeMillis() - convertStart)); String resultURI = ((AbstractIrodsObjectEnhancementService) service).makeIrodsURIFromPath(resultPath); long addDsStart = System.currentTimeMillis(); if (!exists) { String message = "adding thumbnail"; client.addManagedDatastream(pid, dsname, false, message, Collections.<String> emptyList(), "Thumbnail Image", false, "image/png", resultURI); } else { String message = "updating thumbnail"; client.modifyDatastreamByReference(pid, dsname, false, message, new ArrayList<String>(), "Thumbnail Image", "image/png", null, null, resultURI); } LOG.debug("Added datastream in {}ms", dsname, (System.currentTimeMillis() - addDsStart)); long deleteStart = System.currentTimeMillis(); ((AbstractIrodsObjectEnhancementService) service).deleteIRODSFile(resultPath); LOG.debug("Cleaned up irods file in {}ms", dsname, (System.currentTimeMillis() - deleteStart)); }
Source:
<code>public String getSignature() { <START> return "haversine_dist_degree(DD)"; <END> }</code><technical_language>name "deg" "degrees"</technical_language>

Target:
public String getSignature() { return "haversine_dist_deg(DDN)"; }