auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code><START> public void endWithFailure() { <END> }</code><technical_language>audit log ? setSucceeded(true) added IIRC</technical_language>

Target:
public void endWithFailure() { revertTask(); enclosingCommand.getReturnValue().setSucceeded(true); }
Source:
<code>public synchronized void dispose() { if (masterMap != null) { masterMap.removeMapChangeListener(masterMapListener); masterMap.removeStaleListener(masterStaleListener); } if (keyDetailMap != null) { for <START> (Iterator<IObservableValue<E>> <END> iter = keyDetailMap.values() .iterator(); iter.hasNext();) { IObservableValue<E> detailValue = iter.next(); detailValue.dispose(); } keyDetailMap.clear(); } masterMap = null; observableValueFactory = null; detailValueType = null; keyDetailMap = null; masterStaleListener = null; detailStaleListener = null; staleDetailObservables = null; super.dispose(); }</code><technical_language>Better: IObservableValue<E> detailValue : keyDetailMap.values()</technical_language>

Target:
public synchronized void dispose() { if (masterMap != null) { masterMap.removeMapChangeListener(masterMapListener); masterMap.removeStaleListener(masterStaleListener); } if (keyDetailMap != null) { for (IObservableValue<E> detailValue : keyDetailMap.values()) { detailValue.dispose(); } keyDetailMap.clear(); } masterMap = null; observableValueFactory = null; detailValueType = null; keyDetailMap = null; masterStaleListener = null; detailStaleListener = null; staleDetailObservables = null; super.dispose(); }
Source:
<code>public void saveEncounter_shouldCascadeSaveToContainedConditions() { Encounter encounter = buildEncounter(); Condition pregnancy = new Condition(); CodedOrFreeText freeTextForPregnancy = new CodedOrFreeText(); freeTextForPregnancy.setNonCoded("Pregnancy"); pregnancy.setCondition(freeTextForPregnancy); pregnancy.setPatient(encounter.getPatient()); <START> encounter.addCondition(pregnancy); <END> Condition edema = new Condition(); CodedOrFreeText freeTextForEdema = new CodedOrFreeText(); freeTextForEdema.setNonCoded("Edema"); edema.setCondition(freeTextForEdema); edema.setPatient(encounter.getPatient()); encounter.addCondition(edema); Context.getEncounterService().saveEncounter(encounter); Object[] conditionsArray = encounter.getConditions().toArray(); pregnancy = (Condition) conditionsArray[0]; edema = (Condition) conditionsArray[1]; assertEquals(2, conditionsArray.length); assertNotNull(pregnancy.getId()); assertEquals("Pregnancy", pregnancy.getCondition().getNonCoded()); assertNotNull(edema.getId()); assertEquals("Edema", edema.getCondition().getNonCoded()); }</code><technical_language>This is part of replay</technical_language>

Target:
public void saveEncounter_shouldCascadeSaveToContainedConditions() { Encounter encounter = buildEncounter(); Condition pregnancy = new Condition(); CodedOrFreeText freeTextForPregnancy = new CodedOrFreeText(); freeTextForPregnancy.setNonCoded("Pregnancy"); pregnancy.setCondition(freeTextForPregnancy); pregnancy.setPatient(encounter.getPatient()); Condition edema = new Condition(); CodedOrFreeText freeTextForEdema = new CodedOrFreeText(); freeTextForEdema.setNonCoded("Edema"); edema.setCondition(freeTextForEdema); edema.setPatient(encounter.getPatient()); encounter.addCondition(pregnancy); encounter.addCondition(edema); Context.getEncounterService().saveEncounter(encounter); Object[] conditionsArray = encounter.getConditions().toArray(); pregnancy = (Condition) conditionsArray[0]; edema = (Condition) conditionsArray[1]; assertEquals(2, conditionsArray.length); assertNotNull(pregnancy.getId()); assertEquals("Pregnancy", pregnancy.getCondition().getNonCoded()); assertNotNull(edema.getId()); assertEquals("Edema", edema.getCondition().getNonCoded()); }
Source:
<code>public void testMerge() { final List<String> first = new ArrayList<String>(); <START> first.add(null); <END> final List<String> second = new ArrayList<String>(); second.add("a/b/c"); final List<String> actual = Utils.merge(first, second); final List<String> arrayList = new ArrayList<String>(); arrayList.add(null); arrayList.add("a/b/c"); assertEquals(arrayList, actual); }</code><technical_language>is adding null</technical_language>

Target:
public void testMerge() { assertEquals( Arrays.asList("foo", "bar"), Utils.merge(Arrays.asList("foo"), Arrays.asList("bar")) ); }
Source:
<code>public int hashCode() { if (hashCode == null) { <START> hashCode = Objects.hash(lockMap, lockTimeout, lockGroupBehavior, blockingMode, blockingDuration, versionId); <END> } return hashCode; }</code><technical_language>I a bit worried this lead fun times (if deserialize version a of calculating hash code shove a set fun times), safe create this serialization proxy, meaning hash codes computed current JVM. appreciate a double-check though</technical_language>

Target:
public int hashCode() { int tempHashCode = hashCode; if (tempHashCode == 0) { tempHashCode = Objects.hash(lockMap, lockTimeout, lockGroupBehavior, blockingMode, blockingDuration, versionId); hashCode = tempHashCode; } return tempHashCode; }
Source:
<code>public static NamedQueueEvent getEventByOrdinal(int value){ switch (value) { case 0: { return SLOW_LOG; } case 1: { return BALANCE_DECISION; } default: { <START> throw new IllegalArgumentException("Failed to retrieve NamedQueue Event"); <END> } } }</code><technical_language>"NamedQueue event ordinal %d defined"</technical_language>

Target:
public static NamedQueueEvent getEventByOrdinal(int value){ switch (value) { case 0: { return SLOW_LOG; } case 1: { return BALANCE_DECISION; } default: { throw new IllegalArgumentException( "NamedQueue event with ordinal " + value + " not defined"); } } }
Source:
<code>private File addToWorkDir(String path, String content) throws IOException { File f = new File(db.getWorkDir(), path); FileOutputStream fos = new FileOutputStream(f); try { <START> fos.write(content.getBytes()); <END> return f; } finally { fos.close(); } }</code><technical_language>Please platform encoding in tests</technical_language>

Target:
private File addToWorkDir(String path, String content) throws IOException { File f = new File(db.getWorkDir(), path); FileOutputStream fos = new FileOutputStream(f); try { fos.write(content.getBytes(Constants.CHARACTER_ENCODING)); return f; } finally { fos.close(); } }
Source:
<code>private String getInstituteForStudent( CourseStudent student, List<Instructor> allInstructors, List<Account> allAccounts) { if (courseIdToInstituteMap.containsKey(student.getCourseId())) { return courseIdToInstituteMap.get(student.getCourseId()); } List<Instructor> instructorList = new ArrayList<>(); for (Instructor instructor : allInstructors) { if (instructor.getCourseId().equals(student.getCourseId())) { instructorList.add(instructor); } <START> } <END> String institute = getInstituteForInstructors(instructorList, allAccounts); courseIdToInstituteMap.put(student.getCourseId(), institute); return institute; }</code><technical_language>extract method? e.g. List<Instructor> instructorList = getInstructorsOfCourse(allInstructors, student.getCourseId());</technical_language>

Target:
private String getInstituteForStudent( CourseStudent student, List<Instructor> allInstructors, List<Account> allAccounts) { if (courseIdToInstituteMap.containsKey(student.getCourseId())) { return courseIdToInstituteMap.get(student.getCourseId()); } List<Instructor> instructorList = getInstructorsOfCourse(allInstructors, student.getCourseId()); String institute = getInstituteForInstructors(instructorList, allAccounts); courseIdToInstituteMap.put(student.getCourseId(), institute); return institute; }
Source:
<code>public Config getSystem() { <START> return new EmptyConfig(); <END> }</code><technical_language>EmptyConfig.INSTANCE</technical_language>

Target:
public Config getSystem() { return EmptyConfig.INSTANCE; }
Source:
<code>public void testWhenNextMarkerAbsentDoesntAdvance() { GeneratedHttpRequest request = args(ImmutableList.of()); TestArgs converter = new TestArgs(request) { @Override protected Function<Object, IterableWithMarker<String>> markerToNextForArgs(List<Object> args) { <START> fail(); <END> return null; } }; assertEquals(converter.apply(IterableWithMarkers.from(ImmutableSet.of("foo", "bar"))).concat().toSet(), ImmutableSet.of("foo", "bar")); }</code><technical_language>Add a message fail(...)</technical_language>

Target:
public void testWhenNextMarkerAbsentDoesntAdvance() { GeneratedHttpRequest request = args(ImmutableList.of()); TestArgs converter = new TestArgs(request) { @Override protected Function<Object, IterableWithMarker<String>> markerToNextForArgs(List<Object> args) { fail("The Iterable should not advance"); return null; } }; assertEquals(converter.apply(IterableWithMarkers.from(ImmutableSet.of("foo", "bar"))).concat().toSet(), ImmutableSet.of("foo", "bar")); }
Source:
<code>private String addRecordTranslator () { String translatorId = "avroKafkaSpoutTranslator" + UUID_FOR_COMPONENTS; String translatorClassname = "com.hortonworks.streamline.streams.runtime.storm.spout.AvroKafkaSpoutTranslator"; List<Object> constructorArgs = new ArrayList<>(); constructorArgs.addAll(getConstructorArgsYaml(new String[]{TopologyLayoutConstants.JSON_KEY_OUTPUT_STREAM_ID, TopologyLayoutConstants .JSON_KEY_TOPIC})); constructorArgs.add(kafkaSource != null ? kafkaSource.getId() : ""); constructorArgs.add(conf.get(TopologyLayoutConstants.SCHEMA_REGISTRY_URL)); Object readerSchemaVersionObj = conf.get("readerSchemaVersion"); if (readerSchemaVersionObj != null) { String readerSchemaVersion = (String) readerSchemaVersionObj; <START> if (!readerSchemaVersion.isEmpty()) { <END> constructorArgs.add(Integer.parseInt(readerSchemaVersion)); } } addToComponents(createComponent(translatorId, translatorClassname, null, constructorArgs, null)); return translatorId; }</code><technical_language>nit: This simplified multiple ifs String readerSchemaVersion = (String) conf.get("readerSchemaVersion"); if(readerSchemaVersion != null && !readerSchemaVersion.isEMpty()) { constructorArgs.add(Integer.parseInt(readerSchemaVersion)) }</technical_language>

Target:
private String addRecordTranslator () { String translatorId = "avroKafkaSpoutTranslator" + UUID_FOR_COMPONENTS; String translatorClassname = "com.hortonworks.streamline.streams.runtime.storm.spout.AvroKafkaSpoutTranslator"; List<Object> constructorArgs = new ArrayList<>(); constructorArgs.addAll(getConstructorArgsYaml(new String[]{TopologyLayoutConstants.JSON_KEY_OUTPUT_STREAM_ID, TopologyLayoutConstants .JSON_KEY_TOPIC})); constructorArgs.add(kafkaSource != null ? kafkaSource.getId() : ""); constructorArgs.add(conf.get(TopologyLayoutConstants.SCHEMA_REGISTRY_URL)); String readerSchemaVersion = (String) conf.get("readerSchemaVersion"); if(readerSchemaVersion != null && !readerSchemaVersion.isEMpty()) { constructorArgs.add(Integer.parseInt(readerSchemaVersion)) } addToComponents(createComponent(translatorId, translatorClassname, null, constructorArgs, null)); return translatorId; }
Source:
<code>protected void checkTextConversion(String textContent) { assertTrue(!textContent.isEmpty()); <START> String[] cells = textContent.trim().split(separator); <END> assertTrue(cells.length == 2); assertArrayEquals(cells, new String[] { "hello", "world" }); }</code><technical_language>" " here, need for a constant</technical_language>

Target:
protected void checkTextConversion(String textContent) { String[] cells = textContent.trim().split(" "); assertTrue(cells.length == 2); assertArrayEquals(cells, new String[] { "hello", "world" }); }
Source:
<code>public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { View view = super.onCreateView(inflater, container, savedInstanceState); if (mSearchRecentsListView != null) { mSearchRecentsListView.setAdapter(mRecentSearchesAdapter); if (mSearchQuery == null) { mSearchRecentsListView.setVisibility(View.VISIBLE); mSearchRecentsListView.setOnItemClickListener(new AdapterView.OnItemClickListener() { @Override public void onItemClick(AdapterView<?> parent, View view, int position, long id) { String query = mRecentSearches.get(position); Activity activity = getActivity(); if (activity instanceof BoxBrowseActivity) { <START> ((BoxBrowseActivity)activity).setSearchQuery(query); <END> } } }); } } mSearchFiltersHeader = view.findViewById(R.id.filterResultsHeader); mSearchFiltersHeader.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { startFilterActivity(); } }); setupSearchFiltersHeader(); return view; }</code><technical_language>setSearchQuery sounds a method interface, browse activity</technical_language>

Target:
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { View view = super.onCreateView(inflater, container, savedInstanceState); mSearchFiltersHeader = view.findViewById(R.id.filterResultsHeader); mSearchFiltersHeader.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { startFilterActivity(); } }); setupSearchFiltersHeader(); return view; }
Source:
<code>protected void scrollToElement(WebElement element) { try { ((JavascriptExecutor) driver).executeScript( "var x = $(arguments[0]); window.scroll(0,parseInt(x.offset().top - 100));", element); <START> } catch (WebDriverException e) { <END> if (e.getMessage().contains(XSSContent.NO_JQUERY_ERROR)) { PageObjectLogging.log("JSError", "JQuery is not defined", false); } } }</code><technical_language>![MAJOR](<LINK_0> log rethrow this exception. [![rule](<LINK_1>](<LINK_2></technical_language>

Target:
protected void scrollToElement(WebElement element) { try { ((JavascriptExecutor) driver).executeScript( "var x = $(arguments[0]); " + "window.scroll(0,parseInt(x.offset().top - 100));", element ); } catch (WebDriverException e) { if (e.getMessage().contains(XSSContent.NO_JQUERY_ERROR)) { PageObjectLogging.log("JSError", "JQuery is not defined", false); } } }
Source:
<code>protected List<SQLTranslation> fetchAllTranslations(@Nonnull Mapping field) { return oma.select(SQLTranslation.class) .eq(Translation.TRANSLATION_DATA.inner(TranslationData.OWNER), owner.getUniqueName()) .eq(Translation.TRANSLATION_DATA.inner(TranslationData.FIELD), field.getName()) <START> .limit(supportedLanguages.size()) <END> .queryList(); }</code><technical_language>skip - this silently suppress a bug want surface here...</technical_language>

Target:
protected List<SQLTranslation> fetchAllTranslations(@Nonnull Mapping field) { return oma.select(SQLTranslation.class) .eq(Translation.TRANSLATION_DATA.inner(TranslationData.OWNER), owner.getUniqueName()) .eq(Translation.TRANSLATION_DATA.inner(TranslationData.FIELD), field.getName()) .queryList(); }
Source:
<code><START> private void match(BuiltinList builtinList, BuiltinList pattern) { <END> addMatchingTask( builtinList.toLabelRepresentation(termContext), pattern.toLabelRepresentation(termContext)); }</code><technical_language>do convert builtin lists label representation in order match them? for convenience</technical_language>

Target:
private void match(BuiltinList builtinList, BuiltinList pattern) { addMatchingTask( builtinList.toK(termContext), pattern.toK(termContext)); }
Source:
<code>private boolean shouldAbortOnClientInactivityTimeout(ImageTransfer entity, long ts, Integer idleTimeFromTicket) { int <START> inactivityTimeout = <END> entity.getClientInactivityTimeout() != null ? entity.getClientInactivityTimeout() : getTransferImageClientInactivityTimeoutInSeconds(); boolean timeoutExceeded = idleTimeFromTicket != null ? idleTimeFromTicket > inactivityTimeout : ts > (entity.getLastUpdated().getTime() / 1000) + inactivityTimeout; return inactivityTimeout > 0 && timeoutExceeded && !entity.getActive(); }</code><technical_language>entity</technical_language>

Target:
private boolean shouldAbortOnClientInactivityTimeout(ImageTransfer entity, long ts, Integer idleTimeFromTicket) { int inactivityTimeout = entity.getClientInactivityTimeout(); boolean timeoutExceeded = idleTimeFromTicket != null ? idleTimeFromTicket > inactivityTimeout : ts > (entity.getLastUpdated().getTime() / 1000) + inactivityTimeout; return inactivityTimeout > 0 && timeoutExceeded && !entity.getActive(); }
Source:
<code>public String toString() { return "ClientConfiguration{" + ", cacheManagerTtl=" + cacheManagerTtl + ", cacheManagerTti=" + cacheManagerTti + ", cacheManagerCaches=" + cacheManagerCaches + ", baseUrl='" + getBaseUrl() + '\'' + ", authorizationMode='" + getAuthorizationMode() + ", clientId='" + getClientId() + ", scopes='" + getScopes() + <START> ", privateKey=" + getPrivateKey() + <END> ", connectionTimeout=" + getConnectionTimeout() + ", requestAuthenticator=" + getRequestAuthenticator() + ", retryMaxElapsed=" + getRetryMaxElapsed() + ", retryMaxAttempts=" + getRetryMaxAttempts() + ", proxy=" + getProxy() + '}'; }</code><technical_language>this secret, if support armored strings, do want print it. ClientConfiguration class properties for File, for parsed string, logging file name issue, PEM string</technical_language>

Target:
public String toString() { return "ClientConfiguration {cacheManagerTtl=" + cacheManagerTtl + ", cacheManagerTti=" + cacheManagerTti + ", cacheManagerCaches=" + cacheManagerCaches + ", baseUrl='" + getBaseUrl() + '\'' + ", authorizationMode=" + getAuthorizationMode() + ", clientId=" + getClientId() + ", scopes=" + getScopes() + ", privateKey=" + ((getPrivateKey() != null) ? "xxxxx" : null) + ", connectionTimeout=" + getConnectionTimeout() + ", requestAuthenticator=" + getRequestAuthenticator() + ", retryMaxElapsed=" + getRetryMaxElapsed() + ", retryMaxAttempts=" + getRetryMaxAttempts() + ", proxy=" + getProxy() + " }"; }
Source:
<code>public void testBulkWrites() throws Exception { CountDownLatch countDownLatch = new CountDownLatch(20); loaderWriter.setLatch(countDownLatch); for(int i=0 ; i<10; i++) testCache.put("test"+i, "test"+i); Map<String, String> entries = new HashMap<String, String>(10); Set<String> keys = new HashSet<String>(10); for(int i=10 ; i<19; i++) { entries.put("test"+i, "test"+i); keys.add("test"+i); } <START> Thread.sleep(1000); <END> entries.put("test20", "test20"); keys.add("test20"); testCache.putAll(entries); countDownLatch.await(5, TimeUnit.SECONDS); assertThat(loaderWriter.getData().size(), is(20)); CountDownLatch countDownLatch1 = new CountDownLatch(10); loaderWriter.setLatch(countDownLatch1); testCache.removeAll(keys); countDownLatch1.await(5, TimeUnit.SECONDS); assertThat(loaderWriter.getData().size(), is(10)); }</code><technical_language>Thread.sleep()</technical_language>

Target:
public void testBulkWrites() throws Exception { CountDownLatch countDownLatch = new CountDownLatch(20); loaderWriter.setLatch(countDownLatch); for(int i=0 ; i<10; i++) testCache.put("test"+i, "test"+i); Map<String, String> entries = new HashMap<String, String>(10); Set<String> keys = new HashSet<String>(10); for(int i=10 ; i<20; i++) { entries.put("test"+i, "test"+i); keys.add("test"+i); } testCache.putAll(entries); countDownLatch.await(5, TimeUnit.SECONDS); assertThat(loaderWriter.getData().size(), is(20)); CountDownLatch countDownLatch1 = new CountDownLatch(10); loaderWriter.setLatch(countDownLatch1); testCache.removeAll(keys); countDownLatch1.await(5, TimeUnit.SECONDS); assertThat(loaderWriter.getData().size(), is(10)); }
Source:
<code><START> public Collection<Config> getAllConfigs() { <END> return GlobalConfigFiles.get().getConfigs(); }</code><technical_language>this API some compatible again, is semantically wrong. GlobalConfigFiles.get().getConfigs(); returns global configuration files in folders. I this is a good idea. applies other methods..</technical_language>

Target:
public Collection<Config> getAllConfigs() { return GlobalConfigFiles.get().getConfigs(getClass()); }
Source:
<code>private boolean isCurrentFilter(String filter) { if (TextUtils.isEmpty(filter) && TextUtils.isEmpty(mCurrentFilter)) { return true; } <START> return filter.equalsIgnoreCase(mCurrentFilter); <END> }</code><technical_language>filter null this line is reached - check null</technical_language>

Target:
private boolean isCurrentFilter(String filter) { if (TextUtils.isEmpty(filter) && TextUtils.isEmpty(mCurrentFilter)) { return true; } return filter != null && filter.equalsIgnoreCase(mCurrentFilter); }
Source:
<code>public void synchronizeMailboxSynchronous_withAccountPolicySetToExpungeOnPoll_shouldExpungeRemoteFolder() throws Exception { messageCountInRemoteFolder(1); when(account.getExpungePolicy()).thenReturn(Account.Expunge.EXPUNGE_ON_POLL); configureRemoteStoreWithFolder(); controller.synchronizeMailboxSynchronous(account, FOLDER_NAME, listener, null); <START> verify(remoteFolder).expunge(anySet()); <END> }</code><technical_language>anySet() is pretty weak. verify pass in right IDs</technical_language>

Target:
public void synchronizeMailboxSynchronous_withAccountPolicySetToExpungeOnPoll_shouldExpungeRemoteFolder() throws Exception { messageCountInRemoteFolder(1); when(account.getExpungePolicy()).thenReturn(Account.Expunge.EXPUNGE_ON_POLL); configureRemoteStoreWithFolder(); controller.synchronizeMailboxSynchronous(account, FOLDER_NAME, listener, null); verify(remoteFolder).expunge(); }
Source:
<code>public void scan(File dir, FileVisitor visitor) throws IOException { <START> if (Util.fixEmpty(this.includes) == null && this.excludes == null) { <END> (new DirScanner.Full()).scan(dir, visitor); } else { FileSet fs = Util.createFileSet(dir, this.includes, this.excludes); fs.setDefaultexcludes(this.useDefaultExcludes); fs.setFollowSymlinks(followSymlinks); if (dir.exists()) { DirectoryScanner ds = fs.getDirectoryScanner(new Project()); String[] var5 = (String [])ArrayUtils.addAll(ds.getIncludedFiles(), Stream.of(ds.getNotFollowedSymlinks()) .map(s -> dir.toPath().relativize(Paths.get(s)).toString()) .toArray() ); for (String f : var5) { File file = new File(dir, f); this.scanSingle(file, f, visitor); } } } }</code><technical_language>this or? excludes empty</technical_language>

Target:
public void scan(File dir, FileVisitor visitor) throws IOException { FileSet fileSet = Util.createFileSet(dir, Optional.ofNullable(Util.fixEmpty(this.includes)).orElse("**/*"), Optional.ofNullable(Util.fixEmpty(this.excludes)).orElse("")); fileSet.setDefaultexcludes(this.useDefaultExcludes); fileSet.setFollowSymlinks(followSymlinks); if (dir.exists()) { DirectoryScanner dirScanner = fileSet.getDirectoryScanner(new Project()); String[] var5 = (String[]) ArrayUtils.addAll(dirScanner.getIncludedFiles(), Stream.of(dirScanner.getNotFollowedSymlinks()) .map(s -> dir.toPath().relativize(Paths.get(s)).toString()) .toArray() ); int var6 = var5.length; for (int var7 = 0; var7 < var6; ++var7) { String f = var5[var7]; File file = new File(dir, f); this.scanSingle(file, f, visitor); } } }
Source:
<code>public void setUp() { when(model.getProgress()).thenReturn(null, progressModel); Config.setConfigUtils(mock(IConfigUtilsInterface.class)); <START> when(Config.getConfigUtils().getValue(ConfigValues.CoCoCommandLifeInMinutes, ConfigCommon.defaultConfigurationVersion)).thenReturn(300); <END> }</code><technical_language>formatter</technical_language>

Target:
public void setUp() { when(model.getProgress()).thenReturn(null, progressModel); }
Source:
<code>public boolean checkMasterPassword(char[] passwd) { try { if (!this.masterPasswordProviderHelper .loadConfig(this.masterPasswordConfig.getProviderName()) <START> .isCanLogin()) { <END> return false; } } catch (IOException e) { throw new RuntimeException("Unable to load master password provider config", e); } GeoServerDigestPasswordEncoder pwEncoder = loadPasswordEncoder(GeoServerDigestPasswordEncoder.class); if (masterPasswdDigest == null) { synchronized (this) { if (masterPasswdDigest == null) { try { masterPasswdDigest = loadMasterPasswordDigest(); } catch (IOException e) { throw new RuntimeException("Unable to create master password digest", e); } } } } return pwEncoder.isPasswordValid(masterPasswdDigest, passwd, null); }</code><technical_language>isCanLogin sounds ugly... call "isLoginEnabled" maybe</technical_language>

Target:
public boolean checkMasterPassword(char[] passwd) { try { if (!this.masterPasswordProviderHelper .loadConfig(this.masterPasswordConfig.getProviderName()) .isLoginEnabled()) { return false; } } catch (IOException e) { throw new RuntimeException("Unable to load master password provider config", e); } GeoServerDigestPasswordEncoder pwEncoder = loadPasswordEncoder(GeoServerDigestPasswordEncoder.class); if (masterPasswdDigest == null) { synchronized (this) { if (masterPasswdDigest == null) { try { masterPasswdDigest = loadMasterPasswordDigest(); } catch (IOException e) { throw new RuntimeException("Unable to create master password digest", e); } } } } return pwEncoder.isPasswordValid(masterPasswdDigest, passwd, null); }
Source:
<code>public Mono<AccessToken> authenticateWithPemCertificate(String pemCertificatePath, TokenRequestContext request) { String authorityUrl = options.getAuthorityHost().replaceAll("/+$", "") + "/" + tenantId; try { byte[] pemCertificateBytes = Files.readAllBytes(Paths.get(pemCertificatePath)); ConfidentialClientApplication.Builder applicationBuilder = ConfidentialClientApplication.builder(clientId, ClientCredentialFactory.createFromCertificate( CertificateUtil.privateKeyFromPem(pemCertificateBytes), CertificateUtil.publicKeyFromPem(pemCertificateBytes))) <START> .httpClient(new HttpPipelineAdapter(options.getHttpPipeline())) <END> .authority(authorityUrl); if (options.getProxyOptions() != null) { applicationBuilder.proxy(proxyOptionsToJavaNetProxy(options.getProxyOptions())); } if (options.getHttpPipeline() != null) { applicationBuilder.httpClient(new HttpPipelineAdapter(options.getHttpPipeline())); } ConfidentialClientApplication application = applicationBuilder.build(); return Mono.fromFuture(application.acquireToken( ClientCredentialParameters.builder(new HashSet<>(request.getScopes())) .build())) .map(ar -> new AccessToken(ar.accessToken(), OffsetDateTime.ofInstant(ar.expiresOnDate().toInstant(), ZoneOffset.UTC))); } catch (IOException e) { return Mono.error(e); } }</code><technical_language>here, setting checking pipeline null</technical_language>

Target:
public Mono<AccessToken> authenticateWithPemCertificate(String pemCertificatePath, TokenRequestContext request) { String authorityUrl = options.getAuthorityHost().replaceAll("/+$", "") + "/" + tenantId; try { byte[] pemCertificateBytes = Files.readAllBytes(Paths.get(pemCertificatePath)); ConfidentialClientApplication.Builder applicationBuilder = ConfidentialClientApplication.builder(clientId, ClientCredentialFactory.createFromCertificate( CertificateUtil.privateKeyFromPem(pemCertificateBytes), CertificateUtil.publicKeyFromPem(pemCertificateBytes))) .authority(authorityUrl); if (options.getProxyOptions() != null) { applicationBuilder.proxy(proxyOptionsToJavaNetProxy(options.getProxyOptions())); } if (options.getHttpPipeline() != null) { applicationBuilder.httpClient(new HttpPipelineAdapter(options.getHttpPipeline())); } ConfidentialClientApplication application = applicationBuilder.build(); return Mono.fromFuture(application.acquireToken( ClientCredentialParameters.builder(new HashSet<>(request.getScopes())) .build())) .map(ar -> new AccessToken(ar.accessToken(), OffsetDateTime.ofInstant(ar.expiresOnDate().toInstant(), ZoneOffset.UTC))); } catch (IOException e) { return Mono.error(e); } }
Source:
<code>public void testSetStarred() throws Exception { int reviewId = Integer.parseInt(reviewHarness.shortId); <START> boolean starred = true; <END> reviewHarness.client.setStarred(reviewHarness.shortId, starred, new NullProgressMonitor()); ChangeDetailX changeDetail = reviewHarness.client.getChangeDetail(reviewId, new NullProgressMonitor()); assertEquals(starred, changeDetail.isStarred()); starred = false; reviewHarness.client.setStarred(reviewHarness.shortId, starred, new NullProgressMonitor()); changeDetail = reviewHarness.client.getChangeDetail(reviewId, new NullProgressMonitor()); assertEquals(starred, changeDetail.isStarred()); }</code><technical_language>pass directly</technical_language>

Target:
public void testSetStarred() throws Exception { int reviewId = Integer.parseInt(reviewHarness.shortId); reviewHarness.client.setStarred(reviewHarness.shortId, true, new NullProgressMonitor()); ChangeDetailX changeDetail = reviewHarness.client.getChangeDetail(reviewId, new NullProgressMonitor()); assertEquals(true, changeDetail.isStarred()); reviewHarness.client.setStarred(reviewHarness.shortId, true, new NullProgressMonitor()); changeDetail = reviewHarness.client.getChangeDetail(reviewId, new NullProgressMonitor()); assertEquals(true, changeDetail.isStarred()); reviewHarness.client.setStarred(reviewHarness.shortId, false, new NullProgressMonitor()); changeDetail = reviewHarness.client.getChangeDetail(reviewId, new NullProgressMonitor()); assertEquals(false, changeDetail.isStarred()); }
Source:
<code>private static List<List<Trivia>> groupTrivias(Token token) { <START> List<List<Trivia>> result = new LinkedList<>(); <END> List<Trivia> currentGroup = null; for (Trivia trivia : token.trivia()) { currentGroup = handleOneLineComment(result, currentGroup, trivia); } if (currentGroup != null) { result.add(currentGroup); } return result; }</code><technical_language>I this is you, change arrayList, is good usage of linked list</technical_language>

Target:
private static List<List<Trivia>> groupTrivias(Token token) { List<List<Trivia>> result = new ArrayList<>(); List<Trivia> currentGroup = null; for (Trivia trivia : token.trivia()) { currentGroup = handleOneLineComment(result, currentGroup, trivia); } if (currentGroup != null) { result.add(currentGroup); } return result; }
Source:
<code>public byte[] call(final byte[] memento) throws Exception { LOG.log(Level.INFO, "MistMaster is started"); if (!masterRecovery) { final Collection<AllocatedTask> allocatedTasks = taskRequestor.setupTaskAndConn(initialTaskNum); if (allocatedTasks == null) { LOG.log(Level.SEVERE, "Mist tasks are not successfully submitted!"); throw new IllegalStateException("Internal Error : No tasks are allocated!"); } else { masterSetupFinished.setFinished(); } } else { applicationCodeManager.recoverAppJarInfo(); taskRequestor.recoverTaskConn(); masterSetupFinished.setFinished(); } if (dynamicScalingEnabled) { final ScheduledExecutorService dynamicScalingService = Executors.newSingleThreadScheduledExecutor(); final Injector injector = tang.newInjector(); <START> final DynamicScalingPolicy policy = injector.getInstance(DefaultDynamicScalingPolicy.class); <END> dynamicScalingService.schedule(new DynamicScalingRunner(policy), dynamicScalingPeriod, TimeUnit.MILLISECONDS); } this.countDownLatch.await(); this.driverToMasterServer.close(); this.clientToMasterServer.close(); this.taskToMasterServer.close(); return null; }</code><technical_language>creating DynamicScalingManager injecting it? do consider periodic policy? implement on-demand scale in/out</technical_language>

Target:
public byte[] call(final byte[] memento) throws Exception { LOG.log(Level.INFO, "MistMaster is started"); if (!masterRecovery) { final Collection<AllocatedTask> allocatedTasks = taskRequestor.setupTaskAndConn(initialTaskNum); if (allocatedTasks == null) { LOG.log(Level.SEVERE, "Mist tasks are not successfully submitted!"); throw new IllegalStateException("Internal Error : No tasks are allocated!"); } else { masterSetupFinished.setFinished(); } } else { applicationCodeManager.recoverAppJarInfo(); taskRequestor.recoverTaskConn(); masterSetupFinished.setFinished(); } this.dynamicScalingManager.startAutoScaling(); this.countDownLatch.await(); this.driverToMasterServer.close(); this.clientToMasterServer.close(); this.taskToMasterServer.close(); this.dynamicScalingManager.close(); return null; }
Source:
<code>public Object getCurrentTransactionId() { if(com.arjuna.ats.internal.jta.transaction.arjunacore.TransactionImple.getTransaction() == null) <START> return null; <END> return com.arjuna.ats.internal.jta.transaction.arjunacore.TransactionImple.getTransaction().get_uid(); }</code><technical_language>a new line return</technical_language>

Target:
public Object getCurrentTransactionId() { com.arjuna.ats.internal.jta.transaction.arjunacore.TransactionImple transaction = com.arjuna.ats.internal.jta.transaction.arjunacore.TransactionImple.getTransaction(); if (transaction == null) return null; return transaction.get_uid(); }
Source:
<code>public static String getCodeSystemUrl(@Nonnull IBaseResource theCodeSystem) { String url; switch (theCodeSystem.getStructureFhirVersionEnum()) { case DSTU2_HL7ORG: { url = ((CodeSystem) theCodeSystem).getUrl(); break; } case DSTU3: { url = ((org.hl7.fhir.dstu3.model.CodeSystem) theCodeSystem).getUrl(); break; } case R4: { url = ((org.hl7.fhir.r4.model.CodeSystem) theCodeSystem).getUrl(); break; } case R5: { url = ((org.hl7.fhir.r5.model.CodeSystem) theCodeSystem).getUrl(); <START> break; <END> } case DSTU2: case DSTU2_1: default: throw new IllegalArgumentException("Can not handle version: " + theCodeSystem.getStructureFhirVersionEnum()); } return url; }</code><technical_language>augment R5 provider test include a case includes CodeSystem ID this code is included in tests</technical_language>

Target:
public static String getCodeSystemUrl(@Nonnull IBaseResource theCodeSystem) { String url; switch (theCodeSystem.getStructureFhirVersionEnum()) { case R4: { url = ((org.hl7.fhir.r4.model.CodeSystem) theCodeSystem).getUrl(); break; } case R5: { url = ((org.hl7.fhir.r5.model.CodeSystem) theCodeSystem).getUrl(); break; } case DSTU3: default: throw new IllegalArgumentException("Can not handle version: " + theCodeSystem.getStructureFhirVersionEnum()); } return url; }
Source:
<code>final private SecretKey getSecretKeyFromAndroidKeyStore() throws IOException, GeneralSecurityException { File keyFile = new File(mContext.getFilesDir(), "adal.secret.key"); loadKeyPair(); if (!keyFile.exists()) { Logger.v(TAG, "Key file does not exists"); final SecretKey key = generateSecretKey(); Logger.v(TAG, "Wrapping SecretKey"); <START> final byte[] keyWrapped = wrap(key); <END> Logger.v(TAG, "Writing SecretKey"); writeKeyData(keyFile, keyWrapped); Logger.v(TAG, "Finished writing SecretKey"); } Logger.v(TAG, "Reading SecretKey"); final byte[] encryptedKey = readKeyData(keyFile); final SecretKey key = unWrap(encryptedKey); Logger.v(TAG, "Finished reading SecretKey"); return key; }</code><technical_language>Is this encryption signed</technical_language>

Target:
final synchronized private SecretKey getSecretKeyFromAndroidKeyStore() throws IOException, GeneralSecurityException { if (sSecretKeyFromAndroidKeyStore != null) { return sSecretKeyFromAndroidKeyStore; } File keyFile = new File(mContext.getFilesDir(), ADALKS); loadKeyPair(); Cipher wrapCipher = Cipher.getInstance(WRAP_ALGORITHM); if (!keyFile.exists()) { Logger.v(TAG, "Key file does not exists"); final SecretKey key = generateSecretKey(); Logger.v(TAG, "Wrapping SecretKey"); final byte[] keyWrapped = wrap(wrapCipher, key); Logger.v(TAG, "Writing SecretKey"); writeKeyData(keyFile, keyWrapped); Logger.v(TAG, "Finished writing SecretKey"); } Logger.v(TAG, "Reading SecretKey"); final byte[] encryptedKey = readKeyData(keyFile); sSecretKeyFromAndroidKeyStore = unwrap(wrapCipher, encryptedKey); Logger.v(TAG, "Finished reading SecretKey"); return sSecretKeyFromAndroidKeyStore; }
Source:
<code><START> Map<String, File> createOutputMap( <END> final File outputMapFile, final File outputDir, final String defaultExtension, final List<SAMReadGroupRecord> readGroups) { final Map<String, File> outputMap; if (outputMapFile != null) { outputMap = createOutputMapFromFile(outputMapFile); } else { outputMap = createOutputMap(readGroups, outputDir, defaultExtension); } return outputMap; }</code><technical_language>this static</technical_language>

Target:
static Map<String, File> createOutputMap( final File outputMapFile, final File outputDir, final String defaultExtension, final List<SAMReadGroupRecord> readGroups) { final Map<String, File> outputMap; if (outputMapFile != null) { outputMap = createOutputMapFromFile(outputMapFile); } else { outputMap = createOutputMap(readGroups, outputDir, defaultExtension); } return outputMap; }
Source:
<code>private boolean notRacyClean(final long read) { <START> return read - lastModified > 3 * 60 * 1000L; <END> }</code><technical_language>This is minutes. FAT is seconds require larger seconds. file systems is seconds, 2.001 do. a Unit test this out. Do break ObjectDirectory /minutes/ fudge</technical_language>

Target:
private boolean notRacyClean(final long read) { return read - lastModified > 2500; }
Source:
<code>public void testConfigOverwrittenByDynamicOpts() throws Exception { double cpuCores = 39.0; String[] commands = {RUN_BASH_JAVA_UTILS_CMD_SCRIPT, BashJavaUtils.Command.GET_TM_RESOURCE_PARAMS.toString(), "-D" + TaskManagerOptions.CPU_CORES.key() + "=" + cpuCores}; List<String> lines = Arrays.asList(executeScript(commands).split(System.lineSeparator())); <START> assertEquals(2, lines.size()); <END> Map<String, String> configs = ConfigurationUtils.parseTmResourceDynamicConfigs(lines.get(lines.size() - 1)); assertThat(Double.valueOf(configs.get(TaskManagerOptions.CPU_CORES.key())), is(cpuCores)); }</code><technical_language>suggestion assertThat(lines.size(), is(2)); Map<String, String> configs = ConfigurationUtils.parseTmResourceDynamicConfigs(lines.get(1));</technical_language>

Target:
public void testConfigOverwrittenByDynamicOpts() throws Exception { double cpuCores = 39.0; String[] commands = {RUN_BASH_JAVA_UTILS_CMD_SCRIPT, BashJavaUtils.Command.GET_TM_RESOURCE_PARAMS.toString(), "-D" + TaskManagerOptions.CPU_CORES.key() + "=" + cpuCores}; List<String> lines = Arrays.asList(executeScript(commands).split(System.lineSeparator())); assertThat(lines.size(), is(2)); Map<String, String> configs = ConfigurationUtils.parseTmResourceDynamicConfigs(lines.get(1)); assertThat(Double.valueOf(configs.get(TaskManagerOptions.CPU_CORES.key())), is(cpuCores)); }
Source:
<code>protected void executeCommand() { TransactionSupport.executeInNewTransaction(new TransactionMethod<Void>() { @Override public Void runInTransaction() { getCompensationContext().snapshotEntity(getVmPool()); setPoolBeingDestroyed(); setPrestartedToZero(); getCompensationContext().stateChanged(); return null; } }); setCommandShouldBeLogged(false); log(); stopVms(); if (allVmsDown) { getParameters().setTaskGroupSuccess(true); <START> endAction(); <END> } else { setSucceeded(true); } }</code><technical_language>calling endAction is dangerous, I else. is problematic execute phase finished is infra in CommandBase handles it. Please call endSuccessfully instead (and need verify 'log' method is called)</technical_language>

Target:
protected void executeCommand() { TransactionSupport.executeInNewTransaction(new TransactionMethod<Void>() { @Override public Void runInTransaction() { getCompensationContext().snapshotEntity(getVmPool()); setPoolBeingDestroyed(); setPrestartedToZero(); getCompensationContext().stateChanged(); return null; } }); setCommandShouldBeLogged(false); log(); stopVms(); if (allVmsDown) { getParameters().setTaskGroupSuccess(true); endSuccessfully(); } else { setSucceeded(true); } }
Source:
<code>public Map<Long, Map<Integer, QuestionAnswerStore>> mapByQuestionIdAndIteration( List<QuestionAnswerStore> qasList) { Map<Long, Map<Integer, QuestionAnswerStore>> responseMap = new HashMap<>(); for (QuestionAnswerStore a : qasList) { Long questionId = Long.parseLong(a.getQuestionID()); Integer iteration = a.getIteration(); iteration = iteration == null ? 0 : iteration; Map<Integer, QuestionAnswerStore> iterationMap = responseMap.get(questionId); if (iterationMap == null) { iterationMap = new HashMap<>(); } iterationMap.put(iteration, a); <START> responseMap.put(questionId, iterationMap); <END> } return responseMap; }</code><technical_language>This line need executed for response, right</technical_language>

Target:
public Map<Long, Map<Integer, QuestionAnswerStore>> mapByQuestionIdAndIteration( List<QuestionAnswerStore> qasList) { Map<Long, Map<Integer, QuestionAnswerStore>> responseMap = new HashMap<>(); for (QuestionAnswerStore a : qasList) { Long questionId = Long.parseLong(a.getQuestionID()); Integer iteration = a.getIteration(); iteration = iteration == null ? 0 : iteration; Map<Integer, QuestionAnswerStore> iterationMap = responseMap.get(questionId); if (iterationMap == null) { iterationMap = new HashMap<>(); responseMap.put(questionId, iterationMap); } iterationMap.put(iteration, a); } return responseMap; }
Source:
<code>AbstractInvocationHandler(SafeCallManager manager, T target, Object identifier, long timeout, @Nullable Consumer<Throwable> exceptionHandler, @Nullable Runnable timeoutHandler) { <START> super(); <END> this.manager = manager; this.target = target; this.identifier = identifier; this.timeout = timeout; this.exceptionHandler = exceptionHandler; this.timeoutHandler = timeoutHandler; }</code><technical_language>Okay, done implicit</technical_language>

Target:
AbstractInvocationHandler(SafeCallManager manager, T target, Object identifier, long timeout, @Nullable Consumer<Throwable> exceptionHandler, @Nullable Runnable timeoutHandler) { this.manager = manager; this.target = target; this.identifier = identifier; this.timeout = timeout; this.exceptionHandler = exceptionHandler; this.timeoutHandler = timeoutHandler; }
Source:
<code>public static StyleKeyRegistry getRegistry() { if ( registry == null ) { <START> throw new IllegalStateException( "You have to boot LibCSS to make all style-keys known" ); <END> } return registry; }</code><technical_language>need a form of memory barrier end stale data. Booting set registry, if queried registry a thread updated instance booting hit a syncronized block elsewhere. registry variable volatile a atomic reference this safe</technical_language>

Target:
public static StyleKeyRegistry getRegistry() { lock.readLock().lock(); try { if ( registry == null ) { throw new IllegalStateException( "You have to boot LibCSS to make all style-keys known" ); } return registry; } finally { lock.readLock().unlock(); } }
Source:
<code>public Object createWebSocket(ServletUpgradeRequest req, ServletUpgradeResponse resp) { try { final URI requestURI = req.getRequestURI(); final String path = requestURI.getPath(); final String backendURL = getMatchedBackendURL(path); ProxyWebSocketAdapter wsAdaptor = new ProxyWebSocketAdapter (URI.create(backendURL), pool, getClientEndpointConfig(req)); <START> wsAdaptor.setMaxBufferCount(config.getWebsocketMaxWaitBufferCount()); <END> return wsAdaptor; } catch (final Exception e) { LOG.failedCreatingWebSocket(e); throw e; } }</code><technical_language>I do need this API all; config.getWebsocketMaxWaitBufferCount() ProxyWebSocketAdapter checking limit</technical_language>

Target:
public Object createWebSocket(ServletUpgradeRequest req, ServletUpgradeResponse resp) { try { final URI requestURI = req.getRequestURI(); final String path = requestURI.getPath(); final String backendURL = getMatchedBackendURL(path, requestURI); LOG.debugLog("Generated backend URL for websocket connection: " + backendURL); return new ProxyWebSocketAdapter (URI.create(backendURL), pool, getClientEndpointConfig(req), config); } catch (final Exception e) { LOG.failedCreatingWebSocket(e); throw e; } }
Source:
<code>public void loadDictionaryFromFasta () throws IOException { <START> IndexedFastaSequenceFile ff = new IndexedFastaSequenceFile(REF_FILE); <END> DICTIONARY_BACKED_BY_REF_FILE = ff.getSequenceDictionary(); ff.close(); }</code><technical_language>final</technical_language>

Target:
public void loadDictionaryFromFasta () throws IOException { final IndexedFastaSequenceFile ff = new IndexedFastaSequenceFile(REF_FILE); DICTIONARY_BACKED_BY_REF_FILE = ff.getSequenceDictionary(); ff.close(); }
Source:
<code>public Standed( @NotNull(message = "work can't be NULL") final Work wrk, @NotNull(message = "name of stand can't be NULL") final String name, @NotNull(message = "key can't be NULL") final String secret, @NotNull(message = "drain can't be NULL") final Drain drain) { this.work = wrk; this.stand = name; this.key = secret; this.origin = drain; this.entry = new Standed.SQSEntry() { @Override public TestClient get() { return RestTester.start(Stand.QUEUE); } }; <START> this.exec = new Standed.Exec() { <END> @Override public ExecutorService get() { return Executors.newFixedThreadPool( Standed.THREADS, new VerboseThreads() ); } }; }</code><technical_language>a good practice changes local vars in constructor. other constructors call this(...). a clear code duplication. done in, for example, com.rultor.snapshot.Snapshot. constructors, of is making save operation. Others proxies</technical_language>

Target:
public Standed( @NotNull(message = "work can't be NULL") final Work wrk, @NotNull(message = "name of stand can't be NULL") final String name, @NotNull(message = "key can't be NULL") final String secret, @NotNull(message = "drain can't be NULL") final Drain drain) { this( wrk, name, secret, drain, RestTester.start(Stand.QUEUE), Executors.newFixedThreadPool(Standed.THREADS, new VerboseThreads()) ); }
Source:
<code>public Mapper build() { JacksonEngine jacksonEngine = new JacksonEngine(createMapping()); if (queryFactory == null) { queryFactory = new BsonQueryFactory(jacksonEngine); } if (objectIdUpdater == null) { objectIdUpdater = new JacksonObjectIdUpdater(jacksonEngine.getObjectMapper()); <START> } <END> return new JacksonMapper(jacksonEngine, queryFactory, objectIdUpdater); }</code><technical_language>done. This is this end of this long living life class</technical_language>

Target:
public Mapper build() { JacksonEngine jacksonEngine = new JacksonEngine(createMapping()); if (queryFactory == null) { queryFactory = new BsonQueryFactory(jacksonEngine); } if (objectIdUpdater == null) { objectIdUpdater = new ReflectiveObjectIdUpdater(new JacksonIdFieldSelector()); } return new JacksonMapper(jacksonEngine, queryFactory, objectIdUpdater); }
Source:
<code>private void prune(Block inactiveBlock) { if (inactiveBlock.equals(trueBlock)) { if (inactiveBlock.successors.size() != 1) { throw new IllegalStateException("True successor must be replaced by a unique successor!"); } trueBlock = inactiveBlock.successors.iterator().next(); } if (inactiveBlock.equals(falseBlock)) { if (inactiveBlock.successors.size() != 1) { throw new IllegalStateException("False successor must be replaced by a unique successor!"); } falseBlock = inactiveBlock.successors.iterator().next(); } if (inactiveBlock.equals(successorWithoutJump)) { <START> if (inactiveBlock.successors.size() != 1) { <END> throw new IllegalStateException("SuccessorWithoutJump successor must be replaced by a unique successor!"); } successorWithoutJump = inactiveBlock.successors.iterator().next(); } if (successors.remove(inactiveBlock)) { successors.addAll(inactiveBlock.successors); } if (exceptions.remove(inactiveBlock)) { exceptions.addAll(inactiveBlock.exceptions); exceptions.addAll(inactiveBlock.successors); } if (inactiveBlock.equals(exitBlock)) { exitBlock = inactiveBlock.successors.iterator().next(); } }</code><technical_language>a com.google.common.base.Preconditions a if a throw?: java Preconditions.checkState( inactiveBlock.successors.size() == 1, "SuccessorWithoutJump successor replaced a unique successor!"); I prefer this in a distinct commit. changing behavior of CFG, lost in a "fix unreachable code" commit</technical_language>

Target:
private void prune(Block inactiveBlock) { boolean hasUniqueSuccessor = inactiveBlock.successors.size() == 1; if (inactiveBlock.equals(trueBlock)) { Preconditions.checkArgument(hasUniqueSuccessor, "True successor must be replaced by a unique successor!"); trueBlock = inactiveBlock.successors.iterator().next(); } if (inactiveBlock.equals(falseBlock)) { Preconditions.checkArgument(hasUniqueSuccessor, "False successor must be replaced by a unique successor!"); falseBlock = inactiveBlock.successors.iterator().next(); } if (inactiveBlock.equals(successorWithoutJump)) { Preconditions.checkArgument(hasUniqueSuccessor, "SuccessorWithoutJump successor must be replaced by a unique successor!"); successorWithoutJump = inactiveBlock.successors.iterator().next(); } if (successors.remove(inactiveBlock)) { successors.addAll(inactiveBlock.successors); } if (exceptions.remove(inactiveBlock)) { exceptions.addAll(inactiveBlock.exceptions); exceptions.addAll(inactiveBlock.successors); } if (inactiveBlock.equals(exitBlock)) { exitBlock = inactiveBlock.successors.iterator().next(); } }