Skip to content

Commit

Permalink
Add compilation errors & SAT GitHub annotations (openhab#2543)
Browse files Browse the repository at this point in the history
Signed-off-by: Yannick Schaus <[email protected]>
GitOrigin-RevId: d4f62ed
  • Loading branch information
ghys authored and splatch committed Jul 12, 2023
1 parent c36ff9f commit f6ddc52
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 16 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -65,8 +65,9 @@ public ByteArrayFileCache(String servicePID) {
* disable this functionality.
*/
public ByteArrayFileCache(String servicePID, Duration expiry) {
// TODO track and limit folder size
// TODO support user specific folder
// possible to-dos:
// - track and limit folder size
// - support user specific folder
cacheFolder = new File(new File(OpenHAB.getUserDataFolder(), CACHE_FOLDER_NAME), servicePID);
if (!cacheFolder.exists()) {
logger.debug("Creating cache folder '{}'", cacheFolder.getAbsolutePath());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,10 @@
@NonNullByDefault
public abstract class ModbusSlaveErrorResponseException extends ModbusTransportException {

private static final Map<Integer, KnownExceptionCode> exceptionCodesIndex = new HashMap<>(10);
private static final Map<Integer, KnownExceptionCode> EXCEPTION_CODES_INDEX = new HashMap<>(10);
static {
for (KnownExceptionCode code : KnownExceptionCode.values()) {
exceptionCodesIndex.put(code.exceptionCode, code);
EXCEPTION_CODES_INDEX.put(code.exceptionCode, code);
}
}

Expand Down Expand Up @@ -64,7 +64,7 @@ public int getExceptionCode() {
}

public static Optional<KnownExceptionCode> tryFromExceptionCode(int exceptionCode) {
return Optional.ofNullable(exceptionCodesIndex.get(exceptionCode));
return Optional.ofNullable(EXCEPTION_CODES_INDEX.get(exceptionCode));
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,6 @@ public DecimalType(double value) {
* The English locale is used to determine (decimal/grouping) separator characters.
*
* @param value the non null value representing a number
*
* @throws NumberFormatException when the number could not be parsed to a {@link BigDecimal}
*/
public DecimalType(String value) {
Expand All @@ -73,7 +72,6 @@ public DecimalType(String value) {
*
* @param value the non null value representing a number
* @param locale the locale used to determine (decimal/grouping) separator characters
*
* @throws NumberFormatException when the number could not be parsed to a {@link BigDecimal}
*/
public DecimalType(String value, Locale locale) {
Expand Down Expand Up @@ -102,7 +100,6 @@ public String toFullString() {
*
* @param value the non null value representing a number
* @return a new {@link DecimalType}
*
* @throws NumberFormatException when the number could not be parsed to a {@link BigDecimal}
*/
public static DecimalType valueOf(String value) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,6 @@ public PercentType() {
* Creates a new {@link PercentType} with the given value.
*
* @param value the value representing a percentage
*
* @throws IllegalArgumentException when the value is not between 0 and 100
*/
public PercentType(int value) {
Expand All @@ -58,7 +57,6 @@ public PercentType(int value) {
* The English locale is used to determine (decimal/grouping) separator characters.
*
* @param value the non null value representing a percentage
*
* @throws NumberFormatException when the number could not be parsed to a {@link BigDecimal}
* @throws IllegalArgumentException when the value is not between 0 and 100
*/
Expand All @@ -71,7 +69,6 @@ public PercentType(String value) {
*
* @param value the non null value representing a percentage
* @param locale the locale used to determine (decimal/grouping) separator characters
*
* @throws NumberFormatException when the number could not be parsed to a {@link BigDecimal}
* @throws IllegalArgumentException when the value is not between 0 and 100
*/
Expand All @@ -84,7 +81,6 @@ public PercentType(String value, Locale locale) {
* Creates a new {@link PercentType} with the given value.
*
* @param value the value representing a percentage.
*
* @throws IllegalArgumentException when the value is not between 0 and 100
*/
public PercentType(BigDecimal value) {
Expand All @@ -103,7 +99,6 @@ private void validateValue(BigDecimal value) {
*
* @param value the non null value representing a percentage
* @return new {@link PercentType}
*
* @throws NumberFormatException when the number could not be parsed to a {@link BigDecimal}
* @throws IllegalArgumentException when the value is not between 0 and 100
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,6 @@ public QuantityType() {
* The English locale is used to determine (decimal/grouping) separator characters.
*
* @param value the non null value representing a quantity with an optional unit.
*
* @throws NumberFormatException when a quantity without a unit could not be parsed
* @throws IllegalArgumentException when a quantity with a unit could not be parsed
*/
Expand All @@ -113,7 +112,6 @@ public QuantityType(String value) {
*
* @param value the non null value representing a quantity with an optional unit.
* @param locale the locale used to determine (decimal/grouping) separator characters.
*
* @throws NumberFormatException when a quantity without a unit could not be parsed
* @throws IllegalArgumentException when a quantity with a unit could not be parsed
*/
Expand Down Expand Up @@ -201,7 +199,6 @@ public String toString() {
*
* @param value the non null value representing a quantity with an optional unit
* @return a new {@link QuantityType}
*
* @throws NumberFormatException when a quantity without a unit could not be parsed
* @throws IllegalArgumentException when a quantity with a unit could not be parsed
*/
Expand Down

0 comments on commit f6ddc52

Please sign in to comment.