auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>private PollingResult compare(Launcher launcher, TaskListener listener, MercurialTagAction baseline, PrintStream output, Node node, FilePath repository, AbstractProject<?,?> project) throws IOException, InterruptedException { HgExe hg = new HgExe(findInstallation(getInstallation()), getCredentials(project), launcher, node, listener, new EnvVars()); String _branch = getBranchExpanded(project); String remote = hg.tip(repository, _branch); String rev = hg.tipNumber(repository, _branch); <START> if(!(project instanceof MatrixProject)) { <END> Change change = null; for(AbstractComparator s : AbstractComparator.all()) { Change c = s.compare(this, launcher, listener, baseline, output, node, repository, project); if(c != null) { if(change == null || c.compareTo(change) > 0){ change = c; } } } if(change != null) { return new PollingResult(baseline, new MercurialTagAction(remote, rev, subdir), change); } } if (remote == null) { throw new IOException("failed to find ID of branch head"); } if (rev == null) { throw new IOException("failed to find revision of branch head"); } if (remote.equals(baseline.id)) { return new PollingResult(baseline, new MercurialTagAction(remote, rev, subdir), Change.NONE); } Set<String> changedFileNames = parseStatus(hg.popen(repository, listener, false, new ArgumentListBuilder("status", "--rev", baseline.id, "--rev", remote))); MercurialTagAction cur = new MercurialTagAction(remote, rev, subdir); return new PollingResult(baseline,cur,computeDegreeOfChanges(changedFileNames,output)); }</code><technical_language>exclude matrix projects? if is some reason do so, left extension implementation</technical_language>

Target:
private PollingResult compare(Launcher launcher, TaskListener listener, MercurialTagAction baseline, PrintStream output, Node node, FilePath repository, AbstractProject<?,?> project) throws IOException, InterruptedException { HgExe hg = new HgExe(findInstallation(getInstallation()), getCredentials(project), launcher, node, listener, new EnvVars()); String _branch = getBranchExpanded(project); String remote = hg.tip(repository, _branch); String rev = hg.tipNumber(repository, _branch); Change change = null; for(ChangeComparator s : ChangeComparator.all()) { Change c = s.compare(this, launcher, listener, baseline, output, node, repository, project); if(c != null) { if(change == null || c.compareTo(change) > 0){ change = c; } } } if(change != null) { return new PollingResult(change); } if (remote == null) { throw new IOException("failed to find ID of branch head"); } if (rev == null) { throw new IOException("failed to find revision of branch head"); } if (remote.equals(baseline.id)) { return new PollingResult(baseline, new MercurialTagAction(remote, rev, subdir), Change.NONE); } Set<String> changedFileNames = parseStatus(hg.popen(repository, listener, false, new ArgumentListBuilder("status", "--rev", baseline.id, "--rev", remote))); MercurialTagAction cur = new MercurialTagAction(remote, rev, subdir); return new PollingResult(baseline,cur,computeDegreeOfChanges(changedFileNames,output)); }
Source:
<code>public AnnotationMemberDeclaration asAnnotationMemberDeclaration() { <START> return (AnnotationMemberDeclaration) this; <END> }</code><technical_language>this throw exception? [the for other similar cases]</technical_language>

Target:
public AnnotationMemberDeclaration asAnnotationMemberDeclaration() { throw new IllegalStateException(f("%s is not an AnnotationMemberDeclaration", this)); }
Source:
<code>public RealmObjectSchema addRealmListField(String fieldName, Class<?> primitiveType) { checkLegalName(fieldName); checkFieldNameIsAvailable(fieldName); FieldMetaData metadata = SUPPORTED_SIMPLE_FIELDS.get(primitiveType); if (metadata == null) { <START> if (primitiveType.equals(RealmObjectSchema.class)) { <END> throw new IllegalArgumentException("Use 'addRealmListField(String name, RealmObjectSchema schema)' instead to add lists that link to other RealmObjects: " + fieldName); } else { throw new IllegalArgumentException(String.format(Locale.US, "RealmList does not support lists with this type: %s(%s)", fieldName, primitiveType)); } } table.addColumn(metadata.listType, fieldName, metadata.defaultNullable); return this; }</code><technical_language>I if this check if (primitiveType.equals(RealmObjectSchema.class) || RealmModel.class.isAssignableFrom(primitiveType)) { ensure get this error message if provide Class<?> belongs a RealmModel. Currently I get RealmList support lists this type: "SomeRealmObject" confusing</technical_language>

Target:
public RealmObjectSchema addRealmListField(String fieldName, Class<?> primitiveType) { checkLegalName(fieldName); checkFieldNameIsAvailable(fieldName); FieldMetaData metadata = SUPPORTED_SIMPLE_FIELDS.get(primitiveType); if (metadata == null) { if (primitiveType.equals(RealmObjectSchema.class) || RealmModel.class.isAssignableFrom(primitiveType)) { throw new IllegalArgumentException("Use 'addRealmListField(String name, RealmObjectSchema schema)' instead to add lists that link to other RealmObjects: " + fieldName); } else { throw new IllegalArgumentException(String.format(Locale.US, "RealmList does not support lists with this type: %s(%s)", fieldName, primitiveType)); } } table.addColumn(metadata.listType, fieldName, metadata.defaultNullable); return this; }
Source:
<code>private static Block createBlock(int positionCount, Type type) { BlockBuilder blockBuilder = type.createBlockBuilder(null, positionCount); if (type instanceof VarcharType) { for (int i = 0; i < positionCount; i++) { <START> type.writeSlice(blockBuilder, Slices.utf8Slice(String.valueOf(ThreadLocalRandom.current().nextInt()))); <END> } } else if (type == BIGINT) { for (int i = 0; i < positionCount; i++) { type.writeLong(blockBuilder, ThreadLocalRandom.current().nextLong()); } } else { throw new UnsupportedOperationException(); } return blockBuilder.build(); }</code><technical_language>static import utf8Slice</technical_language>

Target:
private static Block createBlock(int positionCount, Type type) { BlockBuilder blockBuilder = type.createBlockBuilder(null, positionCount); if (type instanceof VarcharType) { for (int i = 0; i < positionCount; i++) { type.writeSlice(blockBuilder, utf8Slice(String.valueOf(ThreadLocalRandom.current().nextInt()))); } } else if (type == BIGINT) { for (int i = 0; i < positionCount; i++) { type.writeLong(blockBuilder, ThreadLocalRandom.current().nextLong()); } } else { throw new UnsupportedOperationException(); } return blockBuilder.build(); }
Source:
<code>private static <T> T invoke(Method method, Object obj, Object... args) { try { <START> return (T)method.invoke(obj, args); <END> } catch (IllegalAccessException e) { throw new IllegalArgumentException("Can't invoke method " + method.getName(), e); } catch (InvocationTargetException e) { throw new IllegalArgumentException("Can't invoke method " + method.getName(), e); } }</code><technical_language>create a warning. safe do is casting caller</technical_language>

Target:
private static Object invoke(Method method, Object obj, Object... args) { try { return method.invoke(obj, args); } catch (IllegalAccessException e) { throw new IllegalArgumentException("Can't invoke method " + method.getName(), e); } catch (InvocationTargetException e) { throw new IllegalArgumentException("Can't invoke method " + method.getName(), e); } }
Source:
<code>public void emit(ErrorType etype, ANTLRMessage msg) { switch ( etype.severity ) { case WARNING_ONE_OFF: <START> case ERROR_ONE_OFF: <END> if ( errorTypes.contains(etype) ) break; case WARNING: warnings++; tool.warning(msg); break; case ERROR: errors++; tool.error(msg); break; } errorTypes.add(etype); }</code><technical_language>this is correct</technical_language>

Target:
public void emit(ErrorType etype, ANTLRMessage msg) { switch ( etype.severity ) { case WARNING_ONE_OFF: if ( errorTypes.contains(etype) ) break; case WARNING: warnings++; tool.warning(msg); break; case ERROR_ONE_OFF: if ( errorTypes.contains(etype) ) break; case ERROR: errors++; tool.error(msg); break; } errorTypes.add(etype); }
Source:
<code>private void validateSearchParam(String theFieldName, String theTheResourceType, String theTheSearchParam) { <START> if ("*".equals(theTheResourceType)) { <END> validateResourceSearchParam(theFieldName, "Patient", theTheSearchParam); validateResourceSearchParam(theFieldName, "Practitioner", theTheSearchParam); } else { validateResourceSearchParam(theFieldName, theTheResourceType, theTheSearchParam); } }</code><technical_language>constant * out a constant called ALL_EMPI_RESOURCE_TYPES something</technical_language>

Target:
private void validateSearchParam(String theFieldName, String theTheResourceType, String theTheSearchParam) { if (EmpiConstants.ALL_RESOURCE_SEARCH_PARAM_TYPE.equals(theTheResourceType)) { validateResourceSearchParam(theFieldName, "Patient", theTheSearchParam); validateResourceSearchParam(theFieldName, "Practitioner", theTheSearchParam); } else { validateResourceSearchParam(theFieldName, theTheResourceType, theTheSearchParam); } }
Source:
<code>public String getFullViewPath() { <START> if (null == assetRoot || "".equals(assetRoot)) { <END> return viewPath; } return URI.create(assetRoot + "/" + viewPath).normalize().toString(); }</code><technical_language>StringUtils.isBlank</technical_language>

Target:
public String getFullViewPath() { if (StringUtils.isBlank(assetRoot)) { return viewPath; } return URI.create(assetRoot + "/" + viewPath).normalize().toString(); }
Source:
<code>protected boolean validateAttachment() { NetworkClusterValidator validator = new NetworkClusterValidator(getNetworkCluster(), getClusterVersion()); return (!NetworkUtils.isManagementNetwork(getNetwork()) || validate(validator.managementNetworkAttachment(getNetworkName()))) && validate(validator.migrationPropertySupported(getNetworkName())) && <START> (!getNetwork().isExternal() <END> || validateExternalNetwork(validator)); }</code><technical_language>In AttachNetworkToVdsGroupCommand getNetwork() returns network parameters. means isExternal initialized properly. persistent network used. !NetworkUtils.isManagementNetwork(getNetwork()) problem in case id is passed (and name). is behaviour I"m a bug I miss something</technical_language>

Target:
protected boolean validateAttachment() { NetworkClusterValidator validator = new NetworkClusterValidator(getNetworkCluster(), getClusterVersion()); return (!NetworkUtils.isManagementNetwork(getNetworkName()) || validate(validator.managementNetworkAttachment(getNetworkName()))) && validate(validator.migrationPropertySupported(getNetworkName())) && (!getPersistedNetwork().isExternal() || validateExternalNetwork(validator)); }
Source:
<code>public PlanNodeCostEstimate visitSemiJoin(SemiJoinNode node, Void context) { return calculateJoinCost( node.getSource(), node.getFilteringSource(), <START> node.getDistributionType().orElse(SemiJoinNode.DistributionType.PARTITIONED).equals(SemiJoinNode.DistributionType.REPLICATED)); <END> }</code><technical_language>This is easier read: node.getDistributionType().map(JoinNode.DistributionType.REPLICATED::equals).orElse(false) Other that: - please extract this method - in case of empty distribution type check in session distribution type is prefered</technical_language>

Target:
public PlanNodeCostEstimate visitSemiJoin(SemiJoinNode node, Void context) { return calculateJoinCost( node.getSource(), node.getFilteringSource(), Objects.equals(node.getDistributionType(), Optional.of(SemiJoinNode.DistributionType.REPLICATED))); }
Source:
<code>public void processRecord(ComputationContext context, String inputStreamName, Record record) { Work work = deserialize(record.getData()); try { if (work.isIdempotent() && workIds.contains(work.getId())) { log.warn("Duplicate work id: " + work.getId() + " skipping"); } else { new WorkHolder(work).run(); workIds.add(work.getId()); KeyValueStore kvStore = Framework.getService(KeyValueService.class) .getKeyValueStore(StreamWorkManager.KV_NAME); kvStore.put(work.getId() + StreamWorkManager.STATE, Work.State.RUNNING.toString()); <START> kvStore.setTTL(work.getId() + StreamWorkManager.STATE, 60 * 60L); <END> } work.cleanUp(true, null); context.askForCheckpoint(); } catch (Exception e) { if (ExceptionUtils.hasInterruptedCause(e)) { Thread.currentThread().interrupt(); log.warn( String.format("Work id: %s title: %s, has been interrupted, it will be rescheduled, record: %s", work.getId(), work.getTitle(), record)); } else { log.error(String.format("Work id: %s title: %s is in error, the work is skipped, record: %s", work.getId(), work.getTitle(), record)); context.askForCheckpoint(); } log.debug("Exception during work " + work.getId(), e); work.cleanUp(false, e); } finally { workTimer.update(work.getCompletionTime() - work.getStartTime(), TimeUnit.MILLISECONDS); } }</code><technical_language>kvStore.put(String, String, long)? arguments is ttl</technical_language>

Target:
public void processRecord(ComputationContext context, String inputStreamName, Record record) { Work work = deserialize(record.getData()); try { if (work.isIdempotent() && workIds.contains(work.getId())) { log.warn("Duplicate work id: " + work.getId() + " skipping"); } else { boolean storeState = Boolean.parseBoolean( Framework.getService(ConfigurationService.class).getProperty(STORESTATE_KEY)); if (storeState) { StreamWorkManager.setState(work.getId(), Work.State.RUNNING.toString(), stateTTL); } new WorkHolder(work).run(); if (storeState) { KeyValueStore kvStore = Framework.getService(KeyValueService.class).getKeyValueStore(KV_NAME); kvStore.put(work.getId() + STATE_SUFFIX, (String) null); } workIds.add(work.getId()); } work.cleanUp(true, null); context.askForCheckpoint(); } catch (Exception e) { if (ExceptionUtils.hasInterruptedCause(e)) { Thread.currentThread().interrupt(); log.warn( String.format("Work id: %s title: %s, has been interrupted, it will be rescheduled, record: %s", work.getId(), work.getTitle(), record)); } else { log.error(String.format("Work id: %s title: %s is in error, the work is skipped, record: %s", work.getId(), work.getTitle(), record)); context.askForCheckpoint(); } log.debug("Exception during work " + work.getId(), e); work.cleanUp(false, e); } finally { workTimer.update(work.getCompletionTime() - work.getStartTime(), TimeUnit.MILLISECONDS); } }
Source:
<code>protected void stopParticipant(int i) { if (_participants.length <= i) { throw new HelixException(String .format("Can't stop participant %s, only %s participants" + "were set up.", i, _participants.length)); } if (_participants[i] != null) { if (_participants[i].isConnected()) { _participants[i].syncStop(); } StateMachineEngine stateMachine = _participants[i].getStateMachineEngine(); if (stateMachine != null) { <START> StateModelFactory stateModelFactory = stateMachine.getStateModelFactory("Task"); <END> if (stateModelFactory != null && stateModelFactory instanceof TaskStateModelFactory) { ((TaskStateModelFactory) stateModelFactory).shutdownNow(); } } } }</code><technical_language>Nit: constant in TaskConstants instead of hard-coded string</technical_language>

Target:
protected void stopParticipant(int i) { if (_participants.length <= i) { throw new HelixException(String .format("Can't stop participant %s, only %s participants" + "were set up.", i, _participants.length)); } if (_participants[i] != null) { if (_participants[i].isConnected()) { _participants[i].syncStop(); } StateMachineEngine stateMachine = _participants[i].getStateMachineEngine(); if (stateMachine != null) { StateModelFactory stateModelFactory = stateMachine.getStateModelFactory(TaskConstants.STATE_MODEL_NAME); if (stateModelFactory != null && stateModelFactory instanceof TaskStateModelFactory) { ((TaskStateModelFactory) stateModelFactory).shutdownNow(); } } } }
Source:
<code>public Response createIssue(@Context HttpServletRequest request, @FormParam("title") String title, @FormParam("description") String description, @FormParam("assignee") String assigneeNetID) throws IOException{ Issue issue = new Issue(); issue.setTitle(title); issue.setDescription(description); issue.setOpen(true); <START> if (!assigneeNetID.isEmpty()) { <END> User assignee = users.findByNetId(assigneeNetID); checkCollaborator(assignee); issue.setAssignee(assignee); } issue.setRepository(getRepositoryEntity()); issueBackend.createIssue(getRepositoryApi(getRepositoryEntity()), issue); return redirect(issue.getURI().toString()); }</code><technical_language>I !Stings.isNullOrEmpty() is more fail safe</technical_language>

Target:
public Response createIssue(@Context HttpServletRequest request, @FormParam("title") String title, @FormParam("description") String description, @FormParam("assignee") String assigneeNetID) throws IOException{ Issue issue = new Issue(); issue.setTitle(title); issue.setDescription(description); issue.setOpen(true); if (!Strings.isNullOrEmpty(assigneeNetID)) { User assignee = users.findByNetId(assigneeNetID); checkCollaborator(assignee); issue.setAssignee(assignee); } else { issue.setAssignee(null); } issue.setRepository(getRepositoryEntity()); issueBackend.createIssue(getRepositoryApi(getRepositoryEntity()), issue); return redirect(issue.getURI().toString()); }
Source:
<code>public boolean onFling(MotionEvent e1, MotionEvent e2, float velocityX, float velocityY) { <START> boolean swipe = false; <END> int dx = (int)(e2.getX() - e1.getX()); if(dx > SWIPE_MIN_DISTANCE && velocityX > velocityY){ if(getPlaylistService().getCurrentEntry()!= null && getPlaylistService().getCurrentEntry().equals(entry)){ getPlaylistService().skip(); } getPlaylistService().removeSong(entry); animateView(dx); swipe=true; } Log.i("Swipe Removal", "distance " + dx); return swipe; }</code><technical_language>I a good idea pull code determines if this is a swipe a private method if( isSwipe(e1, e2, velocityX, velocityY)) logic code. Questions: Is a difference swipe fling? vocab interchangeably. returned boolean mean/do</technical_language>

Target:
public boolean onFling(MotionEvent e1, MotionEvent e2, float velocityX, float velocityY) { boolean swipe = false; if(isSwipe(e1, e2, velocityX, velocityY)){ if(getPlaylistService().getCurrentEntry()!= null && getPlaylistService().getCurrentEntry().equals(entry)){ getPlaylistService().skip(); } getPlaylistService().removeSong(entry); animateDragging((int)e2.getX()); swipe=true; } return swipe; }
Source:
<code>public Object2LongMap<String> getSegmentAvailability() { final Object2LongOpenHashMap<String> retVal = new Object2LongOpenHashMap<>(); if (segmentReplicantLookup == null) { return retVal; } for (DataSegment segment : getAvailableDataSegments()) { <START> if (segmentReplicantLookup.getTotalReplicants(segment.getIdentifier()) == 0) { <END> retVal.addTo(segment.getDataSource(), 1); } } return retVal; }</code><technical_language>This change omits segments total replicants is 0. I change behavior</technical_language>

Target:
public Object2LongMap<String> getSegmentAvailability() { final Object2LongOpenHashMap<String> retVal = new Object2LongOpenHashMap<>(); if (segmentReplicantLookup == null) { return retVal; } for (DataSegment segment : getAvailableDataSegments()) { if (segmentReplicantLookup.getTotalReplicants(segment.getIdentifier()) == 0) { retVal.addTo(segment.getDataSource(), 1); } else { retVal.addTo(segment.getDataSource(), 0); } } return retVal; }
Source:
<code>public void run() { m_licenseApi = MiscUtils.licenseApiFactory(); String type = getLicenseType(m_licenseApi); String issuer = "VoltDB"; String licensee = m_licenseApi.licensee(); Calendar issueDate = m_licenseApi.issued(); String key; Calendar expirationDate = m_licenseApi.expires(); int hostCount = m_licenseApi.maxHostcount(); Boolean commandLoggingEnabled = m_licenseApi.isCommandLoggingAllowed(); <START> Boolean activePassiveDREnabled; <END> Boolean activeActiveDREnabled = m_licenseApi.isDrActiveActiveAllowed(); Boolean isDrReplicationAllowed = m_licenseApi.isDrReplicationAllowed(); hostLog.info("LICENSE INFORMATION: " + type + " license issued by " + issuer + " to " + licensee + " on " + issueDate); hostLog.info("LICENSE EXPIRES: " + expirationDate); hostLog.info("LICENSE CONSTRAINTS: " + hostCount + "nodes"); hostLog.info("LICENCE FEATURES: " + "commandLoggingEnabled=" + commandLoggingEnabled + ", activeActiveDREnabled=" + activeActiveDREnabled + ", isDrReplicationAllowed=" + isDrReplicationAllowed); m_myHostId = m_messenger.getHostId(); hostLog.info(String.format("Host id of this node is: %d", m_myHostId)); hostLog.info("URL of deployment info: " + m_config.m_pathToDeployment); hostLog.info("Cluster uptime: " + MiscUtils.formatUptime(getClusterUptime())); logDebuggingInfo(m_config, m_httpPortExtraLogMessage, m_jsonEnabled); logSystemSettingFromCatalogContext(); scheduleDailyLoggingWorkInNextCheckTime(); EnterpriseMaintenance em = EnterpriseMaintenance.get(); if (em != null) { em.dailyMaintenaceTask(); } }</code><technical_language>This variable is unused</technical_language>

Target:
public void run() { logLicensingInfo(); m_myHostId = m_messenger.getHostId(); hostLog.info(String.format("Host id of this node is: %d", m_myHostId)); hostLog.info("URL of deployment info: " + m_config.m_pathToDeployment); hostLog.info("Cluster uptime: " + MiscUtils.formatUptime(getClusterUptime())); logDebuggingInfo(m_config, m_httpPortExtraLogMessage, m_jsonEnabled); logSystemSettingFromCatalogContext(); scheduleDailyLoggingWorkInNextCheckTime(); EnterpriseMaintenance em = EnterpriseMaintenance.get(); if (em != null) { em.dailyMaintenaceTask(); } }
Source:
<code>public void testRemove() throws Exception{ String fileID = store.remove(file1); assertNull(fileID); fileID = store.putIfAbsent(file1, file1Id); assertNull(fileID); fileID = store.remove(file1); assertNotNull(fileID); <START> assertEquals(file1Id, fileID); <END> }</code><technical_language>get in end check is in collection matter</technical_language>

Target:
public void testRemove() throws Exception { String fileID = store.remove(file1); assertNull(fileID); fileID = store.putIfAbsent(file1, file1Id); assertNull(fileID); fileID = store.remove(file1); assertNotNull(fileID); assertEquals(file1Id, fileID); fileID = store.get(file1); assertNull(fileID); }
Source:
<code>private static boolean isNullLiteral(ExpressionTree lastArgument) { ExpressionTree arg = ExpressionUtils.skipParentheses(lastArgument); return arg.is(Tree.Kind.NULL_LITERAL) <START> || (arg.is(Tree.Kind.TYPE_CAST) && ((TypeCastTree) arg).expression().is(Tree.Kind.NULL_LITERAL)); <END> }</code><technical_language>if smart cautious operand replaced isNullLiteral((TypeCastTree) arg).expression()) this tested : IOUtils.write(s, output, ((String) (null)));</technical_language>

Target:
private static boolean isNullLiteral(ExpressionTree lastArgument) { ExpressionTree arg = ExpressionUtils.skipParentheses(lastArgument); return arg.is(Tree.Kind.NULL_LITERAL) || (arg.is(Tree.Kind.TYPE_CAST) && isNullLiteral(((TypeCastTree) arg).expression())); }
Source:
<code><START> private String getParamJsonString(String param, String[] params) throws JSONException { <END> JSONObject internal = new JSONObject(), external = new JSONObject(); internal.put(params[0], params[1]); external.put(param, internal); return external.toString(); }</code><technical_language>static</technical_language>

Target:
private static String getParamJsonString(String param, String[] params) throws JSONException { JSONObject internal = new JSONObject(), external = new JSONObject(); internal.put(params[0], params[1]); external.put(param, internal); return external.toString(); }
Source:
<code>@Override public ClientResponse process(ClientConnectionContext ctx) { ClientTxContext txCtx = ctx.txContext(txId); if (txCtx == null && !committed) return super.process(ctx); if (txCtx == null) throw new IgniteClientException(ClientStatus.TX_NOT_FOUND, "Transaction with id " + txId + " not found."); try (GridNearTxLocal tx = txCtx.tx()) { if (committed) tx.commit(); else tx.rollback(); } catch (IgniteCheckedException e) { <START> throw new IgniteClientException(ClientStatus.FAILED, e.getMessage(), e); <END> } finally { ctx.removeTxContext(txId); } return super.process(ctx); }</code><technical_language>Do need this catch block all? I exceptions handled stack anyway</technical_language>

Target:
@Override public ClientResponse process(ClientConnectionContext ctx) { ClientTxContext txCtx = ctx.txContext(txId); if (txCtx == null && !committed) return super.process(ctx); if (txCtx == null) throw new IgniteClientException(ClientStatus.TX_NOT_FOUND, "Transaction with id " + txId + " not found."); try { txCtx.acquire(committed); try (GridNearTxLocal tx = txCtx.tx()) { if (committed) tx.commit(); else tx.rollback(); } } catch (IgniteCheckedException e) { throw new IgniteClientException(ClientStatus.FAILED, e.getMessage(), e); } finally { ctx.removeTxContext(txId); try { txCtx.release(false); } catch (IgniteCheckedException ignore) { } } return super.process(ctx); }
Source:
<code>public UnweightedDoubleReservoirSample(int maxSamples) { <START> checkArgument(maxSamples > 0, "Number of samples must be positive"); <END> checkArgument(maxSamples <= MAX_SAMPLES_LIMIT, "Maximum number of reservoir samples is capped"); this.count = 0; this.samples = new double[maxSamples]; }</code><technical_language>"Number of samples" -> "Maximum number of samples" for clarity consistency - "is capped" -> "must exceed " + MAX_SAMPLES_LIMIT give user information necessary fix query guessing checkArgument(maxSamples > 0, "Maximum number of samples positive"); checkArgument(maxSamples <= MAX_SAMPLES_LIMIT, "Maximum number of samples exceed " + MAX_SAMPLES_LIMIT);</technical_language>

Target:
public UnweightedDoubleReservoirSample(int maxSamples) { checkArgument( maxSamples > 0, format("Maximum number of samples must be positive: %s", maxSamples)); checkArgument( maxSamples <= MAX_SAMPLES_LIMIT, format("Maximum number of samples must not exceed maximum: %s %s", maxSamples, MAX_SAMPLES_LIMIT)); this.samples = new double[maxSamples]; }
Source:
<code>public void getMrrtReportTemplateByTitle_shouldGetListOfTemplatesThatMatchGivenTitle() throws Exception { List<MrrtReportTemplate> templates = mrrtReportTemplateService.getMrrtReportTemplateByTitle(EXISTING_TEMPLATE_TITLE); assertNotNull(templates); <START> assertThat(templates.size(), is(1)); <END> }</code><technical_language>@ivange94 assert templates returned matching query param</technical_language>

Target:
public void getMrrtReportTemplateByTitle_shouldGetListOfTemplatesThatMatchGivenTitle() throws Exception { List<MrrtReportTemplate> templates = mrrtReportTemplateService.getMrrtReportTemplateByTitle(EXISTING_TEMPLATE_TITLE); assertNotNull(templates); assertThat(templates.size(), is(1)); for (MrrtReportTemplate template : templates) { assertThat(template.getDcTermsTitle() .contains(EXISTING_TEMPLATE_TITLE), is(true)); } }
Source:
<code>private static long computeFileChecksum(final File sourceFile) { try ( CheckedInputStream stream = new CheckedInputStream( new BufferedInputStream(Files.newInputStream(sourceFile.toPath())), new Adler32()); ) { IOUtils.skipFully(stream, sourceFile.length()); return stream.getChecksum().getValue(); } catch (final IOException ignored) { } <START> return System.currentTimeMillis(); <END> }</code><technical_language>this unrelated rest of PR, related original report</technical_language>

Target:
private static long computeFileChecksum(final File sourceFile) { try ( CheckedInputStream stream = new CheckedInputStream( new BufferedInputStream(Files.newInputStream(sourceFile.toPath())), new Adler32()); ) { IOUtils.skipFully(stream, sourceFile.length()); return stream.getChecksum().getValue(); } catch (final IOException ignored) { } return 0; }
Source:
<code><START> void activateOwnedEntityAsClient(EntityRef usedOwnedEntity) { <END> if (!usedOwnedEntity.exists()) { return; } activateTargetOrOwnedEntity(usedOwnedEntity); }</code><technical_language>This is in ManualLabor module, causing a compile error</technical_language>

Target:
public void activateOwnedEntityAsClient(EntityRef usedOwnedEntity) { if (!usedOwnedEntity.exists()) { return; } activateTargetOrOwnedEntity(usedOwnedEntity); }
Source:
<code>public QueryPlan implement(PhoenixRelImplementor implementor) { QueryPlan plan = implementor.visitInput(0, (PhoenixQueryRel) getInput()); int fetchValue = RexLiteral.intValue(fetch); int offsetValue = 0; if (offset != null){ offsetValue = RexLiteral.intValue(offset); } <START> if (plan.getLimit() == null) { <END> return plan.limit(fetchValue, offsetValue); } return new ClientScanPlan(plan.getContext(), plan.getStatement(), implementor.getTableMapping().getTableRef(), RowProjector.EMPTY_PROJECTOR, fetchValue, offsetValue, null, OrderBy.EMPTY_ORDER_BY, plan); }</code><technical_language>"if (plan.getLimit() == null && plan.getOffset() == null)"</technical_language>

Target:
public QueryPlan implement(PhoenixRelImplementor implementor) { QueryPlan plan = implementor.visitInput(0, (PhoenixQueryRel) getInput()); Integer fetch = this.fetch == null ? null : RexLiteral.intValue(this.fetch); Integer offset = this.offset == null ? null : RexLiteral.intValue(this.offset); if (plan.getLimit() == null && plan.getOffset() == null) { return plan.limit(fetch, offset); } return new ClientScanPlan(plan.getContext(), plan.getStatement(), implementor.getTableMapping().getTableRef(), RowProjector.EMPTY_PROJECTOR, fetch, offset, null, OrderBy.EMPTY_ORDER_BY, plan); }
Source:
<code><START> public Response getThreads(@PathParam("nodeId") String nodeId) <END> { Set<Node> nodes = nodeManager.getNodes(NodeState.ACTIVE); Node node = nodes.stream() .filter(n -> n.getNodeIdentifier().equals(nodeId)) .findFirst() .orElse(null); if (node == null) { return Response.status(Response.Status.NOT_FOUND).build(); } Request request = prepareGet() .setUri(uriBuilder() .scheme("http") .hostAndPort(fromParts(node.getHostAndPort().getHostText(), node.getHostAndPort().getPort())) .appendPath("v1") .appendPath("thread") .build()) .build(); InputStream responseStream = httpClient.execute(request, new StreamingJsonResponseHandler()); return Response.ok(responseStream, APPLICATION_JSON_TYPE).build(); }</code><technical_language>This method other one, for path. dedupe</technical_language>

Target:
public Response getThreads(@PathParam("nodeId") String nodeId) { return proxyJsonResponse(nodeId, "v1/thread"); }
Source:
<code>public static void registerClientDriver(String metadataBackendScheme, Class<? extends MetadataClientDriver> driver, boolean allowOverride) { if (!initialized) { initialize(); } String scheme = metadataBackendScheme.toLowerCase(); MetadataClientDriverInfo oldDriverInfo = clientDrivers.get(scheme); if (null != oldDriverInfo && !allowOverride) { return; } MetadataClientDriverInfo newDriverInfo = new MetadataClientDriverInfo(driver); <START> if (allowOverride) { <END> oldDriverInfo = clientDrivers.put(scheme, newDriverInfo); } else { oldDriverInfo = clientDrivers.putIfAbsent(scheme, newDriverInfo); } if (null != oldDriverInfo) { log.debug("Metadata client driver for is already there.", scheme); } }</code><technical_language>handle special case branching based a boolean flag in place. java if (null != oldDriverInfo) { if (allowOverride) { log.debug("Metadata client driver for is there.", scheme); } else { return; } } clientDrivers.put(scheme, newDriverInfo);</technical_language>

Target:
public static void registerClientDriver(String metadataBackendScheme, Class<? extends MetadataClientDriver> driver, boolean allowOverride) { if (!initialized) { initialize(); } String scheme = metadataBackendScheme.toLowerCase(); MetadataClientDriverInfo oldDriverInfo = clientDrivers.get(scheme); if (null != oldDriverInfo && !allowOverride) { return; } MetadataClientDriverInfo newDriverInfo = new MetadataClientDriverInfo(driver); oldDriverInfo = clientDrivers.putIfAbsent(scheme, newDriverInfo); if (null != oldDriverInfo) { log.debug("Metadata client driver for is already there.", scheme); if (allowOverride) { log.debug("Overriding client driver for {}", scheme); clientDrivers.put(scheme, newDriverInfo); } } }
Source:
<code>public Iterator<Entry<KeyType>> iterator(final boolean sorted) { <START> final List<Integer> wrappedOffsets = new AbstractList<Integer>() <END> { @Override public Integer get(int index) { return buffer.getInt(tableArenaSize + index * Ints.BYTES); } @Override public Integer set(int index, Integer element) { final Integer oldValue = get(index); buffer.putInt(tableArenaSize + index * Ints.BYTES, element); return oldValue; } @Override public int size() { return size; } }; if (sorted) { final KeyComparator comparator = keySerde.comparator(); Collections.sort( wrappedOffsets, new Comparator<Integer>() { @Override public int compare(Integer lhs, Integer rhs) { return comparator.compare( tableBuffer, tableBuffer, lhs + HASH_SIZE, rhs + HASH_SIZE ); } } ); return new Iterator<Entry<KeyType>>() { int curr = 0; @Override public boolean hasNext() { return curr < size; } @Override public Entry<KeyType> next() { return bucketEntryForOffset(wrappedOffsets.get(curr++)); } @Override public void remove() { throw new UnsupportedOperationException(); } }; } else { return new Iterator<Entry<KeyType>>() { int curr = 0; @Override public boolean hasNext() { return curr < size; } @Override public Entry<KeyType> next() { final int offset = buffer.getInt(tableArenaSize + curr * Ints.BYTES); final Entry<KeyType> entry = bucketEntryForOffset(offset); curr++; return entry; } @Override public void remove() { throw new UnsupportedOperationException(); } }; } }</code><technical_language>move this if(sorted) block</technical_language>

Target:
public Iterator<Entry<KeyType>> iterator(final boolean sorted) { if (sorted) { final List<Integer> wrappedOffsets = new AbstractList<Integer>() { @Override public Integer get(int index) { return buffer.getInt(tableArenaSize + index * Ints.BYTES); } @Override public Integer set(int index, Integer element) { final Integer oldValue = get(index); buffer.putInt(tableArenaSize + index * Ints.BYTES, element); return oldValue; } @Override public int size() { return size; } }; final KeyComparator comparator = keySerde.comparator(); Collections.sort( wrappedOffsets, new Comparator<Integer>() { @Override public int compare(Integer lhs, Integer rhs) { return comparator.compare( tableBuffer, tableBuffer, lhs + HASH_SIZE, rhs + HASH_SIZE ); } } ); return new Iterator<Entry<KeyType>>() { int curr = 0; @Override public boolean hasNext() { return curr < size; } @Override public Entry<KeyType> next() { return bucketEntryForOffset(wrappedOffsets.get(curr++)); } @Override public void remove() { throw new UnsupportedOperationException(); } }; } else { return new Iterator<Entry<KeyType>>() { int curr = 0; @Override public boolean hasNext() { return curr < size; } @Override public Entry<KeyType> next() { final int offset = buffer.getInt(tableArenaSize + curr * Ints.BYTES); final Entry<KeyType> entry = bucketEntryForOffset(offset); curr++; return entry; } @Override public void remove() { throw new UnsupportedOperationException(); } }; } }
Source:
<code>public Release populateRelease(CollectionReader reader, CollectionWriter collectionWriter, Iterable<ContentDetail> collectionContent) throws IOException, ZebedeeException { if (StringUtils.isEmpty(this.getDescription().getReleaseUri())) { throw new BadRequestException("This collection is not associated with a release."); } String uri = this.getDescription().getReleaseUri() + "/data.json"; try ( Resource resource = reader.getResource(uri); InputStream dataStream = resource.getData() ) { Release release = (Release) ContentUtil.deserialiseContent(dataStream); <START> info().data("collectionId", this).data("title", release.getDescription().getTitle()) <END> .log("Release identified for collection"); if (release == null) { throw new BadRequestException("This collection is not associated with a release."); } release = ReleasePopulator.populate(release, collectionContent); collectionWriter.getReviewed().writeObject(release, uri); return release; } }</code><technical_language>I .data("collectionId", this).... .data("collectionId", this.getDescription().getId()).... entire collection in json I want/need</technical_language>

Target:
public Release populateRelease(CollectionReader reader, CollectionWriter collectionWriter, Iterable<ContentDetail> collectionContent) throws IOException, ZebedeeException { if (StringUtils.isEmpty(this.getDescription().getReleaseUri())) { throw new BadRequestException("This collection is not associated with a release."); } String uri = this.getDescription().getReleaseUri() + "/data.json"; try ( Resource resource = reader.getResource(uri); InputStream dataStream = resource.getData() ) { Release release = (Release) ContentUtil.deserialiseContent(dataStream); info().data("collectionId", this.getDescription().getId()).data("title", release.getDescription().getTitle()) .log("Release identified for collection"); if (release == null) { throw new BadRequestException("This collection is not associated with a release."); } release = ReleasePopulator.populate(release, collectionContent); collectionWriter.getReviewed().writeObject(release, uri); return release; } }
Source:
<code>public static <T> Predicate<Location> displayNameEqualTo(final T val) { return new Predicate<Location>() { @Override <START> public boolean apply(@Nullable Location input) { <END> return Objects.equal(input.getDisplayName(), val); } }; }</code><technical_language>input is @Nullable, remove annotation add null check</technical_language>

Target:
public static <T> Predicate<Location> displayNameEqualTo(final T val) { return new Predicate<Location>() { @Override public boolean apply(@Nullable Location input) { return (input != null) && Objects.equal(input.getDisplayName(), val); } }; }
Source:
<code>private String createMultipleSpecsMessage(Fixture fixture, SpecificationType type1, SpecificationType type2) { <START> return SimpleFormatter.format("Found multiple matching specifications: '%s.%s' and '%1$s.%s'", <END> fixture.getFixturePathWithoutSuffix(), type1.getTypeSuffix(), type2.getTypeSuffix()); }</code><technical_language>I noticed this is %1$s reuse parameter. I SimpleFormatter handles that. OK if repeated parameter instead (preferably extracted a local variable)</technical_language>

Target:
private String createMultipleSpecsMessage(Fixture fixture, SpecificationType type1, SpecificationType type2) { String fixturePathWithoutSuffix = fixture.getFixturePathWithoutSuffix(); return SimpleFormatter.format("Found multiple matching specifications: '%s.%s' and '%s.%s'", fixturePathWithoutSuffix, type1.getTypeSuffix(), fixturePathWithoutSuffix, type2.getTypeSuffix()); }
Source:
<code>public static University findUniversity(HttpServletRequest request) throws ServiceException { <START> univid = Integer.parseInt(request.getParameter("uid")); <END> return SQLSource.interact(new SQLInteractionInterface<University>() { @Override public University run(Connection connection) throws ServiceException, SQLException { return University.lookup(connection, univid); } }); }</code><technical_language>_must_ null check request.getParameter() try/catch Integer.parseInt() page explode if receive uid a uid is integer</technical_language>

Target:
public static University findUniversity(HttpServletRequest request) throws ServiceException { String idStr = request.getParameter("uid"); if (idStr == null) { throw new ServiceException(ServiceStatus.MALFORMED_REQUEST); } final int univid = Integer.parseInt(idStr); return SQLSource.interact(new SQLInteractionInterface<University>() { @Override public University run(Connection connection) throws ServiceException, SQLException { return University.lookup(connection, univid); } }); }
Source:
<code>public Optional<VM> getVmUsingMac(Guid macPoolId, String mac) { Map<Guid, VM> vmsById = <START> getAllVmsInSystem(getIdsOfAllClustersHavingMacPool(macPoolId)).filter(vm -> !vm.isStateless()) <END> .collect(Collectors.toMap(VM::getId, Function.identity())); Optional<Guid> vmUsingMacId = getVmIdUsingMac(vmsById.keySet() .stream() .flatMap(vmId -> getVmInterfaces(vmId).stream()), mac); return vmUsingMacId.map(vmsById::get); }</code><technical_language>do filter out stateless vms? In stateless vms macs a union actual macs mac in snapshot</technical_language>

Target:
public Optional<VM> getVmUsingMac(Guid macPoolId, String mac) { Map<Guid, VM> vmsById = getAllVmsInSystem(getIdsOfAllClustersHavingMacPool(macPoolId)) .collect(Collectors.toMap(VM::getId, Function.identity())); Optional<Guid> vmUsingMacId = getVmIdUsingMac(vmsById.keySet() .stream() .flatMap(vmId -> getVmInterfaces(vmId).stream()), mac); return vmUsingMacId.map(vmsById::get); }
Source:
<code>public void filter(final ContainerRequestContext requestContext) throws IOException { if (permitAll.contains(resourceInfo.getResourceMethod())) { return; } if (denyAll.contains(resourceInfo.getResourceMethod())) { forbidden(requestContext); return; } final Set<String> roles = rolesAllowed.get(resourceInfo.getResourceMethod()); if (roles != null && !roles.isEmpty()) { final SecurityContext securityContext = requestContext.getSecurityContext(); <START> Boolean hasAtLeasOneValidRole = false; <END> for (String role : roles) { if (securityContext.isUserInRole(role)) { hasAtLeasOneValidRole = true; break; } } if (!hasAtLeasOneValidRole) { forbidden(requestContext); } } }</code><technical_language>primitive boolean? Avoid boxing in L48 unboxing in L52</technical_language>

Target:
public void filter(final ContainerRequestContext requestContext) throws IOException { if (permitAll.contains(resourceInfo.getResourceMethod())) { return; } if (denyAll.contains(resourceInfo.getResourceMethod())) { forbidden(requestContext); return; } final Set<String> roles = rolesAllowed.get(resourceInfo.getResourceMethod()); if (roles != null && !roles.isEmpty()) { final SecurityContext securityContext = requestContext.getSecurityContext(); boolean hasAtLeasOneValidRole = false; for (String role : roles) { if (securityContext.isUserInRole(role)) { hasAtLeasOneValidRole = true; break; } } if (!hasAtLeasOneValidRole) { forbidden(requestContext); } } }
Source:
<code>public List<QuotaUpdate> findLimited(int limit) throws StorageException { ArrayList<QuotaUpdate> resultList; PreparedStatement s = null; ResultSet result = null; try { Connection conn = mysqlConnector.obtainSession(); s = conn.prepareStatement(FIND_QUERY); s.setInt(1, limit); result = s.executeQuery(); resultList = new ArrayList<>(); while (result.next()) { int id = result.getInt(ID); int inodeId = result.getInt(INODE_ID); int namespaceDelta = result.getInt(NAMESPACE_DELTA); long diskspaceDelta = result.getLong(STORAGE_SPACE_DELTA); Map<QuotaUpdate.StorageType, Long> typeSpaceDelta = new HashMap<>(); typeSpaceDelta.put(QuotaUpdate.StorageType.DISK, result.getLong(TYPESPACE_DELTA_DISK)); typeSpaceDelta.put(QuotaUpdate.StorageType.SSD, result.getLong(TYPESPACE_DELTA_SSD)); typeSpaceDelta.put(QuotaUpdate.StorageType.RAID5, result.getLong(TYPESPACE_DELTA_RAID5)); typeSpaceDelta.put(QuotaUpdate.StorageType.ARCHIVE, result.getLong(TYPESPACE_DELTA_ARCHIVE)); typeSpaceDelta.put(QuotaUpdate.StorageType.DB, result.getLong(TYPESPACE_DELTA_DB)); resultList .add(new QuotaUpdate(id, inodeId, namespaceDelta, diskspaceDelta, typeSpaceDelta)); } } catch (SQLException ex) { throw HopsSQLExceptionHelper.wrap(ex); } finally { if (s != null) { try { s.close(); } catch (SQLException ex) { } } if (result != null) { try { result.close(); } catch (SQLException ex) { } } mysqlConnector.closeSession(); } <START> return resultList; <END> }</code><technical_language>exception issue</technical_language>

Target:
public List<QuotaUpdate> findLimited(int limit) throws StorageException { ArrayList<QuotaUpdate> resultList; PreparedStatement s = null; ResultSet result = null; try { Connection conn = mysqlConnector.obtainSession(); s = conn.prepareStatement(FIND_QUERY); s.setInt(1, limit); result = s.executeQuery(); resultList = new ArrayList<>(); while (result.next()) { int id = result.getInt(ID); int inodeId = result.getInt(INODE_ID); int namespaceDelta = result.getInt(NAMESPACE_DELTA); long diskspaceDelta = result.getLong(STORAGE_SPACE_DELTA); Map<QuotaUpdate.StorageType, Long> typeSpaceDelta = new HashMap<>(); typeSpaceDelta.put(QuotaUpdate.StorageType.DISK, result.getLong(TYPESPACE_DELTA_DISK)); typeSpaceDelta.put(QuotaUpdate.StorageType.SSD, result.getLong(TYPESPACE_DELTA_SSD)); typeSpaceDelta.put(QuotaUpdate.StorageType.RAID5, result.getLong(TYPESPACE_DELTA_RAID5)); typeSpaceDelta.put(QuotaUpdate.StorageType.ARCHIVE, result.getLong(TYPESPACE_DELTA_ARCHIVE)); typeSpaceDelta.put(QuotaUpdate.StorageType.DB, result.getLong(TYPESPACE_DELTA_DB)); resultList .add(new QuotaUpdate(id, inodeId, namespaceDelta, diskspaceDelta, typeSpaceDelta)); } } catch (SQLException ex) { throw HopsSQLExceptionHelper.wrap(ex); } finally { if (s != null) { try { s.close(); } catch (SQLException ex) { LOG.warn("Exception when closing the PrepareStatement", ex); } } if (result != null) { try { result.close(); } catch (SQLException ex) { LOG.warn("Exception when closing the REsultSet", ex); } } mysqlConnector.closeSession(); } return resultList; }
Source:
<code>public void nearbyStationsAddress() throws Exception { nearbyStationsAddress(-34618072, -58436443); <START> System.out.println("\n"); <END> }</code><technical_language>remove this line? printing sysout please</technical_language>

Target:
public void nearbyStationsAddress() throws Exception { nearbyStationsAddress(-34618072, -58436443); }
Source:
<code>protected void handleComments() { try { while (line != null) { String tLine = line.trim(); if (tLine.startsWith(" ")) { <START> if (tLine != null) { <END> tLine = tLine.trim(); } comments.add(++count + line); } } else if (!tLine.startsWith(" line = stripOffComment(tLine); return; } comments.add(++count + line); line = in.readLine(); } } catch (IOException ex) { System.err.println(ex); return; } }</code><technical_language>tLine is null if code reaches this line. Therefore, this if block is needed</technical_language>

Target:
protected void handleComments() { try { while (line != null) { String tLine = line.trim(); if (tLine.startsWith(" ")) { tLine = in.readLine(); if (tLine != null) { tLine = tLine.trim(); } comments.add(++count + line); } } else if (!tLine.startsWith(" line = stripOffComment(tLine); return; } comments.add(++count + line); line = in.readLine(); } } catch (IOException ex) { System.err.println(ex); return; } }
Source:
<code>public void testResetToLocalBranch() throws Exception { checkoutAndVerify(new String[] { LOCAL_BRANCHES, "master" }, new String[] { LOCAL_BRANCHES, "stable" }); String stable = getTestFileContent(); checkoutAndVerify(new String[] { LOCAL_BRANCHES, "stable" }, new String[] { LOCAL_BRANCHES, "master" }); String master = getTestFileContent(); assertFalse(stable.equals(master)); SWTBotShell resetDialog = openResetDialog(); resetDialog.bot().tree().getTreeItem(LOCAL_BRANCHES).getNode("stable") .select(); resetDialog.bot().radio( UIText.ResetTargetSelectionDialog_ResetTypeHardButton).click(); resetDialog.bot().button(UIText.ResetTargetSelectionDialog_ResetButton) .click(); <START> Job.getJobManager().join(JobFamilies.RESET, null); <END> bot.shell(UIText.ResetTargetSelectionDialog_ResetQuestion).bot() .button(IDialogConstants.YES_LABEL).click(); waitInUI(); String reset = getTestFileContent(); assertEquals("Wrong content after reset", stable, reset); }</code><technical_language>join happen question replace waitInUi</technical_language>

Target:
public void testResetToLocalBranch() throws Exception { checkoutAndVerify(new String[] { LOCAL_BRANCHES, "master" }, new String[] { LOCAL_BRANCHES, "stable" }); String stable = getTestFileContent(); checkoutAndVerify(new String[] { LOCAL_BRANCHES, "stable" }, new String[] { LOCAL_BRANCHES, "master" }); String master = getTestFileContent(); assertFalse(stable.equals(master)); SWTBotShell resetDialog = openResetDialog(); resetDialog.bot().tree().getTreeItem(LOCAL_BRANCHES).getNode("stable") .select(); resetDialog.bot().radio( UIText.ResetTargetSelectionDialog_ResetTypeHardButton).click(); resetDialog.bot().button(UIText.ResetTargetSelectionDialog_ResetButton) .click(); bot.shell(UIText.ResetTargetSelectionDialog_ResetQuestion).bot() .button(IDialogConstants.YES_LABEL).click(); Job.getJobManager().join(JobFamilies.RESET, null); String reset = getTestFileContent(); assertEquals("Wrong content after reset", stable, reset); }