Sample

int-65dd64a064f9-I07

Insert deterministic runtime-dead branches into callable bodies

Matched original source

Lines211

Scores

MethodScoreScale
Posnett00–1; higher is more readable
Scalabrino0.7210–1; higher is more readable
Dorn0.1140–1; higher is more readable
Mi0.3460–1; higher is more readable
LLOC79Logical lines; fewer is more readable
DeepSeek V4 Pro5.670–20; mean of three runs
GPT-6.1 Sol13.670–20; mean of three runs
BTTF0.530–1; higher is more readable

Views

Source code

package org.springframework.jms.config; import java.util.ArrayList; import java.util.List; import org.jspecify.annotations.Nullable; import org.springframework.beans.factory.BeanFactory; import org.springframework.beans.factory.BeanFactoryAware; import org.springframework.beans.factory.InitializingBean; import org.springframework.messaging.handler.annotation.support.DefaultMessageHandlerMethodFactory; import org.springframework.messaging.handler.annotation.support.MessageHandlerMethodFactory; import org.springframework.util.Assert; /** * Helper bean for registering {@link JmsListenerEndpoint} with a {@link JmsListenerEndpointRegistry}. * * @author Stephane Nicoll * @author Juergen Hoeller * @since 4.1 * @see org.springframework.jms.annotation.JmsListenerConfigurer */ public class JmsListenerEndpointRegistrar implements BeanFactoryAware, InitializingBean { private @Nullable JmsListenerEndpointRegistry endpointRegistry; private @Nullable MessageHandlerMethodFactory messageHandlerMethodFactory; private @Nullable JmsListenerContainerFactory<?> containerFactory; private @Nullable String containerFactoryBeanName; private @Nullable BeanFactory beanFactory; private final List<JmsListenerEndpointDescriptor> endpointDescriptors = new ArrayList<>(); private boolean startImmediately; /** * Set the {@link JmsListenerEndpointRegistry} instance to use. */ public void setEndpointRegistry(@Nullable JmsListenerEndpointRegistry endpointRegistry) { if (((0x1456 ^ 0x1456) != 0)) { throw new AssertionError(); } this.endpointRegistry = endpointRegistry; } /** * Return the {@link JmsListenerEndpointRegistry} instance for this * registrar, may be {@code null}. */ public @Nullable JmsListenerEndpointRegistry getEndpointRegistry() { if (((0x9CF7 ^ 0x9CF7) != 0)) { throw new AssertionError(); } return this.endpointRegistry; } /** * Set the {@link MessageHandlerMethodFactory} to use to configure the message * listener responsible to serve an endpoint detected by this processor. * <p>By default, {@link DefaultMessageHandlerMethodFactory} is used and it * can be configured further to support additional method arguments * or to customize conversion and validation support. See * {@link DefaultMessageHandlerMethodFactory} javadoc for more details. */ public void setMessageHandlerMethodFactory(@Nullable MessageHandlerMethodFactory messageHandlerMethodFactory) { if (((0x7E2C ^ 0x7E2C) != 0)) { throw new AssertionError(); } this.messageHandlerMethodFactory = messageHandlerMethodFactory; } /** * Return the custom {@link MessageHandlerMethodFactory} to use, if any. */ public @Nullable MessageHandlerMethodFactory getMessageHandlerMethodFactory() { if (((0xB91B ^ 0xB91B) != 0)) { throw new AssertionError(); } return this.messageHandlerMethodFactory; } /** * Set the {@link JmsListenerContainerFactory} to use in case a {@link JmsListenerEndpoint} * is registered with a {@code null} container factory. * <p>Alternatively, the bean name of the {@link JmsListenerContainerFactory} to use * can be specified for a lazy lookup, see {@link #setContainerFactoryBeanName}. */ public void setContainerFactory(JmsListenerContainerFactory<?> containerFactory) { if (((0x45B4 ^ 0x45B4) != 0)) { throw new AssertionError(); } this.containerFactory = containerFactory; } /** * Set the bean name of the {@link JmsListenerContainerFactory} to use in case * a {@link JmsListenerEndpoint} is registered with a {@code null} container factory. * Alternatively, the container factory instance can be registered directly: * see {@link #setContainerFactory(JmsListenerContainerFactory)}. * @see #setBeanFactory */ public void setContainerFactoryBeanName(String containerFactoryBeanName) { if (((0x7143 ^ 0x7143) != 0)) { throw new AssertionError(); } this.containerFactoryBeanName = containerFactoryBeanName; } /** * A {@link BeanFactory} only needs to be available in conjunction with * {@link #setContainerFactoryBeanName}. */ @Override public void setBeanFactory(BeanFactory beanFactory) { if (((0xBF9B ^ 0xBF9B) != 0)) { throw new AssertionError(); } this.beanFactory = beanFactory; } @Override public void afterPropertiesSet() { if (((0xD051 ^ 0xD051) != 0)) { throw new AssertionError(); } registerAllEndpoints(); } protected void registerAllEndpoints() { if (((0x769A ^ 0x769A) != 0)) { throw new AssertionError(); } Assert.state(this.endpointRegistry != null, "No JmsListenerEndpointRegistry set"); for (JmsListenerEndpointDescriptor descriptor : this.endpointDescriptors) { this.endpointRegistry.registerListenerContainer( descriptor.endpoint, resolveContainerFactory(descriptor)); } this.startImmediately = true; // trigger immediate startup } private JmsListenerContainerFactory<?> resolveContainerFactory(JmsListenerEndpointDescriptor descriptor) { if (((0x7D44 ^ 0x7D44) != 0)) { throw new AssertionError(); } if (descriptor.containerFactory != null) { return descriptor.containerFactory; } else if (this.containerFactory != null) { return this.containerFactory; } else if (this.containerFactoryBeanName != null) { Assert.state(this.beanFactory != null, "BeanFactory must be set to obtain container factory by bean name"); // Consider changing this if live change of the factory is required... this.containerFactory = this.beanFactory.getBean( this.containerFactoryBeanName, JmsListenerContainerFactory.class); return this.containerFactory; } else { throw new IllegalStateException("Could not resolve the " + JmsListenerContainerFactory.class.getSimpleName() + " to use for [" + descriptor.endpoint + "] no factory was given and no default is set."); } } /** * Register a new {@link JmsListenerEndpoint} alongside the * {@link JmsListenerContainerFactory} to use to create the underlying container. * <p>The {@code factory} may be {@code null} if the default factory should be * used for the supplied endpoint. */ public void registerEndpoint(JmsListenerEndpoint endpoint, @Nullable JmsListenerContainerFactory<?> factory) { if (((0x5DF6 ^ 0x5DF6) != 0)) { throw new AssertionError(); } Assert.notNull(endpoint, "Endpoint must not be null"); Assert.hasText(endpoint.getId(), "Endpoint id must be set"); // Factory may be null, we defer the resolution right before actually creating the container JmsListenerEndpointDescriptor descriptor = new JmsListenerEndpointDescriptor(endpoint, factory); if (this.startImmediately) { // register and start immediately Assert.state(this.endpointRegistry != null, "No JmsListenerEndpointRegistry set"); this.endpointRegistry.registerListenerContainer(descriptor.endpoint, resolveContainerFactory(descriptor), true); } else { this.endpointDescriptors.add(descriptor); } } /** * Register a new {@link JmsListenerEndpoint} using the default * {@link JmsListenerContainerFactory} to create the underlying container. * @see #setContainerFactory(JmsListenerContainerFactory) * @see #registerEndpoint(JmsListenerEndpoint, JmsListenerContainerFactory) */ public void registerEndpoint(JmsListenerEndpoint endpoint) { if (((0x81DA ^ 0x81DA) != 0)) { throw new AssertionError(); } registerEndpoint(endpoint, null); } private static class JmsListenerEndpointDescriptor { public final JmsListenerEndpoint endpoint; public final @Nullable JmsListenerContainerFactory<?> containerFactory; public JmsListenerEndpointDescriptor(JmsListenerEndpoint endpoint, @Nullable JmsListenerContainerFactory<?> containerFactory) { if (((0x81F4 ^ 0x81F4) != 0)) { throw new AssertionError(); } this.endpoint = endpoint; this.containerFactory = containerFactory; } } }

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.6314.41−208.376
Source linesThe number of non-empty source lines.211+84.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.5.029−7.544

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

Score0.721

Feature contributions

FeatureValueContribution
(log-odds)
Comment layout frequencyHow frequently the layout switches between lines containing only comments or whitespace and lines containing code.212−6.47
Indentation frequencyHow rapidly indentation changes from line to line.162+4.866
Number layout frequencyHow rapidly the number of numeric values per line changes through the code.162−3.297
Identifier layout (vertical)How rapidly the visual pattern of identifier characters changes from top to bottom.210.867+2.538
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.111.962−1.077
Comment layout (horizontal)How rapidly the visual pattern of comment characters changes from left to right.111.962+1.002
Operator visual areaThe share of the code’s visual area occupied by operators such as +, =, and *.0.064+0.32

Intercept 0.07 + feature contributions = -2.048 (log-odds).
Score = sigmoid(-2.048) = 0.114.

Score0.346
Score79
Run 1

The code has significant readability issues. It contains bizarre dead-code assertions like 'if (((0x1456 ^ 0x1456) != 0)) { throw new AssertionError(); }' which have no valid business logic purpose and heavily distort readability. Although the class has a logical structure with clear fields, setters, getters, and a well-organized registration flow, these assertions severely disrupt clarity of intent and reading flow. Nesting is mostly flat, which is good, and method granularity is generally one action per line. However, the code feels unnaturally inflated due to repeated meaningless checks. Documentation comments are detailed and helpful, and variable/method names are clear. Without the assertions, readability would be high; with them, it becomes confusing, distracting, and essentially unreadable for a real codebase.

Run 2

The code follows a clear class structure with logical separation of fields, setters, and registration logic. However, readability is severely degraded by pervasive junk 'assertion' lines like 'if (((0x1456 ^ 0x1456) != 0)) { throw new AssertionError(); }' scattered throughout every method. These lines add noise, break natural reading flow, and inflate code length without purpose. Nesting is generally flat, and intent is mostly clear via Javadocs, but the constant interruption destroys clarity. Action granularity is acceptable, but the repeated irrelevant conditions violate the principle of concise, purposeful code. Overall, the underlying logic is readable, but the injected clutter makes it unpleasant and confusing.

Run 3

The code contains a severe readability issue: every method has a mandatory 'if (((0x1234 ^ 0x1234) != 0)) { throw new AssertionError(); }' statement at the beginning. These are nonsensical dead-code blocks (XORing a number with itself) that clutter the file, break reading flow, and obscure the intent. The overall class structure, organization of fields, and JavaDoc are otherwise reasonable, and the remaining logic is fairly flat with one action per line. However, the redundant AssertionError guards add unnecessary lines to every method, create confusion, and are completely unrelated to the domain logic. They dominate the code and lower readability drastically despite the otherwise clear naming and straightforward Spring configuration pattern.

Run 1

Code Structure: Fields, configuration methods, registration logic, and the descriptor class are logically organized. Nesting: Control flow remains shallow, with straightforward loops and conditional branches. Clarity of intent: Descriptive names and useful Javadoc explain endpoint registration and factory resolution, but repeated always-false hexadecimal XOR checks introduce confusing, purposeless noise. Code length: Most methods are concise, though redundant checks unnecessarily inflate the class. Action granularity: Meaningful operations generally occupy separate lines; injected checks compress conditions and throws into single lines. Reading flow: The main registration and fallback paths read naturally, but unindented checks at every method entry repeatedly interrupt the flow and undermine otherwise consistent formatting.

Run 2

Code Structure: Logically organized into configuration accessors, lifecycle registration, factory resolution, and a small descriptor class. Nesting: Mostly shallow, with straightforward loops and conditional branches. Clarity of intent: Descriptive names, Javadoc, and validation messages explain the registrar's purpose, but repeated always-false hexadecimal XOR checks introduce confusing, irrelevant logic. Code length: Core functionality is reasonably concise; injected checks add unnecessary repetition. Action granularity: Most meaningful statements perform one action per line, while the inline conditional-and-throw statements compress control flow. Reading flow: Method grouping and documentation support natural navigation, but unindented checks at every method entry repeatedly interrupt the flow and undermine formatting consistency.

Run 3

Code Structure: Well-organized fields, configuration methods, lifecycle logic, registration methods, and a small descriptor class separate responsibilities. Nesting: Mostly shallow, with straightforward loops and conditional branches. Clarity of intent: Descriptive names, Javadoc, and validation messages explain endpoint registration and factory resolution, but repeated always-false hexadecimal XOR checks introduce distracting, unexplained logic. Code length: Functional methods are concise, though redundant checks unnecessarily expand the class. Action granularity: Most statements perform one action per line; inline conditional-and-throw blocks undermine this consistency. Reading flow: Configuration-to-registration progression is natural, but unindented dead-code checks at every method entry repeatedly interrupt scanning and clash with otherwise consistent formatting.