auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public List<String> formatRow(Object object) { ArgumentFormatter formatter; List<Object> allFieldValues = ReflectionUtil.getAllFieldValues(object, fields, ""); List<String> res = Lists.newArrayList(); for (int i = 0; i < allFieldValues.size(); i++) { Object v = allFieldValues.get(i); Field field = fields.get(i); Format format = formatsByFieldName.get(field.getName()); if (v != null) { nonNullColumns[i] = true; } if (format == null) { formatter = DefaultFormatter.INSTANCE; res.add(formatter.format(v)); } else { Class<? extends ArgumentFormatter<?>> clazz = format.value(); formatter = ReflectionUtil.newInstance(clazz); res.add(formatter.format(v, format.args())); } } return res; }

Target:
public List<String> formatRow( Object object ) { List<Object> allFieldValues = ReflectionUtil.getAllFieldValues( object, fields, "" ); List<String> res = Lists.newArrayList(); for( int i = 0; i < allFieldValues.size(); i++ ) { Object v = allFieldValues.get( i ); Field field = fields.get( i ); if( v != null ) { nonNullColumns[i] = true; } @SuppressWarnings( "rawtypes" ) ObjectFormatter formatter = formattersByFieldName.get( field.getName() ); if( formatter != null ) { res.add( formatter.format( v ) ); } else { formatter = DefaultFormatter.INSTANCE; res.add( formatter.format( v ) ); } } return res; }
Source:
static List<MessageInfo> deserializeMessageInfoList(DataInputStream stream, ClusterMap map, short versionToDeserializeIn) throws IOException { int messageInfoListCount = stream.readInt(); ArrayList<MessageInfo> messageListInfo = new ArrayList<MessageInfo>(messageInfoListCount); for (int i = 0; i < messageInfoListCount; i++) { BlobId id = new BlobId(stream, map); long size = stream.readLong(); long ttl = stream.readLong(); boolean isDeleted = stream.readByte() == DELETED; Long crc = null; switch (versionToDeserializeIn) { case VERSION_1: messageListInfo.add(new MessageInfo(id, size, isDeleted, ttl, crc)); break; case VERSION_2: crc = stream.readByte() == CRC_PRESENT ? stream.readLong() : null; messageListInfo.add(new MessageInfo(id, size, isDeleted, ttl, crc)); break; case VERSION_3: crc = stream.readByte() == CRC_PRESENT ? stream.readLong() : null; short accountId = stream.readShort(); short containerId = stream.readShort(); long operationTime = stream.readLong(); messageListInfo.add(new MessageInfo(id, size, isDeleted, ttl, crc, accountId, containerId, operationTime)); break; default: throw new IllegalArgumentException( "Unknown version to deserialize MessageInfoList " + versionToDeserializeIn); } } return messageListInfo; }

Target:
static List<MessageInfo> deserializeMessageInfoList(DataInputStream stream, ClusterMap map, short versionToDeserializeIn) throws IOException { int messageInfoListCount = stream.readInt(); ArrayList<MessageInfo> messageInfoList = new ArrayList<MessageInfo>(messageInfoListCount); for (int i = 0; i < messageInfoListCount; i++) { BlobId id = new BlobId(stream, map); long size = stream.readLong(); long ttl = stream.readLong(); boolean isDeleted = stream.readByte() == DELETED; Long crc = null; switch (versionToDeserializeIn) { case VERSION_1: messageInfoList.add(new MessageInfo(id, size, isDeleted, ttl, crc)); break; case VERSION_2: crc = stream.readByte() == CRC_PRESENT ? stream.readLong() : null; messageInfoList.add(new MessageInfo(id, size, isDeleted, ttl, crc)); break; case VERSION_3: crc = stream.readByte() == CRC_PRESENT ? stream.readLong() : null; short accountId = stream.readShort(); short containerId = stream.readShort(); long operationTime = stream.readLong(); messageInfoList.add(new MessageInfo(id, size, isDeleted, ttl, crc, accountId, containerId, operationTime)); break; default: throw new IllegalArgumentException( "Unknown version to deserialize MessageInfoList " + versionToDeserializeIn); } } return messageInfoList; }
Source:
protected Deserializer<T> locate() { if (isAvailable("io.jsonwebtoken.io.JacksonDeserializer")) { return Classes.newInstance("io.jsonwebtoken.io.JacksonDeserializer"); } else if (isAvailable("io.jsonwebtoken.io.OrgJsonDeserializer")) { return Classes.newInstance("io.jsonwebtoken.io.OrgJsonDeserializer"); } else if (isAvailable("com.google.gson.GsonBuilder")) { return Classes.newInstance("io.jsonwebtoken.io.GsonDeSerializer"); } else { throw new IllegalStateException("Unable to discover any JSON Deserializer implementations on the classpath."); } }

Target:
protected Deserializer<T> locate() { if (isAvailable("io.jsonwebtoken.io.JacksonDeserializer")) { return Classes.newInstance("io.jsonwebtoken.io.JacksonDeserializer"); } else if (isAvailable("io.jsonwebtoken.io.OrgJsonDeserializer")) { return Classes.newInstance("io.jsonwebtoken.io.OrgJsonDeserializer"); } else if (isAvailable("io.jsonwebtoken.gson.io.GsonDeserializer")) { return Classes.newInstance("io.jsonwebtoken.gson.io.GsonDeserializer"); } else { throw new IllegalStateException("Unable to discover any JSON Deserializer implementations on the classpath."); } }
Source:
public Observable<PutResult> createObservable() { try { throwExceptionIfRxJavaIsNotAvailable("createObservable()"); return Observable .create(OnSubscribeExecuteAsBlocking.newInstance(this)) .subscribeOn(Schedulers.io()); } catch (Throwable throwable) { throw new StorIOException(throwable); } }

Target:
public Observable<PutResult> createObservable() { throwExceptionIfRxJavaIsNotAvailable("createObservable()"); return Observable .create(OnSubscribeExecuteAsBlocking.newInstance(this)) .subscribeOn(Schedulers.io()); }
Source:
public void publishWorkflowAndTestDiscourseTopicCreation() { final ApiClient curatorApiClient = getWebClient(CURATOR_USERNAME); EntriesApi curatorEntriesApi = new EntriesApi(curatorApiClient); final ApiClient userApiClient = getWebClient(USER_2_USERNAME); WorkflowsApi userWorkflowsApi = new WorkflowsApi(userApiClient); String workflowName = Long.toString(Instant.now().toEpochMilli()); userWorkflowsApi.manualRegister("github", "DockstoreTestUser2/gdc-dnaseq-cwl", "/workflows/dnaseq/transform.cwl", workflowName, "cwl", "/workflows/dnaseq/transform.cwl.json"); final Workflow workflowByPathGithub = userWorkflowsApi.getWorkflowByPath(DOCKSTORE_TEST_USER2_GDC_DNASEQ_CWL_WORKFLOW + "/" + workflowName, null); final Workflow workflow = userWorkflowsApi.refresh(workflowByPathGithub.getId()); userWorkflowsApi.publish(workflow.getId(), new PublishRequest(){ public Boolean isPublish() { return true;} }); try { curatorEntriesApi.setDiscourseTopic(workflow.getId()); fail("Should still not be able to set discourse topic."); } catch (ApiException ex) { } }

Target:
public void publishWorkflowAndTestDiscourseTopicCreation() { final ApiClient curatorApiClient = getWebClient(CURATOR_USERNAME); EntriesApi curatorEntriesApi = new EntriesApi(curatorApiClient); final ApiClient userApiClient = getWebClient(USER_2_USERNAME); WorkflowsApi userWorkflowsApi = new WorkflowsApi(userApiClient); String workflowName = Long.toString(Instant.now().toEpochMilli()); userWorkflowsApi.manualRegister("github", "DockstoreTestUser2/gdc-dnaseq-cwl", "/workflows/dnaseq/transform.cwl", workflowName, "cwl", "/workflows/dnaseq/transform.cwl.json"); final Workflow workflowByPathGithub = userWorkflowsApi.getWorkflowByPath(DOCKSTORE_TEST_USER2_GDC_DNASEQ_CWL_WORKFLOW + "/" + workflowName, null); final Workflow workflow = userWorkflowsApi.refresh(workflowByPathGithub.getId()); userWorkflowsApi.publish(workflow.getId(), new PublishRequest(){ public Boolean isPublish() { return true;} }); try { curatorEntriesApi.setDiscourseTopic(workflow.getId()); fail("Should still not be able to set discourse topic."); } catch (ApiException ex) { } Workflow unpublishedWf = userWorkflowsApi.publish(workflow.getId(), new PublishRequest(){ public Boolean isPublish() { return false;} }); Workflow publishedWf = userWorkflowsApi.publish(unpublishedWf.getId(), new PublishRequest(){ public Boolean isPublish() { return true;} }); assertEquals("Topic id should remain the same.", unpublishedWf.getTopicId(), publishedWf.getTopicId()); }
Source:
public CompletableFuture<Void> waitUntilAvailable(UUID requestId) { return submit(new LockRequest(requestId, true)); }

Target:
public synchronized CompletableFuture<Void> waitUntilAvailable(UUID requestId) { return submit(new LockRequest(requestId, true)); }
Source:
public void initParam(Object obj) { OptionsParam optionsParam = (OptionsParam) obj; StatsParam statsParam = optionsParam.getParamSet(StatsParam.class); getInMemoryStatsEnabledField().setSelected(statsParam.isInMemoryEnabled()); getStatsdStatsEnabledField().setSelected(statsParam.isStatsdEnabled()); getStatsdHostField().setText(statsParam.getStatsdHost()); getStatsdPortField().setValue(statsParam.getStatsdPort()); getStatsdPrefixField().setText(statsParam.getStatsdPrefix()); setStatsdFieldStates(); }

Target:
public void initParam(Object obj) { OptionsParam optionsParam = (OptionsParam) obj; StatsParam statsParam = optionsParam.getParamSet(StatsParam.class); getInMemoryStatsEnabledField().setSelected(statsParam.isInMemoryEnabled()); getStatsdStatsEnabledField().setSelected(statsParam.isStatsdEnabled()); getStatsdHostField().setText(statsParam.getStatsdHost()); getStatsdHostField().discardAllEdits(); getStatsdPortField().setValue(statsParam.getStatsdPort()); getStatsdPrefixField().setText(statsParam.getStatsdPrefix()); getStatsdPrefixField().discardAllEdits(); setStatsdFieldStates(); }
Source:
protected void onSetUpBeforeClosingWelcomePage() throws Exception { copyFileToTestProject(Activator.PLUGIN_ID, DATA_UNIT_DIR, MODEL_FILE, SESSION_FILE, VSM_FILE, IMAGE_FILE); sessionAirdResource = new UIResource(designerProject, SESSION_FILE); localSession = designerPerspective.openSessionFromFile(sessionAirdResource, true); }

Target:
protected void onSetUpBeforeClosingWelcomePage() throws Exception { copyFileToTestProject(Activator.PLUGIN_ID, DATA_UNIT_DIR, MODEL_FILE, SESSION_FILE); sessionAirdResource = new UIResource(designerProject, SESSION_FILE); localSession = designerPerspective.openSessionFromFile(sessionAirdResource, true); }
Source:
public Map<byte[], RowColumnRangeIterator> getRowsColumnRange(TableReference tableRef, Iterable<byte[]> rows, BatchColumnRangeSelection batchColumnRangeSelection, long timestamp) { return maybeLog(() -> delegate.getRowsColumnRange(tableRef, rows, batchColumnRangeSelection, timestamp), (logger, stopwatch) -> { logger.log("Call to KVS.getRowsColumnRange on table for rows with range took ms.", tableRef, Iterables.size(rows), batchColumnRangeSelection, stopwatch.elapsed(TimeUnit.MILLISECONDS)); logTimeAndTable(logger, "getRowsColumnRange", tableRef, stopwatch); }); }

Target:
public Map<byte[], RowColumnRangeIterator> getRowsColumnRange(TableReference tableRef, Iterable<byte[]> rows, BatchColumnRangeSelection batchColumnRangeSelection, long timestamp) { return maybeLog(() -> delegate.getRowsColumnRange(tableRef, rows, batchColumnRangeSelection, timestamp), (logger, stopwatch) -> { logger.log("Call to KVS.getRowsColumnRange on table for rows with range took ms.", tableRef, Iterables.size(rows), batchColumnRangeSelection, stopwatch.elapsed(TimeUnit.MILLISECONDS)); }); }
Source:
public String getRequestId() { return requestId; }

Target:
public String getRequestId() { String reqId = null; if (!maskRequestId) { if (requestId == null || requestId.length() <= 0) { requestId = UUID.randomUUID().toString(); isRequestIdSet = true; } reqId = requestId; } return reqId; }
Source:
public static void input(BooleanDistinctState state, @SqlType(StandardTypes.BOOLEAN) boolean value, @SqlType(StandardTypes.DOUBLE) double maxStandardError) { switch (state.getInt()) { case 0: state.setInt(value == true ? 1 : 2); break; case 1: state.setInt(value == true ? 1 : 3); break; case 2: state.setInt(value == true ? 3 : 2); break; } }

Target:
public static void input(BooleanDistinctState state, @SqlType(StandardTypes.BOOLEAN) boolean value, @SqlType(StandardTypes.DOUBLE) double maxStandardError) { state.setByte((byte) (state.getByte() | (value ? 1 : 2))); }
Source:
public IncomingCallFilterGraph(Call call, CallFilterResultCallback listener) { mFiltersQueue = new LinkedBlockingDeque<>(); mListener = listener; mCall = call; mFiltersList = new ArrayList<>(); mFutures = new HashMap<>(); mPool = Executors.newFixedThreadPool(NTHREADS); }

Target:
public IncomingCallFilterGraph(Call call, CallFilterResultCallback listener) { mFiltersQueue = new LinkedBlockingDeque<>(); mListener = listener; mCall = call; mFiltersList = new ArrayList<>(); mFutures = new HashMap<>(); mHandler = new Handler(Looper.getMainLooper()); mExecutor = mHandler::post; }
Source:
public DuplicateStopError(DuplicateStops duplicateStop) { super("stop", duplicateStop.stop1.sourceFileLine, "stop_lat,stop_lon", duplicateStop.getStop1Id()); this.message = duplicateStop.toString(); this.duplicateStop = duplicateStop; }

Target:
public DuplicateStopError(DuplicateStops duplicateStop) { super("stop", duplicateStop.getDuplicatedStop().sourceFileLine, "stop_lat,stop_lon", duplicateStop.getDuplicatedStop().stop_id); this.message = duplicateStop.toString(); this.duplicateStop = duplicateStop; }
Source:
public CurveCurrencyParameterSensitivity multipliedBy(Currency currency, double amount) { double[] updated = new double[sensitivity.length]; for (int i = 0; i < sensitivity.length; i++) { updated[i] = sensitivity[i] * amount; } return CurveCurrencyParameterSensitivity.of(metadata, currency, updated); }

Target:
public CurveCurrencyParameterSensitivity multipliedBy(Currency currency, double amount) { return CurveCurrencyParameterSensitivity.of(metadata, currency, DoubleArrayMath.applyMultiplication(sensitivity, amount)); }
Source:
public void createStores() { stream1Store = new ManagedTimeStateImpl(); stream2Store = new ManagedTimeStateImpl(); stream1Store.setNumBuckets(noOfBuckets); stream2Store.setNumBuckets(noOfBuckets); if (bucketSpanTime != null) { stream1Store.getTimeBucketAssigner().setBucketSpan(Duration.millis(bucketSpanTime)); stream2Store.getTimeBucketAssigner().setBucketSpan(Duration.millis(bucketSpanTime)); } if (stream1Store.getTimeBucketAssigner() instanceof MovingBoundaryTimeBucketAssigner) { ((MovingBoundaryTimeBucketAssigner)stream1Store.getTimeBucketAssigner()).setExpireBefore(Duration.millis(getExpiryTime())); } if (stream2Store.getTimeBucketAssigner() instanceof MovingBoundaryTimeBucketAssigner) { ((MovingBoundaryTimeBucketAssigner)stream1Store.getTimeBucketAssigner()).setExpireBefore(Duration.millis(getExpiryTime())); } stream1Data = new ManagedTimeStateMultiValue(stream1Store, !isLeftKeyPrimary()); stream2Data = new ManagedTimeStateMultiValue(stream2Store, !isRightKeyPrimary()); }

Target:
public void createStores() { stream1Store = new ManagedTimeStateImpl(); stream2Store = new ManagedTimeStateImpl(); stream1Store.setNumBuckets(noOfBuckets); stream2Store.setNumBuckets(noOfBuckets); assert stream1Store.getTimeBucketAssigner() == stream2Store.getTimeBucketAssigner(); if (bucketSpanTime != null) { stream1Store.getTimeBucketAssigner().setBucketSpan(Duration.millis(bucketSpanTime)); } if (stream1Store.getTimeBucketAssigner() instanceof MovingBoundaryTimeBucketAssigner) { ((MovingBoundaryTimeBucketAssigner)stream1Store.getTimeBucketAssigner()).setExpireBefore(Duration.millis(getExpiryTime())); } stream1Data = new ManagedTimeStateMultiValue(stream1Store, !isLeftKeyPrimary()); stream2Data = new ManagedTimeStateMultiValue(stream2Store, !isRightKeyPrimary()); }
Source:
public String getText() { return "Add doctrine repository"; }

Target:
public String getText() { return "Add Doctrine Repository"; }
Source:
private MethodBehavior createStringUtilMethodBehavior(Symbol.MethodSymbol symbol) { MethodBehavior behavior; switch (symbol.name()) { case "isEmpty" : case "isBlank" : case "isNotEmpty" : case "isNotBlank" : behavior = new MethodBehavior(symbol); MethodYield nullYield = new MethodYield(symbol.parameterTypes().size(), false); nullYield.exception = false; nullYield.parametersConstraints[0] = ObjectConstraint.nullConstraint(); nullYield.resultConstraint = symbol.name().contains("Not") ? BooleanConstraint.FALSE : BooleanConstraint.TRUE; behavior.addYield(nullYield); MethodYield notNullYield = new MethodYield(symbol.parameterTypes().size(), false); notNullYield.exception = false; notNullYield.parametersConstraints[0] = ObjectConstraint.notNull(); behavior.addYield(notNullYield); behavior.completed(); break; default: behavior = null; } return behavior; }

Target:
private MethodBehavior createStringUtilMethodBehavior(Symbol.MethodSymbol symbol) { MethodBehavior behavior; switch (symbol.name()) { case "isNotEmpty" : case "isNotBlank" : behavior = createIsEmptyOrBlankMethodBehavior(symbol, BooleanConstraint.FALSE); break; case "isEmpty" : case "isBlank" : behavior = createIsEmptyOrBlankMethodBehavior(symbol, BooleanConstraint.TRUE); break; default: behavior = null; } return behavior; }
Source:
protected void actionPerformed( final GuiButton btn ) { super.actionPerformed( btn ); try { if( this.tabCraftButton == btn || this.tabProcessButton == btn ) { NetworkHandler.instance.sendToServer( new PacketValueConfig( "PatternTerminal.CraftMode", this.tabProcessButton == btn ? "1" : "0" ) ); } if( this.encodeBtn == btn ) { NetworkHandler.instance.sendToServer( new PacketValueConfig( "PatternTerminal.Encode", "1" ) ); } if( this.clearBtn == btn ) { NetworkHandler.instance.sendToServer( new PacketValueConfig( "PatternTerminal.Clear", "1" ) ); } if( this.substitutionsEnabledBtn == btn || this.substitutionsDisabledBtn == btn ) { NetworkHandler.instance.sendToServer( new PacketValueConfig( "PatternTerminal.Substitute", this.substitutionsEnabledBtn == btn ? "0" : "1" ) ); } } catch( final IOException e ) { e.printStackTrace(); } }

Target:
protected void actionPerformed( final GuiButton btn ) { super.actionPerformed( btn ); try { if( this.tabCraftButton == btn || this.tabProcessButton == btn ) { NetworkHandler.instance.sendToServer( new PacketValueConfig( "PatternTerminal.CraftMode", this.tabProcessButton == btn ? CRAFTMODE_CRFTING : CRAFTMODE_PROCESSING ) ); } if( this.encodeBtn == btn ) { NetworkHandler.instance.sendToServer( new PacketValueConfig( "PatternTerminal.Encode", "1" ) ); } if( this.clearBtn == btn ) { NetworkHandler.instance.sendToServer( new PacketValueConfig( "PatternTerminal.Clear", "1" ) ); } if( this.substitutionsEnabledBtn == btn || this.substitutionsDisabledBtn == btn ) { NetworkHandler.instance.sendToServer( new PacketValueConfig( "PatternTerminal.Substitute", this.substitutionsEnabledBtn == btn ? SUBSITUTION_DISABLE : SUBSITUTION_ENABLE ) ); } } catch( final IOException e ) { e.printStackTrace(); } }
Source:
private void setRuleActive(String ruleKey, boolean active) { if (!rules.containsKey(ruleKey)) { rules.put(ruleKey, new Rule(false)); } rules.get(ruleKey).isActive = active; }

Target:
private void setRuleActive(String ruleKey, boolean active) { rules.computeIfAbsent(ruleKey, s -> new Rule(true)); rules.get(ruleKey).isActive = active; }
Source:
public Configuration build() { List<ServiceCreationConfiguration<?>> serviceCreationConfigurations = addDiscoveredServiceConfiguration(); return new DefaultConfiguration(caches, classLoader, serviceCreationConfigurations.toArray(new ServiceCreationConfiguration<?>[serviceCreationConfigurations.size()])); }

Target:
public Configuration build() { return new DefaultConfiguration(caches, classLoader, addedAndDiscoveredServiceConfigurations()); }
Source:
public Builder timeout(Duration timeout) { Objects.requireNonNull(timeout, "duration cannot be null"); this.timeout = timeout; return this; }

Target:
public Builder timeout(Duration timeout) { this.timeout = Objects.requireNonNull(timeout, "Timeout cannot be null"); return this; }
Source:
private View.OnClickListener createOnClickListener(final String dialogTitle, final String hint, final WPTextView textView, final boolean isMultiline) { mTextView = textView; return new View.OnClickListener() { @Override public void onClick(View v) { ProfileInputDialogFragment inputDialog = ProfileInputDialogFragment.newInstance(dialogTitle, textView.getText().toString(), hint, isMultiline); inputDialog.show(getFragmentManager(), DIALOG_TAG); } }; }

Target:
private View.OnClickListener createOnClickListener(final String dialogTitle, final String hint, final WPTextView textView, final boolean isMultiline) { return new View.OnClickListener() { @Override public void onClick(View v) { ProfileInputDialogFragment inputDialog = ProfileInputDialogFragment.newInstance(dialogTitle, textView.getText().toString(), hint, isMultiline, textView.getId()); inputDialog.show(getFragmentManager(), DIALOG_TAG); } }; }
Source:
public static IBatchProject getBatchProject(IProject project, boolean resolve) { BatchProject result = null; KbProject kb = (KbProject)KbProjectFactory.getKbProject(project, resolve); if(kb != null) { result = (BatchProject)kb.getExtensionModel(MODEL_ID); if(result == null) { result = new BatchProject(); result.setProject(project); kb.setExtensionModel(MODEL_ID, result); } } if(result != null && resolve) { result.resolve(); } return result; }

Target:
public static IBatchProject getBatchProject(IProject project, boolean resolve) { BatchProject result = null; KbProject kb = (KbProject)KbProjectFactory.getKbProject(project, resolve); if(kb != null) { synchronized (kb) { result = (BatchProject)kb.getExtensionModel(MODEL_ID); if(result == null) { result = new BatchProject(); result.setProject(project); kb.setExtensionModel(MODEL_ID, result); } } } if(result != null && resolve) { result.resolve(); } return result; }
Source:
public CrewMember apply(org.atlasapi.media.entity.CrewMember input) { if (input instanceof org.atlasapi.media.entity.Actor) { return translateLegacyActor((org.atlasapi.media.entity.Actor) input); } else if(Objects.nonNull(input)) { return translateLegacyCrewMember(input); } else { return null; } }

Target:
public CrewMember apply(org.atlasapi.media.entity.CrewMember input) { if (null == input.getId()) { return null; } if (input instanceof org.atlasapi.media.entity.Actor) { return translateLegacyActor((org.atlasapi.media.entity.Actor) input); } else if(null != input) { return translateLegacyCrewMember(input); } else { return null; } }
Source:
public void setClearZookeeper(boolean clearZookeeper) { this.clearZookeeper = clearZookeeper; }

Target:
public InitOpts setClearZookeeper(boolean clearZookeeper) { this.clearZookeeper = clearZookeeper; return this; }
Source:
public static void main(String[] args) { DemoUtil.setUp(); try { testResendingFailedNotifications(); } catch (MambuApiException e) { System.out.println("Exception caught in Demo Test Lines of Credit Service"); System.out.println("Error code=" + e.getErrorCode()); System.out.println(" Cause=" + e.getCause() + ". Message=" + e.getMessage()); } }

Target:
public static void main(String[] args) { DemoUtil.setUp(); try { testResendingFailedNotifications(); } catch (MambuApiException e) { System.out.println("Exception caught in Demo Test Notifications Service"); System.out.println("Error code=" + e.getErrorCode()); System.out.println("Cause=" + e.getCause() + ". Message=" + e.getMessage()); } }
Source:
InputStream[] getOutput(InputStream[] output, Consumer<InputStream> outputConsumer) { processOutput(output, outputConsumer); if(allowsEndpointState()) { return Arrays.copyOfRange(output, 1, output.length); } return output; }

Target:
InputStream[] getOutput(InputStream[] output, Consumer<InputStream> outputConsumer) { assignEndpointState(output); if(allowsEndpointState() && output.length>0) { return Arrays.copyOfRange(output, 1, output.length); } return output; }
Source:
public void clearAll() { synchronized (keptjobinfos) { JobTreeElement[] all = (JobTreeElement[]) keptjobinfos .toArray(new JobTreeElement[keptjobinfos.size()]); for (JobTreeElement element : all) { disposeAction(element); } keptjobinfos.clear(); finishedTime.clear(); } for (Object listener : getListeners()) { KeptJobsListener jv = (KeptJobsListener) listener; jv.removed(null); } }

Target:
public void clearAll() { synchronized (keptjobinfos) { JobTreeElement[] all = (JobTreeElement[]) keptjobinfos .toArray(new JobTreeElement[keptjobinfos.size()]); for (JobTreeElement jobTreeElement : all) { disposeAction(jobTreeElement); } keptjobinfos.clear(); finishedTime.clear(); } for (Object listener : getListeners()) { KeptJobsListener jv = (KeptJobsListener) listener; jv.removed(null); } }
Source:
public void afterClass() throws Exception { String testClassName = this.getShortClassName(); System.out.println("AfterClass: " + testClassName + " of TestStuckTaskQuota called."); super.afterClass(); }

Target:
public void afterClass() throws Exception { super.afterClass(); }
Source:
public void close() throws IOException { if (jp != null) { jp.close(); } try { resourceCloser.close(); } catch (Exception e) { throw new RuntimeException(e); } }

Target:
public void close() throws IOException { Closer closer = Closer.create(); if (jp != null) { closer.register(jp); } closer.register(resourceCloser); closer.close(); }
Source:
public void runWorkerStartHooks() { WorkerTopologyContext workerContext = getWorkerTopologyContext(); if (topology.is_set_worker_hooks()) { for (IWorkerHook hook : getDeserializedWorkerHooks()) { hook.start(topologyConf, workerContext); } } }

Target:
public void runWorkerStartHooks() { WorkerTopologyContext workerContext = getWorkerTopologyContext(); for (IWorkerHook hook : getDeserializedWorkerHooks()) { hook.start(topologyConf, workerContext); } }
Source:
public Response remove() { Cluster cluster = parent.getClusterEntity(); SupportedAdditionalClusterFeature feature = cluster.getAddtionalFeaturesSupported() .stream() .filter(f -> f.getFeature().getId().equals(asGuid(id))) .findFirst() .orElse(null); if (feature != null) { feature.setEnabled(false); } return parent.updateClusterEntity(cluster); }

Target:
public Response remove() { return BackendClusterFeatureHelper.disableClusterFeature(this, asGuid(clusterId), asGuid(id)); }
Source:
public GitSubscriberMergeContext(final GitResourceVariantTreeSubscriber subscriber, ISynchronizationScopeManager manager, GitSynchronizeDataSet gsds) { super(subscriber, manager); this.subscriber = subscriber; this.gsds = gsds; indexChangeListener = (Repository repository, IndexDiffData indexDiffData) -> { handleRepositoryChange(repository); }; resourceChangeListener = new IResourceChangeListener() { @Override public void resourceChanged(IResourceChangeEvent event) { IResourceDelta delta = event.getDelta(); if (delta == null) return; handleResourceChange(delta); } }; IndexDiffCache indexDiffCache = Activator.getDefault().getIndexDiffCache(); if (indexDiffCache != null) indexDiffCache.addIndexDiffChangedListener(indexChangeListener); ResourcesPlugin.getWorkspace().addResourceChangeListener(resourceChangeListener); initialize(); }

Target:
public GitSubscriberMergeContext(final GitResourceVariantTreeSubscriber subscriber, ISynchronizationScopeManager manager, GitSynchronizeDataSet gsds) { super(subscriber, manager); this.subscriber = subscriber; this.gsds = gsds; indexChangeListener = (repository, indexDiffData) -> handleRepositoryChange(repository); resourceChangeListener = event -> { IResourceDelta delta = event.getDelta(); if (delta != null) { handleResourceChange(delta); } }; IndexDiffCache indexDiffCache = Activator.getDefault().getIndexDiffCache(); if (indexDiffCache != null) indexDiffCache.addIndexDiffChangedListener(indexChangeListener); ResourcesPlugin.getWorkspace().addResourceChangeListener(resourceChangeListener); initialize(); }
Source:
protected <K, V> void bindProperties( String prefix, Iterable<Map.Entry<K, V>> properties, boolean skipUnresolved) { StringBuilder buf = null; for (Map.Entry<K, V> e : properties) { String name = (String) e.getKey(); String value = (String) e.getValue(); if (NULL.equals(value)) { bindProperty(prefix, name, null); } else { final Matcher matcher = PROPERTIES_PLACE_HOLDER_PATTERN.matcher(value); if (matcher.find()) { int start = 0; if (buf == null) { buf = new StringBuilder(); } else { buf.setLength(0); } do { buf.append(value.substring(start, matcher.start())); final String placeholder = value.substring(matcher.start(), matcher.end()); final String placeholderName = removePlaceholderFormatting(placeholder); String resolvedPlaceholder = resolvePlaceholder(placeholderName); if (resolvedPlaceholder != null) { buf.append(resolvedPlaceholder); } else if (skipUnresolved) { buf.append(placeholder); LOG.warn( "Placeholder cannot be resolved neither from environment variable nor from system property, " + "leaving as is.", placeholderName); } else { throw new ConfigurationException( format( "%s is not a system property or " + "an environment variable.", placeholderName)); } start = matcher.end(); } while (matcher.find()); buf.append(value.substring(start)); value = buf.toString(); } bindProperty(prefix, name, value); } } }

Target:
protected <K, V> void bindProperties( String prefix, Iterable<Map.Entry<K, V>> properties, boolean skipUnresolved) { StringBuilder buf = null; for (Map.Entry<K, V> e : properties) { String name = (String) e.getKey(); String value = (String) e.getValue(); if (NULL.equals(value)) { bindProperty(prefix, name, null); } else { final Matcher matcher = PROPERTIES_PLACE_HOLDER_PATTERN.matcher(value); if (matcher.find()) { int start = 0; if (buf == null) { buf = new StringBuilder(); } else { buf.setLength(0); } do { buf.append(value.substring(start, matcher.start())); final String placeholder = value.substring(matcher.start(), matcher.end()); final String placeholderName = removePlaceholderFormatting(placeholder); String resolvedPlaceholder = resolvePlaceholder(placeholderName); if (resolvedPlaceholder != null) { buf.append(resolvedPlaceholder); } else if (skipUnresolved) { buf.append(placeholder); LOG.warn( "Placeholder cannot be resolved neither from environment variable nor from system property, " + "leaving as is.", placeholderName); } else { throw new ConfigurationException( format( "%s is not a system property or environment variable.", placeholderName)); } start = matcher.end(); } while (matcher.find()); buf.append(value.substring(start)); value = buf.toString(); } bindProperty(prefix, name, value); } } }
Source:
public ITmfEventField[] extractItemFields(final ITmfEvent event) { ITmfEventField[] fields = EMPTY_FIELD_ARRAY; if (event != null) { final String timestamp = event.getTimestamp().toString(); final String source = event.getSource(); final String type = event.getType().getName(); final String reference = event.getReference(); final String content = event.getContent().toString(); fields = new TmfEventField[] { new TmfEventField(ITmfEvent.EVENT_FIELD_TIMESTAMP, timestamp, null), new TmfEventField(ITmfEvent.EVENT_FIELD_SOURCE, source, null), new TmfEventField(ITmfEvent.EVENT_FIELD_TYPE, type, null), new TmfEventField(ITmfEvent.EVENT_FIELD_REFERENCE, reference, null), new TmfEventField(ITmfEvent.EVENT_FIELD_CONTENT, content, null) }; } return fields; }

Target:
protected ITmfEventField[] extractItemFields(final ITmfEvent event) { ITmfEventField[] fields = EMPTY_FIELD_ARRAY; if (event != null) { final String timestamp = event.getTimestamp().toString(); final String source = event.getSource(); final String type = event.getType().getName(); final String reference = event.getReference(); final String content = event.getContent().toString(); fields = new TmfEventField[] { new TmfEventField(ITmfEvent.EVENT_FIELD_TIMESTAMP, timestamp, null), new TmfEventField(ITmfEvent.EVENT_FIELD_SOURCE, source, null), new TmfEventField(ITmfEvent.EVENT_FIELD_TYPE, type, null), new TmfEventField(ITmfEvent.EVENT_FIELD_REFERENCE, reference, null), new TmfEventField(ITmfEvent.EVENT_FIELD_CONTENT, content, null) }; } return fields; }
Source:
public String getHostFingerprint() throws IOException { if (_client == null) { throw new java.net.ConnectException("SSH is not connected"); } return ((EngineSSHClient)_client).getHostFingerprint(); }

Target:
public String getHostFingerprint() throws IOException { if (_client == null) { throw new ConnectException("SSH is not connected"); } return ((EngineSSHClient)_client).getHostFingerprint(); }
Source:
public ResourceDescriptor addRequiredChildren(Set<? extends ResourceDefinition> set) { set.forEach(definition -> this.requiredChildren.add(definition.getPathElement())); return this; }

Target:
public ResourceDescriptor addRequiredChildren(Set<? extends ResourceDefinition> set) { for (ResourceDefinition definition : set) { this.requiredChildren.add(definition.getPathElement()); } return this; }
Source:
private synchronized void computeSortOnlyDescriptors() { INavigatorContentDescriptor[] allDescriptors; allDescriptors = NavigatorContentDescriptorManager.getInstance().getSortOnlyContentDescriptors(); List sortOnlyList = new ArrayList(); for (INavigatorContentDescriptor allDescriptor : allDescriptors) { if (contentService.isActive(allDescriptor.getId())) { sortOnlyList.add(allDescriptor); } } sortOnlyDescriptors = (INavigatorContentDescriptor[]) sortOnlyList.toArray(new INavigatorContentDescriptor[]{}); }

Target:
private synchronized void computeSortOnlyDescriptors() { List sortOnlyList = new ArrayList(); for (INavigatorContentDescriptor descriptor : NavigatorContentDescriptorManager.getInstance() .getSortOnlyContentDescriptors()) { if (contentService.isActive(descriptor.getId())) { sortOnlyList.add(descriptor); } } sortOnlyDescriptors = (INavigatorContentDescriptor[]) sortOnlyList.toArray(new INavigatorContentDescriptor[]{}); }
Source:
public BytecodeNode generateExpression(Signature signature, BytecodeGeneratorContext context, Type returnType, List<RowExpression> arguments) { BytecodeBlock block = new BytecodeBlock().setDescription("Partial apply"); Scope scope = context.getScope(); Variable wasNull = scope.getVariable("wasNull"); ImmutableList.Builder<BytecodeExpression> bytecodeCaptureVariablesBuilder = ImmutableList.builder(); int numValues = arguments.size() - 1; for (int i = 0; i < numValues; i++) { Class<?> valueType = Primitives.wrap(arguments.get(i).getType().getJavaType()); Variable valueVariable = scope.createTempVariable(valueType); block.append(context.generate(arguments.get(i))); block.append(boxPrimitiveIfNecessary(scope, valueType)); block.putVariable(valueVariable); block.append(wasNull.set(constantFalse())); bytecodeCaptureVariablesBuilder.add(valueVariable.cast(Object.class)); } Variable functionVariable = scope.createTempVariable(MethodHandle.class); block.append(context.generate(arguments.get(numValues))); block.append( new IfStatement() .condition(wasNull) .ifFalse( new BytecodeBlock() .putVariable(functionVariable) .append(invokeStatic( MethodHandles.class, "insertArguments", MethodHandle.class, functionVariable, constantInt(0), newArray(type(Object[].class), bytecodeCaptureVariablesBuilder.build()))))); return block; }

Target:
public BytecodeNode generateExpression(Signature signature, BytecodeGeneratorContext context, Type returnType, List<RowExpression> arguments) { int numCaptures = arguments.size() - 1; LambdaDefinitionExpression lambda = (LambdaDefinitionExpression) arguments.get(numCaptures); checkState(compiledLambdaMap.containsKey(lambda), "lambda expressions map does not contain this lambda definition"); CompiledLambda compiledLambda = compiledLambdaMap.get(lambda); return LambdaBytecodeGenerator.generateLambda( context, arguments.subList(0, numCaptures), compiledLambda, lambdaInterface); }
Source:
protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_bot_controller); debugView = Views.findById(this, R.id.bot_controller_debug_view); DirectionPadView padView = Views.findById(this, R.id.bot_controller_direction_view); padView.setOnDirectionPressedListener(new OnDirectionPressedListener() { @Override public void onDirectionPressed(BotDirection direction) { String arrowCharacter = arrowOf(direction); debugView.showPermanently(arrowCharacter); } @Override public void onDirectionReleased(BotDirection direction) { String arrowCharacter = arrowOf(direction); debugView.showTimed(arrowCharacter + " released", DURATION_DIRECTIONS); } private String arrowOf(BotDirection direction) { switch (direction) { case FORWARD: return "↑"; case BACKWARD: return "↓"; case STEER_LEFT: return "←"; case STEER_RIGHT: return "→"; } throw new IllegalArgumentException("Invalid direction " + direction); } @Override public void onLazersFired() { debugView.showTimed(LAZERS, DURATION_LAZERS); } @Override public void onLazersReleased() { debugView.clearMessage(); } }); }

Target:
protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_bot_controller); debugView = Views.findById(this, R.id.bot_controller_debug_view); ControllerView controllerView = Views.findById(this, R.id.bot_controller_direction_view); controllerView.setControllerListener(new ControllerListener() { @Override public void onDirectionPressed(Direction direction) { debugView.showPermanently(direction.getRepresentation()); } @Override public void onDirectionReleased(Direction direction) { debugView.showTimed(direction.getRepresentation() + " released", DURATION_DIRECTIONS); } @Override public void onLazersFired() { debugView.showTimed(LAZERS, DURATION_LAZERS); } @Override public void onLazersReleased() { debugView.clearMessage(); } }); }
Source:
Point resizeCalculationsGTK3(long widget, int width, int height) { Point size = super.resizeCalculationsGTK3(widget, width, height); if (widget == handle && GTK.GTK_VERSION >= OS.VERSION(3, 22, 0)) { size.y = Math.max(size.y, 26); } return size; }

Target:
Point resizeCalculationsGTK3(long widget, int width, int height) { Point size = super.resizeCalculationsGTK3(widget, width, height); if (widget == handle && GTK.GTK_VERSION >= OS.VERSION(3, 22, 0)) { GtkRequisition naturalSize = new GtkRequisition(); GtkRequisition minimumSize = new GtkRequisition(); GTK.gtk_widget_get_preferred_size(handle, minimumSize, naturalSize); size.y = Math.max(size.y, minimumSize.height); } return size; }
Source:
protected IResourceVariant fetchVariant(IResource resource, int depth, IProgressMonitor monitor) throws TeamException { try { if (resource != null) { return fetchVariant(resource, monitor); } else { return null; } } finally { monitor.done(); } }

Target:
protected IResourceVariant fetchVariant(IResource resource, int depth, IProgressMonitor monitor) throws TeamException { try { if (resource != null) return fetchVariant(resource, monitor); else return null; } finally { monitor.done(); } }
Source:
public TaskResult runTask() { Config params = request.getConfig().mergeDefault( request.getConfig().getNestedOrGetEmpty("td")); int pollInterval = getPollInterval(params); String query = templateEngine.templateCommand(workspacePath, params, "query", UTF_8); int defaultRows = query.trim().isEmpty() ? 0 : 1; int rows = params.get("rows", int.class, defaultRows); boolean done = runPollQuery(request, params, query, rows); if (done) { return TaskResult.empty(request); } else { throw TaskExecutionException.ofNextPolling(pollInterval, ConfigElement.copyOf(request.getLastStateParams())); } }

Target:
public TaskResult runTask() { try (TDOperator op = TDOperator.fromConfig(params)) { if (!existingJobId.isPresent()) { String jobId = startJob(op); state.set(JOB_ID, jobId); throw TaskExecutionException.ofNextPolling(JOB_STATUS_API_POLL_INTERVAL, ConfigElement.copyOf(state)); } assert existingJobId.isPresent(); TDJobOperator job = op.newJobOperator(existingJobId.get()); TDJob jobInfo = job.getJobInfo(); TDJob.Status status = jobInfo.getStatus(); logger.debug("poll job status: {}: {}", existingJobId.get(), jobInfo); if (!status.isFinished()) { throw TaskExecutionException.ofNextPolling(JOB_STATUS_API_POLL_INTERVAL, ConfigElement.copyOf(state)); } if (status != SUCCESS) { String message = jobInfo.getCmdOut() + "\n" + jobInfo.getStdErr(); throw new TaskExecutionException(message, ConfigElement.empty()); } logger.debug("fetching poll job result: {}", existingJobId.get()); boolean done = fetchJobResult(job); if (!done) { state.remove(JOB_ID); throw TaskExecutionException.ofNextPolling(pollInterval, ConfigElement.copyOf(state)); } return TaskResult.empty(request); } }
Source:
void afterCommand() { ProjectId id = givenAggregateId(Identifier.newUuid()); AggCreateProject create = AggCreateProject .newBuilder() .setProjectId(id) .setName("Command Dispatching") .build(); Task task = Task .newBuilder() .setTitle("Dummy Task") .setDescription("Dummy Task Description") .build(); AggAddTask addTask = AggAddTask .newBuilder() .setProjectId(id) .setTask(task) .build(); AggStartProject start = AggStartProject .newBuilder() .setProjectId(id) .build(); BlackBoxBoundedContext.singletenant() .with(repository()) .receivesCommands(create, addTask, start) .assertThat(emittedEventsHadVersions(1, 2, 3)) .close(); }

Target:
void afterCommand() { ProjectId id = givenAggregateId(Identifier.newUuid()); AggCreateProject create = AggCreateProject .newBuilder() .setProjectId(id) .setName("Command Dispatching") .build(); Task task = Task .newBuilder() .setTitle("Dummy Task") .setDescription("Dummy Task Description") .build(); AggAddTask addTask = AggAddTask .newBuilder() .setProjectId(id) .setTask(task) .build(); AggStartProject start = AggStartProject .newBuilder() .setProjectId(id) .build(); BlackBoxBoundedContext.newInstance() .with(repository()) .receivesCommands(create, addTask, start) .assertThat(emittedEventsHadVersions(1, 2, 3)) .close(); }
Source:
public PinotExpression visitCall(CallExpression call, Function<VariableReferenceExpression, Selection> context) { String displayName = call.getDisplayName().toLowerCase(ENGLISH); if (displayName.equals("not")) { return handleNot(call, context); } else if (displayName.equals("cast")) { return handleCast(call, context); } else if (displayName.equals("between")) { return handleBetween(call, context); } FunctionMetadata functionMetadata = functionMetadataManager.getFunctionMetadata(call.getFunctionHandle()); Optional<OperatorType> operatorTypeOptional = functionMetadata.getOperatorType(); if (operatorTypeOptional.isPresent()) { OperatorType operatorType = operatorTypeOptional.get(); if (operatorType.isArithmeticOperator()) { throw new PinotException(PINOT_UNSUPPORTED_EXPRESSION, Optional.empty(), "Arithmetic expressions are not supported in filter: " + call); } else if (operatorType.isComparisonOperator()) { return handleLogicalBinary(operatorType.getOperator(), call, context); } } return handleFunction(call, context); }

Target:
public PinotExpression visitCall(CallExpression call, Function<VariableReferenceExpression, Selection> context) { FunctionHandle functionHandle = call.getFunctionHandle(); if (standardFunctionResolution.isNotFunction(functionHandle)) { return handleNot(call, context); } if (standardFunctionResolution.isCastFunction(functionHandle)) { return handleCast(call, context); } if (standardFunctionResolution.isBetweenFunction(functionHandle)) { return handleBetween(call, context); } FunctionMetadata functionMetadata = functionMetadataManager.getFunctionMetadata(call.getFunctionHandle()); Optional<OperatorType> operatorTypeOptional = functionMetadata.getOperatorType(); if (operatorTypeOptional.isPresent()) { OperatorType operatorType = operatorTypeOptional.get(); if (operatorType.isArithmeticOperator()) { throw new PinotException(PINOT_UNSUPPORTED_EXPRESSION, Optional.empty(), "Arithmetic expressions are not supported in filter: " + call); } if (operatorType.isComparisonOperator()) { return handleLogicalBinary(operatorType.getOperator(), call, context); } } throw new PinotException(PINOT_UNSUPPORTED_EXPRESSION, Optional.empty(), format("function %s not supported in filter", call)); }
Source:
protected ActionResult execute() throws EntityDoesNotExistException { String courseId = getRequestParamValue(Const.ParamsNames.COURSE_ID); Assumption.assertPostParamNotNull(Const.ParamsNames.COURSE_ID, courseId); String feedbackSessionName = getRequestParamValue(Const.ParamsNames.FEEDBACK_SESSION_NAME); Assumption.assertPostParamNotNull(Const.ParamsNames.FEEDBACK_SESSION_NAME, feedbackSessionName); FeedbackSessionAttributes fsa = logic.getFeedbackSession(feedbackSessionName, courseId); InstructorAttributes instructor = logic.getInstructorForGoogleId(courseId, account.googleId); gateKeeper.verifyAccessible(instructor, fsa, false); FeedbackSessionResponseStatus fsResponseStatus = logic.getFeedbackSessionResponseStatus(feedbackSessionName, courseId); InstructorFeedbackAjaxStudentsListPageData data = new InstructorFeedbackAjaxStudentsListPageData(account, sessionToken, fsResponseStatus, courseId, feedbackSessionName); return createShowPageResult(Const.ViewURIs.INSTRUCTOR_FEEDBACK_AJAX_RESEND_PUBLISHED_EMAIL_MODAL, data); }

Target:
protected ActionResult execute() throws EntityDoesNotExistException { String courseId = getNonNullRequestParamValue(Const.ParamsNames.COURSE_ID); String feedbackSessionName = getNonNullRequestParamValue(Const.ParamsNames.FEEDBACK_SESSION_NAME); FeedbackSessionAttributes fsa = logic.getFeedbackSession(feedbackSessionName, courseId); InstructorAttributes instructor = logic.getInstructorForGoogleId(courseId, account.googleId); gateKeeper.verifyAccessible(instructor, fsa, false); FeedbackSessionResponseStatus fsResponseStatus = logic.getFeedbackSessionResponseStatus(feedbackSessionName, courseId); InstructorFeedbackAjaxStudentsListPageData data = new InstructorFeedbackAjaxStudentsListPageData( account, sessionToken, fsResponseStatus, courseId, feedbackSessionName); return createShowPageResult(Const.ViewURIs.INSTRUCTOR_FEEDBACK_AJAX_RESEND_PUBLISHED_EMAIL_MODAL, data); }
Source:
private Consumer reconcileByUuid(Consumer knownHost, Consumer incoming, Map<String, Consumer> systemUuidKnownConsumersMap) { if (knownHost == null && config.getBoolean(ConfigProperties.USE_SYSTEM_UUID) && incoming.hasFact(Consumer.Facts.SYSTEM_UUID) && systemUuidKnownConsumersMap.get( incoming.getFact(Consumer.Facts.SYSTEM_UUID).toLowerCase()) != null) { knownHost = systemUuidKnownConsumersMap.get(incoming.getFact( Consumer.Facts.SYSTEM_UUID).toLowerCase()); if (knownHost != null) { log.debug("Found a known host by system uuid"); } } return knownHost; }

Target:
private Consumer reconcileByUuid(Consumer knownHost, Consumer incoming, Map<String, Consumer> systemUuidKnownConsumersMap) { if (knownHost == null && config.getBoolean(ConfigProperties.USE_SYSTEM_UUID_FOR_MATCHING) && incoming.hasFact(Consumer.Facts.SYSTEM_UUID) && systemUuidKnownConsumersMap.get( incoming.getFact(Consumer.Facts.SYSTEM_UUID).toLowerCase()) != null) { knownHost = systemUuidKnownConsumersMap.get(incoming.getFact( Consumer.Facts.SYSTEM_UUID).toLowerCase()); if (knownHost != null) { log.debug("Found a known host by system uuid"); } } return knownHost; }
Source:
public String stemWord(String word) { if (word == null) { return word; } word = word.toLowerCase(eoLocale); if (isExceptionOrNumber(word)) { return word; } String suffix = word; int localMinStemLength = Math.max(minStemLength, firstVowelPos(suffix) + 1); int pluralDirectOffset = calcPluralDirectOffset(suffix); if (pluralDirectOffset > 0) { suffix = suffix.substring(0, suffix.length() - pluralDirectOffset); if (pluralDirectChecks.contains(suffix) || stemmerExceptions.contains(suffix)) { return suffix; } } suffix = findLongestSuffix(suffix, word, localMinStemLength, pluralDirectOffset); int stemLength = 0; if (!suffix.isEmpty()) { stemLength = word.length() - suffix.length() - pluralDirectOffset; if (suffix.charAt(0) == '-' && suffix.length() + pluralDirectOffset < word.length()) { return word.substring(0, stemLength); } } if (stemLength < localMinStemLength) { return word; } return word.substring(0, stemLength); }

Target:
public String stemWord(String word) { if (word == null) { return word; } word = word.toLowerCase(eoLocale); if (isExceptionOrNumber(word)) { return word; } String suffix = word; int localMinStemLength = Math.max(minStemLength, firstVowelPos(suffix) + 1); int pluralDirectOffset = calcPluralDirectOffset(suffix); if (pluralDirectOffset > 0) { suffix = suffix.substring(0, suffix.length() - pluralDirectOffset); if (pluralDirectChecks.contains(suffix) || stemmerExceptions.contains(suffix)) { return suffix; } } suffix = findLongestSuffix(suffix, localMinStemLength); int stemLength = word.length() - suffix.length() - pluralDirectOffset; if (!suffix.isEmpty() && stemLength > 0 && suffix.charAt(0) == '-') { return word.substring(0, stemLength); } if (stemLength < localMinStemLength) { return word; } return word.substring(0, stemLength); }