auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
private Set<Column> findOriginatingColumnsOfSource(Object source) { final Set<Column> cachedOriginatingColumns = originatingColumnsOfSourceCache.get(source); if (cachedOriginatingColumns != null) { return cachedOriginatingColumns; } Set<Column> originatingColumns = new HashSet<>(); if (source != null) { if (source instanceof InputColumnSinkJob) { InputColumn<?>[] input = ((InputColumnSinkJob) source).getInput(); if (input != null) { for (InputColumn<?> inputColumn : input) { originatingColumns.addAll(findOriginatingColumnsOfInputColumn(inputColumn)); } } } if (source instanceof HasComponentRequirement) { final HasComponentRequirement hasComponentRequirement = (HasComponentRequirement) source; final ComponentRequirement componentRequirement = hasComponentRequirement.getComponentRequirement(); final Collection<FilterOutcome> requirements = getProcessingDependencies(componentRequirement); for (FilterOutcome outcome : requirements) { originatingColumns.addAll(findOriginatingColumnsOfOutcome(outcome)); } } } originatingColumnsOfSourceCache.put(source, originatingColumns); return originatingColumns; }

Target:
private Set<Column> findOriginatingColumnsOfSource(Object source) { final Set<Column> cachedOriginatingColumns = originatingColumnsOfSourceCache.get(source); if (cachedOriginatingColumns != null) { return cachedOriginatingColumns; } final Set<Column> originatingColumns = new HashSet<>(); if (source != null) { if (source instanceof InputColumnSinkJob) { InputColumn<?>[] input = ((InputColumnSinkJob) source).getInput(); if (input != null) { for (InputColumn<?> inputColumn : input) { originatingColumns.addAll(findOriginatingColumnsOfInputColumn(inputColumn)); } } } if (source instanceof HasComponentRequirement) { final HasComponentRequirement hasComponentRequirement = (HasComponentRequirement) source; final ComponentRequirement componentRequirement = hasComponentRequirement.getComponentRequirement(); final Collection<FilterOutcome> requirements = getProcessingDependencies(componentRequirement); for (FilterOutcome outcome : requirements) { originatingColumns.addAll(findOriginatingColumnsOfOutcome(outcome)); } } } originatingColumnsOfSourceCache.put(source, originatingColumns); return originatingColumns; }
Source:
public void registerOperations(ManagementResourceRegistration interfaces) { super.registerOperations(interfaces); interfaces.registerOperationHandler(org.jboss.as.controller.operations.global.ReadResourceHandler.RESOLVE_DEFINITION, org.jboss.as.controller.operations.global.ReadResourceHandler.RESOLVE_INSTANCE, true); interfaces.registerOperationHandler(org.jboss.as.controller.operations.global.ReadAttributeHandler.RESOLVE_DEFINITION, org.jboss.as.controller.operations.global.ReadAttributeHandler.RESOLVE_INSTANCE, true); }

Target:
public void registerOperations(ManagementResourceRegistration interfaces) { super.registerOperations(interfaces); if( resolvable ) { interfaces.registerOperationHandler(org.jboss.as.controller.operations.global.ReadResourceHandler.RESOLVE_DEFINITION, org.jboss.as.controller.operations.global.ReadResourceHandler.RESOLVE_INSTANCE, true); interfaces.registerOperationHandler(org.jboss.as.controller.operations.global.ReadAttributeHandler.RESOLVE_DEFINITION, org.jboss.as.controller.operations.global.ReadAttributeHandler.RESOLVE_INSTANCE, true); } }
Source:
public static SynchronizeTimeRequest fromParameterMap(final Map<String, String> parameters) { final SynchronizeTimeRequest request = new SynchronizeTimeRequest(); request.setDeviceIdentification(parameters.get(PlatformSmartmeteringKeys.DEVICE_IDENTIFICATION)); request.setSynchronizeTimeRequestData(SynchronizeTimeRequestDataFactory.fromParameterMap(parameters)); ; return request; }

Target:
public static SynchronizeTimeRequest fromParameterMap(final Map<String, String> parameters) { final SynchronizeTimeRequest request = new SynchronizeTimeRequest(); request.setDeviceIdentification(parameters.get(PlatformSmartmeteringKeys.DEVICE_IDENTIFICATION)); request.setSynchronizeTimeRequestData(SynchronizeTimeRequestDataFactory.fromParameterMap(parameters)); return request; }
Source:
protected VDSParametersBase getRevertVDSParameters() { boolean wipeAfterDelete = ImagesHandler.shouldWipeAfterDelete( DbFacade.getInstance().getDiskImageDao().get(getEnclosingCommand(). getParameters().getDestinationImageId()).isWipeAfterDelete(), DbFacade.getInstance().getStorageDomainDao().get(getEnclosingCommand(). getParameters().getStorageDomainId()).getStorageType()); return new DeleteImageGroupVDSCommandParameters( getEnclosingCommand().getParameters().getStoragePoolId(), getEnclosingCommand().getParameters().getTargetStorageDomainId(), getEnclosingCommand().getParameters().getImageGroupID(), wipeAfterDelete, getEnclosingCommand().getParameters().getForceDelete()); }

Target:
protected VDSParametersBase getRevertVDSParameters() { DiskImage diskImage = DbFacade.getInstance().getDiskImageDao().get( getEnclosingCommand().getParameters().getDestinationImageId()); boolean wipeAfterDelete = ImagesHandler.shouldWipeAfterDelete( diskImage.isWipeAfterDelete(), diskImage.getStorageTypes().get(0)); return new DeleteImageGroupVDSCommandParameters( getEnclosingCommand().getParameters().getStoragePoolId(), getEnclosingCommand().getParameters().getTargetStorageDomainId(), getEnclosingCommand().getParameters().getImageGroupID(), wipeAfterDelete, getEnclosingCommand().getParameters().getForceDelete()); }
Source:
public ValueHolder<V> replace(final K key, final V value) throws CacheAccessException { checkKey(key); checkValue(value); final AtomicReference<OnHeapValueHolder<V>> returnValue = new AtomicReference<OnHeapValueHolder<V>>(null); final long now = timeSource.getTimeMillis(); map.computeIfPresent(key, new BiFunction<K, OnHeapValueHolder<V>, OnHeapValueHolder<V>>() { @Override public OnHeapValueHolder<V> apply(K mappedKey, OnHeapValueHolder<V> mappedValue) { if (mappedValue.isExpired(now)) { return null; } else { returnValue.set(mappedValue); return newValueHolder(key, value, now); } } }); return returnValue.get(); }

Target:
public ValueHolder<V> replace(final K key, final V value) throws CacheAccessException { checkKey(key); checkValue(value); final AtomicReference<OnHeapValueHolder<V>> returnValue = new AtomicReference<OnHeapValueHolder<V>>(null); map.computeIfPresent(key, new BiFunction<K, OnHeapValueHolder<V>, OnHeapValueHolder<V>>() { @Override public OnHeapValueHolder<V> apply(K mappedKey, OnHeapValueHolder<V> mappedValue) { final long now = timeSource.getTimeMillis(); if (mappedValue.isExpired(now)) { return null; } else { returnValue.set(mappedValue); return newValueHolder(key, value, now); } } }); return returnValue.get(); }
Source:
public static IFile getWorkspaceFile(URI uri) { IWorkspaceRoot root = ResourcesPlugin .getWorkspace() .getRoot(); URI relativize = root.getLocationURI().relativize(uri); IPath path = new Path(relativize.getPath()); try { return root.getFile(path); } catch (Exception e) { return null; } }

Target:
public static IFile getWorkspaceFile(URI uri) { return getWorkspaceFile(new Path(uri.getPath())); }
Source:
public void testValidateDataComments() { this.lotGeneratorInputDto.setGid(GID); this.lotGeneratorInputDto.setLocationId(LOCATION_ID); this.lotGeneratorInputDto.setGenerateStock(false); this.lotGeneratorInputDto.setScaleId(SCALE_ID); this.lotGeneratorInputDto.setStockId(STOCK_ID); this.lotGeneratorInputDto.setComments( "CommentsCommentsCommentsCommentsCommentsCommentsCommentsCommentsCommentsCommentsCommentsCommentsCommentsCommentsCommentsCommentsCommentsCommentsCommentsCommentsCommentsCommentsCommentsCommentsCommentsCommentsCommentsCommentsCommentsCommentsCommentsCommentsCommentsCommentsCommentsCommentsCommentsCommentsCommentsCommentsCommentsCommentsCommentsCommentsCommentsCommentsCommentsCommentsCommentsCommentsCommentsCommentsCommentsCommentsCommentsCommentsCommentsCommentsCommentsCommentsCommentsCommentsCommentsCommentsCommentsCommentsCommentsCommentsCommentsCommentsCommentsCommentsCommentsCommentsCommentsCommentsCommentsCommentsCommentsComments"); this.lotInputValidator.validate(this.lotGeneratorInputDto); }

Target:
public void testValidateDataComments() { this.lotGeneratorInputDto.setGid(GID); this.lotGeneratorInputDto.setLocationId(LOCATION_ID); this.lotGeneratorInputDto.setGenerateStock(false); this.lotGeneratorInputDto.setScaleId(SCALE_ID); this.lotGeneratorInputDto.setStockId(STOCK_ID); this.lotGeneratorInputDto.setComments(RandomStringUtils.randomAlphabetic(256)); this.lotInputValidator.validate(this.lotGeneratorInputDto); }
Source:
protected boolean validateVdsGroup() { if (getVdsGroup() == null) { VDSGroup cluster = getVdsGroupDAO().getByName("Default"); if (cluster != null) { setVdsGroup(cluster); return true; } else { List<VDSGroup> clusters = getVdsGroupDAO().getAll(); if (clusters.size() > 0) { setVdsGroup(clusters.get(0)); return true; } log.error("AddVdsCommand: No default or valid cluster was found, host registration failed."); return failCanDoAction(VdcBllMessages.VDS_CLUSTER_IS_NOT_VALID); } } return true; }

Target:
protected boolean validateVdsGroup() { if (getVdsGroup() == null) { return failCanDoAction(VdcBllMessages.VDS_CLUSTER_IS_NOT_VALID); } return true; }
Source:
public IntegerList(int capacity) { if (capacity < 0) { throw new IllegalArgumentException(); } if (capacity > MAX_ARRAY_SIZE) throw new IllegalArgumentException(); if (capacity == 0) { _data = EMPTY_DATA; } else { _data = new int[capacity]; } }

Target:
public IntegerList(int capacity) { if (capacity < 0) { throw new IllegalArgumentException(); } if (capacity == 0) { _data = EMPTY_DATA; } else { _data = new int[capacity]; } }
Source:
public static void start(Stage stage) { State.resetAll(); primaryStage = stage; root = new Group(); root.setDepthTest(DepthTest.ENABLE); root.setAutoSizeChildren(true); scene = new Scene(root, WIDTH, HEIGHT, true); scene.setFill(Color.AQUA); primaryStage.setScene(scene); world = new Group(); overlay = new Group(); worldScene = new SubScene(world, WIDTH, HEIGHT, true, SceneAntialiasing.BALANCED); overlayScene = new SubScene(overlay, WIDTH, HEIGHT); overlayScene.setFill(Color.TRANSPARENT); root.getChildren().add(worldScene); root.getChildren().add(overlayScene); setupCamera(); keyBindings(primaryStage); primaryStage.setResizable(false); primaryStage.show(); startTickers(); }

Target:
public static void start(Stage stage) { State.reset(); primaryStage = stage; root = new Group(); root.setDepthTest(DepthTest.ENABLE); root.setAutoSizeChildren(true); scene = new Scene(root, WIDTH, HEIGHT, true); scene.setFill(Color.AQUA); primaryStage.setScene(scene); world = new Group(); overlay = new Group(); worldScene = new SubScene(world, WIDTH, HEIGHT, true, SceneAntialiasing.BALANCED); overlayScene = new SubScene(overlay, WIDTH, HEIGHT); overlayScene.setFill(Color.TRANSPARENT); root.getChildren().add(worldScene); root.getChildren().add(overlayScene); setupCamera(); keyBindings(primaryStage); primaryStage.setResizable(false); primaryStage.show(); startTickers(); }
Source:
public void setInstitutionPanels( Map<String, List<FeedbackSessionAttributes>> map, Map<String, String> sessionToInstructorIdMap) { institutionPanels = new ArrayList<InstitutionPanel>(); for (String key : map.keySet()) { if (!key.equals("Unknown")) { institutionPanels.add(new InstitutionPanel( key, getFeedbackSessionRows( map.get(key), sessionToInstructorIdMap))); } } String key = "Unknown"; List<FeedbackSessionAttributes> feedbackSessions = map.get(key); if (feedbackSessions != null) { institutionPanels.add(new InstitutionPanel( key, getFeedbackSessionRows( feedbackSessions, sessionToInstructorIdMap))); } }

Target:
public void setInstitutionPanels( Map<String, List<FeedbackSessionAttributes>> map, Map<String, String> sessionToInstructorIdMap) { institutionPanels = new ArrayList<InstitutionPanel>(); for (String key : map.keySet()) { if (!key.equals(UNKNOWN_INSTITUTION)) { institutionPanels.add(new InstitutionPanel( key, getFeedbackSessionRows( map.get(key), sessionToInstructorIdMap))); } } String key = UNKNOWN_INSTITUTION; List<FeedbackSessionAttributes> feedbackSessions = map.get(key); if (feedbackSessions != null) { institutionPanels.add(new InstitutionPanel( key, getFeedbackSessionRows( feedbackSessions, sessionToInstructorIdMap))); } }
Source:
private void waitBetweenPolls() { while(lastTimeBeforePoll != null && System.currentTimeMillis() - lastTimeBeforePoll < POLLING_BREAK) { try { Thread.sleep(POLLING_BREAK); } catch (InterruptedException e) { } } lastTimeBeforePoll = System.currentTimeMillis(); }

Target:
private void waitBetweenPolls() { while (timestampOfEndOfPreviousInvocation != null && System.currentTimeMillis() - timestampOfEndOfPreviousInvocation < POLLING_BREAK) { try { Thread.sleep(POLLING_BREAK); } catch (InterruptedException e) { } } }
Source:
public double[] call(double[] values) throws MLModelBuilderException { try { double[] normalizedValues = new double[values.length]; for (int i = 0; i < values.length; i++) { if (values[i] > max.get(i)) { normalizedValues[i] = 1; } else if (values[i] < min.get(i)) { normalizedValues[i] = 0; } else if (min.get(i) == max.get(i)) { normalizedValues[i] = 0.5; } else { normalizedValues[i] = (values[i] - min.get(i)) / (max.get(i) - min.get(i)); } } return normalizedValues; } catch (Exception e) { throw new MLModelBuilderException("An error occurred while normalizing values: " + e.getMessage(), e); } }

Target:
public double[] call(double[] values) throws MLModelBuilderException { try { double[] normalizedValues = new double[values.length]; for (int i = 0; i < values.length; i++) { if (Double.compare(values[i], max.get(i)) > 0) { normalizedValues[i] = 1.0; } else if (Double.compare(values[i], min.get(i)) < 0) { normalizedValues[i] = 0.0; } else if (Double.compare(min.get(i), max.get(i)) == 0) { normalizedValues[i] = 0.5; } else { normalizedValues[i] = (values[i] - min.get(i)) / (max.get(i) - min.get(i)); } } return normalizedValues; } catch (Exception e) { throw new MLModelBuilderException("An error occurred while normalizing values: " + e.getMessage(), e); } }
Source:
private boolean haveGitHubIdEntry(ReviewDb db, Account.Id accountId, AccountExternalId.Key key) throws OrmException { boolean found = false; for (AccountExternalId id : db.accountExternalIds().byAccount(accountId)) { if (id.getKey().equals(key)) { found = true; break; } } return found; }

Target:
private boolean haveGitHubIdEntry(ReviewDb db, Account.Id accountId, AccountExternalId.Key key) throws OrmException { boolean found = false; for (AccountExternalId id : db.accountExternalIds().byAccount(accountId)) { if (id.getKey().equals(key)) { return true; } } return false; }
Source:
private String unescapeEscapedJsonString(final String escapedJsonString) throws IOException, XPathException { JsonFactory jsonFactory = new JsonFactory(); StringBuilder unescapedJsonStringBuilder = new StringBuilder(); String unescapedJsonString; try { JsonParser jsonParser = jsonFactory.createParser("\"" + escapedJsonString + "\""); while (!jsonParser.isClosed()) { JsonToken jsonToken = jsonParser.nextToken(); if (jsonParser.hasTextCharacters()) { unescapedJsonStringBuilder.append(jsonParser.getValueAsString()); } } } catch (JsonParseException e) { logger.error("fn:xml-to-json(): FOJS0007: Bad JSON escape sequence. XML claims string is escaped. String does not parse as valid JSON string. Offending string in double quotes : \"" + escapedJsonString + "\""); throw new XPathException(ErrorCodes.FOJS0007, "Bad JSON escape sequence. XML claims string is escaped. String does not parse as valid JSON string. Offending string in error logs."); } unescapedJsonString = unescapedJsonStringBuilder.toString(); return unescapedJsonString; }

Target:
private String unescapeEscapedJsonString(final String escapedJsonString) throws IOException, XPathException { final JsonFactory jsonFactory = new JsonFactory(); final StringBuilder unescapedJsonStringBuilder = new StringBuilder(); final String unescapedJsonString; try { final JsonParser jsonParser = jsonFactory.createParser("\"" + escapedJsonString + "\""); while (!jsonParser.isClosed()) { jsonParser.nextToken(); if (jsonParser.hasTextCharacters()) { unescapedJsonStringBuilder.append(jsonParser.getValueAsString()); } } } catch (JsonParseException e) { logger.error("fn:xml-to-json(): FOJS0007: Bad JSON escape sequence. XML claims string is escaped. String does not parse as valid JSON string. Offending string in double quotes : \"" + escapedJsonString + "\""); throw new XPathException(ErrorCodes.FOJS0007, "Bad JSON escape sequence. XML claims string is escaped. String does not parse as valid JSON string. Offending string in error logs."); } unescapedJsonString = unescapedJsonStringBuilder.toString(); return unescapedJsonString; }
Source:
protected String getReleaseNotesForFixVersion(String projectKey, String versionName, String filter) throws TimeoutException { JiraSession session = getSession(); if (session == null) { LOGGER.warning("Jira session could not be established"); return ""; } List<Issue> issues = session.getIssuesWithFixVersion(projectKey, versionName, filter); if (issues.isEmpty()) { return ""; } Map<String, Set<String>> releaseNotes = new HashMap<>(); for (Issue issue : issues) { String key = issue.getKey(); String summary = issue.getSummary(); String status = issue.getStatus().getName(); String type = issue.getIssueType().getName(); Set<String> issueSet; if (releaseNotes.containsKey(type)) { issueSet = releaseNotes.get(type); } else { issueSet = new HashSet<>(); releaseNotes.put(type, issueSet); } issueSet.add(String.format(" - [%s] %s (%s)", key, summary, status)); } StringBuilder sb = new StringBuilder(); for ( Map.Entry<String, Set<String>> entry : releaseNotes.entrySet() ) { sb.append(String.format("# %s\n", entry.getKey())); for (String issue : entry.getValue()) { sb.append(issue); sb.append("\n"); } } return sb.toString(); }

Target:
public String getReleaseNotesForFixVersion(String projectKey, String versionName, String filter) throws TimeoutException { JiraSession session = getSession(); if (session == null) { LOGGER.warning("Jira session could not be established"); return ""; } List<Issue> issues = session.getIssuesWithFixVersion(projectKey, versionName, filter); if (issues.isEmpty()) { return ""; } Map<String, Set<String>> releaseNotes = new HashMap<>(); for (Issue issue : issues) { String key = issue.getKey(); String summary = issue.getSummary(); String status = issue.getStatus().getName(); String type = issue.getIssueType().getName(); Set<String> issueSet; if (releaseNotes.containsKey(type)) { issueSet = releaseNotes.get(type); } else { issueSet = new HashSet<>(); releaseNotes.put(type, issueSet); } issueSet.add(String.format(" - [%s] %s (%s)", key, summary, status)); } StringBuilder sb = new StringBuilder(); for ( Map.Entry<String, Set<String>> entry : releaseNotes.entrySet() ) { sb.append(String.format("# %s\n", entry.getKey())); for (String issue : entry.getValue()) { sb.append(issue); sb.append("\n"); } } return sb.toString(); }
Source:
private String[] getDimVals(final DimDim dimLookup, final List<String> dimValues) { final String[] retVal = new String[dimValues.size()]; if (dimValues.size() == 0) { if (!dimLookup.contains(null)) { dimLookup.add(null); } return retVal; } int count = 0; for (String dimValue : dimValues) { String canonicalDimValue = dimLookup.get(dimValue); if (!dimLookup.contains(canonicalDimValue)) { dimLookup.add(dimValue); } retVal[count] = canonicalDimValue; count++; } Arrays.sort(retVal); return retVal; }

Target:
private String[] getDimVals(final DimDim dimLookup, final List<String> dimValues) { final String[] retVal = new String[dimValues.size()]; if (dimValues.size() == 0) { if (!dimLookup.contains(null)) { dimLookup.add(null); } return null; } int count = 0; for (String dimValue : dimValues) { String canonicalDimValue = dimLookup.get(dimValue); if (!dimLookup.contains(canonicalDimValue)) { dimLookup.add(dimValue); } retVal[count] = canonicalDimValue; count++; } Arrays.sort(retVal); return retVal; }
Source:
protected void configure() { getDockerImageName(); }

Target:
protected void configure() { }
Source:
private MacPool createPoolInternal(org.ovirt.engine.core.common.businessentities.MacPool macPool, boolean engineStartup) { if (macPools.containsKey(macPool.getId())) { throw new IllegalStateException(UNABLE_TO_CREATE_MAC_POOL_IT_ALREADY_EXIST); } log.debug("Creating new MacPool {}.", macPool); MacPool poolForScope = macPoolFactory.createMacPool(macPool, engineStartup); List<MacPool> overlappingPools = macPools.entrySet().stream() .filter(poolEntry -> poolEntry.getKey() != poolForScope.getId() && poolEntry.getValue().overlaps(poolForScope)) .map(Map.Entry::getValue) .collect(Collectors.toList()); if (!overlappingPools.isEmpty()) { StringJoiner joiner = new StringJoiner(", "); overlappingPools.forEach(pool -> joiner.add(pool.getId().toString())); String macReport = joiner.toString(); String msg = "MAC pool '%s' overlaps with other MAC pools: [%s]"; log.warn(String.format(msg, macPool.getName(), macReport)); AuditLogableImpl auditLoggable = new AuditLogableImpl(); auditLoggable.addCustomValue("macPoolName", macPool.getName()); auditLoggable.addCustomValue("overlapping", macReport); auditLogDirector.log(auditLoggable, AuditLogType.MAC_POOL_VIOLATES_NO_OVERLAPPING_MAC_POOLS); } macPools.put(macPool.getId(), poolForScope); return poolForScope; }

Target:
private MacPool createPoolInternal(org.ovirt.engine.core.common.businessentities.MacPool macPool, boolean engineStartup) { if (macPools.containsKey(macPool.getId())) { throw new IllegalStateException(UNABLE_TO_CREATE_MAC_POOL_IT_ALREADY_EXIST); } log.debug("Creating new MacPool {}.", macPool); MacPool poolForScope = macPoolFactory.createMacPool(macPool, engineStartup); macPools.put(macPool.getId(), poolForScope); return poolForScope; }
Source:
protected void initTiffParser() { super.initTiffParser(); if (handler != null) { Image i = handler.imageMap.get(0); tiffParser.setYCbCrCorrection(!"versa".equalsIgnoreCase(i.devModel) && !"leica scn400".equalsIgnoreCase(i.devModel); } }

Target:
protected void initTiffParser() { super.initTiffParser(); if (handler != null) { Image i = handler.imageMap.get(0); tiffParser.setYCbCrCorrection(!("versa".equalsIgnoreCase(i.devModel) || "leica scn400".equalsIgnoreCase(i.devModel))); } }
Source:
public Reply<?> fetchEmergencyAlertURI(@Named("id") String id, Request request) { Optional<AccessPoint> ap = repository.findById(id); if (!ap.isPresent()) { return Reply.with("Not found AP with id " + id).notFound(); } String host = request.header("HOST"); String emergencyURI = host + "/r/emergency-alerts"; return Reply.with(emergencyURI).ok(); }

Target:
public Reply<?> fetchEmergencyAlertURI(@Named("id") String id, Request request) { Optional<AccessPoint> ap = repository.findById(id); if (!ap.isPresent()) { return Reply.with("Not found AP with id " + id).notFound(); } String host = request.header("Host"); String emergencyURI = host + "/r/emergency-alerts"; return Reply.with(emergencyURI).ok(); }
Source:
public Organisation approveOrganisation(@ApiParam(hidden = true) @Auth User user, @ApiParam(value = "Organisation ID.", required = true) @PathParam("organisationId") Long id) { Organisation organisation = organisationDAO.findById(id); if (organisation == null) { String msg = "Organisation not found"; LOG.info(msg); throw new CustomWebApplicationException(msg, HttpStatus.SC_BAD_REQUEST); } organisation.setApproved(true); Event createOrganisationEvent = new Event(null, organisation, null, null, null, user, Event.EventType.APPROVE_ORG); eventDAO.create(createOrganisationEvent); return organisationDAO.findById(id); }

Target:
public Organisation approveOrganisation(@ApiParam(hidden = true) @Auth User user, @ApiParam(value = "Organisation ID.", required = true) @PathParam("organisationId") Long id) { Organisation organisation = organisationDAO.findById(id); if (organisation == null) { String msg = "Organisation not found"; LOG.info(msg); throw new CustomWebApplicationException(msg, HttpStatus.SC_NOT_FOUND); } if (!organisation.isApproved()) { organisation.setApproved(true); Event approveOrgEvent = new Event.Builder() .withOrganisation(organisation) .withInitiatorUser(user) .withType(Event.EventType.APPROVE_ORG) .build(); eventDAO.create(approveOrgEvent); } return organisationDAO.findById(id); }
Source:
public void retry(Call failedCall, Throwable throwable) { long now = time.milliseconds(); RetryContext failedCallRetryContext = failedCall.getRetryContext(); this.retryContext.update(failedCallRetryContext); if (this.retryContext.getTries() > maxRetries) { failWithTimeout(now, throwable); return; } if (log.isDebugEnabled()) { log.debug("{} failed: {}. Beginning retry #{}", this, prettyPrintException(throwable), retryContext.getTries()); } runnable.call(this, now); }

Target:
public void retry(Call failedCall, Throwable throwable) { long now = time.milliseconds(); if ((throwable instanceof UnsupportedVersionException) && handleUnsupportedVersionException((UnsupportedVersionException) throwable)) { log.debug("{} attempting protocol downgrade and retrying.", this); runnable.call(this, now); return; } CallRetryContext failedCallRetryContext = failedCall.callRetryContext(); this.callRetryContext.update(failedCallRetryContext); if (this.callRetryContext.tries() <= maxRetries) { log.debug("{} failed: {}. Beginning retry #{}", this, prettyPrintException(throwable), callRetryContext.tries()); runnable.call(this, now); } else { failWithTimeout(now, throwable); } }
Source:
private void parseResourceClasses() { List<IGDBHardwareAndOS.IResourceClass> classes = new ArrayList<IGDBHardwareAndOS.IResourceClass>(); MITuple table = (MITuple)get(getMIOutput(), "OSDataTable"); MIList body = (MIList)get(table, "body"); for (MIResult r: body.getMIResults()) { MITuple row = (MITuple)r.getMIValue(); final String id = getString(row.getMIResults()[0]); final String description = getString(row.getMIResults()[2]); classes.add(new IGDBHardwareAndOS.IResourceClass() { @Override public String getId() { return id; } @Override public String getHunamDescription() { return description; } }); } resourceClasses = classes.toArray(new IGDBHardwareAndOS.IResourceClass[0]); }

Target:
private void parseResourceClasses() { List<IGDBHardwareAndOS2.IResourceClass> classes = new ArrayList<IGDBHardwareAndOS2.IResourceClass>(); MITuple table = (MITuple)get(getMIOutput(), "OSDataTable"); MIList body = (MIList)get(table, "body"); for (MIResult r: body.getMIResults()) { MITuple row = (MITuple)r.getMIValue(); final String id = getString(row.getMIResults()[0]); final String description = getString(row.getMIResults()[2]); classes.add(new IGDBHardwareAndOS2.IResourceClass() { @Override public String getId() { return id; } @Override public String getHumanDescription() { return description; } }); } resourceClasses = classes.toArray(new IGDBHardwareAndOS2.IResourceClass[classes.size()]); }
Source:
protected void customizeContainerConfiguration( ContainerConfiguration containerConfiguration ) { super.customizeContainerConfiguration( containerConfiguration ); containerConfiguration.setAutoWiring( true ); containerConfiguration.setClassPathScanning( PlexusConstants.SCANNING_ON ); }

Target:
protected void customizeContainerConfiguration( ContainerConfiguration containerConfiguration ) { super.customizeContainerConfiguration( containerConfiguration ); containerConfiguration.setAutoWiring( true ); containerConfiguration.setClassPathScanning( PlexusConstants.SCANNING_INDEX ); }
Source:
public List<HostToken> getTokens(Set<Host> activeHosts) { Set<HostToken> allTokens = new HashSet<HostToken>(); Set<Host> remainingHosts = new TreeSet<>(activeHosts); for (Host host : activeHosts) { try { List<HostToken> hostTokens = parseTokenListFromJson(getTopologyJsonPayload((host.getHostAddress()))); for (HostToken hToken : hostTokens) { allTokens.add(hToken); remainingHosts.remove(hToken.getHost()); } if (remainingHosts.size() == 0) { Logger.info("Received token information for " + allTokens.size() + " hosts. Not querying other hosts"); break; } } catch (Exception e) { Logger.warn("Could not get json response for token topology [" + e.getMessage() + "]"); } } return new ArrayList<>(allTokens); }

Target:
public List<HostToken> getTokens(Set<Host> activeHosts) { Set<HostToken> allTokens = new HashSet<HostToken>(); Set<Host> remainingHosts = new HashSet<>(activeHosts); for (Host host : activeHosts) { try { List<HostToken> hostTokens = parseTokenListFromJson(getTopologyJsonPayload((host.getHostAddress()))); for (HostToken hToken : hostTokens) { allTokens.add(hToken); remainingHosts.remove(hToken.getHost()); } if (remainingHosts.size() == 0) { Logger.info("Received token information for " + allTokens.size() + " hosts. Not querying other hosts"); break; } } catch (Exception e) { Logger.warn("Could not get json response for token topology [" + e.getMessage() + "]"); } } return new ArrayList<>(allTokens); }
Source:
protected String decryptBytes(@NonNull final Key key, @NonNull final byte[] bytes, @Nullable final DecryptBytesHandler handler) throws GeneralSecurityException, IOException { final Cipher cipher = getCachedInstance(); try { if (null != handler) { handler.initialize(cipher, key, bytes); } byte[] decryptedBytes = cipher.doFinal(bytes, IV.IV_LENGTH, bytes.length - IV.IV_LENGTH); return new String(decryptedBytes, UTF8); } catch (Throwable fail) { Log.w(LOG_TAG, fail.getMessage(), fail); throw fail; } }

Target:
protected String decryptBytes(@NonNull final Key key, @NonNull final byte[] bytes, @Nullable final DecryptBytesHandler handler) throws GeneralSecurityException, IOException { final Cipher cipher = getCachedInstance(); try { final IvParameterSpec iv = IV.readIv(bytes); cipher.init(Cipher.DECRYPT_MODE, key, iv); byte[] decryptedBytes = cipher.doFinal(bytes, IV.IV_LENGTH, bytes.length - IV.IV_LENGTH); return new String(decryptedBytes, UTF8); } catch (Throwable fail) { Log.w(LOG_TAG, fail.getMessage(), fail); throw fail; } }
Source:
public void getLocation(Network network, final LocationProviderCallback callback) { try { String request = Context.getObjectMapper().writeValueAsString(network); Context.getAsyncHttpClient().preparePost(url) .setHeader("Content-Type", "application/json") .setHeader("Content-Length", "" + request.length()) .setBody(request).execute(new AsyncCompletionHandler() { @Override public Object onCompleted(Response response) throws Exception { try (JsonReader reader = Json.createReader(response.getResponseBodyAsStream())) { JsonObject json = reader.readObject(); if (json.containsKey("error")) { callback.onFailure( new GeolocationException(json.getJsonObject("error").getString("message"))); } else { JsonObject location = json.getJsonObject("location"); callback.onSuccess( location.getJsonNumber("lat").doubleValue(), location.getJsonNumber("lng").doubleValue(), json.getJsonNumber("accuracy").doubleValue()); } } return null; } @Override public void onThrowable(Throwable t) { callback.onFailure(t); } }); } catch (JsonProcessingException e) { callback.onFailure(e); } }

Target:
public void getLocation(Network network, final LocationProviderCallback callback) { try { String request = Context.getObjectMapper().writeValueAsString(network); Context.getAsyncHttpClient().preparePost(url) .setHeader(HttpHeaders.CONTENT_TYPE, MediaType.APPLICATION_JSON) .setHeader(HttpHeaders.CONTENT_LENGTH, String.valueOf(request.length())) .setBody(request).execute(new AsyncCompletionHandler() { @Override public Object onCompleted(Response response) throws Exception { try (JsonReader reader = Json.createReader(response.getResponseBodyAsStream())) { JsonObject json = reader.readObject(); if (json.containsKey("error")) { callback.onFailure( new GeolocationException(json.getJsonObject("error").getString("message"))); } else { JsonObject location = json.getJsonObject("location"); callback.onSuccess( location.getJsonNumber("lat").doubleValue(), location.getJsonNumber("lng").doubleValue(), json.getJsonNumber("accuracy").doubleValue()); } } return null; } @Override public void onThrowable(Throwable t) { callback.onFailure(t); } }); } catch (JsonProcessingException e) { callback.onFailure(e); } }
Source:
public void shouldWriteCompleteRepliesSummaryWhenRepliesFetcherIsProvided() throws IOException { PartialList<Comment> returnedComments = new PartialList<>(Lists.reverse(replies), replies.size()); when(commentManager.getComments(any(CoreSession.class), eq(comment.getId()), eq(1L), eq(0L), eq(false))).thenReturn(returnedComments); JsonAssert json = jsonAssert(comment, context); verify(commentManager).getComments(any(CoreSession.class), eq(comment.getId()), eq(1L), eq(0L), eq(false)); assertCommentProperties(json); assertRepliesSummary(json, true); }

Target:
public void shouldWriteCompleteRepliesSummaryWhenRepliesFetcherIsProvided() throws IOException { Collections.reverse(replies); when(commentManager.getComments(any(CoreSession.class), eq(comment.getId()), eq(1L), eq(0L), eq(false))).thenReturn(new PartialList<>(replies, replies.size())); JsonAssert json = jsonAssert(comment, context); verify(commentManager).getComments(any(CoreSession.class), eq(comment.getId()), eq(1L), eq(0L), eq(false)); assertCommentProperties(json); assertRepliesSummary(json, true); }
Source:
public boolean hasRequiredPermissionForPermission(String permission, Predicate<String> hasPermissionPredicate) { Config config = Sirius.getSettings().getConfig("security.packages.required-permissions-for-permission"); if (!config.hasPath(permission)) { return true; } String requiredPermission = config.getString(permission); return hasPermissionPredicate.test(requiredPermission); }

Target:
public boolean hasRequiredPermissionForPermission(String permission, Predicate<String> hasPermissionPredicate) { Config config = Sirius.getSettings().getConfig("security.packages.required-permissions-for-permission"); if (!config.hasPath(permission)) { return true; } String requiredPermission = config.getString(permission); return Permissions.hasPermission(requiredPermission, hasPermissionPredicate); }
Source:
public Map<?, ?> addArticleLinks(Map<?, ?> searchResults, HttpServletRequest request, Site site, SiteSet siteSet) throws IOException { List<Map> docs = (List<Map>) searchResults.get("docs"); for (Map doc : docs) { String doi = (String) doc.get("id"); List<String> crossPubbedJournals = (List<String>) doc.get("cross_published_journal_key"); Site resultSite = null; for (String journalKey : crossPubbedJournals) { resultSite = site.getTheme().resolveForeignJournalKey(siteSet, journalKey); boolean isCollection = (boolean) resultSite.getTheme().getConfigMap("journal").get("isCollection"); if (!isCollection) { break; } } doc.put("link", resultSite.getRequestScheme().buildLink(request, "/article?id=" + doi)); } return searchResults; }

Target:
public Map<?, ?> addArticleLinks(Map<?, ?> searchResults, HttpServletRequest request, Site site, SiteSet siteSet) throws IOException { initializeEIssnToJournalKeyMap(siteSet, site); List<Map> docs = (List<Map>) searchResults.get("docs"); for (Map doc : docs) { String doi = (String) doc.get("id"); String eIssn = (String) doc.get("eissn"); Site resultSite = site.getTheme().resolveForeignJournalKey(siteSet, eIssnToJournalKey.get(eIssn)); doc.put("link", resultSite.getRequestScheme().buildLink(request, "/article?id=" + doi)); } return searchResults; }
Source:
public static ModelConfig loadModelConfig(String path, SourceType sourceType) throws IOException { ModelConfig modelConfig = loadJSON(path, sourceType, ModelConfig.class); if(modelConfig.getTrain().getGridConfigFile() != null) { modelConfig.getTrain().setGridConfigFileContent(loadFileContent(modelConfig.getTrain().getGridConfigFile(), sourceType)); } return modelConfig; }

Target:
public static ModelConfig loadModelConfig(String path, SourceType sourceType) throws IOException { ModelConfig modelConfig = loadJSON(path, sourceType, ModelConfig.class); if(modelConfig.getTrain().getGridConfigFile() != null) { String gridConfigPath = modelConfig.getTrain().getGridConfigFile(); if(sourceType == SourceType.HDFS) { gridConfigPath = new PathFinder(modelConfig).getPathBySourceType( gridConfigPath.substring(gridConfigPath.lastIndexOf(File.separator) + 1), SourceType.HDFS); } modelConfig.getTrain().setGridConfigFileContent(loadFileContent(gridConfigPath, sourceType)); } return modelConfig; }
Source:
private MediaModel getMediaModelFromEditorImageMetaData() { MediaModel mediaModel = new MediaModel(); mediaModel.setUrl(mEditorImageMetaData.getSrc()); mediaModel.setTitle(mEditorImageMetaData.getTitle()); mediaModel.setCaption(mEditorImageMetaData.getCaption()); mediaModel.setAlt(mEditorImageMetaData.getAlt()); mediaModel.setFileName(mEditorImageMetaData.getSrc().substring(mEditorImageMetaData.getSrc().lastIndexOf("/") + 1)); mediaModel.setFileExtension(org.wordpress.android.fluxc.utils.MediaUtils.getExtension(mEditorImageMetaData.getSrc())); mediaModel.setWidth(mEditorImageMetaData.getWidthInt()); mediaModel.setHeight(mEditorImageMetaData.getHeightInt()); return mediaModel; }

Target:
private MediaModel getMediaModelFromEditorImageMetaData() { MediaModel mediaModel = new MediaModel(); mediaModel.setUrl(mEditorImageMetaData.getSrc()); mediaModel.setTitle(mEditorImageMetaData.getTitle()); mediaModel.setCaption(mEditorImageMetaData.getCaption()); mediaModel.setAlt(mEditorImageMetaData.getAlt()); if (!TextUtils.isEmpty(mEditorImageMetaData.getSrc())) { mediaModel.setFileName(mEditorImageMetaData.getSrc().substring(mEditorImageMetaData.getSrc().lastIndexOf("/") + 1)); } mediaModel.setFileExtension(org.wordpress.android.fluxc.utils.MediaUtils.getExtension(mEditorImageMetaData.getSrc())); mediaModel.setWidth(mEditorImageMetaData.getWidthInt()); mediaModel.setHeight(mEditorImageMetaData.getHeightInt()); return mediaModel; }
Source:
private SearchResult userRecord(String query) { LdapContext context = getServiceContext(); try { SearchControls controls = new SearchControls(); controls.setSearchScope(SUBTREE_SCOPE); NamingEnumeration<SearchResult> results; try { results = context.search(getConstantsConfig().getDomain(), query, controls); } catch (NamingException e) { logger.info("Failed to search: " + query + "with DN=" + getConstantsConfig().getDomain() + " as the scope.", e); throw new ClientVisibleException(ResponseCodes.INTERNAL_SERVER_ERROR, "LdapConfig", "Organizational Unit not found.", null); } if (!results.hasMoreElements()) { logger.error("Cannot locate user information for " + query); return null; } SearchResult result; try { result = results.next(); logger.trace("Found LDAP SearchResult object: " + result.toString()); if (results.hasMoreElements()) { logger.error("More than one result."); return null; } if (!hasPermission(result.getAttributes())) { return null; } } catch (NamingException e) { logger.error("No results. when searching. " + query); return null; } return result; } finally { if (context != null) { contextPool.returnObject(context); } } }

Target:
private SearchResult userRecord(String query) { LdapContext context = getServiceContext(); try { SearchControls controls = new SearchControls(); controls.setSearchScope(SUBTREE_SCOPE); NamingEnumeration<SearchResult> results; try { results = context.search(getConstantsConfig().getDomain(), query, controls); } catch (NamingException e) { logger.info("Failed to search: " + query + "with DN=" + getConstantsConfig().getDomain() + " as the scope.", e); throw new ClientVisibleException(ResponseCodes.INTERNAL_SERVER_ERROR, "LdapConfig", "Organizational Unit not found.", null); } if (!results.hasMoreElements()) { logger.error("Cannot locate user information for " + query); return null; } SearchResult result; try { result = results.next(); logger.trace("Found LDAP SearchResult object: {}", result); if (results.hasMoreElements()) { logger.error("More than one result."); return null; } if (!hasPermission(result.getAttributes())) { return null; } } catch (NamingException e) { logger.error("No results. when searching. " + query); return null; } return result; } finally { if (context != null) { contextPool.returnObject(context); } } }
Source:
public void showTargetFeedback(Request req) { if (req.getType().equals(org.eclipse.gmf.runtime.diagram.ui.requests.RequestConstants.REQ_DROP) || req.getType().equals(REQ_MOVE) || req.getType().equals(REQ_RESIZE) || req.getType().equals(REQ_CLONE) || req.getType().equals(REQ_ADD) || req.getType().equals(REQ_CREATE)) { Integer value; value = (Integer) req.getExtendedData().get(SnapToGeometry.KEY_WEST_ANCHOR); highlightGuide(value, nsewColor, 0); value = (Integer) req.getExtendedData().get(SnapToGeometry.KEY_NORTH_ANCHOR); highlightGuide(value, nsewColor, 1); value = (Integer) req.getExtendedData().get(SnapToGeometry.KEY_EAST_ANCHOR); highlightGuide(value, nsewColor, 2); value = (Integer) req.getExtendedData().get(SnapToGeometry.KEY_SOUTH_ANCHOR); highlightGuide(value, nsewColor, 3); value = (Integer) req.getExtendedData().get(SnapToGuides.KEY_VERTICAL_GUIDE); highlightGuide(value, guideColor, 4); value = (Integer) req.getExtendedData().get(SnapToGuides.KEY_HORIZONTAL_GUIDE); highlightGuide(value, guideColor, 5); } }

Target:
public void showTargetFeedback(Request req) { if (req.getType().equals(RequestConstants.REQ_DROP) || req.getType().equals(REQ_MOVE) || req.getType().equals(REQ_RESIZE) || req.getType().equals(REQ_CLONE) || req.getType().equals(REQ_ADD) || req.getType().equals(REQ_CREATE)) { Integer value; value = (Integer) req.getExtendedData().get(SnapToGeometry.KEY_WEST_ANCHOR); highlightGuide(value, nsewColor, 0); value = (Integer) req.getExtendedData().get(SnapToGeometry.KEY_NORTH_ANCHOR); highlightGuide(value, nsewColor, 1); value = (Integer) req.getExtendedData().get(SnapToGeometry.KEY_EAST_ANCHOR); highlightGuide(value, nsewColor, 2); value = (Integer) req.getExtendedData().get(SnapToGeometry.KEY_SOUTH_ANCHOR); highlightGuide(value, nsewColor, 3); value = (Integer) req.getExtendedData().get(SnapToGuides.KEY_VERTICAL_GUIDE); highlightGuide(value, guideColor, 4); value = (Integer) req.getExtendedData().get(SnapToGuides.KEY_HORIZONTAL_GUIDE); highlightGuide(value, guideColor, 5); } }
Source:
public void removeTransactionStateFromCache(long startTimestamp) { timestampMap.remove(startTimestamp); }

Target:
public void removeTransactionStateFromCache(long startTimestamp) { timestampStateStore.remove(startTimestamp); retentionEventsInLog(); }
Source:
public void testSetBrightness() { final int mode = Settings.System.getInt(mContext.getContentResolver(), Settings.System.SCREEN_BRIGHTNESS_MODE, SCREEN_BRIGHTNESS_MODE_AUTOMATIC); if(mode==1) { mDevicePolicyManager.setSystemSetting(ADMIN_RECEIVER_COMPONENT, Settings.System.SCREEN_BRIGHTNESS_MODE, "0"); testSetBrightnessWithValue(TEST_BRIGHTNESS_1); testSetBrightnessWithValue(TEST_BRIGHTNESS_2); mDevicePolicyManager.setSystemSetting(ADMIN_RECEIVER_COMPONENT, Settings.System.SCREEN_BRIGHTNESS_MODE, "1"); } else { testSetBrightnessWithValue(TEST_BRIGHTNESS_1); testSetBrightnessWithValue(TEST_BRIGHTNESS_2); } }

Target:
public void testSetBrightness() { final int mode = Settings.System.getInt(mContext.getContentResolver(), Settings.System.SCREEN_BRIGHTNESS_MODE, SCREEN_BRIGHTNESS_MODE_AUTOMATIC); if(mode == SCREEN_BRIGHTNESS_MODE_AUTOMATIC) { mDevicePolicyManager.setSystemSetting(ADMIN_RECEIVER_COMPONENT, Settings.System.SCREEN_BRIGHTNESS_MODE, "0"); testSetBrightnessWithValue(TEST_BRIGHTNESS_1); testSetBrightnessWithValue(TEST_BRIGHTNESS_2); mDevicePolicyManager.setSystemSetting(ADMIN_RECEIVER_COMPONENT, Settings.System.SCREEN_BRIGHTNESS_MODE, mode == SCREEN_BRIGHTNESS_MODE_AUTOMATIC? "1" : "0"); } else { testSetBrightnessWithValue(TEST_BRIGHTNESS_1); testSetBrightnessWithValue(TEST_BRIGHTNESS_2); } }
Source:
public void convertProject(IProject project, IProgressMonitor monitor, String projectID) throws CoreException { SubMonitor progress = SubMonitor.convert(monitor, MakeUIPlugin.getResourceString("WizardMakeProjectConversion.monitor.convertingToMakeProject"), 3); try { super.convertProject(project, progress.split(1), projectID); MakeProjectNature.addNature(project, SubMonitor.convert(monitor, 1)); ScannerConfigNature.addScannerConfigNature(project); ScannerConfigNature.initializeDiscoveryOptions(project); CCorePlugin.getDefault().mapCProjectOwner(project, projectID, true); } finally { monitor.done(); } }

Target:
public void convertProject(IProject project, IProgressMonitor monitor, String projectID) throws CoreException { SubMonitor progress = SubMonitor.convert(monitor, MakeUIPlugin.getResourceString("WizardMakeProjectConversion.monitor.convertingToMakeProject"), 1); try { super.convertProject(project, progress.split(1), projectID); MakeProjectNature.addNature(project, SubMonitor.convert(monitor, 1)); ScannerConfigNature.addScannerConfigNature(project); ScannerConfigNature.initializeDiscoveryOptions(project); CCorePlugin.getDefault().mapCProjectOwner(project, projectID, true); } finally { progress.worked(1); } }
Source:
public void testGenerateGroupId() { String user = System.getProperty("user.name"); String vcloudGroupId = JcloudsLocation.generateGroupId("vcloud"); assertTrue(vcloudGroupId.startsWith("br-")); String fooGroupId = JcloudsLocation.generateGroupId("foo"); if (!"brooklyn".equals(user)) assertTrue(fooGroupId.startsWith("brooklyn-"+user)); }

Target:
public void testGenerateGroupId() { String user = System.getProperty("user.name"); String vcloudGroupId = JcloudsLocation.generateGroupId("vcloud"); assertTrue(vcloudGroupId.startsWith("br-")); String fooGroupId = JcloudsLocation.generateGroupId("foo"); if ("brooklyn".equals(user)) { } else { assertTrue(fooGroupId.startsWith("brooklyn-"+user)); } }
Source:
private void configure(IMavenProjectFacade facade) { new WorkspaceJob(NLS.bind("Adding utility facet to project {0}", facade.getProject().getName())) { @Override public IStatus runInWorkspace(IProgressMonitor monitor) throws CoreException { try { MavenProject mavenProject = facade.getMavenProject(monitor); ModuleCoreNature.addModuleCoreNatureIfNecessary(facade.getProject(), monitor); addUtilityFacet(mavenProject, facade.getProject(), monitor); if (ModuleUtils.hasModuleCoreNature(project)) { ModuleUtils.addChildModule(facade.getProject(), project, monitor); } unconfiguredDependencies.remove(facade); if (unconfiguredDependencies.isEmpty()) { stop(); } return Status.OK_STATUS; } catch (Exception e) { MavenCoreActivator.logError(e); return StatusFactory.errorStatus(MavenCoreActivator.PLUGIN_ID, NLS.bind("Could not add utility facet to project {0}.", facade.getProject().getName())); } } }.schedule(); }

Target:
private void configure(IMavenProjectFacade facade) { new WorkspaceJob(NLS.bind("Adding utility facet to project {0}", facade.getProject().getName())) { @Override public IStatus runInWorkspace(IProgressMonitor monitor) throws CoreException { try { MavenProject mavenProject = facade.getMavenProject(monitor); addUtilityFacet(mavenProject, facade.getProject(), monitor); ModuleUtils.addChildModule(facade.getProject(), project, monitor); unconfiguredDependencies.remove(facade); if (unconfiguredDependencies.isEmpty()) { stop(); } return Status.OK_STATUS; } catch (Exception e) { MavenCoreActivator.logError(e); return StatusFactory.errorStatus(MavenCoreActivator.PLUGIN_ID, NLS.bind("Could not add utility facet to project {0}.", facade.getProject().getName())); } } }.schedule(); }
Source:
public JobDetail populatedHostedDB() { if (config.getBoolean(ConfigProperties.STANDALONE)) { log.warn("Ignoring populate DB request due to standalone config."); return null; } return PopulateHostedDBTask.createAsyncTask(); }

Target:
public JobDetail populatedHostedDB() { if (config.getBoolean(ConfigProperties.STANDALONE)) { log.warn("Ignoring populate DB request in standalone environment"); return null; } return PopulateHostedDBTask.createAsyncTask(); }