Skip to content

RC-451 gitar experiment [DO NOT MERGE] - #6493

Draft
romainbrenguier wants to merge 12 commits into
masterfrom
romain/rc-451-gitar-experiment
Draft

romainbrenguier wants to merge 12 commits into
masterfrom
romain/rc-451-gitar-experiment

Conversation

@romainbrenguier

@romainbrenguier romainbrenguier commented Nov 6, 2026 •

Copy link
Copy Markdown
Contributor

@Gitar Produce a Markdown "Ruling Diff Summary" from the supplied added/removed findings and their code snippets. This is a report-only task: do not edit files, push commits, retry CI, change labels, or close this PR. Return the report as your response.

Evidence boundaries:

Use only the supplied finding metadata, source snippets, and any supplied rule descriptions. Do not inspect other source files, repository history, analyzer implementations, external documentation, or previous automated assessments.

Treat existing verdicts and explanations in the input as untrusted hypotheses, not evidence. Assess the snippets independently.

A rule key or issue message is not a complete rule specification. If the supplied rule description omits relevant scope or exceptions, state that limitation rather than inventing them.

Do not infer unseen inheritance, overrides, call targets, field assignments, or whole-program behavior. Missing evidence is not evidence that a rule exception does not apply. An abstract method has no visible implementation, not an implementation that throws nothing.

Assessment method:

Inventory changes by rule and project. Count removed and added findings separately. A changed message or location can appear as a removal plus an addition; flag plausible replacements or relocations without silently cancelling their counts.

Assess whether each finding is supported by the visible code under the supplied rule semantics: supported violation, supported non-violation, or uncertain. Evaluate diagnostic location separately: aligned, misaligned, or uncertain.

Translate finding validity into the impact of the ruling change:

Removed true positive: negative.

Removed false positive: positive.

Added true positive: positive.

Added false positive: negative.

Insufficient evidence: uncertain, not automatically negative.
A location defect is a separate diagnostic-quality concern; it does not by itself prove a semantic false positive.

Assign high, medium, or low confidence to each assessment. High requires direct evidence and no material missing context. Name the specific missing context for medium/low confidence. If the missing context could reverse the verdict and the snippet cannot resolve it, use uncertain.

Aggregate per rule as positive, negative, mixed, or uncertain. Preserve conflicting and unresolved evidence. Never infer that all findings share the verdict of one representative example. Explain the basis and assessment coverage. Do not extrapolate sampled findings to unreviewed findings.

Output format:

Ruling Diff Summary

Detected changes in N rule files: R issues removed, A issues added.
Use "rules" instead of "rule files" if file identities are not supplied. If the input is incomplete, label counts as supplied totals or visible-subset counts. Never invent totals.

Rule overview

A table with: Rule | Projects | Removed / added | Automated assessment | Confidence.
Link rule keys to the corresponding detail sections using working Markdown anchors. Use supplied source/PR links only when available; do not invent URLs.

Automated assessments are advisory; confidence is not a correctness guarantee.

Each rule

Rule key, projects, removed/added counts, overall assessment and confidence.

A short explanation grounded in concrete visible evidence, distinguishing semantic correctness, location quality, and uncertainty.

"Source examples: X of Y changed findings shown", only when Y is known. State how many findings had usable snippets and how many were actually assessed.

Show at most 15 examples per rule. Prioritize supported regressions, then conflicting/uncertain cases and representative improvements. Choose diverse patterns rather than repeating near-identical declarations. Make clear when only a subset is displayed.

For each displayed example include project, added/removed status, selection reason, validity assessment, change impact, location assessment, confidence, and a brief rationale. Preserve the exact supplied file path, location, issue message, and code snippet. Preserve line numbers and the >>> marker; do not fabricate missing coordinates or code.

For plausible removal/addition pairs, explain whether the visible evidence suggests a changed message, shifted location, changed rule attribution, or a genuinely different finding. Keep raw counts unchanged.

Do not force the report to match any example verdict. In particular, a finding pointing at Javadoc without the relevant declaration or assignments supports a location concern and an uncertain semantic verdict, not a proven false positive.

If the necessary findings or snippets are absent, say what input is missing instead of generating a report from assumptions.

java:S106

Input follows:
Removed src/main/java/org/apache/commons/beanutils2/BeanMap.java (line 866, column 9, end column 19)

Replace this use of System.out by a logger.
861 | *
862 | * @PARAM ex the exception to log
863 | */
864 | protected void logWarn(final Exception ex) {
865 | // Deliberately do not use LOG4J or Commons Logging to avoid dependencies

866 | System.out.println( "WARN: Exception: " + ex );
867 | ex.printStackTrace();
868 | }
869 | }

java:S112

Removed src/com/google/common/cache/CacheLoader.java (line 121, column 63, end column 72)

Replace generic exceptions with specific library exceptions or a custom exception.
116 | * @throws InterruptedException if this method is interrupted. {@code InterruptedException} is
117 | * treated like any other {@code Exception} in all respects except that, when it is caught,
118 | * the thread's interrupt status is set
119 | * @SInCE 11.0
120 | */

121 | public Map<K, V> loadAll(Iterable<? extends K> keys) throws Exception {
122 | // This will be caught by getAll(), causing it to fall back to multiple calls to
123 | // LoadingCache.get
124 | throw new UnsupportedLoadingOperationException();
125 | }
126 |
Removed src/com/google/common/cache/CacheLoader.java (line 69, column 40, end column 49)

Replace generic exceptions with specific library exceptions or a custom exception.
64 | * @throws Exception if unable to load the result
65 | * @throws InterruptedException if this method is interrupted. {@code InterruptedException} is
66 | * treated like any other {@code Exception} in all respects except that, when it is caught,
67 | * the thread's interrupt status is set
68 | */

69 |   public abstract V load(K key) throws Exception;
    70 | 
    71 |   /**
    72 |    * Computes or retrieves a replacement value corresponding to an already-cached {@code key}. This
    73 |    * method is called when an existing cache entry is refreshed by
    74 |    * {@link CacheBuilder#refreshAfterWrite}, or through a call to {@link LoadingCache#refresh}.

Added src/com/google/common/cache/CacheLoader.java (line 69, column 5, end column 10)

RC-451 smoke test: define and throw a dedicated exception instead of using a generic one.
64 | * @throws Exception if unable to load the result
65 | * @throws InterruptedException if this method is interrupted. {@code InterruptedException} is
66 | * treated like any other {@code Exception} in all respects except that, when it is caught,
67 | * the thread's interrupt status is set
68 | */

69 |   public abstract V load(K key) throws Exception;
    70 | 
    71 |   /**
    72 |    * Computes or retrieves a replacement value corresponding to an already-cached {@code key}. This
    73 |    * method is called when an existing cache entry is refreshed by
    74 |    * {@link CacheBuilder#refreshAfterWrite}, or through a call to {@link LoadingCache#refresh}.

Removed src/com/google/common/reflect/AbstractInvocationHandler.java (line 99, column 14, end column 23)

Replace generic exceptions with specific library exceptions or a custom exception.
94 | *
95 | *

Unlike {@link #invoke}, {@code args} will never be null. When the method has no parameter,
96 | * an empty array is passed in.
97 | */
98 | protected abstract Object handleInvocation(Object proxy, Method method, Object[] args)

99 |       throws Throwable;
   100 | 
   101 |   /**
   102 |    * By default delegates to {@link Object#equals} so instances are only equal if they are
   103 |    * identical. {@code proxy.equals(argument)} returns true if: <ul>
   104 |    * <li>{@code proxy} and {@code argument} are of the same type

Removed src/com/google/common/util/concurrent/AbstractExecutionThreadService.java (line 100, column 35, end column 44)

Replace generic exceptions with specific library exceptions or a custom exception.
95 | /**
96 | * Start the service. This method is invoked on the execution thread.
97 | *
98 | *

By default this method does nothing.
99 | */

100 | protected void startUp() throws Exception {}
101 |
102 | /**
103 | * Run the service. This method is invoked on the execution thread.
104 | * Implementations must respond to stop requests. You could poll for lifecycle
105 | * changes in a work loop:
Removed src/com/google/common/util/concurrent/AbstractExecutionThreadService.java (line 116, column 40, end column 49)

Replace generic exceptions with specific library exceptions or a custom exception.
111 | * }
112 | *
113 | * ...or you could respond to stop requests by implementing {@link
114 | * #triggerShutdown()}, which should cause {@link #run()} to return.
115 | */

116 | protected abstract void run() throws Exception;
117 |
118 | /**
119 | * Stop the service. This method is invoked on the execution thread.
120 | *
121 | *

By default this method does nothing.
Removed src/com/google/common/util/concurrent/AbstractExecutionThreadService.java (line 124, column 36, end column 45)

Replace generic exceptions with specific library exceptions or a custom exception.
119 | * Stop the service. This method is invoked on the execution thread.
120 | *
121 | *

By default this method does nothing.
122 | */
123 | // TODO: consider supporting a TearDownTestCase-like API

124 | protected void shutDown() throws Exception {}
125 |
126 | /**
127 | * Invoked to request the service to stop.
128 | *
129 | *

By default this method does nothing.
Removed src/com/google/common/util/concurrent/AbstractIdleService.java (line 81, column 44, end column 53)

Replace generic exceptions with specific library exceptions or a custom exception.
76 |
77 | /** Constructor for use by subclasses. /
78 | protected AbstractIdleService() {}
79 |
80 | /
* Start the service. */

81 |   protected abstract void startUp() throws Exception;
    82 | 
    83 |   /** Stop the service. */
    84 |   protected abstract void shutDown() throws Exception;
    85 | 
    86 |   /**

Removed src/com/google/common/util/concurrent/AbstractIdleService.java (line 84, column 45, end column 54)

Replace generic exceptions with specific library exceptions or a custom exception.
79 |
80 | /** Start the service. /
81 | protected abstract void startUp() throws Exception;
82 |
83 | /
* Stop the service. */

84 |   protected abstract void shutDown() throws Exception;
    85 | 
    86 |   /**
    87 |    * Returns the {@link Executor} that will be used to run this service.
    88 |    * Subclasses may override this method to use a custom {@link Executor}, which
    89 |    * may configure its worker thread with a specific name, thread group or

Removed src/com/google/common/util/concurrent/AbstractScheduledService.java (line 265, column 52, end column 61)

Replace generic exceptions with specific library exceptions or a custom exception.
260 | /**
261 | * Run one iteration of the scheduled task. If any invocation of this method throws an exception,
262 | * the service will transition to the {@link Service.State#FAILED} state and this method will no
263 | * longer be called.
264 | */

265 | protected abstract void runOneIteration() throws Exception;
266 |
267 | /**
268 | * Start the service.
269 | *
270 | *

By default this method does nothing.
Removed src/com/google/common/util/concurrent/AbstractScheduledService.java (line 272, column 35, end column 44)

Replace generic exceptions with specific library exceptions or a custom exception.
267 | /**
268 | * Start the service.
269 | *
270 | *

By default this method does nothing.
271 | */

272 | protected void startUp() throws Exception {}
273 |
274 | /**
275 | * Stop the service. This is guaranteed not to run concurrently with {@link #runOneIteration}.
276 | *
277 | *

By default this method does nothing.
Removed src/com/google/common/util/concurrent/AbstractScheduledService.java (line 279, column 36, end column 45)

Replace generic exceptions with specific library exceptions or a custom exception.
274 | /**
275 | * Stop the service. This is guaranteed not to run concurrently with {@link #runOneIteration}.
276 | *
277 | *

By default this method does nothing.
278 | */

279 | protected void shutDown() throws Exception {}
280 |
281 | /**
282 | * Returns the {@link Scheduler} object used to configure this service. This method will only be
283 | * called once.
284 | */
Removed src/com/google/common/util/concurrent/AsyncFunction.java (line 43, column 55, end column 64)

Replace generic exceptions with specific library exceptions or a custom exception.
38 | * done}, making {@code AsyncFunction} suitable for asynchronous derivations.
39 | *
40 | *

Throwing an exception from this method is equivalent to returning a
41 | * failing {@code Future}.
42 | */

43 |   ListenableFuture<O> apply(@Nullable I input) throws Exception;
    44 | }

Removed src/com/google/common/util/concurrent/FutureFallback.java (line 51, column 50, end column 59)

Replace generic exceptions with specific library exceptions or a custom exception.
46 | *
47 | * @PARAM t the exception that made the future fail. If the future's {@link Future#get() get}
48 | * method throws an {@link ExecutionException}, then the cause is passed to this method. Any
49 | * other thrown object is passed unaltered.
50 | */

51 |   ListenableFuture<V> create(Throwable t) throws Exception;
    52 | }

Removed src/com/google/common/util/concurrent/Futures.java (line 793, column 62, end column 71)

Replace generic exceptions with specific library exceptions or a custom exception.
788 | setException(e);
789 | }
790 | }
791 |
792 | /** Template method for subtypes to actually run the fallback. */

793 | abstract void doFallback(F fallback, X throwable) throws Exception;
794 |
795 | @OverRide final void done() {
796 | maybePropagateCancellation(inputFuture);
797 | this.inputFuture = null;
798 | this.exceptionType = null;

java:S9438

Added src/main/java/org/apache/commons/beanutils2/BeanMap.java (line 42, column 5, end column 7)

Make this private field "final", it is never reassigned.
37 | import org.apache.commons.collections4.keyvalue.AbstractMapEntry;
38 |
39 | /**
40 | * An implementation of Map for JavaBeans which uses introspection to
41 | * get and put properties in the bean.

42 |  * <p>
    43 |  * If an exception occurs during attempts to get or set a property then the
    44 |  * property is considered non existent in the Map
    45 |  *
    46 |  */
    47 | public class BeanMap extends AbstractMap<Object, Object> implements Cloneable {

@github-actions

github-actions Bot commented Nov 6, 2026

Copy link
Copy Markdown
Contributor

Ruling Diff Summary

Detected changes in 1266 rule files: 0 issues removed, 164156 issues added.

S103 (java) on commons-beanutils - 0 issues removed, 24 issues added - new ruling file

Added src/main/java/org/apache/commons/beanutils2/BeanPropertyValueChangeClosure.java (line 134, column 1, end column 125)

Split this 124 characters long line (which is greater than 120 authorized).
       129 |      * object.
       130 |      * @param ignoreNull Determines whether <code>null</code> objects in the property path will
       131 |      * genenerate an <code>IllegalArgumentException</code> or not.
       132 |      * @throws IllegalArgumentException If the propertyName provided is null or empty.
       133 |      */
>>>    134 |     public BeanPropertyValueChangeClosure(final String propertyName, final Object propertyValue, final boolean ignoreNull) {
       135 |         super();
       136 | 
       137 |         if (propertyName != null && propertyName.length() > 0) {
       138 |             this.propertyName = propertyName;
       139 |             this.propertyValue = propertyValue;

Added src/main/java/org/apache/commons/beanutils2/BeanPropertyValueEqualsPredicate.java (line 164, column 1, end column 127)

Split this 126 characters long line (which is greater than 120 authorized).
       159 |      * @param propertyValue The value to use in object evaluation.
       160 |      * @param ignoreNull Determines whether <code>null</code> objects in the property path will
       161 |      * genenerate an <code>IllegalArgumentException</code> or not.
       162 |      * @throws IllegalArgumentException If the property name provided is null or empty.
       163 |      */
>>>    164 |     public BeanPropertyValueEqualsPredicate(final String propertyName, final Object propertyValue, final boolean ignoreNull) {
       165 |         super();
       166 | 
       167 |         if (propertyName != null && propertyName.length() > 0) {
       168 |             this.propertyName = propertyName;
       169 |             this.propertyValue = propertyValue;

Added src/main/java/org/apache/commons/beanutils2/MethodUtils.java (line 1319, column 1, end column 123)

Split this 122 characters long line (which is greater than 120 authorized).
      1314 |          * @param cls  the class to reflect, must not be null
      1315 |          * @param methodName  the method name to obtain
      1316 |          * @param paramTypes the array of classes representing the parameter types
      1317 |          * @param exact whether the match has to be exact.
      1318 |          */
>>>   1319 |         public MethodDescriptor(final Class<?> cls, final String methodName, Class<?>[] paramTypes, final boolean exact) {
      1320 |             if (cls == null) {
      1321 |                 throw new IllegalArgumentException("Class cannot be null");
      1322 |             }
      1323 |             if (methodName == null) {
      1324 |                 throw new IllegalArgumentException("Method Name cannot be null");

Added src/main/java/org/apache/commons/beanutils2/RowSetDynaClass.java (line 236, column 1, end column 126)

Split this 125 characters long line (which is greater than 120 authorized).
       231 |      *  is <code>null</code>
       232 |      * @throws SQLException if the metadata for this result set
       233 |      *  cannot be introspected
       234 |      * @since 1.8.3
       235 |      */
>>>    236 |     public RowSetDynaClass(final ResultSet resultSet, final boolean lowerCase, final int limit, final boolean useColumnLabel)
       237 |                                                             throws SQLException {
       238 | 
       239 |         if (resultSet == null) {
       240 |             throw new NullPointerException();
       241 |         }

Added src/main/java/org/apache/commons/beanutils2/converters/DateTimeConverter.java (line 555, column 1, end column 128)

Split this 127 characters long line (which is greater than 120 authorized).
       550 |      * @param format The DateFormat to parse the String value.
       551 |      *
       552 |      * @return The converted Calendar object.
       553 |      * @throws ConversionException if the String cannot be converted.
       554 |      */
>>>    555 |     private Calendar parse(final Class<?> sourceType, final Class<?> targetType, final String value, final DateFormat format) {
       556 |         logFormat("Parsing", format);
       557 |         format.setLenient(false);
       558 |         final ParsePosition pos = new ParsePosition(0);
       559 |         final Date parsedDate = format.parse(value, pos); // ignore the result (use the Calendar)
       560 |         if (pos.getErrorIndex() >= 0 || pos.getIndex() != value.length() || parsedDate == null) {

Added src/main/java/org/apache/commons/beanutils2/converters/NumberConverter.java (line 546, column 1, end column 128)

Split this 127 characters long line (which is greater than 120 authorized).
       541 |      * @param format The NumberFormat to parse the String value.
       542 |      *
       543 |      * @return The converted Number object.
       544 |      * @throws ConversionException if the String cannot be converted.
       545 |      */
>>>    546 |     private Number parse(final Class<?> sourceType, final Class<?> targetType, final String value, final NumberFormat format) {
       547 |         final ParsePosition pos = new ParsePosition(0);
       548 |         final Number parsedNumber = format.parse(value, pos);
       549 |         if (pos.getErrorIndex() >= 0 || pos.getIndex() != value.length() || parsedNumber == null) {
       550 |             String msg = "Error converting from '" + toString(sourceType) + "' to '" + toString(targetType) + "'";
       551 |             if (format instanceof DecimalFormat) {

Added src/main/java/org/apache/commons/beanutils2/locale/BaseLocaleConverter.java (line 111, column 1, end column 132)

Split this 131 characters long line (which is greater than 120 authorized).
       106 |      * @param defaultValue  The default value to be returned
       107 |      * @param locale        The locale
       108 |      * @param pattern       The convertion pattern
       109 |      * @param locPattern    Indicate whether the pattern is localized or not
       110 |      */
>>>    111 |     protected BaseLocaleConverter(final Object defaultValue, final Locale locale, final String pattern, final boolean locPattern) {
       112 | 
       113 |         this(defaultValue, locale, pattern, true, locPattern);
       114 |     }
       115 | 
       116 |     /**

Added src/main/java/org/apache/commons/beanutils2/locale/LocaleBeanUtils.java (line 618, column 1, end column 141)

Split this 140 characters long line (which is greater than 120 authorized).
       613 |      * @throws InvocationTargetException if the property accessor method
       614 |      *  throws an exception
       615 |      *
       616 |      * @see LocaleBeanUtilsBean#invokeSetter(Object, String, String, int, Object)
       617 |      */
>>>    618 |     protected static void invokeSetter(final Object target, final String propName, final String key, final int index, final Object newValue)
       619 |             throws IllegalAccessException, InvocationTargetException {
       620 | 
       621 |        LocaleBeanUtilsBean.getLocaleBeanUtilsInstance().invokeSetter(target, propName, key, index, newValue);
       622 |     }
       623 | }

Added src/main/java/org/apache/commons/beanutils2/locale/LocaleBeanUtilsBean.java (line 875, column 1, end column 134)

Split this 133 characters long line (which is greater than 120 authorized).
       870 |      * @throws IllegalAccessException if the caller does not have
       871 |      *  access to the property accessor method
       872 |      * @throws InvocationTargetException if the property accessor method
       873 |      *  throws an exception
       874 |      */
>>>    875 |     protected void invokeSetter(final Object target, final String propName, final String key, final int index, final Object newValue)
       876 |             throws IllegalAccessException, InvocationTargetException {
       877 | 
       878 |         try {
       879 |             if (index >= 0) {
       880 |                 getPropertyUtils().setIndexedProperty(target, propName,

Added src/main/java/org/apache/commons/beanutils2/locale/LocaleConvertUtils.java (line 235, column 1, end column 123)

Split this 122 characters long line (which is greater than 120 authorized).
       230 |      * @param locale The locale
       231 |      * @param pattern The convertion pattern
       232 |      * @return the converted value
       233 |      * @see LocaleConvertUtilsBean#convert(String[], Class, Locale, String)
       234 |      */
>>>    235 |     public static Object convert(final String[] values, final Class<?> clazz, final Locale locale, final String pattern) {
       236 | 
       237 |         return LocaleConvertUtilsBean.getInstance().convert(values, clazz, locale, pattern);
       238 |     }
       239 | 
       240 |     /**

Added src/main/java/org/apache/commons/beanutils2/locale/converters/BigDecimalLocaleConverter.java (line 197, column 1, end column 135)

Split this 134 characters long line (which is greater than 120 authorized).
       192 |      * @param defaultValue  The default value to be returned
       193 |      * @param locale        The locale
       194 |      * @param pattern       The convertion pattern
       195 |      * @param locPattern    Indicate whether the pattern is localized or not
       196 |      */
>>>    197 |     public BigDecimalLocaleConverter(final Object defaultValue, final Locale locale, final String pattern, final boolean locPattern) {
       198 | 
       199 |         super(defaultValue, locale, pattern, locPattern);
       200 |     }
       201 | 
       202 |     /**

Added src/main/java/org/apache/commons/beanutils2/locale/converters/BigIntegerLocaleConverter.java (line 198, column 1, end column 135)

Split this 134 characters long line (which is greater than 120 authorized).
       193 |      * @param defaultValue  The default value to be returned
       194 |      * @param locale        The locale
       195 |      * @param pattern       The convertion pattern
       196 |      * @param locPattern    Indicate whether the pattern is localized or not
       197 |      */
>>>    198 |     public BigIntegerLocaleConverter(final Object defaultValue, final Locale locale, final String pattern, final boolean locPattern) {
       199 | 
       200 |         super(defaultValue, locale, pattern, locPattern);
       201 |     }
       202 | 
       203 |     /**

Added src/main/java/org/apache/commons/beanutils2/locale/converters/ByteLocaleConverter.java (line 198, column 1, end column 129)

Split this 128 characters long line (which is greater than 120 authorized).
       193 |      * @param defaultValue  The default value to be returned
       194 |      * @param locale        The locale
       195 |      * @param pattern       The convertion pattern
       196 |      * @param locPattern    Indicate whether the pattern is localized or not
       197 |      */
>>>    198 |     public ByteLocaleConverter(final Object defaultValue, final Locale locale, final String pattern, final boolean locPattern) {
       199 | 
       200 |         super(defaultValue, locale, pattern, locPattern);
       201 |     }
       202 | 
       203 |     /**

Added src/main/java/org/apache/commons/beanutils2/locale/converters/DateLocaleConverter.java (line 219, column 1, end column 129)

Split this 128 characters long line (which is greater than 120 authorized).
       214 |      * @param defaultValue  The default value to be returned
       215 |      * @param locale        The locale
       216 |      * @param pattern       The convertion pattern
       217 |      * @param locPattern    Indicate whether the pattern is localized or not
       218 |      */
>>>    219 |     public DateLocaleConverter(final Object defaultValue, final Locale locale, final String pattern, final boolean locPattern) {
       220 | 
       221 |         super(defaultValue, locale, pattern, locPattern);
       222 |     }
       223 | 
       224 |     // --------------------------------------------------------- Methods

Added src/main/java/org/apache/commons/beanutils2/locale/converters/DecimalLocaleConverter.java (line 208, column 1, end column 132)

Split this 131 characters long line (which is greater than 120 authorized).
       203 |      * @param defaultValue  The default value to be returned
       204 |      * @param locale        The locale
       205 |      * @param pattern       The convertion pattern
       206 |      * @param locPattern    Indicate whether the pattern is localized or not
       207 |      */
>>>    208 |     public DecimalLocaleConverter(final Object defaultValue, final Locale locale, final String pattern, final boolean locPattern) {
       209 | 
       210 |         super(defaultValue, locale, pattern, locPattern);
       211 | 
       212 |     }
       213 | 
S104 (java) on commons-beanutils - 0 issues removed, 1 issues added - new ruling file

Added src/main/java/org/apache/commons/beanutils2/PropertyUtilsBean.java (file-level)

This file has 1,169 lines, which is greater than 750 authorized. Split it into smaller files.
>>> FILE-LEVEL ISSUE
         1 | /*
         2 |  * Licensed to the Apache Software Foundation (ASF) under one or more
         3 |  * contributor license agreements.  See the NOTICE file distributed with
         4 |  * this work for additional information regarding copyright ownership.
         5 |  * The ASF licenses this file to You under the Apache License, Version 2.0
         6 |  * (the "License"); you may not use this file except in compliance with
         7 |  * the License.  You may obtain a copy of the License at
         8 |  *
         9 |  *      http://www.apache.org/licenses/LICENSE-2.0
        10 |  *
        11 |  * Unless required by applicable law or agreed to in writing, software
S105 (java) on commons-beanutils - 0 issues removed, 2 issues added - new ruling file

Added src/main/java/org/apache/commons/beanutils2/BeanUtilsBean.java (file-level)

Replace all tab characters in this file by sequences of white-spaces.
>>> FILE-LEVEL ISSUE
         1 | /*
         2 |  * Licensed to the Apache Software Foundation (ASF) under one or more
         3 |  * contributor license agreements.  See the NOTICE file distributed with
         4 |  * this work for additional information regarding copyright ownership.
         5 |  * The ASF licenses this file to You under the Apache License, Version 2.0
         6 |  * (the "License"); you may not use this file except in compliance with
         7 |  * the License.  You may obtain a copy of the License at
         8 |  *
         9 |  *      http://www.apache.org/licenses/LICENSE-2.0
        10 |  *
        11 |  * Unless required by applicable law or agreed to in writing, software

Added src/main/java/org/apache/commons/beanutils2/DynaProperty.java (file-level)

Replace all tab characters in this file by sequences of white-spaces.
>>> FILE-LEVEL ISSUE
         1 | /*
         2 |  * Licensed to the Apache Software Foundation (ASF) under one or more
         3 |  * contributor license agreements.  See the NOTICE file distributed with
         4 |  * this work for additional information regarding copyright ownership.
         5 |  * The ASF licenses this file to You under the Apache License, Version 2.0
         6 |  * (the "License"); you may not use this file except in compliance with
         7 |  * the License.  You may obtain a copy of the License at
         8 |  *
         9 |  *      http://www.apache.org/licenses/LICENSE-2.0
        10 |  *
        11 |  * Unless required by applicable law or agreed to in writing, software
S106 (java) on commons-beanutils - 0 issues removed, 2 issues added - new ruling file

Added src/main/java/org/apache/commons/beanutils2/BeanMap.java (line 855, column 9, end column 19)

Replace this use of System.out by a logger.
       850 |      *
       851 |      * @param ex  the exception to log
       852 |      */
       853 |     protected void logInfo(final Exception ex) {
       854 |         // Deliberately do not use LOG4J or Commons Logging to avoid dependencies
>>>    855 |         System.out.println( "INFO: Exception: " + ex );
       856 |     }
       857 | 
       858 |     /**
       859 |      * Logs the given exception to <code>System.err</code>.  Used to display
       860 |      * errors while accessing/mutating the bean.

Added src/main/java/org/apache/commons/beanutils2/BeanMap.java (line 866, column 9, end column 19)

Replace this use of System.out by a logger.
       861 |      *
       862 |      * @param ex  the exception to log
       863 |      */
       864 |     protected void logWarn(final Exception ex) {
       865 |         // Deliberately do not use LOG4J or Commons Logging to avoid dependencies
>>>    866 |         System.out.println( "WARN: Exception: " + ex );
       867 |         ex.printStackTrace();
       868 |     }
       869 | }
S1066 (java) on commons-beanutils - 0 issues removed, 1 issues added - new ruling file

Added src/main/java/org/apache/commons/beanutils2/MethodUtils.java (line 1295, column 13, end column 15)

Merge this if statement with the enclosing one.
      1290 |      * @param md The method descriptor
      1291 |      * @param method The method to cache
      1292 |      */
      1293 |     private static void cacheMethod(final MethodDescriptor md, final Method method) {
      1294 |         if (CACHE_METHODS) {
>>>   1295 |             if (method != null) {
      1296 |                 cache.put(md, new WeakReference<>(method));
      1297 |             }
      1298 |         }
      1299 |     }
      1300 | 
S1067 (java) on commons-beanutils - 0 issues removed, 5 issues added - new ruling file

Added src/main/java/org/apache/commons/beanutils2/BasicDynaBean.java (line 436, column 13 to line 444, end column 60)

Reduce the number of conditional operators (16) used in the expression (maximum allowed 3).
       431 |      * @return <code>true</code> if the source class is assignable to the
       432 |      * destination class, otherwise <code>false</code>
       433 |      */
       434 |     protected boolean isAssignable(final Class<?> dest, final Class<?> source) {
       435 | 
>>>    436 |         if (dest.isAssignableFrom(source) ||
       437 |                 dest == Boolean.TYPE && source == Boolean.class ||
       438 |                 dest == Byte.TYPE && source == Byte.class ||
       439 |                 dest == Character.TYPE && source == Character.class ||
       440 |                 dest == Double.TYPE && source == Double.class ||
       441 |                 dest == Float.TYPE && source == Float.class ||

Added src/main/java/org/apache/commons/beanutils2/LazyDynaBean.java (line 848, column 13 to line 852, end column 46)

Reduce the number of conditional operators (4) used in the expression (maximum allowed 3).
       843 |      * @param type The class of the property
       844 |      * @return The new value
       845 |      */
       846 |     protected Object createOtherProperty(final String name, final Class<?> type) {
       847 | 
>>>    848 |         if (type == Object.class    ||
       849 |             type == String.class    ||
       850 |             type == Boolean.class   ||
       851 |             type == Character.class ||
       852 |             Date.class.isAssignableFrom(type)) {
       853 | 

Added src/main/java/org/apache/commons/beanutils2/LazyDynaBean.java (line 929, column 13 to line 937, end column 60)

Reduce the number of conditional operators (16) used in the expression (maximum allowed 3).
       924 |      * @return <code>true</code> if the source class is assignable to the
       925 |      * destination class, otherwise <code>false</code>
       926 |      */
       927 |     protected boolean isAssignable(final Class<?> dest, final Class<?> source) {
       928 | 
>>>    929 |         if (dest.isAssignableFrom(source) ||
       930 |                 dest == Boolean.TYPE && source == Boolean.class ||
       931 |                 dest == Byte.TYPE && source == Byte.class ||
       932 |                 dest == Character.TYPE && source == Character.class ||
       933 |                 dest == Double.TYPE && source == Double.class ||
       934 |                 dest == Float.TYPE && source == Float.class ||

Added src/main/java/org/apache/commons/beanutils2/MethodUtils.java (line 1067, column 25 to line 1071, end column 59)

Reduce the number of conditional operators (4) used in the expression (maximum allowed 3).
      1062 |             final Log log = LogFactory.getLog(MethodUtils.class);
      1063 |             if (!loggedAccessibleWarning) {
      1064 |                 boolean vulnerableJVM = false;
      1065 |                 try {
      1066 |                     final String specVersion = System.getProperty("java.specification.version");
>>>   1067 |                     if (specVersion.charAt(0) == '1' &&
      1068 |                             (specVersion.charAt(2) == '0' ||
      1069 |                              specVersion.charAt(2) == '1' ||
      1070 |                              specVersion.charAt(2) == '2' ||
      1071 |                              specVersion.charAt(2) == '3')) {
      1072 | 

Added src/main/java/org/apache/commons/beanutils2/locale/converters/StringLocaleConverter.java (line 236, column 13 to line 240, end column 39)

Reduce the number of conditional operators (4) used in the expression (maximum allowed 3).
       231 |     @Override
       232 |     protected Object parse(final Object value, final String pattern) throws ParseException {
       233 | 
       234 |         String result = null;
       235 | 
>>>    236 |         if (value instanceof Integer ||
       237 |                 value instanceof Long ||
       238 |                 value instanceof BigInteger ||
       239 |                 value instanceof Byte ||
       240 |                 value instanceof Short) {
       241 | 
S108 (java) on commons-beanutils - 0 issues removed, 3 issues added - new ruling file

Added src/test/java/org/apache/commons/beanutils2/MappedPropertyTestCase.java (line 290, column 38, end column 39)

Remove this block of code, fill it in, or add a comment explaining why it is empty.
       285 |         final String property = "protectedMapped";
       286 |         final Class<?> clazz = MappedPropertyChildBean.class;
       287 |         try {
       288 |             new MappedPropertyDescriptor(property, clazz);
       289 |             fail("Property '" + property + "' found in " + clazz.getName());
>>>    290 |         } catch (final Exception ex) {
       291 |         }
       292 |     }
       293 | 
       294 | 
       295 |     /**

Added src/test/java/org/apache/commons/beanutils2/MappedPropertyTestCase.java (line 320, column 38, end column 39)

Remove this block of code, fill it in, or add a comment explaining why it is empty.
       315 |         final String property = "XXXXXX";
       316 |         final Class<?> clazz = MappedPropertyTestInterface.class;
       317 |         try {
       318 |             new MappedPropertyDescriptor(property, clazz);
       319 |             fail("Property '" + property + "' found in " + clazz.getName());
>>>    320 |         } catch (final Exception ex) {
       321 |         }
       322 |     }
       323 | 
       324 |     /**
       325 |      * Test Interface Inherited mapped property

Added src/test/java/org/apache/commons/beanutils2/bugs/Jira347TestCase.java (line 114, column 47, end column 48)

Remove this block of code, fill it in, or add a comment explaining why it is empty.
       109 |             try {
       110 |                 long i = 0;
       111 |                 while (true && ref.get() != null) {
       112 |                     list.add("A Big String A Big String A Big String A Big String A Big String A Big String A Big String A Big String A Big String A Big String " + i++);
       113 |                 }
>>>    114 |             } catch (final Throwable ignored) {
       115 |             }
       116 |             list.clear();
       117 |             list = null;
       118 |             // System.out.println("Count " + count + " : " + getMemoryStats());
       119 |             System.gc();
S109 (java) on commons-beanutils - 0 issues removed, 19 issues added - new ruling file

Added src/main/java/org/apache/commons/beanutils2/MappedPropertyDescriptor.java (line 119, column 68, end column 69)

Assign this magic number 2 to a well-named constant, and use the constant instead.
       114 |              */
       115 |         }
       116 | 
       117 |         // If there's no read method, then look for just a write method
       118 |         if (mappedReadMethod == null) {
>>>    119 |             mappedWriteMethod = getMethod(beanClass, "set" + base, 2);
       120 |         }
       121 | 
       122 |         if (mappedReadMethod == null && mappedWriteMethod == null) {
       123 |             throw new IntrospectionException("Property '" + propertyName +
       124 |                     "' not found on " +

Added src/main/java/org/apache/commons/beanutils2/MappedPropertyDescriptor.java (line 175, column 56, end column 57)

Assign this magic number 2 to a well-named constant, and use the constant instead.
       170 |             final Class<?>[] params = { String.class, mappedReadMethod.getReturnType() };
       171 |             mappedWriteMethod =
       172 |                 getMethod(beanClass, mappedSetterName, params);
       173 |         } else {
       174 |             mappedWriteMethod =
>>>    175 |                 getMethod(beanClass, mappedSetterName, 2);
       176 |         }
       177 |         mappedReadMethodRef  = new MappedMethodReference(mappedReadMethod);
       178 |         mappedWriteMethodRef = new MappedMethodReference(mappedWriteMethod);
       179 | 
       180 |         findMappedPropertyType();

Added src/main/java/org/apache/commons/beanutils2/MappedPropertyDescriptor.java (line 302, column 38, end column 39)

Assign this magic number 2 to a well-named constant, and use the constant instead.
       297 |                 }
       298 |             }
       299 | 
       300 |             if (mappedWriteMethod != null) {
       301 |                 final Class<?>[] params = mappedWriteMethod.getParameterTypes();
>>>    302 |                 if (params.length != 2) {
       303 |                     throw new IntrospectionException
       304 |                             ("bad mapped write method arg count");
       305 |                 }
       306 |                 if (mappedPropertyType != null &&
       307 |                         mappedPropertyType != params[1]) {

Added src/main/java/org/apache/commons/beanutils2/MethodUtils.java (line 1068, column 49, end column 50)

Assign this magic number 2 to a well-named constant, and use the constant instead.
      1063 |             if (!loggedAccessibleWarning) {
      1064 |                 boolean vulnerableJVM = false;
      1065 |                 try {
      1066 |                     final String specVersion = System.getProperty("java.specification.version");
      1067 |                     if (specVersion.charAt(0) == '1' &&
>>>   1068 |                             (specVersion.charAt(2) == '0' ||
      1069 |                              specVersion.charAt(2) == '1' ||
      1070 |                              specVersion.charAt(2) == '2' ||
      1071 |                              specVersion.charAt(2) == '3')) {
      1072 | 
      1073 |                         vulnerableJVM = true;

Added src/main/java/org/apache/commons/beanutils2/MethodUtils.java (line 1069, column 49, end column 50)

Assign this magic number 2 to a well-named constant, and use the constant instead.
      1064 |                 boolean vulnerableJVM = false;
      1065 |                 try {
      1066 |                     final String specVersion = System.getProperty("java.specification.version");
      1067 |                     if (specVersion.charAt(0) == '1' &&
      1068 |                             (specVersion.charAt(2) == '0' ||
>>>   1069 |                              specVersion.charAt(2) == '1' ||
      1070 |                              specVersion.charAt(2) == '2' ||
      1071 |                              specVersion.charAt(2) == '3')) {
      1072 | 
      1073 |                         vulnerableJVM = true;
      1074 |                     }

Added src/main/java/org/apache/commons/beanutils2/MethodUtils.java (line 1070, column 49, end column 50)

Assign this magic number 2 to a well-named constant, and use the constant instead.
      1065 |                 try {
      1066 |                     final String specVersion = System.getProperty("java.specification.version");
      1067 |                     if (specVersion.charAt(0) == '1' &&
      1068 |                             (specVersion.charAt(2) == '0' ||
      1069 |                              specVersion.charAt(2) == '1' ||
>>>   1070 |                              specVersion.charAt(2) == '2' ||
      1071 |                              specVersion.charAt(2) == '3')) {
      1072 | 
      1073 |                         vulnerableJVM = true;
      1074 |                     }
      1075 |                 } catch (final SecurityException e) {

Added src/main/java/org/apache/commons/beanutils2/PropertyUtilsBean.java (line 1619, column 55, end column 56)

Assign this magic number 2 to a well-named constant, and use the constant instead.
      1614 |         if (descriptor instanceof IndexedPropertyDescriptor) {
      1615 |             Method writeMethod = ((IndexedPropertyDescriptor) descriptor).
      1616 |                     getIndexedWriteMethod();
      1617 |             writeMethod = MethodUtils.getAccessibleMethod(bean.getClass(), writeMethod);
      1618 |             if (writeMethod != null) {
>>>   1619 |                 final Object[] subscript = new Object[2];
      1620 |                 subscript[0] = Integer.valueOf(index);
      1621 |                 subscript[1] = value;
      1622 |                 try {
      1623 |                     if (log.isTraceEnabled()) {
      1624 |                         final String valueClassName =

Added src/main/java/org/apache/commons/beanutils2/PropertyUtilsBean.java (line 1787, column 52, end column 53)

Assign this magic number 2 to a well-named constant, and use the constant instead.
      1782 |             Method mappedWriteMethod =
      1783 |                     ((MappedPropertyDescriptor) descriptor).
      1784 |                     getMappedWriteMethod();
      1785 |             mappedWriteMethod = MethodUtils.getAccessibleMethod(bean.getClass(), mappedWriteMethod);
      1786 |             if (mappedWriteMethod != null) {
>>>   1787 |                 final Object[] params = new Object[2];
      1788 |                 params[0] = key;
      1789 |                 params[1] = value;
      1790 |                 if (log.isTraceEnabled()) {
      1791 |                     final String valueClassName =
      1792 |                         value == null ? "<null>" : value.getClass().getName();

Added src/main/java/org/apache/commons/beanutils2/converters/DateTimeConverter.java (line 303, column 57, end column 61)

Assign this magic number 1000 to a well-named constant, and use the constant instead.
       298 |             // ---------------------- JDK 1.3 Fix ----------------------
       299 |             // N.B. Prior to JDK 1.4 the Timestamp's getTime() method
       300 |             //      didn't include the milliseconds. The following code
       301 |             //      ensures it works consistently accross JDK versions
       302 |             final java.sql.Timestamp timestamp = (java.sql.Timestamp)value;
>>>    303 |             long timeInMillis = ((timestamp.getTime() / 1000) * 1000);
       304 |             timeInMillis += timestamp.getNanos() / 1000000;
       305 |             // ---------------------- JDK 1.3 Fix ----------------------
       306 |             return toDate(targetType, timeInMillis);
       307 |         }
       308 | 

Added src/main/java/org/apache/commons/beanutils2/converters/DateTimeConverter.java (line 303, column 65, end column 69)

Assign this magic number 1000 to a well-named constant, and use the constant instead.
       298 |             // ---------------------- JDK 1.3 Fix ----------------------
       299 |             // N.B. Prior to JDK 1.4 the Timestamp's getTime() method
       300 |             //      didn't include the milliseconds. The following code
       301 |             //      ensures it works consistently accross JDK versions
       302 |             final java.sql.Timestamp timestamp = (java.sql.Timestamp)value;
>>>    303 |             long timeInMillis = ((timestamp.getTime() / 1000) * 1000);
       304 |             timeInMillis += timestamp.getNanos() / 1000000;
       305 |             // ---------------------- JDK 1.3 Fix ----------------------
       306 |             return toDate(targetType, timeInMillis);
       307 |         }
       308 | 

Added src/main/java/org/apache/commons/beanutils2/converters/DateTimeConverter.java (line 304, column 52, end column 59)

Assign this magic number 1000000 to a well-named constant, and use the constant instead.
       299 |             // N.B. Prior to JDK 1.4 the Timestamp's getTime() method
       300 |             //      didn't include the milliseconds. The following code
       301 |             //      ensures it works consistently accross JDK versions
       302 |             final java.sql.Timestamp timestamp = (java.sql.Timestamp)value;
       303 |             long timeInMillis = ((timestamp.getTime() / 1000) * 1000);
>>>    304 |             timeInMillis += timestamp.getNanos() / 1000000;
       305 |             // ---------------------- JDK 1.3 Fix ----------------------
       306 |             return toDate(targetType, timeInMillis);
       307 |         }
       308 | 
       309 |         // Handle Date (includes java.sql.Date & java.sql.Time)

Added src/main/java/org/apache/commons/beanutils2/expression/DefaultResolver.java (line 98, column 53, end column 55)

Assign this magic number 10 to a well-named constant, and use the constant instead.
        93 |                 if (value.length() == 0) {
        94 |                     throw new IllegalArgumentException("No Index Value");
        95 |                 }
        96 |                 int index = 0;
        97 |                 try {
>>>     98 |                     index = Integer.parseInt(value, 10);
        99 |                 } catch (final Exception e) {
       100 |                     throw new IllegalArgumentException("Invalid index value '"
       101 |                             + value + "'");
       102 |                 }
       103 |                 return index;
S110 (java) on commons-beanutils - 0 issues removed, 1 issues added - new ruling file

Added src/main/java/org/apache/commons/beanutils2/NestedNullException.java (line 27, column 14, end column 33)

This class has 6 parents which is greater than 5 authorized.
        22 |  * against given bean since a nested bean referenced is null.
        23 |  *
        24 |  * @since 1.7
        25 |  */
        26 | 
>>>     27 | public class NestedNullException extends BeanAccessLanguageException {
        28 | 
        29 |     private static final long serialVersionUID = 1L;
        30 | 
        31 |     // --------------------------------------------------------- Constuctors
        32 | 
S1105 (java) on commons-beanutils - 0 issues removed, 2 issues added - new ruling file

Added src/main/java/org/apache/commons/beanutils2/BeanComparator.java (line 201, column 9, end column 10)

Move this left curly brace to the end of previous line of code.
       196 | 
       197 |         if (!comparator.equals(beanComparator.comparator)) {
       198 |             return false;
       199 |         }
       200 |         if (property != null)
>>>    201 |         {
       202 |             if (!property.equals(beanComparator.property)) {
       203 |                 return false;
       204 |             }
       205 |         }
       206 |         else

Added src/main/java/org/apache/commons/beanutils2/BeanComparator.java (line 207, column 9, end column 10)

Move this left curly brace to the end of previous line of code.
       202 |             if (!property.equals(beanComparator.property)) {
       203 |                 return false;
       204 |             }
       205 |         }
       206 |         else
>>>    207 |         {
       208 |             return beanComparator.property == null;
       209 |         }
       210 | 
       211 |         return true;
       212 |     }
S1107 (java) on commons-beanutils - 0 issues removed, 53 issues added - new ruling file

Added src/main/java/org/apache/commons/beanutils2/BeanComparator.java (line 168, column 9, end column 14)

Move this "catch" on the same line that the previous closing curly brace.
       163 |         try {
       164 |             final Object value1 = PropertyUtils.getProperty( o1, property );
       165 |             final Object value2 = PropertyUtils.getProperty( o2, property );
       166 |             return internalCompare( value1, value2 );
       167 |         }
>>>    168 |         catch ( final IllegalAccessException iae ) {
       169 |             throw new RuntimeException( "IllegalAccessException: " + iae.toString() );
       170 |         }
       171 |         catch ( final InvocationTargetException ite ) {
       172 |             throw new RuntimeException( "InvocationTargetException: " + ite.toString() );
       173 |         }

Added src/main/java/org/apache/commons/beanutils2/BeanComparator.java (line 171, column 9, end column 14)

Move this "catch" on the same line that the previous closing curly brace.
       166 |             return internalCompare( value1, value2 );
       167 |         }
       168 |         catch ( final IllegalAccessException iae ) {
       169 |             throw new RuntimeException( "IllegalAccessException: " + iae.toString() );
       170 |         }
>>>    171 |         catch ( final InvocationTargetException ite ) {
       172 |             throw new RuntimeException( "InvocationTargetException: " + ite.toString() );
       173 |         }
       174 |         catch ( final NoSuchMethodException nsme ) {
       175 |             throw new RuntimeException( "NoSuchMethodException: " + nsme.toString() );
       176 |         }

Added src/main/java/org/apache/commons/beanutils2/BeanComparator.java (line 174, column 9, end column 14)

Move this "catch" on the same line that the previous closing curly brace.
       169 |             throw new RuntimeException( "IllegalAccessException: " + iae.toString() );
       170 |         }
       171 |         catch ( final InvocationTargetException ite ) {
       172 |             throw new RuntimeException( "InvocationTargetException: " + ite.toString() );
       173 |         }
>>>    174 |         catch ( final NoSuchMethodException nsme ) {
       175 |             throw new RuntimeException( "NoSuchMethodException: " + nsme.toString() );
       176 |         }
       177 |     }
       178 | 
       179 |     /**

Added src/main/java/org/apache/commons/beanutils2/BeanMap.java (line 295, column 9, end column 14)

Move this "catch" on the same line that the previous closing curly brace.
       290 |         Class<? extends Object> beanClass = null;
       291 |         try {
       292 |             beanClass = bean.getClass();
       293 |             bean = beanClass.newInstance();
       294 |         }
>>>    295 |         catch (final Exception e) {
       296 |             final UnsupportedOperationException uoe =
       297 |                 new UnsupportedOperationException("Could not create new instance of class: " + beanClass);
       298 |             BeanUtils.initCause(uoe, e);
       299 |             throw uoe;
       300 |         }

Added src/main/java/org/apache/commons/beanutils2/BeanMap.java (line 361, column 17, end column 22)

Move this "catch" on the same line that the previous closing curly brace.
       356 |             final Method method = getReadMethod( name );
       357 |             if ( method != null ) {
       358 |                 try {
       359 |                     return method.invoke( bean, NULL_ARGUMENTS );
       360 |                 }
>>>    361 |                 catch (  final IllegalAccessException e ) {
       362 |                     logWarn( e );
       363 |                 }
       364 |                 catch ( final IllegalArgumentException e ) {
       365 |                     logWarn(  e );
       366 |                 }

Added src/main/java/org/apache/commons/beanutils2/BeanMap.java (line 364, column 17, end column 22)

Move this "catch" on the same line that the previous closing curly brace.
       359 |                     return method.invoke( bean, NULL_ARGUMENTS );
       360 |                 }
       361 |                 catch (  final IllegalAccessException e ) {
       362 |                     logWarn( e );
       363 |                 }
>>>    364 |                 catch ( final IllegalArgumentException e ) {
       365 |                     logWarn(  e );
       366 |                 }
       367 |                 catch ( final InvocationTargetException e ) {
       368 |                     logWarn(  e );
       369 |                 }

Added src/main/java/org/apache/commons/beanutils2/LazyDynaBean.java (line 725, column 17, end column 22)

Move this "catch" on the same line that the previous closing curly brace.
       720 |                 indexedProperty = defaultIndexedProperty(name);
       721 |             } else {
       722 |                 try {
       723 |                     indexedProperty = type.newInstance();
       724 |                 }
>>>    725 |                 catch (final Exception ex) {
       726 |                     throw new IllegalArgumentException
       727 |                         ("Error instantiating indexed property of type '" +
       728 |                                    type.getName() + "' for '" + name + "' " + ex);
       729 |                 }
       730 |             }

Added src/main/java/org/apache/commons/beanutils2/LazyDynaBean.java (line 764, column 13, end column 18)

Move this "catch" on the same line that the previous closing curly brace.
       759 | 
       760 |         } else if (Map.class.isAssignableFrom(type)) {
       761 |             try {
       762 |                 mappedProperty = type.newInstance();
       763 |             }
>>>    764 |             catch (final Exception ex) {
       765 |                 throw new IllegalArgumentException
       766 |                     ("Error instantiating mapped property of type '" +
       767 |                             type.getName() + "' for '" + name + "' " + ex);
       768 |             }
       769 |         } else {

Added src/main/java/org/apache/commons/beanutils2/LazyDynaBean.java (line 789, column 9, end column 14)

Move this "catch" on the same line that the previous closing curly brace.
       784 |      */
       785 |     protected Object createDynaBeanProperty(final String name, final Class<?> type) {
       786 |         try {
       787 |             return type.newInstance();
       788 |         }
>>>    789 |         catch (final Exception ex) {
       790 |             if (logger().isWarnEnabled()) {
       791 |                 logger().warn("Error instantiating DynaBean property of type '" +
       792 |                         type.getName() + "' for '" + name + "' " + ex);
       793 |             }
       794 |             return null;

Added src/main/java/org/apache/commons/beanutils2/ResultSetDynaClass.java (line 243, column 9, end column 14)

Move this "catch" on the same line that the previous closing curly brace.
       238 |     protected Class<?> loadClass(final String className) throws SQLException {
       239 | 
       240 |         try {
       241 |             return getClass().getClassLoader().loadClass(className);
       242 |         }
>>>    243 |         catch (final Exception e) {
       244 |             throw new SQLException("Cannot load column class '" +
       245 |                                    className + "': " + e);
       246 |         }
       247 |     }
       248 | }

Added src/main/java/org/apache/commons/beanutils2/locale/LocaleBeanUtilsBean.java (line 647, column 13, end column 17)

Move this "else" on the same line that the previous closing curly brace.
       642 |             sb.append(name);
       643 |             sb.append(", ");
       644 |             if (value == null) {
       645 |                 sb.append("<NULL>");
       646 |             }
>>>    647 |             else if (value instanceof String) {
       648 |                 sb.append((String) value);
       649 |             }
       650 |             else if (value instanceof String[]) {
       651 |                 final String[] values = (String[]) value;
       652 |                 sb.append('[');

Added src/main/java/org/apache/commons/beanutils2/locale/LocaleBeanUtilsBean.java (line 650, column 13, end column 17)

Move this "else" on the same line that the previous closing curly brace.
       645 |                 sb.append("<NULL>");
       646 |             }
       647 |             else if (value instanceof String) {
       648 |                 sb.append((String) value);
       649 |             }
>>>    650 |             else if (value instanceof String[]) {
       651 |                 final String[] values = (String[]) value;
       652 |                 sb.append('[');
       653 |                 for (int i = 0; i < values.length; i++) {
       654 |                     if (i > 0) {
       655 |                         sb.append(',');

Added src/main/java/org/apache/commons/beanutils2/locale/LocaleBeanUtilsBean.java (line 661, column 13, end column 17)

Move this "else" on the same line that the previous closing curly brace.
       656 |                     }
       657 |                     sb.append(values[i]);
       658 |                 }
       659 |                 sb.append(']');
       660 |             }
>>>    661 |             else {
       662 |                 sb.append(value.toString());
       663 |             }
       664 |             sb.append(')');
       665 |             log.trace(sb.toString());
       666 |         }

Added src/main/java/org/apache/commons/beanutils2/locale/LocaleConvertUtilsBean.java (line 144, column 9, end column 13)

Move this "else" on the same line that the previous closing curly brace.
       139 |     public void setDefaultLocale(final Locale locale) {
       140 | 
       141 |         if (locale == null) {
       142 |             defaultLocale = Locale.getDefault();
       143 |         }
>>>    144 |         else {
       145 |             defaultLocale = locale;
       146 |         }
       147 |     }
       148 | 
       149 |     /**

Added src/main/java/org/apache/commons/beanutils2/locale/LocaleConvertUtilsBean.java (line 440, column 9, end column 13)

Move this "else" on the same line that the previous closing curly brace.
       435 |         Map<Class<?>, LocaleConverter> localeConverters;
       436 | 
       437 |         if (locale == null) {
       438 |             localeConverters = (Map<Class<?>, LocaleConverter>) mapConverters.get(defaultLocale);
       439 |         }
>>>    440 |         else {
       441 |             localeConverters = (Map<Class<?>, LocaleConverter>) mapConverters.get(locale);
       442 | 
       443 |             if (localeConverters == null) {
       444 |                 localeConverters = create(locale);
       445 |                 mapConverters.put(locale, localeConverters);

... and 1255 more rules with changes (diff too large to display fully)

Comment thread .agents/skills/new-rule/SKILL.md Resolved
Co-authored-by: Romain Brenguier <11854194+romainbrenguier@users.noreply.github.com>
@gitar-bot

gitar-bot Bot commented Nov 6, 2026 •

Copy link
Copy Markdown
Code Review ✅ Approved 3 closed / 3 findings

🟡 Medium risk · Switching rule-triage guidance to CI SARIF artifacts could omit or misclassify findings if artifacts and expected baselines diverge.

Ruling-diff reporting change for SARIF-based ruling expectations, with the stale AGENTS.md JSON documentation, the skill's local target/actual paths, and the sonar-server SARIF baseline gap all addressed. No open issues remain.

✅ 3 closed
✅ Quality: AGENTS.md still documents JSON ruling expectations

📄 .agents/skills/new-rule/SKILL.md:88
This PR replaces every expected/<project>/java-<RULE>.json with .sarif, and commit 661677d updates README.md and the new-rule skill to match. AGENTS.md (which CLAUDE.md symlinks to) was missed. Its Ruling Tests section still gives .json paths for expected and actual output, plus the old format {"<projectKey>:path": [lines]}. None of those files exist anymore, so agents following AGENTS.md will look for the wrong files and parse the wrong schema. Fix: change the paths to .sarif and describe runs[].results[] with locations[0].physicalLocation instead of the line map.

✅ Quality: Skill points to local target/actual that agents never generate

📄 .agents/skills/new-rule/SKILL.md:84-88
The rewritten Step 6 tells the agent to collect new findings by diffing its/ruling/target/actual/<project>/java-<RULE_ID>.sarif against the expected file. But AGENTS.md says not to run ruling tests locally, and Step 5 of the same skill relies on CI's auto-generated expectations PR. So target/actual won't exist in the agent's checkout, and after that PR is merged, actual and expected are identical anyway. The old text pointed at the expectation diff (the expected files changed by the auto PR), which is something the agent can actually get. Fix: say the new findings are the results[] entries added to expected/<project>/java-<RULE_ID>.sarif by the auto-generated ruling PR (its git diff).

✅ Cross-PR: sonar-server ruling would have no SARIF baselines after both merge

📄 its/ruling/src/test/java/org/sonar/java/it/JavaRulingTest.java:185 📄 its/ruling/src/test/java/org/sonar/java/it/JavaRulingTest.java:402
Breaks when this PR and #6436 both merge (after ruling_java#18), and the sonarqube_server ruling test then runs against expected/sonar-server, which has only legacy .json baselines.

How

  1. This PR keeps projectName = "sonarqube-6.5" in sonarqube_server() (its/ruling/src/test/java/org/sonar/java/it/JavaRulingTest.java:402) and converts the baselines to expected/sonarqube-6.5/*.sarif with sonarqube-6.5: URIs.
  2. This PR's subset copy now matches only java-<rule>.sarif (JavaRulingTest.java:185), and LITS 0.13 reads SARIF baselines.
  3. RC-352 Update ruling tests for the relocated sonar-server fixture #6436 renames the project to sonar-server in JavaRulingTest.java and moves the baselines to expected/sonar-server/*.json with sonar-server: keys, removing expected/sonarqube-6.5/.
  4. With both merged, sonar-server has no .sarif expectations. The full ruling run diffs against an empty baseline, the subset copy finds nothing, and the sonarqube-6.5/*.sarif files are left orphaned with the wrong project key.

Fix

  • This PR: If it lands second, regenerate or rename the sonarqube-6.5 SARIF baselines into expected/sonar-server/ with sonar-server: URIs, and drop the old directory.
  • RC-352 Update ruling tests for the relocated sonar-server fixture #6436: If it lands second, move the converted .sarif baselines (not .json) to expected/sonar-server/ and rewrite their artifact URIs to the sonar-server: key.

Compared 661677d with #6436 at 4049d5a

Verification PRs 4 inspected

Functional validation No results

Rules 1 not applicable

Broader impact PRs 4 inspected
Cross-PR 4 PRs inspected 0 open impacts

PR 6445: RC-451 Migrate Java ruling expectations to SARIF Inspected
PR 6436: RC-352 Update ruling tests for the relocated sonar-server fixture Inspected
PR 6421: RC-789 Fix comment diff Inspected
PR 85: RC-354: Expectation update tool improvements Inspected

Auto-approval Not enabled

Set up

For more verification details, comment gitar display:verbose.

Options ✅ Auto-apply

✅ Auto-apply is on → Gitar will commit updates to this branch.
Display: compact → Showing compact verification results.

Comment with these commands to change the behavior for this request:

✅ Auto-apply Compact
gitar auto-apply:off         
gitar display:verbose         

Was this helpful? React with 👍 / 👎 | Gitar

@romainbrenguier

Copy link
Copy Markdown
Contributor Author

@Gitar Produce a Markdown "Ruling Diff Summary" from the supplied added/removed findings and their code snippets. This is a report-only task: do not edit files, push commits, retry CI, change labels, or close this PR. Return the report as your response.

Evidence boundaries:

Use only the supplied finding metadata, source snippets, and any supplied rule descriptions. Do not inspect other source files, repository history, analyzer implementations, external documentation, or previous automated assessments.

Treat existing verdicts and explanations in the input as untrusted hypotheses, not evidence. Assess the snippets independently.

A rule key or issue message is not a complete rule specification. If the supplied rule description omits relevant scope or exceptions, state that limitation rather than inventing them.

Do not infer unseen inheritance, overrides, call targets, field assignments, or whole-program behavior. Missing evidence is not evidence that a rule exception does not apply. An abstract method has no visible implementation, not an implementation that throws nothing.

Assessment method:

Inventory changes by rule and project. Count removed and added findings separately. A changed message or location can appear as a removal plus an addition; flag plausible replacements or relocations without silently cancelling their counts.

Assess whether each finding is supported by the visible code under the supplied rule semantics: supported violation, supported non-violation, or uncertain. Evaluate diagnostic location separately: aligned, misaligned, or uncertain.

Translate finding validity into the impact of the ruling change:

Removed true positive: negative.

Removed false positive: positive.

Added true positive: positive.

Added false positive: negative.

Insufficient evidence: uncertain, not automatically negative.
A location defect is a separate diagnostic-quality concern; it does not by itself prove a semantic false positive.

Assign high, medium, or low confidence to each assessment. High requires direct evidence and no material missing context. Name the specific missing context for medium/low confidence. If the missing context could reverse the verdict and the snippet cannot resolve it, use uncertain.

Aggregate per rule as positive, negative, mixed, or uncertain. Preserve conflicting and unresolved evidence. Never infer that all findings share the verdict of one representative example. Explain the basis and assessment coverage. Do not extrapolate sampled findings to unreviewed findings.

Output format:

Ruling Diff Summary

Detected changes in N rule files: R issues removed, A issues added.
Use "rules" instead of "rule files" if file identities are not supplied. If the input is incomplete, label counts as supplied totals or visible-subset counts. Never invent totals.

Rule overview

A table with: Rule | Projects | Removed / added | Automated assessment | Confidence.
Link rule keys to the corresponding detail sections using working Markdown anchors. Use supplied source/PR links only when available; do not invent URLs.

Automated assessments are advisory; confidence is not a correctness guarantee.

Each rule

Rule key, projects, removed/added counts, overall assessment and confidence.

A short explanation grounded in concrete visible evidence, distinguishing semantic correctness, location quality, and uncertainty.

"Source examples: X of Y changed findings shown", only when Y is known. State how many findings had usable snippets and how many were actually assessed.

Show at most 15 examples per rule. Prioritize supported regressions, then conflicting/uncertain cases and representative improvements. Choose diverse patterns rather than repeating near-identical declarations. Make clear when only a subset is displayed.

For each displayed example include project, added/removed status, selection reason, validity assessment, change impact, location assessment, confidence, and a brief rationale. Preserve the exact supplied file path, location, issue message, and code snippet. Preserve line numbers and the >>> marker; do not fabricate missing coordinates or code.

For plausible removal/addition pairs, explain whether the visible evidence suggests a changed message, shifted location, changed rule attribution, or a genuinely different finding. Keep raw counts unchanged.

Do not force the report to match any example verdict. In particular, a finding pointing at Javadoc without the relevant declaration or assignments supports a location concern and an uncertain semantic verdict, not a proven false positive.

If the necessary findings or snippets are absent, say what input is missing instead of generating a report from assumptions.

java:S106

Input follows:
Removed src/main/java/org/apache/commons/beanutils2/BeanMap.java (line 866, column 9, end column 19)

Replace this use of System.out by a logger.
861 | *
862 | * @PARAM ex the exception to log
863 | */
864 | protected void logWarn(final Exception ex) {
865 | // Deliberately do not use LOG4J or Commons Logging to avoid dependencies

866 | System.out.println( "WARN: Exception: " + ex );
867 | ex.printStackTrace();
868 | }
869 | }

java:S112

Removed src/com/google/common/cache/CacheLoader.java (line 121, column 63, end column 72)

Replace generic exceptions with specific library exceptions or a custom exception.
116 | * @throws InterruptedException if this method is interrupted. {@code InterruptedException} is
117 | * treated like any other {@code Exception} in all respects except that, when it is caught,
118 | * the thread's interrupt status is set
119 | * @SInCE 11.0
120 | */

121 | public Map<K, V> loadAll(Iterable<? extends K> keys) throws Exception {
122 | // This will be caught by getAll(), causing it to fall back to multiple calls to
123 | // LoadingCache.get
124 | throw new UnsupportedLoadingOperationException();
125 | }
126 |
Removed src/com/google/common/cache/CacheLoader.java (line 69, column 40, end column 49)

Replace generic exceptions with specific library exceptions or a custom exception.
64 | * @throws Exception if unable to load the result
65 | * @throws InterruptedException if this method is interrupted. {@code InterruptedException} is
66 | * treated like any other {@code Exception} in all respects except that, when it is caught,
67 | * the thread's interrupt status is set
68 | */

69 |   public abstract V load(K key) throws Exception;
    70 | 
    71 |   /**
    72 |    * Computes or retrieves a replacement value corresponding to an already-cached {@code key}. This
    73 |    * method is called when an existing cache entry is refreshed by
    74 |    * {@link CacheBuilder#refreshAfterWrite}, or through a call to {@link LoadingCache#refresh}.

Added src/com/google/common/cache/CacheLoader.java (line 69, column 5, end column 10)

RC-451 smoke test: define and throw a dedicated exception instead of using a generic one.
64 | * @throws Exception if unable to load the result
65 | * @throws InterruptedException if this method is interrupted. {@code InterruptedException} is
66 | * treated like any other {@code Exception} in all respects except that, when it is caught,
67 | * the thread's interrupt status is set
68 | */

69 |   public abstract V load(K key) throws Exception;
    70 | 
    71 |   /**
    72 |    * Computes or retrieves a replacement value corresponding to an already-cached {@code key}. This
    73 |    * method is called when an existing cache entry is refreshed by
    74 |    * {@link CacheBuilder#refreshAfterWrite}, or through a call to {@link LoadingCache#refresh}.

Removed src/com/google/common/reflect/AbstractInvocationHandler.java (line 99, column 14, end column 23)

Replace generic exceptions with specific library exceptions or a custom exception.
94 | *
95 | *

Unlike {@link #invoke}, {@code args} will never be null. When the method has no parameter,
96 | * an empty array is passed in.
97 | */
98 | protected abstract Object handleInvocation(Object proxy, Method method, Object[] args)

99 |       throws Throwable;
   100 | 
   101 |   /**
   102 |    * By default delegates to {@link Object#equals} so instances are only equal if they are
   103 |    * identical. {@code proxy.equals(argument)} returns true if: <ul>
   104 |    * <li>{@code proxy} and {@code argument} are of the same type

Removed src/com/google/common/util/concurrent/AbstractExecutionThreadService.java (line 100, column 35, end column 44)

Replace generic exceptions with specific library exceptions or a custom exception.
95 | /**
96 | * Start the service. This method is invoked on the execution thread.
97 | *
98 | *

By default this method does nothing.
99 | */

100 | protected void startUp() throws Exception {}
101 |
102 | /**
103 | * Run the service. This method is invoked on the execution thread.
104 | * Implementations must respond to stop requests. You could poll for lifecycle
105 | * changes in a work loop:
Removed src/com/google/common/util/concurrent/AbstractExecutionThreadService.java (line 116, column 40, end column 49)

Replace generic exceptions with specific library exceptions or a custom exception.
111 | * }
112 | *
113 | * ...or you could respond to stop requests by implementing {@link
114 | * #triggerShutdown()}, which should cause {@link #run()} to return.
115 | */

116 | protected abstract void run() throws Exception;
117 |
118 | /**
119 | * Stop the service. This method is invoked on the execution thread.
120 | *
121 | *

By default this method does nothing.
Removed src/com/google/common/util/concurrent/AbstractExecutionThreadService.java (line 124, column 36, end column 45)

Replace generic exceptions with specific library exceptions or a custom exception.
119 | * Stop the service. This method is invoked on the execution thread.
120 | *
121 | *

By default this method does nothing.
122 | */
123 | // TODO: consider supporting a TearDownTestCase-like API

124 | protected void shutDown() throws Exception {}
125 |
126 | /**
127 | * Invoked to request the service to stop.
128 | *
129 | *

By default this method does nothing.
Removed src/com/google/common/util/concurrent/AbstractIdleService.java (line 81, column 44, end column 53)

Replace generic exceptions with specific library exceptions or a custom exception.
76 |
77 | /** Constructor for use by subclasses. /
78 | protected AbstractIdleService() {}
79 |
80 | /
* Start the service. */

81 |   protected abstract void startUp() throws Exception;
    82 | 
    83 |   /** Stop the service. */
    84 |   protected abstract void shutDown() throws Exception;
    85 | 
    86 |   /**

Removed src/com/google/common/util/concurrent/AbstractIdleService.java (line 84, column 45, end column 54)

Replace generic exceptions with specific library exceptions or a custom exception.
79 |
80 | /** Start the service. /
81 | protected abstract void startUp() throws Exception;
82 |
83 | /
* Stop the service. */

84 |   protected abstract void shutDown() throws Exception;
    85 | 
    86 |   /**
    87 |    * Returns the {@link Executor} that will be used to run this service.
    88 |    * Subclasses may override this method to use a custom {@link Executor}, which
    89 |    * may configure its worker thread with a specific name, thread group or

Removed src/com/google/common/util/concurrent/AbstractScheduledService.java (line 265, column 52, end column 61)

Replace generic exceptions with specific library exceptions or a custom exception.
260 | /**
261 | * Run one iteration of the scheduled task. If any invocation of this method throws an exception,
262 | * the service will transition to the {@link Service.State#FAILED} state and this method will no
263 | * longer be called.
264 | */

265 | protected abstract void runOneIteration() throws Exception;
266 |
267 | /**
268 | * Start the service.
269 | *
270 | *

By default this method does nothing.
Removed src/com/google/common/util/concurrent/AbstractScheduledService.java (line 272, column 35, end column 44)

Replace generic exceptions with specific library exceptions or a custom exception.
267 | /**
268 | * Start the service.
269 | *
270 | *

By default this method does nothing.
271 | */

272 | protected void startUp() throws Exception {}
273 |
274 | /**
275 | * Stop the service. This is guaranteed not to run concurrently with {@link #runOneIteration}.
276 | *
277 | *

By default this method does nothing.
Removed src/com/google/common/util/concurrent/AbstractScheduledService.java (line 279, column 36, end column 45)

Replace generic exceptions with specific library exceptions or a custom exception.
274 | /**
275 | * Stop the service. This is guaranteed not to run concurrently with {@link #runOneIteration}.
276 | *
277 | *

By default this method does nothing.
278 | */

279 | protected void shutDown() throws Exception {}
280 |
281 | /**
282 | * Returns the {@link Scheduler} object used to configure this service. This method will only be
283 | * called once.
284 | */
Removed src/com/google/common/util/concurrent/AsyncFunction.java (line 43, column 55, end column 64)

Replace generic exceptions with specific library exceptions or a custom exception.
38 | * done}, making {@code AsyncFunction} suitable for asynchronous derivations.
39 | *
40 | *

Throwing an exception from this method is equivalent to returning a
41 | * failing {@code Future}.
42 | */

43 |   ListenableFuture<O> apply(@Nullable I input) throws Exception;
    44 | }

Removed src/com/google/common/util/concurrent/FutureFallback.java (line 51, column 50, end column 59)

Replace generic exceptions with specific library exceptions or a custom exception.
46 | *
47 | * @PARAM t the exception that made the future fail. If the future's {@link Future#get() get}
48 | * method throws an {@link ExecutionException}, then the cause is passed to this method. Any
49 | * other thrown object is passed unaltered.
50 | */

51 |   ListenableFuture<V> create(Throwable t) throws Exception;
    52 | }

Removed src/com/google/common/util/concurrent/Futures.java (line 793, column 62, end column 71)

Replace generic exceptions with specific library exceptions or a custom exception.
788 | setException(e);
789 | }
790 | }
791 |
792 | /** Template method for subtypes to actually run the fallback. */

793 | abstract void doFallback(F fallback, X throwable) throws Exception;
794 |
795 | @OverRide final void done() {
796 | maybePropagateCancellation(inputFuture);
797 | this.inputFuture = null;
798 | this.exceptionType = null;

java:S9438

Added src/main/java/org/apache/commons/beanutils2/BeanMap.java (line 42, column 5, end column 7)

Make this private field "final", it is never reassigned.
37 | import org.apache.commons.collections4.keyvalue.AbstractMapEntry;
38 |
39 | /**
40 | * An implementation of Map for JavaBeans which uses introspection to
41 | * get and put properties in the bean.

42 |  * <p>
    43 |  * If an exception occurs during attempts to get or set a property then the
    44 |  * property is considered non existent in the Map
    45 |  *
    46 |  */
    47 | public class BeanMap extends AbstractMap<Object, Object> implements Cloneable {

@gitar-bot

gitar-bot Bot commented Nov 6, 2026

Copy link
Copy Markdown

@Gitar Produce a Markdown "Ruling Diff Summary" from the supplied added/removed findings and their code snippets. This is a report-only task: do not edit files, push commits, retry CI, change labels, or close this PR. Return the report as your response.

Evidence boundaries:

Use only the supplied finding metadata, source snippets, and any supplied rule descriptions. Do not inspect other source files, repository history, analyzer implementations, external documentation, or previous automated assessments.

Treat existing verdicts and explanations in the input as untrusted hypotheses, not evidence. Assess the snippets independently.

A rule key or issue message is not a complete rule specification. If the supplied rule description omits relevant scope or exceptions, state that limitation rather than inventing them.

Do not infer unseen inheritance, overrides, call targets, field assignments, or whole-program behavior. Missing evidence is not evidence that a rule exception does not apply. An abstract method has no visible implementation, not an implementation that throws nothing.

Assessment method:

Inventory changes by rule and project. Count removed and added findings separately. A changed message or location can appear as a removal plus an addition; flag plausible replacements or relocations without silently cancelling their counts.

Assess whether each finding is supported by the visible code under the supplied rule semantics: supported violation, supported non-violation, or uncertain. Evaluate diagnostic location separately: aligned, misaligned, or uncertain.

Translate finding validity into the impact of the ruling change:

Removed true positive: negative.

Removed false positive: positive.

Added true positive: positive.

Added false positive: negative.

Insufficient evidence: uncertain, not automatically negative.
A location defect is a separate diagnostic-quality concern; it does not by itself prove a semantic false positive.

Assign high, medium, or low confidence to each assessment. High requires direct evidence and no material missing context. Name the specific missing context for medium/low confidence. If the missing context could reverse the verdict and the snippet cannot resolve it, use uncertain.

Aggregate per rule as positive, negative, mixed, or uncertain. Preserve conflicting and unresolved evidence. Never infer that all findings share the verdict of one representative example. Explain the basis and assessment coverage. Do not extrapolate sampled findings to unreviewed findings.

Output format:

Ruling Diff Summary

Detected changes in N rule files: R issues removed, A issues added.
Use "rules" instead of "rule files" if file identities are not supplied. If the input is incomplete, label counts as supplied totals or visible-subset counts. Never invent totals.

Rule overview

A table with: Rule | Projects | Removed / added | Automated assessment | Confidence.
Link rule keys to the corresponding detail sections using working Markdown anchors. Use supplied source/PR links only when available; do not invent URLs.

Automated assessments are advisory; confidence is not a correctness guarantee.

Each rule

Rule key, projects, removed/added counts, overall assessment and confidence.

A short explanation grounded in concrete visible evidence, distinguishing semantic correctness, location quality, and uncertainty.

"Source examples: X of Y changed findings shown", only when Y is known. State how many findings had usable snippets and how many were actually assessed.

Show at most 15 examples per rule. Prioritize supported regressions, then conflicting/uncertain cases and representative improvements. Choose diverse patterns rather than repeating near-identical declarations. Make clear when only a subset is displayed.

For each displayed example include project, added/removed status, selection reason, validity assessment, change impact, location assessment, confidence, and a brief rationale. Preserve the exact supplied file path, location, issue message, and code snippet. Preserve line numbers and the >>> marker; do not fabricate missing coordinates or code.

For plausible removal/addition pairs, explain whether the visible evidence suggests a changed message, shifted location, changed rule attribution, or a genuinely different finding. Keep raw counts unchanged.

Do not force the report to match any example verdict. In particular, a finding pointing at Javadoc without the relevant declaration or assignments supports a location concern and an uncertain semantic verdict, not a proven false positive.

If the necessary findings or snippets are absent, say what input is missing instead of generating a report from assumptions.

java:S106

Input follows:
Removed src/main/java/org/apache/commons/beanutils2/BeanMap.java (line 866, column 9, end column 19)

Replace this use of System.out by a logger.
861 | *
862 | * @PARAM ex the exception to log
863 | */
864 | protected void logWarn(final Exception ex) {
865 | // Deliberately do not use LOG4J or Commons Logging to avoid dependencies

866 | System.out.println( "WARN: Exception: " + ex );
867 | ex.printStackTrace();
868 | }
869 | }

java:S112

Removed src/com/google/common/cache/CacheLoader.java (line 121, column 63, end column 72)

Replace generic exceptions with specific library exceptions or a custom exception.
116 | * @throws InterruptedException if this method is interrupted. {@code InterruptedException} is
117 | * treated like any other {@code Exception} in all respects except that, when it is caught,
118 | * the thread's interrupt status is set
119 | * @SInCE 11.0
120 | */

121 | public Map<K, V> loadAll(Iterable<? extends K> keys) throws Exception {
122 | // This will be caught by getAll(), causing it to fall back to multiple calls to
123 | // LoadingCache.get
124 | throw new UnsupportedLoadingOperationException();
125 | }
126 |
Removed src/com/google/common/cache/CacheLoader.java (line 69, column 40, end column 49)

Replace generic exceptions with specific library exceptions or a custom exception.
64 | * @throws Exception if unable to load the result
65 | * @throws InterruptedException if this method is interrupted. {@code InterruptedException} is
66 | * treated like any other {@code Exception} in all respects except that, when it is caught,
67 | * the thread's interrupt status is set
68 | */

69 |   public abstract V load(K key) throws Exception;
    70 | 
    71 |   /**
    72 |    * Computes or retrieves a replacement value corresponding to an already-cached {@code key}. This
    73 |    * method is called when an existing cache entry is refreshed by
    74 |    * {@link CacheBuilder#refreshAfterWrite}, or through a call to {@link LoadingCache#refresh}.

Added src/com/google/common/cache/CacheLoader.java (line 69, column 5, end column 10)

RC-451 smoke test: define and throw a dedicated exception instead of using a generic one.
64 | * @throws Exception if unable to load the result
65 | * @throws InterruptedException if this method is interrupted. {@code InterruptedException} is
66 | * treated like any other {@code Exception} in all respects except that, when it is caught,
67 | * the thread's interrupt status is set
68 | */

69 |   public abstract V load(K key) throws Exception;
    70 | 
    71 |   /**
    72 |    * Computes or retrieves a replacement value corresponding to an already-cached {@code key}. This
    73 |    * method is called when an existing cache entry is refreshed by
    74 |    * {@link CacheBuilder#refreshAfterWrite}, or through a call to {@link LoadingCache#refresh}.

Removed src/com/google/common/reflect/AbstractInvocationHandler.java (line 99, column 14, end column 23)

Replace generic exceptions with specific library exceptions or a custom exception.
94 | *
95 | *

Unlike {@link #invoke}, {@code args} will never be null. When the method has no parameter,
96 | * an empty array is passed in.
97 | */
98 | protected abstract Object handleInvocation(Object proxy, Method method, Object[] args)

99 |       throws Throwable;
   100 | 
   101 |   /**
   102 |    * By default delegates to {@link Object#equals} so instances are only equal if they are
   103 |    * identical. {@code proxy.equals(argument)} returns true if: <ul>
   104 |    * <li>{@code proxy} and {@code argument} are of the same type

Removed src/com/google/common/util/concurrent/AbstractExecutionThreadService.java (line 100, column 35, end column 44)

Replace generic exceptions with specific library exceptions or a custom exception.
95 | /**
96 | * Start the service. This method is invoked on the execution thread.
97 | *
98 | *

By default this method does nothing.
99 | */

100 | protected void startUp() throws Exception {}
101 |
102 | /**
103 | * Run the service. This method is invoked on the execution thread.
104 | * Implementations must respond to stop requests. You could poll for lifecycle
105 | * changes in a work loop:
Removed src/com/google/common/util/concurrent/AbstractExecutionThreadService.java (line 116, column 40, end column 49)

Replace generic exceptions with specific library exceptions or a custom exception.
111 | * }
112 | *
113 | * ...or you could respond to stop requests by implementing {@link
114 | * #triggerShutdown()}, which should cause {@link #run()} to return.
115 | */

116 | protected abstract void run() throws Exception;
117 |
118 | /**
119 | * Stop the service. This method is invoked on the execution thread.
120 | *
121 | *

By default this method does nothing.
Removed src/com/google/common/util/concurrent/AbstractExecutionThreadService.java (line 124, column 36, end column 45)

Replace generic exceptions with specific library exceptions or a custom exception.
119 | * Stop the service. This method is invoked on the execution thread.
120 | *
121 | *

By default this method does nothing.
122 | */
123 | // TODO: consider supporting a TearDownTestCase-like API

124 | protected void shutDown() throws Exception {}
125 |
126 | /**
127 | * Invoked to request the service to stop.
128 | *
129 | *

By default this method does nothing.
Removed src/com/google/common/util/concurrent/AbstractIdleService.java (line 81, column 44, end column 53)

Replace generic exceptions with specific library exceptions or a custom exception.
76 |
77 | /** Constructor for use by subclasses. /
78 | protected AbstractIdleService() {}
79 |
80 | /
* Start the service. */

81 |   protected abstract void startUp() throws Exception;
    82 | 
    83 |   /** Stop the service. */
    84 |   protected abstract void shutDown() throws Exception;
    85 | 
    86 |   /**

Removed src/com/google/common/util/concurrent/AbstractIdleService.java (line 84, column 45, end column 54)

Replace generic exceptions with specific library exceptions or a custom exception.
79 |
80 | /** Start the service. /
81 | protected abstract void startUp() throws Exception;
82 |
83 | /
* Stop the service. */

84 |   protected abstract void shutDown() throws Exception;
    85 | 
    86 |   /**
    87 |    * Returns the {@link Executor} that will be used to run this service.
    88 |    * Subclasses may override this method to use a custom {@link Executor}, which
    89 |    * may configure its worker thread with a specific name, thread group or

Removed src/com/google/common/util/concurrent/AbstractScheduledService.java (line 265, column 52, end column 61)

Replace generic exceptions with specific library exceptions or a custom exception.
260 | /**
261 | * Run one iteration of the scheduled task. If any invocation of this method throws an exception,
262 | * the service will transition to the {@link Service.State#FAILED} state and this method will no
263 | * longer be called.
264 | */

265 | protected abstract void runOneIteration() throws Exception;
266 |
267 | /**
268 | * Start the service.
269 | *
270 | *

By default this method does nothing.
Removed src/com/google/common/util/concurrent/AbstractScheduledService.java (line 272, column 35, end column 44)

Replace generic exceptions with specific library exceptions or a custom exception.
267 | /**
268 | * Start the service.
269 | *
270 | *

By default this method does nothing.
271 | */

272 | protected void startUp() throws Exception {}
273 |
274 | /**
275 | * Stop the service. This is guaranteed not to run concurrently with {@link #runOneIteration}.
276 | *
277 | *

By default this method does nothing.
Removed src/com/google/common/util/concurrent/AbstractScheduledService.java (line 279, column 36, end column 45)

Replace generic exceptions with specific library exceptions or a custom exception.
274 | /**
275 | * Stop the service. This is guaranteed not to run concurrently with {@link #runOneIteration}.
276 | *
277 | *

By default this method does nothing.
278 | */

279 | protected void shutDown() throws Exception {}
280 |
281 | /**
282 | * Returns the {@link Scheduler} object used to configure this service. This method will only be
283 | * called once.
284 | */
Removed src/com/google/common/util/concurrent/AsyncFunction.java (line 43, column 55, end column 64)

Replace generic exceptions with specific library exceptions or a custom exception.
38 | * done}, making {@code AsyncFunction} suitable for asynchronous derivations.
39 | *
40 | *

Throwing an exception from this method is equivalent to returning a
41 | * failing {@code Future}.
42 | */

43 |   ListenableFuture<O> apply(@Nullable I input) throws Exception;
    44 | }

Removed src/com/google/common/util/concurrent/FutureFallback.java (line 51, column 50, end column 59)

Replace generic exceptions with specific library exceptions or a custom exception.
46 | *
47 | * @PARAM t the exception that made the future fail. If the future's {@link Future#get() get}
48 | * method throws an {@link ExecutionException}, then the cause is passed to this method. Any
49 | * other thrown object is passed unaltered.
50 | */

51 |   ListenableFuture<V> create(Throwable t) throws Exception;
    52 | }

Removed src/com/google/common/util/concurrent/Futures.java (line 793, column 62, end column 71)

Replace generic exceptions with specific library exceptions or a custom exception.
788 | setException(e);
789 | }
790 | }
791 |
792 | /** Template method for subtypes to actually run the fallback. */

793 | abstract void doFallback(F fallback, X throwable) throws Exception;
794 |
795 | @OverRide final void done() {
796 | maybePropagateCancellation(inputFuture);
797 | this.inputFuture = null;
798 | this.exceptionType = null;

java:S9438

Added src/main/java/org/apache/commons/beanutils2/BeanMap.java (line 42, column 5, end column 7)

Make this private field "final", it is never reassigned.
37 | import org.apache.commons.collections4.keyvalue.AbstractMapEntry;
38 |
39 | /**
40 | * An implementation of Map for JavaBeans which uses introspection to
41 | * get and put properties in the bean.

42 |  * <p>
    43 |  * If an exception occurs during attempts to get or set a property then the
    44 |  * property is considered non existent in the Map
    45 |  *
    46 |  */
    47 | public class BeanMap extends AbstractMap<Object, Object> implements Cloneable {

Ruling Diff Summary

Detected changes in 3 rules (rule identities only, no rule files supplied): 15 issues removed, 2 issues added (visible-subset counts from the supplied input; no separate totals were given).

Rule overview

Rule Projects Removed / added Automated assessment Confidence
java:S106 commons-beanutils (path org/apache/commons/beanutils2) 1 / 0 Negative High
java:S112 guava (path com/google/common/...) 14 / 0 (plus 1 plausible replacement under a different rule key, see below) Uncertain Low
java:S9438 commons-beanutils 0 / 1 Negative (location), semantic verdict uncertain Medium

Project names are inferred from file paths only; none were supplied. Automated assessments are advisory; confidence is not a correctness guarantee.


java:S106

Projects: commons-beanutils (inferred) | Removed / added: 1 / 0 | Overall: Negative | Confidence: High

The removed finding flags System.out.println(...) inside logWarn, which is a direct use of standard output where the rule message asks for a logger. The snippet shows the call itself, and the diagnostic range points at it. The in-code comment ("Deliberately do not use LOG4J or Commons Logging to avoid dependencies") is a developer justification, not a rule exception. No rule description was supplied, so I cannot confirm whether the rule has a scope exception that would cover this. On the visible code, the removal looks like a lost true positive.

Source examples: 1 of 1 changed findings shown; 1 had a usable snippet; 1 assessed.

Example 1

  • Project: commons-beanutils (inferred)
  • Status: Removed
  • Selection reason: Only finding for this rule
  • Location: src/main/java/org/apache/commons/beanutils2/BeanMap.java (line 866, column 9, end column 19)
  • Message: Replace this use of System.out by a logger.
  • Validity: Supported violation
  • Change impact: Negative (removed true positive)
  • Location assessment: Aligned (columns 9-19 cover System.out)
  • Confidence: High
  • Rationale: Direct console output is visible on the flagged line. Missing context is the rule description, which could define exceptions, but nothing in the snippet suggests one applies.
       861 |      *
       862 |      * @param ex  the exception to log
       863 |      */
       864 |     protected void logWarn(final Exception ex) {
       865 |         // Deliberately do not use LOG4J or Commons Logging to avoid dependencies
>>>    866 |         System.out.println( "WARN: Exception: " + ex );
       867 |         ex.printStackTrace();
       868 |     }
       869 | }

java:S112

Projects: guava (inferred) | Removed / added: 14 / 0 under this key | Overall: Uncertain | Confidence: Low

All 14 removed findings point at a throws Exception or throws Throwable clause, which matches the message "Replace generic exceptions with specific library exceptions or a custom exception." Whether each is a true positive depends on rule scope that was not supplied. In particular, I cannot tell whether the rule exempts overridable or abstract methods, interface methods, or methods whose declared exception is part of a deliberate API contract. Several snippets are abstract methods or interface methods (for example load, startUp, shutDown, run, apply, create, doFallback, handleInvocation), and their Javadoc describes the generic throws as intentional. Because that missing context could reverse the verdict, I mark these uncertain rather than positive or negative. Aggregate: uncertain, with no basis to say all 14 share one verdict.

Replacement pair (flagged, counts left unchanged): CacheLoader.java line 69 has a removed S112 finding and an added finding with message "RC-451 smoke test: define and throw a dedicated exception instead of using a generic one." on the same line, with a different column range (removed: 40-49, which covers Exception in the throws clause; added: 5-10, which covers abstract). The code snippet is identical. This suggests a changed message and shifted location for the same underlying condition, but the added finding's rule key was not supplied, so I cannot confirm whether it is a changed rule attribution or a different rule. The "RC-451 smoke test" wording looks like test or placeholder text, and I cannot assess it as a normal rule message. The added finding is counted separately from the S112 totals above (it is in the overall total of 2 added).

Source examples: 12 of 14 removed S112 findings shown (plus 1 added finding of unknown rule key); all had usable snippets; all shown were assessed. The remaining 2 (AbstractIdleService.java line 84 and AbstractScheduledService.java line 279) have the same shape as shown examples and are omitted to avoid near-duplicates; they are not extrapolated from.

# Status File and location Selection reason Validity Impact Location Confidence
1 Removed src/com/google/common/cache/CacheLoader.java line 69, col 40-49 Paired with added finding Uncertain (abstract method, Javadoc documents Exception) Uncertain Aligned Low
2 Added (rule key unknown) src/com/google/common/cache/CacheLoader.java line 69, col 5-10 Replacement candidate Uncertain (rule key and description missing) Uncertain Misaligned (points at abstract, message concerns the exception type) Low
3 Removed src/com/google/common/cache/CacheLoader.java line 121, col 63-72 Concrete method that throws a specific subclass Uncertain Uncertain Aligned Medium
4 Removed src/com/google/common/reflect/AbstractInvocationHandler.java line 99, col 14-23 Throwable variant Uncertain Uncertain Aligned Low
5 Removed src/com/google/common/util/concurrent/AbstractExecutionThreadService.java line 100, col 35-44 Empty-body overridable method Uncertain Uncertain Aligned Low
6 Removed src/com/google/common/util/concurrent/AbstractExecutionThreadService.java line 116, col 40-49 Abstract method Uncertain Uncertain Aligned Low
7 Removed src/com/google/common/util/concurrent/AbstractIdleService.java line 81, col 44-53 Abstract method Uncertain Uncertain Aligned Low
8 Removed src/com/google/common/util/concurrent/AbstractScheduledService.java line 265, col 52-61 Abstract method Uncertain Uncertain Aligned Low
9 Removed src/com/google/common/util/concurrent/AbstractScheduledService.java line 272, col 35-44 Empty-body overridable method Uncertain Uncertain Aligned Low
10 Removed src/com/google/common/util/concurrent/AsyncFunction.java line 43, col 55-64 Interface method Uncertain Uncertain Aligned Low
11 Removed src/com/google/common/util/concurrent/FutureFallback.java line 51, col 50-59 Interface method Uncertain Uncertain Aligned Low
12 Removed src/com/google/common/util/concurrent/Futures.java line 793, col 62-71 Package-private abstract method Uncertain Uncertain Aligned Low
13 Removed src/com/google/common/util/concurrent/AbstractExecutionThreadService.java line 124, col 36-45 Empty-body overridable method Uncertain Uncertain Aligned Low

Rationale common to the table: every row shows a visible generic throws clause, so the syntactic trigger is present, and the location points at the exception type in all removed cases. What is missing is the rule description (scope for abstract, interface, or overridable methods) and any visible overrides, which I do not infer. Example 3 is rated medium because the method has a concrete body that throws UnsupportedLoadingOperationException while declaring Exception, but I still cannot see the rule's exemptions.

Snippets for examples 1 and 2 (exact as supplied):

Removed: src/com/google/common/cache/CacheLoader.java (line 69, column 40, end column 49)
Replace generic exceptions with specific library exceptions or a custom exception.
        64 |    * @throws Exception if unable to load the result
        65 |    * @throws InterruptedException if this method is interrupted. {@code InterruptedException} is
        66 |    *     treated like any other {@code Exception} in all respects except that, when it is caught,
        67 |    *     the thread's interrupt status is set
        68 |    */
>>>     69 |   public abstract V load(K key) throws Exception;
        70 | 
        71 |   /**
        72 |    * Computes or retrieves a replacement value corresponding to an already-cached {@code key}. This
        73 |    * method is called when an existing cache entry is refreshed by
        74 |    * {@link CacheBuilder#refreshAfterWrite}, or through a call to {@link LoadingCache#refresh}.

Added: src/com/google/common/cache/CacheLoader.java (line 69, column 5, end column 10)
RC-451 smoke test: define and throw a dedicated exception instead of using a generic one.
        (same snippet as above, >>> on line 69)

Snippet for example 3:

       116 |    * @throws InterruptedException if this method is interrupted. {@code InterruptedException} is
       117 |    *     treated like any other {@code Exception} in all respects except that, when it is caught,
       118 |    *     the thread's interrupt status is set
       119 |    * @since 11.0
       120 |    */
>>>    121 |   public Map<K, V> loadAll(Iterable<? extends K> keys) throws Exception {
       122 |     // This will be caught by getAll(), causing it to fall back to multiple calls to
       123 |     // LoadingCache.get
       124 |     throw new UnsupportedLoadingOperationException();
       125 |   }

The remaining rows (4 to 13) are as supplied in the input; their flagged lines are: throws Throwable; (line 99), protected void startUp() throws Exception {} (lines 100 and 272), protected abstract void run() throws Exception; (116), protected void shutDown() throws Exception {} (124), protected abstract void startUp() throws Exception; (81), protected abstract void runOneIteration() throws Exception; (265), ListenableFuture<O> apply(@Nullable I input) throws Exception; (43), ListenableFuture<V> create(Throwable t) throws Exception; (51), and abstract void doFallback(F fallback, X throwable) throws Exception; (793).


java:S9438

Projects: commons-beanutils (inferred) | Removed / added: 0 / 1 | Overall: Negative for location; semantic verdict uncertain | Confidence: Medium

The added finding says: Make this private field "final", it is never reassigned. The flagged line (42) is * <p> inside the class Javadoc. No field declaration and no assignments are visible in the snippet, so the claim that a private field is never reassigned cannot be checked. This supports a location concern (the diagnostic points at Javadoc, not a field) and an uncertain semantic verdict. It is not proof of a false positive: the finding may be correct for a field elsewhere in the file while being reported at a wrong line. I also have no rule description for S9438.

Source examples: 1 of 1 changed findings shown; 1 had a usable snippet; 1 assessed.

Example 1

  • Project: commons-beanutils (inferred)
  • Status: Added
  • Selection reason: Only finding for this rule
  • Location: src/main/java/org/apache/commons/beanutils2/BeanMap.java (line 42, column 5, end column 7)
  • Message: Make this private field "final", it is never reassigned.
  • Validity: Uncertain
  • Change impact: Uncertain, leaning negative if the location defect is counted as diagnostic-quality regression
  • Location assessment: Misaligned (Javadoc <p> tag, not a field)
  • Confidence: Medium (missing: the field declaration and all its assignments)
        37 | import org.apache.commons.collections4.keyvalue.AbstractMapEntry;
        38 | 
        39 | /**
        40 |  * An implementation of Map for JavaBeans which uses introspection to
        41 |  * get and put properties in the bean.
>>>     42 |  * <p>
        43 |  * If an exception occurs during attempts to get or set a property then the
        44 |  * property is considered non existent in the Map
        45 |  *
        46 |  */
        47 | public class BeanMap extends AbstractMap<Object, Object> implements Cloneable {

Limitations

  • No rule descriptions, project names, or issue totals were supplied; project names are inferred from file paths only.
  • The rule key of the added CacheLoader.java finding was not supplied.
  • No existing verdicts were used as evidence. No files were edited and no other actions were taken.

@sonarqube-next

sonarqube-next Bot commented Nov 6, 2026

Copy link
Copy Markdown
Contributor

@github-actions

Copy link
Copy Markdown
Contributor

This PR is stale because it has been open 7 days with no activity. If there is no activity in the next 7 days it will be closed automatically

@github-actions github-actions Bot added the stale label Nov 14, 2026

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants