auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>public void push() throws Exception { HTTP2Client http2Client = new HTTP2Client(); http2Client.start(); SocketAddress serverAddress = new InetSocketAddress("localhost", 8080); CompletableFuture<Session> sessionCF = http2Client.connect(serverAddress, new Session.Listener.Adapter()); Session session = sessionCF.get(); HttpFields requestHeaders = HttpFields.build() <START> .add(HttpHeader.USER_AGENT, "Jetty HTTP2Client {version}"); <END> MetaData.Request request = new MetaData.Request("GET", HttpURI.from("http://localhost:8080/path"), HttpVersion.HTTP_2, requestHeaders); HeadersFrame headersFrame = new HeadersFrame(request, null, true); CompletableFuture<Stream> streamCF = session.newStream(headersFrame, new Stream.Listener.Adapter() { @Override public Stream.Listener onPush(Stream pushedStream, PushPromiseFrame frame) { MetaData.Request pushedRequest = frame.getMetaData(); HttpURI pushedURI = pushedRequest.getURI(); HttpFields pushedRequestHeaders = pushedRequest.getFields(); Stream primaryStream = pushedStream.getSession().getStream(frame.getStreamId()); return new Stream.Listener.Adapter() { @Override public void onHeaders(Stream stream, HeadersFrame frame) { MetaData metaData = frame.getMetaData(); if (metaData.isResponse()) { HttpFields pushedResponseHeaders = metaData.getFields(); } } @Override public void onData(Stream stream, DataFrame frame, Callback callback) { ByteBuffer buffer = frame.getData(); callback.succeeded(); } }; } }); }</code><technical_language>Please put() a multiple occurrences header</technical_language>

Target:
public void push() throws Exception { HTTP2Client http2Client = new HTTP2Client(); http2Client.start(); SocketAddress serverAddress = new InetSocketAddress("localhost", 8080); CompletableFuture<Session> sessionCF = http2Client.connect(serverAddress, new Session.Listener.Adapter()); Session session = sessionCF.get(); HttpFields requestHeaders = HttpFields.build() .put(HttpHeader.USER_AGENT, "Jetty HTTP2Client {version}"); MetaData.Request request = new MetaData.Request("GET", HttpURI.from("http://localhost:8080/path"), HttpVersion.HTTP_2, requestHeaders); HeadersFrame headersFrame = new HeadersFrame(request, null, true); CompletableFuture<Stream> streamCF = session.newStream(headersFrame, new Stream.Listener.Adapter() { @Override public Stream.Listener onPush(Stream pushedStream, PushPromiseFrame frame) { MetaData.Request pushedRequest = frame.getMetaData(); HttpURI pushedURI = pushedRequest.getURI(); HttpFields pushedRequestHeaders = pushedRequest.getFields(); Stream primaryStream = pushedStream.getSession().getStream(frame.getStreamId()); return new Stream.Listener.Adapter() { @Override public void onHeaders(Stream stream, HeadersFrame frame) { MetaData metaData = frame.getMetaData(); if (metaData.isResponse()) { HttpFields pushedResponseHeaders = metaData.getFields(); } } @Override public void onData(Stream stream, DataFrame frame, Callback callback) { ByteBuffer buffer = frame.getData(); callback.succeeded(); } }; } }); }
Source:
<code>public void generatedInterfaceHasInterfaceMethods() { Set<String> generatedMethods = TestingUtils.extractMethods(AutoDelegate_GenericsTester.class); Set<String> originalMethods = extractNonStaticMethods(GenericsTester.class); <START> assertThat(generatedMethods, hasItems(originalMethods.toArray(new String[0]))); <END> }</code><technical_language>please assertJ for this: java assertThat(generatedMethods.contains(originalMethods);</technical_language>

Target:
public void generatedInterfaceHasInterfaceMethods() { Set<String> generatedMethods = TestingUtils.extractMethods(AutoDelegate_GenericsTester.class); Set<String> originalMethods = TestingUtils.extractNonStaticMethods(GenericsTester.class); assertThat(generatedMethods).containsAll(originalMethods); }
Source:
<code>private SingularityDeploy checkImmediateRunDeploy(SingularityRequest request, SingularityDeploy deploy, SingularityRunNowRequest runNowRequest, List<SingularityTaskId> activeTasks, List<SingularityPendingTaskId> pendingTasks) { if (!request.isScheduled() && !request.isOneOff()) { throw badRequest("Can not request an immediate run of a non-scheduled / always running request (%s)", request); } <START> boolean canRunImmediately = <END> (request.isScheduled() && activeTasks.isEmpty()) || (request.isOneOff() && ! request.getInstances().isPresent()) || (request.isOneOff() && request.getInstances().get() > activeTasks.size() + pendingTasks.size()); if (canRunImmediately) { return deploy.toBuilder() .setRunImmediately(Optional.of(fillRunNowRequest(Optional.of(runNowRequest)))) .build(); } else { return deploy.toBuilder() .setRunImmediately(Optional.absent()) .build(); } }</code><technical_language>do want validate this time deploy is enqueued? re-check similar conditions time pending request is created deploy finishes, data changed then. Checking a extra zk calls (activeTaskIds/pendingTaskIds) possibly hit non-leader instance</technical_language>

Target:
private SingularityDeploy checkImmediateRunDeploy(SingularityRequest request, SingularityDeploy deploy, SingularityRunNowRequest runNowRequest, List<SingularityTaskId> activeTasks, List<SingularityPendingTaskId> pendingTasks) { if (!request.isScheduled() && !request.isOneOff()) { throw badRequest("Can not request an immediate run of a non-scheduled / always running request (%s)", request); } return deploy.toBuilder() .setRunImmediately(Optional.of(fillRunNowRequest(Optional.of(runNowRequest)))) .build(); }
Source:
<code>private Node alloc(byte[] labelBytes) { byte[] input = new byte[seedBytes.length+labelBytes.length]; System.arraycopy(seedBytes, 0, input, 0, seedBytes.length); System.arraycopy(labelBytes, 0, input, seedBytes.length, labelBytes.length); String hexString; if ( true ) { <START> long[] x = MurmurHash3.hash128(input); <END> char[] chars = new char[32]; longAsHexLC(x[0], chars, 0); longAsHexLC(x[1], chars, 16); hexString = new String(chars); } else { byte[] bytes = Hashing.murmur3_128(104729).hashBytes(input).asBytes(); hexString = Bytes.asHexLC(bytes); } return NodeFactory.createBlankNode(hexString); }</code><technical_language>original commons-codec MurmurHash3.hash128 (like Guava code) a sign extension issue seed value. seed is 104729 (for some reason) hashes work correctly. a fair amount of work commons-codec v 1.14 fixes issue. of change of MurmurHash3.hash128(x) methods deprecated. is cleaner call MurmurHash3.hash128x86( input, 0, input.length, MurmurHash3.DEFAULT_SEED) MurmurHash3.hash128x86( input, 0, input.length, 104729L)</technical_language>

Target:
private Node alloc(byte[] labelBytes) { byte[] input = new byte[seedBytes.length+labelBytes.length]; System.arraycopy(seedBytes, 0, input, 0, seedBytes.length); System.arraycopy(labelBytes, 0, input, seedBytes.length, labelBytes.length); String hexString; if ( true ) { long[] x = MurmurHash3.hash128x64(input); char[] chars = new char[32]; longAsHexLC(x[0], chars, 0); longAsHexLC(x[1], chars, 16); hexString = new String(chars); } else { byte[] bytes = Hashing.murmur3_128(MurmurHash3.DEFAULT_SEED).hashBytes(input).asBytes(); hexString = Bytes.asHexLC(bytes); } return NodeFactory.createBlankNode(hexString); }
Source:
<code>public String getMessage(MessageSourceResolvable resolvable, Locale locale) { <START> if((resolvable.getCodes()[0]) == (activeMessageSource.getMessage(resolvable, locale))){ <END> return (resolvable.getCodes()[(resolvable.getCodes().length) - 1]); } else{ return activeMessageSource.getMessage(resolvable, locale); } }</code><technical_language>I thought comparing strings, right? i expect of equals</technical_language>

Target:
public String getMessage(MessageSourceResolvable resolvable, Locale locale) { if((resolvable.getCodes()[0]).equals((activeMessageSource.getMessage(resolvable, locale)))){ return (resolvable.getCodes()[(resolvable.getCodes().length) - 1]); } else{ return activeMessageSource.getMessage(resolvable, locale); } }
Source:
<code>public void detectCancelEvent_noMoreReverts_detected() { FilterTextField field = getFirstPanelField(); AtomicInteger toggle = new AtomicInteger(0); field.setOnCancel(toggle::getAndIncrement); assertTrue(toggle.get() % 2 == 0); type("mile").push(KeyCode.TAB); push(KeyCode.ENTER); clearField(); type("test"); waitAndAssertEquals("test", field::getText); push(KeyCode.ESCAPE); waitAndAssertEquals(0, () -> toggle.get() % 2); push(KeyCode.ESCAPE); waitAndAssertEquals(1, () -> toggle.get() % 2); <START> clearField(); <END> }</code><technical_language>Is this needed</technical_language>

Target:
public void detectCancelEvent_noMoreReverts_detected() { FilterTextField field = getFirstPanelField(); AtomicInteger toggle = new AtomicInteger(0); field.setOnCancel(toggle::getAndIncrement); assertTrue(toggle.get() % 2 == 0); type("mile").push(KeyCode.TAB); push(KeyCode.ENTER); clearField(); type("test"); waitAndAssertEquals("test", field::getText); push(KeyCode.ESCAPE); waitAndAssertEquals(0, () -> toggle.get() % 2); push(KeyCode.ESCAPE); waitAndAssertEquals(1, () -> toggle.get() % 2); }
Source:
<code>public String getProvides() { <START> return (String) context.get(ExtensionProperties.PROVIDES); <END> }</code><technical_language>split("[,]") trim() support multiple interfaces single extension, please. return List<String></technical_language>

Target:
public List<String> getProvides() { List<String> providers = new ArrayList<>(); for (String provider : ((String) context.get(ExtensionProperties.PROVIDES)).split(",")) { providers.add(provider.trim()); } return providers; }
Source:
<code>public QueryBuilder make(EsHint hint, String fieldName, Object value) { String[] indexFields = hint.getIndexFieldNames(); String[] fields = indexFields.length > 0 ? indexFields : new String[] { fieldName }; MoreLikeThisQueryBuilder moreLikeThisBuilder = QueryBuilders.moreLikeThisQuery(fields, null, getItems(value)); if (hint.analyzer != null) { <START> moreLikeThisBuilder.analyzer(hint.analyzer); <END> } moreLikeThisBuilder.minDocFreq(MORE_LIKE_THIS_MIN_DOC_FREQ); moreLikeThisBuilder.minTermFreq(MORE_LIKE_THIS_MIN_TERM_FREQ); moreLikeThisBuilder.maxQueryTerms(MORE_LIKE_THIS_MAX_QUERY_TERMS); return moreLikeThisBuilder; }</code><technical_language>need for null check</technical_language>

Target:
public QueryBuilder make(EsHint hint, String fieldName, Object value) { String[] indexFields = hint.getIndexFieldNames(); String[] fields = indexFields.length > 0 ? indexFields : new String[] { fieldName }; return QueryBuilders.moreLikeThisQuery(fields, null, getItems(value)) .analyzer(hint.analyzer) .minDocFreq(MORE_LIKE_THIS_MIN_DOC_FREQ) .minTermFreq(MORE_LIKE_THIS_MIN_TERM_FREQ) .maxQueryTerms(MORE_LIKE_THIS_MAX_QUERY_TERMS); }
Source:
<code>private File createTempReactorProject(Server server) throws MojoFailureException, MojoExecutionException { File tempFolder = new File(server.getServerDirectory(), "temp-project"); if (!tempFolder.exists()) { tempFolder.mkdir(); } Model tempModel = createModel(); Set<Project> watchedModules = server.getWatchedProjects(); for(Project module: watchedModules){ Path newLink = Paths.get(new File(tempFolder, module.getArtifactId()).getAbsolutePath()); Path existingfile = Paths.get(module.getPath()); try { <START> Files.createSymbolicLink(newLink, existingfile); <END> tempModel.addModule(module.getArtifactId()); } catch (IOException e) { throw new RuntimeException("Couldn't create link", e); } catch (UnsupportedOperationException e) { throw new RuntimeException("Couldn't create link due to unsupported file system", e); } } try { Writer writer = new FileWriter(new File(tempFolder, "pom.xml")); new MavenXpp3Writer().write(writer, tempModel); } catch (IOException e) { throw new RuntimeException("Failed to write pom.xml", e); } return tempFolder; }</code><technical_language>createSymbolicLink requires administrator privileges Windows. catch IOException simply copy directory if creating symbolic link fails..</technical_language>

Target:
private File createTempReactorProject(Server server) throws MojoFailureException, MojoExecutionException { File tempFolder = new File(server.getServerDirectory(), "temp-project"); if (!tempFolder.exists()) { tempFolder.mkdir(); } Model tempModel = createModel(); Set<Project> watchedModules = server.getWatchedProjects(); for(Project module: watchedModules){ Path newLink = Paths.get(new File(tempFolder, module.getArtifactId()).getAbsolutePath()); Path existingfile = Paths.get(module.getPath()); try { Files.createSymbolicLink(newLink, existingfile); } catch (IOException e) { copyModuleToTempServer(module.getPath(), newLink.toString()); } finally { tempModel.addModule(module.getArtifactId()); } } try { Writer writer = new FileWriter(new File(tempFolder, "pom.xml")); new MavenXpp3Writer().write(writer, tempModel); } catch (IOException e) { throw new RuntimeException("Failed to write pom.xml", e); } return tempFolder; }
Source:
<code>public Properties getCacheProperties() { Properties props = new Properties(); props.setProperty("cachMode", this.cacheMode.name()); synchronized(connectionMonitor) { props.setProperty("channelCacheSize", Integer.toString(this.channelCacheSize)); if (this.cacheMode.equals(CacheMode.CONNECTION)) { props.setProperty("connectionCacheSize", Integer.toString(this.connectionCacheSize)); props.setProperty("openConnections", Integer.toString(this.openConnections.size())); props.setProperty("idleConnections", Integer.toString(this.idleConnections.size())); int n = 0; for (Entry<ChannelCachingConnectionProxy, LinkedList<ChannelProxy>> entry : this.openConnectionTransactionalChannels.entrySet()) { int port = entry.getKey().getLocalPort(); if (port == 0) { port = ++n; } <START> props.put("idleChannelsTx:" + port, Integer.valueOf(entry.getValue().size())); <END> } for (Entry<ChannelCachingConnectionProxy, LinkedList<ChannelProxy>> entry : this.openConnectionNonTransactionalChannels.entrySet()) { int port = entry.getKey().getLocalPort(); if (port == 0) { port = ++n; } props.put("idleChannelsNotTx:" + port, Integer.valueOf(entry.getValue().size())); } } else { props.setProperty("localPort", Integer.toString(this.connection == null ? 0 : this.connection.getLocalPort())); props.setProperty("idleChannelsTx", Integer.toString(cachedChannelsTransactional.size())); props.setProperty("idleChannelsNotTx", Integer.toString(cachedChannelsNonTransactional.size())); } } return props; }</code><technical_language>![unnecessary_boxing](<LINK_0></technical_language>

Target:
public Properties getCacheProperties() { Properties props = new Properties(); props.setProperty("cacheMode", this.cacheMode.name()); synchronized(connectionMonitor) { props.setProperty("channelCacheSize", Integer.toString(this.channelCacheSize)); if (this.cacheMode.equals(CacheMode.CONNECTION)) { props.setProperty("connectionCacheSize", Integer.toString(this.connectionCacheSize)); props.setProperty("openConnections", Integer.toString(this.openConnections.size())); props.setProperty("idleConnections", Integer.toString(this.idleConnections.size())); int n = 0; for (Entry<ChannelCachingConnectionProxy, LinkedList<ChannelProxy>> entry : this.openConnectionTransactionalChannels.entrySet()) { int port = entry.getKey().getLocalPort(); if (port == 0) { port = ++n; } props.put("idleChannelsTx:" + port, entry.getValue().size()); } for (Entry<ChannelCachingConnectionProxy, LinkedList<ChannelProxy>> entry : this.openConnectionNonTransactionalChannels.entrySet()) { int port = entry.getKey().getLocalPort(); if (port == 0) { port = ++n; } props.put("idleChannelsNotTx:" + port, entry.getValue().size()); } } else { props.setProperty("localPort", Integer.toString(this.connection == null ? 0 : this.connection.getLocalPort())); props.setProperty("idleChannelsTx", Integer.toString(this.cachedChannelsTransactional.size())); props.setProperty("idleChannelsNotTx", Integer.toString(this.cachedChannelsNonTransactional.size())); } } return props; }
Source:
<code>private void logPromotionCommitFailure(PartitionReplica destination, Collection<MigrationInfo> migrations, Throwable t) { boolean memberLeft = t instanceof MemberLeftException || t.getCause() instanceof TargetNotMemberException || t.getCause() instanceof HazelcastInstanceNotActiveException; int migrationsSize = migrations.size(); if (memberLeft) { <START> if (node.getThisAddress().equals(destination.address())) { <END> logger.fine("Promotion commit failed for " + migrationsSize + " migrations" + " since this node is shutting down."); return; } if (logger.isFinestEnabled()) { logger.warning("Promotion commit failed for " + migrations + " since destination " + destination + " left the cluster"); } else { logger.warning("Promotion commit failed for " + (migrationsSize == 1 ? migrations.iterator().next() : migrationsSize + " migrations") + " since destination " + destination + " left the cluster"); } return; } if (logger.isFinestEnabled()) { logger.severe("Promotion commit to " + destination + " failed for " + migrations, t); } else { logger.severe("Promotion commit to " + destination + " failed for " + (migrationsSize == 1 ? migrations.iterator().next() : migrationsSize + " migrations"), t); } }</code><technical_language>above, check node.getLocalMember()</technical_language>

Target:
private void logPromotionCommitFailure(PartitionReplica destination, Collection<MigrationInfo> migrations, Throwable t) { boolean memberLeft = t instanceof MemberLeftException || t.getCause() instanceof TargetNotMemberException || t.getCause() instanceof HazelcastInstanceNotActiveException; int migrationsSize = migrations.size(); if (memberLeft) { if (destination.isIdentical(node.getLocalMember())) { logger.fine("Promotion commit failed for " + migrationsSize + " migrations" + " since this node is shutting down."); return; } if (logger.isFinestEnabled()) { logger.warning("Promotion commit failed for " + migrations + " since destination " + destination + " left the cluster"); } else { logger.warning("Promotion commit failed for " + (migrationsSize == 1 ? migrations.iterator().next() : migrationsSize + " migrations") + " since destination " + destination + " left the cluster"); } return; } if (logger.isFinestEnabled()) { logger.severe("Promotion commit to " + destination + " failed for " + migrations, t); } else { logger.severe("Promotion commit to " + destination + " failed for " + (migrationsSize == 1 ? migrations.iterator().next() : migrationsSize + " migrations"), t); } }
Source:
<code>public PhysicalOperation visitStatisticsWriterNode(StatisticsWriterNode node, LocalExecutionPlanContext context) { PhysicalOperation source = node.getSource().accept(this, context); StatisticAggregationsDescriptor<Integer> descriptor = node.getDescriptor().map(symbol -> source.getLayout().get(symbol)); OperatorFactory operatorFactory = new StatisticsWriterOperatorFactory( context.getNextOperatorId(), node.getId(), computedStatistics -> metadata.finishAnalysis(session, ((StatisticsWriterNode.WriteStatisticsHandle) node.getTarget()).getHandle(), computedStatistics), node.isRowCountEnabled(), descriptor); <START> Map<Symbol, Integer> layout = ImmutableMap.of(getOnlyElement(node.getOutputSymbols()), 0); <END> return new PhysicalOperation(operatorFactory, layout, context, source); }</code><technical_language>makeLayout</technical_language>

Target:
public PhysicalOperation visitStatisticsWriterNode(StatisticsWriterNode node, LocalExecutionPlanContext context) { PhysicalOperation source = node.getSource().accept(this, context); StatisticAggregationsDescriptor<Integer> descriptor = node.getDescriptor().map(symbol -> source.getLayout().get(symbol)); OperatorFactory operatorFactory = new StatisticsWriterOperatorFactory( context.getNextOperatorId(), node.getId(), computedStatistics -> metadata.finishStatisticsCollection(session, ((StatisticsWriterNode.WriteStatisticsHandle) node.getTarget()).getHandle(), computedStatistics), node.isRowCountEnabled(), descriptor); return new PhysicalOperation(operatorFactory, makeLayout(node), context, source); }
Source:
<code><START> public void testNameValidation() throws IOException { <END> String diskStoreName = "diskStoreName"; CommandStringBuilder csb = new CommandStringBuilder(CliStrings.ALTER_DISK_STORE); csb.addOption(CliStrings.ALTER_DISK_STORE__DISKSTORENAME, diskStoreName); csb.addOption(CliStrings.ALTER_DISK_STORE__REGIONNAME, "regionName"); csb.addOption(CliStrings.ALTER_DISK_STORE__DISKDIRS, tempDir.getRoot().toString()); csb.addOption(CliStrings.ALTER_DISK_STORE__CONCURRENCY__LEVEL, "5"); String commandString = csb.toString(); gfsh.executeAndAssertThat(command, commandString).statusIsError() .containsOutput( "The init file " + tempDir.getRoot().toString() + File.separator + "BACKUP" + diskStoreName + DiskInitFile.IF_FILE_EXT + " does not exist."); }</code><technical_language>remove throws IOException thrown method body?</technical_language>

Target:
public void testNameValidation() { String diskStoreName = "diskStoreName"; CommandStringBuilder csb = new CommandStringBuilder(CliStrings.ALTER_DISK_STORE); csb.addOption(CliStrings.ALTER_DISK_STORE__DISKSTORENAME, diskStoreName); csb.addOption(CliStrings.ALTER_DISK_STORE__REGIONNAME, "regionName"); csb.addOption(CliStrings.ALTER_DISK_STORE__DISKDIRS, tempDir.getRoot().toString()); csb.addOption(CliStrings.ALTER_DISK_STORE__CONCURRENCY__LEVEL, "5"); String commandString = csb.toString(); gfsh.executeAndAssertThat(command, commandString).statusIsError() .containsOutput( "The init file " + tempDir.getRoot().toString() + File.separator + "BACKUP" + diskStoreName + DiskInitFile.IF_FILE_EXT + " does not exist."); }
Source:
<code>public void finish() { if (fXAggregator != null) { <START> fSeries.stream().map(s -> s.getXConsumer()).forEach(checkNotNull(fXAggregator)::accept); <END> } if (fYAggregator != null) { fSeries.stream().map(s -> s.getYConsumer()).forEach(checkNotNull(fYAggregator)::accept); } }</code><technical_language>avoid null checks time, extract a local variable variable instead. is safer do fields, especially if final. Here, field final necessary, compiler happy</technical_language>

Target:
public void finish() { IConsumerAggregator aggregator = fXAggregator; if (aggregator != null) { fSeries.stream().map(s -> s.getXConsumer()).forEach(aggregator::accept); } aggregator = fYAggregator; if (aggregator != null) { fSeries.stream().map(s -> s.getYConsumer()).forEach(aggregator::accept); } }
Source:
<code>protected void autonomousMain() throws AutonomousModeOverException, InterruptedException { done.set(false); Elevator.lowering.set(true); Elevator.raising.set(false); waitUntil(Elevator.bottomLimitSwitch); Rollers.open.set(true); Rollers.direction.set(false); Rollers.running.set(true); waitUntil(BooleanMixing.invert(crateInPosition)); waitForTime(timeout); Rollers.running.set(false); <START> done.set(true); <END> }</code><technical_language>if error? done set true. report something</technical_language>

Target:
protected void autonomousMain() throws AutonomousModeOverException, InterruptedException { try { done.set(false); Elevator.lowering.set(true); Elevator.raising.set(false); waitUntil(Elevator.bottomLimitSwitch); Rollers.open.set(true); Rollers.direction.set(false); Rollers.running.set(true); waitUntil(BooleanMixing.invert(crateInPosition)); waitForTime(timeout); Rollers.running.set(false); } finally { done.set(true); } }
Source:
<code>private List<MongoCredential> buildCredentials(Iterable<String> userPasses) { ImmutableList.Builder<MongoCredential> builder = ImmutableList.builder(); <START> for (String userPassCollection : userPasses) { <END> int lastIndex = userPassCollection.lastIndexOf('@'); checkArgument(lastIndex > 0, "Invalid Credential format. Requires user:password@collection"); String userPass = userPassCollection.substring(0, lastIndex); String collection = userPassCollection.substring(lastIndex + 1); int firstIndex = userPass.indexOf(':'); checkArgument(firstIndex > 0, "Invalid Credential format. Requires user:password@collection"); String user = userPass.substring(0, firstIndex); String password = userPass.substring(firstIndex + 1); builder.add(createCredential(user, collection, password.toCharArray())); } return builder.build(); }</code><technical_language>s/userPassCollection/userPass - s/userPass/userAndPassword - s/lastIndex/atPos - s/firstIndex/colonPos for (String userPass : userPasses) { int atPos = userPass.lastIndexOf('@'); checkArgument(atPos > 0, "Invalid Credential format. Requires user:password@collection"); String userAndPassword = userPass.substring(0, atPos); String collection = userPass.substring(atPos + 1); int colonPos = userAndPassword.indexOf(':'); checkArgument(colonPos > 0, "Invalid Credential format. Requires user:password@collection"); String user = userAndPassword.substring(0, colonPos); String password = userAndPassword.substring(colonPos + 1); builder.add(createCredential(user, collection, password.toCharArray())); }</technical_language>

Target:
private List<MongoCredential> buildCredentials(Iterable<String> userPasses) { ImmutableList.Builder<MongoCredential> builder = ImmutableList.builder(); for (String userPass : userPasses) { int atPos = userPass.lastIndexOf('@'); checkArgument(atPos > 0, "Invalid credential format. Required user:password@collection"); String userAndPassword = userPass.substring(0, atPos); String collection = userPass.substring(atPos + 1); int colonPos = userAndPassword.indexOf(':'); checkArgument(colonPos > 0, "Invalid credential format. Required user:password@collection"); String user = userAndPassword.substring(0, colonPos); String password = userAndPassword.substring(colonPos + 1); builder.add(createCredential(user, collection, password.toCharArray())); } return builder.build(); }
Source:
<code>public static void runExample(String title) { try { XResultData rd = new XResultData(); rd.log("This is just a normal log message"); rd.logWarning("This is a warning"); rd.logError("This is an error"); rd.log("\n\nExample of hyperlinked hrid: " + getHyperlink(UserManager.getUser())); <START> <END> rd.log("Example of hyperlinked artifact different hyperlink string: " + getHyperlink("Different string", UserManager.getUser())); rd.log("Example of hyperlinked hrid on another branch: " + getHyperlink(UserManager.getUser().getGuid(), UserManager.getUser().getGuid(), BranchManager.getCommonBranch().getId())); rd.addRaw(AHTML.newline()); rd.addRaw("Example of hyperlink that opens external browser " + getHyperlinkUrlExternal("Google", "<LINK_0>") + AHTML.newline()); rd.addRaw("Example of hyperlink that opens internal browser " + getHyperlinkUrlInternal("Google", "<LINK_0>") + AHTML.newline()); rd.log("\n\nHere is a nice table"); rd.addRaw(AHTML.beginMultiColumnTable(95, 1)); rd.addRaw(AHTML.addHeaderRowMultiColumnTable(new String[] {"Type", "Title", "Status"})); for (int x = 0; x < 3; x++) { rd.addRaw(AHTML.addRowMultiColumnTable(new String[] {"Type " + x, "Title " + x, x + ""})); } rd.addRaw(AHTML.addRowMultiColumnTable(new String[] { "Error / Warning in table ", "Error: this is error", "Warning: this is warning"})); rd.addRaw(AHTML.endMultiColumnTable()); report(rd, "This is my report title"); } catch (OseeCoreException ex) { OseeLog.log(Activator.class, OseeLevel.SEVERE_POPUP, ex); } }</code><technical_language>log text guid instead of hrid</technical_language>

Target:
public static void runExample(String title) { try { XResultData rd = new XResultData(); rd.log("This is just a normal log message"); rd.logWarning("This is a warning"); rd.logError("This is an error"); rd.log("\n\nExample of hyperlinked guid: " + getHyperlink(UserManager.getUser())); rd.log("Example of hyperlinked artifact different hyperlink string: " + getHyperlink("Different string", UserManager.getUser())); rd.log("Example of hyperlinked guid on another branch: " + getHyperlink(UserManager.getUser().getGuid(), UserManager.getUser().getGuid(), BranchManager.getCommonBranch().getId())); rd.addRaw(AHTML.newline()); rd.addRaw("Example of hyperlink that opens external browser " + getHyperlinkUrlExternal("Google", "<LINK_0>") + AHTML.newline()); rd.addRaw("Example of hyperlink that opens internal browser " + getHyperlinkUrlInternal("Google", "<LINK_0>") + AHTML.newline()); rd.log("\n\nHere is a nice table"); rd.addRaw(AHTML.beginMultiColumnTable(95, 1)); rd.addRaw(AHTML.addHeaderRowMultiColumnTable(new String[] {"Type", "Title", "Status"})); for (int x = 0; x < 3; x++) { rd.addRaw(AHTML.addRowMultiColumnTable(new String[] {"Type " + x, "Title " + x, x + ""})); } rd.addRaw(AHTML.addRowMultiColumnTable(new String[] { "Error / Warning in table ", "Error: this is error", "Warning: this is warning"})); rd.addRaw(AHTML.endMultiColumnTable()); report(rd, "This is my report title"); } catch (OseeCoreException ex) { OseeLog.log(Activator.class, OseeLevel.SEVERE_POPUP, ex); } }
Source:
<code>public EntryTypeViewModel(JabRefPreferences preferences, BasePanel basePanel, DialogService dialogService) { this.basePanel = basePanel; this.prefs = preferences; this.dialogService = dialogService; fetchers.addAll(WebFetchers.getIdBasedFetchers(preferences.getImportFormatPreferences())); selectedItemProperty.setValue(getLastSelectedFetcher()); <START> Predicate<String> notEmpty = input -> (input != null) && !input.trim().isEmpty(); <END> idFieldValidator = new FunctionBasedValidator<>(idText, notEmpty, ValidationMessage.error(Localization.lang("Required field \"%0\" is empty.", Localization.lang("ID")))); }</code><technical_language>This replaced StringUtil:isNotBlank</technical_language>

Target:
public EntryTypeViewModel(JabRefPreferences preferences, BasePanel basePanel, DialogService dialogService) { this.basePanel = basePanel; this.prefs = preferences; this.dialogService = dialogService; fetchers.addAll(WebFetchers.getIdBasedFetchers(preferences.getImportFormatPreferences())); selectedItemProperty.setValue(getLastSelectedFetcher()); idFieldValidator = new FunctionBasedValidator<>(idText, StringUtil::isNotBlank, ValidationMessage.error(Localization.lang("Required field \"%0\" is empty.", Localization.lang("ID")))); }
Source:
<code>public void accept(Event<SetPasswordRequest> setPasswordRequestEvent) { SetPasswordRequest request = setPasswordRequestEvent.getData(); LOGGER.info("SetPasswordHandler accepting request {}", request); try { Stack stack = stackService.getStackById(request.getResourceId()); MDCBuilder.buildMdcContext(stack); FreeIpaClient freeIpaClient = freeIpaClientFactory.getFreeIpaClientForStack(stack); if (FreeIpaCapabilities.hasSetPasswordHashSupport(freeIpaClient.getConfig())) { WorkloadCredential workloadCredential = umsCredentialProvider.getCredentials(request.getUserCrn(), MDCUtils.getRequestId()); LOGGER.info("IPA has password hash support. Credentials information from UMS will be used."); workloadCredentialService.setWorkloadCredential(freeIpaClient, request.getUsername(), workloadCredential); <START> if (workloadCredential.getHashedPassword().isBlank()) { <END> LOGGER.info("IPA has password hash support but user does not have a password set in UMS; using the provided password directly."); freeIpaClient.userSetPasswordWithExpiration( request.getUsername(), request.getPassword(), request.getExpirationInstant()); } } else { LOGGER.info("IPA does not have password hash support; using the provided password directly."); freeIpaClient.userSetPasswordWithExpiration( request.getUsername(), request.getPassword(), request.getExpirationInstant()); } SetPasswordResult result = new SetPasswordResult(request); request.getResult().onNext(result); } catch (Exception e) { request.getResult().onError(e); } }</code><technical_language>if StringUtils.isBlank work if getHashedPassword returns null</technical_language>

Target:
public void accept(Event<SetPasswordRequest> setPasswordRequestEvent) { SetPasswordRequest request = setPasswordRequestEvent.getData(); LOGGER.info("SetPasswordHandler accepting request {}", request); try { Stack stack = stackService.getStackById(request.getResourceId()); MDCBuilder.buildMdcContext(stack); FreeIpaClient freeIpaClient = freeIpaClientFactory.getFreeIpaClientForStack(stack); if (FreeIpaCapabilities.hasSetPasswordHashSupport(freeIpaClient.getConfig())) { WorkloadCredential workloadCredential = umsCredentialProvider.getCredentials(request.getUserCrn(), MDCUtils.getRequestId()); LOGGER.info("IPA has password hash support. Credentials information from UMS will be used."); workloadCredentialService.setWorkloadCredential(freeIpaClient, request.getUsername(), workloadCredential); if (StringUtils.isBlank(workloadCredential.getHashedPassword())) { LOGGER.info("IPA has password hash support but user does not have a password set in UMS; using the provided password directly."); freeIpaClient.userSetPasswordWithExpiration( request.getUsername(), request.getPassword(), request.getExpirationInstant()); } } else { LOGGER.info("IPA does not have password hash support; using the provided password directly."); freeIpaClient.userSetPasswordWithExpiration( request.getUsername(), request.getPassword(), request.getExpirationInstant()); } SetPasswordResult result = new SetPasswordResult(request); request.getResult().onNext(result); } catch (Exception e) { request.getResult().onError(e); } }
Source:
<code>public void removeJobInfo(JobInfo info) { Job job = info.getJob(); jobs.remove(job); runnableMonitors.remove(job); Object[] listenersArray = listeners.getListeners(); <START> for (Object element : listenersArray) { <END> IJobProgressManagerListener listener = (IJobProgressManagerListener) element; if (!isCurrentDisplaying(info.getJob(), listener.showsDebug())) { listener.removeJob(info); } } }</code><technical_language>inline listeners.getListeners()</technical_language>

Target:
public void removeJobInfo(JobInfo info) { Job job = info.getJob(); jobs.remove(job); runnableMonitors.remove(job); for (Object element : listeners.getListeners()) { IJobProgressManagerListener listener = (IJobProgressManagerListener) element; if (!isCurrentDisplaying(info.getJob(), listener.showsDebug())) { listener.removeJob(info); } } }
Source:
<code>public void modify(Path path, byte[] data, Consumer<Long> progressConsumer) { FileWrapper file = getPath(path); <START> ProgressConsumer<Long> pc = l -> progressConsumer.accept(l); <END> file.overwriteFileJS(AsyncReader.build(data), 0, data.length, userContext.network, userContext.crypto, pc).join(); }</code><technical_language>progressConsumer</technical_language>

Target:
public void modify(Path path, byte[] data, Consumer<Long> progressConsumer) { FileWrapper file = getPath(path); file.overwriteFileJS(AsyncReader.build(data), 0, data.length, userContext.network, userContext.crypto, l -> progressConsumer.accept(l)).join(); }
Source:
<code>private void initDateBox() { dateBox = new DateBox(); dateBox.getDatePicker().addStyleName("dateBoxPopup"); <START> dateBox.setWidth(dateRequired ? "90px" : "0px"); END> dateBox.setFormat(new DateBox.DefaultFormat(DateTimeFormat.getFormat("dd-MMM-yyyy"))); dateBox.addValueChangeHandler(new ValueChangeHandler<Date>() { @Override public void onValueChange(ValueChangeEvent<Date> event) { selectedDate = event.getValue(); setSelectedDate(); } }); }</code><technical_language>CSS</technical_language>

Target:
private void initDateBox() { dateBox = new DateBox(); dateBox.getDatePicker().addStyleName("dateBoxPopup"); dateBox.setStyleName(dateRequired ? "dateBoxWidth" : "dateBoxShrink"); dateBox.setFormat(new DateBox.DefaultFormat(dateFormat)); dateBox.addValueChangeHandler(new ValueChangeHandler<Date>() { @Override public void onValueChange(ValueChangeEvent<Date> event) { selectedDate = event.getValue(); setSelectedDate(); } }); }
Source:
<code>public String templateAuswahlAuswerten() throws DAOException { Process tempProzess = serviceManager.getProcessService().getById(this.auswahl); if (serviceManager.getProcessService().getWorkpiecesSize(tempProzess) > 0) { for (Property workpieceProperty : tempProzess.getWorkpieces()) { for (AdditionalField field : this.additionalFields) { if (field.getTitle().equals(workpieceProperty.getTitle())) { field.setValue(workpieceProperty.getValue()); } } } } if (serviceManager.getProcessService().getTemplatesSize(tempProzess) > 0) { for (Property templateProperty : tempProzess.getTemplates()) { for (AdditionalField field : this.additionalFields) { if (field.getTitle().equals(templateProperty.getTitle())) { field.setValue(templateProperty.getValue()); } } } } try { this.myRdf = serviceManager.getProcessService().readMetadataAsTemplateFile(tempProzess); } catch (Exception e) { <START> logger.error("Fehler beim Einlesen der Template-Metadaten ", e); <END> Helper.setFehlerMeldung("Fehler beim Einlesen der Template-Metadaten ", e); } try { DocStructInterface colStruct = this.myRdf.getDigitalDocument().getLogicalDocStruct(); removeCollections(colStruct); colStruct = colStruct.getAllChildren().get(0); removeCollections(colStruct); } catch (PreferencesException e) { Helper.setFehlerMeldung("Fehler beim Anlegen des Vorgangs", e); logger.error("Fehler beim Anlegen des Vorgangs", e); } catch (RuntimeException e) { } return ""; }</code><technical_language>setErrorMessage</technical_language>

Target:
public String templateAuswahlAuswerten() throws DAOException { Process tempProzess = serviceManager.getProcessService().getById(this.auswahl); if (serviceManager.getProcessService().getWorkpiecesSize(tempProzess) > 0) { for (Property workpieceProperty : tempProzess.getWorkpieces()) { for (AdditionalField field : this.additionalFields) { if (field.getTitle().equals(workpieceProperty.getTitle())) { field.setValue(workpieceProperty.getValue()); } } } } if (serviceManager.getProcessService().getTemplatesSize(tempProzess) > 0) { for (Property templateProperty : tempProzess.getTemplates()) { for (AdditionalField field : this.additionalFields) { if (field.getTitle().equals(templateProperty.getTitle())) { field.setValue(templateProperty.getValue()); } } } } try { this.myRdf = serviceManager.getProcessService().readMetadataAsTemplateFile(tempProzess); } catch (ReadException | PreferencesException | IOException | RuntimeException e) { Helper.setErrorMessage("Fehler beim Einlesen der Template-Metadaten ", logger, e); } try { DocStructInterface colStruct = this.myRdf.getDigitalDocument().getLogicalDocStruct(); removeCollections(colStruct, this.prozessKopie); colStruct = colStruct.getAllChildren().get(0); removeCollections(colStruct, this.prozessKopie); } catch (PreferencesException e) { Helper.setErrorMessage("Fehler beim Anlegen des Vorgangs", logger, e); } catch (RuntimeException e) { } return ""; }
Source:
<code>private StateManager() { this.initialzedSenderIdList = new ArrayList<>(); this.receiverNum = shuffleDescription.getReceiverIdList().size(); this.receiverStateMachineMap = new HashMap<>(receiverNum); for (final String receiverId : shuffleDescription.getReceiverIdList()) { receiverStateMachineMap.put(receiverId, PushShuffleReceiverImpl.createStateMachine()); } this.stateMachine = StateMachine.newBuilder() .addState("INIT", "Wait for all receivers are initialized") .addState("CAN_SEND", "Prepared senders can send data to receivers") .addState("RECEIVERS_COMPLETED", "All receivers were completed to receive data from senders in an iteration") .addState("FINISHED", "All senders and receivers were finished") .setInitialState("INIT") .addTransition("INIT", "CAN_SEND", "When RECEIVER_INITIALIZED messages arrived from all receivers." + " It sends SENDER_CAN_SEND messages to all initialized senders.") .addTransition("CAN_SEND", "RECEIVERS_COMPLETED", "When RECEIVER_COMPLETED messages arrived from all receivers." + " It broadcasts ALL_RECEIVERS_COMPLETED messages to all receivers.") .addTransition("RECEIVERS_COMPLETED", "CAN_SEND", "When RECEIVER_READY messages arrived from all receivers" <START> + " It broadcasts ALL_RECEIVERS_READY messages to all senders.") <END> .addTransition("CAN_SEND", "FINISHED", "When RECEIVER_FINISHED messages arrived from all receivers") .build(); }</code><technical_language>is code ALL_RECEIVERS_READY in PushShuffleCode. I SENDER_CAN_SEND. I right</technical_language>

Target:
private StateManager() { this.initializedSenderIdList = new ArrayList<>(); this.totalNumReceivers = shuffleDescription.getReceiverIdList().size(); this.receiverStateMachineMap = new HashMap<>(totalNumReceivers); for (final String receiverId : shuffleDescription.getReceiverIdList()) { receiverStateMachineMap.put(receiverId, PushShuffleReceiverState.createStateMachine()); } this.stateMachine = StateMachine.newBuilder() .addState(INIT, "Wait for all receivers are initialized") .addState(CAN_SEND, "Prepared senders can send data to receivers") .addState(RECEIVERS_COMPLETED, "All receivers were completed to receive data from senders in an iteration") .addState(FINISHED, "All senders and receivers were finished") .setInitialState(INIT) .addTransition(INIT, CAN_SEND, "When RECEIVER_INITIALIZED messages arrived from all receivers." + " It sends SENDER_CAN_SEND messages to all initialized senders.") .addTransition(CAN_SEND, RECEIVERS_COMPLETED, "When RECEIVER_COMPLETED messages arrived from all receivers." + " It broadcasts ALL_RECEIVERS_COMPLETED messages to all receivers.") .addTransition(RECEIVERS_COMPLETED, CAN_SEND, "When RECEIVER_READY messages arrived from all receivers" + " It broadcasts SENDER_CAN_SEND messages to all senders.") .addTransition(RECEIVERS_COMPLETED, FINISHED, "If shutdown() method was called before.") .build(); }
Source:
<code>private Client createClientFrom(final Sid accountSid, final MultivaluedMap<String, String> data) { final Client.Builder builder = Client.builder(); final Sid sid = Sid.generate(Sid.Type.CLIENT); String password = data.getFirst("Password"); builder.setSid(sid); builder.setApiVersion(getApiVersion(data)); builder.setFriendlyName(data.getFirst("FriendlyName")); builder.setAccountSid(accountSid); builder.setLogin(data.getFirst("Login")); builder.setPassword(password); builder.setStatus(Client.ENABLED); <START> builder.setVoiceUrl(getUrl("VoiceUrl", data)); <END> builder.setVoiceMethod(getMethod("VoiceMethod", data)); builder.setVoiceFallbackUrl(getUrl("VoiceFallbackUrl", data)); builder.setVoiceFallbackMethod(getMethod("VoiceFallbackMethod", data)); builder.setVoiceApplicationSid(getSid("VoiceApplicationSid", data)); String rootUri = configuration.getString("root-uri"); rootUri = StringUtils.addSuffixIfNotPresent(rootUri, "/"); final StringBuilder buffer = new StringBuilder(); buffer.append(rootUri).append(getApiVersion(data)).append("/Accounts/").append(accountSid.toString()) .append("/Clients/").append(sid.toString()); builder.setUri(URI.create(buffer.toString())); return builder.build(); }</code><technical_language>object data parameters. remove them</technical_language>

Target:
private Client createClientFrom(final Sid accountSid, final MultivaluedMap<String, String> data) { final Client.Builder builder = Client.builder(); final Sid sid = Sid.generate(Sid.Type.CLIENT); String password = data.getFirst("Password"); builder.setSid(sid); builder.setAccountSid(accountSid); builder.setApiVersion(getApiVersion(data)); builder.setLogin(data.getFirst("Login")); builder.setPassword(password); builder.setFriendlyName(data.getFirst("FriendlyName")); builder.setStatus(Client.ENABLED); String rootUri = configuration.getString("root-uri"); rootUri = StringUtils.addSuffixIfNotPresent(rootUri, "/"); final StringBuilder buffer = new StringBuilder(); buffer.append(rootUri).append(getApiVersion(data)).append("/Accounts/").append(accountSid.toString()) .append("/Clients/").append(sid.toString()); builder.setUri(URI.create(buffer.toString())); return builder.build(); }
Source:
<code>private void setDiskImageActiveBySnapshotType(Map<Guid, DiskImage> diskImageMap, Snapshot snapshot) { DiskImage diskImage = diskImageMap.get(snapshot.getId()); if (diskImage == null) { return; } if (snapshot.getType() == SnapshotType.ACTIVE || snapshot.getType() == SnapshotType.PREVIEW) { diskImage.setActive(true); } else if (snapshot.getType() == <START> SnapshotType.REGULAR) { <END> diskImage.setActive(false); } }</code><technical_language>missing treat STATELESS NEXT_RUN</technical_language>

Target:
private void setDiskImageActiveBySnapshotType(Map<Guid, DiskImage> diskImageMap, Snapshot snapshot) { DiskImage diskImage = diskImageMap.get(snapshot.getId()); if (diskImage == null) { return; } diskImage.setActive(false); if (snapshot.getType() == SnapshotType.ACTIVE || snapshot.getType() == SnapshotType.PREVIEW) { diskImage.setActive(true); } }
Source:
<code>public void startNode(String name) { if (nodeDepth == 1) { <START> currentKey = name; <END> } nodeDepth++; }</code><technical_language>This is work nested nodes</technical_language>

Target:
public void startNode(String name) { currentKey.push(name); if (currentKey.size() == 2) { fields.put(name, ""); } }
Source:
<code>private void email() { if (message == null) { return; } workQueue.getDefaultQueue() .submit(requestScopePropagator.wrap(new Runnable() { @Override public void run() { PatchSetInfo patchSetInfo; try { ReviewDb reviewDb = schemaFactory.open(); try { patchSetInfo = patchSetInfoFactory.get(reviewDb, patchSetId); } finally { reviewDb.close(); } } catch (PatchSetInfoNotAvailableException e) { log.error( <START> "Failed to obtain PatchSetInfo for patch set " + patchSetId, e); <END> return; } catch (OrmException e) { log.error( "Cannot send comments by email for patch set " + patchSetId, e); return; } try { final CommentSender cm = commentSenderFactory.create(change); cm.setFrom(user.getAccountId()); cm.setPatchSet(patchSet, patchSetInfo); cm.setChangeMessage(message); cm.setPatchLineComments(drafts); cm.send(); } catch (EmailException e) { log.error( "Cannot send comments by email for patch set " + patchSetId, e); } } @Override public String toString() { return "send email for patch set comments"; } })); }</code><technical_language>("Cannot read PatchSetInfo of " + patchSetId, e)</technical_language>

Target:
private void email() { if (message == null) { return; } workQueue.getDefaultQueue() .submit(requestScopePropagator.wrap(new Runnable() { @Override public void run() { PatchSetInfo patchSetInfo; try { ReviewDb reviewDb = schemaFactory.open(); try { patchSetInfo = patchSetInfoFactory.get(reviewDb, patchSetId); } finally { reviewDb.close(); } } catch (PatchSetInfoNotAvailableException e) { log.error("Cannot read PatchSetInfo of " + patchSetId, e); return; } catch (OrmException e) { log.error("Cannot email comments for " + patchSetId, e); return; } try { final CommentSender cm = commentSenderFactory.create(change); cm.setFrom(user.getAccountId()); cm.setPatchSet(patchSet, patchSetInfo); cm.setChangeMessage(message); cm.setPatchLineComments(drafts); cm.send(); } catch (EmailException e) { log.error("Cannot email comments for " + patchSetId, e); } } @Override public String toString() { return "send-email comments"; } })); }