auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>public boolean equals(final Object o) { if (this == o) { return true; } <START> if (o == null || this.getClass() != o.getClass()) { <END> return false; } final GraphMLEdgeStatus that = (GraphMLEdgeStatus) o; return Objects.equal(this.getSeverity(), that.getSeverity()) && Objects.equal(this.getStyleProperties(), that.getStyleProperties()); }</code><technical_language>Is a reason getClass() is instead of instanceof. instanceof is restrictive choice</technical_language>

Target:
public boolean equals(final Object o) { if (this == o) { return true; } if (!(o instanceof GraphMLEdgeStatus)) { return false; } final GraphMLEdgeStatus that = (GraphMLEdgeStatus) o; return Objects.equal(this.getSeverity(), that.getSeverity()) && Objects.equal(this.getStyleProperties(), that.getStyleProperties()); }
Source:
<code>private void initializeGitIndexWatcher() { requestTransmitter.newRequest() .endpointId("ws-agent") <START> .methodName("track:git-index") <END> .noParams() .sendAndSkipResult(); }</code><technical_language>ename method "track/git-index"</technical_language>

Target:
private void initializeGitIndexWatcher() { requestTransmitter.newRequest() .endpointId("ws-agent") .methodName("track/git-index") .noParams() .sendAndSkipResult(); }
Source:
<code>public boolean isBackgroundSprite() { <START> return this == ProjectManager.getInstance().getCurrentlyEditedScene().getSpriteList().get(0); <END> }</code><technical_language>this is potentially problems. e.g. in stage scene is running currently edited scene this change behaviour there. besides is situations ProjectManager currently edited scene set lead incorrect behaviour. I suggest another it</technical_language>

Target:
public boolean isBackgroundSprite() { return look.getZIndex() == Constants.Z_INDEX_BACKGROUND; }
Source:
<code>private void setDefaultBootDevice() { boolean hasBootDevice = <START> vmBase.getManagedDeviceMap().values().stream().anyMatch(device -> device.getBootOrder() > 0); <END> if (hasBootDevice) { return; } final int[] order = new int[]{1}; _images.stream() .filter(DiskImage::isBoot) .map(image -> vmBase.getManagedDeviceMap().get(image.getId())) .filter(Objects::nonNull) .forEachOrdered(device -> device.setBootOrder(order[0]++)); }</code><technical_language>breaking line 'stream()'</technical_language>

Target:
private void setDefaultBootDevice() { boolean hasBootDevice = vmBase.getManagedDeviceMap().values().stream() .anyMatch(device -> device.getBootOrder() > 0); if (hasBootDevice) { return; } AtomicInteger order = new AtomicInteger(1); _images.stream() .filter(DiskImage::isBoot) .map(image -> vmBase.getManagedDeviceMap().get(image.getId())) .filter(Objects::nonNull) .forEachOrdered(device -> device.setBootOrder(order.getAndIncrement())); }
Source:
<code>public ArticlePageObject savePage() { switchToIFrame(); waitForElementInViewPort(editSummary); <START> WebElement publishButton = driver.findElement(By.cssSelector(".oo-ui-window-foot .oo-ui-flaggableElement-constructive .oo-ui-labeledElement-label")); <END> waitForElementClickableByElement(publishButton); try { Thread.sleep(1000); } catch (InterruptedException e) { e.printStackTrace(); } publishButton.click(); PageObjectLogging.log("savePage", "The 2nd Publish Button is clicked", true); switchOutOfIFrame(); return new ArticlePageObject(driver); }</code><technical_language>please move 'By.cssSelector(".oo-ui-window-foot .oo-ui-flaggableElement-constructive .oo-ui-labeledElement-label")' top of class</technical_language>

Target:
public ArticlePageObject savePage() { switchToIFrame(); waitForElementInViewPort(editSummary); waitForElementClickableByElement(publishButton); publishButton.click(); PageObjectLogging.log("savePage", "The 2nd Publish Button is clicked", true); switchOutOfIFrame(); return new ArticlePageObject(driver); }
Source:
<code><START> public Class<?> loadClass(String name, boolean resolve) throws ClassNotFoundException { <END> ClassNotFoundException firstException = null; for (ClassLoader classLoader : delegates) { try { return classLoader.loadClass(name); } catch (ClassNotFoundException e) { firstException = e; } } throw firstException; }</code><technical_language>i methods overriddes, resolve flag propagated delegated loadClass, right</technical_language>

Target:
public Class<?> loadClass(String name, boolean resolve) throws ClassNotFoundException { ClassNotFoundException firstException = null; for (ClassLoader classLoader : delegates) { try { Class<?> result = classLoader.loadClass(name); if (resolve) { resolveClass(result); } return result; } catch (ClassNotFoundException e) { firstException = e; } } throw firstException; }
Source:
<code>public void onClickTypeButton(final ClickEvent clickEvent) { final String value = typeSelector.getValue(); <START> dataTypeModal.show(); <END> }</code><technical_language>remove L#162 well; is longer used</technical_language>

Target:
public void onClickTypeButton(final ClickEvent clickEvent) { dataTypeModal.show(); }
Source:
<code>public BranchId getBranch(IAtsConfigObject configObject) { BranchId branch = BranchId.SENTINEL; if (configObject instanceof IAtsVersion) { IAtsVersion version = (IAtsVersion) configObject; if (version.getBaselineBranchId().isValid()) { branch = version.getBaselineBranchId(); } } if (branch.isInvalid() && configObject instanceof IAtsTeamDefinition) { IAtsTeamDefinition teamDef = (IAtsTeamDefinition) configObject; if (teamDef.getBaselineBranchId().isValid()) { branch = teamDef.getBaselineBranchId(); } } if (branch.isInvalid()) { BranchId branchId = BranchId.valueOf(services.getAttributeResolver().getSoleAttributeValue(configObject, <START> AtsAttributeTypes.BaselineBranchUuid, 0L)); <END> if (branchId.isValid()) { branch = branchId; } } return branch; }</code><technical_language>Please BranchId.SENTINEL.getId() default remove is valid check</technical_language>

Target:
public BranchId getBranch(IAtsConfigObject configObject) { BranchId branch = BranchId.SENTINEL; if (configObject instanceof IAtsVersion) { IAtsVersion version = (IAtsVersion) configObject; if (version.getBaselineBranchId().isValid()) { branch = version.getBaselineBranchId(); } } if (branch.isInvalid() && configObject instanceof IAtsTeamDefinition) { IAtsTeamDefinition teamDef = (IAtsTeamDefinition) configObject; if (teamDef.getBaselineBranchId().isValid()) { branch = teamDef.getBaselineBranchId(); } } if (branch.isInvalid()) { branch = BranchId.valueOf(services.getAttributeResolver().getSoleAttributeValue(configObject, AtsAttributeTypes.BaselineBranchUuid, BranchId.SENTINEL.getId())); } return branch; }
Source:
<code>public Description matchMethodInvocation(MethodInvocationTree tree, VisitorState state) { if (unsafeParamNames.isEmpty() || !SAFE_ARG_OF.matches(tree, state)) { return Description.NO_MATCH; } List<? extends ExpressionTree> args = tree.getArguments(); ExpressionTree argNameExpression = args.get(0); if (compileTimeConstExpressionMatcher.matches(argNameExpression, state)) { <START> if (argNameExpression instanceof JCTree.JCLiteral) { <END> String argName = (String) ((JCTree.JCLiteral) argNameExpression).getValue(); if (unsafeParamNames.stream().anyMatch(unsafeArgName -> unsafeArgName.equalsIgnoreCase(argName))) { SuggestedFix.Builder builder = SuggestedFix.builder(); String unsafeArg = SuggestedFixes.qualifyType(state, builder, "com.palantir.logsafe.UnsafeArg"); return buildDescription(tree) .setMessage("Arguments with name '" + argName + "' must be marked as unsafe.") .addFix(builder.replace(tree.getMethodSelect(), unsafeArg + ".of") .build()) .build(); } } } return Description.NO_MATCH; }</code><technical_language>nit: combine conditional expressions</technical_language>

Target:
public Description matchMethodInvocation(MethodInvocationTree tree, VisitorState state) { if (unsafeParamNames.isEmpty() || !SAFE_ARG_OF.matches(tree, state)) { return Description.NO_MATCH; } List<? extends ExpressionTree> args = tree.getArguments(); ExpressionTree argNameExpression = args.get(0); if (argNameExpression instanceof JCTree.JCLiteral) { String argName = (String) ((JCTree.JCLiteral) argNameExpression).getValue(); if (unsafeParamNames.stream().anyMatch(unsafeArgName -> unsafeArgName.equalsIgnoreCase(argName))) { SuggestedFix.Builder builder = SuggestedFix.builder(); String unsafeArg = SuggestedFixes.qualifyType(state, builder, "com.palantir.logsafe.UnsafeArg"); return buildDescription(tree) .setMessage("Arguments with name '" + argName + "' must be marked as unsafe.") .addFix(builder.replace(tree.getMethodSelect(), unsafeArg + ".of") .build()) .build(); } } return Description.NO_MATCH; }
Source:
<code>public static void viewCurrentBlogPeople(Context context) { Intent intent = new Intent(context, PeopleManagementActivity.class); slideInFromRight(context, intent); <START> AnalyticsUtils.trackWithCurrentBlogDetails(AnalyticsTracker.Stat.OPENED_PEOPLE); <END> }</code><technical_language>name for this enum OPENED_PEOPLE_MANAGEMENT. feels more clear for</technical_language>

Target:
public static void viewCurrentBlogPeople(Context context) { Intent intent = new Intent(context, PeopleManagementActivity.class); slideInFromRight(context, intent); AnalyticsUtils.trackWithCurrentBlogDetails(AnalyticsTracker.Stat.OPENED_PEOPLE_MANAGEMENT); }
Source:
<code>public QuotaVdsConsumptionParameter clone() { return new QuotaVdsConsumptionParameter( this.quotaGuid, this.quota, this.action, this.vdsGroupId, this.requestedCpu, <START> this.requestedMemory); <END> }</code><technical_language>need for 'this', getters for super private members</technical_language>

Target:
public QuotaVdsConsumptionParameter clone() { return new QuotaVdsConsumptionParameter( this.getQuotaGuid(), this.getQuota(), this.getAction(), this.vdsGroupId, this.requestedCpu, this.requestedMemory); }
Source:
<code>public static String getUriPath(Map<String, Object> tags) { for (String key : tags.keySet()) { if (isUriKey(key)) { <START> return getUriPath(tags.get(key).toString()); <END> } } return null; }</code><technical_language>Please Map.Entry</technical_language>

Target:
public static String getUriPath(Map<String, Object> tags) { for (Map.Entry<String,Object> entry : tags.entrySet()) { if (isUriKey(entry.getKey())) { return getUriPath(entry.getValue().toString()); } } return null; }
Source:
<code>public void writeRequested(ChannelHandlerContext ctx, MessageEvent e) throws Exception { ControlMessage message = (ControlMessage) e.getMessage(); switch (message.getKind()) { case PREPARED: writePreparedRequested(ctx, e); break; case STARTED: writeStartedRequested(ctx, e); break; case FINISHED: writeFinishedRequested(ctx, e); break; case ERROR: writeErrorRequested(ctx, e); break; case NOTIFY: <START> writeNotifyRequested(ctx, e); <END> default: throw new IllegalArgumentException(String.format("Unexpected control message: %s", message.getKind())); } }</code><technical_language>missing break ?</technical_language>

Target:
public void writeRequested(ChannelHandlerContext ctx, MessageEvent e) throws Exception { ControlMessage message = (ControlMessage) e.getMessage(); switch (message.getKind()) { case PREPARED: writePreparedRequested(ctx, e); break; case STARTED: writeStartedRequested(ctx, e); break; case FINISHED: writeFinishedRequested(ctx, e); break; case ERROR: writeErrorRequested(ctx, e); break; case NOTIFY: writeNotifyRequested(ctx, e); break; default: throw new IllegalArgumentException(String.format("Unexpected control message: %s", message.getKind())); } }
Source:
<code><START> public boolean hasUsableImageCount(int minImageCount, int minImageWidth) { <END> if (!mContentContainsImages) { return false; } int numFound = 0; Matcher imgMatcher = IMG_TAG_PATTERN.matcher(mContent); while (imgMatcher.find()) { String imgTag = mContent.substring(imgMatcher.start(), imgMatcher.end()); String imageUrl = ReaderHtmlUtils.getSrcAttrValue(imgTag); int width = Math.max(ReaderHtmlUtils.getWidthAttrValue(imgTag), ReaderHtmlUtils.getIntQueryParam(imageUrl, "w")); if (width >= minImageWidth) { numFound++; if (numFound >= minImageCount) { return true; } } } return false; }</code><technical_language>I wondering if common code in this method getImageList extracted somehow. I find a straight refactor myself, thought bring anyway. if could</technical_language>

Target:
public boolean hasUsableImageCount(int minImageCount, int minImageWidth) { return getImageList(minImageCount, minImageWidth).size() == minImageCount; }
Source:
<code>public String describe() { <START> return "User " + consumedAU.getUserIdentifier() + " ( type: " + consumedAU.getAuthenticatedUserLookup().getAuthenticationProviderId() + " ) merged into " +ongoingAU.getUserIdentifier(); <END> }</code><technical_language>getAuthenticationProviderId is good provides "shib" more specific. add in logic parse persistentuserid get "Harvard IDP" put in persistentuserid (is useful?) is onfo lost? @matthew-a-dunlap thoughts</technical_language>

Target:
public String describe() { return "User " + consumedAU.getUserIdentifier() + " (type: " + consumedAU.getAuthenticatedUserLookup().getAuthenticationProviderId() + " | persistentUserId: " + consumedAU.getAuthenticatedUserLookup().getPersistentUserId() + "; Name: "+ consumedAU.getFirstName() + " " + consumedAU.getLastName() +"; Institution: " + consumedAU.getAffiliation() + "; Email: " + consumedAU.getEmail() + ") merged into " +ongoingAU.getUserIdentifier(); }
Source:
<code>default <U extends Comparable<? super U>> Option<T> maxBy(Function<? super T, ? extends U> f) { Objects.requireNonNull(f, "f is null"); if (isEmpty()) { return None.instance(); } else { T tm = null; U um = null; for (T t : Iterator.ofAll(this)) { U u = f.apply(t); if (um == null || u.compareTo(um) >= 0) { um = u; tm = t; } } <START> return new Some<>(tm); <END> } }</code><technical_language>save null-check. conform previous impl maxBy(Comparator), need > instead of >= (see internals of reduce foldLeft... zero is previous - current value) java final Iterator<T> iter = iterator(); T tm = iter.next(); U um = f.apply(tm); while (iter.hasNext()) { final T t = iter.next(); final U u = f.apply(t); if (u.compareTo(um) > 0) { um = u; tm = t; } } return new Some<>(tm);</technical_language>

Target:
default <U extends Comparable<? super U>> Option<T> maxBy(Function<? super T, ? extends U> f) { Objects.requireNonNull(f, "f is null"); if (isEmpty()) { return None.instance(); } else { final Iterator<T> iter = iterator(); T tm = iter.next(); U um = f.apply(tm); while (iter.hasNext()) { final T t = iter.next(); final U u = f.apply(t); if (u.compareTo(um) > 0) { um = u; tm = t; } } return new Some<>(tm); } }
Source:
<code>public void setKeyStore(String keyStore, String ksType) { if (Arrays.stream(VALID_KEY_STORE_TYPES.split("\\s*,\\s*")).noneMatch(ksType.toUpperCase()::equals)) { <START> throw new SlimFixtureException(false, "Invalid keystore type: " + ksType.toUpperCase() + ". Valid options: " + Arrays.toString(VALID_KEY_STORE_TYPES.split("\\s*,\\s*"))); <END> } signatureKeyProperties.put("org.apache.ws.security.crypto.provider", "org.apache.ws.security.components.crypto.Merlin"); signatureKeyProperties.put("org.apache.ws.security.crypto.merlin.keystore.file", Environment.getInstance().getFilePathFromWikiUrl(keyStore)); signatureKeyProperties.put("org.apache.ws.security.crypto.merlin.keystore.type", ksType.toUpperCase()); }</code><technical_language>suggestion throw new SlimFixtureException(false, "Invalid keystore type: " + ksType.toUpperCase() + ". Valid options: " + VALID_KEY_STORE_TYPES);</technical_language>

Target:
public void setKeyStore(String keyStore, String ksType) { if (Arrays.stream(VALID_KEY_STORE_TYPES.split("\\s*,\\s*")).noneMatch(ksType.toUpperCase()::equals)) { throw new SlimFixtureException(false, "Invalid keystore type: " + ksType.toUpperCase() + ". Valid options: " + VALID_KEY_STORE_TYPES); } signatureKeyProperties.put("org.apache.ws.security.crypto.provider", "org.apache.ws.security.components.crypto.Merlin"); signatureKeyProperties.put("org.apache.ws.security.crypto.merlin.keystore.file", Environment.getInstance().getFilePathFromWikiUrl(keyStore)); signatureKeyProperties.put("org.apache.ws.security.crypto.merlin.keystore.type", ksType.toUpperCase()); }
Source:
<code>public boolean containsAllConstantNodes() { int size = size(); for (int index = 0; index < size; index++) { ValueNode literalVal = (ValueNode) elementAt(index); if (! (literalVal instanceof ConstantNode)) { return false; } else if (literalVal instanceof ListValueNode) { <START> if (! ((ListValueNode)literalVal).containsAllConstantNodes()) <END> return false; } } return true; }</code><technical_language>this block of code reached if literalVal is of type ConstantNode, returned in previous if statement. order of IF checks (for ConstantNode for ListValueNode) switched</technical_language>

Target:
public boolean containsAllConstantNodes() { int size = size(); for (int index = 0; index < size; index++) { ValueNode literalVal = (ValueNode) elementAt(index); if (! (literalVal instanceof ConstantNode)) { if (literalVal instanceof ListValueNode) { if (!((ListValueNode) literalVal).containsAllConstantNodes()) return false; } else return false; } } return true; }
Source:
<code>public String getInventoryDisplayName() { if (itemHandler instanceof InvWrapper) { <START> ITextComponent textName = ((InvWrapper) itemHandler).getInv().getDisplayName(); <END> if (textName != null) { return textName.getFormattedText(); } } if(tile instanceof IWorldNameable) { IWorldNameable nameable = (IWorldNameable) tile; ITextComponent textName = ((IWorldNameable) tile).getDisplayName(); return textName != null ? textName.getFormattedText() : nameable.getName(); } return null; }</code><technical_language>Exctract variable for proper control flow</technical_language>

Target:
public String getInventoryDisplayName() { IWorldNameable nameable = null; if (itemHandler instanceof InvWrapper) { nameable = ((InvWrapper) itemHandler).getInv(); if (nameable.getDisplayName() == null) { nameable = null; } } if(nameable == null && tile instanceof IWorldNameable) { nameable = (IWorldNameable) tile; } if (nameable != null) { ITextComponent textName = nameable.getDisplayName(); return textName != null ? textName.getFormattedText() : nameable.getName(); } return null; }
Source:
<code>public void setUp() throws Exception{ mongoClient = MockMongoFactory.with(Version.Main.PRODUCTION).newMongoClient(); final int port = mongoClient.getServerAddressList().get(0).getPort(); conf = new MongoDBRdfConfiguration(); conf.set(MongoDBRdfConfiguration.MONGO_DB_NAME, "test"); conf.set(MongoDBRdfConfiguration.MONGO_COLLECTION_PREFIX, "rya"); conf.set(RdfCloudTripleStoreConfiguration.CONF_TBL_PREFIX, "rya"); conf.set(MongoDBRdfConfiguration.MONGO_INSTANCE_PORT, Integer.toString(port)); conf.setBoolean(ConfigUtils.USE_MONGO, true); conf.setBoolean(OptionalConfigUtils.USE_GEOTEMPORAL, true); conf.setMongoClient(mongoClient); conf.setTablePrefix("isthisused_"); final Sail sail = GeoRyaSailFactory.getInstance(conf); conn = new SailRepository(sail).getConnection(); conn.begin(); <START> indexer = new MongoGeoTemporalIndexer(); <END> indexer.setConf(conf); indexer.setClient(mongoClient); indexer.init(); }</code><technical_language>Is indexer integrated MongoRyaDAO</technical_language>

Target:
public void setUp() throws Exception{ mongoClient = MockMongoFactory.newFactory().newMongoClient(); conf = new MongoDBRdfConfiguration(); conf.set(MongoDBRdfConfiguration.MONGO_DB_NAME, "test"); conf.set(MongoDBRdfConfiguration.MONGO_COLLECTION_PREFIX, "rya"); conf.set(RdfCloudTripleStoreConfiguration.CONF_TBL_PREFIX, "rya"); conf.setBoolean(ConfigUtils.USE_MONGO, true); conf.setBoolean(OptionalConfigUtils.USE_GEOTEMPORAL, true); conf.setMongoClient(mongoClient); final Sail sail = GeoRyaSailFactory.getInstance(conf); conn = new SailRepository(sail).getConnection(); conn.begin(); addStatements(); }
Source:
<code>public static String readNullableIntString(DataInputStream input) throws IOException { String tmp = readIntString(input, StandardCharsets.UTF_8); <START> if (tmp.length() == 0) { return null; } else { return tmp; } <END> }</code><technical_language>return tmp.isEmpty() ? null : tmp;</technical_language>

Target:
public static String readNullableIntString(DataInputStream input) throws IOException { String tmp = readIntString(input, StandardCharsets.UTF_8); return tmp.isEmpty() ? null : tmp; }
Source:
<code>public void move(ReplicatorQueue replicatorQueue, ResourceResolver rr) throws IllegalAccessException, MovingException { Session session = rr.adaptTo(Session.class); try { session.getWorkspace().getObservationManager().setUserData("changedByWorkflowProcess"); session.move(getSourcePath(), getDestinationPath()); session.save(); <START> if (session.nodeExists(getDestinationPath())) { <END> Node originalAssetJcrContentNode = session .getNode(getDestinationPath() + "/" + JcrConstants.JCR_CONTENT); JcrUtil.setProperty(originalAssetJcrContentNode, JcrConstants.JCR_LASTMODIFIED, new Date()); JcrUtil.setProperty(originalAssetJcrContentNode, JcrConstants.JCR_LAST_MODIFIED_BY, DEFAULT_LAST_MODIFIED_BY); } updateReferences(replicatorQueue, rr); } catch (RepositoryException e) { throw new MovingException(getSourcePath(), e); } }</code><technical_language>suggestion if (session.nodeExists(getDestinationPath() + "/" + JcrConstants.JCR_CONTENT)) { WDYT ultra-safe? If check check for node writing to</technical_language>

Target:
public void move(ReplicatorQueue replicatorQueue, ResourceResolver rr) throws IllegalAccessException, MovingException { Session session = rr.adaptTo(Session.class); try { session.getWorkspace().getObservationManager().setUserData("changedByWorkflowProcess"); session.move(getSourcePath(), getDestinationPath()); session.save(); if (Util.resourceExists(rr, getDestinationPath())) { Node originalAssetJcrContentNode = session .getNode(getDestinationPath() + "/" + JcrConstants.JCR_CONTENT); if (originalAssetJcrContentNode!=null) { JcrUtil.setProperty(originalAssetJcrContentNode, JcrConstants.JCR_LASTMODIFIED, new Date()); JcrUtil.setProperty(originalAssetJcrContentNode, JcrConstants.JCR_LAST_MODIFIED_BY, DEFAULT_LAST_MODIFIED_BY); } } updateReferences(replicatorQueue, rr); } catch (RepositoryException e) { throw new MovingException(getSourcePath(), e); } }
Source:
<code>public void ChatPreview_004_basicUserChatFails() { switchToWindow(driverOne); ChatPageObject chatUserOne = openChatForUser( driverOne, userOne, userOnePassword ); <START> WebElement permissionError = driverOne.findElement(By.cssSelector(".WikiaPageHeader")); <END> PageObjectLogging.log( "basicUserPermissions", "User doesn't have permission to chat", permissionError.getText().toString().matches("Permissions error.*\n?.*") ); }</code><technical_language>is permission error displayed at? Is a page object this .WikiaPageHeader belongs to</technical_language>

Target:
public void ChatPreview_004_basicUserChatFails() { switchToWindow(driverOne); ChatPageObject chatUserOne = openChatForUser( driverOne, credentials.userName, credentials.password ); SpecialPageObject special = new SpecialPageObject(driver); special.verifyPageHeader("Permissions error"); }
Source:
<code>public void testGetProducerInfoJustClient() { SpanCache spanCache = new TestSpanCache(); Span serverSpan = new Span(); serverSpan.setId("1"); serverSpan.setParentId("1"); serverSpan.setAnnotations(serverAnnotations()); Span clientSpan = new Span(); clientSpan.setId("1"); clientSpan.setParentId("1"); BinaryAnnotation ba = new BinaryAnnotation(); ba.setKey("http.url"); ba.setValue("http://myhost:8080/myuri"); clientSpan.setBinaryAnnotations(Arrays.asList(ba)); clientSpan.setAnnotations(clientAnnotations()); try { spanCache.store(null, Arrays.asList(serverSpan, clientSpan), SpanUniqueIdGenerator::toUnique); <START> } catch (CacheException e) { <END> fail("Failed to store span"); } ProducerInfo pi = ProducerInfoUtil.getProducerInfo(null, serverSpan, spanCache); assertNotNull(pi); assertEquals(Constants.URI_CLIENT_PREFIX + "/myuri", pi.getSourceUri()); }</code><technical_language>I catch this test Error a failure</technical_language>

Target:
public void testGetProducerInfoJustClient() throws CacheException { SpanCache spanCache = new TestSpanCache(); Span serverSpan = new Span(); serverSpan.setId("1"); serverSpan.setParentId("1"); serverSpan.setAnnotations(serverAnnotations()); Span clientSpan = new Span(); clientSpan.setId("1"); clientSpan.setParentId("1"); BinaryAnnotation ba = new BinaryAnnotation(); ba.setKey("http.url"); ba.setValue("http://myhost:8080/myuri"); clientSpan.setBinaryAnnotations(Arrays.asList(ba)); clientSpan.setAnnotations(clientAnnotations()); spanCache.store(null, Arrays.asList(serverSpan, clientSpan), SpanUniqueIdGenerator::toUnique); ProducerInfo pi = ProducerInfoUtil.getProducerInfo(null, serverSpan, spanCache); assertNotNull(pi); assertEquals(Constants.URI_CLIENT_PREFIX + "/myuri", pi.getSourceUri()); }
Source:
<code>public static boolean nameExists(String name) { return NAME_TO_FLUIDS.containsKey(name.toLowerCase()); <START> } <END></code><technical_language>missed</technical_language>

Target:
public static boolean nameExists(String name) { return NAME_TO_FLUIDS.containsKey(name.toLowerCase(Locale.ENGLISH)); }
Source:
<code>public boolean isVmTemlateWithSameNameExist(String name, Guid datacenterId) { <START> return DbFacade.getInstance().getVmTemplateDao().getByName(name, datacenterId, null, false) != null; <END> }</code><technical_language>please inject DAO</technical_language>

Target:
public boolean isVmTemlateWithSameNameExist(String name, Guid datacenterId) { return vmTemplateDao.getByName(name, datacenterId, null, false) != null; }
Source:
<code>public DataSegment push(File inDir, DataSegment segment) throws IOException { final String storageDir = DataSegmentPusherUtil.getHdfsStorageDir(segment); log.info( "Copying segment[%s] to HDFS at location[%s/%s]", segment.getIdentifier(), config.getStorageDirectory(), storageDir ); Path outFile = new Path(String.format( "%s/%s/index.zip", config.getStorageDirectory(), RandomStringUtils.randomAlphanumeric(4))); FileSystem fs = outFile.getFileSystem(hadoopConfig); fs.mkdirs(outFile.getParent()); log.info("Compressing files from[%s] to [%s]", inDir, outFile); final long size; try (FSDataOutputStream out = fs.create(outFile)) { size = CompressionUtils.zip(inDir, out); } DataSegment dataSegment = createDescriptorFile( segment.withLoadSpec(makeLoadSpec(outFile)) .withSize(size) .withBinaryVersion(SegmentUtils.getVersionFromDir(inDir)), outFile.getParent(), fs ); Path outDir = new Path(String.format("%s/%s", config.getStorageDirectory(), storageDir)); <START> fs.rename(outFile.getParent(), outDir); <END> return dataSegment; }</code><technical_language>In case another task publishes segment first, rename return false leaking temporary directory</technical_language>

Target:
public DataSegment push(File inDir, DataSegment segment) throws IOException { final String storageDir = DataSegmentPusherUtil.getHdfsStorageDir(segment); log.info( "Copying segment[%s] to HDFS at location[%s/%s]", segment.getIdentifier(), config.getStorageDirectory(), storageDir ); Path tmpFile = new Path(String.format( "%s/%s/index.zip", config.getStorageDirectory(), UUIDUtils.generateUuid() )); FileSystem fs = tmpFile.getFileSystem(hadoopConfig); fs.mkdirs(tmpFile.getParent()); log.info("Compressing files from[%s] to [%s]", inDir, tmpFile); final long size; final DataSegment dataSegment; try (FSDataOutputStream out = fs.create(tmpFile)) { size = CompressionUtils.zip(inDir, out); dataSegment = createDescriptorFile( segment.withLoadSpec(makeLoadSpec(tmpFile)) .withSize(size) .withBinaryVersion(SegmentUtils.getVersionFromDir(inDir)), tmpFile.getParent(), fs ); Path outDir = new Path(String.format("%s/%s", config.getStorageDirectory(), storageDir)); if (!fs.rename(tmpFile.getParent(), outDir)) { if (!fs.delete(tmpFile.getParent(), true)) { log.error("Failed to delete temp directory[%s]", tmpFile); } if (fs.exists(outDir)) { log.info( "Unable to rename temp directory[%s] to segment directory[%s]. It is already pushed by a replica task.", tmpFile, outDir ); } else { throw new IOException(String.format( "Failed to rename temp directory[%s] and segment directory[%s] is not present.", tmpFile, outDir )); } } } return dataSegment; }
Source:
<code>public ExactNumberOfProblemsExists(ProblemType type, int count) { if(type == null) { throw new NullPointerException("Problem Type cannot be null"); } if(count < 0) { throw new IllegalArgumentException("Number of problems must be greater than zero."); } this.problemType = type; this.expectedProblemsCount = count; <START> matchers = new AbstractProblemMatcher[]{}; <END> problemsView = new ProblemsView(); }</code><technical_language>Call constructors in other please: ExactNumberOfProblemsExists(ProblemType type, int count) call this (type, count, new AbstractProblemMatcher[]{}) logic there. this. for matchers field</technical_language>

Target:
public ExactNumberOfProblemsExists(ProblemType type, int count) { this(type, count, new AbstractProblemMatcher[]{}); }
Source:
<code>public WorkunitWrapper getWUInfo(WUInfoRequestWrapper wuinfodetailsparams) throws Exception, ArrayOfEspExceptionWrapper { WorkunitWrapper workunit = null; verifyStub(); WUInfoResponseWrapper wuInfoResponse = stubWrapper.WUInfo(wuinfodetailsparams); ArrayOfEspException exceptions = wuInfoResponse.getRawArrayOfEspExceptions1_75(); if (exceptions == null && wuInfoResponse.getWorkunit() != null) { if (wuinfodetailsparams.isUnarchive() && wuInfoResponse.getWorkunit().getArchived()) { doWorkunitAction(wuinfodetailsparams.getWuid(), ECLWUActions.Restore); <START> wuinfodetailsparams.setUnarchive(false); <END> return getWUInfo(wuinfodetailsparams); } workunit = wuInfoResponse.getWorkunit(); workunit.setOriginalEclWatchUrl(getEclWatchUrl()); workunit.setResultViews(wuInfoResponse.getResultViews()); } else { handleEspExceptions(new ArrayOfEspExceptionWrapper(exceptions), "Could not fetch WU Info"); } return workunit; }</code><technical_language>change request, subsequent recursive call bypass this block wuInfoResponse.getWorkunit().getArchived() return false</technical_language>

Target:
public WorkunitWrapper getWUInfo(WUInfoRequestWrapper wuinfodetailsparams) throws Exception, ArrayOfEspExceptionWrapper { WorkunitWrapper workunit = null; verifyStub(); WUInfoResponseWrapper wuInfoResponse = stubWrapper.WUInfo(wuinfodetailsparams); ArrayOfEspException exceptions = wuInfoResponse.getRawArrayOfEspExceptions1_75(); if (exceptions == null && wuInfoResponse.getWorkunit() != null) { workunit = wuInfoResponse.getWorkunit(); workunit.setOriginalEclWatchUrl(getEclWatchUrl()); workunit.setResultViews(wuInfoResponse.getResultViews()); if (wuinfodetailsparams.attemptUnarchive() && workunit.getArchived()) { doWorkunitAction(wuinfodetailsparams.getWuid(), ECLWUActions.Restore); wuInfoResponse = stubWrapper.WUInfo(wuinfodetailsparams); if (exceptions == null && wuInfoResponse.getWorkunit() != null) { workunit = wuInfoResponse.getWorkunit(); workunit.setOriginalEclWatchUrl(getEclWatchUrl()); workunit.setResultViews(wuInfoResponse.getResultViews()); } } } else { handleEspExceptions(new ArrayOfEspExceptionWrapper(exceptions), "Could not fetch WU Info"); } return workunit; }
Source:
<code>private void withMyClassLoader(Runnable runnable) { ClassLoader classLoader = getClass().getClassLoader(); ClassLoader oldloader = Thread.currentThread().getContextClassLoader(); try { <START> Thread.currentThread().setContextClassLoader(classLoader); <END> runnable.run(); } finally { Thread.currentThread().setContextClassLoader(oldloader); } }</code><technical_language>This try-block right</technical_language>

Target:
private void withMyClassLoader(Runnable runnable) { ClassLoader classLoader = getClass().getClassLoader(); ClassLoader oldloader = Thread.currentThread().getContextClassLoader(); Thread.currentThread().setContextClassLoader(classLoader); try { runnable.run(); } finally { Thread.currentThread().setContextClassLoader(oldloader); } }
Source:
<code>protected String createClassPath(Class taskletClass) { <START> URLClassLoader jobClassLoader; <END> URLClassLoader contextClassLoader; try { contextClassLoader = (URLClassLoader) Thread.currentThread().getContextClassLoader(); jobClassLoader = (URLClassLoader) Class.forName("org.springframework.xd.dirt.core.Job").getClassLoader(); } catch (Exception e) { throw new IllegalStateException("Unable to determine classpath from ClassLoader.", e); } if (jobClassLoader == null) { throw new IllegalStateException("Unable to access ClassLoader for " + taskletClass + "."); } if (contextClassLoader == null) { throw new IllegalStateException("Unable to access Context ClassLoader."); } List<String> classPath = new ArrayList<String>(); for (URL url : jobClassLoader.getURLs()) { String file = url.getFile().split("\\!/", 2)[0]; if (file.endsWith(".jar")) { classPath.add(file); } } for (URL url : contextClassLoader.getURLs()) { String file = url.getFile().split("\\!/", 2)[0]; if (file.endsWith(".jar") && !classPath.contains(file)) { classPath.add(file); } } StringBuilder classPathBuilder = new StringBuilder(); String separator = System.getProperty("path.separator"); for (String url : classPath) { if (classPathBuilder.length() > 0) { classPathBuilder.append(separator); } classPathBuilder.append(url); } return classPathBuilder.toString(); }</code><technical_language>picky (coffee deficiency)... this affect SqoopTasklet Spark Tasklet</technical_language>

Target:
protected String createClassPath(Class taskletClass) { URLClassLoader serverClassLoader; URLClassLoader taskletClassLoader; try { serverClassLoader = (URLClassLoader) Class.forName("org.springframework.xd.dirt.core.Job").getClassLoader(); taskletClassLoader = (URLClassLoader) taskletClass.getClassLoader(); } catch (Exception e) { throw new IllegalStateException("Unable to determine classpath from ClassLoader.", e); } if (serverClassLoader == null) { throw new IllegalStateException("Unable to access ClassLoader for " + taskletClass + "."); } if (taskletClassLoader == null) { throw new IllegalStateException("Unable to access Context ClassLoader."); } List<String> classPath = new ArrayList<String>(); for (URL url : serverClassLoader.getURLs()) { String file = url.getFile().split("\\!/", 2)[0]; if (file.endsWith(".jar")) { classPath.add(file); } } for (URL url : taskletClassLoader.getURLs()) { String file = url.getFile().split("\\!/", 2)[0]; if (file.endsWith(".jar") && !classPath.contains(file)) { classPath.add(file); } } StringBuilder classPathBuilder = new StringBuilder(); String separator = System.getProperty("path.separator"); for (String url : classPath) { if (classPathBuilder.length() > 0) { classPathBuilder.append(separator); } classPathBuilder.append(url); } return classPathBuilder.toString(); }
Source:
<code>public void attributes_person() { <START> final Query query = Query.parse("-i person name"); <END> assertThat(query.getAttributeTypes(), contains(AttributeType.ABUSE_C, AttributeType.ADMIN_C, AttributeType.TECH_C, AttributeType.ZONE_C, AttributeType.AUTHOR, AttributeType.PING_HDL)); }</code><technical_language>test short format ('pn') of person</technical_language>

Target:
public void attributes_person() { final Query query = Query.parse("-i person name"); assertThat(query.getAttributeTypes(), contains(AttributeType.ABUSE_C, AttributeType.ADMIN_C, AttributeType.TECH_C, AttributeType.ZONE_C, AttributeType.AUTHOR, AttributeType.PING_HDL)); final Query queryPn = Query.parse("-i pn name"); assertThat(queryPn.getAttributeTypes(), contains(AttributeType.ABUSE_C, AttributeType.ADMIN_C, AttributeType.TECH_C, AttributeType.ZONE_C, AttributeType.AUTHOR, AttributeType.PING_HDL)); }
Source:
<code>private String getLocationName() { <START> return m_location == null ? "Default" : m_location.getLocationName(); <END> }</code><technical_language>org.opennms.core.utils.LocationUtils instead of hardcoding "Default"</technical_language>

Target:
private String getLocationName() { return m_location == null ? DEFAULT_LOCATION_NAME: m_location.getLocationName(); }
Source:
<code>private ApnsClient buildApnsClient(final iOSVariant iOSVariant) { if (iOSVariant.getCertificate() != null && iOSVariant.getPassphrase() != null) { ApnsClient apnsClient = null; try { final ByteArrayInputStream stream = new ByteArrayInputStream(iOSVariant.getCertificate()); apnsClient = new ApnsClientBuilder() .setClientCredentials(stream, iOSVariant.getPassphrase()) .build(); stream.close(); } catch (Exception e) { logger.error("Error reading certificate", e); <START> return null; <END> } return apnsClient; } return null; }</code><technical_language>exception here</technical_language>

Target:
private ApnsClient buildApnsClient(final iOSVariant iOSVariant) { if (iOSVariant.getCertificate() != null && iOSVariant.getPassphrase() != null) { try { final ByteArrayInputStream stream = new ByteArrayInputStream(iOSVariant.getCertificate()); final ApnsClient apnsClient = new ApnsClientBuilder() .setClientCredentials(stream, iOSVariant.getPassphrase()) .build(); stream.close(); return apnsClient; } catch (Exception e) { logger.error("Error reading certificate", e); } } throw new IllegalArgumentException("Not able to construct APNS client"); }
Source:
<code>private void navigateStats() { swipeDownOnView(R.id.scroll_view); moveToStats(); <START> idleFor(2000); <END> swipeToAvoidGrayOverlay(R.id.statsPager); setNightModeAndWait(true); takeScreenshot("3-build-an-audience"); pressBackUntilElementIsDisplayed(R.id.nav_sites); }</code><technical_language>moveToStats() include a idleFor(8000) end of code (and moveToStats is called here), want combine idleFor(8000) idleFor(2000) in a single idleFor(10000) - reduce duration if long pause previously more for debugging - one. _(Not of is (end of moveToStats ), decide)_</technical_language>

Target:
private void navigateStats() { swipeDownOnView(R.id.scroll_view); moveToStats(); swipeToAvoidGrayOverlay(R.id.statsPager); setNightModeAndWait(true); takeScreenshot("3-build-an-audience"); pressBackUntilElementIsDisplayed(R.id.nav_sites); }
Source:
<code><START> Map<String, String> updateAdditionalAttributes(Map<String, String> oldAdditionalAttributes) { <END> oldAdditionalAttributes.putAll(this.additionalAttributes); return oldAdditionalAttributes; }</code><technical_language>I prefer method visibility</technical_language>

Target:
private Map<String, String> updateAdditionalAttributes(Map<String, String> oldAdditionalAttributes) { Map<String, String> aux = new HashMap<String, String>(); aux.putAll(oldAdditionalAttributes); aux.putAll(this.additionalAttributes); return aux; }
Source:
<code>public void shouldBeAlphabeticalWhenNoHomeAndLocation() { ChapterComparator comparator = new ChapterComparator(null, null); <START> assertTrue(0 > comparator.compare(chapterStartsWithDigit, chapterStartsWithLetterA)); <END> assertTrue(0 < comparator.compare(chapterStartsWithLetterA, chapterStartsWithDigit)); assertTrue(0 == comparator.compare(chapterStartsWithDigit, chapterStartsWithDigit)); assertTrue(0 > comparator.compare(chapterStartsWithDigit, chapterIstanbul)); assertTrue(0 < comparator.compare(chapterIstanbul, chapterStartsWithDigit)); }</code><technical_language>I find this difficult read, extract a method for asserts? assertOrder(comparator, chapterStartsWithDigit, chapterStartsWithLetterA, chapterInstanbul);</technical_language>

Target:
public void shouldBeAlphabeticalWhenNoHomeAndLocation() { ChapterComparator comparator = new ChapterComparator(null, null); assertElementsOrderedLikeThis(comparator, chapterStartsWithDigit, chapterStartsWithLetterA, chapterIstanbul); }
Source:
<code>private void doStartThread() { assert thread == null; executor.execute(new Runnable() { @Override public void run() { thread = Thread.currentThread(); if (interrupted) { thread.interrupt(); } boolean success = false; updateLastExecutionTime(); try { SingleThreadEventExecutor.this.run(); success = true; } catch (Throwable t) { logger.warn("Unexpected exception from an event executor: ", t); } finally { for (;;) { int oldState = state; if (oldState >= ST_SHUTTING_DOWN || STATE_UPDATER.compareAndSet( SingleThreadEventExecutor.this, oldState, ST_SHUTTING_DOWN)) { break; } } if (success && gracefulShutdownStartTime == 0) { if (logger.isErrorEnabled()) { logger.error("Buggy " + EventExecutor.class.getSimpleName() + " implementation; " + SingleThreadEventExecutor.class.getSimpleName() + ".confirmShutdown() must " + "be called before run() implementation terminates."); } } try { for (;;) { if (confirmShutdown()) { break; } } } finally { try { cleanup(); } finally { STATE_UPDATER.set(SingleThreadEventExecutor.this, ST_TERMINATED); threadLock.release(); if (!taskQueue.isEmpty()) { if (logger.isWarnEnabled()) { logger.warn("An event executor terminated with " + "non-empty task queue (" + taskQueue.size() + ')'); } } <START> FastThreadLocal.removeAll(); <END> terminationFuture.setSuccess(null); } } } } }); }</code><technical_language>this happen threadLock.release()/before STATE_UPDATER.set()? awaitTermination returns threadLock is released</technical_language>

Target:
private void doStartThread() { assert thread == null; executor.execute(new Runnable() { @Override public void run() { thread = Thread.currentThread(); if (interrupted) { thread.interrupt(); } boolean success = false; updateLastExecutionTime(); try { SingleThreadEventExecutor.this.run(); success = true; } catch (Throwable t) { logger.warn("Unexpected exception from an event executor: ", t); } finally { for (;;) { int oldState = state; if (oldState >= ST_SHUTTING_DOWN || STATE_UPDATER.compareAndSet( SingleThreadEventExecutor.this, oldState, ST_SHUTTING_DOWN)) { break; } } if (success && gracefulShutdownStartTime == 0) { if (logger.isErrorEnabled()) { logger.error("Buggy " + EventExecutor.class.getSimpleName() + " implementation; " + SingleThreadEventExecutor.class.getSimpleName() + ".confirmShutdown() must " + "be called before run() implementation terminates."); } } try { for (;;) { if (confirmShutdown()) { break; } } } finally { try { cleanup(); } finally { FastThreadLocal.removeAll(); STATE_UPDATER.set(SingleThreadEventExecutor.this, ST_TERMINATED); threadLock.release(); if (!taskQueue.isEmpty()) { if (logger.isWarnEnabled()) { logger.warn("An event executor terminated with " + "non-empty task queue (" + taskQueue.size() + ')'); } } terminationFuture.setSuccess(null); } } } } }); }
Source:
<code>public int onStartCommand(Intent intent, int flags, int startId) { Log.d(TAG, "Trip service started"); Intent notificationIntent = new Intent(this, TripService.class); PendingIntent pendingIntent = PendingIntent.getActivity(this, 0, notificationIntent, 0); Notification notification = new NotificationCompat.Builder(getApplicationContext(), Application.CHANNEL_TRIP_PLAN_UPDATES_ID) .setSmallIcon(R.drawable.ic_stat_notification) .setContentTitle("Service running in foreground") .setContentText("OneBusAway will be running a service in foreground") .setContentIntent(pendingIntent).build(); <START> startForeground(1001,notification); <END> return handleCommand(intent, startId); }</code><technical_language>change ID a larger number 1000000, refactor a public static final member constant in class? want this collide other notification IDs in OBA. A large number shot for this me, if other ideas</technical_language>

Target:
public int onStartCommand(Intent intent, int flags, int startId) { if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) { Intent notificationIntent = new Intent(this, TripService.class); PendingIntent pendingIntent = PendingIntent.getActivity(this, 0, notificationIntent, 0); String action = intent.getAction(); String foregroundNotifyTitle = Application.get().getResources() .getString(R.string.foreground_all_intent_title); String foregroundNotifyText = ""; if (ACTION_SCHEDULE.equals(action)) { foregroundNotifyText = Application.get().getResources() .getString(R.string.foreground_action_schedule_text); } else if (ACTION_POLL.equals(action)) { foregroundNotifyText = Application.get().getResources() .getString(R.string.foreground_action_poll_text); } else if (ACTION_NOTIFY.equals(action)) { foregroundNotifyText = Application.get().getResources() .getString(R.string.foreground_action_notify_text); } else { foregroundNotifyText = Application.get().getResources() .getString(R.string.foreground_action_cancel_text); } Notification notification = new NotificationCompat.Builder(getApplicationContext(), Application.CHANNEL_TRIP_PLAN_UPDATES_ID) .setSmallIcon(R.drawable.ic_stat_notification) .setContentTitle(foregroundNotifyTitle) .setContentText(foregroundNotifyText) .setContentIntent(pendingIntent).build(); startForeground(FOREGROUND_NOTIFICATION_ID, notification); } return handleCommand(intent, startId); }
Source:
<code>private void callCreateCacheManagers() throws Throwable { try { log.debug("Creating cache managers"); createCacheManagers(); <START> waitForClusterToForm(); <END> log.debug("Cache managers created, ready to start the test"); } catch (Throwable th) { log.error("Error in test setup: ", th); throw th; } }</code><technical_language>impact of this state transfer tests</technical_language>

Target:
private void callCreateCacheManagers() throws Throwable { try { log.debug("Creating cache managers"); createCacheManagers(); log.debug("Cache managers created, ready to start the test"); } catch (Throwable th) { log.error("Error in test setup: ", th); throw th; } }
Source:
<code>public ReviewerResult removeReviewer(String reviewId, String reviewerId, IProgressMonitor monitor) throws GerritException { Change.Id id = new Change.Id(id(reviewId)); String uri = "/a/changes/" + id.get() + "/reviewers/" + reviewerId; ReviewerResult reviewerResult = new ReviewerResult(); try { String result = restClient.executeDeleteRestRequest(uri, new ReviewerInput(reviewerId), String.class, null, monitor); } catch (GerritHttpException e) { if (e.getResponseCode() == HttpStatus.SC_NOT_FOUND) { reviewerResult <START> .addError(new ReviewerResult.Error(ReviewerResult.Error.Type.ACCOUNT_NOT_FOUND, reviewerId)); <END> } } ChangeDetail changeDetail = getChangeDetail(id.get(), monitor); List<ApprovalDetail> approvalDetails = new ArrayList<>(); for (ApprovalDetail approval : changeDetail.getApprovals()) { if (!approval.getAccount().equals(reviewerId)) { approvalDetails.add(approval); } } changeDetail.setApprovals(approvalDetails); reviewerResult.setChange(changeDetail); return reviewerResult; }</code><technical_language>necessarily account right? reviewer is review? I initially this null correct</technical_language>

Target:
public ReviewerResult removeReviewer(String reviewId, String reviewerId, IProgressMonitor monitor) throws GerritException { Change.Id id = new Change.Id(id(reviewId)); String uri = "/a/changes/" + id.get() + "/reviewers/" + reviewerId; ReviewerResult reviewerResult = new ReviewerResult(); try { String result = restClient.executeDeleteRestRequest(uri, new ReviewerInput(reviewerId), String.class, null, monitor); } catch (GerritHttpException e) { if (e.getResponseCode() == HttpStatus.SC_NOT_FOUND) { reviewerResult.addError(new ReviewerResult.Error(null, reviewerId)); } } ChangeDetail changeDetail = getChangeDetail(id.get(), monitor); List<ApprovalDetail> approvalDetails = new ArrayList<>(); for (ApprovalDetail approval : changeDetail.getApprovals()) { if (!approval.getAccount().equals(reviewerId)) { approvalDetails.add(approval); } } changeDetail.setApprovals(approvalDetails); reviewerResult.setChange(changeDetail); return reviewerResult; }
Source:
<code>public void onCreatePreferences(Bundle savedInstanceState, String rootKey) { <START> GoogleAnalyticsUtils.reportPrefActivityEntry(GoogleAnalyticsFields.CATEGORY_CC_PREFS); <END> setupUI(); initPrefs(); loadPrefs(); }</code><technical_language>If of calls reportPrefActivityEntry() removed in this PR, notice preference activity invoke this call specific category. switch that? sense do in implemented setting a title for fragment</technical_language>

Target:
public void onCreatePreferences(Bundle savedInstanceState, String rootKey) { GoogleAnalyticsUtils.reportPrefActivityEntry(getAnalyticsCategory()); setTitle(); initPrefsFile(); loadPrefs(); }