auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
private void verifyRespondentInSessionRespondentsList(FeedbackSessionAttributes session, String respondentEmail, boolean isInstructor) { FeedbackSessionAttributes sessionInDb = logic.getFeedbackSession(session.getFeedbackSessionName(), session.getCourseId()); Set<String> respondingStudentList = sessionInDb.getRespondingStudentList(); Set<String> respondingInstructorList = sessionInDb.getRespondingInstructorList(); if (isInstructor) { assertFalse(respondingStudentList.contains(respondentEmail)); assertTrue(respondingInstructorList.contains(respondentEmail)); } else { assertTrue(respondingStudentList.contains(respondentEmail)); assertFalse(respondingInstructorList.contains(respondentEmail)); } }

Target:
private void verifyRespondentInSessionRespondentsList(FeedbackSessionAttributes session, String respondentEmail, boolean isInstructor) throws EntityDoesNotExistException { FeedbackSessionResponseStatus responseStatus = fsLogic.getFeedbackSessionResponseStatus(session.getFeedbackSessionName(), session.getCourseId()); assertFalse(responseStatus.getStudentsWhoDidNotRespond().contains(respondentEmail)); if (!isInstructor) { assertTrue(responseStatus.getStudentsWhoResponded().contains(respondentEmail)); } }
Source:
public void downloadPackage(@RepositoryMapping Repository repository, @PathVariable(name = "packageName") String packageName, @PathVariable(name = "packageNameWithVersion") String packageNameWithVersion, @PathVariable(name = "packageExtension") String packageExtension, @RequestHeader HttpHeaders httpHeaders, HttpServletRequest request, HttpServletResponse response) throws Exception { final String storageId = repository.getStorage().getId(); final String repositoryId = repository.getId(); if (!packageNameWithVersion.startsWith(packageName + "-")) { response.setStatus(HttpServletResponse.SC_BAD_REQUEST); } final String packageVersion = packageNameWithVersion.substring(packageName.length() + 1, packageNameWithVersion.length()); NpmArtifactCoordinates coordinates; try { coordinates = NpmArtifactCoordinates.of(packageName, packageVersion); } catch (IllegalArgumentException e) { response.setStatus(HttpStatus.BAD_REQUEST.value()); response.getWriter().write(e.getMessage()); return; } RepositoryPath path = artifactResolutionService.resolvePath(storageId, repositoryId, coordinates.toPath()); provideArtifactDownloadResponse(request, response, httpHeaders, path); }

Target:
public void downloadPackage(@RepositoryMapping Repository repository, @PathVariable(name = "packageName") String packageName, @PathVariable(name = "packageNameWithVersion") String packageNameWithVersion, @PathVariable(name = "packageExtension") String packageExtension, @RequestHeader HttpHeaders httpHeaders, HttpServletRequest request, HttpServletResponse response) throws Exception { final String storageId = repository.getStorage().getId(); final String repositoryId = repository.getId(); if (!packageNameWithVersion.startsWith(packageName + "-")) { response.setStatus(HttpServletResponse.SC_BAD_REQUEST); return; } final String packageVersion = getPackageVersion(packageNameWithVersion, packageName); NpmArtifactCoordinates coordinates; try { coordinates = NpmArtifactCoordinates.of(packageName, packageVersion); } catch (IllegalArgumentException e) { response.setStatus(HttpStatus.BAD_REQUEST.value()); response.getWriter().write(e.getMessage()); return; } RepositoryPath path = artifactResolutionService.resolvePath(storageId, repositoryId, coordinates.toPath()); provideArtifactDownloadResponse(request, response, httpHeaders, path); }
Source:
public EntrezGeneIdResolver(CanonicalTranscriptResolver canonicalTranscriptResolver, EnsemblService ensemblService) { this.canonicalTranscriptResolver = canonicalTranscriptResolver; this.ensemblService = ensemblService; this.hugoSymbolToEntrezGeneIdMap = ensemblService.getHugoSymbolToEntrezGeneIdMap(); }

Target:
public EntrezGeneIdResolver(CanonicalTranscriptResolver canonicalTranscriptResolver, EnsemblService ensemblService) { this.canonicalTranscriptResolver = canonicalTranscriptResolver; this.ensemblService = ensemblService; }
Source:
public void updateDependentPhenotypesStatusByGeolocation(final Integer geolocation, final List<Integer> variableIds) { final List<Formula> formulaList = this.daoFactory.getFormulaDAO().getByInputIds(variableIds); if (!formulaList.isEmpty()) { final List<Integer> targetVariableIds = Lists.transform(formulaList, new Function<Formula, Integer>() { @Override public Integer apply(final Formula formula) { return formula.getTargetCVTerm().getCvTermId(); } }); if (!targetVariableIds.isEmpty()) { this.daoFactory.getPhenotypeDAO() .updateOutOfSyncPhenotypesByGeolocation(geolocation, Sets.newHashSet(targetVariableIds)); } } }

Target:
public void updateDependentPhenotypesStatusByGeolocation(final Integer geolocation, final List<Integer> variableIds) { final List<Formula> formulaList = this.daoFactory.getFormulaDAO().getByInputIds(variableIds); if (!formulaList.isEmpty()) { final List<Integer> targetVariableIds = Lists.transform(formulaList, new Function<Formula, Integer>() { @Override public Integer apply(final Formula formula) { return formula.getTargetCVTerm().getCvTermId(); } }); this.daoFactory.getPhenotypeDAO() .updateOutOfSyncPhenotypesByGeolocation(geolocation, Sets.newHashSet(targetVariableIds)); } }
Source:
public SafeHtml getTooltip(T object) { VmNetworkInterface vnic = null; if (object instanceof VmNetworkInterface) { vnic = (VmNetworkInterface) object; } else if (object instanceof PairQueryable && ((PairQueryable) object).getFirst() instanceof VmNetworkInterface) { vnic = ((PairQueryable<VmNetworkInterface, VM>) object).getFirst(); } StringBuilder tooltip = new StringBuilder(""); if (vnic != null && vnic.isPlugged()) { tooltip = tooltip.append(templates.cardStatus(constants.pluggedNetworkInteface()).asString()); } else { tooltip = tooltip.append(templates.cardStatus(constants.unpluggedNetworkInteface()).asString()); } tooltip = tooltip.append("<BR>"); if (vnic.isLinked()) { tooltip = tooltip.append(templates.linkState(constants.linkedNetworkInteface()) .asString()); } else { tooltip = tooltip.append(templates.linkState(constants.unlinkedNetworkInteface()) .asString()); } return SafeHtmlUtils.fromTrustedString(tooltip.toString()); }

Target:
public SafeHtml getTooltip(T object) { VmNetworkInterface vnic = null; if (object instanceof VmNetworkInterface) { vnic = (VmNetworkInterface) object; } else if (object instanceof PairQueryable && ((PairQueryable) object).getFirst() instanceof VmNetworkInterface) { vnic = ((PairQueryable<VmNetworkInterface, VM>) object).getFirst(); } StringBuilder tooltip = new StringBuilder(""); if (vnic != null && vnic.isPlugged()) { tooltip = tooltip.append(templates.cardStatus(constants.pluggedNetworkInteface()).asString()); } else { tooltip = tooltip.append(templates.cardStatus(constants.unpluggedNetworkInteface()).asString()); } tooltip = tooltip.append("<BR>"); if (vnic != null && vnic.isLinked()) { tooltip = tooltip.append(templates.linkState(constants.linkedNetworkInteface()) .asString()); } else { tooltip = tooltip.append(templates.linkState(constants.unlinkedNetworkInteface()) .asString()); } return SafeHtmlUtils.fromTrustedString(tooltip.toString()); }
Source:
public List<String> list(String bucket, String prefix) throws IOException { if (prefix.length() > 0 && !prefix.endsWith("/")) prefix += "/"; final ListParser lp = new ListParser(bucket, prefix); do { lp.list(); } while (lp.truncated); Comparator<KeyInfo> comparator = (k1, k2) -> Long.compare(k1.getLastModifiedSecs(), k2.getLastModifiedSecs()); return lp.entries.stream().sorted(comparator.reversed()) .map(e -> e.getName()).collect(Collectors.toList()); }

Target:
public List<String> list(String bucket, String prefix) throws IOException { if (prefix.length() > 0 && !prefix.endsWith("/")) prefix += "/"; final ListParser lp = new ListParser(bucket, prefix); do { lp.list(); } while (lp.truncated); Comparator<KeyInfo> comparator = Comparator.comparingLong(KeyInfo::getLastModifiedSecs); return lp.entries.stream().sorted(comparator.reversed()) .map(KeyInfo::getName).collect(Collectors.toList()); }
Source:
static ScenarioResult<CurveCurrencyParameterSensitivities> bucketedPv01( TermDepositTrade trade, ExpandedTermDeposit product, CalculationMarketData marketData) { return FxConvertibleList.of( marketData.getScenarioCount(), i -> calculateBucketedPv01(product, marketData.scenario(i))); }

Target:
static ScenarioResult<CurveCurrencyParameterSensitivities> bucketedPv01( TermDepositTrade trade, ExpandedTermDeposit product, CalculationMarketData marketData) { return ScenarioResult.of( marketData.getScenarioCount(), i -> calculateBucketedPv01(product, marketData.scenario(i))); }
Source:
public void testPostProcessing() throws Exception{ StartupProperties.get().setProperty("falcon.postprocessing.enable", "false"); OozieEntityBuilder builder = OozieEntityBuilder.get(postFeed); Path bundlePath = new Path("/projects/falcon/"); builder.build(trgCluster, bundlePath); BUNDLEAPP bundle = getBundle(trgMiniDFS.getFileSystem(), bundlePath); List<COORDINATOR> coords = bundle.getCoordinator(); COORDINATORAPP coord = getCoordinator(trgMiniDFS, coords.get(0).getAppPath()); WORKFLOWAPP workflow = getWorkflowapp(trgMiniDFS.getFileSystem(), coord); Boolean userAction = false; Boolean postProcessing = true; coord = getCoordinator(trgMiniDFS, coords.get(1).getAppPath()); for(Object action : workflow.getDecisionOrForkOrJoin()){ if (action instanceof ACTION && ((ACTION)action).getName().equals("eviction")){ userAction = true; } if (action instanceof ACTION && ((ACTION)action).getName().contains("post")){ postProcessing = false; } } assertTrue(userAction); assertTrue(postProcessing); workflow = getWorkflowapp(trgMiniDFS.getFileSystem(), coord); userAction = false; postProcessing = true; for(Object action : workflow.getDecisionOrForkOrJoin()){ if (action instanceof ACTION && ((ACTION)action).getName().equals("replication")){ userAction = true; } if (action instanceof ACTION && ((ACTION)action).getName().contains("post")){ postProcessing = false; } } assertTrue(userAction); assertTrue(postProcessing); StartupProperties.get().setProperty("falcon.postprocessing.enable", "true"); }

Target:
public void testPostProcessing() throws Exception{ StartupProperties.get().setProperty("falcon.postprocessing.enable", "false"); OozieEntityBuilder builder = OozieEntityBuilder.get(feed); Path bundlePath = new Path("/projects/falcon/"); builder.build(trgCluster, bundlePath); BUNDLEAPP bundle = getBundle(trgMiniDFS.getFileSystem(), bundlePath); List<COORDINATOR> coords = bundle.getCoordinator(); COORDINATORAPP coord = getCoordinator(trgMiniDFS, coords.get(0).getAppPath()); WORKFLOWAPP workflow = getWorkflowapp(trgMiniDFS.getFileSystem(), coord); Boolean foundUserAction = false; Boolean foundPostProcessing = false; Iterator<COORDINATOR> coordIterator = coords.iterator(); while(coordIterator.hasNext()){ COORDINATORAPP coord1 = getCoordinator(trgMiniDFS, coordIterator.next().getAppPath()); WORKFLOWAPP workflow1 = getWorkflowapp(trgMiniDFS.getFileSystem(), coord1); Iterator<Object> workflowIterator = workflow1.getDecisionOrForkOrJoin().iterator(); while (workflowIterator.hasNext()){ Object object = workflowIterator.next(); if (ACTION.class.isAssignableFrom(object.getClass())){ ACTION action = (ACTION) object; if (action.getName().equals("eviction") || action.getName().equals("replication")){ foundUserAction = true; } if (action.getName().contains("post")){ foundPostProcessing = true; } } } } assertTrue(foundUserAction); assertFalse(foundPostProcessing); StartupProperties.get().setProperty("falcon.postprocessing.enable", "true"); }
Source:
public void testHashMethod() { Pair<Integer,String> pair1 = new Pair<>(25, "twenty-five"); Pair<Integer,String> pair2 = new Pair<>(25, "twenty-five"); Pair<Integer,String> pair3 = new Pair<>(null, null); assertNotSame(pair1, pair2); assertEquals(pair1.hashCode(), pair2.hashCode()); assertNotSame(pair2, pair3); assertNotEquals(pair2.hashCode(), pair3.hashCode()); }

Target:
public void testHashMethod() { Pair<Integer,String> pair1 = new Pair<>(25, "twenty-five"); Pair<Integer,String> pair2 = new Pair<>(25, "twenty-five"); Pair<Integer,String> pair3 = new Pair<>(null, null); Pair<Integer,String> pair4 = new Pair<>(25, "twentyfive"); Pair<Integer,String> pair5 = new Pair<>(225, "twenty-five"); assertNotSame(pair1, pair2); assertEquals(pair1.hashCode(), pair2.hashCode()); assertNotSame(pair2, pair3); assertNotEquals(pair1.hashCode(), pair4.hashCode()); assertNotEquals(pair1.hashCode(), pair5.hashCode()); }
Source:
public static int reportDRConflict(int partitionId, int remoteClusterId, long remoteTimestamp, String tableName, int action, int deleteConflict, ByteBuffer existingMetaTableForDelete, ByteBuffer existingTupleTableForDelete, ByteBuffer expectedMetaTableForDelete, ByteBuffer expectedTupleTableForDelete, int insertConflict, ByteBuffer existingMetaTableForInsert, ByteBuffer existingTupleTableForInsert, ByteBuffer newMetaTableForInsert, ByteBuffer newTupleTableForInsert) { if (m_conflictManager != null) { return m_conflictManager.resolveConflict(partitionId, remoteClusterId, remoteTimestamp, tableName, DRRecordType.values()[action], DRConflictType.values()[deleteConflict], existingMetaTableForDelete, existingTupleTableForDelete, expectedMetaTableForDelete, expectedTupleTableForDelete, DRConflictType.values()[insertConflict], existingMetaTableForInsert, existingTupleTableForInsert, newMetaTableForInsert, newTupleTableForInsert); } else { assert false : "Community edition should not have any conflicts"; return 0; } }

Target:
public static int reportDRConflict(int partitionId, int remoteClusterId, long remoteTimestamp, String tableName, int action, int deleteConflict, ByteBuffer existingMetaTableForDelete, ByteBuffer existingTupleTableForDelete, ByteBuffer expectedMetaTableForDelete, ByteBuffer expectedTupleTableForDelete, int insertConflict, ByteBuffer existingMetaTableForInsert, ByteBuffer existingTupleTableForInsert, ByteBuffer newMetaTableForInsert, ByteBuffer newTupleTableForInsert) { assert m_conflictManager != null : "Community edition should not have any conflicts"; return m_conflictManager.resolveConflict(partitionId, remoteClusterId, remoteTimestamp, tableName, DRRecordType.values()[action], DRConflictType.values()[deleteConflict], existingMetaTableForDelete, existingTupleTableForDelete, expectedMetaTableForDelete, expectedTupleTableForDelete, DRConflictType.values()[insertConflict], existingMetaTableForInsert, existingTupleTableForInsert, newMetaTableForInsert, newTupleTableForInsert); }
Source:
public Serializable execute(TaskResult... results) throws Throwable { CookieBasedProcessTreeKiller processTreeKiller = null; Process process = null; org.apache.log4j.Logger.getLogger(ProcessTree.class).setLevel(Level.DEBUG); try { ProcessBuilder builder = new ProcessBuilder(getNativeExecLauncher(false)); builder.directory(getExecutablePath(launchersDir).getParentFile().getCanonicalFile()); Map<String, String> environment = builder.environment(); String cookieSuffix = "JavaExecutable_Job" + getVariables().get(SchedulerVars.PA_JOB_ID) + "Task" + getVariables().get(SchedulerVars.PA_TASK_ID); if (!forkMode) { processTreeKiller = CookieBasedProcessTreeKiller.createProcessChildrenKiller(cookieSuffix, environment); } process = builder.start(); BufferedReader sout = new BufferedReader(new InputStreamReader(process.getInputStream())); BufferedReader serr = new BufferedReader(new InputStreamReader(process.getErrorStream())); Thread tsout = new Thread(new ThreadReader(sout, getOut())); Thread tserr = new Thread(new ThreadReader(serr, getErr())); tsout.setDaemon(true); tserr.setDaemon(true); tsout.start(); tserr.start(); process.waitFor(); Thread.sleep(sleep * 1000); } catch (InterruptedException e) { getOut().println("Process Interrupted"); } finally { if (processTreeKiller != null) { processTreeKiller.kill(); } } return true; }

Target:
public Serializable execute(TaskResult... results) throws Throwable { CookieBasedProcessTreeKiller processTreeKiller = null; Process process = null; org.apache.log4j.Logger.getLogger(ProcessTree.class).setLevel(Level.DEBUG); try { ProcessBuilder builder = new ProcessBuilder(getNativeExecLauncher(false)); builder.directory(getExecutablePath(launchersDir).getParentFile().getCanonicalFile()); Map<String, String> environment = builder.environment(); String cookieSuffix = "JavaExecutable_Job" + getVariables().get(SchedulerVars.PA_JOB_ID) + "Task" + getVariables().get(SchedulerVars.PA_TASK_ID); if (!forkMode) { processTreeKiller = CookieBasedProcessTreeKiller.createProcessChildrenKiller(cookieSuffix, environment); } process = builder.start(); redirectStream(process.getInputStream(), getOut()); redirectStream(process.getErrorStream(), getErr()); process.waitFor(); Thread.sleep(sleep * 1000); } catch (InterruptedException e) { getOut().println("Process Interrupted"); } finally { if (processTreeKiller != null) { processTreeKiller.kill(); } } return true; }
Source:
public OvfUpdateProcessHelper(VmDeviceUtils vmDeviceUtils) { Objects.requireNonNull(vmDeviceUtils); this.vmDeviceUtils = vmDeviceUtils; this.ovfManager = new OvfManager(); }

Target:
public OvfUpdateProcessHelper(VmDeviceUtils vmDeviceUtils) { this.vmDeviceUtils = vmDeviceUtils; this.ovfManager = new OvfManager(); }
Source:
public void onExecute() { String text = scriptPanel.getText().trim(); try { groovyShell.evaluate(text); infoLogger.flush(); } catch (CompilationFailedException e) { LOGGER_POPUP.error(I18N.tr("Cannot execute the script"), e); } catch (IOException e) { LOGGER_POPUP.error(I18N.tr("Cannot display the output of the console"), e); } }

Target:
public void onExecute() { String text = scriptPanel.getText().trim(); new GroovyExecutor(text, groovyShell, infoLogger).execute(); }
Source:
public List<String> describeDatabases() { QueryResult result = execute( this.influxDBService.query(this.username, this.password, SHOW_DATABASE_COMMAND_ENCODED)); List<List<Object>> databaseNames = result.getResults().get(0).getSeries().get(0).getValues(); List<String> databases = new ArrayList<>(); if (databaseNames != null) { for (List<Object> database : databaseNames) { databases.add(database.get(0).toString()); } } return databases; }

Target:
public List<String> describeDatabases() { QueryResult result = executeQuery(this.influxDBService.query(this.username, this.password, SHOW_DATABASE_COMMAND_ENCODED)); List<List<Object>> databaseNames = result.getResults().get(0).getSeries().get(0).getValues(); List<String> databases = new ArrayList<>(); if (databaseNames != null) { for (List<Object> database : databaseNames) { databases.add(database.get(0).toString()); } } return databases; }
Source:
private TimedRenderer getCurrentFrame() { if (frames.get(currentFrame) != null) return frames.get(currentFrame); else { return new TimedRenderer() { @Override public void draw(Batch batch) { } @Override public float getHeight() { return 0; } @Override public float getWidth() { return 0; } @Override public void initialize(Object schemaObject) { } public float surplusTime() { return 0; } }; } }

Target:
private TimedRenderer getCurrentFrame() { return frames.get(currentFrame); }
Source:
public boolean run(CommandSender sender, Player playerSender, Command cmd, String commandLabel, String[] args, boolean senderIsConsole) { if (args.length < 2) { return false; } String message = StringUtils.join(ArrayUtils.subarray(args, 1, args.length), " "); String commandSender = sender.getName(); if (!args[0].equalsIgnoreCase(commandSender) && !plugin.al.isSeniorAdmin(sender)) { msg("You don't have permission to assign another users login message!"); return true; } if (args[1].equalsIgnoreCase("delete")) { admin.setLoginMssgae(null); msg("You have deleted your login message!"); return true; } if (args[1].equalsIgnoreCase("set")) { Admin admin = plugin.al.getAdmin(sender); if (message.equalsIgnoreCase(admin.getLoginMessage())) { msg(ChatColor.RED + "The login message can't be the same as its the same as the current login message"); return true; } admin.setLoginMessage(message); msg(FUtil.colorize("The newly set login message is now " + message), ChatColor.GREEN); return true; } return false; }

Target:
public boolean run(CommandSender sender, Player playerSender, Command cmd, String commandLabel, String[] args, boolean senderIsConsole) { if (args.length < 2) { return false; } String message = StringUtils.join(ArrayUtils.subarray(args, 1, args.length), " "); String commandSender = sender.getName(); if (!args[0].equalsIgnoreCase(commandSender) && !plugin.al.isSeniorAdmin(sender)) { msg("You don't have permission to assign another users login message!"); return true; } if (args[1].equalsIgnoreCase("delete")) { admin.setLoginMessage(null); msg("You have deleted your login message!"); return true; } if (args[1].equalsIgnoreCase("set")) { Admin admin = plugin.al.getAdmin(sender); if (message.equalsIgnoreCase(admin.getLoginMessage())) { msg(ChatColor.RED + "The login message can't be the same as its the same as the current login message"); return true; } admin.setLoginMessage(message); msg(FUtil.colorize("The newly set login message is now " + message), ChatColor.GREEN); return true; } return false; }
Source:
private RollingOperation getLastRollingOperation(final ZooKeeperClient client, final String groupName) throws DeploymentGroupDoesNotExistException { for (final String rollingOpId : getRollingOperationIds(client, groupName)) { try { final RollingOperation rolling = getRollingOperation(client, rollingOpId); return rolling; } catch (RollingOperationDoesNotExistException e) { log.warn("Rolling operation associated with deployment group does not exist", rollingOpId, groupName, e); } } return null; }

Target:
RollingOperation getLastRollingOperation(final ZooKeeperClient client, final String groupName) throws DeploymentGroupDoesNotExistException { final List<String> rollingOpIds = getRollingOperationIds(client, groupName); if (!rollingOpIds.isEmpty()) { try { return getRollingOperation(client, rollingOpIds.get(0)); } catch (RollingOperationDoesNotExistException e) { log.warn("Rolling operation associated with deployment group does not exist", rollingOpIds.get(0), groupName, e); } } return null; }
Source:
public void deleteFragment(UUID fragmentId) { m_db.deleteStoryFragment(fragmentId.toString()); }

Target:
public void deleteFragment(UUID fragmentId) { m_db.deleteStoryFragment(fragmentId.toString()); m_fragmentList.remove(fragmentId.toString()); PublishAllFragmentsChanged(); }
Source:
public static boolean equalAsMapSansNullability( RelDataTypeFactory factory, RelDataType type1, RelDataType type2) { assert isMap(type1) && isMap(type2); if (type1.equals(type2)) { return true; } if (isMap(type1) && isMap(type2)) { MapSqlType mType1 = (MapSqlType) type1; MapSqlType mType2 = (MapSqlType) type2; return equalSansNullability(factory, mType1.getKeyType(), mType2.getKeyType()) && equalSansNullability(factory, mType1.getValueType(), mType2.getValueType()); } else { return false; } }

Target:
public static boolean equalAsMapSansNullability( RelDataTypeFactory factory, RelDataType type1, RelDataType type2) { Preconditions.checkArgument(isMap(type1)); Preconditions.checkArgument(isMap(type2)); MapSqlType mType1 = (MapSqlType) type1; MapSqlType mType2 = (MapSqlType) type2; return (type1 == type2) || (equalSansNullability(factory, mType1.getKeyType(), mType2.getKeyType()) && equalSansNullability(factory, mType1.getValueType(), mType2.getValueType())); }
Source:
public Collection<Class<?>> extractServiceInterfaces(Object serviceObject) { Class<?>[] interfaces = serviceObject.getClass().getInterfaces(); List<Class<?>> serviceInterfaces = new ArrayList<>(); for (Class<?> interfaceClass : interfaces) { if (interfaceClass.isAnnotationPresent(Service.class)) { serviceInterfaces.add(interfaceClass); } } return serviceInterfaces; }

Target:
public Collection<Class<?>> extractServiceInterfaces(Object serviceObject) { Class<?>[] interfaces = serviceObject.getClass().getInterfaces(); return Arrays.stream(interfaces) .filter(interfaceClass -> interfaceClass.isAnnotationPresent(Service.class)) .collect(Collectors.toList()); }
Source:
void construct(MWindow window, MToolControl toolControl, Composite composite) { IConfigurationElement configurationElement = ControlContributionRegistry.get(toolControl .getElementId()); if (configurationElement != null) { contribution = (WorkbenchWindowControlContribution) Util.safeLoadExecutableExtension( configurationElement, IWorkbenchRegistryConstants.ATT_CLASS, WorkbenchWindowControlContribution.class); if (contribution != null) { IWorkbenchWindow workbenchWindow = window.getContext().get(IWorkbenchWindow.class); contribution.setWorkbenchWindow(workbenchWindow); if (contribution instanceof IWorkbenchContribution) { ((IWorkbenchContribution) contribution).initialize(workbenchWindow); } MUIElement parent = toolControl.getParent(); while (!(parent instanceof MTrimBar)) { parent = parent.getParent(); } contribution.setCurSide(SWT.TOP); if (parent instanceof MTrimBar) { switch (((MTrimBar) parent).getSide()) { case BOTTOM: contribution.setCurSide(SWT.BOTTOM); break; case LEFT: contribution.setCurSide(SWT.LEFT); break; case RIGHT: contribution.setCurSide(SWT.RIGHT); break; case TOP: contribution.setCurSide(SWT.TOP); break; } } contribution.delegateCreateControl(composite); } } }

Target:
void construct(MWindow window, MToolControl toolControl, Composite composite) { IConfigurationElement configurationElement = ControlContributionRegistry.get(toolControl .getElementId()); if (configurationElement != null) { contribution = (WorkbenchWindowControlContribution) Util.safeLoadExecutableExtension( configurationElement, IWorkbenchRegistryConstants.ATT_CLASS, WorkbenchWindowControlContribution.class); if (contribution != null) { IWorkbenchWindow workbenchWindow = window.getContext().get(IWorkbenchWindow.class); contribution.setWorkbenchWindow(workbenchWindow); if (contribution instanceof IWorkbenchContribution) { ((IWorkbenchContribution) contribution).initialize(workbenchWindow); } MUIElement parent = toolControl.getParent(); while (!(parent instanceof MTrimBar) && parent != null) { parent = parent.getParent(); } if (parent instanceof MTrimBar) { switch (((MTrimBar) parent).getSide()) { case BOTTOM: contribution.setCurSide(SWT.BOTTOM); break; case LEFT: contribution.setCurSide(SWT.LEFT); break; case RIGHT: contribution.setCurSide(SWT.RIGHT); break; case TOP: contribution.setCurSide(SWT.TOP); break; } } else { contribution.setCurSide(SWT.TOP); } contribution.delegateCreateControl(composite); } } }
Source:
public ExpressionTree PREFIXED_BINARY_CAST() { return b.<ExpressionTree>nonterminal(PHPLexicalGrammar.PREFIXED_BINARY_CAST).is( f.prefixedCastExpression( b.firstOf( b.token(PHPPunctuator.LOWER_BINARY_CAST_PREFIX), b.token(PHPPunctuator.UPPER_BINARY_CAST_PREFIX)), b.firstOf( STRING_LITERAL(), NOWDOC_STRING_LITERAL(), HEREDOC_STRING_LITERAL()))); }

Target:
public ExpressionTree PREFIXED_BINARY_CAST() { return b.<ExpressionTree>nonterminal(Kind.PREFIXED_CAST_EXPRESSION).is( f.prefixedCastExpression( b.firstOf( b.token(PHPPunctuator.LOWER_BINARY_CAST_PREFIX), b.token(PHPPunctuator.UPPER_BINARY_CAST_PREFIX)), b.firstOf( STRING_LITERAL(), NOWDOC_STRING_LITERAL(), HEREDOC_STRING_LITERAL()))); }
Source:
public void savePersonAttributeType_shouldNotResultIntoNonUniqueObjectExceptionWithOtherOpenmrsObjects() throws Exception { PatientIdentifierType type = ps.getPatientIdentifierType(1); Person anotherOpemrsObject = personService.getPerson(1); PersonService service = Context.getPersonService(); PersonAttributeType pat = service.getPersonAttributeType(1); service.savePersonAttributeType(pat); try { ps.savePatientIdentifierType(type); personService.savePerson(anotherOpemrsObject); } catch(NonUniqueObjectException e) { fail("Should not throw NonUniqueObjectException"); } }

Target:
public void savePersonAttributeType_shouldNotResultIntoNonUniqueObjectExceptionWithOtherOpenmrsObjects() throws Exception { PatientIdentifierType type = ps.getPatientIdentifierType(1); ConceptService conceptService = Context.getConceptService(); ConceptClass anotherOpemrsObject = conceptService.getConceptClass(1); PersonService service = Context.getPersonService(); PersonAttributeType pat = service.getPersonAttributeType(1); service.savePersonAttributeType(pat); try { ps.savePatientIdentifierType(type); conceptService.saveConceptClass(anotherOpemrsObject); } catch(NonUniqueObjectException e) { fail("Should not throw NonUniqueObjectException"); } }
Source:
public void onError(JSONObject error) { if (error != null) { System.err.println("Default error handler invoked: " + error.toString()); } else { new Throwable().printStackTrace(System.err); } }

Target:
public void onError(JSONObject error) { if (error != null) { Log.e(ResponseListener.LOG_TAG, "Default error handler invoked: " + error.toString()); } }
Source:
public void testReplaceIllegalChars() { String str = null; assertEquals(null, StringHelper.replaceIllegalChars(str, FieldValidator.REGEX_COURSE_ID, '_')); str = ""; assertEquals("", StringHelper.replaceIllegalChars(str, FieldValidator.REGEX_COURSE_ID, '_')); str = "abc"; assertEquals("abc", StringHelper.replaceIllegalChars(str, FieldValidator.REGEX_COURSE_ID, '_')); str = "illegal!?Chars+1"; assertEquals("illegal__Chars_1", StringHelper.replaceIllegalChars(str, FieldValidator.REGEX_COURSE_ID, '_')); assertEquals("illegal..Chars.1", StringHelper.replaceIllegalChars(str, FieldValidator.REGEX_COURSE_ID, '.')); }

Target:
public void testReplaceIllegalChars() { String regex = "[a-zA-Z0-9_.$-]+"; String str = null; assertEquals(null, StringHelper.replaceIllegalChars(str, regex, '_')); str = ""; assertEquals("", StringHelper.replaceIllegalChars(str, regex, '_')); str = "abc"; assertEquals("abc", StringHelper.replaceIllegalChars(str, regex, '_')); str = "illegal!?Chars+1"; assertEquals("illegal__Chars_1", StringHelper.replaceIllegalChars(str, regex, '_')); assertEquals("illegal..Chars.1", StringHelper.replaceIllegalChars(str, regex, '.')); }
Source:
private void setClipboard() { clipboard.registerPasteListener(Scene.class, new ScenePasteListener( this)); clipboard.registerPasteListener(SceneElement.class, new SceneElementPasteListener(this)); }

Target:
private void setClipboard() { clipboard.registerPasteListener(EditorScene.class, new ScenePasteListener(this)); clipboard.registerPasteListener(SceneElement.class, new SceneElementPasteListener(this)); }
Source:
public Function<List<String>, List<String>> finisher() { return null; }

Target:
public Function<List<String>, List<String>> finisher() { return (inputList) -> inputList; }
Source:
public FieldSort(String field) { this.field = field; this.sort = Direction.ASCENDING; }

Target:
public FieldSort(String field) { this(field, Direction.ASCENDING); }
Source:
public int getLevel() { return data.optInt("toclevel"); }

Target:
public int getLevel() { return data.optInt("toclevel", 1); }
Source:
private VolumeType getType() { if ((getStorageDomain().getStorageType().isBlockDomain() || getStorageDomain().getStorageType().isFileDomain()) && getParameters().getVolumeFormat() == VolumeFormat.RAW) { return VolumeType.Preallocated; } return VolumeType.Sparse; }

Target:
private VolumeType getType() { if (getStorageDomain().getStorageType().isInternal() && getParameters().getVolumeFormat() == VolumeFormat.RAW) { return VolumeType.Preallocated; } return VolumeType.Sparse; }
Source:
public Integer getReadTimeoutOrDefault() { if (Objects.isNull(readTimeout)) { return defaultReadTimeout; } return readTimeout; }

Target:
public Integer getReadTimeoutOrDefault() { if (null == readTimeout) { return defaultReadTimeout; } return readTimeout; }
Source:
public void prepare() throws Exception { super.init(userMode); }

Target:
public void prepare() throws XPathExpressionException { super.init(userMode); }
Source:
public void visitNode(Tree tree) { CatchTree catchTree = (CatchTree) tree; boolean isRethrowing = false; boolean isLogging = false; List<Location> secondaryLocations = new ArrayList<>(); for (StatementTree statementTree : catchTree.block().body()) { if (statementTree.is(Tree.Kind.THROW_STATEMENT)) { secondaryLocations.add(new Location("", ((ThrowStatementTree) statementTree).expression())); isRethrowing = true; } else if (isLoggingMethod(statementTree, catchTree.parameter().simpleName().name())) { secondaryLocations.add(new Location("", statementTree)); isLogging = true; } } if (isLogging && isRethrowing) { reportIssue(catchTree.parameter(), "Either log this exception and handle it, or rethrow it with some contextual information.", secondaryLocations, 0); } }

Target:
public void visitNode(Tree tree) { if (!hasSemantic()) { return; } CatchTree catchTree = (CatchTree) tree; boolean isLogging = false; List<Location> secondaryLocations = new ArrayList<>(); for (StatementTree statementTree : catchTree.block().body()) { IdentifierTree exceptionIdentifier = catchTree.parameter().simpleName(); if (isLogging && statementTree.is(Tree.Kind.THROW_STATEMENT) && isExceptionUsed(exceptionIdentifier, ((ThrowStatementTree) statementTree).expression())) { secondaryLocations.add(new Location("", ((ThrowStatementTree) statementTree).expression())); reportIssue(catchTree.parameter(), "Either log this exception and handle it, or rethrow it with some contextual information.", secondaryLocations, 0); return; } else if (isLoggingMethod(statementTree, exceptionIdentifier)) { secondaryLocations.add(new Location("", statementTree)); isLogging = true; } } }
Source:
public DataContainer toContainer() { final DataContainer container = new MemoryDataContainer(); container.set(Queries.CONTENT_VERSION, getContentVersion()) .set(DataQuery.of("ColorIndex"), this.colorIndex); return container; }

Target:
public DataContainer toContainer() { final DataContainer container = DataContainer.createNew(); container.set(Queries.CONTENT_VERSION, getContentVersion()) .set(DataQueries.MAP_COLOR_INDEX, this.colorIndex); return container; }
Source:
public boolean correspondsTo(AttributeType attribute) { return Objects.equals(this.uri, attribute.getName()) || Objects.equals(this.friendlyName, attribute.getFriendlyName()); }

Target:
public boolean correspondsTo(AttributeType attribute) { return attribute != null ? Objects.equals(this.uri, attribute.getName()) || Objects.equals(this.friendlyName, attribute.getFriendlyName()) : false; }
Source:
public Object executeInTransaction(DataStore dataStore, Transactional action) { log.debug("executeInTransaction"); Object result = null; try (DataStoreTransaction tx = dataStore.beginTransaction()) { JsonApiDocument jsonApiDoc = new JsonApiDocument(); MultivaluedMap<String, String> queryParams = new MultivaluedHashMap<String, String>(); RequestScope scope = new RequestScope("query", jsonApiDoc, tx, null, queryParams, elide.getElideSettings()); result = action.execute(tx, scope); tx.commit(scope); tx.flush(scope); } catch (IOException e) { log.error("IOException: {}", e); } catch (Exception e) { log.error("Exception: {}", e); } return result; }

Target:
protected Object executeInTransaction(DataStore dataStore, Transactional action) { log.debug("executeInTransaction"); Object result = null; try (DataStoreTransaction tx = dataStore.beginTransaction()) { JsonApiDocument jsonApiDoc = new JsonApiDocument(); MultivaluedMap<String, String> queryParams = new MultivaluedHashMap<String, String>(); RequestScope scope = new RequestScope("query", jsonApiDoc, tx, null, queryParams, elide.getElideSettings()); result = action.execute(tx, scope); tx.commit(scope); tx.flush(scope); } catch (IOException e) { log.error("IOException: {}", e); } catch (Exception e) { log.error("Exception: {}", e); } return result; }
Source:
public Session build() { return new Session( queryId, Optional.ofNullable(transactionId), clientTransactionSupport, identity, Optional.ofNullable(source), Optional.ofNullable(catalog), Optional.ofNullable(schema), this.traceToken, timeZoneKey, locale, Optional.ofNullable(remoteUserAddress), Optional.ofNullable(userAgent), Optional.ofNullable(clientInfo), clientTags, Optional.ofNullable(resourceEstimates).orElse(new ResourceEstimateBuilder().build()), startTime, systemProperties, ImmutableMap.of(), catalogSessionProperties, sessionPropertyManager, preparedStatements); }

Target:
public Session build() { return new Session( queryId, Optional.ofNullable(transactionId), clientTransactionSupport, identity, Optional.ofNullable(source), Optional.ofNullable(catalog), Optional.ofNullable(schema), traceToken, timeZoneKey, locale, Optional.ofNullable(remoteUserAddress), Optional.ofNullable(userAgent), Optional.ofNullable(clientInfo), clientTags, Optional.ofNullable(resourceEstimates).orElse(new ResourceEstimateBuilder().build()), startTime, systemProperties, ImmutableMap.of(), catalogSessionProperties, sessionPropertyManager, preparedStatements); }
Source:
private String addKubernetesToTrustStore() throws IOException, FileNotFoundException, CertificateException, KeyStoreException, NoSuchAlgorithmException{ String javaHome = System.getenv("JAVA_HOME"); String defaultTrustStorePath = javaHome + "/jre/lib/security/cacerts"; String destinationTrustStorePath = "/service/var/cacerts"; String certfile = "/var/run/secrets/kubernetes.io/serviceaccount/ca.crt"; String alias = "kubernetes-root-ca-cert"; char[] password = "changeit".toCharArray(); File f = new File(certfile); if(f.exists() && !f.isDirectory()) { System.out.println("Detected Kubernetes Cert."); File source = new File(defaultTrustStorePath); File dest = new File(destinationTrustStorePath); Files.copy(source.toPath(), dest.toPath(), StandardCopyOption.REPLACE_EXISTING); FileInputStream is = new FileInputStream(destinationTrustStorePath); KeyStore keystore = KeyStore.getInstance(KeyStore.getDefaultType()); keystore.load(is, password); is.close(); CertificateFactory cf = CertificateFactory.getInstance("X.509"); InputStream certstream = getCertStream (certfile); Certificate certs = cf.generateCertificate(certstream); certstream.close(); keystore.setCertificateEntry(alias, certs); FileOutputStream out = new FileOutputStream(destinationTrustStorePath); keystore.store(out, password); out.close(); System.out.println("Created new TrustStore with Kubernetes Certificate"); return destinationTrustStorePath; } else{ System.out.println("Kubernetes CA cert not found. Skipping."); return defaultTrustStorePath; } }

Target:
private String addKubernetesToTrustStore() { File certFile = new File("/var/run/secrets/kubernetes.io/serviceaccount/ca.crt"); if (certFile.exists() && certFile.isFile()) { String javaHome = System.getProperty("java.home"); if (javaHome == null) { System.out.println("System Property java.home not set."); System.exit(STATUS_GENERIC_ERROR); } File sourceTS = new File(javaHome + "/lib/security/cacerts"); File destinationTS = new File(dataDir + "/var/cacerts"); String alias = "kubernetes-root-ca-cert"; char[] password = "changeit".toCharArray(); try (FileInputStream sourceIs = new FileInputStream(sourceTS); FileOutputStream destinationOs = new FileOutputStream(destinationTS); FileInputStream certIs = new FileInputStream(certFile)) { KeyStore keystore = KeyStore.getInstance(KeyStore.getDefaultType()); keystore.load(sourceIs, password); BufferedInputStream bis = new BufferedInputStream(certIs); CertificateFactory cf = CertificateFactory.getInstance("X.509"); Certificate cert = cf.generateCertificate(bis); keystore.setCertificateEntry(alias, cert); keystore.store(destinationOs, password); } catch (KeyStoreException | IOException | CertificateException | NoSuchAlgorithmException e) { throw new RuntimeException("Configuring TLS TrustStore", e); } if (verbose) { System.out.println("Created new TrustStore with Kubernetes Certificate"); } return destinationTS.getAbsolutePath(); } else { return null; } }
Source:
public MonotonicityAwareMailbox(MonotonicityAwareReceiver receiver, ReteContainer container) { this.receiver = receiver; this.container = container; this.tracker = container.getTracker(); this.monotoneQueue = new DefaultMailbox(null, null); this.nonMonotoneQueue = new DefaultMailbox(null, null); this.monotoneBuffer = new DefaultMailbox(null, null); this.antiMonotoneBuffer = new DefaultMailbox(null, null); this.deliveringMonotone = false; this.deliveringNonMonotone = false; }

Target:
public MonotonicityAwareMailbox(MonotonicityAwareReceiver receiver, ReteContainer container) { this.receiver = receiver; this.container = container; this.tracker = container.getTracker(); this.monotoneQueue = new DefaultMailbox(null, null); this.antiMonotoneQueue = new DefaultMailbox(null, null); this.monotoneBuffer = new DefaultMailbox(null, null); this.antiMonotoneBuffer = new DefaultMailbox(null, null); this.deliveringMonotone = false; this.deliveringAntiMonotone = false; }
Source:
public void onClick(View arg0) { SharedPreferences.Editor edit = prefs.edit(); if (prefs.getInt("logimages", 1) == 0) { edit.putInt("logimages", 1); settings.storeLogImg = 1; } else { edit.putInt("logimages", 0); settings.storeLogImg = 0; } edit.commit(); CheckBox saveLogImgButton = (CheckBox) findViewById(R.id.save_log_img); if (prefs.getInt("logimages", 1) == 0) { saveLogImgButton.setChecked(false); } else { saveLogImgButton.setChecked(true); } return; }

Target:
public void onClick(View arg0) { SharedPreferences.Editor edit = prefs.edit(); if (prefs.getBoolean("logimages", true) == false) { edit.putBoolean("logimages", true); settings.storelogimages = true; } else { edit.putBoolean("logimages", false); settings.storelogimages = false; } edit.commit(); CheckBox saveLogImgButton = (CheckBox) findViewById(R.id.save_log_img); if (prefs.getBoolean("logimages", true) == false) { saveLogImgButton.setChecked(false); } else { saveLogImgButton.setChecked(true); } return; }
Source:
public static boolean isFileOversizeWarningDisabled() { if (CommCareApplication.instance().isConsumerApp()) { return false; } SharedPreferences properties = CommCareApplication.instance().getCurrentApp().getAppPreferences(); return PrefValues.YES.equals(properties.getString(FILE_OVERSIZE_WARNING, PrefValues.NO)); }

Target:
public static boolean isFileOversizeWarningDisabled() { SharedPreferences properties = CommCareApplication.instance().getCurrentApp().getAppPreferences(); return PrefValues.YES.equals(properties.getString(FILE_OVERSIZE_WARNING, PrefValues.NO)); }
Source:
public void initialize(){ ScheduleExpression scheduleExpression = new ScheduleExpression(); scheduleExpression.hour("*"); scheduleExpression.minute("*"); scheduleExpression.second("*/5"); TimerConfig timerConfig = new TimerConfig(); timerConfig.setInfo("Every 5 second timer"); timerService.createCalendarTimer(scheduleExpression, timerConfig); }

Target:
public void initialize() { ScheduleExpression scheduleExpression = new ScheduleExpression() .hour("*") .minute("*") .second("*/5"); TimerConfig timerConfig = new TimerConfig(); timerConfig.setInfo("Every 5 second timer"); timerService.createCalendarTimer(scheduleExpression, timerConfig); }
Source:
public Object getDimSelector() { return selectorPlus.getSelector(); }

Target:
public DimensionSelector getDimSelector() { return (DimensionSelector) selectorPlus.getSelector(); }
Source:
protected void setFrameFocus(final IFrameDMContext newFrame, ImmediateRequestMonitor rm) { if (isThreadSuspended(getThreadFromFrame(newFrame))) { ICommand<MIInfo> command = fCommandFactory.createMIStackSelectFrame(newFrame, newFrame.getLevel()); fCommandControl.queueCommand(command, new ImmediateDataRequestMonitor<MIInfo>(rm) {}); } fCurrentStackFrameCtx = newFrame; }

Target:
private void setFrameFocus(final IFrameDMContext newFrame, ImmediateRequestMonitor rm) { if (newFrame == null) { GdbPlugin.logErrorMessage("GdbSynchronizer unable to resolve frame context for the selected element"); return; } IExecutionDMContext newThread = getThreadFromFrame(newFrame); if (isThreadSuspended(newThread)) { ICommand<MIInfo> command = fCommandFactory.createMIStackSelectFrame(newFrame, newFrame.getLevel()); fCommandControl.queueCommand(command, new ImmediateDataRequestMonitor<MIInfo>(rm) {}); } fCurrentThreadCtx = newThread; fCurrentStackFrameCtx = newFrame; }
Source:
public void testGetAnalysisRequirements() { Iterable<TmfAnalysisRequirement> requirements = fKernelAnalysisModule.getAnalysisRequirements(); assertNotNull(requirements); assertTrue(requirements.iterator().hasNext()); TmfAnalysisRequirement eventReq = null; TmfAnalysisRequirement domainReq = null; int numberOfRequirement = 0; for (TmfAnalysisRequirement requirement : requirements) { ++numberOfRequirement; if (requirement.getType().equals(SessionConfigStrings.CONFIG_ELEMENT_EVENT)) { eventReq = requirement; } else if (requirement.getType().equals(SessionConfigStrings.CONFIG_ELEMENT_DOMAIN)) { domainReq = requirement; } } assertNotNull(eventReq); assertNotNull(domainReq); assertEquals(2, numberOfRequirement); assertEquals(1, domainReq.getValues().size()); for (String domain : domainReq.getValues()) { assertEquals(SessionConfigStrings.CONFIG_DOMAIN_TYPE_KERNEL, domain); } Set<String> expectedEvents = ImmutableSet.of( LttngStrings.EXIT_SYSCALL, LttngStrings.IRQ_HANDLER_ENTRY, LttngStrings.IRQ_HANDLER_EXIT, LttngStrings.SOFTIRQ_ENTRY, LttngStrings.SOFTIRQ_EXIT, LttngStrings.SOFTIRQ_RAISE, LttngStrings.SCHED_SWITCH, LttngStrings.SCHED_PROCESS_FORK, LttngStrings.SCHED_PROCESS_EXIT, LttngStrings.SCHED_PROCESS_FREE, LttngStrings.STATEDUMP_PROCESS_STATE, LttngStrings.SCHED_WAKEUP, LttngStrings.SCHED_WAKEUP_NEW, LttngStrings.SYSCALL_PREFIX ); assertEquals(14, eventReq.getValues().size()); for (String event : eventReq.getValues()) { assertTrue("Unexpected event " + event, expectedEvents.contains(event)); } }

Target:
public void testGetAnalysisRequirements() { Iterable<TmfAnalysisRequirement> requirements = fKernelAnalysisModule.getAnalysisRequirements(); assertNotNull(requirements); TmfAnalysisRequirement eventReq = null; TmfAnalysisRequirement domainReq = null; int numberOfRequirement = 0; for (TmfAnalysisRequirement requirement : requirements) { ++numberOfRequirement; if (requirement.getType().equals(SessionConfigStrings.CONFIG_ELEMENT_EVENT)) { eventReq = requirement; } else if (requirement.getType().equals(SessionConfigStrings.CONFIG_ELEMENT_DOMAIN)) { domainReq = requirement; } } assertNotNull(eventReq); assertNotNull(domainReq); assertEquals(2, numberOfRequirement); assertEquals(1, domainReq.getValues().size()); for (String domain : domainReq.getValues()) { assertEquals(SessionConfigStrings.CONFIG_DOMAIN_TYPE_KERNEL, domain); } Set<String> expectedEvents = ImmutableSet.of( LttngStrings.EXIT_SYSCALL, LttngStrings.IRQ_HANDLER_ENTRY, LttngStrings.IRQ_HANDLER_EXIT, LttngStrings.SOFTIRQ_ENTRY, LttngStrings.SOFTIRQ_EXIT, LttngStrings.SOFTIRQ_RAISE, LttngStrings.SCHED_SWITCH, LttngStrings.SCHED_PROCESS_FORK, LttngStrings.SCHED_PROCESS_EXIT, LttngStrings.SCHED_PROCESS_FREE, LttngStrings.STATEDUMP_PROCESS_STATE, LttngStrings.SCHED_WAKEUP, LttngStrings.SCHED_WAKEUP_NEW, LttngStrings.SYSCALL_PREFIX ); assertEquals(14, eventReq.getValues().size()); for (String event : eventReq.getValues()) { assertTrue("Unexpected event " + event, expectedEvents.contains(event)); } }
Source:
public Iterator<IRefactorParticipant> getRefactorParticipants() { return refactorParticipantsList.iterator(); }

Target:
public List<IRefactorParticipant> getRefactorParticipants() { return Collections.unmodifiableList(refactorParticipantsList); }
Source:
private String[] makeAccessibleHorizontalLabels(String[] horizontalLabels) { String[] accessibleLabels = new String[horizontalLabels.length]; for (int i = 0; i < horizontalLabels.length; i++) { if (getTimeframe() == StatsTimeframe.MONTH) { accessibleLabels[i] = StatsUtils.parseDate(horizontalLabels[i], "MMM", "MMMM"); } else if (getTimeframe() == StatsTimeframe.WEEK) { accessibleLabels[i] = getString(R.string.stats_bar_week_desc, horizontalLabels[i]); } else { accessibleLabels[i] = horizontalLabels[i]; } } return accessibleLabels; }

Target:
private String[] makeAccessibleHorizontalLabels(String[] horizontalLabels) { String[] accessibleLabels = new String[horizontalLabels.length]; for (int i = 0; i < horizontalLabels.length; i++) { if (getTimeframe() == StatsTimeframe.MONTH) { accessibleLabels[i] = StatsUtils.parseDate( horizontalLabels[i], StatsConstants.STATS_OUTPUT_DATE_MONTH_SHORT_FORMAT, StatsConstants.STATS_OUTPUT_DATE_MONTH_LONG_FORMAT); } else if (getTimeframe() == StatsTimeframe.WEEK) { accessibleLabels[i] = getString(R.string.stats_bar_week_desc, StatsUtils.parseDate( horizontalLabels[i], StatsConstants.STATS_OUTPUT_DATE_MONTH_SHORT_DAY_SHORT_FORMAT, StatsConstants.STATS_OUTPUT_DATE_MONTH_LONG_DAY_SHORT_FORMAT)); } else { accessibleLabels[i] = horizontalLabels[i]; } } return accessibleLabels; }