auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public void getApplicationByCandidateIdShouldReturnAMaximumNumberOfApplicationsGivenByTheSizeParameter() { List<ApplicationEntity> applicationEntities = Arrays.asList(applicationEntity, applicationEntity); List<CandidateApplicationDTO> candidateApplicationDTOs = Arrays.asList(dummyCandidateApplicationDTO, dummyCandidateApplicationDTO); given(candidateRepository.findOne(CANDIDATE_ID)).willReturn(candidateEntity); given(applicationsRepository.findByCandidateEntity(candidateEntity, ZERO_TWO_PAGE_REQUEST)) .willReturn(new PageImpl<ApplicationEntity>(applicationEntities)); given(converterService.convert(applicationEntities, CandidateApplicationDTO.class)) .willReturn(candidateApplicationDTOs); PagingResponse<CandidateApplicationDTO> result = applicationsService .getApplicationsByCandidateId(CANDIDATE_ID, PAGE_NUMBER_ZERO, PAGE_SIZE_TWO); assertThat(result.getRows().size(), is(2)); assertThat(result.getRows(), equalTo(candidateApplicationDTOs)); }

Target:
public void getApplicationByCandidateIdShouldReturnAMaximumNumberOfApplicationsGivenByTheSizeParameter() { final List<ApplicationEntity> applicationEntities = Arrays.asList(applicationEntity, applicationEntity); final List<CandidateApplicationDTO> candidateApplicationDTOs = Arrays.asList(dummyCandidateApplicationDTO, dummyCandidateApplicationDTO); given(candidateRepository.findOne(CANDIDATE_ID)).willReturn(candidateEntity); given(applicationsRepository.findByCandidateEntity(candidateEntity, ZERO_TWO_PAGE_REQUEST)) .willReturn(new PageImpl<ApplicationEntity>(applicationEntities)); given(converterService.convert(applicationEntities, CandidateApplicationDTO.class)) .willReturn(candidateApplicationDTOs); final PagingResponse<CandidateApplicationDTO> result = applicationsService .getApplicationsByCandidateId(CANDIDATE_ID, PAGE_NUMBER_ZERO, PAGE_SIZE_TWO); assertThat(result.getRows().size(), is(2)); assertThat(result.getRows(), equalTo(candidateApplicationDTOs)); }
Source:
private void updatePositionLeaderNoValidation(Metadata.LeaderAndEpoch currentLeaderAndEpoch) { if (position != null && !position.currentLeader.equals(currentLeaderAndEpoch)) { FetchPosition newPosition = new FetchPosition(position.offset, position.offsetEpoch, currentLeaderAndEpoch); transitionState(FetchStates.FETCHING, () -> { this.position = newPosition; this.nextRetryTimeMs = null; }); } }

Target:
private void updatePositionLeaderNoValidation(Metadata.LeaderAndEpoch currentLeaderAndEpoch) { if (position != null) { FetchPosition newPosition = new FetchPosition(position.offset, position.offsetEpoch, currentLeaderAndEpoch); transitionState(FetchStates.FETCHING, () -> { this.position = newPosition; this.nextRetryTimeMs = null; }); } }
Source:
public void setup(final IDocument document, IPath location, LocationKind locationKind) { if (document == null) { return; } Job job = new Job("Initialize Language Servers for " + location.toFile().getName()) { @Override protected IStatus run(IProgressMonitor monitor) { LanguageServiceAccessor.getLanguageServers(document, capabilities -> true); return Status.OK_STATUS; } }; job.setUser(true); job.setPriority(Job.INTERACTIVE); job.schedule(100); locationMap.put(location, job); }

Target:
public void setup(final IDocument document, IPath location, LocationKind locationKind) { if (document == null) { return; } Job job = new Job("Initialize Language Servers for " + location.toFile().getName()) { @Override protected IStatus run(IProgressMonitor monitor) { ITextFileBuffer buffer = ITextFileBufferManager.DEFAULT.getTextFileBuffer(document); if (buffer == null || buffer.getLocation() == null) { return Status.OK_STATUS; } if (monitor.isCanceled()) { return Status.CANCEL_STATUS; } LanguageServiceAccessor.getLanguageServers(document, capabilities -> true); locationMap.remove(location); return Status.OK_STATUS; } }; job.setUser(true); job.setPriority(Job.INTERACTIVE); locationMap.put(location, job); job.schedule(100); }
Source:
private void appendValuesToBuffer() { verify(decodedBlock != null); ensureValueBufferSize(); if (decodedBlock.mayHaveNull()) { appendLongsWithNullsToBuffer(); } else { appendLongsToBuffer(); } }

Target:
private void appendValuesToBuffer() { ensureValuesBufferCapacity(); int[] positions = getPositions(); if (decodedBlock.mayHaveNull()) { for (int i = positionsOffset; i < positionsOffset + batchSize; i++) { int position = positions[i]; int newIndex = setLong(valuesBuffer, valuesBufferIndex, decodedBlock.getLong(position)); if (!decodedBlock.isNull(position)) { valuesBufferIndex = newIndex; } } } else { for (int i = positionsOffset; i < positionsOffset + batchSize; i++) { valuesBufferIndex = setLong(valuesBuffer, valuesBufferIndex, decodedBlock.getLong(positions[i])); } } }
Source:
boolean hasMappingErrors(String vreName) { return getRawCollectionsTraversal(vreName).outE(HAS_NEXT_ERROR).hasNext(); }

Target:
public boolean hasMappingErrors(String vreName) { return getRawCollectionsTraversal(vreName).outE(HAS_NEXT_ERROR).hasNext(); }
Source:
public void define(NewController context) { NewAction action = context.createAction("groups") .setDescription("Lists the groups a user belongs to. Requires Administer System permission.") .setHandler(this) .setResponseExample(getClass().getResource("groups-example.json")) .addSelectionModeParam() .addSearchQuery("users", "group names") .addPagingParams(25) .setChangelog(new Change("6.4", "Paging response fields as been moved under a 'paging' node")) .setSince("5.2"); action.createParam(PARAM_LOGIN) .setDescription("A user login") .setExampleValue("admin") .setRequired(true); }

Target:
public void define(NewController context) { NewAction action = context.createAction("groups") .setDescription("Lists the groups a user belongs to. Requires Administer System permission.") .setHandler(this) .setResponseExample(getClass().getResource("groups-example.json")) .addSelectionModeParam() .addSearchQuery("users", "group names") .addPagingParams(25) .setChangelog(new Change("6.4", "Paging response fields moved to a Paging object")) .setSince("5.2"); action.createParam(PARAM_LOGIN) .setDescription("A user login") .setExampleValue("admin") .setRequired(true); action.createParam(PARAM_ORGANIZATION) .setDescription("Organization key") .setExampleValue("my-org") .setInternal(true) .setSince("6.4"); }
Source:
public static MapValue convert( ExecutionPlanDescription plan ) { MapValueBuilder out = new MapValueBuilder( ); out.add( "operatorType", stringValue( plan.getName() ) ); out.add( "args", ValueUtils.asMapValue( plan.getArguments() ) ); out.add( "identifiers", ValueUtils.asListValue( plan.getIdentifiers() ) ); out.add( "children", children( plan ) ); if ( plan.hasProfilerStatistics() ) { ExecutionPlanDescription.ProfilerStatistics profile = plan.getProfilerStatistics(); out.add( "dbHits", longValue( profile.getDbHits() ) ); out.add( "pageCacheHits", longValue( profile.getPageCacheHits() ) ); out.add( "pageCacheMisses", longValue( profile.getPageCacheMisses() ) ); out.add( "pageCacheHitRatio", doubleValue( profile.getPageCacheHitRatio() ) ); out.add( "rows", longValue( profile.getRows() ) ); } return out.build(); }

Target:
public static MapValue convert( ExecutionPlanDescription plan ) { boolean hasProfilerStatistics = plan.hasProfilerStatistics(); int size = hasProfilerStatistics ? 9 : 4; MapValueBuilder out = new MapValueBuilder( size ); out.add( "operatorType", stringValue( plan.getName() ) ); out.add( "args", ValueUtils.asMapValue( plan.getArguments() ) ); out.add( "identifiers", ValueUtils.asListValue( plan.getIdentifiers() ) ); out.add( "children", children( plan ) ); if ( hasProfilerStatistics ) { ExecutionPlanDescription.ProfilerStatistics profile = plan.getProfilerStatistics(); out.add( "dbHits", longValue( profile.getDbHits() ) ); out.add( "pageCacheHits", longValue( profile.getPageCacheHits() ) ); out.add( "pageCacheMisses", longValue( profile.getPageCacheMisses() ) ); out.add( "pageCacheHitRatio", doubleValue( profile.getPageCacheHitRatio() ) ); out.add( "rows", longValue( profile.getRows() ) ); } return out.build(); }
Source:
public static void testCopyObject( String testTags, ServerSideEncryption sse, CopyObjectArgs args, boolean negativeCase) throws Exception { String methodName = "copyObject()"; if (!mintEnv) { System.out.println("Test: " + methodName + " " + testTags); } String srcObject = args.object(); if (args.srcObject() != null) { srcObject = args.srcObject(); } long startTime = System.currentTimeMillis(); try { client.makeBucket(MakeBucketArgs.builder().bucket(args.srcBucket()).build()); try { PutObjectOptions options = new PutObjectOptions(1 * KB, -1); if (sse != null) { options.setSse(sse); } client.putObject(args.srcBucket(), srcObject, new ContentInputStream(1 * KB), options); if (negativeCase) { try { client.copyObject(args); } catch (ErrorResponseException e) { if (e.errorResponse().errorCode() != ErrorCode.PRECONDITION_FAILED) { throw e; } } } else { client.copyObject(args); ServerSideEncryptionCustomerKey ssec = null; if (sse instanceof ServerSideEncryptionCustomerKey) { ssec = (ServerSideEncryptionCustomerKey) sse; } client.statObject( StatObjectArgs.builder() .bucket(args.bucket()) .object(args.object()) .ssec(ssec) .build()); } mintSuccessLog(methodName, testTags, startTime); } finally { client.removeObject( RemoveObjectArgs.builder().bucket(args.srcBucket()).object(srcObject).build()); client.removeObject( RemoveObjectArgs.builder().bucket(args.bucket()).object(args.object()).build()); client.removeBucket(RemoveBucketArgs.builder().bucket(args.srcBucket()).build()); } } catch (Exception e) { handleException(methodName, testTags, startTime, e); } }

Target:
public static void testCopyObject( String testTags, ServerSideEncryption sse, CopyObjectArgs args, boolean negativeCase) throws Exception { String methodName = "copyObject()"; if (!mintEnv) { System.out.println("Test: " + methodName + " " + testTags); } String srcObject = Optional.ofNullable(args.srcObject()).orElse(args.object()); long startTime = System.currentTimeMillis(); try { client.makeBucket(MakeBucketArgs.builder().bucket(args.srcBucket()).build()); try { PutObjectOptions options = new PutObjectOptions(1 * KB, -1); if (sse != null) { options.setSse(sse); } client.putObject(args.srcBucket(), srcObject, new ContentInputStream(1 * KB), options); if (negativeCase) { try { client.copyObject(args); } catch (ErrorResponseException e) { if (e.errorResponse().errorCode() != ErrorCode.PRECONDITION_FAILED) { throw e; } } } else { client.copyObject(args); ServerSideEncryptionCustomerKey ssec = null; if (sse instanceof ServerSideEncryptionCustomerKey) { ssec = (ServerSideEncryptionCustomerKey) sse; } client.statObject( StatObjectArgs.builder() .bucket(args.bucket()) .object(args.object()) .ssec(ssec) .build()); } mintSuccessLog(methodName, testTags, startTime); } finally { client.removeObject( RemoveObjectArgs.builder().bucket(args.srcBucket()).object(srcObject).build()); client.removeObject( RemoveObjectArgs.builder().bucket(args.bucket()).object(args.object()).build()); client.removeBucket(RemoveBucketArgs.builder().bucket(args.srcBucket()).build()); } } catch (Exception e) { handleException(methodName, testTags, startTime, e); } }
Source:
public static <E> int hashCode(final Collection<? extends E> collection, final Equator<? super E> equator) { Objects.requireNonNull(equator, "Equator"); if (null == collection) { return 0; } int hashCode = 1; for (final E e : collection) { hashCode = 31 * hashCode + equator.hash(e); } return hashCode; }

Target:
public static <E> int hashCode(final Collection<? extends E> collection, final Equator<? super E> equator) { Objects.requireNonNull(equator, "equator"); if (null == collection) { return 0; } int hashCode = 1; for (final E e : collection) { hashCode = 31 * hashCode + equator.hash(e); } return hashCode; }
Source:
private LineData generateA1cData() { ArrayList<String> xVals = new ArrayList<>(); ArrayList<Entry> yVals = new ArrayList<>(); int k = 0; for (int i = presenter.getA1cReadings().size() - 1; i >= 0; i--) { float val = Float.parseFloat(presenter.getA1cReadings().get(i).toString()); Log.e("glucosio", "ADDING " + val); yVals.add(new Entry(k, val)); k++; } for (int i = presenter.getA1cReadingsDateTime().size() - 1; i >= 0; i--) { String date = presenter.convertDate(presenter.getA1cReadingsDateTime().get(i)); xVals.add(date + ""); } xValues = xVals; return new LineData(generateLineDataSet(yVals, getResources().getColor(R.color.glucosio_fab_HB1AC))); }

Target:
private LineData generateA1cData() { ArrayList<String> xVals = new ArrayList<>(); ArrayList<Entry> yVals = new ArrayList<>(); int k = 0; for (int i = presenter.getA1cReadings().size() - 1; i >= 0; i--) { float val = Float.parseFloat(presenter.getA1cReadings().get(i).toString()); yVals.add(new Entry(k, val)); k++; } for (int i = presenter.getA1cReadingsDateTime().size() - 1; i >= 0; i--) { String date = presenter.convertDate(presenter.getA1cReadingsDateTime().get(i)); xVals.add(date); } xValues = xVals; return new LineData(generateLineDataSet(yVals, getResources().getColor(R.color.glucosio_fab_HB1AC))); }
Source:
public static User parseUserLight(JSONObject jUser) throws JSONException { User user = new User(); user.setUserid(jUser.getInt("userid")); user.setUsername(jUser.getString("username")); if (!jUser.isNull("image")) user.setAvatar(parseImage(jUser.getJSONObject("image"), null)); if (!jUser.isNull("join_date")) user.setJoinDate(jUser.getInt("join_date")); user.setReputation(jUser.getInt("reputation")); return user; }

Target:
public static User parseUserLight(JSONObject jUser) throws JSONException { User user = new User(); user.setUserid(jUser.getInt("userid")); user.setUsername(jUser.getString("username")); user.setAvatar(parseImage(jUser, "image")); if (!jUser.isNull("join_date")) user.setJoinDate(jUser.getInt("join_date")); user.setReputation(jUser.getInt("reputation")); return user; }
Source:
private TransferPartitionKey findTransferBucketKey(List<BlockTransferInfo> transferInfos) { int srcAllocatedCount = 0; int dstAllocatedCount = 0; Set<BlockStoreLocation> srcLocations = new HashSet<>(); Set<BlockStoreLocation> dstLocations = new HashSet<>(); for (BlockTransferInfo transferInfo : transferInfos) { if (transferInfo.getSrcLocation().dir() != BlockStoreLocation.ANY_DIR) { srcAllocatedCount++; } if (transferInfo.getDstLocation().dir() != BlockStoreLocation.ANY_DIR) { dstAllocatedCount++; } srcLocations.add(transferInfo.getSrcLocation()); dstLocations.add(transferInfo.getDstLocation()); } if (srcAllocatedCount == dstAllocatedCount) { if (srcAllocatedCount == 0) { return TransferPartitionKey.NONE; } else { if (srcLocations.size() >= dstLocations.size()) { return TransferPartitionKey.SRC; } else { return TransferPartitionKey.DST; } } } else if (srcAllocatedCount > dstAllocatedCount) { return TransferPartitionKey.SRC; } else { return TransferPartitionKey.DST; } }

Target:
private TransferPartitionKey findTransferBucketKey(List<BlockTransferInfo> transferInfos) { int srcAllocatedCount = 0; int dstAllocatedCount = 0; Set<BlockStoreLocation> srcLocations = new HashSet<>(); Set<BlockStoreLocation> dstLocations = new HashSet<>(); for (BlockTransferInfo transferInfo : transferInfos) { if (transferInfo.getSrcLocation().dir() != BlockStoreLocation.ANY_DIR) { srcAllocatedCount++; } if (transferInfo.getDstLocation().dir() != BlockStoreLocation.ANY_DIR) { dstAllocatedCount++; } srcLocations.add(transferInfo.getSrcLocation()); dstLocations.add(transferInfo.getDstLocation()); } if (srcAllocatedCount == 0 && dstAllocatedCount == 0) { return TransferPartitionKey.NONE; } if (srcAllocatedCount > dstAllocatedCount) { return TransferPartitionKey.SRC; } else if (dstAllocatedCount > srcAllocatedCount) { return TransferPartitionKey.DST; } else { if (srcLocations.size() >= dstLocations.size()) { return TransferPartitionKey.SRC; } else { return TransferPartitionKey.DST; } } }
Source:
public ZKDistributedNonblockingLock(LockScope scope, String zkAddress, Long leaseTimeout, String lockMsg, String userId) { this(scope.getPath(), leaseTimeout, lockMsg, userId, 0, Integer.MAX_VALUE, 0, false, new LockListener() { @Override public void onCleanupNotification() { } }, new ZkBaseDataAccessor<ZNRecord>(zkAddress)); }

Target:
public ZKDistributedNonblockingLock(LockScope scope, String zkAddress, Long leaseTimeout, String lockMsg, String userId) { this(scope.getPath(), leaseTimeout, lockMsg, userId, 0, Integer.MAX_VALUE, 0, false, null, new ZkBaseDataAccessor<ZNRecord>(zkAddress)); }
Source:
public ManifestIdentifier identify(Config config) { String buckManifest = System.getProperty(BUCK_ROBOLECTRIC_MANIFEST); FsFile manifestFile = Fs.fileFromPath(buckManifest); String buckResDirs = System.getProperty(BUCK_ROBOLECTRIC_RES_DIRECTORIES); String buckAssetsDirs = System.getProperty(BUCK_ROBOLECTRIC_ASSETS_DIRECTORIES); String packageName = config.packageName(); final List<FsFile> buckResources = getDirectoriesFromProperty(buckResDirs); final List<FsFile> buckAssets = getDirectoriesFromProperty(buckAssetsDirs); final FsFile resDir = buckResources.size() == 0 ? null : buckResources.get(buckResources.size() - 1); final FsFile assetsDir = buckAssets.size() == 0 ? null : buckAssets.get(buckAssets.size() - 1); final List<ManifestIdentifier> libraries; if (resDir == null && assetsDir == null) { libraries = null; } else { libraries = new ArrayList<>(); for (FsFile buckResource: buckResources) { libraries.add(new ManifestIdentifier(null, null, buckResource, null, null)); } for (FsFile buckAsset: buckAssets) { libraries.add(new ManifestIdentifier(null, null, null, buckAsset, null)); } } return new ManifestIdentifier(packageName, manifestFile, resDir, assetsDir, libraries); }

Target:
public ManifestIdentifier identify(Config config) { String buckManifest = System.getProperty(BUCK_ROBOLECTRIC_MANIFEST); FsFile manifestFile = Fs.fileFromPath(buckManifest); String buckResDirs = System.getProperty(BUCK_ROBOLECTRIC_RES_DIRECTORIES); String buckAssetsDirs = System.getProperty(BUCK_ROBOLECTRIC_ASSETS_DIRECTORIES); String packageName = config.packageName(); final List<FsFile> buckResources = getDirectoriesFromProperty(buckResDirs); final List<FsFile> buckAssets = getDirectoriesFromProperty(buckAssetsDirs); final FsFile resDir = buckResources.size() == 0 ? null : buckResources.get(buckResources.size() - 1); final FsFile assetsDir = buckAssets.size() == 0 ? null : buckAssets.get(buckAssets.size() - 1); final List<ManifestIdentifier> libraries; if (resDir == null && assetsDir == null) { libraries = null; } else { libraries = new ArrayList<>(); for (int i = 0; i < buckResources.size() - 1; i++) { libraries.add(new ManifestIdentifier((String) null, null, buckResources.get(i), null, null)); } for (int i = 0; i < buckAssets.size() - 1; i++) { libraries.add(new ManifestIdentifier(null, null, null, buckAssets.get(i), null)); } } return new ManifestIdentifier(packageName, manifestFile, resDir, assetsDir, libraries); }
Source:
private void postConstruct() { ThreadFactory factory = new ThreadFactoryBuilder() .setUncaughtExceptionHandler(LoggingUncaughtExceptionHandler.getInstance()) .setNameFormat(ServerSideRequestProcessor.class.getSimpleName() + "-%d") .setDaemon(true) .build(); executor = new ThreadPoolExecutor(0, maxPoolSize, 60L, SECONDS, new SynchronousQueue<>(), factory); executor.setRejectedExecutionHandler( (r, __) -> LOG.warn("Message rejected for execution", r)); requestProcessorConfigurator.put(getEndpointId(), () -> executor); }

Target:
private void postConstruct() { ThreadFactory factory = new ThreadFactoryBuilder() .setUncaughtExceptionHandler(LoggingUncaughtExceptionHandler.getInstance()) .setNameFormat(CheMajorWebSocketEndpoint.class.getSimpleName() + "-%d") .setDaemon(true) .build(); executor = new ThreadPoolExecutor(0, maxPoolSize, 60L, SECONDS, new SynchronousQueue<>(), factory); executor.setRejectedExecutionHandler( (r, __) -> LOG.error("Message rejected for execution", r)); requestProcessorConfigurator.put(getEndpointId(), () -> executor); }
Source:
private void warnOnProblemsAndErrors() { for (ModelProblem problem : buildingResult.getProblems()) { ShellMessages.warn(writer, "[ " + problem.getSeverity() + " ] " + problem.getMessage() + " @ " + ModelProblemUtils.formatLocation(problem, problem.getModelId())); } DependencyResolutionResult resolutionResult = buildingResult.getDependencyResolutionResult(); for (Exception collectionError : resolutionResult.getCollectionErrors()) { ShellMessages.warn(writer, collectionError.getMessage()); } for (Dependency unresolvedDep : resolutionResult.getUnresolvedDependencies()) { ShellMessages.warn(writer, "Failed to resolve dependency [ " + unresolvedDep + " ] , due to error(s) : " + resolutionResult.getResolutionErrors(unresolvedDep)); } }

Target:
private void warnOnProblemsAndErrors() { for (ModelProblem problem : buildingResult.getProblems()) { ShellMessages.warn(writer, "[ " + problem.getSeverity() + " ] " + problem.getMessage() + " @ " + ModelProblemUtils.formatLocation(problem, problem.getModelId())); } DependencyResolutionResult resolutionResult = buildingResult.getDependencyResolutionResult(); for (Exception collectionError : resolutionResult.getCollectionErrors()) { StringBuilder message = new StringBuilder(); message.append(collectionError.getMessage()); message.append('\n'); if(collectionError.getCause() != null) { message.append("Cause : "); message.append(collectionError.getCause().getMessage()); } ShellMessages.warn(writer, message.toString()); } for (Dependency unresolvedDep : resolutionResult.getUnresolvedDependencies()) { ShellMessages.warn(writer, "Failed to resolve dependency [ " + unresolvedDep + " ] , due to error(s) : " + resolutionResult.getResolutionErrors(unresolvedDep)); } }
Source:
static LocalDateDoubleTimeSeries of( LocalDate startDate, LocalDate endDate, Stream<LocalDateDoublePoint> values, DenseTimeSeriesCalculation dateCalculation) { double[] points = new double[dateCalculation.calculatePosition(startDate, endDate) + 1]; Arrays.fill(points, Double.NaN); int size = 0; for (LocalDateDoublePoint pt : Guavate.in(values)) { points[dateCalculation.calculatePosition(startDate, pt.getDate())] = pt.getValue(); size++; } return new DenseLocalDateDoubleTimeSeries(startDate, points, dateCalculation, true, size); }

Target:
static LocalDateDoubleTimeSeries of( LocalDate startDate, LocalDate endDate, Stream<LocalDateDoublePoint> values, DenseTimeSeriesCalculation dateCalculation) { double[] points = new double[dateCalculation.calculatePosition(startDate, endDate) + 1]; Arrays.fill(points, Double.NaN); int size = 1; for (LocalDateDoublePoint pt : in(values)) { points[dateCalculation.calculatePosition(startDate, pt.getDate())] = pt.getValue(); size++; } return new DenseLocalDateDoubleTimeSeries(startDate, points, dateCalculation, true, size); }
Source:
public static void assertTextContainsProperty(String text, String propName, Object propValue) { Assert.assertTrue("Property " + propName + " not found in " + text, text.contains(propName + " = " + propValue)); }

Target:
public static void assertTextContainsProperty(String text, String propName, Object propValue) { Assert.assertTrue("String '" + propName + " = " + propValue + "' not found in the following output:\n" + text, text.contains(propName + " = " + propValue + "\n")); }
Source:
@Override public boolean start() throws Exception { Map<String,String> overrides = new HashMap<String,String>(); List<MultiBinding.Unbinder> unbinders = new ArrayList<MultiBinding.Unbinder>(); for (MultiBinding<?> binding : step.bindings) { MultiBinding.MultiEnvironment environment = binding.bind(run, workspace, launcher, listener); unbinders.add(environment.getUnbinder()); overrides.putAll(environment.getValues()); IdCredentials id = CredentialsProvider.findCredentialById(binding.getCredentialsId(), binding.type(), run); CredentialsProvider.track(run, id); } getContext().newBodyInvoker(). withContext(EnvironmentExpander.merge(getContext().get(EnvironmentExpander.class), new Overrider(overrides))). withContext(BodyInvoker.mergeConsoleLogFilters(getContext().get(ConsoleLogFilter.class), new Filter(overrides.values(), run.getCharset().name()))). withCallback(new Callback(unbinders)). start(); return false; }

Target:
@Override public boolean start() throws Exception { Map<String,String> overrides = new HashMap<String,String>(); List<MultiBinding.Unbinder> unbinders = new ArrayList<MultiBinding.Unbinder>(); for (MultiBinding<?> binding : step.bindings) { MultiBinding.MultiEnvironment environment = binding.bind(run, workspace, launcher, listener); unbinders.add(environment.getUnbinder()); overrides.putAll(environment.getValues()); } getContext().newBodyInvoker(). withContext(EnvironmentExpander.merge(getContext().get(EnvironmentExpander.class), new Overrider(overrides))). withContext(BodyInvoker.mergeConsoleLogFilters(getContext().get(ConsoleLogFilter.class), new Filter(overrides.values(), run.getCharset().name()))). withCallback(new Callback(unbinders)). start(); return false; }
Source:
public static Optional<Map<String, String>> splitParams(HttpServletRequest request) { String pathInfo = request.getPathInfo(); pathInfo = pathInfo.substring(pathInfo.indexOf(TMSDocumentFactory.TILEMAPSERVICE_LEADINGPATH)); String[] params = pathInfo.split("/"); int paramsLength = params.length; Map<String, String> parsed = new HashMap<>(); if (params.length < 4) { return Optional.empty(); } String[] yExt = params[paramsLength - 1].split("\\."); String x = params[paramsLength - 2]; String y = yExt[0]; String z = params[paramsLength - 3]; String flip = yExt[1].toUpperCase(); if (flip.contains("?FLIPY=TRUE")) { String[] yFlip = yExt[1].split("\\?"); int zInt = Integer.parseInt(z); int flippedY = Integer.parseInt(y); flippedY = (int) (Math.pow(2, zInt)) - flippedY - 1; y = Integer.toString(flippedY); yExt[1] = yFlip[0]; } parsed.put("x", x); parsed.put("y", y); parsed.put("z", z); String layerNameAndSRS = params[2]; String[] lsf = ServletUtils.URLDecode(layerNameAndSRS, request.getCharacterEncoding()).split("@"); parsed.put("layerId", lsf[0]); if (lsf.length >= 3) { parsed.put("gridSetId", lsf[1]); parsed.put("format", lsf[2]); } parsed.put("fileExtension", yExt[1]); return Optional.of(parsed); }

Target:
public static Optional<Map<String, String>> splitParams(HttpServletRequest request) { String pathInfo = request.getPathInfo(); pathInfo = pathInfo.substring(pathInfo.indexOf(TMSDocumentFactory.TILEMAPSERVICE_LEADINGPATH)); String[] params = pathInfo.split("/"); int paramsLength = params.length; Map<String, String> parsed = new HashMap<>(); if (params.length < 4) { return Optional.empty(); } String[] yExt = params[paramsLength - 1].split("\\."); parsed.put("x", params[paramsLength - 2]); parsed.put("y", yExt[0]); parsed.put("z", params[paramsLength - 3]); String layerNameAndSRS = params[2]; String[] lsf = ServletUtils.URLDecode(layerNameAndSRS, request.getCharacterEncoding()).split("@"); parsed.put("layerId", lsf[0]); if (lsf.length >= 3) { parsed.put("gridSetId", lsf[1]); parsed.put("format", lsf[2]); } parsed.put("fileExtension", yExt[1]); return Optional.of(parsed); }
Source:
public void doPost(HttpServletRequest req, HttpServletResponse resp) { try { AutomatedAction action = new AutomatedActionFactory().getAction(req, resp); String url = HttpRequestHelper.getRequestedUrl(req); if (!url.startsWith("/worker/")) { Map<String, String[]> params = HttpRequestHelper.getParameterMap(req); LogMessageGenerator logGenerator = new LogMessageGenerator(); log.info(logGenerator.generateBasicActivityLogMessage(url, params, action.getActionMessage(), null)); } action.execute(); } catch (Throwable t) { String requestUrl = req.getRequestURL().toString(); String requestParams = HttpRequestHelper.printRequestParameters(req); log.severe("Exception occured while performing " + requestUrl + "|||" + requestParams + "|||" + TeammatesException.toStringWithStackTrace(t)); throw t; } }

Target:
public void doPost(HttpServletRequest req, HttpServletResponse resp) { try { AutomatedAction action = new AutomatedActionFactory().getAction(req, resp); String url = HttpRequestHelper.getRequestedUrl(req); if (!url.startsWith("/worker/")) { Map<String, String[]> params = HttpRequestHelper.getParameterMap(req); LogMessageGenerator logGenerator = new LogMessageGenerator(); log.info(logGenerator.generateBasicActivityLogMessage(url, params, action.getActionMessage(), null)); } action.execute(); } catch (Throwable t) { String requestUrl = req.getRequestURL().toString(); String requestParams = HttpRequestHelper.printRequestParameters(req); log.severe("Exception occured while performing " + requestUrl + "|||" + requestParams + "|||" + TeammatesException.toStringWithStackTrace(t)); resp.setStatus(500); } }
Source:
public static Image getUnscaledPortraitImage(String category, String name) { if (category == null || name == null || category.equals(Crew.PORTRAIT_NONE)) { return getDefaultPortrait(); } initializePortraits(); if (portraitDirectory == null) { return getDefaultPortrait(); } try { if (category.equals(Crew.ROOT_PORTRAIT)) { category = ""; } if (name.equals(Crew.PORTRAIT_NONE)) { name = "default.gif"; } Image image = (Image) portraitDirectory.getItem(category, name); if (image != null) { return image; } } catch (Exception e) { e.printStackTrace(); } LOG.error(PortraitManager.class, "Could not load portrait image! Category: " + category + "; Name: " + name); return getDefaultPortrait(); }

Target:
public static Image getUnscaledPortraitImage(String category, String name) { if ((category == null) || (name == null) || category.equals(Crew.PORTRAIT_NONE)) { return getDefaultPortrait(); } initializePortraits(); if (portraitDirectory == null) { return getDefaultPortrait(); } try { if (category.equals(Crew.ROOT_PORTRAIT)) { category = ""; } if (name.equals(Crew.PORTRAIT_NONE)) { name = "default.gif"; } Image image = (Image) portraitDirectory.getItem(category, name); if (image != null) { return image; } } catch (Exception e) { e.printStackTrace(); } MegaMek.getLogger().error(PortraitManager.class, "Could not load portrait image! Category: " + category + "; Name: " + name); return getDefaultPortrait(); }
Source:
public synchronized void compact() { for (long address : logCache.keySet()) { if (address < startingAddress) { LogData data = logCache.get(address); if (data != null) logSizeQuota.release (data.getSizeEstimate ()); logCache.remove(address); } } for (long address : trimmed) { LogData data = logCache.get(address); if (data != null) logSizeQuota.release (data.getSizeEstimate ()); logCache.remove(address); } for (long address : trimmed) { if (address < startingAddress) { trimmed.remove(address); } } }

Target:
public synchronized void compact() { for (long address : logCache.keySet()) { if (address < startingAddress) { LogData data = logCache.get(address); if (data != null) { logSizeQuota.release(data.getSizeEstimate()); } logCache.remove(address); } } for (long address : trimmed) { LogData data = logCache.get(address); if (data != null) { logSizeQuota.release(data.getSizeEstimate()); } logCache.remove(address); } for (long address : trimmed) { if (address < startingAddress) { trimmed.remove(address); } } }
Source:
private <C extends WriteCommand> Object writeManyRemoteCallback(WriteManyCommandHelper<C , ?, ?> helper,InvocationContext ctx, C command, Object rv) { ConsistentHash ch = checkTopologyId(command).getWriteConsistentHash(); Map<Address, Set<Integer>> backups = backupOwnersOfSegments(ch, ch.getPrimarySegmentsForOwner(rpcManager.getAddress())); if (backups.isEmpty()) { return rv; } boolean isSync = isSynchronous(command); CompletableFuture[] futures = isSync ? new CompletableFuture[backups.size()] : null; int future = 0; for (Entry<Address, Set<Integer>> backup : backups.entrySet()) { C copy = helper.copyForBackup(command, ch, backup.getValue()); copy.setTopologyId(command.getTopologyId()); Address backupOwner = backup.getKey(); if (isSync) { MapResponseCollector collector = new MapResponseCollector(false, 1);futures[future++] = rpcManager.invokeCommand(backupOwner, copy, collector, rpcManager.getSyncRpcOptions()) .toCompletableFuture(); } else { rpcManager.sendTo(backupOwner, copy, DeliverOrder.PER_SENDER); } } return isSync ? asyncValue(CompletableFuture.allOf(futures).thenApply(nil -> rv)) : rv; }

Target:
private <C extends WriteCommand> Object writeManyRemoteCallback(WriteManyCommandHelper<C , ?, ?> helper,InvocationContext ctx, C command, Object rv) { ConsistentHash ch = checkTopologyId(command).getWriteConsistentHash(); Map<Address, Set<Integer>> backups = backupOwnersOfSegments(ch, ch.getPrimarySegmentsForOwner(rpcManager.getAddress())); if (backups.isEmpty()) { return rv; } boolean isSync = isSynchronous(command); CompletableFuture[] futures = isSync ? new CompletableFuture[backups.size()] : null; int future = 0; for (Entry<Address, Set<Integer>> backup : backups.entrySet()) { C copy = helper.copyForBackup(command, ch, backup.getValue()); copy.setTopologyId(command.getTopologyId()); Address backupOwner = backup.getKey(); if (isSync) { futures[future++] = rpcManager .invokeCommand(backupOwner, copy, SingleResponseCollector.validOnly(), rpcManager.getSyncRpcOptions()) .toCompletableFuture(); } else { rpcManager.sendTo(backupOwner, copy, DeliverOrder.PER_SENDER); } } return isSync ? asyncValue(CompletableFuture.allOf(futures).thenApply(nil -> rv)) : rv; }
Source:
public List<ArtifactEntry> findByCoordinates(String storageId, String repositoryId, Map<String, String> coordinates, int skip, int limit, String orderBy, boolean strict) { if (coordinates == null || coordinates.keySet().isEmpty()) { return findAll().orElse(Collections.EMPTY_LIST); } coordinates = coordinates.entrySet() .stream() .filter(e -> e.getValue() != null) .collect(Collectors.toMap(Map.Entry::getKey, e -> e.getValue() == null ? null : e.getValue().toLowerCase())); String sQuery = buildCoordinatesQuery(storageId, repositoryId, coordinates, skip, limit, orderBy, strict); OSQLSynchQuery<ArtifactEntry> oQuery = new OSQLSynchQuery<>(sQuery); Map<String, Object> parameterMap = new HashMap<>(coordinates); if (storageId != null && !storageId.trim().isEmpty()){ parameterMap.put("storageId", storageId); } if (repositoryId != null && !repositoryId.trim().isEmpty()){ parameterMap.put("repositoryId", repositoryId); } List<ArtifactEntry> entries = getDelegate().command(oQuery).execute(parameterMap); return entries; }

Target:
public List<ArtifactEntry> findByCoordinates(String storageId, String repositoryId, Map<String, String> coordinates, int skip, int limit, String orderBy, boolean strict) { if (coordinates == null || coordinates.keySet().isEmpty()) { return findAll().orElse(Collections.EMPTY_LIST); } coordinates = prepareParameterMap(coordinates, true); String sQuery = buildCoordinatesQuery(storageId, repositoryId, coordinates.keySet(), skip, limit, orderBy, strict); OSQLSynchQuery<ArtifactEntry> oQuery = new OSQLSynchQuery<>(sQuery); Map<String, Object> parameterMap = new HashMap<>(coordinates); if (storageId != null && !storageId.trim().isEmpty()){ parameterMap.put("storageId", storageId); } if (repositoryId != null && !repositoryId.trim().isEmpty()){ parameterMap.put("repositoryId", repositoryId); } List<ArtifactEntry> entries = getDelegate().command(oQuery).execute(parameterMap); return entries; }
Source:
private char getRandomCharacter() { int randomCharPosition = random.nextInt(TEXT.length()); return TEXT.charAt(randomCharPosition); }

Target:
private char getRandomCharacter() { int randomPosition = RANDOM.nextInt(CHARACTERS.length()); return CHARACTERS.charAt(randomPosition); }
Source:
@Test public void requestConverterFactoryNoMatchThrows() { Type type = String.class; Annotation[] annotations = new Annotation[0]; NonMatchingConverterFactory nonMatchingFactory = new NonMatchingConverterFactory(); Retrofit retrofit = new Retrofit.Builder() .baseUrl("<LINK_0>") .addConverterFactory(nonMatchingFactory) .build(); try { retrofit.requestBodyConverter(type, annotations); } catch (IllegalArgumentException e) { assertThat(e).hasMessage("" + "Could not locate RequestBody converter for class java.lang.String.\n" + " Tried:\n" + " * retrofit2.BuiltInConverters\n" + " * retrofit2.helpers.NonMatchingConverterFactory"); } assertThat(nonMatchingFactory.called).isTrue(); }

Target:
@Test public void requestConverterFactoryNoMatchThrows() { Type type = String.class; Annotation[] annotations = new Annotation[0]; NonMatchingConverterFactory nonMatchingFactory = new NonMatchingConverterFactory(); Retrofit retrofit = new Retrofit.Builder() .baseUrl("<LINK_0>") .addConverterFactory(nonMatchingFactory) .build(); try { retrofit.requestBodyConverter(type, annotations); fail(); } catch (IllegalArgumentException e) { assertThat(e).hasMessage("" + "Could not locate RequestBody converter for class java.lang.String.\n" + " Tried:\n" + " * retrofit2.BuiltInConverters\n" + " * retrofit2.helpers.NonMatchingConverterFactory"); } assertThat(nonMatchingFactory.called).isTrue(); }
Source:
public void setUp() { jenkins.CLI.get().setEnabled(true); Set<String> agentProtocols = new HashSet<>(j.jenkins.getAgentProtocols()); agentProtocols.add(ExtensionList.lookupSingleton(CliProtocol2.class).getName()); j.jenkins.setAgentProtocols(agentProtocols); }

Target:
public void setUp() { Set<String> agentProtocols = new HashSet<>(j.jenkins.getAgentProtocols()); agentProtocols.add(ExtensionList.lookupSingleton(CliProtocol2.class).getName()); j.jenkins.setAgentProtocols(agentProtocols); }
Source:
public <T extends TopLevelItem> T create(Class<T> type, String name) { visit("newJob"); fillIn("name", name); findCaption(type, new Finder<WebElement>() { @Override protected WebElement find(String caption) { try { String normalizedCaption = caption.replace('.', '_'); return outer.find(by.css("li." + normalizedCaption)); } catch (NoSuchElementException e) { return outer.find(by.radioButton(caption)); } } }).click(); waitTillEnabledAndClick("OK", 10, TimeUnit.SECONDS); waitFor(by.name("config")); final T j = get(type, name); waitFor().withTimeout(3, TimeUnit.SECONDS) .until(new Callable<Object>() { @Override public Object call() throws Exception { try { j.getJson(); return true; } catch (Exception e) { return false; } } }); return j; }

Target:
public <T extends TopLevelItem> T create(Class<T> type, String name) { visit("newJob"); fillIn("name", name); findCaption(type, new Finder<WebElement>() { @Override protected WebElement find(String caption) { try { String normalizedCaption = caption.replace('.', '_'); return outer.find(by.css("li." + normalizedCaption)); } catch (NoSuchElementException e) { return outer.find(by.radioButton(caption)); } } }).click(); clickButton("OK"); waitFor(by.name("config"), 10); final T j = get(type, name); waitFor().withTimeout(3, TimeUnit.SECONDS) .until(new Callable<Object>() { @Override public Object call() throws Exception { try { j.getJson(); return true; } catch (Exception e) { return false; } } }); return j; }
Source:
long useService(int value) { long result = serviceAmbassador.doRemoteFunction(value); System.out.println(result); return result; }

Target:
long useService(int value) { long result = serviceAmbassador.doRemoteFunction(value); LOGGER.info("Service result: " + result); return result; }
Source:
public Builder keyValueSeparator(char keyValueSeparator) { if (keyValueSeparator == 0) throw new IllegalArgumentException("keyValueSeparator == 0"); if (keyValueSeparator == entrySeparator) { throw new IllegalArgumentException("keyValueSeparator == entrySeparator"); } this.keyValueSeparator = keyValueSeparator; return this; }

Target:
public Builder keyValueSeparator(char keyValueSeparator) { if (keyValueSeparator == 0) throw new IllegalArgumentException("keyValueSeparator == 0"); this.keyValueSeparator = keyValueSeparator; return this; }
Source:
public void validateWebAnnotation(Annotation webAnnotation) throws ParamValidationException { if (webAnnotation.getCanonical() != null) { try { URI cannonicalUri = URI.create(webAnnotation.getCanonical()); if (!cannonicalUri.isAbsolute()) throw new ParamValidationException("The canonical URI is not absolute:", I18nConstants.ANNOTATION_VALIDATION, new String[]{WebAnnotationFields.CANONICAL, webAnnotation.getCanonical()}); } catch (IllegalArgumentException e) { throw new ParamValidationException("Error when validating canonical URI:", I18nConstants.ANNOTATION_VALIDATION, new String[]{WebAnnotationFields.CANONICAL, webAnnotation.getCanonical()}, e); } } if (webAnnotation.getVia() != null) { if (webAnnotation.getVia() instanceof String[]) { for (String via : webAnnotation.getVia()) { if(!(UriUtils.isUrl(via))) throw new ParamValidationException("This is not a valid URL:", I18nConstants.ANNOTATION_VALIDATION, new String[]{WebAnnotationFields.VIA, via}); } } } switch (webAnnotation.getMotivationType()) { case LINKING: if (webAnnotation.getTarget() != null) { if (webAnnotation.getTarget().getValue() != null) validateResource(webAnnotation.getTarget().getValue()); if (webAnnotation.getTarget().getValues() != null) for (String url : webAnnotation.getTarget().getValues()) { validateResource(url); } } break; case TAGGING: validateTag(webAnnotation); break; case TRANSCRIBING: if (webAnnotation != null && webAnnotation.getBody() != null && webAnnotation.getBody().getRights() != null) validateRights(webAnnotation.getBody().getRights()); break; default: break; } }

Target:
public void validateWebAnnotation(Annotation webAnnotation) throws ParamValidationException { if (webAnnotation.getCanonical() != null) { try { URI cannonicalUri = URI.create(webAnnotation.getCanonical()); if (!cannonicalUri.isAbsolute()) throw new ParamValidationException("The canonical URI is not absolute:", I18nConstants.ANNOTATION_VALIDATION, new String[]{WebAnnotationFields.CANONICAL, webAnnotation.getCanonical()}); } catch (IllegalArgumentException e) { throw new ParamValidationException("Error when validating canonical URI:", I18nConstants.ANNOTATION_VALIDATION, new String[]{WebAnnotationFields.CANONICAL, webAnnotation.getCanonical()}, e); } } if (webAnnotation.getVia() != null) { if (webAnnotation.getVia() instanceof String[]) { for (String via : webAnnotation.getVia()) { if(!(UriUtils.isUrl(via))) throw new ParamValidationException("This is not a valid URL:", I18nConstants.ANNOTATION_VALIDATION, new String[]{WebAnnotationFields.VIA, via}); } } } switch (webAnnotation.getMotivationType()) { case LINKING: if (webAnnotation.getTarget() != null) { if (webAnnotation.getTarget().getValue() != null) validateResource(webAnnotation.getTarget().getValue()); if (webAnnotation.getTarget().getValues() != null) for (String url : webAnnotation.getTarget().getValues()) { validateResource(url); } } break; case TAGGING: validateTag(webAnnotation); break; case TRANSCRIBING: validateEdmRights(webAnnotation); break; default: break; } }
Source:
public void testNetworkClientFactory() throws IOException { Properties props = new Properties(); VerifiableProperties vprops = new VerifiableProperties(props); NetworkConfig networkConfig = new NetworkConfig(vprops); NetworkMetrics networkMetrics = new NetworkMetrics(new MetricRegistry()); NetworkClientFactory networkClientFactory = new NetworkClientFactory(networkMetrics, networkConfig, null, MAX_PORTS_PLAIN_TEXT, MAX_PORTS_SSL, CHECKOUT_TIMEOUT_MS, new MockTime()); networkClientFactory.getNetworkClient(); }

Target:
public void testNetworkClientFactory() throws IOException { Properties props = new Properties(); VerifiableProperties vprops = new VerifiableProperties(props); NetworkConfig networkConfig = new NetworkConfig(vprops); NetworkMetrics networkMetrics = new NetworkMetrics(new MetricRegistry()); NetworkClientFactory networkClientFactory = new NetworkClientFactory(networkMetrics, networkConfig, null, MAX_PORTS_PLAIN_TEXT, MAX_PORTS_SSL, CHECKOUT_TIMEOUT_MS, new MockTime()); Assert.assertNotNull("NetworkClient returned should be non-null", networkClientFactory.getNetworkClient()); }
Source:
private void displaySourceFiles(DsfSession session, IDMContext dmcontext) { if (session.getExecutor().isShutdown()) { return; } IContainerDMContext containerDMContext = DMContexts.getAncestorOfType(dmcontext, IContainerDMContext.class); if (containerDMContext == null || Objects.equals(containerDMContext, this.dmcontext)) { return; } this.dmcontext = containerDMContext; session.getExecutor().submit(new DsfRunnable() { @Override public void run() { DsfServicesTracker tracker = new DsfServicesTracker(GdbUIPlugin.getBundleContext(), session.getId()); IDebugSourceFiles srcService = tracker.getService(IDebugSourceFiles.class); tracker.dispose(); if (srcService == null) { return; } srcService.getSources(containerDMContext, new DataRequestMonitor<IDebugSourceFileInfo[]>(session.getExecutor(), null) { @Override protected void handleSuccess() { IDebugSourceFileInfo[] srcFileInfo = getData(); populateTreeJob.setSrcFileInfo(srcFileInfo); if (populateTreeJob.getState() == Job.RUNNING) populateTreeJob.cancel(); populateTreeJob.schedule(); } @Override protected void handleError() { } }); } }); }

Target:
private void displaySourceFiles(DsfSession session, IDMContext dmcontext) { if (session.getExecutor().isShutdown()) { return; } IContainerDMContext containerDMContext = DMContexts.getAncestorOfType(dmcontext, IContainerDMContext.class); if (containerDMContext == null || Objects.equals(containerDMContext, this.dmcontext)) { return; } this.dmcontext = containerDMContext; session.getExecutor().submit(new DsfRunnable() { @Override public void run() { DsfServicesTracker tracker = new DsfServicesTracker(GdbUIPlugin.getBundleContext(), session.getId()); IDebugSourceFiles srcService = tracker.getService(IDebugSourceFiles.class); tracker.dispose(); if (srcService == null) { return; } srcService.getSources(containerDMContext, new DataRequestMonitor<IDebugSourceFileInfo[]>(session.getExecutor(), null) { @Override protected void handleSuccess() { IDebugSourceFileInfo[] srcFileInfo = getData(); PopulateTreeJob populateTreeJob = new PopulateTreeJob(srcFileInfo); CheckFileExistenceJob checkFileExistenceJob = new CheckFileExistenceJob(); populateTreeJob.addJobChangeListener(new JobChangeAdapter() { @Override public void done(IJobChangeEvent event) { debugTree = (DebugTree<String>) populateTreeJob.getTree(); Display.getDefault().asyncExec(new Runnable() { @Override public void run() { if (!viewer.getControl().isDisposed()) { debugTree.toString(); viewer.setInput(debugTree); } } }); if (checkFileExistenceJob.getState() == Job.RUNNING) checkFileExistenceJob.cancel(); checkFileExistenceJob.schedule(); } }); checkFileExistenceJob.addJobChangeListener(new JobChangeAdapter() { @Override public void done(IJobChangeEvent event) { Display.getDefault().asyncExec(new Runnable() { @Override public void run() { if (!viewer.getControl().isDisposed()) { viewer.refresh(); } } }); } }); if (populateTreeJob.getState() == Job.RUNNING) populateTreeJob.cancel(); if (checkFileExistenceJob.getState() == Job.RUNNING) checkFileExistenceJob.cancel(); populateTreeJob.schedule(); } @Override protected void handleError() { } }); } }); }
Source:
public GeneratedEntityMergeException(Object entity) { super("Detected attempt to merge generated entity " + entity + ". Merging generated entities is not allowed"); }

Target:
public GeneratedEntityMergeException(Object entity) { super("Detected attempt to merge a generated entity " + entity + ". Merging of generated entities is not allowed"); }