auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
private void populateSerializedRowSizes(int fixedWidthRowSize, List<Integer> variableWidthChannels) { if (variableWidthChannels.isEmpty()) { return; } serializedRowSizes = ensureCapacity(serializedRowSizes, positionCount, SMALL, false, true); for (int i : variableWidthChannels) { blockEncodingBuffers[i].accumulateSerializedRowSizes(serializedRowSizes); } for (int i = 0; i < positionCount; i++) { serializedRowSizes[i] += fixedWidthRowSize; } }

Target:
private void populateSerializedRowSizes(int fixedWidthRowSize, List<Integer> variableWidthChannels) { if (variableWidthChannels.isEmpty()) { return; } serializedRowSizes = ensureCapacity(serializedRowSizes, positionCount, SMALL, INITIALIZE); for (int i : variableWidthChannels) { blockEncodingBuffers[i].accumulateSerializedRowSizes(serializedRowSizes); } for (int i = 0; i < positionCount; i++) { serializedRowSizes[i] += fixedWidthRowSize; } }
Source:
private void handleCredentials(HttpServletRequest request, String user, String password) { UserProfile userProfile = translateUser(user); if (userProfile == null || userProfile.profile == null) { log.error(String.format("Error in obtaining profile %1$s", userProfile.profile)); } else { ExtMap outputMap = userProfile.profile.getAuthn().invoke(new ExtMap().mput( Base.InvokeKeys.COMMAND, Authn.InvokeCommands.AUTHENTICATE_CREDENTIALS ).mput( Authn.InvokeKeys.USER, userProfile.userName ).mput( Authn.InvokeKeys.CREDENTIALS, password ) ); if (outputMap.<Integer> get(Base.InvokeKeys.RESULT) == Base.InvokeResult.SUCCESS && outputMap.<Integer> get(Authn.InvokeKeys.RESULT) == Authn.AuthResult.SUCCESS) { request.setAttribute(FiltersHelper.Constants.REQUEST_AUTH_RECORD_KEY, outputMap.<ExtMap> get(Authn.InvokeKeys.AUTH_RECORD)); request.setAttribute(FiltersHelper.Constants.REQUEST_PROFILE_KEY, userProfile.profile.getName()); } else { log.error( String.format( "Failure in authentication to profile %1$s. Invocation Result code is %2$s. Authn result code is %3$s", userProfile.profile, outputMap.<Integer> get(Base.InvokeKeys.RESULT), outputMap.<Integer> get(Authn.InvokeKeys.RESULT) ) ); } } }

Target:
private void handleCredentials(HttpServletRequest request, String user, String password) { UserProfile userProfile = translateUser(user); if (userProfile == null || userProfile.profile == null) { log.error("Error in obtaining profile {}", userProfile.profile); } else { ExtMap outputMap = userProfile.profile.getAuthn().invoke(new ExtMap().mput( Base.InvokeKeys.COMMAND, Authn.InvokeCommands.AUTHENTICATE_CREDENTIALS ).mput( Authn.InvokeKeys.USER, userProfile.userName ).mput( Authn.InvokeKeys.CREDENTIALS, password ) ); if (outputMap.<Integer> get(Base.InvokeKeys.RESULT) == Base.InvokeResult.SUCCESS && outputMap.<Integer> get(Authn.InvokeKeys.RESULT) == Authn.AuthResult.SUCCESS) { request.setAttribute(FiltersHelper.Constants.REQUEST_AUTH_RECORD_KEY, outputMap.<ExtMap> get(Authn.InvokeKeys.AUTH_RECORD)); request.setAttribute(FiltersHelper.Constants.REQUEST_PROFILE_KEY, userProfile.profile.getName()); } else { log.error("Failure in authentication to profile {}. Invocation Result code is {}. Authn result code is {}", userProfile.profile, outputMap.<Integer> get(Base.InvokeKeys.RESULT), outputMap.<Integer> get(Authn.InvokeKeys.RESULT) ); } } }
Source:
protected File getTemporaryFile(IngestJobContext context, AbstractFile file) throws DroneIngestException { String tempFileName = file.getName() + file.getId() + file.getNameExtension(); Path tempFilePath = Paths.get(getExtractorTempPath().toString(), tempFileName); try { ContentUtils.writeToFile(file, tempFilePath.toFile(), context::dataSourceIngestIsCancelled); } catch (IOException ex) { throw new DroneIngestException(String.format("Unable to create temp file %s for abstract file %s", tempFilePath.toString(), file.getName()), ex); } return tempFilePath.toFile(); }

Target:
protected File getTemporaryFile(IngestJobContext context, AbstractFile file) throws DroneIngestException { String tempFileName = file.getName() + file.getId() + file.getNameExtension(); Path tempFilePath = Paths.get(getExtractorTempPath().toString(), tempFileName); try { ContentUtils.writeToFile(file, tempFilePath.toFile(), context::dataSourceIngestIsCancelled); } catch (IOException ex) { throw new DroneIngestException(String.format("Unable to create temp file %s for abstract file %s objectID: %d", tempFilePath.toString(), file.getName(), file.getId()), ex); } return tempFilePath.toFile(); }
Source:
public LauncherDiscoveryResult discover(LauncherDiscoveryRequest request, String phase) { Map<TestEngine, TestDescriptor> testEngineDescriptors = new LinkedHashMap<>(); for (TestEngine testEngine : this.testEngines) { boolean engineIsExcluded = request.getEngineFilters().stream() .map(engineFilter -> engineFilter.apply(testEngine)) .anyMatch(FilterResult::excluded); if (engineIsExcluded) { logger.debug(() -> String.format( "Test discovery for engine '%s' was skipped due to an EngineFilter in phase '%s'.", testEngine.getId(), phase)); continue; } logger.debug(() -> String.format("Discovering tests during Launcher %s phase in engine '%s'.", phase, testEngine.getId())); TestDescriptor rootDescriptor = discoverEngineRoot(testEngine, request); testEngineDescriptors.put(testEngine, rootDescriptor); } final List<PostDiscoveryFilter> filters = new LinkedList<>(postDiscoveryFilters); filters.addAll(request.getPostDiscoveryFilters()); applyPostDiscoveryFilters(testEngineDescriptors, filters); prune(testEngineDescriptors); return new LauncherDiscoveryResult(testEngineDescriptors, request.getConfigurationParameters()); }

Target:
public LauncherDiscoveryResult discover(LauncherDiscoveryRequest request, String phase) { Map<TestEngine, TestDescriptor> testEngineDescriptors = new LinkedHashMap<>(); for (TestEngine testEngine : this.testEngines) { boolean engineIsExcluded = request.getEngineFilters().stream() .map(engineFilter -> engineFilter.apply(testEngine)) .anyMatch(FilterResult::excluded); if (engineIsExcluded) { logger.debug(() -> String.format( "Test discovery for engine '%s' was skipped due to an EngineFilter in phase '%s'.", testEngine.getId(), phase)); continue; } logger.debug(() -> String.format("Discovering tests during Launcher %s phase in engine '%s'.", phase, testEngine.getId())); TestDescriptor rootDescriptor = discoverEngineRoot(testEngine, request); testEngineDescriptors.put(testEngine, rootDescriptor); } List<PostDiscoveryFilter> filters = new LinkedList<>(postDiscoveryFilters); filters.addAll(request.getPostDiscoveryFilters()); applyPostDiscoveryFilters(testEngineDescriptors, filters); prune(testEngineDescriptors); return new LauncherDiscoveryResult(testEngineDescriptors, request.getConfigurationParameters()); }
Source:
public boolean equals(final Object o) { if (this == o) { return true; } if (o == null || getClass() != o.getClass()) { return false; } final MesosClientErrorContext that = (MesosClientErrorContext) o; if (statusCode != that.statusCode) { return false; } if (message != null ? !message.equals(that.message) : that.message != null) { return false; } return !(headers != null ? !headers.equals(that.headers) : that.headers != null); }

Target:
public boolean equals(final Object o) { if (this == o) { return true; } if (o == null || getClass() != o.getClass()) { return false; } final MesosClientErrorContext that = (MesosClientErrorContext) o; return statusCode == that.statusCode && Objects.equals(message, that.message) && Objects.equals(headers, that.headers); }
Source:
private void updatePlaybackPositions() throws ExoPlaybackException { if (playingPeriodHolder == null) { return; } long periodPositionUs = playingPeriodHolder.mediaPeriod.readDiscontinuity(); if (periodPositionUs != C.TIME_UNSET) { resetRendererPosition(periodPositionUs); } else { rendererPositionUs = rendererMediaClock.getPositionUs(); standaloneMediaClock.setPositionUs(rendererPositionUs); periodPositionUs = rendererPositionUs - playingPeriodHolder.rendererPositionOffsetUs; } playbackInfo.positionUs = periodPositionUs; elapsedRealtimeUs = SystemClock.elapsedRealtime() * 1000; long bufferedPositionUs = enabledRenderers.length == 0 ? C.TIME_END_OF_SOURCE : playingPeriodHolder.mediaPeriod.getBufferedPositionUs(); playbackInfo.bufferedPositionUs = bufferedPositionUs == C.TIME_END_OF_SOURCE ? timeline.getPeriod(playingPeriodHolder.index, period).getDurationUs() : bufferedPositionUs; }

Target:
private void updatePlaybackPositions() throws ExoPlaybackException { if (playingPeriodHolder == null) { return; } long periodPositionUs = playingPeriodHolder.mediaPeriod.readDiscontinuity(); if (periodPositionUs != C.TIME_UNSET) { resetRendererPosition(periodPositionUs); } else { if (rendererMediaClockSource != null && !rendererMediaClockSource.isEnded()) { rendererPositionUs = rendererMediaClock.getPositionUs(); standaloneMediaClock.setPositionUs(rendererPositionUs); } else { rendererPositionUs = standaloneMediaClock.getPositionUs(); } periodPositionUs = rendererPositionUs - playingPeriodHolder.rendererPositionOffsetUs; } playbackInfo.positionUs = periodPositionUs; elapsedRealtimeUs = SystemClock.elapsedRealtime() * 1000; long bufferedPositionUs = enabledRenderers.length == 0 ? C.TIME_END_OF_SOURCE : playingPeriodHolder.mediaPeriod.getBufferedPositionUs(); playbackInfo.bufferedPositionUs = bufferedPositionUs == C.TIME_END_OF_SOURCE ? timeline.getPeriod(playingPeriodHolder.index, period).getDurationUs() : bufferedPositionUs; }
Source:
public void shouldOptionReturnNotNull() { assertThat(option(1)).isNotNull(); }

Target:
public void shouldOptionReturnNotNull() { assertThat(Option(1)).isNotNull(); }
Source:
static void mongoInsertDefaultGroupId(final DB dbs, final String assignmentId, final List<String>... ids) { final DBRef myDbRef = new DBRef(dbs, getCollectionFromType(School.ItemType.ASSIGNMENT), new ObjectId(assignmentId)); final DBObject corsor = myDbRef.fetch(); final DBCollection assignments = dbs.getCollection(getCollectionFromType(School.ItemType.ASSIGNMENT)); final BasicDBObject updateQuery = new BasicDBObject(); LOG.info("Updated Query: ", updateQuery); assignments.update(corsor, updateQuery); }

Target:
static void mongoInsertDefaultGroupId(final DB dbs, final String assignmentId, final List<String>... ids) { final DBRef myDbRef = new DBRef(dbs, getCollectionFromType(School.ItemType.ASSIGNMENT), new ObjectId(assignmentId)); final DBObject corsor = myDbRef.fetch(); final DBCollection assignmentCollection = dbs.getCollection(getCollectionFromType(School.ItemType.ASSIGNMENT)); final BasicDBObject updateQuery = new BasicDBObject(); LOG.info("Updated Query: ", updateQuery); assignmentCollection.update(corsor, updateQuery); }
Source:
private Map<String, String> getFormattingProperties(String rawFormat, List<String> positionalParameters) { Map<String, String> properties = new HashMap<String, String>(); String[] valpairs = rawFormat.split(","); for (String pair : valpairs) { Matcher matcher = keyvalpattern.matcher(pair.trim()); String key, value; if (matcher.find()) { key = matcher.group(1); value = matcher.group(2); properties.put(key, value); } else { if(positionalParameters.isEmpty()) { } else { properties.put(positionalParameters.remove(0),pair.trim()); } } } return properties; }

Target:
private Map<String, String> getFormattingProperties(String rawFormat, List<String> positionalParameters) { Map<String, String> properties = new HashMap<String, String>(); String[] valpairs = rawFormat.split(","); for (String pair : valpairs) { Matcher matcher = keyValuePattern.matcher(pair.trim()); String key, value; if (matcher.find()) { key = matcher.group(1); value = matcher.group(2); properties.put(key, value); } else { if (positionalParameters.isEmpty()) { } else { properties.put(positionalParameters.remove(0), pair.trim()); } } } return properties; }
Source:
private void activeEditorChanged(IWorkbenchPart editor) { ITranslationUnit tu = null; if (editor instanceof CEditor) tu = ((CEditor) editor).getTranslationUnit(); if (tu == null && editor != null) { ITranslationUnitProvider provider = (ITranslationUnitProvider) editor.getAdapter(ITranslationUnitProvider.class); if (provider != null) tu = provider.getTranslationUnit(); } synchronized (this) { fActiveEditor= editor; fTimeStamp= IDocumentExtension4.UNKNOWN_MODIFICATION_STAMP; fCache.setActiveElement(tu); } }

Target:
private void activeEditorChanged(IWorkbenchPart editor) { ITranslationUnit tu = null; if (editor instanceof CEditor) tu = ((CEditor) editor).getTranslationUnit(); if (tu == null && editor != null) { ITranslationUnitHolder provider = (ITranslationUnitHolder) editor.getAdapter(ITranslationUnitHolder.class); if (provider != null) tu = provider.getTranslationUnit(); } synchronized (this) { fActiveEditor= editor; fTimeStamp= IDocumentExtension4.UNKNOWN_MODIFICATION_STAMP; fCache.setActiveElement(tu); } }
Source:
public static void main(String[] args) { try { Options options = getOptions(); CommandLineParser parser = new DefaultParser(); final CommandLine cmdLine = parser.parse(options, args); validateCommandLine(cmdLine); if (cmdLine.hasOption("l")) { Properties properties = new Properties(); properties.load(new FileInputStream(cmdLine.getOptionValue("l"))); LogManager.resetConfiguration(); PropertyConfigurator.configure(properties); } switch (cmdLine.getArgs().length) { case 1: final String filename = cmdLine.getArgs()[0]; final File file = new File(filename); if (filename.endsWith(".asn")) { testReadingAsnFile(file); } else { testReadingBerFile(file); } break; case 2: throw new ParseException("Top level type name not supplied"); case 3: { final String asnFilename = cmdLine.getArgs()[0].endsWith(".asn") ? cmdLine.getArgs()[0] : cmdLine.getArgs()[1]; final String berFilename = cmdLine.getArgs()[0].endsWith(".asn") ? cmdLine.getArgs()[1] : cmdLine.getArgs()[0]; final String topLevelType = cmdLine.getArgs()[2]; final File asnFile = new File(asnFilename); final File berFile = new File(berFilename); final CharSource schemaSource = Files.asCharSource(asnFile, Charsets.UTF_8); final AsnSchema asnSchema = AsnSchemaReader.read(schemaSource); handleDataFile(berFile, asnSchema, topLevelType); } break; default: throw new ParseException("No ASN Schema (.asn) or ASN Data (.ber) file supplied"); } } catch (final IOException ex) { logger.error("Could not parse file", ex); System.exit(1); } catch (final ParseException e) { printUsage(e.getMessage()); System.exit(1); } }

Target:
public static void main(String[] args) { try { Options options = getOptions(); CommandLineParser parser = new DefaultParser(); final CommandLine cmdLine = parser.parse(options, args); validateCommandLine(cmdLine); switch (cmdLine.getArgs().length) { case 1: final String filename = cmdLine.getArgs()[0]; final File file = new File(filename); if (filename.endsWith(".asn")) { testReadingAsnFile(file); } else { testReadingBerFile(file); } break; case 2: throw new ParseException("Top level type name not supplied"); case 3: { final String asnFilename = cmdLine.getArgs()[0].endsWith(".asn") ? cmdLine.getArgs()[0] : cmdLine.getArgs()[1]; final String berFilename = cmdLine.getArgs()[0].endsWith(".asn") ? cmdLine.getArgs()[1] : cmdLine.getArgs()[0]; final String topLevelType = cmdLine.getArgs()[2]; final File asnFile = new File(asnFilename); final File berFile = new File(berFilename); final CharSource schemaSource = Files.asCharSource(asnFile, Charsets.UTF_8); final AsnSchema asnSchema = AsnSchemaReader.read(schemaSource); handleDataFile(berFile, asnSchema, topLevelType); } break; default: throw new ParseException("No ASN Schema (.asn) or ASN Data (.ber) file supplied"); } } catch (final IOException ex) { logger.error("Could not parse file", ex); System.exit(1); } catch (final ParseException e) { printUsage(e.getMessage()); System.exit(1); } }
Source:
public Optional<Instant> getLastRun(final UUID reportId, final Organization organization) throws NoSuchElementException { return Ebean.find(ReportExecution.class) .orderBy() .desc("completed_at") .where() .eq("report.uuid", reportId) .eq("report.organization.uuid", organization.getId()) .eq("state", ReportExecution.State.SUCCESS) .findOneOrEmpty() .map(ReportExecution::getCompletedAt); }

Target:
public Optional<Instant> getLastRun(final UUID reportId, final Organization organization) throws NoSuchElementException { assertIsOpen(); return Ebean.find(ReportExecution.class) .orderBy() .desc("completed_at") .where() .eq("report.uuid", reportId) .eq("report.organization.uuid", organization.getId()) .in("state", ReportExecution.State.SUCCESS, ReportExecution.State.FAILURE) .findOneOrEmpty() .map(ReportExecution::getCompletedAt); }
Source:
public void test_fetch_upload_id_finds_improperly_formatted_file() throws IOException { val dir = new File(getClass().getClassLoader().getResource("fixtures/upload/placeholder-upload-file.txt").getFile()); Optional<String> result = UploadStateStore.fetchUploadId(dir, "invalid-upload-id"); assertFalse(result.isPresent()); }

Target:
public void test_fetch_upload_id_finds_improperly_formatted_file() throws IOException { val dir = getTestResourceRoot(); Optional<String> result = UploadStateStore.fetchUploadId(dir, "invalid-upload-id"); assertThat(result.isPresent()).isFalse(); }
Source:
public void selectionChanged(SelectionChangedEvent event) { ISelection selection = event.getSelection(); if (selection instanceof IStructuredSelection) { if (((getActivePartSource() instanceof SelectionProviderDelegator) && !((SelectionProviderDelegator) getActivePartSource()).containsSelectionProvider(event.getSource())) || (!(getActivePartSource() instanceof SelectionProviderDelegator) && event.getSource() != getActivePartSource())) { return; } if (event.getSource().equals(navigator.getCommonViewer())) { IWorkbenchPage page = EclipseUIUtil.getActivePage(); IEditorPart activeEditor = page.getActiveEditor(); if (activeEditor instanceof DialectEditor) { DialectEditor dialectEditor = (DialectEditor) activeEditor; page.bringToTop(dialectEditor); selectRepresentationElements(selection, dialectEditor); } else if (activeEditor != null && SESSION_EDITOR_CLASS_NAME.equals(activeEditor.getClass().getName()) && activeEditor instanceof ISelectionListener) { page.bringToTop(activeEditor); ISelectionListener selectionEditor = (ISelectionListener) activeEditor; selectionEditor.selectionChanged(partService.getActivePart(), selection); } } else { Set<Object> targets = getTargetsFromSelection((IStructuredSelection) selection); if (targets.isEmpty()) { List<?> list = ((IStructuredSelection) selection).toList(); targets = Sets.newHashSet(list); } if (!targets.isEmpty()) { navigator.selectReveal(new StructuredSelection(targets.toArray())); } } } }

Target:
public void selectionChanged(SelectionChangedEvent event) { ISelection selection = event.getSelection(); if (selection instanceof IStructuredSelection) { if (((getActivePartSource() instanceof SelectionProviderDelegator) && !((SelectionProviderDelegator) getActivePartSource()).containsSelectionProvider(event.getSource())) || (!(getActivePartSource() instanceof SelectionProviderDelegator) && event.getSource() != getActivePartSource())) { return; } if (event.getSource().equals(navigator.getCommonViewer())) { IWorkbenchPage page = EclipseUIUtil.getActivePage(); IEditorPart activeEditor = page.getActiveEditor(); if (activeEditor instanceof DialectEditor) { DialectEditor dialectEditor = (DialectEditor) activeEditor; page.bringToTop(dialectEditor); selectRepresentationElements(selection, dialectEditor); } else if (activeEditor != null && SiriusEditPlugin.SESSION_EDITOR_CLASS_NAME.equals(activeEditor.getClass().getName()) && activeEditor instanceof ISelectionListener) { page.bringToTop(activeEditor); ISelectionListener selectionEditor = (ISelectionListener) activeEditor; selectionEditor.selectionChanged(partService.getActivePart(), selection); } } else { Set<Object> targets = getTargetsFromSelection((IStructuredSelection) selection); if (!targets.isEmpty()) { navigator.selectReveal(new StructuredSelection(targets.toArray())); } } } }
Source:
boolean closeOnProtocolViolation() { return closeOnProtocolViolation; }

Target:
public boolean closeOnProtocolViolation() { return closeOnProtocolViolation; }
Source:
protected static Set<TopicPartition> determinePartitionsToPause(Set<TopicPartition> currentAssignment, Map<String, Set<String>> configuredForPause, Set<TopicPartition> autoPause) { Set<TopicPartition> partitionsToPause = new HashSet<>(); for (TopicPartition assigned : currentAssignment) { if (isPartitionConfiguredForPause(assigned, configuredForPause)) { partitionsToPause.add(assigned); } if (autoPause.contains(assigned)) { if (!partitionsToPause.add(assigned)) { autoPause.remove(assigned); } } } return partitionsToPause; }

Target:
protected static Set<TopicPartition> determinePartitionsToPause(Set<TopicPartition> currentAssignment, Map<String, Set<String>> configuredForPause, Set<TopicPartition> autoPause) { Set<TopicPartition> partitionsToPause = new HashSet<>(); for (TopicPartition assigned : currentAssignment) { if (isPartitionConfiguredForPause(assigned, configuredForPause)) { partitionsToPause.add(assigned); } if (autoPause.contains(assigned) && !partitionsToPause.add(assigned)) { autoPause.remove(assigned); } } return partitionsToPause; }
Source:
protected Guid getImageGroupId() { return getRepresentativeImage().map(img -> img.getId()).orElse(Guid.Empty); }

Target:
protected Guid getImageGroupId() { return getRepresentativeImage().map(DiskImage::getId).orElse(Guid.Empty); }
Source:
public void downloadExcludedDependencyToLocalRepository(Artifact artifact) throws MojoExecutionException { CollectRequest collectRequest = new CollectRequest(); collectRequest.setRoot(new org.eclipse.aether.graph.Dependency(RepositoryUtils.toArtifact(artifact), null)); for (RemoteRepository repository : toAetherRepos(remoteRepositories)) { collectRequest.addRepository(repository); } DependencyFilter dependencyFilter = DependencyFilterUtils.classpathFilter(JavaScopes.RUNTIME); DependencyRequest dependencyRequest = new DependencyRequest(collectRequest, dependencyFilter); try { DependencyResult dependencyResult = repositorySystem.resolveDependencies(repositorySystemSession, dependencyRequest); List<ArtifactResult> results = dependencyResult.getArtifactResults(); if (results != null && results.size() != 0) { org.eclipse.aether.artifact.Artifact resolved = results.get(0).getArtifact(); artifact.setFile(resolved.getFile()); } } catch (DependencyResolutionException e) { throw new MojoExecutionException("Error while resolving dependency", e); } }

Target:
public void downloadExcludedDependencyToLocalRepository(Artifact artifact) throws MojoExecutionException { CollectRequest collectRequest = new CollectRequest(); collectRequest.setRoot(new Dependency(RepositoryUtils.toArtifact(artifact), null)); for (RemoteRepository repository : toAetherRepos(remoteRepositories)) { collectRequest.addRepository(repository); } DependencyFilter dependencyFilter = DependencyFilterUtils .classpathFilter(JavaScopes.RUNTIME, JavaScopes.COMPILE, JavaScopes.PROVIDED, JavaScopes.SYSTEM, JavaScopes.TEST); DependencyRequest dependencyRequest = new DependencyRequest(collectRequest, dependencyFilter); try { DependencyResult dependencyResult = repositorySystem.resolveDependencies(repositorySystemSession, dependencyRequest); List<ArtifactResult> results = dependencyResult.getArtifactResults(); if (results != null && results.size() != 0) { org.eclipse.aether.artifact.Artifact resolved = results.get(0).getArtifact(); artifact.setFile(resolved.getFile()); } } catch (DependencyResolutionException e) { throw new MojoExecutionException("Error while resolving dependency " + artifact.getGroupId() + ":" + artifact.getArtifactId() + ":" + artifact.getVersion(), e); } }
Source:
public static void assertAndLogWithException(Logger log, boolean cheapTest, String format, Throwable t, Object... args) { if (!cheapTest) { Object[] newArgs = new Object[args.length + 1]; newArgs[0] = t; System.arraycopy(args,0, newArgs, 1, args.length); log.error("Assertion " + format + " with exception ", newArgs); assert false : format; } }

Target:
public static void assertAndLogWithException(Logger log, boolean cheapTest, String format, Throwable t, Object... args) { if (!cheapTest) { Object[] newArgs = Arrays.copyOf(args, args.length + 2); newArgs[args.length] = SafeArg.of("format", format); newArgs[args.length + 1] = t; log.error("Assertion with exception!", newArgs); assert false : format; } }
Source:
public RunLengthBitPackingHybridValuesWriter(int bitWidth, int initialCapacity, int pageSize, ByteBufferAllocator allocator) { this.allocator = allocator; this.encoder = new RunLengthBitPackingHybridEncoder(bitWidth, initialCapacity, pageSize, this.allocator); }

Target:
public RunLengthBitPackingHybridValuesWriter(int bitWidth, int initialCapacity, int pageSize, ByteBufferAllocator allocator) { this.encoder = new RunLengthBitPackingHybridEncoder(bitWidth, initialCapacity, pageSize, allocator); }
Source:
public static byte[] writeUnsignedITF8(final int value) { final ByteBuffer buffer = ByteBuffer.allocate(10); writeUnsignedITF8(value, buffer); buffer.flip(); final byte[] array = new byte[buffer.limit()]; buffer.get(array); buffer.clear(); return array; }

Target:
public static byte[] writeUnsignedITF8(final int value) { final ByteBuffer buffer = ByteBuffer.allocate(MAX_BYTES); writeUnsignedITF8(value, buffer); buffer.flip(); final byte[] array = new byte[buffer.limit()]; buffer.get(array); buffer.clear(); return array; }
Source:
public void onCreate(Bundle savedInstanceState) { requestWindowFeature(Window.FEATURE_INDETERMINATE_PROGRESS); super.onCreate(savedInstanceState); setContentView(R.layout.main); mActivityWeakRef = new WeakReference<>(this); mInitialStartup = Application.getPrefs().getBoolean(INITIAL_STARTUP, true); Application.get().setUpSocial(); setupNavigationDrawer(); setupSlidingPanel(); setupMapState(savedInstanceState); setupLayersSpeedDial(); setupMyLocationButton(); setupZoomButtons(); setupGooglePlayServices(); UIUtils.setupActionBar(this); if (!mInitialStartup || PermissionUtils.hasGrantedPermissions(this, LOCATION_PERMISSIONS)) { checkRegionStatus(); } Bundle b = getIntent().getExtras(); if (b != null) { if (b.getBoolean(ShowcaseViewUtils.TUTORIAL_WELCOME)) { ShowcaseViewUtils.showTutorial(ShowcaseViewUtils.TUTORIAL_WELCOME, this, null); } } }

Target:
public void onCreate(Bundle savedInstanceState) { requestWindowFeature(Window.FEATURE_INDETERMINATE_PROGRESS); super.onCreate(savedInstanceState); Application.get().setUpSocial(); setContentView(R.layout.main); mActivityWeakRef = new WeakReference<>(this); mInitialStartup = Application.getPrefs().getBoolean(INITIAL_STARTUP, true); setupNavigationDrawer(); setupSlidingPanel(); setupMapState(savedInstanceState); setupLayersSpeedDial(); setupMyLocationButton(); setupZoomButtons(); setupGooglePlayServices(); UIUtils.setupActionBar(this); if (!mInitialStartup || PermissionUtils.hasGrantedPermissions(this, LOCATION_PERMISSIONS)) { checkRegionStatus(); } Bundle b = getIntent().getExtras(); if (b != null) { if (b.getBoolean(ShowcaseViewUtils.TUTORIAL_WELCOME)) { ShowcaseViewUtils.showTutorial(ShowcaseViewUtils.TUTORIAL_WELCOME, this, null); } } }
Source:
public Plan optimize(final Collection<EvaluatorParameters> activeEvaluators, final int availableEvaluators) { if (callsSkipped < callsToSkip) { callsSkipped++; return PlanImpl.newBuilder().build(); } if (callsMade == maxCallsToMake) { return PlanImpl.newBuilder().build(); } final Iterator<EvaluatorParameters> evaluatorIterator = activeEvaluators.iterator(); final EvaluatorParameters evaluatorToDelete = evaluatorIterator.next(); final EvaluatorParameters dstEvaluator = evaluatorIterator.next(); final DataInfo dataInfo = evaluatorToDelete.getDataInfos().iterator().next(); final TransferStep transferStep = new TransferStepImpl( evaluatorToDelete.getId(), dstEvaluator.getId(), new DataInfoImpl(dataInfo.getDataType(), dataInfo.getNumUnits())); callsMade++; return PlanImpl.newBuilder() .addEvaluatorToDelete(evaluatorToDelete.getId()) .addTransferStep(transferStep) .build(); }

Target:
public Plan optimize(final Collection<EvaluatorParameters> activeEvaluators, final int availableEvaluators) { if (callsSkipped < callsToSkip) { callsSkipped++; return PlanImpl.newBuilder().build(); } if (callsMade == maxCallsToMake) { return PlanImpl.newBuilder().build(); } final List<EvaluatorParameters> evaluators = new ArrayList<>(activeEvaluators); Collections.sort(evaluators, new Comparator<EvaluatorParameters>() { @Override public int compare(final EvaluatorParameters o1, final EvaluatorParameters o2) { return o1.getId().compareTo(o2.getId()); } }); if (evaluators.size() < 2) { throw new RuntimeException("Cannot delete, because not enough evaluators " + evaluators.size()); } final EvaluatorParameters evaluatorToDelete = evaluators.get(0); final EvaluatorParameters dstEvaluator = evaluators.get(1); final List<TransferStep> transferSteps = new ArrayList<>(); for (final DataInfo dataInfo : evaluatorToDelete.getDataInfos()) { transferSteps.add(new TransferStepImpl( evaluatorToDelete.getId(), dstEvaluator.getId(), new DataInfoImpl(dataInfo.getDataType(), dataInfo.getNumUnits()))); } callsMade++; return PlanImpl.newBuilder() .addEvaluatorToDelete(evaluatorToDelete.getId()) .addTransferSteps(transferSteps) .build(); }
Source:
private void copyStreams(InputStream from, OutputStream to) throws IOException{ try { byte[] buffer = new byte[4096]; int bytes_read; while ((bytes_read = from.read(buffer)) != -1) to.write(buffer, 0, bytes_read); } finally { if (from != null) try { from.close(); } catch (IOException e) { } if (to != null) try { to.close(); } catch (IOException e) { } } }

Target:
private void copyStreams(InputStream from, OutputStream to) throws IOException{ try { byte[] buffer = new byte[4096]; int bytes_read; while ((bytes_read = from.read(buffer)) != -1) to.write(buffer, 0, bytes_read); } finally { if (from != null) from.close(); if (to != null) to.close(); } }
Source:
public SshPairImpl get(String owner, String service, String name) throws ServerException, NotFoundException { requireNonNull(owner); requireNonNull(service); requireNonNull(name); try { EntityManager manager = managerProvider.get(); SshPairImpl result = manager.find(SshPairImpl.class, new SshPairPrimaryKey(owner, service, name)); if (result == null) { throw new NotFoundException(String.format("Ssh pair with service '%s' and name '%s' was not found.", service, name)); } return result; } catch (RuntimeException e) { throw new ServerException(e.getLocalizedMessage(), e); } }

Target:
public SshPairImpl get(String owner, String service, String name) throws ServerException, NotFoundException { requireNonNull(owner); requireNonNull(service); requireNonNull(name); try { SshPairImpl result = managerProvider.get().find(SshPairImpl.class, new SshPairPrimaryKey(owner, service, name)); if (result == null) { throw new NotFoundException(String.format("Ssh pair with service '%s' and name '%s' was not found.", service, name)); } return result; } catch (RuntimeException e) { throw new ServerException(e.getLocalizedMessage(), e); } }
Source:
protected void run(CancellationTokenSource tokenSource, IProgressMonitor monitor) throws Exception { final SubMonitor progress = SubMonitor.convert(monitor, this.builds.size() + 1); for (GradleBuild build : this.builds) { if (monitor.isCanceled()) { throw new OperationCanceledException(); } synchronizeBuild(build, tokenSource, progress.newChild(1)); } }

Target:
protected void run(CancellationTokenSource tokenSource, IProgressMonitor monitor) throws CoreException { final SubMonitor progress = SubMonitor.convert(monitor, this.builds.size() + 1); for (GradleBuild build : this.builds) { if (monitor.isCanceled()) { throw new OperationCanceledException(); } synchronizeBuild(build, tokenSource, progress.newChild(1)); } }
Source:
public String getBootType() { if (bootType != null && !("bios".equalsIgnoreCase(bootType) || "uefi".equalsIgnoreCase(bootType))) { throw new InvalidParameterValueException("Invalid Boot Type"); } return bootType; }

Target:
private ApiConstants.BootType getBootType() { if (StringUtils.isNotBlank(bootType)) { try { String type = bootType.trim().toUpperCase(); return ApiConstants.BootType.valueOf(type); } catch (IllegalArgumentException e) { String errMesg = "Invalid bootType " + bootType + "Specified for vm " + getName() + " Valid values are: " + Arrays.toString(ApiConstants.BootType.values()); s_logger.warn(errMesg); throw new InvalidParameterValueException(errMesg); } } return null; }
Source:
public static IfcfgConfigWriter getInstance() { if (instance == null) { instance = new IfcfgConfigWriter(); } return instance; }

Target:
public static synchronized IfcfgConfigWriter getInstance() { if (instance == null) { instance = new IfcfgConfigWriter(); } return instance; }
Source:
public void testDownloadCSV() throws Exception { BulkCommand command = createBuilder().param("schemas", ImmutableList.of("dublincore")) .bucket(100) .batch(40) .build(); bulkService.submit(command); assertTrue("Bulk action didn't finish", bulkService.await(command.getId(), Duration.ofSeconds(60))); BulkStatus status = bulkService.getStatus(command.getId()); assertEquals(COMPLETED, status.getState()); assertEquals(CREATED_TOTAL, status.getProcessed()); assertEquals(CREATED_TOTAL, status.getTotal()); Path dir = Files.createTempDirectory(CSVExportAction.ACTION_NAME + "test" + System.currentTimeMillis()); File testCsv = new File(dir.toFile(), "test.csv"); try (FileOutputStream out = new FileOutputStream(testCsv)) { HttpServletRequest request = mock(HttpServletRequest.class); when(request.getMethod()).thenReturn("GET"); HttpServletResponse response = mock(HttpServletResponse.class); ServletOutputStream sos = new DummyServletOutputStream() { @Override public void write(int b) throws IOException { out.write(b); } }; PrintWriter printWriter = new PrintWriter(sos); when(response.getOutputStream()).thenReturn(sos); when(response.getWriter()).thenReturn(printWriter); String url = (String) status.getResult().get("url"); downloadService.handleDownload(request, response, null, url); } List<String> lines = Files.lines(testCsv.toPath()).collect(Collectors.toList()); int headerCount = 0; for (String line : lines) { if (line.startsWith("repository,uid")) { headerCount++; } } assertEquals(1, headerCount); assertEquals(CREATED_TOTAL + headerCount, lines.size()); }

Target:
public void testDownloadCSV() throws Exception { BulkCommand command = createBuilder().param("schemas", ImmutableList.of("dublincore")) .bucket(100) .batch(40) .build(); bulkService.submit(command); assertTrue("Bulk action didn't finish", bulkService.await(command.getId(), Duration.ofSeconds(60))); BulkStatus status = bulkService.getStatus(command.getId()); assertEquals(COMPLETED, status.getState()); assertEquals(CREATED_TOTAL, status.getProcessed()); assertEquals(CREATED_TOTAL, status.getTotal()); Path dir = Files.createTempDirectory(CSVExportAction.ACTION_NAME + "test" + System.currentTimeMillis()); File testCsv = new File(dir.toFile(), "test.csv"); try (FileOutputStream out = new FileOutputStream(testCsv)) { HttpServletRequest request = mock(HttpServletRequest.class); when(request.getMethod()).thenReturn("GET"); HttpServletResponse response = mock(HttpServletResponse.class); ServletOutputStream sos = new DummyServletOutputStream() { @Override public void write(int b) throws IOException { out.write(b); } }; PrintWriter printWriter = new PrintWriter(sos); when(response.getOutputStream()).thenReturn(sos); when(response.getWriter()).thenReturn(printWriter); String url = (String) status.getResult().get("url"); downloadService.handleDownload(request, response, null, url); } List<String> lines = Files.lines(testCsv.toPath()).collect(Collectors.toList()); long headerCount = lines.stream().filter(line -> line.startsWith("repository,uid")).count(); assertEquals(1, headerCount); assertEquals(CREATED_TOTAL + headerCount, lines.size()); }
Source:
private static VariantData processInfoValueFields(String value, String key, String separator, VariantData variantData) { String[] terms = value.split(separator); for (String term: terms) { String[] innerTerms = term.split(INFO_FIELD_VALUE_SEPARATOR); String specificKey = key + INFO_FIELD_INNER_SEPARATOR + innerTerms[0]; if (ArrayUtils.contains(VariantData.INFO_RESERVED, innerTerms[0])) { if (innerTerms.length > 1) { processMultiValueField(innerTerms[1], specificKey, ALT_VALUE_SEPARATOR, variantData); } else { processSingleValueField(INFO_FIELD_DEFAULT_VALUE, specificKey, variantData); } } } return variantData; }

Target:
private static VariantData processInfoValueFields(String value, String key, String separator, VariantData variantData) { String[] terms = value.split(separator); for (String term: terms) { String[] innerTerms = term.split(INFO_FIELD_VALUE_SEPARATOR); if (ArrayUtils.contains(VariantData.INFO_RESERVED, innerTerms[0])) { String specificKey = key + INFO_FIELD_INNER_SEPARATOR + innerTerms[0]; if (innerTerms.length > 1) { processMultiValueField(innerTerms[1], specificKey, ALT_VALUE_SEPARATOR, variantData); } else { processSingleValueField(INFO_FIELD_DEFAULT_VALUE, specificKey, variantData); } } } return variantData; }
Source:
public long getShutdownMs() { if (get(TASK_SHUTDOWN_MS) == null) return DEFAULT_TASK_SHUTDOWN_MS; return Long.valueOf(get(TASK_SHUTDOWN_MS)); }

Target:
public long getShutdownMs() { String shutdownMs = get(TASK_SHUTDOWN_MS); try { return Long.parseLong(shutdownMs); } catch (NumberFormatException nfe) { LOGGER.warn(String.format( "Unable to parse user-configure value for %s - %s. Using default value %d", TASK_SHUTDOWN_MS, shutdownMs, DEFAULT_TASK_SHUTDOWN_MS)); return DEFAULT_TASK_SHUTDOWN_MS; } }
Source:
public boolean shouldOverrideUrlLoading(WebView view, String url) { if (url.equals(BuildConfig.SIGNUP_SUCCESS_REDIRECTION_URL)) { Timber.d("Overriding URL %s", url); Toast toast = Toast.makeText(SignupActivity.this, R.string.sign_up_activity_account, Toast.LENGTH_LONG); toast.show(); finish(); return true; } else { Timber.d("Not overriding URL, URL is: %s", url); return false; } }

Target:
public boolean shouldOverrideUrlLoading(WebView view, String url) { if (url.equals(BuildConfig.SIGNUP_SUCCESS_REDIRECTION_URL)) { Timber.d("Overriding URL %s", url); Toast toast = Toast.makeText(SignupActivity.this, R.string.account_created, Toast.LENGTH_LONG); toast.show(); finish(); return true; } else { Timber.d("Not overriding URL, URL is: %s", url); return false; } }
Source:
private int showKeySettings(int row) { for (String key : settings.getKeySettings()) { Label label = new Label(key); Label value = new Label(settings.getKeyCode(key).getName()); label.setTooltip(new Tooltip(settings.getDescription(key))); Button button = new Button(); button.setText("Change"); button.setOnAction(e -> { e.consume(); button.setText("Type new key"); button.setOnKeyPressed(k -> { KeyCode keyCode = k.getCode(); button.setText("Change"); value.setText(keyCode.getName()); settings.setKey(key, keyCode); button.setOnKeyPressed(empty -> { }); }); }); HBox box = new HBox(); box.setSpacing(20); box.getChildren().add(value); box.getChildren().add(button); gridPane.add(label, 0, row); gridPane.add(box, 1, row); row++; } return row; }

Target:
private int showKeySettings(int row) { for (String key : settings.getKeySettings()) { Label label = new Label(key); Label value = new Label(settings.getKeyCode(key).getName()); label.setTooltip(new Tooltip(settings.getDescription(key))); Button button = new Button(); button.setText("Change"); button.setOnAction(e -> { e.consume(); button.setText("Type new key"); button.setOnKeyPressed(k -> { KeyCode keyCode = k.getCode(); button.setText("Change"); value.setText(keyCode.getName()); settings.setKey(key, keyCode); button.setOnKeyPressed(null); }); }); HBox box = new HBox(); box.setSpacing(20); box.getChildren().add(value); box.getChildren().add(button); gridPane.add(label, 0, row); gridPane.add(box, 1, row); row++; } return row; }
Source:
public void removePatientFromCohort_shouldSaveCohortAfterRemovingPatient() throws Exception { executeDataSet(COHORT_XML); Patient patientToAddThenRemove = new Patient(4); service.addPatientToCohort(service.getCohort(2), patientToAddThenRemove); assertTrue(service.getCohort(2).contains(patientToAddThenRemove)); service.removePatientFromCohort(service.getCohort(2), patientToAddThenRemove); List<CohortMembership> memberList = service.getCohort(2) .getMembers().stream() .filter(m -> m.getPatient() == patientToAddThenRemove) .collect(Collectors.toList()); CohortMembership memberWithPatientToRemove = memberList.get(0); assertNotNull(memberWithPatientToRemove.getEndDate()); }

Target:
public void removePatientFromCohort_shouldSaveCohortAfterRemovingPatient() throws Exception { executeDataSet(COHORT_XML); Patient patientToAddThenRemove = new Patient(4); service.addPatientToCohort(service.getCohort(2), patientToAddThenRemove); assertTrue(service.getCohort(2).contains(patientToAddThenRemove.getPatientId())); service.removePatientFromCohort(service.getCohort(2), patientToAddThenRemove); List<CohortMembership> memberList = service.getCohort(2) .getMembers().stream() .filter(m -> m.getPatient().getPatientId().equals(patientToAddThenRemove.getPatientId())) .collect(Collectors.toList()); CohortMembership memberWithPatientToRemove = memberList.get(0); assertNotNull(memberWithPatientToRemove.getEndDate()); }
Source:
public boolean onContextItemSelected(MenuItem item) { AdapterView.AdapterContextMenuInfo info = (AdapterView.AdapterContextMenuInfo) item.getMenuInfo(); switch (item.getItemId()) { case 1: pokemonTeam.removePokemon(info.position); pokemonListAdapter.notifyDataSetChanged(); ((TeamBuildingActivity) getActivity()).updateList(); return true; case 2: selectedPos = info.position; Intent intent = new Intent(getActivity().getApplicationContext(), SearchableActivity.class); intent.putExtra("Search Type", SearchableActivity.REQUEST_CODE_SEARCH_POKEMON); startActivityForResult(intent, SearchableActivity.REQUEST_CODE_SEARCH_POKEMON); return true; default: return super.onContextItemSelected(item); } }

Target:
public boolean onContextItemSelected(MenuItem item) { AdapterView.AdapterContextMenuInfo info = (AdapterView.AdapterContextMenuInfo) item.getMenuInfo(); switch (item.getItemId()) { case 1: pokemonTeam.removePokemon(info.position); pokemonListAdapter.notifyDataSetChanged(); ((TeamBuildingActivity) getActivity()).updateList(); return true; case 2: selectedPos = info.position; Intent intent = new Intent(getActivity().getApplicationContext(), SearchableActivity.class); intent.putExtra(SearchableActivity.SEARCH_TYPE, SearchableActivity.REQUEST_CODE_SEARCH_POKEMON); startActivityForResult(intent, SearchableActivity.REQUEST_CODE_SEARCH_POKEMON); return true; default: return super.onContextItemSelected(item); } }
Source:
public void init() { String configPath = LocalConfig.getInstance().getUsrDir().getPath() + "/conf/oss.conf.d"; load(FileSystems.getDefault().getPath(configPath)); }

Target:
public void init() { load( FileSystems.getDefault().getPath( EngineLocalConfig.getInstance().getEtcDir().getAbsolutePath(), "oss.conf.d" ) ); }
Source:
private long getMultComplexity(long x) { long x2 = (long) Math.pow(x, 2); if (x <= 64) return x2; if (x <= 1024) return x2 / 4 + 96 * x - 3072; return x2 / 16 + 480 * x - 199680; }

Target:
private long getMultComplexity(long x) { long x2 = x * x; if (x <= 64) return x2; if (x <= 1024) return x2 / 4 + 96 * x - 3072; return x2 / 16 + 480 * x - 199680; }
Source:
public void performStreamOperation(LuceneWork singleOperation, IndexingMonitor monitor, boolean forceAsync) { if ( singleOperation instanceof FlushLuceneWork ) { requestProcessor.awaitAsyncProcessingCompletion(); } BackendRequest<?> request = singleOperation.acceptIndexWorkVisitor( visitor, monitor ); if ( request != null ) { if ( forceAsync ) { requestProcessor.executeAsync( request ); } else { requestProcessor.executeSync( Collections.<BackendRequest<?>>singletonList( request ) ); } } }

Target:
public void performStreamOperation(LuceneWork singleOperation, IndexingMonitor monitor, boolean forceAsync) { BackendRequest<?> request = singleOperation.acceptIndexWorkVisitor( visitor, monitor ); if ( singleOperation instanceof FlushLuceneWork ) { requestProcessor.awaitAsyncProcessingCompletion(); executeBackendRequest( request, true ); } else { executeBackendRequest( request, false ); } }
Source:
private String createOutput(final LnClientConnection conn, final List<ClassIdObisAttr> allObisCodes) throws ProtocolAdapterException, IOException, TimeoutException { String output = ""; int index = 1; for (final ClassIdObisAttr obisAttr : allObisCodes) { LOGGER.info("Creating output for {}/{}", obisAttr.getObisCode().value(), index++, allObisCodes.size()); output += this.getAllDataFromObisCode(conn, obisAttr); LOGGER.info("Length of output is now: {}", output.length()); } return output; }

Target:
private String createOutput(final LnClientConnection conn, final List<ClassIdObisAttr> allObisCodes) throws ProtocolAdapterException, IOException, TimeoutException { String output = ""; int index = 1; for (final ClassIdObisAttr obisAttr : allObisCodes) { LOGGER.debug("Creating output for {}/{}", obisAttr.getObisCode().value(), index++, allObisCodes.size()); output += this.getAllDataFromObisCode(conn, obisAttr); LOGGER.debug("Length of output is now: {}", output.length()); } return output; }
Source:
public static AABB createEncompassing(Iterable<AABB> others) { Vector3f min; Vector3f max; Iterator<AABB> i = others.iterator(); if (i.hasNext()) { AABB next = i.next(); min = next.getMin(); max = next.getMax(); } else { return createEmpty(); } while (i.hasNext()) { AABB next = i.next(); Vector3f otherMin = next.getMin(); Vector3f otherMax = next.getMax(); min.min(otherMin); max.max(otherMax); } return new AABB(min, max); }

Target:
public static AABB createEncompassing(Iterable<AABB> others) { Vector3f min; Vector3f max; Iterator<AABB> i = others.iterator(); if (i.hasNext()) { AABB next = i.next(); min = next.getMin(); max = next.getMax(); } else { return createEmpty(); } while (i.hasNext()) { AABB next = i.next(); Vector3f otherMin = next.getMin(); Vector3f otherMax = next.getMax(); Vector3fUtil.min(min, otherMin, min); Vector3fUtil.max(max, otherMax, max); } return new AABB(min, max); }
Source:
public boolean applicabilityExistsOnBranchView(BranchId branch, ArtifactId viewId, String applicability) { boolean exists = false; List<GammaId> tuples = new ArrayList<>(); queryFactory.tupleQuery().getTuple2GammaFromE1E2(CoreTupleTypes.ViewApplicability, branch, viewId, applicability, tuples::add); if (!tuples.isEmpty()) { exists = true; } return exists; }

Target:
public boolean applicabilityExistsOnBranchView(BranchId branch, ArtifactId viewId, String applicability) { List<GammaId> tuples = new ArrayList<>(); queryFactory.tupleQuery().getTuple2GammaFromE1E2(CoreTupleTypes.ViewApplicability, branch, viewId, applicability, tuples::add); return tuples.isEmpty(); }
Source:
private synchronized Comparable<Object> foo() { return new Comparable<Object>() { @Override public int compareTo(Object o) { value = 0; return 0; } }; }

Target:
private void foo() { synchronized (new Object()) { Comparable<Object> cmp = new Comparable<Object>() { @Override public int compareTo(Object o) { value = 0; return 0; } }; } }
Source:
private void removeTagFromChildrenCacheEntries(TagCacheEntry entry, CVSTag tag) { Iterator childrenIterator = entry.getChildrenIterator(); while (childrenIterator.hasNext()) { TagCacheEntry child = (TagCacheEntry) childrenIterator.next(); removeTagFromChildrenCacheEntries(child, tag); child.getTags().remove(tag); if (child.getTags().size() == 0 && child.children.size() == 0) { removeTagCacheEntry(child); } } }

Target:
private void removeTagFromChildrenCacheEntries(TagCacheEntry entry, CVSTag tag) { Iterator childrenIterator = entry.getChildrenIterator(); while (childrenIterator.hasNext()) { TagCacheEntry child = (TagCacheEntry) childrenIterator.next(); removeTagFromChildrenCacheEntries(child, tag); child.getTags().remove(tag); if (child.isEmpty()) { removeTagCacheEntry(child); } } }