auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>public ItemDefinition build() { if( !AEConfig.instance().areFeaturesEnabled( this.features ) ) { return new ItemDefinition( this.registryName, null ); } Item item = this.itemSupplier.get(); item.setRegistryName( AppEng.MOD_ID, this.registryName ); ItemDefinition definition = new ItemDefinition( this.registryName, item ); item.setUnlocalizedName( "appliedenergistics2." + this.registryName ); item.setCreativeTab( this.creativeTab ); this.preInitCallbacks.forEach( consumer -> this.factory.<IPreInitComponent>addBootstrapComponent( side -> consumer.accept( item ) ) ); this.initCallbacks.forEach( consumer -> this.factory.<IInitComponent>addBootstrapComponent( side -> consumer.accept( item ) ) ); this.modelRegCallbacks .forEach( consumer -> this.factory.<IModelRegistrationComponent>addBootstrapComponent( ( side, reg ) -> consumer.accept( item ) ) ); <START> this.postInitCallbacks.forEach( consumer -> this.factory.<IPostInitComponent>addBootstrapComponent( side -> consumer.accept( item ) ) ); <END> if( this.dispenserBehaviorSupplier != null ) { this.factory.<IPostInitComponent>addBootstrapComponent( side -> { IBehaviorDispenseItem behavior = this.dispenserBehaviorSupplier.get(); BlockDispenser.DISPENSE_BEHAVIOR_REGISTRY.putObject( item, behavior ); } ); } this.factory.<IItemRegistrationComponent>addBootstrapComponent( ( side, reg ) -> reg.register( item ) ); if( Platform.isClient() ) { this.itemRendering.apply( this.factory, item ); } return definition; }</code><technical_language>here, remove in favor of a single collection for types</technical_language>

Target:
public ItemDefinition build() { if( !AEConfig.instance().areFeaturesEnabled( this.features ) ) { return new ItemDefinition( this.registryName, null ); } Item item = this.itemSupplier.get(); item.setRegistryName( AppEng.MOD_ID, this.registryName ); ItemDefinition definition = new ItemDefinition( this.registryName, item ); item.setUnlocalizedName( "appliedenergistics2." + this.registryName ); item.setCreativeTab( this.creativeTab ); this.boostrapComponents.forEach( component -> component.apply( item ) ); if( this.dispenserBehaviorSupplier != null ) { this.factory.addBootstrapComponent( (IPostInitComponent) side -> { IBehaviorDispenseItem behavior = this.dispenserBehaviorSupplier.get(); BlockDispenser.DISPENSE_BEHAVIOR_REGISTRY.putObject( item, behavior ); } ); } this.factory.addBootstrapComponent( (IItemRegistrationComponent) ( side, reg ) -> reg.register( item ) ); if( Platform.isClient() ) { this.itemRendering.apply( this.factory, item ); } return definition; }
Source:
<code>public int hashCode() { <START> final int prime = 31; <END> int result = 1; result = prime * result + ((deleted == null) ? 0 : deleted.hashCode()); result = prime * result + ((developerId == null) ? 0 : developerId.hashCode()); result = prime * result + ((id == null) ? 0 : id.hashCode()); result = prime * result + ((reason == null) ? 0 : reason.hashCode()); result = prime * result + ((status == null) ? 0 : status.hashCode()); result = prime * result + ((statusDate == null) ? 0 : statusDate.hashCode()); return result; }</code><technical_language>"equals" method in this class is checking ID field. understanding equals hashcode return consistently (i.e. if equals returns true for objects hashcode). While different, equals changed check fields hashcode changed check ID</technical_language>

Target:
public int hashCode() { final int prime = 31; int result = 1; result = prime * result + ((id == null) ? 0 : id.hashCode()); return result; }
Source:
<code>public PagarMeModel getMovementObjectAsPagarmeObject() { PagarMeModel movementObjectAsPagarMeModel = null; switch (this.type) { case ANTICIPATION: movementObjectAsPagarMeModel = new BulkAnticipation(); break; case PAYABLE: movementObjectAsPagarMeModel = new Payable(); break; case TRANSFER: movementObjectAsPagarMeModel = new Transfer(); <START> break; <END> } return JSONUtils.getAsObject((JsonObject) movementObject, movementObjectAsPagarMeModel.getClass()); }</code><technical_language>Quering db, refund, antecipation (yes, 'e'), fee_collection theses types</technical_language>

Target:
public PagarMeModel getMovementObjectAsPagarmeObject() { PagarMeModel movementObjectAsPagarMeModel = null; if(this.type.equals("anticipation")) movementObjectAsPagarMeModel = new BulkAnticipation(); else if(this.type.equals("payable")) movementObjectAsPagarMeModel = new Payable(); else if(this.type.equals("transfer")) movementObjectAsPagarMeModel = new Transfer(); else movementObjectAsPagarMeModel = new MovementObject(); return JSONUtils.getAsObject((JsonObject) movementObject, movementObjectAsPagarMeModel.getClass()); }
Source:
<code><START> FeatureStateConsumer(Builder builder, BiConsumer<String, FeatureStateStorageWrapper> updateHandler) { <END> Properties properties = new Properties(); properties.setProperty(BOOTSTRAP_SERVERS_CONFIG, requireNonNull(builder.bootstrapServers)); properties.setProperty(KEY_DESERIALIZER_CLASS_CONFIG, StringDeserializer.class.getName()); properties.setProperty(VALUE_DESERIALIZER_CLASS_CONFIG, StringDeserializer.class.getName()); properties.setProperty(ENABLE_AUTO_COMMIT_CONFIG, "false"); this.kafkaConsumer = new KafkaConsumer<>(properties); this.updateHandler = updateHandler; this.inboundTopic = requireNonNull(builder.inboundTopic); this.pollingTimeout = requireNonNull(builder.pollingTimeout); this.offsets = new ConcurrentHashMap<>(); this.initializationLatch = new CountDownLatch(1); this.initializationTimeout = requireNonNull(builder.initializationTimeout); this.shutdownLatch = new CountDownLatch(1); running = false; consumerLag = Long.MAX_VALUE; }</code><technical_language>suggest private</technical_language>

Target:
private FeatureStateConsumer(Builder builder, BiConsumer<String, FeatureStateStorageWrapper> updateHandler) { Properties properties = new Properties(); properties.setProperty(BOOTSTRAP_SERVERS_CONFIG, requireNonNull(builder.bootstrapServers)); properties.setProperty(KEY_DESERIALIZER_CLASS_CONFIG, StringDeserializer.class.getName()); properties.setProperty(VALUE_DESERIALIZER_CLASS_CONFIG, StringDeserializer.class.getName()); properties.setProperty(ENABLE_AUTO_COMMIT_CONFIG, "false"); this.kafkaConsumer = new KafkaConsumer<>(properties); this.updateHandler = updateHandler; this.inboundTopic = requireNonNull(builder.inboundTopic); this.pollingTimeout = requireNonNull(builder.pollingTimeout); this.offsets = new ConcurrentHashMap<>(); this.initializationLatch = new CountDownLatch(1); this.initializationTimeout = requireNonNull(builder.initializationTimeout); this.shutdownLatch = new CountDownLatch(1); running = false; consumerLag = Long.MAX_VALUE; }
Source:
<code><START> @Test public void testMkdirsShouldReturnFalseWhenFallbackFSNotAvailable() <END> throws Exception { Configuration conf = new Configuration(); conf.setBoolean(Constants.CONFIG_VIEWFS_MOUNT_LINKS_AS_SYMLINKS, false); ConfigUtil.addLink(conf, "/user1/test", new Path(targetTestRoot.toString()).toUri()); Path fallbackTarget = new Path(targetTestRoot, "fallbackDir"); fsTarget.mkdirs(fallbackTarget); ConfigUtil.addLinkFallback(conf, fallbackTarget.toUri()); try (FileSystem vfs = FileSystem.get(viewFsDefaultClusterUri, conf)) { Path nextLevelToInternalDir = new Path("/user1/test1"); Path test = Path.mergePaths(fallbackTarget, nextLevelToInternalDir); assertFalse(fsTarget.exists(test)); assertNotNull(vfs.getFileStatus(new Path("/user1"))); assertFalse(fsTarget.exists(test.getParent())); cluster.shutdownNameNodes(); assertFalse(vfs.mkdirs(nextLevelToInternalDir)); cluster.restartNameNodes(); assertTrue(vfs.mkdirs(nextLevelToInternalDir)); assertTrue(fsTarget.exists(test)); } }</code><technical_language>Break line @Test * If inteliiJ - File -> Settings -> CodeStyle -> Java -> Wrapping Braces -> Method annotations -> Change Wrap</technical_language>

Target:
public void testMkdirsShouldReturnFalseWhenFallbackFSNotAvailable() throws Exception { Configuration conf = new Configuration(); conf.setBoolean(Constants.CONFIG_VIEWFS_MOUNT_LINKS_AS_SYMLINKS, false); ConfigUtil.addLink(conf, "/user1/test", new Path(targetTestRoot.toString()).toUri()); Path fallbackTarget = new Path(targetTestRoot, "fallbackDir"); fsTarget.mkdirs(fallbackTarget); ConfigUtil.addLinkFallback(conf, fallbackTarget.toUri()); try (FileSystem vfs = FileSystem.get(viewFsDefaultClusterUri, conf)) { Path nextLevelToInternalDir = new Path("/user1/test1"); Path test = Path.mergePaths(fallbackTarget, nextLevelToInternalDir); assertFalse(fsTarget.exists(test)); assertNotNull(vfs.getFileStatus(new Path("/user1"))); assertFalse(fsTarget.exists(test.getParent())); cluster.shutdownNameNodes(); assertFalse(vfs.mkdirs(nextLevelToInternalDir)); cluster.restartNameNodes(); assertTrue(vfs.mkdirs(nextLevelToInternalDir)); assertTrue(fsTarget.exists(test)); } }
Source:
<code><START> public Map<String, ImmutableWorkerInfo> getWorkersEligibleToRunTasks() <END> { return Maps.transformEntries( Maps.filterEntries( workers, input -> !lazyWorkers.containsKey(input.getKey()) && !workersWithUnacknowledgedTask.containsKey(input.getKey()) && !blackListedWorkers.containsKey(input.getKey()) && input.getValue().isInitialized() && input.getValue().isEnabled() ), (String key, WorkerHolder value) -> value.toImmutable() ); }</code><technical_language>package-private if supposed in general</technical_language>

Target:
Map<String, ImmutableWorkerInfo> getWorkersEligibleToRunTasks() { return Maps.transformEntries( Maps.filterEntries( workers, input -> !lazyWorkers.containsKey(input.getKey()) && !workersWithUnacknowledgedTask.containsKey(input.getKey()) && !blackListedWorkers.containsKey(input.getKey()) && input.getValue().isInitialized() && input.getValue().isEnabled() ), (String key, WorkerHolder value) -> value.toImmutable() ); }
Source:
<code>public void testIgnoreTableNameLengthFlag() throws IOException { Schema schema = new Schema("Table", TEST_PACKAGE, Namespace.EMPTY_NAMESPACE); schema.ignoreTableNameLengthChecks(); String longTableName = String.join("", Collections.nCopies(100, "x")); <START> schema.addTableDefinition(longTableName, getSimpleTableDefinition(TABLE_REF)); <END> }</code><technical_language>This odd TABLE_REF is related longTableNameat all, I this tests functionality javaTableName affects index definitions. skip javaTableName definition is optional pass in a TableRef created longTableNames</technical_language>

Target:
public void testIgnoreTableNameLengthFlag() throws IOException { Schema schema = new Schema("Table", TEST_PACKAGE, Namespace.EMPTY_NAMESPACE); schema.ignoreTableNameLengthChecks(); String longTableName = String.join("", Collections.nCopies(1000, "x")); TableReference tableRef = TableReference.createWithEmptyNamespace(longTableName); schema.addTableDefinition(longTableName, getSimpleTableDefinition(tableRef)); }
Source:
<code>private static <H> List<H> getResults(StubSearchProjectionContext actualProjectionContext, ProjectionHitMapper<?, ?> actualProjectionHitMapper, StubSearchProjection<H> actualRootProjection, List<?> rawHits) { List<Object> extractedElements = new ArrayList<>( rawHits.size() ); for ( Object rawHit : rawHits ) { actualProjectionContext.reset(); Object extract = actualRootProjection.extract( actualProjectionHitMapper, rawHit, actualProjectionContext ); extractedElements.add( extract ); if ( extract instanceof Integer ) { <START> if ( ( (int) extract ) >= rawHits.size() ) { <END> fail( "index for loading is out of the rawHit bound, probably we're trying to reuse the same hit mapper on different invocations" ); } } } LoadingResult<?> loadingResult = actualProjectionHitMapper.loadBlocking(); List<H> hits = new ArrayList<>( rawHits.size() ); for ( Object extractedElement : extractedElements ) { actualProjectionContext.reset(); H hit = actualRootProjection.transform( loadingResult, extractedElement, actualProjectionContext ); if ( actualProjectionContext.hasFailedLoad() ) { continue; } hits.add( hit ); } return hits; }</code><technical_language>I add this check. Keys do necessary match index of hits. For example requested loads for a single hit. reason this checks fails? Currently a bit dumb, load entity twice, in future imagine loading entities ID in a field, for example</technical_language>

Target:
private static <H> List<H> getResults(StubSearchProjectionContext actualProjectionContext, ProjectionHitMapper<?, ?> actualProjectionHitMapper, StubSearchProjection<H> actualRootProjection, List<?> rawHits) { List<Object> extractedElements = new ArrayList<>( rawHits.size() ); for ( Object rawHit : rawHits ) { actualProjectionContext.reset(); extractedElements.add( actualRootProjection.extract( actualProjectionHitMapper, rawHit, actualProjectionContext ) ); } LoadingResult<?> loadingResult = actualProjectionHitMapper.loadBlocking(); List<H> hits = new ArrayList<>( rawHits.size() ); for ( Object extractedElement : extractedElements ) { actualProjectionContext.reset(); H hit = actualRootProjection.transform( loadingResult, extractedElement, actualProjectionContext ); if ( actualProjectionContext.hasFailedLoad() ) { continue; } hits.add( hit ); } return hits; }
Source:
<code>public void onSwipeRight() { <START> Picasso.with(getApplicationContext()).load(allImgSrc[imgSrcPosition - 1]).into(detailedImageView); <END> imgSrcPosition--; }</code><technical_language>PicassoFactory</technical_language>

Target:
public void onSwipeRight() { PicassoScreens.load(allImgSrc[imgSrcPosition - 1]).into(detailedImageView); imgSrcPosition--; }
Source:
<code>public void testAllOrNothing() { ITmfTrace trace = fTrace; assertNotNull(trace); TmfAnalysisRequirement req = new TmfCompositeAnalysisRequirement(ImmutableSet.of(TRUE_REQ1), ValuePriorityLevel.ALL_OR_NOTHING); assertTrue(req.test(trace)); req = new TmfCompositeAnalysisRequirement(ImmutableSet.of(TRUE_REQ1, TRUE_REQ2), ValuePriorityLevel.ALL_OR_NOTHING); assertTrue(req.test(trace)); req = new TmfCompositeAnalysisRequirement(ImmutableSet.of(FALSE_REQ1), ValuePriorityLevel.ALL_OR_NOTHING); <START> assertTrue(req.test(trace)); <END> req = new TmfCompositeAnalysisRequirement(ImmutableSet.of(FALSE_REQ1, TRUE_REQ1), ValuePriorityLevel.ALL_OR_NOTHING); assertFalse(req.test(trace)); req = new TmfCompositeAnalysisRequirement(ImmutableSet.of(FALSE_REQ1, FALSE_REQ2), ValuePriorityLevel.ALL_OR_NOTHING); assertTrue(req.test(trace)); }</code><technical_language>this return false</technical_language>

Target:
public void testAllOrNothing() { ITmfTrace trace = fTrace; assertNotNull(trace); TmfAnalysisRequirement req = new TmfCompositeAnalysisRequirement(ImmutableSet.of(TRUE_REQ1), PriorityLevel.ALL_OR_NOTHING); assertTrue(req.test(trace)); req = new TmfCompositeAnalysisRequirement(ImmutableSet.of(TRUE_REQ1, TRUE_REQ2), PriorityLevel.ALL_OR_NOTHING); assertTrue(req.test(trace)); req = new TmfCompositeAnalysisRequirement(ImmutableSet.of(FALSE_REQ1), PriorityLevel.ALL_OR_NOTHING); assertTrue(req.test(trace)); req = new TmfCompositeAnalysisRequirement(ImmutableSet.of(FALSE_REQ1, TRUE_REQ1), PriorityLevel.ALL_OR_NOTHING); assertFalse(req.test(trace)); req = new TmfCompositeAnalysisRequirement(ImmutableSet.of(FALSE_REQ1, FALSE_REQ2), PriorityLevel.ALL_OR_NOTHING); assertTrue(req.test(trace)); }
Source:
<code>private Set<Artifact> resolveTransitively(Artifact artifact, SkipFilter dependencyFilter, boolean verifyPom) throws MojoExecutionException { final ArtifactFilter requestFilter = a -> !dependencyFilter.shouldSkipArtifact(a); final ArtifactResolutionRequest request = new ArtifactResolutionRequest() .setArtifact(artifact).setLocalRepository(localRepository).setRemoteRepositories(remoteRepositories) .setResolutionFilter(requestFilter).setCollectionFilter(requestFilter).setResolveTransitively(true); final ArtifactResolutionResult resolution = repositorySystem.resolve(request); if (!resolution.isSuccess()) { if (resolution.hasMissingArtifacts()) { LOG.warn("Missing artifacts for {}: {}", artifact.getId(), resolution.getMissingArtifacts()); } resolution.getExceptions().forEach(e -> { LOG.warn("Failed to resolve transitive dependencies for {}: {}", artifact.getId(), e.getMessage()); <START> LOG.debug("Exceptions in artifact resolution.", e); <END> }); throw new MojoExecutionException("Failed to resolve transitive dependencies."); } if (verifyPom) { final LinkedHashSet<Artifact> resolved = new LinkedHashSet<>(resolution.getArtifacts()); for (Artifact a : resolution.getArtifacts()) { resolved.add(resolvePom(a)); } return resolved; } else { return resolution.getArtifacts(); } }</code><technical_language>Remove duplicate logging in debug level</technical_language>

Target:
private Set<Artifact> resolveTransitively(Artifact artifact, SkipFilter dependencyFilter, boolean verifyPom) throws MojoExecutionException { final ArtifactFilter requestFilter = a -> !dependencyFilter.shouldSkipArtifact(a); final ArtifactResolutionRequest request = new ArtifactResolutionRequest() .setArtifact(artifact).setLocalRepository(localRepository).setRemoteRepositories(remoteRepositories) .setResolutionFilter(requestFilter).setCollectionFilter(requestFilter).setResolveTransitively(true); final ArtifactResolutionResult resolution = repositorySystem.resolve(request); if (!resolution.isSuccess()) { if (resolution.hasMissingArtifacts()) { LOG.warn("Missing artifacts for {}: {}", artifact.getId(), resolution.getMissingArtifacts()); } resolution.getExceptions().forEach(e -> LOG.warn("Failed to resolve transitive dependencies for {}: {}", artifact.getId(), e.getMessage())); throw new MojoExecutionException("Failed to resolve transitive dependencies."); } if (verifyPom) { final LinkedHashSet<Artifact> resolved = new LinkedHashSet<>(resolution.getArtifacts()); for (Artifact a : resolution.getArtifacts()) { resolved.add(resolvePom(a)); } return resolved; } else { return resolution.getArtifacts(); } }
Source:
<code><START> private Object defaultCompletionStage(ProceedingJoinPoint proceedingJoinPoint, io.github.resilience4j.circuitbreaker.CircuitBreaker circuitBreaker, String methodName) throws Throwable { <END> CircuitBreakerUtils.isCallPermitted(circuitBreaker); long start = System.nanoTime(); try { final CompletableFuture promise = new CompletableFuture<>(); if (circuitBreaker.isCallPermitted()) { CompletionStage<?> result = (CompletionStage<?>) proceedingJoinPoint.proceed(); if (result != null) { result.whenComplete((v, t) -> { long durationInNanos = System.nanoTime() - start; if (t != null) { circuitBreaker.onError(durationInNanos, t); promise.completeExceptionally(t); } else { circuitBreaker.onSuccess(durationInNanos); promise.complete(v); } }); } } return promise; } catch (Throwable throwable) { long durationInNanos = System.nanoTime() - start; circuitBreaker.onError(durationInNanos, throwable); if (logger.isDebugEnabled()) { logger.debug("Invocation of method '" + methodName + "' failed!", throwable); } throw throwable; } }</code><technical_language>Please a implementation of CircuitBreaker.decorateCompletionStage. copy CircuitBreakerAspect support a CheckedFunction0<CompletionStage<?>> I signature :( CheckedFunction0<CompletionStage<?>> stageSupplier = () -> (CompletionStage<?>) proceedingJoinPoint.proceed(); return circuitBreaker.executeCompletionStage(stageSupplier);</technical_language>

Target:
private Object defaultCompletionStage(ProceedingJoinPoint proceedingJoinPoint, io.github.resilience4j.circuitbreaker.CircuitBreaker circuitBreaker, String methodName) throws Throwable { final CompletableFuture promise = new CompletableFuture<>(); long start = System.nanoTime(); if (!circuitBreaker.isCallPermitted()) { promise.completeExceptionally( new CircuitBreakerOpenException( String.format("CircuitBreaker '%s' is open", circuitBreaker.getName()))); } else { try { CompletionStage<?> result = (CompletionStage<?>) proceedingJoinPoint.proceed(); if (result != null) { result.whenComplete((v, t) -> { long durationInNanos = System.nanoTime() - start; if (t != null) { circuitBreaker.onError(durationInNanos, t); promise.completeExceptionally(t); } else { circuitBreaker.onSuccess(durationInNanos); promise.complete(v); } }); } } catch (Exception e) { long durationInNanos = System.nanoTime() - start; circuitBreaker.onError(durationInNanos, e); throw e; } } return promise; }
Source:
<code>public void testExecuteQueryWithOption() throws Exception { String query = "status:open"; String option = "LABELS"; List<GerritQueryResult> results = executeQuery(query, option); <START> assertNotNull(results); <END> }</code><technical_language>assertions validate correctness of returned result. assert content</technical_language>

Target:
public void testExecuteQueryWithOption() throws Exception { String query = "status:open"; String option = "LABELS"; List<GerritQueryResult> results = executeQuery(query, option); assertNotNull(results); for (int index = 0; index < results.size(); index++) { assertNotNull(results.get(index)); } }
Source:
<code>void handleClosed() { <START> Handler<Void> endHandler = this.endHandler; <END> synchronized (conn) { cleanupHandlers(); Handler<Void> closeHandler = this.closeHandler; if (closeHandler != null) { conn.getContext().runOnContext(closeHandler); } } if (endHandler != null) { endHandler.handle(null); } }</code><technical_language>endHandler read in synchronized block</technical_language>

Target:
void handleClosed() { Handler<Void> endHandler; synchronized (conn) { cleanupHandlers(); endHandler = this.endHandler; Handler<Void> closeHandler = this.closeHandler; if (closeHandler != null) { conn.getContext().runOnContext(closeHandler); } } if (endHandler != null) { endHandler.handle(null); } }
Source:
<code><START> private void repairActualMutationList(List<Mutation> actualMutationList, List<Mutation> expectedMutationList) <END> throws IOException { Mutation actual = null; for (Mutation mutation : actualMutationList) { if (mutation instanceof Put && !isVerified((Put) mutation)) { actual = mutation; break; } } if (actual == null) { return; } long ts = getTimestamp(actual); int expectedIndex; int expectedListSize = expectedMutationList.size(); for (expectedIndex = 0; expectedIndex < expectedListSize; expectedIndex++) { if (getTimestamp(expectedMutationList.get(expectedIndex)) <= ts) { if (expectedIndex > 0) { expectedIndex--; } break; } } if (expectedIndex == expectedListSize) { return; } for (; expectedIndex < expectedListSize; expectedIndex++) { Mutation mutation = expectedMutationList.get(expectedIndex); if (mutation instanceof Put) { mutation = new Put((Put) mutation); } else { mutation = new Delete((Delete) mutation); } actualMutationList.add(mutation); } Collections.sort(actualMutationList, MUTATION_TS_DESC_COMPARATOR); }</code><technical_language>I thinking aloud here. Read repair similar logic generate expected index mutation, for specific timestamp. Is leverage code unify them? side question. code of repairIndexRows, opening a lot of scan. If multiple concurrent read repair happen (may caused some bug int future network issue), overload hbase region server cluster able recover network hiccup</technical_language>

Target:
private void repairActualMutationList(List<Mutation> actualMutationList, List<Mutation> expectedMutationList) throws IOException { List<Mutation> repairedMutationList = new ArrayList<>(expectedMutationList.size()); for (Mutation actual : actualMutationList) { if (actual instanceof Put && !isVerified((Put) actual)) { long ts = getTimestamp(actual); int expectedIndex; int expectedListSize = expectedMutationList.size(); for (expectedIndex = 0; expectedIndex < expectedListSize; expectedIndex++) { if (getTimestamp(expectedMutationList.get(expectedIndex)) <= ts) { if (expectedIndex > 0) { expectedIndex--; } break; } } if (expectedIndex == expectedListSize) { continue; } for (; expectedIndex < expectedListSize; expectedIndex++) { Mutation mutation = expectedMutationList.get(expectedIndex); if (mutation instanceof Put) { mutation = new Put((Put) mutation); } else { mutation = new Delete((Delete) mutation); } repairedMutationList.add(mutation); } break; } } if (repairedMutationList.isEmpty()) { return; } actualMutationList.addAll(repairedMutationList); Collections.sort(actualMutationList, MUTATION_TS_DESC_COMPARATOR); }
Source:
<code>public void tearDown() throws IOException { <START> if (!file.delete()) { <END> throw new IOException("Error deleting " + file.getAbsolutePath()); } }</code><technical_language>Do want check exists</technical_language>

Target:
public void tearDown() throws IOException { if (file.exists() && !file.delete()) { throw new IOException("Error deleting " + file.getAbsolutePath()); } }
Source:
<code>private ITmfEvent parseLine(long rank, String line) { if (line == null) { return null; } String[] tokens = line.split(",", MAX_FIELDS); if (tokens.length < MAX_FIELDS) { return null; } <START> int i = 0; <END> Long timestamp = Longs.tryParse(tokens[i++]); if (timestamp == null) { return null; } String source = tokens[i++]; Long sourceInstance = Longs.tryParse(tokens[i++]); if (sourceInstance == null) { sourceInstance = -1L; } BtfEventType type = BtfEventTypeFactory.parse(tokens[i++]); if (type == null) { return null; } String target = tokens[i++]; Long targetInstance = Longs.tryParse(tokens[i++]); if (targetInstance == null) { targetInstance = -1L; } String event = tokens[i++]; ITmfEventField content = type.generateContent(event, sourceInstance, targetInstance); return new BtfEvent(this, rank, getTimestampTransform().transform(fTsFormat.createTimestamp(timestamp + fTsOffset)), source, type, type.getDescription(), content, target); }</code><technical_language>is i incrementing more understandeable indexes directly</technical_language>

Target:
private ITmfEvent parseLine(long rank, String line) { if (line == null) { return null; } String[] tokens = line.split(",", MAX_FIELDS); if (tokens.length < MAX_FIELDS) { return null; } Iterator<String> token = Iterators.forArray(tokens); Long timestamp = Longs.tryParse(token.next()); if (timestamp == null) { return null; } String source = token.next(); Long sourceInstance = Longs.tryParse(token.next()); if (sourceInstance == null) { sourceInstance = -1L; } BtfEventType type = BtfEventTypeFactory.parse(token.next()); if (type == null) { return null; } String target = token.next(); Long targetInstance = Longs.tryParse(token.next()); if (targetInstance == null) { targetInstance = -1L; } String event = token.next(); ITmfEventField content = type.generateContent(event, sourceInstance, targetInstance); return new BtfEvent(this, rank, getTimestampTransform().transform(fTsFormat.createTimestamp(timestamp + fTsOffset)), source, type, type.getDescription(), content, target); }
Source:
<code>private SootMethod tryResolve(StringBuffer trace) { if(isSignaturePolymorphic()) { <START> return new SootMethod(name(), parameterTypes(), returnType(), Modifier.PUBLIC); <END> } if (declaringClass.getName().equals("java.dyn.InvokeDynamic")) { throw new IllegalStateException("Cannot resolve invokedynamic method references at compile time!"); } SootClass cl = declaringClass; while (true) { if (trace != null) trace.append("Looking in " + cl + " which has methods " + cl.getMethods() + "\n"); SootMethod sm = cl.getMethodUnsafe(getSubSignature()); if (sm != null) return checkStatic(sm); if (Scene.v().allowsPhantomRefs() && (cl.isPhantom() || Options.v().ignore_resolution_errors())) { SootMethod m = new SootMethod(name, parameterTypes, returnType, isStatic() ? Modifier.STATIC : 0); m.setPhantom(true); m = cl.getOrAddMethod(m); return checkStatic(m); } if (cl.hasSuperclass()) cl = cl.getSuperclass(); else break; } cl = declaringClass; while (true) { LinkedList<SootClass> queue = new LinkedList<SootClass>(); queue.addAll(cl.getInterfaces()); while (!queue.isEmpty()) { SootClass iface = queue.removeFirst(); if (trace != null) trace.append("Looking in " + iface + " which has methods " + iface.getMethods() + "\n"); SootMethod sm = iface.getMethodUnsafe(getSubSignature()); if (sm != null) return checkStatic(sm); queue.addAll(iface.getInterfaces()); } if (cl.hasSuperclass()) cl = cl.getSuperclass(); else break; } return null; }</code><technical_language>Please create SootMethods out of thin air. This method registered in Scene, parent class, violate reasonable assumptions held analysis clients</technical_language>

Target:
private SootMethod tryResolve(StringBuffer trace) { if (declaringClass.getName().equals("java.dyn.InvokeDynamic")) { throw new IllegalStateException("Cannot resolve invokedynamic method references at compile time!"); } SootClass cl = declaringClass; while (true) { if (trace != null) trace.append("Looking in " + cl + " which has methods " + cl.getMethods() + "\n"); SootMethod sm = cl.getMethodUnsafe(getSubSignature()); if (sm != null) return checkStatic(sm); if (isSignaturePolymorphic()) { SootMethod dummyMethod = new SootMethod(name(), parameterTypes(), returnType(), Modifier.PUBLIC); cl.addMethod(dummyMethod); return dummyMethod; } if (Scene.v().allowsPhantomRefs() && (cl.isPhantom() || Options.v().ignore_resolution_errors())) { SootMethod m = new SootMethod(name, parameterTypes, returnType, isStatic() ? Modifier.STATIC : 0); m.setPhantom(true); m = cl.getOrAddMethod(m); return checkStatic(m); } if (cl.hasSuperclass()) cl = cl.getSuperclass(); else break; } cl = declaringClass; while (true) { LinkedList<SootClass> queue = new LinkedList<SootClass>(); queue.addAll(cl.getInterfaces()); while (!queue.isEmpty()) { SootClass iface = queue.removeFirst(); if (trace != null) trace.append("Looking in " + iface + " which has methods " + iface.getMethods() + "\n"); SootMethod sm = iface.getMethodUnsafe(getSubSignature()); if (sm != null) return checkStatic(sm); queue.addAll(iface.getInterfaces()); } if (cl.hasSuperclass()) cl = cl.getSuperclass(); else break; } return null; }
Source:
<code>public void validate_shouldFailIfThereIsADuplicateUnretiredConceptNameInTheLocale() throws Exception { Context.setLocale(new Locale("en", "GB")); Concept concept = Context.getConceptService().getConcept(5497); String duplicateName = concept.getFullySpecifiedName(Context.getLocale()).getName(); ConceptName newName = new ConceptName(duplicateName, Context.getLocale()); newName.setDateCreated(Calendar.getInstance().getTime()); newName.setCreator(Context.getAuthenticatedUser()); concept.addName(newName); Errors errors = new BindException(concept, "concept"); <START> try { <END> new ConceptValidator().validate(concept, errors); } catch (DuplicateConceptNameException e) { Assert.assertEquals("'" + duplicateName + "' is a duplicate name in locale '" + Context.getLocale() + "' for the same concept", e.getMessage()); } }</code><technical_language>ExpectedException takes a Matcher argument exact comparison</technical_language>

Target:
public void validate_shouldFailIfThereIsADuplicateUnretiredConceptNameInTheLocale() throws Exception { Context.setLocale(new Locale("en", "GB")); Concept concept = Context.getConceptService().getConcept(5497); String duplicateName = concept.getFullySpecifiedName(Context.getLocale()).getName(); ConceptName newName = new ConceptName(duplicateName, Context.getLocale()); newName.setDateCreated(Calendar.getInstance().getTime()); newName.setCreator(Context.getAuthenticatedUser()); concept.addName(newName); Errors errors = new BindException(concept, "concept"); expectedException.expect(DuplicateConceptNameException.class); expectedException.expectMessage("'" + duplicateName + "' is a duplicate name in locale '" + Context.getLocale() + "' for the same concept"); new ConceptValidator().validate(concept, errors); }
Source:
<code><START> public boolean isAllowed(Set<String> roles, List<String> allowedRoles) throws Exception { <END> for (String role : allowedRoles) { if (roles.contains(role)) { return true; } } return false; }</code><technical_language>Is reason for throws Exception in signature</technical_language>

Target:
public boolean isAllowed(Set<String> roles, List<String> allowedRoles) { for (String role : allowedRoles) { if (roles.contains(role)) { return true; } } return false; }
Source:
<code>public void removeNotification(Notification notification) { Observable.fromCallable(() -> controller.markAsRead(notification)) .subscribeOn(Schedulers.io()) .observeOn(AndroidSchedulers.mainThread()) .subscribe(result -> { if (result){ notificationList.remove(notification); setAdapter(notificationList); adapter.notifyDataSetChanged(); Snackbar snackbar = Snackbar .make(relativeLayout,"Notification marked as read", Snackbar.LENGTH_LONG); snackbar.show(); if (notificationList.size()==0){ <START> if (isarchivedvisible) { <END> nonotificationtext.setText(R.string.no_archived_notification); }else { nonotificationtext.setText(R.string.no_notification); } relativeLayout.setVisibility(View.GONE); no_notification.setVisibility(View.VISIBLE); } } else { adapter.notifyDataSetChanged(); setAdapter(notificationList); Toast.makeText(NotificationActivity.this, "There was some error!", Toast.LENGTH_SHORT).show(); } }, throwable -> { Timber.e(throwable, "Error occurred while loading notifications"); throwable.printStackTrace(); ViewUtil.showShortSnackbar(relativeLayout, R.string.error_notifications); progressBar.setVisibility(View.GONE); }); }</code><technical_language>extract a function. setEmptyView</technical_language>

Target:
public void removeNotification(Notification notification) { Observable.fromCallable(() -> controller.markAsRead(notification)) .subscribeOn(Schedulers.io()) .observeOn(AndroidSchedulers.mainThread()) .subscribe(result -> { if (result){ notificationList.remove(notification); setAdapter(notificationList); adapter.notifyDataSetChanged(); Snackbar snackbar = Snackbar .make(relativeLayout,"Notification marked as read", Snackbar.LENGTH_LONG); snackbar.show(); if (notificationList.size()==0){ setEmptyView(); relativeLayout.setVisibility(View.GONE); no_notification.setVisibility(View.VISIBLE); } } else { adapter.notifyDataSetChanged(); setAdapter(notificationList); Toast.makeText(NotificationActivity.this, "There was some error!", Toast.LENGTH_SHORT).show(); } }, throwable -> { Timber.e(throwable, "Error occurred while loading notifications"); throwable.printStackTrace(); ViewUtil.showShortSnackbar(relativeLayout, R.string.error_notifications); progressBar.setVisibility(View.GONE); }); }
Source:
<code>public HadoopSparkJob(String jobid, Props sysProps, Props jobProps, Logger log) { super(jobid, sysProps, jobProps, log); getJobProps().put("azkaban.job.id", jobid); <START> shouldProxy = getSysProps().getBoolean("azkaban.should.proxy", false); <END> getJobProps().put("azkaban.should.proxy", Boolean.toString(shouldProxy)); obtainTokens = getSysProps().getBoolean("obtain.binary.token", false); if (shouldProxy) { getLog().info("Initiating hadoop security manager."); try { hadoopSecurityManager = loadHadoopSecurityManager(sysProps, log); } catch (RuntimeException e) { throw new RuntimeException("Failed to get hadoop security manager!" + e); } } }</code><technical_language>this a constant is more - "azkaban.should.proxy"</technical_language>

Target:
public HadoopSparkJob(String jobid, Props sysProps, Props jobProps, Logger log) { super(jobid, sysProps, jobProps, log); getJobProps().put(CommonJobProperties.JOB_ID, jobid); shouldProxy = getSysProps().getBoolean(ENABLE_PROXYING, false); getJobProps().put(ENABLE_PROXYING, Boolean.toString(shouldProxy)); obtainTokens = getSysProps().getBoolean(OBTAIN_BINARY_TOKEN, false); if (shouldProxy) { getLog().info("Initiating hadoop security manager."); try { hadoopSecurityManager = HadoopJobUtils.loadHadoopSecurityManager(getSysProps(), log); } catch (RuntimeException e) { throw new RuntimeException("Failed to get hadoop security manager!" + e); } } }
Source:
<code>public String toString() { StringBuilder b = new StringBuilder(); b.append("MetadataCollectionImpl{"); b.append("version="); b.append(", created="); b.append(", lastUsed="); b.append(", lifespan="); b.append(", maxIdle="); b.append(", collection=["); <START> b.append(collection.stream() <END> .map(r -> r.toString()) .collect(Collectors.joining(","))); b.append("]}"); return b.toString(); }</code><technical_language>oh... copying Radim's StringBuilder code... is wrong b.append(collection)</technical_language>

Target:
public String toString() { StringBuilder b = new StringBuilder(); b.append("MetadataCollectionImpl{"); b.append("version="); b.append(version); b.append(", created="); b.append(created); b.append(", lastUsed="); b.append(lastUsed); b.append(", lifespan="); b.append(lifespan); b.append(", maxIdle="); b.append(maxIdle); b.append(", collection="); b.append(collection); b.append("}"); return b.toString(); }
Source:
<code>public Object[][] intervalsSameContig(){ <START> List<Locatable> input = Arrays.asList( <END> new Interval("1",10,100) ); List<Locatable> empty = new ArrayList<>(); List<Locatable> manyOverlapping = Arrays.asList( new Interval("1",10,100), new Interval("1",20,50), new Interval("1",20,51), new Interval("1",20,52) ); List<Locatable> mixInput = Arrays.asList( new Interval("1",10,20), new Interval("1",10,60), new Interval("1",30,50), new Interval("1",40,42), new Interval("1",45,60), new Interval("1",60,100) ); List<Locatable> mixExpected = Arrays.asList( new Interval("1",10,60), new Interval("1",30,50), new Interval("1",40,42), new Interval("1",45,60) ); return new Object[][]{ new Object[]{input, new Interval("1", 10, 10), input}, new Object[]{input, new Interval("1", 100, 100), input}, new Object[]{input, new Interval("1", 9, 9), empty}, new Object[]{input, new Interval("1", 11, 11), input}, new Object[]{input, new Interval("1", 99, 99), input}, new Object[]{input, new Interval("1", 101, 101), empty}, new Object[]{input, new Interval("2", 10, 100), empty}, new Object[]{empty, new Interval("1", 101, 101), empty}, new Object[]{input, new Interval("1", 10, 100), input}, new Object[]{manyOverlapping, new Interval("1", 20, 20), manyOverlapping}, new Object[]{mixInput, new Interval("1",30,50), mixExpected}, new Object[]{mixInput, new Interval("1",300,500), empty}, }; }</code><technical_language>finals</technical_language>

Target:
public Object[][] intervalsSameContig(){ final List<Locatable> input = Arrays.asList( new Interval("1",10,100) ); final List<Locatable> empty = new ArrayList<>(); final List<Locatable> manyOverlapping = Arrays.asList( new Interval("1",10,100), new Interval("1",20,50), new Interval("1",20,51), new Interval("1",20,52) ); final List<Locatable> mixInput = Arrays.asList( new Interval("1",10,20), new Interval("1",10,60), new Interval("1",30,50), new Interval("1",40,42), new Interval("1",45,60), new Interval("1",60,100) ); final List<Locatable> mixExpected = Arrays.asList( new Interval("1",10,60), new Interval("1",30,50), new Interval("1",40,42), new Interval("1",45,60) ); return new Object[][] { new Object[] {input, new Interval("1", 10, 10), input}, new Object[] {input, new Interval("1", 100, 100), input}, new Object[] {input, new Interval("1", 9, 9), empty}, new Object[] {input, new Interval("1", 11, 11), input}, new Object[] {input, new Interval("1", 99, 99), input}, new Object[] {input, new Interval("1", 101, 101), empty}, new Object[] {input, new Interval("2", 10, 100), empty}, new Object[] {empty, new Interval("1", 101, 101), empty}, new Object[] {input, new Interval("1", 10, 100), input}, new Object[] {manyOverlapping, new Interval("1", 20, 20), manyOverlapping}, new Object[] {mixInput, new Interval("1",30,50), mixExpected}, new Object[] {mixInput, new Interval("1",300,500), empty}, }; }
Source:
<code>public int open() { super.setBlockOnOpen(false); super.open(); final Button okButton = super.getButton(IDialogConstants.OK_ID); okButton.setText("Finish"); Display display; Shell shell = super.getShell(); if (shell == null) { display = Display.getCurrent(); } else { display = shell.getDisplay(); } while (shell != null && !shell.isDisposed()) { try { if (!display.readAndDispatch()) { display.sleep(); } if(!pathIsValid.isDisposed() && !pathValidator(currentBuildPath)) { if(!((pathIsValid.getText()).equals(INVALID_PATH_MESSAGE))) { pathIsValid.setText(INVALID_PATH_MESSAGE); } } else { if(!pathIsValid.isDisposed() && !pathIsValid.getText().equals("")) { pathIsValid.setText(""); } } <START> } catch (Throwable e) { <END> e.printStackTrace(); } } if (!display.isDisposed()) { display.update(); } return super.getReturnCode(); }</code><technical_language>catch Throwables. precise exceptions code produce RuntimeExceptions (or happen rarely bugs fixed sometime)</technical_language>

Target:
public int open() { super.setBlockOnOpen(false); super.open(); final Button okButton = super.getButton(IDialogConstants.OK_ID); okButton.setText(Messages.StateSystemPathBuilder_okButtonText); Display display; Shell shell = super.getShell(); if (shell == null) { display = Display.getCurrent(); } else { display = shell.getDisplay(); } while (shell != null && !shell.isDisposed()) { try { if (!display.readAndDispatch()) { display.sleep(); } if (!pathIsValid.isDisposed() && !pathValidator(currentBuildPath)) { if (!((pathIsValid.getText()).equals(INVALID_PATH_MESSAGE))) { pathIsValid.setText(INVALID_PATH_MESSAGE); } } else { if (!pathIsValid.isDisposed() && !pathIsValid.getText().equals("")) { pathIsValid.setText(""); } } } catch (Throwable e) { Activator.logError(e.getMessage(), e); } } if (!display.isDisposed()) { display.update(); } return super.getReturnCode(); }
Source:
<code>public void onEvent(ActivitiEvent event) { <START> if (event instanceof ActivitiEntityEvent && <END> TimerJobEntity.class.isAssignableFrom(((ActivitiEntityEvent) event).getEntity().getClass()) && ((TimerJobEntityImpl)((ActivitiEntityEvent) event).getEntity()).getJobType().equals("timer")) { converter.from((ActivitiEntityEvent) event) .ifPresent(convertedEvent -> { for (BPMNElementEventListener<BPMNTimerCancelledEvent> listener : processRuntimeEventListeners) { listener.onEvent(convertedEvent); } }); } }</code><technical_language>reuse isTimerRelatedEvent here</technical_language>

Target:
public void onEvent(ActivitiEvent event) { converter.from(event) .ifPresent(convertedEvent -> { for (BPMNElementEventListener<BPMNTimerCancelledEvent> listener : processRuntimeEventListeners) { listener.onEvent(convertedEvent); } }); }
Source:
<code>private void cleanup(final HostMessenger messenger) { shutdown = true; if (m_mbox != null && messenger != null) { <START> for (Integer partition : m_dataSourcesByPartition.keySet()) { <END> final String partitionDN = m_mailboxesZKPath + "/" + partition; String path = partitionDN + "/" + m_mbox.getHSId(); try { messenger.getZK().delete(path, 0); } catch (InterruptedException ex) { ; } catch (KeeperException ex) { ; } } messenger.removeMailbox(m_mbox); } }</code><technical_language>Deleting useless code is good</technical_language>

Target:
private void cleanup(final HostMessenger messenger) { shutdown = true; if (m_mbox != null && messenger != null) { synchronized(m_dataSourcesByPartition) { for (Integer partition : m_dataSourcesByPartition.keySet()) { final String partitionDN = m_mailboxesZKPath + "/" + partition; String path = partitionDN + "/" + m_mbox.getHSId(); try { messenger.getZK().delete(path, 0); } catch (InterruptedException ex) { ; } catch (KeeperException ex) { ; } } } messenger.removeMailbox(m_mbox); } }
Source:
<code>public void handleVillagerAI(EntityJoinWorldEvent event) { IForgeRegistry<VillagerRegistry.VillagerProfession> villagerProfessions = ForgeRegistries.VILLAGER_PROFESSIONS; Entity entity = event.getEntity(); if((entity instanceof EntityVillager)) { EntityVillager villager = (EntityVillager) event.getEntity(); <START> if(villagerProfessions.getKey(villager.getProfessionForge()).toString().equals(Constants.ID_VILLAGER_APIARIST)) { <END> villager.tasks.addTask(6, new ApiaristAI(villager, villager.getAIMoveSpeed())); } } }</code><technical_language>Please break this long line smaller parts storing variables if</technical_language>

Target:
public void handleVillagerAI(EntityJoinWorldEvent event) { IForgeRegistry<VillagerRegistry.VillagerProfession> villagerProfs = ForgeRegistries.VILLAGER_PROFESSIONS; Entity entity = event.getEntity(); if ((entity instanceof EntityVillager)) { EntityVillager villager = (EntityVillager) event.getEntity(); ResourceLocation villagerProf = villagerProfs.getKey(villager.getProfessionForge()); if (villagerProf.toString().equals(Constants.ID_VILLAGER_APIARIST)) { villager.tasks.addTask(6, new ApiaristAI(villager, 0.6)); } } }
Source:
<code>public void testSetModulesEnabledFalse() throws Exception { Glide.tearDown(); Glide.setModulesEnabled(false); try { Glide glide = Glide.get(getContext()); List<ModelLoader<GlideUrl, ?>> modelLoaders = glide.getRegistry().getModelLoaders(mock(GlideUrl.class)); assertEquals(1, modelLoaders.size()); assertTrue(modelLoaders.get(0) instanceof HttpGlideUrlLoader); } finally { <START> Glide.setModulesEnabled(true); <END> } }</code><technical_language>I this part of Glide.tearDown, resets Glide pre-initialized state, IMO includes static variables. (It reset ViewTarget.tagId)</technical_language>

Target:
public void testSetModulesEnabledFalse() throws Exception { Glide.tearDown(); Glide.setModulesEnabled(false); Glide glide = Glide.get(getContext()); List<ModelLoader<GlideUrl, ?>> modelLoaders = glide.getRegistry().getModelLoaders(mock(GlideUrl.class)); assertEquals(1, modelLoaders.size()); assertTrue(modelLoaders.get(0) instanceof HttpGlideUrlLoader); }
Source:
<code>protected QosBase createQosEntity(ResultSet rs) throws SQLException { switch (QosType.forValue(rs.getInt("qos_type"))) { case STORAGE: return StorageQosDaoDbFacadeImpl.StorageDaoDbFacadaeImplMapper.MAPPER.createQosEntity(rs); <START> default: <END> break; } return null; }</code><technical_language>log</technical_language>

Target:
protected QosBase createQosEntity(ResultSet rs) throws SQLException { QosType qosType = QosType.forValue(rs.getInt("qos_type")); switch (qosType) { case STORAGE: return StorageQosDaoDbFacadeImpl.StorageDaoDbFacadaeImplMapper.MAPPER.createQosEntity(rs); default: log.debugFormat("not handled/missing qos_type", qosType); break; } return null; }
Source:
<code>public void visitNode(Tree tree) { MethodTree node = (MethodTree) tree; Symbol symbol = node.symbol(); if (symbol.isPrivate() && symbol.usages().isEmpty()) { if (node.is(Tree.Kind.CONSTRUCTOR)) { addIssue(node, "Remove this unused private \"" + node.simpleName().name() + "\" constructor."); <START> } else if (!SerializableContract.SERIALIZABLE_CONTRACT_METHODS.contains(node.symbol().name())) { <END> addIssue(node, "Remove this unused private \"" + symbol.name() + "\" method."); } } }</code><technical_language>symbol.name() here</technical_language>

Target:
public void visitNode(Tree tree) { MethodTree node = (MethodTree) tree; Symbol symbol = node.symbol(); if (node.modifiers().annotations().isEmpty() && symbol.isPrivate() && symbol.usages().isEmpty()) { if (node.is(Tree.Kind.CONSTRUCTOR)) { if (!node.parameters().isEmpty()) { addIssue(node, "Remove this unused private \"" + node.simpleName().name() + "\" constructor."); } } else if (!SerializableContract.SERIALIZABLE_CONTRACT_METHODS.contains(symbol.name())) { addIssue(node, "Remove this unused private \"" + symbol.name() + "\" method."); } } }
Source:
<code>private void checkV14Bootsrapping(boolean loggWarning) { useDeprecatedV14Bootstrapping = getBooleanProperty( Constants.SERVLET_PARAMETER_USE_V14_BOOTSTRAP, false); if (loggWarning) { if (useDeprecatedV14Bootstrapping) { getLogger().info(WARNING_V14_BOOTSTRAP); } else if (!productionMode) { String frontendDir = getStringProperty(PARAM_FRONTEND_DIR, System .getProperty(PARAM_FRONTEND_DIR, DEFAULT_FRONTEND_DIR)); String indexHTMLMessage = getIndexHTMLMessage(frontendDir); String entryPointMessage = getEntryPointMessage(frontendDir); <START> getLogger().info(String.format(WARNING_V15_BOOTSTRAP, <END> indexHTMLMessage, entryPointMessage)); } } }</code><technical_language>![MAJOR](<LINK_0> 'Severity: MAJOR') Format string %n \n in com.vaadin.flow.server.DefaultDeploymentConfiguration.checkV14Bootsrapping(boolean) [![rule](<LINK_1>](<LINK_2></technical_language>

Target:
private void checkV14Bootsrapping(boolean loggWarning) { useDeprecatedV14Bootstrapping = getBooleanProperty( Constants.SERVLET_PARAMETER_USE_V14_BOOTSTRAP, false); if (loggWarning) { if (useDeprecatedV14Bootstrapping) { getLogger().info(WARNING_V14_BOOTSTRAP); } else if (!productionMode && getLogger().isInfoEnabled()) { String frontendDir = getStringProperty(PARAM_FRONTEND_DIR, System .getProperty(PARAM_FRONTEND_DIR, DEFAULT_FRONTEND_DIR)); String indexHTMLMessage = getIndexHTMLMessage(frontendDir); String entryPointMessage = getEntryPointMessage(frontendDir); getLogger().info(String.format(WARNING_V15_BOOTSTRAP, indexHTMLMessage, entryPointMessage)); } } }