commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bugzi...@apache.org
Subject DO NOT REPLY [Bug 21099] - [lang][PATCH] Unused field 'startFinal' in DateIterator
Date Thu, 26 Jun 2003 22:01:35 GMT
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG 
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://nagoya.apache.org/bugzilla/show_bug.cgi?id=21099>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND 
INSERTED IN THE BUG DATABASE.

http://nagoya.apache.org/bugzilla/show_bug.cgi?id=21099

[lang][PATCH] Unused field 'startFinal' in DateIterator





------- Additional Comments From janekdb@yahoo.co.uk  2003-06-26 22:01 -------
The parameter 'startFinal' is used twice, once to assign to the field
'this.startFinal' and then to assign to the field 'this.spot'. It's the field
which is unused not the parameter. Sorry for the confusion. The patch file
explained it better than I did!


   /**
     * Date iterator.
     */
    static class DateIterator implements Iterator {
        private final Calendar startFinal;
        private final Calendar endFinal;
        private Calendar spot = null;

        DateIterator(Calendar startFinal, Calendar endFinal) {
            super();
            this.startFinal = startFinal;
            this.endFinal = endFinal;
            spot = startFinal;
            spot.add(Calendar.DATE, -1);
        }

        public boolean hasNext() {
            return spot.before(endFinal);
        }

        public Object next() {
            if (spot.equals(endFinal)) {
                throw new NoSuchElementException();
            }
            spot.add(Calendar.DATE, 1);
            return spot.clone();
        }

        public void remove() {
            throw new UnsupportedOperationException();
        }
    }

---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org


Mime
View raw message