auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code><START> private List<String> getLoginsFromPerun(String loginAttrName) throws InternalErrorException { <END> PerunSession sess = this.getSession(); List<String> allLogins = new ArrayList<>(); try { AttributeDefinition attrDefLoginInMu = perunBl.getAttributesManagerBl().getAttributeDefinition(sess, loginAttrName); perunBl.getAttributesManagerBl().getAllValues(sess, attrDefLoginInMu).stream().forEach( value -> allLogins.add((String) value)); } catch (AttributeNotExistsException | WrongAttributeAssignmentException ex) { throw new InternalErrorException(ex); } return allLogins; }</code><technical_language>InputStream. closed do need anymore</technical_language>

Target:
private List<String> getLoginsFromPerun(String loginAttrName) throws InternalErrorException { PerunSession sess = this.getSession(); List<String> allLogins = new ArrayList<>(); try { AttributeDefinition attrDefLoginInMu = perunBl.getAttributesManagerBl().getAttributeDefinition(sess, loginAttrName); perunBl.getAttributesManagerBl().getAllValues(sess, attrDefLoginInMu).forEach( value -> allLogins.add((String) value)); } catch (AttributeNotExistsException | WrongAttributeAssignmentException ex) { throw new InternalErrorException(ex); } return allLogins; }
Source:
<code>protected void removeActionSet(IActionSetDescriptor toRemove) { String id = toRemove.getId(); IContextService service = page.getWorkbenchWindow().getService(IContextService.class); try { service.deferUpdates(true); for (IActionSetDescriptor desc : alwaysOnActionSets) { if (desc.getId().equals(id)) { removeAlwaysOn(desc); break; } } for (IActionSetDescriptor desc : alwaysOffActionSets) { if (desc.getId().equals(id)) { removeAlwaysOff(desc); break; } } addAlwaysOff(toRemove); String tag = ModeledPageLayout.ACTION_SET_TAG + id; <START> layout.getTags().remove(tag); <END> } finally { service.deferUpdates(false); } }</code><technical_language>typically pattern check for a tag removing it. Please add check again, I stay consistent I increases readability</technical_language>

Target:
protected void removeActionSet(IActionSetDescriptor toRemove) { String id = toRemove.getId(); IContextService service = page.getWorkbenchWindow().getService(IContextService.class); try { service.deferUpdates(true); for (IActionSetDescriptor desc : alwaysOnActionSets) { if (desc.getId().equals(id)) { removeAlwaysOn(desc); break; } } for (IActionSetDescriptor desc : alwaysOffActionSets) { if (desc.getId().equals(id)) { removeAlwaysOff(desc); break; } } addAlwaysOff(toRemove); String tag = ModeledPageLayout.ACTION_SET_TAG + id; if (layout.getTags().contains(tag)) { layout.getTags().remove(tag); } } finally { service.deferUpdates(false); } }
Source:
<code>public ParsedLine parseLine(String text, int cursor, boolean parseCurlyAndSquareBrackets) { reset(); if(cursor > text.length()) cursor = text.length(); for (char c : text.toCharArray()) { if(cursor == index && (prev != SPACE_CHAR || haveEscape)) { cursorWord = textList.size(); wordCursor = builder.length(); } if (c == SPACE_CHAR) { handleSpace(c); } else if (c == BACK_SLASH) { if (haveEscape || ternaryQuote || haveDoubleQuote || haveSingleQuote) { builder.append(c); haveEscape = false; } else haveEscape = true; } else if (c == SINGLE_QUOTE) { handleSingleQuote(c); } else if (c == DOUBLE_QUOTE) { handleDoubleQuote(c); } else if (parseCurlyAndSquareBrackets && (c == CURLY_START || c == PARENTHESIS_START)) { handleCurlyStart(c); } else if (parseCurlyAndSquareBrackets && (c == CURLY_END || c == PARENTHESIS_END) && haveCurlyBracket) { handleCurlyEnd(c); } else if (haveEscape) { <START> builder.append(c); <END> haveEscape = false; } else builder.append(c); prev = c; index++; } return endOfLineProcessing(text, cursor, 0, text.length()); }</code><technical_language>I this change impacts fix. \ character contained in quoted text is removed parser. I tha tthis is want. understanding is follow: 1) \ escape a space character. In this case \ character is removed new word is created. 2) other usages, \ character is kept. reported problem shows need offer a escape operators \ removed parsed content in this case. I fix narrower, like: else if (haveEscape) { //Escaping operator? if (!isQuoted() && (currentOperator = matchesOperators(operators, text, index)) != OperatorType.NONE) { // Do add \, a escape operator. } else { builder.append(BACK_SLASH); } builder.append(c); haveEscape = false; }</technical_language>

Target:
public ParsedLine parseLine(String text, int cursor, boolean parseCurlyAndSquareBrackets) { reset(); if(cursor > text.length()) cursor = text.length(); for (char c : text.toCharArray()) { if(cursor == index && (prev != SPACE_CHAR || haveEscape)) { cursorWord = textList.size(); wordCursor = builder.length(); } if (c == SPACE_CHAR) { handleSpace(c); } else if (c == BACK_SLASH) { if (haveEscape || ternaryQuote || haveDoubleQuote || haveSingleQuote) { builder.append(c); haveEscape = false; } else haveEscape = true; } else if (c == SINGLE_QUOTE) { handleSingleQuote(c); } else if (c == DOUBLE_QUOTE) { handleDoubleQuote(c); } else if (parseCurlyAndSquareBrackets && (c == CURLY_START || c == PARENTHESIS_START)) { handleCurlyStart(c); } else if (parseCurlyAndSquareBrackets && (c == CURLY_END || c == PARENTHESIS_END) && haveCurlyBracket) { handleCurlyEnd(c); } else if (haveEscape) { builder.append(BACK_SLASH); builder.append(c); haveEscape = false; } else builder.append(c); prev = c; index++; } return endOfLineProcessing(text, cursor, 0, text.length()); }
Source:
<code>protected void executeCommand() { getNetwork().setId(Guid.newGuid()); NetworkUtils.setNetworkVdsmName(getNetwork()); TransactionSupport.executeInNewTransaction(() -> { networkDao.save(getNetwork()); if (getNetwork().isVmNetwork() && getParameters().isVnicProfileRequired()) { vnicProfileDao.save(networkHelper.createVnicProfile(getNetwork())); } networkHelper.addPermissionsOnNetwork(getUserId(), getNetwork().getId()); return null; }); <START> List<NetworkCluster> networkAttachments = getParameters().getNetworkClusterList(); boolean clusterAttachmentsSucceeded = true; if (networkAttachments != null) { clusterAttachmentsSucceeded = attachToClusters(networkAttachments).getSucceeded(); } getReturnValue().setActionReturnValue(clusterAttachmentsSucceeded ? getNetwork().getId() : null); setSucceeded(clusterAttachmentsSucceeded); <END> }</code><technical_language>List<NetworkCluster> networkAttachments = getParameters().getNetworkClusterList(); if (networkAttachments != null) { ActionReturnValue attachToClustersResult = attachToClusters(networkAttachments); if (!attachToClustersResult.getSucceeded()) { propagateFailure(attachToClustersResult); return; } } getReturnValue().setActionReturnValue(getNetwork().getId()); setSucceeded(true);</technical_language>

Target:
protected void executeCommand() { getNetwork().setId(Guid.newGuid()); NetworkUtils.setNetworkVdsmName(getNetwork()); TransactionSupport.executeInNewTransaction(() -> { networkDao.save(getNetwork()); if (getNetwork().isVmNetwork() && getParameters().isVnicProfileRequired()) { vnicProfileDao.save(networkHelper.createVnicProfile(getNetwork())); } networkHelper.addPermissionsOnNetwork(getUserId(), getNetwork().getId()); return null; }); List<NetworkCluster> networkAttachments = getParameters().getNetworkClusterList(); if (networkAttachments != null) { ActionReturnValue attachToClustersResult = attachToClusters(networkAttachments); if (!attachToClustersResult.getSucceeded()) { propagateFailure(attachToClustersResult); return; } } getReturnValue().setActionReturnValue(getNetwork().getId()); setSucceeded(true); }
Source:
<code>public void testGetOrganizations() throws IOException { final MkUser user = new MkUser( new MkStorage.InFile(), "orgTestIterate" ); final Organizations orgs = user.organizations(); <START> Assert.assertNotNull(orgs); <END> }</code><technical_language>Assert in unit tests. other tests written. Hamcrest MatcherAssert instead</technical_language>

Target:
public void testGetOrganizations() throws IOException { final MkUser user = new MkUser( new MkStorage.InFile(), "orgTestIterate" ); final Organizations orgs = user.organizations(); MatcherAssert.assertThat( orgs, Matchers.notNullValue() ); }
Source:
<code>private IEvaluationResult creatErrorResult(Exception ex) { final BasicDiagnostic diag = new BasicDiagnostic(Diagnostic.ERROR, SiriusPlugin.ID, 0, "Error while evaluating expression", new Object[] { ex }); <START> END> return new IEvaluationResult() { @Override public Object getValue() { return null; } @Override public Diagnostic getDiagnostic() { return diag; } }; }</code><technical_language>this string is "I18N"</technical_language>

Target:
private IEvaluationResult creatErrorResult(Exception ex) { final BasicDiagnostic diag = new BasicDiagnostic(Diagnostic.ERROR, SiriusPlugin.ID, 0, Messages.SessionInterpreter_evaluationError, new Object[] { ex }); return new IEvaluationResult() { @Override public Object getValue() { return null; } @Override public Diagnostic getDiagnostic() { return diag; } }; }
Source:
<code>public static SacnNode getBroadcastNode(int universeId) { <START> return new SacnNode(new String( <END> "239.255." + String.format("%d", universeId / 256) + "." + String.format("%d", universeId % 256))); }</code><technical_language>Do need "new String" here</technical_language>

Target:
public static SacnNode getBroadcastNode(int universeId) { return new SacnNode(String.format("239.255.%d.%d", universeId / 256, universeId % 256)); }
Source:
<code>public boolean validateUserVisibleChangeToken(String userVisibleChangeToken) { if (userVisibleChangeToken == null) { return true; } if (session.isChangeTokenEnabled()) { Long sysChangeToken = (Long) getPropertyValue(Model.MAIN_SYS_CHANGE_TOKEN_PROP); Long changeToken = (Long) getPropertyValue(Model.MAIN_CHANGE_TOKEN_PROP); return validateUserVisibleChangeToken(sysChangeToken, changeToken, userVisibleChangeToken); } else { Calendar modified; try { modified = (Calendar) getPropertyValue(DC_MODIFIED); } catch (PropertyNotFoundException e) { modified = null; } if (modified == null) { return true; } String currentToken = String.valueOf(modified.getTimeInMillis()); <START> return userVisibleChangeToken.equals(currentToken); <END> } }</code><technical_language>This part of code present in DBS, is purpose</technical_language>

Target:
public boolean validateUserVisibleChangeToken(String userVisibleChangeToken) { if (userVisibleChangeToken == null) { return true; } if (session.isChangeTokenEnabled()) { Long sysChangeToken = (Long) getPropertyValue(Model.MAIN_SYS_CHANGE_TOKEN_PROP); Long changeToken = (Long) getPropertyValue(Model.MAIN_CHANGE_TOKEN_PROP); return validateUserVisibleChangeToken(sysChangeToken, changeToken, userVisibleChangeToken); } else { Calendar modified; try { modified = (Calendar) getPropertyValue(DC_MODIFIED); } catch (PropertyNotFoundException e) { modified = null; } return validateLegacyChangeToken(modified, userVisibleChangeToken); } }
Source:
<code><START> public Client() { <END> nwc.addServerPeer(); nwc.startListeningOnDefaultClientPort(); }</code><technical_language>thinking...could chain constructors? calling this(NetworkController.DEFAULT_CLIENT_PORT)</technical_language>

Target:
public Client() { this(NetworkController.DEFAULT_CLIENT_PORT); }
Source:
<code>private static SwapTrade parseVariableRates(SwapTrade trade, List<CsvRow> variableRows) { ImmutableList.Builder<ValueStep> stepBuilder = ImmutableList.builder(); for (CsvRow row : variableRows) { LocalDate date = LoaderUtils.parseDate(row.getValue(START_DATE_FIELD)); row.findValue(FIXED_RATE_FIELD) .map(str -> LoaderUtils.parseDoublePercent(str)) .ifPresent(fixedRate -> stepBuilder.add(ValueStep.of(date, ValueAdjustment.ofReplace(fixedRate)))); } <START> ImmutableList<ValueStep> vnotionals = stepBuilder.build(); <END> if (vnotionals.isEmpty()) { return trade; } ImmutableList.Builder<SwapLeg> legBuilder = ImmutableList.builder(); for (SwapLeg swapLeg : trade.getProduct().getLegs()) { RateCalculationSwapLeg leg = (RateCalculationSwapLeg) swapLeg; if (leg.getCalculation() instanceof FixedRateCalculation) { FixedRateCalculation baseCalc = (FixedRateCalculation) leg.getCalculation(); FixedRateCalculation calc = baseCalc.toBuilder() .rate(ValueSchedule.of(baseCalc.getRate().getInitialValue(), vnotionals)) .build(); legBuilder.add(leg.toBuilder().calculation(calc).build()); } else { legBuilder.add(leg); } } return replaceLegs(trade, legBuilder.build()); }</code><technical_language>rates notionals</technical_language>

Target:
private static SwapTrade parseVariableRates(SwapTrade trade, List<CsvRow> variableRows) { ImmutableList.Builder<ValueStep> stepBuilder = ImmutableList.builder(); for (CsvRow row : variableRows) { LocalDate date = LoaderUtils.parseDate(row.getValue(START_DATE_FIELD)); row.findValue(FIXED_RATE_FIELD) .map(str -> LoaderUtils.parseDoublePercent(str)) .ifPresent(fixedRate -> stepBuilder.add(ValueStep.of(date, ValueAdjustment.ofReplace(fixedRate)))); } ImmutableList<ValueStep> varRates = stepBuilder.build(); if (varRates.isEmpty()) { return trade; } ImmutableList.Builder<SwapLeg> legBuilder = ImmutableList.builder(); for (SwapLeg swapLeg : trade.getProduct().getLegs()) { RateCalculationSwapLeg leg = (RateCalculationSwapLeg) swapLeg; if (leg.getCalculation() instanceof FixedRateCalculation) { FixedRateCalculation baseCalc = (FixedRateCalculation) leg.getCalculation(); FixedRateCalculation calc = baseCalc.toBuilder() .rate(ValueSchedule.of(baseCalc.getRate().getInitialValue(), varRates)) .build(); legBuilder.add(leg.toBuilder().calculation(calc).build()); } else { legBuilder.add(leg); } } return replaceLegs(trade, legBuilder.build()); }
Source:
<code>private static String arrayToString(final Object o) { if (o == null) { return "null"; } <START> if (o.getClass().isArray()) { <END> if (o instanceof Object[]) { return Arrays.toString((Object[]) o); } if (byte[].class.equals(o.getClass())) { return Arrays.toString((byte[])o); } if (short[].class.equals(o.getClass())) { return Arrays.toString((short[])o); } if (char[].class.equals(o.getClass())) { return Arrays.toString((char[])o); } if (int[].class.equals(o.getClass())) { return Arrays.toString((int[])o); } if (long[].class.equals(o.getClass())) { return Arrays.toString((long[])o); } if (float[].class.equals(o.getClass())) { return Arrays.toString((float[])o); } if (double[].class.equals(o.getClass())) { return Arrays.toString((double[])o); } if (boolean[].class.equals(o.getClass())) { return Arrays.toString((boolean[])o); } } return "unknown"; }</code><technical_language>This condition is checked caller. Delete it</technical_language>

Target:
private static String arrayToString(final Object o) { if (o instanceof Object[]) { return Arrays.toString((Object[]) o); } final Class<?> clazz = o.getClass(); if (byte[].class.equals(clazz)) { return Arrays.toString((byte[]) o); } if (short[].class.equals(clazz)) { return Arrays.toString((short[]) o); } if (char[].class.equals(clazz)) { return Arrays.toString((char[]) o); } if (int[].class.equals(clazz)) { return Arrays.toString((int[]) o); } if (long[].class.equals(clazz)) { return Arrays.toString((long[]) o); } if (float[].class.equals(clazz)) { return Arrays.toString((float[]) o); } if (double[].class.equals(clazz)) { return Arrays.toString((double[]) o); } if (boolean[].class.equals(clazz)) { return Arrays.toString((boolean[]) o); } throw new IllegalArgumentException("Unknown array type: " + o.getClass()); }
Source:
<code>public void removeProfile(ProfileService profile) { <START> Message m = mHandler.obtainMessage(MESSAGE_PROFILE_SERVICE_STATE_CHANGED); m.obj = profile; m.arg1 = MESSAGE_PROFILE_UNREGISTERED; <END> mHandler.sendMessage(m); }</code><technical_language>This done call obtainMessage(what, arg1, arg2, obj)</technical_language>

Target:
public void removeProfile(ProfileService profile) { Message m = mHandler.obtainMessage(MESSAGE_PROFILE_SERVICE_UNREGISTERED, profile); mHandler.sendMessage(m); }
Source:
<code>void verifyGetterOpenBraceStyle(GetterClauseContext ctx) { <START> Location getLocation = ListenerUtil.getContextStartLocation(ctx); <END> verifyCodeBlockOpenBraceStyle(Messages.GETTER, getLocation, ctx.codeBlock()); }</code><technical_language>this location of left sibling of ctx.codeBlock</technical_language>

Target:
void verifyGetterOpenBraceStyle(GetterClauseContext ctx) { TerminalNodeImpl get = (TerminalNodeImpl) ParseTreeUtil.getLeftSibling(ctx.codeBlock()); Location getLocation = ListenerUtil.getTokenLocation(get.getSymbol()); verifyCodeBlockOpenBraceStyle(Messages.GETTER, getLocation, ctx.codeBlock()); }
Source:
<code><START> protected int getBlockSize(final String encryptionMode) { <END> return BLOCK_SIZE_CACHE.computeIfAbsent(encryptionMode, BLOCK_SIZE_CALCULATOR); }</code><technical_language>static</technical_language>

Target:
protected static int getBlockSize(final String encryptionMode) { return BLOCK_SIZE_CACHE.computeIfAbsent(encryptionMode, BLOCK_SIZE_CALCULATOR); }
Source:
<code>public void onRestart() { if (postsSort == DiscussionPostsSort.LAST_ACTIVITY_AT && mSelectedItem != -1) { discussionPostsAdapter.moveToTop(mSelectedItem); <START> mSelectedItem = -1; <END> } nextPage = 1; controller.refresh(); }</code><technical_language>This done onItemClick() callback, removing need store click index. Or, if this change is visible new Activity transition, this action posted event queue (i.e. a Handler) there</technical_language>

Target:
public void onRestart() { if (postsSort == DiscussionPostsSort.LAST_ACTIVITY_AT && mSelectedItem != -1) { discussionPostsAdapter.moveToTop(mSelectedItem); mSelectedItem = -1; } nextPage = 1; controller.resetSilently(); }
Source:
<code>public Document getNextPage(Document doc) throws IOException { String nextPage = ""; Element elem = null; if (getHost().contains("www.totempole666.com") == true <START> || getHost().contains("buttsmithy.com") == true <END> || getHost().contains("themonsterunderthebed.net") || getHost().contains("prismblush.com") || getHost().contains("www.konradokonski.com") || getHost().contains("thisis.delvecomic.com")) { elem = doc.select("a.comic-nav-next").first(); if (elem == null) { throw new IOException("No more pages"); } nextPage = elem.attr("href"); } if (nextPage == "") { throw new IOException("No more pages"); } else { sleep(500); return Http.url(nextPage).get(); } }</code><technical_language>== true While clean up</technical_language>

Target:
public Document getNextPage(Document doc) throws IOException { String nextPage = ""; Element elem = null; if (getHost().contains("www.totempole666.com") || getHost().contains("buttsmithy.com") || getHost().contains("themonsterunderthebed.net") || getHost().contains("prismblush.com") || getHost().contains("www.konradokonski.com") || getHost().contains("thisis.delvecomic.com")) { elem = doc.select("a.comic-nav-next").first(); if (elem == null) { throw new IOException("No more pages"); } nextPage = elem.attr("href"); } if (nextPage == "") { throw new IOException("No more pages"); } else { return Http.url(nextPage).get(); } }
Source:
<code>public boolean onOptionsItemSelected(MenuItem item) { if (usingNavDrawer() && item.getItemId() == android.R.id.home) { if (navDrawerController.isDrawerOpen()) { navDrawerController.closeDrawer(); } else { navDrawerController.openDrawer(); <START> } <END> return true; } return super.onOptionsItemSelected(item); }</code><technical_language>nice move more of nav drawer control code NavDrawerController class. For instance, 3 lines in NavDrawerController.toggleDrawer(). Also, move outState.putBoolean(KEY_DRAWER_WAS_OPEN, navDrawerController.isDrawerOpen()); controller class this class state of nav drawer all. This allow hide reopenDrawerInOnResume</technical_language>

Target:
public boolean onOptionsItemSelected(MenuItem item) { if (usingNavDrawer() && item.getItemId() == android.R.id.home) { navDrawerController.toggleDrawer(); return true; } return super.onOptionsItemSelected(item); }
Source:
<code>public boolean delete() { if (fileLock != null) { try { fileLock.release(); } catch (Exception ignored) { } } try { return Files.deleteIfExists(file.toPath()); } catch (Exception ignored) { <START> return false; <END> } }</code><technical_language>log warning</technical_language>

Target:
public void delete() { release(); deleteIfExists(file); }
Source:
<code>protected void onRevisit() { <START> if (NetworkUtil.isConnected(getActivity())) { <END> if (getActivity() instanceof SnackbarStatusListener) { ((SnackbarStatusListener) getActivity()).hideSnackBar(); } } }</code><technical_language>2 conditions merged 1 condition</technical_language>

Target:
protected void onRevisit() { CourseTabsUtils.onRevisit(getActivity()); }
Source:
<code>public ClientTxContext(int txId, GridNearTxLocal tx) { this.txId = txId; <START> this.tx = tx; <END> }</code><technical_language>arg checks</technical_language>

Target:
public ClientTxContext(int txId, GridNearTxLocal tx) { assert txId != 0; assert tx != null; this.txId = txId; this.tx = tx; }
Source:
<code>public static List<ProcessKillingVeto> all() { Jenkins jenkins = Jenkins.getInstance(); <START> if ( null == jenkins ) return Collections.emptyList(); <END> return jenkins.getExtensionList(ProcessKillingVeto.class); }</code><technical_language>Commonly in Jenkins another order of parameters in comparisons. if defined in code conventions</technical_language>

Target:
public static List<ProcessKillingVeto> all() { Jenkins jenkins = Jenkins.getInstance(); if (jenkins == null) return Collections.emptyList(); return jenkins.getExtensionList(ProcessKillingVeto.class); }
Source:
<code>private void validateBoundaryOutgoingTransitions(final BoundaryEventDefinition boundaryEvent) { for (final TransitionDefinition transition : boundaryEvent.getOutgoingTransitions()) { if (transition.getCondition() != null) { <START> designErrors.add("A boundary event must have not unconditional transitions: " + transition.getSource() + "->" + transition.getTarget()); <END> } } }</code><technical_language>I understand, message contrary: "A boundary event conditional transitions". no</technical_language>

Target:
private void validateBoundaryOutgoingTransitions(final BoundaryEventDefinition boundaryEvent) { for (final TransitionDefinition transition : boundaryEvent.getOutgoingTransitions()) { if (transition.getCondition() != null) { designErrors.add("A boundary event must have no conditional transitions: " + transition.getSource() + "->" + transition.getTarget()); } } }
Source:
<code>public boolean performFinish() { final boolean result[] = { false }; try { getContainer().run(false, false, new IRunnableWithProgress() { public void run(IProgressMonitor monitor) throws InvocationTargetException, InterruptedException { try { IProject project = scenarioPage.getProject(); String name = scenarioPage.getScenarioName(); IPath containerPath = scenarioPage.getPathInProject(); testCase = RcpttCore .create(project) .getFolder(containerPath) .createTestCase(name, true, new NullProgressMonitor()); ITestCase workingCopy = (ITestCase) testCase .getWorkingCopy(new NullProgressMonitor()); try { workingCopy.setType(getType()); <START> WriteAccessChecker writeAccessChecker = new WriteAccessChecker(); <END> if (!writeAccessChecker.makeResourceWritable(workingCopy)) { result[0] = false; } else { workingCopy.commitWorkingCopy(true, new NullProgressMonitor()); } } finally { workingCopy.discardWorkingCopy(); } if (openEditor) { IDE.openEditor(getPage(), (IFile) testCase.getResource()); } result[0] = true; } catch (Exception e) { Q7UIPlugin.log(e); result[0] = false; } } }); } catch (Throwable e) { Q7UIPlugin.log(e); } return result[0]; }</code><technical_language>Wizard shell</technical_language>

Target:
public boolean performFinish() { final boolean result[] = { false }; try { getContainer().run(false, false, new IRunnableWithProgress() { public void run(IProgressMonitor monitor) throws InvocationTargetException, InterruptedException { try { IProject project = scenarioPage.getProject(); String name = scenarioPage.getScenarioName(); IPath containerPath = scenarioPage.getPathInProject(); testCase = RcpttCore .create(project) .getFolder(containerPath) .createTestCase(name, true, new NullProgressMonitor()); ITestCase workingCopy = (ITestCase) testCase .getWorkingCopy(new NullProgressMonitor()); try { workingCopy.setType(getType()); WriteAccessChecker writeAccessChecker = new WriteAccessChecker(getShell()); if (!writeAccessChecker.makeResourceWritable(workingCopy)) { result[0] = false; } else { workingCopy.commitWorkingCopy(true, new NullProgressMonitor()); } } finally { workingCopy.discardWorkingCopy(); } if (openEditor) { IDE.openEditor(getPage(), (IFile) testCase.getResource()); } result[0] = true; } catch (Exception e) { Q7UIPlugin.log(e); result[0] = false; } } }); } catch (Throwable e) { Q7UIPlugin.log(e); } return result[0]; }
Source:
<code>public void storeAssociation(EntityKey key, Association document) { byte[] associationId = associationId( key ); connection.del( associationId ); for ( Object row : document.getRows() ) { <START> connection.rpush( associationId, serializationStrategy.serialize( row ) ); <END> } }</code><technical_language>this JSON? I missing something. I sense "transaction" semantics write rows of association in go</technical_language>

Target:
private void storeAssociation(EntityKey key, Association document) { byte[] associationId = associationId( key ); connection.del( associationId ); for ( Object row : document.getRows() ) { connection.rpush( associationId, serializationStrategy.serialize( row ) ); } }
Source:
<code>private void removeVmStatelessImages() { if (getSnapshotDao().exists(getVmId(), SnapshotType.STATELESS) <START> && !VmPoolType.Manual.equals(getVmPoolType())) { <END> log.info("Deleting snapshot for stateless vm '{}'", getVmId()); runInternalAction(VdcActionType.RestoreStatelessVm, new VmOperationParameterBase(getVmId()), ExecutionHandler.createDefaultContextForTasks(getContext(), getLock())); } }</code><technical_language>same, is more standard compare enums == != 'equals' - behaves</technical_language>

Target:
private void removeVmStatelessImages() { if (getSnapshotDao().exists(getVmId(), SnapshotType.STATELESS) && getVmPoolType() != VmPoolType.Manual) { log.info("Deleting snapshot for stateless vm '{}'", getVmId()); runInternalAction(VdcActionType.RestoreStatelessVm, new VmOperationParameterBase(getVmId()), ExecutionHandler.createDefaultContextForTasks(getContext(), getLock())); } }
Source:
<code>public void testCanceledExecutionReturnsSlot() throws Exception { final JobVertex jobVertex = createNoOpJobVertex(); final JobVertexID jobVertexId = jobVertex.getID(); final SimpleAckingTaskManagerGateway taskManagerGateway = new SimpleAckingTaskManagerGateway(); TestingPhysicalSlotProvider physicalSlotProvider = TestingPhysicalSlotProvider.builder() .withTaskManagerGateway(taskManagerGateway) .build(); final SchedulerBase scheduler = SchedulerTestingUtils.newSchedulerBuilder(new JobGraph(jobVertex)) .setExecutionSlotAllocatorFactory(SchedulerTestingUtils.slotSharingExecutionSlotAllocatorFactoryBuilder() .withSlotProvider(physicalSlotProvider) .build()) .build(); scheduler.initialize(testMainThreadUtil.getMainThreadExecutor()); ExecutionJobVertex executionJobVertex = scheduler.getExecutionJobVertex(jobVertexId); ExecutionVertex executionVertex = executionJobVertex.getTaskVertices()[0]; final Execution execution = executionVertex.getCurrentExecutionAttempt(); taskManagerGateway.setCancelConsumer( executionAttemptID -> { if (execution.getAttemptId().equals(executionAttemptID)) { execution.completeCancelling(); } } ); testMainThreadUtil.execute(scheduler::startScheduling); testMainThreadUtil.execute(execution::cancel); <START> assertThat(physicalSlotProvider.getRequests().keySet(), is(physicalSlotProvider.getCancellations().keySet())); <END> }</code><technical_language>nicer :-)</technical_language>

Target:
public void testCanceledExecutionReturnsSlot() throws Exception { final JobVertex jobVertex = createNoOpJobVertex(); final JobVertexID jobVertexId = jobVertex.getID(); final SimpleAckingTaskManagerGateway taskManagerGateway = new SimpleAckingTaskManagerGateway(); TestingPhysicalSlotProvider physicalSlotProvider = TestingPhysicalSlotProvider.create( (resourceProfile) -> CompletableFuture.completedFuture( TestingPhysicalSlot.builder() .withTaskManagerGateway(taskManagerGateway) .build())); final SchedulerBase scheduler = SchedulerTestingUtils.newSchedulerBuilder(new JobGraph(jobVertex)) .setExecutionSlotAllocatorFactory( SchedulerTestingUtils.newSlotSharingExecutionSlotAllocatorFactory( physicalSlotProvider)) .build(); scheduler.initialize(testMainThreadUtil.getMainThreadExecutor()); ExecutionJobVertex executionJobVertex = scheduler.getExecutionJobVertex(jobVertexId); ExecutionVertex executionVertex = executionJobVertex.getTaskVertices()[0]; final Execution execution = executionVertex.getCurrentExecutionAttempt(); taskManagerGateway.setCancelConsumer( executionAttemptID -> { if (execution.getAttemptId().equals(executionAttemptID)) { execution.completeCancelling(); } }); testMainThreadUtil.execute(scheduler::startScheduling); testMainThreadUtil.execute(execution::cancel); assertThat( physicalSlotProvider.getRequests().keySet(), is(physicalSlotProvider.getCancellations().keySet())); }
Source:
<code>protected void onCreate(Bundle savedInstanceState) { Timber.d("onCreate()"); mExtensions = new ReviewerExtRegistry(getBaseContext()); restorePreferences(); super.onCreate(savedInstanceState); setContentView(getContentViewAttr(mPrefFullscreenReview)); getDelegate().setHandleNativeActionModesEnabled(true); View mainView = findViewById(android.R.id.content); initNavigationDrawer(mainView); <START> if (!isFinishing()) { <END> startLoadingCollection(); } }</code><technical_language>This sense me, please explain</technical_language>

Target:
protected void onCreate(Bundle savedInstanceState) { Timber.d("onCreate()"); mExtensions = new ReviewerExtRegistry(getBaseContext()); restorePreferences(); super.onCreate(savedInstanceState); setContentView(getContentViewAttr(mPrefFullscreenReview)); getDelegate().setHandleNativeActionModesEnabled(true); View mainView = findViewById(android.R.id.content); initNavigationDrawer(mainView); startLoadingCollection(); }
Source:
<code>public void onSubscribe(Subscription s) { if (SubscriptionHelper.validate(this.s, s)) { this.s = s; if (s instanceof QueueSubscription) { @SuppressWarnings("unchecked") QueueSubscription<T> qs = (QueueSubscription<T>) s; int m = qs.requestFusion(ANY); if (m == SYNC) { fusionMode = m; this.queue = qs; done = true; actual.onSubscribe(this); return; } else <START> if (m == ASYNC) { <END> fusionMode = m; this.queue = qs; actual.onSubscribe(this); s.request(prefetch); return; } } queue = new SpscArrayQueue<T>(prefetch); actual.onSubscribe(this); s.request(prefetch); } }</code><technical_language>Is this wrap+indent intentional? a figure out</technical_language>

Target:
public void onSubscribe(Subscription s) { if (SubscriptionHelper.validate(this.s, s)) { this.s = s; if (s instanceof QueueSubscription) { @SuppressWarnings("unchecked") QueueSubscription<T> qs = (QueueSubscription<T>) s; int m = qs.requestFusion(ANY); if (m == SYNC) { fusionMode = m; this.queue = qs; done = true; actual.onSubscribe(this); return; } if (m == ASYNC) { fusionMode = m; this.queue = qs; actual.onSubscribe(this); s.request(prefetch); return; } } queue = new SpscArrayQueue<T>(prefetch); actual.onSubscribe(this); s.request(prefetch); } }
Source:
<code>private Object executeFindQuery(final KeyValueQuery<?> query, final QueryMethod queryMethod, final boolean distinct ) { Iterable<?> resultSet = this.keyValueOperations.find(query, queryMethod.getEntityInformation().getJavaType()); if (!queryMethod.isCollectionQuery() && !queryMethod.isPageQuery() && !queryMethod.isSliceQuery() && !queryMethod .isStreamQuery()) { return resultSet.iterator().hasNext() ? resultSet.iterator().next() : null; } if (queryMethod.isStreamQuery()) { <START> if (distinct) { final List<?> list = IterableConverter.toList(resultSet); List<?> result = collectDistinct(list); return StreamUtils.createStreamFromIterator(result.iterator()); } return StreamUtils.createStreamFromIterator(resultSet.iterator()); <END> } if (distinct) { return StreamUtils.createStreamFromIterator(resultSet.iterator()).distinct().collect(Collectors.toList()); } return resultSet; }</code><technical_language>in case above, avoid intermediate List conversions. a Stream Iterable call distinct()</technical_language>

Target:
private Object executeFindQuery(final KeyValueQuery<?> query, final QueryMethod queryMethod, final boolean distinct) { Iterable<?> resultSet = this.keyValueOperations.find(query, queryMethod.getEntityInformation().getJavaType()); if (!queryMethod.isCollectionQuery() && !queryMethod.isPageQuery() && !queryMethod.isSliceQuery() && !queryMethod .isStreamQuery()) { return resultSet.iterator().hasNext() ? resultSet.iterator().next() : null; } if (queryMethod.isStreamQuery()) { if (distinct) { return StreamUtils.createStreamFromIterator(resultSet.iterator()).distinct(); } return StreamUtils.createStreamFromIterator(resultSet.iterator()); } if (distinct) { return StreamUtils.createStreamFromIterator(resultSet.iterator()).distinct().collect(Collectors.toList()); } return resultSet; }
Source:
<code>void addTopicChange(final int word, final int topicIndex, final int delta) { if (!changedTopicCounts.containsKey(word)) { <START> changedTopicCounts.put(word, new int[numTopics]); <END> } final int[] changedTopicCountsForWord = changedTopicCounts.get(word); changedTopicCountsForWord[topicIndex] += delta; }</code><technical_language>This implementation is a bit discussed yesterday. This batch is small (except for initialization), a map instead of array. Or, I missing something</technical_language>

Target:
void addTopicChange(final int word, final int topicIndex, final int delta) { if (!changedTopicCounts.contains(word, topicIndex)) { changedTopicCounts.put(word, topicIndex, 0); } changedTopicCounts.put(word, topicIndex, delta + changedTopicCounts.get(word, topicIndex)); }
Source:
<code>public static void setUpBeforeClass() throws Exception { util.getConfiguration().set(CoprocessorHost.REGION_COPROCESSOR_CONF_KEY, ""); util.getConfiguration().setInt(LoadIncrementalHFiles.MAX_FILES_PER_REGION_PER_FAMILY, MAX_FILES_PER_REGION_PER_FAMILY); util.getConfiguration().set(HConstants.RPC_CODEC_CONF_KEY, KeyValueCodecWithTags.class.getCanonicalName()); <START> util.getConfiguration().setBoolean(BulkLoadHFiles.BULK_LOAD_HFILES_BY_FAMILY, false); <END> util.startMiniCluster(); setupNamespace(); }</code><technical_language>Is this needed? BULK_LOAD_HFILES_BY_FAMILY loaded false default if set LoadIncrementalHFiles#195? move this for a separate method overridden TestLoadIncrementalHFilesByFamily avoid duplicating setUpBeforeClass in child class</technical_language>

Target:
public static void setUpBeforeClass() throws Exception { util.getConfiguration().set(CoprocessorHost.REGION_COPROCESSOR_CONF_KEY, ""); util.getConfiguration().setInt(LoadIncrementalHFiles.MAX_FILES_PER_REGION_PER_FAMILY, MAX_FILES_PER_REGION_PER_FAMILY); util.getConfiguration().set(HConstants.RPC_CODEC_CONF_KEY, KeyValueCodecWithTags.class.getCanonicalName()); util.startMiniCluster(); setupNamespace(); }
Source:
<code>protected static String joinNames(Command... commands) { StringJoiner joiner = new StringJoiner(", "); <START> for (Command cs : commands) { <END> joiner.add(cs.getName()); } return joiner.toString(); }</code><technical_language>cs</technical_language>

Target:
protected static String joinNames(Command... commands) { StringJoiner joiner = new StringJoiner(", "); for (Command c : commands) { joiner.add(c.getName()); } return joiner.toString(); }
Source:
<code>public void testConnectionFactoryStringWithInvalidParameter() throws NamingException, JMSException { Hashtable<String, String> props = new Hashtable<>(); <START> props.put(Context.INITIAL_CONTEXT_FACTORY, "org.apache.activemq.artemis.jndi.ActiveMQInitialContextFactory"); <END> props.put("connectionFactory.ConnectionFactory", "tcp://localhost:61616?foo=too"); Context ctx = new InitialContext(props); props.put("java.naming.provider.url", ""); new InitialContext(props); }</code><technical_language>asserting here? AssertionLogger (whatever name is)</technical_language>

Target:
public void testConnectionFactoryStringWithInvalidParameter() throws Exception { Hashtable<String, String> props = new Hashtable<>(); props.put(Context.INITIAL_CONTEXT_FACTORY, "org.apache.activemq.artemis.jndi.ActiveMQInitialContextFactory"); props.put("connectionFactory.ConnectionFactory", "tcp://localhost:61616?foo=too"); AssertionLoggerHandler.startCapture(); try { new InitialContext(props); assertTrue("Expected to find AMQ212078", AssertionLoggerHandler.findText("AMQ212078")); } finally { AssertionLoggerHandler.stopCapture(); } }
Source:
<code>private List<StorageServerConnections> parseFullTargets(List<String> iqnList) { ArrayList<StorageServerConnections> connections = new ArrayList<StorageServerConnections>(iqnList.size()); for (String fullTarget : iqnList) { StorageServerConnections con = StorageServerConnections.copyOf(getParameters().getConnection()); String[] tokens = fullTarget.split(","); String[] address = tokens[0].split(":"); String[] literals = tokens[1].split(" "); con.setport(address[1]); con.setportal(literals[0]); con.setiqn(literals[1]); <START> log.infoFormat("Connection to {0} requested, VDSM returned {1}.", con.getconnection(), address[0]); <END> connections.add(con); } return connections; }</code><technical_language>wait for logging changes merged, fix this accordingly</technical_language>

Target:
private List<StorageServerConnections> parseFullTargets(List<String> iqnList) { ArrayList<StorageServerConnections> connections = new ArrayList<StorageServerConnections>(iqnList.size()); for (String fullTarget : iqnList) { StorageServerConnections con = StorageServerConnections.copyOf(getParameters().getConnection()); String[] tokens = fullTarget.split(","); String[] address = tokens[0].split(":"); String[] literals = tokens[1].split(" "); con.setport(address[1]); con.setportal(literals[0]); con.setiqn(literals[1]); log.info("Connection to requested, VDSM returned {}.", con.getconnection(), address[0]); connections.add(con); } return connections; }
Source:
<code>public void path() { StubMappingScope scope = indexManager.createScope(); SearchQuery<DocumentReference> query = scope.query().extension( ElasticsearchExtension.get() ) .predicate( f -> f.matchAll() ) .requestTransformer( context -> { <START> assertThat( context.getPath() ).isEqualTo( "/" + INDEX_NAME.toLowerCase( Locale.ROOT ) + "/_search" ); <END> context.setPath( "/_search" ); assertThat( context.getPath() ).isEqualTo( "/_search" ); } ) .toQuery(); clientSpy.expectNext( ElasticsearchRequest.post() .pathComponent( URLEncodedString.fromString( "_search" ) ) .body( new Gson().fromJson( "{}", JsonObject.class ) ) .build(), ElasticsearchRequestAssertionMode.EXTENSIBLE ); query.fetchAll(); }</code><technical_language>constant INDEX_NAME is lowercase</technical_language>

Target:
public void path() { StubMappingScope scope = indexManager.createScope(); SearchQuery<DocumentReference> query = scope.query().extension( ElasticsearchExtension.get() ) .predicate( f -> f.matchAll() ) .requestTransformer( context -> { assertThat( context.getPath() ).isEqualTo( "/" + INDEX_NAME + "/_search" ); context.setPath( "/_search" ); assertThat( context.getPath() ).isEqualTo( "/_search" ); } ) .toQuery(); clientSpy.expectNext( ElasticsearchRequest.post() .pathComponent( URLEncodedString.fromString( "_search" ) ) .body( new Gson().fromJson( "{}", JsonObject.class ) ) .build(), ElasticsearchRequestAssertionMode.EXTENSIBLE ); query.fetchAll(); }
Source:
<code>private void logActiveFacts() { LOGGER.warn("facts: "); for (FactHandle handle : session.getFactHandles()) { LOGGER.warn(handle.toString()); <START> } <END> }</code><technical_language>Again, a nicer one-liner Java 8 streams and/or StringJoiner</technical_language>

Target:
private void logActiveFacts() { LOGGER.warn("facts: "); session.getFactHandles().stream().map(Object::toString).forEach(LOGGER::warn); }
Source:
<code>public InternalResourceGroup getRoot() { <START> synchronized (root) { <END> return root; } }</code><technical_language>root change I access needs serialized other methods this need synchronized</technical_language>

Target:
public InternalResourceGroup getRoot() { return root; }
Source:
<code>private void initialise(boolean initView) { firstTime = true; if (initView) { initView(); } KeyStroke escape = KeyStroke.getKeyStroke(KeyEvent.VK_ESCAPE, 0, false); AbstractAction escapeAction = new AbstractAction() { private static final long serialVersionUID = -8088438488574461587L; public void actionPerformed(ActionEvent e) { <START> clearAndHide(); <END> } }; getRootPane().getInputMap(JComponent.WHEN_IN_FOCUSED_WINDOW).put(escape, "ESCAPE"); getRootPane().getActionMap().put("ESCAPE", escapeAction); }</code><technical_language>missing override annotation</technical_language>

Target:
private void initialise(boolean initView) { firstTime = true; if (initView) { initView(); } KeyStroke escape = KeyStroke.getKeyStroke(KeyEvent.VK_ESCAPE, 0, false); AbstractAction escapeAction = new AbstractAction() { private static final long serialVersionUID = -8088438488574461587L; @Override public void actionPerformed(ActionEvent e) { clearAndHide(); } }; getRootPane().getInputMap(JComponent.WHEN_IN_FOCUSED_WINDOW).put(escape, "ESCAPE"); getRootPane().getActionMap().put("ESCAPE", escapeAction); }
Source:
<code>public void testTimeRange() { <START> long referenceTimeInSecs = 10L; <END> long errorMarginInSecs = 5L; TimeRange timeRangeWithNoErrorMargin = new TimeRange(referenceTimeInSecs, 0L); TimeRange timeRangeWithErrorMargin = new TimeRange(referenceTimeInSecs, errorMarginInSecs); assertEquals("Start time and end time should be equal for TimeRange with no error margin", timeRangeWithNoErrorMargin.getStartTimeInSecs(), timeRangeWithNoErrorMargin.getEndTimeInSecs()); assertEquals("TimeRange with no error margin is constructed incorrectly", referenceTimeInSecs, timeRangeWithNoErrorMargin.getStartTimeInSecs()); assertEquals("Start time of TimeRange with error margin is incorrect", referenceTimeInSecs - errorMarginInSecs, timeRangeWithErrorMargin.getStartTimeInSecs()); assertEquals("End time of TimeRange with error margin is incorrect", referenceTimeInSecs + errorMarginInSecs, timeRangeWithErrorMargin.getEndTimeInSecs()); }</code><technical_language>generate random time</technical_language>

Target:
public void testTimeRange() { Random rand = new Random(); long referenceTimeInMs = rand.nextInt(10000) + 10000; TimeRange timeRangeWithNoErrorMargin = new TimeRange(referenceTimeInMs, 0L); long errorMarginInMs = rand.nextInt(10000); TimeRange timeRangeWithErrorMargin = new TimeRange(referenceTimeInMs, errorMarginInMs); assertEquals("Start time and end time should be equal for TimeRange with no error margin", timeRangeWithNoErrorMargin.getStartTimeInMs(), timeRangeWithNoErrorMargin.getEndTimeInMs()); assertEquals("TimeRange with no error margin is constructed incorrectly", referenceTimeInMs, timeRangeWithNoErrorMargin.getStartTimeInMs()); assertEquals("Start time of TimeRange with error margin is incorrect", referenceTimeInMs - errorMarginInMs, timeRangeWithErrorMargin.getStartTimeInMs()); assertEquals("End time of TimeRange with error margin is incorrect", referenceTimeInMs + errorMarginInMs, timeRangeWithErrorMargin.getEndTimeInMs()); }
Source:
<code>private void logSlowLockAcquisition(String lockId, LockClient currentHolder, long durationMillis) { if (isSlowLogEnabled() && durationMillis >= slowLogTriggerMillis) { SlowLockLogger.logger.info("Blocked for ms to acquire lock {}.", durationMillis, lockId, currentHolder == null ? "successfully" : "unsuccessfully"); <START> } else if (durationMillis > 100) { <END> log.debug("Blocked for ms to acquire lock {}.", durationMillis, lockId, currentHolder == null ? "successfully" : "unsuccessfully"); } }</code><technical_language>extract magic number here. is this threshold 100x default TimeLock configuration below</technical_language>

Target:
protected void logSlowLockAcquisition(String lockId, LockClient currentHolder, long durationMillis) { String slowLockLogMessage = "Blocked for ms to acquire lock {}."; if (isSlowLogEnabled() && durationMillis >= slowLogTriggerMillis) { SlowLockLogger.logger.info(slowLockLogMessage, durationMillis, lockId, currentHolder == null ? "successfully" : "unsuccessfully"); } else if (log.isDebugEnabled() && durationMillis > DEBUG_SLOW_LOG_TRIGGER_MILLIS) { log.debug(slowLockLogMessage, durationMillis, lockId, currentHolder == null ? "successfully" : "unsuccessfully"); } }
Source:
<code>public CrashDetails(String crashIdentifier) { this.crashIdentifier = crashIdentifier; <START> appStartDate = new Date(); <END> appCrashDate = new Date(); isXamarinException = false; throwableStackTrace = ""; }</code><technical_language>lines dangerous, values true in this case, default values. null. code causing exception experiencing handling null case instead gracefully handle (not recommended rely fields) throw a more reasonable exception. Overriding CrashManager / ExceptionHandler building produce valid crash report files</technical_language>

Target:
public CrashDetails(String crashIdentifier) { this.crashIdentifier = crashIdentifier; isXamarinException = false; throwableStackTrace = ""; }
Source:
<code>private void setEntityStatus(Entity entity, MachinePoolMemberStatus status) { <START> checkNotNull(entity, "What?"); <END> ((EntityInternal) entity).setAttribute(SERVER_STATUS, status); }</code><technical_language>message, checkNotNull(entity, "entity")</technical_language>

Target:
private void setEntityStatus(Entity entity, MachinePoolMemberStatus status) { ((EntityInternal) entity).setAttribute(SERVER_STATUS, status); }
Source:
<code>public TmfGraphBuildRequest(ITmfGraphProvider provider, IProgressMonitor monitor) { super(TmfEvent.class, TmfTimeRange.ETERNITY, 0, ITmfEventRequest.ALL_DATA, ITmfEventRequest.ExecutionType.BACKGROUND); fProvider = provider; long nbEvents = provider.getTrace().getNbEvents(); fEventFactor = nbEvents < Integer.MAX_VALUE ? DEFAULT_FACTOR : (int) Math.ceil(nbEvents * 10.0 / Integer.MAX_VALUE); <START> fMonitor = SubMonitor.convert(monitor, (int) Math.min(nbEvents / fEventFactor, Integer.MAX_VALUE)); <END> }</code><technical_language>If I understand correctly, nbEvents is greater Integer.MAX value, amount of work is a constant (MAX_VALUE/10.0). is number of 10K chunks. split work in a fixed number of units (e.g. 100)? SubMonitor.setWorkRemaining() based % of number of events remaining read, matter if nbEvents is in integer long range</technical_language>

Target:
public TmfGraphBuildRequest(ITmfGraphProvider provider, IProgressMonitor monitor) { super(TmfEvent.class, TmfTimeRange.ETERNITY, 0, ITmfEventRequest.ALL_DATA, ITmfEventRequest.ExecutionType.BACKGROUND); fProvider = provider; long nbEvents = provider.getTrace().getNbEvents(); fEventFactor = nbEvents / DEFAULT_FACTOR; fMonitor = SubMonitor.convert(monitor, DEFAULT_FACTOR); }