auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
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); } catch (Throwable e) { errors.addError(e); } } }

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:
public void onProjectTemplateRegistryUpdated(ProjectTemplateRegistryUpdatedEvent event) { registry_ = event.getData(); for (Callback callback : pendingCallbacks_) callback.execute(registry_); pendingCallbacks_.clear(); }

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:
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 = "com/googlesource/gerrit/plugins/xdocs/diff/htmlheader-sidebyside-a.xsl"; 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()); }

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:
public void testSyncRefresh() throws IOException { initialize(HeaderCacheElement.TOKEN_STALENESS_MS * 2); Assert.assertEquals(CacheState.Good, RefreshingOAuth2CredentialsInterceptor.getCacheState(underTest.headerCache.get())); }

Target:
public void testSyncRefresh() throws IOException { initialize(HeaderCacheElement.TOKEN_STALENESS_MS + 1); Assert.assertEquals(CacheState.Good, RefreshingOAuth2CredentialsInterceptor.getCacheState(underTest.headerCache.get())); }
Source:
private static boolean equals(float a, float b) { return Float.compare(a, b) == COMPARE_EQUALS; }

Target:
private static boolean equals(float a, float b) { return Float.compare(a, b) == 0; }
Source:
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)); } return buffer.toString().replaceAll("0*$", ""); } return key.toString(); }

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:
private void determineRequiresVisibility(BundleDescription bundle) { BundleSpecification[] required = 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; } } } }

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:
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"; if (new File(basePath, possibleLocationWithoutProcessManifest).isDirectory()) { possibleLocations.add(possibleLocationWithoutProcessManifest); addPossibleSplitLocations(basePath, possibleLocationWithoutProcessManifest, possibleLocations); } if (new File(basePath, possibleLocationWithProcessManifest).isDirectory()) { possibleLocations.add(possibleLocationWithProcessManifest); addPossibleSplitLocations(basePath, possibleLocationWithProcessManifest, possibleLocations); } }

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:
public DataSize convertToMostSuccinctDataSize() { Unit unitToUse = Unit.BYTE; for (Unit unitToTest : Unit.values()) { if (getValue(unitToTest) > 0.99) { unitToUse = unitToTest; } else { break; } } return convertTo(unitToUse); }

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:
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.trace("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.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); } }

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:
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); getStatisticsService().addHandler(queryExecutionStatisticsGenerator); }

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:
public void onRegister() throws URISyntaxException { logger.info("\n----------------WebSocket Registry Test----------------"); String uri = "/test"; textCarbonMessage.setProperty(Constants.TO, uri); }

Target:
public void onRegister() throws URISyntaxException { log.info(System.lineSeparator() + "----------------WebSocket Registry Test----------------"); String uri = "/test"; textCarbonMessage.setProperty(Constants.TO, uri); }
Source:
public Array createArrayOf(String typeName, Object[] elements) throws SQLException { PDataType pdDataType = PDataType.fromSqlTypeName(typeName); PDataType arrayPrimitiveType = PDataType.fromSqlTypeName(SchemaUtil.getPrimitiveTypeOfArray(pdDataType.name())); return new PhoenixArray(arrayPrimitiveType.ordinal(), elements); }

Target:
public Array createArrayOf(String typeName, Object[] elements) throws SQLException { PDataType arrayPrimitiveType = PDataType.fromSqlTypeName(typeName); return PDataTypeForArray.instantiatePhoenixArray(arrayPrimitiveType, elements); }
Source:
public String getMode() { return mode.toString(); }

Target:
public String getMode() { return mode; }
Source:
private AS7ManagementDetails createSynchronousManagementDetails(IServer server, final boolean[] callbacksCalled) { HashMap<String, Object> props = new HashMap<String, Object>(); props.put(IAS7ManagementDetails.PROPERTY_TIMEOUT, new Integer(800)); return new AS7ManagementDetails(server, props) { public String[] handleCallbacks(String[] prompts) throws UnsupportedOperationException { synchronized(callbacksCalled) { callbacksCalled[0] = true; } throw new UnsupportedOperationException(); } }; }

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:
public void resume() { checkRealm(); pauseDepth--; if (pauseDepth < 0) { throw new IllegalStateException( "The resume() method was called more often than pause()."); } else if (dirty && pauseDepth == 0) { scheduleUpdate(); } }

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:
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.MAX_VALUE, view.getMaxIdle()); assertEquals(Long.MAX_VALUE, view.getTtl()); }

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:
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 = SortOrderDialogFragment.compareInt(card1.getIndex(), card2.getIndex()); break; } } } catch (NullPointerException e) { retVal = 0; } if (!option.getAscending()) { retVal = -retVal; } if (retVal != 0) { return retVal; } } return retVal; }

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:
void preemptEligibleCommands() { synchronized (runningCommandsMap) { Set<String> commandsToInterrupt = new HashSet<>(); for (RunningCommand command : runningCommandsMap.values()) { if (command.isPreemptible()) { command.thread.interrupt(); commandsToInterrupt.add(command.id); } } if (!commandsToInterrupt.isEmpty()) { startSlowInterruptWatcher(ImmutableSet.copyOf(commandsToInterrupt)); } } }

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:
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")));;; }

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:
static private void processOutcomeJson(JSONObject outcomeJson, InfluenceParams influenceParams) { if (outcomeJson.has(V2_PARAM)) influenceParams.v2Enabled = outcomeJson.optBoolean(V2_PARAM);; if (outcomeJson.has(DIRECT_PARAM)) { JSONObject direct = outcomeJson.optJSONObject(DIRECT_PARAM); influenceParams.directEnabled = direct.optBoolean(ENABLED_PARAM); } if (outcomeJson.has(INDIRECT_PARAM)) { JSONObject indirect = outcomeJson.optJSONObject(INDIRECT_PARAM); influenceParams.indirectEnabled = indirect.optBoolean(ENABLED_PARAM); if (indirect.has(NOTIFICATION_ATTRIBUTION_PARAM)) { JSONObject indirectNotificationAttribution = indirect.optJSONObject(NOTIFICATION_ATTRIBUTION_PARAM); influenceParams.indirectNotificationAttributionWindow = indirectNotificationAttribution.optInt("minutes_since_displayed", DEFAULT_INDIRECT_ATTRIBUTION_WINDOW); influenceParams.notificationLimit = indirectNotificationAttribution.optInt("limit", DEFAULT_NOTIFICATION_LIMIT); } if (indirect.has(IAM_ATTRIBUTION_PARAM)) { JSONObject indirectIAMAttribution = indirect.optJSONObject(IAM_ATTRIBUTION_PARAM); influenceParams.indirectIAMAttributionWindow = indirectIAMAttribution.optInt("minutes_since_displayed", DEFAULT_INDIRECT_ATTRIBUTION_WINDOW); influenceParams.iamLimit = indirectIAMAttribution.optInt("limit", DEFAULT_NOTIFICATION_LIMIT); } } if (outcomeJson.has(UNATTRIBUTED_PARAM)) { JSONObject unattributed = outcomeJson.optJSONObject(UNATTRIBUTED_PARAM); influenceParams.unattributedEnabled = unattributed.optBoolean(ENABLED_PARAM); } }

Target:
static private void processOutcomeJson(JSONObject outcomeJson, InfluenceParams influenceParams) { if (outcomeJson.has(OUTCOMES_V2_SERVICE_PARAM)) influenceParams.outcomesV2ServiceEnabled = outcomeJson.optBoolean(OUTCOMES_V2_SERVICE_PARAM); if (outcomeJson.has(DIRECT_PARAM)) { JSONObject direct = outcomeJson.optJSONObject(DIRECT_PARAM); influenceParams.directEnabled = direct.optBoolean(ENABLED_PARAM); } if (outcomeJson.has(INDIRECT_PARAM)) { JSONObject indirect = outcomeJson.optJSONObject(INDIRECT_PARAM); influenceParams.indirectEnabled = indirect.optBoolean(ENABLED_PARAM); if (indirect.has(NOTIFICATION_ATTRIBUTION_PARAM)) { JSONObject indirectNotificationAttribution = indirect.optJSONObject(NOTIFICATION_ATTRIBUTION_PARAM); influenceParams.indirectNotificationAttributionWindow = indirectNotificationAttribution.optInt("minutes_since_displayed", DEFAULT_INDIRECT_ATTRIBUTION_WINDOW); influenceParams.notificationLimit = indirectNotificationAttribution.optInt("limit", DEFAULT_NOTIFICATION_LIMIT); } if (indirect.has(IAM_ATTRIBUTION_PARAM)) { JSONObject indirectIAMAttribution = indirect.optJSONObject(IAM_ATTRIBUTION_PARAM); influenceParams.indirectIAMAttributionWindow = indirectIAMAttribution.optInt("minutes_since_displayed", DEFAULT_INDIRECT_ATTRIBUTION_WINDOW); influenceParams.iamLimit = indirectIAMAttribution.optInt("limit", DEFAULT_NOTIFICATION_LIMIT); } } if (outcomeJson.has(UNATTRIBUTED_PARAM)) { JSONObject unattributed = outcomeJson.optJSONObject(UNATTRIBUTED_PARAM); influenceParams.unattributedEnabled = unattributed.optBoolean(ENABLED_PARAM); } }
Source:
private void loadPlugins() { NativeInterface.setClient(this); if (config.getDetectNdkCrashes()) { enableNdkCrashReporting(); } else { disableNdkCrashReporting(); } if (config.getDetectAnrs()) { enableAnrReporting(); } else { disableAnrReporting(); } }

Target:
private void loadPlugins() { NativeInterface.setClient(this); enableOrDisableNdkReporting(); enableOrDisableAnrReporting(); BugsnagPluginInterface.INSTANCE.loadRegisteredPlugins(this); }
Source:
@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); FeatureLayer statesLayer = new FeatureLayer(statesTable); 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())); } }

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:
public ListenableFuture<TransportEndpoint> connect(@CheckForNull final TransportAddress address) { checkArgument(address != null); final TransportChannel transportChannel = getOrConnect(address); return Futures.transform(transportChannel.handshakeFuture(), new AsyncFunction<TransportHandshakeData, TransportEndpoint>() { @Override public ListenableFuture<TransportEndpoint> apply(@Nonnull TransportHandshakeData handshakeData) throws Exception { return Futures.immediateFuture(handshakeData.endpoint()); } }); }

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:
@Override public void stop() { for (Map.Entry<String, CatalogReplicaShipper[]> e : primaryRegionsUnderReplication.entrySet()) { for (CatalogReplicaShipper s : e.getValue()) { s.setRunning(false); } } stopAsync(); }

Target:
@Override public void stop() { for (Map.Entry<String, CatalogReplicaShipper[]> e : primaryRegionsUnderReplication.entrySet()) { for (CatalogReplicaShipper s : e.getValue()) { s.stopShipper(); } } stopAsync(); }
Source:
private String stripPortNumber(String instanceName) { return instanceName.replace("_" + clusterMapConfig.clusterMapPort, ""); }

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:
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); } }

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:
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 = RandomUtil.getRandom(); double variance = (random.nextBoolean() ? collisionAvoidanceFactor : -collisionAvoidanceFactor) * random.nextDouble(); delay += (delay * variance); } if (delay > maxRedeliveryDelay) { delay = maxRedeliveryDelay; } return delay; }

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:
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(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"); } }; }

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:
public CommandLine parse(ShellProperties shellProperties, String[] applicationArguments) { List<String> commands = new ArrayList<String>(); if (shellProperties.getCommandFile() != null) { 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); }

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:
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")); StringBuffer buffer = new StringBuffer(); 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(); }

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:
private boolean singleRemittanceAddressExists(PaymentWorksNewVendorDetailDTO paymentWorksNewVendorDetailDTO) { if (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) { return true; } else { return false; } }

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:
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(); if (exp != null && exp instanceof NamespaceAware) { na = (NamespaceAware) exp; } else if (ed instanceof NamespaceAware) { na = (NamespaceAware) ed; } if (na != null) { na.setNamespaces(namespaces); } } }

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:
public static DateTime getDateTime(JsonObject object, String memberName, DateTimeFormatter formatter) { JsonPrimitive primitive = getPrimitiveChecked(object, memberName); return primitive == null ? null : DateTime.parse(primitive.getAsString(), formatter); }

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:
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()); if (originalAccountingEntry.getAmount().isPositive()) { newDetailEntry.getAccounting().add(copyAccountingEntry(originalAccountingEntry)); } else { LOG.debug("addDetailEntriesToNewGroupEntry, not adding accounting entry: " + originalAccountingEntry.toString()); } } addNewPaymentDetailToGroup(newGroupEntry, newDetailEntry, originalDetailTransactionTotal); } }

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:
public String toString() { return path == null ? super.toString() : getAbsolutePath(); }

Target:
public String toString() { return source; }
Source:
public void testVersionsLocation() { CreateContainerOptions options = new CreateContainerOptions().headers(ImmutableMultimap.of(CONTAINER_VERSIONS_LOCATION, "versions")); assertEquals(ImmutableList.of("versions"), options.buildRequestHeaders().get(CONTAINER_VERSIONS_LOCATION)); }

Target:
public void testVersionsLocation() { CreateContainerOptions options = new CreateContainerOptions().headers(ImmutableMultimap.of(VERSIONS_LOCATION, "containerWithVersions")); assertEquals(options.buildRequestHeaders().get(VERSIONS_LOCATION), ImmutableList.of("containerWithVersions")); }
Source:
Map<Long, ILogData> readRange(RuntimeLayout runtimeLayout, Set<Long> globalAddresses) { return globalAddresses.parallelStream() .map(a -> new SimpleImmutableEntry<>(a, read(runtimeLayout, a))) .collect(Collectors.toMap(SimpleImmutableEntry::getKey, SimpleImmutableEntry::getValue)); }

Target:
Map<Long, ILogData> readRange(RuntimeLayout runtimeLayout, Set<Long> globalAddresses) { return globalAddresses .parallelStream() .collect(Collectors.toMap(Function.identity(),a -> read(runtimeLayout, a))); }
Source:
public static double[] findCoordinatesByIp() { double lat = 0; double lon = 0; try { URL geoIpUrl = new URL("<LINK_0>"); URLConnection conn = geoIpUrl.openConnection(); ByteArrayOutputStream output = new ByteArrayOutputStream(MAX_BYTE_STREAM); org.apache.commons.io.IOUtils.copy(conn.getInputStream(), output); output.close(); String result = output.toString(); twitter4j.JSONObject myGeoLocation = new twitter4j.JSONObject(result); String[] loc = myGeoLocation.getString("loc").split(","); System.out.printf(loc[0]); lat = Double.parseDouble(loc[0]); lon = Double.parseDouble(loc[1]); } catch (Exception ex) { System.err.println(ex.getMessage()); } double[] coordinates = new double[2]; coordinates[0] = lat; coordinates[1] = lon; return coordinates; }

Target:
public static double[] findCoordinatesByIp() throws LocationException { double lat; double lon; try { URL geoIpUrl = new URL("<LINK_0>"); URLConnection conn = geoIpUrl.openConnection(); try (ByteArrayOutputStream output = new ByteArrayOutputStream(MAX_BYTE_STREAM)) { org.apache.commons.io.IOUtils.copy(conn.getInputStream(), output); output.close(); String result = output.toString(); twitter4j.JSONObject myGeoLocation = new twitter4j.JSONObject(result); String[] loc = myGeoLocation.getString("loc").split(","); lat = Double.parseDouble(loc[0]); lon = Double.parseDouble(loc[1]); } catch (Exception ex) { throw new LocationException(ex.getMessage()); } } catch (Exception ex) { throw new LocationException(ex.getMessage()); } double[] coordinates = new double[]{lat, lon}; return coordinates; }
Source:
protected boolean nextInner() throws IOException { boolean more = false; if (this.resultIt == null || !this.resultIt.hasNext()) { while (this.result.hasMoreRows()) { RowResultIterator nextRows = this.result.nextRows(); if (nextRows.hasNext()) { resultIt = nextRows; more = true; } } } else { more = true; } if (more) { RowResult next = resultIt.next(); key = ((KuduStore<K, T>) getDataStore()).extractKey(next); persistent = ((KuduStore<K, T>) getDataStore()).newInstance(next, getQuery().getFields()); } return more; }

Target:
protected boolean nextInner() throws IOException { boolean hasMoreRecords = false; if (this.resultIt == null || !this.resultIt.hasNext()) { while (this.result.hasMoreRows()) { RowResultIterator nextRows = this.result.nextRows(); if (nextRows.hasNext()) { resultIt = nextRows; hasMoreRecords = true; } } } else { hasMoreRecords = true; } if (hasMoreRecords) { RowResult next = resultIt.next(); key = ((KuduStore<K, T>) getDataStore()).extractKey(next); persistent = ((KuduStore<K, T>) getDataStore()).newInstance(next, getQuery().getFields()); } return hasMoreRecords; }
Source:
public static MutableCTreeNetwork expand(MutableCTreeNetwork tree, MutableCTreeNetwork subTree) { Optional parent = tree.predecessor(subTree); Object parentEdge = parent.isPresent() ? Iterables.getOnlyElement(tree.inEdges(subTree)) : null; tree.removeNode(subTree); if (!subTree.root().isPresent()) { return tree; } if (parent.isPresent()) { TreeUtils.addSubTree(tree, subTree, parent.get(), parentEdge); return tree; } else { return subTree; } }

Target:
public static MutableCTreeNetwork expand(MutableCTreeNetwork tree, MutableCTreeNetwork subTree) { Optional parent = tree.predecessor(subTree); Object parentEdge = parent.isPresent() ? Iterables.getOnlyElement(tree.inEdges(subTree)) : null; if (!subTree.root().isPresent()) { return tree; } tree.removeNode(subTree); if (parent.isPresent()) { TreeUtils.addSubTree(tree, subTree, parent.get(), parentEdge); return tree; } else { return subTree; } }
Source:
ModularInputKindArgument(Map<String,String> template) { super(); for (String key : template.keySet()) { put(key, template.get(key)); } }

Target:
ModularInputKindArgument(Map<String,String> template) { super(); putAll(template); }