auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>public String binaryName() { <START> return this.typeWrapper.elements().getBinaryName(element).toString(); <END> }</code><technical_language>type.binaryName() instead</technical_language>

Target:
public String binaryName() { return this.type.binaryName(); }
Source:
<code>private static void providerExample(BlobStoreContext context) throws IOException { GlacierClient client = context.unwrapApi(GlacierClient.class); final String vaultName = UUID. randomUUID().toString() + "_providerExample"; client.createVault(vaultName); Payload payload = new ByteSourcePayload(buildData(16)); payload.getContentMetadata().setContentType(PLAIN_TEXT_UTF_8.toString()); payload.getContentMetadata().setContentLength(16L); String archiveId = client.uploadArchive(vaultName, payload); JobRequest archiveRetrievalJobRequest = ArchiveRetrievalJobRequest.builder() .archiveId(archiveId) .description("retrieval job") .build(); String jobId = client.initiateJob(vaultName, archiveRetrievalJobRequest); try { new BasePollingStrategy(client).waitForSuccess(vaultName, jobId); Payload result = client.getJobOutput(vaultName, jobId); InputStream is = result.openStream(); try { <START> String data = CharStreams.toString(new InputStreamReader(is, "UTF-8")); <END> System.out.println("The retrieved payload is: " + data); } finally { is.close(); } } catch (InterruptedException e) { Throwables.propagate(e); } }</code><technical_language>Charsets.UTF_8</technical_language>

Target:
private static void providerExample(BlobStoreContext context) throws IOException { GlacierClient client = context.unwrapApi(GlacierClient.class); final String vaultName = "jclouds_providerExample_" + UUID.randomUUID().toString(); client.createVault(vaultName); Payload payload = new ByteSourcePayload(buildData(16)); payload.getContentMetadata().setContentType(PLAIN_TEXT_UTF_8.toString()); payload.getContentMetadata().setContentLength(16L); String archiveId = client.uploadArchive(vaultName, payload); JobRequest archiveRetrievalJobRequest = ArchiveRetrievalJobRequest.builder() .archiveId(archiveId) .description("retrieval job") .build(); String jobId = client.initiateJob(vaultName, archiveRetrievalJobRequest); try { new BasePollingStrategy(client).waitForSuccess(vaultName, jobId); Payload result = client.getJobOutput(vaultName, jobId); System.out.println("The retrieved payload is: " + Strings2.toStringAndClose(result.openStream())); } catch (InterruptedException e) { Throwables.propagate(e); } }
Source:
<code>protected Map<String, Object> getIcon(DocumentReference groupReference) { Map<String, Object> icon = new HashMap<>(); XWikiContext xcontext = this.xcontextProvider.get(); try { XWikiDocument groupProfileDocument = xcontext.getWiki().getDocument(groupReference, xcontext); XWikiAttachment avatarAttachment = getFirstImageAttachment(groupProfileDocument, xcontext); if (avatarAttachment != null) { icon.put(META_DATA_ICON, xcontext.getWiki().getURL(avatarAttachment.getReference(), "download", "width=30&height=30&keepAspectRatio=true", null, xcontext)); } } catch (XWikiException e) { this.logger.warn( "Failed to read the avatar of group [{}]. Root cause is [{}]. Using the default avatar instead.", groupReference.getName(), ExceptionUtils.getRootCauseMessage(e)); } if (!icon.containsKey(META_DATA_ICON)) { <START> icon.put(META_DATA_ICON, xcontext.getWiki().getSkinFile("icons/xwiki/noavatargroup.png", true, xcontext)); <END> } return icon; }</code><technical_language>try icon theme here, for instance group icon</technical_language>

Target:
protected Map<String, Object> getIcon(DocumentReference groupReference) { Map<String, Object> icon = new HashMap<>(); XWikiContext xcontext = this.xcontextProvider.get(); try { XWikiDocument groupProfileDocument = xcontext.getWiki().getDocument(groupReference, xcontext); XWikiAttachment avatarAttachment = getFirstImageAttachment(groupProfileDocument, xcontext); if (avatarAttachment != null) { icon.put(IconManager.META_DATA_URL, xcontext.getWiki().getURL(avatarAttachment.getReference(), "download", "width=30&height=30&keepAspectRatio=true", null, xcontext)); icon.put(IconManager.META_DATA_ICON_SET_TYPE, IconType.IMAGE.name()); } } catch (XWikiException e) { this.logger.warn( "Failed to read the avatar of group [{}]. Root cause is [{}]. Using the default avatar instead.", groupReference.getName(), ExceptionUtils.getRootCauseMessage(e)); } if (!icon.containsKey(IconManager.META_DATA_URL)) { try { icon = this.iconManager.getMetaData(DEFAULT_ICON_NAME); } catch (IconException e) { this.logger.warn("Error getting the icon [{}]. Root cause is [{}].", DEFAULT_ICON_NAME, ExceptionUtils.getRootCause(e)); } } return icon; }
Source:
<code>public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { View view = inflater.inflate(R.layout.fragment_webview_with_paddings, container, false); <START> announcementWebView = view.findViewById(R.id.webview); <END> URLInterceptorWebViewClient client = new URLInterceptorWebViewClient( getActivity(), announcementWebView); client.setAllLinksAsExternal(true); return view; }</code><technical_language>announcement_webview variable name renamed webview, 'announcementWebView' webview odd here</technical_language>

Target:
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { View view = inflater.inflate(R.layout.fragment_webview_with_paddings, container, false); webView = view.findViewById(R.id.webview); URLInterceptorWebViewClient client = new URLInterceptorWebViewClient( getActivity(), webView); client.setAllLinksAsExternal(true); return view; }
Source:
<code>public String getSummary() { String buckets = ""; Histogram intervalHistogram = getIntervalHistogramAndAccumulate(); if (histogramLogWriter != null) { histogramLogWriter.outputIntervalHistogram(intervalHistogram); } if (addstatus) { <START> buckets += getStatusCounts(); <END> } DecimalFormat d = new DecimalFormat("#.##"); return "[" + getName() + ": Count=" + intervalHistogram.getTotalCount() + ", Max=" + intervalHistogram.getMaxValue() + ", Min=" + intervalHistogram.getMinValue() + ", Avg=" + d.format(intervalHistogram.getMean()) + ", 90=" + d.format(intervalHistogram.getValueAtPercentile(90)) + ", 99=" + d.format(intervalHistogram.getValueAtPercentile(99)) + ", 99.9=" + d.format(intervalHistogram.getValueAtPercentile(99.9)) + ", 99.99=" + d.format(intervalHistogram.getValueAtPercentile(99.99)) + buckets +"]"; }</code><technical_language>is this concatenation instead of assignment</technical_language>

Target:
public String getSummary() { Histogram intervalHistogram = getIntervalHistogramAndAccumulate(); if (histogramLogWriter != null) { histogramLogWriter.outputIntervalHistogram(intervalHistogram); } String buckets = getStatusCounts(); DecimalFormat d = new DecimalFormat("#.##"); return "[" + getName() + ": Count=" + intervalHistogram.getTotalCount() + ", Max=" + intervalHistogram.getMaxValue() + ", Min=" + intervalHistogram.getMinValue() + ", Avg=" + d.format(intervalHistogram.getMean()) + ", 90=" + d.format(intervalHistogram.getValueAtPercentile(90)) + ", 99=" + d.format(intervalHistogram.getValueAtPercentile(99)) + ", 99.9=" + d.format(intervalHistogram.getValueAtPercentile(99.9)) + ", 99.99=" + d.format(intervalHistogram.getValueAtPercentile(99.99)) + buckets +"]"; }
Source:
<code>public <T> void notifyReadyAsync( Callable<T> callable, BiConsumer<T, Throwable> handler, long initialDelayMs, long periodMs) { workerExecutor.scheduleAtFixedRate(() -> { try { T result = callable.call(); executorToNotify.execute(() -> handler.accept(result, null)); } catch (Throwable t) { <START> LOG.error("Unexpected exception", t); <END> executorToNotify.execute(() -> handler.accept(null, t)); } }, initialDelayMs, periodMs, TimeUnit.MILLISECONDS); }</code><technical_language>Remove / update log line</technical_language>

Target:
public <T> void notifyReadyAsync( Callable<T> callable, BiConsumer<T, Throwable> handler, long initialDelayMs, long periodMs) { workerExecutor.scheduleAtFixedRate(() -> { try { T result = callable.call(); executorToNotify.execute(() -> handler.accept(result, null)); } catch (Throwable t) { executorToNotify.execute(() -> handler.accept(null, t)); } }, initialDelayMs, periodMs, TimeUnit.MILLISECONDS); }
Source:
<code>List<List<Entry>> filterNotExistTableEdits(final List<List<Entry>> oldEntryList) { List<List<Entry>> entryList = new ArrayList<>(); Map<TableName, Boolean> existMap = new HashMap<>(); try (Connection localConn = ConnectionFactory.createConnection(ctx.getLocalConfiguration()); Admin localAdmin = localConn.getAdmin()) { for (List<Entry> oldEntries : oldEntryList) { List<Entry> entries = new ArrayList<>(); for (Entry e : oldEntries) { TableName tableName = e.getKey().getTableName(); boolean exist = true; if (existMap.containsKey(tableName)) { exist = existMap.get(tableName); } else { try { exist = localAdmin.tableExists(tableName); existMap.put(tableName, exist); } catch (IOException iox) { <START> LOG.warn("Exception checking for local table " + tableName, iox); <END> } } if (exist) { entries.add(e); } else { LOG.warn("Missing table detected at sink, local table also does not exist, " + "filtering edits for table '{}'", tableName); } } if (!entries.isEmpty()) { entryList.add(entries); } } } catch (IOException iox) { LOG.warn("Exception when creating connection to check local table", iox); return oldEntryList; } return entryList; }</code><technical_language>assume table exist's check for it</technical_language>

Target:
List<List<Entry>> filterNotExistTableEdits(final List<List<Entry>> oldEntryList) { List<List<Entry>> entryList = new ArrayList<>(); Map<TableName, Boolean> existMap = new HashMap<>(); try (Connection localConn = ConnectionFactory.createConnection(ctx.getLocalConfiguration()); Admin localAdmin = localConn.getAdmin()) { for (List<Entry> oldEntries : oldEntryList) { List<Entry> entries = new ArrayList<>(); for (Entry e : oldEntries) { TableName tableName = e.getKey().getTableName(); boolean exist = true; if (existMap.containsKey(tableName)) { exist = existMap.get(tableName); } else { try { exist = localAdmin.tableExists(tableName); existMap.put(tableName, exist); } catch (IOException iox) { LOG.warn("Exception checking for local table " + tableName, iox); exist = true; } } if (exist) { entries.add(e); } else { LOG.warn("Missing table detected at sink, local table also does not exist, " + "filtering edits for table '{}'", tableName); } } if (!entries.isEmpty()) { entryList.add(entries); } } } catch (IOException iox) { LOG.warn("Exception when creating connection to check local table", iox); return oldEntryList; } return entryList; }
Source:
<code>private static List<File> listFiles(String directory, String suffix) { File dir = new File(directory); List<File> propFiles = new ArrayList<>(); if (!dir.exists()) { logger.warn("Directory doesn't exists.", directory); <START> return propFiles; <END> } File[] dirFiles = dir.listFiles(); if (dirFiles != null) { for (File file : dirFiles) { if (file.getName().endsWith(suffix)) { propFiles.add(file); } } } return propFiles; }</code><technical_language>please avoid returning in middle of functions</technical_language>

Target:
private static List<File> listFiles(String directory, String suffix) { File dir = new File(directory); List<File> propFiles = new ArrayList<>(); File[] dirFiles = dir.listFiles(); if (dirFiles != null) { for (File file : dirFiles) { if (file.getName().endsWith(suffix)) { propFiles.add(file); } } } return propFiles; }
Source:
<code>private DriverSideMsgHandler(final AggregationMaster aggregationMaster, final SerializableCodec<String> codec) { this.aggregationMaster = aggregationMaster; this.codec = codec; this.msgCountDown = new CountDownLatch(RemoteEMDriver.EVAL_NUM); this.slaveIds = Collections.synchronizedSet(new HashSet<String>(RemoteEMDriver.EVAL_NUM)); <START> syncThread = new Thread(new SyncThread()); <END> }</code><technical_language>question: syncThread a member of this class? initiate thread is start, in MemoryStoreImpl.initialize()</technical_language>

Target:
private DriverSideMsgHandler(final AggregationMaster aggregationMaster, final SerializableCodec<String> codec) { this.aggregationMaster = aggregationMaster; this.codec = codec; this.msgCountDown = new CountDownLatch(RemoteEMDriver.EVAL_NUM); this.workerIds = Collections.synchronizedSet(new HashSet<String>(RemoteEMDriver.EVAL_NUM)); syncWorkers(); }
Source:
<code>private static String deriveTemplateUuidOnHost(VmwareHypervisorHost hyperHost, String storeIdentifier, String templateName) { try{ String templateUuid = UUID.nameUUIDFromBytes((templateName + "@" + storeIdentifier + "-" + hyperHost.getMor().getValue()).getBytes("UTF-8")).toString(); }catch(UnsupportedEncodingException e){ <START> s_logger.warn("Unable to generate UUID due to unexpected encoding error."+e); <END> } templateUuid = templateUuid.replaceAll("-", ""); return templateUuid; }</code><technical_language>change to: "Unable generate UUID due unexpected encoding error: " + e.getLocalizedMessage()</technical_language>

Target:
private static String deriveTemplateUuidOnHost(VmwareHypervisorHost hyperHost, String storeIdentifier, String templateName) { try{ String templateUuid = UUID.nameUUIDFromBytes((templateName + "@" + storeIdentifier + "-" + hyperHost.getMor().getValue()).getBytes("UTF-8")).toString(); }catch(UnsupportedEncodingException e){ s_logger.warn("Unable to generate UUID due to unexpected encoding error."+e.getLocalizedMessage()); } templateUuid = templateUuid.replaceAll("-", ""); return templateUuid; }
Source:
<code><START> public void addUpdateTask(Operations operation, String key, String value) { <END> mUpdateTasks.add(new BoxMetadataUpdateTask(operation, key, value)); setUpdateTasks(mUpdateTasks); }</code><technical_language>this return UpdateFileMetadata instead of void developers builder pattern like: java updateRequest.addUpdateTask(op, k, v) .addUpdateTask(op2, k2, v2);</technical_language>

Target:
public UpdateFileMetadata addUpdateTask(Operations operation, String key, String value) { mUpdateTasks.add(new BoxMetadataUpdateTask(operation, key, value)); return setUpdateTasks(mUpdateTasks); }
Source:
<code>private String getNameForNonStringMapRecord(Type keyType, Type valueType, Schema keySchema, Schema valueSchema) { <START> if (keyType instanceof Class && valueType instanceof Class) { <END> Class keyClass = (Class)keyType; Class valueClass = (Class)valueType; if (keyClass.getPackage().equals(JAVA_LANG_PKG) && valueClass.getPackage().equals(JAVA_LANG_PKG)) { return NS_MAP_ARRAY_RECORD + keyClass.getSimpleName() + valueClass.getSimpleName(); } } String name = keySchema.getFullName() + valueSchema.getFullName(); long fingerprint = 0; try { fingerprint = SchemaNormalization.fingerprint64(name.getBytes("UTF-8")); } catch (UnsupportedEncodingException e) { String msg = "Unable to create fingerprint for (" + keyType + ", " + valueType + ") pair"; throw new AvroRuntimeException(msg, e); } if (fingerprint < 0) fingerprint = -fingerprint; String fpString = Long.toString(fingerprint, 16); return NS_MAP_ARRAY_RECORD + fpString; }</code><technical_language>this key Schemas instead of types? I more sense check Schema.Type instead of evaluating String equality</technical_language>

Target:
private String getNameForNonStringMapRecord(Type keyType, Type valueType, Schema keySchema, Schema valueSchema) { if (keyType instanceof Class && valueType instanceof Class) { Class keyClass = (Class)keyType; Class valueClass = (Class)valueType; Package pkg1 = keyClass.getPackage(); Package pkg2 = valueClass.getPackage(); if (pkg1 != null && pkg1.getName().startsWith("java") && pkg2 != null && pkg2.getName().startsWith("java")) { return NS_MAP_ARRAY_RECORD + keyClass.getSimpleName() + valueClass.getSimpleName(); } } String name = keySchema.getFullName() + valueSchema.getFullName(); long fingerprint = 0; try { fingerprint = SchemaNormalization.fingerprint64(name.getBytes("UTF-8")); } catch (UnsupportedEncodingException e) { String msg = "Unable to create fingerprint for (" + keyType + ", " + valueType + ") pair"; throw new AvroRuntimeException(msg, e); } if (fingerprint < 0) fingerprint = -fingerprint; String fpString = Long.toString(fingerprint, 16); return NS_MAP_ARRAY_RECORD + fpString; }
Source:
<code>public static void setupLogging(String log4jConfig, URL defaultUrl) { try { URL url = defaultUrl; <START> if (!StringUtils.isBlank(log4jConfig)) { <END> File f = new File(log4jConfig); if (f.exists()) { url = f.toURI().toURL(); } else { url = new URL(log4jConfig); } } LogManager.resetConfiguration(); DOMConfigurator.configure(url); } catch (IOException | FactoryConfigurationError ex) { throw new RuntimeException("Cannot configure logging: " + ex.getMessage(), ex); } }</code><technical_language>isEmpty? Do reject file name " " ? :)</technical_language>

Target:
public static void setupLogging(String log4jConfig, URL defaultUrl) { try { LogManager.resetConfiguration(); if (log4jConfig == null) { DOMConfigurator.configure(defaultUrl); } else { DOMConfigurator.configure(log4jConfig); } } catch (FactoryConfigurationError ex) { throw new RuntimeException("Cannot configure logging: " + ex.getMessage(), ex); } }
Source:
<code>public void testRemoveValueNoStoreEntryNoCacheWriterEntry() throws Exception { final MockStore realStore = new MockStore(Collections.<String, String>emptyMap()); this.store = spy(realStore); final MockCacheWriter realCache = new MockCacheWriter(Collections.<String, String>emptyMap()); final Ehcache<String, String> ehcache = this.getEhcache(realCache); assertFalse(ehcache.remove("key", "value")); verify(this.store).computeIfPresent(eq("key"), getAnyBiFunction()); verifyZeroInteractions(this.spiedResilienceStrategy); assertThat(realStore.getMap().containsKey("key"), is(false)); assertThat(realCache.getEntries().containsKey("key"), is(false)); <START> validateStats(ehcache, EnumSet.of(CacheOperationOutcomes.RemoveOutcome.FAILURE)); END> }</code><technical_language>Sounds ok outcome matches false return</technical_language>

Target:
public void testRemoveValueNoStoreEntryNoCacheWriterEntry() throws Exception { final FakeStore fakeStore = new FakeStore(Collections.<String, String>emptyMap()); this.store = spy(fakeStore); final FakeCacheWriter fakeWriter = new FakeCacheWriter(Collections.<String, String>emptyMap()); final Ehcache<String, String> ehcache = this.getEhcache(fakeWriter); assertFalse(ehcache.remove("key", "value")); verify(this.store).computeIfPresent(eq("key"), getAnyBiFunction()); verifyZeroInteractions(this.spiedResilienceStrategy); assertThat(fakeStore.getEntryMap().containsKey("key"), is(false)); assertThat(fakeWriter.getEntryMap().containsKey("key"), is(false)); validateStats(ehcache, EnumSet.of(CacheOperationOutcomes.RemoveOutcome.FAILURE)); }
Source:
<code>protected boolean shouldValidateOnBudgetTotal() { Boolean validateOnBudgetTotal = parameterService.getParameterValueAsBoolean(ArConstants.AR_NAMESPACE_CODE, ArConstants.CONTRACTS_GRANTS_INVOICE_COMPONENT, <START> CuArConstants.CG_INVOICE_AMT_BILLED_SUSPENSION_BY_BUDGET_TOTAL, Boolean.TRUE.booleanValue()); <END> if (LOG.isDebugEnabled()) { LOG.debug("shouldValidateOnBudgetTotal, the value of " + CuArConstants.CG_INVOICE_AMT_BILLED_SUSPENSION_BY_BUDGET_TOTAL + " is " + validateOnBudgetTotal.booleanValue()); } return validateOnBudgetTotal.booleanValue(); }</code><technical_language>This ParameterService method accepts a Boolean object, need unbox Boolean.TRUE here</technical_language>

Target:
protected boolean shouldValidateOnBudgetTotal() { Boolean validateOnBudgetTotal = parameterService.getParameterValueAsBoolean(ArConstants.AR_NAMESPACE_CODE, ArConstants.CONTRACTS_GRANTS_INVOICE_COMPONENT, CuArConstants.CG_INVOICE_AMT_BILLED_SUSPENSION_BY_BUDGET_TOTAL, Boolean.TRUE); if (LOG.isDebugEnabled()) { LOG.debug("shouldValidateOnBudgetTotal, the value of " + CuArConstants.CG_INVOICE_AMT_BILLED_SUSPENSION_BY_BUDGET_TOTAL + " is " + validateOnBudgetTotal.booleanValue()); } return validateOnBudgetTotal.booleanValue(); }
Source:
<code>public RexNode singleton(RexBuilder rexBuilder, RelDataType inputRowType, AggregateCall aggregateCall) { final List<RexNode> predicates = new ArrayList<>(); for (Integer arg : aggregateCall.getArgList()) { final RelDataType type = inputRowType.getFieldList().get(arg).getType(); if (type.isNullable()) { predicates.add( rexBuilder.makeCall(SqlStdOperatorTable.IS_NOT_NULL, rexBuilder.makeInputRef(type, arg))); } } final RexNode predicate = RexUtil.composeConjunction(rexBuilder, predicates, true); if (predicate == null) { <START> return rexBuilder.makeBigintLiteral(BigDecimal.ONE); <END> } else { return rexBuilder.makeCall(SqlStdOperatorTable.CASE, predicate, rexBuilder.makeBigintLiteral(BigDecimal.ONE), rexBuilder.makeBigintLiteral(BigDecimal.ZERO)); } }</code><technical_language>assume COUNT is BIGINT. (In some type systems INT.) AggregateCall.type</technical_language>

Target:
public RexNode singleton(RexBuilder rexBuilder, RelDataType inputRowType, AggregateCall aggregateCall) { final List<RexNode> predicates = new ArrayList<>(); for (Integer arg : aggregateCall.getArgList()) { final RelDataType type = inputRowType.getFieldList().get(arg).getType(); if (type.isNullable()) { predicates.add( rexBuilder.makeCall(SqlStdOperatorTable.IS_NOT_NULL, rexBuilder.makeInputRef(type, arg))); } } final RexNode predicate = RexUtil.composeConjunction(rexBuilder, predicates, true); final RexNode rexOne = rexBuilder.makeExactLiteral( BigDecimal.ONE, aggregateCall.getType()); if (predicate == null) { return rexOne; } else { return rexBuilder.makeCall(SqlStdOperatorTable.CASE, predicate, rexOne, rexBuilder.makeExactLiteral(BigDecimal.ZERO, aggregateCall.getType())); } }
Source:
<code>private Options createOptions() { <START> Options opt = new Options(); <END> opt.addOption(buildOption(CliOption.CONF, true, true)); opt.addOption(buildOption(CliOption.CONNECTOR, true, true)); opt.addOption(buildOption(CliOption.CHANGE_ID, true, false)); opt.addOption(buildOption(CliOption.REVISION_ID, true, false)); opt.addOption(buildOption(CliOption.PULL_REQUEST_ID, true, false)); return opt; }</code><technical_language>long names please: options</technical_language>

Target:
private Options createOptions() { Options localOptions = new Options(); localOptions.addOption(buildOption(CliOption.CONF, true, true)); localOptions.addOption(buildOption(CliOption.CONNECTOR, true, true)); localOptions.addOption(buildOption(CliOption.CHANGE_ID, true, false)); localOptions.addOption(buildOption(CliOption.REVISION_ID, true, false)); localOptions.addOption(buildOption(CliOption.PULL_REQUEST_ID, true, false)); return localOptions; }
Source:
<code>public void appliesOuterTimeoutOnAdditionalChildren() { Duration defaultInnerWait = Duration.ofMillis(2); Duration outerWait = Duration.ofMillis(20); WaitStrategy child1 = new SleepingStrategy(defaultInnerWait); WaitStrategy child2 = new SleepingStrategy(defaultInnerWait); <START> final WaitStrategy underTest = ((WaitAllStrategy) new WaitAllStrategy() <END> .withStrategy(child1) .withStartupTimeout(outerWait)) .withStrategy(child2); try { underTest.waitUntilReady(container); } catch (Exception e) { if (e.getCause() instanceof CaughtTimeoutException) fail("The timeout wasn't applied to inner strategies."); else { fail(e.getMessage()); } } }</code><technical_language>this test demonstrates usability issue in WaitAllStrategy, change withStartupTimeout's return method WaitAllStrategy. do in this PR if want :) /cc @rnorth</technical_language>

Target:
public void appliesOuterTimeoutOnAdditionalChildren() { Duration defaultInnerWait = Duration.ofMillis(2); Duration outerWait = Duration.ofMillis(20); WaitStrategy child1 = new SleepingStrategy(defaultInnerWait); WaitStrategy child2 = new SleepingStrategy(defaultInnerWait); final WaitStrategy underTest = new WaitAllStrategy() .withStrategy(child1) .withStartupTimeout(outerWait) .withStrategy(child2); try { underTest.waitUntilReady(container); } catch (Exception e) { if (e.getCause() instanceof CaughtTimeoutException) fail("The timeout wasn't applied to inner strategies."); else { fail(e.getMessage()); } } }
Source:
<code>SMTPConnection(NetClient client, ConnectionLifeCycleListener listener) { broken = true; idle = false; doShutdown = false; socketClosed = false; socketShutDown = false; this.client = client; this.listener = listener; this.nsHandler = new MultilineParser(buffer -> { if (commandReplyHandler == null) { <START> log.debug("dropping reply arriving after we stopped processing \"" + buffer.toString() + "\""); <END> } else { Handler<String> currentHandler = commandReplyHandler; commandReplyHandler = null; currentHandler.handle(buffer.toString()); } }); }</code><technical_language>want log buffer enables log injection</technical_language>

Target:
SMTPConnection(NetClient client, ConnectionLifeCycleListener listener) { broken = true; idle = false; doShutdown = false; socketClosed = false; socketShutDown = false; this.client = client; this.listener = listener; this.nsHandler = new MultilineParser(buffer -> { if (commandReplyHandler == null) { log.debug("dropping reply arriving after we stopped processing the buffer."); } else { Handler<String> currentHandler = commandReplyHandler; commandReplyHandler = null; currentHandler.handle(buffer.toString()); } }); }
Source:
<code>public static boolean validatePort(String targetPort) { <START> return StringUtils.isNotBlank(targetPort) && StringUtils.isNumeric(targetPort); <END> }</code><technical_language>consider 0 invalid well. revert change: <LINK_0></technical_language>

Target:
public static boolean validatePort(String targetPort) { return StringUtils.isNotBlank(targetPort) && StringUtils.isNumeric(targetPort) && NumberUtils.createInteger(targetPort) != 0; }
Source:
<code>private boolean validateSuiteSetting(String name, Set<String> keywords) throws JSONException { if (!moduleInfo.has(name)) { if(keywords != <START> null) { <END> CLog.i("Test Module: %s can't be found in module-info.json, but it has " + "key-word setting. Ignore checking...", name); return true; } CLog.w("Test Module: %s can't be found in module-info.json.", name); return false; } JSONArray compatibilitySuites = moduleInfo.getJSONObject(name). getJSONArray(LOCAL_COMPATIBILITY_SUITES); for (int i = 0; i < compatibilitySuites.length(); i++) { String suite = compatibilitySuites.optString(i); if (suite.equals(GENERAL_TESTS) || suite.equals(DEVICE_TESTS)) { return true; } } return false; }</code><technical_language>&& !keywords.isEmpty()</technical_language>

Target:
private boolean validateSuiteSetting(String name, Set<String> keywords) throws JSONException { if (!moduleInfo.has(name)) { if (!keywords.isEmpty()) { CLog.d("Test Module: %s can't be found in module-info.json, but it has " + "keyword setting. Ignore checking...", name); return true; } CLog.w("Test Module: %s can't be found in module-info.json.", name); return false; } JSONArray compatibilitySuites = moduleInfo.getJSONObject(name). getJSONArray(LOCAL_COMPATIBILITY_SUITES); for (int i = 0; i < compatibilitySuites.length(); i++) { String suite = compatibilitySuites.optString(i); if (suite.equals(GENERAL_TESTS) || suite.equals(DEVICE_TESTS)) { return true; } } return false; }
Source:
<code>public Mono<Instant> renewMessageLock(UUID lockToken) { return isAuthorized(PEEK_OPERATION).thenMany(createRequestResponse.flatMap(channel -> { Message requestMessage = createManagementMessage(RENEW_LOCK_OPERATION, channel.getReceiveLinkName()); requestMessage.setBody(new AmqpValue(Collections.singletonMap(LOCK_TOKENS_KEY, new UUID[]{lockToken}))); return channel.sendWithAck(requestMessage); }).flatMapMany(responseMessage -> { int statusCode = RequestResponseUtils.getResponseStatusCode(responseMessage); if (statusCode != AmqpResponseCode.OK.getValue()) { return Mono.error(ExceptionUtil.amqpResponseCodeToException(statusCode, "Could not renew the lock.", getErrorContext())); } <START> return Flux.fromIterable(messageSerializer.deserializeList(responseMessage, Instant.class)); <END> })) .next(); }</code><technical_language>access list here, return item in list a mono wrapping in a flux iterable choosing item it</technical_language>

Target:
public Mono<Instant> renewMessageLock(UUID lockToken) { return isAuthorized(PEEK_OPERATION).then(createRequestResponse.flatMap(channel -> { Message requestMessage = createManagementMessage(RENEW_LOCK_OPERATION, channel.getReceiveLinkName()); requestMessage.setBody(new AmqpValue(Collections.singletonMap(LOCK_TOKENS_KEY, new UUID[]{lockToken}))); return channel.sendWithAck(requestMessage); }).map(responseMessage -> { int statusCode = RequestResponseUtils.getResponseStatusCode(responseMessage); if (statusCode != AmqpResponseCode.OK.getValue()) { throw logger.logExceptionAsError(new AmqpException(false, String.format("Could not renew the lock for lock token: '%s'.", lockToken.toString()), getErrorContext())); } List<Instant> renewTimeList = messageSerializer.deserializeList(responseMessage, Instant.class); if (CoreUtils.isNullOrEmpty(renewTimeList)) { throw logger.logExceptionAsError(new AmqpException(false, String.format("Service bus response empty. " + "Could not renew message with lock token: '%s'.", lockToken.toString()), getErrorContext())); } return renewTimeList.get(0); })); }
Source:
<code>public void doFilter(final ServletRequest servletRequest, final ServletResponse servletResponse, final FilterChain filterChain) throws IOException, ServletException { final HttpServletRequest request = (HttpServletRequest) servletRequest; final HttpServletResponse response = (HttpServletResponse) servletResponse; <START> if (handler.isTokenRequest(request)) { <END> handler.recordSession(request); } else if (handler.isBackChannelLogoutRequest(request)) { handler.destroySession(request); return; } else if (handler.isFrontChannelLogoutRequest(request)) { handler.destroySession(request); final String redirectionUrl = handler.computeRedirectionToServer(request); if (redirectionUrl != null) { CommonUtils.sendRedirect(response, redirectionUrl); } return; } else { logger.trace("Ignoring URI {}", request.getRequestURI()); } filterChain.doFilter(servletRequest, servletResponse); }</code><technical_language>Instead of if calls for case, encapsulate condition a strategy class? way, this reduced handler.execute() handler is typed for case</technical_language>

Target:
public void doFilter(final ServletRequest servletRequest, final ServletResponse servletResponse, final FilterChain filterChain) throws IOException, ServletException { final HttpServletRequest request = (HttpServletRequest) servletRequest; final HttpServletResponse response = (HttpServletResponse) servletResponse; if (handler.process(request, response)) { filterChain.doFilter(servletRequest, servletResponse); } }
Source:
<code><START> public void doSetFilter(FileListFilter<F> filter) { <END> this.filter = filter; }</code><technical_language>intend this final</technical_language>

Target:
protected final void doSetFilter(FileListFilter<F> filter) { this.filter = filter; }
Source:
<code>private void convertAlert(HealthMapLocation healthMapLocation, Location location, Set<Location> convertedLocations, Set<DiseaseOccurrence> convertedOccurrences) { if (healthMapLocation.getAlerts() != null) { for (HealthMapAlert healthMapAlert : healthMapLocation.getAlerts()) { DiseaseOccurrence occurrence = alertConverter.convert(healthMapAlert, location); if (occurrence != null) { location = continueLocationConversion(healthMapLocation, location); if (location != null) { occurrence.setLocation(location); <START> if (automaticModelRunsEnabled(occurrence)) { <END> diseaseOccurrenceValidationService.addValidationParameters(occurrence); } diseaseService.saveDiseaseOccurrence(occurrence); convertedLocations.add(location); convertedOccurrences.add(occurrence); } else { break; } } } } }</code><technical_language>Cool this :) If automatic model runs is enabled, occurrence's location passed QC, is_validated needs set true - add this</technical_language>

Target:
private void convertAlert(HealthMapLocation healthMapLocation, Location location, Set<Location> convertedLocations, Set<DiseaseOccurrence> convertedOccurrences) { if (healthMapLocation.getAlerts() != null) { for (HealthMapAlert healthMapAlert : healthMapLocation.getAlerts()) { DiseaseOccurrence occurrence = alertConverter.convert(healthMapAlert, location); if (occurrence != null) { location = continueLocationConversion(healthMapLocation, location); if (location != null) { occurrence.setLocation(location); diseaseOccurrenceValidationService.addValidationParameters(occurrence); diseaseService.saveDiseaseOccurrence(occurrence); convertedLocations.add(location); convertedOccurrences.add(occurrence); } else { break; } } } } }
Source:
<code>protected Map<String, String> getImgMetadata(File file, List<String> ignoreKeysList) { logger.debug("Get image Metadata in Resource Action"); Map<String, String> meta = new HashMap<>(); try { Metadata metadata = ImageMetadataReader.readMetadata(file); for (Directory directory : metadata.getDirectories()) { for (Tag tag : directory.getTags()) { if (!ignoreKeysList.contains(tag.getTagName())) { logger.debug("Add Metadata with key: {}", tag.getTagName()); meta.put(tag.getTagName(), tag.getDescription()); } else { logger.debug("Skip Metadata key {}", tag.getTagName()); } } } } catch (ImageProcessingException ex) { <START> logger.error("Error reading metadata"); <END> } catch (IOException ioex) { logger.error("Error reading file"); } return meta; }</code><technical_language>exceptions logged</technical_language>

Target:
protected Map<String, String> getImgMetadata(File file, List<String> ignoreKeysList) { logger.debug("Get image Metadata in Resource Action"); Map<String, String> meta = new HashMap<>(); try { Metadata metadata = ImageMetadataReader.readMetadata(file); for (Directory directory : metadata.getDirectories()) { for (Tag tag : directory.getTags()) { if (!ignoreKeysList.contains(tag.getTagName())) { logger.debug("Add Metadata with key: {}", tag.getTagName()); meta.put(tag.getTagName(), tag.getDescription()); } else { logger.debug("Skip Metadata key {}", tag.getTagName()); } } } } catch (ImageProcessingException|IOException ex) { logger.error("Error reading image metadata", ex); } return meta; }
Source:
<code><START> public DefaultCurveMetadataBuilder dayCount(DayCount dayCount) { <END> if (dayCount != null) { this.info.put(CurveInfoType.DAY_COUNT, dayCount); } return this; }</code><technical_language>reason I of for allowing a null argument is allow reuse of existing builder a null day count clear previously set day count. happen here; if day count is null previous day count is left in place method returns successfully. I behaviour of day count is null - Throw IllegalArgumentException - info.remove(CurveInfoType.DAY_COUNT) I a strong opinion is</technical_language>

Target:
public DefaultCurveMetadataBuilder dayCount(DayCount dayCount) { return addInfo(CurveInfoType.DAY_COUNT, dayCount); }
Source:
<code>private TemporalUnitOffset getAllowableOffset() { if (SystemUtils.IS_OS_WINDOWS) { <START> return within(0, ChronoUnit.MICROS); <END> } else { return within(0, ChronoUnit.NANOS); } }</code><technical_language>more lenient comparison window always, get rid of OS detection? intending test system clock all, OS-specific behavior avoided possible</technical_language>

Target:
private TemporalUnitOffset getAllowableOffset() { return within(0, ChronoUnit.MICROS); }
Source:
<code>public void shouldGetActiveDiagnosesWithFromDate() { assertEquals(1, diagnosisDAO.getActiveDiagnoses(new Patient(2), new Date(0)).size()); <START> } <END></code><technical_language>This is i mean. If i supplied dates, i get results basing date value</technical_language>

Target:
public void shouldGetActiveDiagnosesWithFromDate() { Calendar calendar = new GregorianCalendar(2014,1,1,13,24,56); assertEquals(1, diagnosisDAO.getActiveDiagnoses(new Patient(2), calendar.getTime()).size()); }
Source:
<code>public boolean perform(AbstractBuild<?, ?> build, Launcher launcher, BuildListener listener) throws InterruptedException, IOException { final String sha1 = ObjectId.toString(BuildDataHelper.getCommitSHA1(build)); for (GitHubRepositoryName name : GitHubRepositoryNameContributor.parseAssociatedNames(build.getProject())) { for (GHRepository repository : name.resolve()) { listener.getLogger().println(Messages.GitHubCommitNotifier_SettingCommitStatus(repository.getUrl() + "/commit/" + sha1)); <START> repository.createCommitStatus(sha1, GHCommitState.PENDING, build.getAbsoluteUrl(), Messages.CommitNotifier_Pending(build.getProject().getFullName()), build.getProject().getFullName()); <END> } } return true; }</code><technical_language>reasons change <code>DisplayName</code> project's full name. In cases status info lose information build</technical_language>

Target:
public boolean perform(AbstractBuild<?, ?> build, Launcher launcher, BuildListener listener) throws InterruptedException, IOException { final String sha1 = ObjectId.toString(BuildDataHelper.getCommitSHA1(build)); for (GitHubRepositoryName name : GitHubRepositoryNameContributor.parseAssociatedNames(build.getProject())) { for (GHRepository repository : name.resolve()) { listener.getLogger().println(Messages.GitHubCommitNotifier_SettingCommitStatus(repository.getUrl() + "/commit/" + sha1)); repository.createCommitStatus(sha1, GHCommitState.PENDING, build.getAbsoluteUrl(), Messages.CommitNotifier_Pending(build.getDisplayName()), build.getProject().getFullName()); } } return true; }
Source:
<code>public V getOrFill(K key, Callable<V> callable) { try { return callable.call() ; } catch (Exception e) { <START> e.printStackTrace(); <END> return null; } }</code><technical_language>printStackTrace()? a logger</technical_language>

Target:
public V getOrFill(K key, Callable<V> callable) { try { return callable.call() ; } catch (Exception e) { return null; } }
Source:
<code><START> public void addAncestors(final Path qualifiedPath, @Nullable final BulkOperationState operationState) throws IOException { <END> Collection<DDBPathMetadata> newDirs = new ArrayList<>(); final AncestorState ancestorState = extractOrCreate(operationState, BulkOperationState.OperationType.Rename); Path parent = qualifiedPath.getParent(); boolean entryFound = false; while (!parent.isRoot()) { synchronized (ancestorState) { if (ancestorState.contains(parent)) { break; } } PathMetadata directory = get(parent); if (directory == null || directory.isDeleted()) { if (entryFound) { LOG.warn("Inconsistent S3Guard table: adding directory {}", parent); } S3AFileStatus status = makeDirStatus(username, parent); LOG.debug("Adding new ancestor entry {}", status); DDBPathMetadata meta = new DDBPathMetadata(status, Tristate.FALSE, false); newDirs.add(meta); } else { entryFound = true; if (directory.getFileStatus().isFile()) { throw new PathIOException(parent.toString(), "Cannot overwrite parent file: metadatstore is" + " in an inconsistent state"); } synchronized (ancestorState) { ancestorState.put(parent, new DDBPathMetadata(directory)); } } parent = parent.getParent(); } if (!newDirs.isEmpty()) { patchLastUpdated(newDirs, ttlTimeProvider); innerPut(newDirs, operationState, ttlTimeProvider); } }</code><technical_language>separate lines -IDE thought helpful</technical_language>

Target:
public void addAncestors(final Path qualifiedPath, @Nullable final BulkOperationState operationState) throws IOException { Collection<DDBPathMetadata> newDirs = new ArrayList<>(); final AncestorState ancestorState = extractOrCreate(operationState, BulkOperationState.OperationType.Rename); Path parent = qualifiedPath.getParent(); boolean entryFound = false; while (!parent.isRoot()) { synchronized (ancestorState) { if (ancestorState.contains(parent)) { break; } } PathMetadata directory = get(parent); if (directory == null || directory.isDeleted()) { if (entryFound) { LOG.warn("Inconsistent S3Guard table: adding directory {}", parent); } S3AFileStatus status = makeDirStatus(username, parent); LOG.debug("Adding new ancestor entry {}", status); DDBPathMetadata meta = new DDBPathMetadata(status, Tristate.FALSE, false); newDirs.add(meta); } else { entryFound = true; if (directory.getFileStatus().isFile()) { throw new PathIOException(parent.toString(), "Cannot overwrite parent file: metastore is" + " in an inconsistent state"); } synchronized (ancestorState) { ancestorState.put(parent, new DDBPathMetadata(directory)); } } parent = parent.getParent(); } if (!newDirs.isEmpty()) { patchLastUpdated(newDirs, ttlTimeProvider); innerPut(newDirs, operationState, ttlTimeProvider); } }
Source:
<code>public SqlSystemStreamConfig fetchSourceInfo(String source) { String[] sourceComponents = source.split("\\."); boolean isTable = false; int systemIdx = 0; int endIdx = sourceComponents.length - 1; int streamIdx = endIdx; <START> if (sourceComponents.length != 2) { <END> if (sourceComponents.length != 3 || !sourceComponents[0].equals(SAMZA_SQL_QUERY_TABLE_KEYWORD)) { String msg = String.format("Source %s is not of the format [table.]{systemName}.{streamName{", source); LOG.error(msg); throw new SamzaException(msg); } } if (sourceComponents[endIdx].toLowerCase().equals(SAMZA_SQL_QUERY_TABLE_KEYWORD)) { isTable = true; streamIdx = endIdx - 1; } String systemName = sourceComponents[systemIdx]; String streamName = sourceComponents[streamIdx]; return new SqlSystemStreamConfig(systemName, streamName, fetchSystemConfigs(systemName), isTable); }</code><technical_language>For case source = "$table.bar". I this case pass validation, throw exception</technical_language>

Target:
public SqlSystemSourceConfig fetchSourceInfo(String source) { String[] sourceComponents = source.split("\\."); boolean isTable = false; int endIdx = sourceComponents.length - 1; int streamIdx = endIdx; boolean invalidQuery = false; if (sourceComponents.length != 2) { if (sourceComponents.length != 3 || !sourceComponents[endIdx].equalsIgnoreCase(SAMZA_SQL_QUERY_TABLE_KEYWORD)) { invalidQuery = true; } } else { if (sourceComponents[0].equalsIgnoreCase(SAMZA_SQL_QUERY_TABLE_KEYWORD) || sourceComponents[1].equalsIgnoreCase(SAMZA_SQL_QUERY_TABLE_KEYWORD)) { invalidQuery = true; } } if (invalidQuery) { String msg = String.format("Source %s is not of the format {systemName}.{streamName}[.%s]", source, SAMZA_SQL_QUERY_TABLE_KEYWORD); LOG.error(msg); throw new SamzaException(msg); } if (sourceComponents[endIdx].equalsIgnoreCase(SAMZA_SQL_QUERY_TABLE_KEYWORD)) { isTable = true; streamIdx = endIdx - 1; } String systemName = sourceComponents[0]; String streamName = sourceComponents[streamIdx]; return new SqlSystemSourceConfig(systemName, streamName, fetchSystemConfigs(systemName), isTable); }
Source:
<code>public int removeAmmo(AmmoType ammoType, InfantryWeapon infantryWeapon, int shotsNeeded) { Objects.requireNonNull(ammoType); if (shotsNeeded <= 0) { return 0; } InfantryAmmoStorage ammoStorage = findSpareAmmo(ammoType, infantryWeapon); int shotsRemoved = removeAmmo(ammoStorage, shotsNeeded); <START> shotsNeeded -= shotsRemoved; <END> return shotsRemoved; }</code><technical_language>This is used</technical_language>

Target:
public int removeAmmo(AmmoType ammoType, InfantryWeapon infantryWeapon, int shotsNeeded) { Objects.requireNonNull(ammoType); if (shotsNeeded <= 0) { return 0; } InfantryAmmoStorage ammoStorage = findSpareAmmo(ammoType, infantryWeapon); int shotsRemoved = removeAmmo(ammoStorage, shotsNeeded); return shotsRemoved; }
Source:
<code>public Class<Void> getMarketDataType() { <START> throw new UnsupportedOperationException("getMarketDataType not supported in MissingMappingId"); <END> }</code><technical_language>Returning Void.class OK more friendly</technical_language>

Target:
public Class<Void> getMarketDataType() { return Void.class; }
Source:
<code>protected EntityEquipmentSlot validateSlotIndex(final int slot) { if (slot < 0 || slot >= slots.size()) <START> throw new RuntimeException("Slot " + slot + " not in valid range - [0," + slots.size() + ")"); <END> return slots.get(slot); }</code><technical_language>I IndexOutOfBoundsException</technical_language>

Target:
protected EntityEquipmentSlot validateSlotIndex(final int slot) { if (slot < 0 || slot >= slots.size()) throw new IllegalArgumentException("Slot " + slot + " not in valid range - [0," + slots.size() + ")"); return slots.get(slot); }
Source:
<code>public boolean directAchEdit(PaymentWorksVendorUpdatesDTO vendorUpdate, String vendorNumberList) { boolean isSuccessful = false; <START> String routingNumber = getRoutingNumber(vendorUpdate.getField_changes().getField_changes()); <END> String accountNumber = getAccountNumber(vendorUpdate.getField_changes().getField_changes()); if (!validateRoutingNumberAndAccountNumber(routingNumber, accountNumber)) { return isSuccessful; } List<String> vendorNumbers = Arrays.asList(vendorNumberList.split("\\s*,\\s*")); for (String vendorNumber : vendorNumbers) { PayeeACHAccount payeeAchAccount = this.getActivePayeeAchAccount(PdpConstants.PayeeIdTypeCodes.VENDOR_ID, vendorNumber, PdpConstants.DisbursementTypeCodes.ACH); if (!inactivatePayeeAchAccount(payeeAchAccount)) { isSuccessful = false; break; } if(!validatePayeeAchAccountExistence(payeeAchAccount, routingNumber, accountNumber)) { return isSuccessful; } PayeeACHAccount payeeAchAccountNew = buildPayeeAchAccountNew(vendorUpdate, routingNumber, accountNumber, vendorNumber, payeeAchAccount); if(!processPayeeAchAccountNew(payeeAchAccountNew, payeeAchAccount)) { break; } } return isSuccessful; }</code><technical_language>in code touched, I getField_changes method renamed getFieldChanges</technical_language>

Target:
public boolean directAchEdit(PaymentWorksVendorUpdatesDTO vendorUpdate, String vendorNumberList) { boolean successful = false; String routingNumber = getRoutingNumber(vendorUpdate.getField_changes().getField_changes()); String accountNumber = getAccountNumber(vendorUpdate.getField_changes().getField_changes()); if (validateRoutingNumberAndAccountNumber(routingNumber, accountNumber)) { return successful; } List<String> vendorNumbers = Arrays.asList(vendorNumberList.split("\\s*,\\s*")); for (String vendorNumber : vendorNumbers) { PayeeACHAccount payeeAchAccount = this.getActivePayeeAchAccount(PdpConstants.PayeeIdTypeCodes.VENDOR_ID, vendorNumber, PdpConstants.DisbursementTypeCodes.ACH); if (!inactivatePayeeAchAccount(payeeAchAccount)) { successful = false; break; } if(!validatePayeeAchAccountExistence(payeeAchAccount, routingNumber, accountNumber)) { return successful; } PayeeACHAccount payeeAchAccountNew = buildPayeeAchAccountNew(vendorUpdate, routingNumber, accountNumber, vendorNumber, payeeAchAccount); if(!processPayeeAchAccountNew(payeeAchAccountNew, payeeAchAccount)) { break; } successful = true; } return successful; }
Source:
<code>public void reportCompleted(AgentRuntimeInfo agentRuntimeInfo, JobIdentifier jobIdentifier, JobResult result) { Map<String, Object> request = Map.of( "agent_runtime_info", agentRuntimeInfo, "job_identifier", jobIdentifier, <START> "job_result", result); <END> try { this.httpClientHttpInvokerRequestExecutor.doPost("report_completed", gson.toJson(new ReportCompleteStatusRequest(agentRuntimeInfo, jobIdentifier, result))); } catch (IOException e) { throw new RuntimeException(e); } }</code><technical_language>I guess need maps, small objects</technical_language>

Target:
public void reportCompleted(AgentRuntimeInfo agentRuntimeInfo, JobIdentifier jobIdentifier, JobResult result) { try { this.httpClientHttpInvokerRequestExecutor.doPost("report_completed", gson.toJson(new ReportCompleteStatusRequest(agentRuntimeInfo, jobIdentifier, result), ReportCompleteStatusRequest.class)); } catch (IOException e) { throw new RuntimeException(e); } }
Source:
<code>private String resolveRelativeModulePath(String url) { File f = new File(url); if (!f.isAbsolute()) <START> if (repo.isBare()) { <END> url = new File(repo.getDirectory(), url).getAbsolutePath(); } else { url = new File(repo.getWorkTree(), url).getAbsolutePath(); } return url; }</code><technical_language>curlies needed</technical_language>

Target:
private String resolveRelativeModulePath(String url) { File f = new File(url); if (!f.isAbsolute()) if (repo.isBare()) url = new File(repo.getDirectory(), url).getAbsolutePath(); else url = new File(repo.getWorkTree(), url).getAbsolutePath(); return url; }