auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code><START> Set<ReportField> reportContent() { <END> Set<ReportField> reportContent = new HashSet<ReportField>(); if (customReportContent != null) { if (ACRA.DEV_LOGGING) ACRA.log.d(LOG_TAG, "Using custom Report Fields"); reportContent.addAll(Arrays.asList(customReportContent)); } else if (mailTo == null || DEFAULT_STRING_VALUE.equals(mailTo)) { if (ACRA.DEV_LOGGING) ACRA.log.d(LOG_TAG, "Using default Report Fields"); reportContent.addAll(Arrays.asList(DEFAULT_REPORT_FIELDS)); } else { if (ACRA.DEV_LOGGING) ACRA.log.d(LOG_TAG, "Using default Mail Report Fields"); reportContent.addAll(Arrays.asList(DEFAULT_MAIL_REPORT_FIELDS)); } if (!reportContentChanges.isEmpty()) { for (Map.Entry<ReportField, Boolean> entry : reportContentChanges.entrySet()) { if (entry.getValue()) { reportContent.add(entry.getKey()); } else { reportContent.remove(entry.getKey()); } } } return reportContent; }</code><technical_language>do is unused? introduced 10-FEB-2016</technical_language>

Target:
Set<ReportField> reportContent() { Set<ReportField> reportContent = new HashSet<ReportField>(); if (customReportContent != null) { if (ACRA.DEV_LOGGING) ACRA.log.d(LOG_TAG, "Using custom Report Fields"); reportContent.addAll(Arrays.asList(customReportContent)); } else if (mailTo == null || DEFAULT_STRING_VALUE.equals(mailTo)) { if (ACRA.DEV_LOGGING) ACRA.log.d(LOG_TAG, "Using default Report Fields"); reportContent.addAll(Arrays.asList(DEFAULT_REPORT_FIELDS)); } else { if (ACRA.DEV_LOGGING) ACRA.log.d(LOG_TAG, "Using default Mail Report Fields"); reportContent.addAll(Arrays.asList(DEFAULT_MAIL_REPORT_FIELDS)); } for (Map.Entry<ReportField, Boolean> entry : reportContentChanges.entrySet()) { if (entry.getValue()) { reportContent.add(entry.getKey()); } else { reportContent.remove(entry.getKey()); } } return reportContent; }
Source:
<code>public boolean handleFault(SOAPMessageContext context) { if (!shouldExecute(context)) { return true; } <START> final Span span = tracingPlugin.getTracer().scopeManager().activeSpan(); <END> Tags.ERROR.set(span, Boolean.TRUE); try { final SOAPFault fault = context.getMessage().getSOAPBody().getFault(); span.setTag("soap.fault.reason", fault.getFaultString()); span.setTag("soap.fault.code", fault.getFaultCode()); } catch (SOAPException e) { logger.warn("Exception while trying to access SOAP fault (this exception was suppressed)", e); } return true; }</code><technical_language>if span == null</technical_language>

Target:
public boolean handleFault(SOAPMessageContext context) { if (!shouldExecute(context)) { return true; } final Span activeSpan = tracingPlugin.getTracer().scopeManager().activeSpan(); if (activeSpan != null) { Tags.ERROR.set(activeSpan, Boolean.TRUE); try { final SOAPFault fault = context.getMessage().getSOAPBody().getFault(); activeSpan.setTag("soap.fault.reason", fault.getFaultString()); activeSpan.setTag("soap.fault.code", fault.getFaultCode()); } catch (SOAPException e) { logger.warn("Exception while trying to access SOAP fault (this exception was suppressed)", e); } } return true; }
Source:
<code>public static void assertEmpty(String multimapName, Multimap<?, ?> actualMultimap) { try { assertObjectNotNull(multimapName, actualMultimap); if (!actualMultimap.isEmpty()) { <START> Assert.fail(multimapName + MSG_SHOULD_BE_EMPTY_ACTUAL_SIZE + <END> actualMultimap.size() + '>'); } } catch (AssertionError e) { throw mangledException(e); } }</code><technical_language>here, please add static imports for Assert static methods</technical_language>

Target:
public static void assertEmpty(String multimapName, Multimap<?, ?> actualMultimap) { try { assertObjectNotNull(multimapName, actualMultimap); if (!actualMultimap.isEmpty()) { fail(multimapName + MSG_SHOULD_BE_EMPTY_ACTUAL_SIZE + actualMultimap.size() + '>'); } } catch (AssertionError e) { throw mangledException(e); } }
Source:
<code>public List<UserModel> searchForUser(Map<String, String> attributes, RealmModel realm, int firstResult, int maxResults) { String search = Optional.ofNullable(attributes.get(UserModel.USERNAME)) .orElseGet(()-> attributes.get(UserModel.SEARCH)); if (search == null) return Collections.EMPTY_LIST; <START> return searchForUser(search, realm, firstResult, maxResults, username -> { if (Boolean.valueOf(attributes.getOrDefault(UserModel.EXACT, Boolean.FALSE.toString()))) { return username.equals(search); } else { return username.contains(search); } }); <END> }</code><technical_language>For performance smaller memory footprint, evaluate predicate early: suggestion Predicate<String> p = Boolean.valueOf(attributes.getOrDefault(UserModel.EXACT, Boolean.FALSE.toString())) ? username -> username.equals(search) : username -> username.contains(search); return searchForUser(search, realm, firstResult, maxResults, p);</technical_language>

Target:
public List<UserModel> searchForUser(Map<String, String> attributes, RealmModel realm, int firstResult, int maxResults) { String search = Optional.ofNullable(attributes.get(UserModel.USERNAME)) .orElseGet(()-> attributes.get(UserModel.SEARCH)); if (search == null) return Collections.EMPTY_LIST; Predicate<String> p = Boolean.valueOf(attributes.getOrDefault(UserModel.EXACT, Boolean.FALSE.toString())) ? username -> username.equals(search) : username -> username.contains(search); return searchForUser(search, realm, firstResult, maxResults, p); }
Source:
<code>private void sortBySize(boolean sortAscending){ final Integer val; if (sortAscending){ val = 1; } else { val = -1; } Collections.sort(mFiles, new Comparator<OCFile>() { public int compare(OCFile o1, OCFile o2) { if (o1.isFolder() && o2.isFolder()) { <START> return val * Long.compare(getFolderSize(new File(FileStorageUtils.getDefaultSavePathFor(mAccount.name, o1))), <END> getFolderSize(new File(FileStorageUtils.getDefaultSavePathFor(mAccount.name, o2)))); } else if (o1.isFolder()) { return -1; } else if (o2.isFolder()) { return 1; } else if (o1.getFileLength() == 0 || o2.getFileLength() == 0){ return 0; } else { return val * Long.compare(o1.getFileLength(), o2.getFileLength()); } } }); }</code><technical_language>Please, break lines shorter 120 characters; maximum length shown Github in pull requests scrollbar</technical_language>

Target:
private void sortBySize(boolean sortAscending) { final Integer val; if (sortAscending) { val = 1; } else { val = -1; } Collections.sort(mFiles, new Comparator<OCFile>() { @Override public int compare(OCFile o1, OCFile o2) { if (o1.isFolder() && o2.isFolder()) { return val * Long.compare( getFolderSize(new File(FileStorageUtils.getDefaultSavePathFor(mAccount.name, o1))), getFolderSize(new File(FileStorageUtils.getDefaultSavePathFor(mAccount.name, o2)))); } else if (o1.isFolder()) { return -1; } else if (o2.isFolder()) { return 1; } else if (o1.getFileLength() == 0 || o2.getFileLength() == 0) { return 0; } else { return val * Long.compare(o1.getFileLength(), o2.getFileLength()); } } }); }
Source:
<code>public int getInt(int col) { <START> return intValues[col]; <END> }</code><technical_language>remove array, int column is present</technical_language>

Target:
public int getInt(int col) { return tableId; }
Source:
<code>public String toString() { <START> return com.google.common.base.Objects.toStringHelper(this) <END> .add("id", m_id) .add("applicationName", m_applicationName) .toString(); }</code><technical_language>above, this is deprecated longer used</technical_language>

Target:
public String toString() { return MoreObjects.toStringHelper(this) .add("m_id", m_id) .add("m_applicationName", m_applicationName) .add("location", location) .toString(); }
Source:
<code>public static IType findTypeInCompilationUnit(ICompilationUnit cu, String typeQualifiedName) throws JavaModelException { IType[] types= cu.getAllTypes(); for (IType type <START> : <END> types) { String currName= type.getTypeQualifiedName('.'); if (typeQualifiedName.equals(currName)) { return type; } } return null; }</code><technical_language>Please separate refactoring of iteration variables a separate patch</technical_language>

Target:
public static IType findTypeInCompilationUnit(ICompilationUnit cu, String typeQualifiedName) throws JavaModelException { IType[] types= cu.getAllTypes(); for (int i= 0; i < types.length; i++) { String currName= types[i].getTypeQualifiedName('.'); if (typeQualifiedName.equals(currName)) { return types[i]; } } return null; }
Source:
<code>public boolean equals(Object o) { <START> if (this == o) return true; <END> if (o == null || getClass() != o.getClass()) return false; SourceProcessingDetailsImpl that = (SourceProcessingDetailsImpl) o; if (this.warnings == null) return that.warnings == null; if (that.warnings == null) return false; ListIterator<String> thisWarningsIterator = this.warnings.listIterator(); ListIterator<String> thatWarningsIterator = that.warnings.listIterator(); while (thisWarningsIterator.hasNext() && thatWarningsIterator.hasNext()) { String thisNextWarning = thisWarningsIterator.next(); String thatNextWarning = thatWarningsIterator.next(); if (!Objects.equals(thisNextWarning, thatNextWarning)) return false; } return !thisWarningsIterator.hasNext() && !thatWarningsIterator.hasNext(); }</code><technical_language>replace this method with: if(o==null || getClass() != o.getClass()){ return false; } SourceProcessingDetailsImpl = (SourceProcessingDetailsImpl) o; if(this.warnings==null && that.warnings == null){ return true; }else{ return (this.warnings!=null && that.warnings!=null && this.warnings.size() == that.warnings.size() && this.warnings.containsAll(that.warnings)); } for added clarity</technical_language>

Target:
public boolean equals(Object o) { if (this == o) { return true; } if (o == null || getClass() != o.getClass()) { return false; } SourceProcessingDetailsImpl that = (SourceProcessingDetailsImpl) o; return this.warnings.size() == that.warnings.size() && this.warnings.containsAll(that.warnings); }
Source:
<code>public Person readPerson(final String memberId) { <START> final CgdCardCounter counter = CgdCardCounter.findCounterForYear(CgdCard.yearFor(memberId)); <END> if (!StringUtils.isNumeric(memberId)) { return null; } final int serialNumber = CgdCard.serialNumberFor(memberId); return counter == null ? null : counter.getCgdCardSet().stream().filter(c -> c.getSerialNumber() == serialNumber) .map(c -> c.getUser().getPerson()).findAny().orElse(null); }</code><technical_language>check this line</technical_language>

Target:
public Person readPerson(final String memberId) { if (!StringUtils.isNumeric(memberId)) { return null; } final CgdCardCounter counter = CgdCardCounter.findCounterForYear(CgdCard.yearFor(memberId)); final int serialNumber = CgdCard.serialNumberFor(memberId); return counter == null ? null : counter.getCgdCardSet().stream().filter(c -> c.getSerialNumber() == serialNumber) .map(c -> c.getUser().getPerson()).findAny().orElse(null); }
Source:
<code>private ErrorHandler createErrorHandlerFromString(String errorHandlerClassName, ClassLoaderService classLoaderService) { <START> if ( StringHelper.isEmpty( errorHandlerClassName ) || "log".equals( errorHandlerClassName.trim() ) ) { <END> return new LogErrorHandler(); } else { Class<?> errorHandlerClass = classLoaderService.classForName( errorHandlerClassName ); return ClassLoaderHelper.instanceFromClass( ErrorHandler.class, errorHandlerClass, "Error Handler" ); } }</code><technical_language>'log' a constant, making clear is shortcut name of logging error handler</technical_language>

Target:
private ErrorHandler createErrorHandlerFromString(String errorHandlerClassName, ClassLoaderService classLoaderService) { if ( StringHelper.isEmpty( errorHandlerClassName ) || ErrorHandler.LOG.equals( errorHandlerClassName.trim() ) ) { return new LogErrorHandler(); } else { Class<?> errorHandlerClass = classLoaderService.classForName( errorHandlerClassName ); return ClassLoaderHelper.instanceFromClass( ErrorHandler.class, errorHandlerClass, "Error Handler" ); } }
Source:
<code><START> public MakeBucketArgs build() throws IllegalArgumentException { <END> if (this.bucket == null) { throw new IllegalArgumentException("null value is not allowed for Bucket"); } return new MakeBucketArgs(this); }</code><technical_language>remove throws IllegalArgumentException</technical_language>

Target:
public MakeBucketArgs build() throws IllegalArgumentException { return new MakeBucketArgs(this); }
Source:
<code>private Tuple2<String, Map<String, Object>> runAndTakeSavepoint() throws Exception { return withCluster(new Configuration(), miniCluster -> { JobClient jobClient = submitJobInitially(env(startAligned, 0)); waitForAllTaskRunning(miniCluster, jobClient.getJobID(), Deadline.fromNow(Duration.of(30, ChronoUnit.SECONDS))); <START> Thread.sleep(FIRST_RUN_BACKPRESSURE_MS); END> Future<Map<String, Object>> accFuture = jobClient.getAccumulators(); Future<String> savepointFuture = jobClient.stopWithSavepoint(false, tempFolder().toURI().toString()); return new Tuple2<>(savepointFuture.get(), accFuture.get()); }); }</code><technical_language>generally anti-pattern in tests "just sleep for a while". backpressure monitoring wait is backpressure? (or longer?)</technical_language>

Target:
private Tuple2<String, Map<String, Object>> runAndTakeSavepoint() throws Exception { JobClient jobClient = submitJobInitially(env(startAligned, 0)); waitForAllTaskRunning(() -> miniCluster.getMiniCluster().getExecutionGraph(jobClient.getJobID()).get()); Thread.sleep(FIRST_RUN_BACKPRESSURE_MS); Future<Map<String, Object>> accFuture = jobClient.getAccumulators(); Future<String> savepointFuture = jobClient.stopWithSavepoint(false, tempFolder().toURI().toString()); return new Tuple2<>(savepointFuture.get(), accFuture.get()); }
Source:
<code>public void validate(Map<String, List<String>> messageHeaders, AlgorithmProvider algorithmProvider, PublicKeyProvider publicKeyProvider, SecurityProvider securityProvider, String method, String uri) { Signature signature = extractSignatureFromHeader(messageHeaders.get("Signature").get(0)); String providedAlgorithm = algorithmProvider.getAlgorithmName(signature.getKeyId()); <START> Objects.requireNonNull(providedAlgorithm, "provided algorithm is null"); <END> String signatureAlgorithm = signature.getAlgorithm().toString(); if (!providedAlgorithm.equals(signatureAlgorithm)) { throw new DifferentAlgorithmsException("signature algorithm from header and provided are different"); } Key key = publicKeyProvider.getKey(signature.getKeyId()); Objects.requireNonNull(key, "provided public key is null"); java.security.Provider provider = securityProvider.getProvider(signature.getKeyId()); Objects.requireNonNull(provider, "provided security provider is null"); runVerifier(messageHeaders, key, signature, provider, method, uri); }</code><technical_language>needed anymore, getAlgorithmName return null</technical_language>

Target:
public void validate(Map<String, List<String>> messageHeaders, AlgorithmProvider algorithmProvider, PublicKeyProvider publicKeyProvider, SecurityProvider securityProvider, String method, String uri) { Signature signature = extractSignatureFromHeader(messageHeaders.get("Signature").get(0)); String providedAlgorithm = algorithmProvider.getAlgorithmName(signature.getKeyId()); String signatureAlgorithm = signature.getAlgorithm().toString(); if (!providedAlgorithm.equals(signatureAlgorithm)) { throw new DifferentAlgorithmsException("signature algorithm from header and provided are different"); } Key key = publicKeyProvider.getKey(signature.getKeyId()); java.security.Provider provider = securityProvider.getProvider(signature.getKeyId()); runVerifier(messageHeaders, key, signature, provider, method, uri); }
Source:
<code>public static String autoConvert(long size , SizeUnit inUnit) { <START> for(int i = (int)(inUnit.getUnitWeight()); i <= SizeUnit.GB.getUnitWeight();i++ ) { <END> if(size > Math.pow(1024, i)) { if(i == 0 ) { break; } return ((String.valueOf(convert(size, inUnit, SizeUnit.getUnit(i-1)))).concat(" ")).concat(SizeUnit.getUnit(i-1).toString()); } } return String.valueOf(size).concat(" ").concat(SizeUnit.BYTES.toString()); }</code><technical_language>long</technical_language>

Target:
public static String autoConvert(long size , SizeUnit inUnit) { weightToUnit = new HashMap<SizeConverter.SizeUnit, Long>(); for(long i = (SizeUnit.values())[SizeUnit.values().length - 1].getUnitWeight(); i >= inUnit.getUnitWeight() ; i-- ) { if(size/Math.pow(CONVERT_FACTOR, i-1) >= 1) { return ((String.valueOf(convert(size, inUnit, SizeUnit.getUnit(inUnit.getUnitWeight() + i-1)))).concat(" ")).concat(SizeUnit.getUnit(inUnit.getUnitWeight() + i -1).toString()); } } return String.valueOf(size).concat(" ").concat(SizeUnit.BYTES.toString()); }
Source:
<code>public void createProfileDuplicateDisplayName() { createEnabledTestUser(); Map<String, String> profileDTO = getProfileDTO(); <START> profileDTO.put("displayName", "MONSTERKILLER9001"); <END> SessionData login = login(testUser.getUsername(), testUserCleartextPassword); given(). filter(sessionFilter). header(login.getCsrfHeader()). when(). content(profileDTO). contentType(ContentType.JSON). post("/users/current/profile"). then(). statusCode(HttpStatus.SC_CONFLICT); }</code><technical_language>this dynamic if .toUpperCase()</technical_language>

Target:
public void createProfileDuplicateDisplayName() { createEnabledTestUser(); Map<String, String> profileDTO = getProfileDTO(); profileDTO.put("displayName", user.getProfile().getDisplayName().toUpperCase()); SessionData login = login(testUser.getUsername(), testUserCleartextPassword); given(). filter(sessionFilter). header(login.getCsrfHeader()). when(). content(profileDTO). contentType(ContentType.JSON). post("/users/current/profile"). then(). statusCode(HttpStatus.SC_CONFLICT). body("message", equalTo("DisplayName already in use")); }
Source:
<code>protected void configure() { super.configure(); bind(new TypeLiteral<ComputeServiceAdapter<Server, HardwareFlavour, org.apache.jclouds.oneandone.rest.domain.Image, Location>>() { }).to(OneandoneComputeServiceAdapter.class); <START> bind(TemplateBuilderImpl.class).to(ArbitraryCpuRamTemplateBuilderImpl.class); <END> bind(new TypeLiteral<Function<Server, NodeMetadata>>() { }).to(ServerToNodeMetadata.class); bind(new TypeLiteral<Function<org.apache.jclouds.oneandone.rest.domain.Image, Image>>() { }).to(ImageToImage.class); bind(new TypeLiteral<Function<Hdd, Volume>>() { }).to(HddToVolume.class); bind(new TypeLiteral<Function<HardwareFlavour, Hardware>>() { }).to(HardwareFlavourToHardware.class); }</code><technical_language>users set custom CPU/RAM values if predefined hardware flavours in OneAndOne? If not, remove this binding</technical_language>

Target:
protected void configure() { super.configure(); install(new LocationsFromComputeServiceAdapterModule<Server, HardwareFlavour, SingleServerAppliance, DataCenter>() { }); bind(new TypeLiteral<ComputeServiceAdapter<Server, HardwareFlavour, SingleServerAppliance, DataCenter>>() { }).to(OneandoneComputeServiceAdapter.class); bind(TemplateBuilderImpl.class).to(ArbitraryCpuRamTemplateBuilderImpl.class); bind(NodeAndTemplateOptionsToStatement.class).to(NodeAndTemplateOptionsToStatementWithoutPublicKey.class); bind(new TypeLiteral<Function<Server, NodeMetadata>>() { }).to(ServerToNodeMetadata.class); bind(new TypeLiteral<Function<SingleServerAppliance, Image>>() { }).to(SingleServerApplianceToImage.class); bind(new TypeLiteral<Function<Hdd, Volume>>() { }).to(HddToVolume.class); bind(new TypeLiteral<Function<HardwareFlavour, Hardware>>() { }).to(HardwareFlavourToHardware.class); bind(new TypeLiteral<Function<DataCenter, Location>>() { }).to(DataCenterToLocation.class); }
Source:
<code>public void createSuiteContext(@Observes(precedence = 100) EventContext<SuiteEvent> context) { SuiteContext suiteContext = this.suiteContextInstance.get(); try { suiteContext.activate(); context.proceed(); } finally { suiteContext.deactivate(); <START> suiteContext.destroy(); <END> } }</code><technical_language>need a AfterSuite check well. If destroying context pr _any_ BeforeClass/AfterClass/Before/After/Test in SuiteEvent hierarchy</technical_language>

Target:
public void createSuiteContext(@Observes(precedence = 100) EventContext<SuiteEvent> context) { SuiteContext suiteContext = this.suiteContextInstance.get(); try { suiteContext.activate(); context.proceed(); } finally { suiteContext.deactivate(); if (AfterSuite.class.isAssignableFrom(context.getEvent().getClass())) { suiteContext.destroy(); } } }
Source:
<code>private PackWriter newPackWriter() { PackConfig pc = packConfig; if (pc == null) { pc = db != null ? new PackConfig(db) : new PackConfig(); } if (reader != null) { return new PackWriter(pc, reader); } final ObjectReader or = db.newObjectReader(); return new PackWriter(pc, or) { @Override public void close() { super.close(); <START> or.close(); <END> } }; }</code><technical_language>super.close() closes 'or' (as writePack). Is idea PackWriter gain a boolean disable behavior</technical_language>

Target:
private PackWriter newPackWriter() { PackConfig pc = packConfig; if (pc == null) { pc = db != null ? new PackConfig(db) : new PackConfig(); } return new PackWriter(pc, reader != null ? reader : db.newObjectReader()); }
Source:
<code>private void checkMissingQueues() { long now = System.currentTimeMillis(); if (now - this.retryDeclarationInterval > this.lastRetryDeclaration) { synchronized(this.missingQueues) { Iterator<String> iterator = this.missingQueues.iterator(); while (iterator.hasNext()) { boolean available = true; String queue = iterator.next(); Channel channel = null; try { channel = this.connectionFactory.createConnection().createChannel(false); channel.queueDeclarePassive(queue); if (logger.isDebugEnabled()) { logger.debug("Queue '" + queue + "' is now available"); } } catch (IOException e) { available = false; if (logger.isDebugEnabled()) { logger.debug("Queue '" + queue + "' is still not available"); } } finally { if (channel != null) { try { channel.close(); } catch (IOException e) } } if (available) { try { this.consumeFromQueue(queue); iterator.remove(); } catch (IOException e) { throw RabbitExceptionTranslator.convertRabbitAccessException(e); } } } } } <START> this.lastRetryDeclaration = now; <END> }</code><technical_language>for a fresh time</technical_language>

Target:
private void checkMissingQueues() { long now = System.currentTimeMillis(); if (now - this.retryDeclarationInterval > this.lastRetryDeclaration) { synchronized(this.missingQueues) { Iterator<String> iterator = this.missingQueues.iterator(); while (iterator.hasNext()) { boolean available = true; String queue = iterator.next(); Channel channel = null; try { channel = this.connectionFactory.createConnection().createChannel(false); channel.queueDeclarePassive(queue); if (logger.isDebugEnabled()) { logger.debug("Queue '" + queue + "' is now available"); } } catch (IOException e) { available = false; if (logger.isDebugEnabled()) { logger.debug("Queue '" + queue + "' is still not available"); } } finally { if (channel != null) { try { channel.close(); } catch (IOException e) } } if (available) { try { this.consumeFromQueue(queue); iterator.remove(); } catch (IOException e) { throw RabbitExceptionTranslator.convertRabbitAccessException(e); } } } } this.lastRetryDeclaration = now; } }
Source:
<code>public void safeRun() { boolean force = forceGarbageCollection.get(); boolean suspendMajor = suspendMajorCompaction.get(); boolean suspendMinor = suspendMinorCompaction.get(); try { runWithFlags(force, suspendMajor, suspendMinor); } catch (Exception e) { <START> LOG.warn("Failed to complete gc {}", e.getMessage(), e); <END> } if (force) { forceGarbageCollection.set(false); } }</code><technical_language>if catching "Exception" time call runWithFlags.... catch error runWithFlags leave previous signature ? catch (Exception) is a code smell, do need</technical_language>

Target:
public void safeRun() { boolean force = forceGarbageCollection.get(); boolean suspendMajor = suspendMajorCompaction.get(); boolean suspendMinor = suspendMinorCompaction.get(); runWithFlags(force, suspendMajor, suspendMinor); if (force) { forceGarbageCollection.set(false); } }
Source:
<code><START> public static TmfAnalysisType getInstance() { <END> if (fInstance == null) { fInstance = new TmfAnalysisType(); } return fInstance; }</code><technical_language>synchronized, juuust in case</technical_language>

Target:
public static TmfAnalysisType getInstance() { synchronized (syncObj) { if (fInstance == null) { fInstance = new TmfAnalysisType(); } } return fInstance; }
Source:
<code>private void publish() { ModelControllerImpl.this.managementModel.set(this); ControllerLogger.MGMT_OP_LOGGER.tracef("published %s", this); published = true; <START> capabilityRegistry.publish(); <END> }</code><technical_language>ordering wrong. matter, unintuitive log set flag, continue publishing process</technical_language>

Target:
private void publish() { ModelControllerImpl.this.managementModel.set(this); published = true; ControllerLogger.MGMT_OP_LOGGER.tracef("published %s", this); }
Source:
<code>public Pull create( @NotNull(message = "title can't be NULL") final String title, @NotNull(message = "head can't be NULL") final String head, @NotNull(message = "base can't be NULL") final String base ) throws IOException { if (head.isEmpty()) { throw new IllegalArgumentException("head cannot be empty!"); } if (base.isEmpty()) { throw new IllegalArgumentException("base cannot be empty!"); } final String canonicalHead; <START> if (head.contains(USER_BRANCH_SEP)) { <END> canonicalHead = head; } else { canonicalHead = this.coords.user() + USER_BRANCH_SEP + head; } this.storage.lock(); final int number; try { final Issue issue = this.repo().issues().create(title, "some body"); number = issue.number(); this.storage.apply( new Directives().xpath(this.xpath()).add("pull") .add("number").set(Integer.toString(number)).up() .add("head").set(canonicalHead).up() .add("base").set(base).up() .add("user") .add("login").set(this.self) .up() ); } finally { this.storage.unlock(); } return this.get(number); }</code><technical_language>@cvrebert MkPulls.USER_BRANCH_SEP</technical_language>

Target:
public Pull create( @NotNull(message = "title can't be NULL") final String title, @NotNull(message = "head can't be NULL") final String head, @NotNull(message = "base can't be NULL") final String base ) throws IOException { if (head.isEmpty()) { throw new IllegalArgumentException("head cannot be empty!"); } if (base.isEmpty()) { throw new IllegalArgumentException("base cannot be empty!"); } final String canonical; if (head.contains(MkPulls.USER_BRANCH_SEP)) { canonical = head; } else { canonical = String.format( "%s%s%s", this.coords.user(), MkPulls.USER_BRANCH_SEP, head ); } this.storage.lock(); final int number; try { final Issue issue = this.repo().issues().create(title, "some body"); number = issue.number(); this.storage.apply( new Directives().xpath(this.xpath()).add("pull") .add("number").set(Integer.toString(number)).up() .add("head").set(canonical).up() .add("base").set(base).up() .add("user") .add("login").set(this.self) .up() ); } finally { this.storage.unlock(); } return this.get(number); }
Source:
<code>public <T extends Closeable> Mono<T> bind(ServerTransport<T> transport) { return Mono.defer( new Supplier<Mono<T>>() { final ServerSetup serverSetup = serverSetup(); @Override public Mono<T> get() { int maxFrameLength = transport.maxFrameLength(); if (maxFrameLength > FRAME_LENGTH_MASK) { return Mono.error( new IllegalArgumentException( "Configured maxFrameLength[" + maxFrameLength <START> + "] exits maxFrameLength limit " <END> + FRAME_LENGTH_MASK)); } if (maxFrameLength > maxPayloadSize) { return Mono.error( new IllegalArgumentException( "Configured maxFrameLength[" + maxFrameLength + "] exits maxPayloadSize[" + maxPayloadSize + "]")); } if (mtu != 0 && mtu > maxFrameLength) { return Mono.error( new IllegalArgumentException( "Configured maximumTransmissionUnit[" + mtu + "] exits configured maxFrameLength[" + maxFrameLength + "]")); } return transport .start(duplexConnection -> acceptor(serverSetup, duplexConnection)) .doOnNext(c -> c.onClose().doFinally(v -> serverSetup.dispose()).subscribe()); } }); }</code><technical_language>This is meant exceeds? Search replace in RSocketConnector</technical_language>

Target:
public <T extends Closeable> Mono<T> bind(ServerTransport<T> transport) { return Mono.defer( new Supplier<Mono<T>>() { final ServerSetup serverSetup = serverSetup(); @Override public Mono<T> get() { int maxFrameLength = transport.maxFrameLength(); assertValidateSetup(maxFrameLength, maxInboundPayloadSize, mtu); return transport .start(duplexConnection -> acceptor(serverSetup, duplexConnection, maxFrameLength)) .doOnNext(c -> c.onClose().doFinally(v -> serverSetup.dispose()).subscribe()); } }); }
Source:
<code>public Long commit(EDBCommit commit) throws EDBException { if (commit.isCommitted()) { throw new EDBException("EDBCommit is already commitet."); } <START> if (commit.getParentRevisionNumber() != null <END> && !commit.getParentRevisionNumber().equals(getCurrentRevisionNumber())) { throw new EDBException("EDBCommit do not have the correct head revision number."); } runBeginCommitHooks(commit); EDBException exception = runPreCommitHooks(commit); if (exception != null) { return runErrorHooks(commit, exception); } Long timestamp = performCommit(commit); runEDBPostHooks(commit); return timestamp; }</code><technical_language>a good idea controlling this a property for compatibility</technical_language>

Target:
public Long commit(EDBCommit commit) throws EDBException { if (commit.isCommitted()) { throw new EDBException("EDBCommit is already commitet."); } if (revisionCheckEnabled && commit.getParentRevisionNumber() != null && !commit.getParentRevisionNumber().equals(getCurrentRevisionNumber())) { throw new EDBException("EDBCommit do not have the correct head revision number."); } runBeginCommitHooks(commit); EDBException exception = runPreCommitHooks(commit); if (exception != null) { return runErrorHooks(commit, exception); } Long timestamp = performCommit(commit); runEDBPostHooks(commit); return timestamp; }
Source:
<code>public <K,V> boolean callForMap(Map.Entry<K, V> entry) { if (numberOfArguments==2) { return call(entry.getKey(), entry.getValue()); } else { <START> return call(entry); <END> } }</code><technical_language>create a new BooleanClosureWraper delegate it, code here</technical_language>

Target:
public <K,V> boolean callForMap(Map.Entry<K, V> entry) { return new BooleanClosureWrapper(wrapped).callForMap(entry); }
Source:
<code>public void addAllIncludeFilters(Set<String> filters) { <START> for (String filter : filters) { mIncludeFilters.add(filter); } <END> }</code><technical_language>nit: mIncludeFilters.addAll(filters)</technical_language>

Target:
public void addAllIncludeFilters(Set<String> filters) { mIncludeFilters.addAll(filters); }
Source:
<code>public void customizeConnection(HttpURLConnection connection) { <START> connection.setChunkedStreamingMode(5242880); <END> }</code><technical_language>Magic number here.. a private static final variable in this class set value</technical_language>

Target:
public void customizeConnection(HttpURLConnection connection) { connection.setChunkedStreamingMode(chunkSize); }
Source:
<code>public boolean isTimeZone(final String timeZone) { <START> if (UTC.equals(timeZone)) { <END> return false; } return getLoadedTimeZones().stream().anyMatch(s -> s.getId().equals(timeZone)); }</code><technical_language>I reuse existing UTC, I if (TimeValueFormatter.UTC.equals(timeZone)) {</technical_language>

Target:
public boolean isTimeZone(final String timeZone) { if (TimeValueFormatter.UTC.equals(timeZone)) { return false; } return getLoadedTimeZones().stream().anyMatch(s -> s.getId().equals(timeZone)); }
Source:
<code>public List<Attribute> getRequiredAttributes(PerunSession sess, Service service, Member member, Group group) throws InternalErrorException { try { <START> return jdbc.query("select " + getAttributeMappingSelectQuery("mem") + " from attr_names " + <END> "join service_required_attrs on id=service_required_attrs.attr_id and service_required_attrs.service_id=? " + "left join member_group_attr_values mem on id=mem.attr_id and mem.group_id=? and member_id=? " + "where namespace in (?,?,?)", new AttributeRowMapper(sess, this, member), service.getId(), group.getId(), member.getId(), AttributesManager.NS_MEMBER_GROUP_ATTR_DEF, AttributesManager.NS_MEMBER_GROUP_ATTR_OPT, AttributesManager.NS_MEMBER_GROUP_ATTR_VIRT); } catch(RuntimeException ex) { throw new InternalErrorException(ex); } }</code><technical_language>problem name above</technical_language>

Target:
public List<Attribute> getRequiredAttributes(PerunSession sess, Service service, Member member, Group group) throws InternalErrorException { try { return jdbc.query("select " + getAttributeMappingSelectQuery("mem_gr") + " from attr_names " + "join service_required_attrs on id=service_required_attrs.attr_id and service_required_attrs.service_id=? " + "left join member_group_attr_values mem_gr on id=mem.attr_id and mem_gr.group_id=? and member_id=? " + "where namespace in (?,?,?)", new AttributeRowMapper(sess, this, member), service.getId(), group.getId(), member.getId(), AttributesManager.NS_MEMBER_GROUP_ATTR_DEF, AttributesManager.NS_MEMBER_GROUP_ATTR_OPT, AttributesManager.NS_MEMBER_GROUP_ATTR_VIRT); } catch(RuntimeException ex) { throw new InternalErrorException(ex); } }
Source:
<code>public LanguageToMapTransformer(final Contentlet con) { if (con.getInode() == null) { throw new DotStateException("Contentlet needs an inode to get fields"); } <START> final List<Map<String, Object>> maps = <END> new DotTransformerBuilder().languageToMapTransformer().content(con).build().toMaps(); if (maps.isEmpty()) { this.mapOfMaps = Collections.emptyMap(); } else { this.mapOfMaps = maps.get(0); } }</code><technical_language>this reduce findFirst().getOrElse</technical_language>

Target:
public LanguageToMapTransformer(final Contentlet con) { if (con.getInode() == null) { throw new DotStateException("Contentlet needs an inode to get fields"); } final List<Map<String, Object>> maps = new DotTransformerBuilder().languageToMapTransformer().content(con).build().toMaps(); this.mapOfMaps = maps.stream().findFirst().orElse(emptyMap()); }
Source:
<code>public Entry<String, Resource> export(String type, Project project, Map<String, String> options) throws Exception { project.prepare(); Jar jar; <START> if (EXECUTABLE_JAR.equals(type)) { <END> try (ProjectLauncher launcher = project.getProjectLauncher()) { Configuration configuration = Converter.cnv(Configuration.class, options); if (configuration.keep() || Processor.isTrue(project.getProperty(Constants.RUNKEEP))) launcher.setKeep(true); jar = launcher.executable(); launcher.removeClose(jar); project.getInfo(launcher); } } else if (EXECUTABLE_PACK.equals(type)) { String profile = options.getOrDefault(Constants.PROFILE, project.getProperty(Constants.PROFILE)); jar = project.pack(profile); if (jar == null) return null; } else { project.error("Unknown type %s", type); return null; } String name = jar.getName(); String[] baseext = Strings.extension(name); if (baseext != null && ("bnd".equals(baseext[1]) || "bndrun".equals(baseext[1]))) { name = baseext[0]; } name = name + Constants.DEFAULT_JAR_EXTENSION; return new SimpleEntry<>(name, new JarResource(jar, true)); }</code><technical_language>this a switch (type)</technical_language>

Target:
public Entry<String, Resource> export(String type, Project project, Map<String, String> options) throws Exception { project.prepare(); Jar jar = null; if (EXECUTABLE_JAR.equals(type)) { jar = defaultExporter(project, options); } else if (EXECUTABLE_PACK.equals(type)) { String profile = options.getOrDefault(Constants.PROFILE, project.getProfile()); jar = pack(project, profile); } else { project.error("Unknown type %s", type); } if (jar == null) return null; String name = jar.getName(); String[] baseext = Strings.extension(name); if (baseext != null && ("bnd".equals(baseext[1]) || "bndrun".equals(baseext[1]))) { name = baseext[0]; } name = name + Constants.DEFAULT_JAR_EXTENSION; return new SimpleEntry<>(name, new JarResource(jar, true)); }
Source:
<code>private PrivateEncryptedChannelExampleApp(final String[] args) { switch (args.length) { case 4: cluster = args[3]; case 3: eventName = args[2]; case 2: channelName = args[1]; <START> case 0: apiKey = args[0]; <END> } final HttpAuthorizer authorizer = new HttpAuthorizer( "http://localhost:3030/pusher/auth"); final PusherOptions options = new PusherOptions().setAuthorizer(authorizer).setEncrypted(true); options.setCluster(cluster); Pusher pusher = new Pusher(apiKey, options); pusher.connect(this); channel = pusher.subscribePrivateEncrypted(channelName, this, eventName); for (int i = 0; ; i++) { try { Thread.sleep(5000); pusher.disconnect(); pusher.connect(this); Thread.sleep(5000); pusher.unsubscribe(channelName); if (i % 2 == 0) { channel = pusher.subscribePrivateEncrypted(channelName, this, eventName); } } catch (final InterruptedException e) { e.printStackTrace(); } } }</code><technical_language>0 args, 1 arg</technical_language>

Target:
private PrivateEncryptedChannelExampleApp(final String[] args) { switch (args.length) { case 4: cluster = args[3]; case 3: eventName = args[2]; case 2: channelName = args[1]; case 1: apiKey = args[0]; } final HttpAuthorizer authorizer = new HttpAuthorizer( "http://localhost:3030/pusher/auth"); final PusherOptions options = new PusherOptions().setAuthorizer(authorizer).setEncrypted(true); options.setCluster(cluster); Pusher pusher = new Pusher(apiKey, options); pusher.connect(this); channel = pusher.subscribePrivateEncrypted(channelName, this, eventName); while (true) { try { Thread.sleep(1000); } catch (final InterruptedException e) { e.printStackTrace(); } } }
Source:
<code>private boolean hasBrandSummary(ProgData progData) { if (Strings.isNullOrEmpty(progData.getSeriesSummary())) { return false; } <START> return true; <END> }</code><technical_language>if ([boolean condition]) return boolean... REALLY? in other news, do return !Strings.isNullOrEmpty(progData.getSeriesSummary());</technical_language>

Target:
private boolean hasBrandSummary(ProgData progData) { return !Strings.isNullOrEmpty(progData.getSeriesSummary()); }
Source:
<code>protected void service(HttpServletRequest req, HttpServletResponse res) throws ServletException, IOException { noCache(res); try { checkRequiresCapability(); super.service(req, res); <START> } catch (Error err) { <END> handleError(err, req, res); } catch (RuntimeException err) { handleError(err, req, res); } }</code><technical_language>add a catch block here: catch (RequireCapabilityException err) { res.setStatus(HttpServletResponse.SC_FORBIDDEN); noCache(res); sendText(req, res, err.getMessage()); }</technical_language>

Target:
protected void service(HttpServletRequest req, HttpServletResponse res) throws ServletException, IOException { noCache(res); try { checkRequiresCapability(); super.service(req, res); } catch (RequireCapabilityException err) { res.setStatus(HttpServletResponse.SC_FORBIDDEN); noCache(res); sendText(req, res, err.getMessage()); } catch (Error err) { handleError(err, req, res); } catch (RuntimeException err) { handleError(err, req, res); } }
Source:
<code>private MultiStatus syncDown(IProgressMonitor monitor) throws CoreException { final RSync rsync = OpenShiftServerUtils.createRSync(getServer(), monitor); final File localDeploymentDirectory = new File(getDeploymentOptions().getDeploymentsRootFolder(true)); final MultiStatus status = new MultiStatus(OpenShiftCoreActivator.PLUGIN_ID, IStatus.OK, <START> NLS.bind(OpenShiftCoreMessages.couldNoSyncPodsToFolder, localDeploymentDirectory.getAbsolutePath()), null); <END> rsync.syncPodsToDirectory(localDeploymentDirectory, status, ServerConsoleModel.getDefault().getConsoleWriter()); return status; }</code><technical_language>said, I **NOT** extract string, strive consistent remove message classes, moving strings code while NLS.bind etc</technical_language>

Target:
private MultiStatus syncDown(IProgressMonitor monitor) throws CoreException { final RSync rsync = OpenShiftServerUtils.createRSync(getServer(), monitor); final File localDeploymentDirectory = new File(getDeploymentOptions().getDeploymentsRootFolder(true)); final MultiStatus status = new MultiStatus(OpenShiftCoreActivator.PLUGIN_ID, IStatus.OK, NLS.bind("Could not sync all pods to folder {0}.", localDeploymentDirectory.getAbsolutePath()), null); rsync.syncPodsToDirectory(localDeploymentDirectory, status, ServerConsoleModel.getDefault().getConsoleWriter()); return status; }
Source:
<code>public void failed(Exception ex) { JOB_EXECUTION_LOG.error("Failed. " + ex.getMessage(), ex); jobExecution.setEndDate(Instant.now()); jobExecution.setStatus(FAILED); <START> jobExecution.setProgressMessage(ex.getLocalizedMessage()); <END> sendEmail( jobExecution.getFailureEmail(), jobExecution.getType() + " job failed.", jobExecution.getLog()); update(); JobExecutionContext.unset(); }</code><technical_language>I this: - in a separate PR GitHub issue - needs a unit test</technical_language>

Target:
public void failed(Exception ex) { JOB_EXECUTION_LOG.error("Failed. " + ex.getMessage(), ex); jobExecution.setEndDate(Instant.now()); jobExecution.setStatus(FAILED); jobExecution.setProgressMessage(ex.getMessage()); sendEmail( jobExecution.getFailureEmail(), jobExecution.getType() + " job failed.", jobExecution.getLog()); update(); JobExecutionContext.unset(); }
Source:
<code><START> private static Value readArrayFromBuffer( ByteBuffer buffer ) <END> { if ( buffer.limit() <= 0 ) { throw new IllegalStateException( "Given buffer is empty" ); } byte typeId = buffer.get(); buffer.order( ByteOrder.BIG_ENDIAN ); try { if ( typeId == PropertyType.STRING.intValue() ) { int arrayLength = buffer.getInt(); String[] result = new String[arrayLength]; for ( int i = 0; i < arrayLength; i++ ) { int byteLength = buffer.getInt(); result[i] = UTF8.decode( buffer.array(), buffer.position(), byteLength ); buffer.position( buffer.position() + byteLength ); } return Values.stringArray( result ); } else { ShortArray type = ShortArray.typeOf( typeId ); int bitsUsedInLastByte = buffer.get(); int requiredBits = buffer.get(); if ( requiredBits == 0 ) { return type.createEmptyArray(); } if ( type == ShortArray.BYTE && requiredBits == Byte.SIZE ) { byte[] byteArray = new byte[buffer.limit() - buffer.position()]; buffer.get( byteArray ); return Values.byteArray( byteArray ); } else { Bits bits = Bits.bitsFromBytes( buffer.array(), buffer.position() ); int length = ((buffer.limit() - buffer.position()) * 8 - (8 - bitsUsedInLastByte)) / requiredBits; return type.createArray( length, bits, requiredBits ); } } } finally { buffer.order( ByteOrder.LITTLE_ENDIAN ); } }</code><technical_language>this ArrayValue, is NO_VALUE hindering that</technical_language>

Target:
private static ArrayValue readArrayFromBuffer( ByteBuffer buffer ) { if ( buffer.limit() <= 0 ) { throw new IllegalStateException( "Given buffer is empty" ); } byte typeId = buffer.get(); buffer.order( ByteOrder.BIG_ENDIAN ); try { if ( typeId == PropertyType.STRING.intValue() ) { int arrayLength = buffer.getInt(); String[] result = new String[arrayLength]; for ( int i = 0; i < arrayLength; i++ ) { int byteLength = buffer.getInt(); result[i] = UTF8.decode( buffer.array(), buffer.position(), byteLength ); buffer.position( buffer.position() + byteLength ); } return Values.stringArray( result ); } else { ShortArray type = ShortArray.typeOf( typeId ); int bitsUsedInLastByte = buffer.get(); int requiredBits = buffer.get(); if ( requiredBits == 0 ) { return type.createEmptyArray(); } if ( type == ShortArray.BYTE && requiredBits == Byte.SIZE ) { byte[] byteArray = new byte[buffer.limit() - buffer.position()]; buffer.get( byteArray ); return Values.byteArray( byteArray ); } else { Bits bits = Bits.bitsFromBytes( buffer.array(), buffer.position() ); int length = ((buffer.limit() - buffer.position()) * 8 - (8 - bitsUsedInLastByte)) / requiredBits; return type.createArray( length, bits, requiredBits ); } } } finally { buffer.order( ByteOrder.LITTLE_ENDIAN ); } }
Source:
<code>public void completeImportWizard() { SimpleCertificateResponseMessageType response = service.completeImportWizard(); if (null != response) { if (response.isStatus()) { HelperUtil.addMessageInfo(null, response.getMessage()); } else { HelperUtil.addMessageError(null, response.getMessage()); } } else { <START> HelperUtil.addMessageError(null, "Error occured while calling completeImportWizard."); <END> } }</code><technical_language>Fix error message</technical_language>

Target:
public void completeImportWizard() { SimpleCertificateResponseMessageType response = service.completeImportWizard(); if (null != response) { if (response.isStatus()) { HelperUtil.addMessageInfo(null, response.getMessage()); } else { HelperUtil.addMessageError(null, response.getMessage()); } } else { HelperUtil.addMessageError(null, "Error occured while calling webservice."); } }
Source:
<code>public void initialize(URI uri, Configuration conf) throws IOException { super.initialize(uri, conf); setConf(conf); <START> defaultBlockSize = getDefaultBlockSize(new Path(".")); <END> }</code><technical_language>absolute fs uri</technical_language>

Target:
public void initialize(URI uri, Configuration conf) throws IOException { super.initialize(uri, conf); setConf(conf); defaultBlockSize = getDefaultBlockSize(new Path(uri)); }
Source:
<code>public static Submission.SrlExperiment mongoGetExperiment(final DB dbs, final String userId, final String problemId, final SubmissionManagerInterface submissionManager) throws DatabaseAccessException, AuthenticationException { final Data.ItemResult.Builder send = Data.ItemResult.newBuilder(); send.setQuery(ItemQuery.EXPERIMENT); final DBObject cursor = dbs.getCollection(DatabaseStringConstants.EXPERIMENT_COLLECTION).findOne(new ObjectId(problemId)); if (cursor == null) { throw new DatabaseAccessException("The student has not submitted anything for this problem"); } <START> if (!cursor.containsField(userId) || Strings.isNullOrEmpty((String) cursor.get(userId))) { <END> throw new DatabaseAccessException("The student has not submitted anything for this problem"); } final String sketchId = cursor.get(userId).toString(); LOG.info("SketchId: ", sketchId); final List<Submission.SrlExperiment> experimentList = submissionManager.getSubmission(userId, null, problemId, sketchId); if (experimentList.isEmpty()) { throw new DatabaseAccessException("No experiments were found"); } return experimentList.get(0); }</code><technical_language>add cursor == null this if statement delete preceding if statement do</technical_language>

Target:
public static Submission.SrlExperiment mongoGetExperiment(final DB dbs, final String userId, final String problemId, final SubmissionManagerInterface submissionManager) throws DatabaseAccessException, AuthenticationException { final Data.ItemResult.Builder send = Data.ItemResult.newBuilder(); send.setQuery(ItemQuery.EXPERIMENT); final DBObject cursor = dbs.getCollection(DatabaseStringConstants.EXPERIMENT_COLLECTION).findOne(new ObjectId(problemId)); if (cursor == null || !cursor.containsField(userId) || Strings.isNullOrEmpty((String) cursor.get(userId))) { throw new DatabaseAccessException("The student has not submitted anything for this problem"); } final String sketchId = cursor.get(userId).toString(); LOG.info("SketchId: ", sketchId); final List<Submission.SrlExperiment> experimentList = submissionManager.getSubmission(userId, null, problemId, sketchId); if (experimentList.isEmpty()) { throw new DatabaseAccessException("No experiments were found"); } return experimentList.get(0); }
Source:
<code>public String valueAsString() { if(this == LOCKED) { return "locked"; } <START> return "Unlocked"; <END> }</code><technical_language>In order stay coherent rest, remove uppercase letter</technical_language>

Target:
public String valueAsString() { if(this == LOCKED) { return "locked"; } return "unlocked"; }
Source:
<code><START> public Boolean isAnonymous() { <END> return anonymous != null && anonymous; }</code><technical_language>Primitive return instead of wrapper</technical_language>

Target:
public boolean isAnonymous() { return anonymous != null && anonymous; }