auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public void process(IQ reqIQ) throws Exception { try { String node = federatedQueueManager.getRelatedNodeForRemotePacket(reqIQ); federatedQueueManager.passResponseToRequester(reqIQ.createCopy()); Element pubsub = reqIQ.getChildElement(); List<Element> elements = pubsub.elements(); boolean handled = false; for (Element x : elements) { for (PubSubElementProcessorAbstract elementProcessor : elementProcessors) { if (elementProcessor.accept(x)) { if (null != node) { elementProcessor.setNode(node); } elementProcessor.process(x, null, reqIQ, x); handled = true; } } } if (handled) { return; } } catch (UnknownFederatedPacketException e) { LOGGER.error(e); } if (!"result".equals(reqIQ.getType().toString())) { sendUnexpectedRequestResponse(reqIQ); } }

Target:
public void process(IQ reqIQ) throws Exception { try { String node = federatedQueueManager.getRelatedNodeForRemotePacket(reqIQ); federatedQueueManager.passResponseToRequester(reqIQ.createCopy()); Element pubsub = reqIQ.getChildElement(); List<Element> elements = pubsub.elements(); boolean handled = false; for (Element x : elements) { for (PubSubElementProcessorAbstract elementProcessor : elementProcessors) { if (elementProcessor.accept(x)) { if (null != node) { elementProcessor.setNode(node); } elementProcessor.process(x, null, reqIQ, x); handled = true; } } } if (handled) { return; } } catch (UnknownFederatedPacketException e) { LOGGER.error(e); } if (IQ.Type.result != reqIQ.getType()) { sendUnexpectedRequestResponse(reqIQ); } }
Source:
public Object getSinglePropertyValue() { assert propertyValues.values().length == 1; return propertyValues.values()[0]; }

Target:
public Object getSinglePropertyValue() { return propertyValues.getSinglePropertyValue(); }
Source:
public void testServerDisconnect() throws Exception { String connectionId = "testServerDisconnect_Hello"; blockingConnect(connectionId); assertEquals("hello", blockingRequest(connectionId, "hello")); this.server.closeConnections(); while (!selector.disconnected().contains(connectionId)) { selector.poll(1000L); } connectionId = "testServerDisconnect_Hello2"; blockingConnect(connectionId); assertEquals("hello", blockingRequest(connectionId, "hello")); }

Target:
public void testServerDisconnect() throws Exception { String connectionId = blockingConnect(); assertEquals("hello", blockingRequest(connectionId, "hello")); this.server.closeConnections(); while (!selector.disconnected().contains(connectionId)) { selector.poll(1000L); } connectionId = blockingConnect(); assertEquals("hello", blockingRequest(connectionId, "hello")); }
Source:
public void testImagesDoesNotExist() { DiskImage diskImage1 = getNewDiskImage(); DiskImage diskImage2 = getNewDiskImage(); List<DiskImage> diskImagesFromParams = new ArrayList<>(); diskImagesFromParams.addAll(Arrays.asList(diskImage1, diskImage2)); Set<Guid> guidsForDiskImages = diskImagesFromParams.stream() .map(DiskImage::getId) .collect(Collectors.toSet()); cmd.getParameters().setDisks(guidsForDiskImages); doReturn(new ValidationResult(EngineMessage.ACTION_TYPE_FAILED_DISKS_NOT_EXIST)).when(diskImagesValidator) .diskImagesNotExist(guidsForDiskImages); ValidateTestUtils.runAndAssertValidateFailure(cmd, EngineMessage.ACTION_TYPE_FAILED_DISKS_NOT_EXIST); }

Target:
public void testImagesDoesNotExist() { DiskImage diskImage1 = getNewDiskImage(); DiskImage diskImage2 = getNewDiskImage(); List<DiskImage> diskImagesFromParams = new ArrayList<>(); diskImagesFromParams.addAll(Arrays.asList(diskImage1, diskImage2)); Set<Guid> guidsForDiskImages = new HashSet<>(Arrays.asList(Guid.newGuid(), Guid.newGuid())); cmd.getParameters().setDisks(guidsForDiskImages); doReturn(new ValidationResult(EngineMessage.ACTION_TYPE_FAILED_DISKS_NOT_EXIST)).when(diskExistenceValidator).diskImagesNotExist(); ValidateTestUtils.runAndAssertValidateFailure(cmd, EngineMessage.ACTION_TYPE_FAILED_DISKS_NOT_EXIST); }
Source:
protected abstract boolean exists() throws IOException; protected abstract ByteBuffer fileBytes() throws IOException; protected abstract ByteBuffer welcomeBytes() throws IOException; protected abstract ByteBuffer directoryListingBytes() throws IOException; protected ByteBuffer formatFileListAsHtml(File[] files) throws IOException { StringBuilder builder = new StringBuilder(); for (File file : files) { builder .append("<li><a href=\"") .append(file.getName()) .append("\">") .append(file.getName()) .append("</a></li>"); } String formattedString = String.format(DIRECTORY_LISTING_FORMAT_STRING, builder.toString()); byte[] formattedBytes = formattedString.getBytes(); ByteArrayInputStream inputStream = new ByteArrayInputStream(formattedBytes); return read(formattedBytes.length, inputStream); }

Target:
protected abstract boolean exists() throws IOException; protected abstract boolean isDirectory() throws IOException; protected abstract ByteBuffer fileBytes() throws IOException; protected abstract ByteBuffer welcomeBytes() throws IOException; protected abstract ByteBuffer directoryListingBytes() throws IOException; protected ByteBuffer read(int length, InputStream in) throws IOException { return AbstractResourceHandler.consumeInputStreamToByteBuffer(length, in); }
Source:
public ListFragment(String id, List<ISfMenuItem> items) { super(id, "list-fragment", SfMenu.this); this.add(new ListView<ISfMenuItem>("items", items) { private static final long serialVersionUID = 1L; @Override protected void populateItem(ListItem<ISfMenuItem> item) { ISfMenuItem menuItem = item.getModelObject(); SfMenu.this.map.put(menuItem.getId(), menuItem); item.add(new ItemFragment("item", menuItem)); item.add(new MenuFragment("menu", menuItem.getItems())); item.add(AttributeModifier.replace("id", menuItem.getId())); if (!menuItem.isEnabled()) { item.add(AttributeModifier.append("class", Model.of("ui-state-disabled"))); } } }); }

Target:
public ListFragment(String id, List<ISfMenuItem> items) { super(id, "list-fragment", SfMenu.this); this.add(new ListView<ISfMenuItem>("items", items) { private static final long serialVersionUID = 1L; @Override protected void populateItem(ListItem<ISfMenuItem> item) { ISfMenuItem menuItem = item.getModelObject(); if(menuItem.isEnabled()) { item.add(new ItemLinkFragment("item", menuItem)); item.add(new MenuFragment("menu", menuItem.getItems())); } else { item.add(new ItemDisableFragment("item", menuItem)); item.add(new EmptyPanel("menu")); } } }); }
Source:
public DocumentModel newDocumentModel(DocumentRef parentRef, String name, String typeName) { if (parentRef == null && name == null) { return createDocumentModel(typeName); } String parentPath = null; if (parentRef != null) { parentPath = resolveReference(parentRef).getPath(); } Map<String, Serializable> options = new HashMap<>(); options.put(CoreEventConstants.PARENT_PATH, parentPath); options.put(CoreEventConstants.DOCUMENT_MODEL_ID, name); options.put(CoreEventConstants.DESTINATION_NAME, name); DocumentModel model = createDocumentModelByParentAndType(parentRef, typeName, options); model.setPathInfo(parentPath, name); return model; }

Target:
public DocumentModel newDocumentModel(DocumentRef parentRef, String name, String typeName) { if (parentRef == null && name == null) { return createDocumentModel(typeName); } String parentPath = parentRef == null ? null : resolveReference(parentRef).getPath(); Map<String, Serializable> options = new HashMap<>(); options.put(CoreEventConstants.PARENT_PATH, parentPath); options.put(CoreEventConstants.DOCUMENT_MODEL_ID, name); options.put(CoreEventConstants.DESTINATION_NAME, name); DocumentModel model = createDocumentModelFromParentAndType(parentRef, typeName, options); model.setPathInfo(parentPath, name); return model; }
Source:
void updateGlobalPieChart() { if (getGlobalPC() == null) { fGlobalPC = new PieChart(this, SWT.NONE); getGlobalPC().getTitle().setText(fGlobalPCname); getGlobalPC().getAxisSet().getXAxis(0).getTitle().setText(""); getGlobalPC().getLegend().setVisible(true); getGlobalPC().getLegend().setPosition(SWT.RIGHT); getGlobalPC().addListener(SWT.MouseMove, fMouseListener); } else if (getGlobalPC().isDisposed() || fModel == null || fModel.getPieChartGlobalModel() == null) { return; } Map<String, Long> totalEventCountForChart = getTotalEventCountForChart(true); if(totalEventCountForChart == null){ return; } updatePieChartWithData(fGlobalPC, totalEventCountForChart, MIN_PRECENTAGE_TO_SHOW_SLICE, fOthersSliceName); }

Target:
synchronized void updateGlobalPieChart() { if (getGlobalPC() == null) { fGlobalPC = new PieChart(this, SWT.NONE); getGlobalPC().getTitle().setText(fGlobalPCname); getGlobalPC().getAxisSet().getXAxis(0).getTitle().setText(""); getGlobalPC().getLegend().setVisible(true); getGlobalPC().getLegend().setPosition(SWT.RIGHT); getGlobalPC().addListener(SWT.MouseMove, fMouseListener); } else if (getGlobalPC().isDisposed() || fModel == null || fModel.getPieChartGlobalModel() == null) { return; } Map<String, Long> totalEventCountForChart = getTotalEventCountForChart(true); if(totalEventCountForChart == null){ return; } updatePieChartWithData(fGlobalPC, totalEventCountForChart, MIN_PRECENTAGE_TO_SHOW_SLICE, fOthersSliceName); }
Source:
public SWTBotMenu contextMenu(int row, int col, String text) throws WidgetNotFoundException { assertIsLegalCell(row, col); assertNotNull(text); waitForEnabled(); rightClick(row, col); return NatTableContextMenuFinder.contextMenu(widget, text); }

Target:
public SWTBotMenu contextMenu(int row, int col, String text) throws WidgetNotFoundException { assertIsLegalCell(row, col); Assert.isNotNull(text); waitForEnabled(); rightClick(row, col); return NatTableContextMenuFinder.contextMenu(widget, text); }
Source:
public ExecutionResult executeInVR(String routerIP, String script, String args, Duration timeout) { Pair<Boolean, String> result; if (s_logger.isDebugEnabled()) { s_logger.debug("Run command on VR: " + routerIP + ", script: " + script + " with args: " + args); } try { VmwareManager mgr = getServiceContext().getStockObject(VmwareManager.CONTEXT_STOCK_NAME); result = SshHelper.sshExecute(routerIP, DefaultDomRSshPort, "root", mgr.getSystemVMKeyFile(), null, "/opt/cloud/bin/" + script + " " + args, 60000, 60000, (int)timeout.getMillis()); } catch (Exception e) { String msg = "Command failed due to " + VmwareHelper.getExceptionMessage(e); s_logger.error(msg); result = new Pair<Boolean, String>(false, msg); } if (s_logger.isDebugEnabled()) { s_logger.debug(script + " execution result: " + result.first().toString()); } return new ExecutionResult(result.first(), result.second()); }

Target:
public ExecutionResult executeInVR(String routerIP, String script, String args, Duration timeout) { Pair<Boolean, String> result; if (s_logger.isDebugEnabled()) { s_logger.debug("Run command on VR: " + routerIP + ", script: " + script + " with args: " + args); } try { VmwareManager mgr = getServiceContext().getStockObject(VmwareManager.CONTEXT_STOCK_NAME); result = SshHelper.sshExecute(routerIP, DefaultDomRSshPort, "root", mgr.getSystemVMKeyFile(), null, "/opt/cloud/bin/" + script + " " + args, VRScripts.CONNECTION_TIMEOUT, VRScripts.CONNECTION_TIMEOUT, timeout); } catch (Exception e) { String msg = "Command failed due to " + VmwareHelper.getExceptionMessage(e); s_logger.error(msg); result = new Pair<Boolean, String>(false, msg); } if (s_logger.isDebugEnabled()) { s_logger.debug(script + " execution result: " + result.first().toString()); } return new ExecutionResult(result.first(), result.second()); }
Source:
protected Map<Object, Object> getCacheByType(Object type) { if (allResourcesMap != null) { Map<Object, Object> resourcesMap = allResourcesMap.get(type); if (resourcesMap != null) { return resourcesMap; } } return Collections.<Object, Object> emptyMap(); }

Target:
protected Map<Object, Object> getCacheByType(Object type) { if (allResourcesMap != null) { Map<Object, Object> resourcesMap = allResourcesMap.get(type); if (resourcesMap != null) { return resourcesMap; } } return Collections.emptyMap(); }
Source:
private MethodSpec(Builder builder) { CodeBlock code = builder.code.build(); checkArgument(!(builder.modifiers.contains(Modifier.ABSTRACT) && hasDefaultModifier(builder.modifiers)), "abstract method %s cannot be default", builder.name); checkArgument(code.isEmpty() || !builder.modifiers.contains(Modifier.ABSTRACT) || hasDefaultModifier(builder.modifiers), "abstract method %s cannot have code", builder.name); checkArgument(!builder.varargs || lastParameterIsArray(builder.parameters), "last parameter of varargs method %s must be an array", builder.name); this.name = checkNotNull(builder.name, "name == null"); this.javadoc = builder.javadoc.build(); this.annotations = Util.immutableList(builder.annotations); this.modifiers = Util.immutableSet(builder.modifiers); this.typeVariables = Util.immutableList(builder.typeVariables); this.returnType = builder.returnType; this.parameters = Util.immutableList(builder.parameters); this.varargs = builder.varargs; this.exceptions = Util.immutableList(builder.exceptions); this.defaultValue = builder.defaultValue; this.code = code; }

Target:
private MethodSpec(Builder builder) { CodeBlock code = builder.code.build(); checkArgument(code.isEmpty() || !builder.modifiers.contains(Modifier.ABSTRACT), "abstract method %s cannot have code", builder.name); checkArgument(!builder.varargs || lastParameterIsArray(builder.parameters), "last parameter of varargs method %s must be an array", builder.name); this.name = checkNotNull(builder.name, "name == null"); this.javadoc = builder.javadoc.build(); this.annotations = Util.immutableList(builder.annotations); this.modifiers = Util.immutableSet(builder.modifiers); this.typeVariables = Util.immutableList(builder.typeVariables); this.returnType = builder.returnType; this.parameters = Util.immutableList(builder.parameters); this.varargs = builder.varargs; this.exceptions = Util.immutableList(builder.exceptions); this.defaultValue = builder.defaultValue; this.code = code; }
Source:
protected SelectRootNodeWizardPage(TmfExperimentElement experiment) { super(""); setTitle(Messages.SelectRootNodeWizardPage_WindowTitle); setDescription(Messages.SelectRootNodeWizardPage_Description); fExperiment = experiment; }

Target:
protected SelectRootNodeWizardPage(TmfExperimentElement experiment) { super(""); fExperiment = experiment; }
Source:
public void writeObject(ObjectOutput output, EncoderValueMapper object) throws IOException { output.writeObject(object.encodingClasses); }

Target:
public void writeObject(ObjectOutput output, EncoderValueMapper object) throws IOException { EncodingClasses.writeTo(output, object.encodingClasses); }
Source:
private void executeVariable(VariableTree variableTree, @Nullable Tree terminator) { if (variableTree.initializer() == null) { SymbolicValue sv = null; if (terminator != null && terminator.is(Tree.Kind.FOR_EACH_STATEMENT)) { sv = constraintManager.createSymbolicValue(variableTree); } else if (variableTree.parent().is(Tree.Kind.CATCH)) { SymbolicValue thrownSV = getCaughtException(variableTree.symbol().type()); sv = new SymbolicValue() { @Override public SymbolicValue wrappedValue() { return thrownSV; } }; programState = programState.addConstraint(sv, ObjectConstraint.NOT_NULL); } if (sv != null) { programState = programState.put(variableTree.symbol(), sv); } } else { ProgramState.Pop unstack = programState.unstackValue(1); programState = unstack.state; programState = programState.put(variableTree.symbol(), unstack.values.get(0)); } }

Target:
private void executeVariable(VariableTree variableTree, @Nullable Tree terminator) { if (variableTree.initializer() == null) { SymbolicValue sv = null; if (terminator != null && terminator.is(Tree.Kind.FOR_EACH_STATEMENT)) { sv = constraintManager.createSymbolicValue(variableTree); } else if (variableTree.parent().is(Tree.Kind.CATCH)) { sv = handleCatchVariable(variableTree.symbol().type()); programState = programState.clearStack(); programState = programState.addConstraint(sv, ObjectConstraint.NOT_NULL); } if (sv != null) { programState = programState.put(variableTree.symbol(), sv); } } else { ProgramState.Pop unstack = programState.unstackValue(1); programState = unstack.state; programState = programState.put(variableTree.symbol(), unstack.values.get(0)); } }
Source:
public File exportAPIOrAPIProductArchive(ApiTypeWrapper apiTypeWrapper, boolean isStatusPreserved, ExportFormat exportFormat) throws APIImportExportException { String archiveBasePath; if (!apiTypeWrapper.isAPIProduct()) { APIIdentifier apiIdentifier = apiTypeWrapper.getApi().getId(); archiveBasePath = exportAPIArtifacts(apiTypeWrapper.getApi(), isStatusPreserved, exportFormat); log.info("API" + apiIdentifier.getApiName() + "-" + apiIdentifier.getVersion() + " exported successfully"); } else { APIProductIdentifier apiProductIdentifier = apiTypeWrapper.getApiProduct().getId(); archiveBasePath = exportAPIProductArtifacts(apiTypeWrapper.getApiProduct(), isStatusPreserved, exportFormat); log.info("API Product" + apiProductIdentifier.getName() + "-" + apiProductIdentifier.getVersion() + " exported successfully"); } CommonUtil.archiveDirectory(archiveBasePath); FileUtils.deleteQuietly(new File(archiveBasePath)); return new File(archiveBasePath + APIConstants.ZIP_FILE_EXTENSION); }

Target:
public File exportAPIOrAPIProductArchive(ApiTypeWrapper apiTypeWrapper, boolean isStatusPreserved, ExportFormat exportFormat) throws APIImportExportException { String archiveBasePath; if (!apiTypeWrapper.isAPIProduct()) { APIIdentifier apiIdentifier = apiTypeWrapper.getApi().getId(); archiveBasePath = exportAPIArtifacts(apiTypeWrapper.getApi(), isStatusPreserved, exportFormat); if (log.isDebugEnabled()) { log.debug("API" + apiIdentifier.getApiName() + "-" + apiIdentifier.getVersion() + " exported successfully"); } } else { APIProductIdentifier apiProductIdentifier = apiTypeWrapper.getApiProduct().getId(); archiveBasePath = exportAPIProductArtifacts(apiTypeWrapper.getApiProduct(), isStatusPreserved, exportFormat); if (log.isDebugEnabled()) { log.info("API Product" + apiProductIdentifier.getName() + "-" + apiProductIdentifier.getVersion() + " exported successfully"); } } CommonUtil.archiveDirectory(archiveBasePath); FileUtils.deleteQuietly(new File(archiveBasePath)); return new File(archiveBasePath + APIConstants.ZIP_FILE_EXTENSION); }
Source:
public void testActual() { Subscriber<Integer> actual = new Subscriber<Integer>() { @Override public void onNext(Integer t) { } @Override public void onError(Throwable e) { } @Override public void onCompleted() { } }; SafeSubscriber<Integer> s = new SafeSubscriber<Integer>(actual); assertEquals(actual, s.getActual()); }

Target:
public void testActual() { Subscriber<Integer> actual = new Subscriber<Integer>() { @Override public void onNext(Integer t) { } @Override public void onError(Throwable e) { } @Override public void onCompleted() { } }; SafeSubscriber<Integer> s = new SafeSubscriber<Integer>(actual); assertSame(actual, s.getActual()); }
Source:
protected List<Name> getLogNames(LogManager manager, String names) { if (ALL_LOGS.equalsIgnoreCase(names)) { return manager.listAll(); } List<Name> ret = Arrays.asList(names.split(",")).stream().map(Name::ofUrn).collect(Collectors.toList()); for (Name name : ret) { if (!manager.exists(name)) { throw new IllegalArgumentException("Unknown log name: " + name); } } return ret; }

Target:
protected List<Name> getLogNames(LogManager manager, String names) { if (ALL_LOGS.equalsIgnoreCase(names)) { return manager.listAllNames(); } List<Name> ret = Arrays.stream(names.split(",")).map(Name::ofUrn).collect(Collectors.toList()); for (Name name : ret) { if (!manager.exists(name)) { throw new IllegalArgumentException("Unknown log name: " + name); } } return ret; }
Source:
void register(TriggerType triggerType, Action<ListViewActionContext> action) { ListViewAction viewAction = new ListViewAction(triggerType, action); actionMap.put(triggerType, viewAction); actionList.add(viewAction); }

Target:
void register(TriggerType triggerType, Action<ListViewActionContext> action) { assertValidAction(triggerType); ListViewAction viewAction = new ListViewAction(triggerType, action); actionMap.put(triggerType, viewAction); actionList.add(viewAction); }
Source:
public static final GlusterBrickEntity getBrickByQualifiedName(List<GlusterBrickEntity> bricksList, String qualifiedBrickName) { for (GlusterBrickEntity brick : bricksList) { if ((brick.getServerName() + ":" + brick.getBrickDirectory()).equals(qualifiedBrickName) || (brick.getNetworkAddress() + ":" + brick.getBrickDirectory()).equals(qualifiedBrickName)) { return brick; } } return null; }

Target:
public static final GlusterBrickEntity getBrickByQualifiedName(List<GlusterBrickEntity> bricksList, String qualifiedBrickName) { for (GlusterBrickEntity brick : bricksList) { if (brick.getQualifiedName().equals(qualifiedBrickName)) { return brick; } } return null; }
Source:
public static void main(String[] args) throws Exception { String idpEndpoint = "https://IDP-HOST:IDP-PORT/auth/realms/master/protocol/openid-connect/token"; String clientId = "IDP-CLIENT-ID"; String clientSecret = "IDP-CLIENT-SECRET"; String stsEndpoint = "http://STS-HOST:STS-PORT/"; Provider provider = new ClientGrantsProvider( () -> getJwt(clientId, clientSecret, idpEndpoint), stsEndpoint, null, null, null); MinioClient minioClient = MinioClient.builder() .endpoint("https://MINIO-HOST:MINIO-PORT") .credentialsProvider(provider) .build(); StatObjectResponse stat = minioClient.statObject( StatObjectArgs.builder().bucket("my-bucketname").object("my-objectname").build()); System.out.println(stat); }

Target:
public static void main(String[] args) throws Exception { String idpEndpoint = "https://IDP-HOST:IDP-PORT/auth/realms/master/protocol/openid-connect/token"; String clientId = "IDP-CLIENT-ID"; String clientSecret = "IDP-CLIENT-SECRET"; String stsEndpoint = "http://STS-HOST:STS-PORT/"; String policy = null; Provider provider = new ClientGrantsProvider( () -> getJwt(clientId, clientSecret, idpEndpoint), stsEndpoint, null, policy, null); MinioClient minioClient = MinioClient.builder() .endpoint("https://MINIO-HOST:MINIO-PORT") .credentialsProvider(provider) .build(); StatObjectResponse stat = minioClient.statObject( StatObjectArgs.builder().bucket("my-bucketname").object("my-objectname").build()); System.out.println(stat); }
Source:
private void initializeWriter(StoreConfiguration cfg, CacheWriter writer, InitializationContextImpl ctx) { if (writer != null) { if (writer instanceof DelegatingCacheWriter) writer.init(ctx); if (writer instanceof TransactionalCacheWriter && cfg.transactional()) txWriters.add((TransactionalCacheWriter) writer); else writers.add(writer); configMap.put(writer, cfg); } }

Target:
private void initializeWriter(StoreConfiguration cfg, CacheWriter writer, InitializationContextImpl ctx) { if (writer != null) { if (writer instanceof DelegatingCacheWriter) writer.init(ctx); if (undelegate(writer) instanceof TransactionalCacheWriter && cfg.transactional()) { if (configuration.transaction().transactionMode().isTransactional()) { txWriters.add((TransactionalCacheWriter) writer); } else { nonTxWriters.add(writer); } } else { nonTxWriters.add(writer); } configMap.put(writer, cfg); } }
Source:
protected void initProcessor(StreamProcessorDescriptor descriptor) { if (processors.containsKey(descriptor.getId())) { log.error("Processor already initialized: {}", descriptor.getId()); return; } log.info("Init Stream processor: with manager: ", descriptor.getId(), descriptor.config); LogManager manager = getLogManager(descriptor.config); Topology topology; try { topology = descriptor.klass.getDeclaredConstructor().newInstance().getTopology(descriptor.options); } catch (ReflectiveOperationException e) { throw new StreamRuntimeException("Can not create topology for processor: " + descriptor.getId(), e); } StreamProcessor streamProcessor = new LogStreamProcessor(manager); Settings settings = getSettings(descriptor); log.debug("Starting computation topology: {}\n", descriptor::getId, () -> topology.toPlantuml(settings)); streamProcessor.init(topology, settings); processors.put(descriptor.getId(), streamProcessor); }

Target:
protected void initProcessor(StreamProcessorDescriptor descriptor) { if (processors.containsKey(descriptor.getId())) { log.error("Processor already initialized: {}", descriptor.getId()); return; } log.info("Init Stream processor: with manager: {}", descriptor.getId(), descriptor.config); LogManager manager = getLogManager(descriptor.config); Topology topology; try { topology = descriptor.klass.getDeclaredConstructor().newInstance().getTopology(descriptor.options); } catch (ReflectiveOperationException e) { throw new StreamRuntimeException("Can not create topology for processor: " + descriptor.getId(), e); } StreamProcessor streamProcessor = new LogStreamProcessor(manager); Settings settings = getSettings(descriptor); log.debug("Starting computation topology: {}\n{}", descriptor::getId, () -> topology.toPlantuml(settings)); streamProcessor.init(topology, settings); processors.put(descriptor.getId(), streamProcessor); }
Source:
private void executeBatchActions( final User user, final WorkflowAction action, final ConcurrentMap<String, Object> actionsContext, final BiConsumer<List<?>, Exception> failsConsumer) throws DotDataException { final List<WorkflowActionClass> actionClasses = this.findActionClasses(action); for (final WorkflowActionClass actionClass : actionClasses) { final WorkFlowActionlet actionlet = actionClass.getActionlet(); if (actionlet instanceof BatchAction) { final Map<String, WorkflowActionClassParameter> params = findParamsForActionClass(actionClass); final BatchAction batchAction = BatchAction.class.cast(actionlet); final List <?> objects = batchAction.getObjectsForBatch(actionsContext, actionClass); try { batchAction.executeBatchAction(user, actionsContext, actionClass, params); } catch (Exception e) { failsConsumer.accept(objects, e); Logger.error(getClass(), String.format("Exception while Trying to execute action %s, in batch", actionClass.getName() ), e ); } } } }

Target:
private void executeBatchActions( final User user, final WorkflowAction action, final ConcurrentMap<String, Object> actionsContext, final BiConsumer<List<?>, Exception> failsConsumer) throws DotDataException { final List<WorkflowActionClass> actionClasses = this.findActionClasses(action); for (final WorkflowActionClass actionClass : actionClasses) { final WorkFlowActionlet actionlet = actionClass.getActionlet(); if (actionlet instanceof BatchAction) { final Map<String, WorkflowActionClassParameter> params = findParamsForActionClass(actionClass); final BatchAction batchAction = BatchAction.class.cast(actionlet); final List <?> objects = batchAction.getObjectsForBatch(actionsContext, actionClass); try { batchAction.executeBatchAction(user, actionsContext, actionClass, params); } catch (Exception e) { failsConsumer.accept(objects, e); Logger.error(getClass(), String.format("Exception while Trying to execute action %s, in batch", actionClass.getName() ), e ); break; } } } }
Source:
private void validateNewTraceName() { String newTraceName = fNewElementName.getText(); TmfCommonProjectElement element = fElement; IWorkspace workspace = element.getResource().getWorkspace(); IStatus nameStatus = workspace.validateName(newTraceName, IResource.FOLDER); if ("".equals(newTraceName)) { updateStatus(new Status(IStatus.ERROR, Activator.PLUGIN_ID, IStatus.ERROR, Messages.Dialog_EmptyNameError, null)); return; } if (!nameStatus.isOK()) { updateStatus(nameStatus); return; } IContainer parentFolder = element.getResource().getParent(); if (parentFolder.findMember(newTraceName) != null) { updateStatus(new Status(IStatus.ERROR, Activator.PLUGIN_ID, IStatus.ERROR, Messages.Dialog_ExistingNameError, null)); return; } updateStatus(new Status(IStatus.OK, Activator.PLUGIN_ID, "")); }

Target:
private void validateNewTraceName() { String newTraceName = fNewElementName.getText(); TmfCommonProjectElement element = fElement; IWorkspace workspace = element.getResource().getWorkspace(); IStatus nameStatus = workspace.validateName(newTraceName, IResource.FOLDER); if ("".equals(newTraceName)) { updateStatus(new Status(IStatus.ERROR, Activator.PLUGIN_ID, IStatus.ERROR, Messages.Dialog_EmptyNameError, null)); return; } if (!nameStatus.isOK()) { updateStatus(nameStatus); return; } IContainer parentFolder = element.getResource().getParent(); if (parentFolder.findMember(newTraceName) != null) { updateStatus(new Status(IStatus.ERROR, Activator.PLUGIN_ID, IStatus.ERROR, Messages.Dialog_ExistingNameError, null)); return; } TmfTraceFolder tracesFolderElement = element.getProject().getTracesFolder(); if (tracesFolderElement != null) { IFolder tracesFolder = tracesFolderElement.getResource(); IPath traceDestinationPath = new Path(newTraceName); if (tracesFolder.getFolder(traceDestinationPath).exists()) { updateStatus(new Status(IStatus.ERROR, Activator.PLUGIN_ID, IStatus.ERROR, Messages.Dialog_ExistingNameError, null)); return; } } updateStatus(new Status(IStatus.OK, Activator.PLUGIN_ID, "")); }
Source:
public Date getNeedBy() { try { return ((XDate) page2.getXWidget(NewActionPage2.DEADLINE)).getDate(); } catch (Exception ex) { return null; } }

Target:
public Date getNeedBy() { if (page2.hasNeedByDate()) { return ((XDate) page2.getXWidget(NewActionPage2.DEADLINE)).getDate(); } return null; }
Source:
private void executeSingleCommand(String str) { ICommand<MIInfo> cmd; if (!isMIOperation(str) && !CLIEventProcessor.isSteppingOperation(str)) { cmd = new MIInterpreterExecConsole<>(fContext, str); } else { cmd = new CLICommand<>(fContext, str); } fExecutor.execute(new DsfRunnable() { @Override public void run() { ICommandControlService commandControl = fServiceTracker.getService(ICommandControlService.class); if (commandControl != null) { commandControl.queueCommand(cmd, new ImmediateDataRequestMonitor<>()); } } }); }

Target:
private void executeSingleCommand(String str) { ICommand<MIInfo> cmd; if (!isMIOperation(str) && !CLIEventProcessor.isSteppingOperation(str)) { cmd = new MIInterpreterExecConsole<>(fContext, str); } else { cmd = new CLICommand<>(fContext, str); } fExecutor.execute(new DsfRunnable() { @Override public void run() { ICommandControlService commandControl = fServiceTracker.getService(ICommandControlService.class); if (commandControl != null) { commandControl.queueCommand(cmd, new ImmediateDataRequestMonitor<>()); } else { GdbPlugin.log(new Status( IStatus.INFO, GdbPlugin.PLUGIN_ID, "Unable to find service to execute breakpoint command")); } } }); }
Source:
public void removeAllBodies() { pendingRemoves.addAll(dynamicBodies); pendingAdds.clear(); }

Target:
public void removeAllBodies() { pendingRemoves.addAll(dynamicBodies); pendingRemoves.addAll(kineticBodies); pendingRemoves.addAll(staticBodies); pendingAdds.clear(); }
Source:
public InstallationsView(ThemeManager themeManager, JavaFxSettingsManager javaFxSettingsManager) { super(tr("Installations"), themeManager); this.javaFxSettingsManager = javaFxSettingsManager; this.filter = new InstallationsFilter(); this.selectedListWidget = new SimpleObjectProperty<>(); this.categories = FXCollections.observableArrayList(); this.installation = new SimpleObjectProperty<>(); this.getStyleClass().add("mainWindowScene"); this.activeInstallations = createInstallationListWidget(); final StringBinding openInstallations = Bindings.createStringBinding( () -> Integer.toString(this.activeInstallations.getElements().size()), this.activeInstallations.getElements()); final TabIndicator indicator = new TabIndicator(); indicator.textProperty().bind(openInstallations); this.graphicProperty().bind(Bindings.when(Bindings.notEqual(openInstallations, "0")).then(indicator) .otherwise(new SimpleObjectProperty<>())); this.filter.selectedInstallationCategoryProperty().addListener((Observable invalidation) -> closeDetailsView()); this.installationDetailsPanel = createInstallationDetailsPanel(); final InstallationSidebar installationSidebar = createInstallationsSidebar(); setSidebar(installationSidebar); setCenter(activeInstallations); }

Target:
public InstallationsView(ThemeManager themeManager, JavaFxSettingsManager javaFxSettingsManager) { super(tr("Installations"), themeManager); this.javaFxSettingsManager = javaFxSettingsManager; this.filter = new InstallationsFilter(); this.selectedListWidget = new SimpleObjectProperty<>(); this.categories = FXCollections.observableArrayList(); this.installation = new SimpleObjectProperty<>(); this.getStyleClass().add("mainWindowScene"); this.activeInstallations = createInstallationListWidget(); final IntegerBinding openInstallations = Bindings.createIntegerBinding( () -> this.activeInstallations.getElements().size(), this.activeInstallations.getElements()); final TabIndicator indicator = new TabIndicator(); indicator.textProperty().bind(StringBindings.map(openInstallations, numberOfInstallations -> { if (numberOfInstallations.intValue() < 10) { return String.valueOf(numberOfInstallations); } else { return "+"; } })); this.graphicProperty().bind(Bindings.when(Bindings.notEqual(openInstallations, 0)).then(indicator) .otherwise(new SimpleObjectProperty<>())); this.filter.selectedInstallationCategoryProperty().addListener((Observable invalidation) -> closeDetailsView()); this.installationDetailsPanel = createInstallationDetailsPanel(); final InstallationSidebar installationSidebar = createInstallationsSidebar(); setSidebar(installationSidebar); setCenter(activeInstallations); }
Source:
FatekContactItem(Item item, List<String> confItems) throws BindingConfigParseException { super(item, confItems); if (confItems.size() != 1) { throw new BindingConfigParseException("Incorect number of register for contact binding"); } }

Target:
FatekContactItem(Item item, List<String> confItems) throws BindingConfigParseException { super(item, confItems); if (confItems.size() != 1) { throw new BindingConfigParseException("Incorrect number of register for contact binding"); } String regName = confItems.get(0); if (regName.startsWith("!") ) { regName = regName.substring(1); negate = true; } else { negate = false; } try { reg1 = Reg.parse(regName); } catch (UnknownRegNameException e) { throw new BindingConfigParseException(e.getMessage()); } }
Source:
public RepositoryHandle(Repository delegate) { super(new RepositoryBuilder()); this.delegate = delegate; addListeners(listeners, delegate.getListenerList(), new WeakReference<>(this)); }

Target:
RepositoryHandle(Repository delegate) { super(new RepositoryBuilder()); Assert.isLegal(!(delegate instanceof RepositoryHandle), "Delegate of a RepositoryHandle must not be another RepositoryHandle"); this.delegate = delegate; addListeners(listeners, delegate.getListenerList(), new WeakReference<>(this)); }
Source:
public void testRelaxedExpirationOnWrite() throws Exception { initTest(StateTtlConfig.UpdateType.OnCreateAndWrite, StateTtlConfig.StateVisibility.ReturnExpiredIfNotCleanedUp); timeProvider.time = 0; ctx().update(ctx().updateEmpty); takeAndRestoreSnapshot(); timeProvider.time = 120; assertEquals(EXPIRED_AVAIL, ctx().getUpdateEmpty, ctx().get()); assertTrue(ctx().isOriginalEmptyValue()); assertEquals("Expired state should be cleared on access", ctx().emptyValue, ctx().get()); }

Target:
public void testRelaxedExpirationOnWrite() throws Exception { initTest(StateTtlConfig.UpdateType.OnCreateAndWrite, StateTtlConfig.StateVisibility.ReturnExpiredIfNotCleanedUp); timeProvider.time = 0; ctx().update(ctx().updateEmpty); takeAndRestoreSnapshot(); timeProvider.time = 120; assertEquals(EXPIRED_AVAIL, ctx().getUpdateEmpty, ctx().get()); assertTrue("Original state should be cleared on access", ctx().isOriginalEmptyValue()); assertEquals("Expired state should be cleared on access", ctx().emptyValue, ctx().get()); }
Source:
public ConnectorTestProcessor() throws IOException { tests = ImmutableSet.of(); connectors = ImmutableSet.of(); Properties properties = new Properties(); URL url = this.getClass().getClassLoader().getResource(VELOCITY_PROPERTIES); properties.load(url.openStream()); VelocityEngine velocityEngine = new VelocityEngine(properties); template = velocityEngine.getTemplate("ConnectorTest.vt"); }

Target:
public ConnectorTestProcessor() throws IOException { Reflections reflections = new Reflections("com.facebook.presto.featuretests"); tests = sanityChecked(reflections.getTypesAnnotatedWith(ConnectorTest.class)); connectors = ImmutableSet.of(); Properties properties = new Properties(); URL url = this.getClass().getClassLoader().getResource(VELOCITY_PROPERTIES); try (InputStream inputStream = url.openStream()) { properties.load(inputStream); } VelocityEngine velocityEngine = new VelocityEngine(properties); template = velocityEngine.getTemplate("ConnectorTest.vt"); }
Source:
public ExecutableType getMethodType(TypeElement includingType, ExecutableElement method) { DeclaredType asType = (DeclaredType) replaceTypeElementIfNecessary( elementUtils, includingType ).asType(); TypeMirror asMemberOf = SpecificCompilerWorkarounds.asMemberOf( asType, method, typeUtils, elementUtils ); ExecutableType methodType = asMemberOf.accept( new ExecutableTypeRetrievalVisitor(), null ); return methodType; }

Target:
public ExecutableType getMethodType(TypeElement includingType, ExecutableElement method) { DeclaredType asType = (DeclaredType) replaceTypeElementIfNecessary( elementUtils, includingType ).asType(); TypeMirror asMemberOf = typeUtils.asMemberOf( asType, method ); return (ExecutableType) asMemberOf; }
Source:
public Observable<Void> release(PooledConnection<I, O> connection) { if (null == connection) { return Observable.error(new IllegalArgumentException("Returned a null connection to the pool.")); } long startTimeMillis = Clock.newStartTimeMillis(); aquiredConnectionsCounter.decrementAndGet(); try { connection.getChannel().pipeline().fireUserEventTriggered(new PooledConnectionReleasedEvent(connection)); metricEventsSubject.onEvent(ClientMetricsEvent.POOL_RELEASE_START); if (isShutdownRequested.get() || !connection.isUsable()) { discardConnection(connection); metricEventsSubject.onEvent(ClientMetricsEvent.POOL_RELEASE_SUCCESS, Clock.onEndMillis( startTimeMillis)); performShutdownIfRequested(); return Observable.empty(); } else { idleConnections.add(connection); metricEventsSubject.onEvent(ClientMetricsEvent.POOL_RELEASE_SUCCESS, Clock.onEndMillis( startTimeMillis)); performShutdownIfRequested(); return Observable.empty(); } } catch (Throwable throwable) { metricEventsSubject.onEvent(ClientMetricsEvent.POOL_RELEASE_FAILED, Clock.onEndMillis(startTimeMillis)); performShutdownIfRequested(); return Observable.error(throwable); } }

Target:
public Observable<Void> release(PooledConnection<I, O> connection) { if (null == connection) { return Observable.error(new IllegalArgumentException("Returned a null connection to the pool.")); } long startTimeMillis = Clock.newStartTimeMillis(); try { connection.getChannel().pipeline().fireUserEventTriggered(new PooledConnectionReleasedEvent(connection)); metricEventsSubject.onEvent(ClientMetricsEvent.POOL_RELEASE_START); if (isShutdownRequested.get() || !connection.isUsable()) { discardConnection(connection); metricEventsSubject.onEvent(ClientMetricsEvent.POOL_RELEASE_SUCCESS, Clock.onEndMillis( startTimeMillis)); return Observable.empty(); } else { idleConnections.add(connection); metricEventsSubject.onEvent(ClientMetricsEvent.POOL_RELEASE_SUCCESS, Clock.onEndMillis( startTimeMillis)); return Observable.empty(); } } catch (Throwable throwable) { metricEventsSubject.onEvent(ClientMetricsEvent.POOL_RELEASE_FAILED, Clock.onEndMillis(startTimeMillis)); return Observable.error(throwable); } finally { aquiredConnectionsCounter.decrementAndGet(); } }
Source:
private Thread createThread(final Runnable target) { final ThreadNameInfo nameInfo = new ThreadNameInfo(globalThreadIndexSequence.getAndIncrement(), factoryThreadIndexSequence.getAndIncrement(), factoryIndex, node, component); Thread thread = new Thread(threadGroup, target); thread.setName(nameInfo.format(thread, threadNamePattern)); if (initialPriority != null) thread.setPriority(initialPriority); thread.setDaemon(true); return thread; }

Target:
private Thread createThread(final Runnable target) { final ThreadNameInfo nameInfo = new ThreadNameInfo(globalThreadIndexSequence.getAndIncrement(), factoryThreadIndexSequence.getAndIncrement(), factoryIndex, node, component); Thread thread = new Thread(threadGroup, target); thread.setName(nameInfo.format(thread, threadNamePattern)); thread.setPriority(initialPriority); thread.setDaemon(true); return thread; }
Source:
private Map<String, ResourceAssignment> getBestPossibleAssignment( AssignmentMetadataStore assignmentMetadataStore, CurrentStateOutput currentStateOutput, Set<String> resources) throws HelixRebalanceException { Map<String, ResourceAssignment> currentBestAssignment = Collections.emptyMap(); if (assignmentMetadataStore != null) { try { currentBestAssignment = assignmentMetadataStore.getBestPossibleAssignment(); } catch (HelixException ex) { LOG.error("Failed to get the current best possible assignment.", ex); } catch (Exception ex) { throw new HelixRebalanceException( "Failed to get the current best possible assignment because of unexpected error.", HelixRebalanceException.Type.INVALID_REBALANCER_STATUS, ex); } } if (currentBestAssignment.isEmpty()) { LOG.warn( "The current best possible assignment record is empty. Use the current states instead."); currentBestAssignment = getCurrentStateAssingment(currentStateOutput, resources); } return currentBestAssignment; }

Target:
private Map<String, ResourceAssignment> getBestPossibleAssignment( AssignmentMetadataStore assignmentMetadataStore, CurrentStateOutput currentStateOutput, Set<String> resources) throws HelixRebalanceException { Map<String, ResourceAssignment> currentBestAssignment = Collections.emptyMap(); if (assignmentMetadataStore != null) { try { LatencyMetric stateReadLatency = _metricCollector.getMetric( WagedRebalancerMetricCollector.WagedRebalancerMetricNames.StateReadLatencyGauge.name(), LatencyMetric.class); stateReadLatency.startMeasuringLatency(); currentBestAssignment = assignmentMetadataStore.getBestPossibleAssignment(); stateReadLatency.endMeasuringLatency(); } catch (HelixException ex) { LOG.error("Failed to get the current best possible assignment.", ex); } catch (Exception ex) { throw new HelixRebalanceException( "Failed to get the current best possible assignment because of unexpected error.", HelixRebalanceException.Type.INVALID_REBALANCER_STATUS, ex); } } if (currentBestAssignment.isEmpty()) { LOG.warn( "The current best possible assignment record is empty. Use the current states instead."); currentBestAssignment = getCurrentStateAssingment(currentStateOutput, resources); } return currentBestAssignment; }
Source:
public void safeRun() { if (callbackTriggered) { maybeRecycle(); return; } this.requestTimeNanos = MathUtils.nowInNano(); checkNotNull(lh); checkNotNull(lh.macManager); this.toSend = lh.macManager.computeDigestAndPackageForSending( entryId, lh.lastAddConfirmed, currentLedgerLength, payload); DistributionSchedule.WriteSet writeSet = lh.distributionSchedule.getWriteSet(entryId); try { for (int i = 0; i < writeSet.size(); i++) { sendWriteRequest(writeSet.get(i)); } } finally { hasRun = true; writeSet.recycle(); } }

Target:
public void safeRun() { hasRun = true; if (callbackTriggered) { maybeRecycle(); return; } this.requestTimeNanos = MathUtils.nowInNano(); checkNotNull(lh); checkNotNull(lh.macManager); this.toSend = lh.macManager.computeDigestAndPackageForSending( entryId, lh.lastAddConfirmed, currentLedgerLength, payload); DistributionSchedule.WriteSet writeSet = lh.distributionSchedule.getWriteSet(entryId); try { for (int i = 0; i < writeSet.size(); i++) { sendWriteRequest(writeSet.get(i)); } } finally { writeSet.recycle(); } }
Source:
public Response toolsIndexGet(SecurityContext securityContext) { List<Entry> published = getPublished(); if (!config.getEsConfiguration().getHostname().isEmpty()) { try (RestClient restClient = RestClient .builder(new HttpHost(config.getEsConfiguration().getHostname(), config.getEsConfiguration().getPort(), "http")) .build()) { LOG.info("Deleting the ES index."); try { restClient.performRequest("DELETE", "/entry"); } catch (Exception e) { throw new CustomWebApplicationException(e.getMessage(), HttpStatus.SC_INTERNAL_SERVER_ERROR); } URL url = Resources.getResource("queries/mapping.json"); String text = Resources.toString(url, StandardCharsets.UTF_8); HttpEntity mappingEntity = new NStringEntity(text, ContentType.APPLICATION_JSON); LOG.info("Recreating the ES index."); restClient.performRequest("PUT", "/entry", Collections.emptyMap(), mappingEntity); ElasticManager elasticManager = new ElasticManager(); elasticManager.bulkUpsert(published); } catch (IOException e) { throw new CustomWebApplicationException(e.getMessage(), HttpStatus.SC_INTERNAL_SERVER_ERROR); } return Response.ok().entity(published.size()).build(); } return Response.ok().entity(0).build(); }

Target:
public Response toolsIndexGet(SecurityContext securityContext) { List<Entry> published = getPublished(); if (!config.getEsConfiguration().getHostname().isEmpty() && !published.isEmpty()) { try (RestClient restClient = RestClient .builder(new HttpHost(config.getEsConfiguration().getHostname(), config.getEsConfiguration().getPort(), "http")) .build()) { try { restClient.performRequest("DELETE", "/entry"); } catch (Exception e) { e.printStackTrace(); } URL url = Resources.getResource("queries/mapping.json"); String text = Resources.toString(url, StandardCharsets.UTF_8); HttpEntity mappingEntity = new NStringEntity(text, ContentType.APPLICATION_JSON); restClient.performRequest("PUT", "/entry", Collections.emptyMap(), mappingEntity); ElasticManager elasticManager = new ElasticManager(); elasticManager.bulkUpsert(published); } catch (IOException e) { throw new CustomWebApplicationException(e.getMessage(), HttpStatus.SC_INTERNAL_SERVER_ERROR); } return Response.ok().entity(published.size()).build(); } return Response.ok().entity(0).build(); }
Source:
public ASTNode visit(TermCons tc, Void _) throws ParseFailedException { if (!tc.getProduction().getItems().isEmpty() && tc.getProduction().getItems().get(0) instanceof UserList) { UserList ulist = (UserList) tc.getProduction().getItems().get(0); tc.getContents().set(0, (Term) preferStrict(ulist.getSort(), tc.getContents().get(0))); tc.getContents().set(1, (Term) preferStrict(tc.getProduction().getSort(), tc.getContents().get(1))); } else { int j = 0; Production prd = tc.getProduction(); for (int i = 0; i < prd.getItems().size(); i++) { if (prd.getItems().get(i) instanceof Sort) { Sort sort = (Sort) prd.getItems().get(i); Term child = (Term) tc.getContents().get(j); tc.getContents().set(j, (Term) new TypeSystemFilter2(sort.getName(), context).visitNode(child)); j++; } } } return super.visit(tc, _); }

Target:
public ASTNode visit(TermCons tc, Void _) throws ParseFailedException { if (tc.getProduction().isListDecl()) { UserList ulist = tc.getProduction().getListDecl(); tc.getContents().set(0, (Term) preferStrict(ulist.getSort(), tc.getContents().get(0))); tc.getContents().set(1, (Term) preferStrict(tc.getProduction().getSort(), tc.getContents().get(1))); } else { int j = 0; for (int i = 0; i < tc.getContents().size(); i++) { tc.getContents().set(i, (Term) new TypeSystemFilter2(tc.getProduction().getChildSort(i), context).visitNode(tc.getContents().get(i))); } } return super.visit(tc, _); }
Source:
public static boolean isBeginningOfEntity(String label) { return StringUtils.startsWith(label, TaggingLabels.GROBID_START_ENTITY_LABEL_PREFIX) || StringUtil.startsWith(label, TaggingLabels.IOB_START_ENTITY_LABEL_PREFIX) || StringUtil.startsWith(label, TaggingLabels.ENAMEX_START_ENTITY_LABEL_PREFIX); }

Target:
public static boolean isBeginningOfEntity(String label) { return StringUtils.startsWith(label, TaggingLabels.GROBID_START_ENTITY_LABEL_PREFIX) || StringUtil.startsWith(label, TaggingLabels.ENAMEX_START_ENTITY_LABEL_PREFIX); }