Upgrade embedded ical4j from ancient whatever to upstream version 1.0.6.

Tue, 10 Feb 2015 19:38:00 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Tue, 10 Feb 2015 19:38:00 +0100
changeset 3
73bdfa70b04e
parent 2
dee028db6e9b
child 4
45d57ecba757

Upgrade embedded ical4j from ancient whatever to upstream version 1.0.6.

src/net/fortuna/ical4j/data/CalendarParserImpl.java file | annotate | diff | comparison | revisions
src/net/fortuna/ical4j/data/HCalendarParser.java file | annotate | diff | comparison | revisions
src/net/fortuna/ical4j/data/HCalendarParserFactory.java file | annotate | diff | comparison | revisions
src/net/fortuna/ical4j/model/CalendarException.java file | annotate | diff | comparison | revisions
src/net/fortuna/ical4j/model/ComponentList.java file | annotate | diff | comparison | revisions
src/net/fortuna/ical4j/model/Date.java file | annotate | diff | comparison | revisions
src/net/fortuna/ical4j/model/DateList.java file | annotate | diff | comparison | revisions
src/net/fortuna/ical4j/model/DateTime.java file | annotate | diff | comparison | revisions
src/net/fortuna/ical4j/model/Iso8601.java file | annotate | diff | comparison | revisions
src/net/fortuna/ical4j/model/NumberList.java file | annotate | diff | comparison | revisions
src/net/fortuna/ical4j/model/ParameterFactoryRegistry.java file | annotate | diff | comparison | revisions
src/net/fortuna/ical4j/model/PeriodList.java file | annotate | diff | comparison | revisions
src/net/fortuna/ical4j/model/PropertyFactoryImpl.java file | annotate | diff | comparison | revisions
src/net/fortuna/ical4j/model/PropertyFactoryRegistry.java file | annotate | diff | comparison | revisions
src/net/fortuna/ical4j/model/PropertyList.java file | annotate | diff | comparison | revisions
src/net/fortuna/ical4j/model/Recur.java file | annotate | diff | comparison | revisions
src/net/fortuna/ical4j/model/TimeZone.java file | annotate | diff | comparison | revisions
src/net/fortuna/ical4j/model/TimeZoneRegistryImpl.java file | annotate | diff | comparison | revisions
src/net/fortuna/ical4j/model/WeekDayList.java file | annotate | diff | comparison | revisions
src/net/fortuna/ical4j/model/component/VEvent.java file | annotate | diff | comparison | revisions
src/net/fortuna/ical4j/model/component/VFreeBusy.java file | annotate | diff | comparison | revisions
src/net/fortuna/ical4j/model/component/VJournal.java file | annotate | diff | comparison | revisions
src/net/fortuna/ical4j/model/component/VTimeZone.java file | annotate | diff | comparison | revisions
src/net/fortuna/ical4j/model/component/VToDo.java file | annotate | diff | comparison | revisions
src/net/fortuna/ical4j/model/property/Categories.java file | annotate | diff | comparison | revisions
src/net/fortuna/ical4j/model/property/RRule.java file | annotate | diff | comparison | revisions
src/net/fortuna/ical4j/model/property/TzOffsetTo.java file | annotate | diff | comparison | revisions
src/net/fortuna/ical4j/model/tz.alias file | annotate | diff | comparison | revisions
src/net/fortuna/ical4j/util/CompatibilityHints.java file | annotate | diff | comparison | revisions
     1.1 --- a/src/net/fortuna/ical4j/data/CalendarParserImpl.java	Tue Feb 10 19:25:00 2015 +0100
     1.2 +++ b/src/net/fortuna/ical4j/data/CalendarParserImpl.java	Tue Feb 10 19:38:00 2015 +0100
     1.3 @@ -177,7 +177,7 @@
     1.4                  else {
     1.5                      propertyParser.parse(tokeniser, in, handler);
     1.6                  }
     1.7 -                absorbWhitespace(tokeniser);
     1.8 +                absorbWhitespace(tokeniser, in);
     1.9                  // assertToken(tokeniser, StreamTokenizer.TT_WORD);
    1.10              }
    1.11          }
    1.12 @@ -228,10 +228,9 @@
    1.13              // text       = *(TSAFE-CHAR / ":" / DQUOTE / ESCAPED-CHAR)
    1.14              //
    1.15              tokeniser.ordinaryChar('"');
    1.16 -            int nextToken = tokeniser.nextToken();
    1.17 +            int nextToken = nextToken(tokeniser, in);
    1.18  
    1.19 -            while (nextToken != StreamTokenizer.TT_EOL
    1.20 -                    && nextToken != StreamTokenizer.TT_EOF) {
    1.21 +            while (nextToken != StreamTokenizer.TT_EOL) {
    1.22  
    1.23                  if (tokeniser.ttype == StreamTokenizer.TT_WORD) {
    1.24                      value.append(tokeniser.sval);
    1.25 @@ -240,17 +239,12 @@
    1.26                      value.append((char) tokeniser.ttype);
    1.27                  }
    1.28  
    1.29 -                nextToken = tokeniser.nextToken();
    1.30 +                nextToken = nextToken(tokeniser, in);
    1.31              }
    1.32              
    1.33              // reset DQUOTE to be quote char
    1.34              tokeniser.quoteChar('"');
    1.35              
    1.36 -            if (nextToken == StreamTokenizer.TT_EOF) {
    1.37 -                throw new ParserException("Unexpected end of file",
    1.38 -                        getLineNumber(tokeniser, in));
    1.39 -            }
    1.40 -
    1.41              try {
    1.42                  handler.propertyValue(value.toString());
    1.43              }
    1.44 @@ -279,7 +273,7 @@
    1.45                  final ContentHandler handler) throws IOException, ParserException,
    1.46                  URISyntaxException {
    1.47  
    1.48 -            while (tokeniser.nextToken() == ';') {
    1.49 +            while (nextToken(tokeniser, in) == ';') {
    1.50                  paramParser.parse(tokeniser, in, handler);
    1.51              }
    1.52          }
    1.53 @@ -312,7 +306,7 @@
    1.54              final StringBuffer paramValue = new StringBuffer();
    1.55  
    1.56              // preserve quote chars..
    1.57 -            if (tokeniser.nextToken() == '"') {
    1.58 +            if (nextToken(tokeniser, in) == '"') {
    1.59                  paramValue.append('"');
    1.60                  paramValue.append(tokeniser.sval);
    1.61                  paramValue.append('"');
    1.62 @@ -320,7 +314,7 @@
    1.63              else if (tokeniser.sval != null) {
    1.64                  paramValue.append(tokeniser.sval);
    1.65                  // check for additional words to account for equals (=) in param-value
    1.66 -                int nextToken = tokeniser.nextToken();
    1.67 +                int nextToken = nextToken(tokeniser, in);
    1.68  
    1.69                  while (nextToken != ';' && nextToken != ':' && nextToken != ',') {
    1.70  
    1.71 @@ -331,7 +325,7 @@
    1.72                      	paramValue.append((char) tokeniser.ttype);
    1.73                      }
    1.74  
    1.75 -                    nextToken = tokeniser.nextToken();
    1.76 +                    nextToken = nextToken(tokeniser, in);
    1.77                  }
    1.78                  tokeniser.pushBack();
    1.79              } else if(tokeniser.sval == null) { 
    1.80 @@ -363,7 +357,7 @@
    1.81  
    1.82              while (Component.BEGIN.equals(tokeniser.sval)) {
    1.83                  componentParser.parse(tokeniser, in, handler);
    1.84 -                absorbWhitespace(tokeniser);
    1.85 +                absorbWhitespace(tokeniser, in);
    1.86                  // assertToken(tokeniser, StreamTokenizer.TT_WORD);
    1.87              }
    1.88          }
    1.89 @@ -429,7 +423,7 @@
    1.90      private void assertToken(final StreamTokenizer tokeniser, Reader in, final int token)
    1.91              throws IOException, ParserException {
    1.92  
    1.93 -        if (tokeniser.nextToken() != token) {
    1.94 +        if (nextToken(tokeniser, in) != token) {
    1.95              throw new ParserException(MessageFormat.format(UNEXPECTED_TOKEN_MESSAGE, new Object[] {
    1.96                      new Integer(token), new Integer(tokeniser.ttype),
    1.97              }), getLineNumber(tokeniser, in));
    1.98 @@ -489,9 +483,9 @@
    1.99       * @param tokeniser
   1.100       * @throws IOException
   1.101       */
   1.102 -    private void absorbWhitespace(final StreamTokenizer tokeniser) throws IOException {
   1.103 +    private void absorbWhitespace(final StreamTokenizer tokeniser, Reader in) throws IOException, ParserException {
   1.104          // HACK: absorb extraneous whitespace between components (KOrganizer)..
   1.105 -        while (tokeniser.nextToken() == StreamTokenizer.TT_EOL) {
   1.106 +        while (nextToken(tokeniser, in) == StreamTokenizer.TT_EOL) {
   1.107              if (log.isTraceEnabled()) {
   1.108                  log.trace("Absorbing extra whitespace..");
   1.109              }
   1.110 @@ -518,4 +512,20 @@
   1.111          }
   1.112          return line;
   1.113      }
   1.114 +
   1.115 +    /**
   1.116 +     * Reads the next token from the tokeniser.
   1.117 +     * This method throws a ParseException when reading EOF.
   1.118 +     * @param tokeniser
   1.119 +     * @param in
   1.120 +     * @return
   1.121 +     * @throws ParseException When reading EOF.
   1.122 +     */
   1.123 +    private int nextToken(StreamTokenizer tokeniser, Reader in) throws IOException, ParserException {
   1.124 +        int token = tokeniser.nextToken();
   1.125 +        if (token == StreamTokenizer.TT_EOF) {
   1.126 +            throw new ParserException("Unexpected end of file", getLineNumber(tokeniser, in));
   1.127 +        }
   1.128 +        return token;
   1.129 +    }
   1.130  }
     2.1 --- a/src/net/fortuna/ical4j/model/ComponentList.java	Tue Feb 10 19:25:00 2015 +0100
     2.2 +++ b/src/net/fortuna/ical4j/model/ComponentList.java	Tue Feb 10 19:38:00 2015 +0100
     2.3 @@ -124,7 +124,7 @@
     2.4       * Add a component to the list.
     2.5       * @param component the component to add
     2.6       * @return true
     2.7 -     * @see List#add(java.lang.Object)
     2.8 +     * @see java.util.List#add(Object)
     2.9       */
    2.10      public final boolean add(final Component component) {
    2.11          return add((Object) component);
    2.12 @@ -135,7 +135,7 @@
    2.13       * <code>net.fortuna.ical4j.model.Component</code>.
    2.14       * @param component a component to add
    2.15       * @return true if the object was added, otherwise false
    2.16 -     * @see List#add(E)
    2.17 +     * @see java.util.List#add(Object)
    2.18       */
    2.19      public final boolean add(final Object component) {
    2.20          if (!(component instanceof Component)) {
    2.21 @@ -147,14 +147,14 @@
    2.22  
    2.23      /**
    2.24       * @return boolean indicates if the list is empty
    2.25 -     * @see List#isEmpty()
    2.26 +     * @see java.util.List#isEmpty()
    2.27       */
    2.28      // public final boolean isEmpty() {
    2.29      // return components.isEmpty();
    2.30      // }
    2.31      /**
    2.32       * @return an iterator
    2.33 -     * @see List#iterator()
    2.34 +     * @see java.util.List#iterator()
    2.35       */
    2.36      // public final Iterator iterator() {
    2.37      // return components.iterator();
    2.38 @@ -163,7 +163,7 @@
    2.39       * Remove a component from the list.
    2.40       * @param component the component to remove
    2.41       * @return true if the list contained the specified component
    2.42 -     * @see List#remove(java.lang.Object)
    2.43 +     * @see java.util.List#remove(java.lang.Object)
    2.44       */
    2.45      public final boolean remove(final Component component) {
    2.46          return remove((Object) component);
    2.47 @@ -171,7 +171,7 @@
    2.48  
    2.49      /**
    2.50       * @return the number of components in the list
    2.51 -     * @see List#size()
    2.52 +     * @see java.util.List#size()
    2.53       */
    2.54      // public final int size() {
    2.55      // return components.size();
     3.1 --- a/src/net/fortuna/ical4j/model/Date.java	Tue Feb 10 19:25:00 2015 +0100
     3.2 +++ b/src/net/fortuna/ical4j/model/Date.java	Tue Feb 10 19:38:00 2015 +0100
     3.3 @@ -31,9 +31,12 @@
     3.4   */
     3.5  package net.fortuna.ical4j.model;
     3.6  
     3.7 +import java.text.DateFormat;
     3.8  import java.text.ParseException;
     3.9 +import java.text.SimpleDateFormat;
    3.10  import java.util.TimeZone;
    3.11  
    3.12 +import net.fortuna.ical4j.util.CompatibilityHints;
    3.13  import net.fortuna.ical4j.util.Dates;
    3.14  import net.fortuna.ical4j.util.TimeZones;
    3.15  
    3.16 @@ -87,13 +90,15 @@
    3.17  
    3.18      private static final long serialVersionUID = 7136072363141363141L;
    3.19  
    3.20 -    private static final String PATTERN = "yyyyMMdd";
    3.21 +    private static final String DEFAULT_PATTERN = "yyyyMMdd";
    3.22 +    
    3.23 +    private static final String VCARD_PATTERN = "yyyy'-'MM'-'dd";
    3.24  
    3.25      /**
    3.26       * Default constructor.
    3.27       */
    3.28      public Date() {
    3.29 -        super(PATTERN, Dates.PRECISION_DAY, TimeZones.getDateTimeZone());
    3.30 +        super(DEFAULT_PATTERN, Dates.PRECISION_DAY, TimeZones.getDateTimeZone());
    3.31      }
    3.32      
    3.33      /**
    3.34 @@ -105,14 +110,14 @@
    3.35       * @see Dates#PRECISION_SECOND
    3.36       */
    3.37      protected Date(final int precision, TimeZone tz) {
    3.38 -        super(PATTERN, precision, tz);
    3.39 +        super(DEFAULT_PATTERN, precision, tz);
    3.40      }
    3.41  
    3.42      /**
    3.43       * @param time a date value in milliseconds
    3.44       */
    3.45      public Date(final long time) {
    3.46 -        super(time, PATTERN, Dates.PRECISION_DAY, TimeZones.getDateTimeZone());
    3.47 +        super(time, DEFAULT_PATTERN, Dates.PRECISION_DAY, TimeZones.getDateTimeZone());
    3.48      }
    3.49      
    3.50      /**
    3.51 @@ -125,7 +130,7 @@
    3.52       * @see Dates#PRECISION_SECOND
    3.53       */
    3.54      protected Date(final long time, final int precision, TimeZone tz) {
    3.55 -        super(time, PATTERN, precision, tz);
    3.56 +        super(time, DEFAULT_PATTERN, precision, tz);
    3.57      }
    3.58  
    3.59      /**
    3.60 @@ -143,7 +148,18 @@
    3.61       */
    3.62      public Date(final String value) throws ParseException {
    3.63          this();
    3.64 -        setTime(getFormat().parse(value).getTime());
    3.65 +        try {
    3.66 +        	setTime(getFormat().parse(value).getTime());
    3.67 +        } catch (ParseException pe) {
    3.68 +        	if (CompatibilityHints.isHintEnabled(CompatibilityHints.KEY_VCARD_COMPATIBILITY)) {
    3.69 +                final DateFormat parseFormat = new SimpleDateFormat(VCARD_PATTERN);
    3.70 +                parseFormat.setTimeZone(TimeZones.getDateTimeZone());
    3.71 +                setTime(parseFormat.parse(value).getTime());
    3.72 +        	}
    3.73 +        	else {
    3.74 +        		throw pe;
    3.75 +        	}
    3.76 +        }
    3.77      }
    3.78      
    3.79      /**
    3.80 @@ -152,7 +168,9 @@
    3.81       * @throws ParseException where the specified string is not a valid date
    3.82       */
    3.83      public Date(String value, String pattern) throws ParseException {
    3.84 -        super(pattern, Dates.PRECISION_DAY, TimeZones.getDateTimeZone());
    3.85 -        setTime(getFormat().parse(value).getTime());
    3.86 +        super(DEFAULT_PATTERN, Dates.PRECISION_DAY, TimeZones.getDateTimeZone());
    3.87 +        final DateFormat parseFormat = new SimpleDateFormat(pattern);
    3.88 +        parseFormat.setTimeZone(TimeZones.getDateTimeZone());
    3.89 +        setTime(parseFormat.parse(value).getTime());
    3.90      }
    3.91  }
     4.1 --- a/src/net/fortuna/ical4j/model/DateList.java	Tue Feb 10 19:25:00 2015 +0100
     4.2 +++ b/src/net/fortuna/ical4j/model/DateList.java	Tue Feb 10 19:38:00 2015 +0100
     4.3 @@ -195,7 +195,7 @@
     4.4       * timezone of this list.
     4.5       * @param date the date to add
     4.6       * @return true
     4.7 -     * @see List#add(java.lang.Object)
     4.8 +     * @see java.util.List#add(Object)
     4.9       */
    4.10      public final boolean add(final Date date) {
    4.11          if (date instanceof DateTime) {
    4.12 @@ -219,7 +219,7 @@
    4.13       * Where argument is not a <code>net.fortuna.ical4j.model.Date</code>.
    4.14       * @param date the date to add
    4.15       * @return true if the object was added, otherwise false
    4.16 -     * @see List#add(E)
    4.17 +     * @see java.util.List#add(Object)
    4.18       */
    4.19      public final boolean add(final Object date) {
    4.20          if (!(date instanceof Date)) {
     5.1 --- a/src/net/fortuna/ical4j/model/DateTime.java	Tue Feb 10 19:25:00 2015 +0100
     5.2 +++ b/src/net/fortuna/ical4j/model/DateTime.java	Tue Feb 10 19:38:00 2015 +0100
     5.3 @@ -42,7 +42,6 @@
     5.4  import net.fortuna.ical4j.util.TimeZones;
     5.5  
     5.6  import org.apache.commons.lang.builder.EqualsBuilder;
     5.7 -import org.apache.commons.lang.builder.HashCodeBuilder;
     5.8  
     5.9  /**
    5.10   * $Id$
    5.11 @@ -161,6 +160,8 @@
    5.12  	private static final String DEFAULT_PATTERN = "yyyyMMdd'T'HHmmss";
    5.13  
    5.14  	private static final String UTC_PATTERN = "yyyyMMdd'T'HHmmss'Z'";
    5.15 +	
    5.16 +	private static final String VCARD_PATTERN = "yyyy'-'MM'-'dd'T'HH':'mm':'ss'Z'";
    5.17  
    5.18  	private static final String RELAXED_PATTERN = "yyyyMMdd";
    5.19  
    5.20 @@ -195,10 +196,16 @@
    5.21  	private static final DateFormatCache RELAXED_FORMAT;
    5.22  	static {
    5.23  		final DateFormat format = new SimpleDateFormat(RELAXED_PATTERN);
    5.24 -		format.setLenient(false);
    5.25 +		format.setLenient(true);
    5.26  		RELAXED_FORMAT = new DateFormatCache(format);
    5.27  	}
    5.28  
    5.29 +	private static final DateFormatCache VCARD_FORMAT;
    5.30 +	static {
    5.31 +		final DateFormat format = new SimpleDateFormat(VCARD_PATTERN);
    5.32 +        VCARD_FORMAT = new DateFormatCache(format);
    5.33 +	}
    5.34 +
    5.35  	private Time time;
    5.36  
    5.37  	private TimeZone timezone;
    5.38 @@ -305,8 +312,18 @@
    5.39                  setTimeZone(timezone);
    5.40              }
    5.41          } catch (ParseException pe) {
    5.42 -            if (CompatibilityHints.isHintEnabled(CompatibilityHints.KEY_RELAXED_PARSING)) {
    5.43 +            if (CompatibilityHints.isHintEnabled(CompatibilityHints.KEY_VCARD_COMPATIBILITY)) {
    5.44  
    5.45 +            	try {
    5.46 +	                setTime(value, (DateFormat) VCARD_FORMAT.get(), timezone);
    5.47 +	                setTimeZone(timezone);
    5.48 +            	} catch (ParseException pe2) {
    5.49 +                    if (CompatibilityHints.isHintEnabled(CompatibilityHints.KEY_RELAXED_PARSING)) {
    5.50 +    	                setTime(value, (DateFormat) RELAXED_FORMAT.get(), timezone);
    5.51 +    	                setTimeZone(timezone);
    5.52 +                    }            		
    5.53 +            	}
    5.54 +            } else if (CompatibilityHints.isHintEnabled(CompatibilityHints.KEY_RELAXED_PARSING)) {
    5.55                  setTime(value, (DateFormat) RELAXED_FORMAT.get(), timezone);
    5.56                  setTimeZone(timezone);
    5.57              } else {
     6.1 --- a/src/net/fortuna/ical4j/model/Iso8601.java	Tue Feb 10 19:25:00 2015 +0100
     6.2 +++ b/src/net/fortuna/ical4j/model/Iso8601.java	Tue Feb 10 19:38:00 2015 +0100
     6.3 @@ -112,21 +112,22 @@
     6.4      public String toString() {
     6.5          // if time is floating avoid daylight saving rules when generating
     6.6          // string representation of date..
     6.7 -        if (!(format.getTimeZone() instanceof TimeZone)) {
     6.8 +        final java.util.TimeZone timeZone = format.getTimeZone();
     6.9 +        if (!(timeZone instanceof TimeZone)) {
    6.10              if (gmtFormat == null) {
    6.11                  gmtFormat = (DateFormat) format.clone();
    6.12                  gmtFormat.setTimeZone(TimeZone.getTimeZone(TimeZones.GMT_ID));
    6.13              }
    6.14 -            if (format.getTimeZone().inDaylightTime(this)
    6.15 -                    && format.getTimeZone().inDaylightTime(new Date(getTime() - 1))) {
    6.16 -                
    6.17 +            if (timeZone.inDaylightTime(this)
    6.18 +                    && timeZone.inDaylightTime(new Date(getTime() - 1))) {
    6.19 +
    6.20                  return gmtFormat.format(new Date(getTime()
    6.21 -                        + format.getTimeZone().getRawOffset()
    6.22 -                        + format.getTimeZone().getDSTSavings()));
    6.23 +                        + timeZone.getRawOffset()
    6.24 +                        + timeZone.getDSTSavings()));
    6.25  //                return format.format(new Date(getTime() - format.getTimeZone().getDSTSavings()));
    6.26              }
    6.27  //            return gmtFormat.format(new Date(getTime() + format.getTimeZone().getOffset(getTime())));
    6.28 -            return gmtFormat.format(new Date(getTime() + format.getTimeZone().getRawOffset()));
    6.29 +            return gmtFormat.format(new Date(getTime() + timeZone.getRawOffset()));
    6.30          }
    6.31          return format.format(this);
    6.32      }
     7.1 --- a/src/net/fortuna/ical4j/model/NumberList.java	Tue Feb 10 19:25:00 2015 +0100
     7.2 +++ b/src/net/fortuna/ical4j/model/NumberList.java	Tue Feb 10 19:38:00 2015 +0100
     7.3 @@ -121,7 +121,7 @@
     7.4       * where argument is not a <code>java.lang.Integer</code>.
     7.5       * @param arg0 an object to add
     7.6       * @return true if the object was added, otherwise false
     7.7 -     * @see List#add(E)
     7.8 +     * @see java.util.List#add(Object)
     7.9       */
    7.10      public final boolean add(final Object arg0) {
    7.11          if (!(arg0 instanceof Integer)) {
     8.1 --- a/src/net/fortuna/ical4j/model/PeriodList.java	Tue Feb 10 19:25:00 2015 +0100
     8.2 +++ b/src/net/fortuna/ical4j/model/PeriodList.java	Tue Feb 10 19:38:00 2015 +0100
     8.3 @@ -146,7 +146,7 @@
     8.4       * where argument is not a <code>net.fortuna.ical4j.model.Period</code>.
     8.5       * @param period a period to add to the list
     8.6       * @return true if the period was added, otherwise false
     8.7 -     * @see java.util.List#add(E)
     8.8 +     * @see java.util.List#add(Object)
     8.9       */
    8.10      public final boolean add(final Object period) {
    8.11          if (!(period instanceof Period)) {
     9.1 --- a/src/net/fortuna/ical4j/model/PropertyFactoryImpl.java	Tue Feb 10 19:25:00 2015 +0100
     9.2 +++ b/src/net/fortuna/ical4j/model/PropertyFactoryImpl.java	Tue Feb 10 19:38:00 2015 +0100
     9.3 @@ -365,9 +365,6 @@
     9.4          }
     9.5      }
     9.6  
     9.7 -    /**
     9.8 -     * @return
     9.9 -     */
    9.10      private static class DtStartFactory implements PropertyFactory {
    9.11          private static final long serialVersionUID = 1L;
    9.12  
    10.1 --- a/src/net/fortuna/ical4j/model/PropertyList.java	Tue Feb 10 19:25:00 2015 +0100
    10.2 +++ b/src/net/fortuna/ical4j/model/PropertyList.java	Tue Feb 10 19:38:00 2015 +0100
    10.3 @@ -134,7 +134,7 @@
    10.4       * <code>net.fortuna.ical4j.model.Property</code>.
    10.5       * @param property a property to add
    10.6       * @return true if the property is added, otherwise false
    10.7 -     * @see java.util.List#add(E)
    10.8 +     * @see java.util.List#add(Object)
    10.9       */
   10.10      public final boolean add(final Object property) {
   10.11          if (!(property instanceof Property)) {
    11.1 --- a/src/net/fortuna/ical4j/model/Recur.java	Tue Feb 10 19:25:00 2015 +0100
    11.2 +++ b/src/net/fortuna/ical4j/model/Recur.java	Tue Feb 10 19:38:00 2015 +0100
    11.3 @@ -44,6 +44,7 @@
    11.4  import java.util.StringTokenizer;
    11.5  
    11.6  import net.fortuna.ical4j.model.parameter.Value;
    11.7 +import net.fortuna.ical4j.util.CompatibilityHints;
    11.8  import net.fortuna.ical4j.util.Configurator;
    11.9  import net.fortuna.ical4j.util.Dates;
   11.10  
   11.11 @@ -171,6 +172,8 @@
   11.12      private NumberList setPosList;
   11.13  
   11.14      private String weekStartDay;
   11.15 +    
   11.16 +    private int calendarWeekStartDay;
   11.17  
   11.18      private Map experimentalValues = new HashMap();
   11.19  
   11.20 @@ -181,6 +184,8 @@
   11.21       * Default constructor.
   11.22       */
   11.23      public Recur() {
   11.24 +        // default week start is Monday per RFC5545
   11.25 +        calendarWeekStartDay = Calendar.MONDAY;
   11.26      }
   11.27      
   11.28      /**
   11.29 @@ -189,6 +194,8 @@
   11.30       * @throws ParseException thrown when the specified string contains an invalid representation of an UNTIL date value
   11.31       */
   11.32      public Recur(final String aValue) throws ParseException {
   11.33 +        // default week start is Monday per RFC5545
   11.34 +        calendarWeekStartDay = Calendar.MONDAY;
   11.35          final StringTokenizer t = new StringTokenizer(aValue, ";=");
   11.36          while (t.hasMoreTokens()) {
   11.37              final String token = t.nextToken();
   11.38 @@ -241,10 +248,17 @@
   11.39              }
   11.40              else if (WKST.equals(token)) {
   11.41                  weekStartDay = nextToken(t, token);
   11.42 +                calendarWeekStartDay = WeekDay.getCalendarDay(new WeekDay(weekStartDay));
   11.43              }
   11.44 -            // assume experimental value..
   11.45              else {
   11.46 -                experimentalValues.put(token, nextToken(t, token));
   11.47 +            	if (CompatibilityHints.isHintEnabled(CompatibilityHints.KEY_RELAXED_PARSING)) {
   11.48 +	            	// assume experimental value..
   11.49 +	                experimentalValues.put(token, nextToken(t, token));
   11.50 +            	}
   11.51 +            	else {
   11.52 +            		throw new IllegalArgumentException("Invalid recurrence rule part: " + 
   11.53 +            				token + "=" + nextToken(t, token));
   11.54 +            	}
   11.55              }
   11.56          }
   11.57          validateFrequency();
   11.58 @@ -264,6 +278,8 @@
   11.59       * @param until maximum recurrence date
   11.60       */
   11.61      public Recur(final String frequency, final Date until) {
   11.62 +        // default week start is Monday per RFC5545
   11.63 +        calendarWeekStartDay = Calendar.MONDAY;
   11.64          this.frequency = frequency;
   11.65          this.until = until;
   11.66          validateFrequency();
   11.67 @@ -274,6 +290,8 @@
   11.68       * @param count maximum recurrence count
   11.69       */
   11.70      public Recur(final String frequency, final int count) {
   11.71 +        // default week start is Monday per RFC5545
   11.72 +        calendarWeekStartDay = Calendar.MONDAY;
   11.73          this.frequency = frequency;
   11.74          this.count = count;
   11.75          validateFrequency();
   11.76 @@ -416,6 +434,9 @@
   11.77       */
   11.78      public final void setWeekStartDay(final String weekStartDay) {
   11.79          this.weekStartDay = weekStartDay;
   11.80 +        if (weekStartDay != null) {
   11.81 +            calendarWeekStartDay = WeekDay.getCalendarDay(new WeekDay(weekStartDay));
   11.82 +        }
   11.83      }
   11.84  
   11.85      /**
   11.86 @@ -578,8 +599,7 @@
   11.87                  dates.setTimeZone(((DateTime) seed).getTimeZone());
   11.88              }
   11.89          }
   11.90 -        final Calendar cal = Dates.getCalendarInstance(seed);
   11.91 -        cal.setTime(seed);
   11.92 +        final Calendar cal = getCalendarInstance(seed, true);
   11.93  
   11.94          // optimize the start time for selecting candidates
   11.95          // (only applicable where a COUNT is not specified)
   11.96 @@ -670,8 +690,7 @@
   11.97       */
   11.98      public final Date getNextDate(final Date seed, final Date startDate) {
   11.99  
  11.100 -        final Calendar cal = Dates.getCalendarInstance(seed);
  11.101 -        cal.setTime(seed);
  11.102 +        final Calendar cal = getCalendarInstance(seed, true);
  11.103  
  11.104          // optimize the start time for selecting candidates
  11.105          // (only applicable where a COUNT is not specified)
  11.106 @@ -857,8 +876,8 @@
  11.107          final DateList monthlyDates = getDateListInstance(dates);
  11.108          for (final Iterator i = dates.iterator(); i.hasNext();) {
  11.109              final Date date = (Date) i.next();
  11.110 -            final Calendar cal = Dates.getCalendarInstance(date);
  11.111 -            cal.setTime(date);
  11.112 +            final Calendar cal = getCalendarInstance(date, true);
  11.113 +
  11.114              for (final Iterator j = getMonthList().iterator(); j.hasNext();) {
  11.115                  final Integer month = (Integer) j.next();
  11.116                  // Java months are zero-based..
  11.117 @@ -883,8 +902,7 @@
  11.118          final DateList weekNoDates = getDateListInstance(dates);
  11.119          for (final Iterator i = dates.iterator(); i.hasNext();) {
  11.120              final Date date = (Date) i.next();
  11.121 -            final Calendar cal = Dates.getCalendarInstance(date);
  11.122 -            cal.setTime(date);
  11.123 +            final Calendar cal = getCalendarInstance(date, true);
  11.124              for (final Iterator j = getWeekNoList().iterator(); j.hasNext();) {
  11.125                  final Integer weekNo = (Integer) j.next();
  11.126                  cal.set(Calendar.WEEK_OF_YEAR, Dates.getAbsWeekNo(cal.getTime(), weekNo.intValue()));
  11.127 @@ -907,8 +925,7 @@
  11.128          final DateList yearDayDates = getDateListInstance(dates);
  11.129          for (final Iterator i = dates.iterator(); i.hasNext();) {
  11.130              final Date date = (Date) i.next();
  11.131 -            final Calendar cal = Dates.getCalendarInstance(date);
  11.132 -            cal.setTime(date);
  11.133 +            final Calendar cal = getCalendarInstance(date, true);
  11.134              for (final Iterator j = getYearDayList().iterator(); j.hasNext();) {
  11.135                  final Integer yearDay = (Integer) j.next();
  11.136                  cal.set(Calendar.DAY_OF_YEAR, Dates.getAbsYearDay(cal.getTime(), yearDay.intValue()));
  11.137 @@ -931,9 +948,7 @@
  11.138          final DateList monthDayDates = getDateListInstance(dates);
  11.139          for (final Iterator i = dates.iterator(); i.hasNext();) {
  11.140              final Date date = (Date) i.next();
  11.141 -            final Calendar cal = Dates.getCalendarInstance(date);
  11.142 -            cal.setLenient(false);
  11.143 -            cal.setTime(date);
  11.144 +            final Calendar cal = getCalendarInstance(date, false);
  11.145              for (final Iterator j = getMonthDayList().iterator(); j.hasNext();) {
  11.146                  final Integer monthDay = (Integer) j.next();
  11.147                  try {
  11.148 @@ -969,8 +984,7 @@
  11.149                  // if BYYEARDAY or BYMONTHDAY is specified filter existing
  11.150                  // list..
  11.151                  if (!getYearDayList().isEmpty() || !getMonthDayList().isEmpty()) {
  11.152 -                    final Calendar cal = Dates.getCalendarInstance(date);
  11.153 -                    cal.setTime(date);
  11.154 +                    final Calendar cal = getCalendarInstance(date, true);
  11.155                      if (weekDay.equals(WeekDay.getWeekDay(cal))) {
  11.156                          weekDayDates.add(date);
  11.157                      }
  11.158 @@ -991,15 +1005,7 @@
  11.159       * @return
  11.160       */
  11.161      private List getAbsWeekDays(final Date date, final Value type, final WeekDay weekDay) {
  11.162 -        final Calendar cal = Dates.getCalendarInstance(date);
  11.163 -        // default week start is Monday per RFC5545
  11.164 -        int calendarWeekStartDay = Calendar.MONDAY;
  11.165 -        if (weekStartDay != null) {
  11.166 -        	calendarWeekStartDay = WeekDay.getCalendarDay(new WeekDay(weekStartDay));
  11.167 -        }
  11.168 -        cal.setFirstDayOfWeek(calendarWeekStartDay);
  11.169 -        cal.setTime(date);
  11.170 -        
  11.171 +        final Calendar cal = getCalendarInstance(date, true);
  11.172          final DateList days = new DateList(type);
  11.173          if (date instanceof DateTime) {
  11.174              if (((DateTime) date).isUtc()) {
  11.175 @@ -1095,8 +1101,7 @@
  11.176          final DateList hourlyDates = getDateListInstance(dates);
  11.177          for (final Iterator i = dates.iterator(); i.hasNext();) {
  11.178              final Date date = (Date) i.next();
  11.179 -            final Calendar cal = Dates.getCalendarInstance(date);
  11.180 -            cal.setTime(date);
  11.181 +            final Calendar cal = getCalendarInstance(date, true);
  11.182              for (final Iterator j = getHourList().iterator(); j.hasNext();) {
  11.183                  final Integer hour = (Integer) j.next();
  11.184                  cal.set(Calendar.HOUR_OF_DAY, hour.intValue());
  11.185 @@ -1119,8 +1124,7 @@
  11.186          final DateList minutelyDates = getDateListInstance(dates);
  11.187          for (final Iterator i = dates.iterator(); i.hasNext();) {
  11.188              final Date date = (Date) i.next();
  11.189 -            final Calendar cal = Dates.getCalendarInstance(date);
  11.190 -            cal.setTime(date);
  11.191 +            final Calendar cal = getCalendarInstance(date, true);
  11.192              for (final Iterator j = getMinuteList().iterator(); j.hasNext();) {
  11.193                  final Integer minute = (Integer) j.next();
  11.194                  cal.set(Calendar.MINUTE, minute.intValue());
  11.195 @@ -1143,8 +1147,7 @@
  11.196          final DateList secondlyDates = getDateListInstance(dates);
  11.197          for (final Iterator i = dates.iterator(); i.hasNext();) {
  11.198              final Date date = (Date) i.next();
  11.199 -            final Calendar cal = Dates.getCalendarInstance(date);
  11.200 -            cal.setTime(date);
  11.201 +            final Calendar cal = getCalendarInstance(date, true);
  11.202              for (final Iterator j = getSecondList().iterator(); j.hasNext();) {
  11.203                  final Integer second = (Integer) j.next();
  11.204                  cal.set(Calendar.SECOND, second.intValue());
  11.205 @@ -1218,6 +1221,23 @@
  11.206      }
  11.207      
  11.208      /**
  11.209 +     * Construct a Calendar object and sets the time.
  11.210 +     * @param date
  11.211 +     * @param lenient 
  11.212 +     * @return 
  11.213 +     */
  11.214 +    private Calendar getCalendarInstance(final Date date, final boolean lenient) {
  11.215 +        Calendar cal = Dates.getCalendarInstance(date);
  11.216 +        // A week should have at least 4 days to be considered as such per RFC5545
  11.217 +        cal.setMinimalDaysInFirstWeek(4);
  11.218 +        cal.setFirstDayOfWeek(calendarWeekStartDay);
  11.219 +        cal.setLenient(lenient);     
  11.220 +        cal.setTime(date);
  11.221 +        
  11.222 +        return cal;
  11.223 +    }
  11.224 +    
  11.225 +    /**
  11.226       * @param stream
  11.227       * @throws IOException
  11.228       * @throws ClassNotFoundException
  11.229 @@ -1233,7 +1253,7 @@
  11.230       * @param origList
  11.231       * @return a new empty list.
  11.232       */
  11.233 -    private static final DateList getDateListInstance(final DateList origList) {
  11.234 +    private static DateList getDateListInstance(final DateList origList) {
  11.235          final DateList list = new DateList(origList.getType());
  11.236          if (origList.isUtc()) {
  11.237              list.setUtc(true);
    12.1 --- a/src/net/fortuna/ical4j/model/TimeZone.java	Tue Feb 10 19:25:00 2015 +0100
    12.2 +++ b/src/net/fortuna/ical4j/model/TimeZone.java	Tue Feb 10 19:38:00 2015 +0100
    12.3 @@ -72,16 +72,27 @@
    12.4      /**
    12.5       * {@inheritDoc}
    12.6       */
    12.7 -    public final int getOffset(final int era, final int year, final int month, final int day,
    12.8 +    public final int getOffset(final int era, final int year, final int month, final int dayOfMonth,
    12.9              final int dayOfWeek, final int milliseconds) {
   12.10 +
   12.11 +        // calculate time of day
   12.12 +        int ms = milliseconds;
   12.13 +        final int hour = ms / 3600000;
   12.14 +        ms -= hour*3600000;
   12.15 +        final int minute = ms / 60000;
   12.16 +        ms -= minute*60000;
   12.17 +        final int second = ms / 1000;
   12.18 +        ms -= second*1000;
   12.19 +
   12.20 +        final Calendar cal = Calendar.getInstance();
   12.21 +        cal.clear();	// don't retain current date/time, it may disturb the calculation		
   12.22          
   12.23 -        final Calendar cal = Calendar.getInstance();
   12.24 +    	// set date and time
   12.25          cal.set(Calendar.ERA, era);
   12.26 -        cal.set(Calendar.YEAR, year);
   12.27 -        cal.set(Calendar.MONTH, month);
   12.28 -        cal.set(Calendar.DAY_OF_YEAR, day);
   12.29          cal.set(Calendar.DAY_OF_WEEK, dayOfWeek);
   12.30 -        cal.set(Calendar.MILLISECOND, milliseconds);
   12.31 +        cal.set(year, month, dayOfMonth, hour, minute, second);
   12.32 +        cal.set(Calendar.MILLISECOND, ms);
   12.33 +        
   12.34          final Observance observance = vTimeZone.getApplicableObservance(new DateTime(cal.getTime()));
   12.35          if (observance != null) {
   12.36              final TzOffsetTo offset = (TzOffsetTo) observance.getProperty(Property.TZOFFSETTO);
   12.37 @@ -97,7 +108,12 @@
   12.38          final Observance observance = vTimeZone.getApplicableObservance(new DateTime(date));
   12.39          if (observance != null) {
   12.40              final TzOffsetTo offset = (TzOffsetTo) observance.getProperty(Property.TZOFFSETTO);
   12.41 -            return (int) offset.getOffset().getOffset();
   12.42 +            if (offset.getOffset().getOffset() < getRawOffset()) {
   12.43 +            	return getRawOffset();
   12.44 +            }
   12.45 +            else {
   12.46 +            	return (int) offset.getOffset().getOffset();
   12.47 +            }
   12.48          }
   12.49          return 0;
   12.50      }
   12.51 @@ -145,26 +161,34 @@
   12.52      }
   12.53  
   12.54      private static final int getRawOffset(VTimeZone vt) {
   12.55 -        // per spec, rawoffset is the raw offset at the current date
   12.56 -        final DateTime now = new DateTime();
   12.57          
   12.58          List seasonalTimes = vt.getObservances().getComponents(Observance.STANDARD);
   12.59          // if no standard time use daylight time..
   12.60 -        if (seasonalTimes.size() == 0) {
   12.61 +        if (seasonalTimes.isEmpty()) {
   12.62              seasonalTimes = vt.getObservances().getComponents(Observance.DAYLIGHT);
   12.63 +            if (seasonalTimes.isEmpty()) {
   12.64 +                return 0;
   12.65 +            }
   12.66          }
   12.67          Observance latestSeasonalTime = null;
   12.68 -        Date latestOnset = null;
   12.69 -        for (int i = 0; i < seasonalTimes.size(); i++) {
   12.70 -            Observance seasonalTime = (Observance) seasonalTimes.get(i);
   12.71 -            Date onset = seasonalTime.getLatestOnset(now);
   12.72 -            if (onset == null) {
   12.73 -                continue;
   12.74 +        if (seasonalTimes.size() > 1) {
   12.75 +            // per java spec and when dealing with historical time,
   12.76 +            // rawoffset is the raw offset at the current date
   12.77 +            final DateTime now = new DateTime();
   12.78 +            Date latestOnset = null;
   12.79 +            for (int i = 0; i < seasonalTimes.size(); i++) {
   12.80 +                Observance seasonalTime = (Observance) seasonalTimes.get(i);
   12.81 +                Date onset = seasonalTime.getLatestOnset(now);
   12.82 +                if (onset == null) {
   12.83 +                    continue;
   12.84 +                }
   12.85 +                if (latestOnset == null || onset.after(latestOnset)) {
   12.86 +                    latestOnset = onset;
   12.87 +                    latestSeasonalTime = seasonalTime;
   12.88 +                }
   12.89              }
   12.90 -            if (latestOnset == null || onset.after(latestOnset)) {
   12.91 -                latestOnset = onset;
   12.92 -                latestSeasonalTime = seasonalTime;
   12.93 -            }
   12.94 +        } else {
   12.95 +            latestSeasonalTime = (Observance)seasonalTimes.get(0);
   12.96          }
   12.97          if (latestSeasonalTime != null) {
   12.98              final TzOffsetTo offsetTo = (TzOffsetTo) latestSeasonalTime.getProperty(Property.TZOFFSETTO);
   12.99 @@ -174,4 +198,22 @@
  12.100          }
  12.101          return 0;
  12.102      }
  12.103 +
  12.104 +    public boolean equals(Object o) {
  12.105 +        if (this == o) return true;
  12.106 +        if (o == null || getClass() != o.getClass()) return false;
  12.107 +
  12.108 +        TimeZone timeZone = (TimeZone) o;
  12.109 +
  12.110 +        if (rawOffset != timeZone.rawOffset) return false;
  12.111 +        if (vTimeZone != null ? !vTimeZone.equals(timeZone.vTimeZone) : timeZone.vTimeZone != null) return false;
  12.112 +
  12.113 +        return true;
  12.114 +    }
  12.115 +
  12.116 +    public int hashCode() {
  12.117 +        int result = vTimeZone != null ? vTimeZone.hashCode() : 0;
  12.118 +        result = 31 * result + rawOffset;
  12.119 +        return result;
  12.120 +    }
  12.121  }
    13.1 --- a/src/net/fortuna/ical4j/model/TimeZoneRegistryImpl.java	Tue Feb 10 19:25:00 2015 +0100
    13.2 +++ b/src/net/fortuna/ical4j/model/TimeZoneRegistryImpl.java	Tue Feb 10 19:38:00 2015 +0100
    13.3 @@ -73,13 +73,19 @@
    13.4      private static final Properties ALIASES = new Properties();
    13.5      static {
    13.6          try {
    13.7 -        	//ALIASES.load(ResourceLoader.getResourceAsStream("net/fortuna/ical4j/model/tz.alias"));
    13.8 -        	ALIASES.load(TimeZoneRegistryImpl.class.getResourceAsStream("tz.alias"));
    13.9 -             }
   13.10 +            ALIASES.load(ResourceLoader.getResourceAsStream("net/fortuna/ical4j/model/tz.alias"));
   13.11 +        }
   13.12          catch (IOException ioe) {
   13.13              LogFactory.getLog(TimeZoneRegistryImpl.class).warn(
   13.14                      "Error loading timezone aliases: " + ioe.getMessage());
   13.15          }
   13.16 +        try {
   13.17 +        	ALIASES.load(ResourceLoader.getResourceAsStream("tz.alias"));
   13.18 +        }
   13.19 +        catch (Exception e) {
   13.20 +        	LogFactory.getLog(TimeZoneRegistryImpl.class).debug(
   13.21 +        			"Error loading custom timezone aliases: " + e.getMessage());
   13.22 +        }
   13.23      }
   13.24  
   13.25      private Map timezones;
   13.26 @@ -180,8 +186,7 @@
   13.27       * Loads an existing VTimeZone from the classpath corresponding to the specified Java timezone.
   13.28       */
   13.29      private VTimeZone loadVTimeZone(final String id) throws IOException, ParserException {
   13.30 -        //final URL resource = ResourceLoader.getResource(resourcePrefix + id + ".ics");
   13.31 -        final URL resource = TimeZoneRegistryImpl.class.getClassLoader().getResource(resourcePrefix + id + ".ics");
   13.32 +        final URL resource = ResourceLoader.getResource(resourcePrefix + id + ".ics");
   13.33          if (resource != null) {
   13.34              final CalendarBuilder builder = new CalendarBuilder();
   13.35              final Calendar calendar = builder.build(resource.openStream());
    14.1 --- a/src/net/fortuna/ical4j/model/WeekDayList.java	Tue Feb 10 19:25:00 2015 +0100
    14.2 +++ b/src/net/fortuna/ical4j/model/WeekDayList.java	Tue Feb 10 19:38:00 2015 +0100
    14.3 @@ -95,7 +95,7 @@
    14.4       * where argument is not a <code>net.fortuna.ical4j.model.WeekDay</code>.
    14.5       * @param weekday a week day to add
    14.6       * @return true if the week day is added, otherwise false
    14.7 -     * @see List#add(E)
    14.8 +     * @see java.util.List#add(Object)
    14.9       */
   14.10      public final boolean add(final Object weekday) {
   14.11          if (!(weekday instanceof WeekDay)) {
    15.1 --- a/src/net/fortuna/ical4j/model/component/VEvent.java	Tue Feb 10 19:25:00 2015 +0100
    15.2 +++ b/src/net/fortuna/ical4j/model/component/VEvent.java	Tue Feb 10 19:38:00 2015 +0100
    15.3 @@ -548,7 +548,6 @@
    15.4              
    15.5              PropertyValidator.getInstance().assertOneOrLess(Property.CATEGORIES, getProperties());
    15.6              PropertyValidator.getInstance().assertOneOrLess(Property.CLASS, getProperties());
    15.7 -            PropertyValidator.getInstance().assertOneOrLess(Property.COMMENT, getProperties());
    15.8              PropertyValidator.getInstance().assertOneOrLess(Property.CREATED, getProperties());
    15.9              PropertyValidator.getInstance().assertOneOrLess(Property.DESCRIPTION, getProperties());
   15.10              PropertyValidator.getInstance().assertOneOrLess(Property.DTEND, getProperties());
   15.11 @@ -643,7 +642,6 @@
   15.12              PropertyValidator.getInstance().assertOne(Property.SEQUENCE, getProperties());
   15.13              PropertyValidator.getInstance().assertOne(Property.UID, getProperties());
   15.14              
   15.15 -            PropertyValidator.getInstance().assertOneOrLess(Property.COMMENT, getProperties());
   15.16              PropertyValidator.getInstance().assertOneOrLess(Property.CATEGORIES, getProperties());
   15.17              PropertyValidator.getInstance().assertOneOrLess(Property.CLASS, getProperties());
   15.18              PropertyValidator.getInstance().assertOneOrLess(Property.CREATED, getProperties());
   15.19 @@ -747,7 +745,6 @@
   15.20              
   15.21              PropertyValidator.getInstance().assertOneOrLess(Property.CATEGORIES, getProperties());
   15.22              PropertyValidator.getInstance().assertOneOrLess(Property.CLASS, getProperties());
   15.23 -            PropertyValidator.getInstance().assertOneOrLess(Property.COMMENT, getProperties());
   15.24              PropertyValidator.getInstance().assertOneOrLess(Property.CREATED, getProperties());
   15.25              PropertyValidator.getInstance().assertOneOrLess(Property.DESCRIPTION, getProperties());
   15.26              PropertyValidator.getInstance().assertOneOrLess(Property.DTEND, getProperties());
   15.27 @@ -833,7 +830,6 @@
   15.28              PropertyValidator.getInstance().assertOne(Property.ORGANIZER, getProperties());
   15.29              PropertyValidator.getInstance().assertOne(Property.UID, getProperties());
   15.30              
   15.31 -            PropertyValidator.getInstance().assertOneOrLess(Property.COMMENT, getProperties());
   15.32              PropertyValidator.getInstance().assertOneOrLess(Property.RECURRENCE_ID, getProperties());
   15.33              PropertyValidator.getInstance().assertOneOrLess(Property.SEQUENCE, getProperties());
   15.34              
   15.35 @@ -941,7 +937,6 @@
   15.36              PropertyValidator.getInstance().assertOneOrLess(Property.SEQUENCE, getProperties());
   15.37              PropertyValidator.getInstance().assertOneOrLess(Property.CATEGORIES, getProperties());
   15.38              PropertyValidator.getInstance().assertOneOrLess(Property.CLASS, getProperties());
   15.39 -            PropertyValidator.getInstance().assertOneOrLess(Property.COMMENT, getProperties());
   15.40              PropertyValidator.getInstance().assertOneOrLess(Property.CREATED, getProperties());
   15.41              PropertyValidator.getInstance().assertOneOrLess(Property.DESCRIPTION, getProperties());
   15.42              PropertyValidator.getInstance().assertOneOrLess(Property.DTEND, getProperties());
   15.43 @@ -1034,7 +1029,6 @@
   15.44              PropertyValidator.getInstance().assertOne(Property.ORGANIZER, getProperties());
   15.45              PropertyValidator.getInstance().assertOne(Property.UID, getProperties());
   15.46              
   15.47 -            PropertyValidator.getInstance().assertOneOrLess(Property.COMMENT, getProperties());
   15.48              PropertyValidator.getInstance().assertOneOrLess(Property.RECURRENCE_ID, getProperties());
   15.49              
   15.50              PropertyValidator.getInstance().assertNone(Property.ATTACH, getProperties());
   15.51 @@ -1140,7 +1134,6 @@
   15.52              PropertyValidator.getInstance().assertOneOrLess(Property.SEQUENCE, getProperties());
   15.53              PropertyValidator.getInstance().assertOneOrLess(Property.CATEGORIES, getProperties());
   15.54              PropertyValidator.getInstance().assertOneOrLess(Property.CLASS, getProperties());
   15.55 -            PropertyValidator.getInstance().assertOneOrLess(Property.COMMENT, getProperties());
   15.56              PropertyValidator.getInstance().assertOneOrLess(Property.CREATED, getProperties());
   15.57              PropertyValidator.getInstance().assertOneOrLess(Property.DESCRIPTION, getProperties());
   15.58              PropertyValidator.getInstance().assertOneOrLess(Property.DTEND, getProperties());
   15.59 @@ -1233,7 +1226,6 @@
   15.60              PropertyValidator.getInstance().assertOneOrLess(Property.SEQUENCE, getProperties());
   15.61              PropertyValidator.getInstance().assertOneOrLess(Property.CATEGORIES, getProperties());
   15.62              PropertyValidator.getInstance().assertOneOrLess(Property.CLASS, getProperties());
   15.63 -            PropertyValidator.getInstance().assertOneOrLess(Property.COMMENT, getProperties());
   15.64              PropertyValidator.getInstance().assertOneOrLess(Property.CREATED, getProperties());
   15.65              PropertyValidator.getInstance().assertOneOrLess(Property.DESCRIPTION, getProperties());
   15.66              PropertyValidator.getInstance().assertOneOrLess(Property.DTEND, getProperties());
   15.67 @@ -1456,9 +1448,19 @@
   15.68      public final DtEnd getEndDate(final boolean deriveFromDuration) {
   15.69          DtEnd dtEnd = (DtEnd) getProperty(Property.DTEND);
   15.70          // No DTEND? No problem, we'll use the DURATION.
   15.71 -        if (dtEnd == null && deriveFromDuration && getDuration() != null) {
   15.72 +        if (dtEnd == null && deriveFromDuration && getStartDate() != null) {
   15.73              final DtStart dtStart = getStartDate();
   15.74 -            final Duration vEventDuration = getDuration();
   15.75 +            final Duration vEventDuration;
   15.76 +            if (getDuration() != null) {
   15.77 +                vEventDuration = getDuration();
   15.78 +            } else if (dtStart.getDate() instanceof DateTime) {
   15.79 +                // If "DTSTART" is a DATE-TIME, then the event's duration is zero (see: RFC 5545, 3.6.1 Event Component)
   15.80 +                vEventDuration = new Duration(new Dur(0, 0, 0, 0));
   15.81 +            } else {
   15.82 +                // If "DTSTART" is a DATE, then the event's duration is one day (see: RFC 5545, 3.6.1 Event Component)
   15.83 +                vEventDuration = new Duration(new Dur(1, 0, 0, 0));
   15.84 +            }
   15.85 +
   15.86              dtEnd = new DtEnd(Dates.getInstance(vEventDuration.getDuration()
   15.87                      .getTime(dtStart.getDate()), (Value) dtStart
   15.88                      .getParameter(Parameter.VALUE)));
    16.1 --- a/src/net/fortuna/ical4j/model/component/VFreeBusy.java	Tue Feb 10 19:25:00 2015 +0100
    16.2 +++ b/src/net/fortuna/ical4j/model/component/VFreeBusy.java	Tue Feb 10 19:38:00 2015 +0100
    16.3 @@ -398,7 +398,7 @@
    16.4                  final Period period = (Period) i.next();
    16.5                  // check if period outside bounds..
    16.6                  if (!range.intersects(period)) {
    16.7 -                    periods.remove(period);
    16.8 +                    i.remove();
    16.9                  }
   16.10              }
   16.11              return new FreeBusy(periods);
   16.12 @@ -628,7 +628,6 @@
   16.13              PropertyValidator.getInstance().assertOne(Property.ORGANIZER, getProperties());
   16.14              PropertyValidator.getInstance().assertOne(Property.UID, getProperties());
   16.15              
   16.16 -            PropertyValidator.getInstance().assertOneOrLess(Property.COMMENT, getProperties());
   16.17              PropertyValidator.getInstance().assertOneOrLess(Property.URL, getProperties());
   16.18              
   16.19              PropertyValidator.getInstance().assertNone(Property.ATTENDEE, getProperties());
   16.20 @@ -687,7 +686,6 @@
   16.21              PropertyValidator.getInstance().assertOne(Property.ORGANIZER, getProperties());
   16.22              PropertyValidator.getInstance().assertOne(Property.UID, getProperties());
   16.23              
   16.24 -            PropertyValidator.getInstance().assertOneOrLess(Property.COMMENT, getProperties());
   16.25              PropertyValidator.getInstance().assertOneOrLess(Property.URL, getProperties());
   16.26              
   16.27              PropertyValidator.getInstance().assertNone(Property.DURATION, getProperties());
   16.28 @@ -741,8 +739,6 @@
   16.29              PropertyValidator.getInstance().assertOne(Property.ORGANIZER, getProperties());
   16.30              PropertyValidator.getInstance().assertOne(Property.UID, getProperties());
   16.31              
   16.32 -            PropertyValidator.getInstance().assertOneOrLess(Property.COMMENT, getProperties());
   16.33 -            
   16.34              PropertyValidator.getInstance().assertNone(Property.FREEBUSY, getProperties());
   16.35              PropertyValidator.getInstance().assertNone(Property.DURATION, getProperties());
   16.36              PropertyValidator.getInstance().assertNone(Property.REQUEST_STATUS, getProperties());
    17.1 --- a/src/net/fortuna/ical4j/model/component/VJournal.java	Tue Feb 10 19:25:00 2015 +0100
    17.2 +++ b/src/net/fortuna/ical4j/model/component/VJournal.java	Tue Feb 10 19:38:00 2015 +0100
    17.3 @@ -289,7 +289,6 @@
    17.4              
    17.5              PropertyValidator.getInstance().assertOneOrLess(Property.CATEGORIES, getProperties());
    17.6              PropertyValidator.getInstance().assertOneOrLess(Property.CLASS, getProperties());
    17.7 -            PropertyValidator.getInstance().assertOneOrLess(Property.COMMENT, getProperties());
    17.8              PropertyValidator.getInstance().assertOneOrLess(Property.CREATED, getProperties());
    17.9              PropertyValidator.getInstance().assertOneOrLess(Property.LAST_MODIFIED, getProperties());
   17.10              PropertyValidator.getInstance().assertOneOrLess(Property.STATUS, getProperties());
   17.11 @@ -360,7 +359,6 @@
   17.12              
   17.13              PropertyValidator.getInstance().assertOneOrLess(Property.CATEGORIES, getProperties());
   17.14              PropertyValidator.getInstance().assertOneOrLess(Property.CLASS, getProperties());
   17.15 -            PropertyValidator.getInstance().assertOneOrLess(Property.COMMENT, getProperties());
   17.16              PropertyValidator.getInstance().assertOneOrLess(Property.CREATED, getProperties());
   17.17              PropertyValidator.getInstance().assertOneOrLess(Property.DESCRIPTION, getProperties());
   17.18              PropertyValidator.getInstance().assertOneOrLess(Property.DTSTART, getProperties());
   17.19 @@ -435,7 +433,6 @@
   17.20              
   17.21              PropertyValidator.getInstance().assertOneOrLess(Property.CATEGORIES, getProperties());
   17.22              PropertyValidator.getInstance().assertOneOrLess(Property.CLASS, getProperties());
   17.23 -            PropertyValidator.getInstance().assertOneOrLess(Property.COMMENT, getProperties());
   17.24              PropertyValidator.getInstance().assertOneOrLess(Property.CREATED, getProperties());
   17.25              PropertyValidator.getInstance().assertOneOrLess(Property.LAST_MODIFIED, getProperties());
   17.26              PropertyValidator.getInstance().assertOneOrLess(Property.RECURRENCE_ID, getProperties());
    18.1 --- a/src/net/fortuna/ical4j/model/component/VTimeZone.java	Tue Feb 10 19:25:00 2015 +0100
    18.2 +++ b/src/net/fortuna/ical4j/model/component/VTimeZone.java	Tue Feb 10 19:38:00 2015 +0100
    18.3 @@ -288,7 +288,6 @@
    18.4                  PropertyValidator.getInstance().assertOne(Property.TZOFFSETFROM, observance.getProperties());
    18.5                  PropertyValidator.getInstance().assertOne(Property.TZOFFSETTO, observance.getProperties());
    18.6                  
    18.7 -                PropertyValidator.getInstance().assertOneOrLess(Property.COMMENT, observance.getProperties());
    18.8                  PropertyValidator.getInstance().assertOneOrLess(Property.TZNAME, observance.getProperties());
    18.9              }
   18.10          }
    19.1 --- a/src/net/fortuna/ical4j/model/component/VToDo.java	Tue Feb 10 19:25:00 2015 +0100
    19.2 +++ b/src/net/fortuna/ical4j/model/component/VToDo.java	Tue Feb 10 19:38:00 2015 +0100
    19.3 @@ -423,7 +423,6 @@
    19.4              
    19.5              PropertyValidator.getInstance().assertOneOrLess(Property.CATEGORIES, getProperties());
    19.6              PropertyValidator.getInstance().assertOneOrLess(Property.CLASS, getProperties());
    19.7 -            PropertyValidator.getInstance().assertOneOrLess(Property.COMMENT, getProperties());
    19.8              PropertyValidator.getInstance().assertOneOrLess(Property.CREATED, getProperties());
    19.9              PropertyValidator.getInstance().assertOneOrLess(Property.DESCRIPTION, getProperties());
   19.10              PropertyValidator.getInstance().assertOneOrLess(Property.DTSTART, getProperties());
   19.11 @@ -517,7 +516,6 @@
   19.12              
   19.13              PropertyValidator.getInstance().assertOneOrLess(Property.CATEGORIES, getProperties());
   19.14              PropertyValidator.getInstance().assertOneOrLess(Property.CLASS, getProperties());
   19.15 -            PropertyValidator.getInstance().assertOneOrLess(Property.COMMENT, getProperties());
   19.16              PropertyValidator.getInstance().assertOneOrLess(Property.CREATED, getProperties());
   19.17              PropertyValidator.getInstance().assertOneOrLess(Property.DESCRIPTION, getProperties());
   19.18              PropertyValidator.getInstance().assertOneOrLess(Property.DTSTART, getProperties());
   19.19 @@ -610,7 +608,6 @@
   19.20              
   19.21              PropertyValidator.getInstance().assertOneOrLess(Property.CATEGORIES, getProperties());
   19.22              PropertyValidator.getInstance().assertOneOrLess(Property.CLASS, getProperties());
   19.23 -            PropertyValidator.getInstance().assertOneOrLess(Property.COMMENT, getProperties());
   19.24              PropertyValidator.getInstance().assertOneOrLess(Property.CREATED, getProperties());
   19.25              PropertyValidator.getInstance().assertOneOrLess(Property.DESCRIPTION, getProperties());
   19.26              PropertyValidator.getInstance().assertOneOrLess(Property.DTSTART, getProperties());
   19.27 @@ -700,7 +697,6 @@
   19.28              
   19.29              PropertyValidator.getInstance().assertOneOrLess(Property.CATEGORIES, getProperties());
   19.30              PropertyValidator.getInstance().assertOneOrLess(Property.CLASS, getProperties());
   19.31 -            PropertyValidator.getInstance().assertOneOrLess(Property.COMMENT, getProperties());
   19.32              PropertyValidator.getInstance().assertOneOrLess(Property.CREATED, getProperties());
   19.33              PropertyValidator.getInstance().assertOneOrLess(Property.DESCRIPTION, getProperties());
   19.34              PropertyValidator.getInstance().assertOneOrLess(Property.DTSTART, getProperties());
   19.35 @@ -797,7 +793,6 @@
   19.36              PropertyValidator.getInstance().assertOneOrLess(Property.SEQUENCE, getProperties());
   19.37              PropertyValidator.getInstance().assertOneOrLess(Property.CATEGORIES, getProperties());
   19.38              PropertyValidator.getInstance().assertOneOrLess(Property.CLASS, getProperties());
   19.39 -            PropertyValidator.getInstance().assertOneOrLess(Property.COMMENT, getProperties());
   19.40              PropertyValidator.getInstance().assertOneOrLess(Property.CREATED, getProperties());
   19.41              PropertyValidator.getInstance().assertOneOrLess(Property.DESCRIPTION, getProperties());
   19.42              PropertyValidator.getInstance().assertOneOrLess(Property.DUE, getProperties());
   19.43 @@ -886,7 +881,6 @@
   19.44              PropertyValidator.getInstance().assertNone(Property.ATTACH, getProperties());
   19.45              PropertyValidator.getInstance().assertNone(Property.CATEGORIES, getProperties());
   19.46              PropertyValidator.getInstance().assertNone(Property.CLASS, getProperties());
   19.47 -            PropertyValidator.getInstance().assertNone(Property.COMMENT, getProperties());
   19.48              PropertyValidator.getInstance().assertNone(Property.CONTACT, getProperties());
   19.49              PropertyValidator.getInstance().assertNone(Property.CREATED, getProperties());
   19.50              PropertyValidator.getInstance().assertNone(Property.DESCRIPTION, getProperties());
   19.51 @@ -981,7 +975,6 @@
   19.52  
   19.53              PropertyValidator.getInstance().assertOneOrLess(Property.CATEGORIES, getProperties());
   19.54              PropertyValidator.getInstance().assertOneOrLess(Property.CLASS, getProperties());
   19.55 -            PropertyValidator.getInstance().assertOneOrLess(Property.COMMENT, getProperties());
   19.56              PropertyValidator.getInstance().assertOneOrLess(Property.CREATED, getProperties());
   19.57              PropertyValidator.getInstance().assertOneOrLess(Property.DESCRIPTION, getProperties());
   19.58              PropertyValidator.getInstance().assertOneOrLess(Property.DTSTART, getProperties());
   19.59 @@ -1079,7 +1072,6 @@
   19.60              PropertyValidator.getInstance().assertOneOrLess(Property.SEQUENCE, getProperties());
   19.61              PropertyValidator.getInstance().assertOneOrLess(Property.CATEGORIES, getProperties());
   19.62              PropertyValidator.getInstance().assertOneOrLess(Property.CLASS, getProperties());
   19.63 -            PropertyValidator.getInstance().assertOneOrLess(Property.COMMENT, getProperties());
   19.64              PropertyValidator.getInstance().assertOneOrLess(Property.CREATED, getProperties());
   19.65              PropertyValidator.getInstance().assertOneOrLess(Property.DESCRIPTION, getProperties());
   19.66              PropertyValidator.getInstance().assertOneOrLess(Property.DUE, getProperties());
    20.1 --- a/src/net/fortuna/ical4j/model/property/Categories.java	Tue Feb 10 19:25:00 2015 +0100
    20.2 +++ b/src/net/fortuna/ical4j/model/property/Categories.java	Tue Feb 10 19:38:00 2015 +0100
    20.3 @@ -1,176 +1,176 @@
    20.4 -/**
    20.5 - * Copyright (c) 2012, Ben Fortuna
    20.6 - * All rights reserved.
    20.7 - *
    20.8 - * Redistribution and use in source and binary forms, with or without
    20.9 - * modification, are permitted provided that the following conditions
   20.10 - * are met:
   20.11 - *
   20.12 - *  o Redistributions of source code must retain the above copyright
   20.13 - * notice, this list of conditions and the following disclaimer.
   20.14 - *
   20.15 - *  o Redistributions in binary form must reproduce the above copyright
   20.16 - * notice, this list of conditions and the following disclaimer in the
   20.17 - * documentation and/or other materials provided with the distribution.
   20.18 - *
   20.19 - *  o Neither the name of Ben Fortuna nor the names of any other contributors
   20.20 - * may be used to endorse or promote products derived from this software
   20.21 - * without specific prior written permission.
   20.22 - *
   20.23 - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
   20.24 - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
   20.25 - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
   20.26 - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
   20.27 - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
   20.28 - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
   20.29 - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
   20.30 - * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
   20.31 - * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
   20.32 - * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
   20.33 - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
   20.34 - */
   20.35 -package net.fortuna.ical4j.model.property;
   20.36 -
   20.37 -import net.fortuna.ical4j.model.TextList;
   20.38 -import net.fortuna.ical4j.model.Parameter;
   20.39 -import net.fortuna.ical4j.model.ParameterList;
   20.40 -import net.fortuna.ical4j.model.Property;
   20.41 -import net.fortuna.ical4j.model.PropertyFactoryImpl;
   20.42 -import net.fortuna.ical4j.model.ValidationException;
   20.43 -import net.fortuna.ical4j.util.ParameterValidator;
   20.44 -
   20.45 -/**
   20.46 - * $Id$
   20.47 - * 
   20.48 - * Created: [Apr 6, 2004]
   20.49 - *
   20.50 - * Defines a CATEGORIES iCalendar component property.
   20.51 - * <pre>
   20.52 - *     4.8.1.2 Categories
   20.53 - *     
   20.54 - *        Property Name: CATEGORIES
   20.55 - *     
   20.56 - *        Purpose: This property defines the categories for a calendar
   20.57 - *        component.
   20.58 - *     
   20.59 - *        Value Type: TEXT
   20.60 - *     
   20.61 - *        Property Parameters: Non-standard and language property parameters
   20.62 - *        can be specified on this property.
   20.63 - *     
   20.64 - *        Conformance: The property can be specified within "VEVENT", "VTODO"
   20.65 - *        or "VJOURNAL" calendar components.
   20.66 - *     
   20.67 - *        Description: This property is used to specify categories or subtypes
   20.68 - *        of the calendar component. The categories are useful in searching for
   20.69 - *        a calendar component of a particular type and category. Within the
   20.70 - *        "VEVENT", "VTODO" or "VJOURNAL" calendar components, more than one
   20.71 - *        category can be specified as a list of categories separated by the
   20.72 - *        COMMA character (US-ASCII decimal 44).
   20.73 - *     
   20.74 - *        Format Definition: The property is defined by the following notation:
   20.75 - *     
   20.76 - *          categories = "CATEGORIES" catparam ":" text *("," text)
   20.77 - *                       CRLF
   20.78 - *     
   20.79 - *          catparam   = *(
   20.80 - *     
   20.81 - *                     ; the following is optional,
   20.82 - *                     ; but MUST NOT occur more than once
   20.83 - *     
   20.84 - *                     (";" languageparam ) /
   20.85 - *     
   20.86 - *                     ; the following is optional,
   20.87 - *                     ; and MAY occur more than once
   20.88 - *     
   20.89 - *                     (";" xparam)
   20.90 - *     
   20.91 - *                     )
   20.92 - * </pre>
   20.93 - * @author benf
   20.94 - */
   20.95 -public class Categories extends Property {
   20.96 -
   20.97 -    private static final long serialVersionUID = -7769987073466681634L;
   20.98 -
   20.99 -    private TextList categories;
  20.100 -
  20.101 -    /**
  20.102 -     * Default constructor.
  20.103 -     */
  20.104 -    public Categories() {
  20.105 -        super(CATEGORIES, PropertyFactoryImpl.getInstance());
  20.106 -        categories = new TextList();
  20.107 -    }
  20.108 -
  20.109 -    /**
  20.110 -     * @param aValue a value string for this component
  20.111 -     */
  20.112 -    public Categories(final String aValue) {
  20.113 -        super(CATEGORIES, PropertyFactoryImpl.getInstance());
  20.114 -        setValue(aValue);
  20.115 -    }
  20.116 -
  20.117 -    /**
  20.118 -     * @param aList a list of parameters for this component
  20.119 -     * @param aValue a value string for this component
  20.120 -     */
  20.121 -    public Categories(final ParameterList aList, final String aValue) {
  20.122 -        super(CATEGORIES, aList, PropertyFactoryImpl.getInstance());
  20.123 -        setValue(aValue);
  20.124 -    }
  20.125 -
  20.126 -    /**
  20.127 -     * @param cList a list of categories
  20.128 -     */
  20.129 -    public Categories(final TextList cList) {
  20.130 -        super(CATEGORIES, PropertyFactoryImpl.getInstance());
  20.131 -        categories = cList;
  20.132 -    }
  20.133 -
  20.134 -    /**
  20.135 -     * @param aList a list of parameters for this component
  20.136 -     * @param cList a list of categories
  20.137 -     */
  20.138 -    public Categories(final ParameterList aList, final TextList cList) {
  20.139 -        super(CATEGORIES, aList, PropertyFactoryImpl.getInstance());
  20.140 -        categories = cList;
  20.141 -    }
  20.142 -
  20.143 -    /**
  20.144 -     * {@inheritDoc}
  20.145 -     */
  20.146 -    public final void setValue(final String aValue) {
  20.147 -        categories = new TextList(aValue);
  20.148 -    }
  20.149 -
  20.150 -    /**
  20.151 -     * {@inheritDoc}
  20.152 -     */
  20.153 -    public final void validate() throws ValidationException {
  20.154 -
  20.155 -        /*
  20.156 -         * ; the following is optional, ; but MUST NOT occur more than once (";" languageparam ) /
  20.157 -         */
  20.158 -        ParameterValidator.getInstance().assertOneOrLess(Parameter.LANGUAGE,
  20.159 -                getParameters());
  20.160 -
  20.161 -        /*
  20.162 -         * ; the following is optional, ; and MAY occur more than once (";" xparam)
  20.163 -         */
  20.164 -    }
  20.165 -
  20.166 -    /**
  20.167 -     * @return Returns the categories.
  20.168 -     */
  20.169 -    public final TextList getCategories() {
  20.170 -        return categories;
  20.171 -    }
  20.172 -
  20.173 -    /**
  20.174 -     * {@inheritDoc}
  20.175 -     */
  20.176 -    public final String getValue() {
  20.177 -        return getCategories().toString();
  20.178 -    }
  20.179 -}
  20.180 +/**
  20.181 + * Copyright (c) 2012, Ben Fortuna
  20.182 + * All rights reserved.
  20.183 + *
  20.184 + * Redistribution and use in source and binary forms, with or without
  20.185 + * modification, are permitted provided that the following conditions
  20.186 + * are met:
  20.187 + *
  20.188 + *  o Redistributions of source code must retain the above copyright
  20.189 + * notice, this list of conditions and the following disclaimer.
  20.190 + *
  20.191 + *  o Redistributions in binary form must reproduce the above copyright
  20.192 + * notice, this list of conditions and the following disclaimer in the
  20.193 + * documentation and/or other materials provided with the distribution.
  20.194 + *
  20.195 + *  o Neither the name of Ben Fortuna nor the names of any other contributors
  20.196 + * may be used to endorse or promote products derived from this software
  20.197 + * without specific prior written permission.
  20.198 + *
  20.199 + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
  20.200 + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
  20.201 + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
  20.202 + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
  20.203 + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
  20.204 + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
  20.205 + * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
  20.206 + * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
  20.207 + * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
  20.208 + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
  20.209 + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  20.210 + */
  20.211 +package net.fortuna.ical4j.model.property;
  20.212 +
  20.213 +import net.fortuna.ical4j.model.TextList;
  20.214 +import net.fortuna.ical4j.model.Parameter;
  20.215 +import net.fortuna.ical4j.model.ParameterList;
  20.216 +import net.fortuna.ical4j.model.Property;
  20.217 +import net.fortuna.ical4j.model.PropertyFactoryImpl;
  20.218 +import net.fortuna.ical4j.model.ValidationException;
  20.219 +import net.fortuna.ical4j.util.ParameterValidator;
  20.220 +
  20.221 +/**
  20.222 + * $Id$
  20.223 + * 
  20.224 + * Created: [Apr 6, 2004]
  20.225 + *
  20.226 + * Defines a CATEGORIES iCalendar component property.
  20.227 + * <pre>
  20.228 + *     4.8.1.2 Categories
  20.229 + *     
  20.230 + *        Property Name: CATEGORIES
  20.231 + *     
  20.232 + *        Purpose: This property defines the categories for a calendar
  20.233 + *        component.
  20.234 + *     
  20.235 + *        Value Type: TEXT
  20.236 + *     
  20.237 + *        Property Parameters: Non-standard and language property parameters
  20.238 + *        can be specified on this property.
  20.239 + *     
  20.240 + *        Conformance: The property can be specified within "VEVENT", "VTODO"
  20.241 + *        or "VJOURNAL" calendar components.
  20.242 + *     
  20.243 + *        Description: This property is used to specify categories or subtypes
  20.244 + *        of the calendar component. The categories are useful in searching for
  20.245 + *        a calendar component of a particular type and category. Within the
  20.246 + *        "VEVENT", "VTODO" or "VJOURNAL" calendar components, more than one
  20.247 + *        category can be specified as a list of categories separated by the
  20.248 + *        COMMA character (US-ASCII decimal 44).
  20.249 + *     
  20.250 + *        Format Definition: The property is defined by the following notation:
  20.251 + *     
  20.252 + *          categories = "CATEGORIES" catparam ":" text *("," text)
  20.253 + *                       CRLF
  20.254 + *     
  20.255 + *          catparam   = *(
  20.256 + *     
  20.257 + *                     ; the following is optional,
  20.258 + *                     ; but MUST NOT occur more than once
  20.259 + *     
  20.260 + *                     (";" languageparam ) /
  20.261 + *     
  20.262 + *                     ; the following is optional,
  20.263 + *                     ; and MAY occur more than once
  20.264 + *     
  20.265 + *                     (";" xparam)
  20.266 + *     
  20.267 + *                     )
  20.268 + * </pre>
  20.269 + * @author benf
  20.270 + */
  20.271 +public class Categories extends Property {
  20.272 +
  20.273 +    private static final long serialVersionUID = -7769987073466681634L;
  20.274 +
  20.275 +    private TextList categories;
  20.276 +
  20.277 +    /**
  20.278 +     * Default constructor.
  20.279 +     */
  20.280 +    public Categories() {
  20.281 +        super(CATEGORIES, PropertyFactoryImpl.getInstance());
  20.282 +        categories = new TextList();
  20.283 +    }
  20.284 +
  20.285 +    /**
  20.286 +     * @param aValue a value string for this component
  20.287 +     */
  20.288 +    public Categories(final String aValue) {
  20.289 +        super(CATEGORIES, PropertyFactoryImpl.getInstance());
  20.290 +        setValue(aValue);
  20.291 +    }
  20.292 +
  20.293 +    /**
  20.294 +     * @param aList a list of parameters for this component
  20.295 +     * @param aValue a value string for this component
  20.296 +     */
  20.297 +    public Categories(final ParameterList aList, final String aValue) {
  20.298 +        super(CATEGORIES, aList, PropertyFactoryImpl.getInstance());
  20.299 +        setValue(aValue);
  20.300 +    }
  20.301 +
  20.302 +    /**
  20.303 +     * @param cList a list of categories
  20.304 +     */
  20.305 +    public Categories(final TextList cList) {
  20.306 +        super(CATEGORIES, PropertyFactoryImpl.getInstance());
  20.307 +        categories = cList;
  20.308 +    }
  20.309 +
  20.310 +    /**
  20.311 +     * @param aList a list of parameters for this component
  20.312 +     * @param cList a list of categories
  20.313 +     */
  20.314 +    public Categories(final ParameterList aList, final TextList cList) {
  20.315 +        super(CATEGORIES, aList, PropertyFactoryImpl.getInstance());
  20.316 +        categories = cList;
  20.317 +    }
  20.318 +
  20.319 +    /**
  20.320 +     * {@inheritDoc}
  20.321 +     */
  20.322 +    public final void setValue(final String aValue) {
  20.323 +        categories = new TextList(aValue);
  20.324 +    }
  20.325 +
  20.326 +    /**
  20.327 +     * {@inheritDoc}
  20.328 +     */
  20.329 +    public final void validate() throws ValidationException {
  20.330 +
  20.331 +        /*
  20.332 +         * ; the following is optional, ; but MUST NOT occur more than once (";" languageparam ) /
  20.333 +         */
  20.334 +        ParameterValidator.getInstance().assertOneOrLess(Parameter.LANGUAGE,
  20.335 +                getParameters());
  20.336 +
  20.337 +        /*
  20.338 +         * ; the following is optional, ; and MAY occur more than once (";" xparam)
  20.339 +         */
  20.340 +    }
  20.341 +
  20.342 +    /**
  20.343 +     * @return Returns the categories.
  20.344 +     */
  20.345 +    public final TextList getCategories() {
  20.346 +        return categories;
  20.347 +    }
  20.348 +
  20.349 +    /**
  20.350 +     * {@inheritDoc}
  20.351 +     */
  20.352 +    public final String getValue() {
  20.353 +        return getCategories().toString();
  20.354 +    }
  20.355 +}
    21.1 --- a/src/net/fortuna/ical4j/model/property/RRule.java	Tue Feb 10 19:25:00 2015 +0100
    21.2 +++ b/src/net/fortuna/ical4j/model/property/RRule.java	Tue Feb 10 19:38:00 2015 +0100
    21.3 @@ -1,129 +1,129 @@
    21.4 -/**
    21.5 - * Copyright (c) 2012, Ben Fortuna
    21.6 - * All rights reserved.
    21.7 - *
    21.8 - * Redistribution and use in source and binary forms, with or without
    21.9 - * modification, are permitted provided that the following conditions
   21.10 - * are met:
   21.11 - *
   21.12 - *  o Redistributions of source code must retain the above copyright
   21.13 - * notice, this list of conditions and the following disclaimer.
   21.14 - *
   21.15 - *  o Redistributions in binary form must reproduce the above copyright
   21.16 - * notice, this list of conditions and the following disclaimer in the
   21.17 - * documentation and/or other materials provided with the distribution.
   21.18 - *
   21.19 - *  o Neither the name of Ben Fortuna nor the names of any other contributors
   21.20 - * may be used to endorse or promote products derived from this software
   21.21 - * without specific prior written permission.
   21.22 - *
   21.23 - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
   21.24 - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
   21.25 - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
   21.26 - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
   21.27 - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
   21.28 - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
   21.29 - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
   21.30 - * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
   21.31 - * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
   21.32 - * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
   21.33 - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
   21.34 - */
   21.35 -package net.fortuna.ical4j.model.property;
   21.36 -
   21.37 -import java.text.ParseException;
   21.38 -
   21.39 -import net.fortuna.ical4j.model.ParameterList;
   21.40 -import net.fortuna.ical4j.model.Property;
   21.41 -import net.fortuna.ical4j.model.PropertyFactoryImpl;
   21.42 -import net.fortuna.ical4j.model.Recur;
   21.43 -import net.fortuna.ical4j.model.ValidationException;
   21.44 -
   21.45 -/**
   21.46 - * $Id$
   21.47 - * 
   21.48 - * Created: [Apr 6, 2004]
   21.49 - *
   21.50 - * Defines an RRULE iCalendar component property.
   21.51 - * @author benf
   21.52 - */
   21.53 -public class RRule extends Property {
   21.54 -
   21.55 -    private static final long serialVersionUID = -9188265089143001164L;
   21.56 -
   21.57 -    private Recur recur;
   21.58 -
   21.59 -    /**
   21.60 -     * Default constructor.
   21.61 -     */
   21.62 -    public RRule() {
   21.63 -        super(RRULE, PropertyFactoryImpl.getInstance());
   21.64 -        recur = new Recur(Recur.DAILY, 1);
   21.65 -    }
   21.66 -
   21.67 -    /**
   21.68 -     * @param value a rule string
   21.69 -     * @throws ParseException where the specified string is not a valid rule
   21.70 -     */
   21.71 -    public RRule(String value) throws ParseException {
   21.72 -        super(RRULE, PropertyFactoryImpl.getInstance());
   21.73 -        setValue(value);
   21.74 -    }
   21.75 -    
   21.76 -    /**
   21.77 -     * @param aList a list of parameters for this component
   21.78 -     * @param aValue a value string for this component
   21.79 -     * @throws ParseException thrown when the specified string is not a valid representaton of a recurrence
   21.80 -     * @see Recur#Recur(String)
   21.81 -     */
   21.82 -    public RRule(final ParameterList aList, final String aValue)
   21.83 -            throws ParseException {
   21.84 -        super(RRULE, aList, PropertyFactoryImpl.getInstance());
   21.85 -        setValue(aValue);
   21.86 -    }
   21.87 -
   21.88 -    /**
   21.89 -     * @param aRecur a recurrence value
   21.90 -     */
   21.91 -    public RRule(final Recur aRecur) {
   21.92 -        super(RRULE, PropertyFactoryImpl.getInstance());
   21.93 -        recur = aRecur;
   21.94 -    }
   21.95 -
   21.96 -    /**
   21.97 -     * @param aList a list of parameters for this component
   21.98 -     * @param aRecur a recurrence value
   21.99 -     */
  21.100 -    public RRule(final ParameterList aList, final Recur aRecur) {
  21.101 -        super(RRULE, aList, PropertyFactoryImpl.getInstance());
  21.102 -        recur = aRecur;
  21.103 -    }
  21.104 -
  21.105 -    /**
  21.106 -     * @return Returns the recur.
  21.107 -     */
  21.108 -    public final Recur getRecur() {
  21.109 -        return recur;
  21.110 -    }
  21.111 -
  21.112 -    /**
  21.113 -     * {@inheritDoc}
  21.114 -     */
  21.115 -    public final void setValue(final String aValue) throws ParseException {
  21.116 -        recur = new Recur(aValue);
  21.117 -    }
  21.118 -
  21.119 -    /**
  21.120 -     * {@inheritDoc}
  21.121 -     */
  21.122 -    public final String getValue() {
  21.123 -        return getRecur().toString();
  21.124 -    }
  21.125 -
  21.126 -    /**
  21.127 -     * {@inheritDoc}
  21.128 -     */
  21.129 -    public final void validate() throws ValidationException {
  21.130 -        // TODO: Auto-generated method stub
  21.131 -    }
  21.132 -}
  21.133 +/**
  21.134 + * Copyright (c) 2012, Ben Fortuna
  21.135 + * All rights reserved.
  21.136 + *
  21.137 + * Redistribution and use in source and binary forms, with or without
  21.138 + * modification, are permitted provided that the following conditions
  21.139 + * are met:
  21.140 + *
  21.141 + *  o Redistributions of source code must retain the above copyright
  21.142 + * notice, this list of conditions and the following disclaimer.
  21.143 + *
  21.144 + *  o Redistributions in binary form must reproduce the above copyright
  21.145 + * notice, this list of conditions and the following disclaimer in the
  21.146 + * documentation and/or other materials provided with the distribution.
  21.147 + *
  21.148 + *  o Neither the name of Ben Fortuna nor the names of any other contributors
  21.149 + * may be used to endorse or promote products derived from this software
  21.150 + * without specific prior written permission.
  21.151 + *
  21.152 + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
  21.153 + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
  21.154 + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
  21.155 + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
  21.156 + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
  21.157 + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
  21.158 + * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
  21.159 + * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
  21.160 + * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
  21.161 + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
  21.162 + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  21.163 + */
  21.164 +package net.fortuna.ical4j.model.property;
  21.165 +
  21.166 +import java.text.ParseException;
  21.167 +
  21.168 +import net.fortuna.ical4j.model.ParameterList;
  21.169 +import net.fortuna.ical4j.model.Property;
  21.170 +import net.fortuna.ical4j.model.PropertyFactoryImpl;
  21.171 +import net.fortuna.ical4j.model.Recur;
  21.172 +import net.fortuna.ical4j.model.ValidationException;
  21.173 +
  21.174 +/**
  21.175 + * $Id$
  21.176 + * 
  21.177 + * Created: [Apr 6, 2004]
  21.178 + *
  21.179 + * Defines an RRULE iCalendar component property.
  21.180 + * @author benf
  21.181 + */
  21.182 +public class RRule extends Property {
  21.183 +
  21.184 +    private static final long serialVersionUID = -9188265089143001164L;
  21.185 +
  21.186 +    private Recur recur;
  21.187 +
  21.188 +    /**
  21.189 +     * Default constructor.
  21.190 +     */
  21.191 +    public RRule() {
  21.192 +        super(RRULE, PropertyFactoryImpl.getInstance());
  21.193 +        recur = new Recur(Recur.DAILY, 1);
  21.194 +    }
  21.195 +
  21.196 +    /**
  21.197 +     * @param value a rule string
  21.198 +     * @throws ParseException where the specified string is not a valid rule
  21.199 +     */
  21.200 +    public RRule(String value) throws ParseException {
  21.201 +        super(RRULE, PropertyFactoryImpl.getInstance());
  21.202 +        setValue(value);
  21.203 +    }
  21.204 +    
  21.205 +    /**
  21.206 +     * @param aList a list of parameters for this component
  21.207 +     * @param aValue a value string for this component
  21.208 +     * @throws ParseException thrown when the specified string is not a valid representaton of a recurrence
  21.209 +     * @see Recur#Recur(String)
  21.210 +     */
  21.211 +    public RRule(final ParameterList aList, final String aValue)
  21.212 +            throws ParseException {
  21.213 +        super(RRULE, aList, PropertyFactoryImpl.getInstance());
  21.214 +        setValue(aValue);
  21.215 +    }
  21.216 +
  21.217 +    /**
  21.218 +     * @param aRecur a recurrence value
  21.219 +     */
  21.220 +    public RRule(final Recur aRecur) {
  21.221 +        super(RRULE, PropertyFactoryImpl.getInstance());
  21.222 +        recur = aRecur;
  21.223 +    }
  21.224 +
  21.225 +    /**
  21.226 +     * @param aList a list of parameters for this component
  21.227 +     * @param aRecur a recurrence value
  21.228 +     */
  21.229 +    public RRule(final ParameterList aList, final Recur aRecur) {
  21.230 +        super(RRULE, aList, PropertyFactoryImpl.getInstance());
  21.231 +        recur = aRecur;
  21.232 +    }
  21.233 +
  21.234 +    /**
  21.235 +     * @return Returns the recur.
  21.236 +     */
  21.237 +    public final Recur getRecur() {
  21.238 +        return recur;
  21.239 +    }
  21.240 +
  21.241 +    /**
  21.242 +     * {@inheritDoc}
  21.243 +     */
  21.244 +    public final void setValue(final String aValue) throws ParseException {
  21.245 +        recur = new Recur(aValue);
  21.246 +    }
  21.247 +
  21.248 +    /**
  21.249 +     * {@inheritDoc}
  21.250 +     */
  21.251 +    public final String getValue() {
  21.252 +        return getRecur().toString();
  21.253 +    }
  21.254 +
  21.255 +    /**
  21.256 +     * {@inheritDoc}
  21.257 +     */
  21.258 +    public final void validate() throws ValidationException {
  21.259 +        // TODO: Auto-generated method stub
  21.260 +    }
  21.261 +}
    22.1 --- a/src/net/fortuna/ical4j/model/property/TzOffsetTo.java	Tue Feb 10 19:25:00 2015 +0100
    22.2 +++ b/src/net/fortuna/ical4j/model/property/TzOffsetTo.java	Tue Feb 10 19:38:00 2015 +0100
    22.3 @@ -1,132 +1,132 @@
    22.4 -/**
    22.5 - * Copyright (c) 2012, Ben Fortuna
    22.6 - * All rights reserved.
    22.7 - *
    22.8 - * Redistribution and use in source and binary forms, with or without
    22.9 - * modification, are permitted provided that the following conditions
   22.10 - * are met:
   22.11 - *
   22.12 - *  o Redistributions of source code must retain the above copyright
   22.13 - * notice, this list of conditions and the following disclaimer.
   22.14 - *
   22.15 - *  o Redistributions in binary form must reproduce the above copyright
   22.16 - * notice, this list of conditions and the following disclaimer in the
   22.17 - * documentation and/or other materials provided with the distribution.
   22.18 - *
   22.19 - *  o Neither the name of Ben Fortuna nor the names of any other contributors
   22.20 - * may be used to endorse or promote products derived from this software
   22.21 - * without specific prior written permission.
   22.22 - *
   22.23 - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
   22.24 - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
   22.25 - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
   22.26 - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
   22.27 - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
   22.28 - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
   22.29 - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
   22.30 - * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
   22.31 - * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
   22.32 - * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
   22.33 - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
   22.34 - */
   22.35 -package net.fortuna.ical4j.model.property;
   22.36 -
   22.37 -import net.fortuna.ical4j.model.ParameterList;
   22.38 -import net.fortuna.ical4j.model.Property;
   22.39 -import net.fortuna.ical4j.model.PropertyFactoryImpl;
   22.40 -import net.fortuna.ical4j.model.UtcOffset;
   22.41 -import net.fortuna.ical4j.model.ValidationException;
   22.42 -
   22.43 -/**
   22.44 - * $Id$
   22.45 - * 
   22.46 - * Created: [Apr 6, 2004]
   22.47 - *
   22.48 - * Defines a TZOFFSETTO iCalendar component property.
   22.49 - * @author benf
   22.50 - */
   22.51 -public class TzOffsetTo extends Property {
   22.52 -
   22.53 -    private static final long serialVersionUID = 8213874575051177732L;
   22.54 -
   22.55 -    private UtcOffset offset;
   22.56 -
   22.57 -    /**
   22.58 -     * Default constructor.
   22.59 -     */
   22.60 -    public TzOffsetTo() {
   22.61 -        super(TZOFFSETTO, PropertyFactoryImpl.getInstance());
   22.62 -    }
   22.63 -
   22.64 -    /**
   22.65 -     * @param value an offset value
   22.66 -     */
   22.67 -    public TzOffsetTo(String value) {
   22.68 -        super(TZOFFSETTO, PropertyFactoryImpl.getInstance());
   22.69 -        setValue(value);
   22.70 -    }
   22.71 -    
   22.72 -    /**
   22.73 -     * @param aList a list of parameters for this component
   22.74 -     * @param aValue a value string for this component
   22.75 -     */
   22.76 -    public TzOffsetTo(final ParameterList aList, final String aValue) {
   22.77 -        super(TZOFFSETTO, aList, PropertyFactoryImpl.getInstance());
   22.78 -        setValue(aValue);
   22.79 -    }
   22.80 -
   22.81 -    /**
   22.82 -     * @param anOffset a timezone offset in milliseconds
   22.83 -     */
   22.84 -    public TzOffsetTo(final UtcOffset anOffset) {
   22.85 -        super(TZOFFSETTO, PropertyFactoryImpl.getInstance());
   22.86 -        offset = anOffset;
   22.87 -    }
   22.88 -
   22.89 -    /**
   22.90 -     * @param aList a list of parameters for this component
   22.91 -     * @param anOffset a timezone offset in milliseconds
   22.92 -     */
   22.93 -    public TzOffsetTo(final ParameterList aList, final UtcOffset anOffset) {
   22.94 -        super(TZOFFSETTO, aList, PropertyFactoryImpl.getInstance());
   22.95 -        offset = anOffset;
   22.96 -    }
   22.97 -
   22.98 -    /**
   22.99 -     * @return Returns the offset.
  22.100 -     */
  22.101 -    public final UtcOffset getOffset() {
  22.102 -        return offset;
  22.103 -    }
  22.104 -
  22.105 -    /**
  22.106 -     * {@inheritDoc}
  22.107 -     */
  22.108 -    public final void setValue(final String aValue) {
  22.109 -        offset = new UtcOffset(aValue);
  22.110 -    }
  22.111 -
  22.112 -    /**
  22.113 -     * {@inheritDoc}
  22.114 -     */
  22.115 -    public final String getValue() {
  22.116 -        if (offset != null) {
  22.117 -            return offset.toString();
  22.118 -        }
  22.119 -        return "";
  22.120 -    }
  22.121 -
  22.122 -    /**
  22.123 -     * @param offset The offset to set.
  22.124 -     */
  22.125 -    public final void setOffset(final UtcOffset offset) {
  22.126 -        this.offset = offset;
  22.127 -    }
  22.128 -
  22.129 -    /**
  22.130 -     * {@inheritDoc}
  22.131 -     */
  22.132 -    public final void validate() throws ValidationException {
  22.133 -        // TODO: Auto-generated method stub
  22.134 -    }
  22.135 -}
  22.136 +/**
  22.137 + * Copyright (c) 2012, Ben Fortuna
  22.138 + * All rights reserved.
  22.139 + *
  22.140 + * Redistribution and use in source and binary forms, with or without
  22.141 + * modification, are permitted provided that the following conditions
  22.142 + * are met:
  22.143 + *
  22.144 + *  o Redistributions of source code must retain the above copyright
  22.145 + * notice, this list of conditions and the following disclaimer.
  22.146 + *
  22.147 + *  o Redistributions in binary form must reproduce the above copyright
  22.148 + * notice, this list of conditions and the following disclaimer in the
  22.149 + * documentation and/or other materials provided with the distribution.
  22.150 + *
  22.151 + *  o Neither the name of Ben Fortuna nor the names of any other contributors
  22.152 + * may be used to endorse or promote products derived from this software
  22.153 + * without specific prior written permission.
  22.154 + *
  22.155 + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
  22.156 + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
  22.157 + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
  22.158 + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
  22.159 + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
  22.160 + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
  22.161 + * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
  22.162 + * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
  22.163 + * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
  22.164 + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
  22.165 + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  22.166 + */
  22.167 +package net.fortuna.ical4j.model.property;
  22.168 +
  22.169 +import net.fortuna.ical4j.model.ParameterList;
  22.170 +import net.fortuna.ical4j.model.Property;
  22.171 +import net.fortuna.ical4j.model.PropertyFactoryImpl;
  22.172 +import net.fortuna.ical4j.model.UtcOffset;
  22.173 +import net.fortuna.ical4j.model.ValidationException;
  22.174 +
  22.175 +/**
  22.176 + * $Id$
  22.177 + * 
  22.178 + * Created: [Apr 6, 2004]
  22.179 + *
  22.180 + * Defines a TZOFFSETTO iCalendar component property.
  22.181 + * @author benf
  22.182 + */
  22.183 +public class TzOffsetTo extends Property {
  22.184 +
  22.185 +    private static final long serialVersionUID = 8213874575051177732L;
  22.186 +
  22.187 +    private UtcOffset offset;
  22.188 +
  22.189 +    /**
  22.190 +     * Default constructor.
  22.191 +     */
  22.192 +    public TzOffsetTo() {
  22.193 +        super(TZOFFSETTO, PropertyFactoryImpl.getInstance());
  22.194 +    }
  22.195 +
  22.196 +    /**
  22.197 +     * @param value an offset value
  22.198 +     */
  22.199 +    public TzOffsetTo(String value) {
  22.200 +        super(TZOFFSETTO, PropertyFactoryImpl.getInstance());
  22.201 +        setValue(value);
  22.202 +    }
  22.203 +    
  22.204 +    /**
  22.205 +     * @param aList a list of parameters for this component
  22.206 +     * @param aValue a value string for this component
  22.207 +     */
  22.208 +    public TzOffsetTo(final ParameterList aList, final String aValue) {
  22.209 +        super(TZOFFSETTO, aList, PropertyFactoryImpl.getInstance());
  22.210 +        setValue(aValue);
  22.211 +    }
  22.212 +
  22.213 +    /**
  22.214 +     * @param anOffset a timezone offset in milliseconds
  22.215 +     */
  22.216 +    public TzOffsetTo(final UtcOffset anOffset) {
  22.217 +        super(TZOFFSETTO, PropertyFactoryImpl.getInstance());
  22.218 +        offset = anOffset;
  22.219 +    }
  22.220 +
  22.221 +    /**
  22.222 +     * @param aList a list of parameters for this component
  22.223 +     * @param anOffset a timezone offset in milliseconds
  22.224 +     */
  22.225 +    public TzOffsetTo(final ParameterList aList, final UtcOffset anOffset) {
  22.226 +        super(TZOFFSETTO, aList, PropertyFactoryImpl.getInstance());
  22.227 +        offset = anOffset;
  22.228 +    }
  22.229 +
  22.230 +    /**
  22.231 +     * @return Returns the offset.
  22.232 +     */
  22.233 +    public final UtcOffset getOffset() {
  22.234 +        return offset;
  22.235 +    }
  22.236 +
  22.237 +    /**
  22.238 +     * {@inheritDoc}
  22.239 +     */
  22.240 +    public final void setValue(final String aValue) {
  22.241 +        offset = new UtcOffset(aValue);
  22.242 +    }
  22.243 +
  22.244 +    /**
  22.245 +     * {@inheritDoc}
  22.246 +     */
  22.247 +    public final String getValue() {
  22.248 +        if (offset != null) {
  22.249 +            return offset.toString();
  22.250 +        }
  22.251 +        return "";
  22.252 +    }
  22.253 +
  22.254 +    /**
  22.255 +     * @param offset The offset to set.
  22.256 +     */
  22.257 +    public final void setOffset(final UtcOffset offset) {
  22.258 +        this.offset = offset;
  22.259 +    }
  22.260 +
  22.261 +    /**
  22.262 +     * {@inheritDoc}
  22.263 +     */
  22.264 +    public final void validate() throws ValidationException {
  22.265 +        // TODO: Auto-generated method stub
  22.266 +    }
  22.267 +}
    23.1 --- a/src/net/fortuna/ical4j/model/tz.alias	Tue Feb 10 19:25:00 2015 +0100
    23.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    23.3 @@ -1,131 +0,0 @@
    23.4 -## Unsupported timezone identifiers..
    23.5 -Etc/GMT+0=Etc/GMT
    23.6 -Etc/GMT-0=Etc/GMT
    23.7 -Etc/GMT0=Etc/GMT
    23.8 -GMT=Etc/GMT
    23.9 -
   23.10 -### Temporary hack to support above timezones..
   23.11 -Etc/GMT=Europe/London
   23.12 -Etc/Greenwich=Etc/GMT
   23.13 -Etc/UCT=Europe/London
   23.14 -Etc/UTC=Europe/London
   23.15 -Etc/Universal=Etc/UTC
   23.16 -
   23.17 -Etc/Zulu=Etc/UTC
   23.18 -
   23.19 -## Non-Oslon aliases:
   23.20 -#
   23.21 -US/Pacific-New=America/Los_Angeles
   23.22 -
   23.23 -## Update Olson backward compatibility here:
   23.24 -#
   23.25 -Africa/Asmera = Africa/Asmara
   23.26 -Africa/Timbuktu = Africa/Bamako
   23.27 -America/Argentina/ComodRivadavia = America/Argentina/Catamarca
   23.28 -America/Atka = America/Adak
   23.29 -America/Buenos_Aires = America/Argentina/Buenos_Aires
   23.30 -America/Catamarca = America/Argentina/Catamarca
   23.31 -America/Coral_Harbour = America/Atikokan
   23.32 -America/Cordoba = America/Argentina/Cordoba
   23.33 -America/Ensenada = America/Tijuana
   23.34 -America/Fort_Wayne = America/Indiana/Indianapolis
   23.35 -America/Indianapolis = America/Indiana/Indianapolis
   23.36 -America/Jujuy = America/Argentina/Jujuy
   23.37 -America/Knox_IN = America/Indiana/Knox
   23.38 -America/Louisville = America/Kentucky/Louisville
   23.39 -America/Mendoza = America/Argentina/Mendoza
   23.40 -America/Porto_Acre = America/Rio_Branco
   23.41 -America/Rosario = America/Argentina/Cordoba
   23.42 -America/Virgin = America/St_Thomas
   23.43 -Asia/Ashkhabad = Asia/Ashgabat
   23.44 -Asia/Chungking = Asia/Chongqing
   23.45 -Asia/Dacca = Asia/Dhaka
   23.46 -Asia/Katmandu = Asia/Kathmandu
   23.47 -Asia/Calcutta = Asia/Kolkata
   23.48 -Asia/Macao = Asia/Macau
   23.49 -Asia/Tel_Aviv = Asia/Jerusalem
   23.50 -Asia/Saigon = Asia/Ho_Chi_Minh
   23.51 -Asia/Thimbu = Asia/Thimphu
   23.52 -Asia/Ujung_Pandang = Asia/Makassar
   23.53 -Asia/Ulan_Bator = Asia/Ulaanbaatar
   23.54 -Atlantic/Faeroe = Atlantic/Faroe
   23.55 -Atlantic/Jan_Mayen = Europe/Oslo
   23.56 -Australia/ACT = Australia/Sydney
   23.57 -Australia/Canberra = Australia/Sydney
   23.58 -Australia/LHI = Australia/Lord_Howe
   23.59 -Australia/NSW = Australia/Sydney
   23.60 -Australia/North = Australia/Darwin
   23.61 -Australia/Queensland = Australia/Brisbane
   23.62 -Australia/South = Australia/Adelaide
   23.63 -Australia/Tasmania = Australia/Hobart
   23.64 -Australia/Victoria = Australia/Melbourne
   23.65 -Australia/West = Australia/Perth
   23.66 -Australia/Yancowinna = Australia/Broken_Hill
   23.67 -Brazil/Acre = America/Rio_Branco
   23.68 -Brazil/DeNoronha = America/Noronha
   23.69 -Brazil/East = America/Sao_Paulo
   23.70 -Brazil/West = America/Manaus
   23.71 -Canada/Atlantic = America/Halifax
   23.72 -Canada/Central = America/Winnipeg
   23.73 -Canada/East-Saskatchewan = America/Regina
   23.74 -Canada/Eastern = America/Toronto
   23.75 -Canada/Mountain = America/Edmonton
   23.76 -Canada/Newfoundland = America/St_Johns
   23.77 -Canada/Pacific = America/Vancouver
   23.78 -Canada/Saskatchewan = America/Regina
   23.79 -Canada/Yukon = America/Whitehorse
   23.80 -Chile/Continental = America/Santiago
   23.81 -Chile/EasterIsland = Pacific/Easter
   23.82 -Cuba = America/Havana
   23.83 -Egypt = Africa/Cairo
   23.84 -Eire = Europe/Dublin
   23.85 -Europe/Belfast = Europe/London
   23.86 -Europe/Tiraspol = Europe/Chisinau
   23.87 -GB = Europe/London
   23.88 -GB-Eire = Europe/London
   23.89 -GMT+0 = Etc/GMT
   23.90 -GMT-0 = Etc/GMT
   23.91 -GMT0 = Etc/GMT
   23.92 -Greenwich = Etc/GMT
   23.93 -Hongkong = Asia/Hong_Kong
   23.94 -Iceland = Atlantic/Reykjavik
   23.95 -Iran = Asia/Tehran
   23.96 -Israel = Asia/Jerusalem
   23.97 -Jamaica = America/Jamaica
   23.98 -Japan = Asia/Tokyo
   23.99 -Kwajalein = Pacific/Kwajalein
  23.100 -Libya = Africa/Tripoli
  23.101 -Mexico/BajaNorte = America/Tijuana
  23.102 -Mexico/BajaSur = America/Mazatlan
  23.103 -Mexico/General = America/Mexico_City
  23.104 -NZ = Pacific/Auckland
  23.105 -NZ-CHAT = Pacific/Chatham
  23.106 -Navajo = America/Denver
  23.107 -PRC = Asia/Shanghai
  23.108 -Pacific/Samoa = Pacific/Pago_Pago
  23.109 -Pacific/Yap = Pacific/Chuuk
  23.110 -Pacific/Truk = Pacific/Chuuk
  23.111 -Pacific/Ponape = Pacific/Pohnpei
  23.112 -Poland = Europe/Warsaw
  23.113 -Portugal = Europe/Lisbon
  23.114 -ROC = Asia/Taipei
  23.115 -ROK = Asia/Seoul
  23.116 -Singapore = Asia/Singapore
  23.117 -Turkey = Europe/Istanbul
  23.118 -UCT = Etc/UCT
  23.119 -US/Alaska = America/Anchorage
  23.120 -US/Aleutian = America/Adak
  23.121 -US/Arizona = America/Phoenix
  23.122 -US/Central = America/Chicago
  23.123 -US/East-Indiana = America/Indiana/Indianapolis
  23.124 -US/Eastern = America/New_York
  23.125 -US/Hawaii = Pacific/Honolulu
  23.126 -US/Indiana-Starke = America/Indiana/Knox
  23.127 -US/Michigan = America/Detroit
  23.128 -US/Mountain = America/Denver
  23.129 -US/Pacific = America/Los_Angeles
  23.130 -US/Samoa = Pacific/Pago_Pago
  23.131 -UTC = Etc/UTC
  23.132 -Universal = Etc/UTC
  23.133 -W-SU = Europe/Moscow
  23.134 -Zulu = Etc/UTC
    24.1 --- a/src/net/fortuna/ical4j/util/CompatibilityHints.java	Tue Feb 10 19:25:00 2015 +0100
    24.2 +++ b/src/net/fortuna/ical4j/util/CompatibilityHints.java	Tue Feb 10 19:38:00 2015 +0100
    24.3 @@ -76,6 +76,11 @@
    24.4       * compatibility is enabled by setting this system property to "true".
    24.5       */
    24.6      public static final String KEY_NOTES_COMPATIBILITY = "ical4j.compatibility.notes";
    24.7 +    
    24.8 +    /**
    24.9 +     * Support for vCard features that are not necessarily compatible with the iCalendar standard.
   24.10 +     */
   24.11 +    public static final String KEY_VCARD_COMPATIBILITY = "ical4j.compatibility.vcard";
   24.12  
   24.13      private static final Map HINTS = new ConcurrentHashMap();
   24.14      // preload known hints from the configurator

mercurial