auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public byte[] getCacheKey() { byte[] dimBytes = StringUtils.toUtf8(this.dimension); byte[] valBytes = StringUtils.toUtf8(this.value); byte[] extractionFnBytes = null; if (this.getExtractionFn() != null) { extractionFnBytes = this.getExtractionFn().getCacheKey(); } if (extractionFnBytes != null) { return ByteBuffer.allocate(2 + dimBytes.length + valBytes.length + extractionFnBytes.length) .put(CACHE_KEY) .put(dimBytes) .put(STRING_SEPARATOR) .put(valBytes) .put(extractionFnBytes) .array(); } else { return ByteBuffer.allocate(2 + dimBytes.length + valBytes.length) .put(CACHE_KEY) .put(dimBytes) .put(STRING_SEPARATOR) .put(valBytes) .array(); } }

Target:
public byte[] getCacheKey() { byte[] dimBytes = StringUtils.toUtf8(dimension); byte[] valBytes = StringUtils.toUtf8(value); byte extractionFnBytes = this.getExtractionFn().getCacheKey(); return ByteBuffer.allocate(3 + dimBytes.length + valBytes.length + extractionFnBytes.length) .put(CACHE_KEY) .put(dimBytes) .put(STRING_SEPARATOR) .put(valBytes) .put(STRING_SEPARATOR) .put(extractionFnBytes) .array(); }
Source:
public Response stop(Action action) { validateParameters(action); return performServiceAction(action, GlusterServiceActionType.stop); }

Target:
public Response stop(Action action) { validateParameters(action); return performServiceAction(action, GlusterServiceActionType.STOP); }
Source:
public void testJdbcPOJOPollInputOperatorApplication() throws Exception { try { LocalMode lma = LocalMode.newInstance(); Configuration conf = new Configuration(false); conf.addResource(this.getClass().getResourceAsStream("/JdbcProperties.xml")); lma.prepareDAG(new JdbcPOJOPollInputOperatorApplication(), conf); LocalMode.Controller lc = lma.getController(); lc.setHeartbeatMonitoringEnabled(false); ((StramLocalCluster)lc).setExitCondition(new Callable<Boolean>() { @Override public Boolean call() throws Exception { return TupleCount == 10; } }); lc.run(10000); Assert.assertEquals("rows in db", TupleCount, getNumOfRowsinTable(TABLE_POJO_NAME)); } catch (ConstraintViolationException e) { Assert.fail("constraint violations: " + e.getConstraintViolations()); } }

Target:
public void testJdbcPOJOPollInputOperatorApplication() throws Exception { testApplication(new JdbcPOJOPollInputOperatorApplication()); }
Source:
public static BoilerpipeExtractor getExtractor(String boilerpipeExtractorName) { if (!extractorRepository.containsKey(boilerpipeExtractorName)) { boilerpipeExtractorName = "de.l3s.boilerpipe.extractors." + boilerpipeExtractorName; try { ClassLoader loader = BoilerpipeExtractor.class.getClassLoader(); Class extractorClass = loader.loadClass(boilerpipeExtractorName); extractorRepository.put(boilerpipeExtractorName, (BoilerpipeExtractor)extractorClass.newInstance()); } catch (ClassNotFoundException e) { LOG.error("BoilerpipeExtractor " + boilerpipeExtractorName + " not found!"); } catch (InstantiationException e) { LOG.error("Could not instantiate " + boilerpipeExtractorName); } catch (Exception e) { LOG.error(e); } } return extractorRepository.get(boilerpipeExtractorName); }

Target:
public static BoilerpipeExtractor getExtractor(String boilerpipeExtractorName) { if (!extractorRepository.containsKey(boilerpipeExtractorName)) { boilerpipeExtractorName = "de.l3s.boilerpipe.extractors." + boilerpipeExtractorName; try { ClassLoader loader = BoilerpipeExtractor.class.getClassLoader(); Class extractorClass = loader.loadClass(boilerpipeExtractorName); extractorRepository.put(boilerpipeExtractorName, (BoilerpipeExtractor)extractorClass.newInstance()); } catch (ClassNotFoundException e) { LOG.error("BoilerpipeExtractor not found!", boilerpipeExtractorName); } catch (InstantiationException e) { LOG.error("Could not instantiate {}!", boilerpipeExtractorName); } catch (Exception e) { LOG.error("Error due to the {}!",boilerpipeExtractorName, e); } } return extractorRepository.get(boilerpipeExtractorName); }
Source:
public long updateBandwidthEstimate(long nowMs) { currentBitrateBps = changeBitrate( currentBitrateBps, currentInput.incomingBitRate, nowMs); DiagnosticContext diagnosticContext = this.diagnosticContextProvider.getDiagnosticContext(); if (isValidEstimate() && logger.isTraceEnabled() && diagnosticContext != null) { logger.trace(diagnosticContext .makeTimeSeriesPoint("new_rate_estimate") .addField("estimate", currentBitrateBps) .addField("incoming", currentInput.incomingBitRate) .setTimestampMs(nowMs)); } if (nowMs - timeOfLastLog > kLogIntervalMs) timeOfLastLog = nowMs; return currentBitrateBps; }

Target:
public long updateBandwidthEstimate(long nowMs) { currentBitrateBps = changeBitrate( currentBitrateBps, currentInput.incomingBitRate, nowMs); if (logger.isTraceEnabled() && isValidEstimate()) { logger.trace(diagnosticContext .makeTimeSeriesPoint("new_rate_estimate", nowMs) .addKey("aimd", hashCode()) .addField("estimate", currentBitrateBps) .addField("incoming", currentInput.incomingBitRate)); } if (nowMs - timeOfLastLog > kLogIntervalMs) timeOfLastLog = nowMs; return currentBitrateBps; }
Source:
public void run() { log.info("Starting writer"); try { writerRegistry.register(this); running = true; runUntilCanceled(); } catch (InterruptedException ie) { log.info("Exiting due to thread interrupt"); Thread.currentThread().interrupt(); } catch (Exception e) { log.error("Caught exception running writer: {}", e.getMessage(), e); } finally { running = false; writerRegistry.unregister(this); } }

Target:
public void run() { log.info("Starting writer"); try { writerRegistry.register(this); running = true; runUntilCanceled(); } catch (InterruptedException ie) { log.info("Exiting due to thread interrupt"); Thread.currentThread().interrupt(); } finally { running = false; writerRegistry.unregister(this); } }
Source:
public final void readExecutionData(File jacocoExecutionData, SensorContext context) throws IOException { ExecutionDataVisitor executionDataVisitor = new ExecutionDataVisitor(); if (jacocoExecutionData == null || !jacocoExecutionData.exists() || !jacocoExecutionData.isFile()) { JaCoCoExtensions.LOG.warn("Project coverage is set to 0% as no JaCoCo execution data has been dumped: {}", jacocoExecutionData); } else { JaCoCoExtensions.LOG.info("Analysing {}", jacocoExecutionData); InputStream inputStream = null; try { inputStream = new BufferedInputStream(new FileInputStream(jacocoExecutionData)); ExecutionDataReader reader = new ExecutionDataReader(inputStream); reader.setSessionInfoVisitor(executionDataVisitor); reader.setExecutionDataVisitor(executionDataVisitor); reader.read(); } finally { Closeables.closeQuietly(inputStream); } } CoverageBuilder coverageBuilder = analyze(executionDataVisitor.getMerged()); int analyzedResources = 0; for (ISourceFileCoverage coverage : coverageBuilder.getSourceFiles()) { Resource resource = getResource(coverage, context); if (resource != null) { CoverageMeasuresBuilder builder = analyzeFile(resource, coverage); saveMeasures(context, resource, builder.createMeasures()); analyzedResources++; } } if (analyzedResources == 0) { JaCoCoExtensions.LOG.warn("Coverage information was not collected. Perhaps you forget to include debug information into compiled classes?"); } else { JaCoCoExtensions.LOG.info("No information about coverage per test."); } }

Target:
public final void readExecutionData(File jacocoExecutionData, SensorContext context) throws IOException { ExecutionDataVisitor executionDataVisitor = new ExecutionDataVisitor(); if (jacocoExecutionData == null || !jacocoExecutionData.isFile()) { JaCoCoExtensions.LOG.warn("Project coverage is set to 0% as no JaCoCo execution data has been dumped: {}", jacocoExecutionData); } else { JaCoCoExtensions.LOG.info("Analysing {}", jacocoExecutionData); InputStream inputStream = null; try { inputStream = new BufferedInputStream(new FileInputStream(jacocoExecutionData)); ExecutionDataReader reader = new ExecutionDataReader(inputStream); reader.setSessionInfoVisitor(executionDataVisitor); reader.setExecutionDataVisitor(executionDataVisitor); reader.read(); } finally { Closeables.closeQuietly(inputStream); } } CoverageBuilder coverageBuilder = analyze(executionDataVisitor.getMerged()); int analyzedResources = 0; for (ISourceFileCoverage coverage : coverageBuilder.getSourceFiles()) { InputFile groovyFile = getInputFile(coverage); if (groovyFile != null) { CoverageMeasuresBuilder builder = analyzeFile(coverage); saveMeasures(context, groovyFile, builder.createMeasures()); analyzedResources++; } } if (analyzedResources == 0) { JaCoCoExtensions.LOG.warn("Coverage information was not collected. Perhaps you forget to include debug information into compiled classes?"); } else { JaCoCoExtensions.LOG.info("No information about coverage per test."); } }
Source:
protected Set<PropertyPathConnector> getAllSchemaPropertiesConnectors(boolean isOutputConnection) { if (isOutputConnection) { return Collections.singleton(MAIN_CONNECTOR); } else { return Collections.EMPTY_SET; } }

Target:
protected Set<PropertyPathConnector> getAllSchemaPropertiesConnectors(boolean isOutputConnection) { if (isOutputConnection) { return Collections.singleton(MAIN_CONNECTOR); } else { return Collections.emptySet(); } }
Source:
public RqBuffered(final Request req) { super( new RqOf( req::head, () -> new BufferedInputStream(req.body()) ) ); }

Target:
public RqBuffered(final Request req) { super( new RequestOf( req::head, () -> new BufferedInputStream(req.body()) ) ); }
Source:
public Merchandise__c() { super(); getAttributes().setType("Merchandise__c"); }

Target:
public Merchandise__c() { getAttributes().setType("Merchandise__c"); }
Source:
public synchronized boolean append(@NonNull ICTFPacketDescriptor entry) { ICTFPacketDescriptor entryToAdd = entry; if (entryToAdd.getTimestampBegin() > entryToAdd.getTimestampEnd()) { Activator.log(IStatus.WARNING, "Packet at offset " + entryToAdd.getOffsetBytes() + " begin timestamp is after end timestamp"); entryToAdd = new StreamInputPacketIndexEntry(entryToAdd, Long.MAX_VALUE); } if (!fEntries.isEmpty()) { ICTFPacketDescriptor lastElement = lastElement(); if ((entryToAdd.getTimestampBegin() < lastElement.getTimestampBegin()) && (lastElement.getContentSizeBits() > lastElement.getPayloadStartBits())) { return false; } } fEntries.add(entryToAdd); return true; }

Target:
public synchronized boolean append(@NonNull ICTFPacketDescriptor entry) { ICTFPacketDescriptor entryToAdd = entry; if (entryToAdd.getTimestampBegin() > entryToAdd.getTimestampEnd()) { Activator.log(IStatus.WARNING, "Packet at offset " + entryToAdd.getOffsetBytes() + " begin timestamp is after end timestamp"); entryToAdd = new StreamInputPacketIndexEntry(entryToAdd, Long.MAX_VALUE); } if (!contains(entryToAdd)) { fEntries.add(entryToAdd); fEntries.sort(OFFSET_COMPARE); return true; } return false; }
Source:
private static int printClassDefinitions( String basename, AClass aClass, PrintWriter printWriter) { String[] classNames = basename.split("\\$"); TypeElement innermostTypeElt = aClass.getTypeElement(); TypeElement[] typeElements = getTypeElementsForClasses(innermostTypeElt, classNames); if (innermostTypeElt == null) { throw new BugInCF("typeElement was unexpectedly null in this aClass: " + aClass); } for (int i = 0; i < classNames.length; i++) { String nameToPrint = classNames[i]; printWriter.print(indents(i)); if (aClass.isEnum(nameToPrint)) { printWriter.print("enum "); } else { printWriter.print("class "); } if (i == classNames.length - 1) { printWriter.print(formatAnnotations(aClass.getAnnotations())); } printWriter.print(nameToPrint); printTypeParameters(typeElements[i], printWriter); printWriter.println(" {"); if (aClass.isEnum(nameToPrint) && i != classNames.length - 1) { printWriter.println(indents(i + 1) + " ;"); } printWriter.println(); } return classNames.length; }

Target:
private static int printClassDefinitions( String basename, AClass aClass, PrintWriter printWriter) { String[] classNames = basename.split("\\$"); TypeElement innermostTypeElt = aClass.getTypeElement(); if (innermostTypeElt == null) { throw new BugInCF("typeElement was unexpectedly null in this aClass: " + aClass); } TypeElement[] typeElements = getTypeElementsForClasses(innermostTypeElt, classNames); for (int i = 0; i < classNames.length; i++) { String nameToPrint = classNames[i]; printWriter.print(indents(i)); if (aClass.isEnum(nameToPrint)) { printWriter.print("enum "); } else { printWriter.print("class "); } if (i == classNames.length - 1) { printWriter.print(formatAnnotations(aClass.getAnnotations())); } printWriter.print(nameToPrint); printTypeParameters(typeElements[i], printWriter); printWriter.println(" {"); if (aClass.isEnum(nameToPrint) && i != classNames.length - 1) { printWriter.println(indents(i + 1) + " ;"); } printWriter.println(); } return classNames.length; }
Source:
public JenkinsOrchestrator newFreestyleJobWithMaven(String jobName, File projectPath, String branch) { newFreestyleJobConfig(jobName, projectPath); findElement(By.name("hudson-plugins-sonar-SonarBuildWrapper")).click(); findElement(buttonByText("Add build step")).click(); findElement(By.linkText("Invoke top-level Maven targets")).click(); setTextValue(findElement(By.name("_.targets")), "clean package"); findElement(buttonByText("Add build step")).click(); findElement(By.linkText("Invoke top-level Maven targets")).click(); setTextValue(findElement(By.name("_.targets"), 1), "$SONAR_MAVEN_GOAL -Dsonar.host.url=$SONAR_HOST_URL"); findElement(buttonByText("Save")).click(); return this; }

Target:
public JenkinsOrchestrator newFreestyleJobWithMaven(String jobName, File projectPath, String branch) { newFreestyleJobConfig(jobName, projectPath); findElement(By.name("hudson-plugins-sonar-SonarBuildWrapper")).click(); findElement(buttonByText("Add build step")).click(); findElement(By.linkText("Invoke top-level Maven targets")).click(); setTextValue(findElement(By.name("_.targets")), "clean package"); findElement(buttonByText("Add build step")).click(); findElement(By.linkText("Invoke top-level Maven targets")).click(); setTextValue(findElement(By.name("_.targets"), 1), getMavenParams()); findElement(buttonByText("Save")).click(); return this; }
Source:
default Iterable<PipelinedRegion<VID, RID, V, R>> getAllPipelinedRegions() { throw new UnsupportedOperationException(); }

Target:
default Iterable<PR> getAllPipelinedRegions() { throw new UnsupportedOperationException(); }
Source:
public void testAllJdkCipherSuitesMapping() { final MechanismDatabase mechanismDatabase = MechanismDatabase.getInstance(); SSLServerSocketFactory ssf = (SSLServerSocketFactory) SSLServerSocketFactory.getDefault(); String[] supportedCipherSuites = ssf.getSupportedCipherSuites(); List<String> TLS1_3CipherSuites = Arrays.asList("TLS_AES_128_GCM_SHA256", "TLS_AES_256_GCM_SHA384"); String unknownCipherSuites = Arrays.stream(supportedCipherSuites) .filter(cipherSuite -> !TLS1_3CipherSuites.contains(cipherSuite) && !cipherSuite.equals("TLS_EMPTY_RENEGOTIATION_INFO_SCSV") && mechanismDatabase.getCipherSuite(cipherSuite) == null) .collect(Collectors.joining(", ")); Assert.assertTrue("There are JDK cipher suites which are unknown to Elytron MechanismDatabase: " + unknownCipherSuites, unknownCipherSuites.isEmpty()); }

Target:
public void testAllJdkCipherSuitesMapping() { final MechanismDatabase mechanismDatabase = MechanismDatabase.getInstance(); SSLServerSocketFactory ssf = (SSLServerSocketFactory) SSLServerSocketFactory.getDefault(); String[] supportedCipherSuites = ssf.getSupportedCipherSuites(); List<String> TLS1_3CipherSuites = Arrays.asList("TLS_AES_128_GCM_SHA256", "TLS_AES_256_GCM_SHA384", "TLS_CHACHA20_POLY1305_SHA256", "TLS_AES_128_CCM_SHA256", "TLS_AES_128_CCM_8_SHA256"); String unknownCipherSuites = Arrays.stream(supportedCipherSuites) .filter(cipherSuite -> !TLS1_3CipherSuites.contains(cipherSuite) && !cipherSuite.equals("TLS_EMPTY_RENEGOTIATION_INFO_SCSV") && mechanismDatabase.getCipherSuite(cipherSuite) == null) .collect(Collectors.joining(", ")); Assert.assertTrue("There are JDK cipher suites which are unknown to Elytron MechanismDatabase: " + unknownCipherSuites, unknownCipherSuites.isEmpty()); }
Source:
public void testListPathWithValidListMaxResultsValues() throws IOException, ExecutionException, InterruptedException { final int fileCount = 10; final String directory = "testWithValidListMaxResultsValues"; createDirectoryWithNFiles(directory, fileCount); final int[] testData = {fileCount + 100, fileCount + 1, fileCount, fileCount - 1, 1}; for (int i = 0; i < testData.length; i++) { int listMaxResults = testData[i]; setListMaxResults(listMaxResults); int expectedListResultsSize = listMaxResults > fileCount ? fileCount : listMaxResults; assertThat(listPath(directory).size(), is(equalTo(expectedListResultsSize))); } }

Target:
public void testListPathWithValidListMaxResultsValues() throws IOException, ExecutionException, InterruptedException { final int fileCount = 10; final String directory = "testWithValidListMaxResultsValues"; createDirectoryWithNFiles(directory, fileCount); final int[] testData = {fileCount + 100, fileCount + 1, fileCount, fileCount - 1, 1}; for (int i = 0; i < testData.length; i++) { int listMaxResults = testData[i]; setListMaxResults(listMaxResults); int expectedListResultsSize = listMaxResults > fileCount ? fileCount : listMaxResults; Assertions.assertThat(listPath(directory)).describedAs( "AbfsClient.listPath result should contain %d items when " + "listMaxResults is %d and directory contains %d items", expectedListResultsSize, listMaxResults, fileCount) .hasSize(expectedListResultsSize); } }
Source:
public String choose(VolumeChooserEnvironment env, String[] options) throws AccumuloException { if (log.isTraceEnabled()) { log.trace("PerTableVolumeChooser.choose"); } VolumeChooser chooser; if (!env.hasTableId() && !env.hasScope()) { return randomChooser.choose(env, options); } ServerConfigurationFactory localConf = loadConf(); lazilyCreateFallbackChooser(); if (env.hasScope()) { chooser = getVolumeChooserForNonTable(env, localConf); } else { chooser = getVolumeChooserForTable(env, localConf); } return chooser.choose(env, options); }

Target:
public String choose(VolumeChooserEnvironment env, String[] options) throws VolumeChooserException { log.trace("{}.choose", getClass().getSimpleName()); return getDelegateChooser(env).choose(env, options); }
Source:
private static void showDialog(final Context context, String title, String message) { AlertDialog.Builder alertDialog = new AlertDialog.Builder(context); alertDialog.setTitle(title); alertDialog.setMessage(message) .setPositiveButton("OK", new DialogInterface.OnClickListener() { @Override public void onClick(DialogInterface dialog, int which) { dialog.dismiss(); } }); alertDialog.show(); }

Target:
private static void showDialog(final Context context, String title, String message) { AlertDialog.Builder alertDialog = new AlertDialog.Builder(context); alertDialog.setTitle(title); alertDialog.setMessage(message) .setPositiveButton(R.string.ok, new DialogInterface.OnClickListener() { @Override public void onClick(DialogInterface dialog, int which) { dialog.dismiss(); } }); alertDialog.show(); }
Source:
public void updatePresentation(@NotNull NodePresentation presentation) { presentation.setPresentableText(getData().getName()); presentation.setPresentableIcon(isValid(getData()) ? nodeManager.getNodesResources().projectFolder() : nodeManager.getNodesResources().notValidProjectFolder()); presentation.setPresentableTextCss("font-weight:bold"); if ("private".equals(getData().getVisibility())) { SpanElement lockElement = Document.get().createSpanElement(); lockElement.appendChild(nodeManager.getNodesResources().lock().getSvg().getElement()); presentation.setUserElement(lockElement); } }

Target:
public void updatePresentation(@NotNull NodePresentation presentation) { presentation.setPresentableText(getData().getName()); presentation.setPresentableIcon(isValid(getData()) ? nodeManager.getNodesResources().projectFolder() : nodeManager.getNodesResources().notValidProjectFolder()); presentation.setPresentableTextCss("font-weight:bold"); }
Source:
private void setupBackupRenamePath() { DateTimeFormatter formatter = configuration.getBackupDirDateTimeFormatter(); String subDirNm = formatter.format(LocalDate.now()); int n = 0; do { renamePath.of(configuration.getBackupRoot()).put(Files.SEPARATOR).concat(subDirNm); if (n > 0) { renamePath.put('.').put(Integer.valueOf(n).toString()); } renamePath.put(Files.SEPARATOR).$(); n++; } while (ff.exists(renamePath)); if (ff.mkdirs(renamePath, configuration.getMkDirMode()) != 0) { throw CairoException.instance(ff.errno()).put("could not create [dir=").put(renamePath).put(']'); } }

Target:
private void setupBackupRenamePath() { TimestampFormat format = configuration.getBackupDirTimestampFormat(); long epochMicros = configuration.getMicrosecondClock().getTicks(); int n = 0; renamePath.of(configuration.getBackupRoot()).put(Files.SEPARATOR); int plen = renamePath.length(); do { renamePath.trimTo(plen); format.format(epochMicros, configuration.getDefaultTimestampLocale(), null, renamePath); if (n > 0) { renamePath.put('.').put(n); } renamePath.put(Files.SEPARATOR).$(); n++; } while (ff.exists(renamePath)); if (ff.mkdirs(renamePath, configuration.getBackupMkDirMode()) != 0) { throw CairoException.instance(ff.errno()).put("could not create [dir=").put(renamePath).put(']'); } }
Source:
protected void verify() { ofNullable(duration).orElseThrow(() -> new IllegalArgumentException("Duration value should not be a null value")); }

Target:
protected void verify() { }
Source:
private String getConstraint(final ItemDefinition itemDefinition) { final UnaryTests allowedValues = itemDefinition.getAllowedValues(); if (allowedValues != null && !allowedValues.getText().getValue().isEmpty()) { return translationService.format(DMNDocumentationFactory_Constraints) + allowedValues.getText().getValue(); } return ""; }

Target:
private String getConstraint(final ItemDefinition itemDefinition) { final UnaryTests allowedValues = itemDefinition.getAllowedValues(); if (allowedValues != null && !isEmpty(allowedValues.getText().getValue())) { return translationService.format(DMNDocumentationFactory_Constraints) + " " + allowedValues.getText().getValue(); } return ""; }
Source:
public void onPause() { super.onPause(); prefs.unregisterOnSharedPreferenceChangeListener(this); if(!requireFullRestart) { finish(); } else { Toast.makeText(this, "You've changed some important settings, the app will restart.", Toast.LENGTH_SHORT).show(); SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(this); prefs.edit().putBoolean("require-layout-update", true).apply(); Intent intent = new Intent(this, getClass()); intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP | Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_NO_ANIMATION); finish(); overridePendingTransition(0, 0); startActivity(intent); overridePendingTransition(0, 0); return; } }

Target:
public void onPause() { super.onPause(); prefs.unregisterOnSharedPreferenceChangeListener(this); if(!requireFullRestart) { finish(); } else { Toast.makeText(this, R.string.app_wil_restart, Toast.LENGTH_SHORT).show(); SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(this); prefs.edit().putBoolean("require-layout-update", true).apply(); Intent intent = new Intent(this, getClass()); intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP | Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_NO_ANIMATION); finish(); overridePendingTransition(0, 0); startActivity(intent); overridePendingTransition(0, 0); return; } }
Source:
public void initialize(ConfigurableApplicationContext applicationContext) { String adminPort = applicationContext.getEnvironment().resolvePlaceholders(ADMIN_PORT_PLACEHOLDER); ServerSocket socket = null; try { socket = new ServerSocket(Integer.parseInt(adminPort)); } catch (IOException e) { throw new AdminPortNotAvailableException(adminPort); } finally { if (socket != null) { try { socket.close(); } catch (IOException e) { e.printStackTrace(); } } } }

Target:
public void initialize(ConfigurableApplicationContext applicationContext) { String adminPort = applicationContext.getEnvironment().resolvePlaceholders(ADMIN_PORT_PLACEHOLDER); ServerSocket socket = null; try { socket = new ServerSocket(Integer.parseInt(adminPort)); } catch (IOException e) { throw new AdminPortNotAvailableException(adminPort); } finally { if (socket != null) { try { socket.close(); } catch (IOException e) { } } } }
Source:
public void inventoryTick(ItemStack stack, World worldIn, Entity entityIn, int itemSlot, boolean isSelected) { if(entityIn instanceof ServerPlayerEntity) { if(PlayerSavedData.getData((ServerPlayerEntity) entityIn).getTitle() != null) { if (PlayerSavedData.getData((ServerPlayerEntity) entityIn).getTitle().getHeroAspect() == aspect && isSelected) { ((ServerPlayerEntity) entityIn).addPotionEffect(new EffectInstance(effect, duration, effectTier)); } } } }

Target:
public void inventoryTick(ItemStack stack, World worldIn, Entity entityIn, int itemSlot, boolean isSelected) { if(isSelected && entityIn instanceof ServerPlayerEntity) { Title title = PlayerSavedData.getData((ServerPlayerEntity) entityIn).getTitle(); if(title != null) { if (title.getHeroAspect() == aspect) { ((ServerPlayerEntity) entityIn).addPotionEffect(new EffectInstance(effect.get(), duration, effectTier)); } } } }
Source:
static void toGerrit(final String target, final HttpServletRequest req, final HttpServletResponse rsp) throws IOException { final StringBuilder url = new StringBuilder(); url.append(URLEncoder.encode(req.getContextPath(), "UTF-8")); url.append('/'); url.append('#'); url.append(target); rsp.sendRedirect(url.toString()); }

Target:
static void toGerrit(final String target, final HttpServletRequest req, final HttpServletResponse rsp) throws IOException { final StringBuilder url = new StringBuilder(); url.append(req.getContextPath()); url.append('/'); url.append('#'); url.append(target); rsp.sendRedirect(url.toString()); }
Source:
public static <T> PredicateOperation predicate(Operator operator, ImmutableList<Expression<?>> args) { return new PredicateOperation(operator, args); }

Target:
public static PredicateOperation predicate(Operator operator, ImmutableList<Expression<?>> args) { return new PredicateOperation(operator, args); }
Source:
public void onCurrentMediaItemChanged(@NonNull final SessionPlayer player, @NonNull final MediaItem item) { final MediaSessionImplBase session = getSession(); if (session == null || player == null || session.getPlayer() != player) { return; } synchronized (session.mLock) { if (mMediaItem != null) { mMediaItem.removeOnMetadataChangedListener(this); } if (item != null) { item.addOnMetadataChangedListener(session.mCallbackExecutor, this); } mMediaItem = item; } boolean notified = updateCurrentMediaItemMetadataWithDuration(player); if (!notified) { notifyCurrentMediaItemChanged(item); } }

Target:
public void onCurrentMediaItemChanged(@NonNull final SessionPlayer player, @NonNull final MediaItem item) { final MediaSessionImplBase session = getSession(); if (session == null || player == null || session.getPlayer() != player) { return; } synchronized (session.mLock) { if (mMediaItem != null) { mMediaItem.removeOnMetadataChangedListener(this); } if (item != null) { item.addOnMetadataChangedListener(session.mCallbackExecutor, this); } mMediaItem = item; } boolean notifyingPended = updateCurrentMediaItemMetadataWithDuration(player); if (!notifyingPended) { notifyCurrentMediaItemChanged(item); } }
Source:
private static void checkNtpSync(ConfigurableApplicationContext context) { String host = context.getBean(IntegrasjonspunktProperties.class).getNtpHost(); try { NTPClient client = new NTPClient(host); long offset = client.getOffset(); if (Math.abs(offset) > 5000) { String errorStr = String.format("Startup failed. Offset from NTP host %s was more than 5 seconds (%sms). Adjust local clock and try again.", host, offset); log.error(errorStr); String stars = "\n**************************\n"; System.out.println(stars+errorStr+stars); context.close(); } } catch (IOException e) { log.error("Error while syncing with NTP {}, continuing startup..", host); } }

Target:
private static void checkNtpSync(ConfigurableApplicationContext context) { String host = context.getBean(IntegrasjonspunktProperties.class).getNtpHost(); try { NTPClient client = new NTPClient(host); long offset = client.getOffset(); if (Math.abs(offset) > 5000) { String errorStr = String.format("Startup failed. Offset from NTP host %s was more than 5 seconds (%sms). Adjust local clock and try again.", host, offset); log.error(errorStr); String stars = "\n**************************\n"; System.out.println(stars+errorStr+stars); context.close(); } } catch (IOException e) { log.error(String.format("Error while syncing with NTP %s, continuing startup..", host), e); } }
Source:
protected void setupSSL() { try { sslContext = new SslContextBuilder(InetAddress.getLocalHost().getHostName()).build(); } catch (GeneralSecurityException ex) { throw Throwables.propagate(ex); } catch (UnknownHostException ex) { throw Throwables.propagate(ex); } }

Target:
protected void setupSSL() { try { sslContext = new SslContextBuilder(InetAddress.getLocalHost().getHostName()).build(); } catch (GeneralSecurityException ex) { throw new RuntimeException(ex); } catch (UnknownHostException ex) { throw new RuntimeException(ex); } }
Source:
private void initDatabase() throws Exception { String jndiName = config.getString("database.jndi"); if (jndiName != null) { dataSource = (DataSource) new InitialContext().lookup(jndiName); } else { String driverFile = config.getString("database.driverFile"); if (driverFile != null) { URLClassLoader classLoader = (URLClassLoader) ClassLoader.getSystemClassLoader(); Method method = URLClassLoader.class.getDeclaredMethod("addURL", URL.class); method.setAccessible(true); method.invoke(classLoader, new File(driverFile).toURI().toURL()); } String driver = config.getString("database.driver"); if (driver != null) { Class.forName(driver); } HikariConfig hConfig = new HikariConfig(); hConfig.setDriverClassName(config.getString("database.driver")); hConfig.setJdbcUrl(config.getString("database.url")); hConfig.setUsername(config.getString("database.user")); hConfig.setPassword(config.getString("database.password")); hConfig.setConnectionInitSql("SELECT 1 FROM DUAL"); hConfig.setIdleTimeout(600000); int maxPoolSize = config.getInteger("database.maxPoolSize"); if (maxPoolSize != 0) { hConfig.setMaximumPoolSize(maxPoolSize); } dataSource = new HikariDataSource(hConfig); } }

Target:
private void initDatabase() throws Exception { String jndiName = config.getString("database.jndi"); if (jndiName != null) { dataSource = (DataSource) new InitialContext().lookup(jndiName); } else { String driverFile = config.getString("database.driverFile"); if (driverFile != null) { URLClassLoader classLoader = (URLClassLoader) ClassLoader.getSystemClassLoader(); Method method = URLClassLoader.class.getDeclaredMethod("addURL", URL.class); method.setAccessible(true); method.invoke(classLoader, new File(driverFile).toURI().toURL()); } String driver = config.getString("database.driver"); if (driver != null) { Class.forName(driver); } HikariConfig hikariConfig = new HikariConfig(); hikariConfig.setDriverClassName(config.getString("database.driver")); hikariConfig.setJdbcUrl(config.getString("database.url")); hikariConfig.setUsername(config.getString("database.user")); hikariConfig.setPassword(config.getString("database.password")); hikariConfig.setConnectionInitSql("SELECT 1 FROM DUAL"); hikariConfig.setIdleTimeout(600000); int maxPoolSize = config.getInteger("database.maxPoolSize"); if (maxPoolSize != 0) { hikariConfig.setMaximumPoolSize(maxPoolSize); } dataSource = new HikariDataSource(hikariConfig); } }
Source:
public void addResolverListener(String expression, ResolverListener listener) throws CloudnameException { DynamicExpression dynamicExpression = new DynamicExpression(expression, listener, this, zkGetter); synchronized (dynamicAddressMonitor) { DynamicExpression previousExpression = dynamicAddressesByListener.put( listener, dynamicExpression); if (previousExpression != null) { throw new IllegalArgumentException("It is not legal to register a listener twice."); } } dynamicExpression.start(); }

Target:
public void addResolverListener(String expression, ResolverListener listener) throws CloudnameException { final DynamicExpression dynamicExpression = new DynamicExpression(expression, listener, this, zkGetter); synchronized (dynamicAddressMonitor) { DynamicExpression previousExpression = dynamicAddressesByListener.put( listener, dynamicExpression); if (previousExpression != null) { throw new IllegalArgumentException("It is not legal to register a listener twice."); } } dynamicExpression.start(); }
Source:
private void status(int sc) { if (sc == SC_UNAUTHORIZED) { StringBuilder v = new StringBuilder(); v.append("Basic"); v.append(" realm=\"" + REALM_NAME + "\""); setHeader(WWW_AUTHENTICATE, v.toString()); } else if (containsHeader(WWW_AUTHENTICATE)) { setHeader(WWW_AUTHENTICATE, null); } }

Target:
private void status(int sc) { if (sc == SC_UNAUTHORIZED) { StringBuilder v = new StringBuilder(); v.append(LIT_BASIC); v.append(" realm=\"" + REALM_NAME + "\""); setHeader(WWW_AUTHENTICATE, v.toString()); } else if (containsHeader(WWW_AUTHENTICATE)) { setHeader(WWW_AUTHENTICATE, null); } }
Source:
protected Iterator<ServiceRecord> getServiceRecords(MarketoService marketoService, PluginTask task) { Iterable<ObjectNode> nodes = null; if (!task.getQueryBy().isPresent()) { nodes = marketoService.getPrograms(); } else if (task.getQueryBy().isPresent() && task.getQueryBy().get() == QueryBy.TAG_TYPE) { nodes = marketoService.getProgramsByTag(task.getTagType().get(), task.getTagVallue().get()); } else if (task.getQueryBy().isPresent() && task.getQueryBy().get() == QueryBy.DATE_RANGE) { nodes = marketoService.getProgramsByDateRange(task.getEarliestUpdatedAt().get(), task.getLatestUpdatedAt().get(), task.getFilterType().orNull(), task.getFilterValues().orNull()); } return FluentIterable.from(nodes).transform(MarketoUtils.TRANSFORM_OBJECT_TO_JACKSON_SERVICE_RECORD_FUNCTION).iterator(); }

Target:
protected Iterator<ServiceRecord> getServiceRecords(MarketoService marketoService, PluginTask task) { Iterable<ObjectNode> nodes = null; if (task.getQueryBy().isPresent()) { switch (task.getQueryBy().get()) { case TAG_TYPE: nodes = marketoService.getProgramsByTag(task.getTagType().get(), task.getTagVallue().get()); break; case DATE_RANGE: nodes = marketoService.getProgramsByDateRange(task.getEarliestUpdatedAt().get(), task.getLatestUpdatedAt().get(), task.getFilterType().orNull(), task.getFilterValues().orNull()); } } else { nodes = marketoService.getPrograms(); } return FluentIterable.from(nodes).transform(MarketoUtils.TRANSFORM_OBJECT_TO_JACKSON_SERVICE_RECORD_FUNCTION).iterator(); }
Source:
public int compareTo(byte[] bytes, int offset, int len) { if (this.length == this.data.length && len == bytes.length) { int res = UnsignedBytes.lexicographicalComparator().compare(this.data, bytes); return UnsignedBytes.lexicographicalComparator().compare(this.data, bytes); } else { int minLen = Math.min(this.length, len); for (int i = this.offset, j = offset; i < minLen; i++, j++) { int a = (this.data[i] & 0xff); int b = (bytes[j] & 0xff); if (a != b) { return a - b; } } return this.length - len; } }

Target:
public int compareTo(byte[] bytes, int offset, int len) { Preconditions.checkArgument(offset >= 0 && len >= 0 && offset + len <= bytes.length); return compareToUnchecked(bytes, offset, len); }
Source:
public void addSize(final int size) { boolean globalFull = !ignoreGlobalMaxSize && pagingManager.addSize(size).isGlobalFull(); long newSize = sizeInBytes.addAndGet(size); if (newSize < 0) { ActiveMQServerLogger.LOGGER.negativeAddressSize(newSize, address.toString()); } if (addressFullMessagePolicy == AddressFullMessagePolicy.BLOCK || addressFullMessagePolicy == AddressFullMessagePolicy.FAIL) { if (usingGlobalMaxSize && !globalFull || maxSize != -1) { checkReleaseMemory(globalFull, newSize); } return; } else if (addressFullMessagePolicy == AddressFullMessagePolicy.PAGE) { if (size > 0) { if (maxSize != -1 && newSize > maxSize || globalFull) { if (startPaging()) { ActiveMQServerLogger.LOGGER.pageStoreStart(storeName, newSize, maxSize, pagingManager.getGlobalSize()); } } } return; } }

Target:
public void addSize(final int size) { boolean globalFull = pagingManager.addSize(size).isGlobalFull() && !ignoreGlobalMaxSize; long newSize = sizeInBytes.addAndGet(size); if (newSize < 0) { ActiveMQServerLogger.LOGGER.negativeAddressSize(newSize, address.toString()); } if (addressFullMessagePolicy == AddressFullMessagePolicy.BLOCK || addressFullMessagePolicy == AddressFullMessagePolicy.FAIL) { if (usingGlobalMaxSize && !globalFull || maxSize != -1) { checkReleaseMemory(globalFull, newSize); } return; } else if (addressFullMessagePolicy == AddressFullMessagePolicy.PAGE) { if (size > 0) { if (maxSize != -1 && newSize > maxSize || globalFull) { if (startPaging()) { ActiveMQServerLogger.LOGGER.pageStoreStart(storeName, newSize, maxSize, pagingManager.getGlobalSize()); } } } return; } }
Source:
public void close() throws IOException { _dataBuffer.close(); }

Target:
public void close() throws IOException { }
Source:
public CPPASTLiteralExpression copy(CopyStyle style) { CPPASTLiteralExpression copy = new CPPASTLiteralExpression(fKind, getValue(), fNumericCompilerSuffixes); copy.fStringLiteralSize = fStringLiteralSize; copy.fEvaluation = fEvaluation; copy.fUserDefinedLiteralOperator = fUserDefinedLiteralOperator; copy.fImplicitNames = fImplicitNames; return copy(copy, style); }

Target:
public CPPASTLiteralExpression copy(CopyStyle style) { return copy(new CPPASTLiteralExpression(this), style); }
Source:
public LRUCache() { setCache(this.MAX_ENTRIES); }

Target:
public LRUCache() { setCache(MAX_ENTRIES); }
Source:
public void onResult(Activity activity, int requestCode, int resultCode, Intent data) { if (resultCode != Activity.RESULT_OK && resultCode != Activity.RESULT_CANCELED) { processFailed(resultCode); return; } else if (resultCode == Activity.RESULT_CANCELED) { processCanceled(resultCode); return; } try { processResult(data.getStringExtra(Intents.Scan.RESULT_FORMAT), data.getStringExtra(Intents.Scan.RESULT), resultCode); } catch (Exception e) { Log.e(LCAT, "Hit exception while processing barcode! " + e.toString()); e.printStackTrace(); processFailed(resultCode); } Log.w(LCAT, "--> from module :: keepOpen value: " + keepOpen); if (!keepOpen) { _instance = null; } }

Target:
public void onResult(Activity activity, int requestCode, int resultCode, Intent data) { if (resultCode != Activity.RESULT_OK && resultCode != Activity.RESULT_CANCELED) { processFailed(resultCode); return; } else if (resultCode == Activity.RESULT_CANCELED) { processCanceled(resultCode); return; } try { processResult(data.getStringExtra(Intents.Scan.RESULT_FORMAT), data.getStringExtra(Intents.Scan.RESULT), resultCode); } catch (Exception e) { Log.e(LCAT, "Hit exception while processing barcode! " + e.toString()); e.printStackTrace(); processFailed(resultCode); } if (!keepOpen) { _instance = null; } }
Source:
public void failPreservesStdout() { ProcessResult result = new ProcessResult(0, fail, ""); RunResult parsed = parser.parse(result); assertTrue(parsed.logs.containsKey(SpecialLogs.STDOUT)); assertEquals(fail, new String(parsed.logs.get(SpecialLogs.STDOUT))); }

Target:
public void failPreservesStdout() { RunResult parsed = parser.parse(failResult); assertTrue(parsed.logs.containsKey(SpecialLogs.STDOUT)); assertEquals(fail, new String(parsed.logs.get(SpecialLogs.STDOUT))); }
Source:
public void panelsTest() { UI.events.registerEvent((PanelClickedEventHandler) e -> eventTriggered.set(true)); pushKeys(MAXIMIZE_WINDOW); pushKeys(CREATE_RIGHT_PANEL); pushKeys(CREATE_RIGHT_PANEL); waitUntilNodeAppears(getPanel(0).getFilterTextField()); type("repo:dummy2/dummy2"); push(KeyCode.ENTER); selectPanel(1); final FilterPanel panel0 = getPanel(0); final FilterPanel panel1 = getPanel(1); final FilterPanel panel2 = getPanel(2); reorderPanelsByDragging(panel0, panel1, panel2); reorderPanelsViaHotkeys(panel0, panel1); click(panel0.getCloseButton()); waitUntilNodeDisappears(panel0); doubleClick("#repositorySelector"); doubleClick(); type("dummy2/dummy2"); push(KeyCode.ENTER); pushKeys(CREATE_RIGHT_PANEL); waitUntilNodeAppears(panel1); }

Target:
public void panelsTest() { UI.events.registerEvent((PanelClickedEventHandler) e -> eventTriggered.set(true)); pushKeys(MAXIMIZE_WINDOW); pushKeys(CREATE_RIGHT_PANEL); pushKeys(CREATE_RIGHT_PANEL); waitUntilNodeAppears(getPanel(0).getFilterTextField()); type("repo:dummy2/dummy2"); push(KeyCode.ENTER); selectPanel(1); final FilterPanel panel0 = getPanel(0); final FilterPanel panel1 = getPanel(1); final FilterPanel panel2 = getPanel(2); reorderPanelsByDragging(panel0, panel1, panel2); reorderPanelsViaHotkeys(panel0, panel1); click(panel0.getCloseButton()); waitUntilNodeDisappears(panel0); doubleClick("#repositorySelector"); doubleClick(); type("dummy2/dummy2"); push(KeyCode.ENTER); pushKeys(CREATE_RIGHT_PANEL); awaitCondition(() -> existsQuiet("#dummy2/dummy2_col2")); }
Source:
public String toString() { return getClass().getName() + "@" + Integer.toHexString(hashCode()) + "identifier=" + identifier + ", upstream=" + upstream + ", group=" + group + ", partitions=" + partitions + ", iterator=" + iterator + '}'; }

Target:
public String toString() { return "LogicalNode@" + Integer.toHexString(hashCode()) + "identifier=" + identifier + ", upstream=" + upstream + ", group=" + group + ", partitions=" + partitions + ", iterator=" + iterator + '}'; }
Source:
protected IASTTranslationUnit parseAndCheckImplicitNameBindings() throws Exception { IASTTranslationUnit tu = parse(getAboveComment(), CPP, false, true, Integer.MAX_VALUE); NameCollector col = new NameCollector(true ); tu.accept(col); assertNoProblemBindings(col); return tu; }

Target:
protected IASTTranslationUnit parseAndCheckImplicitNameBindings() throws Exception { IASTTranslationUnit tu = parse(getAboveComment(), CPP, false, true); NameCollector col = new NameCollector(true ); tu.accept(col); assertNoProblemBindings(col); return tu; }
Source:
private static Filter doubleRangeToFilter(Range range, boolean nullAllowed) { Marker low = range.getLow(); Marker high = range.getHigh(); double lowerDouble = low.isLowerUnbounded() ? Double.MIN_VALUE : ((Double) low.getValue()).doubleValue(); double upperDouble = high.isUpperUnbounded() ? Double.MAX_VALUE : ((Double) high.getValue()).doubleValue(); return new Filters.DoubleRange( lowerDouble, low.isLowerUnbounded(), low.getBound() == Marker.Bound.ABOVE, upperDouble, high.isUpperUnbounded(), high.getBound() == Marker.Bound.BELOW, nullAllowed); }

Target:
private static Filter doubleRangeToFilter(Range range, boolean nullAllowed) { Marker low = range.getLow(); Marker high = range.getHigh(); double lowerDouble = low.isLowerUnbounded() ? Double.MIN_VALUE : (double) low.getValue(); double upperDouble = high.isUpperUnbounded() ? Double.MAX_VALUE : (double) high.getValue(); return new Filters.DoubleRange( lowerDouble, low.isLowerUnbounded(), low.getBound() == Marker.Bound.ABOVE, upperDouble, high.isUpperUnbounded(), high.getBound() == Marker.Bound.BELOW, nullAllowed); }
Source:
private List<CapacityHeatmapSceneBuilder.Resource> getResources() { HumanResource[] humanResources = ((ChartModelResource) getChartModel()).getVisibleResources(); List<CapacityHeatmapSceneBuilder.Resource> resources = new ArrayList<>(); for (HumanResource humanResource : humanResources) { List<CapacityHeatmapSceneBuilder.Load> loads = new ArrayList<>(); List<Load> tasksLoads = humanResource.getLoadDistribution().getTasksLoads(); for (Load taskLoad : tasksLoads) { Integer taskId = null; if (taskLoad.refTask != null) { taskId = taskLoad.refTask.getTaskID(); } CapacityHeatmapSceneBuilder.Load load = new CapacityHeatmapSceneBuilder.Load(toTs(taskLoad.startDate), toTs(taskLoad.endDate), taskLoad.load, taskId); loads.add(load); } boolean isExpanded = myResourcechart.isExpanded(humanResource); CapacityHeatmapSceneBuilder.Resource resource = new CapacityHeatmapSceneBuilder.Resource(loads, isExpanded); resources.add(resource); } return resources; }

Target:
private List<CapacityHeatmapSceneBuilder.Resource> getResources() { HumanResource[] humanResources = ((ChartModelResource) getChartModel()).getVisibleResources(); List<CapacityHeatmapSceneBuilder.Resource> resources = new ArrayList<>(); for (HumanResource humanResource : humanResources) { List<CapacityHeatmapSceneBuilder.Load> loads = new ArrayList<>(); List<Load> tasksLoads = humanResource.getLoadDistribution().getTasksLoads(); for (Load taskLoad : tasksLoads) { Integer taskId = null; if (taskLoad.refTask != null) { taskId = taskLoad.refTask.getTaskID(); } CapacityHeatmapSceneBuilder.Load load = new CapacityHeatmapSceneBuilder.Load(taskLoad.startDate.getTime(), taskLoad.endDate.getTime(), taskLoad.load, taskId); loads.add(load); } boolean isExpanded = myResourcechart.isExpanded(humanResource); CapacityHeatmapSceneBuilder.Resource resource = new CapacityHeatmapSceneBuilder.Resource(loads, isExpanded); resources.add(resource); } return resources; }
Source:
public String toString() { return "SubnetRequest{" + "publicSubnetCidr='" + publicSubnetCidr + '\'' + ", privateSubnetCidr='" + privateSubnetCidr + '\'' + ", availabilityZone='" + availabilityZone + '\'' + ", type=" + type + '}'; }

Target:
public String toString() { return "SubnetRequest{" + "publicSubnetCidr='" + publicSubnetCidr + '\'' + ", privateSubnetCidr='" + privateSubnetCidr + '\'' + ", availabilityZone='" + availabilityZone + '\'' + ", subnetGroup=" + subnetGroup + ", index=" + index + ", type=" + type + '}'; }
Source:
public DynamicMBeanProvider register() throws JMException { List<DynamicMetric<?, ?>> attributeList = new ArrayList<>(); attributeList.add(_dataChangeEventCounter); attributeList.add(_outstandingRequestGauge); attributeList.add(_stateChangeEventCounter); attributeList.add(_expiredSessionCounter); if (_zkEventThreadMetric != null) { attributeList.add(_zkEventThreadMetric); } doRegister(attributeList, MBEAN_DESCRIPTION, getObjectName(_monitorType, _monitorKey, _monitorInstanceName)); for (ZkClientPathMonitor.PredefinedPath path : ZkClientPathMonitor.PredefinedPath.values()) { if (_zkClientPathMonitorMap.get(path) != null) { _zkClientPathMonitorMap.get(path).register(); } } return this; }

Target:
public DynamicMBeanProvider register() throws JMException { List<DynamicMetric<?, ?>> attributeList = new ArrayList<>(); attributeList.add(_dataChangeEventCounter); attributeList.add(_outstandingRequestGauge); attributeList.add(_stateChangeEventCounter); attributeList.add(_expiredSessionCounter); if (_zkEventThreadMetric != null) { attributeList.add(_zkEventThreadMetric); } doRegister(attributeList, MBEAN_DESCRIPTION, getObjectName(_monitorType, _monitorKey, _monitorInstanceName)); _zkClientPathMonitorMap.values().stream().forEach( monitor -> { if (monitor != null) { try { monitor.register(); } catch (JMException e) { _logger.error(" failed registration", monitor, e); } } }); return this; }
Source:
public ITmfTrace openMinimalTrace(String projectName, String traceName, Boolean isExperiment) throws FileNotFoundException, InstantiationException, IllegalAccessException, TmfTraceException, CoreException, TmfTraceImportException { String path = getFile(projectName, traceName, isExperiment).getLocationURI().getPath(); if (path == null) { throw new FileNotFoundException(); } ITmfTrace trace; trace = put(path, traceName, ""); return trace; }

Target:
public ITmfTrace openMinimalTrace(String projectName, String traceName, Boolean isExperiment) throws FileNotFoundException, InstantiationException, IllegalAccessException, TmfTraceException, CoreException, TmfTraceImportException { String path = getTracePath(projectName, traceName, isExperiment); IFile file = getFile(path); String location = file.getLocationURI().getPath(); return openAndInitializeTrace(file, location, traceName, ""); }
Source:
void onImageSizeSelected(int position) { if (trackChanges) { if (trackingHelper != null) { trackingHelper.logImageSizeChanged(position); } presenter.saveImageSize(position); } }

Target:
void onImageSizeSelected(int position) { if (listenersEnabled) { if (trackingHelper != null) { trackingHelper.logImageSizeChanged(position); } presenter.saveImageSize(position); } }