auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public DataSection isSolvedBody(Patient patient) { String sectionName = "isSolved"; Set<String> present = this.enabledHeaderIdsBySection.get(sectionName); if (present == null || present.isEmpty()) { return null; } DataSection bodySection = new DataSection(); PatientData<SolvedData> patientData = patient.getData("solved"); SolvedData data = patientData != null ? patientData.getValue() : null; int x = 0; if (present.contains(SolvedData.STATUS_PROPERTY_NAME)) { String solved = data != null ? data.getStatus() : null; DataCell cell = new DataCell(solved != null ? ConversionHelpers.strIntegerToStrBool(solved) : "", x, 0); bodySection.addCell(cell); x++; } if (present.contains(SolvedData.PUBMED_ID_PROPERTY_NAME)) { List<String> pubmedIds = data != null ? data.getPubmedIds() : null; if (!pubmedIds.isEmpty()) { int y = 0; for (String id : pubmedIds) { DataCell cell = new DataCell(StringUtils.isBlank(id) ? "" : id, x, y); bodySection.addCell(cell); y++; } x++; } } if (present.contains(SolvedData.NOTES_PROPERTY_NAME)) { String solvedNotes = data != null ? data.getNotes() : null; for (DataCell cell : ConversionHelpers.preventOverflow(solvedNotes, x, 0)) { cell.setMultiline(); bodySection.addCell(cell); } x++; } return bodySection; }

Target:
public DataSection isSolvedBody(Patient patient) { String sectionName = "isSolved"; Set<String> present = this.enabledHeaderIdsBySection.get(sectionName); if (present == null || present.isEmpty()) { return null; } DataSection bodySection = new DataSection(); PatientData<SolvedData> patientData = patient.getData("solved"); SolvedData data = patientData != null ? patientData.getValue() : null; int x = 0; if (present.contains(SolvedData.STATUS_PROPERTY_NAME)) { String solved = data != null ? data.getStatus() : null; DataCell cell = new DataCell(solved != null ? ConversionHelpers.strIntegerToStrBool(solved) : "", x, 0); bodySection.addCell(cell); x++; } if (present.contains(SolvedData.PUBMED_ID_PROPERTY_NAME)) { List<String> pubmedIds = data != null ? data.getPubmedIds() : Collections.emptyList(); if (!pubmedIds.isEmpty()) { int y = 0; for (String id : pubmedIds) { DataCell cell = new DataCell(StringUtils.isBlank(id) ? "" : id, x, y); bodySection.addCell(cell); y++; } x++; } } if (present.contains(SolvedData.NOTES_PROPERTY_NAME)) { String solvedNotes = data != null ? data.getNotes() : null; for (DataCell cell : ConversionHelpers.preventOverflow(solvedNotes, x, 0)) { cell.setMultiline(); bodySection.addCell(cell); } x++; } return bodySection; }
Source:
public boolean process(HttpServletRequest request, HttpServletResponse response, FilterChain chain) throws IOException, ServletException { Object apiTokenValid = request.getAttribute(BasicHeaderApiTokenAuthenticator.class.getName()); if (apiTokenValid != null && apiTokenValid == Boolean.TRUE) { chain.doFilter(request, response); return true; } return false; }

Target:
public boolean process(HttpServletRequest request, HttpServletResponse response, FilterChain chain) throws IOException, ServletException { if (Boolean.TRUE.equals(request.getAttribute(BasicHeaderApiTokenAuthenticator.class.getName()))) { chain.doFilter(request, response); return true; } return false; }
Source:
public static ImmutableBitmap matchPredicate( final String dimension, final BitmapIndexSelector selector, final Predicate<String> predicate ) { if (predicate == null) { return selector.getBitmapFactory().makeEmptyImmutableBitmap(); } final Indexed<String> dimValues = selector.getDimensionValues(dimension); if (dimValues == null || dimValues.size() == 0) { if (predicate.apply(null)) { return selector.getBitmapFactory().complement( selector.getBitmapFactory().makeEmptyImmutableBitmap(), selector.getNumRows() ); } else { return selector.getBitmapFactory().makeEmptyImmutableBitmap(); } } final BitmapIndex bitmapIndex = selector.getBitmapIndex(dimension); return selector.getBitmapFactory().union( new Iterable<ImmutableBitmap>() { @Override public Iterator<ImmutableBitmap> iterator() { return new Iterator<ImmutableBitmap>() { int currIndex = 0; @Override public boolean hasNext() { return currIndex < bitmapIndex.getCardinality(); } @Override public ImmutableBitmap next() { while (currIndex < bitmapIndex.getCardinality() && !predicate.apply(dimValues.get(currIndex))) { currIndex++; } if (currIndex == bitmapIndex.getCardinality()) { return bitmapIndex.getBitmapFactory().makeEmptyImmutableBitmap(); } return bitmapIndex.getBitmap(currIndex++); } @Override public void remove() { throw new UnsupportedOperationException(); } }; } } ); }

Target:
public static ImmutableBitmap matchPredicate( final String dimension, final BitmapIndexSelector selector, final Predicate<String> predicate ) { Preconditions.checkNotNull(dimension, "dimension"); Preconditions.checkNotNull(selector, "selector"); Preconditions.checkNotNull(predicate, "predicate"); final Indexed<String> dimValues = selector.getDimensionValues(dimension); if (dimValues == null || dimValues.size() == 0) { if (predicate.apply(null)) { return selector.getBitmapFactory().complement( selector.getBitmapFactory().makeEmptyImmutableBitmap(), selector.getNumRows() ); } else { return selector.getBitmapFactory().makeEmptyImmutableBitmap(); } } final BitmapIndex bitmapIndex = selector.getBitmapIndex(dimension); return selector.getBitmapFactory().union( new Iterable<ImmutableBitmap>() { @Override public Iterator<ImmutableBitmap> iterator() { return new Iterator<ImmutableBitmap>() { int currIndex = 0; @Override public boolean hasNext() { return currIndex < bitmapIndex.getCardinality(); } @Override public ImmutableBitmap next() { while (currIndex < bitmapIndex.getCardinality() && !predicate.apply(dimValues.get(currIndex))) { currIndex++; } if (currIndex == bitmapIndex.getCardinality()) { return bitmapIndex.getBitmapFactory().makeEmptyImmutableBitmap(); } return bitmapIndex.getBitmap(currIndex++); } @Override public void remove() { throw new UnsupportedOperationException(); } }; } } ); }
Source:
@Test public final void blankNodesTest() throws IOException { Dataset ds = null; Model m = ModelFactory.createDefaultModel(); Model m2 = ModelFactory.createDefaultModel(); ds = DatasetFactory.create(m); String namedModelName = "<LINK_0>"; ds.addNamedModel(namedModelName, m2); Resource s = m.createResource(); m.add(s, RDFS.label, "blank node 1 in default graph"); s = m2.createResource(); m2.add(s, RDFS.label, "blank node 2 in named graph"); s = m.createResource(AnonId.create("_:foo")); m.add(s, RDFS.label, "_:foo in default graph"); s = m2.createResource(AnonId.create("_:foo")); m2.add(s, RDFS.label, "_:foo in named graph"); s = m.createResource(AnonId.create("xxx")); m.add(s, RDFS.label, "xxx in default"); s = m2.createResource(AnonId.create("xxx")); m2.add(s, RDFS.label, "xxx in named"); s = m.createResource(AnonId.create("_:b0")); m.add(s, RDFS.label, "? in default graph"); s = m2.createResource(AnonId.create("_:b0")); m2.add(s, RDFS.label, "? in named graph"); String jsonld = dataset2jsonld(ds.asDatasetGraph(), RDFFormat.JSONLD, null); System.out.println(jsonld); assertTrue(jsonld.indexOf("\"_:foo\"") > -1); assertTrue(jsonld.indexOf("\"xxx\"") < 0); Dataset ds2 = jsonld2dataset(jsonld, null); assertTrue(ds2.getDefaultModel().isIsomorphicWith(ds.getDefaultModel())); assertTrue(ds2.getNamedModel(namedModelName).isIsomorphicWith(ds.getNamedModel(namedModelName))); }

Target:
@Test public final void blankNodesTest() throws IOException { Dataset ds = null; Model m = ModelFactory.createDefaultModel(); Model m2 = ModelFactory.createDefaultModel(); ds = DatasetFactory.create(m); String namedModelName = "<LINK_0>"; ds.addNamedModel(namedModelName, m2); Resource s = m.createResource(); m.add(s, RDFS.label, "blank node 1 in default graph"); s = m2.createResource(); m2.add(s, RDFS.label, "blank node 2 in named graph"); s = m.createResource(AnonId.create("_:foo")); m.add(s, RDFS.label, "_:foo in default graph"); s = m2.createResource(AnonId.create("_:foo")); m2.add(s, RDFS.label, "_:foo in named graph"); s = m.createResource(AnonId.create("xxx")); m.add(s, RDFS.label, "xxx in default"); s = m2.createResource(AnonId.create("xxx")); m2.add(s, RDFS.label, "xxx in named"); s = m.createResource(AnonId.create("_:b0")); m.add(s, RDFS.label, "? in default graph"); s = m2.createResource(AnonId.create("_:b0")); m2.add(s, RDFS.label, "? in named graph"); String jsonld = dataset2jsonld(ds.asDatasetGraph(), RDFFormat.JSONLD, null); System.out.println(jsonld); assertTrue(jsonld.contains("\"_:foo\"")); assertFalse(jsonld.contains("\"xxx\"")); Dataset ds2 = jsonld2dataset(jsonld, null); assertTrue(ds2.getDefaultModel().isIsomorphicWith(ds.getDefaultModel())); assertTrue(ds2.getNamedModel(namedModelName).isIsomorphicWith(ds.getNamedModel(namedModelName))); }
Source:
public ServerConfigResource(ServerInventory serverInventory, ControlledProcessState processState, String serverName, File domainDataDir, Resource delegate) { super(delegate); this.serverInventory = serverInventory; this.serverName = serverName; this.processState = processState; this.autoStartDataDir = Paths.get(domainDataDir.toURI()).resolve("auto-start"); try { if (Files.notExists(autoStartDataDir)) { Files.createDirectory(autoStartDataDir); } } catch (IOException ex) { HostControllerLogger.ROOT_LOGGER.couldNotCreateDomainAutoStartDirectory(autoStartDataDir, ex); } }

Target:
public ServerConfigResource(ServerInventory serverInventory, ControlledProcessState processState, String serverName, File domainDataDir, Resource delegate) { super(delegate); this.serverInventory = serverInventory; this.serverName = serverName; this.processState = processState; this.autoStartDataDir = domainDataDir.toPath().resolve("auto-start"); try { if (Files.notExists(autoStartDataDir)) { Files.createDirectory(autoStartDataDir); } } catch (IOException ex) { throw HostControllerLogger.ROOT_LOGGER.couldNotCreateDomainAutoStartDirectory(autoStartDataDir, ex); } }
Source:
public void bulkUpdateAgentAttributes(AgentInstances agentInstances, final Username username, final LocalizedOperationResult result, final List<String> uuids, final List<String> resourcesToAdd, final List<String> resourcesToRemove, final List<String> environmentsToAdd, final List<String> environmentsToRemove, final TriState enable) { Localizable.CurryableLocalizable successMessage = LocalizedMessage.string("BULK_AGENT_UPDATE_SUCESSFUL", StringUtils.join(uuids, ", ")); EntityConfigUpdateCommand<Agents> agentsEntityConfigUpdateCommand = new AgentsEntityConfigUpdateCommand(agentInstances, username, result, uuids, environmentsToAdd, environmentsToRemove, enable, resourcesToAdd, resourcesToRemove, goConfigService); try { goConfigService.updateConfig(agentsEntityConfigUpdateCommand, username); if(result.isSuccessful()){ result.setMessage(successMessage); } } catch (Exception e) { LOGGER.error("There was an error bulk updating agents", e); if (!result.hasMessage()) { result.internalServerError(LocalizedMessage.string("INTERNAL_SERVER_ERROR")); } } }

Target:
public void bulkUpdateAgentAttributes(AgentInstances agentInstances, final Username username, final LocalizedOperationResult result, final List<String> uuids, final List<String> resourcesToAdd, final List<String> resourcesToRemove, final List<String> environmentsToAdd, final List<String> environmentsToRemove, final TriState enable) { Localizable.CurryableLocalizable successMessage = LocalizedMessage.string("BULK_AGENT_UPDATE_SUCESSFUL", StringUtils.join(uuids, ", ")); EntityConfigUpdateCommand<Agents> agentsEntityConfigUpdateCommand = new AgentsEntityConfigUpdateCommand(agentInstances, username, result, uuids, environmentsToAdd, environmentsToRemove, enable, resourcesToAdd, resourcesToRemove, goConfigService); try { goConfigService.updateConfig(agentsEntityConfigUpdateCommand, username); if(result.isSuccessful()){ result.setMessage(successMessage); } } catch (Exception e) { LOGGER.error("There was an error bulk updating agents", e); if(e instanceof GoConfigInvalidException && !result.hasMessage()) { result.unprocessableEntity(LocalizedMessage.string("ENTITY_CONFIG_VALIDATION_FAILED", Agents.class.getAnnotation(ConfigTag.class).value(), uuids, e.getMessage())); } else if(!result.hasMessage()) { result.internalServerError(LocalizedMessage.string("INTERNAL_SERVER_ERROR")); } } }
Source:
private static String languageCodeToSubdomain(@NonNull String languageCode) { switch (languageCode) { case AppLanguageLookUpTable.SIMPLIFIED_CHINESE_LANGUAGE_CODE: case AppLanguageLookUpTable.TRADITIONAL_CHINESE_LANGUAGE_CODE: return Locale.CHINA.getLanguage(); case AppLanguageLookUpTable.NORWEGIAN_BOKMAL_LANGUAGE_CODE: return AppLanguageLookUpTable.NORWEGIAN_LEGACY_LANGUAGE_CODE; default: return languageCode; } }

Target:
private static String languageCodeToSubdomain(@NonNull String languageCode) { switch (languageCode) { case AppLanguageLookUpTable.SIMPLIFIED_CHINESE_LANGUAGE_CODE: case AppLanguageLookUpTable.TRADITIONAL_CHINESE_LANGUAGE_CODE: return AppLanguageLookUpTable.CHINESE_LANGUAGE_CODE; case AppLanguageLookUpTable.NORWEGIAN_BOKMAL_LANGUAGE_CODE: return AppLanguageLookUpTable.NORWEGIAN_LEGACY_LANGUAGE_CODE; default: return languageCode; } }
Source:
public void tearDown() throws SQLException { TimeZone.setDefault(saveTZ); TestUtil.dropTable(con, "table1"); TestUtil.closeDB(con); }

Target:
public void tearDown() throws SQLException { TestUtil.dropTable(con, "table1"); TestUtil.closeDB(con); }
Source:
public DescribeConfigsResponse(Struct struct, short version) { this.data = new DescribeConfigsResponseData(struct, version); if (version == 0) { for (DescribeConfigsResult result : data.results()) { for (DescribeConfigsResponseData.DescribeConfigsResourceResult x : result.configs()) { if (x.isDefault()) { x.setConfigSource(ConfigSource.DEFAULT_CONFIG.id); } else { if (result.resourceType() == ConfigResource.Type.BROKER.id()) { x.setConfigSource(ConfigSource.STATIC_BROKER_CONFIG.id); } else if (result.resourceType() == ConfigResource.Type.TOPIC.id()) { x.setConfigSource(ConfigSource.TOPIC_CONFIG.id); } else { x.setConfigSource(ConfigSource.UNKNOWN_CONFIG.id); } } } } } }

Target:
public DescribeConfigsResponse(Struct struct, short version) { this.data = new DescribeConfigsResponseData(struct, version); if (version == 0) { for (DescribeConfigsResult result : data.results()) { for (DescribeConfigsResponseData.DescribeConfigsResourceResult config : result.configs()) { if (config.isDefault()) { config.setConfigSource(ConfigSource.DEFAULT_CONFIG.id); } else { if (result.resourceType() == ConfigResource.Type.BROKER.id()) { config.setConfigSource(ConfigSource.STATIC_BROKER_CONFIG.id); } else if (result.resourceType() == ConfigResource.Type.TOPIC.id()) { config.setConfigSource(ConfigSource.TOPIC_CONFIG.id); } else { config.setConfigSource(ConfigSource.UNKNOWN.id); } } } } } }
Source:
public int isApplicable(VElement vElement, ViewModelContext context) { if (!VControl.class.isInstance(vElement)) { return NOT_APPLICABLE; } final VControl control = (VControl) vElement; final IObservableValue observableValue = Activator.getDefault().getEMFFormsDatabinding() .getObservableValue(control.getDomainModelReference(), context.getDomainModel()); final EStructuralFeature feature = (EStructuralFeature) observableValue.getValueType(); final EObject eObject = (EObject) ((IObserving) observableValue).getObserved(); return isApplicable(feature, eObject); }

Target:
public int isApplicable(VElement vElement, ViewModelContext context) { if (!VControl.class.isInstance(vElement)) { return NOT_APPLICABLE; } final VControl control = (VControl) vElement; final IValueProperty valueProperty = Activator.getDefault().getEMFFormsDatabinding() .getValueProperty(control.getDomainModelReference()); final EStructuralFeature feature = (EStructuralFeature) valueProperty.getValueType(); return isApplicable(feature); }
Source:
private URL createSimpleManagementOperationUrl() throws URISyntaxException, IOException { return new URL("http://" + host + ":9990/management?operation=attribute&name=server-state"); }

Target:
private URL createSimpleManagementOperationUrl() throws URISyntaxException, IOException { return new URL("http://" + TestSuiteEnvironment.getServerAddress() + ":" + TestSuiteEnvironment.getServerPort() + "/management?operation=attribute&name=server-state"); }
Source:
public final void checkCreatePermission(@Nonnull ItemGroup c, @Nonnull TopLevelItemDescriptor d) { Authentication a = Jenkins.getAuthentication(); if (!hasCreatePermission(a, c, d)) { throw new AccessDeniedException(Messages.AccessDeniedException2_MissingPermission(a.getName(), "Item/CREATE/" + d.getDisplayName())); } }

Target:
public final void checkCreatePermission(@Nonnull ItemGroup c, @Nonnull TopLevelItemDescriptor d) { Authentication a = Jenkins.getAuthentication(); if (!hasCreatePermission(a, c, d)) { throw new AccessDeniedException(Messages.AccessDeniedException2_MissingPermission(a.getName(), Item.CREATE.getDisplayName() + "/" + d.getDisplayName())); } }
Source:
public Validation validate(Validation val) { if (systemEnvironment.getPropertyImpl("jetty.home").equals("")) { systemEnvironment.setProperty("jetty.home", systemEnvironment.getPropertyImpl("user.dir")); } systemEnvironment.setProperty("jetty.base", systemEnvironment.getPropertyImpl("jetty.home")); File home = new File(systemEnvironment.getPropertyImpl("jetty.home")); File work = new File(systemEnvironment.getPropertyImpl("jetty.home"), "work"); if (home.exists()) { if (work.exists()) { try { FileUtils.deleteDirectory(work); } catch (IOException e) { String message = format("Error trying to remove Jetty working directory {0}: {1}", work.getAbsolutePath(), e); return val.addError(new RuntimeException(message)); } } work.mkdir(); } return Validation.SUCCESS; }

Target:
public Validation validate(Validation val) { if (StringUtils.isBlank(systemEnvironment.getPropertyImpl("jetty.home"))) { systemEnvironment.setProperty("jetty.home", systemEnvironment.getPropertyImpl("user.dir")); } systemEnvironment.setProperty("jetty.base", systemEnvironment.getPropertyImpl("jetty.home")); File home = new File(systemEnvironment.getPropertyImpl("jetty.home")); File work = new File(systemEnvironment.getPropertyImpl("jetty.home"), "work"); if (home.exists()) { if (work.exists()) { try { FileUtils.deleteDirectory(work); } catch (IOException e) { String message = format("Error trying to remove Jetty working directory {0}: {1}", work.getAbsolutePath(), e); return val.addError(new RuntimeException(message)); } } work.mkdir(); } return Validation.SUCCESS; }
Source:
private BuildCommand isRepositoryChanged(String workingDir) { return test("-ncontains", "URL: " + StringUtil.removeTrailingSlash(material.getUrl()), svn("info", "--non-interactive", workingDir)); }

Target:
private BuildCommand isRepositoryChanged(String workingDir) { return test("-ncontains", "URL: " + StringUtil.removeTrailingSlash(material.getUrl()) + "\n", svn("info", "--non-interactive", workingDir)); }
Source:
private void parseDelete(final ReceiveCommand cmd) { RefControl ctl = projectControl.controlForRef(cmd.getRefName()); if (ctl.canDelete()) { } else { if (GitRepositoryManager.REF_CONFIG.equals(ctl.getRefName())) { reject(cmd, "Cannot delete project configuration"); } else { addError(Error.DELETE, ctl.getRefName()); reject(cmd, String.format("%s cannot delete references", displayName(ctl))); } } }

Target:
private void parseDelete(final ReceiveCommand cmd) { RefControl ctl = projectControl.controlForRef(cmd.getRefName()); if (ctl.canDelete()) { } else { if (GitRepositoryManager.REF_CONFIG.equals(ctl.getRefName())) { reject(cmd, "cannot delete project configuration"); } else { addError(Error.DELETE, ctl); reject(cmd, "can not delete references"); } } }
Source:
protected void onMethodInvocationFound(MethodInvocationTree mit) { ExpressionTree firstArg = mit.arguments().get(0); ExpressionTree value = getValueOrPropertyDefaultValue(firstArg); if (value.is(Tree.Kind.STRING_LITERAL)) { checkIssue(firstArg, (LiteralTree) value); } }

Target:
protected void onMethodInvocationFound(MethodInvocationTree mit) { ExpressionTree firstArg = mit.arguments().get(0); ExpressionTree defaultValue = JavaPropertiesHelper.retrievedPropertyDefaultValue(firstArg); String firstArgStringValue = ExpressionsHelper.getConstantValueAsString(defaultValue != null ? defaultValue : firstArg).value(); if (firstArgStringValue != null) { checkIssue(firstArg, firstArgStringValue); } }
Source:
private Endpoint validateIntentForSessionEndpoint(Intent intent) { String sessionEndpointId = intent.getStringExtra(SESSION_ENDPOINT_ID); Endpoint endpoint = CommCareApplication.instance().getCommCarePlatform().getEndpoint(sessionEndpointId); if (endpoint == null) { Hashtable<String, Endpoint> allEndpoints = CommCareApplication.instance().getCommCarePlatform().getAllEndpoints(); String invalidEndpointError = org.commcare.utils.StringUtils.getStringRobust( this, R.string.session_endpoint_unavailable, new String[]{ endpoint.getId(), StringUtils.join(allEndpoints.keySet(), ",")}); UserfacingErrorHandling.createErrorDialog(this, invalidEndpointError, true); return null; } Bundle intentArgumentsAsBundle = intent.getBundleExtra(SESSION_ENDPOINT_ARGUMENTS_BUNDLE); ArrayList intentArgumentsAsList = getIntent().getStringArrayListExtra(SESSION_ENDPOINT_ARGUMENTS_LIST); int numOfArgumentsInIntent = intentArgumentsAsBundle == null ? (intentArgumentsAsList == null ? 0 : intentArgumentsAsList.size()) : intentArgumentsAsBundle.size(); if (endpoint.getArguments().size() != numOfArgumentsInIntent) { String invalidEndpointArgsError = org.commcare.utils.StringUtils.getStringRobust( this, R.string.session_endpoint_invalid_arguments, new String[]{ endpoint.getId(), StringUtils.join(intentArgumentsAsBundle, ","), StringUtils.join(endpoint.getArguments(), ",")}); UserfacingErrorHandling.createErrorDialog(this, invalidEndpointArgsError, true); return null; } return endpoint; }

Target:
private Endpoint validateIntentForSessionEndpoint(Intent intent) { String sessionEndpointId = intent.getStringExtra(SESSION_ENDPOINT_ID); Endpoint endpoint = CommCareApplication.instance().getCommCarePlatform().getEndpoint(sessionEndpointId); if (endpoint == null) { Hashtable<String, Endpoint> allEndpoints = CommCareApplication.instance().getCommCarePlatform().getAllEndpoints(); String invalidEndpointError = org.commcare.utils.StringUtils.getStringRobust( this, R.string.session_endpoint_unavailable, new String[]{ endpoint.getId(), StringUtils.join(allEndpoints.keySet(), ",")}); UserfacingErrorHandling.createErrorDialog(this, invalidEndpointError, true); return null; } return endpoint; }
Source:
protected void showOrHideNodeActions(boolean forLog, ProcessInstanceSummary processInstance) { if (forLog || processInstance.getState() != ProcessInstance.STATE_ACTIVE) { view.showOrHideNodeActions(false); }else{ view.showOrHideNodeActions(true); } }

Target:
protected void showOrHideNodeActions(boolean forLog, ProcessInstanceSummary processInstance) { if (forLog || processInstance.getState() != ProcessInstance.STATE_ACTIVE) { view.hideNodeActions(); } else { view.showNodeActions(); } }
Source:
public IStatus runInWorkspace(IProgressMonitor monitor) throws CoreException { try { getJobManager().join(EasymportJob.class, monitor); } catch (InterruptedException ex) { throw new CoreException(new Status(IStatus.WARNING, Activator.getDefault().getBundle().getSymbolicName(), ex.getMessage(), ex)); } synchronized (this.toProcess) { this.started = true; } try { LifecycleMappingDiscoveryRequest discoveryRequest = LifecycleMappingDiscoveryHelper .createLifecycleMappingDiscoveryRequest(toProcess, monitor); if (discoveryRequest.isMappingComplete()) { return Status.OK_STATUS; } discoverProposals(discoveryRequest, monitor); openProposalWizard(toProcess, discoveryRequest); this.toProcess.clear(); } finally { this.toProcess.clear(); } return Status.OK_STATUS; }

Target:
public IStatus runInWorkspace(IProgressMonitor monitor) throws CoreException { try { getJobManager().join(EasymportJob.class, monitor); } catch (InterruptedException ex) { throw new CoreException(new Status(IStatus.WARNING, Activator.getDefault().getBundle().getSymbolicName(), ex.getMessage(), ex)); } synchronized (this.toProcess) { this.started = true; } try { LifecycleMappingDiscoveryRequest discoveryRequest = LifecycleMappingDiscoveryHelper .createLifecycleMappingDiscoveryRequest(toProcess, monitor); if (discoveryRequest.isMappingComplete()) { return Status.OK_STATUS; } discoverProposals(discoveryRequest, monitor); openProposalWizard(toProcess, discoveryRequest); } finally { this.toProcess.clear(); } return Status.OK_STATUS; }
Source:
private void addActionsToToolbar() { importAction = new Action("Import...") { @Override public void run() { GitCloneWizard wiz = new GitCloneWizard(); wiz.init(null, null); new WizardDialog(getSite().getShell(), wiz).open(); updateDirStrings(new NullProgressMonitor()); } }; importAction.setToolTipText("Import (clone) a Git Repository"); getViewSite().getActionBars().getToolBarManager().add(importAction); addAction = new Action("Add...") { @Override public void run() { RepositorySearchDialog sd = new RepositorySearchDialog( getSite().getShell(), ResourcesPlugin.getWorkspace() .getRoot().getLocation().toOSString(), getGitDirs()); if (sd.open() == Window.OK) { Set<String> dirs = new HashSet<String>(); dirs.addAll(getGitDirs()); if (dirs.addAll(sd.getDirectories())) saveDirStrings(dirs); scheduleRefresh(); } } }; addAction.setToolTipText("Add an existing Git Repository"); getViewSite().getActionBars().getToolBarManager().add(addAction); refreshAction = new Action("Refresh") { @Override public void run() { scheduleRefresh(); } }; getViewSite().getActionBars().getToolBarManager().add(refreshAction); }

Target:
private void addActionsToToolbar() { importAction = new Action( RepositoryViewUITexts.RepositoriesView_Import_Button) { @Override public void run() { GitCloneWizard wiz = new GitCloneWizard(); wiz.init(null, null); new WizardDialog(getSite().getShell(), wiz).open(); updateDirStrings(new NullProgressMonitor()); } }; importAction .setToolTipText(RepositoryViewUITexts.RepositoriesView_Clone_Tooltip); getViewSite().getActionBars().getToolBarManager().add(importAction); addAction = new Action( RepositoryViewUITexts.RepositoriesView_Add_Button) { @Override public void run() { RepositorySearchDialog sd = new RepositorySearchDialog( getSite().getShell(), ResourcesPlugin.getWorkspace() .getRoot().getLocation().toOSString(), getGitDirs()); if (sd.open() == Window.OK) { Set<String> dirs = new HashSet<String>(); dirs.addAll(getGitDirs()); if (dirs.addAll(sd.getDirectories())) saveDirStrings(dirs); scheduleRefresh(); } } }; addAction .setToolTipText(RepositoryViewUITexts.RepositoriesView_AddRepository_Tooltip); getViewSite().getActionBars().getToolBarManager().add(addAction); refreshAction = new Action( RepositoryViewUITexts.RepositoriesView_Refresh_Button) { @Override public void run() { scheduleRefresh(); } }; getViewSite().getActionBars().getToolBarManager().add(refreshAction); }
Source:
void release(Object connection) { Reference<Object> connReference = new Reference<>(connection); lock.lock(); try { int count = getConnectionRefCount(connReference) - 1; ConnectionHandler<Object> connectionHandler = connections.get(connReference).getSecond(); if (count > 0) { connections.put(connReference, new Pair(count, connectionHandler)); return; } if (connectionHandler != null) { connectionHandler.release(); } connections.remove(connReference); } finally { lock.unlock(); } }

Target:
void release(Object connection) { decreaseConnectionReferenceCount(new Reference<>(connection), connHandler -> { if (connHandler != null) connHandler.release(); }); }
Source:
private void _pushCounters() { int sizeJVMMetrics = 0; _logger.debug("Pushing monitor service counters for {}.", HOSTNAME); Map<Metric, Double> counters = new HashMap<>(); _updateJVMStatsCounters(); sizeJVMMetrics = _metrics.size(); synchronized (_metrics) { counters.putAll(_metrics); _metrics.clear(); } if(counters.size() != sizeJVMMetrics){ _logger.warn("Monitoring Service JVM Metrics and counters size are not equal"); _logger.warn("JVM Metrics size = {}", sizeJVMMetrics); _logger.warn("counters size = {}", counters.size()); } long timestamp = (System.currentTimeMillis() / 60000) * 60000L; for (Entry<Metric, Double> entry : counters.entrySet()) { Map<Long, String> dataPoints = new HashMap<>(1); dataPoints.put(timestamp, String.valueOf(entry.getValue())); entry.getKey().setDatapoints(dataPoints); } if (!isDisposed()) { _logger.info("Pushing monitoring metrics to TSDB.", counters.size()); _tsdbService.putMetrics(new ArrayList<>(counters.keySet())); } }

Target:
private void _pushCounters() { int sizeJVMMetrics = 0; _logger.debug("Pushing monitor service counters for {}.", HOSTNAME); Map<Metric, Double> counters = new HashMap<>(); _updateJVMStatsCounters(); synchronized (_metrics) { sizeJVMMetrics = _metrics.size(); counters.putAll(_metrics); _metrics.clear(); } if(counters.size() != sizeJVMMetrics){ _logger.warn("Monitoring Service JVM Metrics and counters size are not equal"); _logger.warn("JVM Metrics size = {}", sizeJVMMetrics); _logger.warn("counters size = {}", counters.size()); } long timestamp = (System.currentTimeMillis() / 60000) * 60000L; for (Entry<Metric, Double> entry : counters.entrySet()) { Map<Long, String> dataPoints = new HashMap<>(1); dataPoints.put(timestamp, String.valueOf(entry.getValue())); entry.getKey().setDatapoints(dataPoints); } if (!isDisposed()) { _logger.info("Pushing monitoring metrics to TSDB.", counters.size()); _tsdbService.putMetrics(new ArrayList<>(counters.keySet())); } }
Source:
public void onCollisionEaten() { element.kill(); element.setSize(0); AudioController.getInstance().playSoundEffect(Options.getInstance().getHitSoundFileName()); }

Target:
public void onCollisionEaten() { element.kill(); element.setSize(0); AudioController.getInstance().playEatSoundEffect(); }
Source:
private Mono<OAuth2AuthorizedClient> refreshIfNecessary(ClientRequest request, ExchangeFunction next, OAuth2AuthorizedClient authorizedClient) { ClientRegistration clientRegistration = authorizedClient.getClientRegistration(); if (AuthorizationGrantType.CLIENT_CREDENTIALS.equals(clientRegistration.getAuthorizationGrantType()) && hasExpired(authorizedClient)) { return createRequest(request) .flatMap(r -> getNewAuthorizedClient(clientRegistration, r)); } else if (shouldRefresh(authorizedClient)) { return createRequest(request) .flatMap(r -> refreshAuthorizedClient(next, authorizedClient, r)); } return Mono.just(authorizedClient); }

Target:
private Mono<OAuth2AuthorizedClient> refreshIfNecessary(ClientRequest request, ExchangeFunction next, OAuth2AuthorizedClient authorizedClient) { ClientRegistration clientRegistration = authorizedClient.getClientRegistration(); if (isClientCredentialsGrantType(clientRegistration) && hasTokenExpired(authorizedClient)) { return createRequest(request) .flatMap(r -> authorizeWithClientCredentials(clientRegistration, r)); } else if (shouldRefresh(authorizedClient)) { return createRequest(request) .flatMap(r -> refreshAuthorizedClient(next, authorizedClient, r)); } return Mono.just(authorizedClient); }
Source:
public void write(final File file) { try { final IntervalListWriter writer = new IntervalListWriter(file, this.header); for (final Interval interval : this) { writer.write(interval); } writer.close(); } catch (final IOException ioe) { throw new SAMException("Error writing out interval list to file: " + file.getAbsolutePath(), ioe); } }

Target:
public void write(final File file) { this.write(file.toPath()); }
Source:
public void replaceTypeToResponse() throws IOException { final String type = "text/plain"; final String header = "Content-Type: "; MatcherAssert.assertThat( new RsPrint( new RsWithType( new RsWithType(new RsEmpty(), "text/xml"), type ) ).print(), Matchers.equalTo( Joiner.on("\r\n").join( "HTTP/1.1 200 OK", header + type, "", "" ) ) ); }

Target:
public void replaceTypeToResponse() throws IOException { final String type = "text/plain"; MatcherAssert.assertThat( new RsPrint( new RsWithType( new RsWithType(new RsEmpty(), "text/xml"), type ) ).print(), Matchers.equalTo( Joiner.on("\r\n").join( "HTTP/1.1 200 OK", String.format("Content-Type: %s", type), "", "" ) ) ); }
Source:
public TopNResultBuilder addEntry( String dimName, Object dimValIndex, Object[] metricVals ) { final Map<String, Object> metricValues = Maps.newHashMapWithExpectedSize(metricVals.length + 1); if (shouldAdd(dimName)) { metricValues.put(dimSpec.getOutputName(), dimName); final int extra = metricVals.length % LOOP_UNROLL_COUNT; switch (extra) { case 7: metricValues.put(aggFactoryNames[6], metricVals[6]); case 6: metricValues.put(aggFactoryNames[5], metricVals[5]); case 5: metricValues.put(aggFactoryNames[4], metricVals[4]); case 4: metricValues.put(aggFactoryNames[3], metricVals[3]); case 3: metricValues.put(aggFactoryNames[2], metricVals[2]); case 2: metricValues.put(aggFactoryNames[1], metricVals[1]); case 1: metricValues.put(aggFactoryNames[0], metricVals[0]); } for (int i = extra; i < metricVals.length; i += LOOP_UNROLL_COUNT) { metricValues.put(aggFactoryNames[i + 0], metricVals[i + 0]); metricValues.put(aggFactoryNames[i + 1], metricVals[i + 1]); metricValues.put(aggFactoryNames[i + 2], metricVals[i + 2]); metricValues.put(aggFactoryNames[i + 3], metricVals[i + 3]); metricValues.put(aggFactoryNames[i + 4], metricVals[i + 4]); metricValues.put(aggFactoryNames[i + 5], metricVals[i + 5]); metricValues.put(aggFactoryNames[i + 6], metricVals[i + 6]); metricValues.put(aggFactoryNames[i + 7], metricVals[i + 7]); } pQueue.add(new DimValHolder.Builder().withDimName(dimName).withMetricValues(metricValues).build()); if (this.pQueue.size() > this.threshold) { pQueue.poll(); } } return this; }

Target:
public TopNResultBuilder addEntry( String dimName, Object dimValIndex, Object[] metricVals ) { final Map<String, Object> metricValues = Maps.newHashMapWithExpectedSize(metricVals.length + 1); if (shouldAdd(dimName)) { metricValues.put(dimSpec.getOutputName(), dimName); final int extra = metricVals.length % LOOP_UNROLL_COUNT; switch (extra) { case 7: metricValues.put(aggFactoryNames[6], metricVals[6]); case 6: metricValues.put(aggFactoryNames[5], metricVals[5]); case 5: metricValues.put(aggFactoryNames[4], metricVals[4]); case 4: metricValues.put(aggFactoryNames[3], metricVals[3]); case 3: metricValues.put(aggFactoryNames[2], metricVals[2]); case 2: metricValues.put(aggFactoryNames[1], metricVals[1]); case 1: metricValues.put(aggFactoryNames[0], metricVals[0]); } for (int i = extra; i < metricVals.length; i += LOOP_UNROLL_COUNT) { metricValues.put(aggFactoryNames[i + 0], metricVals[i + 0]); metricValues.put(aggFactoryNames[i + 1], metricVals[i + 1]); metricValues.put(aggFactoryNames[i + 2], metricVals[i + 2]); metricValues.put(aggFactoryNames[i + 3], metricVals[i + 3]); metricValues.put(aggFactoryNames[i + 4], metricVals[i + 4]); metricValues.put(aggFactoryNames[i + 5], metricVals[i + 5]); metricValues.put(aggFactoryNames[i + 6], metricVals[i + 6]); metricValues.put(aggFactoryNames[i + 7], metricVals[i + 7]); } pQueue.add(new DimValHolder.Builder().withDimName(dimName).withMetricValues(metricValues).build()); if (pQueue.size() > threshold) { pQueue.poll(); } } return this; }
Source:
public Object java_mutable(Initialized state) { final java.util.ArrayList<Integer> values = state.javaMutable; for (int i = 0; i < CONTAINER_SIZE; i++) { values.remove(0); } require(values, v -> v.isEmpty()); return values; }

Target:
public Object java_mutable(Initialized state) { final java.util.ArrayList<Integer> values = state.javaMutable; for (int i = 0; i < CONTAINER_SIZE; i++) { values.remove(0); } assert values.isEmpty(); return values; }
Source:
public void removeFromMapHappyPathMappedKeyTest() throws Exception { Map<String, String> testMap = new HashMap<>(); testMap.put( ActionUtil.QUARTZ_ACTIONCLASS, "one" ); testMap.put( "two", "two" ); testMap.remove( ActionUtil.QUARTZ_ACTIONCLASS ); Assert.assertNull( testMap.get( ActionUtil.QUARTZ_ACTIONCLASS ) ); assertEquals( testMap.get( "two" ), "two" ); }

Target:
public void removeFromMapHappyPathMappedKeyTest() throws Exception { Map<String, String> testMap = new HashMap<>(); testMap.put( ActionUtil.QUARTZ_ACTIONCLASS, "one" ); testMap.put( "two", "two" ); testMap.remove( ActionUtil.QUARTZ_ACTIONCLASS ); assertNull( testMap.get( ActionUtil.QUARTZ_ACTIONCLASS ) ); assertEquals( testMap.get( "two" ), "two" ); }
Source:
public void writeStructuresData(Map<Integer, GlowStructure> structures) { for (GlowStructure structure : structures.values()) { if (structure.isDirty()) { CompoundTag data = null; CompoundTag features = new CompoundTag(); CompoundTag feature = new CompoundTag(); CompoundTag inputRoot; StructureStore<GlowStructure> store = StructureStorage .saveStructure(structure, feature); File structureFile = new File(structureDir, store.getId() + ".dat"); if (structureFile.exists()) { try (NbtInputStream in = new NbtInputStream( new FileInputStream(structureFile))) { inputRoot = in.readCompound(); data = inputRoot.tryGetCompound("data"); if (data != null) { CompoundTag maybeFeatures = data.tryGetCompound("Features"); if (maybeFeatures != null) { features = maybeFeatures; } } } catch (IOException e) { server.getLogger().log(Level.SEVERE, "Failed to read structure data from " + structureFile, e); } } if (data == null) { data = new CompoundTag(); } String key = "[" + structure.getChunkX() + "," + structure.getChunkZ() + "]"; features.putCompound(key, feature); data.putCompound("Features", features); CompoundTag root = new CompoundTag(); root.putCompound("data", data); try (NbtOutputStream nbtOut = new NbtOutputStream( new FileOutputStream(structureFile))) { nbtOut.writeTag(root); } catch (IOException e) { server.getLogger() .log(Level.SEVERE, "Failed to write structure data to " + structureFile, e); } structure.setDirty(false); } } }

Target:
public void writeStructuresData(Map<Integer, GlowStructure> structures) { for (GlowStructure structure : structures.values()) { if (structure.isDirty()) { CompoundTag data; CompoundTag features; CompoundTag feature = new CompoundTag(); CompoundTag inputRoot; StructureStore<GlowStructure> store = StructureStorage .saveStructure(structure, feature); File structureFile = new File(structureDir, store.getId() + ".dat"); if (structureFile.exists()) { try (NbtInputStream in = new NbtInputStream( new FileInputStream(structureFile))) { inputRoot = in.readCompound(); data = inputRoot.tryGetCompound("data").orElseGet(CompoundTag::new); } catch (IOException e) { LocalizedStrings.Console.Error.Structure.IO_READ.log(e, structureFile); data = new CompoundTag(); } features = data.tryGetCompound("Features").orElseGet(CompoundTag::new); } else { data = new CompoundTag(); features = new CompoundTag(); } String key = "[" + structure.getChunkX() + "," + structure.getChunkZ() + "]"; features.putCompound(key, feature); data.putCompound("Features", features); CompoundTag root = new CompoundTag(); root.putCompound("data", data); try (NbtOutputStream nbtOut = new NbtOutputStream( new FileOutputStream(structureFile))) { nbtOut.writeTag(root); } catch (IOException e) { LocalizedStrings.Console.Error.Structure.IO_WRITE.log(e, structureFile); } structure.setDirty(false); } } }
Source:
public ApkData[] getProjects(String projects, IAbstractFile buildLog) throws ExportException { ApkData[] apks = getProjects(projects); if (mTarget == Target.RELEASE && buildLog != null && buildLog.exists()) { ApkData[] previousApks = getProjects(buildLog); if (previousApks.length != apks.length) { throw new ExportException(String.format( "Project export is setup differently from previous export at versionCode %d.\n" + "Any change in the multi-apk configuration require a increment of the versionCode.", mVersionCode)); } for (int i = 0 ; i < previousApks.length ; i++) { apks[i].setMinor(previousApks[i].getMinor()); if (apks[i].compareTo(previousApks[i]) != 0) { throw new ExportException(String.format( "Project export is setup differently from previous export at versionCode %d.\n" + "Any change in the multi-apk configuration require a increment of the versionCode.", mVersionCode)); } } } return apks; }

Target:
public ApkData[] getProjects(String projects, IAbstractFile buildLog) throws ExportException { ApkData[] apks = getProjects(projects); if (mTarget == Target.RELEASE && buildLog != null && buildLog.exists()) { ApkData[] previousApks = getProjects(buildLog); if (previousApks.length != apks.length) { throw new ExportException(String.format( "Project export is setup differently from previous export at versionCode %d.\n" + "Any change in the multi-apk configuration requires an increment of the versionCode.", mVersionCode)); } for (int i = 0 ; i < previousApks.length ; i++) { apks[i].setMinor(previousApks[i].getMinor()); if (apks[i].compareTo(previousApks[i]) != 0) { throw new ExportException(String.format( "Project export is setup differently from previous export at versionCode %d.\n" + "Any change in the multi-apk configuration requires an increment of the versionCode.", mVersionCode)); } } } return apks; }
Source:
public void rocksPathToFileThrowsAnException() { Assertions.assertThatThrownBy(() -> ImmutableRocksDbPersistentStorageConfig.builder() .storagePath(TEST_FOLDER.newFile().getAbsolutePath()) .build()) .isInstanceOf(SafeIllegalStateException.class); }

Target:
public void rocksPathToFileThrowsAnException() throws IOException { Path filePath = TEST_FOLDER.newFile("testFile").toPath(); assertThatThrownBy(() -> ImmutableRocksDbPersistentStorageConfig.builder() .storagePath(TEST_FOLDER.getRoot().toPath().relativize(filePath).toString()) .build()) .isInstanceOf(SafeIllegalStateException.class) .hasMessageContaining("has to point to a directory"); }
Source:
private void clearIndexCache() { if (executionBlockId.getId() > 1) { Bootstrap bootstrap = new Bootstrap() .group(NettyUtils.getSharedEventLoopGroup(NettyUtils.GROUP.FETCHER, 1)) .channel(NioSocketChannel.class) .option(ChannelOption.ALLOCATOR, NettyUtils.ALLOCATOR) .option(ChannelOption.CONNECT_TIMEOUT_MILLIS, 10 * 1000) .option(ChannelOption.TCP_NODELAY, true); ChannelInitializer<Channel> initializer = new ChannelInitializer<Channel>() { @Override protected void initChannel(Channel channel) throws Exception { ChannelPipeline pipeline = channel.pipeline(); pipeline.addLast("codec", new HttpClientCodec()); } }; bootstrap.handler(initializer); WorkerConnectionInfo connInfo = workerContext.getConnectionInfo(); ChannelFuture future = bootstrap.connect(new InetSocketAddress(connInfo.getHost(), connInfo.getPullServerPort())) .addListener(ChannelFutureListener.CLOSE_ON_FAILURE); try { Channel channel = future.await().channel(); if (!future.isSuccess()) { LOG.warn(future.cause()); return; } ExecutionBlockId clearEbId = new ExecutionBlockId(executionBlockId.getQueryId(), executionBlockId.getId() - 1); HttpRequest request = new DefaultHttpRequest(HttpVersion.HTTP_1_1, HttpMethod.DELETE, clearEbId.toString()); request.headers().set(Names.HOST, connInfo.getHost()); request.headers().set(Names.CONNECTION, Values.CLOSE); channel.writeAndFlush(request); } catch (InterruptedException e) { throw new RuntimeException(e); } finally { if (future != null && future.channel().isOpen()) { future.channel().closeFuture(); } } } }

Target:
private void clearIndexCache() { if (executionBlockId.getId() > 1) { Bootstrap bootstrap = new Bootstrap() .group(NettyUtils.getSharedEventLoopGroup(NettyUtils.GROUP.FETCHER, 1)) .channel(NioSocketChannel.class) .option(ChannelOption.ALLOCATOR, NettyUtils.ALLOCATOR) .option(ChannelOption.CONNECT_TIMEOUT_MILLIS, 30 * 1000) .option(ChannelOption.TCP_NODELAY, true); ChannelInitializer<Channel> initializer = new ChannelInitializer<Channel>() { @Override protected void initChannel(Channel channel) throws Exception { ChannelPipeline pipeline = channel.pipeline(); pipeline.addLast("codec", new HttpClientCodec()); } }; bootstrap.handler(initializer); WorkerConnectionInfo connInfo = workerContext.getConnectionInfo(); ChannelFuture future = bootstrap.connect(new InetSocketAddress(connInfo.getHost(), connInfo.getPullServerPort())) .addListener(ChannelFutureListener.CLOSE_ON_FAILURE); try { Channel channel = future.await().channel(); if (!future.isSuccess()) { LOG.warn(future.cause()); return; } ExecutionBlockId clearEbId = new ExecutionBlockId(executionBlockId.getQueryId(), executionBlockId.getId() - 1); HttpRequest request = new DefaultHttpRequest(HttpVersion.HTTP_1_1, HttpMethod.DELETE, "ebid=" + clearEbId.toString()); request.headers().set(Names.HOST, connInfo.getHost()); request.headers().set(Names.CONNECTION, Values.CLOSE); channel.writeAndFlush(request); } catch (InterruptedException e) { throw new RuntimeException(e); } finally { if (future != null && future.channel().isOpen()) { future.channel().close(); } } } }
Source:
public void notify(Transcriber transcriber, TranscriptEvent event) { TranscriptionStatusExtension extension = new TranscriptionStatusExtension(); extension.setStatus( transcriber.isTranscribing() ? TranscriptionStatusExtension.Status.ON : TranscriptionStatusExtension.Status.OFF); jvbConference.sendPresenceExtension(extension); }

Target:
public void notify(Transcriber transcriber, TranscriptEvent event) { if (event.getEvent() == Transcript.TranscriptEventType.START || event.getEvent() == Transcript.TranscriptEventType.WILL_END) { TranscriptionStatusExtension.Status status = event.getEvent() == Transcript.TranscriptEventType.WILL_END ? TranscriptionStatusExtension.Status.OFF : transcriber.isTranscribing() ? TranscriptionStatusExtension.Status.ON : TranscriptionStatusExtension.Status.OFF; TranscriptionStatusExtension extension = new TranscriptionStatusExtension(); extension.setStatus(status); jvbConference.sendPresenceExtension(extension); } }
Source:
public ByteBuf order(ByteOrder endianness) { ObjectUtil.checkNotNull(endianness, "endianness"); if (endianness == order) { return this; } return buf; }

Target:
public ByteBuf order(ByteOrder endianness) { if (ObjectUtil.checkNotNull(endianness, "endianness") == order) { return this; } return buf; }
Source:
private void processError(String endpointId, JsonRpcResponse response, String key) { LOGGER.debug("Response has error. Proceeding..."); if (!promises.containsKey(key)) { LOGGER.debug("No action is associated for the key: " + key + ", skipping."); return; } JsonRpcError error = response.getError(); JsonRpcPromise<?> promise = promises.remove(key); LOGGER.debug("Fetching promise:" + promise); BiConsumer<String, JsonRpcError> consumer = promise.getFailureConsumer(); if (consumer != null) { LOGGER.debug("Failure consumer is found, accepting..."); consumer.accept(endpointId, error); } else { LOGGER.debug("Reject function is not found, skipping"); } }

Target:
private void processError(String endpointId, JsonRpcResponse response, String key) { LOGGER.debug("Response has error. Proceeding..."); if (!promises.containsKey(key)) { LOGGER.debug("No action is associated for the key: {}, skipping.", key); return; } JsonRpcError error = response.getError(); JsonRpcPromise<?> promise = promises.remove(key); LOGGER.debug("Fetching promise: {}", promise); BiConsumer<String, JsonRpcError> consumer = promise.getFailureConsumer(); if (consumer != null) { LOGGER.debug("Failure consumer is found, accepting..."); consumer.accept(endpointId, error); } else { LOGGER.debug("Reject function is not found, skipping"); } }