auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
protected AbstractMergeViewer createMergeViewer(final Composite parent, final MergeViewerSide side) { final TreeMergeViewer mergeTreeViewer = new TreeMergeViewer(parent, side, this, getCompareConfiguration()); final IContentProvider contentProvider = createMergeViewerContentProvider(); mergeTreeViewer.setContentProvider(contentProvider); final IBaseLabelProvider labelProvider = new PapyrusTreeContentMergeViewerItemLabelProvider( getResourceBundle(), getAdapterFactory(), side); mergeTreeViewer.setLabelProvider(labelProvider); hookListeners(mergeTreeViewer); return mergeTreeViewer; }

Target:
protected AbstractMergeViewer createMergeViewer(final Composite parent, final MergeViewerSide side) { final TreeMergeViewer mergeTreeViewer = new TreeMergeViewer(parent, side, this, getCompareConfiguration()); final IContentProvider contentProvider = createMergeViewerContentProvider(side); mergeTreeViewer.setContentProvider(contentProvider); final IBaseLabelProvider labelProvider = new PapyrusTreeContentMergeViewerItemLabelProvider( getResourceBundle(), getAdapterFactory(), side); mergeTreeViewer.setLabelProvider(labelProvider); hookListeners(mergeTreeViewer); return mergeTreeViewer; }
Source:
protected boolean canDoAction() { Guid vdsId = getVm().getDedicatedVmForVds(); if (vdsId == null) { return failCanDoAction(VdcBllMessages.VM_NUMA_PINNED_VDS_NOT_EXIST); } List<VdsNumaNode> vdsNumaNodes = getDbFacade().getVdsNumaNodeDAO().getAllVdsNumaNodeByVdsId(vdsId); List<VmNumaNode> vmNumaNodes = getParameters().getVmNumaNodeList(); for (VmNumaNode vmNumaNode : vmNumaNodes) { for (Pair<Guid, Pair<Boolean, Integer>> pair : vmNumaNode.getVdsNumaNodeList()) { int index = pair.getSecond().getSecond(); for (VdsNumaNode vdsNumaNode : vdsNumaNodes) { if (vdsNumaNode.getIndex() == index) { if (vmNumaNode.getMemTotal() > vdsNumaNode.getMemTotal()) { return failCanDoAction(VdcBllMessages.VM_NUMA_NODE_MEMRORY_ERROR); } break; } } } } return true; }

Target:
protected boolean canDoAction() { return checkNumaValid(); }
Source:
public void runOnContentField(Consumer<WebElement> action) { List<WebElement> textareas = getContainer() .findElements(By.tagName("textarea")) .stream() .filter(it -> !it.getAttribute("class").contains("ckeditor-textarea")) .collect(Collectors.toList()); if (textareas.size() == 0 || !textareas.get(0).isDisplayed()) { WebElement iframe = getContainer().findElement(By.tagName("iframe")); getDriver().switchTo().frame(iframe); action.accept(getDriver().findElement(By.tagName("body"))); getDriver().switchTo().parentFrame(); } else { action.accept(textareas.get(0)); } }

Target:
private void runOnContentField(Consumer<WebElement> action) { List<WebElement> textareas = getContainer() .findElements(By.tagName("textarea")) .stream() .filter(it -> !it.getAttribute("class").contains("ckeditor-textarea")) .collect(Collectors.toList()); if (textareas.size() == 0 || !textareas.get(0).isDisplayed()) { WebElement iframe = getContainer().findElement(By.tagName("iframe")); getDriver().switchTo().frame(iframe); action.accept(getDriver().findElement(By.tagName("body"))); getDriver().switchTo().parentFrame(); } else { action.accept(textareas.get(0)); } }
Source:
public synchronized T get() { if (container==null) { Class<T> fixture = (Class<T>) type.getRawType(); File buildlog = diag.touch("docker-" + fixture.getSimpleName() + ".build.log"); File runlog = diag.touch("docker-" + fixture.getSimpleName() + ".run.log"); try { System.out.println("Setting up docker container for " + fixture.getSimpleName()); container = docker.build(fixture, buildlog).start(fixture).withPortOffset(portOffset).withLog(runlog).start(); } catch (InterruptedException | IOException e) { throw new AssertionError("Failed to start container " + fixture.getName(), e); } } return container; }

Target:
public synchronized T get() { if (container==null) { Class<T> fixture = (Class<T>) type.getRawType(); File buildlog = diag.touch("docker-" + fixture.getSimpleName() + ".build.log"); File runlog = diag.touch("docker-" + fixture.getSimpleName() + ".run.log"); try { container = docker.build(fixture, buildlog).start(fixture).withPortOffset(portOffset).withLog(runlog).start(); } catch (InterruptedException | IOException e) { throw new Error("Failed to start container " + fixture.getName(), e); } } return container; }
Source:
public static void init() { CRS.reset("all"); System.setProperty("org.geotools.referencing.forceXY", "true"); }

Target:
public static void init() { CRS.reset("all"); System.setProperty(GeoTools.FORCE_LONGITUDE_FIRST_AXIS_ORDER, "true"); }
Source:
public double estimateFwhmMs(int numberOfScansForFWHMCalc) { double sigma = 0; int countProperIteration = 0; int countTotalIteration = 0; while (countProperIteration < numberOfScansForFWHMCalc) { countTotalIteration++; int matrixIndex = 0; if (countTotalIteration > objSliceSparseMatrix.getSizeOfRawDataFile()) { System.out.println(countTotalIteration); throw new IllegalArgumentException("Cannot calculate FWHM."); } Random generator = new Random(); int randInt = generator.nextInt(objSliceSparseMatrix.getSizeOfRawDataFile()); List<SliceSparseMatrix.VerticalSliceDataPoint> verticalSlice = objSliceSparseMatrix.getVerticalSlice(randInt); if (verticalSlice == null) continue; WeightedObservedPoints obs = new WeightedObservedPoints(); for (SliceSparseMatrix.VerticalSliceDataPoint datapoint : verticalSlice) { obs.add(datapoint.mz, datapoint.intensity); matrixIndex++; } try { double[] parameters = GaussianCurveFitter.create().fit(obs.toList()); sigma += 2.35482 * parameters[2]; } catch (Exception e) { continue; } countProperIteration++; } double fwhm = sigma / numberOfScansForFWHMCalc; return fwhm; }

Target:
public double estimateFwhmMs(int numberOfScansForFWHMCalc) { double sigma = 0; int countProperIteration = 0; int countTotalIteration = 0; while (countProperIteration < numberOfScansForFWHMCalc) { countTotalIteration++; if (countTotalIteration > objSliceSparseMatrix.getSizeOfRawDataFile()) { System.out.println(countTotalIteration); throw new IllegalArgumentException("Cannot calculate FWHM."); } Random generator = new Random(); int randInt = generator.nextInt(objSliceSparseMatrix.getSizeOfRawDataFile()); List<SliceSparseMatrix.VerticalSliceDataPoint> verticalSlice = objSliceSparseMatrix.getVerticalSlice(randInt); if (verticalSlice == null) continue; WeightedObservedPoints obs = new WeightedObservedPoints(); for (SliceSparseMatrix.VerticalSliceDataPoint datapoint : verticalSlice) { obs.add(datapoint.mz, datapoint.intensity); } try { double[] parameters = GaussianCurveFitter.create().fit(obs.toList()); sigma += fwhmConstant * parameters[2]; } catch (MathIllegalArgumentException e) { continue; } countProperIteration++; } double fwhm = sigma / numberOfScansForFWHMCalc; return fwhm; }
Source:
protected void doFilterInternal(final HttpServletRequest request, final HttpServletResponse response, final FilterChain filterChain) throws ServletException, IOException { final long start = System.currentTimeMillis(); try { filterChain.doFilter(request, response); } finally { final long time = System.currentTimeMillis(); final Long timing = time - start; final Optional<String> userAgent = Optional.ofNullable(request.getHeader("User-Agent")); final Optional<String> user = Optional.ofNullable(request.getUserPrincipal()).map(Principal::getName); LOG.info("{} \"{}\" \"{}\" \"{}\" ms", request.getMethod(), request.getRequestURI(), userAgent.orElse("-"), user.orElse("-"), response.getStatus(), timing); } }

Target:
protected void doFilterInternal(final HttpServletRequest request, final HttpServletResponse response, final FilterChain filterChain) throws ServletException, IOException { final long start = System.currentTimeMillis(); final String userAgent = Optional.ofNullable(request.getHeader("User-Agent")).orElse("-"); final String user = Optional.ofNullable(request.getUserPrincipal()).map(Principal::getName).orElse("-"); final String method = request.getMethod(); final String path = request.getRequestURI(); LOG.info("[ACCESS_LOG_BEGIN] \"{}\" \"{}\" \"{}\"", method, path, userAgent, user); try { filterChain.doFilter(request, response); } finally { final long time = System.currentTimeMillis(); final Long timing = time - start; LOG.info("[ACCESS_LOG_END] \"{}\" \"{}\" \"{}\" ms", method, path, userAgent, user, response.getStatus(), timing); } }
Source:
public VoidResult call() throws NoSuchChangeException, InvalidChangeOperationException, OrmException { final Change.Id changeId = patchSetId.getParentKey(); final ChangeControl ctl = changeControlFactory.validateFor(changeId); change = ctl.getChange(); patchSet = db.patchSets().get(patchSetId); if (patchSet == null) { throw new NoSuchChangeException(changeId); } drafts = drafts(); db.changes().beginTransaction(changeId); try { publishDrafts(); final boolean isCurrent = patchSetId.equals(change.currentPatchSetId()); if (isCurrent && change.getStatus().isOpen()) { publishApprovals(ctl); } else if (approvals.isEmpty() || forceMessage) { publishMessageOnly(); } else { throw new InvalidChangeOperationException("Change is closed"); } touchChange(); db.commit(); } finally { db.rollback(); } if (!suppressMails) { email(); } fireHook(); return VoidResult.INSTANCE; }

Target:
public VoidResult call() throws NoSuchChangeException, InvalidChangeOperationException, OrmException { final Change.Id changeId = patchSetId.getParentKey(); final ChangeControl ctl = changeControlFactory.validateFor(changeId); change = ctl.getChange(); patchSet = db.patchSets().get(patchSetId); if (patchSet == null) { throw new NoSuchChangeException(changeId); } drafts = drafts(); db.changes().beginTransaction(changeId); try { publishDrafts(); final boolean isCurrent = patchSetId.equals(change.currentPatchSetId()); if (isCurrent && change.getStatus().isOpen()) { publishApprovals(ctl); } else if (approvals.isEmpty() || forceMessage) { publishMessageOnly(); } else { throw new InvalidChangeOperationException("Change is closed"); } touchChange(); db.commit(); } finally { db.rollback(); } email(); fireHook(); return VoidResult.INSTANCE; }
Source:
private int getLimit(ResourceInfo resource, Object clientLimit, HttpServletResponse response) throws OWSException { if (clientLimit != null) { Integer value = Converters.convert(clientLimit, Integer.class); if (value == null) { throw new OWSException( 400, "InvalidParameterValue", LIMIT, "Invalid " + LIMIT + " " + "value " + clientLimit + ", expected an integer value"); } int limitMax = LIMIT_MAX_DEFAULT; if (value < limitMax) { return value; } else { String message = "Client provided a limit value higher than the configured max, using the " + "internal value (provided/max): " + value + "/" + limitMax; LOGGER.log(Level.INFO, message); response.addHeader(HttpHeaders.WARNING, "299 " + message); return limitMax; } } else { if (LOGGER.isLoggable(Level.FINE)) { LOGGER.log( Level.FINE, "Client did not provide a limit, using the internal default value: " + LIMIT_DEFAULT); } return LIMIT_DEFAULT; } }

Target:
private int getLimit(ResourceInfo resource, Object clientLimit, HttpServletResponse response) throws OWSException { if (clientLimit != null) { Integer value = Converters.convert(clientLimit, Integer.class); if (value == null) { throw new OWSException( 400, "InvalidParameterValue", DOMAIN_VALUES_LIMIT, "Invalid " + DOMAIN_VALUES_LIMIT + " " + "value " + clientLimit + ", expected an integer value"); } int limitMax = DOMAIN_VALUES_LIMIT_MAX_DEFAULT; if (value < limitMax) { return value; } else { String message = "Client provided a limit value higher than the configured max, using the " + "internal value (provided/max): " + value + "/" + limitMax; LOGGER.log(Level.INFO, message); response.addHeader(HttpHeaders.WARNING, "299 " + message); return limitMax; } } else { if (LOGGER.isLoggable(Level.FINE)) { LOGGER.log( Level.FINE, "Client did not provide a limit, using the internal default value: " + DOMAIN_VALUES_LIMIT_DEFAULT); } return DOMAIN_VALUES_LIMIT_DEFAULT; } }
Source:
public static ExpectedCondition<WebDriverElement> hasAttribute(final Hook hook, final String attribute, final String value, final boolean expectValue) { return new ExpectedCondition<WebDriverElement>() { @Override public WebDriverElement apply(WebDriver driver) { try { WebElement element = findElement(hook, driver); String[] values = element.getAttribute(attribute).split("\\s"); for (int x = 0; x < values.length; x++) { if (values[x].equals(value)) { return expectValue ? createWebDriverElement(hook, element, driver) : null; } } return expectValue ? null : createWebDriverElement(hook, element, driver); } catch (CandybeanException | StaleElementReferenceException e) { return null; } } @Override public String toString() { return attribute + (expectValue? " is ": " isn't ") + value; } }; }

Target:
public static ExpectedCondition<WebDriverElement> hasAttribute(final Hook hook, final String attribute, final String value, final boolean expectValue) { return new ExpectedCondition<WebDriverElement>() { @Override public WebDriverElement apply(WebDriver driver) { try { WebElement element = findElement(hook, driver); for (String currentValue : element.getAttribute(attribute).split("\\s")) { if (currentValue.equals(value)) { return expectValue ? createWebDriverElement(hook, element, driver) : null; } } return expectValue ? null : createWebDriverElement(hook, element, driver); } catch (CandybeanException | StaleElementReferenceException e) { return null; } } @Override public String toString() { return attribute + (expectValue? " is ": " isn't ") + value; } }; }
Source:
@Test public void shouldCheckIfRemoteRepoExists() throws Exception { try { GitCommand.checkConnection(git.workingRepositoryUrl(), "master"); } catch (Exception e) { fail(); } }

Target:
@Test public void shouldCheckIfRemoteRepoExists() throws Exception { final TestSubprocessExecutionContext executionContext = new TestSubprocessExecutionContext(); GitCommand.checkConnection(git.workingRepositoryUrl(), "master", executionContext.getDefaultEnvironmentVariables()); }
Source:
private ReplaceOptions buildReplaceOptions(T object) { final ReplaceOptions options = ReplaceOptions.replaceOptions(); if (persistTo != PersistTo.NONE || replicateTo != ReplicateTo.NONE) { options.durability(persistTo, replicateTo); } else if (durabilityLevel != DurabilityLevel.NONE) { options.durability(durabilityLevel); } long cas = template.support().getCas(object); if (cas != 0) { options.cas(cas); } return options; }

Target:
private ReplaceOptions buildReplaceOptions(T object) { final ReplaceOptions options = ReplaceOptions.replaceOptions(); if (persistTo != PersistTo.NONE || replicateTo != ReplicateTo.NONE) { options.durability(persistTo, replicateTo); } else if (durabilityLevel != DurabilityLevel.NONE) { options.durability(durabilityLevel); } long cas = template.support().getCas(object); options.cas(cas); return options; }
Source:
public String toString() { return ToStringBuilder.forInstance(this) .append("DB Name", dbName) .append("Done At", doneAt) .append("Passed", passed) .append("Output Message", outputMessage) .build(); }

Target:
public String toString() { return ToStringBuilder.forInstance(this) .append("dbName", dbName) .append("doneAt", doneAt) .append("passed", passed) .append("outputMessage", outputMessage) .build(); }
Source:
private static void resetDownloadFolder(SharedPreferences prefs, String key, String defaultDirectoryName) { final File folder = getFolder(defaultDirectoryName); SharedPreferences.Editor spEditor = prefs.edit(); spEditor.putString(key, new File(folder, "NewPipe").getAbsolutePath()); spEditor.apply(); }

Target:
private static void resetDownloadFolder(SharedPreferences prefs, String key, String defaultDirectoryName) { SharedPreferences.Editor spEditor = prefs.edit(); spEditor.putString(key, getNewPipeChildFolderPathForDir(getDir(defaultDirectoryName))); spEditor.apply(); }
Source:
public void getEffectiveFeatures( ) throws Exception { List<ProfileFeature> effectiveFeatures = policyManagerService. getEffectiveFeatures(new DeviceIdentifier(DEVICE1, DEVICE_TYPE_A)); Assert.assertNotNull(effectiveFeatures); Assert.assertEquals(POLICY1_FEATURE1_CODE,effectiveFeatures.get(0).getFeatureCode()); try{ policyManagerService.getEffectiveFeatures(new DeviceIdentifier(DEVICE_2, DEVICE_TYPE_B)); }catch(FeatureManagementException e){ Assert.assertTrue(e.getCause()instanceof PolicyEvaluationException); } }

Target:
public void getEffectiveFeatures( ) throws Exception { List<ProfileFeature> effectiveFeatures = policyManagerService. getEffectiveFeatures(new DeviceIdentifier(DEVICE1, DEVICE_TYPE_A)); Assert.assertNotNull(effectiveFeatures); Assert.assertEquals(POLICY1_FEATURE1_CODE,effectiveFeatures.get(0).getFeatureCode()); try{ policyManagerService.getEffectiveFeatures(new DeviceIdentifier(DEVICE_2, DEVICE_TYPE_B)); }catch(FeatureManagementException ex){ if(ex.getCause() instanceof PolicyEvaluationException){ Assert.assertTrue(ex.getCause() instanceof PolicyEvaluationException); }else { throw ex; } } }
Source:
private Optional<Authentication> extractSourceAuthentication(Authentication currentAuthentication) { return currentAuthentication.getAuthorities().stream() .filter(a -> a instanceof SwitchUserGrantedAuthority) .map(a -> (SwitchUserGrantedAuthority) a) .map(SwitchUserGrantedAuthority::getSource) .findFirst(); }

Target:
private Optional<Authentication> extractSourceAuthentication(Authentication currentAuthentication) { for (GrantedAuthority authority : currentAuthentication.getAuthorities()) { if (authority instanceof SwitchUserGrantedAuthority) { final SwitchUserGrantedAuthority switchAuthority = (SwitchUserGrantedAuthority) authority; return Optional.of(switchAuthority.getSource()); } } return Optional.empty(); }
Source:
public int indexOf(ICTFPacketDescriptor element) { int indexOf = -1; if (element != null) { indexOf = Collections.binarySearch(fEntries, element, new MonotonicComparator()); } return (indexOf < 0) ? -1 : indexOf; }

Target:
public int indexOf(ICTFPacketDescriptor element) { int indexOf = -1; if (element != null) { indexOf = Collections.binarySearch(fEntries, element, (o1, o2) -> Long.compare(o1.getOffsetBytes(), o2.getOffsetBytes())); } return (indexOf < 0) ? -1 : indexOf; }
Source:
public void setup(String host, int port, String databaseName, String awsAccessKey, String awsSecretKey, String writableBucket) { checkArgument(!isNullOrEmpty(host), "Expected non empty host"); checkArgument(!isNullOrEmpty(databaseName), "Expected non empty databaseName"); checkArgument(!isNullOrEmpty(awsAccessKey), "Expected non empty awsAccessKey"); checkArgument(!isNullOrEmpty(awsSecretKey), "Expected non empty awsSecretKey"); checkArgument(!isNullOrEmpty(writableBucket), "Expected non empty writableBucket"); super.setup(host, port, databaseName, awsAccessKey, awsSecretKey, writableBucket, true); }

Target:
public void setup(String host, int port, String databaseName, String awsAccessKey, String awsSecretKey, String writableBucket) { super.setup(host, port, databaseName, awsAccessKey, awsSecretKey, writableBucket, true); }
Source:
public RenameResourceWizard(IResource resource, String newName) { super(new RenameRefactoring(new RenameResourceProcessor(resource)), DIALOG_BASED_USER_INTERFACE); RenameResourceProcessor fRenameResourceProcessor= (RenameResourceProcessor) ((RenameRefactoring) super.getRefactoring()).getProcessor(); fRenameResourceProcessor.setNewResourceName(newName); setDefaultPageTitle(RefactoringUIMessages.RenameResourceWizard_page_title); setWindowTitle(RefactoringUIMessages.RenameResourceWizard_window_title); }

Target:
public RenameResourceWizard(IResource resource, String newName) { this(resource); RenameResourceProcessor fRenameResourceProcessor= (RenameResourceProcessor) ((RenameRefactoring) super.getRefactoring()).getProcessor(); fRenameResourceProcessor.setNewResourceName(newName); setDefaultPageTitle(RefactoringUIMessages.RenameResourceWizard_page_title); setWindowTitle(RefactoringUIMessages.RenameResourceWizard_window_title); }
Source:
VoltFormatter (String name, Properties prop) { if (!("csv".equalsIgnoreCase(name) || "tsv".equalsIgnoreCase(name))) { throw new RuntimeException("Invalid format " + name + ", choices are either \"csv\" or \"tsv\"."); } m_parser = new CSVParser("csv".equalsIgnoreCase(name) ? ',' : '\t'); }

Target:
VoltFormatter (String name, Properties prop) { if (!("csv".equalsIgnoreCase(name) || "tsv".equalsIgnoreCase(name))) { throw new IllegalArgumentException("Invalid format " + name + ", choices are either \"csv\" or \"tsv\"."); } m_parser = new CSVParser("csv".equalsIgnoreCase(name) ? ',' : '\t'); }
Source:
void flush() throws IOException { for (Map.Entry<String, LogSegment> entry : segmentsByName.entrySet()) { entry.getValue().flush(); } }

Target:
void flush() throws IOException { logger.trace("Flushing log"); for (LogSegment segment : segmentsByName.values()) { segment.flush(); } }
Source:
private void configureHttp1OrH2C(ChannelPipeline pipeline, HandlerHolder<? extends Handler<HttpServerConnection>> holder) { if (logEnabled) { pipeline.addLast("logging", new LoggingHandler()); } if (HttpServerImpl.USE_FLASH_POLICY_HANDLER) { pipeline.addLast("flashpolicy", new FlashPolicyHandler()); } pipeline.addLast("optionalHAProxyMessageDecoder", new OptionalHAProxyMessageDecoder()); pipeline.addLast("httpDecoder", new VertxHttpRequestDecoder(options)); pipeline.addLast("httpEncoder", new VertxHttpResponseEncoder()); if (options.isDecompressionSupported()) { pipeline.addLast("inflater", new HttpContentDecompressor(false)); } if (options.isCompressionSupported()) { pipeline.addLast("deflater", new HttpChunkContentCompressor(options.getCompressionLevel())); } if (sslHelper.isSSL() || options.isCompressionSupported()) { pipeline.addLast("chunkedWriter", new ChunkedWriteHandler()); } if (options.getIdleTimeout() > 0) { pipeline.addLast("idle", new IdleStateHandler(0, 0, options.getIdleTimeout(), options.getIdleTimeoutUnit())); } if (disableH2C) { configureHttp1(pipeline, holder); } else { pipeline.addLast("h2c", new Http1xUpgradeToH2CHandler(this, holder, options.isCompressionSupported(), options.isDecompressionSupported())); } }

Target:
private void configureHttp1OrH2C(ChannelPipeline pipeline, HandlerHolder<? extends Handler<HttpServerConnection>> holder) { if (logEnabled) { pipeline.addLast("logging", new LoggingHandler()); } if (HttpServerImpl.USE_FLASH_POLICY_HANDLER) { pipeline.addLast("flashpolicy", new FlashPolicyHandler()); } pipeline.addLast("httpDecoder", new VertxHttpRequestDecoder(options)); pipeline.addLast("httpEncoder", new VertxHttpResponseEncoder()); if (options.isDecompressionSupported()) { pipeline.addLast("inflater", new HttpContentDecompressor(false)); } if (options.isCompressionSupported()) { pipeline.addLast("deflater", new HttpChunkContentCompressor(options.getCompressionLevel())); } if (sslHelper.isSSL() || options.isCompressionSupported()) { pipeline.addLast("chunkedWriter", new ChunkedWriteHandler()); } if (options.getIdleTimeout() > 0) { pipeline.addLast("idle", new IdleStateHandler(0, 0, options.getIdleTimeout(), options.getIdleTimeoutUnit())); } if (disableH2C) { configureHttp1(pipeline, holder); } else { pipeline.addLast("h2c", new Http1xUpgradeToH2CHandler(this, holder, options.isCompressionSupported(), options.isDecompressionSupported())); } }
Source:
public void precache() { cacheSignatureList((List)methodSignatures(), (List)(newSignatures()), (List)(staticMethodSignatures()), (List)(fieldSignatures()), (List)(staticFieldSignatures())); }

Target:
final void precache() { if (!permittedCache.isEmpty()) { this.permittedCache.clear(); } cacheSignatureList((List)methodSignatures(), (List)(newSignatures()), (List)(staticMethodSignatures()), (List)(fieldSignatures()), (List)(staticFieldSignatures())); }
Source:
public String getMessageInfo() { if (message.toLowerCase(Locale.ENGLISH).contains(Const.ACTION_RESULT_FAILURE.toLowerCase(Locale.ENGLISH))) { message = message.replace(Const.ACTION_RESULT_FAILURE, "<span class=\"text-danger\"><strong>" + Const.ACTION_RESULT_FAILURE + "</strong><br>"); message = message + "</span><br>"; } else if (message.toLowerCase(Locale.ENGLISH).contains( Const.ACTION_RESULT_SYSTEM_ERROR_REPORT.toLowerCase(Locale.ENGLISH))) { message = message.replace(Const.ACTION_RESULT_SYSTEM_ERROR_REPORT, "<span class=\"text-danger\"><strong>" + Const.ACTION_RESULT_SYSTEM_ERROR_REPORT + "</strong><br>"); message = message + "</span><br>"; } return message; }

Target:
public String getMessageInfo() { if (message.toLowerCase().contains(Const.ACTION_RESULT_FAILURE.toLowerCase())) { message = message.replace(Const.ACTION_RESULT_FAILURE, "<span class=\"text-danger\"><strong>" + Const.ACTION_RESULT_FAILURE + "</strong><br>"); message = message + "</span><br>"; } else if (message.toLowerCase().contains(Const.ACTION_RESULT_SYSTEM_ERROR_REPORT.toLowerCase())) { message = message.replace(Const.ACTION_RESULT_SYSTEM_ERROR_REPORT, "<span class=\"text-danger\"><strong>" + Const.ACTION_RESULT_SYSTEM_ERROR_REPORT + "</strong><br>"); message = message + "</span><br>"; } return message; }
Source:
private static void updateStepMessage(CommandBase<?> cmd, Guid vdsForExecution) { try { Step step = cmd.getExecutionContext().getStep(); Map<String, String> jobProperties = cmd.getJobMessageProperties(); jobProperties.put("vds", getVdsDao().get(vdsForExecution).getName()); StepEnum stepEnum = StepEnum.valueOf(cmd.getCommandStep().toString() + "_ON_HOST"); step.setDescription(ExecutionMessageDirector.resolveStepMessage(stepEnum, jobProperties)); getStepDao().update(step); } catch (IllegalArgumentException e) { } }

Target:
private static void updateStepMessage(CommandBase<?> cmd, Guid vdsForExecution) { StepEnum stepEnum = null; try { stepEnum = StepEnum.valueOf(cmd.getCommandStep().toString() + "_ON_HOST"); } catch (IllegalArgumentException e) { } if (stepEnum != null) { Step step = cmd.getExecutionContext().getStep(); Map<String, String> jobProperties = cmd.getJobMessageProperties(); jobProperties.put("VDS", getVdsDao().get(vdsForExecution).getName()); step.setDescription(ExecutionMessageDirector.resolveStepMessage(stepEnum, jobProperties)); getStepDao().update(step); } }
Source:
Optional<Instant> getPlayerMuteExpiration(final InetAddress inetAddress, final Clock clock) { return Optional.ofNullable(playerMutes.get(inetAddress)) .map( muteInstant -> { if (muteInstant.isAfter(clock.instant())) { return muteInstant; } else { playerMutes.remove(inetAddress); return null; } }); }

Target:
Optional<Instant> getPlayerMuteExpiration(final InetAddress inetAddress, final Clock clock) { return Optional.ofNullable( playerMutes.computeIfPresent( inetAddress, (address, existingBan) -> existingBan.isAfter(clock.instant()) ? existingBan : null)); }
Source:
protected MoveSelector buildBaseMoveSelector( HeuristicConfigPolicy configPolicy, SelectionCacheType minimumCacheType, boolean randomSelection) { assertThat(minimumCacheType).isEqualTo(expectedMinimumCacheType); if (expectedRandomSelection) { assertThat(randomSelection).isTrue(); } else { assertThat(randomSelection).isFalse(); } return baseMoveSelector; }

Target:
protected MoveSelector buildBaseMoveSelector( HeuristicConfigPolicy configPolicy, SelectionCacheType minimumCacheType, boolean randomSelection) { assertThat(minimumCacheType).isEqualTo(expectedMinimumCacheType); assertThat(randomSelection).isEqualTo(expectedRandomSelection); return baseMoveSelector; }
Source:
public void toFile(String krb5ConfPath, StringBuffer sb) throws FileNotFoundException, IOException { FileOutputStream fos = null; try { fos = new FileOutputStream(krb5ConfPath); fos.write(sb.toString().getBytes()); } finally { if (fos != null) { fos.close(); } } }

Target:
public void toFile(String krb5ConfPath, StringBuffer sb) throws FileNotFoundException, IOException { try (FileOutputStream fos = new FileOutputStream(krb5ConfPath)) { fos.write(sb.toString().getBytes()); } }
Source:
public void getLabel_labelWithDate() throws ItemNotFoundException { String testLabel = "Label [%1$td.%1$tm.%1$tY]"; Widget w = mock(Widget.class); Item item = mock(Item.class); when(w.getLabel()).thenReturn(testLabel); when(w.getItem()).thenReturn("Item"); when(registry.getItem("Item")).thenReturn(item); when(item.getState()).thenReturn(new DateTimeType("2011-06-01T00:00:00Z")); String label = uiRegistry.getLabel(w); assertEquals("Label [01.06.2011]", label); }

Target:
public void getLabel_labelWithDate() throws ItemNotFoundException { String testLabel = "Label [%1$td.%1$tm.%1$tY]"; Widget w = mock(Widget.class); Item item = mock(Item.class); when(w.getLabel()).thenReturn(testLabel); when(w.getItem()).thenReturn("Item"); when(registry.getItem("Item")).thenReturn(item); when(item.getState()).thenReturn(new DateTimeType("2011-06-01T00:00:00")); String label = uiRegistry.getLabel(w); assertEquals("Label [01.06.2011]", label); }
Source:
private void addSSLConfigResource(Configuration config) { SSLConfig sslConfig = dag.getValue(Context.DAGContext.SSL_CONFIG); if (sslConfig != null) { String nodeLocalConfig = sslConfig.getNodeLocalConfigPath(); if (StringUtils.isNotEmpty(nodeLocalConfig)) { config.addResource(new Path(nodeLocalConfig)); } else { Configuration sslConfigResource = new Configuration(false); String keyStorePath = sslConfig.getKeyStorePath(); keyStorePath = (new File(keyStorePath)).getName(); sslConfigResource.set("ssl.server.keystore.location", new File(keyStorePath).getName(), Context.DAGContext.SSL_CONFIG.getLongName()); sslConfigResource.set("ssl.server.keystore.password", sslConfig.getKeyStorePassword(), Context.DAGContext.SSL_CONFIG.getLongName()); sslConfigResource.set("ssl.server.keystore.keypassword", sslConfig.getKeyStoreKeyPassword(), Context.DAGContext.SSL_CONFIG.getLongName()); config.addResource(sslConfigResource); } } }

Target:
private void addSSLConfigResource(Configuration config) { SSLConfig sslConfig = dag.getValue(Context.DAGContext.SSL_CONFIG); if (sslConfig != null) { String nodeLocalConfig = sslConfig.getConfigPath(); if (StringUtils.isNotEmpty(nodeLocalConfig)) { config.addResource(new Path(nodeLocalConfig)); } else { Configuration sslConfigResource = new Configuration(false); final String SSL_CONFIG_LONG_NAME = Context.DAGContext.SSL_CONFIG.getLongName(); sslConfigResource.set(SSL_SERVER_KEYSTORE_LOCATION, new Path(sslConfig.getKeyStorePath()).getName(), SSL_CONFIG_LONG_NAME); sslConfigResource.set(WebAppUtils.WEB_APP_KEYSTORE_PASSWORD_KEY, sslConfig.getKeyStorePassword(), SSL_CONFIG_LONG_NAME); sslConfigResource.set(WebAppUtils.WEB_APP_KEY_PASSWORD_KEY, sslConfig.getKeyStoreKeyPassword(), SSL_CONFIG_LONG_NAME); config.addResource(sslConfigResource); } } }
Source:
public boolean isEmpty(String node) { return count(node) == 0; }

Target:
public boolean isEmpty(String node) { Deque<NetworkClient.InFlightRequest> queue = requests.get(node); return queue == null || queue.isEmpty(); }
Source:
public void test() throws Exception { AbstractReport<ClassReport,MethodReport> report = new AbstractReport<ClassReport,MethodReport>() { }; assertNotNull(report); report.setParent(new ClassReport()); report.getParent().setParent(new PackageReport()); TaskListener taskListener = new TaskListener() { public PrintStream getLogger() { return null; } public void annotate(ConsoleNote consoleNote) throws IOException { } public void hyperlink(String s, String s1) throws IOException { } public PrintWriter error(String s) { return null; } public PrintWriter error(String s, Object... objects) { return null; } public PrintWriter fatalError(String s) { return null; } public PrintWriter fatalError(String s, Object... objects) { return null; } }; JacocoBuildAction action = new JacocoBuildAction(null, null, taskListener, null, null); report.getParent().getParent().setParent(new CoverageReport(action, null)); assertNull(report.getBuild()); assertNull(report.getName()); assertNull(report.getDisplayName()); report.setName("testname"); assertEquals("testname", report.getName()); assertEquals("testname", report.getDisplayName()); }

Target:
public void test() throws Exception { AbstractReport<ClassReport,MethodReport> report = new AbstractReport<ClassReport,MethodReport>() { }; assertNotNull(report); report.setParent(new ClassReport()); report.getParent().setParent(new PackageReport()); TaskListener taskListener = StreamTaskListener.fromStdout(); JacocoBuildAction action = new JacocoBuildAction(null, null, taskListener, null, null); report.getParent().getParent().setParent(new CoverageReport(action, null)); assertNull(report.getBuild()); assertNull(report.getName()); assertNull(report.getDisplayName()); report.setName("testname"); assertEquals("testname", report.getName()); assertEquals("testname", report.getDisplayName()); }
Source:
protected void processOptions(Widget widget, ObjectNode schema) { Map<String, String> optionsMap = UiSchemaConstants.getWidgetOptionsMapping().get(widget.getWidgetType()); Map<String, List<String>> optionsMapMultipleValues = UiSchemaConstants.getWidgetOptionsMappingMultipleValues() .get(widget.getWidgetType()); if (optionsMap != null) { ObjectNode options = JsonNodeFactory.instance.objectNode(); for (Map.Entry<String, String> entry : optionsMap.entrySet()) { options.put(entry.getKey(), entry.getValue()); } schema.set(UiSchemaConstants.TAG_OPTIONS, options); } if (optionsMapMultipleValues != null) { ObjectNode options = JsonNodeFactory.instance.objectNode(); for (Map.Entry<String, List<String>> entry : optionsMapMultipleValues.entrySet()) { for (String value : entry.getValue()) { if (value.equals(widget.getWidgetCode().name())) { options.put(entry.getKey(), value); } } } schema.set(UiSchemaConstants.TAG_OPTIONS, options); } }

Target:
protected void processOptions(Widget widget, ObjectNode schema) { Map<String, String> optionsMap = UiSchemaConstants.getWidgetOptionsMapping().get(widget.getWidgetType()); if (optionsMap != null) { ObjectNode options = JsonNodeFactory.instance.objectNode(); for (Map.Entry<String, String> entry : optionsMap.entrySet()) { if (widget.getConfigurationValue(entry.getKey()) != null) { options.put(entry.getKey(), widget.getConfigurationValue(entry.getKey()).toString()); } else { options.put(entry.getKey(), entry.getValue()); } } schema.set(UiSchemaConstants.TAG_OPTIONS, options); } }
Source:
protected BluetoothConnectionBase(OutputStream outputStream, InputStream inputStream) { this((Form) null, (String) null, SdkLevel.LEVEL_CUPCAKE); this.connectedBluetoothSocket = "Not Null"; this.outputStream = outputStream; this.inputStream = inputStream; }

Target:
protected BluetoothConnectionBase(OutputStream outputStream, InputStream inputStream) { this((Form) null, (String) null, SdkLevel.LEVEL_ECLAIR_MR1); this.connectedBluetoothSocket = "Not Null"; this.outputStream = outputStream; this.inputStream = inputStream; }
Source:
public void setup(Context.OperatorContext context) { if (store == null) { store = new ManagedStateSpillableStateStore(); } sccImpl = new SpillableComplexComponentImpl(store); internValues = sccImpl.newSpillableByteMap((identifier + "#values").getBytes(), bucket, windowKeyPairSerde, valueSerde); internKeys = sccImpl.newSpillableByteArrayListMultimap((identifier + "#keys").getBytes(), bucket, windowSerde, keySerde); sccImpl.setup(context); }

Target:
public void setup(Context.OperatorContext context) { if (bucket == 0) { bucket = (context.getValue(Context.DAGContext.APPLICATION_NAME) + "#" + context.getId()).hashCode(); } if (windowSerde == null) { windowSerde = new SerdeKryoSlice<>(); } if (windowKeyPairSerde == null) { windowKeyPairSerde = new SerdeKryoSlice<>(); } if (keySerde == null) { keySerde = new SerdeKryoSlice<>(); } if (valueSerde == null) { valueSerde = new SerdeKryoSlice<>(); } if (windowKeyToValueMap == null) { windowKeyToValueMap = scc.newSpillableByteMap(bucket, windowKeyPairSerde, valueSerde); } if (windowToKeysMap == null) { windowToKeysMap = scc.newSpillableByteArrayListMultimap(bucket, windowSerde, keySerde); } }
Source:
private void updateCommitStatus(@Nonnull AbstractBuild<?, ?> build, @Nonnull BuildListener listener) throws InterruptedException, IOException { BuildData buildData = build.getAction(BuildData.class); if (buildData == null) { throw new IOException(Messages.GitHubCommitNotifier_NoBuildDataError()); } final Revision lastBuildRevision = buildData.getLastBuiltRevision(); final ObjectId sha1 = lastBuildRevision != null ? lastBuildRevision.getSha1() : null; if (sha1 == null) { throw new IOException(Messages.GitHubCommitNotifier_NoLastRevisionError()); } for (GitHubRepositoryName name : GitHubRepositoryNameContributor.parseAssociatedNames(build.getProject())) { for (GHRepository repository : name.resolve()) { GHCommitState state; String msg; final String duration = Util.getTimeSpanString(System.currentTimeMillis() - build.getTimeInMillis()); Result result = build.getResult(); if (result.isBetterOrEqualTo(SUCCESS)) { state = GHCommitState.SUCCESS; msg = Messages.CommitNotifier_Success(build.getDisplayName(), duration); } else if (result.isBetterOrEqualTo(UNSTABLE)) { state = GHCommitState.FAILURE; msg = Messages.CommitNotifier_Unstable(build.getDisplayName(), duration); } else { state = GHCommitState.ERROR; msg = Messages.CommitNotifier_Failed(build.getDisplayName(), duration); } listener.getLogger().println(Messages.GitHubCommitNotifier_SettingCommitStatus(repository.getUrl() + "/commit/" + sha1)); repository.createCommitStatus(ObjectId.toString(sha1), state, build.getAbsoluteUrl(), msg, "jenkins"); } } }

Target:
private void updateCommitStatus(@Nonnull AbstractBuild<?, ?> build, @Nonnull BuildListener listener) throws InterruptedException, IOException { final String sha1 = ObjectId.toString(BuildDataHelper.getCommitSHA1(build)); for (GitHubRepositoryName name : GitHubRepositoryNameContributor.parseAssociatedNames(build.getProject())) { for (GHRepository repository : name.resolve()) { GHCommitState state; String msg; final String duration = Util.getTimeSpanString(System.currentTimeMillis() - build.getTimeInMillis()); Result result = build.getResult(); if (result == null) { state = GHCommitState.PENDING; msg = Messages.CommitNotifier_Pending(build.getDisplayName()); } else if (result.isBetterOrEqualTo(SUCCESS)) { state = GHCommitState.SUCCESS; msg = Messages.CommitNotifier_Success(build.getDisplayName(), duration); } else if (result.isBetterOrEqualTo(UNSTABLE)) { state = GHCommitState.FAILURE; msg = Messages.CommitNotifier_Unstable(build.getDisplayName(), duration); } else { state = GHCommitState.ERROR; msg = Messages.CommitNotifier_Failed(build.getDisplayName(), duration); } listener.getLogger().println(Messages.GitHubCommitNotifier_SettingCommitStatus(repository.getUrl() + "/commit/" + sha1)); repository.createCommitStatus(sha1, state, build.getAbsoluteUrl(), msg, build.getFullDisplayName()); } } }
Source:
public void lockSettingsCodeSnippet() { ConfigurationClient configurationClient = createSyncConfigurationClient(); ConfigurationSetting result = configurationClient.setReadOnly("prodDBConnection", "westUS"); System.out.printf("Key: %s, Value: %s", result.getKey(), result.getValue()); END: com.azure.data.applicationconfig.configurationclient.setReadOnly#string-string ConfigurationSetting resultSetting = configurationClient .setReadOnly(new ConfigurationSetting().setKey("prodDBConnection").setLabel("westUS")); System.out.printf("Key: %s, Value: %s", resultSetting.getKey(), resultSetting.getValue()); END: com.azure.data.applicationconfig.configurationclient.setReadOnly#ConfigurationSetting Response<ConfigurationSetting> responseSetting = configurationClient .setSettingWithResponse(new ConfigurationSetting().setKey("prodDBConnection").setLabel("westUS"), new Context(key2, value2)); System.out .printf("Key: %s, Value: %s", responseSetting.getValue().getKey(), responseSetting.getValue().getValue()); END: com.azure.data.applicationconfig.configurationclient.setReadOnlyWithResponse#ConfigurationSetting-Context }

Target:
public void lockSettingsCodeSnippet() { ConfigurationClient configurationClient = createSyncConfigurationClient(); ConfigurationSetting result = configurationClient.setReadOnly("prodDBConnection", "westUS"); System.out.printf("Key: %s, Value: %s", result.getKey(), result.getValue()); END: com.azure.data.applicationconfig.configurationclient.setReadOnly#string-string ConfigurationSetting resultSetting = configurationClient.setReadOnlyWithResponse( new ConfigurationSetting().setKey("prodDBConnection").setLabel("westUS"), Context.NONE).getValue(); System.out.printf("Key: %s, Value: %s", resultSetting.getKey(), resultSetting.getValue()); END: com.azure.data.applicationconfig.configurationclient.setReadOnly#ConfigurationSetting Response<ConfigurationSetting> responseSetting = configurationClient .setSettingWithResponse(new ConfigurationSetting().setKey("prodDBConnection").setLabel("westUS"), false, new Context(key2, value2)); System.out.printf("Key: %s, Value: %s", responseSetting.getValue().getKey(), responseSetting.getValue().getValue()); END: com.azure.data.applicationconfig.configurationclient.setReadOnlyWithResponse#ConfigurationSetting-Context }
Source:
public List<String> getNames() { final List<String> steps = new ArrayList<>(); if (this.order == FirstStrikeStepOrder.NOT_APPLICABLE) { return steps; } steps.add(battleState.getDefender().getName() + FIRST_STRIKE_UNITS_FIRE); steps.add(battleState.getAttacker().getName() + SELECT_FIRST_STRIKE_CASUALTIES); return steps; }

Target:
public List<String> getNames() { final List<String> steps = new ArrayList<>(); if (this.state == State.NOT_APPLICABLE) { return steps; } steps.add(battleState.getDefender().getName() + FIRST_STRIKE_UNITS_FIRE); steps.add(battleState.getAttacker().getName() + SELECT_FIRST_STRIKE_CASUALTIES); return steps; }
Source:
void initByteBufferDexPath(ByteBuffer[] dexFiles) { if (dexFiles == null) { throw new NullPointerException("dexFiles == null"); } if (Arrays.stream(dexFiles).anyMatch(v -> v == null)) { throw new NullPointerException("dexFiles contains a null Buffer!"); } if (dexElements != null || dexElementsSuppressedExceptions != null) { throw new IllegalStateException("Should only be called once"); } final List<IOException> suppressedExceptions = new ArrayList<IOException>(); try { Element[] null_elements = null; DexFile dex = new DexFile(dexFiles); dexElements = new Element[] { new Element(dex) }; dex.verifyInBackground(definingContext); } catch (IOException suppressed) { System.logE("Unable to load dex files", suppressed); suppressedExceptions.add(suppressed); dexElements = new Element[0]; } if (suppressedExceptions.size() > 0) { dexElementsSuppressedExceptions = suppressedExceptions.toArray( new IOException[suppressedExceptions.size()]); } }

Target:
void initByteBufferDexPath(ByteBuffer[] dexFiles) { if (dexFiles == null) { throw new NullPointerException("dexFiles == null"); } if (Arrays.stream(dexFiles).anyMatch(v -> v == null)) { throw new NullPointerException("dexFiles contains a null Buffer!"); } if (dexElements != null || dexElementsSuppressedExceptions != null) { throw new IllegalStateException("Should only be called once"); } final List<IOException> suppressedExceptions = new ArrayList<IOException>(); try { Element[] null_elements = null; DexFile dex = new DexFile(dexFiles, definingContext, null_elements); String classLoaderContext = dex.isBackedByOatFile() ? null : DexFile.getClassLoaderContext(definingContext, null_elements); dexElements = new Element[] { new Element(dex) }; if (classLoaderContext != null) { dex.verifyInBackground(definingContext, classLoaderContext); } } catch (IOException suppressed) { System.logE("Unable to load dex files", suppressed); suppressedExceptions.add(suppressed); dexElements = new Element[0]; } if (suppressedExceptions.size() > 0) { dexElementsSuppressedExceptions = suppressedExceptions.toArray( new IOException[suppressedExceptions.size()]); } }
Source:
void setupProject(final ProjectVersion pv) throws ProjectManagerException, IOException { final int projectId = pv.getProjectId(); final int version = pv.getVersion(); final String projectDir = String.valueOf(projectId) + "." + String.valueOf(version); if (pv.getInstalledDir() == null) { pv.setInstalledDir(new File(this.projectsDir, projectDir)); } if (pv.getInstalledDir().exists()) { log.info("Project already cached. Skipping download. " + pv); touchIfExists( new File(Paths.get(pv.getInstalledDir().getPath(), Constants.PROJECT_DIR_SIZE_FILE_NAME) .toString())); return; } log.info("Preparing Project: " + pv); final File tempDir = new File(this.projectsDir, "_temp." + projectDir + "." + System.currentTimeMillis()); tempDir.mkdirs(); ProjectFileHandler projectFileHandler = null; try { projectFileHandler = requireNonNull(this.storageManager.getProjectFile(projectId, version)); checkState("zip".equals(projectFileHandler.getFileType())); log.info("Downloading zip file."); final File zipFile = requireNonNull(projectFileHandler.getLocalFile()); final ZipFile zip = new ZipFile(zipFile); Utils.unzip(zip, tempDir); updateDirSize(tempDir, pv); Files.move(tempDir.toPath(), pv.getInstalledDir().toPath(), StandardCopyOption.ATOMIC_MOVE); log.warn(String.format("Project preparation completes. [%s]", pv)); } finally { if (projectFileHandler != null) { projectFileHandler.deleteLocalFile(); } FileUtils.deleteDirectory(tempDir); } }

Target:
void setupProject(final ProjectVersion pv) throws ProjectManagerException, IOException { final int projectId = pv.getProjectId(); final int version = pv.getVersion(); final String projectDir = String.valueOf(projectId) + "." + String.valueOf(version); if (pv.getInstalledDir() == null) { pv.setInstalledDir(new File(this.projectsDir, projectDir)); } if (pv.getInstalledDir().exists()) { log.info("Project already cached. Skipping download. " + pv); touchIfExists( Paths.get(pv.getInstalledDir().getPath(), PROJECT_DIR_SIZE_FILE_NAME)); return; } log.info("Preparing Project: " + pv); final File tempDir = new File(this.projectsDir, "_temp." + projectDir + "." + System.currentTimeMillis()); tempDir.mkdirs(); ProjectFileHandler projectFileHandler = null; try { projectFileHandler = requireNonNull(this.storageManager.getProjectFile(projectId, version)); checkState("zip".equals(projectFileHandler.getFileType())); log.info("Downloading zip file."); final File zipFile = requireNonNull(projectFileHandler.getLocalFile()); final ZipFile zip = new ZipFile(zipFile); Utils.unzip(zip, tempDir); updateDirSize(tempDir, pv); Files.move(tempDir.toPath(), pv.getInstalledDir().toPath(), StandardCopyOption.ATOMIC_MOVE); log.warn(String.format("Project preparation completes. [%s]", pv)); } finally { if (projectFileHandler != null) { projectFileHandler.deleteLocalFile(); } FileUtils.deleteDirectory(tempDir); } }
Source:
private boolean isSearchedVariable(ExpressionTree variable) { return variable.is(Tree.Kind.IDENTIFIER) && usages.contains((IdentifierTree) variable); }

Target:
private boolean isSearchedVariable(ExpressionTree variable) { return variable.is(Tree.Kind.IDENTIFIER) && usages.contains(variable); }
Source:
public void preProcessModule(Module module) { DeploymentMetadata md = module.getDeploymentMetadata(); Properties properties = new Properties(); properties.setProperty("xd.stream.name", md.getGroup()); properties.setProperty("xd.module.index", String.valueOf(md.getIndex())); module.addProperties(properties); module.addListener(new ApplicationListener<ApplicationPreparedEvent>() { @Override public void onApplicationEvent(ApplicationPreparedEvent event) { MessageBusAwareRouterBeanPostProcessor bpp = new MessageBusAwareRouterBeanPostProcessor(messageBus); bpp.setBeanFactory(event.getApplicationContext()); event.getApplicationContext().getBeanFactory().registerSingleton( "messageBusAwareRouterBeanPostProcessor", bpp); } }); }

Target:
public void preProcessModule(Module module) { DeploymentMetadata md = module.getDeploymentMetadata(); Properties properties = new Properties(); properties.setProperty("xd.stream.name", md.getGroup()); properties.setProperty("xd.module.index", String.valueOf(md.getIndex())); module.addProperties(properties); if (module.getType() == ModuleType.sink) { module.addListener(new ApplicationListener<ApplicationPreparedEvent>() { @Override public void onApplicationEvent(ApplicationPreparedEvent event) { MessageBusAwareRouterBeanPostProcessor bpp = new MessageBusAwareRouterBeanPostProcessor(messageBus); bpp.setBeanFactory(event.getApplicationContext()); event.getApplicationContext().getBeanFactory().registerSingleton( "messageBusAwareRouterBeanPostProcessor", bpp); } }); } }