auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>protected Block computeSpan(SpanType type, Attributes attributes) { switch (type) { case LINK: if (attributes instanceof LinkAttributes) { return new LinkBlock((LinkAttributes) attributes); <START> } else { <END> return new ContentBlock("<", ">"); } case ITALIC: case EMPHASIS: return new ContentBlock("*", "*"); case BOLD: case STRONG: return new ContentBlock("**", "**"); case CODE: return new CodeSpan(); default: Logger.getLogger(getClass().getName()).warning("Unexpected block type: " + type); return new ContentBlock("", ""); } }</code><technical_language>need for else if statement</technical_language>

Target:
protected Block computeSpan(SpanType type, Attributes attributes) { switch (type) { case LINK: if (attributes instanceof LinkAttributes) { return new LinkBlock((LinkAttributes) attributes); } return new ContentBlock("<", ">"); case ITALIC: case EMPHASIS: return new ContentBlock("*", "*"); case BOLD: case STRONG: return new ContentBlock("**", "**"); case CODE: return new CodeSpan(); default: Logger.getLogger(getClass().getName()).warning("Unexpected block type: " + type); return new ContentBlock("", ""); } }
Source:
<code>static Options processSpecialOptionKey(Options options, Enum<?> specialOptionKey) { if (specialOptionKey != null && options.containsKey(specialOptionKey)) { final TermFilter termFilter = options.get(specialOptionKey, TermFilter.class); <START> String specialOption = termFilter.getTerm(); <END> if (specialOption != null && specialOption.startsWith(SPECIAL_OPTION_CHARACTER) && specialOption.endsWith(")")) { String fieldAndValueWithParenSeparator = specialOption.substring(1, specialOption.length() - 1); int separatorIdx = fieldAndValueWithParenSeparator.indexOf("("); if (separatorIdx != -1) { String field = fieldAndValueWithParenSeparator.substring(0, separatorIdx).toUpperCase(); String value = fieldAndValueWithParenSeparator.substring(separatorIdx + 1); if (!CompareUtils.isEmpty(field) && !CompareUtils.isEmpty(value)) { OptionsBuilder newOptions = Options.builder(); if (specialOptionKey.name().equals(field)) { newOptions.put(field, TermFilter.builder(termFilter).term(value)); } else { newOptions.put(field, value); } for (String key : options.keySet()) { if (!specialOptionKey.name().equals(key)) { newOptions.put(key, options.get(key)); } } return newOptions.build(); } } } } return options; }</code><technical_language>Please original feature intact add extractor extract term for special option key handler</technical_language>

Target:
static Options processSpecialOptionKey(Options options, Enum<?> specialOptionKey) { return processSpecialOptionKey(options, specialOptionKey, Options::getString); }
Source:
<code>public void start() { notifierThread = Execs.makeThread( threadName, () -> { while (!Thread.interrupted()) { try { logger.debug("Waiting for cache update notification"); Set<String> itemsToUpdateSnapshot; HashMap<String, byte[]> serializedMapsSnapshot; synchronized (itemsToUpdate) { if (itemsToUpdate.isEmpty()) { <START> itemsToUpdate.wait(); <END> } itemsToUpdateSnapshot = new HashSet<>(itemsToUpdate); serializedMapsSnapshot = new HashMap<String, byte[]>(serializedMaps); itemsToUpdate.clear(); serializedMaps.clear(); } logger.debug("Sending cache update notifications"); for (String authorizer : itemsToUpdateSnapshot) { BasicAuthDBConfig authorizerConfig = itemConfigMap.get(authorizer); if (!authorizerConfig.isEnableCacheNotifications()) { continue; } List<ListenableFuture<StatusResponseHolder>> futures = sendUpdate( authorizer, serializedMapsSnapshot.get(authorizer) ); for (ListenableFuture<StatusResponseHolder> future : futures) { try { StatusResponseHolder srh = future.get( authorizerConfig.getCacheNotificationTimeout(), TimeUnit.MILLISECONDS ); logger.debug("Got status: " + srh.getStatus()); } catch (Exception e) { logger.makeAlert(e, "Failed to get response for cache notification.").emit(); } } } logger.debug("Received responses for cache update notifications."); } catch (Throwable t) { logger.makeAlert(t, "Error occured while handling updates for cachedUserMaps.").emit(); } } }, true ); notifierThread.start(); }</code><technical_language>Well, I BlockingQueue is simple worry synchronization</technical_language>

Target:
public void start() { exec.submit( () -> { while (!Thread.interrupted()) { try { LOG.debug(callerName + ":Waiting for cache update notification"); Pair<String, byte[]> update = updateQueue.take(); String authorizer = update.lhs; byte[] serializedMap = update.rhs; BasicAuthDBConfig authorizerConfig = itemConfigMap.get(update.lhs); if (!authorizerConfig.isEnableCacheNotifications()) { continue; } LOG.debug(callerName + ":Sending cache update notifications"); List<ListenableFuture<StatusResponseHolder>> futures = sendUpdate( authorizer, serializedMap ); try { List<StatusResponseHolder> responses = Futures.allAsList(futures) .get( authorizerConfig.getCacheNotificationTimeout(), TimeUnit.MILLISECONDS ); for (StatusResponseHolder response : responses) { LOG.debug(callerName + ":Got status: " + response.getStatus()); } } catch (Exception e) { LOG.makeAlert(e, callerName + ":Failed to get response for cache notification.").emit(); } LOG.debug(callerName + ":Received responses for cache update notifications."); } catch (Throwable t) { LOG.makeAlert(t, callerName + ":Error occured while handling updates for cachedUserMaps.").emit(); } } } ); }
Source:
<code>MasterRegistry(Configuration conf) throws IOException { this.hedgedReadFanOut = Math.max(1, conf.getInt(MASTER_REGISTRY_HEDGED_REQS_FANOUT_KEY, MASTER_REGISTRY_HEDGED_REQS_FANOUT_DEFAULT)); rpcTimeoutMs = (int) Math.min(Integer.MAX_VALUE, conf.getLong(HConstants.HBASE_RPC_TIMEOUT_KEY, HConstants.DEFAULT_HBASE_RPC_TIMEOUT)); rpcClient = RpcClientFactory.createClient(conf, null); rpcControllerFactory = RpcControllerFactory.instantiate(conf); populateMasterStubs(parseMasterAddrs(conf)); Runnable masterEndPointRefresher = () -> { while (!Thread.interrupted()) { try { synchronized (refreshMasters) { refreshMasters.wait(WAIT_TIME_OUT_MS); } LOG.debug("Attempting to refresh master address end points."); Set<ServerName> newMasters = new HashSet<>(getMasters().get()); populateMasterStubs(newMasters); LOG.debug("Finished refreshing master end points. {}", newMasters); } catch (InterruptedException e) { LOG.debug("Interrupted during wait, aborting refresh-masters-thread.", e); break; } catch (ExecutionException | IOException e) { LOG.debug("Error populating latest list of masters.", e); } } }; masterAddrRefresherThread = Threads.newDaemonThreadFactory( "MasterRegistry refresh end-points").newThread(masterEndPointRefresher); <START> masterAddrRefresherThread.start(); <END> }</code><technical_language>want SingleThreadExecutor.submit()</technical_language>

Target:
MasterRegistry(Configuration conf) throws IOException { this.hedgedReadFanOut = Math.max(1, conf.getInt(MASTER_REGISTRY_HEDGED_REQS_FANOUT_KEY, MASTER_REGISTRY_HEDGED_REQS_FANOUT_DEFAULT)); rpcTimeoutMs = (int) Math.min(Integer.MAX_VALUE, conf.getLong(HConstants.HBASE_RPC_TIMEOUT_KEY, HConstants.DEFAULT_HBASE_RPC_TIMEOUT)); rpcClient = RpcClientFactory.createClient(conf, null); rpcControllerFactory = RpcControllerFactory.instantiate(conf); populateMasterStubs(parseMasterAddrs(conf)); masterAddressRefresher = new MasterAddressRefresher(conf, this); }
Source:
<code>public boolean hasNext() { <START> return super.hasNext() || this.stashedStarts.peek() != null; <END> }</code><technical_language>this.stashedStarts.isEmpty()</technical_language>

Target:
public boolean hasNext() { return super.hasNext() || !this.stashedStarts.isEmpty(); }
Source:
<code>RegisteredConsumer(EventConsumer consumer, Set<String> eventTypes) { this.consumer = consumer; <START> this.eventTypes = unmodifiableSet(eventTypes); <END> }</code><technical_language>Do need wrap in unmodifiable set? a copy is change it</technical_language>

Target:
RegisteredConsumer(EventConsumer consumer, Set<String> eventTypes) { this.consumer = consumer; this.eventTypes.addAll(eventTypes); }
Source:
<code>public void handleFlush(Object input) { TreeNodeCompareInput treeNodeCompareInput = (TreeNodeCompareInput)input; EObject eobject = treeNodeCompareInput.getComparisonObject(); Comparison comparison; <START> if (eobject instanceof Match) { comparison = ((Match)eobject).getComparison(); } else if (eobject instanceof Diff) { comparison = ((Diff)eobject).getMatch().getComparison(); } else if (eobject instanceof MatchResource) { comparison = ((MatchResource)eobject).getComparison(); } else { return; } <END> Predicate<Conflict> unresolvedConflict = new Predicate<Conflict>() { public boolean apply(Conflict conflict) { return conflict != null && conflict.getKind() != ConflictKind.PSEUDO && Iterables.any(conflict.getDifferences(), EMFComparePredicates .hasState(DifferenceState.UNRESOLVED)); } }; if (Iterables.any(comparison.getConflicts(), unresolvedConflict)) { mergeResolutionListenerRegistry.mergeResolutionCompleted(comparison); } }</code><technical_language>Please ComparisonUtil.getComparison(eObject) instead</technical_language>

Target:
public void handleFlush(Object input) { TreeNodeCompareInput treeNodeCompareInput = (TreeNodeCompareInput)input; EObject eobject = treeNodeCompareInput.getComparisonObject(); Comparison comparison = ComparisonUtil.getComparison(eobject); if (comparison == null) { return; } Predicate<Conflict> unresolvedConflict = new Predicate<Conflict>() { public boolean apply(Conflict conflict) { return conflict != null && conflict.getKind() != ConflictKind.PSEUDO && Iterables.any(conflict.getDifferences(), EMFComparePredicates .hasState(DifferenceState.UNRESOLVED)); } }; if (Iterables.any(comparison.getConflicts(), unresolvedConflict)) { mergeResolutionListenerRegistry.mergeResolutionCompleted(comparison); } }
Source:
<code>public void testIsMetacardTransformerIdValidBadId() throws CatalogTransformerException { BinaryContent binaryContent = mock(BinaryContent.class); MultiMetacardTransformer transformer = mock(MultiMetacardTransformer.class); <START> when(transformer.transform(any(List.class), any(Map.class))) <END> .thenReturn(Collections.singletonList(binaryContent)); when(transformerLocator.findMultiMetacardTransformers(eq("xyz"))) .thenReturn(Collections.singletonList(transformer)); boolean isValid = transform.isMetacardTransformerIdValid("xxx"); assertThat(isValid, is(false)); }</code><technical_language>Is this stubbing necessary for test</technical_language>

Target:
public void testIsMetacardTransformerIdValidBadId() { MultiMetacardTransformer transformer = mock(MultiMetacardTransformer.class); when(transformerLocator.findMultiMetacardTransformers(eq("xyz"))) .thenReturn(Collections.singletonList(transformer)); boolean isValid = transform.isMetacardTransformerIdValid("xxx"); assertThat(isValid, is(false)); }
Source:
<code>protected void assertHasAccess(String message, PID pid, Permission permission) throws SwordError { if (!aclService.hasAccess(pid, getAgentPrincipals().getPrincipals(), permission)) { <START> throw new SwordError(ErrorURIRegistry.INSUFFICIENT_PRIVILEGES, 403, message); <END> } }</code><technical_language>mind Response.Status.Forbidden here</technical_language>

Target:
protected void assertHasAccess(String message, PID pid, Permission permission) throws SwordError { if (!aclService.hasAccess(pid, getAgentPrincipals().getPrincipals(), permission)) { throw new SwordError(ErrorURIRegistry.INSUFFICIENT_PRIVILEGES, SC_FORBIDDEN, message); } }
Source:
<code>public void testDummyScriptExecutionAndLoggerConsumer() throws Exception { <START> System.setProperty("tc.install-root", "src" + File.separator + "test" + File.separator + <END> "resources" + File.separator + "parent"); ConfigToolScriptExecutor configToolScriptExecutor = new ConfigToolScriptExecutor(); String[] cmd = new String[]{"detach", "-t", "stripe", "-d", "localhost:" + node1.getInternalAddress().toString(), "-s", node2.getInternalAddress().toString()}; int exitStatus = configToolScriptExecutor.execCommand(cmd, consumer); Assert.assertThat(sb.toString(), containsString("starting the script")); Assert.assertThat(sb.toString(), containsString("error:")); Assert.assertEquals(2, exitStatus); }</code><technical_language>I script resource instead of src directory itself, need tweak test-resources processing config in pom set executable permission copy resources tmp directory, change permissions execute</technical_language>

Target:
public void testDummyScriptExecutionAndLoggerConsumer() throws Exception { Path toolsDir = temporaryFolder.newFolder().toPath().resolve("tools"); Path binDir = toolsDir.resolve("bin"); Files.createDirectories(binDir); installScript("/tools/bin/config-tool.bat", binDir); installScript("/tools/bin/config-tool.sh", binDir); System.setProperty("tc.install-root", toolsDir.toString()); ConfigToolScriptExecutor configToolScriptExecutor = new ConfigToolScriptExecutor(); String[] cmd = new String[]{"detach", "-t", "stripe", "-d", "localhost:" + node1.getInternalAddress().toString(), "-s", node2.getInternalAddress().toString()}; int exitStatus = configToolScriptExecutor.execCommand(cmd, consumer); assertThat(sb.toString(), containsString("starting the script")); assertThat(sb.toString(), containsString("error:")); assertThat(exitStatus, is(2)); }
Source:
<code>public int[] downloadSetupConfigurations(){ int[] result = new int[2]; try { List<SetupConfiguration> setupConfigurations = setupConfigurationController.downloadAllSetupConfigurations(); result[0] = SyncStatusConstants.SUCCESS; result[1] = setupConfigurations.size(); <START> System.out.println("Setup Configs downloaded: "+setupConfigurations.size()); <END> setupConfigurationController.saveSetupConfigurations(setupConfigurations); } catch (SetupConfigurationController.SetupConfigurationDownloadException e){ Log.e(TAG, "Exception when trying to download setup configs"); result[0] = SyncStatusConstants.DOWNLOAD_ERROR; } catch (SetupConfigurationController.SetupConfigurationSaveException e){ Log.e(TAG, "Exception when trying to save setup configs"); result[0] = SyncStatusConstants.SAVE_ERROR; } return result; }</code><technical_language>Replace logger</technical_language>

Target:
public int[] downloadSetupConfigurations(){ int[] result = new int[2]; try { List<SetupConfiguration> setupConfigurations = setupConfigurationController.downloadAllSetupConfigurations(); result[0] = SyncStatusConstants.SUCCESS; result[1] = setupConfigurations.size(); Log.i(TAG, "Setup Configs downloaded: "+setupConfigurations.size()); setupConfigurationController.saveSetupConfigurations(setupConfigurations); } catch (SetupConfigurationController.SetupConfigurationDownloadException e){ Log.e(TAG, "Exception when trying to download setup configs"); result[0] = SyncStatusConstants.DOWNLOAD_ERROR; } catch (SetupConfigurationController.SetupConfigurationSaveException e){ Log.e(TAG, "Exception when trying to save setup configs"); result[0] = SyncStatusConstants.SAVE_ERROR; } return result; }
Source:
<code>private Map<Job,Collection<ReverseBuildTrigger>> calculateCache() { Map<Job,Collection<ReverseBuildTrigger>> result = new WeakHashMap<>(); <START> SecurityContext orig = ACL.impersonate(ACL.SYSTEM); <END> for (Job<?, ?> downstream : Jenkins.getInstance().getAllItems(Job.class)) { ReverseBuildTrigger trigger = ParameterizedJobMixIn.getTrigger(downstream, ReverseBuildTrigger.class); if (trigger == null) { continue; } try { List<Job> upstreams = Items.fromNameList(downstream.getParent(), trigger.upstreamProjects, Job.class); LOGGER.log(Level.FINE, "from {0} see upstreams {1}", new Object[] {downstream, upstreams}); for (Job upstream : upstreams) { if (upstream instanceof AbstractProject && downstream instanceof AbstractProject) { continue; } Collection<ReverseBuildTrigger> triggers = result.get(upstream); if (triggers == null) { triggers = new LinkedList<>(); result.put(upstream, triggers); } triggers.remove(trigger); triggers.add(trigger); } } finally { SecurityContextHolder.setContext(orig); } } return result; }</code><technical_language><code>finally</code> handler is correctly? <code>for</code> loop :ant:</technical_language>

Target:
private Map<Job,Collection<ReverseBuildTrigger>> calculateCache() { final Map<Job,Collection<ReverseBuildTrigger>> result = new WeakHashMap<>(); ACL.impersonate(ACL.SYSTEM, new Runnable() { @Override public void run() { for (Job<?, ?> downstream : Jenkins.getInstance().getAllItems(Job.class)) { ReverseBuildTrigger trigger = ParameterizedJobMixIn.getTrigger(downstream, ReverseBuildTrigger.class); if (trigger == null) { continue; } List<Job> upstreams = Items.fromNameList(downstream.getParent(), trigger.upstreamProjects, Job.class); LOGGER.log(Level.FINE, "from {0} see upstreams {1}", new Object[] {downstream, upstreams}); for (Job upstream : upstreams) { if (upstream instanceof AbstractProject && downstream instanceof AbstractProject) { continue; } Collection<ReverseBuildTrigger> triggers = result.get(upstream); if (triggers == null) { triggers = new LinkedList<>(); result.put(upstream, triggers); } triggers.remove(trigger); triggers.add(trigger); } } } }); return result; }
Source:
<code>public Step loadVepAnnotationStep(StepBuilderFactory stepBuilderFactory, JobOptions jobOptions) { logger.debug("Building '" + LOAD_VEP_ANNOTATION_STEP + "'"); return stepBuilderFactory.get(LOAD_VEP_ANNOTATION_STEP) <START> .<VariantAnnotation, VariantAnnotation>chunk(jobOptions.getPipelineOptions().getInt(JobParametersNames.CONFIG_CHUNK_SIZE)) <END> .reader(variantAnnotationReader) .writer(variantAnnotationItemWriter) .faultTolerant().skipLimit(50).skip(FlatFileParseException.class) .listener(new SkippedItemListener()) .build(); }</code><technical_language>this line is longer 120</technical_language>

Target:
public Step loadVepAnnotationStep(StepBuilderFactory stepBuilderFactory, JobOptions jobOptions) { logger.debug("Building '" + LOAD_VEP_ANNOTATION_STEP + "'"); final int chunkSize = jobOptions.getPipelineOptions().getInt(JobParametersNames.CONFIG_CHUNK_SIZE); return stepBuilderFactory.get(LOAD_VEP_ANNOTATION_STEP) .<VariantAnnotation, VariantAnnotation>chunk(chunkSize) .reader(variantAnnotationReader) .writer(variantAnnotationItemWriter) .faultTolerant().skipLimit(50).skip(FlatFileParseException.class) .listener(new SkippedItemListener()) .build(); }
Source:
<code>public boolean matches(Message msg) { <START> return msg.getFlags() != null && msg.getFlags().contains("starred"); <END> }</code><technical_language>check return msg.getFlags() != null && (msg.getMessageStar() || msg.getFlags().contains("starred"));</technical_language>

Target:
public boolean matches(Message msg) { return (msg.getFlags() != null && msg.getFlags().contains("starred")) || (msg.getMessageStar()); }
Source:
<code>public void initialize() { try { logger.debug("Initializing NTP handler for '{}'.",getThing().getUID()); Configuration config = getThing().getConfiguration(); this.hostname = (String) config.get(PROPERTY_NTP_SERVER); <START> this.refreshInterval = new BigDecimal (config.get(PROPERTY_REFRESH_INTERVAL).toString()); <END> this.refreshNtp = new BigDecimal (config.get(PROPERTY_REFRESH_NTP).toString());; this.refreshNtpCount = 0; try { timeZone = TimeZone.getTimeZone((String) config.get(PROPERTY_TIMEZONE)); } catch (Exception e) { timeZone = TimeZone.getDefault(); logger.debug("using default TZ: {}", timeZone); } try { String localeString = (String) config.get(PROPERTY_LOCALE); locale = new Locale(localeString); } catch (Exception e) { locale = Locale.getDefault(); logger.debug("using default locale: {}", locale); } dateTimeChannelUID = new ChannelUID(getThing().getUID(), CHANNEL_DATE_TIME); startAutomaticRefresh(); } catch (Exception ex) { String msg = "Error occured while initializing NTP handler: " + ex.getMessage(); logger.error(msg, ex); updateStatus(ThingStatus.OFFLINE, ThingStatusDetail.CONFIGURATION_ERROR, msg); } }</code><technical_language>Do example happened Integer here? in this case need toString - new BigDecimal good enough</technical_language>

Target:
public void initialize() { try { logger.debug("Initializing NTP handler for '{}'.",getThing().getUID()); Configuration config = getThing().getConfiguration(); this.hostname = (String) config.get(PROPERTY_NTP_SERVER); this.refreshInterval = (BigDecimal) config.get(PROPERTY_REFRESH_INTERVAL); this.refreshNtp = (BigDecimal) config.get(PROPERTY_REFRESH_NTP); this.refreshNtpCount = 0; try { timeZone = TimeZone.getTimeZone((String) config.get(PROPERTY_TIMEZONE)); } catch (Exception e) { timeZone = TimeZone.getDefault(); logger.debug("using default TZ: {}", timeZone); } try { String localeString = (String) config.get(PROPERTY_LOCALE); locale = new Locale(localeString); } catch (Exception e) { locale = Locale.getDefault(); logger.debug("using default locale: {}", locale); } dateTimeChannelUID = new ChannelUID(getThing().getUID(), CHANNEL_DATE_TIME); startAutomaticRefresh(); } catch (Exception ex) { String msg = "Error occured while initializing NTP handler: " + ex.getMessage(); logger.error(msg, ex); updateStatus(ThingStatus.OFFLINE, ThingStatusDetail.CONFIGURATION_ERROR, msg); } }
Source:
<code>private static boolean isArrayOrList(Type type) { <START> if (type.getClass().isArray()) { <END> return true; } return isList(type); }</code><technical_language>This is easier read as: return type.getClass().isArray() || isList(type);</technical_language>

Target:
private static boolean isArrayOrList(Type type) { return type.getClass().isArray() || isList(type); }
Source:
<code>public ResponseEntity<?> commitCursors(@PathVariable("subscriptionId") final String subscriptionId, @RequestBody final List<SubscriptionCursor> cursors, final NativeWebRequest request, final Client client) { if (!featureToggleService.isFeatureEnabled(HIGH_LEVEL_API)) { return new ResponseEntity<>(NOT_IMPLEMENTED); } try { <START> validateSubscriptionReadScopes(client, subscriptionId); <END> final boolean allCommitted = cursorsService.commitCursors(subscriptionId, cursors); return allCommitted ? ok().build() : noContent().build(); } catch (final NakadiException e) { return create(e.asProblem(), request); } catch (InvalidCursorException e) { return create(Problem.valueOf(UNPROCESSABLE_ENTITY, e.getMessage()), request); } }</code><technical_language>do check read scopes commit cursor</technical_language>

Target:
public ResponseEntity<?> commitCursors(@PathVariable("subscriptionId") final String subscriptionId, @RequestBody final List<SubscriptionCursor> cursors, final NativeWebRequest request, final Client client) { if (!featureToggleService.isFeatureEnabled(HIGH_LEVEL_API)) { return new ResponseEntity<>(NOT_IMPLEMENTED); } try { validateSubscriptionReadScopes(client, subscriptionId); final Map<SubscriptionCursor, Boolean> result = cursorsService.commitCursors(subscriptionId, cursors); final List<CursorCommitResult> items = result.entrySet().stream() .map(entry -> new CursorCommitResult(entry.getKey(), entry.getValue())) .collect(Collectors.toList()); final boolean allCommited = result.values().stream().reduce(Boolean::logicalAnd).orElseGet(() -> true); final ItemsWrapper<CursorCommitResult> body = new ItemsWrapper<>(items); return allCommited ? noContent().build() : ok(body); } catch (final NakadiException e) { return create(e.asProblem(), request); } catch (InvalidCursorException e) { return create(Problem.valueOf(UNPROCESSABLE_ENTITY, e.getMessage()), request); } }
Source:
<code>protected void applyDataRowStyle(final int row) { super.applyDataRowStyle(row); final CellFormatter fmt = table.getCellFormatter(); fmt.addStyleName(row, C_STAR, Gerrit.RESOURCES.css().iconCell()); for (int i = C_ID; i < columns; i++) { fmt.addStyleName(row, i, Gerrit.RESOURCES.css().dataCell()); } if (!showLegacyId) { fmt.addStyleName(row, C_ID, Gerrit.RESOURCES.css().dataCellHidden()); } fmt.addStyleName(row, C_SUBJECT, Gerrit.RESOURCES.css().cSUBJECT()); fmt.addStyleName(row, C_STATUS, Gerrit.RESOURCES.css().cSTATUS()); fmt.addStyleName(row, C_OWNER, Gerrit.RESOURCES.css().cOWNER()); fmt.addStyleName(row, C_LAST_UPDATE, Gerrit.RESOURCES.css().cLastUpdate()); fmt.addStyleName(row, C_SIZE, Gerrit.RESOURCES.css().cSIZE()); for (int i = <START> C_SIZE; i <END> < columns; i++) { fmt.addStyleName(row, i, Gerrit.RESOURCES.css().cAPPROVAL()); } }</code><technical_language>C_SIZE + 1</technical_language>

Target:
protected void applyDataRowStyle(final int row) { super.applyDataRowStyle(row); final CellFormatter fmt = table.getCellFormatter(); fmt.addStyleName(row, C_STAR, Gerrit.RESOURCES.css().iconCell()); for (int i = C_ID; i < columns; i++) { fmt.addStyleName(row, i, Gerrit.RESOURCES.css().dataCell()); } if (!showLegacyId) { fmt.addStyleName(row, C_ID, Gerrit.RESOURCES.css().dataCellHidden()); } fmt.addStyleName(row, C_SUBJECT, Gerrit.RESOURCES.css().cSUBJECT()); fmt.addStyleName(row, C_STATUS, Gerrit.RESOURCES.css().cSTATUS()); fmt.addStyleName(row, C_OWNER, Gerrit.RESOURCES.css().cOWNER()); fmt.addStyleName(row, C_LAST_UPDATE, Gerrit.RESOURCES.css().cLastUpdate()); fmt.addStyleName(row, C_SIZE, Gerrit.RESOURCES.css().cSIZE()); for (int i = C_SIZE + 1; i < columns; i++) { fmt.addStyleName(row, i, Gerrit.RESOURCES.css().cAPPROVAL()); } }
Source:
<code>public void addSpecificUserOwner(PerunSession sess, User user, User specificUser) throws InternalErrorException, UserNotExistsException, PrivilegeException, SpecificUserExpectedException, NotSpecificUserExpectedException, RelationExistsException { Utils.checkPerunSession(sess); getUsersManagerBl().checkUserExists(sess, user); getUsersManagerBl().checkUserExists(sess, specificUser); if (user.isServiceUser()) throw new NotSpecificUserExpectedException(user); if (user.isSponsoredUser() && specificUser.isSponsoredUser()) throw new NotSpecificUserExpectedException(specificUser); if (!specificUser.isSpecificUser()) throw new SpecificUserExpectedException(specificUser); <START> if(!AuthzResolver.authorizedInternal(sess, "addSpecificUserOwner_User_User_policy", Collections.singletonList(specificUser))) { <END> throw new PrivilegeException(sess, "addSpecificUserOwner"); } getUsersManagerBl().addSpecificUserOwner(sess, user, specificUser); }</code><technical_language>2 methods authorizedInternal in 1 if clause objects? Like: if(!AuthzResolver.authorizedInternal(sess, "addSpecificUserOwner_User_User_policy", Collections.singletonList(user)) && !AuthzResolver.authorizedInternal(sess, "addSpecificUserOwner_User_User_policy", Collections.singletonList(specificUser))) { .. }</technical_language>

Target:
public void addSpecificUserOwner(PerunSession sess, User user, User specificUser) throws InternalErrorException, UserNotExistsException, PrivilegeException, SpecificUserExpectedException, NotSpecificUserExpectedException, RelationExistsException { Utils.checkPerunSession(sess); getUsersManagerBl().checkUserExists(sess, user); getUsersManagerBl().checkUserExists(sess, specificUser); if (user.isServiceUser()) throw new NotSpecificUserExpectedException(user); if (user.isSponsoredUser() && specificUser.isSponsoredUser()) throw new NotSpecificUserExpectedException(specificUser); if (!specificUser.isSpecificUser()) throw new SpecificUserExpectedException(specificUser); if(!AuthzResolver.authorizedInternal(sess, "addSpecificUserOwner_User_User_policy", Collections.singletonList(specificUser)) && !AuthzResolver.authorizedInternal(sess, "owner-addSpecificUserOwner_User_User_policy", Collections.singletonList(user))) { throw new PrivilegeException(sess, "addSpecificUserOwner"); } getUsersManagerBl().addSpecificUserOwner(sess, user, specificUser); }
Source:
<code>public static <ResType> List<ResType> filterAuthorizedResources( final HttpServletRequest request, final Collection<ResType> resources, final Function<? super ResType, ResourceAction> resourceActionGenerator, final AuthorizerMapper authorizerMapper ) { final AuthenticationResult authenticationResult = (AuthenticationResult) request.getAttribute( AuthConfig.DRUID_AUTHENTICATION_RESULT ); if (authenticationResult == null) { throw new ISE("Null authentication result"); } final Authorizer authorizer = authorizerMapper.getAuthorizer(authenticationResult.getAuthorizerName()); if (authorizer == null) { throw new ISE("No authorizer found with name: [%s].", authenticationResult.getAuthorizerName()); } int initialSize = resources.size(); final Map<ResourceAction, Access> resultCache = Maps.newHashMap(); List<ResType> filteredResources = new ArrayList<>(); for (ResType resource : resources) { final ResourceAction resourceAction = resourceActionGenerator.apply(resource); <START> Access access = resultCache.get(resourceAction); <END> if (access == null) { access = authorizer.authorize( authenticationResult, resourceAction.getResource(), resourceAction.getAction() ); resultCache.put(resourceAction, access); } if (access.isAllowed()) { filteredResources.add(resource); } } request.setAttribute(AuthConfig.DRUID_AUTHORIZATION_CHECKED, (filteredResources.size() > 0 || initialSize == 0)); return filteredResources; }</code><technical_language>resultCache.computeIfAbsent</technical_language>

Target:
public static <ResType> List<ResType> filterAuthorizedResources( final HttpServletRequest request, final Collection<ResType> resources, final Function<? super ResType, ResourceAction> resourceActionGenerator, final AuthorizerMapper authorizerMapper ) { final AuthenticationResult authenticationResult = (AuthenticationResult) request.getAttribute( AuthConfig.DRUID_AUTHENTICATION_RESULT ); if (authenticationResult == null) { throw new ISE("Null authentication result"); } final Authorizer authorizer = authorizerMapper.getAuthorizer(authenticationResult.getAuthorizerName()); if (authorizer == null) { throw new ISE("No authorizer found with name: [%s].", authenticationResult.getAuthorizerName()); } final Map<ResourceAction, Access> resultCache = Maps.newHashMap(); List<ResType> filteredResources = new ArrayList<>(); for (ResType resource : resources) { final ResourceAction resourceAction = resourceActionGenerator.apply(resource); Access access = resultCache.computeIfAbsent( resourceAction, ra -> authorizer.authorize( authenticationResult, ra.getResource(), ra.getAction() ) ); if (access.isAllowed()) { filteredResources.add(resource); } } request.setAttribute(AuthConfig.DRUID_AUTHORIZATION_CHECKED, true); return filteredResources; }
Source:
<code>private ThrowableCategory throwableCategory(Throwable t) { Throwable current = t; StringBuilder builder = new StringBuilder(); do { if (current.getMessage() != null && current.getMessage().startsWith("Acquire operation")) { <START> return new ThrowableCategory(ThrowableType.ACUIRE_TIMEOUT); <END> } if (current.getClass().getName().equals("io.netty.handler.timeout.ReadTimeoutException")) { return new ThrowableCategory(ThrowableType.READ_TIMEOUT); } if (current.getCause() == null) { builder.append(current.getClass().getName()).append(": ").append(current.getMessage()); } else { builder.append(current.getClass().getSimpleName()); builder.append("/"); } current = current.getCause(); } while (current != null); return new ThrowableCategory(ThrowableType.UNKNOWN, builder.toString()); }</code><technical_language>static instances of ThrowableCategory local state</technical_language>

Target:
private ThrowableCategory throwableCategory(Throwable t) { Throwable current = t; StringBuilder builder = new StringBuilder(); do { if (current.getMessage() != null && current.getMessage().startsWith("Acquire operation")) { return ACQUIRE_TIMEOUT_CATEGORY; } if (current.getClass().getName().equals("io.netty.handler.timeout.ReadTimeoutException")) { return READ_TIMEOUT_CATEGORY; } if (current.getCause() == null) { builder.append(current.getClass().getName()).append(": ").append(current.getMessage()); } else { builder.append(current.getClass().getSimpleName()); builder.append("/"); } current = current.getCause(); } while (current != null); return new ThrowableCategory(ThrowableType.OTHER, builder.toString()); }
Source:
<code>public <START> ImmutableList<VariantOutput> <END> getOutputFiles() { ImmutableList.Builder<VariantOutput> outputs = ImmutableList.builder(); if (packageSplitResourcesTask != null) { outputs.addAll(packageSplitResourcesTask.getOutputFiles()); } outputs.add(new VariantOutput.MainVariantOutput(getOutputFile())); return outputs.build(); }</code><technical_language>I create return a immutable list. I for internal API super useful, do this API class (in api package)</technical_language>

Target:
public ImmutableList<APKOutput> getOutputFiles() { ImmutableList.Builder<APKOutput> outputs = ImmutableList.builder(); if (packageSplitResourcesTask != null) { outputs.addAll(packageSplitResourcesTask.getOutputFiles()); } outputs.add(new APKOutput.MainAPKOutput(getOutputFile())); return outputs.build(); }
Source:
<code>public void handleUploadButton(View view) { if (!Utils.isNetworkAvailable(view.getContext(), true)) { return; } if (!viewSwitchLock.tryLock()) { return; } if (BuildConfig.CREATE_AT_SCHOOL && !Utils.isCreateAtSchoolUser(this)) { SharedPreferences sharedPreferences = PreferenceManager.getDefaultSharedPreferences(this); <START> sharedPreferences.edit().putString(Constants.TOKEN, Constants.NO_TOKEN).apply(); <END> sharedPreferences.edit().putString(Constants.USERNAME, Constants.NO_USERNAME).apply(); } ProjectManager.getInstance().uploadProject(Utils.getCurrentProjectName(this), this); }</code><technical_language>(I this is this in other parts of code) if edit multiple items call in this order: SharedPreferences.Editor prefEditor = sharedPreferences.edit(); prefEditor.putString(); prefEditor.putString(); //... other operations this editor prefEditor.apply(); for reasons: - apply() is atomic write operation, meaning part of app access preferences in a weird state for example Constants.TOKEN is written, Constants.USERNAME value. - time call edit() a new SharedPreferences.Editor is created creates a full copy of original preferences apply() writes modiefied copy original -> performance please check code bits this</technical_language>

Target:
public void handleUploadButton(View view) { if (!Utils.isNetworkAvailable(view.getContext(), true)) { return; } if (!viewSwitchLock.tryLock()) { return; } if (BuildConfig.CREATE_AT_SCHOOL && !Utils.isCreateAtSchoolUser(this)) { SharedPreferences.Editor sharedPrefEditor = PreferenceManager.getDefaultSharedPreferences(this).edit(); sharedPrefEditor.putString(Constants.TOKEN, Constants.NO_TOKEN); sharedPrefEditor.putString(Constants.USERNAME, Constants.NO_USERNAME); sharedPrefEditor.apply(); } ProjectManager.getInstance().uploadProject(Utils.getCurrentProjectName(this), this); }
Source:
<code>public void toggleFavoriteBranch(Branch favoriteBranch) throws OseeCoreException { HashSet<Long> branchUuids = new HashSet<Long>(); for (Branch branch : BranchManager.getBranches(BranchArchivedState.UNARCHIVED, BranchType.WORKING, BranchType.BASELINE)) { branchUuids.add(branch.getUuid()); } boolean found = false; @SuppressWarnings("deprecation") Collection<Attribute<String>> attributes = getAttributes(CoreAttributeTypes.FavoriteBranch); for (Attribute<String> attribute : attributes) { Long uuid = 0L; try { uuid = Long.valueOf(attribute.getValue()); } catch (Exception ex) { throw new OseeStateException("Invalid Favorite Branch uuid [%s] for user [%s]", attribute.getValue(), <START> toStringWithId()); <END> } if (!branchUuids.contains(uuid)) { attribute.delete(); } else if (favoriteBranch.getUuid().equals(uuid)) { attribute.delete(); found = true; } } if (!found) { addAttribute(CoreAttributeTypes.FavoriteBranch, String.valueOf(favoriteBranch.getUuid())); } setSetting(CoreAttributeTypes.FavoriteBranch.getName(), String.valueOf(favoriteBranch.getUuid())); saveSettings(); }</code><technical_language>I this is important enough throw exception logging exception is throwing</technical_language>

Target:
public void toggleFavoriteBranch(Branch favoriteBranch) throws OseeCoreException { HashSet<Long> branchUuids = new HashSet<Long>(); for (Branch branch : BranchManager.getBranches(BranchArchivedState.UNARCHIVED, BranchType.WORKING, BranchType.BASELINE)) { branchUuids.add(branch.getUuid()); } boolean found = false; @SuppressWarnings("deprecation") Collection<Attribute<String>> attributes = getAttributes(CoreAttributeTypes.FavoriteBranch); for (Attribute<String> attribute : attributes) { Long uuid = 0L; try { uuid = Long.valueOf(attribute.getValue()); } catch (Exception ex) { continue; } if (!branchUuids.contains(uuid)) { attribute.delete(); } else if (favoriteBranch.getUuid().equals(uuid)) { attribute.delete(); found = true; } } if (!found) { addAttribute(CoreAttributeTypes.FavoriteBranch, String.valueOf(favoriteBranch.getUuid())); } setSetting(CoreAttributeTypes.FavoriteBranch.getName(), String.valueOf(favoriteBranch.getUuid())); saveSettings(); }
Source:
<code>private void setTabularResult(String key, Object obj, List<String> columns, List<String> line, TypeSystem typeSystem) { if (obj instanceof Value) { Value value = (Value) obj; if (value.hasType(typeSystem.MAP())) { Map<String, Object> map = value.asMap(); for (Entry<String, Object> entry : map.entrySet()) { setTabularResult(String.format(MAP_KEY_TEMPLATE, key, entry.getKey()), entry.getValue(), columns, line, typeSystem); } } else { addValueToLine(key, columns, line, value); } } else if (obj instanceof Map) { <START> @SuppressWarnings("unchecked") <END> Map<String, Object> map = (Map<String, Object>) obj; for (Entry<String, Object> entry : map.entrySet()) { setTabularResult(String.format(MAP_KEY_TEMPLATE, key, entry.getKey()), entry.getValue(), columns, line, typeSystem); } } else { addValueToLine(key, columns, line, obj); } }</code><technical_language>do need unchecked here</technical_language>

Target:
private void setTabularResult(String key, Object obj, List<String> columns, List<String> line, TypeSystem typeSystem) { if (obj instanceof Value) { Value value = (Value) obj; if (value.hasType(typeSystem.MAP())) { Map<String, Object> map = value.asMap(); for (Entry<String, Object> entry : map.entrySet()) { setTabularResult(String.format(MAP_KEY_TEMPLATE, key, entry.getKey()), entry.getValue(), columns, line, typeSystem); } } else { addValueToLine(key, columns, line, value); } } else if (obj instanceof Map) { Map<String, Object> map = (Map<String, Object>) obj; for (Entry<String, Object> entry : map.entrySet()) { setTabularResult(String.format(MAP_KEY_TEMPLATE, key, entry.getKey()), entry.getValue(), columns, line, typeSystem); } } else { addValueToLine(key, columns, line, obj); } }
Source:
<code>protected void ExecuteVdsBrokerCommand() { if (getParameters().getGracefully()) { status = getBroker().shutdown(getParameters().getVmId().toString(), <START> (Integer.valueOf(getParameters().getSecondsToWait())).toString(), <END> Config.<String> GetValue(ConfigValues.VmGracefulShutdownMessage)); } else { status = getBroker().destroy(getParameters().getVmId().toString()); } ProceedProxyReturnValue(); }</code><technical_language>Instead of Integer.valueOf(int).toString(), String.valueOf(int)</technical_language>

Target:
protected void ExecuteVdsBrokerCommand() { if (getParameters().getGracefully()) { status = getBroker().shutdown(getParameters().getVmId().toString(), String.valueOf(getParameters().getSecondsToWait()), Config.<String> GetValue(ConfigValues.VmGracefulShutdownMessage)); } else { status = getBroker().destroy(getParameters().getVmId().toString()); } ProceedProxyReturnValue(); }
Source:
<code>private void initiateRequest(AjpClientExchange AjpClientExchange) { currentRequest = AjpClientExchange; ClientRequest request = AjpClientExchange.getRequest(); String connectionString = request.getRequestHeaders().getFirst(CONNECTION); if (connectionString != null) { <START> if (connectionString.equals(CLOSE)) { <END> state |= CLOSE_REQ; } } else if (request.getProtocol() != Protocols.HTTP_1_1) { state |= CLOSE_REQ; } if (request.getRequestHeaders().contains(UPGRADE)) { state |= UPGRADE_REQUESTED; } long length = 0; String fixedLengthString = request.getRequestHeaders().getFirst(CONTENT_LENGTH); String transferEncodingString = request.getRequestHeaders().getLast(TRANSFER_ENCODING); if (fixedLengthString != null) { length = Long.parseLong(fixedLengthString); } else if (transferEncodingString != null) { length = -1; } AjpClientRequestClientStreamSinkChannel sinkChannel = connection.sendRequest(request.getMethod(), request.getPath(), request.getProtocol(), request.getRequestHeaders(), request, requestFinishListener); currentRequest.setRequestChannel(sinkChannel); AjpClientExchange.invokeReadReadyCallback(AjpClientExchange); if (length == 0) { try { sinkChannel.shutdownWrites(); if (!sinkChannel.flush()) { handleFailedFlush(sinkChannel); } } catch (Throwable t) { handleError((t instanceof IOException) ? (IOException) t : new IOException(t)); } } }</code><technical_language>This is wrong. CLOSE is a HttpString connectionString is a String</technical_language>

Target:
private void initiateRequest(AjpClientExchange AjpClientExchange) { currentRequest = AjpClientExchange; ClientRequest request = AjpClientExchange.getRequest(); String connectionString = request.getRequestHeaders().getFirst(CONNECTION); if (connectionString != null) { if (CLOSE.equalToString(connectionString)) { state |= CLOSE_REQ; } } else if (request.getProtocol() != Protocols.HTTP_1_1) { state |= CLOSE_REQ; } if (request.getRequestHeaders().contains(UPGRADE)) { state |= UPGRADE_REQUESTED; } long length = 0; String fixedLengthString = request.getRequestHeaders().getFirst(CONTENT_LENGTH); String transferEncodingString = request.getRequestHeaders().getLast(TRANSFER_ENCODING); if (fixedLengthString != null) { length = Long.parseLong(fixedLengthString); } else if (transferEncodingString != null) { length = -1; } AjpClientRequestClientStreamSinkChannel sinkChannel = connection.sendRequest(request.getMethod(), request.getPath(), request.getProtocol(), request.getRequestHeaders(), request, requestFinishListener); currentRequest.setRequestChannel(sinkChannel); AjpClientExchange.invokeReadReadyCallback(AjpClientExchange); if (length == 0) { try { sinkChannel.shutdownWrites(); if (!sinkChannel.flush()) { handleFailedFlush(sinkChannel); } } catch (Throwable t) { handleError((t instanceof IOException) ? (IOException) t : new IOException(t)); } } }
Source:
<code>private JavaPairRDD<Integer, List<double[]>> fetchClusteredPoints(JavaRDD<Vector> evalData) { return evalData.mapToPair(new PairFunction<Vector, Integer, List<double[]>>() { @Override public Tuple2<Integer, List<double[]>> call(Vector vector) { double closestDist = Double.POSITIVE_INFINITY; int minCluster = -1; double[] vec = vector.toArray(); for (int i = 0; i < numClusters; i++) { ClusterInfo cluster = clusters.get(i); double distance = distanceFn.distance(cluster.getCenter(), vec); if (distance < closestDist) { closestDist = distance; minCluster = i; } } Preconditions.checkState(minCluster >= 0); List<double[]> pointsList = new ArrayList<>(); pointsList.add(vec); return new Tuple2<>(minCluster, pointsList); } <START> }).reduceByKey(new Function2<List<double[]>, List<double[]>, List<double[]>>() { <END> @Override public List<double[]> call(List<double[]> v1, List<double[]> v2) { v1.addAll(v2); return v1; } }); }</code><technical_language>I this is equivalent groupByKey()</technical_language>

Target:
private JavaPairRDD<Integer, Iterable<double[]>> fetchClusteredPoints(JavaRDD<Vector> evalData) { return evalData.mapToPair(new PairFunction<Vector, Integer, double[]>() { @Override public Tuple2<Integer, double[]> call(Vector vector) { double closestDist = Double.POSITIVE_INFINITY; int minCluster = -1; double[] vec = vector.toArray(); for (int i = 0; i < numClusters; i++) { ClusterInfo cluster = clusters.get(i); double distance = distanceFn.distance(cluster.getCenter(), vec); if (distance < closestDist) { closestDist = distance; minCluster = i; } } Preconditions.checkState(minCluster >= 0); return new Tuple2<>(minCluster, vec); } }).groupByKey(); }
Source:
<code>public static void main(String[] args) throws IOException, InterruptedException, BookieException, KeeperException { Bookie b = new Bookie(new ServerConfiguration()); b.start(); CounterCallback cb = new CounterCallback(); long start = MathUtils.now(); for (int i = 0; i < 100000; i++) { ByteBuf buff = Unpooled.buffer(1024); buff.writeLong(1); buff.writeLong(i); cb.incCount(); <START> b.addEntry(buff, cb, null, new byte[0], LedgerType.FORCE_ON_JOURNAL); <END> } cb.waitZero(); long end = MathUtils.now(); System.out.println("Took " + (end - start) + "ms"); }</code><technical_language>this main()?</technical_language>

Target:
public static void main(String[] args) throws IOException, InterruptedException, BookieException, KeeperException { Bookie b = new Bookie(new ServerConfiguration()); b.start(); CounterCallback cb = new CounterCallback(); long start = MathUtils.now(); for (int i = 0; i < 100000; i++) { ByteBuf buff = Unpooled.buffer(1024); buff.writeLong(1); buff.writeLong(i); cb.incCount(); b.addEntry(buff, LedgerType.FORCE_ON_JOURNAL, cb, null, new byte[0]); } cb.waitZero(); long end = MathUtils.now(); System.out.println("Took " + (end - start) + "ms"); }
Source:
<code>public GanttCategoryDataset createDebugEventGanttChartDataset() { splitEventsIntoAListPerType(); <START> final TaskSeries allTasks = new TaskSeries("Debug Events"); <END> allTasks.add( createTaskForEventsWithName("Breakpoint Added", bpAddEvents)); allTasks.add(createTaskForEventsWithName("Breakpoint Changed", bpChangeEvents)); allTasks.add(createTaskForEventsWithName("Breakpoint Removed", bpRemoveEvents)); allTasks.add(createTaskForEventsWithName("Suspended (breakpoint)", suspendBpEvents)); allTasks.add(createTaskForEventsWithName("Suspended (client)", suspendClientEvents)); allTasks.add(createTaskForEventsWithName("Stepped Out", stepOutEvents)); allTasks.add( createTaskForEventsWithName("Stepped Into", stepIntoEvents)); allTasks.add( createTaskForEventsWithName("Stepped Over", stepOverEvents)); allTasks.add(createTaskForEventsWithName("Resumed (client)", resumeClientEvents)); allTasks.add(createTaskForEventsWithName("Inspected Variable", inspectEvents)); allTasks.add(createTaskForEventsWithName("Defined Watch", defineWatchEvents)); allTasks.add(createTaskForEventsWithName("Evaluated Expression", evalExpressionEvents)); allTasks.add(createTaskForEventsWithName("Modified Variable Value", modVarValueEvents)); final TaskSeriesCollection collection = new TaskSeriesCollection(); collection.add(allTasks); return collection; }</code><technical_language>a clone nl.tudelft.watchdog.eclipse.logic.event.EventStatistics? introduce common base class in Core</technical_language>

Target:
public GanttCategoryDataset createDebugEventGanttChartDataset() { splitEventsIntoAListPerType(); TaskSeries allTasks = new TaskSeries("Debug Events"); allTasks.add( createTaskForEventsWithName(bpAddEvents, "Breakpoint Added")); allTasks.add(createTaskForEventsWithName(bpChangeEvents, "Breakpoint Changed" )); allTasks.add(createTaskForEventsWithName(bpRemoveEvents, "Breakpoint Removed" )); allTasks.add(createTaskForEventsWithName(suspendBpEvents, "Suspended (breakpoint)" )); allTasks.add(createTaskForEventsWithName(suspendClientEvents, "Suspended (client)" )); allTasks.add(createTaskForEventsWithName(stepOutEvents, "Stepped Out")); allTasks.add( createTaskForEventsWithName(stepIntoEvents, "Stepped Into")); allTasks.add( createTaskForEventsWithName(stepOverEvents, "Stepped Over")); allTasks.add(createTaskForEventsWithName(resumeClientEvents, "Resumed (client)" )); allTasks.add(createTaskForEventsWithName(inspectEvents, "Inspected Variable" )); allTasks.add(createTaskForEventsWithName(defineWatchEvents, "Defined Watch" )); allTasks.add(createTaskForEventsWithName(evalExpressionEvents, "Evaluated Expression" )); allTasks.add(createTaskForEventsWithName(modVarValueEvents, "Modified Variable Value" )); TaskSeriesCollection collection = new TaskSeriesCollection(); collection.add(allTasks); return collection; }