Skip to content
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

Fixes #330 #374

Open
wants to merge 3 commits into
base: 2024-06
Choose a base branch
from

Fixes #377 (inconsistent types)

752f6b4
Select commit
Loading
Failed to load commit list.
Sign in for the full log view
Open

Fixes #330 #374

Fixes #377 (inconsistent types)
752f6b4
Select commit
Loading
Failed to load commit list.
GitHub Actions / SpotBugs failed Dec 16, 2024 in 0s

SpotBugs Source Code Analyzer report

8 violation(s) found

Annotations

Check warning on line 595 in gama.core/src/gama/gaml/statements/LoopStatement.java

See this annotation in the file changed.

@github-actions github-actions / SpotBugs

BX_UNBOXING_IMMEDIATELY_REBOXED

Boxed value is unboxed and then immediately reboxed in new gama.gaml.statements.LoopStatement$FloatBounded(LoopStatement, IExpression, IExpression, IExpression)
Raw output
A boxed value is unboxed and then immediately reboxed.

Check warning on line 592 in gama.core/src/gama/gaml/statements/LoopStatement.java

See this annotation in the file changed.

@github-actions github-actions / SpotBugs

CT_CONSTRUCTOR_THROW

Exception thrown in class gama.gaml.statements.LoopStatement$FloatBounded at new gama.gaml.statements.LoopStatement$FloatBounded(LoopStatement, IExpression, IExpression, IExpression) will leave the constructor. The object under construction remains partially initialized and may be vulnerable to Finalizer attacks.
Raw output
Classes that throw exceptions in their constructors are vulnerable to Finalizer attacks

A finalizer attack can be prevented, by declaring the class final, using an empty finalizer declared as final, or by a clever use of a private constructor.

See SEI CERT Rule OBJ-11 [https://wiki.sei.cmu.edu/confluence/display/java/OBJ11-J.+Be+wary+of+letting+constructors+throw+exceptions] for more information.

Check warning on line 595 in gama.core/src/gama/gaml/statements/LoopStatement.java

See this annotation in the file changed.

@github-actions github-actions / SpotBugs

NP_NULL_ON_SOME_PATH

Possible null pointer dereference of null in new gama.gaml.statements.LoopStatement$FloatBounded(LoopStatement, IExpression, IExpression, IExpression)
Raw output
There is a branch of statement that, if executed, guarantees that a null value will be dereferenced, which would generate a NullPointerException when the code is executed. Of course, the problem might be that the branch or statement is infeasible and that the null pointer exception cannot ever be executed; deciding that is beyond the ability of SpotBugs.

Check warning on line 625 in gama.core/src/gama/gaml/statements/LoopStatement.java

See this annotation in the file changed.

@github-actions github-actions / SpotBugs

SF_SWITCH_NO_DEFAULT

Switch statement found in gama.gaml.statements.LoopStatement$FloatBounded.runIn(IScope) where default case is missing
Raw output
This method contains a switch statement where default case is missing. Usually you need to provide a default case.

Because the analysis only looks at the generated bytecode, this warning can be incorrect triggered if the default case is at the end of the switch statement and the switch statement doesn't contain break statements for other cases.

Check warning on line 516 in gama.core/src/gama/gaml/statements/LoopStatement.java

See this annotation in the file changed.

@github-actions github-actions / SpotBugs

BX_UNBOXING_IMMEDIATELY_REBOXED

Boxed value is unboxed and then immediately reboxed in new gama.gaml.statements.LoopStatement$IntBounded(LoopStatement, IExpression, IExpression, IExpression)
Raw output
A boxed value is unboxed and then immediately reboxed.

Check warning on line 513 in gama.core/src/gama/gaml/statements/LoopStatement.java

See this annotation in the file changed.

@github-actions github-actions / SpotBugs

CT_CONSTRUCTOR_THROW

Exception thrown in class gama.gaml.statements.LoopStatement$IntBounded at new gama.gaml.statements.LoopStatement$IntBounded(LoopStatement, IExpression, IExpression, IExpression) will leave the constructor. The object under construction remains partially initialized and may be vulnerable to Finalizer attacks.
Raw output
Classes that throw exceptions in their constructors are vulnerable to Finalizer attacks

A finalizer attack can be prevented, by declaring the class final, using an empty finalizer declared as final, or by a clever use of a private constructor.

See SEI CERT Rule OBJ-11 [https://wiki.sei.cmu.edu/confluence/display/java/OBJ11-J.+Be+wary+of+letting+constructors+throw+exceptions] for more information.

Check warning on line 516 in gama.core/src/gama/gaml/statements/LoopStatement.java

See this annotation in the file changed.

@github-actions github-actions / SpotBugs

NP_NULL_ON_SOME_PATH

Possible null pointer dereference of null in new gama.gaml.statements.LoopStatement$IntBounded(LoopStatement, IExpression, IExpression, IExpression)
Raw output
There is a branch of statement that, if executed, guarantees that a null value will be dereferenced, which would generate a NullPointerException when the code is executed. Of course, the problem might be that the branch or statement is infeasible and that the null pointer exception cannot ever be executed; deciding that is beyond the ability of SpotBugs.

Check warning on line 546 in gama.core/src/gama/gaml/statements/LoopStatement.java

See this annotation in the file changed.

@github-actions github-actions / SpotBugs

SF_SWITCH_NO_DEFAULT

Switch statement found in gama.gaml.statements.LoopStatement$IntBounded.runIn(IScope) where default case is missing
Raw output
This method contains a switch statement where default case is missing. Usually you need to provide a default case.

Because the analysis only looks at the generated bytecode, this warning can be incorrect triggered if the default case is at the end of the switch statement and the switch statement doesn't contain break statements for other cases.