-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
bug-fix: enable SuppressWarnings to suppress issues on enhancement pr…
…operties (#83)
- Loading branch information
1 parent
9eca929
commit 949b2e6
Showing
5 changed files
with
41 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
25 changes: 25 additions & 0 deletions
25
src/test/resources/rules/SuppressWarningsListener/enhancementSuppressWarnings-methods.gsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
package friday.enhancement | ||
|
||
uses java.math.BigDecimal | ||
|
||
enhancement SampleEnhancement: BigDecimal { | ||
|
||
@SuppressWarnings("gosu:MagicNumbersRule") | ||
property get DummyRandomNumber(): BigDecimal { | ||
return BigDecimal.ONE.multiply(345bd) | ||
} | ||
|
||
@SuppressWarnings("gosu:MagicNumbersRule") | ||
property set SecondRandomNumber(value: int) { | ||
if (value < 0 or value > 100) { | ||
throw new IllegalArgumentException("Number must be between 0 and 100, as it's a percentage.") | ||
} | ||
var reductionAsDecimal = BigDecimal.valueOf(value).divide(100bd) | ||
} | ||
|
||
@SuppressWarnings("gosu:MagicNumbersRule") | ||
function createDummyNumber() { | ||
var no = BigDecimal.ZERO.subtract(-9.5bd) | ||
} | ||
|
||
} |