Sample

int-f916255bca1a-I01

Remove line comments, block comments, and Javadoc

Matched original source

Lines31

Scores

MethodScoreScale
Posnett0.0010–1; higher is more readable
Scalabrino0.5490–1; higher is more readable
Dorn0.6620–1; higher is more readable
Mi0.3950–1; higher is more readable
LLOC5Logical lines; fewer is more readable
DeepSeek V4 Pro18.670–20; mean of three runs
GPT-6.1 Sol180–20; mean of three runs
BTTF0.5750–1; higher is more readable

Views

Source code

package com.google.common.cache; import static com.google.common.base.Preconditions.checkNotNull; import com.google.common.annotations.GwtIncompatible; import java.util.concurrent.Executor; @GwtIncompatible public final class RemovalListeners { private RemovalListeners() {} public static <K, V> RemovalListener<K, V> asynchronous( RemovalListener<K, V> listener, Executor executor) { checkNotNull(listener); checkNotNull(executor); return (RemovalNotification<K, V> notification) -> executor.execute(() -> listener.onRemoval(notification)); } }

Loading feature diagnosis…

Source regions

Feature contributions

Feature contributions

FeatureValueContribution
(log-odds)
Halstead volumeHow much symbolic information the code contains. It combines the total number of operators and values with the number of distinct ones.647.078−21.354
Source linesThe number of non-empty source lines.31+12.4
Byte entropyHow varied the bytes in the source text are. Repeated bytes give a lower value; a more even mixture gives a higher value.4.756−7.134

Intercept 8.87 + feature contributions = -7.218 (log-odds).
Score = sigmoid(-7.218) = 0.001.

Score0.549

Feature contributions

FeatureValueContribution
(log-odds)
Identifier layout (horizontal)How rapidly the visual pattern of identifier characters changes from left to right. It measures spatial frequency, not the meaning of the names.65+0.912
Comment layout (horizontal)How rapidly the visual pattern of comment characters changes from left to right.0−0.804
Number layout frequencyHow rapidly the number of numeric values per line changes through the code.1+0.398
Indentation frequencyHow rapidly indentation changes from line to line.31+0.335
Operator visual areaThe share of the code’s visual area occupied by operators such as +, =, and *.0.114−0.163
Comment layout frequencyHow frequently the layout switches between lines containing only comments or whitespace and lines containing code.32−0.097
Identifier layout (vertical)How rapidly the visual pattern of identifier characters changes from top to bottom.30.909+0.022

Intercept 0.07 + feature contributions = 0.674 (log-odds).
Score = sigmoid(0.674) = 0.662.

Score0.395
Score5
Run 1

The code is a well-structured utility class with a single static factory method. It follows clean code principles: the private constructor prevents instantiation, null checks are explicit and self-documenting, and the method has a clear purpose. Nesting is minimal (lambdas only), and the action granularity is excellent with one logical step per line. Reading flow is natural — from validation to return of the wrapped listener. The code is concise, uses static imports appropriately, and clearly documents GWT incompatibility. Only minor deduction due to unnecessary blank lines, but overall this is near-ideal readability.

Run 2

The code is highly readable due to its clean structure, minimal nesting, and clear intent. The package and imports are well-organized, and the class is appropriately final with a private constructor. The asynchronous method is concise, uses proper null checks, and the lambda expression clearly delegates removal notifications to the executor. Action granularity is good, with each logical step on its own line. The only minor drawbacks are several blank lines and a stray empty comment block, which slightly disrupt the reading flow but do not affect functionality.

Run 3

The code is exceptionally readable, with a clear and focused single-purpose class. The structure is logical: private constructor to prevent instantiation, followed by a single static factory method. There is minimal nesting — only a lambda inside a lambda — and the flat hierarchy aids comprehension. Intent is explicit through descriptive naming and immediate null checks using Preconditions. The code is concise, with no unnecessary boilerplate or comments, and each line performs a distinct logical action. The reading flow is natural: validation first, then the construction of a lambda that defers execution to the provided Executor. The only minor detractor is the slight indirection of the lambda returning another lambda, but this pattern is idiomatic and transparent in context. Overall, it demonstrates excellent readability and maintainability.

Run 1

Code Structure: A well-organized utility class with a private constructor and one focused factory method. Nesting: Minimal; the nested lambdas remain easy to follow. Clarity of intent: The asynchronous method name, descriptive parameters, and executor delegation clearly communicate its purpose. Code length: The implementation is concise, although excessive blank lines add unnecessary visual length. Action granularity: Each null check occupies its own line, and the callback dispatch forms a single coherent expression. Reading flow: The progression from validation to listener creation is natural, but inconsistent whitespace and the lack of separation between package and import declarations slightly reduce readability.

Run 2

Code Structure: A logically organized utility class with a private constructor and one focused factory method. Nesting: Minimal nesting; the two lambdas are compact and easy to follow. Clarity of intent: Descriptive class, method, and parameter names clearly communicate asynchronous removal notification, though a brief API comment could clarify executor behavior. Code length: The implementation is concise, but excessive blank lines add unnecessary visual length. Action granularity: Each null check occupies its own line, and the returned expression represents one cohesive operation. Reading flow: Validation naturally precedes listener construction, and formatting makes execution delegation clear; excessive whitespace and tightly grouped package/import declarations slightly disrupt presentation.

Run 3

Code Structure: A small, logically organized utility class with a private constructor and one public factory method; excessive blank lines slightly weaken presentation. Nesting: Minimal nesting, with two compact lambdas expressing asynchronous delegation. Clarity of intent: Descriptive names and explicit null checks make the purpose clear. Code length: The implementation is concise, although whitespace unnecessarily lengthens the snippet. Action granularity: Each validation occupies its own line, and the return expression represents one cohesive operation. Reading flow: Imports, class declaration, constructor, and method follow a natural order, but inconsistent spacing and large blank gaps interrupt scanning.