auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public List<Diagnosis> getPrimaryDiagnoses(Encounter encounter) { List<Diagnosis> diagnoses = new ArrayList<Diagnosis>(); if (encounter != null && !encounter.getVoided()) { for (Diagnosis diagnosis : encounter.getDiagnoses()) { if (diagnosis.getRank() == 2) { diagnoses.add(diagnosis); } } } return diagnoses; }

Target:
public List<Diagnosis> getPrimaryDiagnoses(Encounter encounter) { return diagnosisDAO.getPrimaryDiagnoses(encounter); }
Source:
public void onXFormResult(final int requestCode, final int resultCode, final Intent data) { final FormRequest request = popFormRequest(requestCode); if (request == null) { LOG.e("Unknown form request code: " + requestCode); return; } final boolean isSubmissionCanceled = (resultCode == Activity.RESULT_CANCELED); Utils.logUserAction(isSubmissionCanceled ? "form_discard_pressed" : "form_save_pressed", "form", request.formUuid, "patient_uuid", request.patientUuid); if(isSubmissionCanceled) return; final boolean isSubmittingForm = mOdkResultSender.sendOdkResultToServer(request.patientUuid, resultCode, data); mUi.showFormSubmissionDialog(isSubmittingForm); }

Target:
public void onXFormResult(final int requestCode, final int resultCode, final Intent data) { final FormRequest request = popFormRequest(requestCode); if (request == null) { LOG.e("Unknown form request code: " + requestCode); return; } final boolean isSubmissionCanceled = (resultCode == Activity.RESULT_CANCELED); Utils.logUserAction(isSubmissionCanceled ? "form_discard_pressed" : "form_save_pressed", "form", request.formUuid, "patient_uuid", request.patientUuid); if(isSubmissionCanceled) return; final boolean isSubmittingForm = mOdkResultSender.sendOdkResultToServer(request.patientUuid, data); mUi.showFormSubmissionDialog(isSubmittingForm); }
Source:
public void leaseShouldStartBeforeRefreshTime() { setTimeDynamic(NanoTime::now); LockToken t1 = lockSync(REQUEST_ID); LockToken t2 = lockSync(REQUEST_ID_2); Set<LockToken> tokens = ImmutableSet.of(t1, t2); Leased<Set<LockToken>> refreshResult = heldLocksCollection.refresh(tokens); NanoTime t1RefreshTime = heldLocksCollection.heldLocksById.get(t1.getRequestId()).get().lastRefreshTime(); NanoTime t2RefreshTime = heldLocksCollection.heldLocksById.get(t2.getRequestId()).get().lastRefreshTime(); NanoTime minRefreshTime = t1RefreshTime.isBefore(t2RefreshTime) ? t1RefreshTime : t2RefreshTime; assertThat(refreshResult.lease().leaderTime().currentTime()).isLessThan(minRefreshTime); }

Target:
public void leaseShouldStartBeforeRefreshTime() { LockToken t1 = lockSync(REQUEST_ID); LockToken t2 = lockSync(REQUEST_ID_2); Set<LockToken> tokens = ImmutableSet.of(t1, t2); Leased<Set<LockToken>> refreshResult = heldLocksCollection.refresh(tokens); NanoTime t1RefreshTime = heldLocksCollection.heldLocksById.get(t1.getRequestId()).get().lastRefreshTime(); NanoTime t2RefreshTime = heldLocksCollection.heldLocksById.get(t2.getRequestId()).get().lastRefreshTime(); NanoTime minRefreshTime = t1RefreshTime.isBefore(t2RefreshTime) ? t1RefreshTime : t2RefreshTime; assertThat(refreshResult.lease().leaderTime().currentTime()).isLessThan(minRefreshTime); }
Source:
private List<Class<?>> getVersionableWhitelist() { List<Class<?>> whitelist = new ArrayList<>(); whitelist.add(Container.class); whitelist.add(Template.class); whitelist.add(File.class); whitelist.add(HTMLPage.class); return whitelist; }

Target:
private Set<Class<?>> getVersionableWhitelist() { return set(Container.class, Template.class, File.class, HTMLPage.class); }
Source:
public void describeTo(Description description) { description.appendText("Editor that title contins text: " + fileName); }

Target:
public void describeTo(Description description) { description.appendText("Editor that title contains text: " + fileName); }
Source:
public <T> T verify(T mock, VerificationMode mode) { MockingProgress mockingProgress = mockingProgress(); VerificationMode actualMode = mockingProgress.maybeVerifyLazily(mode); Set<VerificationListener> listeners = mockingProgress.verificationListeners(); try { if (mock == null) { throw nullPassedToVerify(); } if (!isMock(mock)) { throw notAMockPassedToVerify(mock.getClass()); } mockingProgress.verificationStarted(new MockAwareVerificationMode(mock, actualMode, listeners)); return mock; } catch (MockitoException e) { for (VerificationListener listener : listeners) { listener.onVerificationException(mock, actualMode, e); } throw e; } }

Target:
public <T> T verify(T mock, VerificationMode mode) { if (mock == null) { throw nullPassedToVerify(); } if (!isMock(mock)) { throw notAMockPassedToVerify(mock.getClass()); } MockingProgress mockingProgress = mockingProgress(); VerificationMode actualMode = mockingProgress.maybeVerifyLazily(mode); mockingProgress.verificationStarted(new MockAwareVerificationMode(mock, actualMode, mockingProgress.verificationListeners())); return mock; }
Source:
public DeviceManager(DataManager dataManager) { this.dataManager = dataManager; this.config = Context.getConfig(); dataRefreshDelay = config.getLong("database.refreshDelay", DEFAULT_REFRESH_DELAY) * 1000; if (dataManager != null) { try { updateDeviceCache(true); updateGroupCache(true); for (Position position : dataManager.getLatestPositions()) { positions.put(position.getDeviceId(), position); } } catch (SQLException error) { Log.warning(error); } } }

Target:
public DeviceManager(DataManager dataManager) { this.dataManager = dataManager; this.config = Context.getConfig(); dataRefreshDelay = config.getLong("database.refreshDelay", DEFAULT_REFRESH_DELAY) * 1000; if (dataManager != null) { try { updateGroupCache(true); updateDeviceCache(true); for (Position position : dataManager.getLatestPositions()) { positions.put(position.getDeviceId(), position); } } catch (SQLException error) { Log.warning(error); } } }
Source:
public void addsCookieToResponse() throws IOException { MatcherAssert.assertThat( new RsPrint( new PsCookie( new CcPlain(), "foo", 1L ).exit(new RsEmpty(), new Identity.Simple("urn:test:99")) ).print(), Matchers.allOf( Matchers.containsString( "Set-Cookie: foo=urn%3Atest%3A99;Path=/;" ), Matchers.containsString(";HttpOnly") ) ); }

Target:
public void addsCookieToResponse() throws IOException { MatcherAssert.assertThat( new RsPrint( new PsCookie( new CcPlain(), "foo", 1L ).exit(new RsEmpty(), new Identity.Simple("urn:test:99")) ).print(), Matchers.containsString( "Set-Cookie: foo=urn%3Atest%3A99;Path=/;HttpOnly;" ) ); }
Source:
public void testListSecurityGroups() throws RunNodesException, InterruptedException, ExecutionException { skipIfSecurityGroupsNotSupported(); ComputeService computeService = view.getComputeService(); Optional<SecurityGroupExtension> securityGroupExtension = computeService.getSecurityGroupExtension(); assertTrue(securityGroupExtension.isPresent(), "security extension was not present"); Set<SecurityGroup> groups = securityGroupExtension.get().listSecurityGroups(); System.out.println(groups.size()); for (SecurityGroup group : groups) { System.out.println(group); } }

Target:
public void testListSecurityGroups() throws Exception { skipIfSecurityGroupsNotSupported(); final long begin = new Date().getTime(); ComputeService computeService = view.getComputeService(); Optional<SecurityGroupExtension> securityGroupExtension = computeService.getSecurityGroupExtension(); assertTrue(securityGroupExtension.isPresent(), "security extension was not present"); logger.info("Loading security groups"); final SecurityGroupExtension security = securityGroupExtension.get(); Set<SecurityGroup> beforeAdd = security.listSecurityGroups(); int countBeforeAdd = beforeAdd.size(); logger.info("Found %d security groups", countBeforeAdd); String someUnlikelyName = String.valueOf(new Random().nextInt(1000000) + 1000000); logger.info("Adding security group %s", someUnlikelyName); final SecurityGroup testGroup = security.createSecurityGroup(someUnlikelyName, getNodeTemplate().getLocation()); try { verifyAndDeleteSecurityGroup(security, countBeforeAdd, testGroup); } catch (Exception e) { logger.error(e, "Exception caught, live test leaking security group %s", testGroup.getName()); throw e; } final long end = new Date().getTime(); assertTrue(end - begin < TimeUnit.MINUTES.toMillis(5)); }
Source:
public LocalRangeCacheManager(CacheConfig cacheConfig, CacheStats stats, ExecutorService cacheFlushExecutor, ExecutorService cacheRemovalExecutor) { requireNonNull(cacheConfig, "directory is null"); this.cacheFlushExecutor = cacheFlushExecutor; this.cacheRemovalExecutor = cacheRemovalExecutor; this.cache = CacheBuilder.newBuilder() .maximumSize(cacheConfig.getMaxCachedEntries()) .expireAfterAccess(cacheConfig.getCacheTtl().toMillis(), MILLISECONDS) .removalListener(new CacheRemovalListener()) .recordStats() .build(); this.stats = requireNonNull(stats, "stats is null"); this.directory = new Path(cacheConfig.getDirectory()); checkArgument(cacheConfig.getMaxInMemoryCacheSize().toBytes() >= 0, "maxInflightBytes is negative"); this.maxInflightBytes = cacheConfig.getMaxInMemoryCacheSize().toBytes(); File target = new File(directory.toUri()); if (!target.exists()) { try { Files.createDirectories(target.toPath()); } catch (IOException e) { throw new PrestoException(GENERIC_INTERNAL_ERROR, "cannot create cache directory " + target, e); } } else { File[] files = target.listFiles(); if (files == null) { return; } this.cacheRemovalExecutor.submit(() -> Arrays.stream(files).forEach(file -> { try { Files.delete(file.toPath()); } catch (IOException e) { } })); } }

Target:
public LocalRangeCacheManager(CacheConfig cacheConfig, CacheStats stats, ExecutorService cacheFlushExecutor, ExecutorService cacheRemovalExecutor) { requireNonNull(cacheConfig, "directory is null"); this.cacheFlushExecutor = cacheFlushExecutor; this.cacheRemovalExecutor = cacheRemovalExecutor; this.cache = CacheBuilder.newBuilder() .maximumSize(cacheConfig.getMaxCachedEntries()) .expireAfterAccess(cacheConfig.getCacheTtl().toMillis(), MILLISECONDS) .removalListener(new CacheRemovalListener()) .recordStats() .build(); this.stats = requireNonNull(stats, "stats is null"); this.baseDirectory = new Path(cacheConfig.getBaseDirectory()); checkArgument(cacheConfig.getMaxInMemoryCacheSize().toBytes() >= 0, "maxInflightBytes is negative"); this.maxInflightBytes = cacheConfig.getMaxInMemoryCacheSize().toBytes(); File target = new File(baseDirectory.toUri()); if (!target.exists()) { try { Files.createDirectories(target.toPath()); } catch (IOException e) { throw new PrestoException(GENERIC_INTERNAL_ERROR, "cannot create cache directory " + target, e); } } else { File[] files = target.listFiles(); if (files == null) { return; } this.cacheRemovalExecutor.submit(() -> Arrays.stream(files).forEach(file -> { try { Files.delete(file.toPath()); } catch (IOException e) { } })); } }
Source:
public TechResponse add(TechResponse entrada) { TechnologySample entity = new TechnologySample(); entity.setName(entrada.getName()); Key<TechnologySample> key = dao.add(entity); List<Key<RecommendationSample>> listKeyRec = null; if (entrada.getRecommendationsResponse() != null) { listKeyRec = new ArrayList<Key<RecommendationSample>>(); for (RecResponse recResponse : entrada.getRecommendationsResponse()) { RecommendationSample rec = new RecommendationSample(); rec.setScore(recResponse.getScore()); rec.setTechnology(key); Key<RecommendationSample> keyRecAtual = recService.add(rec); listKeyRec.add(keyRecAtual); } } entity.setRecommendations(listKeyRec); dao.update(entity); entrada.setId(entity.getId()); return entrada; }

Target:
public TechResponse add(TechResponse entrada) { Technology entity = new Technology(); entity.setName(entrada.getName()); Key<Technology> key = dao.add(entity); List<Key<Recommendation>> listKeyRec = null; if (entrada.getRecommendationsResponse() != null) { listKeyRec = new ArrayList<Key<Recommendation>>(); for (RecResponse recResponse : entrada.getRecommendationsResponse()) { Recommendation rec = new Recommendation(); rec.setScore(recResponse.getScore()); rec.setTechnology(key); Key<Recommendation> keyRecAtual = recService.add(rec); listKeyRec.add(keyRecAtual); } } entity.setRecommendations(listKeyRec); dao.update(entity); entrada.setId(entity.getId()); return entrada; }
Source:
public void visit(final MavenProject project) { if (JavadocMojo.this.sourceTypes.contains(project.getPackaging())) { this.manifestFiles.add(new File(project.getBasedir().getPath() + File.separator + "META-INF" + File.separator + "MANIFEST.MF")); } }

Target:
public void visit(final MavenProject project) { if (JavadocMojo.this.sourceTypes.contains(project.getPackaging())) { this.manifestFiles.add(new File(project.getBasedir(), "META-INF/MANIFEST.MF")); } }
Source:
private List<Date> daysIn(Interval interval) { return StreamSupport.stream(new ScheduleIntervalDates(interval).spliterator(), false) .map(localDate -> localDate.toDateTimeAtStartOfDay(DateTimeZone.UTC).toDate()) .collect(Collectors.toList()); }

Target:
private List<LocalDate> daysIn(Interval interval) { return StreamSupport.stream(new ScheduleIntervalDates(interval).spliterator(), false) .collect(Collectors.toList()); }
Source:
protected FloatsColumn(final ColumnarFloats column) { this.column = column; }

Target:
FloatsColumn(final ColumnarFloats column) { this.column = column; }
Source:
public ThreadedModelResolver() { this.dependencyGraph = new Graph<URI>(); this.lock = new ReentrantLock(true); this.notResolving = lock.newCondition(); this.resolutionEnd = lock.newCondition(); this.currentlyResolving = new HashSet<URI>(); this.shutdownInProgress = new AtomicBoolean(false); this.dependencySpecifierManager = new DependencySpecifierManager(); }

Target:
public ThreadedModelResolver() { this.dependencyGraph = new Graph<URI>(); this.lock = new ReentrantLock(true); this.notResolving = lock.newCondition(); this.resolutionEnd = lock.newCondition(); this.currentlyResolving = new HashSet<URI>(); this.shutdownInProgress = new AtomicBoolean(false); this.dependencyProviderRegistry = EMFCompareIDEUIPlugin.getDefault() .getModelDependencyProviderRegistry(); }
Source:
protected boolean canDoAction() { AuditLog event = DbFacade.getInstance().getAuditLogDao().get(getParameters().getId()); if (event == null) { return failCanDoAction(VdcBllMessages.ACTION_TYPE_FAILED_EXTERNAL_EVENT_NOT_FOUND); } if (OVIRT.equalsIgnoreCase(event.getOrigin())) { return failCanDoAction(VdcBllMessages.ACTION_TYPE_FAILED_EXTERNAL_EVENT_ILLEGAL_ORIGIN); } if (!event.getseverity().equals(AuditLogSeverity.ALERT)) { return failCanDoAction(VdcBllMessages.ACTION_TYPE_FAILED_EXTERNAL_EVENT_ILLRGAL_OPERATION); } return true; }

Target:
protected boolean canDoAction() { AuditLog event = DbFacade.getInstance().getAuditLogDao().get(getParameters().getId()); if (event == null) { return failCanDoAction(VdcBllMessages.ACTION_TYPE_FAILED_EXTERNAL_EVENT_NOT_FOUND); } if (OVIRT.equalsIgnoreCase(event.getOrigin())) { return failCanDoAction(VdcBllMessages.ACTION_TYPE_FAILED_EXTERNAL_EVENT_ILLEGAL_ORIGIN); } if (event.getseverity() == AuditLogSeverity.ALERT) { return failCanDoAction(VdcBllMessages.ACTION_TYPE_FAILED_EXTERNAL_EVENT_ILLRGAL_OPERATION); } return true; }
Source:
public void execute(ExecutionRequest request) { EngineExecutionListener engineExecutionListener = request.getEngineExecutionListener(); VintageEngineDescriptor engineDescriptor = (VintageEngineDescriptor) request.getRootTestDescriptor(); engineExecutionListener.executionStarted(engineDescriptor); RunnerExecutor runnerExecutor = new RunnerExecutor(engineExecutionListener, engineDescriptor.getTestSourceProvider()); final ConfigurationParameters configurationParameters = request.getConfigurationParameters(); final boolean parallelExecutionEnabled = configurationParameters.getBoolean(PARALLEL_ENABLED_CONFIG).orElse( false); try (CloseableExecutor executor = parallelExecutionEnabled ? new ParallelExecutor(configurationParameters) : new SerialExecutor()) { executeAllChildren(executor, runnerExecutor, engineDescriptor); } catch (final InterruptedException e) { throw new JUnitException("Error executing tests for engine " + getId() + ": " + e.getMessage(), e); } engineExecutionListener.executionFinished(engineDescriptor, successful()); }

Target:
public void execute(ExecutionRequest request) { EngineExecutionListener engineExecutionListener = request.getEngineExecutionListener(); VintageEngineDescriptor engineDescriptor = (VintageEngineDescriptor) request.getRootTestDescriptor(); engineExecutionListener.executionStarted(engineDescriptor); RunnerExecutor runnerExecutor = new RunnerExecutor(engineExecutionListener, engineDescriptor.getTestSourceProvider()); try (CloseableExecutor executor = createExecutor(request)) { executeAllChildren(executor, runnerExecutor, engineDescriptor); } catch (InterruptedException e) { throw new JUnitException("Error executing tests for engine " + getId() + ": " + e.getMessage(), e); } engineExecutionListener.executionFinished(engineDescriptor, successful()); }
Source:
public void preInit(FMLPreInitializationEvent event) { MinecraftForge.EVENT_BUS.register(this); proxy.construct(event); File configFile = event.getSuggestedConfigurationFile(); Configurations.configExists = configFile.exists(); Configurations.config = new Configuration(configFile); Configurations.config.load(); Configurations.refreshConfig(); CraftingHelper.register(new ResourceLocation(Reference.MOD_ID, "feature"), new JsonFeatureFactory()); MinecraftForge.EVENT_BUS.register(PerChunkData.INSTANCE); MinecraftForge.EVENT_BUS.register(ChiselController.class); GameRegistry.registerWorldGenerator(GenerationHandler.INSTANCE, 2); MinecraftForge.EVENT_BUS.register(GenerationHandler.INSTANCE); MinecraftForge.TERRAIN_GEN_BUS.register(GenerationHandler.INSTANCE); NetworkRegistry.INSTANCE.registerGuiHandler(this, new ChiselGuiHandler()); proxy.preInit(event); }

Target:
public void preInit(FMLPreInitializationEvent event) { MinecraftForge.EVENT_BUS.register(this); ChiselSounds.init(); proxy.construct(event); File configFile = event.getSuggestedConfigurationFile(); Configurations.configExists = configFile.exists(); Configurations.config = new Configuration(configFile); Configurations.config.load(); Configurations.refreshConfig(); MinecraftForge.EVENT_BUS.register(PerChunkData.INSTANCE); MinecraftForge.EVENT_BUS.register(ChiselController.class); GameRegistry.registerWorldGenerator(GenerationHandler.INSTANCE, 2); MinecraftForge.EVENT_BUS.register(GenerationHandler.INSTANCE); MinecraftForge.TERRAIN_GEN_BUS.register(GenerationHandler.INSTANCE); NetworkRegistry.INSTANCE.registerGuiHandler(this, new ChiselGuiHandler()); proxy.preInit(event); }
Source:
public static Method getMethod(Class c, String name) { Method[] methods = c.getDeclaredMethods(); for (Method method : methods) { if (method.getName().equals(name)) { return method; } } throw new IllegalArgumentException("Unknown method '" + name + "' on " + c); }

Target:
public static Method getMethod(Class c, String name) { for (Method method : c.getDeclaredMethods()) { if (method.getName().equals(name)) { return method; } } throw new IllegalArgumentException("Unknown method '" + name + "' on " + c); }
Source:
public IndexCollection(IndexCollection.Args args) throws Exception { this.args = args; LOG.info("Index path: " + args.index); LOG.info("Threads: " + args.threads); LOG.info("Keep stopwords: " + args.keepstop); LOG.info("Positions: " + args.positions); LOG.info("Store docvectors: " + args.docvectors); LOG.info("Store docs: " + (args.storeTransformedDocs ? "transformed" : (args.storeRawDocs ? "raw" : "none"))); LOG.info("Optimize (merge segments): " + args.optimize); this.indexPath = Paths.get(args.index); if (!Files.exists(this.indexPath)) { Files.createDirectories(this.indexPath); } collectionPath = Paths.get(args.input); if (!Files.exists(collectionPath) || !Files.isReadable(collectionPath) || !Files.isDirectory(collectionPath)) { throw new RuntimeException("Document directory " + collectionPath.toString() + " does not exist or is not readable, please check the path"); } this.transformerClass = Class.forName("io.anserini.index.generator." + args.generatorClass); this.collectionClass = Class.forName("io.anserini.collection." + args.collectionClass); collection = (Collection) this.collectionClass.newInstance(); collection.setInputDir(collectionPath); this.counters = new Counters(); }

Target:
public IndexCollection(IndexCollection.Args args) throws Exception { this.args = args; LOG.info("Index path: " + args.index); LOG.info("Threads: " + args.threads); LOG.info("Keep stopwords? " + args.keepStopwords); LOG.info("Store positions? " + args.storePositions); LOG.info("Store docvectors? " + args.storeDocvectors); LOG.info("Store transformed docs? " + args.storeTransformedDocs); LOG.info("Store raw docs?" + args.storeRawDocs); LOG.info("Optimize (merge segments)? " + args.optimize); this.indexPath = Paths.get(args.index); if (!Files.exists(this.indexPath)) { Files.createDirectories(this.indexPath); } collectionPath = Paths.get(args.input); if (!Files.exists(collectionPath) || !Files.isReadable(collectionPath) || !Files.isDirectory(collectionPath)) { throw new RuntimeException("Document directory " + collectionPath.toString() + " does not exist or is not readable, please check the path"); } this.transformerClass = Class.forName("io.anserini.index.generator." + args.generatorClass); this.collectionClass = Class.forName("io.anserini.collection." + args.collectionClass); collection = (Collection) this.collectionClass.newInstance(); collection.setInputDir(collectionPath); this.counters = new Counters(); }
Source:
public void writeBytes(Slice source, int sourceIndex, int length) { if (length >= slice.length()) { if (bufferPosition > 0) { int flushLength = getFreeBufferLength(); slice.setBytes(bufferPosition, source, sourceIndex, flushLength); bufferPosition = slice.length(); flushBufferToOutputStream(); sourceIndex += flushLength; length -= flushLength; } int flushLength = length - length % CHUNK_SIZE; for (int i = 0; i < flushLength / CHUNK_SIZE; i++) { writeToOutputStream(source, sourceIndex, CHUNK_SIZE); sourceIndex += CHUNK_SIZE; } length = length - flushLength; bufferOffset += flushLength; } ensureWritableBytes(length); slice.setBytes(bufferPosition, source, sourceIndex, length); bufferPosition += length; }

Target:
public void writeBytes(Slice source, int sourceIndex, int length) { if (length >= CHUNK_SIZE) { if (bufferPosition > 0) { int flushLength = getFreeBufferLength(); slice.setBytes(bufferPosition, source, sourceIndex, flushLength); bufferPosition = CHUNK_SIZE; flushBufferToOutputStream(); sourceIndex += flushLength; length -= flushLength; } while (length >= CHUNK_SIZE) { writeToOutputStream(source, sourceIndex, CHUNK_SIZE); sourceIndex += CHUNK_SIZE; length -= CHUNK_SIZE; bufferOffset += CHUNK_SIZE; } } if (length > 0) { ensureWritableBytes(length); slice.setBytes(bufferPosition, source, sourceIndex, length); bufferPosition += length; } }
Source:
public PathMappedListResult list( String packageType, String type, String name, String path, boolean recursive, String fileType, int limit ) { String[] list; StoreKey storeKey = new StoreKey( packageType, StoreType.get( type ), name ); if ( recursive ) { int lmt = DEFAULT_RECURSIVE_LIST_LIMIT; if ( limit > 0 ) { lmt = limit; } list = fileManager.list( storeKey.toString(), path, true, lmt ); } else { list = fileManager.list( storeKey.toString(), path ); } if ( fileType != null && list != null ) { Arrays.stream( list ).map( s -> { if ( "all".equals( fileType ) || ( "dir".equals( fileType ) && s.endsWith( "/" ) ) || ( "file".equals( fileType ) && !s.endsWith( "/" ) ) ) { return s; } else { return ""; } } ).filter( s -> isNotBlank( s ) ).toArray( String[]::new ); } return new PathMappedListResult( packageType, type, name, path, list ); }

Target:
public PathMappedListResult list( String packageType, String type, String name, String path, boolean recursive, String fileType, int limit ) { PathDB.FileType fType = PathDB.FileType.all; if ( isNotBlank( fileType ) ) { fType = PathDB.FileType.valueOf( fileType ); } String[] list; StoreKey storeKey = new StoreKey( packageType, StoreType.get( type ), name ); if ( recursive ) { int lmt = DEFAULT_RECURSIVE_LIST_LIMIT; if ( limit > 0 ) { lmt = limit; } list = fileManager.list( storeKey.toString(), path, true, lmt, fType ); } else { list = fileManager.list( storeKey.toString(), path, fType ); } return new PathMappedListResult( packageType, type, name, path, list ); }
Source:
private boolean goToFirstOccurrenceOfEarlierDate(Cursor cursor, Date furthestDate) throws CacheDatabaseException { boolean done = false; boolean retValue = false; while(!done) { try { String dateAsString = cursor.getString(cursor.getColumnIndex(KEY_MESSAGE_DATE)); DateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss.SSS"); Date date = dateFormat.parse(dateAsString); if(date.compareTo(furthestDate) <= 0){ done = true; retValue = true; } else if(!cursor.moveToNext()) { done = true; retValue = false; } } catch (ParseException e) { throw new CacheDatabaseException("Unable to retrieve Message !"); } } return retValue; }

Target:
private boolean goToFirstOccurrenceOfEarlierDate(Cursor cursor, Date furthestDate) throws CacheDatabaseException { boolean done = false; boolean retValue = false; while(!done) { try { String dateAsString = cursor.getString(cursor.getColumnIndex(KEY_MESSAGE_DATE)); Date date = DateSerialization.toDateForCache(dateAsString); if(date.compareTo(furthestDate) <= 0){ done = true; retValue = true; } else if(!cursor.moveToNext()) { done = true; retValue = false; } } catch (ParseException e) { throw new CacheDatabaseException("Unable to retrieve Message !"); } } return retValue; }
Source:
protected void parsePackagesSheet( Repository<Entity> repo, IntermediateParseResults intermediateResults) { if (repo == null) return; int rowIndex = 1; for (Entity packageEntity : resolvePackages(repo)) { rowIndex++; parseSinglePackage(intermediateResults, rowIndex, packageEntity); } }

Target:
private void parsePackagesSheet( Repository<Entity> repo, IntermediateParseResults intermediateResults) { if (repo == null) return; int rowIndex = 1; for (Entity packageEntity : resolvePackages(repo)) { rowIndex++; parseSinglePackage(intermediateResults, rowIndex, packageEntity); } }
Source:
private void addOperationsUsingSignatures( Path methodSignatures_file, VisibilityPredicate visibility, ReflectionPredicate reflectionPredicate) throws SignatureParseException { if (methodSignatures_file == null) { return; } try (EntryReader reader = new EntryReader(methodSignatures_file, "( for (String line : reader) { String sig = line.trim(); if (!sig.isEmpty()) { try { TypedClassOperation operation = signatureToOperation(sig, visibility, reflectionPredicate); if (operation == null) { continue; } if (!omitMethodsPredicate.shouldOmit(operation)) { operations.add(operation); } } catch (FailedPredicateException e) { System.out.printf("Ignoring %s that failed predicate: %s%n", sig, e.getMessage()); } } } } catch (IOException e) { throw new RandoopUsageError("Problem reading file " + methodSignatures_file, e); } }

Target:
private void addOperationsUsingSignatures( Path methodSignatures_file, VisibilityPredicate visibility, ReflectionPredicate reflectionPredicate) throws SignatureParseException { if (methodSignatures_file == null) { return; } try (EntryReader reader = new EntryReader(methodSignatures_file, "( for (String line : reader) { String sig = line.trim(); if (!sig.isEmpty()) { try { TypedClassOperation operation = signatureToOperation(sig, visibility, reflectionPredicate); if (!omitMethodsPredicate.shouldOmit(operation)) { operations.add(operation); } } catch (FailedPredicateException e) { System.out.printf("Ignoring %s that failed predicate: %s%n", sig, e.getMessage()); } } } } catch (IOException e) { throw new RandoopUsageError("Problem reading file " + methodSignatures_file, e); } }
Source:
protected void migrateData(ReviewDb db, UpdateUI ui) throws OrmException, SQLException { systemConfig = db.systemConfig().get(new SystemConfig.Key()); Repository git = null; try { git = mgr.openRepository(allProjects); asignChangeOwnerPermissions(git); } catch (RepositoryNotFoundException e) { throw new OrmException(e); } catch (IOException e) { throw new OrmException(e); } catch (ConfigInvalidException e) { throw new OrmException(e); } finally { if (git != null) { git.close(); } } }

Target:
protected void migrateData(ReviewDb db, UpdateUI ui) throws OrmException, SQLException { Repository git; try { git = mgr.openRepository(allProjects); } catch (RepositoryNotFoundException e) { throw new OrmException(e); } catch (IOException e) { throw new OrmException(e); } try { asignChangeOwnerPermissions(git); } catch (IOException e) { throw new OrmException(e); } catch (ConfigInvalidException e) { throw new OrmException(e); } finally { if (git != null) { git.close(); } } }
Source:
protected void fireTableSelectionChangeEvent() { logger.info(this.getClass().toString() + " fireTableSelectionChangeEvent"); ErrataSelectionChangeEvent.fire(this, getSelectedItems()); }

Target:
protected void fireTableSelectionChangeEvent() { ErrataSelectionChangeEvent.fire(this, getSelectedItems()); }
Source:
public void onMediaDeleted(String localMediaId) { if (!TextUtils.isEmpty(localMediaId)) { notifyMediaDeleted(Integer.valueOf(localMediaId)); } else { AppLog.w(AppLog.T.MEDIA, "onMediaDeleted event carries null localMediaId, not recognized"); } }

Target:
public void onMediaDeleted(String localMediaId) { if (!TextUtils.isEmpty(localMediaId)) { notifyMediaDeleted(StringUtils.stringToInt(localMediaId)); } else { AppLog.w(AppLog.T.MEDIA, "onMediaDeleted event carries null localMediaId, not recognized"); } }
Source:
public void visitToken(DetailAST ast) { final FullIdent ident; final boolean isStatic; if (ast.getType() == TokenTypes.IMPORT) { ident = FullIdent.createFullIdentBelow(ast); isStatic = false; } else { ident = FullIdent.createFullIdent(ast.getFirstChild() .getNextSibling()); isStatic = true; } final boolean isStaticAndNotLastImport = isStatic && !lastImportStatic; final boolean isLastImportAndNonStatic = lastImportStatic && !isStatic; if (option == ImportOrderOption.TOP) { if (isLastImportAndNonStatic) { lastGroup = Integer.MIN_VALUE; lastImport = ""; } doVisitToken(ident, isStatic, isStaticAndNotLastImport); } else if (option == ImportOrderOption.BOTTOM) { if (isStaticAndNotLastImport) { lastGroup = Integer.MIN_VALUE; lastImport = ""; } doVisitToken(ident, isStatic, isLastImportAndNonStatic); if (isLastImportAndNonStatic) { log(ident.getLineNo(), MSG_ORDERING, ident.getText()); } } else if (option == ImportOrderOption.ABOVE) { doVisitToken(ident, isStatic, isStaticAndNotLastImport); } else if (option == ImportOrderOption.UNDER) { doVisitToken(ident, isStatic, isLastImportAndNonStatic); } else if (option == ImportOrderOption.INFLOW) { doVisitToken(ident, isStatic, true); } else { throw new IllegalStateException( "Unexpected option for static imports: " + option); } lastImportLine = ast.findFirstToken(TokenTypes.SEMI).getLineNo(); lastImportStatic = isStatic; beforeFirstImport = false; }

Target:
public void visitToken(DetailAST ast) { final FullIdent ident; final boolean isStatic; if (ast.getType() == TokenTypes.IMPORT) { ident = FullIdent.createFullIdentBelow(ast); isStatic = false; } else { ident = FullIdent.createFullIdent(ast.getFirstChild() .getNextSibling()); isStatic = true; } final boolean isStaticAndNotLastImport = isStatic && !lastImportStatic; final boolean isLastImportAndNonStatic = lastImportStatic && !isStatic; if (option == ImportOrderOption.TOP) { if (isLastImportAndNonStatic) { lastGroup = Integer.MIN_VALUE; lastImport = ""; } doVisitToken(ident, isStatic, isStaticAndNotLastImport); if (isStaticAndNotLastImport && !beforeFirstImport) { log(ident.getLineNo(), MSG_ORDERING, ident.getText()); } } else if (option == ImportOrderOption.BOTTOM) { if (isStaticAndNotLastImport) { lastGroup = Integer.MIN_VALUE; lastImport = ""; } doVisitToken(ident, isStatic, isLastImportAndNonStatic); if (isLastImportAndNonStatic) { log(ident.getLineNo(), MSG_ORDERING, ident.getText()); } } else if (option == ImportOrderOption.ABOVE) { doVisitToken(ident, isStatic, isStaticAndNotLastImport); } else if (option == ImportOrderOption.UNDER) { doVisitToken(ident, isStatic, isLastImportAndNonStatic); } else if (option == ImportOrderOption.INFLOW) { doVisitToken(ident, isStatic, true); } else { throw new IllegalStateException( "Unexpected option for static imports: " + option); } lastImportLine = ast.findFirstToken(TokenTypes.SEMI).getLineNo(); lastImportStatic = isStatic; beforeFirstImport = false; }
Source:
private <C extends FlagAffectedCommand & TopologyAffectedCommand> CompletionStage<?> checkRemoteGetIfNeeded( InvocationContext ctx, C command, Set<Object> keys, LocalizedCacheTopology cacheTopology, boolean needsPreviousValue) { List<Object> remoteKeys = new ArrayList<>(); for (Object key : keys) { CacheEntry cacheEntry = ctx.lookupEntry(key); if (cacheEntry == null && cacheTopology.isWriteOwner(key)) { if (!needsPreviousValue || command.hasAnyFlag(FlagBitSets.SKIP_REMOTE_LOOKUP | FlagBitSets.CACHE_MODE_LOCAL)) { entryFactory.wrapExternalEntry(ctx, key, null, false, true); } else { remoteKeys.add(key); } } } final int size = remoteKeys.size(); if (size == 0) { return CompletableFutures.completedNull(); } return remoteGetMany(ctx, command, remoteKeys); }

Target:
private <C extends FlagAffectedCommand & TopologyAffectedCommand> CompletionStage<?> checkRemoteGetIfNeeded( InvocationContext ctx, C command, Set<Object> keys, LocalizedCacheTopology cacheTopology, boolean needsPreviousValue) { List<Object> remoteKeys = null; for (Object key : keys) { CacheEntry cacheEntry = ctx.lookupEntry(key); if (cacheEntry == null && cacheTopology.isWriteOwner(key)) { if (!needsPreviousValue || command.hasAnyFlag(FlagBitSets.SKIP_REMOTE_LOOKUP | FlagBitSets.CACHE_MODE_LOCAL)) { entryFactory.wrapExternalEntry(ctx, key, null, false, true); } else { if (remoteKeys == null) { remoteKeys = new ArrayList<>(); } remoteKeys.add(key); } } } return remoteKeys != null ? remoteGetMany(ctx, command, remoteKeys) : CompletableFutures.completedNull(); }
Source:
private static boolean isCompatible(MerkleTreeConfig c1, MerkleTreeConfig c2) { boolean c1Disabled = c1 == null || !c1.isEnabled(); boolean c2Disabled = c2 == null || !c2.isEnabled(); return c1 == c2 || (c1Disabled && c2Disabled) || (c1 != null && c2 != null && nullSafeEqual(c1.getDepth(), c2.getDepth())); }

Target:
private static boolean isCompatible(MerkleTreeConfig c1, MerkleTreeConfig c2) { boolean c1Disabled = c1 == null || !c1.isEnabled(); boolean c2Disabled = c2 == null || !c2.isEnabled(); return c1 == c2 || (c1Disabled && c2Disabled) || (c1 != null && c2 != null && c1.getDepth() == c2.getDepth()); }
Source:
public void should_have_parent_and_child_span_when_trigger_contains_span_info() throws Exception { brave.Span span = tracing.tracer().nextSpan(); JobDataMap data = new JobDataMap(); try (SpanInScope spanInScope = tracing.tracer().withSpanInScope(span)) { tracing.propagation() .injector((Setter<JobDataMap, String>) StringKeyDirtyFlagMap::put) .inject(tracing.currentTraceContext().get(), data); } finally { span.finish(); } Trigger trigger = newTrigger().forJob(SUCCESSFUL_JOB_KEY).usingJobData(data) .startNow().build(); runJob(trigger); Span parent = takeSpan(); Span child = takeSpan(); assertThat(parent.parentId()).isNull(); assertThat(child.parentId()).isEqualTo(parent.id()); }

Target:
public void should_have_parent_and_child_span_when_trigger_contains_span_info() throws Exception { brave.Span span = tracing.tracer().nextSpan(); JobDataMap data = new JobDataMap(); addSpanToJobData(data); Trigger trigger = newTrigger().forJob(SUCCESSFUL_JOB_KEY).usingJobData(data) .startNow().build(); runJob(trigger); Span parent = takeSpan(); Span child = takeSpan(); assertThat(parent.parentId()).isNull(); assertThat(child.parentId()).isEqualTo(parent.id()); }
Source:
public FileBackedInMemIFileWriter(Configuration conf, FileSystem fs, TezTaskOutput taskOutput, Class keyClass, Class valueClass, CompressionCodec codec, TezCounter writesCounter, TezCounter serializedBytesCounter, int cacheSize) throws IOException { super(conf, new FSDataOutputStream(createBoundedBuffer(cacheSize), null), keyClass, valueClass, null, writesCounter, serializedBytesCounter); this.fs = fs; this.cacheStream = (BoundedByteArrayOutputStream) this.rawOut.getWrappedStream(); this.taskOutput = taskOutput; this.bufferFull = (cacheStream == null); this.cacheSize = (cacheStream == null) ? 0 : Math.max(getBaseCacheSize(), cacheStream.available()); this.fileCodec = codec; }

Target:
public FileBackedInMemIFileWriter(Configuration conf, FileSystem fs, TezTaskOutput taskOutput, Class keyClass, Class valueClass, CompressionCodec codec, TezCounter writesCounter, TezCounter serializedBytesCounter, int cacheSize) throws IOException { super(conf, new FSDataOutputStream(createBoundedBuffer(cacheSize), null), keyClass, valueClass, null, writesCounter, serializedBytesCounter); this.fs = fs; this.cacheStream = (BoundedByteArrayOutputStream) this.rawOut.getWrappedStream(); this.taskOutput = taskOutput; this.bufferFull = (cacheStream == null); this.totalSize = getBaseCacheSize(); this.fileCodec = codec; }
Source:
protected boolean addedValid(IConfigurationElement element) { int ranking = Integer.parseInt(element.getAttribute(ATT_RANKING)); IContextTester contextTester = null; if (element.getAttribute(ATT_CONTEXT) != null) { try { contextTester = (IContextTester)element.createExecutableExtension(ATT_CONTEXT); } catch (CoreException e) { log(IStatus.WARNING, element, "Unable to create Context Tester '" + element.getAttribute(ATT_CONTEXT) + "'."); } } RankedAdapterFactoryDescriptor descriptor = new RankedAdapterFactoryDescriptorImpl(element, ranking, contextTester); String supportedTypes = element.getAttribute(ATT_SUPPORTED_TYPES); for (StringTokenizer stringTokenizer = new StringTokenizer(supportedTypes); stringTokenizer .hasMoreTokens();) { String supportedType = stringTokenizer.nextToken(); List<Object> key = new ArrayList<Object>(); key.add(element.getAttribute(ATT_URI)); key.add(supportedType); adapterFactoryRegistry.put(key, descriptor); } return true; }

Target:
protected boolean addedValid(IConfigurationElement element) { int ranking = Integer.parseInt(element.getAttribute(ATT_RANKING)); IContextTester contextTester = null; if (element.getAttribute(ATT_CONTEXT) != null) { try { contextTester = (IContextTester)element.createExecutableExtension(ATT_CONTEXT); } catch (CoreException e) { log(IStatus.WARNING, element, EMFCompareRCPMessages.getString("malformed.extension.executable", ATT_CONTEXT, element.getAttribute(ATT_CONTEXT))); } } RankedAdapterFactoryDescriptor descriptor = new RankedAdapterFactoryDescriptorImpl(element, ranking, contextTester); String supportedTypes = element.getAttribute(ATT_SUPPORTED_TYPES); for (StringTokenizer stringTokenizer = new StringTokenizer(supportedTypes); stringTokenizer .hasMoreTokens();) { String supportedType = stringTokenizer.nextToken(); List<Object> key = new ArrayList<Object>(); key.add(element.getAttribute(ATT_URI)); key.add(supportedType); adapterFactoryRegistry.put(key, descriptor); } return true; }
Source:
public void testFetchStdoutWithTimeout() throws TimeoutException { WaitingConsumer consumer = new WaitingConsumer(); container.followOutput(consumer, STDOUT); assertThrows("a TimeoutException should be thrown", TimeoutException.class, () -> { consumer.waitUntil(frame -> frame.getType() == STDOUT && frame.getUtf8String().contains("qqq"), 4, TimeUnit.SECONDS); return true; }); }

Target:
public void testFetchStdoutWithTimeout() { WaitingConsumer consumer = new WaitingConsumer(); container.followOutput(consumer, STDOUT); assertThrows("a TimeoutException should be thrown", TimeoutException.class, () -> { consumer.waitUntil(frame -> frame.getType() == STDOUT && frame.getUtf8String().contains("qqq"), 1, TimeUnit.SECONDS); return true; }); }
Source:
public void createControl(Composite parent, FormToolkit toolkit) { super.createControl(parent, toolkit, (getLayoutHint().rowSpan == RowSpan.MULTIPLE ? SWT.WRAP : SWT.NONE)); if (!isReadOnly() && isMultiSelect) { getText().setToolTipText("Separate multiple values with a comma"); } }

Target:
public void createControl(Composite parent, FormToolkit toolkit) { super.createControl(parent, toolkit, (getLayoutHint() != null && getLayoutHint().rowSpan == RowSpan.MULTIPLE ? SWT.WRAP : SWT.NONE)); if (!isReadOnly() && isMultiSelect) { getText().setToolTipText("Separate multiple values with a comma"); } }
Source:
private ProjectTypes getProjectTypes(FolderEntry module, ProjectConfig moduleConfig) throws ProjectTypeConstraintException, ServerException { Project project = new Project(module, projectManager); ProjectTypes types = null; try { types = new ProjectTypes(project, moduleConfig.getType(), moduleConfig.getMixins(), projectManager); types.addTransient(); } catch (NotFoundException e) { e.printStackTrace(); } return types; }

Target:
private ProjectTypes getProjectTypes(FolderEntry module, ProjectConfig moduleConfig) throws ProjectTypeConstraintException, ServerException, NotFoundException { Project project = new Project(module, projectManager); ProjectTypes types = new ProjectTypes(project, moduleConfig.getType(), moduleConfig.getMixins(), projectManager); types.addTransient(); return types; }
Source:
public void testGettingDescriptorType() throws IOException { ApiClient webClient = BaseIT.getWebClient(BaseIT.ADMIN_USERNAME, testingPostgres); HostedApi api = new HostedApi(webClient); DockstoreTool hostedTool = api .createHostedTool("awesomeTool", Registry.QUAY_IO.getDockerPath().toLowerCase(), CWL.getLowerShortName(), "coolNamespace", null); List<SourceFile> sourceFiles = generateSourceFiles(CWL.getLowerShortName()); hostedTool = api.editHostedTool(hostedTool.getId(), sourceFiles); assertEquals("CWL", hostedTool.getDescriptorType().get(0)); sourceFiles = generateSourceFiles(WDL.getLowerShortName()); hostedTool = api.editHostedTool(hostedTool.getId(), sourceFiles); assertTrue(hostedTool.getDescriptorType().size() == 2); assertTrue(hostedTool.getDescriptorType().get(0) != hostedTool.getDescriptorType().get(1)); }

Target:
public void testGettingDescriptorType() throws IOException { ApiClient webClient = BaseIT.getWebClient(BaseIT.ADMIN_USERNAME, testingPostgres); HostedApi api = new HostedApi(webClient); DockstoreTool hostedTool = api .createHostedTool("awesomeTool", Registry.QUAY_IO.getDockerPath().toLowerCase(), CWL.toString(), "coolNamespace", null); List<SourceFile> sourceFiles = generateSourceFiles(CWL); hostedTool = api.editHostedTool(hostedTool.getId(), sourceFiles); assertEquals(CWL.toString(), hostedTool.getDescriptorType().get(0)); sourceFiles = generateSourceFiles(WDL); hostedTool = api.editHostedTool(hostedTool.getId(), sourceFiles); assertTrue(hostedTool.getDescriptorType().size() == 2); assertTrue(hostedTool.getDescriptorType().get(0) != hostedTool.getDescriptorType().get(1)); }
Source:
public void oneInvalidJsonFile() throws IOException { File invalidJson = new File("store/test/dummy-dummy.json"); assert invalidJson.createNewFile(); RepoIO testIO = TestController.createTestingRepoIO(Optional.of(new JSONStoreStub())); assertEquals(0, testIO.getStoredRepos().size()); }

Target:
public void oneInvalidJsonFile() throws IOException { File invalidJson = new File("store/test/dummy-dummy.json"); assert invalidJson.createNewFile(); RepoIO testIO = TestController.createTestingRepoIO(Optional.empty()); assertEquals(0, testIO.getStoredRepos().size()); }
Source:
public SparqlToPipelineTransformVisitor(MongoCollection<Document> inputCollection) { this.inputCollection = inputCollection; }

Target:
public SparqlToPipelineTransformVisitor(MongoCollection<Document> inputCollection) { this.inputCollection = Preconditions.checkNotNull(inputCollection); }
Source:
public int onStartCommand(Intent intent, int flags, int startId) { if (ACTION_SYNC_FOLDER.equals(intent.getAction())) { if (!intent.hasExtra(EXTRA_ACCOUNT) || !intent.hasExtra(EXTRA_REMOTE_PATH)) { Log_OC.e(TAG, "Not enough information provided in intent"); return START_NOT_STICKY; } Account account = intent.getParcelableExtra(EXTRA_ACCOUNT); String remotePath = intent.getStringExtra(EXTRA_REMOTE_PATH); OCFile file = new OCFile(remotePath); Pair<Account, OCFile> itemSyncKey = new Pair<Account , OCFile>(account, file); Pair<Target, RemoteOperation> itemToQueue = newOperation(intent); if (itemToQueue != null) { mSyncFolderHandler.add(account, file, (SynchronizeFolderOperation)itemToQueue.second); Message msg = mSyncFolderHandler.obtainMessage(); msg.arg1 = startId; msg.obj = itemSyncKey; mSyncFolderHandler.sendMessage(msg); } } else if (ACTION_CANCEL_SYNC_FOLDER.equals(intent.getAction())) { if (!intent.hasExtra(EXTRA_ACCOUNT) || !intent.hasExtra(EXTRA_REMOTE_PATH)) { Log_OC.e(TAG, "Not enough information provided in intent"); return START_NOT_STICKY; } Account account = intent.getParcelableExtra(EXTRA_ACCOUNT); String remotePath = intent.getStringExtra(EXTRA_REMOTE_PATH); OCFile file = new OCFile(remotePath); mSyncFolderHandler.cancel(account,file); } else { Message msg = mOperationsHandler.obtainMessage(); msg.arg1 = startId; mOperationsHandler.sendMessage(msg); } return START_NOT_STICKY; }

Target:
public int onStartCommand(Intent intent, int flags, int startId) { if (ACTION_SYNC_FOLDER.equals(intent.getAction())) { if (!intent.hasExtra(EXTRA_ACCOUNT) || !intent.hasExtra(EXTRA_REMOTE_PATH)) { Log_OC.e(TAG, "Not enough information provided in intent"); return START_NOT_STICKY; } Account account = intent.getParcelableExtra(EXTRA_ACCOUNT); String remotePath = intent.getStringExtra(EXTRA_REMOTE_PATH); Pair<Account, String> itemSyncKey = new Pair<Account , String>(account, remotePath); Pair<Target, RemoteOperation> itemToQueue = newOperation(intent); if (itemToQueue != null) { mSyncFolderHandler.add(account, remotePath, (SynchronizeFolderOperation)itemToQueue.second); Message msg = mSyncFolderHandler.obtainMessage(); msg.arg1 = startId; msg.obj = itemSyncKey; mSyncFolderHandler.sendMessage(msg); } } else if (ACTION_CANCEL_SYNC_FOLDER.equals(intent.getAction())) { if (!intent.hasExtra(EXTRA_ACCOUNT) || !intent.hasExtra(EXTRA_REMOTE_PATH)) { Log_OC.e(TAG, "Not enough information provided in intent"); return START_NOT_STICKY; } Account account = intent.getParcelableExtra(EXTRA_ACCOUNT); String remotePath = intent.getStringExtra(EXTRA_REMOTE_PATH); mSyncFolderHandler.cancel(account,remotePath); } else { Message msg = mOperationsHandler.obtainMessage(); msg.arg1 = startId; mOperationsHandler.sendMessage(msg); } return START_NOT_STICKY; }
Source:
public File getDataDirectory() { return dataDirectory; }

Target:
public URI getDataDirectory() { return dataDirectory; }
Source:
PostMethod getPostMethod(String zenossToken) { String hostname = proxyConfig.getHostname(); int port = proxyConfig.getPort(); String url = "http://" + hostname + ":" + port + VALIDATE_URL; log.debug("Attempting to validate token against ", zenossToken, url); PostMethod method = new PostMethod(url); method.setQueryString(new NameValuePair[]{new NameValuePair("id", zenossToken)}); return method; }

Target:
HttpPost getPostMethod(String zenossToken) { String url = getValidateUrl(); log.debug("Attempting to validate token against ", zenossToken, url); HttpParams params = new BasicHttpParams(); params.setParameter("id", zenossToken); HttpPost method = new HttpPost(url); method.setParams(params); return method; }
Source:
public void verifyAdsenseUnitWidth(int expectedInContent, int expectedOthers) { int width; List<WebElement> listWebElements = driver.findElements(MonetizationModuleAdsenseListBy); for (WebElement elem : listWebElements) { String slotName = elem.getAttribute(attributeNameSlot); width = elem.findElement(By.cssSelector(".adsbygoogle")).getSize().width; if (slotName.equals("in_content")) { Assertion.assertEquals(width, expectedInContent); } else { Assertion.assertEquals(width, expectedOthers); } PageObjectLogging.log("verifyAdsenseUnitWidth", "Verify the width of the adsense unit for " + slotName + " (width=" + width + ")", true); } }

Target:
public void verifyAdsenseUnitWidth(int expectedInContent, int expectedOthers) { int width; List<WebElement> listWebElements = driver.findElements(MonetizationModuleAdsenseListBy); for (WebElement elem : listWebElements) { String slotName = elem.getAttribute(ATTRIBUTE_NAME_SLOT); width = elem.findElement(adsenseIns).getSize().width; if (slotName.equals(SLOT_IN_CONTENT)) { Assertion.assertEquals(width, expectedInContent); } else { Assertion.assertEquals(width, expectedOthers); } PageObjectLogging.log("verifyAdsenseUnitWidth", "Verify the width of the adsense unit for " + slotName + " (width=" + width + ")", true); } }