auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public void shouldNotFailEmptyChecks() throws Exception { GHCommitPointer commitPtr = mock(GHCommitPointer.class); when(local.getPulls()).thenReturn(ImmutableMap.of(3, localPR)); when(localPR.getHeadSha()).thenReturn("this is not the sha you are looking for"); when(remotePR.getNumber()).thenReturn(3); when(remotePR.getState()).thenReturn(GHIssueState.OPEN); when(remotePR.getHead()).thenReturn(commitPtr); when(trigger.getEvents()).thenReturn(Collections.<GitHubPREvent>emptyList()); final GitHubPRCause cause = toGitHubPRCause(local, tlRule.getListener(), trigger) .apply(remotePR); assertThat(cause, nullValue()); }

Target:
public void shouldNotFailEmptyChecks() throws Exception { final GitHubPRCause cause = toGitHubPRCause(local, tlRule.getListener(), trigger) .apply(remotePR); assertThat(cause, nullValue()); }
Source:
public void filter(ContainerRequestContext request, ContainerResponseContext response) throws IOException { if (rest != null && rest.isEnableCors()) { response.getHeaders().add("Access-Control-Allow-Origin", "*"); response.getHeaders().add( "Access-Control-Allow-Headers", "origin, content-type, accept, authorization" ); response.getHeaders().add("Access-Control-Allow-Credentials", "true"); response.getHeaders().add("Access-Control-Allow-Methods", "GET, POST, PUT, DELETE, OPTIONS, HEAD"); } }

Target:
public void filter(ContainerRequestContext request, ContainerResponseContext response) { if (rest != null && rest.isEnableCors()) { response.getHeaders().add("Access-Control-Allow-Origin", "*"); response.getHeaders().add("Access-Control-Allow-Headers", "origin, content-type, accept, authorization"); response.getHeaders().add("Access-Control-Allow-Credentials", "true"); response.getHeaders().add("Access-Control-Allow-Methods", "GET, POST, PUT, PATCH, DELETE, OPTIONS, HEAD"); } }
Source:
public void testParsingLimits() throws Exception { for (Map.Entry<String, Long> e : s_validLimits.entrySet()) { long lim = RetentionPolicyMgr.parseByteLimit(e.getKey()); assertEquals(lim, e.getValue().longValue()); } for (String limStr : s_invalidLimits) { try { long lim = RetentionPolicyMgr.parseByteLimit(limStr); assertNull(limStr); } catch (RetentionLimitException expected) { ; } } }

Target:
public void testParsingLimits() throws Exception { for (Map.Entry<String, Long> e : s_validLimits.entrySet()) { long lim = RetentionPolicyMgr.parseByteLimit(e.getKey()); assertEquals(lim, e.getValue().longValue()); } for (String limStr : s_invalidLimits) { try { long lim = RetentionPolicyMgr.parseByteLimit(limStr); fail(); } catch (RetentionLimitException expected) { ; } } }
Source:
protected void notifyAccountUpdateConsumers(Collection<Account> updatedAccounts, boolean isCalledFromListener) { if (updatedAccounts.size() > 0) { logger.info("Received updates for accounts. Received from listener={}. Accounts={}", updatedAccounts.size(), isCalledFromListener, updatedAccounts); if (isCalledFromListener) { accountServiceMetrics.accountUpdatesCapturedByScheduledUpdaterCount.inc(); } for (Consumer<Collection<Account>> accountUpdateConsumer : accountUpdateConsumers) { long startTime = System.currentTimeMillis(); try { accountUpdateConsumer.accept(Collections.unmodifiableCollection(updatedAccounts)); long consumerExecutionTimeInMs = System.currentTimeMillis() - startTime; logger.trace("Consumer={} has been notified for account change, took ms", accountUpdateConsumer, consumerExecutionTimeInMs); accountServiceMetrics.accountUpdateConsumerTimeInMs.update(consumerExecutionTimeInMs); } catch (Exception e) { logger.error("Exception occurred when notifying accountUpdateConsumer={}", accountUpdateConsumer, e); } } } else { logger.debug("HelixAccountService is updated with 0 updated account"); } }

Target:
protected void notifyAccountUpdateConsumers(Collection<Account> updatedAccounts, boolean isCalledFromListener) { if (updatedAccounts.size() > 0) { logger.info("Received updates for accounts. Received from listener={}. Account IDs={}", updatedAccounts.size(), isCalledFromListener, updatedAccounts.stream().map(Account::getId).collect(Collectors.toList())); if (isCalledFromListener) { accountServiceMetrics.accountUpdatesCapturedByScheduledUpdaterCount.inc(); } for (Consumer<Collection<Account>> accountUpdateConsumer : accountUpdateConsumers) { long startTime = System.currentTimeMillis(); try { accountUpdateConsumer.accept(Collections.unmodifiableCollection(updatedAccounts)); long consumerExecutionTimeInMs = System.currentTimeMillis() - startTime; logger.trace("Consumer={} has been notified for account change, took ms", accountUpdateConsumer, consumerExecutionTimeInMs); accountServiceMetrics.accountUpdateConsumerTimeInMs.update(consumerExecutionTimeInMs); } catch (Exception e) { logger.error("Exception occurred when notifying accountUpdateConsumer={}", accountUpdateConsumer, e); } } } else { logger.debug("HelixAccountService is updated with 0 updated account"); } }
Source:
private ContactDataBuilder extractContactData(ContactDataBuilder builder, long contactId, Cursor cursor) { final ColumnProcessors processors = new ColumnProcessors(); final ColumnProcessor<LabelType> labelTypeProcessor = processors.forMappedEnum(LabelType.class, LabelType.values()); builder.setContactId(contactId); builder.setPhotoId(processors.forInteger().extract(cursor, Column.PHOTO_ID)); String mimeType = processors.forString().extract(cursor, Column.MIMETYPE); String data = processors.forString().extract(cursor, Column.DATA1); int isPrimary = processors.forInteger().extract(cursor, Column.IS_PRIMARY); if (mimeType.equals(Email.CONTENT_ITEM_TYPE)) { builder.addEmailId(data); } else if (mimeType.equals(Phone.CONTENT_ITEM_TYPE)) { LabelType labelType = labelTypeProcessor.extract(cursor, Column.DATA2); if (labelType == null) { labelType = LabelType.Other; } builder.addPhoneNumber(new ContactNumber(data, isPrimary > 0 ? true : false, labelType)); } else if (mimeType.equals(StructuredName.CONTENT_ITEM_TYPE)) { PersonNameDataBuilder nameBuilder = new PersonNameDataBuilder(); nameBuilder.setDisplayName(data); nameBuilder.setGivenName(processors.forString().extract(cursor, Column.DATA2)); nameBuilder.setFamilyName(processors.forString().extract(cursor, Column.DATA3)); nameBuilder.setPrefix(processors.forString().extract(cursor, Column.DATA4)); nameBuilder.setMiddleName(processors.forString().extract(cursor, Column.DATA5)); nameBuilder.setSuffix(processors.forString().extract(cursor, Column.DATA6)); builder.setName(nameBuilder); } return builder; }

Target:
private ContactDataBuilder extractContactData(ContactDataBuilder builder, long contactId, Cursor cursor) { final ColumnProcessors processors = new ColumnProcessors(); final ColumnProcessor<ContactLabel> labelTypeProcessor = processors.forMappedEnum(ContactLabel.class, ContactLabel.values()); builder.setContactId(contactId); builder.setPhotoId(processors.forInteger().extract(cursor, Column.PHOTO_ID)); String mimeType = processors.forString().extract(cursor, Column.MIMETYPE); String data = processors.forString().extract(cursor, Column.DATA1); int isPrimary = processors.forInteger().extract(cursor, Column.IS_PRIMARY); if (mimeType.equals(Email.CONTENT_ITEM_TYPE)) { builder.addEmailId(data); } else if (mimeType.equals(Phone.CONTENT_ITEM_TYPE)) { ContactLabel labelType = labelTypeProcessor.extract(cursor, Column.DATA2); builder.addPhoneNumber(new ContactNumber(data, isPrimary > 0 ? true : false, labelType)); } else if (mimeType.equals(StructuredName.CONTENT_ITEM_TYPE)) { PersonNameDataBuilder nameBuilder = new PersonNameDataBuilder(); nameBuilder.setDisplayName(data); nameBuilder.setGivenName(processors.forString().extract(cursor, Column.DATA2)); nameBuilder.setFamilyName(processors.forString().extract(cursor, Column.DATA3)); nameBuilder.setPrefix(processors.forString().extract(cursor, Column.DATA4)); nameBuilder.setMiddleName(processors.forString().extract(cursor, Column.DATA5)); nameBuilder.setSuffix(processors.forString().extract(cursor, Column.DATA6)); builder.setName(nameBuilder); } return builder; }
Source:
protected void addNewProvidedObjects(List<String> newPortfolio, List<String> previousPortfolio, Set<E> parsedObjects) { List<ProviderChangeListener<E>> snapshot = null; synchronized (listeners) { snapshot = new LinkedList<ProviderChangeListener<E>>(listeners); } for (E parsedObject : parsedObjects) { String uid = getUID(parsedObject); E oldelement = providedObjectsHolder.get(uid); if (oldelement != null && !previousPortfolio.contains(uid)) { logger.warn( String.format("%s with UID \"%s\" already exists! Failed to add a second with the same UID!", parsedObject.getClass().getName(), uid)); continue; } else { newPortfolio.add(uid); providedObjectsHolder.put(uid, parsedObject); for (ProviderChangeListener<E> listener : snapshot) { if (oldelement == null) { listener.added((Provider<E>) this, parsedObject); } else { listener.updated((Provider<E>) this, oldelement, parsedObject); } } } } }

Target:
protected void addNewProvidedObjects(List<String> newPortfolio, List<String> previousPortfolio, Set<E> parsedObjects) { List<ProviderChangeListener<E>> snapshot = null; synchronized (listeners) { snapshot = new LinkedList<ProviderChangeListener<E>>(listeners); } for (E parsedObject : parsedObjects) { String uid = getUID(parsedObject); E oldElement = providedObjectsHolder.get(uid); if (oldElement != null && !previousPortfolio.contains(uid)) { logger.warn("{} with UID '{}' already exists! Failed to add a second with the same UID!", parsedObject.getClass().getName(), uid); continue; } else { newPortfolio.add(uid); providedObjectsHolder.put(uid, parsedObject); for (ProviderChangeListener<E> listener : snapshot) { if (oldElement == null) { listener.added((Provider<E>) this, parsedObject); } else { listener.updated((Provider<E>) this, oldElement, parsedObject); } } } } }
Source:
public TokenCredentials extract(WebContext context) throws HttpAction, CredentialsException { final String method = context.getRequestMethod(); if (HTTP_METHOD.GET.name().equals(method) && !supportGetRequest) { throw new CredentialsException("GET requests not supported"); } else if (HTTP_METHOD.POST.name().equals(method) && !supportPostRequest) { throw new CredentialsException("POST requests not supported"); } final String value = context.getRequestParameter(this.parameterName); if (value == null) { return null; } return new TokenCredentials(value, clientName); }

Target:
public TokenCredentials extract(WebContext context) throws HttpAction, CredentialsException { final String method = context.getRequestMethod(); if (HTTP_METHOD.GET.name().equalsIgnoreCase(method) && !supportGetRequest) { throw new CredentialsException("GET requests not supported"); } else if (HTTP_METHOD.POST.name().equalsIgnoreCase(method) && !supportPostRequest) { throw new CredentialsException("POST requests not supported"); } final String value = context.getRequestParameter(this.parameterName); if (value == null) { return null; } return new TokenCredentials(value, clientName); }
Source:
public ScoredCandidates<Item> score( org.atlasapi.media.entity.Item subject, Set<? extends org.atlasapi.media.entity.Item> candidates, ResultDescription desc, EquivToTelescopeResults equivToTelescopeResults ) { EquivToTelescopeComponent scorerComponent = EquivToTelescopeComponent.create(); scorerComponent.setComponentName("Item Year Scorer"); DefaultScoredCandidates.Builder<Item> equivalents = DefaultScoredCandidates.fromSource(YEAR); for (Item candidate : candidates) { Score score = score(subject, candidate); equivalents.addEquivalent(candidate, score); scorerComponent.addComponentResult( candidate.getId(), String.valueOf(score.asDouble()) ); } equivToTelescopeResults.addScorerResult(scorerComponent); return equivalents.build(); }

Target:
public ScoredCandidates<Item> score( org.atlasapi.media.entity.Item subject, Set<? extends org.atlasapi.media.entity.Item> candidates, ResultDescription desc, EquivToTelescopeResults equivToTelescopeResults ) { EquivToTelescopeComponent scorerComponent = EquivToTelescopeComponent.create(); scorerComponent.setComponentName("Item Year Scorer"); DefaultScoredCandidates.Builder<Item> scoredCandidates = DefaultScoredCandidates.fromSource(YEAR); for (Item candidate : candidates) { Score score = score(subject, candidate); scoredCandidates.addEquivalent(candidate, score); scorerComponent.addComponentResult( candidate.getId(), String.valueOf(score.asDouble()) ); } equivToTelescopeResults.addScorerResult(scorerComponent); return scoredCandidates.build(); }
Source:
private void addRecipientsFromAddresses(final RecipientType recipientType, final Address... addresses) { new RecipientLoader(context, cryptoProvider, addresses) { @Override public void deliverResult(List<Recipient> result) { Recipient[] recipientArray = result.toArray(new Recipient[result.size()]); recipientView.addRecipients(recipientType, recipientArray); stopLoading(); } }.startLoading(); }

Target:
private void addRecipientsFromAddresses(final RecipientType recipientType, final Address... addresses) { new RecipientLoader(context, cryptoProvider, addresses) { @Override public void deliverResult(List<Recipient> result) { Recipient[] recipientArray = result.toArray(new Recipient[result.size()]); recipientMvpView.addRecipients(recipientType, recipientArray); stopLoading(); abandon(); } }.startLoading(); }
Source:
AggregationBuilder bucketsAgg(final QueryFilter filter, final String interval) { DateHistogramInterval dateHistogramInterval = null; if (interval.endsWith("d")) { dateHistogramInterval = DateHistogramInterval .days(Integer.valueOf(interval.substring(0, interval.length() - 1))); } else if (interval.endsWith("h")) { dateHistogramInterval = DateHistogramInterval .hours(Integer.valueOf(interval.substring(0, interval.length() - 1))); } else if (interval.endsWith("m")) { dateHistogramInterval = DateHistogramInterval .hours(Integer.valueOf(interval.substring(0, interval.length() - 1))); } else { throw new IllegalArgumentException("Please set valid interval"); } System.out.println("HERE"); DateHistogramAggregationBuilder agg = AggregationBuilders.dateHistogram(TIME_AGG) .field(START_TIME_FIELD) .dateHistogramInterval(dateHistogramInterval); System.out.println("HERE1" ); return AggregationBuilders.terms(EVENT_TYPE_AGG). field(RESULT_EVENT_TYPE_FIELD) .subAggregation(agg); }

Target:
AggregationBuilder bucketsAgg(final QueryFilter filter, final String interval) { DateHistogramInterval dateHistogramInterval = null; if (interval.endsWith("d")) { dateHistogramInterval = DateHistogramInterval .days(Integer.valueOf(interval.substring(0, interval.length() - 1))); } else if (interval.endsWith("h")) { dateHistogramInterval = DateHistogramInterval .hours(Integer.valueOf(interval.substring(0, interval.length() - 1))); } else if (interval.endsWith("m")) { dateHistogramInterval = DateHistogramInterval .minutes(Integer.valueOf(interval.substring(0, interval.length() - 1))); } else { throw new IllegalArgumentException("Please set valid interval"); } DateHistogramAggregationBuilder agg = AggregationBuilders.dateHistogram(TIME_AGG) .field(START_TIME_FIELD) .dateHistogramInterval(dateHistogramInterval); return AggregationBuilders.terms(EVENT_TYPE_AGG). field(RESULT_EVENT_TYPE_FIELD) .subAggregation(agg); }
Source:
public void validPlatformsAndApiLevels() { final AndroidSdk sdk16 = new AndroidSdk(new File(sdkTestSupport.getEnv_ANDROID_HOME()), "19"); }

Target:
public void validPlatformsAndApiLevels() { final AndroidSdk sdk19 = new AndroidSdk(new File(sdkTestSupport.getEnv_ANDROID_HOME()), "19"); }
Source:
public String getDomainsConfigurationEntry() { StringBuilder configurationEntry = new StringBuilder(""); boolean firstEntry = true; for ( Entry<String,String> currEntry: valuePerDomain.entrySet() ) { if (!firstEntry) { configurationEntry.append(domainSeperator); } else { firstEntry = false; } configurationEntry.append(currEntry.getKey()); if (currEntry.getValue() != null) { configurationEntry.append(valueSeperator).append(currEntry.getValue()); } } return configurationEntry.toString(); }

Target:
public String getDomainsConfigurationEntry() { StringBuilder configurationEntry = new StringBuilder(); boolean firstEntry = true; for ( Entry<String,String> currEntry: valuePerDomain.entrySet() ) { if (!firstEntry) { configurationEntry.append(domainSeperator); } else { firstEntry = false; } configurationEntry.append(currEntry.getKey()); if (currEntry.getValue() != null) { configurationEntry.append(valueSeperator).append(currEntry.getValue()); } } return configurationEntry.toString(); }
Source:
public void setUp() throws Exception { font = new Font(display, "Arial", 12, SWT.NORMAL); shell = new Shell(display); shell.setSize(600, 400); shell.setLayout(GridLayoutFactory.fillDefaults().create()); shell.setFont(font); shell.open(); }

Target:
public void setUp() throws Exception { font = new Font(display, "Arial", 12, SWT.NORMAL); shell = new Shell(display); shell.setSize(600, 400); GridLayoutFactory.fillDefaults().applyTo(shell); shell.setFont(font); shell.open(); }
Source:
public void testDiscontinuousLocations() throws ExecutionException, InterruptedException { Configuration conf = new Configuration(TEST_UTIL.getConfiguration()); try (ZKConnectionRegistry registry = new ZKConnectionRegistry(conf)) { CompletableFuture<RegionLocations> cf = new CompletableFuture<>(); List<String> znodes = Arrays.asList( new String[] { ZNodePaths.META_ZNODE_PREFIX, ZNodePaths.META_ZNODE_PREFIX + "_003" }); registry.getMetaRegionLocation(cf, znodes); cf.get(); } }

Target:
public void testDiscontinuousLocations() throws ExecutionException, InterruptedException, IOException, KeeperException, TimeoutException { Configuration conf = new Configuration(TEST_UTIL.getConfiguration()); conf.set(HConstants.ZOOKEEPER_ZNODE_PARENT, "/" + this.name.getMethodName()); ZooKeeperProtos.MetaRegionServer pbrsr = ZooKeeperProtos.MetaRegionServer.newBuilder() .setServer(ProtobufUtil.toServerName(ServerName.valueOf("example.org,1,1"))) .setRpcVersion(HConstants.RPC_CURRENT_VERSION) .setState(RegionState.State.OPEN.convert()).build(); byte[] data = ProtobufUtil.prependPBMagic(pbrsr.toByteArray()); try (ZKWatcher zkw = new ZKWatcher(conf, this.name.getMethodName(), new Abortable() { @Override public void abort(String why, Throwable e) @Override public boolean isAborted() { return false; } })) { ZKUtil.createSetData(zkw, zkw.getZNodePaths().getZNodeForReplica(0), data); ZKUtil.createSetData(zkw, zkw.getZNodePaths().getZNodeForReplica(3), data); List<String> znodes = zkw.getMetaReplicaNodes(); assertEquals(2, znodes.size()); try (ZKConnectionRegistry registry = new ZKConnectionRegistry(conf)) { CompletableFuture<RegionLocations> cf = registry.getMetaRegionLocations(); RegionLocations locations = cf.get(60, TimeUnit.SECONDS); assertEquals(2, locations.numNonNullElements()); } } }
Source:
public EurekaInstanceConfigBean eurekaInstanceConfigBean(InetUtils inetUtils) { EurekaInstanceConfigBean instance = new EurekaInstanceConfigBean(inetUtils); instance.setNonSecurePort(this.nonSecurePort); instance.setInstanceId(getDefaultInstanceId(this.env)); instance.setPreferIpAddress(preferIpAddress); if (this.managementPort != this.nonSecurePort && this.managementPort != 0) { if (StringUtils.hasText(this.hostname)) { instance.setHostname(this.hostname); } RelaxedPropertyResolver relaxedPropertyResolver = new RelaxedPropertyResolver(env, "eureka.instance."); String statusPageUrlPath = relaxedPropertyResolver.getProperty("statusPageUrlPath"); String healthCheckUrlPath = relaxedPropertyResolver.getProperty("healthCheckUrlPath"); if (StringUtils.hasText(statusPageUrlPath)) { instance.setStatusPageUrlPath(statusPageUrlPath); } if (StringUtils.hasText(healthCheckUrlPath)) { instance.setHealthCheckUrlPath(healthCheckUrlPath); } String scheme = instance.getSecurePortEnabled() ? "https" : "http"; instance.setStatusPageUrl(scheme + "://" + instance.getHostname() + ":" + this.managementPort + instance.getStatusPageUrlPath()); instance.setHealthCheckUrl(scheme + "://" + instance.getHostname() + ":" + this.managementPort + instance.getHealthCheckUrlPath()); } return instance; }

Target:
public EurekaInstanceConfigBean eurekaInstanceConfigBean(InetUtils inetUtils) { RelaxedPropertyResolver relaxedPropertyResolver = new RelaxedPropertyResolver(env, "eureka.instance."); String hostname = relaxedPropertyResolver.getProperty("hostname"); boolean preferIpAddress = Boolean.parseBoolean(relaxedPropertyResolver.getProperty("preferIpAddress")); EurekaInstanceConfigBean instance = new EurekaInstanceConfigBean(inetUtils); instance.setNonSecurePort(this.nonSecurePort); instance.setInstanceId(getDefaultInstanceId(this.env)); instance.setPreferIpAddress(preferIpAddress); if (this.managementPort != this.nonSecurePort && this.managementPort != 0) { if (StringUtils.hasText(hostname)) { instance.setHostname(hostname); } String statusPageUrlPath = relaxedPropertyResolver.getProperty("statusPageUrlPath"); String healthCheckUrlPath = relaxedPropertyResolver.getProperty("healthCheckUrlPath"); if (StringUtils.hasText(statusPageUrlPath)) { instance.setStatusPageUrlPath(statusPageUrlPath); } if (StringUtils.hasText(healthCheckUrlPath)) { instance.setHealthCheckUrlPath(healthCheckUrlPath); } String scheme = instance.getSecurePortEnabled() ? "https" : "http"; instance.setStatusPageUrl(scheme + "://" + instance.getHostname() + ":" + this.managementPort + instance.getStatusPageUrlPath()); instance.setHealthCheckUrl(scheme + "://" + instance.getHostname() + ":" + this.managementPort + instance.getHealthCheckUrlPath()); } return instance; }
Source:
default String getParam(String paramName, String defaultValue) { Objects.requireNonNull(defaultValue, "defaultValue"); return params().contains(paramName) ? params().get(paramName) : defaultValue; }

Target:
default String getParam(String paramName, String defaultValue) { Objects.requireNonNull(defaultValue, "defaultValue"); final String paramValue = params().get(paramName); return paramValue != null ? paramValue : defaultValue; }
Source:
public void addExifCache(long objectID) { if (cacheBuildCount == 0) return; hasExifCache.add(objectID); }

Target:
public void addExifCache(long objectID) { synchronized (cacheLock) { if (cacheBuildCount == 0) return; hasExifCache.add(objectID); } }
Source:
public List<PrestoSparkRow> get() throws InterruptedException { List<PrestoSparkRow> rows = null; synchronized (monitor) { while (buffer.isEmpty() && !finished) { monitor.wait(); } if (!buffer.isEmpty()) { rows = buffer.poll(); } if (rows != null) { memoryManager.updateMemoryUsage(-getRetainedSize(rows)); } } return rows; }

Target:
public List<PrestoSparkRow> get() throws InterruptedException { BufferedRows bufferedRows = null; synchronized (monitor) { while (buffer.isEmpty() && !finished) { monitor.wait(); } if (!buffer.isEmpty()) { bufferedRows = buffer.poll(); } if (bufferedRows != null) { memoryManager.updateMemoryUsage(-bufferedRows.getRetainedSizeInBytes()); } } if (bufferedRows == null) { return null; } return bufferedRows.getRows(); }
Source:
private boolean setSealedReplicas(List<String> sealedReplicas) { HelixAdmin helixAdmin = manager.getClusterManagmentTool(); InstanceConfig instanceConfig = helixAdmin.getInstanceConfig(clusterName, instanceName); if (instanceConfig == null) { throw new IllegalStateException( "No instance config found for cluster: \"" + clusterName + "\", instance: \"" + instanceName + "\""); } logger.trace("Setting the list of sealed replicas in InstanceConfig"); instanceConfig.getRecord().setListField(ClusterMapUtils.SEALED_STR, sealedReplicas); return helixAdmin.setInstanceConfig(clusterName, instanceName, instanceConfig); }

Target:
private boolean setSealedReplicas(List<String> sealedReplicas) { HelixAdmin helixAdmin = manager.getClusterManagmentTool(); InstanceConfig instanceConfig = helixAdmin.getInstanceConfig(clusterName, instanceName); if (instanceConfig == null) { throw new IllegalStateException( "No instance config found for cluster: \"" + clusterName + "\", instance: \"" + instanceName + "\""); } logger.trace("Setting InstanceConfig with list of sealed replicas: {}", Arrays.toString(sealedReplicas.toArray())); instanceConfig.getRecord().setListField(ClusterMapUtils.SEALED_STR, sealedReplicas); return helixAdmin.setInstanceConfig(clusterName, instanceName, instanceConfig); }
Source:
public void testConstructAccountFromJson() throws Exception { System.out.println(refAccountJson); assertAccountAgainstReference(Account.fromJson(refAccountJson), true, true); }

Target:
public void testConstructAccountFromJson() throws Exception { assertAccountAgainstReference(Account.fromJson(refAccountJson), true, true); }
Source:
private static void checkGreater(final NakadiCursor less, final NakadiCursor greater) { Assert.assertTrue("Cursor " + less + " should be less then " + greater, comparator.compare(less, greater) < 0); Assert.assertTrue("Cursor " + greater + " should be greater then " + less, comparator.compare(greater, less) > 0); }

Target:
private static void checkGreater(final NakadiCursor less, final NakadiCursor greater) { Assert.assertTrue("Cursor " + less + " should be less than " + greater, comparator.compare(less, greater) < 0); Assert.assertTrue("Cursor " + greater + " should be greater than " + less, comparator.compare(greater, less) > 0); }
Source:
public void doGet(HttpServletRequest req, HttpServletResponse resp) throws IOException, ServletException { DataSource pool = (DataSource) req.getServletContext().getAttribute("my-pool"); int tabCount; int spaceCount; List<Vote> recentVotes = new ArrayList<>(); try (Connection conn = pool.getConnection()) { PreparedStatement voteStmt = conn.prepareStatement( "SELECT TOP(5) candidate, time_cast FROM votes ORDER BY time_cast DESC"); ResultSet voteResults = voteStmt.executeQuery(); while (voteResults.next()) { String candidate = voteResults.getString(1); Timestamp timeCast = voteResults.getTimestamp(2); recentVotes.add(new Vote(candidate.trim(), timeCast)); } PreparedStatement voteCountStmt = conn.prepareStatement( "SELECT COUNT(vote_id) FROM votes WHERE candidate=?"); voteCountStmt.setString(1, "TABS"); ResultSet tabResult = voteCountStmt.executeQuery(); tabResult.next(); tabCount = tabResult.getInt(1); voteCountStmt.setString(1, "SPACES"); ResultSet spaceResult = voteCountStmt.executeQuery(); spaceResult.next(); spaceCount = spaceResult.getInt(1); } catch (SQLException ex) { throw new ServletException("Unable to successfully connect to the database. Please check the " + "steps in the README and try again.", ex); } req.setAttribute("tabCount", tabCount); req.setAttribute("spaceCount", spaceCount); req.setAttribute("recentVotes", recentVotes); req.getRequestDispatcher("/index.jsp").forward(req, resp); }

Target:
public void doGet(HttpServletRequest req, HttpServletResponse resp) throws IOException, ServletException { DataSource pool = (DataSource) req.getServletContext().getAttribute("my-pool"); int tabCount; int spaceCount; List<Vote> recentVotes = new ArrayList<>(); try (Connection conn = pool.getConnection()) { PreparedStatement voteStmt = conn.prepareStatement( "SELECT TOP(5) candidate, time_cast FROM votes ORDER BY time_cast DESC"); ResultSet voteResults = voteStmt.executeQuery(); while (voteResults.next()) { String candidate = voteResults.getString(1); Timestamp timeCast = voteResults.getTimestamp(2); Vote vote = new Vote(candidate.trim(), timeCast); recentVotes.add(vote); } PreparedStatement voteCountStmt = conn.prepareStatement( "SELECT COUNT(vote_id) FROM votes WHERE candidate=?"); voteCountStmt.setString(1, "TABS"); ResultSet tabResult = voteCountStmt.executeQuery(); tabResult.next(); tabCount = tabResult.getInt(1); voteCountStmt.setString(1, "SPACES"); ResultSet spaceResult = voteCountStmt.executeQuery(); spaceResult.next(); spaceCount = spaceResult.getInt(1); } catch (SQLException ex) { throw new ServletException("Unable to successfully connect to the database. Please check the " + "steps in the README and try again.", ex); } req.setAttribute("tabCount", tabCount); req.setAttribute("spaceCount", spaceCount); req.setAttribute("recentVotes", recentVotes); req.getRequestDispatcher("/index.jsp").forward(req, resp); }
Source:
private boolean reserve(Resource perAllocationResource, FSSchedulerNode node, Container reservedContainer, NodeType type, SchedulerRequestKey schedulerKey) { if (!reservationExceedsThreshold(node, type)) { LOG.info("Making reservation: node=" + node.getNodeName() + " app_id=" + getApplicationId()); if (reservedContainer == null) { reservedContainer = createContainer(node, perAllocationResource, schedulerKey); getMetrics().reserveResource(getUser(), reservedContainer.getResource()); RMContainer rmContainer = super.reserve(node, schedulerKey, null, reservedContainer); node.reserveResource(this, schedulerKey, rmContainer); setReservation(node); } else { RMContainer rmContainer = node.getReservedContainer(); super.reserve(node, schedulerKey, rmContainer, reservedContainer); node.reserveResource(this, schedulerKey, rmContainer); setReservation(node); } return true; } return false; }

Target:
private boolean reserve(Resource perAllocationResource, FSSchedulerNode node, Container reservedContainer, NodeType type, SchedulerRequestKey schedulerKey) { RMContainer nodeReservedContainer = node.getReservedContainer(); boolean reservableForThisApp = nodeReservedContainer == null || nodeReservedContainer.getApplicationAttemptId() .equals(getApplicationAttemptId()); if (reservableForThisApp &&!reservationExceedsThreshold(node, type)) { LOG.info("Making reservation: node=" + node.getNodeName() + " app_id=" + getApplicationId()); if (reservedContainer == null) { reservedContainer = createContainer(node, perAllocationResource, schedulerKey); getMetrics().reserveResource(getUser(), reservedContainer.getResource()); RMContainer rmContainer = super.reserve(node, schedulerKey, null, reservedContainer); node.reserveResource(this, schedulerKey, rmContainer); setReservation(node); } else { RMContainer rmContainer = node.getReservedContainer(); super.reserve(node, schedulerKey, rmContainer, reservedContainer); node.reserveResource(this, schedulerKey, rmContainer); setReservation(node); } return true; } return false; }
Source:
@Override public void registerWorldGen(ICubicWorldServer world, GeneratorPipeline pipeline) { ServerCubeCache cubeCache = world.getCubeCache(); GeneratorStage terrain = new GeneratorStage("TERRAIN"); GeneratorStage surface = new GeneratorStage("SURFACE"); GeneratorStage features = new GeneratorStage("FEATURES"); GeneratorStage lighting = new GeneratorStage("LIGHTING"); GeneratorStage population = new GeneratorStage("POPULATION"); pipeline.addStage(terrain, new FlatTerrainProcessor(cubeCache, 5)); pipeline.addStage(surface, new NullProcessor("Surface", cubeCache)); pipeline.addStage(features, new NullProcessor("Features", cubeCache)); pipeline.addStage(lighting, new FirstLightProcessor(lighting, "Lighting", cubeCache, 5)); pipeline.addStage(population, new NullProcessor("Population", cubeCache)); pipeline.addStage(GeneratorStage.LIVE, null); }

Target:
@Override public void registerWorldGen(ICubicWorldServer world, GeneratorPipeline pipeline) { ServerCubeCache cubeCache = world.getCubeCache(); GeneratorStage terrain = new GeneratorStage("terrain"); pipeline.addStage(terrain, new FlatTerrainProcessor(cubeCache, 5)); pipeline.addStage(GeneratorStage.LIGHTING, new FirstLightProcessor(null, "Lighting", cubeCache, 5)); }
Source:
public Optional<String> getActiveSearchText() { if (stackSearch.topControl == cmpTitle) { return Optional.of(txtSearchTitle.getText()); } else if (stackSearch.topControl == cmpRBNumber) { return Optional.of(txtSearchRBNumber.getText()); } else if (stackSearch.topControl == cmpUsers) { return Optional.of(txtSearchUsers.getText()); } else { return null; } }

Target:
public String getActiveSearchText() { return textSearchBox.getText(); }
Source:
static private boolean rewriteUnionStmt(ParsedUnionStmt stmt) { final AtomicInteger indx = new AtomicInteger(0); final AtomicBoolean updated = new AtomicBoolean(false); stmt.m_children.stream().flatMap(c -> { if(c instanceof ParsedSelectStmt) { final ParsedSelectStmt s = (ParsedSelectStmt) c; if ((new MVQueryRewriter(s)).rewrite()) { updated.set(true); return Stream.of(new Pair<>(indx.getAndIncrement(), s)); } } else if (c instanceof ParsedUnionStmt) { if ((new MVQueryRewriter((ParsedUnionStmt) c)).rewrite()) { updated.set(true); } } else { assert(false); } return null; }).forEach(kv -> { final int i = kv.getFirst(); final ParsedSelectStmt sel = kv.getSecond(); assert (sel.m_tableList.size() == 1); stmt.m_tableList.set(i, sel.m_tableList.get(0)); final Table view = sel.m_tableList.get(0); stmt.m_tableAliasMap.forEach((k, v) -> { if (v.getTableName().equals(view.getMaterializer().getTypeName())) { sel.generateStmtTableScan(view); } }); }); return updated.get(); }

Target:
static private boolean rewriteUnionStmt(ParsedUnionStmt stmt) { final AtomicInteger indx = new AtomicInteger(0); final AtomicBoolean updated = new AtomicBoolean(false); stmt.m_children.stream().flatMap(c -> { if (c instanceof ParsedSelectStmt) { final ParsedSelectStmt s = (ParsedSelectStmt) c; if ((new MVQueryRewriter(s)).rewrite()) { updated.set(true); return Stream.of(Pair.of(indx.getAndIncrement(), s)); } } else if (c instanceof ParsedUnionStmt) { if ((new MVQueryRewriter((ParsedUnionStmt) c)).rewrite()) { updated.set(true); } } else { assert(false); } return null; }).forEach(kv -> { final int i = kv.getFirst(); final ParsedSelectStmt sel = kv.getSecond(); assert (sel.m_tableList.size() == 1); stmt.m_tableList.set(i, sel.m_tableList.get(0)); final Table view = sel.m_tableList.get(0); stmt.m_tableAliasMap.forEach((k, v) -> { if (v.getTableName().equals(view.getMaterializer().getTypeName())) { sel.generateStmtTableScan(view); } }); }); return updated.get(); }
Source:
public Object start(IApplicationContext context) throws Exception { long start = System.currentTimeMillis(); processArguments((String[]) context.getArguments().get("application.args")); IProvisioningAgent agent = ServiceHelper.getService(Activator.getBundleContext(), IProvisioningAgent.class); IMetadataRepositoryManager manager = (IMetadataRepositoryManager) agent.getService(IMetadataRepositoryManager.SERVICE_NAME); IMetadataRepository repository = manager.loadRepository(uri, new NullProgressMonitor()); RepositoryAnalyzer repositoryAnalyzer = new RepositoryAnalyzer(new IMetadataRepository[] {repository}); IStatus status = repositoryAnalyzer.analyze(new NullProgressMonitor()); IStatus[] children = status.getChildren(); long time = (System.currentTimeMillis()) - start; if (status.isOK()) System.out.println("Repository Analyzer Finished succesfuly in " + time + " ms."); else System.out.println("Repository Analyzer Finished in " + time + " ms with status with errors."); for (IStatus children1 : children) { if (children1.isOK()) { System.out.print("[OK] "); } else { System.out.print("[Error] "); } System.out.println(children1.getMessage()); if (children1.isMultiStatus() && children1.getChildren() != null && children1.getChildren().length > 0) { IStatus[] subChildren = children1.getChildren(); for (IStatus subChildren1 : subChildren) { System.out.println(" " + subChildren1.getMessage()); } } } return IApplication.EXIT_OK; }

Target:
public Object start(IApplicationContext context) throws Exception { long start = System.currentTimeMillis(); processArguments((String[]) context.getArguments().get("application.args")); IProvisioningAgent agent = ServiceHelper.getService(Activator.getBundleContext(), IProvisioningAgent.class); IMetadataRepositoryManager manager = (IMetadataRepositoryManager) agent.getService(IMetadataRepositoryManager.SERVICE_NAME); IMetadataRepository repository = manager.loadRepository(uri, new NullProgressMonitor()); RepositoryAnalyzer repositoryAnalyzer = new RepositoryAnalyzer(new IMetadataRepository[] {repository}); IStatus status = repositoryAnalyzer.analyze(new NullProgressMonitor()); IStatus[] children = status.getChildren(); long time = (System.currentTimeMillis()) - start; if (status.isOK()) System.out.println("Repository Analyzer Finished succesfuly in " + time + " ms."); else System.out.println("Repository Analyzer Finished in " + time + " ms with status with errors."); for (IStatus child : children) { if (child.isOK()) { System.out.print("[OK] "); } else { System.out.print("[Error] "); } System.out.println(child.getMessage()); if (child.isMultiStatus() && child.getChildren() != null && child.getChildren().length > 0) { IStatus[] subChildren = child.getChildren(); for (IStatus subChild : subChildren) { System.out.println(" " + subChild.getMessage()); } } } return IApplication.EXIT_OK; }
Source:
public String findCurrentLeader() { Preconditions.checkState(lifecycleLock.awaitStarted(1, TimeUnit.MILLISECONDS)); final FullResponseHolder responseHolder; try { responseHolder = go(makeRequest(HttpMethod.GET, leaderRequestPath)); } catch (Exception ex) { throw new ISE(ex, "Couldn't find leader."); } if (responseHolder.getStatus().getCode() == 200) { String leaderUrl = responseHolder.getContent(); try { new URL(leaderUrl); currentKnownLeader.set(leaderUrl); return leaderUrl; } catch (MalformedURLException ex) { } } throw new ISE( "Couldn't find leader, failed response status is [%s] and content [%s].", responseHolder.getStatus().getCode(), responseHolder.getContent() ); }

Target:
public String findCurrentLeader() { Preconditions.checkState(lifecycleLock.awaitStarted(1, TimeUnit.MILLISECONDS)); final FullResponseHolder responseHolder; try { responseHolder = go(makeRequest(HttpMethod.GET, leaderRequestPath)); } catch (Exception ex) { throw new ISE(ex, "Couldn't find leader."); } if (responseHolder.getStatus().getCode() == 200) { String leaderUrl = responseHolder.getContent(); try { URL validatedUrl = new URL(leaderUrl); currentKnownLeader.set(leaderUrl); return validatedUrl.toString(); } catch (MalformedURLException ex) { log.error(ex, "Received malformed leader url[%s].", leaderUrl); } } throw new ISE( "Couldn't find leader, failed response status is [%s] and content [%s].", responseHolder.getStatus().getCode(), responseHolder.getContent() ); }
Source:
public ArrayList<cgImage> loadLogImages(int log_id) { init(); ArrayList<cgImage> logImgList = new ArrayList<cgImage>(); Cursor cursor = null; cursor = databaseRO.query( dbTableLogImages, new String[]{"_id", "log_id", "title", "url"}, "log_id = \"" + log_id + "\"", null, null, null, null, "100"); if (cursor != null && cursor.getCount() > 0) { cursor.moveToFirst(); do { final cgImage log_img = new cgImage(); log_img.title = (String)cursor.getString(cursor.getColumnIndex("title")); log_img.url = (String)cursor.getString(cursor.getColumnIndex("url")); if (logImgList != null) { logImgList.add(log_img); } } while (cursor.moveToNext()); } if (cursor != null) { cursor.close(); } return logImgList; }

Target:
public ArrayList<cgImage> loadLogImages(int log_id) { init(); ArrayList<cgImage> logImgList = new ArrayList<cgImage>(); Cursor cursor = null; cursor = databaseRO.query( dbTableLogImages, new String[]{"_id", "log_id", "title", "url"}, "log_id = \"" + log_id + "\"", null, null, null, null, "100"); if (cursor != null && cursor.getCount() > 0) { cursor.moveToFirst(); do { final cgImage log_img = new cgImage(); log_img.title = (String)cursor.getString(cursor.getColumnIndex("title")); log_img.url = (String)cursor.getString(cursor.getColumnIndex("url")); logImgList.add(log_img); } while (cursor.moveToNext()); } if (cursor != null) { cursor.close(); } return logImgList; }
Source:
public static DataPartition[] createPartitions(DFUFilePartWrapper[] dfuparts, ClusterRemapper clusterremapper, int max_parts, FileFilter filter, String fileAccessBlob, FileType fileType) throws HpccFileException { DataPartition[] rslt = new DataPartition[dfuparts.length]; try { for (int i = 0; i < dfuparts.length; i++) { int numCopies = dfuparts[i].getCopies().length; String[] copyPaths = new String[numCopies]; for (int j = 0; j < numCopies; j++) { copyPaths[j] = dfuparts[i].getCopies()[j].getCopyPath(); } DataPartition new_dp = new DataPartition(clusterremapper.reviseIPs(dfuparts[i].getCopies()), copyPaths, dfuparts[i].getPartIndex(), dfuparts.length, clusterremapper.revisePort(null), clusterremapper.getUsesSSLConnection(null), filter, fileAccessBlob, fileType); new_dp.isTLK = dfuparts[i].getKind() == DFUFilePartWrapper.FilePartKind.TLK; rslt[i] = new_dp; } } catch (Exception e) { throw new HpccFileException("Could not create DataPartition!\n" + e.getMessage()); } return rslt; }

Target:
public static DataPartition[] createPartitions(DFUFilePartWrapper[] dfuparts, ClusterRemapper clusterremapper, int max_parts, FileFilter filter, String fileAccessBlob, FileType fileType) throws HpccFileException { DataPartition[] rslt = new DataPartition[dfuparts.length]; try { for (int i = 0; i < dfuparts.length; i++) { int numCopies = dfuparts[i].getCopies().length; String[] copyPaths = new String[numCopies]; for (int j = 0; j < numCopies; j++) { copyPaths[j] = dfuparts[i].getCopies()[j].getCopyPath(); } DataPartition new_dp = new DataPartition(clusterremapper.reviseIPs(dfuparts[i].getCopies()), copyPaths, dfuparts[i].getPartIndex(), dfuparts.length, clusterremapper.revisePort(null), clusterremapper.getUsesSSLConnection(null), filter, fileAccessBlob, fileType); new_dp.isTLK = dfuparts[i].isTopLevelKey(); rslt[i] = new_dp; } } catch (Exception e) { throw new HpccFileException("Could not create DataPartition!\n" + e.getMessage()); } return rslt; }
Source:
protected SoftwareDescription(int id, @Nullable String longDescription, @Nullable String manufacturer, @Nullable String name, int operatingSystem, @Nullable String referenceCode, @Nullable String requiredUser, @Nullable String version, int controlPanel, @Nullable String upgradeSoftwareDescriptionId, @Nullable String upgradeSwDescId, @Nullable String virtualLicense, @Nullable String virtualizationPlatform) { this.id = checkNotNull(id, "id"); this.longDescription = longDescription; this.manufacturer = manufacturer; this.name = name; this.operatingSystem = operatingSystem; this.referenceCode = referenceCode; this.requiredUser = requiredUser; this.version = version; this.controlPanel = controlPanel; this.upgradeSoftwareDescriptionId = upgradeSoftwareDescriptionId; this.upgradeSwDescId = upgradeSwDescId; this.virtualLicense = virtualLicense; this.virtualizationPlatform = virtualizationPlatform; }

Target:
protected SoftwareDescription(int id, @Nullable String longDescription, @Nullable String manufacturer, @Nullable String name, int operatingSystem, @Nullable String referenceCode, @Nullable String requiredUser, @Nullable String version, int controlPanel, @Nullable String upgradeSoftwareDescriptionId, @Nullable String upgradeSwDescId, @Nullable String virtualLicense, @Nullable String virtualizationPlatform) { this.id = id; this.longDescription = longDescription; this.manufacturer = manufacturer; this.name = name; this.operatingSystem = operatingSystem; this.referenceCode = referenceCode; this.requiredUser = requiredUser; this.version = version; this.controlPanel = controlPanel; this.upgradeSoftwareDescriptionId = upgradeSoftwareDescriptionId; this.upgradeSwDescId = upgradeSwDescId; this.virtualLicense = virtualLicense; this.virtualizationPlatform = virtualizationPlatform; }
Source:
public void install() { Maybe<Object> url = getEntity().getConfigRaw(SoftwareProcess.DOWNLOAD_URL, true); if (url.isPresentAndNonNull()) { DownloadResolver resolver = Entities.newDownloader(this); List<String> urls = resolver.getTargets(); downloadedFilename = resolver.getFilename(); List<String> commands = new LinkedList<String>(); commands.addAll(BashCommands.commandsToDownloadUrlsAs(urls, downloadedFilename)); commands.addAll(ArchiveUtils.installCommands(downloadedFilename)); int result = newScript(INSTALLING) .failOnNonZeroResultCode(false) .body.append(commands) .execute(); if (result!=0) { for (String urlI: urls) { result = ArchiveUtils.install(getMachine(), urlI, Urls.mergePaths(getInstallDir(), downloadedFilename)); if (result==0) break; } if (result != 0) throw new IllegalStateException("Error installing archive: " + downloadedFilename); } } else { String installCommand = getEntity().getConfig(VanillaSoftwareProcess.INSTALL_COMMAND); if (!StringUtils.isBlank(installCommand)) { newScript(INSTALLING) .failOnNonZeroResultCode() .body.append(installCommand) .execute(); } } }

Target:
public void install() { Maybe<Object> url = getEntity().getConfigRaw(SoftwareProcess.DOWNLOAD_URL, true); if (url.isPresentAndNonNull()) { DownloadResolver resolver = Entities.newDownloader(this); List<String> urls = resolver.getTargets(); downloadedFilename = resolver.getFilename(); List<String> commands = new LinkedList<String>(); commands.addAll(BashCommands.commandsToDownloadUrlsAs(urls, downloadedFilename)); commands.addAll(ArchiveUtils.installCommands(downloadedFilename)); int result = newScript(INSTALLING) .failOnNonZeroResultCode(false) .body.append(commands) .execute(); if (result!=0) { for (String urlI: urls) { result = ArchiveUtils.install(getMachine(), urlI, Urls.mergePaths(getInstallDir(), downloadedFilename)); if (result==0) break; } if (result != 0) throw new IllegalStateException("Error installing archive: " + downloadedFilename); } } String installCommand = getEntity().getConfig(VanillaSoftwareProcess.INSTALL_COMMAND); if (Strings.isNonBlank(installCommand)) { newScript(INSTALLING) .failOnNonZeroResultCode() .body.append(installCommand) .execute(); } }
Source:
private static void gotoRank(IEditorPart editor, int rank) { IEditorInput editorInput = editor.getEditorInput(); if (editorInput instanceof IFileEditorInput) { IFile file = ((IFileEditorInput) editorInput).getFile(); try { final IMarker marker = file.createMarker(IMarker.MARKER); marker.setAttribute(IMarker.LOCATION, (Integer) rank); IDE.gotoMarker(editor, marker); marker.delete(); } catch (CoreException e) { GdbTraceCorePlugin.logError(CORE_EXCEPTION, e); } } }

Target:
private static void gotoRank(IEditorPart editor, int rank) { IEditorInput editorInput = editor.getEditorInput(); if (editorInput instanceof IFileEditorInput) { IFile file = ((IFileEditorInput) editorInput).getFile(); try { final IMarker marker = file.createMarker(IMarker.MARKER); marker.setAttribute(IMarker.LOCATION, (Integer) rank); IDE.gotoMarker(editor, marker); marker.delete(); } catch (CoreException e) { GdbTraceCorePlugin.logError(e.getMessage(), e); } } }
Source:
public static DebugTarget createDebugTarget(String name, EObject context) { final DebugTarget res = DebugPackage.eINSTANCE.getDebugFactory().createDebugTarget(); if (name == null) { throw new IllegalArgumentException("the debug target name can't be null."); } if (context == null) { throw new IllegalArgumentException("the debug target context can't be null."); } res.setName(name); res.setContext(context); res.setState(DebugTargetState.CONNECTED); return res; }

Target:
public static DebugTarget createDebugTarget(String name, EObject context) { final DebugTarget res = DebugPackage.eINSTANCE.getDebugFactory().createDebugTarget(); Objects.requireNonNull(name, "the debug target name can't be null."); Objects.requireNonNull(context, "the debug target context can't be null."); res.setName(name); res.setContext(context); res.setState(DebugTargetState.CONNECTED); return res; }
Source:
public Map<String, Object> values() { return values.entrySet() .stream() .filter(e -> !isNonbinding(e.getKey())) .collect(toMap(Map.Entry::getKey, Map.Entry::getValue)); }

Target:
public Map<String, Object> values() { return Collections.unmodifiableMap(values); }
Source:
public void onReceive(Context context, Intent intent) { Utils.setContext(context); if (intent != null && intent.getAction() != null) { if (intent.getAction().equals(Intent.ACTION_BOOT_COMPLETED)) { Intent serviceStart = new Intent(context, EncryptionService.class); context.startService(serviceStart); } else { String pin = intent.getStringExtra(Intent.EXTRA_PHONE_NUMBER); if (pin != null && !pin.isEmpty() && PinManager.get().hasPin() && HomeActivity.launch(context, pin)) { setResultData(null); } } } }

Target:
public void onReceive(Context context, Intent intent) { Utils.setContext(context); if (intent != null && intent.getAction() != null) { if (intent.getAction().equals(Intent.ACTION_BOOT_COMPLETED)) { Intent serviceStart = new Intent(context, EncryptionService.class); context.startService(serviceStart); } else { String pin = intent.getStringExtra(Intent.EXTRA_PHONE_NUMBER); if (LaunchManager.isDialerEnabled() && DialerManager.getLaunchCode().equals(pin)) { PinActivity.launch(context); setResultData(null); } } } }