Sample

int-7658667ea790-I05

Rewrite eligible decimal integer literals in hexadecimal notation

Matched original source

Lines115

Scores

MethodScoreScale
Posnett00–1; higher is more readable
Scalabrino0.8220–1; higher is more readable
Dorn0.7470–1; higher is more readable
Mi0.1950–1; higher is more readable
LLOC21Logical lines; fewer is more readable
DeepSeek V4 Pro180–20; mean of three runs
GPT-6.1 Sol180–20; mean of three runs
BTTF0.6610–1; higher is more readable

Views

Source code

package org.springframework.orm; import org.jspecify.annotations.Nullable; import org.springframework.dao.DataRetrievalFailureException; /** * Exception thrown if a mapped object could not be retrieved via its identifier. * Provides information about the persistent class and the identifier. * * @author Juergen Hoeller * @since 13.10.2003 */ @SuppressWarnings("serial") public class ObjectRetrievalFailureException extends DataRetrievalFailureException { private final @Nullable Object persistentClass; private final @Nullable Object identifier; /** * Create a general ObjectRetrievalFailureException with the given message, * without any information on the affected object. * @param msg the detail message * @param cause the source exception */ public ObjectRetrievalFailureException(@Nullable String msg, Throwable cause) { super(msg, cause); this.persistentClass = null; this.identifier = null; } /** * Create a new ObjectRetrievalFailureException for the given object, * with the default "not found" message. * @param persistentClass the persistent class * @param identifier the ID of the object that should have been retrieved */ public ObjectRetrievalFailureException(Class<?> persistentClass, Object identifier) { this(persistentClass, identifier, "Object of class [" + persistentClass.getName() + "] with identifier [" + identifier + "]: not found", null); } /** * Create a new ObjectRetrievalFailureException for the given object, * with the given explicit message and exception. * @param persistentClass the persistent class * @param identifier the ID of the object that should have been retrieved * @param msg the detail message * @param cause the source exception */ public ObjectRetrievalFailureException( Class<?> persistentClass, @Nullable Object identifier, String msg, @Nullable Throwable cause) { super(msg, cause); this.persistentClass = persistentClass; this.identifier = identifier; } /** * Create a new ObjectRetrievalFailureException for the given object, * with the default "not found" message. * @param persistentClassName the name of the persistent class * @param identifier the ID of the object that should have been retrieved */ public ObjectRetrievalFailureException(String persistentClassName, Object identifier) { this(persistentClassName, identifier, "Object of class [" + persistentClassName + "] with identifier [" + identifier + "]: not found", null); } /** * Create a new ObjectRetrievalFailureException for the given object, * with the given explicit message and exception. * @param persistentClassName the name of the persistent class * @param identifier the ID of the object that should have been retrieved * @param msg the detail message * @param cause the source exception */ public ObjectRetrievalFailureException( String persistentClassName, @Nullable Object identifier, @Nullable String msg, @Nullable Throwable cause) { super(msg, cause); this.persistentClass = persistentClassName; this.identifier = identifier; } /** * Return the persistent class of the object that was not found. * If no Class was specified, this method returns null. */ public @Nullable Class<?> getPersistentClass() { return (this.persistentClass instanceof Class<?> clazz ? clazz : null); } /** * Return the name of the persistent class of the object that was not found. * Will work for both Class objects and String names. */ public @Nullable String getPersistentClassName() { if (this.persistentClass instanceof Class<?> clazz) { return clazz.getName(); } return (this.persistentClass != null ? this.persistentClass.toString() : null); } /** * Return the identifier of the object that was not found. */ public @Nullable Object getIdentifier() { return this.identifier; } }

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.1829.317−60.367
Source linesThe number of non-empty source lines.115+46
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.834−7.251

Intercept 8.87 + feature contributions = -12.749 (log-odds).
Score = sigmoid(-12.749) = 0.

Score0.822

Feature contributions

FeatureValueContribution
(log-odds)
Comment layout frequencyHow frequently the layout switches between lines containing only comments or whitespace and lines containing code.109−2.823
Indentation frequencyHow rapidly indentation changes from line to line.72+1.753
Identifier layout (vertical)How rapidly the visual pattern of identifier characters changes from top to bottom.114.55+1.191
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.109.94−0.991
Comment layout (horizontal)How rapidly the visual pattern of comment characters changes from left to right.109.966+0.97
Operator visual areaThe share of the code’s visual area occupied by operators such as +, =, and *.0.044+0.515
Number layout frequencyHow rapidly the number of numeric values per line changes through the code.1+0.398

Intercept 0.07 + feature contributions = 1.083 (log-odds).
Score = sigmoid(1.083) = 0.747.

Score0.195
Score21
Run 1

The code is highly readable, following clear structure and best practices. It uses a logical class organization with grouped fields, multiple well-documented constructors, and clearly named accessor methods. Nesting is minimal; the only conditional logic appears in short, flat helper methods. Each constructor and method has a distinct, single responsibility. Action granularity is excellent—each line performs one clear operation or assignment. Javadoc comments thoroughly explain intent, parameters, and edge cases, making the ambiguity low. The code length is appropriate for the class's purpose, with concise implementation and no redundancy. Reading flow is natural: class documentation, fields, constructors in order of increasing specificity, then getters. Null-safety annotations improve clarity. Minor deductions are only theoretical, such as the slight duplication between Class-based and String-based constructors, but overall this is exemplary readable production code.

Run 2

The code is highly readable, following a clear, conventional class structure with field declarations, multiple constructors, and accessor methods. Nesting is minimal—limited to simple conditional checks. Each constructor and method has a distinct purpose, making the intent unambiguous. The code is concise without being overly compressed; Javadocs are thorough but not redundant. Action granularity is well managed: one logical operation per line or statement, with no crowded lines. Reading flow is natural, progressing from the class-level exception concept to field retrieval methods. Minor deductions: multiple overloaded constructors slightly reduce conciseness and the pattern-matching instanceof adds mild complexity that might require a second glance.

Run 3

The code is well-structured and highly readable. It follows a clear logical organization with package declaration, imports, Javadoc, class declaration, fields, constructors, and getters. Nesting is minimal; the only conditional is a simple if statement in getPersistentClassName, and pattern matching for instanceof improves clarity. Intent is unambiguous—the exception conveys missing object retrieval information. Code length is appropriate, not overly verbose; Javadoc adds useful documentation. Each action is granular, with one assignment or method call per line, enhancing clarity. Reading flow is natural, moving from general constructors to specific retrieval methods. Minor deductions: the ternary in getPersistentClassName could be slightly clearer, and multiple constructors increase length, but this is justified by flexibility. Overall, it is idiomatic Spring framework Java.

Run 1

Code Structure: Fields, constructors, and accessors are logically grouped, with consistent formatting. Nesting: Almost entirely flat, with only a simple conditional in one accessor. Clarity of intent: Descriptive names, Javadoc, and nullability annotations clearly explain the exception's purpose; storing either a Class or String in an Object field slightly obscures its representation. Code length: Methods are concise, although repeated constructor documentation and message construction add some verbosity. Action granularity: Assignments and returns each occupy separate lines; multiline constructor delegation remains easy to follow. Reading flow: The progression from state to construction to retrieval is natural, with minor friction from similar overloads and long message expressions.

Run 2

Code Structure: Fields, constructors, and accessors are logically grouped, with constructor delegation reducing duplication. Nesting: Nearly flat; the only conditional block is shallow and easy to follow. Clarity of intent: Descriptive names, Javadoc, and nullability annotations clearly explain the exception's purpose and available metadata. However, storing either a Class or String in an Object field slightly obscures its representation. Code length: Reasonably concise for the supported overloads, though repeated documentation and parallel constructors add some verbosity. Action granularity: Statements generally perform one action each; multiline constructor calls remain coherent. Reading flow: Consistent formatting and a natural fields-to-constructors-to-accessors progression make navigation straightforward. Long message expressions and mixed-type handling introduce only minor friction.

Run 3

Code Structure: Fields, constructors, and accessors are logically grouped, with constructor delegation reducing duplication. Nesting: Almost entirely flat, with only one simple conditional. Clarity of intent: Descriptive names, Javadoc, and nullability annotations clearly explain the exception's purpose and API; storing either a Class or String in an Object field slightly weakens clarity. Code length: Reasonably concise, though repeated constructor documentation and default-message construction add some verbosity. Action granularity: Each assignment and return occupies its own line; multiline constructor calls remain coherent single actions. Reading flow: Consistent formatting and predictable ordering make the class easy to follow, with minor friction from long message expressions and similar constructor overloads.