test/runtime/CommandLine/OptionsValidation/common/optionsvalidation/IntJVMOption.java
Index Unified diffs Context diffs Sdiffs Wdiffs Patch New Old Previous File Next File webrev Sdiff test/runtime/CommandLine/OptionsValidation/common/optionsvalidation

test/runtime/CommandLine/OptionsValidation/common/optionsvalidation/IntJVMOption.java

Print this page




 206         if ((min.compareTo(MINUS_ONE) == -1) && (max.compareTo(MINUS_ONE) == 1)) {
 207             /*
 208              * Add -1 as valid value if min is less than -1 and max is greater than -1
 209              */
 210             validValues.add("-1");
 211         }
 212 
 213         if ((min.compareTo(BigInteger.ZERO) == -1) && (max.compareTo(BigInteger.ZERO) == 1)) {
 214             /*
 215              * Add 0 as valid value if min is less than 0 and max is greater than 0
 216              */
 217             validValues.add("0");
 218         }
 219         if ((min.compareTo(BigInteger.ONE) == -1) && (max.compareTo(BigInteger.ONE) == 1)) {
 220             /*
 221              * Add 1 as valid value if min is less than 1 and max is greater than 1
 222              */
 223             validValues.add("1");
 224         }
 225 
 226         if (max.compareTo(MAX_4_BYTE_INT_PLUS_ONE) == 1) {
 227             /*
 228              * Check for overflow when flag is assigned to the
 229              * 4 byte int variable
 230              */
 231             validValues.add(MAX_4_BYTE_INT_PLUS_ONE.toString());
 232         }
 233 
 234         if (max.compareTo(MAX_4_BYTE_UNSIGNED_INT_PLUS_ONE) == 1) {
 235             /*
 236              * Check for overflow when flag is assigned to the
 237              * 4 byte unsigned int variable
 238              */
 239             validValues.add(MAX_4_BYTE_UNSIGNED_INT_PLUS_ONE.toString());
 240         }
 241 
 242         return validValues;
 243     }
 244 
 245     /**
 246      * Return list of strings with invalid option values which used for testing
 247      * using jcmd, attach and etc.
 248      *
 249      * @return list of strings which contain invalid values for option
 250      */
 251     @Override
 252     protected List<String> getInvalidValues() {
 253         List<String> invalidValues = new ArrayList<>();
 254 




 206         if ((min.compareTo(MINUS_ONE) == -1) && (max.compareTo(MINUS_ONE) == 1)) {
 207             /*
 208              * Add -1 as valid value if min is less than -1 and max is greater than -1
 209              */
 210             validValues.add("-1");
 211         }
 212 
 213         if ((min.compareTo(BigInteger.ZERO) == -1) && (max.compareTo(BigInteger.ZERO) == 1)) {
 214             /*
 215              * Add 0 as valid value if min is less than 0 and max is greater than 0
 216              */
 217             validValues.add("0");
 218         }
 219         if ((min.compareTo(BigInteger.ONE) == -1) && (max.compareTo(BigInteger.ONE) == 1)) {
 220             /*
 221              * Add 1 as valid value if min is less than 1 and max is greater than 1
 222              */
 223             validValues.add("1");
 224         }
 225 
 226         if ((min.compareTo(MAX_4_BYTE_INT_PLUS_ONE) == -1) && (max.compareTo(MAX_4_BYTE_INT_PLUS_ONE) == 1)) {
 227             /*
 228              * Check for overflow when flag is assigned to the
 229              * 4 byte int variable
 230              */
 231             validValues.add(MAX_4_BYTE_INT_PLUS_ONE.toString());
 232         }
 233 
 234         if ((min.compareTo(MAX_4_BYTE_UNSIGNED_INT_PLUS_ONE) == -1) && (max.compareTo(MAX_4_BYTE_UNSIGNED_INT_PLUS_ONE) == 1)) {
 235             /*
 236              * Check for overflow when flag is assigned to the
 237              * 4 byte unsigned int variable
 238              */
 239             validValues.add(MAX_4_BYTE_UNSIGNED_INT_PLUS_ONE.toString());
 240         }
 241 
 242         return validValues;
 243     }
 244 
 245     /**
 246      * Return list of strings with invalid option values which used for testing
 247      * using jcmd, attach and etc.
 248      *
 249      * @return list of strings which contain invalid values for option
 250      */
 251     @Override
 252     protected List<String> getInvalidValues() {
 253         List<String> invalidValues = new ArrayList<>();
 254 


test/runtime/CommandLine/OptionsValidation/common/optionsvalidation/IntJVMOption.java
Index Unified diffs Context diffs Sdiffs Wdiffs Patch New Old Previous File Next File