auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public RegionBootstrap(BootstrapNotifier application, Region region) { if (application.getApplicationContext() == null) { throw new NullPointerException("The BootstrapNotifier instance is returning null from its getApplicationContext() method. Have you implemented this method?"); } beaconManager = BeaconManager.getInstanceForApplication(application.getApplicationContext()); this.context = application.getApplicationContext(); regions = new ArrayList<Region>(); regions.add(region); beaconConsumer = new InternalBeaconConsumer(); beaconManager.bind(beaconConsumer); LogManager.d(TAG, "Waiting for BeaconService connection"); }

Target:
public RegionBootstrap(BootstrapNotifier application, Region region) { if (application.getApplicationContext() == null) { throw new NullPointerException("The BootstrapNotifier instance is returning null from its getApplicationContext() method. Have you implemented this method?"); } this.context = application.getApplicationContext(); regions = new ArrayList<Region>(); regions.add(region); beaconManager = BeaconManager.getInstanceForApplication(context); beaconConsumer = new InternalBeaconConsumer(); beaconManager.bind(beaconConsumer); LogManager.d(TAG, "Waiting for BeaconService connection"); }
Source:
protected void processUnique(T tuple) { if (orderedOutput && !decisions.isEmpty()) { recordDecision(tuple, Decision.UNIQUE); } else { uniqueEvents++; emitOutput(tuple); } }

Target:
protected void processUnique(T tuple) { if (preserveTupleOrder && !decisions.isEmpty()) { recordDecision(tuple, Decision.UNIQUE); } else { uniqueEvents++; emitUnique(tuple); } }
Source:
public String get(Enum<?> key) { if(key == null) { throw new IllegalArgumentException(); } try { String enumName = key.getDeclaringClass().toString(); enumName = enumName.substring(enumName.lastIndexOf(".")+1,enumName.length()); String translatedEnum = enums.getString(enumName + "___" + key.toString()); return translatedEnum; } catch (MissingResourceException e) { logger.info("Missing Enum resource: " + e.getLocalizedMessage()); return key.name(); } }

Target:
public String get(Enum<?> key) { if(key == null) { return constants.notAvailableLabel(); } try { String enumName = key.getDeclaringClass().toString(); enumName = enumName.substring(enumName.lastIndexOf(".")+1,enumName.length()); String translatedEnum = enums.getString(enumName + "___" + key.toString()); return translatedEnum; } catch (MissingResourceException e) { logger.info("Missing Enum resource: " + e.getLocalizedMessage()); return key.name(); } }
Source:
public Observable<Pair<Trip, Trip>> getHideAutoCompleteVisibilityClick() { return _hideAutoCompleteVisibilityClicks; }

Target:
public Observable<AutoCompleteUpdateEvent<Trip>> getHideAutoCompleteVisibilityClick() { return _hideAutoCompleteVisibilityClicks; }
Source:
public long getReplicationRemainingPercent() { ReplicationStatusKey key = ReplicationStatusKey.newBuilder().setKey( ReplicationStatusKey.Status.REPLICATION_COMPLETION).build(); CorfuRecord record = corfuStore.query(NAMESPACE).getRecord(REPLICATION_STATUS_TABLE, key); if (record == null) { return 0; } ReplicationStatusVal val = (ReplicationStatusVal)record.getPayload(); return val.getReplicationCompletion(); }

Target:
public Map<String, ReplicationStatusVal> getReplicationRemainingPercent() { Map<String, ReplicationStatusVal> replicationStatusMap = new HashMap<>(); QueryResult<CorfuStoreEntry<ReplicationStatusKey, ReplicationStatusVal, ReplicationStatusVal>> entries = corfuStore.query(NAMESPACE).executeQuery(REPLICATION_STATUS_TABLE, (x) -> {return true;}); for(CorfuStoreEntry<ReplicationStatusKey, ReplicationStatusVal, ReplicationStatusVal>entry : entries.getResult()) { replicationStatusMap.put(entry.getKey().getClusterId(), entry.getPayload()); } return replicationStatusMap; }
Source:
public boolean equals(Object aThat) { if (this == aThat) return true; if (!(aThat instanceof VariableIdentifier)) return false; VariableIdentifier that = (VariableIdentifier) aThat; return (this.getName().equals(that.getName()) && this.getNamespaceIdentifier().equals(that.getNamespaceIdentifier())); }

Target:
public boolean equals(Object aThat) { if (this == aThat) { return true; } if (!(aThat instanceof VariableIdentifier)) { return false; } VariableIdentifier that = (VariableIdentifier) aThat; return (this.getName().equals(that.getName()) && this .getNamespaceIdentifier().equals(that.getNamespaceIdentifier())); }
Source:
public Subject getSubject() { return () -> Optional.ofNullable( SecurityContextHolder.getContext().getAuthentication()).map(Principal::getName).orElse(null); }

Target:
public Optional<Subject> getSubject() { return Optional.empty(); }
Source:
public void inherit(SolverBenchmarkConfig inheritedConfig) { if (solverConfig == null) { solverConfig = inheritedConfig.getSolverConfig(); } else if (inheritedConfig.getSolverConfig() != null) { solverConfig.inherit(inheritedConfig.getSolverConfig()); } if (problemBenchmarksConfig == null) { problemBenchmarksConfig = inheritedConfig.getProblemBenchmarksConfig(); } else if (inheritedConfig.getProblemBenchmarksConfig() != null) { problemBenchmarksConfig.inherit(inheritedConfig.getProblemBenchmarksConfig()); } if (subSingleCount == null) { subSingleCount = ObjectUtils.defaultIfNull(inheritedConfig.getSubSingleCount(), 1); } }

Target:
public void inherit(SolverBenchmarkConfig inheritedConfig) { if (solverConfig == null) { solverConfig = inheritedConfig.getSolverConfig(); } else if (inheritedConfig.getSolverConfig() != null) { solverConfig.inherit(inheritedConfig.getSolverConfig()); } if (problemBenchmarksConfig == null) { problemBenchmarksConfig = inheritedConfig.getProblemBenchmarksConfig(); } else if (inheritedConfig.getProblemBenchmarksConfig() != null) { problemBenchmarksConfig.inherit(inheritedConfig.getProblemBenchmarksConfig()); } subSingleCount = ConfigUtils.inheritOverwritableProperty(subSingleCount, inheritedConfig.getSubSingleCount()); }
Source:
public void beforeCompletion() { switch (faiMode) { case BEFORE_MARK_ROLLBACK: try { transaction.setRollbackOnly(); } catch (SystemException e) { } break; case BEFORE_THROW_EXCEPTION: throw new RuntimeException("induced!"); } }

Target:
public void beforeCompletion() { switch (failMode) { case BEFORE_MARK_ROLLBACK: try { transaction.setRollbackOnly(); } catch (SystemException e) { } break; case BEFORE_THROW_EXCEPTION: throw new RuntimeException("induced!"); } }
Source:
public ArtifactData create(IOseeBranch branch, IArtifactType token, String guid, long uuid) throws OseeCoreException { Conditions.checkNotNull(branch, "branch"); Conditions.checkExpressionFailOnTrue(artifactCache.isAbstract(token), "Cannot create an instance of abstract type [%s]", token); String guidToSet = idFactory.getUniqueGuid(guid); Conditions.checkExpressionFailOnTrue(!GUID.isValid(guidToSet), "Invalid guid [%s] during artifact creation [type: %s]", guidToSet, token); VersionData version = objectFactory.createDefaultVersionData(); version.setBranchId(branch.getUuid()); ModificationType modType = RelationalConstants.DEFAULT_MODIFICATION_TYPE; ArtifactData artifactData = objectFactory.createArtifactData(version, new Long(uuid).intValue(), token, modType, guidToSet); return artifactData; }

Target:
public ArtifactData create(IOseeBranch branch, IArtifactType token, String guid, long uuid) throws OseeCoreException { Conditions.checkNotNull(branch, "branch"); Conditions.checkExpressionFailOnTrue(artifactCache.isAbstract(token), "Cannot create an instance of abstract type [%s]", token); String guidToSet = idFactory.getUniqueGuid(guid); Conditions.checkExpressionFailOnTrue(!GUID.isValid(guidToSet), "Invalid guid [%s] during artifact creation [type: %s]", guidToSet, token); VersionData version = objectFactory.createDefaultVersionData(); version.setBranchId(branch.getUuid()); ModificationType modType = RelationalConstants.DEFAULT_MODIFICATION_TYPE; ArtifactData artifactData = objectFactory.createArtifactData(version, (int) uuid, token, modType, guidToSet); return artifactData; }
Source:
public boolean execute() throws SQLException { executeQuery(); return result != null; }

Target:
public boolean execute() throws SQLException { return executeQuery() != null; }
Source:
private void openAdminMenu() { administrationDropdownMenu.click(); info("Clicked administration menu"); try { Thread.sleep(500); } catch (InterruptedException e) if (!isDropdownOpened()) { info("Couldn't open administration menu. Trying again."); openMainMenu(); } }

Target:
private void openAdminMenu() { administrationDropdownMenu.click(); info("Clicked administration menu"); if (!mainPage.isDropdownMenuOpened()) { administrationDropdownMenu.click(); info("Clicked administration menu again"); if (!mainPage.isDropdownMenuOpened()) { throw new NoSuchElementException("Tried to open administration menu 2 times without any success"); } } }
Source:
public void testStartCaptivePortalApp() throws Exception { if (!mPackageManager.hasSystemFeature(FEATURE_WIFI)) { Log.i(TAG, "testRegisterNetworkCallback cannot execute unless device supports WiFi"); return; } adoptShellPermissionIdentity(); final List<PackageInfo> apps = mPackageManager.getInstalledPackages(PackageManager.MATCH_ALL); final ArrayList<String> captiveportalApps = new ArrayList<>(); for (PackageInfo app : apps) { List<IntentFilter> filters = mPackageManager.getAllIntentFilters(app.packageName); for (IntentFilter filter : filters) { if (filter.hasAction("android.net.conn.CAPTIVE_PORTAL")) { captiveportalApps.add(app.packageName); } } } assertNotEquals(0, captiveportalApps.size()); captiveportalApps.forEach(name -> mActivityManager.killBackgroundProcesses(name)); assertFalse(isOneOfAppRunning(captiveportalApps)); final Network network = ensureWifiConnected(); final Bundle appExtras = new Bundle(); appExtras.putParcelable(ConnectivityManager.EXTRA_NETWORK, network); mCm.startCaptivePortalApp(network, appExtras); Thread.sleep(200); boolean isCaptivePortalAppRunning = false; for (int i = 0; i < 5; i++) { if (isOneOfAppRunning(captiveportalApps)) { isCaptivePortalAppRunning = true; break; } Thread.sleep(3000); } assertTrue(isCaptivePortalAppRunning); }

Target:
public void testStartCaptivePortalApp() throws Exception { if (!mPackageManager.hasSystemFeature(FEATURE_WIFI)) { Log.i(TAG, "testStartCaptivePortalApp cannot execute unless device supports WiFi"); return; } adoptShellPermissionIdentity(); final List<PackageInfo> apps = mPackageManager.getInstalledPackages(PackageManager.MATCH_ALL); final ArrayList<String> captiveportalApps = new ArrayList<>(); for (PackageInfo app : apps) { List<IntentFilter> filters = mPackageManager.getAllIntentFilters(app.packageName); for (IntentFilter filter : filters) { if (filter.hasAction("android.net.conn.CAPTIVE_PORTAL")) { captiveportalApps.add(app.packageName); } } } assertNotEquals(0, captiveportalApps.size()); captiveportalApps.forEach(name -> mActivityManager.killBackgroundProcesses(name)); assertFalse(isOneOfAppRunning(captiveportalApps)); final Network network = ensureWifiConnected(); final Bundle appExtras = new Bundle(); appExtras.putParcelable(ConnectivityManager.EXTRA_NETWORK, network); mCm.startCaptivePortalApp(network, appExtras); Thread.sleep(200); boolean isCaptivePortalAppRunning = false; for (int i = 0; i < 5; i++) { if (isOneOfAppRunning(captiveportalApps)) { isCaptivePortalAppRunning = true; break; } Thread.sleep(3000); } assertTrue(isCaptivePortalAppRunning); }
Source:
public static List<SessionData> from(List<ScheduleSlot> slots, OffsetTime now) { List<SessionData> sessionData = slots.stream() .filter(slot -> null != slot.getTalk()) .filter(slot -> !slot.getTalk().getTalkType().equals("Ignite Sessions")) .filter(slot -> OffsetTime.parse(slot.getToTime() + "Z").isAfter(now.plusMinutes(10))) .collect(Collectors.groupingBy(slot -> slot.getRoomId())) .entrySet().stream() .map(entry -> entry.getValue().stream().findFirst()) .map(optional -> optional.orElse(null)) .map(SessionData::new) .sorted(SessionData.COMP) .collect(Collectors.toList()); Optional<String> min = sessionData.stream().map(sd -> sd.beginTime).min(Comparator.naturalOrder()); if (min.isPresent()) sessionData = sessionData.stream().filter(sd -> sd.beginTime.equals(min.get())).collect(Collectors.toList()); System.out.println("Possible Next Sessions (" + sessionData.size() + "):\n " + sessionData); return sessionData; }

Target:
public static List<SessionData> from(List<ScheduleSlot> slots, OffsetTime now) { List<SessionData> sessionData = slots.stream() .filter(slot -> null != slot.getTalk()) .filter(slot -> OffsetTime.parse(slot.getToTime() + "Z").isAfter(now.plusMinutes(10))) .collect(Collectors.groupingBy(slot -> slot.getRoomId())) .entrySet().stream() .map(entry -> entry.getValue().stream().findFirst()) .map(optional -> optional.orElse(null)) .map(SessionData::new) .sorted(SessionData.COMP) .collect(Collectors.toList()); Optional<String> min = sessionData.stream().map(sd -> sd.beginTime).min(Comparator.naturalOrder()); if (min.isPresent()) sessionData = sessionData.stream().filter(sd -> sd.beginTime.equals(min.get())).collect(Collectors.toList()); System.out.println("Possible Next Sessions (" + sessionData.size() + "):\n " + sessionData); return sessionData; }
Source:
private int scheduleCancelation(Runnable runnable, Long timeLimit) { assert timeLimit > 0L; if (status() != ActionStatus.RUNNING) { if (LRALogger.logger.isDebugEnabled()) { LRALogger.logger.debugf("Ignoring timer because the action status is `%e'", status()); } return Response.Status.PRECONDITION_FAILED.getStatusCode(); } if (finishTime != null) { LocalDateTime ft = LocalDateTime.now().plusNanos(timeLimit * 1000000); if (ft.isAfter(finishTime)) { if (LRALogger.logger.isDebugEnabled()) { LRALogger.logger.debugf( "Ignoring timer for LRA `%s' since there is already an earlier one", id); } return Response.Status.OK.getStatusCode(); } finishTime = ft; if (scheduledAbort != null) { scheduledAbort.cancel(false); } } else { finishTime = LocalDateTime.now(ZoneOffset.UTC).plusNanos(timeLimit * 1000000); } scheduledAbort = scheduler.schedule(runnable, timeLimit, TimeUnit.MILLISECONDS); return Response.Status.OK.getStatusCode(); }

Target:
private int scheduleCancelation(Runnable runnable, Long timeLimit) { assert timeLimit > 0L; if (status() != ActionStatus.RUNNING) { if (LRALogger.logger.isDebugEnabled()) { LRALogger.logger.debugf("Ignoring timer because the action status is `%e'", status()); } return Response.Status.PRECONDITION_FAILED.getStatusCode(); } if (finishTime != null) { LocalDateTime ft = LocalDateTime.now(ZoneOffset.UTC).plusNanos(timeLimit * 1000000); if (ft.isAfter(finishTime)) { if (LRALogger.logger.isDebugEnabled()) { LRALogger.logger.debugf( "Ignoring timer for LRA `%s' since there is already an earlier one", id); } return Response.Status.OK.getStatusCode(); } finishTime = ft; if (scheduledAbort != null) { scheduledAbort.cancel(false); } } else { finishTime = LocalDateTime.now(ZoneOffset.UTC).plusNanos(timeLimit * 1000000); } scheduledAbort = scheduler.schedule(runnable, timeLimit, TimeUnit.MILLISECONDS); return Response.Status.OK.getStatusCode(); }
Source:
public void clickOnAddSchemaUrlButton() { new WebDriverWait(seleniumWebDriver, LOAD_PAGE_TIMEOUT_SEC) .until(visibilityOf(addSchemaUrlButton)) .click(); }

Target:
public void clickOnAddSchemaUrlButton() { webDriverHelper.waitAndClick(addSchemaUrlButton); }
Source:
private void ensureOpen() { Preconditions.checkState(!closed, "This client was closed."); }

Target:
private void ensureOpen() { if (closed) { throw new IllegalStateException("This client was closed."); } }
Source:
public String getActualDowntime() { return (actualDowntime == null) ? "(N/A)" : actualDowntime.toString() + "ms"; }

Target:
public String getActualDowntime() { return (actualDowntime == null) ? "(N/A)" : actualDowntime + "ms"; }
Source:
private ICodeSystem getCodeSystem(final String shortName) { try { return requests.prepareGetCodeSystem() .setUniqueId(shortName) .build(BRANCH) .executeSync(bus); } catch (CodeSystemNotFoundException e) { return null; } }

Target:
private ICodeSystem getCodeSystem(final String shortName) { return requests.prepareGetCodeSystem() .setUniqueId(shortName) .build(BRANCH) .executeSync(bus); }
Source:
public int compareTo(@NonNull TextTrackScore other) { if (this.isWithinRendererCapabilities != other.isWithinRendererCapabilities) { return this.isWithinRendererCapabilities ? 1 : -1; } if ((this.preferredLanguageScore > 0 || (this.selectUndeterminedTextLanguage && this.trackHasNoLanguage)) == (other.preferredLanguageScore > 0 || (other.selectUndeterminedTextLanguage && other.trackHasNoLanguage))) { if (this.preferredLanguageScore > 0 || (this.selectUndeterminedTextLanguage && this.trackHasNoLanguage)) { if (this.isDefault != other.isDefault) { return this.isDefault ? 1 : -1; } if (this.isForced != other.isForced) { return !this.isForced ? 1 : -1; } return (this.preferredLanguageScore > other.preferredLanguageScore) ? 1 : -1; } else { if (this.isDefault != other.isDefault) { return this.isDefault ? 1 : -1; } if ((this.isForced && (this.selectedAudioLanguageScore > 0 || (this.trackHasNoLanguage && this.stringDefinesNoLang))) != (other.isForced && (other.selectedAudioLanguageScore > 0 || (other.trackHasNoLanguage && other.stringDefinesNoLang)))) { return (this.isForced && (this.selectedAudioLanguageScore > 0 || (this.trackHasNoLanguage && this.stringDefinesNoLang))) ? 1 : -1; } return -1; } } else { return (this.preferredLanguageScore > 0 || (this.selectUndeterminedTextLanguage && this.trackHasNoLanguage)) ? 1 : -1; } }

Target:
public int compareTo(@NonNull TextTrackScore other) { if (this.isWithinRendererCapabilities != other.isWithinRendererCapabilities) { return this.isWithinRendererCapabilities ? 1 : -1; } if (this.hasLanguageMatch != other.hasLanguageMatch) { return this.hasLanguageMatch ? 1 : -1; } if (this.isDefault != other.isDefault) { return this.isDefault ? 1 : -1; } if (this.hasLanguageMatch) { if (this.isForced != other.isForced) { return !this.isForced ? 1 : -1; } return this.preferredLanguageScore - other.preferredLanguageScore; } else { if ((this.isForced && this.hasSelectedAudioLanguageMatch) != (other.isForced && other.hasSelectedAudioLanguageMatch)) { return (this.isForced && this.hasSelectedAudioLanguageMatch) ? 1 : -1; } return 0; } }
Source:
private void waitForServerStartup() throws IOException { log.info("Checking server availability... (Timeout: " + serverStartCheckTimeout + " seconds)"); int currentSeconds = 0; boolean isTimeout = false; while (!isServerListening("localhost", applicationServerPort)) { if (currentSeconds >= 20) { isTimeout = true; break; } try { Thread.sleep(1000); } catch (InterruptedException ignored) { } currentSeconds++; } if (!isTimeout) { isSuccessServerStartup = true; log.info("Server started in " + currentSeconds + " seconds"); } else { isSuccessServerStartup = false; String message = "Server startup timeout."; log.error(message); throw new IOException(message); } }

Target:
private void waitForServerStartup() throws IOException { log.info("Checking server availability... (Timeout: " + serverStartCheckTimeout + " seconds)"); int startupCounter = 0; boolean isTimeout = false; while (!isServerListening("localhost", applicationServerPort)) { if (startupCounter >= 20) { isTimeout = true; break; } try { Thread.sleep(1000); } catch (InterruptedException ignored) { } startupCounter++; } if (!isTimeout) { isSuccessServerStartup = true; log.info("Server started."); } else { isSuccessServerStartup = false; String message = "Server startup timeout."; log.error(message); throw new IOException(message); } }
Source:
public void hasNoStorageDomains() { when(spDao.get(any(Guid.class))).thenReturn(createDefaultStoragePool()); when(sdDao.getAllForStoragePool(any(Guid.class))).thenReturn (Collections.EMPTY_LIST); ValidateTestUtils.runAndAssertValidateSuccess(cmd); }

Target:
public void hasNoStorageDomains() { when(spDao.get(any(Guid.class))).thenReturn(createDefaultStoragePool()); when(sdDao.getAllForStoragePool(any(Guid.class))).thenReturn (Collections.emptyList()); ValidateTestUtils.runAndAssertValidateSuccess(cmd); }
Source:
private RelNode changeTraitsUsingConverters( RelNode rel, RelTraitSet toTraits, boolean allowAbstractConverters) { final RelTraitSet fromTraits = rel.getTraitSet(); assert fromTraits.size() >= toTraits.size(); final boolean allowInfiniteCostConverters = CalciteSystemProperty.ALLOW_INFINITE_COST_CONVERTERS.value(); RelNode converted = rel; for (int i = 0; (converted != null) && (i < toTraits.size()); i++) { RelTrait fromTrait = converted.getTraitSet().getTrait(i); final RelTraitDef traitDef = fromTrait.getTraitDef(); RelTrait toTrait = toTraits.getTrait(i); if (toTrait == null) { continue; } assert traitDef == toTrait.getTraitDef(); if (fromTrait.equals(toTrait)) { continue; } rel = traitDef.convert( this, converted, toTrait, allowInfiniteCostConverters); if (rel != null) { assert rel.getTraitSet().getTrait(traitDef).satisfies(toTrait); if (rel != null) { register(rel, converted); } } if ((rel == null) && allowAbstractConverters) { RelTraitSet stepTraits = converted.getTraitSet().replace(toTrait); rel = getSubset(converted, stepTraits); } converted = rel; } if (converted != null) { assert converted.getTraitSet().satisfies(toTraits); } return converted; }

Target:
private RelNode changeTraitsUsingConverters( RelNode rel, RelTraitSet toTraits, boolean allowAbstractConverters) { final RelTraitSet fromTraits = rel.getTraitSet(); assert fromTraits.size() >= toTraits.size(); final boolean allowInfiniteCostConverters = CalciteSystemProperty.ALLOW_INFINITE_COST_CONVERTERS.value(); RelNode converted = rel; for (int i = 0; (converted != null) && (i < toTraits.size()); i++) { RelTrait fromTrait = converted.getTraitSet().getTrait(i); final RelTraitDef traitDef = fromTrait.getTraitDef(); RelTrait toTrait = toTraits.getTrait(i); if (toTrait == null) { continue; } assert traitDef == toTrait.getTraitDef(); if (fromTrait.equals(toTrait)) { continue; } rel = traitDef.convert( this, converted, toTrait, allowInfiniteCostConverters); if (rel != null) { assert rel.getTraitSet().getTrait(traitDef).satisfies(toTrait); register(rel, converted); } else if (allowAbstractConverters) { RelTraitSet stepTraits = converted.getTraitSet().replace(toTrait); rel = getSubset(converted, stepTraits); } converted = rel; } if (converted != null) { assert converted.getTraitSet().satisfies(toTraits); } return converted; }
Source:
public void testGetIOConfigurationSuccess() throws Exception { ATCommandResponse mockedResponse = Mockito.mock(ATCommandResponse.class); Mockito.when(mockedResponse.getResponseStatus()).thenReturn(ATCommandStatus.OK); Mockito.when(mockedResponse.getResponse()).thenReturn(new byte[]{5}); Mockito.doReturn(mockedResponse).when(xbeeDevice).sendATCommand((ATCommand)Mockito.any()); IOMode ioMode = null; try { ioMode = xbeeDevice.getIOConfiguration(IOLine.DIO0_AD0); } catch (InvalidOperatingModeException e) { fail("This exception shouldn't be thrown now."); } catch (XBeeException e) { fail("This exception shouldn't be thrown now."); } assertEquals(IOMode.DIGITAL_OUT_HIGH, ioMode); }

Target:
public void testGetIOConfigurationSuccess() throws Exception { ATCommandResponse mockedResponse = Mockito.mock(ATCommandResponse.class); Mockito.when(mockedResponse.getResponseStatus()).thenReturn(ATCommandStatus.OK); Mockito.when(mockedResponse.getResponse()).thenReturn(new byte[]{(byte)IOMode.DIGITAL_OUT_HIGH.getID()}); Mockito.doReturn(mockedResponse).when(xbeeDevice).sendATCommand((ATCommand)Mockito.any()); IOMode ioMode = xbeeDevice.getIOConfiguration(IOLine.DIO0_AD0); assertEquals(IOMode.DIGITAL_OUT_HIGH, ioMode); }
Source:
private String getJSON(List<Contentlet> cons, HttpServletRequest request, HttpServletResponse response, String render, User user) throws IOException, DotDataException{ JSONObject json = new JSONObject(); JSONArray jsonCons = new JSONArray(); for(Contentlet c : cons){ try { JSONObject jo = contentletToJSON(c, request, response, render, user); if (c.getStructure().getStructureType() == Structure.STRUCTURE_TYPE_HTMLPAGE){ jo.put(HTMLPageAssetAPI.URL_FIELD, this.contentHelper.getUrl(c)); } jsonCons.put(jo); } catch (Exception e) { Logger.warn(this.getClass(), "unable JSON contentlet " + c.getIdentifier()); Logger.debug(this.getClass(), "unable to find contentlet", e); } } try { json.put("contentlets", jsonCons); } catch (JSONException e) { Logger.warn(this.getClass(), "unable to create JSONObject"); Logger.debug(this.getClass(), "unable to create JSONObject", e); } return json.toString(); }

Target:
private String getJSON(List<Contentlet> cons, HttpServletRequest request, HttpServletResponse response, String render, User user) throws IOException, DotDataException{ JSONObject json = new JSONObject(); JSONArray jsonCons = new JSONArray(); for(Contentlet c : cons){ try { JSONObject jo = contentletToJSON(c, request, response, render, user); if (BaseContentType.HTMLPAGE.equals(c.getContentType().baseType())){ jo.put(HTMLPageAssetAPI.URL_FIELD, this.contentHelper.getUrl(c)); } jsonCons.put(jo); } catch (Exception e) { Logger.warn(this.getClass(), "unable JSON contentlet " + c.getIdentifier()); Logger.debug(this.getClass(), "unable to find contentlet", e); } } try { json.put("contentlets", jsonCons); } catch (JSONException e) { Logger.warn(this.getClass(), "unable to create JSONObject"); Logger.debug(this.getClass(), "unable to create JSONObject", e); } return json.toString(); }
Source:
protected ToStringBuilder appendAttributes(ToStringBuilder tsb) { return super.appendAttributes(tsb) .append("imageId", getImageId()) .append("force", isAllowActive()); }

Target:
protected ToStringBuilder appendAttributes(ToStringBuilder tsb) { return super.appendAttributes(tsb) .append("imageId", getImageId()) .append("allowActive", isAllowActive()); }
Source:
private void populateIncludeFields() { includeFields = new String[2][]; String[] portFields = includeFieldStr.split(";"); for (int i = 0; i < portFields.length; i++) { includeFields[i] = portFields[i].split(","); } }

Target:
private void populateIncludeFields() { String[] portFields = includeFieldStr.split(";"); assert (portFields.length == 2); leftStore.setIncludeFields(portFields[0].split(",")); rightStore.setIncludeFields(portFields[1].split(",")); }
Source:
private void verifyUapBtf(long btfId, String slotName, String bottomSlotName, AdsFandomObject fandomPage) { fandomPage.verifySlot(slotName); Assertion.assertEquals(btfId, fandomPage.getLineItemId(AdsFandomContent.INCONTENT_BOXAD)); fandomPage.verifySlot(bottomSlotName); Assertion.assertEquals(btfId, fandomPage.getLineItemId(AdsFandomContent.BOTTOM_LEADERBOARD)); Assertion.assertNull(fandomPage.getSlot(AdsFandomContent.BOTTOM_BOXAD)); }

Target:
private void verifyUapBtf(long btfId, String slotName, String bottomSlotName, AdsFandomObject fandomPage) { fandomPage.verifySlot(slotName); Assertion.assertEquals(btfId, fandomPage.getLineItemId(slotName)); fandomPage.verifySlot(bottomSlotName); Assertion.assertEquals(btfId, fandomPage.getLineItemId(bottomSlotName)); }
Source:
public boolean isExcludeFirstHeading() { return this.isExcludeFirstHeading; }

Target:
public boolean isExcludeFirstHeading() { return this.excludeFirstHeading; }
Source:
private void processResults(final Response response, final Map<String, PyPiLink> results) throws Exception { checkNotNull(response); checkNotNull(results); Payload payload = checkNotNull(response.getPayload()); try (InputStream in = payload.openInputStream()) { List<PyPiLink> links = PyPiIndexUtils.extractLinksFromIndex(in); for (PyPiLink link: links) { String file = link.getFile(); if (!results.containsKey(file)) { results.put(file, link); } } } }

Target:
private void processResults(final Response response, final Map<String, PyPiLink> results) throws IOException { checkNotNull(response); checkNotNull(results); Payload payload = checkNotNull(response.getPayload()); try (InputStream in = payload.openInputStream()) { List<PyPiLink> links = PyPiIndexUtils.extractLinksFromIndex(in); for (PyPiLink link : links) { String file = link.getFile(); if (!results.containsKey(file)) { results.put(file, link); } } } }
Source:
public void enqueue(final ByteBuffer b[]) { assert(b != null); for (ByteBuffer buf : b) { assert(!buf.isDirect()); if (buf.remaining() == 0) { throw new IllegalArgumentException("Attempted to queue a zero length buffer"); } } synchronized (this) { if (m_isShutdown) { return; } updateLastPendingWriteTimeAndQueueBackpressure(); for (final ByteBuffer buf : b) { if (m_isSSLConfigured) { Iterator<DeferredSerialization> dsIter = new SSLDeferredSerializationIterator(m_sslEngine, new Serializer() { @Override public ByteBuffer serialize() { return buf; } }); while (dsIter.hasNext()) { m_queuedWrites.offer(dsIter.next()); } } else { m_queuedWrites.offer(new DeferredSerialization() { @Override public ByteBuffer serialize(ByteBuffer outbuf) { if (outbuf.remaining() >= buf.remaining()) { outbuf.put(buf); return null; } else { ByteBuffer allocated = ByteBuffer.allocate(buf.remaining()); allocated.put(buf); allocated.flip(); return allocated; } } @Override public void cancel() @Override public int getSerializedSize() { return buf.remaining(); } }); } } m_port.setInterests( SelectionKey.OP_WRITE, 0); } }

Target:
public void enqueue(final ByteBuffer b[]) { assert(b != null); for (ByteBuffer buf : b) { assert(!buf.isDirect()); if (buf.remaining() == 0) { throw new IllegalArgumentException("Attempted to queue a zero length buffer"); } } synchronized (this) { if (m_isShutdown) { return; } updateLastPendingWriteTimeAndQueueBackpressure(); m_queuedWrites.offer(new DeferredSerialization() { @Override public void serialize(ByteBuffer outbuf) { for (ByteBuffer buf : b) { outbuf.put(buf); } } @Override public void cancel() @Override public int getSerializedSize() { int sum = 0; for (ByteBuffer buf : b) { buf.position(0); sum += buf.remaining(); } return sum; } }); m_port.setInterests( SelectionKey.OP_WRITE, 0); } }
Source:
private void dispatch() { Event ev; if (inDispatch) { return; } try { inDispatch = true; while ((ev = collector.peek()) != null) { for (EventHandler h : handlers) { if (log.isTraceEnabled()) { log.trace("Handling " + ev + " towards " + h); } if (AuditLogger.isAnyLoggingEnabled()) { AuditLogger.setRemoteAddress(h.getRemoteAddress()); } try { Events.dispatch(ev, h); } catch (ActiveMQSecurityException e) { log.warn(e.getMessage(), e); ErrorCondition error = new ErrorCondition(); error.setCondition(AmqpError.UNAUTHORIZED_ACCESS); error.setDescription(e.getMessage() == null ? e.getClass().getSimpleName() : e.getMessage()); connection.setCondition(error); connection.close(); } catch (Exception e) { log.warn(e.getMessage(), e); ErrorCondition error = new ErrorCondition(); error.setCondition(AmqpError.INTERNAL_ERROR); error.setDescription("Unrecoverable error: " + (e.getMessage() == null ? e.getClass().getSimpleName() : e.getMessage())); connection.setCondition(error); connection.close(); } } collector.pop(); } } finally { inDispatch = false; } flushBytes(); }

Target:
private void dispatch() { Event ev; if (inDispatch) { return; } try { inDispatch = true; if (AuditLogger.isAnyLoggingEnabled()) { for (EventHandler h : handlers) { AuditLogger.setRemoteAddress(h.getRemoteAddress()); } } while ((ev = collector.peek()) != null) { for (EventHandler h : handlers) { if (log.isTraceEnabled()) { log.trace("Handling " + ev + " towards " + h); } try { Events.dispatch(ev, h); } catch (ActiveMQSecurityException e) { log.warn(e.getMessage(), e); ErrorCondition error = new ErrorCondition(); error.setCondition(AmqpError.UNAUTHORIZED_ACCESS); error.setDescription(e.getMessage() == null ? e.getClass().getSimpleName() : e.getMessage()); connection.setCondition(error); connection.close(); } catch (Exception e) { log.warn(e.getMessage(), e); ErrorCondition error = new ErrorCondition(); error.setCondition(AmqpError.INTERNAL_ERROR); error.setDescription("Unrecoverable error: " + (e.getMessage() == null ? e.getClass().getSimpleName() : e.getMessage())); connection.setCondition(error); connection.close(); } } collector.pop(); } } finally { inDispatch = false; } flushBytes(); }
Source:
public void setPatientId(String patientIdentifierIso) { if (StringUtils.isNotBlank(patientIdentifierIso)) { String[] identifierValue = patientIdentifierIso.split("&"); CoreHelpUtils.updateDocumentBy(withDocument, wsService.getPatientBy(identifierValue[0].replace("^^^", ""), identifierValue[1])); } else { throw new RuntimeException("PatientIdentifier should not be empty."); } }

Target:
public void setPatientId(String patientIdentifierIso) { if (StringUtils.isNotBlank(patientIdentifierIso)) { String[] identifierValue = patientIdentifierIso.split("&"); CoreHelpUtils.updateDocumentBy(withDocument, wsService.getPatientBy(identifierValue[0].replace("^^^", ""), identifierValue[1])); } else { throw new ValidationException("PatientIdentifier should not be empty."); } }
Source:
public void readRelationships(HttpServletRequest request, HttpServletResponse response, @PathVariable("doi") String doi) throws IOException { new Transceiver() { @Override protected RelationshipSetView getData() throws IOException { ArticleIdentifier id = ArticleIdentifier.create(DoiEscaping.unescape(doi)); return relationshipSetViewFactory.getSetView(id); } @Override protected Calendar getLastModifiedDate() throws IOException { return null; } }.respond(request, response, entityGson); }

Target:
public void readRelationships(HttpServletRequest request, HttpServletResponse response, @PathVariable("doi") String doi) throws IOException { ArticleIdentifier id = ArticleIdentifier.create(DoiEscaping.unescape(doi)); Transceiver.serveUntimestampedView(() -> relationshipSetViewFactory.getSetView(id)) .respond(request, response, entityGson); }
Source:
public void testLoadJAASConfigOnce() { File loginConfigFile = createTestKrb5LoginConfigFile(); Configuration conf1 = null; Configuration conf2 = null; try { System.setProperty(GatewayConfig.KRB5_LOGIN_CONFIG, loginConfigFile.getAbsolutePath()); conf1 = AuthUtils.getKerberosJAASConfiguration(); conf2 = AuthUtils.getKerberosJAASConfiguration(); } catch (Throwable e) { e.printStackTrace(); fail(e.getMessage()); } finally { System.clearProperty(GatewayConfig.KRB5_LOGIN_CONFIG); } assertNotNull(conf1); assertNotNull(conf2); assertSame(conf1, conf2); }

Target:
public void testLoadJAASConfigOnce() { File loginConfigFile = createTestKrb5LoginConfigFile(); Configuration conf1 = null; Configuration conf2 = null; try { System.setProperty(GatewayConfig.KRB5_LOGIN_CONFIG, loginConfigFile.getAbsolutePath()); conf1 = AuthUtils.getKerberosJAASConfiguration(); conf2 = AuthUtils.getKerberosJAASConfiguration(); } catch (Throwable e) { fail(e.getMessage()); } finally { System.clearProperty(GatewayConfig.KRB5_LOGIN_CONFIG); } assertNotNull(conf1); assertNotNull(conf2); assertSame(conf1, conf2); }
Source:
public void start(Stage stage) throws Exception { Font.loadFont(this.getClass().getResourceAsStream("/ui/fonts/titillium.otf"), 20); HaskellCatalog catalog = new HaskellCatalog(); CustomUIPane tactilePane = new CustomUIPane(catalog); tactilePane.setBordersCollide(true); tactilePane.setMinWidth(3000); tactilePane.setMinHeight(3000); tactilePane.setMaxWidth(50000); tactilePane.setMaxHeight(50000); tactilePane.getStylesheets().add("/ui/style.css"); tactilePane.dragProcessingModeProperty().set(EventProcessingMode.HANDLER); ValueBlock valueBlock = new ValueBlock(tactilePane); DisplayBlock displayBlock = new DisplayBlock(tactilePane); tactilePane.getChildren().addAll(valueBlock, displayBlock); DebugParent debug = new DebugParent(tactilePane); debug.registerTactilePane(tactilePane); debug.setOverlayVisible(false); try { new GhciEvaluator().eval(""); } catch (GhciException e) { String msg = "It seems the Glasgow Haskell Compiler, GHC, is not " + "available. Executing programs will not be enabled. We " + "strongly recommend you install GHC, for example by " + "installing the Haskell Platform (haskell.org/platform)."; tactilePane.getChildren().add(new CustomAlert(tactilePane, msg)); e.printStackTrace(); } Scene scene = new Scene(debug); stage.setOnCloseRequest(event -> System.exit(0)); stage.setScene(scene); stage.show(); valueBlock.relocate(tactilePane.getWidth() / 2, tactilePane.getHeight() / 2); displayBlock.relocate(tactilePane.getWidth() / 2, tactilePane.getHeight() / 2 + 100); tactilePane.invalidateAll(); tactilePane.requestFocus(); }

Target:
public void start(Stage stage) throws Exception { Font.loadFont(this.getClass().getResourceAsStream("/ui/fonts/titillium.otf"), 20); HaskellCatalog catalog = new HaskellCatalog(); CustomUIPane tactilePane = new CustomUIPane(catalog); tactilePane.setBordersCollide(true); tactilePane.setMinWidth(3000); tactilePane.setMinHeight(3000); tactilePane.setMaxWidth(3000); tactilePane.setMaxHeight(3000); tactilePane.dragProcessingModeProperty().set(EventProcessingMode.HANDLER); ValueBlock valueBlock = new ValueBlock(tactilePane); DisplayBlock displayBlock = new DisplayBlock(tactilePane); tactilePane.getChildren().addAll(valueBlock, displayBlock); DebugParent debug = new DebugParent(tactilePane); debug.registerTactilePane(tactilePane); debug.setOverlayVisible(false); ZoomOverlay zoomOverlay = new ZoomOverlay(debug, tactilePane); try { new GhciEvaluator().eval(""); } catch (GhciException e) { String msg = "It seems the Glasgow Haskell Compiler, GHC, is not " + "available. Executing programs will not be enabled. We " + "strongly recommend you install GHC, for example by " + "installing the Haskell Platform (haskell.org/platform)."; tactilePane.getChildren().add(new CustomAlert(tactilePane, msg)); e.printStackTrace(); } Scene scene = new Scene(zoomOverlay); scene.getStylesheets().add("/ui/style.css"); stage.setOnCloseRequest(event -> System.exit(0)); stage.setScene(scene); stage.show(); valueBlock.relocate(tactilePane.getWidth() / 2, tactilePane.getHeight() / 2); displayBlock.relocate(tactilePane.getWidth() / 2, tactilePane.getHeight() / 2 + 100); tactilePane.invalidateAll(); tactilePane.requestFocus(); }
Source:
public void su_destroy_process_sigkill_after_graceful_timeout() throws Exception { LinuxProcessBuilder processBuilder = new LinuxProcessBuilder(new OSUser(username, password), null, proactiveHome); Process process = processBuilder .command("trap \"echo trapped signal\" SIGTERM; echo $$; while true; do sleep 1; done") .start(); process.destroy(); int exitCode = process.waitFor(); System.out.println("[SU_DESTROYPROCESS] process terminated with exit code " + exitCode); assertEquals(0, exitCode); }

Target:
public void su_destroy_process_sigkill_after_graceful_timeout() throws Exception { LinuxProcessBuilder processBuilder = new LinuxProcessBuilder(new OSUser(username, password), null, proactiveHome); System.setProperty("proactive.process.builder.cleanup.time.seconds", "1"); Process process = processBuilder .command("trap \"echo trapped signal\" SIGTERM; echo $$; while true; do sleep 1; done") .start(); process.destroy(); int exitCode = process.waitFor(); System.out.println("[SU_DESTROYPROCESS] process terminated with exit code " + exitCode); assertEquals(0, exitCode); System.clearProperty("proactive.process.builder.cleanup.time.seconds"); }
Source:
public void run() { log.debug("Subscribing consumer to {}", topic); consumer.subscribe(Collections.singleton(topic)); log.debug("Seeking to beginning"); consumer.seekToBeginning(consumer.assignment()); POLL_LOOP: while (running.get()) { log.trace("Polling"); ConsumerRecords<String, String> consumerRecords = consumer.poll(POLL_DURATION_MS); if (consumerRecords.isEmpty()) { log.trace("0 messages fetched on poll"); if (cacheReadyLatch.getCount() > 0) { log.debug("Cache warmed up"); cacheReadyLatch.countDown(); } } for (ConsumerRecord<String, String> consumerRecord: consumerRecords) { CacheAction action; try { action = CacheAction.valueOf(consumerRecord.value()); } catch (IllegalArgumentException iax) { log.error("Unexpected action value:\"{}\" received on [topic:{}, partition:{}, offset:{}]. Shutting down.", consumerRecord.key(), consumerRecord.topic(), consumerRecord.partition(), consumerRecord.offset()); setRunning(false); continue POLL_LOOP; } String messageId = consumerRecord.key(); if (action == CacheAction.add) { log.debug("Adding to cache messageId:{}", messageId); cache.put(messageId, messageId); } else if (action == CacheAction.remove) { log.debug("Removing from cache messageId:{}", messageId); cache.remove(messageId); } else if (action == CacheAction.clear) { cache.clear(); } else { log.error("No idea how to a record. Shutting down.", action); setRunning(false); continue POLL_LOOP; } } } log.debug("TopicPoller finished - triggering shutdown latch"); shutdownLatch.countDown(); }

Target:
public void run() { log.debug("Subscribing consumer to {}", topic); consumer.subscribe(Collections.singleton(topic)); log.debug("Seeking to beginning"); consumer.seekToBeginning(consumer.assignment()); POLL_LOOP: while (running.get()) { log.trace("Polling"); ConsumerRecords<String, String> consumerRecords = consumer.poll(pollDurationMs); if (consumerRecords.isEmpty()) { log.trace("0 messages fetched on poll"); if (cacheReadyLatch.getCount() > 0) { log.debug("Cache warmed up"); cacheReadyLatch.countDown(); } } for (ConsumerRecord<String, String> consumerRecord: consumerRecords) { CacheAction action; try { action = CacheAction.valueOf(consumerRecord.value()); } catch (IllegalArgumentException iax) { log.error("Unexpected action value:\"{}\" received on [topic:{}, partition:{}, offset:{}]. Shutting down.", consumerRecord.key(), consumerRecord.topic(), consumerRecord.partition(), consumerRecord.offset()); setRunning(false); continue POLL_LOOP; } String messageId = consumerRecord.key(); if (action == CacheAction.add) { log.debug("Adding to cache messageId:{}", messageId); cache.put(messageId, messageId); } else if (action == CacheAction.remove) { log.debug("Removing from cache messageId:{}", messageId); cache.remove(messageId); } else if (action == CacheAction.clear) { cache.clear(); } else { log.warn("No idea how to a record. Shutting down.", action); setRunning(false); continue POLL_LOOP; } } } log.debug("TopicPoller finished - triggering shutdown latch"); shutdownLatch.countDown(); }
Source:
public ChronoPeriod until(final ChronoLocalDate endDateExclusive) { InternationalFixedDate end = InternationalFixedDate.from(endDateExclusive); int years = Math.toIntExact(yearsUntil(end)); InternationalFixedDate sameYearEnd = (InternationalFixedDate) end.plusYears(years); int months = (int) monthsUntil(sameYearEnd); int days = (int) daysUntil(sameYearEnd.plusMonths(months)); return getChronology().period(years, months, days); }

Target:
public ChronoPeriod until(final ChronoLocalDate endDateExclusive) { InternationalFixedDate end = InternationalFixedDate.from(endDateExclusive); int years = Math.toIntExact(yearsUntil(end)); InternationalFixedDate sameYearEnd = plusYears(years); int months = (int) sameYearEnd.monthsUntil(end); int days = (int) sameYearEnd.plusMonths(months).daysUntil(end); if (days == DAYS_IN_MONTH) { days = 0; months += 1; } if (days == -DAYS_IN_MONTH) { days = 0; months -= 1; } return getChronology().period(years, months, days); }
Source:
public void testExchange() { BigInteger primeA = BigInteger.valueOf(23); BigInteger primeB = BigInteger.valueOf(5); BigInteger alicePrivateKey = diffieHellman.privateKey(primeA); BigInteger bobPrivateKey = diffieHellman.privateKey(primeB); BigInteger publicKeyA = diffieHellman.publicKey(primeA, primeB, alicePrivateKey); BigInteger publicKeyB = diffieHellman.publicKey(primeA, primeB, bobPrivateKey); BigInteger secretA = diffieHellman.secret(primeA, publicKeyB, alicePrivateKey); BigInteger secretB = diffieHellman.secret(primeA, publicKeyA, bobPrivateKey); assertEquals(secretA, secretB); }

Target:
public void testExchange() { BigInteger primeA = BigInteger.valueOf(23); BigInteger primeB = BigInteger.valueOf(5); BigInteger alicePrivateKey = diffieHellman.privateKey(primeA); BigInteger bobPrivateKey = diffieHellman.privateKey(primeB); BigInteger alicePublicKey = diffieHellman.publicKey(primeA, primeB, alicePrivateKey); BigInteger bobPublicKey = diffieHellman.publicKey(primeA, primeB, bobPrivateKey); BigInteger secretA = diffieHellman.secret(primeA, bobPublicKey, alicePrivateKey); BigInteger secretB = diffieHellman.secret(primeA, alicePublicKey, bobPrivateKey); assertEquals(secretA, secretB); }
Source:
public int parseArguments(Parameters params) throws CmdLineException { String param = params.getParameter(0); Result v = fromString(param.replace('-', '_')); setter.addValue(v); return 1; }

Target:
public int parseArguments(Parameters params) throws CmdLineException { String param = params.getParameter(0); Result v = fromString(param.replace('-', '_')); if (v== FAILURE) { throw new CmdLineException(owner,"No such status '"+param+"'. Did you mean "+ EditDistance.findNearest(param.replace('-', '_').toUpperCase(), getNames())); } setter.addValue(v); return 1; }
Source:
private void mockSSHClient() { try { doNothing().when(sshclient).connect(); doNothing().when(sshclient).authenticate(); } catch(Exception e) }

Target:
private void mockSSHClient() { try { doNothing().when(sshclient).connect(); doNothing().when(sshclient).authenticate(); } catch (Exception e) { throw new RuntimeException(e); } }
Source:
public NonDdlBatch setInferPartitioning(boolean value) { value = m_batchToDecorate.getTaskCount() == 1 && value; if (m_inferPartitioning ^ value) { m_inferPartitioning = value; updateStatementPartitioning(); } return this; }

Target:
public NonDdlBatch setInferPartitioning(boolean value) { value = m_batchToDecorate.getTaskCount() == 1 && value; if (m_inferPartitioning != value) { m_inferPartitioning = value; updateStatementPartitioning(); } return this; }
Source:
public final void initialize(boolean initializeAsync) { assertNeverCalledInitialize(); if (!initializeAsync) { tryInitializeInternal(); return; } try { tryInitializeInternal(); } catch (Throwable throwable) { log.info("Failed to initialize in the first attempt, will initialize asynchronously.", SafeArg.of("className", getInitializingClassName()), throwable); cleanUpOnInitFailure(); scheduleInitialization(); } }

Target:
public final void initialize(boolean initializeAsync) { assertNeverCalledInitialize(); initializationStartTime = System.currentTimeMillis(); if (!initializeAsync) { tryInitializeInternal(); return; } tryInitializationLoop(); }
Source:
public String getModelHosts() throws PermissionRestException { RMStateFull state = orThrowRpe(RMStateCaching.getRMStateFull()); return "PA:LIST(," + state.getNodesEvents() .stream() .map(event -> event.getHostName()) .distinct() .collect(Collectors.joining(",")) + ")"; }

Target:
public String getModelHosts() throws PermissionRestException { RMStateFull state = orThrowRpe(RMStateCaching.getRMStateFull()); return String.format("PA:LIST(,%s)", state.getNodesEvents() .stream() .map(RMNodeEvent::getHostName) .distinct() .collect(Collectors.joining(","))); }
Source:
public void clickFbWindowTriggerButton() { waitForElementByElement(loginFbButton); try { Thread.sleep(2000); } catch (InterruptedException e) { e.printStackTrace(); } clickAndWait(loginFbButton); try { Thread.sleep(2000); } catch (InterruptedException e) { e.printStackTrace(); } PageObjectLogging.log("clickFbWindowTriggerButton", "facebook button clicked in login drop-down", true, driver); }

Target:
public void clickFbWindowTriggerButton() { waitForElementByElement(loginFbButton); try { Thread.sleep(2000); } catch (InterruptedException e) { e.printStackTrace(); } scrollAndClick(loginFbButton); try { Thread.sleep(2000); } catch (InterruptedException e) { e.printStackTrace(); } PageObjectLogging.log("clickFbWindowTriggerButton", "facebook button clicked in login drop-down", true, driver); }
Source:
public void widgetSelected(@Nullable SelectionEvent e) { VirtualTableLine selectedLine = (VirtualTableLine) NonNullUtils.checkNotNull(e).item.getData(); ITmfTimestamp start = TmfTimestamp.fromNanos(Long.parseLong(selectedLine.getLine().get(0))); ITmfTimestamp end = TmfTimestamp.fromNanos(Long.parseLong(selectedLine.getLine().get(1))); TmfSignalManager.dispatchSignal(new TmfSelectionRangeUpdatedSignal(AbstractSegmentStoreTableViewer.this, start, end, fTrace)); }

Target:
public void widgetSelected(@Nullable SelectionEvent e) { Object line = NonNullUtils.checkNotNull(e).item.getData(); if (!(line instanceof SegmentStoreTableLine)) { return; } SegmentStoreTableLine selectedLine = (SegmentStoreTableLine) line; ITmfTimestamp start = TmfTimestamp.fromNanos(selectedLine.getStartTime()); ITmfTimestamp end = TmfTimestamp.fromNanos(selectedLine.getEndTime()); TmfSignalManager.dispatchSignal(new TmfSelectionRangeUpdatedSignal(AbstractSegmentStoreTableViewer.this, start, end, fTrace)); }