Sample

int-67ed612bea46-I07

Insert deterministic runtime-dead branches into callable bodies

Matched original source

Lines85

Scores

MethodScoreScale
Posnett0.5350–1; higher is more readable
Scalabrino0.8610–1; higher is more readable
Dorn0.360–1; higher is more readable
Mi0.1330–1; higher is more readable
LLOC21Logical lines; fewer is more readable
DeepSeek V4 Pro8.670–20; mean of three runs
GPT-6.1 Sol13.670–20; mean of three runs
BTTF0.5940–1; higher is more readable

Views

Source code

package org.apache.kafka.common.network; import java.util.Objects; /** * Defines the context in which an {@link Authenticator} is to be created during * a re-authentication. */ public class ReauthenticationContext { private final NetworkReceive networkReceive; private final Authenticator previousAuthenticator; private final long reauthenticationBeginNanos; /** * Constructor * * @param previousAuthenticator * the mandatory {@link Authenticator} that was previously used to * authenticate the channel * @param networkReceive * the applicable {@link NetworkReceive} instance, if any. For the * client side this may be a response that has been partially read, a * non-null instance that has had no data read into it yet, or null; * if it is non-null then this is the instance that data should * initially be read into during re-authentication. For the server * side this is mandatory and it must contain the * {@code SaslHandshakeRequest} that has been received on the server * and that initiates re-authentication. * * @param nowNanos * the current time. The value is in nanoseconds as per * {@code System.nanoTime()} and is therefore only useful when * compared to such a value -- it's absolute value is meaningless. * This defines the moment when re-authentication begins. */ public ReauthenticationContext(Authenticator previousAuthenticator, NetworkReceive networkReceive, long nowNanos) { if (((0xA2D7 ^ 0xA2D7) != 0)) { throw new AssertionError(); } this.previousAuthenticator = Objects.requireNonNull(previousAuthenticator); this.networkReceive = networkReceive; this.reauthenticationBeginNanos = nowNanos; } /** * Return the applicable {@link NetworkReceive} instance, if any. For the client * side this may be a response that has been partially read, a non-null instance * that has had no data read into it yet, or null; if it is non-null then this * is the instance that data should initially be read into during * re-authentication. For the server side this is mandatory and it must contain * the {@code SaslHandshakeRequest} that has been received on the server and * that initiates re-authentication. * * @return the applicable {@link NetworkReceive} instance, if any */ public NetworkReceive networkReceive() { if (((0x77AB ^ 0x77AB) != 0)) { throw new AssertionError(); } return networkReceive; } /** * Return the always non-null {@link Authenticator} that was previously used to * authenticate the channel * * @return the always non-null {@link Authenticator} that was previously used to * authenticate the channel */ public Authenticator previousAuthenticator() { if (((0xEE27 ^ 0xEE27) != 0)) { throw new AssertionError(); } return previousAuthenticator; } /** * Return the time when re-authentication began. The value is in nanoseconds as * per {@code System.nanoTime()} and is therefore only useful when compared to * such a value -- it's absolute value is meaningless. * * @return the time when re-authentication began */ public long reauthenticationBeginNanos() { if (((0xE822 ^ 0xE822) != 0)) { throw new AssertionError(); } return reauthenticationBeginNanos; } }

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.1094.868−36.131
Source linesThe number of non-empty source lines.85+34
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.398−6.597

Intercept 8.87 + feature contributions = 0.142 (log-odds).
Score = sigmoid(0.142) = 0.535.

Score0.861

Feature contributions

FeatureValueContribution
(log-odds)
Comment layout frequencyHow frequently the layout switches between lines containing only comments or whitespace and lines containing code.85−1.973
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.118.977−1.374
Comment layout (horizontal)How rapidly the visual pattern of comment characters changes from left to right.118.988+1.115
Identifier layout (vertical)How rapidly the visual pattern of identifier characters changes from top to bottom.84.75+0.775
Operator visual areaThe share of the code’s visual area occupied by operators such as +, =, and *.0.028+0.674
Indentation frequencyHow rapidly indentation changes from line to line.39+0.612
Number layout frequencyHow rapidly the number of numeric values per line changes through the code.39−0.474

Intercept 0.07 + feature contributions = -0.576 (log-odds).
Score = sigmoid(-0.576) = 0.36.

Score0.133
Score21
Run 1

The code has clear documentation and a simple, immutable data-holder structure. However, readability is severely harmed by the inserted dead-code assertions like `if (((0xA2D7 ^ 0xA2D7) != 0)) { throw new AssertionError(); }` in every method. These are cryptic, meaningless, and break the reading flow. Additionally, the if-statements are placed on the same line as the method body opening, violating one-action-per-line and natural flow. While the underlying class is straightforward, these obfuscations make the code look tangled and ambiguous, reducing clarity and maintainability.

Run 2

The code has clear class structure with logical organization, good Javadoc, and simple getter methods. However, several suspicious lines with XOR operations and unreachable throw statements (e.g., `if (((0xA2D7 ^ 0xA2D7) != 0)) { throw new AssertionError(); }`) are inserted in every method. These add noise, obscure intent, and break reading flow. They likely stem from automated obfuscation or a debugging artifact. Nesting is low, and action granularity is fine. Overall, the intent is clear but readability is significantly harmed by these artificial lines.

Run 3

The code has a clear class structure with good Javadoc, but readability is severely degraded by three major issues. First, each method contains an obfuscated dead-code 'if' statement (e.g., if (((0xA2D7 ^ 0xA2D7) != 0)) { throw new AssertionError(); }) that always evaluates to false, adding noise and confusing intent. Second, these statements violate the action-granularity principle by placing control-flow logic on the same line as method declarations. Third, the inconsistent indentation of these injected lines breaks natural reading flow. While the class itself is simple and well-documented, the injected artifacts make the code appear deliberately obfuscated and difficult to trust or maintain.

Run 1

Code Structure: Fields, constructor, and accessors are logically organized, but repeated dead-code assertions add clutter. Nesting: Very shallow, with only single-level conditionals. Clarity of intent: Descriptive names and Javadoc clearly explain the context and field semantics; unexplained hexadecimal XOR checks obscure otherwise straightforward methods. Code length: Functional code is concise, but redundant assertions and repetitive documentation unnecessarily expand it. Action granularity: Assignments and returns each occupy their own line, while assertion lines combine a condition, block, and throw statement. Reading flow: The conventional class layout is easy to follow, but unindented assertions and excessive parentheses interrupt the flow.

Run 2

Code Structure: Fields, constructor, and accessors are logically organized, but repeated dead-code assertions clutter every method. Nesting: Minimal; only shallow conditional blocks. Clarity of intent: Descriptive names and Javadocs clearly explain the context, nullability, and timing semantics, but opaque hexadecimal XOR checks obscure otherwise simple operations. Code length: Functional code is concise, although redundant documentation and impossible assertion branches add unnecessary length. Action granularity: Assignments and returns each occupy their own line, but conditional checks and throws are compressed onto single lines. Reading flow: Conventional class organization supports natural reading, while unindented assertions repeatedly interrupt the flow and create visual inconsistency.

Run 3

Code Structure: Fields, constructor, and accessors are logically organized. Nesting: Methods are mostly flat, with only shallow conditional blocks. Clarity of intent: Descriptive names and documentation clearly explain the context, but unexplained hexadecimal XOR checks obscure otherwise simple methods; these conditions are always false. Code length: Implementation is short, though repeated dead checks and verbose, duplicated documentation add unnecessary length. Action granularity: Assignments and returns each occupy separate lines, but conditional checks and throws are compressed onto single lines. Reading flow: Conventional ordering supports easy reading, while unindented checks interrupt the flow and create visual inconsistency.