Skip to content

Commit

Permalink
Resolve spotbugs error
Browse files Browse the repository at this point in the history
  • Loading branch information
yashpal2104 committed Jan 11, 2025
1 parent f3e735a commit 059229f
Showing 1 changed file with 1 addition and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -70,10 +70,7 @@ public void onStartedItem(@NonNull LeftItem item, float weight) {}
@CheckReturnValue
public void onCanceledItem(@NonNull LeftItem item) {
if (item.isCancelled()) {

Check warning on line 72 in src/main/java/jenkins/advancedqueue/sorter/SorterStrategy.java

View check run for this annotation

ci.jenkins.io / Code Coverage

Partially covered line

Line 72 is only partially covered, one branch is missing

Check warning on line 72 in src/main/java/jenkins/advancedqueue/sorter/SorterStrategy.java

View check run for this annotation

ci.jenkins.io / SpotBugs

UCF_USELESS_CONTROL_FLOW

LOW: Useless control flow in jenkins.advancedqueue.sorter.SorterStrategy.onCanceledItem(Queue$LeftItem)
Raw output
<p> This method contains a useless control flow statement, where control flow continues onto the same place regardless of whether or not the branch is taken. For example, this is caused by having an empty statement block for an <code>if</code> statement:</p> <pre><code>if (argv.length == 0) { // TODO: handle this case } </code></pre>
ExtensionList<SorterStrategy> all = all();
for (SorterStrategy prioritySorterStrategy : all) {
SorterStrategyDescriptor descriptor = prioritySorterStrategy.getDescriptor();
}
// removed the item from the queue
}
}

Check warning on line 75 in src/main/java/jenkins/advancedqueue/sorter/SorterStrategy.java

View check run for this annotation

ci.jenkins.io / SpotBugs

UC_USELESS_VOID_METHOD

LOW: Method jenkins.advancedqueue.sorter.SorterStrategy.onCanceledItem(Queue$LeftItem) seems to be useless
Raw output
<p>Our analysis shows that this non-empty void method does not actually perform any useful work. Please check it: probably there's a mistake in its code or its body can be fully removed. </p> <p>We are trying to reduce the false positives as much as possible, but in some cases this warning might be wrong. Common false-positive cases include:</p> <ul> <li>The method is intended to trigger loading of some class which may have a side effect.</li> <li>The method is intended to implicitly throw some obscure exception.</li> </ul>
;
Expand Down

0 comments on commit 059229f

Please sign in to comment.