commit | e4354c44ad5173c4d92c2612cd63ff553ec2b0a7 | [log] [tgz] |
---|---|---|
author | Edwin Park <esp1@cornell.edu> | Mon Jun 10 13:03:04 2013 -0400 |
committer | Edwin Park <esp1@cornell.edu> | Mon Jun 10 13:03:04 2013 -0400 |
tree | d9154141066da428d1d8b0e4ea3ee53d2076d905 | |
parent | 2cb3ec78b4730dbb494a9ea914a4185450003823 [diff] |
comment
diff --git a/org.eclipse.nebula.widgets.nattable.core/src/org/eclipse/nebula/widgets/nattable/core/math/BigIntegerExtensions.xtend b/org.eclipse.nebula.widgets.nattable.core/src/org/eclipse/nebula/widgets/nattable/core/math/BigIntegerExtensions.xtend index 3c3ccc0..06ae77e 100644 --- a/org.eclipse.nebula.widgets.nattable.core/src/org/eclipse/nebula/widgets/nattable/core/math/BigIntegerExtensions.xtend +++ b/org.eclipse.nebula.widgets.nattable.core/src/org/eclipse/nebula/widgets/nattable/core/math/BigIntegerExtensions.xtend
@@ -4,6 +4,10 @@ class BigIntegerExtensions { + /** + * Adds the intValueExact method to BigInteger, which is missing in Java <= 1.6. This method will throw an exception + * if the BigInteger is larger than what will fit in a 32-bit int. Otherwise the converted primitive int value is returned. + */ def static int intValueExact(BigInteger bigInteger) { if (bigInteger > BigInteger::valueOf(Integer::MAX_VALUE)) throw new IllegalStateException('''Segment count «bigInteger» exceeds integer range''')