Author: michiel
Date: 2010-03-04 18:40:23 +0100 (Thu, 04 Mar 2010)
New Revision: 41269
Modified:
mmbase/branches/MMBase-1_9/applications/taglib/src/main/java/org/mmbase/bridge/jsp/taglib/typehandler/AbstractTypeHandler.java
Log:
MMB-1939
Modified:
mmbase/branches/MMBase-1_9/applications/taglib/src/main/java/org/mmbase/bridge/jsp/taglib/typehandler/AbstractTypeHandler.java
===================================================================
---
mmbase/branches/MMBase-1_9/applications/taglib/src/main/java/org/mmbase/bridge/jsp/taglib/typehandler/AbstractTypeHandler.java
2010-03-04 16:01:10 UTC (rev 41268)
+++
mmbase/branches/MMBase-1_9/applications/taglib/src/main/java/org/mmbase/bridge/jsp/taglib/typehandler/AbstractTypeHandler.java
2010-03-04 17:40:23 UTC (rev 41269)
@@ -68,25 +68,27 @@
IntegerDataType idt = (IntegerDataType) dt;
final int min = idt.getMin() + (idt.isMinInclusive() ? 0 : 1);
final int max = idt.getMax() - (idt.isMaxInclusive() ? 0 : 1);
+
if ((long) max - min < 200L) {
return new EnumHandler(tag, node, field) {
- int i = min;
@Override
protected Iterator<Entry<Integer, Integer>>
getIterator(Node node, Field field) {
- return new Iterator<Entry<Integer, Integer>>() {
- public boolean hasNext() {
- return i <= max;
- }
- public Entry<Integer, Integer> next() {
- Integer value = i++;
- return new Entry<Integer,
Integer>(value, value);
- }
- public void remove() {
- throw new
UnsupportedOperationException();
- }
- };
- }
- };
+ return new Iterator<Entry<Integer, Integer>>() {
+ int i = min;
+ public boolean hasNext() {
+ return i <= max;
+ }
+ public Entry<Integer, Integer> next() {
+ Integer value = i++;
+ return new Entry<Integer, Integer>(value,
value);
+ }
+ public void remove() {
+ throw new UnsupportedOperationException();
+ }
+ };
+ }
+ };
+
}
}
if (dt instanceof LongDataType) {
@@ -95,23 +97,24 @@
final long max = ldt.getMax() - (ldt.isMaxInclusive() ? 0 : 1);
if ((double) max - min < 200.0) {
return new EnumHandler(tag, node, field) {
- long i = min;
+
@Override
protected Iterator<Entry<Long, Long>> getIterator(Node
node, Field field) {
return new Iterator<Entry<Long, Long>>() {
- public boolean hasNext() {
- return i <= max;
- }
- public Entry<Long, Long> next() {
- Long value = i++;
- return new Entry<Long, Long>(value,
value);
- }
- public void remove() {
- throw new
UnsupportedOperationException();
- }
- };
+ long i = min;
+ public boolean hasNext() {
+ return i <= max;
+ }
+ public Entry<Long, Long> next() {
+ Long value = i++;
+ return new Entry<Long, Long>(value, value);
+ }
+ public void remove() {
+ throw new UnsupportedOperationException();
+ }
+ };
}
- };
+ };
}
}
_______________________________________________
Cvs mailing list
[email protected]
http://lists.mmbase.org/mailman/listinfo/cvs