auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>List<AqlSearchResult.SearchEntry> SearchByFileSpec(FileSpec file) throws IOException { AqlSearchHelper aqlHelper = new AqlSearchHelper(client); WildcardsSearchHelper wildcardHelper = new WildcardsSearchHelper(client); <START> List<AqlSearchResult.SearchEntry> results = new ArrayList<>(); <END> log.info("Searching for artifacts..."); switch(file.getSpecType()) { case PATTERN: { setWildcardHelperProperties(wildcardHelper,file); results = wildcardHelper.collectArtifactsByPattern(file.getPattern(), file.getExcludePatterns()); break; } case BUILD: { setAqlHelperProperties(aqlHelper,file); results = aqlHelper.collectArtifactsByBuild(); break; } case AQL: { setAqlHelperProperties(aqlHelper,file); results = aqlHelper.collectArtifactsByAql(file.getAql()); break; } } log.info(String.format("Found %s artifacts.", results.size())); return results; }</code><technical_language>creating a new ArrayList, used. creation of list a cost</technical_language>

Target:
List<AqlSearchResult.SearchEntry> SearchByFileSpec(FileSpec file) throws IOException { List<AqlSearchResult.SearchEntry> results = null; log.info("Searching for artifacts..."); switch (file.getSpecType()) { case PATTERN: { WildcardsSearchHelper wildcardHelper = getNewWildcardHelper(file); results = wildcardHelper.collectArtifactsByPattern(file.getPattern(), file.getExcludePatterns()); break; } case BUILD: { AqlSearchHelper aqlHelper = getNewAqlHelper(file); results = aqlHelper.collectArtifactsByBuild(); break; } case AQL: { AqlSearchHelper aqlHelper = getNewAqlHelper(file); results = aqlHelper.collectArtifactsByAql(file.getAql()); break; } } results = (results == null ? new ArrayList<>() : results); log.info(String.format("Found %s artifacts.", results.size())); return results; }
Source:
<code>protected SnapshotTransaction createTransaction( long immutableTimestamp, Supplier<Long> startTimestampSupplier, LockToken immutableTsLock, AdvisoryLockPreCommitCheck advisoryLockCheck) { return new SnapshotTransaction( keyValueService, timelockService, transactionService, cleaner, startTimestampSupplier, conflictDetectionManager, sweepStrategyManager, immutableTimestamp, Optional.of(immutableTsLock), advisoryLockCheck, constraintModeSupplier.get(), cleaner.getTransactionReadTimeoutMillis(), TransactionReadSentinelBehavior.THROW_EXCEPTION, allowHiddenTableAccess, timestampValidationReadCache, lockAcquireTimeoutMs.get(), getRangesExecutor, defaultGetRangesConcurrency, <START> sweepQueueWriter::enqueue); <END> }</code><technical_language>do a method reference here, constructor simply takes a SweepQueueWriter? (same below)</technical_language>

Target:
protected SnapshotTransaction createTransaction( long immutableTimestamp, Supplier<Long> startTimestampSupplier, LockToken immutableTsLock, AdvisoryLockPreCommitCheck advisoryLockCheck) { return new SnapshotTransaction( keyValueService, timelockService, transactionService, cleaner, startTimestampSupplier, conflictDetectionManager, sweepStrategyManager, immutableTimestamp, Optional.of(immutableTsLock), advisoryLockCheck, constraintModeSupplier.get(), cleaner.getTransactionReadTimeoutMillis(), TransactionReadSentinelBehavior.THROW_EXCEPTION, allowHiddenTableAccess, timestampValidationReadCache, lockAcquireTimeoutMs.get(), getRangesExecutor, defaultGetRangesConcurrency, sweepQueueWriter); }
Source:
<code>public SyntaxErrorMessage getSyntaxErrorMessage(IParserErrorContext context) { <START> String defaultMessage = context.getDefaultMessage(); <END> if (defaultMessage.contains(SyntaxErrorMessages.MISSING_EOF)) { return new SyntaxErrorMessage("Failed to parse Expression '" + context.getRecognitionException().token.getText() + "'.", SYNTAX_DIAGNOSTIC); } else { return new SyntaxErrorMessage(defaultMessage, SYNTAX_DIAGNOSTIC); } }</code><technical_language>copyright header</technical_language>

Target:
public SyntaxErrorMessage getSyntaxErrorMessage(IParserErrorContext context) { String defaultMessage = context.getDefaultMessage(); if (!defaultMessage.contains(SyntaxErrorMessages.MISSING_EOF)) { return new SyntaxErrorMessage(defaultMessage, SYNTAX_DIAGNOSTIC); } RecognitionException recognitionException = context.getRecognitionException(); String message = "Failed to parse Expression."; boolean lexicalAnalysisFailed = recognitionException == null; if (!lexicalAnalysisFailed) { message = "Failed to parse Expression '" + recognitionException.token.getText() + "'."; } return new SyntaxErrorMessage(message, SYNTAX_DIAGNOSTIC); }
Source:
<code>private static String[] cleanAndTokenize(String text) throws IOException { if (sentenceDetector == null) { final File sentenceModelFile = InstalledFileLocator.getDefault().locate("textclassifier/en-sent-ewt.bin", TextClassifierUtils.class.getPackage().getName(), false); if (sentenceModelFile == null) { throw new IOException("Error finding sentence detector module"); } sentenceDetector = new NewlineHeuristicSentenceDetector(new SentenceDetectorME(new SentenceModel(new FileInputStream(sentenceModelFile)))); } ArrayList<String> tokens = new ArrayList<>(); String[] sentences = sentenceDetector.sentDetect(text); for (String sentence : sentences) { String[] sentenceTokens = TOKENIZER.tokenize(sentence); ArrayList<String> tokensToKeep = new ArrayList<>(); if (sentenceTokens.length > 5) { tokens.addAll(Arrays.asList(sentenceTokens)); } } <START> return tokens.toArray(new String[0]); <END> }</code><technical_language>tokens.size() in place of zero provide size necessary</technical_language>

Target:
private static String[] cleanAndTokenize(String text) throws IOException { initializeSentenceDetector(); ArrayList<String> tokens = new ArrayList<>(); String[] sentences = sentenceDetector.sentDetect(text); for (String sentence : sentences) { String[] sentenceTokens = TOKENIZER.tokenize(sentence); if (sentenceTokens.length > 5) { tokens.addAll(Arrays.asList(sentenceTokens)); } } return tokens.toArray(new String[0]); }
Source:
<code>public PoolExhaustedException(HostConnectionPool hostConnectionPool, Throwable t) { super(t); <START> hcp = hostConnectionPool; <END> }</code><technical_language>hcp ---> this.hcp</technical_language>

Target:
public PoolExhaustedException(HostConnectionPool hostConnectionPool, Throwable t) { super(t); this.hcp = hostConnectionPool; }
Source:
<code>public CommandErrorCallback(final Command command) { <START> this.command = checkNotNull("view", command); <END> }</code><technical_language>call: java checkNotNull("command", command); :-)</technical_language>

Target:
public CommandErrorCallback(final Command command) { this.command = checkNotNull("command", command); }
Source:
<code>private boolean isNotTimeshiftedOrHd(Channel channel) { <START> return !(channel.getTimeshifted() || <END> channel.getHighDefinition()); }</code><technical_language>this NPE Booleans (i.e. objects primitives)</technical_language>

Target:
boolean isNotTimeshiftedOrHd(Channel channel) { boolean timeshifted = MoreObjects.firstNonNull(channel.getTimeshifted(), false); boolean hd = MoreObjects.firstNonNull(channel.getHighDefinition(), false); return !(timeshifted || hd); }
Source:
<code>public void render(Context context, String value, SafeHtmlBuilder sb) { if (value == null) { value = ""; } String tooltip = value; if (this.sDateDisplayTooltipFormat != null && this.sDateDisplayTooltipFormat != "" && this.sDateFormat != null && this.sDateFormat != "") { try { Date date = DateTimeFormat.getFormat(this.sDateFormat).parse(value); tooltip = DateTimeFormat.getFormat(this.sDateDisplayTooltipFormat).format(date); } catch (Exception e){ } } <START> sb.appendHtmlConstant("<div title=\"" + tooltip + "\" >" + value + "</div>"); <END> }</code><technical_language>This done incorrectly start templates. ate other cells</technical_language>

Target:
public void render(Context context, String value, SafeHtmlBuilder sb) { if (value == null) { value = ""; } String tooltip = value; if (this.sDateDisplayTooltipFormat != null && this.sDateDisplayTooltipFormat != "" && this.sDateFormat != null && this.sDateFormat != "") { try { Date date = DateTimeFormat.getFormat(this.sDateFormat).parse(value); tooltip = DateTimeFormat.getFormat(this.sDateDisplayTooltipFormat).format(date); } catch (Exception e){ } } sb.append(template.action(tooltip, value)); }
Source:
<code>public LinkdStatusProvider(AlarmDao alarmDao) { <START> m_alarmDao = alarmDao; <END> }</code><technical_language>Objects.requireNonNull(alarmDao)</technical_language>

Target:
public LinkdStatusProvider(AlarmDao alarmDao) { m_alarmDao = Objects.requireNonNull(alarmDao); }
Source:
<code>public void seedShouldGrowWherePlanted() { <START> setBlock(new Vector3i(), dirt); <END> setBlock(new Vector3i(0, 1, 0), air); EntityRef seed = testSeed(); plant(seed, new Vector3f()); Assertions.assertEquals(bush, worldProvider.getBlock(new Vector3i(0, 1, 0))); Assertions.assertEquals(dirt, worldProvider.getBlock(new Vector3i(0, 0, 0))); }</code><technical_language>prefer explicit in test vector coordinates. suggestion setBlock(new Vector3i(0, 0, 0), dirt);</technical_language>

Target:
public void seedShouldGrowWherePlanted() { setBlock(new Vector3i(0, 0, 0), dirt); setBlock(new Vector3i(0, 1, 0), air); EntityRef seed = testSeed(); plant(seed, new Vector3f(0, 0, 0)); Assertions.assertEquals(bush, worldProvider.getBlock(new Vector3i(0, 1, 0))); Assertions.assertEquals(dirt, worldProvider.getBlock(new Vector3i(0, 0, 0))); }
Source:
<code>private void applyForceCloseTimeout(final Channel channel, ChannelFuture flushFuture) { final long forceCloseTimeoutMillis = this.forceCloseTimeoutMillis; <START> if (forceCloseTimeoutMillis <= 0 || !channel.isActive()) { <END> return; } flushFuture.addListener(new ChannelFutureListener() { @Override public void operationComplete(ChannelFuture future) throws Exception { if (!future.isSuccess() || !channel.isActive()) { return; } if (!forceCloseInit.compareAndSet(false, true)) { return; } final ScheduledFuture<?> forceCloseFuture = channel.eventLoop().schedule(new Runnable() { @Override public void run() { if (channel.isActive()) { channel.close(); setForceCloseComplete(); } } }, forceCloseTimeoutMillis, TimeUnit.MILLISECONDS); channel.closeFuture().addListener(new ChannelFutureListener() { @Override public void operationComplete(ChannelFuture future) throws Exception { forceCloseFuture.cancel(false); } }); } }); }</code><technical_language>nit: want check !forceCloseInit.get()</technical_language>

Target:
private void applyForceCloseTimeout(final Channel channel, ChannelFuture flushFuture) { final long forceCloseTimeoutMillis = this.forceCloseTimeoutMillis; final WebSocketClientHandshaker handshaker = this; if (forceCloseTimeoutMillis <= 0 || !channel.isActive() || forceCloseInit != 0) { return; } flushFuture.addListener(new ChannelFutureListener() { @Override public void operationComplete(ChannelFuture future) throws Exception { if (future.isSuccess() && channel.isActive() && FORCE_CLOSE_INIT_UPDATER.compareAndSet(handshaker, 0, 1)) { final Future<?> forceCloseFuture = channel.eventLoop().schedule(new Runnable() { @Override public void run() { if (channel.isActive()) { channel.close(); forceCloseComplete = true; } } }, forceCloseTimeoutMillis, TimeUnit.MILLISECONDS); channel.closeFuture().addListener(new ChannelFutureListener() { @Override public void operationComplete(ChannelFuture future) throws Exception { forceCloseFuture.cancel(false); } }); } } }); }
Source:
<code>public Opt<Identity> enter(final String user, final String pwd) { final Opt<Identity> identity; final User valid = this.usernames.get(user); if (valid == null) { identity = new Opt.Empty<Identity>(); } else if (valid.password().equals(pwd)) { identity = new Opt.Single<Identity>(valid.identity()); } else { <START> identity = new Opt.Empty<Identity>(); <END> } return identity; }</code><technical_language>@Suseika hm.. code duplication me. this: if (valid == null || !valid.password().equals(pwd)) { } else { }</technical_language>

Target:
public Opt<Identity> enter(final String user, final String pwd) { final Opt<String> urn = this.urn(user, pwd); final Opt<Identity> identity; if (urn.has()) { try { identity = new Opt.Single<Identity>( new Identity.Simple( URLDecoder.decode(urn.get(), Default.ENCODING) ) ); } catch (final UnsupportedEncodingException ex) { throw new IllegalStateException(ex); } } else { identity = new Opt.Empty<Identity>(); } return identity; }
Source:
<code>private void validateStartDateTimeToBirthdate(Visit visit, Errors errors) { Patient patient = visit.getPatient(); <START> if (patient != null) { <END> if (visit.getStartDatetime() != null && patient.getBirthdate() != null && !patient.getBirthdateEstimated() && visit.getStartDatetime().before(patient.getBirthdate())) { errors.rejectValue("startDatetime", "Visit.startDateCannotBeBeforeBirthdate", "This visit has a start date before birth date of the patient."); } } }</code><technical_language>@dkayiwa visits patients? this fail error</technical_language>

Target:
private void validateStartDateTimeToBirthdate(Visit visit, Errors errors) { Patient patient = visit.getPatient(); if (patient != null) { if (visit.getStartDatetime() != null && patient.getBirthdate() != null) { if (!patient.getBirthdateEstimated() && visit.getStartDatetime().before(patient.getBirthdate())) { errors.rejectValue("startDatetime", "Visit.startDateCannotBeBeforeBirthdate", "This visit has a start date before birth date of the patient."); } if (patient.getBirthdateEstimated()) { Calendar calendar = Calendar.getInstance(); calendar.setTime(patient.getBirthdate()); long ageInMillis = Calendar.getInstance().getTimeInMillis() - calendar.getTimeInMillis(); long ageInYears = (ageInMillis / 86400000) / 365; int ageInMillisInt = (int) ageInMillis; if (ageInYears < 2) { calendar.add(Calendar.YEAR, -1); } else { calendar.add(Calendar.MILLISECOND, -(ageInMillisInt / 2)); } Date estimatedDate = calendar.getTime(); if (visit.getStartDatetime().before(estimatedDate)) { errors.rejectValue("startDatetime", "Visit.startDateCannotBeBeforeBirthdate", "This visit has a start date before birth date of the patient."); } } } } }
Source:
<code>protected byte[] downloadByteArray(AccountingXmlDocumentBackupLink accountingXmlDocumentBackupLink) throws IOException { Collection<WebServiceCredential> credentials = getWebServiceCredentials(accountingXmlDocumentBackupLink); try { if (isLinkUrlValidForGroupCode(accountingXmlDocumentBackupLink, credentials)) { Invocation request = buildClientRequest(accountingXmlDocumentBackupLink.getLinkUrl(), credentials); return downloadByteArrayFromWebResource(accountingXmlDocumentBackupLink.getFileName(), request); } else { LOG.error("downloadByteArray, the group code isn't valid for the link URL"); throw new ValidationException("The group code: " + accountingXmlDocumentBackupLink.getCredentialGroupCode() + " isn't valid for the link URL: " + accountingXmlDocumentBackupLink.getLinkUrl()); } } catch (URISyntaxException e) { <START> throw new IOException(e.getMessage()); <END> } }</code><technical_language>this changed throw a ValidationException instead? Otherwise, calling code print message of IOException catches it</technical_language>

Target:
protected byte[] downloadByteArray(AccountingXmlDocumentBackupLink accountingXmlDocumentBackupLink) throws IOException { Collection<WebServiceCredential> credentials = getWebServiceCredentials(accountingXmlDocumentBackupLink); try { if (isLinkUrlValidForGroupCode(accountingXmlDocumentBackupLink, credentials)) { Invocation request = buildClientRequest(accountingXmlDocumentBackupLink.getLinkUrl(), credentials); return downloadByteArrayFromWebResource(accountingXmlDocumentBackupLink.getFileName(), request); } else { LOG.error("downloadByteArray, the group code isn't valid for the link URL"); throw new ValidationException("The group code: " + accountingXmlDocumentBackupLink.getCredentialGroupCode() + " isn't valid for the link URL: " + accountingXmlDocumentBackupLink.getLinkUrl()); } } catch (URISyntaxException e) { LOG.error("downloadByteArray, the URL has an incorrect syntax", e); throw new ValidationException("The URL has an incorrect syntax: " + accountingXmlDocumentBackupLink.getLinkUrl()); } }
Source:
<code>private void handleAttributeOrDirective(Annotation a) { <START> Object o = getOrDefault(lastMethodSeen); <END> if (o != null) { String attributeName = a.get("value"); if (attributeName == null) { attributeName = lastMethodSeen; } if (STD_DIRECTIVE.equals(a.getName() .getFQN())) { attributeName += ":"; } if (!attributesAndDirectives.containsKey(attributeName)) { attributesAndDirectives.putTyped(attributeName, o); } } }</code><technical_language>This violates spec: <LINK_0></technical_language>

Target:
private void handleAttributeOrDirective(Annotation a) { Object o = annotation.get(lastMethodSeen); if (o != null) { String attributeName = a.get("value"); if (attributeName == null) { attributeName = lastMethodSeen; } if (STD_DIRECTIVE.equals(a.getName() .getFQN())) { attributeName += ":"; } if (!attributesAndDirectives.containsKey(attributeName)) { attributesAndDirectives.putTyped(attributeName, o); } } }
Source:
<code>public static MyLooperDelayedExecutor newInstance() { <START> Handler handler = new Handler(); <END> return new MyLooperDelayedExecutor(handler, new HashMap<Action, Runnable>()); }</code><technical_language>this executor Looper too</technical_language>

Target:
public static MyLooperDelayedExecutor newInstance() { Handler handler = new Handler(Looper.myLooper()); return new MyLooperDelayedExecutor(handler, new HashMap<Action, Runnable>()); }
Source:
<code>public StoreConfiguration processConfiguration(StoreConfiguration storeConfiguration) { if(storeConfiguration instanceof DeployedStoreConfiguration) { DeployedStoreConfiguration deployedConfiguration = (DeployedStoreConfiguration) storeConfiguration; PersistenceConfigurationBuilder replacedBuilder = deployedConfiguration.getPersistenceConfigurationBuilder(); try { DeployedCacheStoreMetadata deployedCacheStoreMetadata = getPromise(deployedConfiguration.getCustomStoreClassName()).get(TIMEOUT_SECONDS, TimeUnit.SECONDS); StoreConfigurationBuilder replacedStoreBuilder = replacedBuilder.addStore(deployedCacheStoreMetadata.getStoreBuilderClass()); replacedStoreBuilder.fetchPersistentState(deployedConfiguration.fetchPersistentState()); replacedStoreBuilder.ignoreModifications(deployedConfiguration.ignoreModifications()); replacedStoreBuilder.preload(deployedConfiguration.preload()); replacedStoreBuilder.purgeOnStartup(deployedConfiguration.purgeOnStartup()); replacedStoreBuilder.shared(deployedConfiguration.shared()); replacedStoreBuilder.withProperties(deployedConfiguration.properties()); StoreConfiguration replacedConfiguration = (StoreConfiguration) replacedStoreBuilder.create(); return replacedConfiguration; } catch (Exception e) { <START> InfinispanLogger.ROOT_LOGGER.error("Could not get Custom Cache Store metadata (" + deployedConfiguration.getCustomStoreClassName() + ") within given time.", e); <END> } } return null; }</code><technical_language>This message apply line 48. put try/catch one? line 32</technical_language>

Target:
public StoreConfiguration processConfiguration(StoreConfiguration storeConfiguration) { if (storeConfiguration instanceof DeployedStoreConfiguration) { DeployedStoreConfiguration deployedConfiguration = (DeployedStoreConfiguration) storeConfiguration; PersistenceConfigurationBuilder replacedBuilder = deployedConfiguration.getPersistenceConfigurationBuilder(); try { DeployedCacheStoreMetadata deployedCacheStoreMetadata = getPromise(deployedConfiguration.getCustomStoreClassName()).get(TIMEOUT_SECONDS, TimeUnit.SECONDS); StoreConfigurationBuilder replacedStoreBuilder = replacedBuilder.addStore(deployedCacheStoreMetadata.getStoreBuilderClass()); replacedStoreBuilder.fetchPersistentState(deployedConfiguration.fetchPersistentState()); replacedStoreBuilder.ignoreModifications(deployedConfiguration.ignoreModifications()); replacedStoreBuilder.preload(deployedConfiguration.preload()); replacedStoreBuilder.purgeOnStartup(deployedConfiguration.purgeOnStartup()); replacedStoreBuilder.shared(deployedConfiguration.shared()); replacedStoreBuilder.withProperties(deployedConfiguration.properties()); return (StoreConfiguration) replacedStoreBuilder.create(); } catch (InterruptedException | ExecutionException e) { throw new IllegalStateException("An error occurred while processing the deployment", e); } catch (TimeoutException e) { InfinispanLogger.ROOT_LOGGER.error("Could not get Custom Cache Store metadata (" + deployedConfiguration.getCustomStoreClassName() + ") within given time.", e); } } return null; }
Source:
<code><START> public List<ServerResponse> processAndComputeServerResponses( <END> final Session session, final ChatParticipant sender, final ClientMessageEnvelope clientMessageEnvelope) { final Optional<ChatClientEnvelopeType> chatClientEnvelopeType = parseType(clientMessageEnvelope); if (chatClientEnvelopeType.isEmpty()) { return List.of(); } switch (chatClientEnvelopeType.get()) { case CONNECT: chatters.put(session, sender); return List.of( ServerResponse.backToClient( ChatServerEnvelopeFactory.newPlayerListing( new ArrayList<>(chatters.getAllParticipants()))), ServerResponse.broadcast(ChatServerEnvelopeFactory.newPlayerJoined(sender))); case SLAP: final PlayerName slapped = PlayerName.of(clientMessageEnvelope.getPayload()); return List.of( ServerResponse.broadcast( ChatServerEnvelopeFactory.newSlap( PlayerSlapped.builder() .slapper(sender.getPlayerName()) .slapped(slapped) .build()))); case MESSAGE: return List.of( ServerResponse.broadcast( ChatServerEnvelopeFactory.newChatMessage( new ChatMessage(sender.getPlayerName(), clientMessageEnvelope.getPayload())))); case UPDATE_MY_STATUS: return List.of( ServerResponse.broadcast( ChatServerEnvelopeFactory.newStatusUpdate( new StatusUpdate(sender.getPlayerName(), clientMessageEnvelope.getPayload())))); default: throw new UnsupportedOperationException( "Unhandled message type: " + chatClientEnvelopeType); } }</code><technical_language>Method processAndComputeServerResponses 36 lines of code (exceeds 25 allowed). Consider refactoring</technical_language>

Target:
public List<ServerResponse> processAndComputeServerResponses( final Session session, final ChatParticipant sender, final ClientMessageEnvelope clientMessageEnvelope) { final Optional<ChatClientEnvelopeType> chatClientEnvelopeType = parseType(clientMessageEnvelope); if (chatClientEnvelopeType.isEmpty()) { return List.of(); } switch (chatClientEnvelopeType.get()) { case CONNECT: chatters.put(session, sender); return playerConnectedMessages(sender); case SLAP: return List.of(playerSlappedMessage(sender, clientMessageEnvelope)); case MESSAGE: return List.of(chatMessage(sender, clientMessageEnvelope)); case UPDATE_MY_STATUS: return List.of(statusUpdateMessage(sender, clientMessageEnvelope)); default: throw new UnsupportedOperationException( "Unhandled message type: " + chatClientEnvelopeType); } }
Source:
<code>public SWTBotSiriusDiagramEditor(final IEditorReference reference, final SWTWorkbenchBot bot) throws WidgetNotFoundException { super(reference, bot); GraphicalViewer graphicalViewer = UIThreadRunnable.syncExec(new Result<GraphicalViewer>() { @Override public GraphicalViewer run() { final IEditorPart editor = partReference.getEditor(true); <START> return editor.getAdapter(GraphicalViewer.class); <END> } }); ReflectionHelper.setFieldValueWithoutException(this, "viewer", new SWTBotSiriusGefViewer(graphicalViewer), this.getClass().getSuperclass()); }</code><technical_language>generic mars. code compile previous platform</technical_language>

Target:
public SWTBotSiriusDiagramEditor(final IEditorReference reference, final SWTWorkbenchBot bot) throws WidgetNotFoundException { super(reference, bot); GraphicalViewer graphicalViewer = UIThreadRunnable.syncExec(new Result<GraphicalViewer>() { @Override public GraphicalViewer run() { final IEditorPart editor = partReference.getEditor(true); return (GraphicalViewer) editor.getAdapter(GraphicalViewer.class); } }); ReflectionHelper.setFieldValueWithoutException(this, "viewer", new SWTBotSiriusGefViewer(graphicalViewer), this.getClass().getSuperclass()); }
Source:
<code>private void buildChildrenEntries(ThreadNode threadNode) { FlamegraphDepthEntry threadEntry = new FlamegraphDepthEntry(threadNode.getSymbol().toString(), 0, 0, fFlameGraphEntries.size(), threadNode.getId()); <START> List<FlamegraphDepthEntry> childrenEntries = new ArrayList<>(); <END> Deque<Long> timestampStack = new ArrayDeque<>(); timestampStack.push(0L); threadNode.getChildren().stream() .sorted(Comparator.comparingLong(AggregatedCalledFunction::getDuration)) .forEach(rootFunction -> { setData(rootFunction, childrenEntries, timestampStack); long currentThreadDuration = timestampStack.pop() + rootFunction.getDuration(); timestampStack.push(currentThreadDuration); }); childrenEntries.forEach(child -> { if (child != null) { threadEntry.addChild(child); } }); threadEntry.updateEndTime(timestampStack.pop()); fFlameGraphEntries.add(threadEntry); }</code><technical_language>unrelated</technical_language>

Target:
private void buildChildrenEntries(ThreadNode threadNode) { FlamegraphDepthEntry threadEntry = new FlamegraphDepthEntry("", 0, 0, fFlameGraphEntries.size(), threadNode.getId()); List<FlamegraphDepthEntry> childrenEntries = new ArrayList<>(); Deque<Long> timestampStack = new ArrayDeque<>(); timestampStack.push(0L); threadNode.getChildren().stream() .sorted(Comparator.comparingLong(AggregatedCalledFunction::getDuration)) .forEach(rootFunction -> { setData(rootFunction, childrenEntries, timestampStack); long currentThreadDuration = timestampStack.pop() + rootFunction.getDuration(); timestampStack.push(currentThreadDuration); }); childrenEntries.forEach(child -> { if (child != null) { threadEntry.addChild(child); } }); threadEntry.updateEndTime(timestampStack.pop()); threadEntry.setName(threadNode.getSymbol().toString()); fFlameGraphEntries.add(threadEntry); }
Source:
<code>public ModelValidatorContext(TaskFlowJob job) { Map<String, Serializable> jobVariablesValues = new LinkedHashMap<>(); for (JobVariable jobVariable : job.getVariables().values()) { jobVariablesValues.put(jobVariable.getName(), jobVariable.getValue()); } spELVariables = new SpELVariables(jobVariablesValues); spelContext = new StandardEvaluationContext(spELVariables); <START> spelContext.setTypeLocator(new RestrictedTypeLocator()); <END> }</code><technical_language>public ModelValidatorContext(StandardEvaluationContext context) require spelContext.setTypeLocator(new RestrictedTypeLocator()); ? I suggest yo cascading constructors instead of code in constructors</technical_language>

Target:
public ModelValidatorContext(TaskFlowJob job) { this(job.getVariables().values().stream().collect(HashMap<String, Serializable>::new, (m, v) -> m.put(v.getName(), v.getValue()), HashMap<String, Serializable>::putAll)); }
Source:
<code>public void evaluate() throws Throwable { CallableStatement callable = new CallableStatement(); FutureTask<Throwable> task = new FutureTask<Throwable>(callable); ThreadGroup threadGroup = new ThreadGroup("FailOnTimeoutGroup"); Thread thread = new Thread(threadGroup, task, "Time-limited test"); try { thread.setDaemon(true); thread.start(); callable.awaitStarted(); Throwable throwable = getResult(task, thread); if (throwable != null) { throw throwable; } } finally { <START> thread.join(100); <END> try { threadGroup.destroy(); } catch (IllegalThreadStateException e) { } } }</code><technical_language>reason pass 1 thread.join()? this point, test completed (in case this return right away) test timed out (in case thread more 100ms exit). Waiting extra time test run longer. In fact, call join all. thread.join() throw InterruptedException</technical_language>

Target:
public void evaluate() throws Throwable { CallableStatement callable = new CallableStatement(); FutureTask<Throwable> task = new FutureTask<Throwable>(callable); ThreadGroup threadGroup = new ThreadGroup("FailOnTimeoutGroup"); Thread thread = new Thread(threadGroup, task, "Time-limited test"); try { thread.setDaemon(true); thread.start(); callable.awaitStarted(); Throwable throwable = getResult(task, thread); if (throwable != null) { throw throwable; } } finally { try { thread.join(1); } catch (InterruptedException e) { Thread.currentThread().interrupt(); } try { threadGroup.destroy(); } catch (IllegalThreadStateException e) { } } }
Source:
<code>public void start() { if (!started.compareAndSet(false, true)) { LOG.warn("attempting to start the consumer for the second (or more) time."); return; } if (stopped.get()) { LOG.warn("attempting to start a stopped consumer"); <START> return; <END> } startSubscription(); setFetchThresholds(); startConsumer(); LOG.info("consumer started", this); }</code><technical_language>this a exception</technical_language>

Target:
public void start() { if (!started.compareAndSet(false, true)) { LOG.warn("{}: Attempting to start the consumer for the second (or more) time.", this); return; } if (stopped.get()) { LOG.error("{}: Attempting to start a stopped consumer", this); return; } startSubscription(); setFetchThresholds(); startConsumer(); LOG.info("{}: Consumer started", this); }
Source:
<code>private static Map<String, ?> copyConfig(Map<String,?> entries, LocationDetailLevel level) { ImmutableMap.Builder<String, Object> builder = ImmutableMap.builder(); if (level!=LocationDetailLevel.NONE) { <START> for (Object entryO : entries.entrySet()) { <END> @SuppressWarnings("unchecked") Map.Entry<String, ?> entry = (Map.Entry<String, ?>) entryO; if (level==LocationDetailLevel.FULL_INCLUDING_SECRET || !Entities.isSecret(entry.getKey())) { builder.put(entry.getKey(), WebResourceUtils.getValueForDisplay(entry.getValue(), true, false)); } } } return builder.build(); }</code><technical_language>change this for (Map.Entry<String,?> entry : entries.entrySet()), changed arg map improved generics usage of method signature</technical_language>

Target:
private static Map<String, ?> copyConfig(Map<String,?> entries, LocationDetailLevel level) { ImmutableMap.Builder<String, Object> builder = ImmutableMap.builder(); if (level!=LocationDetailLevel.NONE) { for (Map.Entry<String,?> entry : entries.entrySet()) { if (level==LocationDetailLevel.FULL_INCLUDING_SECRET || !Entities.isSecret(entry.getKey())) { builder.put(entry.getKey(), WebResourceUtils.getValueForDisplay(entry.getValue(), true, false)); } } } return builder.build(); }
Source:
<code>public void init(ByteBuffer buf, int position) { NativeMemory nativeMemory = getNativeMemory(buf); <START> Memory mem = new MemoryRegion(nativeMemory, position, maxIntermediateSize); <END> unions.put(position, (Union) SetOperation.builder().initMemory(mem).build(size, Family.UNION)); }</code><technical_language>changes needed</technical_language>

Target:
public void init(ByteBuffer buf, int position) { createNewUnion(buf, position, false); }
Source:
<code>protected boolean canDoAction() { Map<Guid, StorageDomain> domainsMap = new HashMap<Guid, StorageDomain>(); if (!canDoActionBeforeCloneVm(domainsMap)) { return false; } if (getParameters().isImportAsNewEntity()) { initImportClonedVm(); if (getVm().getInterfaces().size() > MacPoolManager.getInstance().getAvailableMacsCount()) { addCanDoActionMessage(VdcBllMessages.MAC_POOL_NOT_ENOUGH_MAC_ADDRESSES); return false; } } <START> if (getVdsGroup() != null && getVm().isBalloonEnabled() && !getVdsGroup().isBalloonSupported()) { <END> return failCanDoAction(VdcBllMessages.BALLOON_REQUESTED_ON_NOT_SUPPORTED_ARCH, String.format("$clusterArch %1$s", getVdsGroup().getArchitecture())); } return canDoActionAfterCloneVm(domainsMap); }</code><technical_language>getVdsGroup() return null here? I do check this else I stay consistent..</technical_language>

Target:
protected boolean canDoAction() { Map<Guid, StorageDomain> domainsMap = new HashMap<Guid, StorageDomain>(); if (!canDoActionBeforeCloneVm(domainsMap)) { return false; } if (getParameters().isImportAsNewEntity()) { initImportClonedVm(); if (getVm().getInterfaces().size() > MacPoolManager.getInstance().getAvailableMacsCount()) { addCanDoActionMessage(VdcBllMessages.MAC_POOL_NOT_ENOUGH_MAC_ADDRESSES); return false; } } if (getVm().isBalloonEnabled() && !getVdsGroup().isBalloonSupported()) { return failCanDoAction(VdcBllMessages.BALLOON_REQUESTED_ON_NOT_SUPPORTED_ARCH, String.format("$clusterArch %1$s", getVdsGroup().getArchitecture())); } return canDoActionAfterCloneVm(domainsMap); }
Source:
<code>public Statement apply(final Statement statement, Description description) { Set<Long> enabled = new HashSet<>(); Set<Long> disabled = new HashSet<>(); EnableCompatChanges enableCompatChanges = description.getAnnotation( EnableCompatChanges.class); DisableCompatChanges disableCompatChanges = description.getAnnotation( DisableCompatChanges.class); if (enableCompatChanges != null) { enabled.addAll(Longs.asList(enableCompatChanges.value())); } if (disableCompatChanges != null) { disabled.addAll(Longs.asList(disableCompatChanges.value())); } <START> ArraySet<Long> intersection = new ArraySet<>(enabled); intersection.retainAll(disabled); if (!intersection.isEmpty()) { throw new IllegalArgumentException( "Changes " + intersection + " are both enabled and disabled."); } if (enabled.isEmpty() && disabled.isEmpty()) { throw new IllegalStateException("Added a CompatChangeRule without specifying any " + "@EnableCompatChanges or @DisableCompatChanges !"); } <END> return new CompatChangeStatement(statement, enabled, disabled); }</code><technical_language>nit: say: new ChangeConfig(enabled, disabled); // throws if configuration is invalid alternatively, extract checks a static helper function ChangeConfig.isValid(enabled, disabled) call static function ChangeConfig constructor</technical_language>

Target:
public Statement apply(final Statement statement, Description description) { Set<Long> enabled = new HashSet<>(); Set<Long> disabled = new HashSet<>(); EnableCompatChanges enableCompatChanges = description.getAnnotation( EnableCompatChanges.class); DisableCompatChanges disableCompatChanges = description.getAnnotation( DisableCompatChanges.class); if (enableCompatChanges != null) { enabled.addAll(Longs.asList(enableCompatChanges.value())); } if (disableCompatChanges != null) { disabled.addAll(Longs.asList(disableCompatChanges.value())); } ArraySet<Long> intersection = new ArraySet<>(enabled); intersection.retainAll(disabled); if (!intersection.isEmpty()) { throw new IllegalArgumentException( "Changes " + intersection + " are both enabled and disabled."); } if (enabled.isEmpty() && disabled.isEmpty()) { throw new IllegalStateException("Added a CompatChangeRule without specifying any " + "@EnableCompatChanges or @DisableCompatChanges !"); } return new CompatChangeStatement(statement, new ChangeConfig(enabled, disabled)); }
Source:
<code>public void handleCommand(ChannelUID channelUID, Command command) { switch (channelUID.getId()) { case CHANNEL_MUTE: if (command instanceof OnOffType) { isMuted = ((OnOffType) command).equals(OnOffType.ON); } else { <START> logger.warn("command not supported in channel {}:mute", command.getClass(), this.thing.getUID()); <END> } break; default: logger.warn("Channel not supported in bridge {}", channelUID.getId(), this.thing.getUID()); } }</code><technical_language>reduce debug</technical_language>

Target:
public void handleCommand(ChannelUID channelUID, Command command) { switch (channelUID.getId()) { case CHANNEL_MUTE: if (command instanceof OnOffType) { isMuted = ((OnOffType) command).equals(OnOffType.ON); } else { logger.debug("command not supported in channel {}:mute", command.getClass(), this.thing.getUID()); } break; default: logger.warn("Channel not supported in bridge {}", channelUID.getId(), this.thing.getUID()); } }
Source:
<code>public void handleEvent(ITmfEvent event) { final String eventName = event.getName(); <START> if (!eventName.equals(QemuKvmStrings.VMSYNC_GH_HOST)) { <END> return; } final ITmfEventField content = event.getContent(); final long ts = event.getTimestamp().getValue(); final String hostId = event.getTrace().getHostId(); final Integer cpu = TmfTraceUtils.resolveIntEventAspectOfClassForEvent(event.getTrace(), TmfCpuAspect.class, event); if (cpu == null) { return; } ITmfEventField data = content.getField(QemuKvmStrings.VM_UID_PAYLOAD); if (data == null) { return; } long vmUid = (Long) data.getValue(); for (Entry<String, VirtualMachine> entry : fKnownMachines.entrySet()) { if (entry.getValue().getVmUid() == vmUid) { KernelAnalysisModule module = getLttngKernelModuleFor(hostId); if (module == null) { break; } Integer tid = KernelThreadInformationProvider.getThreadOnCpu(module, cpu, ts); if (tid == null) { break; } HostThread ht = new HostThread(hostId, tid); fTidToVm.put(ht, entry.getValue()); Integer ppid = KernelThreadInformationProvider.getParentPid(module, tid, ts); if (ppid != null) { HostThread parentHt = new HostThread(hostId, ppid); fTidToVm.put(parentHt, entry.getValue()); } } } }</code><technical_language>this in layout? I asking</technical_language>

Target:
public void handleEvent(ITmfEvent event) { final String eventName = event.getName(); if (!eventName.equals(QemuKvmStrings.VMSYNC_GH_HOST)) { return; } final ITmfEventField content = event.getContent(); final long ts = event.getTimestamp().toNanos(); final String hostId = event.getTrace().getHostId(); final Integer cpu = TmfTraceUtils.resolveIntEventAspectOfClassForEvent(event.getTrace(), TmfCpuAspect.class, event); if (cpu == null) { return; } ITmfEventField data = content.getField(QemuKvmStrings.VM_UID_PAYLOAD); if (data == null) { return; } long vmUid = (Long) data.getValue(); for (Entry<String, VirtualMachine> entry : fKnownMachines.entrySet()) { if (entry.getValue().getVmUid() == vmUid) { KernelAnalysisModule module = getLttngKernelModuleFor(hostId); if (module == null) { break; } Integer tid = KernelThreadInformationProvider.getThreadOnCpu(module, cpu, ts); if (tid == null) { break; } HostThread ht = new HostThread(hostId, tid); fTidToVm.put(ht, entry.getValue()); Integer ppid = KernelThreadInformationProvider.getParentPid(module, tid, ts); if (ppid != null) { HostThread parentHt = new HostThread(hostId, ppid); fTidToVm.put(parentHt, entry.getValue()); } } } }
Source:
<code>private void addAdditionalHeaderFields(VCFHeader header) { header.addMetaDataLine(new VCFHeaderLine(InfiniumVcfFields.ZCALL_VERSION, ZCALL_VERSION)); header.addMetaDataLine(new VCFHeaderLine(InfiniumVcfFields.ZCALL_THRESHOLDS, ZCALL_THRESHOLDS_FILE.getName())); <START> header.addMetaDataLine(new VCFFilterHeaderLine(InfiniumVcfFields.ZCALL_DIFF)); <END> header.addMetaDataLine(new VCFInfoHeaderLine(InfiniumVcfFields.ZTHRESH_X, 1, VCFHeaderLineType.Float, "zCall X threshold")); header.addMetaDataLine(new VCFInfoHeaderLine(InfiniumVcfFields.ZTHRESH_Y, 1, VCFHeaderLineType.Float, "zCall Y threshold")); header.addMetaDataLine(new VCFFormatHeaderLine(InfiniumVcfFields.GTA, 1, VCFHeaderLineType.String, "Illumina Autocall Genotype")); header.addMetaDataLine(new VCFFormatHeaderLine(InfiniumVcfFields.GTZ, 1, VCFHeaderLineType.String, "zCall Genotype")); }</code><technical_language>this filter a description? filtered ZCALL_DIFF</technical_language>

Target:
private void addAdditionalHeaderFields(VCFHeader header) { header.addMetaDataLine(new VCFHeaderLine(InfiniumVcfFields.ZCALL_VERSION, ZCALL_VERSION)); header.addMetaDataLine(new VCFHeaderLine(InfiniumVcfFields.ZCALL_THRESHOLDS, ZCALL_THRESHOLDS_FILE.getName())); header.addMetaDataLine(new VCFInfoHeaderLine(InfiniumVcfFields.ZTHRESH_X, 1, VCFHeaderLineType.Float, "zCall X threshold")); header.addMetaDataLine(new VCFInfoHeaderLine(InfiniumVcfFields.ZTHRESH_Y, 1, VCFHeaderLineType.Float, "zCall Y threshold")); header.addMetaDataLine(new VCFFormatHeaderLine(InfiniumVcfFields.GTA, 1, VCFHeaderLineType.String, "Illumina Autocall Genotype")); header.addMetaDataLine(new VCFFormatHeaderLine(InfiniumVcfFields.GTZ, 1, VCFHeaderLineType.String, "zCall Genotype")); }
Source:
<code>protected boolean validateAndAddListenerInvocations(Object listener, AbstractInvocationBuilder builder) { Listener l = testListenerClassValidity(listener.getClass()); boolean foundMethods = false; builder.setTarget(listener); builder.setSubject(Security.getSubject()); builder.setSync(l.sync()); Map<Class<? extends Annotation>, Class<?>> allowedListeners = getAllowedMethodAnnotations(l); for (Method m : listener.getClass().getMethods()) { if (!m.isSynthetic() || !m.isBridge()) { for (Map.Entry<Class<? extends Annotation>, Class<?>> annotationEntry : allowedListeners.entrySet()) { final Class<? extends Annotation> annotationClass = annotationEntry.getKey(); if (m.isAnnotationPresent(annotationClass)) { final Class<?> eventClass = annotationEntry.getValue(); testListenerMethodValidity(m, eventClass, annotationClass.getName()); if (System.getSecurityManager() == null) { m.setAccessible(true); } else { AccessController.doPrivileged((PrivilegedAction<Void>) () -> { m.setAccessible(true); return null; }); } builder.setMethod(m); builder.setAnnotation(annotationClass); L invocation = builder.build(); <START> if (log.isTraceEnabled()) <END> log.tracef("Add listener invocation %s for %s", invocation, annotationClass); getListenerCollectionForAnnotation(annotationClass).add(invocation); foundMethods = true; } } } } if (!foundMethods) getLog().noAnnotateMethodsFoundInListener(listener.getClass()); return foundMethods; }</code><technical_language>if (trace)</technical_language>

Target:
protected boolean validateAndAddListenerInvocations(Object listener, AbstractInvocationBuilder builder) { Listener l = testListenerClassValidity(listener.getClass()); boolean foundMethods = false; builder.setTarget(listener); builder.setSubject(Security.getSubject()); builder.setSync(l.sync()); Map<Class<? extends Annotation>, Class<?>> allowedListeners = getAllowedMethodAnnotations(l); for (Method m : listener.getClass().getMethods()) { if (!m.isSynthetic() || !m.isBridge()) { for (Map.Entry<Class<? extends Annotation>, Class<?>> annotationEntry : allowedListeners.entrySet()) { final Class<? extends Annotation> annotationClass = annotationEntry.getKey(); if (m.isAnnotationPresent(annotationClass)) { final Class<?> eventClass = annotationEntry.getValue(); testListenerMethodValidity(m, eventClass, annotationClass.getName()); if (System.getSecurityManager() == null) { m.setAccessible(true); } else { AccessController.doPrivileged((PrivilegedAction<Void>) () -> { m.setAccessible(true); return null; }); } builder.setMethod(m); builder.setAnnotation(annotationClass); L invocation = builder.build(); if (trace) log.tracef("Add listener invocation %s for %s", invocation, annotationClass); getListenerCollectionForAnnotation(annotationClass).add(invocation); foundMethods = true; } } } } if (!foundMethods) getLog().noAnnotateMethodsFoundInListener(listener.getClass()); return foundMethods; }
Source:
<code>public static String getVersion() { Properties prop = new Properties(); try (InputStream versionfile = GPSession.class.getResourceAsStream("git.properties")) { try { prop.load(versionfile); <START> return prop.getProperty("git.commit.id.describe"); <END> } catch (IOException e){ return "unknown-development"; } } catch (IOException e) { return "unknown-error"; } }</code><technical_language>Please a default (unknown-development?)</technical_language>

Target:
public static String getVersion() { Properties prop = new Properties(); try (InputStream versionfile = GPSession.class.getResourceAsStream("git.properties")) { prop.load(versionfile); return prop.getProperty("git.commit.id.describe", "unknown-development"); } catch (IOException e) { return "unknown-error"; } }
Source:
<code>public String getRequestURI() { String uri = contextPath + servletPath + path; <START> if (!parameters.isEmpty()) { <END> uri += "?" + GitilesView.paramsToString(parameters); } return uri; }</code><technical_language>IIRC getRequestURI include query parameters. quote docs "Returns part of this request's URL protocol name query string in line of HTTP request."</technical_language>

Target:
public String getRequestURI() { return contextPath + servletPath + path; }
Source:
<code>public void prepareForWrite(RecordConsumer recordConsumer) { final MessageColumnIO columnIO = new ColumnIOFactory().getColumnIO(schema); <START> this.parquetWriteProtocol = new ParquetWriteProtocol( <END> this.configuration, recordConsumer, columnIO, thriftStruct); thriftWriteSupport.prepareForWrite(recordConsumer); }</code><technical_language>drop this for parquetWriteProtoCol configuration</technical_language>

Target:
public void prepareForWrite(RecordConsumer recordConsumer) { final MessageColumnIO columnIO = new ColumnIOFactory().getColumnIO(schema); parquetWriteProtocol = new ParquetWriteProtocol( configuration, recordConsumer, columnIO, thriftStruct); thriftWriteSupport.prepareForWrite(recordConsumer); }
Source:
<code>private static void aliasedDiscoveryConfigsGenerator(XmlGenerator gen, List<AliasedDiscoveryConfig<?>> configs) { if (configs == null) { return; } for (AliasedDiscoveryConfig<?> c : configs) { gen.open(AliasedDiscoveryConfigUtils.tagFor(c), "enabled", c.isEnabled()); for (String key : c.getProperties().keySet()) { <START> gen.node(key, c.getProperties().get(key)); <END> } gen.close(); } }</code><technical_language>Do need handle AliasedDiscoveryConfig#isUsePublicIp well</technical_language>

Target:
private static void aliasedDiscoveryConfigsGenerator(XmlGenerator gen, List<AliasedDiscoveryConfig<?>> configs) { if (configs == null) { return; } for (AliasedDiscoveryConfig<?> c : configs) { gen.open(AliasedDiscoveryConfigUtils.tagFor(c), "enabled", c.isEnabled()); if (c.isUsePublicIp()) { gen.node("use-public-ip", "true"); } for (String key : c.getProperties().keySet()) { gen.node(key, c.getProperties().get(key)); } gen.close(); } }
Source:
<code>public void removeWorkspace(String workspaceId) throws ConflictException, ServerException { requireNonNull(workspaceId, "Required non-null workspace id"); if (runtimes.hasRuntime(workspaceId)) { throw new ConflictException("The workspace '" + workspaceId + "' is currently running and cannot be removed."); } <START> workspaceProjectStorageCleaner.remove(workspaceId); <END> workspaceDao.remove(workspaceId); eventService.publish(new WorkspaceRemovedEvent(workspaceId)); LOG.info("Workspace '{}' removed by user '{}'", workspaceId, sessionUserNameOr("undefined")); }</code><technical_language>If is clearer method name clear more natural for remove</technical_language>

Target:
public void removeWorkspace(String workspaceId) throws ConflictException, ServerException { requireNonNull(workspaceId, "Required non-null workspace id"); if (runtimes.hasRuntime(workspaceId)) { throw new ConflictException("The workspace '" + workspaceId + "' is currently running and cannot be removed."); } workspaceDao.remove(workspaceId); LOG.info("Workspace '{}' removed by user '{}'", workspaceId, sessionUserNameOr("undefined")); }
Source:
<code>public void installVerb(String engineId, String container, String verbId, Runnable doneCallback, Consumer<Exception> errorCallback) { final InteractiveScriptSession interactiveScriptSession = scriptInterpreter.createInteractiveSession(); interactiveScriptSession.eval( "include([\"engines\", \"" + engineId + "\", \"verbs\", \"" + verbId + "\"]);", ignored -> interactiveScriptSession.eval("new Verb()", output -> { final Verb verbObject = (Verb) output; <START> verbObject.install(container, ""); <END> doneCallback.run(); }, errorCallback), errorCallback); }</code><technical_language>if expect a version string in interface if it. more in favor of providing a "default" install method takes a container optional secondary install methods called JavaScript. secondary install methods called JavaScript, if methods called json object java interface instance. (Only methods defined in java interface accessible it)</technical_language>

Target:
public void installVerb(String engineId, String container, String verbId, Runnable doneCallback, Consumer<Exception> errorCallback) { final InteractiveScriptSession interactiveScriptSession = scriptInterpreter.createInteractiveSession(); interactiveScriptSession.eval( "include([\"engines\", \"" + engineId + "\", \"verbs\", \"" + verbId + "\"]);", ignored -> interactiveScriptSession.eval("new Verb()", output -> { final Verb verbObject = (Verb) output; verbObject.install(container); doneCallback.run(); }, errorCallback), errorCallback); }