auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>public BigDecimal getCryptoBalance(String cryptoCurrency) { if (!getCryptoCurrencies().contains(cryptoCurrency)) { log.error("Cryptocurrency " + cryptoCurrency + " not supported."); return null; } try { String query = ""; String timeStamp = String.valueOf(new Date().getTime()); query = "recvWindow=" + 5000 + "&timestamp=" + timeStamp; String signing = sign(query, binanceApiSecret); <START> final Map<String, Object> accountInfo = apiBinance.getCryptoBalance(this.binanceApiKey, String.valueOf(5000), timeStamp, signing); <END> if (accountInfo != null && !accountInfo.isEmpty()) { final List<Object> balances = (List<Object>) accountInfo.get("balances"); if(balances != null && !balances.isEmpty()) { for (Object dataObject : balances) { final Map<String, Object> map = (Map<String, Object>) dataObject; final String asset = (String) map.get("asset"); BigDecimal value = new BigDecimal((String) map.get("free")); if (asset.equals(cryptoCurrency)) { return value; } } } } } catch (HttpStatusIOException e) { log.error(e.getHttpBody()); } catch (IOException e) { log.error("", e); } return null; }</code><technical_language>I mentioned. untyped Maps for results. proper types for API. Otherwise, decimal lose precise information BigDecimal</technical_language>

Target:
public BigDecimal getCryptoBalance(String cryptoCurrency) { if (!getCryptoCurrencies().contains(cryptoCurrency)) { log.error("Cryptocurrency " + cryptoCurrency + " not supported."); return null; } try { String query = ""; String timeStamp = String.valueOf(new Date().getTime()); query = "recvWindow=" + 5000 + "&timestamp=" + timeStamp; String signing = sign(query, binanceApiSecret); final LskBinanceResponse accountInfo = apiBinance.getCryptoBalance(this.binanceApiKey, String.valueOf(5000), timeStamp, signing); if (accountInfo != null) { List<LskBinanceAssetData> balances = (List<LskBinanceAssetData>) accountInfo.getBalance(); if(balances != null && !balances.isEmpty()) { for (LskBinanceAssetData assetData : balances) { final String asset = (String) assetData.getAsset(); BigDecimal value = assetData.getFree(); if (asset.equals(cryptoCurrency)) { return value; } } } } } catch (HttpStatusIOException e) { log.error(e.getHttpBody()); } catch (IOException e) { log.error("", e); } return null; }
Source:
<code>public void JKaliTest() throws Exception { <START> FinalResult result = TestUtills.runRepairability("JKaliTest", "/repairability_test_files/JKali/"); <END> TestUtills.numberOfInstances(result, 5, 5); }</code><technical_language>This needs changed TestUtills.runRepairability("JKali", "/repairability_test_files/JKali/"); argument is name of tool</technical_language>

Target:
public void JKaliTest() throws Exception { FinalResult result = TestUtills.runRepairability("JKali", "/repairability_test_files/JKali/"); TestUtills.numberOfInstances(result, 5, 5); }
Source:
<code>protected boolean connect () { try { if (sysLibrary == null ) { logger.debug("Loading native code library..."); sysLibrary = (LibK8055) Native.synchronizedLibrary((Library) Native.loadLibrary("k8055", LibK8055.class)); logger.debug("Done loading native code library"); } } catch (Exception e) { logger.error("Failed to load K8055 native library " + e.getMessage(), e); } if (!connected) { if (sysLibrary.OpenDevice(boardNo) == boardNo) { connected = true; lastDigitalInputs = -1; try { Thread.sleep(100); } catch (InterruptedException e) { <START> e.printStackTrace(); <END> } logger.info("K8055: Connect to board: " + boardNo + " succeeeded."); } else { logger.error("K8055: Connect to board: " + boardNo + " failed."); } }; return connected; }</code><technical_language>please remove TODO .printStackTrace() add proper logging instead</technical_language>

Target:
protected boolean connect() { try { if (sysLibrary == null) { logger.debug("Loading native code library..."); sysLibrary = (LibK8055) Native .synchronizedLibrary((Library) Native.loadLibrary( "k8055", LibK8055.class)); logger.debug("Done loading native code library"); } if (!connected) { if (sysLibrary.OpenDevice(boardNo) == boardNo) { connected = true; lastDigitalInputs = -1; logger.info("K8055: Connect to board: " + boardNo + " succeeeded."); } else { logger.error("K8055: Connect to board: " + boardNo + " failed."); } } ; } catch (Exception e) { logger.error( "Failed to load K8055 native library. Please check the libk8055 and jna native libraries are in the Java library path. ", e); } return connected; }
Source:
<code>public void test() throws IOException { Configuration cfg = new Configuration(); for (Class<?> cl : Domain.classes) { cfg.addAnnotatedClass(cl); } HibernateDomainExporter exporter = new HibernateDomainExporter(folder.getRoot(), cfg); exporter.execute(); File origRoot = new File("../querydsl-jpa/target/generated-test-sources/java"); Set<File> files = exporter.getGeneratedFiles(); assertFalse(files.isEmpty()); for (File file : files) { String path = file.getAbsolutePath().replace( folder.getRoot().getAbsolutePath(), origRoot.getAbsolutePath()); String reference = Files.toString(new File(path), Charsets.UTF_8); String content = Files.toString(file, Charsets.UTF_8); try { assertEquals(file.getPath(), reference, content); <START> } catch (Throwable e) { <END> errors.addError(e); } } }</code><technical_language>I write this, try-catch: java errors.checkThat(file.getPath(), content, is(equalTo(reference)));</technical_language>

Target:
public void test() throws IOException { Configuration cfg = new Configuration(); for (Class<?> cl : Domain.classes) { cfg.addAnnotatedClass(cl); } Path outputFolder = folder.getRoot().toPath(); HibernateDomainExporter exporter = new HibernateDomainExporter(outputFolder.toFile(), cfg); exporter.execute(); File origRoot = new File("../querydsl-jpa/target/generated-test-sources/java"); Set<File> files = exporter.getGeneratedFiles(); assertFalse(files.isEmpty()); for (File file : files) { Path relativeFile = outputFolder.relativize(file.toPath()); Path origFile = origRoot.toPath().resolve(relativeFile); String reference = Files.toString(origFile.toFile(), Charsets.UTF_8); String content = Files.toString(file, Charsets.UTF_8); errors.checkThat("Mismatch for " + file.getPath(), content, is(equalTo(reference))); } }
Source:
<code>public void onProjectTemplateRegistryUpdated(ProjectTemplateRegistryUpdatedEvent event) { registry_ = event.getData(); for (Callback callback : pendingCallbacks_) <START> callback.execute(registry_); <END> pendingCallbacks_.clear(); }</code><technical_language>Nit: double evaluate if a callback throws while executing -- wrap in a try catch and/or remove callback executing</technical_language>

Target:
public void onProjectTemplateRegistryUpdated(ProjectTemplateRegistryUpdatedEvent event) { registry_ = event.getData(); for (Callback callback : pendingCallbacks_) { try { callback.execute(registry_); } catch (Exception e) { Debug.logException(e); } } pendingCallbacks_.clear(); }
Source:
<code>private String diffHtml(String htmlA, String htmlB, DiffMode diffMode) throws IOException, TransformerConfigurationException, SAXException, ResourceNotFoundException { ByteArrayOutputStream htmlDiff = new ByteArrayOutputStream(); SAXTransformerFactory tf = (SAXTransformerFactory) TransformerFactory.newInstance(); TransformerHandler result = tf.newTransformerHandler(); result.setResult(new StreamResult(htmlDiff)); String htmlHeader; switch (diffMode) { case SIDEBYSIDE_A: htmlHeader = <START> "com/googlesource/gerrit/plugins/xdocs/diff/htmlheader-sidebyside-a.xsl"; <END> break; case SIDEBYSIDE_B: htmlHeader = "com/googlesource/gerrit/plugins/xdocs/diff/htmlheader-sidebyside-b.xsl"; break; case UNIFIED: htmlHeader = "com/googlesource/gerrit/plugins/xdocs/diff/htmlheader-unified.xsl"; break; default: log.error(String.format("Unsupported diff mode: %s", diffMode.name())); throw new ResourceNotFoundException(); } ContentHandler postProcess = new XslFilter().xsl(result, htmlHeader); postProcess.startDocument(); postProcess.startElement("", "diffreport", "diffreport", new AttributesImpl()); postProcess.startElement("", "diff", "diff", new AttributesImpl()); HtmlSaxDiffOutput output = new HtmlSaxDiffOutput(postProcess, "diff"); HTMLDiffer differ = new HTMLDiffer(output); differ.diff(getComparator(htmlA), getComparator(htmlB)); postProcess.endElement("", "diff", "diff"); postProcess.endElement("", "diffreport", "diffreport"); postProcess.endDocument(); return htmlDiff.toString(UTF_8.name()); }</code><technical_language>This prefix is in 3 cases. Extract a constant</technical_language>

Target:
private String diffHtml(String htmlA, String htmlB, DiffMode diffMode) throws IOException, TransformerConfigurationException, SAXException, ResourceNotFoundException { ByteArrayOutputStream htmlDiff = new ByteArrayOutputStream(); SAXTransformerFactory tf = (SAXTransformerFactory) TransformerFactory.newInstance(); TransformerHandler result = tf.newTransformerHandler(); result.setResult(new StreamResult(htmlDiff)); String htmlHeader = "com/googlesource/gerrit/plugins/xdocs/diff/htmlheader-"; switch (diffMode) { case SIDEBYSIDE_A: htmlHeader += "sidebyside-a.xsl"; break; case SIDEBYSIDE_B: htmlHeader += "sidebyside-b.xsl"; break; case UNIFIED: htmlHeader += "unified.xsl"; break; default: log.error(String.format("Unsupported diff mode: %s", diffMode.name())); throw new ResourceNotFoundException(); } ContentHandler postProcess = new XslFilter().xsl(result, htmlHeader); postProcess.startDocument(); postProcess.startElement("", "diffreport", "diffreport", new AttributesImpl()); postProcess.startElement("", "diff", "diff", new AttributesImpl()); HtmlSaxDiffOutput output = new HtmlSaxDiffOutput(postProcess, "diff"); HTMLDiffer differ = new HTMLDiffer(output); differ.diff(getComparator(htmlA), getComparator(htmlB)); postProcess.endElement("", "diff", "diff"); postProcess.endElement("", "diffreport", "diffreport"); postProcess.endDocument(); return htmlDiff.toString(UTF_8.name()); }
Source:
<code>public void testSyncRefresh() throws IOException { <START> initialize(HeaderCacheElement.TOKEN_STALENESS_MS * 2); <END> Assert.assertEquals(CacheState.Good, RefreshingOAuth2CredentialsInterceptor.getCacheState(underTest.headerCache.get())); }</code><technical_language>Hope this introduce flaky test</technical_language>

Target:
public void testSyncRefresh() throws IOException { initialize(HeaderCacheElement.TOKEN_STALENESS_MS + 1); Assert.assertEquals(CacheState.Good, RefreshingOAuth2CredentialsInterceptor.getCacheState(underTest.headerCache.get())); }
Source:
<code>private static boolean equals(float a, float b) { <START> return Float.compare(a, b) == COMPARE_EQUALS; <END> }</code><technical_language>I would've OK a 0 here, == matters -- problem</technical_language>

Target:
private static boolean equals(float a, float b) { return Float.compare(a, b) == 0; }
Source:
<code>protected static String transactionKeyAsString(Object key) { if (key instanceof XidImpl) { byte[] globalId = ((XidImpl) key).getGlobalTransactionId(); StringBuilder buffer = new StringBuilder(); for (byte aGlobalId : globalId) { buffer.append(Integer.toHexString(aGlobalId)); } <START> return buffer.toString().replaceAll("0*$", ""); <END> } return key.toString(); }</code><technical_language>replaceAll is costly, this needed done differently</technical_language>

Target:
protected static String transactionKeyAsString(Object key) { if (key instanceof XidImpl) { byte[] globalId = ((XidImpl) key).getGlobalTransactionId(); StringBuilder buffer = new StringBuilder(); for (byte aGlobalId : globalId) { buffer.append(Integer.toHexString(aGlobalId)); } String stringKey = buffer.toString(); for (int index = stringKey.length() - 1; index >= 0; index--) { if (stringKey.charAt(index) != '0') { return stringKey.substring(0, index + 1); } } return stringKey; } return key.toString(); }
Source:
<code>private void determineRequiresVisibility(BundleDescription bundle) { BundleSpecification[] <START> required = <END> bundle.getRequiredBundles(); Set<BundleDescription> resolved = new HashSet<>(); for (BundleDescription resolvedRequire : resolvedRequires) { resolved.add(resolvedRequire); } for (BundleSpecification required1 : required) { if (required1.getSupplier() != null) { resolvedBundlesExported.put((BundleDescription) required1.getSupplier(), Boolean.valueOf(required1.isExported())); resolved.remove(required1.getSupplier()); } } BundleDescription[] fragments = bundle.getFragments(); if (resolved.size() > 0) { for (BundleDescription fragment : fragments) { BundleSpecification[] fragmentRequiredBundles = fragment.getRequiredBundles(); for (BundleSpecification fragmentRequiredBundle : fragmentRequiredBundles) { if (resolved.contains(fragmentRequiredBundle.getSupplier())) { resolvedBundlesExported.put((BundleDescription) fragmentRequiredBundle.getSupplier(), Boolean.valueOf(fragmentRequiredBundle.isExported())); resolved.remove(fragmentRequiredBundle.getSupplier()); } } if (resolved.size() == 0) { break; } } } }</code><technical_language>rename requiredBundles required in foreach var</technical_language>

Target:
private void determineRequiresVisibility(BundleDescription bundle) { BundleSpecification[] requiredBundles = bundle.getRequiredBundles(); Set<BundleDescription> resolved = new HashSet<>(); for (BundleDescription resolvedRequire : resolvedRequires) { resolved.add(resolvedRequire); } for (BundleSpecification required : requiredBundles) { if (required.getSupplier() != null) { resolvedBundlesExported.put((BundleDescription) required.getSupplier(), Boolean.valueOf(required.isExported())); resolved.remove(required.getSupplier()); } } BundleDescription[] fragments = bundle.getFragments(); if (resolved.size() > 0) { for (BundleDescription fragment : fragments) { BundleSpecification[] fragmentRequiredBundles = fragment.getRequiredBundles(); for (BundleSpecification fragmentRequiredBundle : fragmentRequiredBundles) { if (resolved.contains(fragmentRequiredBundle.getSupplier())) { resolvedBundlesExported.put((BundleDescription) fragmentRequiredBundle.getSupplier(), Boolean.valueOf(fragmentRequiredBundle.isExported())); resolved.remove(fragmentRequiredBundle.getSupplier()); } } if (resolved.size() == 0) { break; } } } }
Source:
<code>private void findPossibleLocationsV32(String basePath, String variantPart, List<String> possibleLocations) { String[] directories = new File(basePath + BUILD_TOOLS_V32_MANIFEST_PATH).list(); if (directories == null) { return; } if (variantPart.startsWith("/") || variantPart.startsWith("\\")) { variantPart = variantPart.substring(1); } String[] variantParts = variantPart.split("[/\\\\]"); if (variantParts.length > 1) { StringBuilder sb = new StringBuilder(variantParts[0]); for (int i = 1; i < variantParts.length; i++) { String part = variantParts[i]; sb.append(upperCaseFirst(part)); } variantPart = sb.toString(); } String possibleLocationWithoutProcessManifest = BUILD_TOOLS_V32_MANIFEST_PATH + "/" + variantPart; String possibleLocationWithProcessManifest = possibleLocationWithoutProcessManifest + "/process" + upperCaseFirst(variantPart) + "Manifest/merged"; <START> if (new File(basePath, possibleLocationWithoutProcessManifest).isDirectory()) { <END> possibleLocations.add(possibleLocationWithoutProcessManifest); addPossibleSplitLocations(basePath, possibleLocationWithoutProcessManifest, possibleLocations); } if (new File(basePath, possibleLocationWithProcessManifest).isDirectory()) { possibleLocations.add(possibleLocationWithProcessManifest); addPossibleSplitLocations(basePath, possibleLocationWithProcessManifest, possibleLocations); } }</code><technical_language>extract this a method? ifs if I right</technical_language>

Target:
private void findPossibleLocationsV32(String basePath, String variantPart, List<String> possibleLocations) { String[] directories = new File(basePath + BUILD_TOOLS_V32_MANIFEST_PATH).list(); if (directories == null) { return; } if (variantPart.startsWith("/") || variantPart.startsWith("\\")) { variantPart = variantPart.substring(1); } String[] variantParts = variantPart.split("[/\\\\]"); if (variantParts.length > 1) { StringBuilder sb = new StringBuilder(variantParts[0]); for (int i = 1; i < variantParts.length; i++) { String part = variantParts[i]; sb.append(upperCaseFirst(part)); } variantPart = sb.toString(); } String possibleLocation = BUILD_TOOLS_V32_MANIFEST_PATH + "/" + variantPart; findPossibleLocations(basePath, possibleLocations, possibleLocation); findPossibleLocations(basePath, possibleLocations, possibleLocation + "/process" + upperCaseFirst(variantPart) + "Manifest/merged"); }
Source:
<code>public DataSize convertToMostSuccinctDataSize() { Unit unitToUse = Unit.BYTE; for (Unit unitToTest : Unit.values()) { <START> if (getValue(unitToTest) > 0.99) { <END> unitToUse = unitToTest; } else { break; } } return convertTo(unitToUse); }</code><technical_language>this change</technical_language>

Target:
public DataSize convertToMostSuccinctDataSize() { Unit unitToUse = Unit.BYTE; for (Unit unitToTest : Unit.values()) { if (getValue(unitToTest) >= 1.0) { unitToUse = unitToTest; } else { break; } } return convertTo(unitToUse); }
Source:
<code>private void tryLoadProjectList() { int interval = 1; while (!isConnected() && !shutdown) { logger.info("Not connected to {}, waiting for second(s)", serverName, interval); waitFor(interval); if (interval < MAX_WAIT_TIME) { interval = interval * 2; } } try { <START> logger.trace("Trying to load project list."); <END> if (isConnected()) { IGerritHudsonTriggerConfig activeConfig = getConfig(); SshConnection sshConnection = SshConnectionFactory.getConnection( activeConfig.getGerritHostName(), activeConfig.getGerritSshPort(), activeConfig.getGerritProxy(), activeConfig.getGerritAuthentication() ); List<String> projects = readProjects(sshConnection.executeCommandReader(GERRIT_LS_PROJECTS)); if (projects.size() > 0) { setGerritProjects(projects); logger.trace("Project list from contains entries", serverName, projects.size()); } else { logger.warn("Project list from contains 0 projects", serverName); } sshConnection.disconnect(); } } catch (SshException ex) { logger.warn("Could not connect to Gerrit server when updating Gerrit project list: ", ex); } catch (IOException ex) { logger.error("Could not read stream with Gerrit projects: ", ex); } }</code><technical_language>Personally I log messages in log. admin, is a sense of comfort I ;)</technical_language>

Target:
private void tryLoadProjectList() { int interval = 1; while (!isConnected() && !shutdown) { logger.info("Not connected to {}, waiting for second(s)", serverName, interval); waitFor(interval); if (interval < MAX_WAIT_TIME) { interval = interval * 2; } } try { logger.info("Trying to load project list."); if (isConnected()) { IGerritHudsonTriggerConfig activeConfig = getConfig(); SshConnection sshConnection = SshConnectionFactory.getConnection( activeConfig.getGerritHostName(), activeConfig.getGerritSshPort(), activeConfig.getGerritProxy(), activeConfig.getGerritAuthentication() ); List<String> projects = readProjects(sshConnection.executeCommandReader(GERRIT_LS_PROJECTS)); if (projects.size() > 0) { setGerritProjects(projects); logger.info("Project list from contains entries", serverName, projects.size()); } else { logger.warn("Project list from contains 0 projects", serverName); } sshConnection.disconnect(); } } catch (SshException ex) { logger.warn("Could not connect to Gerrit server when updating Gerrit project list: ", ex); } catch (IOException ex) { logger.error("Could not read stream with Gerrit projects: ", ex); } }
Source:
<code>public synchronized void start() { synchronized (allQueries) { for (QueryContext ctx : allQueries.values()) { try { if (sessionMap.containsKey(ctx.getGrillSessionIdentifier())) { ctx.setConf(getGrillConf(getSessionHandle( ctx.getGrillSessionIdentifier()), ctx.getQconf())); } else { ctx.setConf(getGrillConf(GrillSessionImpl.sessionDefaultConf(),ctx.getQconf())); } } catch (GrillException e) { LOG.error("Could not set query conf"); } } } super.start(); querySubmitter.start(); statusPoller.start(); queryPurger.start(); prepareQueryPurger.start(); this.queryExecutionStatisticsGenerator = new QueryExecutionStatisticsGenerator(this); <START> getStatisticsService().addHandler(queryExecutionStatisticsGenerator); <END> }</code><technical_language>this in init() start()? initialization in init() processing threads start in start()</technical_language>

Target:
public synchronized void start() { synchronized (allQueries) { for (QueryContext ctx : allQueries.values()) { try { if (sessionMap.containsKey(ctx.getGrillSessionIdentifier())) { ctx.setConf(getGrillConf(getSessionHandle( ctx.getGrillSessionIdentifier()), ctx.getQconf())); } else { ctx.setConf(getGrillConf(GrillSessionImpl.sessionDefaultConf(),ctx.getQconf())); } } catch (GrillException e) { LOG.error("Could not set query conf"); } } } super.start(); querySubmitter.start(); statusPoller.start(); queryPurger.start(); prepareQueryPurger.start(); }
Source:
<code>public void onRegister() throws URISyntaxException { <START> logger.info("\n----------------WebSocket Registry Test----------------"); <END> String uri = "/test"; textCarbonMessage.setProperty(Constants.TO, uri); }</code><technical_language>long dash lines in logs including test cases</technical_language>

Target:
public void onRegister() throws URISyntaxException { log.info(System.lineSeparator() + "----------------WebSocket Registry Test----------------"); String uri = "/test"; textCarbonMessage.setProperty(Constants.TO, uri); }
Source:
<code>public Array createArrayOf(String typeName, Object[] elements) throws SQLException { <START> PDataType pdDataType = PDataType.fromSqlTypeName(typeName); <END> PDataType arrayPrimitiveType = PDataType.fromSqlTypeName(SchemaUtil.getPrimitiveTypeOfArray(pdDataType.name())); return new PhoenixArray(arrayPrimitiveType.ordinal(), elements); }</code><technical_language>Create a new method PDataType.fromSqlElementTypeName(typeName), creating ARRAY. In method, primitive type typeName. primitive type name, get typeId. add this typeID sqlTypeID of ARRAY (which is 1000). this lookup PDataType for type of array PDataType.fromSqlType (which want rename PDataType.fromTypeId())</technical_language>

Target:
public Array createArrayOf(String typeName, Object[] elements) throws SQLException { PDataType arrayPrimitiveType = PDataType.fromSqlTypeName(typeName); return PDataTypeForArray.instantiatePhoenixArray(arrayPrimitiveType, elements); }
Source:
<code>public String getMode() { <START> return mode.toString(); <END> }</code><technical_language>Change to: return mode;</technical_language>

Target:
public String getMode() { return mode; }
Source:
<code>private AS7ManagementDetails createSynchronousManagementDetails(IServer server, final boolean[] callbacksCalled) { HashMap<String, Object> props = new HashMap<String, Object>(); <START> props.put(IAS7ManagementDetails.PROPERTY_TIMEOUT, new Integer(800)); <END> return new AS7ManagementDetails(server, props) { public String[] handleCallbacks(String[] prompts) throws UnsupportedOperationException { synchronized(callbacksCalled) { callbacksCalled[0] = true; } throw new UnsupportedOperationException(); } }; }</code><technical_language>800? unit? A self-decriptive constant more</technical_language>

Target:
private AS7ManagementDetails createSynchronousManagementDetails(IServer server, final boolean[] callbacksCalled) { HashMap<String, Object> props = new HashMap<String, Object>(); props.put(IAS7ManagementDetails.PROPERTY_TIMEOUT, new Integer(SYNCHRONOUS_POLL_FAST_TIMEOUT)); return new AS7ManagementDetails(server, props) { public String[] handleCallbacks(String[] prompts) throws UnsupportedOperationException { synchronized(callbacksCalled) { callbacksCalled[0] = true; } throw new UnsupportedOperationException(); } }; }
Source:
<code>public void resume() { checkRealm(); pauseDepth--; if (pauseDepth < 0) { throw new IllegalStateException( "The resume() method was called more <START> often than <END> pause()."); } else if (dirty && pauseDepth == 0) { scheduleUpdate(); } }</code><technical_language>> times</technical_language>

Target:
public void resume() { checkRealm(); pauseDepth--; if (pauseDepth < 0) { throw new IllegalStateException( "The resume() method was called more times than pause()."); } else if (dirty && pauseDepth == 0) { scheduleUpdate(); } }
Source:
<code>public void testGetEntryView() { IMap<String, String> map = client.getMap(randomString()); String key = "Key"; String value = "Value"; map.put(key, value); EntryView view = map.getEntryView(key); assertEquals(key, view.getKey()); assertEquals(value, view.getValue()); <START> assertEquals(Long.MAX_VALUE, view.getMaxIdle()); <END> assertEquals(Long.MAX_VALUE, view.getTtl()); }</code><technical_language>test cases testing IMap methods maxIdle support. more here? Also, unrelated this PR though: - testGetAll_whenMapEmpty is missing @Test annotation - tests declare thrown exceptions while invoked method is throwing checked exceptions</technical_language>

Target:
public void testGetEntryView() { IMap<String, String> map = client.getMap(randomString()); String key = "Key"; String value = "Value"; map.put(key, value); EntryView view = map.getEntryView(key); assertEquals(key, view.getKey()); assertEquals(value, view.getValue()); assertEquals((Long) Long.MAX_VALUE, view.getMaxIdle()); assertEquals(Long.MAX_VALUE, view.getTtl()); }
Source:
<code>public int compare(MtgCard card1, MtgCard card2) { int retVal = 0; for (SortOrderDialogFragment.SortOption option : options) { try { switch (option.getKey()) { case CardDbAdapter.KEY_NAME: { retVal = card1.mName.compareTo(card2.mName); break; } case CardDbAdapter.KEY_COLOR: { retVal = card1.mColor.compareTo(card2.mColor); break; } case CardDbAdapter.KEY_SUPERTYPE: { retVal = card1.mType.compareTo(card2.mType); break; } case CardDbAdapter.KEY_CMC: { retVal = card1.mCmc - card2.mCmc; break; } case CardDbAdapter.KEY_POWER: { retVal = Float.compare(card1.mPower, card2.mPower); break; } case CardDbAdapter.KEY_TOUGHNESS: { retVal = Float.compare(card1.mToughness, card2.mToughness); break; } case CardDbAdapter.KEY_SET: { retVal = card1.mExpansion.compareTo(card2.mExpansion); break; } case SortOrderDialogFragment.KEY_PRICE: { retVal = Double.compare(card1.price, card2.price); break; } case SortOrderDialogFragment.KEY_ORDER: { <START> retVal = SortOrderDialogFragment.compareInt(card1.getIndex(), card2.getIndex()); <END> break; } } } catch (NullPointerException e) { retVal = 0; } if (!option.getAscending()) { retVal = -retVal; } if (retVal != 0) { return retVal; } } return retVal; }</code><technical_language>Replace retVal = wish1.getIndex().compareTo(wish2.getIndex());</technical_language>

Target:
public int compare(MtgCard card1, MtgCard card2) { int retVal = 0; for (SortOrderDialogFragment.SortOption option : options) { try { switch (option.getKey()) { case CardDbAdapter.KEY_NAME: { retVal = card1.mName.compareTo(card2.mName); break; } case CardDbAdapter.KEY_COLOR: { retVal = card1.mColor.compareTo(card2.mColor); break; } case CardDbAdapter.KEY_SUPERTYPE: { retVal = card1.mType.compareTo(card2.mType); break; } case CardDbAdapter.KEY_CMC: { retVal = card1.mCmc - card2.mCmc; break; } case CardDbAdapter.KEY_POWER: { retVal = Float.compare(card1.mPower, card2.mPower); break; } case CardDbAdapter.KEY_TOUGHNESS: { retVal = Float.compare(card1.mToughness, card2.mToughness); break; } case CardDbAdapter.KEY_SET: { retVal = card1.mExpansion.compareTo(card2.mExpansion); break; } case SortOrderDialogFragment.KEY_PRICE: { retVal = Double.compare(card1.price, card2.price); break; } case SortOrderDialogFragment.KEY_ORDER: { retVal = Double.compare(card1.getIndex(), card2.getIndex()); break; } default: { break; } } } catch (NullPointerException e) { retVal = 0; } if (!option.getAscending()) { retVal = -retVal; } if (retVal != 0) { return retVal; } } return retVal; }
Source:
<code>void preemptEligibleCommands() { synchronized (runningCommandsMap) { <START> Set<String> commandsToInterrupt = new HashSet<>(); <END> for (RunningCommand command : runningCommandsMap.values()) { if (command.isPreemptible()) { command.thread.interrupt(); commandsToInterrupt.add(command.id); } } if (!commandsToInterrupt.isEmpty()) { startSlowInterruptWatcher(ImmutableSet.copyOf(commandsToInterrupt)); } } }</code><technical_language>ImmutableSet.Builder instead - need for intermediate hashset</technical_language>

Target:
void preemptEligibleCommands() { synchronized (runningCommandsMap) { ImmutableSet.Builder<String> commandsToInterruptBuilder = new ImmutableSet.Builder<>(); for (RunningCommand command : runningCommandsMap.values()) { if (command.isPreemptible()) { command.thread.interrupt(); commandsToInterruptBuilder.add(command.id); } } ImmutableSet<String> commandsToInterrupt = commandsToInterruptBuilder.build(); if (!commandsToInterrupt.isEmpty()) { startSlowInterruptWatcher(commandsToInterrupt); } } }
Source:
<code>public void shouldReturnInfoOfFoundTagAsJsonWithHttpCode200() throws Exception { mockMvc.perform(get("/api/v1/tags/{tagId}", TAG_ID) .contentType(APPLICATION_JSON_UTF8) .accept(APPLICATION_JSON_UTF8)) .andDo(print()) .andExpect(status().isOk()) .andExpect(content().contentType(APPLICATION_JSON_UTF8)) .andExpect(jsonPath("$.name").value(is(NAME))) .andExpect(jsonPath("$.links", hasSize(2))) .andExpect(jsonPath("$.links[0].rel").value(is(Link.REL_SELF))) .andExpect(jsonPath("$.links[0].href").value(containsString("/api/v1/tags/" + TAG_ID))) .andExpect(jsonPath("$.links[1].rel").value(is(TagResourceAsm.IDEAS_REL))) <START> .andExpect(jsonPath("$.links[1].href").value(containsString("/api/v1/tags/" + TAG_ID + "/ideas")));;; <END> }</code><technical_language>Redundant semicolons</technical_language>

Target:
public void shouldReturnInfoOfFoundTagAsJsonWithHttpCode200() throws Exception { mockMvc.perform(get("/api/v1/tags/{tagId}", TAG_ID) .contentType(APPLICATION_JSON_UTF8) .accept(APPLICATION_JSON_UTF8)) .andDo(print()) .andExpect(status().isOk()) .andExpect(content().contentType(APPLICATION_JSON_UTF8)) .andExpect(jsonPath("$.name").value(is(NAME))) .andExpect(jsonPath("$.links", hasSize(2))) .andExpect(jsonPath("$.links[0].rel").value(is(Link.REL_SELF))) .andExpect(jsonPath("$.links[0].href").value(containsString("/api/v1/tags/" + TAG_ID))) .andExpect(jsonPath("$.links[1].rel").value(is(TagResourceAsm.IDEAS_REL))) .andExpect(jsonPath("$.links[1].href").value(containsString("/api/v1/tags/" + TAG_ID + "/ideas"))); }
Source:
<code>private void loadPlugins() { NativeInterface.setClient(this); if (config.getDetectNdkCrashes()) { <START> enableNdkCrashReporting(); <END> } else { disableNdkCrashReporting(); } if (config.getDetectAnrs()) { enableAnrReporting(); } else { disableAnrReporting(); } }</code><technical_language>Removing this line breaks plugin interface</technical_language>

Target:
private void loadPlugins() { NativeInterface.setClient(this); enableOrDisableNdkReporting(); enableOrDisableAnrReporting(); BugsnagPluginInterface.INSTANCE.loadRegisteredPlugins(this); }
Source:
<code>@Override protected void onCreate(@Nullable Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); mMapView = findViewById(R.id.mapView); ArcGISMap map = new ArcGISMap(Basemap.createNavigationVector()); mMapView.setMap(map); WfsFeatureTable statesTable = new WfsFeatureTable(getString(R.string.wfs_feature_table_url), getString(R.string.wfs_feature_table_table_name)); statesTable.setAxisOrder(OgcAxisOrder.NO_SWAP); statesTable.setFeatureRequestMode(ServiceFeatureTable.FeatureRequestMode.MANUAL_CACHE); try { String xmlQuery = loadQueryFromAssets(); ListenableFuture<FeatureQueryResult> featureQueryResultFuture = statesTable .populateFromServiceAsync(xmlQuery, true); <START> FeatureLayer statesLayer = new FeatureLayer(statesTable); <END> mMapView.getMap().getOperationalLayers().add(statesLayer); featureQueryResultFuture.addDoneListener(() -> { mMapView.setViewpointGeometryAsync(statesLayer.getFullExtent(), 50); }); } catch (IOException e) { logErrorToUser(getString(R.string.error_reading_xml_file, e.getMessage())); } }</code><technical_language>Move Feature Layer instantiation operation layers try block. xmlquery is relevant populate call (and feature query result future too)</technical_language>

Target:
@Override protected void onCreate(@Nullable Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); mMapView = findViewById(R.id.mapView); ArcGISMap map = new ArcGISMap(Basemap.createNavigationVector()); mMapView.setMap(map); WfsFeatureTable statesTable = new WfsFeatureTable(getString(R.string.wfs_feature_table_url), getString(R.string.wfs_feature_table_table_name)); statesTable.setAxisOrder(OgcAxisOrder.NO_SWAP); statesTable.setFeatureRequestMode(ServiceFeatureTable.FeatureRequestMode.MANUAL_CACHE); FeatureLayer statesLayer = new FeatureLayer(statesTable); mMapView.getMap().getOperationalLayers().add(statesLayer); try { String xmlQuery = loadQueryFromAssets(); ListenableFuture<FeatureQueryResult> featureQueryResultFuture = statesTable .populateFromServiceAsync(xmlQuery, true); featureQueryResultFuture.addDoneListener(() -> { mMapView.setViewpointGeometryAsync(statesLayer.getFullExtent(), 50); }); } catch (IOException e) { logErrorToUser(getString(R.string.error_reading_xml_file, e.getMessage())); } }
Source:
<code>public ListenableFuture<TransportEndpoint> connect(@CheckForNull final TransportAddress address) { checkArgument(address != null); final TransportChannel transportChannel = getOrConnect(address); return Futures.transform(transportChannel.handshakeFuture(), <START> new AsyncFunction<TransportHandshakeData, TransportEndpoint>() { <END> @Override public ListenableFuture<TransportEndpoint> apply(@Nonnull TransportHandshakeData handshakeData) throws Exception { return Futures.immediateFuture(handshakeData.endpoint()); } }); }</code><technical_language>Function here. this function static</technical_language>

Target:
public ListenableFuture<TransportEndpoint> connect(@CheckForNull final TransportAddress address) { checkArgument(address != null); final TransportChannel transportChannel = getOrConnect(address); return Futures.transform(transportChannel.handshakeFuture(), HANDSHAKE_DATA_TO_ENDPOINT_FUNCTION); }
Source:
<code>@Override public void stop() { for (Map.Entry<String, CatalogReplicaShipper[]> e : primaryRegionsUnderReplication.entrySet()) { for (CatalogReplicaShipper s : e.getValue()) { <START> s.setRunning(false); <END> } } stopAsync(); }</code><technical_language>Add stop CatalogReplicaShiipper</technical_language>

Target:
@Override public void stop() { for (Map.Entry<String, CatalogReplicaShipper[]> e : primaryRegionsUnderReplication.entrySet()) { for (CatalogReplicaShipper s : e.getValue()) { s.stopShipper(); } } stopAsync(); }
Source:
<code>private String stripPortNumber(String instanceName) { <START> return instanceName.replace("_" + clusterMapConfig.clusterMapPort, ""); <END> }</code><technical_language>this 100% accurate for a local deployment multiple processes share host name ports</technical_language>

Target:
private String stripPortNumber(String instanceName) { int ind = instanceName.lastIndexOf("_"); if (ind == -1) { return instanceName; } else { try { Short.valueOf(instanceName.substring(ind + 1)); } catch (NumberFormatException e) { return instanceName; } return instanceName.substring(0, ind); } }
Source:
<code><START> private void handleOnIconClickEvent(Event evt) { <END> Element overlay = Browser.getDocument() .getElementById("vaadin-live-reload-overlay"); overlay.setHidden(!overlay.isHidden()); if (lastReloadNotification != null) { return; } if (!overlay.isHidden()) { lastReloadNotification.setHidden(false); } else { lastReloadNotification.setHidden(true); } }</code><technical_language>![MAJOR](<LINK_1> 'Severity: MAJOR') Remove this unused method parameter "evt". [![rule](<LINK_2>](<LINK_0></technical_language>

Target:
private void handleOnIconClickEvent(Event evt) { Element overlay = Browser.getDocument() .getElementById("vaadin-live-reload-overlay"); overlay.setHidden(!overlay.isHidden()); if (lastReloadNotification == null) { return; } if (!overlay.isHidden()) { lastReloadNotification.setHidden(false); } else { lastReloadNotification.setHidden(true); } }
Source:
<code>private long calculateRedeliveryDelay(final AddressSettings addressSettings, final int deliveryCount) { long redeliveryDelay = addressSettings.getRedeliveryDelay(); long maxRedeliveryDelay = addressSettings.getMaxRedeliveryDelay(); double redeliveryMultiplier = addressSettings.getRedeliveryMultiplier(); double collisionAvoidanceFactor = addressSettings.getRedeliveryCollisionAvoidanceFactor(); int tmpDeliveryCount = deliveryCount > 0 ? deliveryCount - 1 : 0; long delay = (long) (redeliveryDelay * (Math.pow(redeliveryMultiplier, tmpDeliveryCount))); if (collisionAvoidanceFactor > 0) { <START> Random random = RandomUtil.getRandom(); <END> double variance = (random.nextBoolean() ? collisionAvoidanceFactor : -collisionAvoidanceFactor) * random.nextDouble(); delay += (delay * variance); } if (delay > maxRedeliveryDelay) { delay = maxRedeliveryDelay; } return delay; }</code><technical_language>RandomUtil return a Thread local random</technical_language>

Target:
private long calculateRedeliveryDelay(final AddressSettings addressSettings, final int deliveryCount) { long redeliveryDelay = addressSettings.getRedeliveryDelay(); long maxRedeliveryDelay = addressSettings.getMaxRedeliveryDelay(); double redeliveryMultiplier = addressSettings.getRedeliveryMultiplier(); double collisionAvoidanceFactor = addressSettings.getRedeliveryCollisionAvoidanceFactor(); int tmpDeliveryCount = deliveryCount > 0 ? deliveryCount - 1 : 0; long delay = (long) (redeliveryDelay * (Math.pow(redeliveryMultiplier, tmpDeliveryCount))); if (collisionAvoidanceFactor > 0) { Random random = ThreadLocalRandom.current(); double variance = (random.nextBoolean() ? collisionAvoidanceFactor : -collisionAvoidanceFactor) * random.nextDouble(); delay += (delay * variance); } if (delay > maxRedeliveryDelay) { delay = maxRedeliveryDelay; } return delay; }
Source:
<code>private Runnable emitLag() { return () -> { try { Map<Integer, Long> highestCurrentOffsets = getHighestCurrentOffsets(); if (latestOffsetsFromKafka == null) { throw new ISE("Latest offsets from Kafka have not been fetched"); } if (!latestOffsetsFromKafka.keySet().equals(highestCurrentOffsets.keySet())) { log.warn( "Lag metric: Kafka partitions %s do not match task partitions %s", latestOffsetsFromKafka.keySet(), highestCurrentOffsets.keySet() ); } <START> long lag = getLagPerPartition(highestCurrentOffsets) <END> .values() .stream() .mapToLong(Number::longValue) .sum(); emitter.emit( ServiceMetricEvent.builder().setDimension("dataSource", dataSource).build("ingest/kafka/lag", lag) ); } catch (Exception e) { log.warn(e, "Unable to compute Kafka lag"); } }; }</code><technical_language>this compute a negative lag for a partition latestOffsetsFromKafka stale latest offsets highestCurrentOffsets updated information lag is computed. problematic</technical_language>

Target:
private Runnable emitLag() { return () -> { try { Map<Integer, Long> highestCurrentOffsets = getHighestCurrentOffsets(); if (latestOffsetsFromKafka == null) { throw new ISE("Latest offsets from Kafka have not been fetched"); } if (!latestOffsetsFromKafka.keySet().equals(highestCurrentOffsets.keySet())) { log.warn( "Lag metric: Kafka partitions %s do not match task partitions %s", latestOffsetsFromKafka.keySet(), highestCurrentOffsets.keySet() ); } long lag = getLagPerPartition(highestCurrentOffsets) .values() .stream() .mapToLong(x -> Math.max(x, 0)) .sum(); emitter.emit( ServiceMetricEvent.builder().setDimension("dataSource", dataSource).build("ingest/kafka/lag", lag) ); } catch (Exception e) { log.warn(e, "Unable to compute Kafka lag"); } }; }
Source:
<code>public CommandLine parse(ShellProperties shellProperties, String[] applicationArguments) { List<String> commands = new ArrayList<String>(); <START> if (shellProperties.getCommandFile() != null) { <END> for(String filePath:shellProperties.getCommandFile().split(",")) { File f = new File(filePath); try { commands.addAll(FileUtils.readLines(f)); } catch (IOException e) { logger.error("Unable to read from " + f.toString(), e); } } } String[] commandsToExecute = (commands.size() > 0) ? commands.toArray(new String[commands.size()]) : null; int historySize = shellProperties.getHistorySize(); if (historySize < 0) { logger.warn("historySize option must be > 0, using default value of " + SimpleShellCommandLineOptions.DEFAULT_HISTORY_SIZE); historySize = SimpleShellCommandLineOptions.DEFAULT_HISTORY_SIZE; } return new CommandLine(applicationArguments, historySize, commandsToExecute); }</code><technical_language>Yep, compatible. In fact i existing tests will/should pass changes. Cheers</technical_language>

Target:
public CommandLine parse(ShellProperties shellProperties, String[] applicationArguments) { List<String> commands = new ArrayList<String>(); if (shellProperties.getCommandFile() != null) { for(String filePath:shellProperties.getCommandFile()) { File f = new File(filePath); try { commands.addAll(FileUtils.readLines(f)); } catch (IOException e) { logger.error("Unable to read from " + f.toString(), e); } } } String[] commandsToExecute = (commands.size() > 0) ? commands.toArray(new String[commands.size()]) : null; int historySize = shellProperties.getHistorySize(); if (historySize < 0) { logger.warn("historySize option must be > 0, using default value of " + SimpleShellCommandLineOptions.DEFAULT_HISTORY_SIZE); historySize = SimpleShellCommandLineOptions.DEFAULT_HISTORY_SIZE; } return new CommandLine(applicationArguments, historySize, commandsToExecute); }
Source:
<code>String getContent(BufferedReader reader, Map<String, ?> args) throws IOException { Pattern start = Pattern.compile((String)args.get("start")); Pattern end = Pattern.compile((String)args.get("end")); <START> StringBuffer buffer = new StringBuffer(); <END> String line = null; boolean started = false; while ((line = reader.readLine()) != null) { line = ConsoleNote.removeNotes(line); if (start.matcher(line).matches()) { started = true; continue; } if (end.matcher(line).matches()) break; if (started) buffer.append(line); } return buffer.toString(); }</code><technical_language>want non-thread safe class StringBuilder instead of StringBuffer</technical_language>

Target:
String getContent(BufferedReader reader, Map<String, ?> args) throws IOException { Pattern start = Pattern.compile((String)args.get("start")); Pattern end = Pattern.compile((String)args.get("end")); StringBuilder buffer = new StringBuilder(); String line = null; boolean started = false; while ((line = reader.readLine()) != null) { line = ConsoleNote.removeNotes(line); if (start.matcher(line).matches()) { started = true; continue; } if (end.matcher(line).matches()) break; if (started) buffer.append(line).append('\n'); } return buffer.toString(); }
Source:
<code>private boolean singleRemittanceAddressExists(PaymentWorksNewVendorDetailDTO paymentWorksNewVendorDetailDTO) { <START> if (ObjectUtils.isNotNull(paymentWorksNewVendorDetailDTO.getRequesting_company().getRemittance_addresses()) && <END> ObjectUtils.isNotNull(paymentWorksNewVendorDetailDTO.getRequesting_company().getRemittance_addresses().getRemittance_address()) && paymentWorksNewVendorDetailDTO.getRequesting_company().getRemittance_addresses().getRemittance_address().size() == 1) { return true; } else { return false; } }</code><technical_language>I return boolean expression here. Also, do want StringUtills.isNotEmpty? Similar thoughts for other "exists" functions</technical_language>

Target:
private boolean singleRemittanceAddressExists(PaymentWorksNewVendorDetailDTO paymentWorksNewVendorDetailDTO) { return (ObjectUtils.isNotNull(paymentWorksNewVendorDetailDTO.getRequesting_company().getRemittance_addresses()) && ObjectUtils.isNotNull(paymentWorksNewVendorDetailDTO.getRequesting_company().getRemittance_addresses().getRemittance_address()) && paymentWorksNewVendorDetailDTO.getRequesting_company().getRemittance_addresses().getRemittance_address().size() == 1); }
Source:
<code>private static void applyNamespaces(RouteDefinition route, Map<String, String> namespaces) { Iterator<ExpressionNode> it = filterTypeInOutputs(route.getOutputs(), ExpressionNode.class); while (it.hasNext()) { ExpressionNode en = it.next(); ExpressionDefinition ed = en.getExpression(); NamespaceAware na = null; Expression exp = ed.getExpressionValue(); <START> if (exp != null && exp instanceof NamespaceAware) { <END> na = (NamespaceAware) exp; } else if (ed instanceof NamespaceAware) { na = (NamespaceAware) ed; } if (na != null) { na.setNamespaces(namespaces); } } }</code><technical_language>check exp instanceof NamespaceAware "null instanceof NamespaceAware" is returning false</technical_language>

Target:
private static void applyNamespaces(RouteDefinition route, Map<String, String> namespaces) { Iterator<ExpressionNode> it = filterTypeInOutputs(route.getOutputs(), ExpressionNode.class); while (it.hasNext()) { NamespaceAware na = getNamespaceAwareFromExpression(it.next()); if (na != null) { na.setNamespaces(namespaces); } } }
Source:
<code><START> public static DateTime getDateTime(JsonObject object, String memberName, <END> DateTimeFormatter formatter) { JsonPrimitive primitive = getPrimitiveChecked(object, memberName); return primitive == null ? null : DateTime.parse(primitive.getAsString(), formatter); }</code><technical_language>In case getDateTime(JsonObject object, String memberName) this method. check formatter != null</technical_language>

Target:
public static DateTime getDateTime(JsonObject object, String memberName, DateTimeFormatter formatter) { if (formatter == null) { throw new NullPointerException("formatter is null"); } JsonPrimitive primitive = getPrimitiveChecked(object, memberName); return primitive == null ? null : DateTime.parse(primitive.getAsString(), formatter); }
Source:
<code>private void addDetailEntriesToNewGroupEntry(PdpFeedGroupEntry newGroupEntry, PdpFeedGroupEntry originalGroupEntry) { for (PdpFeedDetailEntry originalDetailEntry : originalGroupEntry.getDetail()) { PdpFeedDetailEntry newDetailEntry = copyDetailEntry(originalDetailEntry); KualiDecimal originalDetailTransactionTotal = KualiDecimal.ZERO; for (PdpFeedAccountingEntry originalAccountingEntry : originalDetailEntry.getAccounting()) { originalDetailTransactionTotal = originalDetailTransactionTotal.add(originalAccountingEntry.getAmount()); <START> if (originalAccountingEntry.getAmount().isPositive()) { <END> newDetailEntry.getAccounting().add(copyAccountingEntry(originalAccountingEntry)); } else { LOG.debug("addDetailEntriesToNewGroupEntry, not adding accounting entry: " + originalAccountingEntry.toString()); } } addNewPaymentDetailToGroup(newGroupEntry, newDetailEntry, originalDetailTransactionTotal); } }</code><technical_language>I more clear if if/else code extracted in a separate method called: addOnlyPositiveAccountingEntriesForPDPProcessing</technical_language>

Target:
private void addDetailEntriesToNewGroupEntry(PdpFeedGroupEntry newGroupEntry, PdpFeedGroupEntry originalGroupEntry) { for (PdpFeedDetailEntry originalDetailEntry : originalGroupEntry.getDetail()) { PdpFeedDetailEntry newDetailEntry = copyDetailEntry(originalDetailEntry); KualiDecimal originalDetailTransactionTotal = KualiDecimal.ZERO; for (PdpFeedAccountingEntry originalAccountingEntry : originalDetailEntry.getAccounting()) { originalDetailTransactionTotal = originalDetailTransactionTotal.add(originalAccountingEntry.getAmount()); addOnlyPositiveAccountingEntryForPDPProcessing(newDetailEntry, originalAccountingEntry); } addNewPaymentDetailToGroupIfTotalIsPositive(newGroupEntry, newDetailEntry, originalDetailTransactionTotal); } }
Source:
<code>public String toString() { <START> return path == null ? super.toString() : getAbsolutePath(); <END> }</code><technical_language>I adding a field construction time this a name useful. people creating input streams some named source, easy convert a Path, name is useful for error messages</technical_language>

Target:
public String toString() { return source; }