auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public void perform(GraphRewrite event, EvaluationContext context, JspSourceFileModel sourceFile) { TypeReferenceService typeReferenceService = new TypeReferenceService(event.getGraphContext()); try { sourceFile.setPackageName(""); JavaClassService javaClassService = new JavaClassService(event.getGraphContext()); JavaClassModel classModel = javaClassService.create(); classModel.setPackageName(""); classModel.setSimpleName(sourceFile.getFileName()); classModel.setQualifiedName(sourceFile.getFileName()); classModel.setExtends(javaClassService.getOrCreatePhantom("javax.servlet.http.HttpServlet")); sourceFile.addJavaClass(classModel); Iterable<ClassReference> references = getClassReferences(typeReferenceService, sourceFile); for (ClassReference reference : references) { JavaTypeReferenceModel typeReference = typeReferenceService.createTypeReference(sourceFile, reference.getLocation(), reference.getResolutionStatus(), reference.getLineNumber(), reference.getColumn(), reference.getLength(), reference.getQualifiedName(), reference.getLine()); } } catch (Exception e) { ClassificationService classificationService = new ClassificationService(event.getGraphContext()); classificationService.attachClassification(context, sourceFile, UNPARSEABLE_JSP_CLASSIFICATION, UNPARSEABLE_JSP_DESCRIPTION); if (! Boolean.TRUE.equals(sourceFile.isIgnoreParseError())) sourceFile.setParseError("JSP file could not be parsed: " + e.getMessage()); } }

Target:
public void perform(GraphRewrite event, EvaluationContext context, JspSourceFileModel sourceFile) { TypeReferenceService typeReferenceService = new TypeReferenceService(event.getGraphContext()); try { sourceFile.setPackageName(""); JavaClassService javaClassService = new JavaClassService(event.getGraphContext()); JavaClassModel classModel = javaClassService.create(); classModel.setPackageName(""); classModel.setSimpleName(sourceFile.getFileName()); classModel.setQualifiedName(sourceFile.getFileName()); classModel.setExtends(javaClassService.getOrCreatePhantom("javax.servlet.http.HttpServlet")); sourceFile.addJavaClass(classModel); Iterable<ClassReference> references = getClassReferences(typeReferenceService, sourceFile); for (ClassReference reference : references) { JavaTypeReferenceModel typeReference = typeReferenceService.createTypeReference(sourceFile, reference.getLocation(), reference.getResolutionStatus(), reference.getLineNumber(), reference.getColumn(), reference.getLength(), reference.getQualifiedName(), reference.getLine()); } } catch (Exception e) { ClassificationService classificationService = new ClassificationService(event.getGraphContext()); classificationService.attachClassification(context, sourceFile, UNPARSEABLE_JSP_CLASSIFICATION, UNPARSEABLE_JSP_DESCRIPTION); sourceFile.setParseError("JSP file could not be parsed: " + e.getMessage()); } }
Source:
private static void createBucket(String volumeName, String bucketName) throws IOException { OmBucketInfo bucketInfo = OmBucketInfo.newBuilder() .setVolumeName(volumeName) .setBucketName(bucketName) .build(); String bucketKey = metadataManager.getBucketKey(volumeName, bucketName); metadataManager.getBucketTable().put(bucketKey, bucketInfo); metadataManager.getBucketTable().addCacheEntry(new CacheKey<>(bucketKey), new CacheValue<>(Optional.of(bucketInfo), 1L)); }

Target:
private static void createBucket(String volumeName, String bucketName) throws IOException { OmBucketInfo bucketInfo = OmBucketInfo.newBuilder() .setVolumeName(volumeName) .setBucketName(bucketName) .build(); TestOMRequestUtils.addBucketToOM(metadataManager, bucketInfo); }
Source:
private Result executeCmd(String cmd) throws IOException, InterruptedException { PrintStream stdout = listener.getLogger(); PrintStream stderr = listener.getLogger(); KeyMaterial registryKey = null; try { registryKey = registry.materialize(build); EnvVars env = new EnvVars(); env.putAll(build.getEnvironment(listener)); env.putAll(registryKey.env()); boolean result = launcher.launch() .envs(env) .pwd(build.getWorkspace()) .stdout(stdout) .stderr(stderr) .cmdAsSingleString(cmd) .start().join() == 0; String stdoutStr = stdout.toString(); return new Result(result, stdoutStr); } finally { if (registryKey != null) { registryKey.close(); } } }

Target:
private Result executeCmd(String cmd) throws IOException, InterruptedException { ByteArrayOutputStream baos = new ByteArrayOutputStream(); TeeOutputStream stdout = new TeeOutputStream(listener.getLogger(), baos); PrintStream stderr = listener.getLogger(); KeyMaterial registryKey = getRegistry().newKeyMaterialFactory(build).materialize(); KeyMaterial serverKey = server == null ? null : server.newKeyMaterialFactory(build).materialize(); logger.log(Level.FINER, "Executing: {0}", cmd); try { EnvVars env = new EnvVars(); env.putAll(build.getEnvironment(listener)); env.putAll(registryKey.env()); if (serverKey != null) { env.putAll(serverKey.env()); } boolean result = launcher.launch() .envs(env) .pwd(build.getWorkspace()) .stdout(stdout) .stderr(stderr) .cmdAsSingleString(cmd) .start().join() == 0; String stdoutStr = null; try { Computer computer = Computer.currentComputer(); if (computer != null) { Charset charset = computer.getDefaultCharset(); if (charset != null) { baos.flush(); stdoutStr = baos.toString(charset.name()); } } } catch (UnsupportedEncodingException e) { logger.log(Level.FINE, "Unable to get stdout from launched command: {}", e); } return new Result(result, stdoutStr); } finally { registryKey.close(); if (serverKey != null) { serverKey.close(); } } }
Source:
public MetadataSerializer() { this(null); }

Target:
public MetadataSerializer() { super(CloudBlobMetadata.class); }
Source:
protected int getPriorityFromTaintFrame(TaintFrame fact, int offset) throws DataflowAnalysisException { Taint mvcResultTaint = fact.getStackValue(offset); if (!mvcResultTaint.isSafe()) { Taint parameterTaint = fact.getStackValue(0); if ( !parameterTaint.isSafe() || (parameterTaint.getConstantValue() != null && parameterTaint.getConstantValue().toLowerCase().equals(VULNERABLE_CONTENT_TYPE)) ) { return getPriority(mvcResultTaint); } } return Priorities.IGNORE_PRIORITY; }

Target:
protected int getPriorityFromTaintFrame(TaintFrame fact, int offset) throws DataflowAnalysisException { Taint mvcResultTaint = fact.getStackValue(offset); if (!mvcResultTaint.isSafe()) { Taint parameterTaint = fact.getStackValue(0); if ( !parameterTaint.isSafe() || VULNERABLE_CONTENT_TYPE.equalsIgnoreCase(parameterTaint.getConstantValue())) { return getPriority(mvcResultTaint); } } return Priorities.IGNORE_PRIORITY; }
Source:
protected void setFullScreen(boolean fullscreen) { try { if (youTubePlayer != null) { youTubePlayer.setFullscreen(fullscreen); } } catch (IllegalStateException e) { logger.error(e); releaseYoutubePlayer(); initializeYoutubePlayer(); } }

Target:
protected void setFullScreen(boolean fullscreen) { if (youTubePlayer != null) { try { youTubePlayer.setFullscreen(fullscreen); } catch (IllegalStateException e) { logger.error(e); releaseYoutubePlayer(); initializeYoutubePlayer(); } } }
Source:
public Object[][] getArraysAndLists() { return new Object[][]{ { new Object[][]{ {1, 2}, {3, 4} }, Arrays.asList( Arrays.asList(1, 2), Arrays.asList(3, 4) ) }, { new Object[][]{ {1} }, Arrays.asList( Arrays.asList(1) ) }, { new Object[][]{ {1, 2, 3}, {4, 5, 6} }, Arrays.asList( Arrays.asList(1, 2, 3), Arrays.asList(4, 5, 6) ) }, { new Object[][]{ {1}, {2}, {3}, {4} }, Arrays.asList( Arrays.asList(1), Arrays.asList(2), Arrays.asList(3), Arrays.asList(4) ) } }; }

Target:
public Object[][] getArraysAndLists() { return new Object[][]{ { new Object[][]{ {1, 2}, {3, 4} }, Arrays.asList( Arrays.asList(1, 2), Arrays.asList(3, 4) ) }, { new Object[][]{ {1} }, Arrays.asList( Arrays.asList(1) ) }, { new Object[][]{ {1, 2, 3}, {4, 5, 6} }, Arrays.asList( Arrays.asList(1, 2, 3), Arrays.asList(4, 5, 6) ) }, { new Object[][]{ {1}, {2}, {3}, {4} }, Arrays.asList( Arrays.asList(1), Arrays.asList(2), Arrays.asList(3), Arrays.asList(4) ) }, }; }
Source:
public void initialize(URI uri, Configuration conf) throws IOException { super.initialize(uri, conf); try { this.vfs = tryInitializeMountingViewFs(uri, conf); } catch (IOException ioe) { LOGGER.debug( "Mount tree initialization failed with the reason => {}. Falling" + " back to regular DFS initialization. Please" + " re-initialize" + " the fs after updating mount point.", ioe.getMessage()); super.initialize(uri, conf); return; } setConf(conf); defaultDFS = (DistributedFileSystem) this.vfs.getFallbackFileSystem(); Preconditions .checkNotNull("In ViewHDFS fallback link is mandatory.", defaultDFS); dfs = defaultDFS.dfs; }

Target:
public void initialize(URI uri, Configuration conf) throws IOException { super.initialize(uri, conf); try { this.vfs = tryInitializeMountingViewFs(uri, conf); } catch (IOException ioe) { LOGGER.debug(new StringBuilder("Mount tree initialization failed with ") .append("the reason => {}. Falling back to regular DFS") .append(" initialization. Please re-initialize the fs after updating") .append(" mount point.").toString(), ioe.getMessage()); super.initDFSClient(uri, conf); super.setWorkingDirectory(super.getHomeDirectory()); return; } setConf(conf); defaultDFS = (DistributedFileSystem) this.vfs.getFallbackFileSystem(); dfs = (defaultDFS != null) ? defaultDFS.dfs : null; super.setWorkingDirectory(this.vfs.getHomeDirectory()); }
Source:
public String getOption() { final Function<Path, FileTime> createTimeComp = path -> { try { return Files.readAttributes(path, BasicFileAttributes.class).creationTime(); } catch (IOException e) { throw new RuntimeException(UNABLE_TO_DETERMINE_EXAM_DIR_ERROR, e); } }; try (final Stream<Path> dirContents = Files.list(UNPACK_DIRECTORY.toPath())) { return dirContents .max(Comparator.comparing(createTimeComp)) .map(Path::toAbsolutePath) .map(Path::toString) .map( s -> { System.err.println(s); return s; }) .map(s -> StringUtils.replace(super.getOption(), KARAF_HOME, s)) .map(s -> s.replace('\\', '/')) .map(s -> s.replace("/bin/..", "/")) .map(s -> s.replace("c:", "C:")) .map(s -> s.replace("C:", "/C:")) .map(s -> s + "/") .orElseGet(super::getOption); } catch (IOException e) { throw new RuntimeException(UNABLE_TO_DETERMINE_EXAM_DIR_ERROR, e); } }

Target:
public String getOption() { final Function<Path, FileTime> createTimeComp = path -> { try { return Files.readAttributes(path, BasicFileAttributes.class).creationTime(); } catch (IOException e) { throw new RuntimeException(UNABLE_TO_DETERMINE_EXAM_DIR_ERROR, e); } }; try (final Stream<Path> dirContents = Files.list(UNPACK_DIRECTORY.toPath())) { return dirContents .max(Comparator.comparing(createTimeComp)) .map(Path::toAbsolutePath) .map(Path::toString) .map( s -> { LOGGER.error(s); return s; }) .map(s -> StringUtils.replace(super.getOption(), KARAF_HOME, s)) .map(s -> s.replace('\\', '/')) .map(s -> s.replace("/bin/..", "/")) .map(s -> s.replace("c:", "C:")) .map(s -> s.replace("C:", "/C:")) .map(s -> s + "/") .orElseGet(super::getOption); } catch (IOException e) { throw new RuntimeException(UNABLE_TO_DETERMINE_EXAM_DIR_ERROR, e); } }
Source:
public void checkSpecificAccessControl() { String courseId = getNonNullRequestParamValue(Const.ParamsNames.COURSE_ID); CourseAttributes course = logic.getCourse(courseId); StudentAttributes student = null; if (userInfo.isInstructor) { String studentEmail = getNonNullRequestParamValue(Const.ParamsNames.STUDENT_EMAIL); student = logic.getStudentForEmail(courseId, studentEmail); if (student == null) { throw new UnauthorizedAccessException(Const.ErrorMessages.UNAUTHORIZED_ACCESS); } InstructorAttributes instructor = logic.getInstructorForGoogleId(courseId, userInfo.id); gateKeeper.verifyAccessible(instructor, logic.getCourse(courseId), student.section, Const.ParamsNames.INSTRUCTOR_PERMISSION_VIEW_STUDENT_IN_SECTIONS); } else if (userInfo.isStudent) { student = logic.getStudentForGoogleId(courseId, userInfo.id); if (student == null) { throw new UnauthorizedAccessException(Const.ErrorMessages.UNAUTHORIZED_ACCESS); } gateKeeper.verifyAccessible(student, course); } else { Optional<StudentAttributes> studentCheck = getUnregisteredStudent(); if (studentCheck.isPresent()) { student = studentCheck.get(); gateKeeper.verifyAccessible(student, course); } else { throw new UnauthorizedAccessException(Const.ErrorMessages.UNAUTHORIZED_ACCESS); } } }

Target:
public void checkSpecificAccessControl() { String courseId = getNonNullRequestParamValue(Const.ParamsNames.COURSE_ID); CourseAttributes course = logic.getCourse(courseId); StudentAttributes student = null; String studentEmail = getRequestParamValue(Const.ParamsNames.STUDENT_EMAIL); String regKey = getRequestParamValue(Const.ParamsNames.REGKEY); if (studentEmail != null) { student = logic.getStudentForEmail(courseId, studentEmail); if (student == null || !userInfo.isInstructor) { throw new UnauthorizedAccessException(UNAUTHORIZED_ACCESS); } InstructorAttributes instructor = logic.getInstructorForGoogleId(courseId, userInfo.id); gateKeeper.verifyAccessible(instructor, logic.getCourse(courseId), student.section, Const.ParamsNames.INSTRUCTOR_PERMISSION_VIEW_STUDENT_IN_SECTIONS); } else if (regKey != null) { getUnregisteredStudent().orElseThrow(() -> new UnauthorizedAccessException(UNAUTHORIZED_ACCESS)); } else { if (!userInfo.isStudent) { throw new UnauthorizedAccessException(UNAUTHORIZED_ACCESS); } student = logic.getStudentForGoogleId(courseId, userInfo.id); gateKeeper.verifyAccessible(student, course); } }
Source:
protected List<MethodMatcher> getMethodInvocationMatchers() { return Collections.singletonList( MethodMatcher.create() .typeDefinition(TypeCriteria.is("javax.crypto.Cipher")) .name("getInstance") .withAnyParameters()); }

Target:
protected List<MethodMatcher> getMethodInvocationMatchers() { return Collections.singletonList( MethodMatcher.create() .typeDefinition("javax.crypto.Cipher") .name("getInstance") .withAnyParameters()); }
Source:
private void validate(GetTokensByCodeParams params) { if (Strings.isNullOrEmpty(params.getCode())) { throw new HttpException(ErrorResponseCode.BAD_REQUEST_NO_CODE); } if (Strings.isNullOrEmpty(params.getState())) { throw new HttpException(ErrorResponseCode.BAD_REQUEST_NO_STATE); } try { if (!getStateService().isExpiredObjectPresent(params.getState()) && !getStateService().isExpiredObjectPresent(Utils.decode(params.getState()))) { throw new HttpException(ErrorResponseCode.BAD_REQUEST_STATE_NOT_VALID); } } catch (Exception e) { Log.error(e.getMessage(), e); throw new HttpException(ErrorResponseCode.BAD_REQUEST_STATE_NOT_VALID); } }

Target:
private void validate(GetTokensByCodeParams params) { if (Strings.isNullOrEmpty(params.getCode())) { throw new HttpException(ErrorResponseCode.BAD_REQUEST_NO_CODE); } if (Strings.isNullOrEmpty(params.getState())) { throw new HttpException(ErrorResponseCode.BAD_REQUEST_NO_STATE); } try { if (!getStateService().isExpiredObjectPresent(getStateService().encodeExpiredObject(params.getState(), ExpiredObjectType.STATE))) { throw new HttpException(ErrorResponseCode.BAD_REQUEST_STATE_NOT_VALID); } } catch (Exception e) { Log.error(e.getMessage(), e); throw new HttpException(ErrorResponseCode.BAD_REQUEST_STATE_NOT_VALID); } }
Source:
public void run() { while(this.interval > 0 && Cloud.getInstance().getStatus() == Cloud.Status.DBX_CONNECTED) { try { Thread.sleep(this.interval * 1000 * 60); SwingUtilities.invokeLater(new Runnable(){ @Override public void run(){ new DbxFileActions().saveProgress(DbxUtil.getDbxClient(), drtc, false); } }); } catch (InterruptedException ex) { break; } } }

Target:
public void run() { while(this.interval > 0 && Cloud.getInstance().getStatus() == Cloud.Status.DBX_CONNECTED) { try { Thread.sleep(this.interval * 1000 * 60); SwingUtilities.invokeLater(new Runnable(){ @Override public void run(){ new DbxFileActions().saveProgress(DbxUtil.getDbxClient(), drtc, false); } }); } catch (InterruptedException ex) { LOGGER.log("You change the setting of remote auto sync."); break; } } }
Source:
public void setEnableScheduledScanJobs(boolean enabled) { this.mScheduledScanJobsEnabled = enabled; }

Target:
public void setEnableScheduledScanJobs(boolean enabled) { if (isAnyConsumerBound()) { LogManager.e(TAG, "ScanJob may not be configured because a consumer is" + " already bound."); throw new IllegalStateException("Method must be called before calling bind()"); } if (enabled && android.os.Build.VERSION.SDK_INT < Build.VERSION_CODES.LOLLIPOP) { LogManager.e(TAG, "ScanJob may not be configured because JobScheduler is not" + " availble prior to Android 5.0"); return; } mScheduledScanJobsEnabled = enabled; }
Source:
private String createActiveBondTooltipMessage(Bond bond, HostInterfaceLineModel lineModel) { List<String> bondProperties = new LinkedList<>(); String adPartnerMac = Objects.toString(bond.getAdPartnerMac(), ""); bondProperties.add(messages.bondAdPartnerMac(adPartnerMac)); String adAggregatorId = Objects.toString(bond.getAdAggregatorId(), ""); bondProperties.add(messages.bondAdAggregatorId(adAggregatorId)); for (HostInterface nic : lineModel.getInterfaces()) { String nicName = nic.getName(); String nicAggregatorId = Objects.toString(nic.getInterface().getAdAggregatorId()); bondProperties.add(messages.bondSlaveAdAggregatorId(nicName, nicAggregatorId)); } return StringUtils.join(bondProperties, "\n"); }

Target:
private String createActiveBondTooltipMessage(Bond bond, HostInterfaceLineModel lineModel) { List<String> bondProperties = new ArrayList<>(); String adPartnerMac = Objects.toString(bond.getAdPartnerMac(), ""); bondProperties.add(messages.bondAdPartnerMac(adPartnerMac)); String adAggregatorId = Objects.toString(bond.getAdAggregatorId(), ""); bondProperties.add(messages.bondAdAggregatorId(adAggregatorId)); for (HostInterface nic : lineModel.getInterfaces()) { String nicName = nic.getName(); String nicAggregatorId = Objects.toString(nic.getInterface().getAdAggregatorId()); bondProperties.add(messages.bondSlaveAdAggregatorId(nicName, nicAggregatorId)); } return StringUtils.join(bondProperties, "\n"); }
Source:
public String reportProblemForAll() { for (Task task : this.steps) { this.currentStep = task; this.myDav.uploadFromHome(this.currentStep.getProcess()); this.problem.setId(getIdForCorrection(this.problemTask)); serviceManager.getWorkflowService().setProblem(getProblem()); try { setCurrentStep(serviceManager.getWorkflowService().reportProblem(this.currentStep)); saveStep(); } catch (DAOException | DataException e) { Helper.setFehlerMeldung("correctionReportProblem"); logger.error(e.getMessage(), e); } } setProblem(serviceManager.getWorkflowService().getProblem()); this.problemTask = ""; AktuelleSchritteForm asf = (AktuelleSchritteForm) Helper.getManagedBeanValue("#{AktuelleSchritteForm}"); return asf.filterAll(); }

Target:
public String reportProblemForAll() { for (Task task : this.steps) { this.currentStep = task; this.myDav.uploadFromHome(this.currentStep.getProcess()); this.problem.setId(getIdForCorrection(this.problemTask)); serviceManager.getWorkflowControllerService().setProblem(getProblem()); try { setCurrentStep(serviceManager.getWorkflowControllerService().reportProblem(this.currentStep)); saveStep(); } catch (DAOException | DataException e) { Helper.setErrorMessage("correctionReportProblem", logger, e); } } setProblem(serviceManager.getWorkflowControllerService().getProblem()); this.problemTask = ""; AktuelleSchritteForm asf = (AktuelleSchritteForm) Helper.getManagedBeanValue("#{AktuelleSchritteForm}"); return asf.filterAll(); }
Source:
public boolean subsumes(final PartitionKey other) { return IntStream.range(0, keys.length).allMatch(i -> keys[i] == null || keys[i].equals(other.keys[i])); }

Target:
public boolean subsumes(final PartitionKey other) { return IntStream.range(0, keys.length).allMatch(i -> keys[i] == null || Objects.equals(keys[i], other.keys[i])); }
Source:
private void addAddress(List<DiscoveryNode> discoveredNodes, EndpointAddress endpointAddress) { Map<String, Object> properties = endpointAddress.getAdditionalProperties(); String ip = endpointAddress.getIp(); InetAddress inetAddress = mapAddress(ip); int port = (this.port > 0) ? this.port : getServicePort(properties); logger.fine("Discovered node: " + ip + " port: " + port); Address address = new Address(inetAddress, port); discoveredNodes.add(new SimpleDiscoveryNode(address, properties)); }

Target:
private void addAddress(List<DiscoveryNode> discoveredNodes, EndpointAddress endpointAddress) { Map<String, Object> properties = endpointAddress.getAdditionalProperties(); String ip = endpointAddress.getIp(); InetAddress inetAddress = mapAddress(ip); int port = (this.port > 0) ? this.port : getServicePort(properties); if (logger.isFineEnabled()) { logger.fine("Discovered node: " + ip + " port: " + port); } Address address = new Address(inetAddress, port); discoveredNodes.add(new SimpleDiscoveryNode(address, properties)); }
Source:
public boolean equals(Object o) { if (this == o) { return true; } if (o == null || getClass() != o.getClass()) { return false; } ErrorResult that = (ErrorResult) o; return err == that.err && Objects.equals(path, that.path); }

Target:
public boolean equals(Object o) { if (this == o) { return true; } if (!(o instanceof ErrorResult)) { return false; } ErrorResult that = (ErrorResult) o; return err == that.err && Objects.equals(path, that.path); }
Source:
public CompletableFuture<Void> visitKeySetCommand(InvocationContext ctx, KeySetCommand command) throws Throwable { return ctx.onReturn((ctx1, command1, rv, throwable) -> { if (throwable != null) throw throwable; CacheSet<K> set = (CacheSet<K>) rv; return CompletableFuture.completedFuture( new AbstractDelegatingKeyCacheSet<K, V>(Caches.getCacheWithFlags(cache, command), set) { @Override public CloseableIterator<K> iterator() { return new CloseableIteratorMapper<>(super.iterator(), e -> processRetVal(e, null)); } @Override public CloseableSpliterator<K> spliterator() { return new IteratorAsSpliterator.Builder<>(iterator()) .setEstimateRemaining(super.spliterator().estimateSize()).setCharacteristics( Spliterator.CONCURRENT | Spliterator.DISTINCT | Spliterator.NONNULL).get(); } }); }); }

Target:
public CompletableFuture<Void> visitKeySetCommand(InvocationContext ctx, KeySetCommand command) throws Throwable { return ctx.onReturn((rCtx, rCommand, rv, throwable) -> { if (throwable != null) throw throwable; CacheSet<K> set = (CacheSet<K>) rv; return CompletableFuture.completedFuture( new AbstractDelegatingKeyCacheSet<K, V>(Caches.getCacheWithFlags(cache, ((KeySetCommand) rCommand)), set) { @Override public CloseableIterator<K> iterator() { return new CloseableIteratorMapper<>(super.iterator(), e -> processRetVal(e, null)); } @Override public CloseableSpliterator<K> spliterator() { return new IteratorAsSpliterator.Builder<>(iterator()) .setEstimateRemaining(super.spliterator().estimateSize()).setCharacteristics( Spliterator.CONCURRENT | Spliterator.DISTINCT | Spliterator.NONNULL).get(); } }); }); }
Source:
public abstract void processBarrier(CheckpointBarrier receivedBarrier, InputChannelInfo channelInfo) throws IOException; public abstract void processCancellationBarrier(CancelCheckpointMarker cancelBarrier) throws IOException; public abstract void processEndOfPartition() throws IOException; public abstract long getLatestCheckpointId(); public long getAlignmentDurationNanos() { if (startOfAlignmentTimestamp <= 0) { return FutureUtils.getOrDefault(latestAlignmentDurationNanos, 0L); } else { return System.nanoTime() - startOfAlignmentTimestamp; } }

Target:
public abstract void processBarrier(CheckpointBarrier receivedBarrier, InputChannelInfo channelInfo) throws IOException; public abstract void processCancellationBarrier(CancelCheckpointMarker cancelBarrier) throws IOException; public abstract void processEndOfPartition() throws IOException; public abstract long getLatestCheckpointId(); public long getAlignmentDurationNanos() { if (isDuringAlignment()) { return System.nanoTime() - startOfAlignmentTimestamp; } else { return FutureUtils.getOrDefault(latestAlignmentDurationNanos, 0L); } }
Source:
static WorkloadTask generatePrototype(JTestDescription jTestDescription) { WorkloadTask prototype = new WorkloadTask(); prototype.setCalibrator(new OneNodeCalibrator()); prototype.setDescription(jTestDescription.getDescription()); QueryPoolScenarioFactory scenarioFactory = new QueryPoolScenarioFactory(); scenarioFactory.setQueryProvider(jTestDescription.getQueries()); scenarioFactory.setEndpointProvider(jTestDescription.getEndpoints()); scenarioFactory.setInvokerClazz(jTestDescription.getInvokerClass()); scenarioFactory.setLoadBalancer(new SimpleCircularLoadBalancer() {{ setPairSupplierFactory(new RoundRobinPairSupplierFactory()); }}); prototype.setScenarioFactory(scenarioFactory); prototype.setName(jTestDescription.getId()); return prototype; }

Target:
public static WorkloadTask generatePrototype(JTestDescription jTestDescription) { WorkloadTask prototype = new WorkloadTask(); prototype.setCalibrator(new OneNodeCalibrator()); prototype.setDescription(jTestDescription.getDescription()); QueryPoolScenarioFactory scenarioFactory = new QueryPoolScenarioFactory(); scenarioFactory.setQueryProvider(jTestDescription.getQueries()); scenarioFactory.setEndpointProvider(jTestDescription.getEndpoints()); scenarioFactory.setInvokerClazz(jTestDescription.getInvoker().getClass()); scenarioFactory.setLoadBalancer(new SimpleCircularLoadBalancer() {{ setPairSupplierFactory(new RoundRobinPairSupplierFactory()); }}); prototype.setScenarioFactory(scenarioFactory); prototype.setName(jTestDescription.getId()); ManagedList collectors = new ManagedList(); collectors.add(getSuccessRateMetric()); collectors.add(ReflectionProvider.ofClass(DurationCollector.class)); collectors.add(ReflectionProvider.ofClass(InformationCollector.class)); ValidationCollectorProvider validationCollectorProvider = new ValidationCollectorProvider(); validationCollectorProvider.setValidator(ReflectionProvider.ofClass(NotNullResponseValidator.class)); collectors.add(validationCollectorProvider); prototype.setCollectors(collectors); prototype.setTestListeners(newArrayList(new CollectThreadsTestListener())); return prototype; }
Source:
protected static VdcParameter create(String name, Class javaType, String uuidStr) { UUID uuid = UUID.fromString(uuidStr); synchronized (parametersMap) { VdcParameter param = parametersMap.get(uuid); if (param != null) { throw new InvalidParameterUuidException(name, param.getUuid(), param.getName()); } param = new VdcParameter(name, javaType.getName(), uuid); parametersMap.put(uuid, param); return param; } }

Target:
protected static VdcParameter create(String name, Class javaType, String uuidStr) { return VdcParameter.create(name, javaType, uuidStr); }
Source:
public static IASTName getMemberDeclaration(ICPPMember member, IASTTranslationUnit contextTu, CRefactoringContext context, IProgressMonitor pm) throws CoreException, OperationCanceledException { IBinding classBinding = member.getClassOwner(); if (classBinding instanceof ICPPTemplateInstance) classBinding = ((ICPPTemplateInstance) classBinding).getTemplateDefinition(); IBinding memberBinding = member; if (member instanceof ICPPMethodSpecialization) memberBinding = ((ICPPMethodSpecialization) member).getSpecializedBinding(); IASTName classDefintionName = getDefinition(classBinding, contextTu, context, pm); if (classDefintionName == null) return null; IASTCompositeTypeSpecifier compositeTypeSpecifier = ASTQueries.findAncestorWithType(classDefintionName, IASTCompositeTypeSpecifier.class); IASTTranslationUnit ast = classDefintionName.getTranslationUnit(); IIndex index = context.getIndex(); if (index == null) { return null; } IASTName[] memberDeclarationNames = ast.getDeclarationsInAST(index.adaptBinding(memberBinding)); for (IASTName name : memberDeclarationNames) { if (name.getPropertyInParent() == IASTDeclarator.DECLARATOR_NAME) { IASTDeclaration declaration = ASTQueries.findAncestorWithType(name, IASTDeclaration.class); if (declaration.getParent() == compositeTypeSpecifier) { return name; } } } return null; }

Target:
public static IASTName getMemberDeclaration(ICPPMember member, IASTTranslationUnit contextTu, CRefactoringContext context, IProgressMonitor pm) throws CoreException, OperationCanceledException { IBinding classBinding = member.getClassOwner(); IBinding memberBinding = member; if (member instanceof ICPPSpecialization) memberBinding = ((ICPPSpecialization) member).getSpecializedBinding(); IASTName classDefintionName = getDefinition(classBinding, contextTu, context, pm); if (classDefintionName == null) { if (classBinding instanceof ICPPTemplateInstance) classBinding = ((ICPPTemplateInstance) classBinding).getTemplateDefinition(); classDefintionName = getDefinition(classBinding, contextTu, context, pm); if (classDefintionName == null) return null; } IASTCompositeTypeSpecifier compositeTypeSpecifier = ASTQueries.findAncestorWithType(classDefintionName, IASTCompositeTypeSpecifier.class); IASTTranslationUnit ast = classDefintionName.getTranslationUnit(); IIndex index = context.getIndex(); if (index == null) { return null; } IASTName[] memberDeclarationNames = ast.getDeclarationsInAST(index.adaptBinding(memberBinding)); for (IASTName name : memberDeclarationNames) { if (name.getPropertyInParent() == IASTDeclarator.DECLARATOR_NAME) { IASTDeclaration declaration = ASTQueries.findAncestorWithType(name, IASTDeclaration.class); if (declaration.getParent() == compositeTypeSpecifier) { return name; } } } return null; }
Source:
private void registerNotification(SensorListener sensorListener) throws ConnectionException { if (!sensorListener.getXdk().isConnected()) { connect(sensorListener.getXdk()); } switch (sensorListener.getSensorType()) { case "ACCELERATION_X": case "ACCELERATION_Y": case "ACCELERATION_Z": case "GYROSCOPE_X": case "GYROSCOPE_Y": case "GYROSCOPE_Z": case "QUATERNION_M": case "QUATERNION_X": case "QUATERNION_Y": case "QUATERNION_Z": sensorListener.getXdk().disableHighNotifications(); sensorListener.getXdk().enableHighNotifications(SensorListener.getSensorConsumer(sensorListener)); break; case "LIGHT": case "NOISE": case "PRESURE": case "TEMPERATURE": case "HUMIDITY": case "SD_CARD_DETECT_STATUS": sensorListener.getXdk().disableLowNotifications(); sensorListener.getXdk().enableLowNotifications(SensorListener.getSensorConsumer(sensorListener), m1); break; case "BUTTON_STATUS": sensorListener.getXdk().disableLowNotifications(); waitFor(1000); sensorListener.getXdk().enableLowNotifications(SensorListener.getSensorConsumer(sensorListener), m1); break; case "MAGNETIC_X": case "MAGNETIC_Y": case "MAGNETIC_Z": case "MAGNETOMETER_RESISTENCE": case "LED_STATUS": case "VOLTAGE_LEM": sensorListener.getXdk().disableLowNotifications(); sensorListener.getXdk().enableLowNotifications(SensorListener.getSensorConsumer(sensorListener), m2); break; default: } }

Target:
private void registerNotification(SensorListener sensorListener) throws ConnectionException { if (!sensorListener.getXdk().isConnected()) { connect(sensorListener.getXdk()); } switch (sensorListener.getSensorType()) { case "ACCELERATION_X": case "ACCELERATION_Y": case "ACCELERATION_Z": case "GYROSCOPE_X": case "GYROSCOPE_Y": case "GYROSCOPE_Z": case "QUATERNION_M": case "QUATERNION_X": case "QUATERNION_Y": case "QUATERNION_Z": sensorListener.getXdk().disableHighNotifications(); sensorListener.getXdk().enableHighNotifications(SensorListener.getSensorConsumer(sensorListener)); break; case "LIGHT": case "NOISE": case "PRESSURE": case "TEMPERATURE": case "HUMIDITY": case "SD_CARD_DETECT_STATUS": case "BUTTON_STATUS": sensorListener.getXdk().disableLowNotifications(); sensorListener.getXdk().enableLowNotifications(SensorListener.getSensorConsumer(sensorListener), MESSAGE_ONE); break; case "MAGNETIC_X": case "MAGNETIC_Y": case "MAGNETIC_Z": case "MAGNETOMETER_RESISTENCE": case "LED_STATUS": case "VOLTAGE_LEM": sensorListener.getXdk().disableLowNotifications(); sensorListener.getXdk().enableLowNotifications(SensorListener.getSensorConsumer(sensorListener), MESSAGE_TWO); break; default: } }
Source:
protected void updateExpiration(final String tokenId, long expiration) { synchronized (tokenExpirations) { if (tokenExpirations.containsKey(tokenId)) { tokenExpirations.replace(tokenId, expiration); } else { tokenExpirations.put(tokenId, expiration); } } }

Target:
protected void updateExpiration(final String tokenId, long expiration) { synchronized (tokenExpirations) { tokenExpirations.put(tokenId, expiration); } }
Source:
public List<Component> analyze(String command) { if (!command.contains(" add ")) { return new ArrayList<>(); } command = command.replace(Commands.Apk.asString(), ""); String[] words = command.split("\\s"); List<String> packets = new ArrayList<>(); boolean skipNextWord = false; for (String word : words) { if (!skipNextWord) { if (word.length() > 0 && word.charAt(0) != '-') { packets.add(word); } if (word.equals("add")) { packets.clear(); } if (word.equals("--repository")) { skipNextWord = true; } } else { skipNextWord = false; } } return parseComponents(packets); }

Target:
public List<Component> analyze(String command) { if (!command.contains(" add ")) { return new ArrayList<>(); } command = command.replace(Commands.Apk.asString(), ""); String[] words = command.split("\\s"); List<String> packages = new ArrayList<>(); boolean skipNextWord = false; for (String word : words) { if (!skipNextWord) { if (word.length() > 0 && word.charAt(0) != '-') { packages.add(word); } if (word.equals("add")) { packages.clear(); } if (word.equals("--repository")) { skipNextWord = true; } } else { skipNextWord = false; } } return parseComponents(packages); }
Source:
private void removeYarnTask(RMContainer rmContainer) { if (containersNotNull(rmContainer)){ Protos.TaskID taskId = containerToTaskId(rmContainer); state.makeTaskKillable(taskId); Optional<Node> optNode = retrieveNode(rmContainer); if (optNode.isPresent()) { RMNode rmNode = optNode.get().getNode().getRMNode(); Resource resource = rmContainer.getContainer().getResource(); decrementNodeCapacity(rmNode, resource); LOGGER.info("Removed task yarn_{} with exit status freeing cpu and mem.", rmContainer.getContainer().toString(), rmContainer.getContainerExitStatus(), resource.getVirtualCores(), resource.getMemory()); } else { LOGGER.warn("The Node for the host was not found", rmContainer.getContainer().getNodeId().getHost()); } } }

Target:
private void removeYarnTask(RMContainer rmContainer) { if (containersNotNull(rmContainer)){ Protos.TaskID taskId = containerToTaskId(rmContainer); state.makeTaskKillable(taskId); Node node = retrieveNode(rmContainer); if (node != null) { RMNode rmNode = node.getNode().getRMNode(); Resource resource = rmContainer.getContainer().getResource(); decrementNodeCapacity(rmNode, resource); LOGGER.info("Removed task yarn_{} with exit status freeing cpu and mem.", rmContainer.getContainer().toString(), rmContainer.getContainerExitStatus(), resource.getVirtualCores(), resource.getMemory()); } else { LOGGER.warn("The Node for the host was not found", rmContainer.getContainer().getNodeId().getHost()); } } }
Source:
private void processSuite(TestSuiteModel ts) { for (TestCaseModel tc : ts.getTestcase()) { if (tc.getError() != null) { System.out.println(); } } for (TestCaseModel tc : ts.getTestcase()) { tc.postProcess(); } ts.postProcess(); processedTestSuites.add(ts); }

Target:
private void processSuite(TestSuiteModel ts) { for (TestCaseModel tc : ts.getTestcase()) { tc.postProcess(); } ts.postProcess(); processedTestSuites.add(ts); }
Source:
private List<HostCertificate> loadSavedCertificates() { List<HostCertificate> savedItems = new ArrayList<>(); String value = getPreferenceStore().getString(ALLOWED_CERTIFICATES_NEW); if (!StringUtils.isBlank(value)) { String[] tokens = value.split(SEPARATOR); for (int i = 0; i + 4 <= tokens.length;) { boolean accepted = Boolean.toString(Boolean.TRUE).equals(tokens[i++]); X509Certificate certificate = createCertificate(tokens[i++]); if (certificate == null) { continue; } HostCertificate hostCertificate = new HostCertificate(accepted, certificate); if(hostCertificate.isValid()) { savedItems.add(hostCertificate); } } } return savedItems; }

Target:
private synchronized List<HostCertificate> loadSavedCertificates() { List<HostCertificate> savedItems = new ArrayList<>(); String value = getPreferenceStore().getString(ALLOWED_CERTIFICATES_NEW); if (!StringUtils.isBlank(value)) { String[] tokens = value.split(SEPARATOR); for (int i = 0; i + 2 <= tokens.length;) { boolean accepted = Boolean.toString(Boolean.TRUE).equals(tokens[i++]); X509Certificate certificate = createCertificate(tokens[i++]); if (certificate == null) { continue; } HostCertificate hostCertificate = new HostCertificate(accepted, certificate); if (hostCertificate.isValid()) { savedItems.add(hostCertificate); } } } return savedItems; }
Source:
public EventBuffer(EventStream delegate, EventUpcaster upcasterChain, Serializer serializer, boolean disableEventBlacklisting) { this.delegate = delegate; this.eventStream = EventUtils.upcastAndDeserializeTrackedEvents( StreamSupport.stream(new SimpleSpliterator<>(this::poll), false), new GrpcMetaDataAwareSerializer(serializer), getOrDefault(upcasterChain, NoOpEventUpcaster.INSTANCE) ).iterator(); this.serializer = serializer; this.disableEventBlacklisting = disableEventBlacklisting; delegate.onAvailable(() -> { lock.lock(); try { dataAvailable.signalAll(); } finally { lock.unlock(); } }); logger.debug("Now, with adjusted poll operation!"); }

Target:
public EventBuffer(EventStream delegate, EventUpcaster upcasterChain, Serializer serializer, boolean disableEventBlacklisting) { this.delegate = delegate; this.serializer = serializer; this.disableEventBlacklisting = disableEventBlacklisting; this.eventStream = EventUtils.upcastAndDeserializeTrackedEvents( StreamSupport.stream(new SimpleSpliterator<>(this::poll), false), new GrpcMetaDataAwareSerializer(serializer), getOrDefault(upcasterChain, NoOpEventUpcaster.INSTANCE) ).iterator(); delegate.onAvailable(() -> { lock.lock(); try { dataAvailable.signalAll(); } finally { lock.unlock(); } }); }
Source:
public ArrayList<VdcQueryReturnValue> runMultipleQueries( ArrayList<VdcQueryType> queryTypeList, ArrayList<VdcQueryParametersBase> queryParamsList) { int size = queryTypeList == null ? 0 : queryTypeList.size(); log.debug("Server: RunMultipleQuery invoked! [amount of queries: {}]", size); ArrayList<VdcQueryReturnValue> ret = new ArrayList<>(); if (queryTypeList != null && queryParamsList != null && queryTypeList.size() == queryParamsList.size()) { for (int i = 0; i < queryTypeList.size(); i++) { debugQuery(queryTypeList.get(i), queryParamsList.get(i)); ret.add(runQuery(queryTypeList.get(i), queryParamsList.get(i))); } } else { log.error( "Wrong multi query usage: the query types and parameters" + " must not be null or be equally long. Types '{}' Params '{}'", queryTypeList, queryParamsList); } for (VdcQueryReturnValue vqrv : ret) { log.debug("VdcQueryReturnValue '{}'", vqrv); } log.debug("Server: RunMultipleQuery result [amount of queries: {}]", ret.size()); return ret; }

Target:
public ArrayList<VdcQueryReturnValue> runMultipleQueries( ArrayList<VdcQueryType> queryTypeList, ArrayList<VdcQueryParametersBase> queryParamsList) { int size = queryTypeList == null ? 0 : queryTypeList.size(); log.debug("Server: RunMultipleQuery invoked! [amount of queries: {}]", size); ArrayList<VdcQueryReturnValue> ret = new ArrayList<>(); if (queryTypeList != null && queryParamsList != null && queryTypeList.size() == queryParamsList.size()) { String correlationId = CorrelationIdTracker.getCorrelationId(); for (int i = 0; i < queryTypeList.size(); i++) { if (queryParamsList.get(i).getCorrelationId() == null) { queryParamsList.get(i).setCorrelationId(correlationId); } debugQuery(queryTypeList.get(i), queryParamsList.get(i)); ret.add(runQuery(queryTypeList.get(i), queryParamsList.get(i))); } } else { log.error( "Wrong multi query usage: the query types and parameters must not be null " + " or be equally long. Types length '{}' vs params length '{}'", queryTypeList == null ? 0 : queryTypeList.size(), queryParamsList == null ? 0 : queryParamsList.size() ); } for (VdcQueryReturnValue vqrv : ret) { log.debug("VdcQueryReturnValue '{}'", vqrv); } log.debug("Server: RunMultipleQuery result [amount of queries: {}]", ret.size()); return ret; }
Source:
protected void SyncSearch() { if (getEntity() == null) { return; } super.SyncSearch(); AsyncQuery query = new AsyncQuery(this, new INewAsyncCallback() { @Override public void OnSuccess(Object model, Object ReturnValue) { StorageDiskListModel storageDiskListModel = (StorageDiskListModel) model; storageDiskListModel.setItems((ArrayList<DiskImage>) ((VdcQueryReturnValue) ReturnValue).getReturnValue()); } }); StorageDomainQueryParametersBase parameters = new StorageDomainQueryParametersBase((getEntity()).getId()); parameters.setRefresh(getIsQueryFirstTime()); Frontend.RunQuery(VdcQueryType.GetAllDisksByStorageDomainId, parameters, query); }

Target:
protected void SyncSearch() { if (getEntity() == null) { return; } super.SyncSearch(); StorageDomainQueryParametersBase parameters = new StorageDomainQueryParametersBase((getEntity()).getId()); parameters.setRefresh(getIsQueryFirstTime()); Frontend.RunQuery(VdcQueryType.GetAllDisksByStorageDomainId, parameters, new AsyncQuery(this, new INewAsyncCallback() { @Override public void OnSuccess(Object model, Object ReturnValue) { StorageDiskListModel storageDiskListModel = (StorageDiskListModel) model; storageDiskListModel.setItems((ArrayList<DiskImage>) ((VdcQueryReturnValue) ReturnValue).getReturnValue()); } })); }
Source:
public void testGetProducerInfoCompleteClient() { SpanCache spanCache = new TestSpanCache(); Span serverSpan = new Span(); serverSpan.setId("3"); serverSpan.setParentId("2"); serverSpan.setAnnotations(serverAnnotations()); Span clientSpan = new Span(); clientSpan.setId("3"); clientSpan.setParentId("2"); BinaryAnnotation ba = new BinaryAnnotation(); ba.setKey("http.url"); ba.setValue("http://myhost:8080/myuri"); clientSpan.setBinaryAnnotations(Arrays.asList(ba)); clientSpan.setAnnotations(clientAnnotations()); Span midSpan = new Span(); midSpan.setId("2"); midSpan.setParentId("1"); Span topServerSpan = new Span(); topServerSpan.setId("1"); topServerSpan.setParentId("1"); topServerSpan.setAnnotations(serverAnnotations()); BinaryAnnotation ba2 = new BinaryAnnotation(); ba2.setKey("http.url"); ba2.setValue("http://myhost:8080/originaluri"); topServerSpan.setBinaryAnnotations(Arrays.asList(ba2)); try { spanCache.store(null, Arrays.asList(serverSpan, clientSpan, midSpan, topServerSpan), SpanUniqueIdGenerator::toUnique); } catch (CacheException e) { fail("Failed to store span"); } ProducerInfo pi = ProducerInfoUtil.getProducerInfo(null, serverSpan, spanCache); assertNotNull(pi); assertEquals("/originaluri", pi.getSourceUri()); }

Target:
public void testGetProducerInfoCompleteClient() throws CacheException { SpanCache spanCache = new TestSpanCache(); Span serverSpan = new Span(); serverSpan.setId("3"); serverSpan.setParentId("2"); serverSpan.setAnnotations(serverAnnotations()); Span clientSpan = new Span(); clientSpan.setId("3"); clientSpan.setParentId("2"); BinaryAnnotation ba = new BinaryAnnotation(); ba.setKey("http.url"); ba.setValue("http://myhost:8080/myuri"); clientSpan.setBinaryAnnotations(Arrays.asList(ba)); clientSpan.setAnnotations(clientAnnotations()); Span midSpan = new Span(); midSpan.setId("2"); midSpan.setParentId("1"); Span topServerSpan = new Span(); topServerSpan.setId("1"); topServerSpan.setParentId("1"); topServerSpan.setAnnotations(serverAnnotations()); BinaryAnnotation ba2 = new BinaryAnnotation(); ba2.setKey("http.url"); ba2.setValue("http://myhost:8080/originaluri"); topServerSpan.setBinaryAnnotations(Arrays.asList(ba2)); spanCache.store(null, Arrays.asList(serverSpan, clientSpan, midSpan, topServerSpan), SpanUniqueIdGenerator::toUnique); ProducerInfo pi = ProducerInfoUtil.getProducerInfo(null, serverSpan, spanCache); assertNotNull(pi); assertEquals("/originaluri", pi.getSourceUri()); }
Source:
public ExpressionThreadPoolExecutor(final String poolName, int corePoolSize) { this(poolName, corePoolSize, new NamedThreadFactory(poolName), new ThreadPoolExecutor.DiscardPolicy() { @Override public void rejectedExecution(Runnable runnable, ThreadPoolExecutor threadPoolExecutor) { LoggerFactory.getLogger(ExpressionThreadPoolExecutor.class).warn( "Thread pool '{}' rejected execution of {}", new Object[] { poolName, runnable.getClass() }); super.rejectedExecution(runnable, threadPoolExecutor); } }); }

Target:
public ExpressionThreadPoolExecutor(final String poolName, int corePoolSize) { this(poolName, corePoolSize, new NamedThreadFactory(poolName), new ThreadPoolExecutor.DiscardPolicy() { private final Logger logger = LoggerFactory.getLogger(ThreadPoolExecutor.DiscardPolicy.class); @Override public void rejectedExecution(Runnable runnable, ThreadPoolExecutor threadPoolExecutor) { logger.debug("Thread pool '{}' rejected execution of {}", poolName, runnable.getClass()); super.rejectedExecution(runnable, threadPoolExecutor); } }); }
Source:
public void cleanLibFolderBeforeExport() { IRunProcessService runProcessService = CorePlugin.getDefault().getRunProcessService(); ITalendProcessJavaProject talendProcessJavaProject = runProcessService .getTalendJobJavaProject(nodes.get(0).getObject().getProperty()); File libFolder = new File(talendProcessJavaProject.getBundleResourcesFolder().getLocation().toOSString() + File.separator + LIB); for(File file: libFolder.listFiles()) if (!file.isDirectory() && file.getName().endsWith(".jar")) file.delete(); }

Target:
public void cleanLibFolderBeforeExport() { IRunProcessService runProcessService = CorePlugin.getDefault().getRunProcessService(); ITalendProcessJavaProject talendProcessJavaProject = runProcessService .getTalendJobJavaProject(nodes.get(0).getObject().getProperty()); if (talendProcessJavaProject != null) { File libFolder = new File(talendProcessJavaProject.getBundleResourcesFolder().getLocation().toOSString() + File.separator + LIB); if (libFolder.exists()) { for (File file : libFolder.listFiles()) if (!file.isDirectory() && file.getName().endsWith(".jar")) file.delete(); } } }
Source:
public void testSnapshot() throws IOException { if (sharedTestEnv.isBigtable() && !enableTestForBigtable()) { return; } try (Admin admin = getConnection().getAdmin()) { createTable(tableName); Map<String, Long> values = createAndPopulateTable(tableName); checkSnapshotCount(admin, 0); admin.snapshot(snapshotName, tableName); checkSnapshotCount(admin, 1); admin.cloneSnapshot(snapshotName, clonedTableName); validateClone(values); checkSnapshotCount(admin, 1); admin.deleteSnapshot(snapshotName); checkSnapshotCount(admin, 0); } }

Target:
public void testSnapshot() throws IOException { if (sharedTestEnv.isBigtable() && !enableTestForBigtable()) { return; } try (Admin admin = getConnection().getAdmin()) { createTable(tableName); Map<String, Long> values = createAndPopulateTable(tableName); checkSnapshotCount(admin, 0); snapshot(snapshotName, tableName); checkSnapshotCount(admin, 1); cloneSnapshot(snapshotName, clonedTableName); validateClone(values); checkSnapshotCount(admin, 1); deleteSnapshot(snapshotName); checkSnapshotCount(admin, 0); } }
Source:
public void eventDispatched(ISuspendedDMEvent e) { fExpressionCache.setContextAvailable(e.getDMContext(), true); fExpressionCache.reset(); if (e instanceof IMIDMEvent) { Object miEvent = ((IMIDMEvent)e).getMIEvent(); if (miEvent instanceof MIStoppedEvent) { IDMContext dmc = e.getDMContext(); if (dmc instanceof IMIExecutionDMContext) { IMIExecutionDMContext threadDmc = (IMIExecutionDMContext)dmc; if (miEvent instanceof MIFunctionFinishedEvent) { String resultVar = ((MIFunctionFinishedEvent)miEvent).getGDBResultVar(); fReturnValueAliases.createAlias(threadDmc, resultVar); } MIFrame frame = ((MIStoppedEvent)miEvent).getFrame(); if (frame != null) { fReturnValueAliases.updateStoppedLocation(threadDmc, frame.getFunction()); } } } } }

Target:
public void eventDispatched(ISuspendedDMEvent e) { fExpressionCache.setContextAvailable(e.getDMContext(), true); fExpressionCache.reset(); handleReturnValueAliasing(e); }
Source:
private static Order.Urgency getUrgency(ProcedureRequest procedureRequest) { switch (procedureRequest.getPriority()) { case STAT: return Order.Urgency.STAT; default: case ROUTINE: return Order.Urgency.ROUTINE; } }

Target:
private static Order.Urgency getUrgency(ProcedureRequest procedureRequest) { switch (procedureRequest.getPriority()) { case STAT: return Order.Urgency.STAT; case ROUTINE: default: return Order.Urgency.ROUTINE; } }