auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>protected boolean validateForm() { final String host = _hostTextField.getText(); if (StringUtils.isNullOrEmpty(host)) { setStatusError("Please enter DataHub host name"); return false; } final String port = _portTextField.getText(); if (StringUtils.isNullOrEmpty(port)) { setStatusError("Please enter DataHub port number"); return false; } else { try { int portInt = Integer.parseInt(port); if (portInt <= 0) { setStatusError("Please enter a valid (positive port number)"); return false; } } catch (NumberFormatException e) { setStatusError("Please enter a valid port number"); return false; } } final String datastoreName = _datastoreNameTextField.getText(); if (StringUtils.isNullOrEmpty(datastoreName)) { setStatusError("Please enter a datastore name"); return false; } final String username = _usernameTextField.getText(); if (StringUtils.isNullOrEmpty(username)) { setStatusError("Please enter username"); return false; } if (_tenantName == null) { setStatusError("Please test the connection first"); <START> return false; <END> } setStatusValid(); return true; }</code><technical_language>I this prevents saving a datastore testing it? a bit annoying? if simply editing existing datastore temporarily access datahub? Testing datastore IMO postponed moment is connecting. I guess username/passwords change that, verifying this time is giving a false sense of verification</technical_language>

Target:
protected boolean validateForm() { final String host = _hostTextField.getText(); if (StringUtils.isNullOrEmpty(host)) { setStatusError("Please enter DataHub host name"); return false; } final String port = _portTextField.getText(); if (StringUtils.isNullOrEmpty(port)) { setStatusError("Please enter DataHub port number"); return false; } else { try { int portInt = Integer.parseInt(port); if (portInt <= 0) { setStatusError("Please enter a valid (positive port number)"); return false; } } catch (NumberFormatException e) { setStatusError("Please enter a valid port number"); return false; } } final String datastoreName = _datastoreNameTextField.getText(); if (StringUtils.isNullOrEmpty(datastoreName)) { setStatusError("Please enter a datastore name"); return false; } final String username = _usernameTextField.getText(); if (StringUtils.isNullOrEmpty(username)) { setStatusError("Please enter username"); return false; } final char[] password = _passwordTextField.getPassword(); if (password.length < 1) { setStatusError("Please enter password"); return false; } setStatusValid(); return true; }
Source:
<code><START> public int hashCode() { <END> return ((startCommit.hashCode() + numbers.length) * 31) + getNumber(); }</code><technical_language>Missing @Override</technical_language>

Target:
public int hashCode() { return commit.hashCode() ^ (number + 1); }
Source:
<code>private void awaitOnLatch(CountDownLatch countDownLatch) throws InterruptedException { int totalAwaitTime = 0; int backoff = INVALIDATION_BACKOFF_SECONDS; while (!countDownLatch.await(backoff, TimeUnit.SECONDS)) { totalAwaitTime += backoff; if (totalAwaitTime >= MAX_INVALIDATION_WAIT_SECONDS) { <START> throw new IllegalStateException("Server did not send an InvalidationDone message within " + totalAwaitTime + "s"); <END> } backoff += INVALIDATION_BACKOFF_SECONDS; if ((totalAwaitTime + backoff) > MAX_INVALIDATION_WAIT_SECONDS) { backoff = (totalAwaitTime + backoff) - MAX_INVALIDATION_WAIT_SECONDS; } LOGGER.debug("Waiting for the server's InvalidationDone message for {}s, backing off {}s...", totalAwaitTime, backoff); } if (!entity.isConnected()) { throw new IllegalStateException("Entity disconnected"); } }</code><technical_language>I want a max time here. In a slow moving system, hit limit. I waiting for 1 second, for 2 4 10 10. logging wake up. sense</technical_language>

Target:
private void awaitOnLatch(CountDownLatch countDownLatch) throws InterruptedException { int totalAwaitTime = 0; int backoff = 1; while (!countDownLatch.await(backoff, TimeUnit.SECONDS)) { totalAwaitTime += backoff; backoff = (backoff >= 10) ? 10 : backoff * 2; LOGGER.debug("Waiting for the server's InvalidationDone message for {}s, backing off {}s...", totalAwaitTime, backoff); } if (!entity.isConnected()) { throw new IllegalStateException("Entity disconnected"); } }
Source:
<code>public String serialize() { try { <START> return new ObjectMapper().writeValueAsString(this); <END> } catch (JsonProcessingException e) { throw logger.logExceptionAsError(new UncheckedIOException(e)); } }</code><technical_language>this ObjectMapper instance static. For this method a writer(), for deserialize case a reader(). mapper need configuration handle empty/null values</technical_language>

Target:
public String serialize() { try { return MAPPER.writer().writeValueAsString(this); } catch (JsonProcessingException e) { throw logger.logExceptionAsError(new UncheckedIOException(e)); } }
Source:
<code><START> public static @CheckForNull User get(String idOrFullName, boolean create, Map context) { <END> if(idOrFullName==null) return null; List<CanonicalIdResolver> resolvers = new ArrayList<CanonicalIdResolver>(ExtensionList.lookup(CanonicalIdResolver.class)); Collections.sort(resolvers); String id = null; for (CanonicalIdResolver resolver : resolvers) { id = resolver.resolveCanonicalId(idOrFullName, context); if (id != null) { LOGGER.log(Level.FINE, "{0} mapped {1} to {2}", new Object[] {resolver, idOrFullName, id}); break; } } if (id == null) { throw new IllegalStateException("The user id should be always non-null thanks to DefaultUserCanonicalIdResolver"); } return getOrCreate(id, idOrFullName, create); }</code><technical_language>@Nullable</technical_language>

Target:
public static @Nullable User get(String idOrFullName, boolean create, Map context) { if(idOrFullName==null) return null; List<CanonicalIdResolver> resolvers = new ArrayList<CanonicalIdResolver>(ExtensionList.lookup(CanonicalIdResolver.class)); Collections.sort(resolvers); String id = null; for (CanonicalIdResolver resolver : resolvers) { id = resolver.resolveCanonicalId(idOrFullName, context); if (id != null) { LOGGER.log(Level.FINE, "{0} mapped {1} to {2}", new Object[] {resolver, idOrFullName, id}); break; } } if (id == null) { throw new IllegalStateException("The user id should be always non-null thanks to DefaultUserCanonicalIdResolver"); } return getOrCreate(id, idOrFullName, create); }
Source:
<code>private void checkNullableAssertion(Tree issueLocation, Argument actual) { if (actual.isPrimitive()) { <START> reportIssue(issueLocation, MESSAGE); <END> } }</code><technical_language>try a more precise message, clear comparing a primitive null, sense</technical_language>

Target:
private void checkNullableAssertion(Tree issueLocation, Argument actual) { if (actual.isPrimitive()) { reportIssue(issueLocation, "Change the assertion arguments to not compare a primitive value with null."); } }
Source:
<code>public void testBuildStates() { final List<CramCompressionRecord> records = new ArrayList<>(); <START> final CramCompressionRecord record1 = createRecord(0, 0); <END> records.add(record1); final CompressionHeader header1 = new CompressionHeaderFactory().build(records, null, true); final Slice slice1 = Slice.buildSlice(records, header1); assertSliceState(slice1, 1, 0, 1, 3); final CramCompressionRecord record2 = createRecord(1, 1); records.add(record2); final CompressionHeader header2 = new CompressionHeaderFactory().build(records, null, true); final Slice slice2 = Slice.buildSlice(records, header2); assertSliceState(slice2, 2, Slice.MULTI_REFERENCE, Slice.NO_ALIGNMENT_START, Slice.NO_ALIGNMENT_SPAN); final CramCompressionRecord record3 = createRecord(2, 2); records.add(record3); final CompressionHeader header3 = new CompressionHeaderFactory().build(records, null, true); final Slice slice3 = Slice.buildSlice(records, header3); assertSliceState(slice3, 3, Slice.MULTI_REFERENCE, Slice.NO_ALIGNMENT_START, Slice.NO_ALIGNMENT_SPAN); final CramCompressionRecord unmapped = createRecord(3, SAMRecord.NO_ALIGNMENT_REFERENCE_INDEX); unmapped.alignmentStart = SAMRecord.NO_ALIGNMENT_START; unmapped.setSegmentUnmapped(true); records.add(unmapped); final CompressionHeader header4 = new CompressionHeaderFactory().build(records, null, true); final Slice slice4 = Slice.buildSlice(records, header4); assertSliceState(slice4, 4, Slice.MULTI_REFERENCE, Slice.NO_ALIGNMENT_START, Slice.NO_ALIGNMENT_SPAN); }</code><technical_language>this test a lot of duplicated code, is similar getSingleRefRecords/getMultiRefRecords is doing. is rewrite test a provide primitives</technical_language>

Target:
public void testBuildStates() { final List<CramCompressionRecord> records = new ArrayList<>(); final CramCompressionRecord record1 = createRecord(0, 0); records.add(record1); assertSliceStateFromRecords(records, 1, 0, 1, 3); final CramCompressionRecord record2 = createRecord(1, 1); records.add(record2); assertSliceStateFromRecords(records, 2, Slice.MULTI_REFERENCE, Slice.NO_ALIGNMENT_START, Slice.NO_ALIGNMENT_SPAN); final CramCompressionRecord record3 = createRecord(2, 2); records.add(record3); assertSliceStateFromRecords(records, 3, Slice.MULTI_REFERENCE, Slice.NO_ALIGNMENT_START, Slice.NO_ALIGNMENT_SPAN); final CramCompressionRecord unmapped = createRecord(3, SAMRecord.NO_ALIGNMENT_REFERENCE_INDEX); unmapped.alignmentStart = SAMRecord.NO_ALIGNMENT_START; unmapped.setSegmentUnmapped(true); records.add(unmapped); assertSliceStateFromRecords(records, 4, Slice.MULTI_REFERENCE, Slice.NO_ALIGNMENT_START, Slice.NO_ALIGNMENT_SPAN); }
Source:
<code>private void checkWhetherToDisplayUserProjectRegistrationWizard() { ProjectPreferenceSetting projectSetting = preferences .getOrCreateProjectSetting(workspaceName); if (!WatchDogUtils.isEmpty(preferences.getUserid()) || (projectSetting.startupQuestionAsked && !projectSetting.enableWatchdog)) return; UserRegistrationWizardDialogHandler newUserWizardHandler = new UserRegistrationWizardDialogHandler(); try { int statusCode = (int) newUserWizardHandler .execute(new ExecutionEvent()); savePreferenceStoreIfNeeded(); if (statusCode == Window.CANCEL) { <START> if (MessageDialog.openQuestion(null, "WatchDog not active!", <END> WATCHDOG_INACTIVE_WARNING)) { makeSilentRegistration(); } else { userProjectRegistrationCancelled = true; preferences.registerProjectUse( WatchDogUtils.getWorkspaceName(), false); } } } catch (ExecutionException exception) { WatchDogLogger.getInstance().logSevere(exception); } }</code><technical_language>extract call MessageDialog more apparent is here</technical_language>

Target:
private void checkWhetherToDisplayUserProjectRegistrationWizard() { ProjectPreferenceSetting projectSetting = preferences .getOrCreateProjectSetting(workspaceName); if (!WatchDogUtils.isEmpty(preferences.getUserid()) || (projectSetting.startupQuestionAsked && !projectSetting.enableWatchdog)) return; UserRegistrationWizardDialogHandler newUserWizardHandler = new UserRegistrationWizardDialogHandler(); try { int statusCode = (int) newUserWizardHandler .execute(new ExecutionEvent()); savePreferenceStoreIfNeeded(); if (statusCode == Window.CANCEL) { boolean shouldRegisterAnonymously = MessageDialog .openQuestion(null, "WatchDog not active!", WATCHDOG_INACTIVE_WARNING); if (shouldRegisterAnonymously) { makeSilentRegistration(); } else { userProjectRegistrationCancelled = true; preferences.registerProjectUse( WatchDogUtils.getWorkspaceName(), false); } } } catch (ExecutionException exception) { WatchDogLogger.getInstance().logSevere(exception); } }
Source:
<code>public Object toJson() { <START> JSONObject json = JsonObjectUtility.newOrderedJSONObject(); <END> json.put("pattern", getDecimalFormat().toPattern()); json.put("multiplier", getDecimalFormat().getMultiplier()); json.put("roundingMode", getDecimalFormat().getRoundingMode()); return json; }</code><technical_language>null-safe: if (m_decimalFormat == null) { return null; }</technical_language>

Target:
public Object toJson() { if (getDecimalFormat() == null) { return null; } JSONObject json = JsonObjectUtility.newOrderedJSONObject(); json.put("pattern", getDecimalFormat().toPattern()); json.put("multiplier", getDecimalFormat().getMultiplier()); json.put("roundingMode", getDecimalFormat().getRoundingMode().name()); return json; }
Source:
<code>public Map<String, BuilderEnvironment> getBuilderEnvironment(){ <START> return this.environmentMap; <END> }</code><technical_language>This wrapped Collections.unmodifiableMap(map) avoid unexpected modifications</technical_language>

Target:
public Map<String, BuilderEnvironment> getBuilderEnvironment(){ return Collections.unmodifiableMap(this.environmentMap); }
Source:
<code>public ObjectColumnSelector makeObjectColumnSelector( final DimensionSpec spec, final IncrementalIndexStorageAdapter.EntryHolder currEntry, final IncrementalIndex.DimensionDesc desc ) { final int dimIndex = desc.getIndex(); class IndexerObjectColumnSelector implements ObjectColumnSelector { @Override public Class classOfObject() { return Float.class; } @Override public Object get() { final Object[] dims = currEntry.getKey().getDims(); if (dimIndex >= dims.length) { <START> return 0.0f; <END> } return dims[dimIndex]; } } return new IndexerObjectColumnSelector(); }</code><technical_language>ZERO_FLOAT</technical_language>

Target:
public ObjectColumnSelector makeObjectColumnSelector( final DimensionSpec spec, final IncrementalIndexStorageAdapter.EntryHolder currEntry, final IncrementalIndex.DimensionDesc desc ) { final int dimIndex = desc.getIndex(); class IndexerObjectColumnSelector implements ObjectColumnSelector { @Override public Class classOfObject() { return Float.class; } @Override public Object get() { final Object[] dims = currEntry.getKey().getDims(); if (dimIndex >= dims.length) { return DimensionHandlerUtils.ZERO_FLOAT; } return dims[dimIndex]; } } return new IndexerObjectColumnSelector(); }
Source:
<code>public String getInstructorsDataAsString() { <START> return Sanitizer.sanitizeForHtml(Sanitizer.sanitizeListForCsv(instructorsData).toString()); <END> }</code><technical_language>Is list version of sanitizeForHtml()</technical_language>

Target:
public String getInstructorsDataAsString() { return Sanitizer.sanitizeForHtml(Sanitizer.sanitizeListForCsv(instructorsData)).toString(); }
Source:
<code>private static Map<SchemaTableName, ElasticsearchTableDescription> createTableDescriptions(Metadata metadata, Iterable<TpchTable<?>> tables) throws Exception { JsonCodec<ElasticsearchTableDescription> codec = new CodecSupplier<>(ElasticsearchTableDescription.class, metadata).get(); <START> URL metadataUrl = Resources.getResource(ElasticsearchQueryRunner.class, "/queryrunner"); <END> assertNotNull(metadataUrl, "metadataUrl is null"); URI metadataUri = metadataUrl.toURI(); ImmutableSet.Builder<String> tableNames = ImmutableSet.builder(); for (TpchTable<?> table : tables) { tableNames.add(TPCH_SCHEMA + "." + table.getTableName()); } return createElasticsearchTableDescriptions(new File(metadataUri), TPCH_SCHEMA, tableNames.build(), codec); }</code><technical_language>static import getResource</technical_language>

Target:
private static Map<SchemaTableName, ElasticsearchTableDescription> createTableDescriptions(Metadata metadata, Iterable<TpchTable<?>> tables) throws Exception { JsonCodec<ElasticsearchTableDescription> codec = new CodecSupplier<>(ElasticsearchTableDescription.class, metadata).get(); URL metadataUrl = getResource(ElasticsearchQueryRunner.class, "/queryrunner"); assertNotNull(metadataUrl, "metadataUrl is null"); URI metadataUri = metadataUrl.toURI(); ImmutableSet.Builder<String> tableNames = ImmutableSet.builder(); for (TpchTable<?> table : tables) { tableNames.add(TPCH_SCHEMA + "." + table.getTableName()); } return createElasticsearchTableDescriptions(new File(metadataUri), TPCH_SCHEMA, tableNames.build(), codec); }
Source:
<code>public void loadSettings(TuningContext context) { this.toteDistance = context.getFloat("Auto Mode Container Tote Tote Distance +A", 28.0f); this.autoZoneDistance = context.getFloat("Auto Mode Container Tote Auto Zone Distance +A", 60.0f); this.secondDistance = context.getFloat("Auto Mode Container Tote Second Distance +A", 24.0f); this.nudge = context.getFloat("Auto Mode Container Tote Nudge +A", 12.0f); this.containerTurnTime = context.getFloat("Auto Mode Container Tote Container Turn Time +A", 0.5f); this.autoZoneAngle = context.getFloat("Auto Mode Container Tote Auto Zone Angle +A", 90.0f); this.containerHeight = context.getFloat("Auto Mode Container Tote Container Height +A", 0.0f); this.autoZoneSpeed = context.getFloat("Auto Mode Container Tote Auto Zone Speed", 1.0f); <START> this.topClampHeight = context.getFloat("Auto Mode Single Tote Top Clamp Height", 0.75f); <END> }</code><technical_language>name this consistently rest of file</technical_language>

Target:
public void loadSettings(TuningContext context) { this.toteDistance = context.getFloat("Auto Mode Container Tote Tote Distance +A", 28.0f); this.autoZoneDistance = context.getFloat("Auto Mode Container Tote Auto Zone Distance +A", 60.0f); this.secondDistance = context.getFloat("Auto Mode Container Tote Second Distance +A", 24.0f); this.nudge = context.getFloat("Auto Mode Container Tote Nudge +A", 12.0f); this.containerTurnTime = context.getFloat("Auto Mode Container Tote Container Turn Time +A", 0.5f); this.autoZoneAngle = context.getFloat("Auto Mode Container Tote Auto Zone Angle +A", 90.0f); this.containerHeight = context.getFloat("Auto Mode Container Tote Container Height +A", 0.0f); this.autoZoneSpeed = context.getFloat("Auto Mode Container Tote Auto Zone Speed +A", 1.0f); this.topClampHeight = context.getFloat("Auto Mode Container Tote Top Clamp Height +A", 0.75f); }
Source:
<code>public void fireEvent(GwtEvent<?> event) { <START> getEventBus().fireEventFromSource(event, this); <END> }</code><technical_language>public void fireEvent(GwtEvent<?> event) a bit redundant now. Is a web bindery replacement for HasHandlers</technical_language>

Target:
public void fireEvent(GwtEvent<?> event) { fireEvent((Event<?>) event); }
Source:
<code>public synchronized Object getEntity() { abortIfClosed(); Object entity = super.getEntity(); if (entity != null) { return entity; } try { InputStream inputStream = getEntityStream(); <START> if(inputStream.available() == 0){ <END> throw new IllegalStateException(); } return inputStream; } catch (IOException e) { throw new IllegalStateException(e); } }</code><technical_language>Today I working stuff based this fix I spotted in some case inputStream.available() return 0 bytes read. I 'll investigate more is about</technical_language>

Target:
public synchronized Object getEntity() { abortIfClosed(); Object entity = super.getEntity(); if (entity != null) { return entity; } if (streamFullyRead && bufferedEntity == null) { throw new IllegalStateException(); } return getEntityStream(); }
Source:
<code>private static String toString(List<Channel> channels) { List<String> strings = new ArrayList<>(channels.size()); for (Channel channel : channels) { <START> strings.add(channel.getUID().toString() + '#' + channel.getAcceptedItemType() + '#' + channel.getTriggerType()); <END> } Collections.sort(strings); return Joiner.on(',').join(strings); }</code><technical_language>of result in "null" a string, do I miss something? If this is case, this nice</technical_language>

Target:
private static String toString(List<Channel> channels) { List<String> strings = new ArrayList<>(channels.size()); for (Channel channel : channels) { strings.add(channel.getUID().toString() + '#' + channel.getAcceptedItemType() + '#' + channel.getKind()); } Collections.sort(strings); return Joiner.on(',').join(strings); }
Source:
<code>public @ResponseBody ResponseEntity<String> retrieveMODS(@PathVariable("id") String id) throws IOException { PID pid = PIDs.get(id); AgentPrincipals agent = AgentPrincipals.createFromThread(); String modsString; try { modsString = modsService.retrieveMODS(agent, pid); if (modsString == null) { return new ResponseEntity<>(HttpStatus.NOT_FOUND); } } catch (Exception e) { if (e instanceof AuthorizationException || e instanceof AccessRestrictionException) { log.warn("User does not have permission to view metadata for {}", agent.getUsername(), pid); return new ResponseEntity<>(HttpStatus.FORBIDDEN); } else { <START> log.error("Failed to retrieve MODS for object with pid " + pid, e); <END> return new ResponseEntity<>(HttpStatus.INTERNAL_SERVER_ERROR); } } return new ResponseEntity<String>(modsString, HttpStatus.OK); }</code><technical_language>{} for variable interpolation</technical_language>

Target:
public @ResponseBody ResponseEntity<String> retrieveMODS(@PathVariable("id") String id) throws IOException { PID pid = PIDs.get(id); AgentPrincipals agent = AgentPrincipals.createFromThread(); String modsString; try { modsString = modsService.retrieveMODS(agent, pid); if (modsString == null) { return new ResponseEntity<>(HttpStatus.NOT_FOUND); } } catch (Exception e) { if (e instanceof AuthorizationException || e instanceof AccessRestrictionException) { log.warn("User does not have permission to view metadata for {}", agent.getUsername(), pid); return new ResponseEntity<>(HttpStatus.FORBIDDEN); } else if (e instanceof NotFoundException) { log.warn("There is no object with pid {}", pid); return new ResponseEntity<>(HttpStatus.NOT_FOUND); } else { log.error("Failed to retrieve MODS for object with pid {}", pid, e); return new ResponseEntity<>(HttpStatus.INTERNAL_SERVER_ERROR); } } return new ResponseEntity<String>(modsString, HttpStatus.OK); }
Source:
<code>protected Image getImage(Template template) { <START> return Activator.getDefault().getImageRegistry().get("swagger_16"); <END> }</code><technical_language>extract "swagger_16" a constant</technical_language>

Target:
protected Image getImage(Template template) { return Activator.getDefault().getImage(Icons.template_item); }
Source:
<code>protected void onBind() { super.onBind(); registerHandler(getView().getBookmarkButton().addClickHandler(event -> { BookmarkListModel bookmarkListModel = bookmarkModelProvider.getModel(); bookmarkListModel.setSearchString(getView().getSearchString()); bookmarkListModel.getNewCommand().execute(); })); registerHandler(getView().getClearButton().addClickHandler(event -> { model.setSearchString(""); updateViewSearchString(); updateModelSearchString(); })); registerHandler(getView().getSearchButton().addClickHandler(event -> updateModelSearchString())); registerHandler(getView().getSearchInputHandlers().addKeyDownHandler(event -> { if (event.getNativeKeyCode() == KeyCodes.KEY_ENTER) { updateModelSearchString(); } else if (event.getNativeKeyCode() == KeyCodes.KEY_ESCAPE) { getView().hideSuggestionBox(); } })); BookmarkListModel bookmarkListModel = bookmarkModelProvider.getModel(); <START> bookmarkListModel.getItemsChangedEvent().addListener((ev, sender, args) -> { <END> bookmarkItemsChanged(); }); if (bookmarkListModel.getItems() == null) { bookmarkListModel.search(); } bookmarkItemsChanged(); }</code><technical_language>one-liner style</technical_language>

Target:
protected void onBind() { super.onBind(); registerHandler(getView().getBookmarkButton().addClickHandler(event -> { BookmarkListModel bookmarkListModel = bookmarkModelProvider.getModel(); bookmarkListModel.setSearchString(getView().getSearchString()); bookmarkListModel.getNewCommand().execute(); })); registerHandler(getView().getClearButton().addClickHandler(event -> { model.setSearchString(""); updateViewSearchString(); updateModelSearchString(); })); registerHandler(getView().getSearchButton().addClickHandler(event -> updateModelSearchString())); registerHandler(getView().getSearchInputHandlers().addKeyDownHandler(event -> { if (event.getNativeKeyCode() == KeyCodes.KEY_ENTER) { updateModelSearchString(); } else if (event.getNativeKeyCode() == KeyCodes.KEY_ESCAPE) { getView().hideSuggestionBox(); } })); BookmarkListModel bookmarkListModel = bookmarkModelProvider.getModel(); bookmarkListModel.getItemsChangedEvent().addListener((ev, sender, args) -> bookmarkItemsChanged()); if (bookmarkListModel.getItems() == null) { bookmarkListModel.search(); } bookmarkItemsChanged(); }
Source:
<code>protected void executeCommand() { switch (getDisk().getDiskStorageType()) { case IMAGE: <START> if (getDisk().getDiskStorageType() == DiskStorageType.IMAGE) { <END> Future<VdcReturnValueBase> future = CommandCoordinatorUtil.executeAsyncCommand( VdcActionType.RemoveImage, buildRemoveImageParameters(getDiskImage()), cloneContextAndDetachFromParent()); try { VdcReturnValueBase vdcReturnValue = future.get(); if (vdcReturnValue.getSucceeded()) { incrementVmsGeneration(); setSucceeded(true); } } catch (Exception ex) { log.error("Exception raised during executeAsyncCommand", ex); } } break; case LUN: removeLunDisk(); break; case CINDER: Future<VdcReturnValueBase> future = CommandCoordinatorUtil.executeAsyncCommand( VdcActionType.RemoveCinderDisk, new RemoveDiskParameters(getParameters().getDiskId()), cloneContextAndDetachFromParent()); try { setReturnValue(future.get()); setSucceeded(getReturnValue().getSucceeded()); } catch (InterruptedException | ExecutionException e) { log.error("Error removing Cinder disk '{}': {}", getDiskImage().getDiskAlias(), e.getMessage()); log.debug("Exception", e); } break; } }</code><technical_language>this check is redundant - this code is executed 'IMAGE' case of switch statement</technical_language>

Target:
protected void executeCommand() { switch (getDisk().getDiskStorageType()) { case IMAGE: Future<VdcReturnValueBase> removeImageFuture = CommandCoordinatorUtil.executeAsyncCommand( VdcActionType.RemoveImage, buildRemoveImageParameters(getDiskImage()), cloneContextAndDetachFromParent()); try { VdcReturnValueBase vdcReturnValue = removeImageFuture.get(); if (vdcReturnValue.getSucceeded()) { incrementVmsGeneration(); setSucceeded(true); } } catch (Exception ex) { log.error("Exception raised during executeAsyncCommand", ex); } break; case LUN: removeLunDisk(); break; case CINDER: Future<VdcReturnValueBase> future = CommandCoordinatorUtil.executeAsyncCommand( VdcActionType.RemoveCinderDisk, new RemoveDiskParameters(getParameters().getDiskId()), cloneContextAndDetachFromParent()); try { setReturnValue(future.get()); setSucceeded(getReturnValue().getSucceeded()); } catch (InterruptedException | ExecutionException e) { log.error("Error removing Cinder disk '{}': {}", getDiskImage().getDiskAlias(), e.getMessage()); log.debug("Exception", e); } break; } }
Source:
<code>public void testApplication() throws IOException, Exception { try { LocalMode lma = LocalMode.newInstance(); Configuration conf = new Configuration(false); conf.addResource(this.getClass().getResourceAsStream("/META-INF/properties.xml")); lma.prepareDAG(new Application(), conf); LocalMode.Controller lc = lma.getController(); lc.run(10 * 1000); } catch (ConstraintViolationException e) { Assert.fail("constraint violations: " + e.getConstraintViolations()); } <START> } <END></code><technical_language>Please rewrite test check results done in other examples. Also, sample data CustomerTxnData file is large; size reduced</technical_language>

Target:
public void testApplication() throws IOException, Exception { try { LocalMode lma = LocalMode.newInstance(); Configuration conf = new Configuration(false); conf.addResource(this.getClass().getResourceAsStream("/META-INF/properties.xml")); conf.set("dt.application.RecordReaderExample.operator.fileOutput.prop.filePath", outputDir); File outputfile = FileUtils.getFile(outputDir, "output.txt_5.0"); lma.prepareDAG(new Application(), conf); LocalMode.Controller lc = lma.getController(); lc.runAsync(); while (!outputfile.exists()) { System.out.println("Sleeping ...."); Thread.sleep(1000); } lc.shutdown(); Assert.assertTrue( FileUtils.contentEquals( FileUtils.getFile( conf.get("dt.application.RecordReaderExample.operator.recordReader.prop.files") ),outputfile)); } catch (ConstraintViolationException e) { Assert.fail("constraint violations: " + e.getConstraintViolations()); } }
Source:
<code>public RealmStreamTask<DocumentT> watch(){ return new RealmStreamTaskImpl<>(new RealmStreamTaskImpl.Executor() { @Nullable @Override public OsJavaNetworkTransport.Response sendRequest() throws IOException { <START> BsonArray args = new BsonArray(); <END> BsonDocument arguments = new BsonDocument("database", new BsonString(nameSpace.getDatabaseName())); arguments.put("collection", new BsonString(nameSpace.getCollectionName())); args.add(arguments); OsJavaNetworkTransport.Request request = streamNetworkTransport.makeStreamingRequest("watch", args, osMongoCollection.getServiceName()); return streamNetworkTransport.sendRequest(request); } }, getCodecRegistry(), getDocumentClass()); }</code><technical_language>This logic encapsulated in OsMongoCollection. this: public OsJavaNetworkTransport.Response sendRequest() throws IOException { return osMongoCollection.watch(...) } do request heavy lifting there, means move streamNetworkTransport field OsMongoCollection too. This applies other watch methods</technical_language>

Target:
public RealmEventStreamTask<DocumentT> watch() { return new RealmEventStreamTaskImpl<>(getNamespace().getFullName(), new RealmEventStreamTaskImpl.Executor<DocumentT>() { @Override public EventStream<DocumentT> run() throws IOException { return osMongoCollection.watch(); } }); }
Source:
<code>public boolean archiveRepository(final Project.NameKey name) throws RepositoryNotFoundException { if (isUnreasonableName(name)) { throw new RepositoryNotFoundException("Invalid name: " + name); } File dir = FileKey.resolve(gitDirOf(name), FS.DETECTED); if (dir != null) { String timeStamp = new SimpleDateFormat("yyyyMMddHHmm").format(new Date()); File dest = new File(archivePath.getAbsolutePath() + File.separator + timeStamp <START> + "-" + dir.getName()); <END> return dir.renameTo(dest); } else { throw new RepositoryNotFoundException("Cannot find the repository " + name); } }</code><technical_language>dir.getName() returns segment of path, project names hierarchical (e.g. a/b/foo) I this is enough. include full (encoded) project name file name</technical_language>

Target:
public boolean archiveRepository(final Project.NameKey name) throws RepositoryNotFoundException { if (isUnreasonableName(name)) { throw new RepositoryNotFoundException("Invalid name: " + name); } File dir = FileKey.resolve(gitDirOf(name), FS.DETECTED); if (dir != null) { String today = new SimpleDateFormat("yyyyMMdd").format(new Date()); File moveTo = new File(archivePath.getAbsolutePath() + File.separator + today); moveTo.mkdir(); int lastSlash = name.get().lastIndexOf('/'); if (lastSlash > 0) { String parentDirs = name.get().substring(0, lastSlash); moveTo = new File(moveTo, parentDirs); moveTo.mkdirs(); } String timeStamp = new SimpleDateFormat("HHmmss").format(new Date()); File dest = new File(moveTo, timeStamp + "-" + dir.getName()); return dir.renameTo(dest); } else { throw new RepositoryNotFoundException("Cannot find the repository " + name); } }
Source:
<code>public void updateEntity() { if (Game.isNotHost(getWorld())) return; boolean wasLocked = locked == 0; boolean springState = sprung == 0; List<UUID> lockcarts = getCartsAtLockEntrance(); for (UUID cartUUID : lockcarts) { if (springingCarts.contains(cartUUID)) springingCarts.remove(cartUUID); lockingCarts.add(cartUUID); } List<UUID> springcarts = getCartsAtSpringEntrance(); for (UUID cartUUID : springcarts) { if (lockingCarts.contains(cartUUID)) lockingCarts.remove(cartUUID); springingCarts.add(cartUUID); } List<UUID> cartsOnTrack = CartUtils.getMinecartUUIDsAt( getWorld(), tileEntity.xCoord, tileEntity.yCoord, tileEntity.zCoord, 0.3f); for (UUID cartOnTrack : cartsOnTrack) { if (springingCarts.contains(cartOnTrack)) { sprung = SPRING_DURATION; locked = 0; break; } else if (lockingCarts.contains(cartOnTrack)) { locked = SPRING_DURATION; sprung = 0; break; } } if (locked > 0) locked--; if (sprung > 0) <START> sprung--; <END> if (locked == 0 && sprung == 0) { lockingCarts.clear(); springingCarts.clear(); } if (springState != (sprung == 0) || wasLocked != (locked == 0)) sendUpdateToClient(); }</code><technical_language>Technically, counter decrements cart searches, else shortening duration a tick</technical_language>

Target:
public void updateEntity() { if (Game.isNotHost(getWorld())) return; boolean wasLocked = locked == 0; boolean springState = sprung == 0; if (locked > 0) locked--; if (sprung > 0) sprung--; if (locked == 0 && sprung == 0) { lockingCarts.clear(); springingCarts.clear(); decidingCarts.clear(); currentCart = null; } updateSet(lockingCarts, getCartsAtLockEntrance(), springingCarts, decidingCarts); updateSet(springingCarts, getCartsAtSpringEntrance(), lockingCarts, decidingCarts); updateSet(decidingCarts, getCartsAtDecisionEntrance(), lockingCarts, springingCarts); List<UUID> cartsOnTrack = CartUtils.getMinecartUUIDsAt( getWorld(), tileEntity.xCoord, tileEntity.yCoord, tileEntity.zCoord, 0.3f); for (UUID cartOnTrack : cartsOnTrack) { if(isSwitched(LinkageManager.instance().getCartFromUUID(cartOnTrack))) { springTrack(cartOnTrack); break; } else { lockTrack(cartOnTrack); break; } } if (springState != (sprung == 0) || wasLocked != (locked == 0)) sendUpdateToClient(); }
Source:
<code>public void onProjectDeleted(Event event) { Project.NameKey <START> p = <END> new NameKey(event.getProjectName()); repoSizeCache.evict(p); }</code><technical_language>optional: inlined in next line</technical_language>

Target:
public void onProjectDeleted(Event event) { repoSizeCache.evict(new Project.NameKey(event.getProjectName())); }
Source:
<code>protected InputStream execCommand(final String command, InputStream forStdIn, ChannelInputStreams channelInputStream, Session session) throws OpenShiftSSHOperationException { assertLiveSSHSession(); ChannelExec channel = null; try { channel = (ChannelExec) session.openChannel(JSCH_EXEC_CHANNEL); ((ChannelExec) channel).setCommand(command); final OutputStream remoteStdIn = channel.getOutputStream(); InputStream in = channel.getInputStream(); ChannelResponse channelResponse = new ChannelResponse(in, channel); channel.connect(CONNECT_TIMEOUT); if (forStdIn != null) { writeToRemoteStdInput(forStdIn, remoteStdIn); } return channelResponse; } catch (JSchException e) { if (channel != null && channel.isConnected()) { channel.disconnect(); } throw new OpenShiftSSHOperationException(e, "Could no execute remote ssh command \"{0}\" on application {1}", command, application.getName()); } catch (IOException e) { <START> if (channel.isConnected()) { <END> channel.disconnect(); } throw new OpenShiftSSHOperationException(e, "Could not get response channel for remote ssh command \"{0}\" on application {1}", command, application.getName()); } }</code><technical_language>remove null-check</technical_language>

Target:
protected InputStream execCommand(final String command, InputStream forStdIn, ChannelInputStreams channelInputStream, Session session) throws OpenShiftSSHOperationException { assertLiveSSHSession(); ChannelExec channel = null; try { channel = (ChannelExec) session.openChannel(JSCH_EXEC_CHANNEL); ((ChannelExec) channel).setCommand(command); final OutputStream remoteStdIn = channel.getOutputStream(); InputStream in = channel.getInputStream(); ChannelResponse channelResponse = new ChannelResponse(in, channel); channel.connect(CONNECT_TIMEOUT); if (forStdIn != null) { writeToRemoteStdInput(forStdIn, remoteStdIn); } return channelResponse; } catch (JSchException e) { if (channel != null && channel.isConnected()) { channel.disconnect(); } throw new OpenShiftSSHOperationException(e, "Could no execute remote ssh command \"{0}\" on application {1}", command, application.getName()); } catch (IOException e) { if (channel != null && channel.isConnected()) { channel.disconnect(); } throw new OpenShiftSSHOperationException(e, "Could not get response channel for remote ssh command \"{0}\" on application {1}", command, application.getName()); } }
Source:
<code>public Set<Subproject> getByProjectId(Long projectId) throws IOException { Project project = projectStore.get(projectId); if (!authorizationManager.readCheck(project)) { <START> return Sets.newHashSet(); <END> } return Sets.newHashSet(subprojectDao.getByProjectId(projectId)); }</code><technical_language>throw if user read access able ask for this set if project access</technical_language>

Target:
public Set<Subproject> getByProjectId(Long projectId) throws IOException { Project project = projectStore.get(projectId); authorizationManager.throwIfNotReadable(project); return Sets.newHashSet(subprojectDao.getByProjectId(projectId)); }
Source:
<code>public void onCreate(@Nullable Bundle savedInstanceState) { super.onCreate(savedInstanceState); getWindow().clearFlags(WindowManager.LayoutParams.FLAG_TRANSLUCENT_STATUS); getWindow().setStatusBarColor(Color.TRANSPARENT); <START> getWindow().setNavigationBarColor(0); <END> }</code><technical_language>Fixed done</technical_language>

Target:
public void onCreate(@Nullable Bundle savedInstanceState) { super.onCreate(savedInstanceState); getWindow().clearFlags(WindowManager.LayoutParams.FLAG_TRANSLUCENT_STATUS); getWindow().setStatusBarColor(Color.TRANSPARENT); }
Source:
<code><START> public String getUuid() { <END> return UUID.randomUUID().toString(); }</code><technical_language>this method is useless. send a patch remove code needs uuid simply UUID class</technical_language>

Target:
public static String getUuid() { return UUID.randomUUID().toString(); }
Source:
<code>private <E extends Element, S extends DocumentSchema<E>> Iterator<E> search(SearchQuery<E> query, Map<S, Search> schemas) { <START> Optional<MutableMetrics> metrics = query.getStepDescriptor().getMetrics(); <END> MutableMetrics controllerMetric = new MutableMetrics(query.getStepDescriptor().getId() + this.toString(), this.toString()); metrics.ifPresent(metric -> metric.addNested(controllerMetric)); controllerMetric.start(); List<MutableMetrics> childMetrics = schemas.keySet().stream().map((schema) -> new MutableMetrics(query.getStepDescriptor().getId(), schema.toString())).collect(Collectors.toList()); childMetrics.forEach(controllerMetric::addNested); if(schemas.size() == 0) return EmptyIterator.instance(); logger.debug("Preparing search. Schemas: {}", schemas); client.refresh(); MultiSearch multiSearch = new MultiSearch.Builder(schemas.values()).build(); MultiSearchResult results = client.execute(multiSearch); List<MultiSearchResult.MultiSearchResponse> responses = results.getResponses(); for (int i = 0; i < responses.size(); i++) { MutableMetrics child = childMetrics.get(i); MultiSearchResult.MultiSearchResponse response = responses.get(i); child.setCount(TraversalMetrics.ELEMENT_COUNT_ID, response.searchResult.getTotal()); child.setDuration(Long.parseLong(response.searchResult.getJsonObject().get("took").toString()), TimeUnit.MILLISECONDS ); } if(results == null || !results.isSucceeded()) return EmptyIterator.instance(); Iterator<S> schemaIterator = schemas.keySet().iterator(); controllerMetric.stop(); controllerMetric.setCount(TraversalMetrics.ELEMENT_COUNT_ID, controllerMetric.getNested().stream() .mapToLong(n -> n.getCount(TraversalMetrics.ELEMENT_COUNT_ID)).sum()); return responses.stream().filter(this::valid).flatMap(result -> schemaIterator.next().parseResults(result.searchResult.getJsonString(), query).stream()).iterator(); }</code><technical_language>please this new code out some helper class/method. I search code metrics code :)</technical_language>

Target:
private <E extends Element, S extends DocumentSchema<E>> Iterator<E> search(SearchQuery<E> query, Map<S, Search> schemas) { MetricsRunner metrics = new MetricsRunner(this, query, schemas.keySet().stream().map(s-> ((ElementSchema) s)).collect(Collectors.toList())); if(schemas.size() == 0) return EmptyIterator.instance(); logger.debug("Preparing search. Schemas: {}", schemas); client.refresh(); MultiSearch multiSearch = new MultiSearch.Builder(schemas.values()).build(); MultiSearchResult results = client.execute(multiSearch); List<MultiSearchResult.MultiSearchResponse> responses = results.getResponses(); metrics.stop((children) -> fillChildren(children, responses)); if(results == null || !results.isSucceeded()) return EmptyIterator.instance(); Iterator<S> schemaIterator = schemas.keySet().iterator(); return responses.stream().filter(this::valid).flatMap(result -> schemaIterator.next().parseResults(result.searchResult.getJsonString(), query).stream()).iterator(); }
Source:
<code>public void expireKeys(String depositUUID, int seconds) { try (Jedis jedis = getJedisPool().getResource()) { <START> jedis.expire(DEPOSIT_STATUS_PREFIX + depositUUID, seconds); <END> } }</code><technical_language>This is a minor new feature, willing expire key set addManifest method? I get removed present</technical_language>

Target:
public void expireKeys(String depositUUID, int seconds) { try (Jedis jedis = getJedisPool().getResource()) { jedis.expire(DEPOSIT_STATUS_PREFIX + depositUUID, seconds); jedis.expire(DEPOSIT_MANIFEST_PREFIX + depositUUID, seconds); } }
Source:
<code>public RelNode accept(RexShuttle shuttle) { List<RexNode> exps = shuttle.apply(this.exps); if (this.exps == exps) { return this; } final RelDataType rowType = RexUtil.createStructType( getInput().getCluster().getTypeFactory(), exps, this.rowType.getFieldNames(), <START> SqlValidatorUtil.F_SUGGESTER); <END> return copy(traitSet, getInput(), exps, rowType); }</code><technical_language>Good catch, +1</technical_language>

Target:
public RelNode accept(RexShuttle shuttle) { List<RexNode> exps = shuttle.apply(this.exps); if (this.exps == exps) { return this; } final RelDataType rowType = RexUtil.createStructType( getInput().getCluster().getTypeFactory(), exps, this.rowType.getFieldNames(), null); return copy(traitSet, getInput(), exps, rowType); }
Source:
<code>private static List<TimeGraphState> getCurrentThreads(@NonNull ITmfStateSystem ss, ITmfStateInterval userModeInterval, @NonNull NavigableSet<ITmfStateInterval> currentThreadIntervals) throws StateSystemDisposedException { List<TimeGraphState> list = new ArrayList<>(); for (ITmfStateInterval currentThread : currentThreadIntervals) { if (currentThread.getStartTime() <= userModeInterval.getEndTime() && currentThread.getEndTime() >= userModeInterval.getStartTime()) { long start = Long.max(userModeInterval.getStartTime(), currentThread.getStartTime()); long end = Long.min(userModeInterval.getEndTime(), currentThread.getEndTime()); long duration = end - start + 1; Object tid = currentThread.getValue(); if (tid instanceof Integer) { int execNameQuark = ss.optQuarkAbsolute(Attributes.THREADS, String.valueOf(tid), Attributes.EXEC_NAME); if (execNameQuark != ITmfStateSystem.INVALID_ATTRIBUTE) { Object currentThreadName = ss.querySingleState(currentThread.getEndTime(), execNameQuark).getValue(); if (currentThreadName instanceof String) { <START> list.add(new TimeGraphState(start, duration, StateValues.CPU_STATUS_RUN_USERMODE, Messages.Usermode)); <END> continue; } } } list.add(new TimeGraphState(start, duration, StateValues.CPU_STATUS_RUN_USERMODE)); } } return list; }</code><technical_language>Do want usermode written green state? empty green? Asking..</technical_language>

Target:
private static List<TimeGraphState> getCurrentThreads(@NonNull ITmfStateSystem ss, ITmfStateInterval userModeInterval, @NonNull NavigableSet<ITmfStateInterval> currentThreadIntervals) throws StateSystemDisposedException { List<TimeGraphState> list = new ArrayList<>(); for (ITmfStateInterval currentThread : currentThreadIntervals) { if (currentThread.getStartTime() <= userModeInterval.getEndTime() && currentThread.getEndTime() >= userModeInterval.getStartTime()) { long start = Long.max(userModeInterval.getStartTime(), currentThread.getStartTime()); long end = Long.min(userModeInterval.getEndTime(), currentThread.getEndTime()); long duration = end - start + 1; Object tid = currentThread.getValue(); if (tid instanceof Integer) { int execNameQuark = ss.optQuarkAbsolute(Attributes.THREADS, String.valueOf(tid), Attributes.EXEC_NAME); if (execNameQuark != ITmfStateSystem.INVALID_ATTRIBUTE) { Object currentThreadName = ss.querySingleState(currentThread.getEndTime(), execNameQuark).getValue(); if (currentThreadName instanceof String) { list.add(new TimeGraphState(start, duration, StateValues.CPU_STATUS_RUN_USERMODE, Messages.ThreadStatusUsermode)); continue; } } } list.add(new TimeGraphState(start, duration, StateValues.CPU_STATUS_RUN_USERMODE)); } } return list; }
Source:
<code>public void onReceive(Context context, Intent intent) { <START> TwitterSession session = Twitter.getSessionManager().getActiveSession(); <END> EchoAuth echoAuth = new EchoAuth(session); HandlerAPIConnect.requestToken(echoAuth.getAuthHeaders(),context); }</code><technical_language>Do need check if Twitter Session is null</technical_language>

Target:
public void onReceive(Context context, Intent intent) { TwitterSession session = Twitter.getSessionManager().getActiveSession(); if (session!=null) { EchoAuth echoAuth = new EchoAuth(session); HandlerAPIConnect.requestToken(echoAuth.getAuthHeaders(), context); } }
Source:
<code>public void testStash() { try { git.stashCreate().call(); readFile("Stash Created", git.getRepository().getWorkTree() + "/File1.txt"); git.stashList().call(); git.stashApply().call(); readFile("Stash Created", git.getRepository().getWorkTree() + "/File1.txt"); <START> } catch (Exception e) { <END> e.printStackTrace(); } }</code><technical_language>catch exceptions in test code want do use. declare this method throws Exception</technical_language>

Target:
public void testStash() throws Exception { git.stashCreate().call(); readFile("Stash Created", git.getRepository().getWorkTree() + "/File1.txt"); git.stashList().call(); git.stashApply().call(); readFile("Stash Created", git.getRepository().getWorkTree() + "/File1.txt"); }
Source:
<code>public void testImport() { System.out.println(null instanceof Definitions); DMNRuntime runtime = DMNRuntimeUtil.createRuntimeWithAdditionalResources("Importing_Model.dmn", this.getClass(), "Imported_Model.dmn"); DMNModel importedModel = runtime.getModel("<LINK_0>", "Imported Model"); assertThat(importedModel, notNullValue()); for (DMNMessage message : importedModel.getMessages()) { System.out.println(message); } DMNModel dmnModel = runtime.getModel("<LINK_1>", "Importing Model"); assertThat(dmnModel, notNullValue()); for (DMNMessage message : dmnModel.getMessages()) { System.out.println(message); } DMNContext context = runtime.newContext(); context.set("A Person", mapOf(entry("name", "John"), entry("age", 47))); DMNResult evaluateAll = runtime.evaluateAll(dmnModel, context); for (DMNMessage message : evaluateAll.getMessages()) { <START> System.out.println(message); <END> } System.out.println(evaluateAll); assertThat(evaluateAll.getDecisionResultByName("Greeting").getResult(), is("Hello John!")); }</code><technical_language>leftover debugging. Please asserts logger instead if this is needed here</technical_language>

Target:
public void testImport() { System.out.println(null instanceof Definitions); DMNRuntime runtime = DMNRuntimeUtil.createRuntimeWithAdditionalResources("Importing_Model.dmn", this.getClass(), "Imported_Model.dmn"); DMNModel importedModel = runtime.getModel("<LINK_0>", "Imported Model"); assertThat(importedModel, notNullValue()); for (DMNMessage message : importedModel.getMessages()) { LOG.debug("{}", message); } DMNModel dmnModel = runtime.getModel("<LINK_1>", "Importing Model"); assertThat(dmnModel, notNullValue()); for (DMNMessage message : dmnModel.getMessages()) { LOG.debug("{}", message); } DMNContext context = runtime.newContext(); context.set("A Person", mapOf(entry("name", "John"), entry("age", 47))); DMNResult evaluateAll = runtime.evaluateAll(dmnModel, context); for (DMNMessage message : evaluateAll.getMessages()) { LOG.debug("{}", message); } LOG.debug("{}", evaluateAll); assertThat(evaluateAll.getDecisionResultByName("Greeting").getResult(), is("Hello John!")); }