auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public void addDependencies(ChangeAttribute ca, Change change) { ca.dependsOn = new ArrayList<DependencyAttribute>(); ca.neededBy = new ArrayList<DependencyAttribute>(); try { final ReviewDb db = schema.open(); try { final PatchSet.Id psId = change.currentPatchSetId(); for (PatchSetAncestor a : db.patchSetAncestors().ancestorsOf(psId)) { for (PatchSet p : db.patchSets().byRevision(a.getAncestorRevision())) { Change c = db.changes().get(p.getId().getParentKey()); ca.dependsOn.add(newDependsOn(c, p)); } } final RevId revId = db.patchSets().get(psId).getRevision(); for (PatchSetAncestor a : db.patchSetAncestors().descendantsOf(revId)) { final PatchSet p = db.patchSets().get(a.getPatchSet()); final Change c = db.changes().get(p.getId().getParentKey()); ca.neededBy.add(newNeededBy(c, p)); } } finally { db.close(); } } catch (OrmException e) { } if (ca.dependsOn.isEmpty()) { ca.dependsOn = null; } if (ca.neededBy.isEmpty()) { ca.neededBy = null; } }

Target:
public void addDependencies(ChangeAttribute ca, Change change) { ca.dependsOn = new LinkedList<DependencyAttribute>(); ca.neededBy = new LinkedList<DependencyAttribute>(); try { final ReviewDb db = schema.open(); try { final PatchSet.Id psId = change.currentPatchSetId(); for (PatchSetAncestor a : db.patchSetAncestors().ancestorsOf(psId)) { for (PatchSet p : db.patchSets().byRevision(a.getAncestorRevision())) { Change c = db.changes().get(p.getId().getParentKey()); ca.dependsOn.add(newDependsOn(c, p)); } } final RevId revId = db.patchSets().get(psId).getRevision(); for (PatchSetAncestor a : db.patchSetAncestors().descendantsOf(revId)) { final PatchSet p = db.patchSets().get(a.getPatchSet()); final Change c = db.changes().get(p.getId().getParentKey()); ca.neededBy.add(newNeededBy(c, p)); } } finally { db.close(); } } catch (OrmException e) { } if (ca.dependsOn.isEmpty()) { ca.dependsOn = null; } if (ca.neededBy.isEmpty()) { ca.neededBy = null; } }
Source:
public void testGetIdsListId(){ List<Long> result = mgr.getIdsListFromCmd(id1, idsEmptyList); assertEquals(result, expectedListId); }

Target:
public void testGetIdsListId(){ List<Long> result = mgr.getIdsListFromCmd(id1, idsEmptyList); assertEquals(expectedListId, result); }
Source:
private void processConnectorConfigUpdates(Set<String> connectorConfigUpdates) { Set<String> localConnectors = assignment == null ? Collections.<String>emptySet() : new HashSet<>(assignment.connectors()); log.trace( "Processing connector config updates; " + "currently-owned connectors are {}, and to-be-updated connectors are {}", localConnectors, connectorConfigUpdates ); for (String connectorName : connectorConfigUpdates) { if (!localConnectors.contains(connectorName)) { log.trace( "Skipping config update for connector as it is not owned by this worker", connectorName ); continue; } boolean remains = configState.contains(connectorName); log.info("Handling connector-only config update by connector {}", remains ? "restarting" : "stopping", connectorName); worker.stopAndAwaitConnector(connectorName); if (remains) startConnector(connectorName, (error, result) -> { }); } }

Target:
private void processConnectorConfigUpdates(Set<String> connectorConfigUpdates) { Set<String> localConnectors = assignment == null ? Collections.<String>emptySet() : new HashSet<>(assignment.connectors()); log.trace("Processing connector config updates; " + "currently-owned connectors are {}, and to-be-updated connectors are {}", localConnectors, connectorConfigUpdates); for (String connectorName : connectorConfigUpdates) { if (!localConnectors.contains(connectorName)) { log.trace("Skipping config update for connector as it is not owned by this worker", connectorName); continue; } boolean remains = configState.contains(connectorName); log.info("Handling connector-only config update by connector {}", remains ? "restarting" : "stopping", connectorName); worker.stopAndAwaitConnector(connectorName); if (remains) { startConnector(connectorName, (error, result) -> { if (error != null) { log.error("Failed to start connector '" + connectorName + "'", error); } }); } } }
Source:
private <V> ListenableFuture<V> execute( Statement executableStatement, Executor executor, RowStreamAccumulator<V> rowStreamAccumulator) { return Futures.transformAsync( AtlasFutures.tracingFuture(() -> session.executeAsync(executableStatement), "CqlClientImpl: execute"), iterate(executor, rowStreamAccumulator), executor); }

Target:
private <V> ListenableFuture<V> execute( Statement executableStatement, Executor executor, RowStreamAccumulator<V> rowStreamAccumulator) { return Futures.transformAsync( session.executeAsync(executableStatement), iterate(executor, rowStreamAccumulator), executor); }
Source:
public void testSomeUser() { List<Integer> lightData = Lists.newArrayList(); final URL userCSVFile = Resources.getResource("insights/bedlightduration/lightDataUser1.csv"); try { final String csvString = Resources.toString(userCSVFile, Charsets.UTF_8); final String[] lightDataStringList = csvString.replaceAll("\\s+","").split(","); for (String lightDataString : lightDataStringList) { lightData.add(Integer.parseInt(lightDataString)); } } catch (IOException ioexception) { ioexception.printStackTrace(); } List<Long> timeStamps = Lists.newArrayList(); final URL timeStampCSVFile = Resources.getResource("insights/bedlightduration/timeStampUser1.csv"); try { final String csvString = Resources.toString(timeStampCSVFile, Charsets.UTF_8); final String[] timeStampStringList = csvString.replaceAll("\\s+","").replaceAll("L","").split(","); for (String timeStampString : timeStampStringList) { timeStamps.add(Long.parseLong(timeStampString)); } } catch (IOException ioexception) { ioexception.printStackTrace(); } final List<DeviceData> deviceData = Lists.newArrayList(); for (int i = 0; i < lightData.size(); i++) { final int myHour = new DateTime(timeStamps.get(i), DateTimeZone.forOffsetMillis(-25200000)).getHourOfDay(); if (myHour > 21 || myHour < 4) { deviceData.add(createNewDeviceData(lightData.get(i), new DateTime(timeStamps.get(i)))); } } final int avgLightOn = BedLightDuration.getInsightsHelper(deviceData); assertThat(avgLightOn, is(26)); }

Target:
public void testSomeUser() throws IOException{ final List<Integer> lightData = readLightData("insights/bedlightduration/lightDataUser1.csv"); final List<Long> timeStamps = readTimeStamps("insights/bedlightduration/timeStampUser1.csv"); final List<DeviceData> deviceData = Lists.newArrayList(); for (int i = 0; i < lightData.size(); i++) { final int myHour = new DateTime(timeStamps.get(i), DateTimeZone.forOffsetMillis(-25200000)).getHourOfDay(); if (myHour > 21 || myHour < 4) { deviceData.add(createNewDeviceData(lightData.get(i), new DateTime(timeStamps.get(i)))); } } final int avgLightOn = BedLightDuration.getInsightsHelper(deviceData); assertThat(avgLightOn, is(26)); }
Source:
public Either<java.util.Set<ParseFailedException>, Term> apply(TermCons tc) { if (tc.production().items().last() instanceof NonTerminal) { String msg = "Due to typing errors, Casting is too greedy. Use parentheses to set proper scope."; KException kex = new KException(KException.ExceptionType.ERROR, KException.KExceptionGroup.CRITICAL, msg, null, null); return Left.apply(Sets.newHashSet(new PriorityException(kex))); } return Right.apply(tc); }

Target:
public Either<java.util.Set<ParseFailedException>, Term> apply(TermCons tc) { if (tc.production().items().last() instanceof NonTerminal) { String msg = parent.production().klabel().get() + " is not allowed to be an immediate child of cast." + " Use parentheses: (x):Sort to set the proper scope of the operations."; KException kex = new KException(KException.ExceptionType.ERROR, KException.KExceptionGroup.CRITICAL, msg, null, tc.location().get()); return Left.apply(Sets.newHashSet(new PriorityException(kex))); } return Right.apply(tc); }
Source:
public Config hazelcastConfig() { final Config config = new Config() .setInstanceName("hazelcast-instance") .addMapConfig(newDefaultMapConfig(CacheName.User.USERS)) .addMapConfig(newDefaultMapConfig(CacheName.User.USER_DETAILS)) .addMapConfig(newDefaultMapConfig(CacheName.Repository.REMOTE_REPOSITORY_ALIVENESS)) .addMapConfig(newDefaultMapConfig(CacheName.Artifact.TAGS)); config.getGroupConfig().setName("strongbox").setPassword("password"); return config; }

Target:
public Config hazelcastConfig() { final Config config = new Config().setInstanceName("strongbox") .addMapConfig(newDefaultMapConfig(CacheName.User.USERS)) .addMapConfig(newDefaultMapConfig(CacheName.User.USER_DETAILS)) .addMapConfig(newDefaultMapConfig(CacheName.Repository.REMOTE_REPOSITORY_ALIVENESS)) .addMapConfig(newDefaultMapConfig(CacheName.Artifact.TAGS)); config.getGroupConfig().setName("strongbox").setPassword("password"); return config; }
Source:
private static void refreshBorderFigure(final BorderedStyle borderedStyle, final StyledFigure styledFigure) { LineBorder lineBorder = null; if (styledFigure.getBorder() instanceof LineBorder) { lineBorder = (LineBorder) styledFigure.getBorder(); } else { lineBorder = new LineBorder(); if (styledFigure instanceof Shape) { styledFigure.setBorder(null); ((Shape) styledFigure).setOutline(false); } else { styledFigure.setBorder(lineBorder); } } int borderSize = 0; if (borderedStyle.getBorderSize() != null) { borderSize = borderedStyle.getBorderSize().intValue(); } lineBorder.setWidth(borderSize); final RGBValues borderColor = borderedStyle.getBorderColor(); if (borderColor != null) { lineBorder.setColor(VisualBindingManager.getDefault().getColorFromRGBValues(borderColor)); } if (borderSize == 0) { if (!(styledFigure instanceof NoteFigure)) { styledFigure.setBorder(null); if (styledFigure instanceof Shape) { ((Shape) styledFigure).setOutline(false); } } else { if (styledFigure instanceof Shape) { ((Shape) styledFigure).setOutline(true); } } } }

Target:
private static void refreshBorderFigure(final BorderedStyle borderedStyle, final StyledFigure styledFigure) { LineBorder lineBorder = null; if (styledFigure.getBorder() instanceof LineBorder) { lineBorder = (LineBorder) styledFigure.getBorder(); } else { lineBorder = new LineBorder(); if (styledFigure instanceof Shape) { styledFigure.setBorder(null); } else { styledFigure.setBorder(lineBorder); } } int borderSize = 0; if (borderedStyle.getBorderSize() != null) { borderSize = borderedStyle.getBorderSize().intValue(); } lineBorder.setWidth(borderSize); final RGBValues borderColor = borderedStyle.getBorderColor(); if (borderColor != null) { lineBorder.setColor(VisualBindingManager.getDefault().getColorFromRGBValues(borderColor)); } if (borderSize == 0) { if (!(styledFigure instanceof NoteFigure)) { styledFigure.setBorder(null); if (styledFigure instanceof Shape) { ((Shape) styledFigure).setOutline(false); } } } else if (styledFigure instanceof Shape) { ((Shape) styledFigure).setOutline(true); } }
Source:
private void setQcowCompatByQemuImageInfo(Guid storagePoolId, Guid newImageGroupId, Guid newImageId, Guid newStorageDomainID) { Guid hostIdToExecuteQemuImageInfo = null; List<Pair<VM, VmDevice>> attachedVmsInfo = vmDao.getVmsWithPlugInfo(getDestinationDiskImage().getId()); for (Pair<VM, VmDevice> pair : attachedVmsInfo) { VM vm = pair.getFirst(); if (Boolean.TRUE.equals(pair.getSecond().isPlugged())) { if (vm.isStartingOrUp()) { hostIdToExecuteQemuImageInfo = vm.getRunOnVds(); break; } } } setQcowCompat(getDestinationDiskImage().getImage(), storagePoolId, newImageGroupId, newImageId, newStorageDomainID, hostIdToExecuteQemuImageInfo, hostIdToExecuteQemuImageInfo == null); }

Target:
private void setQcowCompatByQemuImageInfo(Guid storagePoolId, Guid newImageGroupId, Guid newImageId, Guid newStorageDomainID) { Guid hostIdToExecuteQemuImageInfo = null; List<Pair<VM, VmDevice>> attachedVmsInfo = vmDao.getVmsWithPlugInfo(getDestinationDiskImage().getId()); for (Pair<VM, VmDevice> pair : attachedVmsInfo) { VM vm = pair.getFirst(); if (Boolean.TRUE.equals(pair.getSecond().isPlugged())) { if (vm.isStartingOrUp()) { hostIdToExecuteQemuImageInfo = vm.getRunOnVds(); break; } } } setQcowCompat(getDestinationDiskImage().getImage(), storagePoolId, newImageGroupId, newImageId, newStorageDomainID, hostIdToExecuteQemuImageInfo); }
Source:
public int getMinimumVerifiedValue(MemoryImprint memoryImprint, boolean onlyBuilt) { Integer verified = Integer.MAX_VALUE; for (Entry entry : memoryImprint.getEntries()) { if (entry == null) { continue; } Run build = entry.getBuild(); if (build == null) { continue; } Result result = build.getResult(); if (onlyBuilt && result == Result.NOT_BUILT) { continue; } GerritTrigger trigger = GerritTrigger.getTrigger(entry.getProject()); if (shouldSkip(trigger.getSkipVote(), result)) { continue; } Integer verifiedObj = getVerifiedValue(result, trigger); if (verifiedObj != null) { verified = Math.min(verified, verifiedObj); } } return verified; }

Target:
public Integer getMinimumVerifiedValue(MemoryImprint memoryImprint, boolean onlyBuilt) { Integer verified = Integer.MAX_VALUE; for (Entry entry : memoryImprint.getEntries()) { if (entry == null) { continue; } Run build = entry.getBuild(); if (build == null) { continue; } Result result = build.getResult(); if (onlyBuilt && result == Result.NOT_BUILT) { continue; } GerritTrigger trigger = GerritTrigger.getTrigger(entry.getProject()); if (shouldSkip(trigger.getSkipVote(), result)) { continue; } Integer verifiedObj = getVerifiedValue(result, trigger); if (verifiedObj != null) { verified = Math.min(verified, verifiedObj); } } if (verified == Integer.MAX_VALUE) { return null; } return verified; }
Source:
public void addSecret(String secret) { ModelNode secretNode = get(SERVICE_ACCOUNT_SECRETS); secretNode.add("name", secret); }

Target:
public void addSecret(String secret) { ModelNode secretNodeName = get(SERVICE_ACCOUNT_SECRETS).add(); set(secretNodeName, NAME, secret); }
Source:
public void stream() throws InterruptedException { try (Closeable ignore = ShutdownHooks.addHook(this::onNodeShutdown)) { streamInternal(new StartingState()); } catch (IOException ex) { log.error( "Failed to delete shutdown hook for subscription {}. This method should not throw any exception", getSubscription(), ex); } }

Target:
public void stream() throws InterruptedException { try (Closeable ignore = ShutdownHooks.addHook(this::onNodeShutdown)) { streamInternal(new StartingState()); } catch (final IOException ex) { log.error( "Failed to delete shutdown hook for subscription {}. This method should not throw any exception", getSubscription(), ex); } }
Source:
public void writeStringNoTag(final String value) throws IOException { writeRawVarint32(encodedLength(value)); CharsetEncoder charsetEncoder = Charset.forName("UTF-8").newEncoder(); CoderResult coderResult = charsetEncoder.encode(CharBuffer.wrap(value), buffer, true ); if (coderResult.isError() && !coderResult.isUnderflow()) { coderResult.throwException(); } }

Target:
public void writeStringNoTag(final String value) throws IOException { writeRawVarint32(encodedLength(value)); if (charsetEncoder == null ) { charsetEncoder = UTF8_CHARSET.newEncoder(); } try { final CharBuffer charBuffer = CharBuffer.wrap(value); CoderResult coderResult = charsetEncoder.encode(charBuffer, buffer, true ); if (coderResult.isError() && !coderResult.isUnderflow()) { coderResult.throwException(); } coderResult = charsetEncoder.flush(buffer); if (coderResult.isError() && !coderResult.isUnderflow()) { coderResult.throwException(); } } finally { charsetEncoder.reset(); } }
Source:
private void processNewDelete(ScanResults results, IndexValue deleteValue, IndexValue originalPutValue) { long operationTimeInMs = deleteValue.getOperationTimeInMs() == Utils.Infinite_Time ? index.getIndexSegments() .floorEntry(deleteValue.getOffset()) .getValue() .getLastModifiedTimeMs() : deleteValue.getOperationTimeInMs(); results.updateLogSegmentBaseBucket(deleteValue.getOffset().getName(), deleteValue.getSize()); if (!isExpired(originalPutValue.getExpiresAtMs(), operationTimeInMs)) { handleContainerBucketUpdate(results, originalPutValue, operationTimeInMs, SUBTRACT); handleLogSegmentBucketUpdate(results, originalPutValue, operationTimeInMs, SUBTRACT); if (originalPutValue.getExpiresAtMs() != Utils.Infinite_Time) { handleContainerBucketUpdate(results, originalPutValue, originalPutValue.getExpiresAtMs(), ADD); handleLogSegmentBucketUpdate(results, originalPutValue, originalPutValue.getExpiresAtMs(), ADD); } } }

Target:
private void processNewDelete(ScanResults results, IndexValue deleteValue, IndexValue originalPutValue) { long operationTimeInMs = deleteValue.getOperationTimeInMs(); if (operationTimeInMs == Utils.Infinite_Time) { operationTimeInMs = index.getIndexSegments().floorEntry(deleteValue.getOffset()).getValue().getLastModifiedTimeMs(); } results.updateLogSegmentBaseBucket(deleteValue.getOffset().getName(), deleteValue.getSize()); if (!isExpired(originalPutValue.getExpiresAtMs(), operationTimeInMs)) { handleContainerBucketUpdate(results, originalPutValue, operationTimeInMs, SUBTRACT); handleLogSegmentBucketUpdate(results, originalPutValue, operationTimeInMs, SUBTRACT); if (originalPutValue.getExpiresAtMs() != Utils.Infinite_Time) { handleContainerBucketUpdate(results, originalPutValue, originalPutValue.getExpiresAtMs(), ADD); handleLogSegmentBucketUpdate(results, originalPutValue, originalPutValue.getExpiresAtMs(), ADD); } } }
Source:
public byte[] getRawPath() { return path; }

Target:
public byte[] getRawPath() { return path.clone(); }
Source:
public static String getArtifactLabel(EObject object) { String artifactLabel = null; if (object instanceof ArtifactWrapper) { ArtifactWrapper wrapper = (ArtifactWrapper) object; Collection<ArtifactHandler> artifactHandlers = ExtensionPointHelper.getArtifactHandlers(); for (ArtifactHandler handler : artifactHandlers) { String handlerName = handler.toString().substring(0, handler.toString().indexOf('@')); if (handlerName.equals(wrapper.getArtifactHandler())) { Object originalObject = handler.resolveArtifact(object); if (originalObject != null) { String artifactName = handler.getDisplayName(originalObject); artifactLabel = artifactName.replaceAll(CHARACTERS_TO_BE_REMOVED, " "); } else { String label = EMFHelper.getIdentifier(object); artifactLabel = label.substring(0, label.indexOf(':')); artifactLabel = artifactLabel.replaceAll(CHARACTERS_TO_BE_REMOVED, " "); } } } } else { artifactLabel = EMFHelper.getIdentifier(object); artifactLabel = artifactLabel.replaceAll(CHARACTERS_TO_BE_REMOVED, " "); } return artifactLabel; }

Target:
public static String getArtifactLabel(EObject object) { String artifactLabel = null; if (object instanceof ArtifactWrapper) { ArtifactWrapper wrapper = (ArtifactWrapper) object; Collection<ArtifactHandler> artifactHandlers = ExtensionPointHelper.getArtifactHandlers(); for (ArtifactHandler handler : artifactHandlers) { String handlerName = handler.toString().substring(0, handler.toString().indexOf('@')); if (handlerName.equals(wrapper.getArtifactHandler())) { Object originalObject = handler.resolveArtifact(object); if (originalObject != null) { artifactLabel = handler.getDisplayName(originalObject); } else { String label = EMFHelper.getIdentifier(object); artifactLabel = label.substring(0, label.indexOf(':')); } } } } else { artifactLabel = EMFHelper.getIdentifier(object); } return artifactLabel.replaceAll(CHARACTERS_TO_BE_REMOVED, " "); }
Source:
private boolean isAnnotationPresent(AnnotatedType annotatedType, Set<Annotation> processedAnnotations) { if ( annotatedType instanceof AnnotatedParameterizedType ) { for ( AnnotatedType type : ( (AnnotatedParameterizedType) annotatedType ).getAnnotatedActualTypeArguments() ) { if ( isAnnotationPresent( type, processedAnnotations ) ) { return true; } } } if ( isAnnotationPresentIn( annotatedType.getDeclaredAnnotations(), processedAnnotations ) ) { return true; } return false; }

Target:
private boolean isAnnotationPresent(AnnotatedType annotatedType, Set<Annotation> processedAnnotations) { if ( isAnnotationPresentIn( annotatedType.getDeclaredAnnotations(), processedAnnotations ) ) { return true; } if ( annotatedType instanceof AnnotatedParameterizedType ) { for ( AnnotatedType type : ( (AnnotatedParameterizedType) annotatedType ).getAnnotatedActualTypeArguments() ) { if ( isAnnotationPresent( type, processedAnnotations ) ) { return true; } } } return false; }
Source:
public void execute() { BibDatabaseContext database = stateManager.getActiveDatabase().orElseThrow(() -> new NullPointerException("Database null")); List<BibEntry> entries = stateManager.getSelectedEntries(); final NamedCompound nc = new NamedCompound(Localization.lang("Automatically set file links")); AutoSetFileLinksUtil util = new AutoSetFileLinksUtil( database, preferences.getFilePreferences(), preferences.getAutoLinkPreferences(), ExternalFileTypes.getInstance()); Task<List<BibEntry>> linkFilesTask = new Task<>() { @Override protected List<BibEntry> call() { return util.linkAssociatedFiles(entries, nc); } @Override protected void succeeded() { if (util.returnFileExceptions().isEmpty()) { if (!getValue().isEmpty()) { if (nc.hasEdits()) { nc.end(); undoManager.addEdit(nc); } dialogService.notify(Localization.lang("Finished automatically setting external links.")); } else { dialogService.notify(Localization.lang("Finished automatically setting external links.") + " " + Localization.lang("No files found.")); } } else { dialogService.notify(Localization.lang("Problem finding files")); } } }; dialogService.showProgressDialog( Localization.lang("Automatically setting file links"), Localization.lang("Searching for files"), linkFilesTask); taskExecutor.execute(linkFilesTask); }

Target:
public void execute() { final BibDatabaseContext database = stateManager.getActiveDatabase().orElseThrow(() -> new NullPointerException("Database null")); final List<BibEntry> entries = stateManager.getSelectedEntries(); final AutoSetFileLinksUtil util = new AutoSetFileLinksUtil( database, preferences.getFilePreferences(), preferences.getAutoLinkPreferences(), ExternalFileTypes.getInstance()); final NamedCompound nc = new NamedCompound(Localization.lang("Automatically set file links")); Task<AutoSetFileLinksUtil.LinkFilesResult> linkFilesTask = new Task<>() { @Override protected AutoSetFileLinksUtil.LinkFilesResult call() { return util.linkAssociatedFiles(entries, nc); } @Override protected void succeeded() { AutoSetFileLinksUtil.LinkFilesResult result = getValue(); if (!result.getFileExceptions().isEmpty()) { dialogService.showWarningDialogAndWait( Localization.lang("Automatically set file links"), Localization.lang("Problem finding files. See error log for details.")); return; } if (result.getChangedEntries().isEmpty()) { dialogService.showWarningDialogAndWait("Automatically set file links", Localization.lang("Finished automatically setting external links.") + "\n" + Localization.lang("No files found.")); return; } if (nc.hasEdits()) { nc.end(); undoManager.addEdit(nc); } dialogService.notify(Localization.lang("Finished automatically setting external links.") + " " + Localization.lang("Changed %0 entries.", String.valueOf(result.getChangedEntries().size()))); } }; dialogService.showProgressDialog( Localization.lang("Automatically setting file links"), Localization.lang("Searching for files"), linkFilesTask); taskExecutor.execute(linkFilesTask); }
Source:
public String getShareReferrerUrl(String loginName) { if (Strings.isNullOrEmpty(loginName)) { return AppUrl.LOGIN.getPath(); } UserModel userModel = userMapper.findByLoginName(loginName); RedEnvelopSplitActivityDto redEnvelopSplitActivityDto = new RedEnvelopSplitActivityDto(String.format(REFERRER_TITLE, userModel.getUserName()), REFERRER_DESCRIPTION, domainName + "/activity/red-envelop-split/referrer"); logger.info(MessageFormat.format("[redEnvelopSplit] shard url:{0}", redEnvelopSplitActivityDto.getShareUrl())); String paramJson = ""; try { paramJson = JsonConverter.writeValueAsString(redEnvelopSplitActivityDto); } catch (JsonProcessingException e) { e.printStackTrace(); } String base64 = ""; try { base64 = Base64.getEncoder().encodeToString(paramJson.getBytes("utf-8")); } catch (UnsupportedEncodingException e) { e.printStackTrace(); } return String.format(AppUrl.SHARE.getPath(), base64); }

Target:
public String getShareReferrerUrl(String loginName) { if (Strings.isNullOrEmpty(loginName)) { return AppUrl.LOGIN.getPath(); } UserModel userModel = userMapper.findByLoginName(loginName); RedEnvelopSplitActivityDto redEnvelopSplitActivityDto = new RedEnvelopSplitActivityDto(String.format(REFERRER_TITLE, userModel.getUserName() == null ? "" : userModel.getUserName()), REFERRER_DESCRIPTION, domainName + "/activity/red-envelop-split/referrer"); logger.info(MessageFormat.format("[redEnvelopSplit] shard url:{0}", redEnvelopSplitActivityDto.getShareUrl())); String paramJson = ""; String base64 = ""; try { paramJson = JsonConverter.writeValueAsString(redEnvelopSplitActivityDto); base64 = Base64.getEncoder().encodeToString(paramJson.getBytes("utf-8")); } catch (JsonProcessingException e) { logger.info(MessageFormat.format("[redEnvelopSplit] json converter fail, userName:{0}, shardUrl:{1}", userModel.getUserName(), redEnvelopSplitActivityDto.getShareUrl())); } catch (UnsupportedEncodingException e) { logger.info(MessageFormat.format("[redEnvelopSplit] base64 converter fail, json:{0}", paramJson)); } return String.format(AppUrl.SHARE.getPath(), base64); }
Source:
private long latestRoundLearnedLocally() { return getGreatestLearnedPaxosValue().map(PaxosValue::getRound).orElse(-1L); }

Target:
private long latestRoundLearnedLocally() { return getGreatestLearnedPaxosValue().map(PaxosValue::getRound).orElse(PaxosAcceptor.NO_LOG_ENTRY); }
Source:
public void visitFile(@Nullable Tree parsedTree) { semanticModel = null; CompilationUnitTree tree = new JavaTree.CompilationUnitTreeImpl(null, new ArrayList<>(), new ArrayList<>(), null, null); boolean fileParsed = parsedTree != null; if (fileParsed && parsedTree.is(Tree.Kind.COMPILATION_UNIT)) { tree = (CompilationUnitTree) parsedTree; if (isNotJavaLangOrSerializable(PackageUtils.packageName(tree.packageDeclaration(), "/"))) { try { semanticModel = SemanticModel.createFor(tree, classLoader); } catch (Exception e) { LOG.error("Unable to create symbol table for : " + currentFile.getAbsolutePath(), e); addAnalysisError(e, currentFile.getPath(), AnalysisError.Kind.SEMANTIC_ERROR); sonarComponents.reportAnalysisError(currentFile, e.getMessage()); return; } createSonarSymbolTable(tree); } else { SemanticModel.handleMissingTypes(tree); } } JavaFileScannerContext javaFileScannerContext = createScannerContext(tree, semanticModel, sonarComponents, fileParsed); if (symbolicExecutionEnabled && isNotJavaLangOrSerializable(PackageUtils.packageName(tree.packageDeclaration(), "/"))) { runScanner(javaFileScannerContext, new SymbolicExecutionVisitor(executableScanners, behaviorCache), AnalysisError.Kind.SE_ERROR); behaviorCache.cleanup(); } scannerRunner.run(javaFileScannerContext); executableScanners.stream().filter(s -> s instanceof SymbolicExecutionVisitor || !(s instanceof IssuableSubscriptionVisitor)) .forEach(scanner -> runScanner(javaFileScannerContext, scanner, AnalysisError.Kind.CHECK_ERROR)); if (semanticModel != null) { classesNotFound.addAll(semanticModel.classesNotFound()); } }

Target:
public void visitFile(@Nullable Tree parsedTree) { semanticModel = null; CompilationUnitTree tree = new JavaTree.CompilationUnitTreeImpl(null, new ArrayList<>(), new ArrayList<>(), null, null); boolean fileParsed = parsedTree != null; if (fileParsed && parsedTree.is(Tree.Kind.COMPILATION_UNIT)) { tree = (CompilationUnitTree) parsedTree; if (isNotJavaLangOrSerializable(PackageUtils.packageName(tree.packageDeclaration(), "/"))) { try { semanticModel = SemanticModel.createFor(tree, classLoader); } catch (Exception e) { LOG.error("Unable to create symbol table for : " + currentFile.getAbsolutePath(), e); addAnalysisError(e, currentFile.getPath(), AnalysisError.Kind.SEMANTIC_ERROR); sonarComponents.reportAnalysisError(currentFile, e.getMessage()); return; } createSonarSymbolTable(tree); } else { SemanticModel.handleMissingTypes(tree); } } JavaFileScannerContext javaFileScannerContext = createScannerContext(tree, semanticModel, sonarComponents, fileParsed); if (symbolicExecutionEnabled && isNotJavaLangOrSerializable(PackageUtils.packageName(tree.packageDeclaration(), "/"))) { runScanner(javaFileScannerContext, new SymbolicExecutionVisitor(executableScanners, behaviorCache), AnalysisError.Kind.SE_ERROR); behaviorCache.cleanup(); } executableScanners.forEach(scanner -> runScanner(javaFileScannerContext, scanner, AnalysisError.Kind.CHECK_ERROR)); scannerRunner.run(javaFileScannerContext); if (semanticModel != null) { classesNotFound.addAll(semanticModel.classesNotFound()); } }
Source:
private void checkPlus(ExpressionTree leftOperand, ExpressionTree rightOperand, Type leftType, Type rightType, Tree operator) { if (leftType != Type.STRING && rightType != Type.STRING) { if (leftType == Type.NUMBER && BOOLEAN_DATE.contains(rightType)) { raiseIssue(rightOperand, leftOperand, operator); } if (rightType == Type.NUMBER && BOOLEAN_DATE.contains(leftType)) { raiseIssue(leftOperand, leftOperand, operator); } } }

Target:
private void checkPlus(ExpressionTree leftOperand, ExpressionTree rightOperand, Type leftType, Type rightType, Tree operator) { if (leftType != Type.STRING && rightType != Type.STRING) { if (leftType == Type.NUMBER && BOOLEAN_DATE.contains(rightType)) { raiseIssue(rightOperand, leftOperand, operator); } if (rightType == Type.NUMBER && BOOLEAN_DATE.contains(leftType)) { raiseIssue(leftOperand, rightOperand, operator); } } }
Source:
private void validateCallbackUrl(String callbackUrl) { try { new URL(callbackUrl); } catch (MalformedURLException e) { throw new IllegalArgumentException("Callback URL must be valid if provided!"); } }

Target:
private void validateCallbackUrl(String callbackUrl) { try { new URL(callbackUrl); } catch (MalformedURLException e) { throw new IllegalArgumentException("Callback URL must be valid if provided!", e); } }
Source:
public RowIterator(GroupByQuery query, final Cursor cursor, ByteBuffer metricsBuffer, GroupByQueryConfig config) { this.query = query; this.cursor = cursor; this.metricsBuffer = metricsBuffer; this.config = config; unprocessedKeys = null; delegate = Iterators.emptyIterator(); dimensionSpecs = query.getDimensions(); dimensions = Lists.newArrayListWithExpectedSize(dimensionSpecs.size()); dimNames = Lists.newArrayListWithExpectedSize(dimensionSpecs.size()); for (int i = 0; i < dimensionSpecs.size(); ++i) { final DimensionSpec dimSpec = dimensionSpecs.get(i); final String dimension = dimSpec.getDimension(); final DimensionSelector selector = cursor.makeDimensionSelector( dimension, dimSpec.getExtractionFn() ); if (selector != null) { dimensions.add(selector); dimNames.add(dimSpec.getOutputName()); } } aggregatorSpecs = query.getAggregatorSpecs(); aggregators = new BufferAggregator[aggregatorSpecs.size()]; metricNames = new String[aggregatorSpecs.size()]; sizesRequired = new int[aggregatorSpecs.size()]; for (int i = 0; i < aggregatorSpecs.size(); ++i) { AggregatorFactory aggregatorSpec = aggregatorSpecs.get(i); aggregators[i] = aggregatorSpec.factorizeBuffered(cursor); metricNames[i] = aggregatorSpec.getName(); sizesRequired[i] = aggregatorSpec.getMaxIntermediateSize(); } }

Target:
public RowIterator(GroupByQuery query, final Cursor cursor, ByteBuffer metricsBuffer, GroupByQueryConfig config) { this.query = query; this.cursor = cursor; this.metricsBuffer = metricsBuffer; this.config = config; unprocessedKeys = null; delegate = Iterators.emptyIterator(); dimensionSpecs = query.getDimensions(); dimensions = Lists.newArrayListWithExpectedSize(dimensionSpecs.size()); dimNames = Lists.newArrayListWithExpectedSize(dimensionSpecs.size()); for (int i = 0; i < dimensionSpecs.size(); ++i) { final DimensionSpec dimSpec = dimensionSpecs.get(i); final DimensionSelector selector = cursor.makeDimensionSelector( dimSpec.getDimension(), dimSpec.getExtractionFn() ); if (selector != null) { dimensions.add(selector); dimNames.add(dimSpec.getOutputName()); } } aggregatorSpecs = query.getAggregatorSpecs(); aggregators = new BufferAggregator[aggregatorSpecs.size()]; metricNames = new String[aggregatorSpecs.size()]; sizesRequired = new int[aggregatorSpecs.size()]; for (int i = 0; i < aggregatorSpecs.size(); ++i) { AggregatorFactory aggregatorSpec = aggregatorSpecs.get(i); aggregators[i] = aggregatorSpec.factorizeBuffered(cursor); metricNames[i] = aggregatorSpec.getName(); sizesRequired[i] = aggregatorSpec.getMaxIntermediateSize(); } }
Source:
private void showGutenbergInformativeDialog() { if (!mIsNewPost && !AppPrefs.isGutenbergInformativeDialogDisabled()) { final PromoDialog asyncPromoDialog = new PromoDialog(); asyncPromoDialog.initialize(TAG_GB_INFORMATIVE_DIALOG, getString(R.string.dialog_gutenberg_informative_title), mPost.isPage() ? getString(R.string.dialog_gutenberg_informative_description_page) : getString(R.string.dialog_gutenberg_informative_description_post), getString(org.wordpress.android.editor.R.string.dialog_button_ok)); asyncPromoDialog.show(getSupportFragmentManager(), TAG_GB_INFORMATIVE_DIALOG); AppPrefs.setGutenbergInformativeDialogDisabled(true); } }

Target:
private void showGutenbergInformativeDialog() { if (!mIsNewPost && !AppPrefs.isGutenbergInformativeDialogDisabled()) { final PromoDialog gbInformativeDialog = new PromoDialog(); gbInformativeDialog.initialize(TAG_GB_INFORMATIVE_DIALOG, getString(R.string.dialog_gutenberg_informative_title), mPost.isPage() ? getString(R.string.dialog_gutenberg_informative_description_page) : getString(R.string.dialog_gutenberg_informative_description_post), getString(org.wordpress.android.editor.R.string.dialog_button_ok)); gbInformativeDialog.show(getSupportFragmentManager(), TAG_GB_INFORMATIVE_DIALOG); AppPrefs.setGutenbergInformativeDialogDisabled(true); } }
Source:
private boolean isCompatible(List<String> serverProtocols, List<String> clientProtocols) { return serverProtocols.contains(clientProtocols.get(0)) || (clientProtocols.get(0).equals("TLSv1.3") && clientProtocols.contains("TLSv1.2")); }

Target:
private boolean isCompatible(List<String> serverProtocols, List<String> clientProtocols) { assertNotNull(serverProtocols); assertFalse(serverProtocols.isEmpty()); assertNotNull(clientProtocols); assertFalse(clientProtocols.isEmpty()); return serverProtocols.contains(clientProtocols.get(0)) || (clientProtocols.get(0).equals("TLSv1.3") && !Collections.disjoint(serverProtocols, clientProtocols)); }
Source:
AbsoluteGraphQLError(ExecutionStrategyParameters executionStrategyParameters, GraphQLError relativeError) { requireNonNull(executionStrategyParameters); this.relativeError = requireNonNull(relativeError); this.absolutePath = Optional.ofNullable(relativeError.getPath()) .map(originalPath -> { List<Object> path = new ArrayList<>(); path.addAll(executionStrategyParameters.path().toList()); path.addAll(relativeError.getPath()); return path; }) .orElse(null); Optional<SourceLocation> baseLocation; if (!executionStrategyParameters.field().isEmpty()) { baseLocation = Optional.of(executionStrategyParameters.field().get(0).getSourceLocation()); } else { baseLocation = Optional.empty(); } this.locations = Optional.ofNullable( relativeError.getLocations()) .map(locations -> locations.stream() .map(l -> baseLocation .map(base -> new SourceLocation(base.getLine() + l.getLine(), base.getColumn() + l.getColumn())) .orElse(null)) .collect(Collectors.toList())) .orElse(null); }

Target:
AbsoluteGraphQLError(ExecutionStrategyParameters executionStrategyParameters, GraphQLError relativeError) { assertNotNull(executionStrategyParameters); assertNotNull(relativeError); this.absolutePath = createAbsolutePath(executionStrategyParameters, relativeError); this.locations = createAbsoluteLocations(relativeError, executionStrategyParameters.field()); this.message = relativeError.getMessage(); this.errorType = relativeError.getErrorType(); }
Source:
private byte[] encryptBytes(byte[] contentBytes, byte[] ivBytes, Key aesKey, byte[] aad) throws GeneralSecurityException { Cipher cipher = Cipher.getInstance("AES/GCM/NoPadding"); GCMParameterSpec gcmParams = new GCMParameterSpec(AUTH_TAG_SIZE_BYTE * 8, ivBytes); cipher.init(Cipher.ENCRYPT_MODE, aesKey, gcmParams); cipher.updateAAD(aad); byte[] cipherText = new byte[cipher.getOutputSize(contentBytes.length)]; cipher.doFinal(contentBytes, 0, contentBytes.length, cipherText); return cipherText; }

Target:
private byte[] encryptBytes(byte[] contentBytes, byte[] ivBytes, Key aesKey, byte[] aad) throws GeneralSecurityException { Cipher cipher = Cipher.getInstance("AES/GCM/NoPadding", "BC"); GCMParameterSpec gcmParams = new GCMParameterSpec(AUTH_TAG_SIZE_BYTE * 8, ivBytes); cipher.init(Cipher.ENCRYPT_MODE, aesKey, gcmParams); cipher.updateAAD(aad); byte[] cipherText = new byte[cipher.getOutputSize(contentBytes.length)]; cipher.doFinal(contentBytes, 0, contentBytes.length, cipherText); return cipherText; }
Source:
public Optional<List<String>> getAllTables(String databaseName) { try { List<String> tblNames = new ArrayList<>(); String nextToken = null; do { GetTablesResult result = glueClient.getTables(new GetTablesRequest() .withDatabaseName(databaseName) .withNextToken(nextToken)); result.getTableList().stream().forEach(tbl -> tblNames.add(tbl.getName())); nextToken = result.getNextToken(); } while (nextToken != null); return Optional.of(tblNames); } catch (EntityNotFoundException e) { return Optional.empty(); } catch (AmazonServiceException e) { throw new PrestoException(HIVE_METASTORE_ERROR, e); } }

Target:
public Optional<List<String>> getAllTables(String databaseName) { try { List<String> tableNames = new ArrayList<>(); String nextToken = null; do { GetTablesResult result = glueClient.getTables(new GetTablesRequest() .withDatabaseName(databaseName) .withNextToken(nextToken)); result.getTableList().stream().forEach(table -> tableNames.add(table.getName())); nextToken = result.getNextToken(); } while (nextToken != null); return Optional.of(tableNames); } catch (EntityNotFoundException e) { return Optional.empty(); } catch (AmazonServiceException e) { throw new PrestoException(HIVE_METASTORE_ERROR, e); } }
Source:
public void getTextTest() throws Exception { iface.go(testPage); WebDriverElement spanByID = iface.getWebDriverElement(Strategy.ID, "writing"); Assert.assertEquals("Click button to hide me", spanByID.getText()); WebDriverElement paragraphByCLASS = iface.getWebDriverElement(Strategy.CLASS, "normal"); Assert.assertEquals("Click to make me blink", paragraphByCLASS.getText()); WebDriverElement inputByNAME = iface.getWebDriverElement(Strategy.NAME, "namedInput"); Assert.assertEquals("This is a named input", inputByNAME.getText()); WebDriverElement spanByXPATH = iface.getWebDriverElement(Strategy.XPATH, " Assert.assertEquals("Click button to hide me", spanByXPATH.getText()); }

Target:
public void getTextTest() throws Exception { iface.go(testPage); WebDriverElement span = $("#writingSpan"); Assert.assertEquals("Click button to hide me", span.getText()); WebDriverElement paragraph = $("#intervalPara"); Assert.assertEquals("Click to make me blink", paragraph.getText()); WebDriverElement input = iface.getWebDriverElement(Strategy.NAME, "namedInput"); Assert.assertEquals("This is named input 0", input.getText()); }
Source:
public GitBasedRepository(String repositoryLocation) throws IOException, NoWorkTreeException, GitAPIException { super(repositoryLocation); FileRepositoryBuilder builder = new FileRepositoryBuilder(); this.gitRepo = builder.setWorkTree(this.repositoryRoot.toFile()).setMustExist(true).build(); if (!new File(this.determineRepositoryPath(repositoryLocation) + File.separator + ".git").exists()) { this.gitRepo.create(); } this.git = new Git(this.gitRepo); if (!this.git.status().call().isClean()) { this.addCommit(null); } }

Target:
public GitBasedRepository(String repositoryLocation) throws IOException, NoWorkTreeException, GitAPIException { super(repositoryLocation); FileRepositoryBuilder builder = new FileRepositoryBuilder(); Repository gitRepo = builder.setWorkTree(this.repositoryRoot.toFile()).setMustExist(false).build(); if (!new File(this.determineRepositoryPath(repositoryLocation) + File.separator + ".git").exists()) { gitRepo.create(); } this.git = new Git(gitRepo); if (!this.git.status().call().isClean()) { this.addCommit("Files changed externally."); } }
Source:
private boolean checkPgFilePermissions(String referencePermissionInput) throws IOException { if(checkIfOsIsPosixCompliant()){ return checkPgFilePermissionsForPosix(referencePermissionInput); } else { System.out.println("Error reading permissions for '" + _pwdfile + "'. OS is not POSIX compliant"); return false; } }

Target:
private boolean checkPgFilePermissions(String referencePermissionInput) throws IOException { if(checkIfOsIsPosixCompliant()){ return checkPgFilePermissionsForPosix(referencePermissionInput); } else { LOGGER.warn("Error reading permissions for '{}'. OS is not POSIX compliant", _pwdfile); return false; } }
Source:
private Properties getJavaProfileProperties(Bundle bundle, String path) { Properties profile = new Properties(); URL profileURL = bundle.getEntry(path); if (profileURL != null) { try (InputStream is = profileURL.openStream()) { profileURL = FileLocator.resolve(profileURL); if (is != null) { profile.load(is); fixJavaSE9ComplianceSourceTargetLevels(profile); } } catch (IOException e) { return null; } } else { if (getCompliance() == null) { return null; } profile.setProperty(JavaCore.COMPILER_COMPLIANCE, getCompliance()); profile.setProperty(JavaCore.COMPILER_SOURCE, getCompliance()); profile.setProperty(JavaCore.COMPILER_CODEGEN_TARGET_PLATFORM, getCompliance()); profile.setProperty("org.eclipse.jdt.core.compiler.problem.assertIdentifier", "error"); profile.setProperty("org.eclipse.jdt.core.compiler.problem.enumIdentifier", "error"); profile.setProperty(Constants.FRAMEWORK_EXECUTIONENVIRONMENT, calculateVMExecutionEnvs(new Version(getCompliance()))); profile.setProperty(JavaCore.COMPILER_RELEASE, JavaCore.ENABLED); profile.setProperty(JavaCore.COMPILER_PB_ENABLE_PREVIEW_FEATURES, JavaCore.DISABLED); } return profile; }

Target:
private Properties getJavaProfileProperties(Bundle bundle, String path) { Properties profile = new Properties(); URL profileURL = bundle.getEntry(path); if (profileURL != null) { try (InputStream is = profileURL.openStream()) { profileURL = FileLocator.resolve(profileURL); if (is != null) { profile.load(is); fixJavaSE9ComplianceSourceTargetLevels(profile); } } catch (IOException e) { return null; } } else { String compliance = getCompliance(); if (compliance == null) { return null; } profile.setProperty(JavaCore.COMPILER_COMPLIANCE, compliance); profile.setProperty(JavaCore.COMPILER_SOURCE, compliance); profile.setProperty(JavaCore.COMPILER_CODEGEN_TARGET_PLATFORM, compliance); profile.setProperty(JavaCore.COMPILER_PB_ASSERT_IDENTIFIER, JavaCore.ERROR); profile.setProperty(JavaCore.COMPILER_PB_ENUM_IDENTIFIER, JavaCore.ERROR); profile.setProperty(Constants.FRAMEWORK_EXECUTIONENVIRONMENT, calculateVMExecutionEnvs(new Version(compliance))); profile.setProperty(JavaCore.COMPILER_RELEASE, JavaCore.ENABLED); if (JavaCore.compareJavaVersions(compliance, JavaCore.VERSION_10) > 0) { profile.setProperty(JavaCore.COMPILER_PB_ENABLE_PREVIEW_FEATURES, JavaCore.DISABLED); profile.setProperty(JavaCore.COMPILER_PB_REPORT_PREVIEW_FEATURES, JavaCore.ERROR); } } return profile; }
Source:
public List<Metacard> get() { if (!configDirectory.exists()) { LOGGER.debug("Could not locate forms directory"); return Collections.emptyList(); } if (!configDirectory.canRead()) { LOGGER.debug("Forms directory exists but could not be read"); return Collections.emptyList(); } File formsFile = configDirectory.toPath().resolve(FORMS_FILE_NAME).toFile(); File resultsFile = configDirectory.toPath().resolve(RESULTS_FILE_NAME).toFile(); return Stream.concat( loadFile(formsFile, this::formMapper), loadFile(resultsFile, this::resultsMapper)) .collect(Collectors.toList()); }

Target:
public List<Metacard> get() { if (!configDirectory.exists()) { LOGGER.warn("Could not locate forms directory [{}]", configDirectory.getAbsolutePath()); return Collections.emptyList(); } File formsFile = configDirectory.toPath().resolve(FORMS_FILE_NAME).toFile(); File resultsFile = configDirectory.toPath().resolve(RESULTS_FILE_NAME).toFile(); return Stream.concat( loadFile(formsFile, this::formMapper), loadFile(resultsFile, this::resultsMapper)) .collect(Collectors.toList()); }
Source:
public CompleteOnRedirectAction() { setLabel("SET-STATE"); }

Target:
public CompleteOnRedirectAction() { setLabel("COMPLETE"); }
Source:
public void provision(DockerEnvironment internalEnv, RuntimeIdentity identity) throws InfrastructureException { for (Map.Entry<String, InternalMachineConfig> machineEntry : internalEnv.getMachines().entrySet()) { final String machineName = machineEntry.getKey(); Map<String, String> containerLabels = new HashMap<>(); for (Map.Entry<String, ServerConfig> serverEntry : machineEntry.getValue().getServers().entrySet()) { final String serverName = serverEntry.getKey().replace('/', '-'); final String host = "Host:" + hostnameBuilder.build(serverName, machineName, identity.getWorkspaceId()); final String serviceName = machineName + "-" + serverName; final String port = serverEntry.getValue().getPort().split("/")[0]; containerLabels.put(format("traefik.%s.port", serviceName), port); containerLabels.put(format("traefik.%s.frontend.entryPoints", serviceName), "http"); containerLabels.put(format("traefik.%s.frontend.rule", serviceName), host); containerLabels.put("traefik.frontend.rule", machineName); } DockerContainerConfig dockerConfig = internalEnv.getContainers().get(machineName); dockerConfig.getLabels().putAll(containerLabels); } }

Target:
public void provision(DockerEnvironment internalEnv, RuntimeIdentity identity) throws InfrastructureException { for (Map.Entry<String, InternalMachineConfig> machineEntry : internalEnv.getMachines().entrySet()) { final String machineName = machineEntry.getKey(); Map<String, String> containerLabels = new HashMap<>(); for (Map.Entry<String, ServerConfig> serverEntry : machineEntry.getValue().getServers().entrySet()) { if (parseBoolean(serverEntry.getValue().getAttributes().get(INTERNAL_SERVER_ATTRIBUTE))) { continue; } final String host = hostnameBuilder.build(serverEntry.getKey(), machineName, identity.getWorkspaceId()); final String serviceName = getServiceName(host); final String port = serverEntry.getValue().getPort().split("/")[0]; containerLabels.put(format("traefik.%s.port", serviceName), port); containerLabels.put(format("traefik.%s.frontend.entryPoints", serviceName), "http"); containerLabels.put(format("traefik.%s.frontend.rule", serviceName), "Host:" + host); containerLabels.put("traefik.frontend.rule", machineName); } DockerContainerConfig dockerConfig = internalEnv.getContainers().get(machineName); dockerConfig.getLabels().putAll(containerLabels); } }
Source:
public String toString() { return "Request with " + this.getId() + " id to invoke " + this.getMethod() + " method with " + this.getParams().toString(); }

Target:
public String toString() { return "Request with " + this.getId() + " ID to invoke " + this.getMethod() + " method with " + this.getParams().toString(); }
Source:
protected void setTitle(CharSequence title) { mCollapsingToolbarLayoutWeakReference.get().setTitle(title); }

Target:
protected void setTitle(CharSequence title) { CollapsingToolbarLayout collapsingToolbarLayout = mCollapsingToolbarLayoutWeakReference.get(); if (collapsingToolbarLayout != null) { collapsingToolbarLayout.setTitle(title); } }