auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public void evaluateLiteralExpression() { assertEquals(1, evaluator.evaluateLiteralExpression(String.class.getCanonicalName(), Collections.emptyList(), "# 1")); assertEquals("Value", evaluator.evaluateLiteralExpression(String.class.getCanonicalName(), Collections.emptyList(), "# \"Value\"")); assertThatThrownBy(() -> evaluator.evaluateLiteralExpression(String.class.getCanonicalName(), Collections.emptyList(), "1+")) .isInstanceOf(RuntimeException.class); assertThatThrownBy(() -> evaluator.evaluateLiteralExpression(String.class.getCanonicalName(), Collections.emptyList(), new Object())) .isInstanceOf(IllegalArgumentException.class) .hasMessageStartingWith("Raw value should be a String"); assertThatThrownBy(() -> evaluator.evaluateLiteralExpression(String.class.getCanonicalName(), Collections.emptyList(), new Object())) .isInstanceOf(IllegalArgumentException.class) .hasMessageStartingWith("Raw value should be a String"); }

Target:
public void evaluateLiteralExpression() { assertEquals(1, evaluator.evaluateLiteralExpression(Integer.class.getCanonicalName(), Collections.emptyList(), MVEL_ESCAPE_SYMBOL + " 1")); assertEquals("Value", evaluator.evaluateLiteralExpression(String.class.getCanonicalName(), Collections.emptyList(), MVEL_ESCAPE_SYMBOL + " \"Value\"")); assertThatThrownBy(() -> evaluator.evaluateLiteralExpression(String.class.getCanonicalName(), Collections.emptyList(), "1+")) .isInstanceOf(RuntimeException.class); assertThatThrownBy(() -> evaluator.evaluateLiteralExpression(String.class.getCanonicalName(), Collections.emptyList(), new Object())) .isInstanceOf(IllegalArgumentException.class) .hasMessageStartingWith("Raw expression should be a String"); assertThatThrownBy(() -> evaluator.evaluateLiteralExpression(String.class.getCanonicalName(), Collections.emptyList(), MVEL_ESCAPE_SYMBOL + " 1")) .isInstanceOf(IllegalArgumentException.class) .hasMessageStartingWith("Cannot assign a 'java.lang.Integer"); }
Source:
public void init(){ isReqContextActive.set(bm.getContext(RequestScoped.class).isActive()); }

Target:
public void init() { try { isRequestContextActiveDuringPostConstruct.set(bm.getContext(RequestScoped.class).isActive()); } catch (ContextNotActiveException e) { isRequestContextActiveDuringPostConstruct.set(false); } }
Source:
static ExecutionJobVertex mockExecutionJobVertex( JobVertexID jobVertexID, List<OperatorID> jobVertexIDs, int parallelism, int maxParallelism) throws Exception { final ExecutionJobVertex executionJobVertex = mock(ExecutionJobVertex.class); ExecutionVertex[] executionVertices = new ExecutionVertex[parallelism]; for (int i = 0; i < parallelism; i++) { executionVertices[i] = mockExecutionVertex( new ExecutionAttemptID(), jobVertexID, jobVertexIDs, parallelism, maxParallelism, ExecutionState.RUNNING); when(executionVertices[i].getParallelSubtaskIndex()).thenReturn(i); } when(executionJobVertex.getJobVertexId()).thenReturn(jobVertexID); when(executionJobVertex.getTaskVertices()).thenReturn(executionVertices); when(executionJobVertex.getParallelism()).thenReturn(parallelism); when(executionJobVertex.getMaxParallelism()).thenReturn(maxParallelism); when(executionJobVertex.isMaxParallelismConfigured()).thenReturn(true); List<OperatorIdPair> operatorIdPairs = new ArrayList<>(); for (OperatorID operatorID : jobVertexIDs) { operatorIdPairs.add(new OperatorIdPair(operatorID, null)); } when(executionJobVertex.getOperatorIdPairList()).thenReturn(new OperatorIdPairList(operatorIdPairs)); return executionJobVertex; }

Target:
static ExecutionJobVertex mockExecutionJobVertex( JobVertexID jobVertexID, List<OperatorID> jobVertexIDs, int parallelism, int maxParallelism) throws Exception { final ExecutionJobVertex executionJobVertex = mock(ExecutionJobVertex.class); ExecutionVertex[] executionVertices = new ExecutionVertex[parallelism]; for (int i = 0; i < parallelism; i++) { executionVertices[i] = mockExecutionVertex( new ExecutionAttemptID(), jobVertexID, jobVertexIDs, parallelism, maxParallelism, ExecutionState.RUNNING); when(executionVertices[i].getParallelSubtaskIndex()).thenReturn(i); } when(executionJobVertex.getJobVertexId()).thenReturn(jobVertexID); when(executionJobVertex.getTaskVertices()).thenReturn(executionVertices); when(executionJobVertex.getParallelism()).thenReturn(parallelism); when(executionJobVertex.getMaxParallelism()).thenReturn(maxParallelism); when(executionJobVertex.isMaxParallelismConfigured()).thenReturn(true); List<OperatorIDPair> operatorIDPairs = new ArrayList<>(); for (OperatorID operatorID : jobVertexIDs) { operatorIDPairs.add(OperatorIDPair.generatedIDOnly(operatorID)); } when(executionJobVertex.getOperatorIDs()).thenReturn(operatorIDPairs); return executionJobVertex; }
Source:
public int getMarks(TreeWalk walk) throws MissingObjectException, IncorrectObjectTypeException, IOException { int marks = 0; for (int index = 0; index < filters.length; index++) { TreeFilter filter = filters[index]; if (filter != null) { try { boolean marked = filter.include(walk); if (marked) marks |= (int) (1L << index); } catch (StopWalkException e) { filters[index] = null; } } } return marks; }

Target:
public int getMarks(TreeWalk walk) throws MissingObjectException, IncorrectObjectTypeException, IOException { int marks = 0; for (int index = 0; index < filters.length; index++) { TreeFilter filter = filters[index]; if (filter != null) { try { boolean marked = filter.include(walk); if (marked) marks |= (1 << index); } catch (StopWalkException e) { filters[index] = null; } } } return marks; }
Source:
private void verifyAndOrRebuildIndex(Map<byte[], List<Mutation>> indexKeyToMutationMap, Set<byte[]> mostRecentIndexRowKeys) throws IOException { if (indexKeyToMutationMap.size() == 0) { return; } if (verifyType != IndexTool.IndexVerifyType.ONLY) { try (org.apache.hadoop.hbase.client.Connection connection = HBaseFactoryProvider.getHConnectionFactory().createConnection(env.getConfiguration())) { endKeys = connection.getRegionLocator(indexHTable.getName()).getEndKeys(); } } List<Map<byte[], List<Mutation>>> mapList = getPerTaskIndexKeyToMutationMaps((TreeMap)indexKeyToMutationMap, endKeys, rowCountPerTask); int taskCount = mapList.size(); TaskBatch<Boolean> tasks = new TaskBatch<>(taskCount); List<IndexToolVerificationResult> verificationResultList = new ArrayList<>(taskCount); for (int i = 0; i < taskCount; i++) { IndexToolVerificationResult perTaskVerificationResult = new IndexToolVerificationResult(scan); verificationResultList.add(perTaskVerificationResult); addRebuildAndOrVerifyTask(tasks, mapList.get(i), mostRecentIndexRowKeys, perTaskVerificationResult); } submitTasks(tasks); if (verify) { for (IndexToolVerificationResult result : verificationResultList) { verificationResult.add(result); } } }

Target:
private void verifyAndOrRebuildIndex(Map<byte[], List<Mutation>> indexKeyToMutationMap, Set<byte[]> mostRecentIndexRowKeys) throws IOException { if (indexKeyToMutationMap.size() == 0) { return; } if (verifyType != IndexTool.IndexVerifyType.ONLY) { endKeys = connection.getRegionLocator(indexHTable.getName()).getEndKeys(); } List<Map<byte[], List<Mutation>>> mapList = getPerTaskIndexKeyToMutationMaps((TreeMap)indexKeyToMutationMap, endKeys, rowCountPerTask); int taskCount = mapList.size(); TaskBatch<Boolean> tasks = new TaskBatch<>(taskCount); List<IndexToolVerificationResult> verificationResultList = new ArrayList<>(taskCount); for (int i = 0; i < taskCount; i++) { IndexToolVerificationResult perTaskVerificationResult = new IndexToolVerificationResult(scan); verificationResultList.add(perTaskVerificationResult); addRebuildAndOrVerifyTask(tasks, mapList.get(i), mostRecentIndexRowKeys, perTaskVerificationResult); } submitTasks(tasks); if (verify) { for (IndexToolVerificationResult result : verificationResultList) { verificationResult.add(result); } } }
Source:
public void shouldWriteAndReadRateHistoryProperly() throws Exception { ConsumerInstance consumer = consumer("consumer1"); RateHistory rateHistory = RateHistory.create(0.5); maxRateRegistry.writeRateHistory(consumer, rateHistory); wait.untilZookeeperPathIsCreated( zookeeperPaths.consumersRateHistoryPath(cluster, consumer.getSubscription(), consumer.getConsumerId())); await().atMost(Duration.TWO_SECONDS).until(() -> maxRateRegistry.getRateHistory(consumer).equals(rateHistory)); }

Target:
public void shouldWriteAndReadRateHistoryProperly() throws Exception { ConsumerInstance consumer = consumer("consumer1"); RateHistory rateHistory = RateHistory.create(0.5); maxRateRegistry.writeRateHistory(consumer, rateHistory); wait.untilZookeeperPathIsCreated( zookeeperPaths.consumersRateHistoryPath(cluster, consumer.getSubscription(), consumer.getConsumerId())); await().atMost(TWO_SECONDS).until(() -> maxRateRegistry.getRateHistory(consumer).equals(rateHistory)); }
Source:
public synchronized void remove(JobRequest request) { mCacheId.remove(request.getJobId()); if (!TextUtils.isEmpty(request.getTag())) { mCacheTag.remove(request.getTag()); } try { mDbHelper.getWritableDatabase().delete(JOB_TABLE_NAME, COLUMN_ID + " = " + request.getJobId(), null); } catch (Exception e) { Cat.e(e, "could not delete %s", request); } }

Target:
public synchronized void remove(JobRequest request) { mCacheId.remove(request.getJobId()); if (!TextUtils.isEmpty(request.getTag())) { mCacheTag.remove(request.getTag()); } try { mDbHelper.getWritableDatabase().delete(JOB_TABLE_NAME, COLUMN_ID + "=?", new String[]{String.valueOf(request.getJobId())}); } catch (Exception e) { Cat.e(e, "could not delete %s", request); } }
Source:
public void testFetchRecentlyFinishedFlows() throws Exception { if (!isTestSetup()) { return; } ExecutorLoader loader = createLoader(); ExecutableFlow flow1 = TestUtils.createExecutableFlow("exectest1", "exec1"); loader.uploadExecutableFlow(flow1); flow1.setStatus(Status.SUCCEEDED); flow1.setEndTime(System.currentTimeMillis()); loader.updateExecutableFlow(flow1); List<ExecutableFlow> flows = loader.fetchRecentlyFinishedFlows(recentlyFinishedLifetimeMs); Assert.assertEquals(1, flows.size()); Assert.assertEquals(flow1.getExecutionId(), flows.get(0).getExecutionId()); Assert.assertEquals(flow1.getProjectName(), flows.get(0).getProjectName()); Assert.assertEquals(flow1.getFlowId(), flows.get(0).getFlowId()); Assert.assertEquals(flow1.getVersion(), flows.get(0).getVersion()); Thread.currentThread().sleep(recentlyFinishedLifetimeMs); flows = loader.fetchRecentlyFinishedFlows(recentlyFinishedLifetimeMs); Assert.assertTrue(flows.isEmpty()); }

Target:
public void testFetchRecentlyFinishedFlows() throws Exception { if (!isTestSetup()) { return; } ExecutorLoader loader = createLoader(); ExecutableFlow flow1 = TestUtils.createExecutableFlow("exectest1", "exec1"); loader.uploadExecutableFlow(flow1); flow1.setStatus(Status.SUCCEEDED); flow1.setEndTime(DateTimeUtils.currentTimeMillis()); loader.updateExecutableFlow(flow1); List<ExecutableFlow> flows = loader.fetchRecentlyFinishedFlows( RECENTLY_FINISHED_LIFETIME); Assert.assertEquals(1, flows.size()); Assert.assertEquals(flow1.getExecutionId(), flows.get(0).getExecutionId()); Assert.assertEquals(flow1.getProjectName(), flows.get(0).getProjectName()); Assert.assertEquals(flow1.getFlowId(), flows.get(0).getFlowId()); Assert.assertEquals(flow1.getVersion(), flows.get(0).getVersion()); }
Source:
public void testAddRepoManifest() throws Exception { StringBuilder xmlContent = new StringBuilder(); xmlContent.append("<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n") .append("<manifest>") .append("<remote name=\"remote1\" fetch=\".\" />") .append("<default revision=\"master\" remote=\"remote1\" />") .append("<project path=\"foo\" name=\".\" />") .append("</manifest>"); writeTrashFile("manifest.xml", xmlContent.toString()); RepoCommand command = new RepoCommand(db); command.setPath(db.getWorkTree() + "/manifest.xml") .setURI(remoteGit.getRepository().getDirectory().toURI().toString()) .call(); File hello = new File(db.getWorkTree() + "/foo/hello.txt"); assertTrue(hello.exists()); BufferedReader reader = new BufferedReader(new FileReader(hello)); String content = reader.readLine(); assertTrue(content.startsWith("world")); }

Target:
public void testAddRepoManifest() throws Exception { StringBuilder xmlContent = new StringBuilder(); xmlContent.append("<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n") .append("<manifest>") .append("<remote name=\"remote1\" fetch=\".\" />") .append("<default revision=\"master\" remote=\"remote1\" />") .append("<project path=\"foo\" name=\".\" />") .append("</manifest>"); writeTrashFile("manifest.xml", xmlContent.toString()); RepoCommand command = new RepoCommand(db); command.setPath(db.getWorkTree().getAbsolutePath() + "/manifest.xml") .setURI(remoteGit.getRepository().getDirectory().toURI().toString()) .call(); File hello = new File(db.getWorkTree(), "foo/hello.txt"); assertTrue("submodule was checked out", hello.exists()); BufferedReader reader = new BufferedReader(new FileReader(hello)); String content = reader.readLine(); reader.close(); assertEquals("submodule content is as expected.", "world", content); }
Source:
public List<DeviceModel> getDevices(UserModel user) { Query query = em.createQuery("select d from FederatedUserDeviceInfoEntity d where d.userId = :userId"); query.setParameter("userId", user.getId()); List<FederatedUserDeviceInfoEntity> resultList = query.getResultList(); return resultList.stream().map(this::toModel).collect(Collectors.toList()); }

Target:
public List<DeviceModel> getDevices(UserModel user) { Query query = em.createNamedQuery("findDevicesByUser"); query.setParameter("userId", user.getId()); return ((List<FederatedUserDeviceInfoEntity>) query.getResultList()).stream().map(this::toModel).collect(Collectors.toList()); }
Source:
public void testMoveProjectContainingGitRepo() throws Exception { TestProject project = initRepoInsideProject(); testUtils.addFileToProject(project.getProject(), "file.txt", "some text"); AddToIndexOperation addToIndexOperation = new AddToIndexOperation( new IResource[] { project.getProject().getFile("file.txt") }); addToIndexOperation.execute(null); IProjectDescription description = project.getProject().getDescription(); description.setName("P2"); project.getProject().move(description, IResource.FORCE | IResource.SHALLOW, null); IProject project2 = ResourcesPlugin.getWorkspace().getRoot() .getProject("P2"); assertNotNull(RepositoryMapping.getMapping(project2.getProject())); assertEquals("Project-1", RepositoryMapping.getMapping(project2.getProject()) .getRepository().getDirectory().getParentFile() .getName()); }

Target:
public void testMoveProjectContainingGitRepo() throws Exception { TestProject project = initRepoInsideProject(); testUtils.addFileToProject(project.getProject(), "file.txt", "some text"); AddToIndexOperation addToIndexOperation = new AddToIndexOperation( new IResource[] { project.getProject().getFile("file.txt") }); addToIndexOperation.execute(null); IProjectDescription description = project.getProject().getDescription(); description.setName("P2"); project.getProject().move(description, IResource.FORCE | IResource.SHALLOW, null); IProject project2 = ResourcesPlugin.getWorkspace().getRoot() .getProject("P2"); assertNotNull(RepositoryMapping.getMapping(project2.getProject())); assertEquals("P2", RepositoryMapping.getMapping(project2) .getRepository().getDirectory().getParentFile() .getName()); }
Source:
private Cache<String, Car> getWriteOnlyCache(int cacheId) { Cache<String, Car> cache = cache(cacheId); AdvancedCache<String,Car> advancedCache = cache.getAdvancedCache(); AdvancedCache<String, Car> withFlags = advancedCache.withFlags(Flag.IGNORE_RETURN_VALUES, Flag.SKIP_INDEX_CLEANUP); System.out.print("Using " + cacheId + ": " + cache +"\t"); return withFlags; }

Target:
private Cache<String, Car> getWriteOnlyCache(int cacheId) { Cache<String, Car> cache = cache(cacheId); AdvancedCache<String,Car> advancedCache = cache.getAdvancedCache(); AdvancedCache<String, Car> withFlags = advancedCache.withFlags(Flag.IGNORE_RETURN_VALUES, Flag.SKIP_INDEX_CLEANUP); return withFlags; }
Source:
public String getNicelyFormattedName() { StringBuffer out = new StringBuffer(); char char_ = "_".charAt(0); char prevchar = 0; for (char c : this.name().toCharArray()) { if (c != char_ && prevchar != char_) { out.append(String.valueOf(c).toLowerCase()); } else if (c != char_) { out.append(String.valueOf(c)); } prevchar = c; } return out.toString(); }

Target:
public String getNicelyFormattedName() { StringBuffer out = new StringBuffer(); char char_ = '_'; char prevchar = 0; for (char c : this.name().toCharArray()) { if (c != char_ && prevchar != char_) { out.append(String.valueOf(c).toLowerCase()); } else if (c != char_) { out.append(String.valueOf(c)); } prevchar = c; } return out.toString(); }
Source:
public String getSolution() { return "<LINK_0>"; }

Target:
public String getSolution() { return SOLUTION; }
Source:
public static Optional<Curie> of(String raw) { try { String namespace = raw.split(":")[0]; String identifier = raw.split(":")[1]; return Optional.of(new Curie(namespace, identifier)); } catch (Exception e) { return Optional.empty(); } }

Target:
public static Optional<Curie> of(String raw) { try { String[] split = raw.split(":", 2); String namespace = split[0]; String identifier = split[1]; return Optional.of(new Curie(namespace, identifier)); } catch (Exception e) { return Optional.empty(); } }
Source:
protected void addGlobalMeta(String key, boolean value) { addGlobalMeta(key, new Boolean(value)); }

Target:
protected void addGlobalMeta(String key, boolean value) { addGlobalMeta(key, Boolean.valueOf(value)); }
Source:
private static OGCGeometry readPoint(BasicSliceInput input) { double x = input.readDouble(); double y = input.readDouble(); Point point; if (isEsriNaN(x) || isEsriNaN(y)) { point = new Point(); } else { point = new Point(x, y); } return createFromEsriGeometry(point, null, false); }

Target:
private static OGCPoint readPoint(BasicSliceInput input) { double x = input.readDouble(); double y = input.readDouble(); Point point; if (isNaN(x) || isNaN(y)) { point = new Point(); } else { point = new Point(x, y); } return new OGCPoint(point, null); }
Source:
public void get_user_in_token() throws DotSecurityException, DotDataException, ParseException { final User user = userAPI.loadUserById(userId); user.setModificationDate(date); final JsonWebTokenService jsonWebTokenService = JsonWebTokenFactory.getInstance().getJsonWebTokenService(); assertNotNull(jsonWebTokenService); String jsonWebToken = jsonWebTokenService.generateUserToken(new UserToken(jwtId, userId, date, DateUtil.daysToMillis(2), user.getSkinId() )); System.out.println(jsonWebToken); assertNotNull(jsonWebToken); final JWToken jwtBean = jsonWebTokenService.parseToken(jsonWebToken); assertNotNull(jwtBean); assertEquals(jwtBean.getId(), jwtId); assertEquals(jwtBean.getIssuer(), clusterId); final String subject = jwtBean.getSubject(); assertNotNull(subject); assertEquals(subject, userId); JsonWebTokenUtils jsonWebTokenUtils = new JsonWebTokenUtils(jsonWebTokenService); User userInToken = jsonWebTokenUtils.getUser(jsonWebToken, "127.0.0.1"); assertNotNull(userInToken); assertEquals(user, userInToken); }

Target:
public void get_user_in_token() throws DotSecurityException, DotDataException, ParseException { final User user = userAPI.loadUserById(userId); user.setModificationDate(date); final JsonWebTokenService jsonWebTokenService = JsonWebTokenFactory.getInstance().getJsonWebTokenService(); assertNotNull(jsonWebTokenService); final String jwtId = user.getRememberMeToken(); final UserToken userToken = new UserToken.Builder() .id(jwtId).subject(userId) .modificationDate(date) .expiresDate(DateUtil.daysToMillis(2)) .build(); String jsonWebToken = jsonWebTokenService.generateUserToken(userToken); System.out.println(jsonWebToken); assertNotNull(jsonWebToken); final JWToken jwtBean = jsonWebTokenService.parseToken(jsonWebToken); assertNotNull(jwtBean); assertEquals(jwtBean.getId(), jwtId); assertEquals(jwtBean.getIssuer(), clusterId); final String subject = jwtBean.getSubject(); assertNotNull(subject); assertEquals(subject, userId); JsonWebTokenUtils jsonWebTokenUtils = new JsonWebTokenUtils(jsonWebTokenService); User userInToken = jsonWebTokenUtils.getUser(jsonWebToken, "127.0.0.1"); assertNotNull(userInToken); assertEquals(user, userInToken); }
Source:
public Object visitGetKeysInGroupCommand(final InvocationContext ctx, GetKeysInGroupCommand command) throws Throwable { final String groupName = command.getGroupName(); if (!command.isGroupOwner() || !enabled || shouldSkipCacheLoader(command)) { return invokeNextInterceptor(ctx, command); } final GroupFilter<Object> groupFilter = new GroupFilter<>(groupName, groupManager); final CollectionKeyFilter<Object> collectionKeyFilter = new CollectionKeyFilter<>(ctx.getLookedUpEntries().keySet()); persistenceManager.processOnAllStores(new KeyFilter() { @Override public boolean accept(Object key) { return groupFilter.accept(key) && collectionKeyFilter.accept(key); } }, new AdvancedCacheLoader.CacheLoaderTask() { @Override public void processEntry(MarshalledEntry marshalledEntry, AdvancedCacheLoader.TaskContext taskContext) throws InterruptedException { synchronized (ctx) { ctx.putLookedUpEntry(marshalledEntry.getKey(), null); } } }, false, false); return invokeNextInterceptor(ctx, command); }

Target:
public Object visitGetKeysInGroupCommand(final InvocationContext ctx, GetKeysInGroupCommand command) throws Throwable { final String groupName = command.getGroupName(); if (!command.isGroupOwner() || !enabled || shouldSkipCacheLoader(command)) { return invokeNextInterceptor(ctx, command); } final KeyFilter<Object> keyFilter = new CompositeKeyFilter<>(new GroupFilter<>(groupName, groupManager), new CollectionKeyFilter<>(ctx.getLookedUpEntries().keySet())); persistenceManager.processOnAllStores(keyFilter, new AdvancedCacheLoader.CacheLoaderTask() { @Override public void processEntry(MarshalledEntry marshalledEntry, AdvancedCacheLoader.TaskContext taskContext) throws InterruptedException { synchronized (ctx) { entryFactory.wrapEntryForReading(ctx, marshalledEntry.getKey(), convert(marshalledEntry, iceFactory)).setSkipLookup(true); } } }, true, true); return invokeNextInterceptor(ctx, command); }
Source:
public void onUndoMediaCheck(final String undoedContent) { List <MediaModel> currentlyUploadingMedia = UploadService.getAllInProgressOrQueuedMediaItemsForPost(mPost); List<String> mediaMarkedUploading = AztecEditorFragment.getMediaMarkedUploadingInPostContent(EditPostActivity.this, undoedContent); for (String mediaId : mediaMarkedUploading) { boolean found = false; for (MediaModel media : currentlyUploadingMedia) { if (Integer.valueOf(mediaId) == media.getId()) { found = true; break; } } if (!found) { if (mEditorFragment instanceof AztecEditorFragment) { ((AztecEditorFragment)mEditorFragment).setMediaToFailed(mediaId); } } } }

Target:
public void onUndoMediaCheck(final String undoedContent) { List <MediaModel> currentlyUploadingMedia = UploadService.getPendingOrInProgressMediaUploadsForPost(mPost); List<String> mediaMarkedUploading = AztecEditorFragment.getMediaMarkedUploadingInPostContent(EditPostActivity.this, undoedContent); for (String mediaId : mediaMarkedUploading) { boolean found = false; for (MediaModel media : currentlyUploadingMedia) { if (StringUtils.stringToInt(mediaId) == media.getId()) { found = true; break; } } if (!found) { if (mEditorFragment instanceof AztecEditorFragment) { ((AztecEditorFragment)mEditorFragment).setMediaToFailed(mediaId); } } } }
Source:
public void beforeRunningTestMethod() throws IOException { HELPERS.ensureBucketExists(BUCKET_NAME, envDataPolicyId); final Ds3Object obj = new Ds3Object(OBJ_NAME, OBJ_BYTES.length); final Ds3ClientHelpers.Job job = HELPERS.startWriteJob(BUCKET_NAME, Lists.newArrayList(obj)); job.transfer(new ObjectInputStreamBuilder() { @Override public InputStream buildInputStream(String key) { return new ByteArrayInputStream(OBJ_BYTES); } }); }

Target:
public void beforeRunningTestMethod() throws IOException { HELPERS.ensureBucketExists(BUCKET_NAME, envDataPolicyId); final Ds3Object obj = new Ds3Object(OBJ_NAME, OBJ_BYTES.length); final Ds3ClientHelpers.Job job = HELPERS.startWriteJob(BUCKET_NAME, Lists.newArrayList(obj)); job.transfer(new ObjectInputStreamBuilder() { @Override public InputStream buildInputStream(final String key) { return new ByteArrayInputStream(OBJ_BYTES); } }); }
Source:
public void deleteEventByOrganizationID(long organizationId) { currentSession().flush(); Query<Event> query = this.currentSession().getNamedQuery("io.dockstore.webservice.core.Event.deleteByOrganizationId"); query.setParameter("organizationId", organizationId); query.executeUpdate(); currentSession().flush(); }

Target:
public void deleteEventByOrganizationID(long organizationId) { Query query = namedQuery("io.dockstore.webservice.core.Event.deleteByOrganizationId"); query.setParameter("organizationId", organizationId); query.executeUpdate(); currentSession().flush(); }
Source:
public void canPersistAndRetrieveAsync() throws ExecutionException, InterruptedException { List<CompletableFuture<Long>> putFutures = new ArrayList<>(); for (int i = 0; i < 1000; i++) { String iStr = Integer.toString(i); putFutures.add(kvStore.putAsync(iStr, new CassandraKVStoreIT.State(i, iStr))); } CompletableFuture[] allPutFutures = putFutures.toArray(new CompletableFuture[0]); assertThat(CompletableFuture.allOf(allPutFutures).isDone(), equalTo(false)); CompletableFuture.allOf(allPutFutures).get(); List<CompletableFuture<Optional<Serializable>>> getFutures = new ArrayList<>(); for (int i = 0; i < 1000; i++) { String iStr = Integer.toString(i); getFutures.add(kvStore.getAsync(iStr)); } CompletableFuture[] allGetFutures = getFutures.toArray(new CompletableFuture[0]); assertThat(CompletableFuture.allOf(allGetFutures).isDone(), equalTo(false)); CompletableFuture.allOf(allGetFutures).get(); getFutures.stream() .filter(f -> { try { return f.get().equals(Optional.empty()); } catch (InterruptedException | ExecutionException e) { throw new RuntimeException(e); } }) .findAny() .ifPresent(f -> fail("Should not have found empty optional")); }

Target:
public void canPersistAndRetrieveAsync() throws ExecutionException, InterruptedException, TimeoutException { List<CompletableFuture<Long>> putFutures = new ArrayList<>(); String context = "canPersistAndRetrieveAsync"; for (int i = 0; i < 1000; i++) { String iStr = Integer.toString(i); putFutures.add(serializingKeyValueStore.putAsync(iStr, Integer.toString(i), context)); } CompletableFuture[] allPutFutures = putFutures.toArray(new CompletableFuture[0]); CompletableFuture.allOf(allPutFutures).get(1, TimeUnit.MINUTES); List<CompletableFuture<Optional<String>>> getFutures = new ArrayList<>(); for (int i = 0; i < 1000; i++) { getFutures.add(serializingKeyValueStore.getAsync(Integer.toString(i), context)); } CompletableFuture[] allGetFutures = getFutures.toArray(new CompletableFuture[0]); CompletableFuture.allOf(allGetFutures).get(1, TimeUnit.MINUTES); getFutures.stream() .filter(f -> { try { return f.get().equals(Optional.empty()); } catch (InterruptedException | ExecutionException e) { throw new RuntimeException(e); } }) .findAny() .ifPresent(f -> fail("Should not have found empty optional")); }
Source:
protected String getNumberVersion(String firstV) { String res = firstV; if (!firstV.matches("[0-9.]+") && firstV.contains("-")) { String[] splittedVersion = firstV.split("-"); if(splittedVersion.length > 1) { res = splittedVersion[1]; } } return res; }

Target:
protected String getNumberVersion(String firstV) { String res = firstV; if (firstV.contains("-")) { String[] splittedVersion = firstV.split("-"); if(splittedVersion.length > 1) { res = splittedVersion[1]; } } return res; }
Source:
public static IResource getTargetResource(ILaunchConfiguration configuration) throws CoreException { String target = getTargetName(configuration); IResource targetResource = ResourcesPlugin.getWorkspace().getRoot().findMember(target); return targetResource; }

Target:
public static IResource getTargetResource(ILaunchConfiguration configuration) throws CoreException { String target = getTargetName(configuration); if (target == null) return null; IResource targetResource = ResourcesPlugin.getWorkspace().getRoot().findMember(target); return targetResource; }
Source:
public void testEmitter() { PrometheusEmitterConfig config = new PrometheusEmitterConfig(null, null, 0); PrometheusEmitter emitter = new PrometheusEmitter(config); ServiceMetricEvent build = ServiceMetricEvent.builder() .setDimension("server", "druid-data01.vpc.region") .build("segment/loadQueue/count", 10) .build(ImmutableMap.of("service", "historical")); assertEquals("historical", build.getService()); assertFalse(build.getUserDims().isEmpty()); emitter.emit(build); Double count = CollectorRegistry.defaultRegistry.getSampleValue( "druid_segment_loadqueue_count", new String[]{"server"}, new String[]{"druid_data01_vpc_region"} ); assertEquals(10, count.intValue()); }

Target:
public void testEmitter() { PrometheusEmitterConfig config = new PrometheusEmitterConfig(PrometheusEmitterConfig.Strategy.exporter, null, null, 0, null); PrometheusEmitter emitter = new PrometheusEmitter(config); ServiceMetricEvent build = ServiceMetricEvent.builder() .setDimension("server", "druid-data01.vpc.region") .build("segment/loadQueue/count", 10) .build(ImmutableMap.of("service", "historical")); Assert.assertEquals("historical", build.getService()); Assert.assertFalse(build.getUserDims().isEmpty()); emitter.emit(build); Double count = CollectorRegistry.defaultRegistry.getSampleValue( "druid_segment_loadqueue_count", new String[]{"server"}, new String[]{"druid_data01_vpc_region"} ); Assert.assertEquals(10, count.intValue()); }
Source:
public Address createCredentialStoreWithCredentialReferenceClearText(String credentialStoreName, String clearTextValue) throws IOException { final ModelNode credentialReference = new ModelNodeGenerator.ModelNodePropertiesBuilder().addProperty(CLEAR_TEXT, clearTextValue).build(); final Address credentialStoreAddress = ELYTRON_SUBSYSTEM_ADDRESS.and(CREDENTIAL_STORE, credentialStoreName); ops.add(credentialStoreAddress, Values.of(CREDENTIAL_REFERENCE, credentialReference) .and(CREATE, true) .and(MODIFIABLE, true)); return credentialStoreAddress; }

Target:
private Address createCredentialStoreWithCredentialReferenceClearText(String credentialStoreName, String clearTextValue) throws IOException { final ModelNode credentialReference = new ModelNodeGenerator.ModelNodePropertiesBuilder().addProperty(CLEAR_TEXT, clearTextValue).build(); final Address credentialStoreAddress = ELYTRON_SUBSYSTEM_ADDRESS.and(CREDENTIAL_STORE, credentialStoreName); ops.add(credentialStoreAddress, Values.of(CREDENTIAL_REFERENCE, credentialReference) .and(CREATE, true) .and(MODIFIABLE, true)); return credentialStoreAddress; }
Source:
private static void normalizeCourseStructure(CourseStructureV1Model courseStructureV1Model, BlockModel block, CourseComponent parent) { if (block.isContainer()) { CourseComponent child = new CourseComponent(block, parent); for (BlockModel m : courseStructureV1Model.getDescendants(block)) { normalizeCourseStructure(courseStructureV1Model, m, child); } } else { if (BlockType.VIDEO == block.type && block.data != null && (block.data instanceof VideoData)) { new VideoBlockModel(block, parent); } else if (BlockType.DISCUSSION == block.type && block.data != null && (block.data instanceof DiscussionData)) { new DiscussionBlockModel(block, parent); } else { new HtmlBlockModel(block, parent); } } }

Target:
private static void normalizeCourseStructure(CourseStructureV1Model courseStructureV1Model, BlockModel block, CourseComponent parent) { if (block.isContainer()) { CourseComponent child = new CourseComponent(block, parent); for (BlockModel m : courseStructureV1Model.getDescendants(block)) { normalizeCourseStructure(courseStructureV1Model, m, child); } } else { if (BlockType.VIDEO == block.type && block.data instanceof VideoData) { new VideoBlockModel(block, parent); } else if (BlockType.DISCUSSION == block.type && block.data instanceof DiscussionData) { new DiscussionBlockModel(block, parent); } else { new HtmlBlockModel(block, parent); } } }
Source:
protected void executeMultiTargetChildren(PathAddress base, PathElement currentElement, PathAddress newRemaining, OperationContext context, ImmutableManagementResourceRegistration registration, boolean ignoreMissing) { final String childType = currentElement.getKey().equals("*") ? null : currentElement.getKey(); if (registration.isRemote()) { throw new IllegalStateException(); } final Set<PathElement> children = context.getResourceRegistration().getChildAddresses(base); if (children == null || children.isEmpty()) { return; } boolean isServerWildcardWithRemaining = currentElement.getKey().equals(RUNNING_SERVER) && currentElement.isWildcard() && newRemaining.size() > 0; for (final PathElement path : children) { if (childType != null && !childType.equals(path.getKey())) { continue; } if (isServerWildcardWithRemaining && path.getKey().equals(RUNNING_SERVER) && path.isWildcard() && newRemaining.size() > 0) { continue; } final PathAddress next = base.append(path); final ImmutableManagementResourceRegistration nr = context.getResourceRegistration().getSubModel(next); execute(next, newRemaining, context, nr, ignoreMissing); } }

Target:
protected void executeMultiTargetChildren(PathAddress base, PathElement currentElement, PathAddress newRemaining, OperationContext context, ImmutableManagementResourceRegistration registration, boolean ignoreMissing) { final String childType = currentElement.getKey().equals("*") ? null : currentElement.getKey(); if (registration.isRemote()) { throw new IllegalStateException(); } final Set<PathElement> children = context.getResourceRegistration().getChildAddresses(base); if (children == null || children.isEmpty()) { return; } for (final PathElement path : children) { if (childType != null && !childType.equals(path.getKey())) { continue; } if (path.getKey().equals(RUNNING_SERVER) && path.isWildcard() && newRemaining.size() > 0) { continue; } final PathAddress next = base.append(path); final ImmutableManagementResourceRegistration nr = context.getResourceRegistration().getSubModel(next); execute(next, newRemaining, context, nr, ignoreMissing); } }
Source:
public void testGetGlyphWithConsumer() { assertEquals(DMNSVGGlyphFactory.BUSINESS_KNOWLEDGE_MODEL_PALETTE, shapeDef.getGlyph(BusinessKnowledgeModel.class, PaletteGlyphConsumer.class, DEFINITION_ID)); assertEquals(DMNSVGGlyphFactory.DECISION_PALETTE, shapeDef.getGlyph(Decision.class, PaletteGlyphConsumer.class, DEFINITION_ID)); assertEquals(DMNSVGGlyphFactory.DIAGRAM_GLYPH, shapeDef.getGlyph(DMNDiagram.class, PaletteGlyphConsumer.class, DEFINITION_ID)); assertEquals(DMNSVGGlyphFactory.INPUT_DATA_PALETTE, shapeDef.getGlyph(InputData.class, PaletteGlyphConsumer.class, DEFINITION_ID)); assertEquals(DMNSVGGlyphFactory.KNOWLEDGE_SOURCE_PALETTE, shapeDef.getGlyph(KnowledgeSource.class, PaletteGlyphConsumer.class, DEFINITION_ID)); assertEquals(DMNSVGGlyphFactory.TEXT_ANNOTATION_PALETTE, shapeDef.getGlyph(TextAnnotation.class, PaletteGlyphConsumer.class, DEFINITION_ID)); }

Target:
public void testGetGlyphWithConsumer() { assertEquals(DMNSVGGlyphFactory.BUSINESS_KNOWLEDGE_MODEL_PALETTE, shapeDef.getGlyph(BusinessKnowledgeModel.class, PaletteGlyphConsumer.class, DEFINITION_ID)); assertEquals(DMNSVGGlyphFactory.DECISION_PALETTE, shapeDef.getGlyph(Decision.class, PaletteGlyphConsumer.class, DEFINITION_ID)); assertEquals(DMNSVGGlyphFactory.DIAGRAM_TOOLBOX, shapeDef.getGlyph(DMNDiagram.class, PaletteGlyphConsumer.class, DEFINITION_ID)); assertEquals(DMNSVGGlyphFactory.INPUT_DATA_PALETTE, shapeDef.getGlyph(InputData.class, PaletteGlyphConsumer.class, DEFINITION_ID)); assertEquals(DMNSVGGlyphFactory.KNOWLEDGE_SOURCE_PALETTE, shapeDef.getGlyph(KnowledgeSource.class, PaletteGlyphConsumer.class, DEFINITION_ID)); assertEquals(DMNSVGGlyphFactory.TEXT_ANNOTATION_PALETTE, shapeDef.getGlyph(TextAnnotation.class, PaletteGlyphConsumer.class, DEFINITION_ID)); assertTrue(shapeDef.getGlyph(DMNViewDefinition.class, PaletteGlyphConsumer.class, DEFINITION_ID) instanceof ShapeGlyph); }
Source:
protected String getParsedValue(String fileURI, String yamlPath) throws SecretDecryptionException { String[] pathElts = yamlPath.split("\\."); Map<String,Object> parsed = cache.get(fileURI); for (String pathElt : pathElts) { Object o = parsed.get(pathElt); if (o instanceof Map) { parsed = (Map<String, Object>) o; } else if (o instanceof List) { parsed = ((List<Map<String, Object>>) o).get(Integer.valueOf(pathElt)); } else { return (String) o; } } throw new SecretDecryptionException("Invalid secret key specified: " + yamlPath); }

Target:
protected String getParsedValue(String fileURI, String yamlPath) throws SecretDecryptionException { Map<String,Object> parsed = cache.get(fileURI); for (Iterator<String> it = Splitter.on(".").split(yamlPath).iterator(); it.hasNext(); ) { String pathElt = it.next(); Object o = parsed.get(pathElt); if (o instanceof Map) { parsed = (Map<String, Object>) o; } else if (o instanceof List) { parsed = ((List<Map<String, Object>>) o).get(Integer.valueOf(pathElt)); } else { return (String) o; } } throw new SecretDecryptionException("Invalid secret key specified: " + yamlPath); }
Source:
public String toString() { return toStringHelper(this) .add("path", path) .toString(); }

Target:
public String toString() { return Joiner.on(", ").join(path); }
Source:
public void setLockScreenArt( NotificationCompat.Builder builder, @Nullable Bitmap thumbnailBitmap ) { if (thumbnailBitmap == null) { return; } if (!mediaSession.isActive()) { return; } mediaSession.setMetadata( new MediaMetadataCompat.Builder() .putBitmap(MediaMetadata.METADATA_KEY_ALBUM_ART, thumbnailBitmap) .build() ); MediaStyle mediaStyle = new MediaStyle() .setMediaSession(mediaSession.getSessionToken()); builder.setStyle(mediaStyle); }

Target:
public void setLockScreenArt(NotificationCompat.Builder builder, @Nullable Bitmap thumbnailBitmap) { if (thumbnailBitmap == null || !mediaSession.isActive()) { return; } mediaSession.setMetadata( new MediaMetadataCompat.Builder() .putBitmap(MediaMetadata.METADATA_KEY_ALBUM_ART, thumbnailBitmap) .build() ); MediaStyle mediaStyle = new MediaStyle() .setMediaSession(mediaSession.getSessionToken()); builder.setStyle(mediaStyle); }
Source:
private static IFile getFile(String path) throws FileNotFoundException { IWorkspaceRoot root = ResourcesPlugin.getWorkspace().getRoot(); IFile traceChild = root.getFile(new Path(path)); if (traceChild != null) { return traceChild; } throw new FileNotFoundException(); }

Target:
private static IFile getFile(String path) throws FileNotFoundException { IWorkspaceRoot root = ResourcesPlugin.getWorkspace().getRoot(); IFile traceChild = root.getFile(new Path(path)); if (traceChild != null) { return traceChild; } throw new FileNotFoundException("The file: " + path + " could not be found"); }
Source:
public static INDArray minv(@Nonnull final INDArray mat) { if (mat.isScalar()) { return Nd4j.onesLike(mat).divi(mat); } if (!mat.isSquare()) { throw new IllegalArgumentException("Invalid array: must be square matrix"); } final RealMatrix rm = Nd4jApacheAdapterUtils.convertINDArrayToApacheMatrix(mat); final RealMatrix rmInverse = new LUDecomposition(rm).getSolver().getInverse(); return Nd4jApacheAdapterUtils.convertApacheMatrixToINDArray(rmInverse); }

Target:
public static INDArray minv(@Nonnull final INDArray mat) { return minv(mat, DEFAULT_LU_DECOMPOSITION_SINGULARITY_THRESHOLD); }
Source:
private ResourceIdentifier(String service, String instance, String type, String locator) { String safeInstnace = instance == null ? "" : instance; resourceIdentifier = RID_CLASS + SEPARATOR + service + SEPARATOR + safeInstnace + SEPARATOR + type + SEPARATOR + locator; serviceIndex = RID_CLASS.length() + SEPARATOR.length() + service.length(); instanceIndex = serviceIndex + SEPARATOR.length() + safeInstnace.length(); typeIndex = instanceIndex + SEPARATOR.length() + type.length(); locatorIndex = typeIndex + SEPARATOR.length() + locator.length(); }

Target:
private ResourceIdentifier(String service, String instance, String type, String locator) { String safeInstance = instance == null ? "" : instance; resourceIdentifier = RID_CLASS + SEPARATOR + service + SEPARATOR + safeInstance + SEPARATOR + type + SEPARATOR + locator; serviceIndex = RID_CLASS.length() + SEPARATOR.length() + service.length(); instanceIndex = serviceIndex + SEPARATOR.length() + safeInstance.length(); typeIndex = instanceIndex + SEPARATOR.length() + type.length(); locatorIndex = typeIndex + SEPARATOR.length() + locator.length(); }
Source:
public List<Monitor<?>> getMonitors() { lastUsed = clock.now(); if (myFutureRef.get() == null) { LOGGER.info("Attempting to get the value for an expired monitor: {}." + "Will start computing stats again.", getConfig().getName()); startComputingStats(executor, statsConfig.getFrequencyMillis()); return Collections.emptyList(); } return monitors; }

Target:
public List<Monitor<?>> getMonitors() { lastUsed = clock.now(); if (isExpired()) { LOGGER.info("Attempting to get the value for an expired monitor: {}." + "Will start computing stats again.", getConfig().getName()); startComputingStats(executor, statsConfig.getFrequencyMillis()); return Collections.emptyList(); } return monitors; }
Source:
public String toString() { StringBuilder builder = new StringBuilder(); builder.append("NetworkProvider [name=") .append(getName()) .append(", description=") .append(getDescription()) .append(", url=") .append(getUrl()) .append("]"); return builder.toString(); }

Target:
public String toString() { StringBuilder builder = new StringBuilder(); builder.append("Provider [id=") .append(getId()) .append(", name=") .append(getName()) .append(", description=") .append(getDescription()) .append(", type=") .append(getType()) .append(", url=") .append(getUrl()) .append("]"); return builder.toString(); }
Source:
private void decorateWiretap(FlowElementMetaData flowElement, AbstractWiretapNode node) { if(flowElement.getDecorators() != null) { flowElement.getDecorators().forEach(decoratorMetaData -> { if (decoratorMetaData.getType().equals("Wiretap") && decoratorMetaData.getName().startsWith("BEFORE")) { node.setWiretapBeforeStatus(NodeFoundStatus.FOUND); node.setDecoratorMetaDataList(flowElement.getDecorators()); } else if (decoratorMetaData.getType().equals("Wiretap") && decoratorMetaData.getName().startsWith("AFTER")) { node.setWiretapAfterStatus(NodeFoundStatus.FOUND); node.setDecoratorMetaDataList(flowElement.getDecorators()); } else if (decoratorMetaData.getType().equals("LogWiretap") && decoratorMetaData.getName().startsWith("BEFORE")) { node.setLogWiretapBeforeStatus(NodeFoundStatus.FOUND); node.setDecoratorMetaDataList(flowElement.getDecorators()); } else if (decoratorMetaData.getType().equals("LogWiretap") && decoratorMetaData.getName().startsWith("AFTER")) { node.setLogWiretapAfterStatus(NodeFoundStatus.FOUND); node.setDecoratorMetaDataList(flowElement.getDecorators()); } }); } }

Target:
private void decorateWiretap(FlowElementMetaData flowElement, AbstractWiretapNode node) { if(flowElement.getDecorators() != null) { flowElement.getDecorators().forEach(decoratorMetaData -> { if (decoratorMetaData.getType().equals(TriggerJobType.WIRETAP.getDescription()) && decoratorMetaData.getName() .startsWith(TriggerRelationship.BEFORE.getDescription().toUpperCase())) { node.setWiretapBeforeStatus(NodeFoundStatus.FOUND); node.setDecoratorMetaDataList(flowElement.getDecorators()); } else if (decoratorMetaData.getType().equals(TriggerJobType.WIRETAP.getDescription()) && decoratorMetaData.getName() .startsWith(TriggerRelationship.AFTER.getDescription().toUpperCase())) { node.setWiretapAfterStatus(NodeFoundStatus.FOUND); node.setDecoratorMetaDataList(flowElement.getDecorators()); } else if (decoratorMetaData.getType().equals(TriggerJobType.LOG_WIRETAP.getDescription()) && decoratorMetaData.getName() .startsWith(TriggerRelationship.BEFORE.getDescription().toUpperCase())) { node.setLogWiretapBeforeStatus(NodeFoundStatus.FOUND); node.setDecoratorMetaDataList(flowElement.getDecorators()); } else if (decoratorMetaData.getType().equals(TriggerJobType.LOG_WIRETAP.getDescription()) && decoratorMetaData.getName() .startsWith(TriggerRelationship.AFTER.getDescription().toUpperCase())) { node.setLogWiretapAfterStatus(NodeFoundStatus.FOUND); node.setDecoratorMetaDataList(flowElement.getDecorators()); } }); } }
Source:
public ScheduledReporter build(MetricRegistry registry) { try { file.mkdir(); } catch (Exception e) { } return CsvReporter.forRegistry(registry) .convertDurationsTo(getDurationUnit()) .convertRatesTo(getRateUnit()) .filter(getFilter()) .formatFor(getLocale()) .build(getFile()); }

Target:
public ScheduledReporter build(MetricRegistry registry) { boolean creation = file.mkdirs(); if (!creation && !file.exists()) { String msg = "Failed to create" + file.getAbsolutePath(); throw new RuntimeException(msg); } return CsvReporter.forRegistry(registry) .convertDurationsTo(getDurationUnit()) .convertRatesTo(getRateUnit()) .filter(getFilter()) .formatFor(getLocale()) .build(getFile()); }
Source:
public void ruleAddedTableLayoutToTableScan() { Map<String, Domain> emptyConstraint = ImmutableMap.<String, Domain>builder().build(); tester().assertThat(pickTableLayout) .on(p -> p.tableScan( nationTableHandle, ImmutableList.of(p.symbol("nationkey", BIGINT)), ImmutableMap.of(p.symbol("nationkey", BIGINT), new TpchColumnHandle("nationkey", BIGINT)))) .matches( constrainedTableScanWithTableLayout("nation", emptyConstraint, ImmutableMap.of("nationkey", "nationkey"))); }

Target:
public void ruleAddedTableLayoutToTableScan() { Map<String, Domain> emptyConstraint = ImmutableMap.<String, Domain>builder().build(); tester.assertThat(pickTableLayout) .on(p -> p.tableScan( nationTableHandle, ImmutableList.of(p.symbol("nationkey", BIGINT)), ImmutableMap.of(p.symbol("nationkey", BIGINT), new TpchColumnHandle("nationkey", BIGINT)))) .matches( constrainedTableScanWithTableLayout("nation", emptyConstraint, ImmutableMap.of("nationkey", "nationkey"))); }
Source:
private void showResource(final IResource resource) { IProject project = resource.getProject(); RepositoryMapping mapping = RepositoryMapping.getMapping(project); if (mapping == null) return; Repository newRep = mapping.getRepositoryOrNestedSubmoduleRepository(resource); if (newRep != currentRepository) { reload(newRep); } }

Target:
private void showResource(final IResource resource) { Repository newRep = getRepositoryOrNestedSubmoduleRepository(resource); if (newRep != null && newRep != currentRepository) { reload(newRep); } }
Source:
public Boolean getCleanup() { if (cleanup != null) { return cleanup; } return false; }

Target:
public Boolean getCleanup() { return cleanup; }