8000 Remove remaining warning suppression by andrewaylett · Pull Request #98 · andrewaylett/arc · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Remove remaining warning suppression #98

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
May 28, 2025
Merged

Conversation

andrewaylett
Copy link
Owner
  • Avoid some checkstyle warnings by fixing guard annotations

  • Avoid spotbugs warnings by only passing in what we need

* Avoid some checkstyle warnings by fixing guard annotations

* Avoid spotbugs warnings by only passing in what we need
@Copilot Copilot AI review requested due to automatic review settings May 28, 2025 20:42
Copy link
github-actions bot commented May 28, 2025 8000
  • Surviving mutants in this change: 5
  • Killed mutants in this change: 12
class surviving killed
🧟eu.aylett.arc.internal.Element 3 2
🧟eu.aylett.arc.internal.InnerArc 1 7
🧟eu.aylett.arc.internal.ElementList 1 1
💯eu.aylett.arc.Arc 0 2

See https://pitest.org

Copy link
@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR removes remaining warning suppressions and refines how lock and nullness annotations are applied, while abstracting thread‐pool usage in Element.

  • Replaced suppressed warnings by adding Checker Framework lock annotations.
  • Updated Element and Arc to accept a generic pool function instead of a raw ForkJoinPool.
  • Simplified test code and updated Array/List initializers.

Reviewed Changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
lib/src/test/java/eu/aylett/arc/ArcTest.java Added @GuardedBy qualifiers to test helpers and updated Arc instantiation.
lib/src/main/java/eu/aylett/arc/internal/InnerArc.java Removed CF suppression, adjusted @GuardedBy fields and method signatures.
lib/src/main/java/eu/aylett/arc/internal/ElementList.java Dropped generics on ElementList, added guard annotations, renamed method.
lib/src/main/java/eu/aylett/arc/internal/Element.java Changed loader/pool types, added guard annotations, removed suppressions.
lib/src/main/java/eu/aylett/arc/Arc.java Broadened loader generic, switched to a pool‐lambda in computeIfAbsent.
config/checkstyle/checkstyle.xml Enabled same‐line multiple annotations in Checkstyle config.
Comments suppressed due to low confidence (5)

lib/src/test/java/eu/aylett/arc/ArcTest.java:43

  • The @GuardedBy annotation is intended for guarding fields or methods with a lock name, not for type parameters—remove it or apply a lock qualifier to the field/method declaration instead.
public static <T> org.hamcrest.Matcher<@GuardedBy @PolyNull @Initialized T> equalTo(@GuardedBy @PolyNull T operand) {

lib/src/test/java/eu/aylett/arc/ArcTest.java:47

  • Misuse of @GuardedBy on method parameters and type arguments; it should specify a lock and be applied to fields or methods rather than types.
public static <T> void assertThat(@GuardedBy @PolyNull T actual, Matcher<? super @GuardedBy @PolyNull T> matcher) {

lib/src/test/java/eu/aylett/arc/ArcTest.java:73

  • The type-use @GuardedBy on a List.of call is inappropriate—remove this annotation from the type argument.
assertThat(recordedValues, equalTo(List.<@GuardedBy Integer>of(1, 2, 1)));

lib/src/main/java/eu/aylett/arc/internal/InnerArc.java:43

  • The @GuardedBy annotation requires a lock name (e.g., @GuardedBy("this")) to be effective; add the lock reference or remove the annotation.
private final @GuardedBy ElementList seenOnceLRU;

lib/src/main/java/eu/aylett/arc/internal/ElementList.java:35

  • Dropping generic parameters on ElementList weakens type safety; consider restoring <K, V> parameters.
class ElementList {

@@ -271,6 +271,7 @@ Authors: Max Vetrenko, Mauryan Kansara, Ruslan Diachenko, Roman Ivanov.
<property name="id" value="AnnotationLocationMostCases"/>
<property name="tokens"
value="CLASS_DEF, INTERFACE_DEF, ENUM_DEF, METHOD_DEF, CTOR_DEF, RECORD_DEF, COMPACT_CTOR_DEF"/>
<property name="allowSamelineMultipleAnnotations" value="true"/>
Copy link
Preview
Copilot AI May 28, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Typo in property name: should be allowSameLineMultipleAnnotations (capital L in 'Line').

Copilot uses AI. Check for mistakes.

@andrewaylett andrewaylett merged commit da379b1 into main May 28, 2025
6 checks passed
@andrewaylett andrewaylett deleted the push-xpsloonnwrpq branch May 28, 2025 20:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3357
1 participant
0