From 763bcb161f2ea13d0b8f0af376fc316cc9448e42 Mon Sep 17 00:00:00 2001 From: Ben Fortuna Date: Sun, 22 Apr 2018 20:51:30 +1000 Subject: [PATCH] Automated code clean up --- .../component/AbstractComponentFactory.groovy | 6 +- .../model/component/AvailableFactory.groovy | 4 +- .../model/component/DaylightFactory.groovy | 8 +- .../model/component/StandardFactory.groovy | 4 +- .../model/component/VAlarmFactory.groovy | 4 +- .../component/VAvailabilityFactory.groovy | 8 +- .../model/component/VEventFactory.groovy | 3 +- .../model/component/VFreeBusyFactory.groovy | 8 +- .../model/component/VJournalFactory.groovy | 8 +- .../model/component/VTimeZoneFactory.groovy | 5 +- .../model/component/VToDoFactory.groovy | 13 ++-- .../model/component/VVenueFactory.groovy | 8 +- .../model/component/XComponentFactory.groovy | 2 +- .../parameter/AbstractParameterFactory.groovy | 2 +- .../property/AbstractPropertyFactory.groovy | 76 +++++++++---------- .../model/property/ActionFactory.groovy | 70 ++++++++--------- .../model/property/BusyTypeFactory.groovy | 70 ++++++++--------- .../model/property/CalScaleFactory.groovy | 69 +++++++++-------- .../ical4j/model/property/ClazzFactory.groovy | 69 +++++++++-------- .../property/DefaultPropertyFactory.groovy | 50 ++++++------ .../model/property/DtStampFactory.groovy | 75 +++++++++--------- .../model/property/MethodFactory.groovy | 69 +++++++++-------- .../model/property/PriorityFactory.groovy | 69 +++++++++-------- .../property/RequestStatusFactory.groovy | 4 +- .../model/property/TranspFactory.groovy | 69 +++++++++-------- .../model/property/VersionFactory.groovy | 70 ++++++++--------- .../model/property/XPropertyFactory.groovy | 4 +- .../ical4j/data/CalendarParserImpl.java | 4 +- .../net/fortuna/ical4j/model/Calendar.java | 6 +- .../net/fortuna/ical4j/model/Component.java | 8 +- .../ical4j/model/IndexedPropertyList.java | 2 +- .../java/net/fortuna/ical4j/model/Period.java | 2 +- .../net/fortuna/ical4j/model/TimeZone.java | 8 +- .../ical4j/model/component/Available.java | 4 +- .../ical4j/model/component/VAvailability.java | 4 +- .../ical4j/model/component/VEvent.java | 8 +- .../ical4j/model/component/VFreeBusy.java | 10 +-- .../ical4j/model/component/VJournal.java | 2 +- .../fortuna/ical4j/model/component/VToDo.java | 2 +- .../fortuna/ical4j/model/property/Attach.java | 3 +- .../ical4j/model/property/Attendee.java | 2 +- .../fortuna/ical4j/transform/Transformer.java | 2 +- .../net/fortuna/ical4j/util/Calendars.java | 2 +- .../java/net/fortuna/ical4j/util/Dates.java | 6 +- 44 files changed, 456 insertions(+), 466 deletions(-) diff --git a/src/main/groovy/net/fortuna/ical4j/model/component/AbstractComponentFactory.groovy b/src/main/groovy/net/fortuna/ical4j/model/component/AbstractComponentFactory.groovy index 136c74299..48a874eb7 100644 --- a/src/main/groovy/net/fortuna/ical4j/model/component/AbstractComponentFactory.groovy +++ b/src/main/groovy/net/fortuna/ical4j/model/component/AbstractComponentFactory.groovy @@ -31,8 +31,8 @@ */ package net.fortuna.ical4j.model.component -import net.fortuna.ical4j.model.PropertyList import net.fortuna.ical4j.model.Property +import net.fortuna.ical4j.model.PropertyList /** * $Id$ @@ -52,8 +52,8 @@ abstract class AbstractComponentFactory extends AbstractFactory { return newInstance(properties) } - protected abstract Object newInstance(PropertyList properties); - + protected abstract Object newInstance(PropertyList properties) + void setChild(FactoryBuilderSupport build, Object parent, Object child) { if (child instanceof Property) { parent.properties.add(child) diff --git a/src/main/groovy/net/fortuna/ical4j/model/component/AvailableFactory.groovy b/src/main/groovy/net/fortuna/ical4j/model/component/AvailableFactory.groovy index 0a848331f..373698454 100644 --- a/src/main/groovy/net/fortuna/ical4j/model/component/AvailableFactory.groovy +++ b/src/main/groovy/net/fortuna/ical4j/model/component/AvailableFactory.groovy @@ -31,7 +31,7 @@ */ package net.fortuna.ical4j.model.component -import net.fortuna.ical4j.model.PropertyList; +import net.fortuna.ical4j.model.PropertyList /** * @author fortuna @@ -46,7 +46,7 @@ class AvailableFactory extends AbstractComponentFactory{ available = (Available) value } else { - available = super.newInstance(builder, name, value, attributes); + available = super.newInstance(builder, name, value, attributes) } return available } diff --git a/src/main/groovy/net/fortuna/ical4j/model/component/DaylightFactory.groovy b/src/main/groovy/net/fortuna/ical4j/model/component/DaylightFactory.groovy index e3f93a18a..5b8a103a5 100644 --- a/src/main/groovy/net/fortuna/ical4j/model/component/DaylightFactory.groovy +++ b/src/main/groovy/net/fortuna/ical4j/model/component/DaylightFactory.groovy @@ -31,22 +31,22 @@ */ package net.fortuna.ical4j.model.component -import net.fortuna.ical4j.model.PropertyList; +import net.fortuna.ical4j.model.PropertyList /** * @author fortuna * */ -public class DaylightFactory extends AbstractComponentFactory{ +class DaylightFactory extends AbstractComponentFactory{ - public Object newInstance(FactoryBuilderSupport builder, Object name, Object value, Map attributes) throws InstantiationException, IllegalAccessException { + Object newInstance(FactoryBuilderSupport builder, Object name, Object value, Map attributes) throws InstantiationException, IllegalAccessException { Daylight daylight if (FactoryBuilderSupport.checkValueIsType(value, name, Daylight.class)) { daylight = (Daylight) value } else { - daylight = super.newInstance(builder, name, value, attributes); + daylight = super.newInstance(builder, name, value, attributes) } return daylight } diff --git a/src/main/groovy/net/fortuna/ical4j/model/component/StandardFactory.groovy b/src/main/groovy/net/fortuna/ical4j/model/component/StandardFactory.groovy index d075aedd5..d867fc7fd 100644 --- a/src/main/groovy/net/fortuna/ical4j/model/component/StandardFactory.groovy +++ b/src/main/groovy/net/fortuna/ical4j/model/component/StandardFactory.groovy @@ -31,7 +31,7 @@ */ package net.fortuna.ical4j.model.component -import net.fortuna.ical4j.model.PropertyList; +import net.fortuna.ical4j.model.PropertyList /** * @author fortuna @@ -46,7 +46,7 @@ class StandardFactory extends AbstractComponentFactory{ standard = (Standard) value } else { - standard = super.newInstance(builder, name, value, attributes); + standard = super.newInstance(builder, name, value, attributes) } return standard } diff --git a/src/main/groovy/net/fortuna/ical4j/model/component/VAlarmFactory.groovy b/src/main/groovy/net/fortuna/ical4j/model/component/VAlarmFactory.groovy index c4c1b7df7..96bba1ae1 100644 --- a/src/main/groovy/net/fortuna/ical4j/model/component/VAlarmFactory.groovy +++ b/src/main/groovy/net/fortuna/ical4j/model/component/VAlarmFactory.groovy @@ -31,7 +31,7 @@ */ package net.fortuna.ical4j.model.component -import net.fortuna.ical4j.model.PropertyList; +import net.fortuna.ical4j.model.PropertyList /** * @author fortuna @@ -46,7 +46,7 @@ class VAlarmFactory extends AbstractComponentFactory{ alarm = (VAlarm) value } else { - alarm = super.newInstance(builder, name, value, attributes); + alarm = super.newInstance(builder, name, value, attributes) } return alarm } diff --git a/src/main/groovy/net/fortuna/ical4j/model/component/VAvailabilityFactory.groovy b/src/main/groovy/net/fortuna/ical4j/model/component/VAvailabilityFactory.groovy index 1185e59e8..5302b3826 100644 --- a/src/main/groovy/net/fortuna/ical4j/model/component/VAvailabilityFactory.groovy +++ b/src/main/groovy/net/fortuna/ical4j/model/component/VAvailabilityFactory.groovy @@ -31,22 +31,22 @@ */ package net.fortuna.ical4j.model.component -import net.fortuna.ical4j.model.PropertyList; +import net.fortuna.ical4j.model.PropertyList /** * @author fortuna * */ -public class VAvailabilityFactory extends AbstractComponentFactory{ +class VAvailabilityFactory extends AbstractComponentFactory{ - public Object newInstance(FactoryBuilderSupport builder, Object name, Object value, Map attributes) throws InstantiationException, IllegalAccessException { + Object newInstance(FactoryBuilderSupport builder, Object name, Object value, Map attributes) throws InstantiationException, IllegalAccessException { VAvailability availability if (FactoryBuilderSupport.checkValueIsType(value, name, VAvailability.class)) { availability = (VAvailability) value } else { - availability = super.newInstance(builder, name, value, attributes); + availability = super.newInstance(builder, name, value, attributes) } return availability } diff --git a/src/main/groovy/net/fortuna/ical4j/model/component/VEventFactory.groovy b/src/main/groovy/net/fortuna/ical4j/model/component/VEventFactory.groovy index b4ab7d2de..be5a54bd3 100644 --- a/src/main/groovy/net/fortuna/ical4j/model/component/VEventFactory.groovy +++ b/src/main/groovy/net/fortuna/ical4j/model/component/VEventFactory.groovy @@ -31,7 +31,6 @@ */ package net.fortuna.ical4j.model.component -import groovy.util.FactoryBuilderSupport import net.fortuna.ical4j.model.PropertyList /** @@ -47,7 +46,7 @@ class VEventFactory extends AbstractComponentFactory{ event = (VEvent) value } else { - event = super.newInstance(builder, name, value, attributes); + event = super.newInstance(builder, name, value, attributes) } return event } diff --git a/src/main/groovy/net/fortuna/ical4j/model/component/VFreeBusyFactory.groovy b/src/main/groovy/net/fortuna/ical4j/model/component/VFreeBusyFactory.groovy index e45819bbc..93ab6af8e 100644 --- a/src/main/groovy/net/fortuna/ical4j/model/component/VFreeBusyFactory.groovy +++ b/src/main/groovy/net/fortuna/ical4j/model/component/VFreeBusyFactory.groovy @@ -31,22 +31,22 @@ */ package net.fortuna.ical4j.model.component -import net.fortuna.ical4j.model.PropertyList; +import net.fortuna.ical4j.model.PropertyList /** * @author fortuna * */ -public class VFreeBusyFactory extends AbstractComponentFactory{ +class VFreeBusyFactory extends AbstractComponentFactory{ - public Object newInstance(FactoryBuilderSupport builder, Object name, Object value, Map attributes) throws InstantiationException, IllegalAccessException { + Object newInstance(FactoryBuilderSupport builder, Object name, Object value, Map attributes) throws InstantiationException, IllegalAccessException { VFreeBusy freeBusy if (FactoryBuilderSupport.checkValueIsType(value, name, VFreeBusy.class)) { freeBusy = (VFreeBusy) value } else { - freeBusy = super.newInstance(builder, name, value, attributes); + freeBusy = super.newInstance(builder, name, value, attributes) } return freeBusy } diff --git a/src/main/groovy/net/fortuna/ical4j/model/component/VJournalFactory.groovy b/src/main/groovy/net/fortuna/ical4j/model/component/VJournalFactory.groovy index b7eabecea..d7557d936 100644 --- a/src/main/groovy/net/fortuna/ical4j/model/component/VJournalFactory.groovy +++ b/src/main/groovy/net/fortuna/ical4j/model/component/VJournalFactory.groovy @@ -31,22 +31,22 @@ */ package net.fortuna.ical4j.model.component -import net.fortuna.ical4j.model.PropertyList; +import net.fortuna.ical4j.model.PropertyList /** * @author fortuna * */ -public class VJournalFactory extends AbstractComponentFactory{ +class VJournalFactory extends AbstractComponentFactory{ - public Object newInstance(FactoryBuilderSupport builder, Object name, Object value, Map attributes) throws InstantiationException, IllegalAccessException { + Object newInstance(FactoryBuilderSupport builder, Object name, Object value, Map attributes) throws InstantiationException, IllegalAccessException { VJournal journal if (FactoryBuilderSupport.checkValueIsType(value, name, VJournal.class)) { journal = (VJournal) value } else { - journal = super.newInstance(builder, name, value, attributes); + journal = super.newInstance(builder, name, value, attributes) } return journal } diff --git a/src/main/groovy/net/fortuna/ical4j/model/component/VTimeZoneFactory.groovy b/src/main/groovy/net/fortuna/ical4j/model/component/VTimeZoneFactory.groovy index 071910422..725fd1d59 100644 --- a/src/main/groovy/net/fortuna/ical4j/model/component/VTimeZoneFactory.groovy +++ b/src/main/groovy/net/fortuna/ical4j/model/component/VTimeZoneFactory.groovy @@ -31,8 +31,7 @@ */ package net.fortuna.ical4j.model.component -import groovy.util.FactoryBuilderSupport; -import net.fortuna.ical4j.model.PropertyList; +import net.fortuna.ical4j.model.PropertyList /** * @author fortuna @@ -47,7 +46,7 @@ class VTimeZoneFactory extends AbstractComponentFactory{ timeZone = (VTimeZone) value } else { - timeZone = super.newInstance(builder, name, value, attributes); + timeZone = super.newInstance(builder, name, value, attributes) } return timeZone } diff --git a/src/main/groovy/net/fortuna/ical4j/model/component/VToDoFactory.groovy b/src/main/groovy/net/fortuna/ical4j/model/component/VToDoFactory.groovy index 658b0af42..cca679343 100644 --- a/src/main/groovy/net/fortuna/ical4j/model/component/VToDoFactory.groovy +++ b/src/main/groovy/net/fortuna/ical4j/model/component/VToDoFactory.groovy @@ -31,23 +31,22 @@ */ package net.fortuna.ical4j.model.component -import groovy.util.FactoryBuilderSupport; -import net.fortuna.ical4j.model.PropertyList; +import net.fortuna.ical4j.model.PropertyList /** * @author fortuna * */ -public class VToDoFactory extends AbstractComponentFactory{ +class VToDoFactory extends AbstractComponentFactory{ - public Object newInstance(FactoryBuilderSupport builder, Object name, Object value, Map attributes) throws InstantiationException, IllegalAccessException { + Object newInstance(FactoryBuilderSupport builder, Object name, Object value, Map attributes) throws InstantiationException, IllegalAccessException { VToDo toDo if (FactoryBuilderSupport.checkValueIsType(value, name, VToDo.class)) { toDo = (VToDo) value } else { - toDo = super.newInstance(builder, name, value, attributes); + toDo = super.newInstance(builder, name, value, attributes) } return toDo } @@ -55,8 +54,8 @@ public class VToDoFactory extends AbstractComponentFactory{ protected Object newInstance(PropertyList properties) { return new VToDo(properties) } - - public void setChild(FactoryBuilderSupport build, Object parent, Object child) { + + void setChild(FactoryBuilderSupport build, Object parent, Object child) { if (child instanceof VAlarm) { parent.alarms.add child } diff --git a/src/main/groovy/net/fortuna/ical4j/model/component/VVenueFactory.groovy b/src/main/groovy/net/fortuna/ical4j/model/component/VVenueFactory.groovy index 85aeffc5c..8f1b1b395 100644 --- a/src/main/groovy/net/fortuna/ical4j/model/component/VVenueFactory.groovy +++ b/src/main/groovy/net/fortuna/ical4j/model/component/VVenueFactory.groovy @@ -31,22 +31,22 @@ */ package net.fortuna.ical4j.model.component -import net.fortuna.ical4j.model.PropertyList; +import net.fortuna.ical4j.model.PropertyList /** * @author fortuna * */ -public class VVenueFactory extends AbstractComponentFactory{ +class VVenueFactory extends AbstractComponentFactory{ - public Object newInstance(FactoryBuilderSupport builder, Object name, Object value, Map attributes) throws InstantiationException, IllegalAccessException { + Object newInstance(FactoryBuilderSupport builder, Object name, Object value, Map attributes) throws InstantiationException, IllegalAccessException { VVenue venue if (FactoryBuilderSupport.checkValueIsType(value, name, VVenue.class)) { venue = (VVenue) value } else { - venue = super.newInstance(builder, name, value, attributes); + venue = super.newInstance(builder, name, value, attributes) } return venue } diff --git a/src/main/groovy/net/fortuna/ical4j/model/component/XComponentFactory.groovy b/src/main/groovy/net/fortuna/ical4j/model/component/XComponentFactory.groovy index fa2a42310..cba3e1264 100644 --- a/src/main/groovy/net/fortuna/ical4j/model/component/XComponentFactory.groovy +++ b/src/main/groovy/net/fortuna/ical4j/model/component/XComponentFactory.groovy @@ -55,7 +55,7 @@ class XComponentFactory extends AbstractFactory { if (properties == null) { properties = new PropertyList() } - component = newInstance(componentName, properties); + component = newInstance(componentName, properties) } return component } diff --git a/src/main/groovy/net/fortuna/ical4j/model/parameter/AbstractParameterFactory.groovy b/src/main/groovy/net/fortuna/ical4j/model/parameter/AbstractParameterFactory.groovy index 2643c2149..7ef630409 100644 --- a/src/main/groovy/net/fortuna/ical4j/model/parameter/AbstractParameterFactory.groovy +++ b/src/main/groovy/net/fortuna/ical4j/model/parameter/AbstractParameterFactory.groovy @@ -45,7 +45,7 @@ abstract class AbstractParameterFactory extends AbstractFactory { * {@inheritDoc} */ boolean isLeaf() { - return true; + return true } } diff --git a/src/main/groovy/net/fortuna/ical4j/model/property/AbstractPropertyFactory.groovy b/src/main/groovy/net/fortuna/ical4j/model/property/AbstractPropertyFactory.groovy index e2ea9a1a4..3c4814360 100644 --- a/src/main/groovy/net/fortuna/ical4j/model/property/AbstractPropertyFactory.groovy +++ b/src/main/groovy/net/fortuna/ical4j/model/property/AbstractPropertyFactory.groovy @@ -1,38 +1,38 @@ -/** - * Copyright (c) 2012, Ben Fortuna - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * o Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * o Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * o Neither the name of Ben Fortuna nor the names of any other contributors - * may be used to endorse or promote products derived from this software - * without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF - * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ +/** + * Copyright (c) 2012, Ben Fortuna + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * o Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * o Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * o Neither the name of Ben Fortuna nor the names of any other contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, + * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF + * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ package net.fortuna.ical4j.model.property -import net.fortuna.ical4j.model.Parameter -import net.fortuna.ical4j.model.ParameterList +import net.fortuna.ical4j.model.Parameter +import net.fortuna.ical4j.model.ParameterList /** * $Id$ * @@ -41,9 +41,9 @@ import net.fortuna.ical4j.model.ParameterList * @author fortuna * */ -public abstract class AbstractPropertyFactory extends AbstractFactory { +abstract class AbstractPropertyFactory extends AbstractFactory { - public Object newInstance(FactoryBuilderSupport builder, Object name, Object value, Map attributes) throws InstantiationException, IllegalAccessException { + Object newInstance(FactoryBuilderSupport builder, Object name, Object value, Map attributes) throws InstantiationException, IllegalAccessException { ParameterList parameters = attributes.remove('parameters') if (parameters == null) { parameters = new ParameterList() @@ -57,9 +57,9 @@ public abstract class AbstractPropertyFactory extends AbstractFactory { } } - protected abstract Object newInstance(ParameterList parameters, String value); - - public void setChild(FactoryBuilderSupport build, Object parent, Object child) { + protected abstract Object newInstance(ParameterList parameters, String value) + + void setChild(FactoryBuilderSupport build, Object parent, Object child) { if (child instanceof Parameter) { parent.parameters.add(child) } diff --git a/src/main/groovy/net/fortuna/ical4j/model/property/ActionFactory.groovy b/src/main/groovy/net/fortuna/ical4j/model/property/ActionFactory.groovy index 0e600bba2..2d3b062f1 100644 --- a/src/main/groovy/net/fortuna/ical4j/model/property/ActionFactory.groovy +++ b/src/main/groovy/net/fortuna/ical4j/model/property/ActionFactory.groovy @@ -1,38 +1,38 @@ -/** - * Copyright (c) 2012, Ben Fortuna - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * o Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * o Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * o Neither the name of Ben Fortuna nor the names of any other contributors - * may be used to endorse or promote products derived from this software - * without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF - * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ +/** + * Copyright (c) 2012, Ben Fortuna + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * o Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * o Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * o Neither the name of Ben Fortuna nor the names of any other contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, + * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF + * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ package net.fortuna.ical4j.model.property -import net.fortuna.ical4j.model.Parameter -import net.fortuna.ical4j.model.ParameterList +import net.fortuna.ical4j.model.ParameterList + /** * $Id$ * @@ -41,9 +41,9 @@ import net.fortuna.ical4j.model.ParameterList * @author fortuna * */ -public class ActionFactory extends AbstractPropertyFactory{ +class ActionFactory extends AbstractPropertyFactory{ - public Object newInstance(FactoryBuilderSupport builder, Object name, Object value, Map attributes) throws InstantiationException, IllegalAccessException { + Object newInstance(FactoryBuilderSupport builder, Object name, Object value, Map attributes) throws InstantiationException, IllegalAccessException { Action action if (FactoryBuilderSupport.checkValueIsTypeNotString(value, name, Action.class)) { action = (Action) value diff --git a/src/main/groovy/net/fortuna/ical4j/model/property/BusyTypeFactory.groovy b/src/main/groovy/net/fortuna/ical4j/model/property/BusyTypeFactory.groovy index 6d9821481..0eb0a108b 100755 --- a/src/main/groovy/net/fortuna/ical4j/model/property/BusyTypeFactory.groovy +++ b/src/main/groovy/net/fortuna/ical4j/model/property/BusyTypeFactory.groovy @@ -1,38 +1,38 @@ -/** - * Copyright (c) 2012, Ben Fortuna - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * o Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * o Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * o Neither the name of Ben Fortuna nor the names of any other contributors - * may be used to endorse or promote products derived from this software - * without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF - * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ +/** + * Copyright (c) 2012, Ben Fortuna + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * o Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * o Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * o Neither the name of Ben Fortuna nor the names of any other contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, + * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF + * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ package net.fortuna.ical4j.model.property -import net.fortuna.ical4j.model.Parameter -import net.fortuna.ical4j.model.ParameterList +import net.fortuna.ical4j.model.ParameterList + /** * $Id$ * @@ -41,9 +41,9 @@ import net.fortuna.ical4j.model.ParameterList * @author fortuna * */ -public class BusyTypeFactory extends AbstractPropertyFactory{ +class BusyTypeFactory extends AbstractPropertyFactory{ - public Object newInstance(FactoryBuilderSupport builder, Object name, Object value, Map attributes) throws InstantiationException, IllegalAccessException { + Object newInstance(FactoryBuilderSupport builder, Object name, Object value, Map attributes) throws InstantiationException, IllegalAccessException { BusyType busyType if (FactoryBuilderSupport.checkValueIsTypeNotString(value, name, BusyType.class)) { busyType = (BusyType) value diff --git a/src/main/groovy/net/fortuna/ical4j/model/property/CalScaleFactory.groovy b/src/main/groovy/net/fortuna/ical4j/model/property/CalScaleFactory.groovy index 41d98856a..dcf00fce9 100755 --- a/src/main/groovy/net/fortuna/ical4j/model/property/CalScaleFactory.groovy +++ b/src/main/groovy/net/fortuna/ical4j/model/property/CalScaleFactory.groovy @@ -1,39 +1,38 @@ -/** - * Copyright (c) 2012, Ben Fortuna - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * o Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * o Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * o Neither the name of Ben Fortuna nor the names of any other contributors - * may be used to endorse or promote products derived from this software - * without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF - * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ +/** + * Copyright (c) 2012, Ben Fortuna + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * o Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * o Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * o Neither the name of Ben Fortuna nor the names of any other contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, + * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF + * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ package net.fortuna.ical4j.model.property -import net.fortuna.ical4j.model.Parameter import net.fortuna.ical4j.model.ParameterList - + /** * $Id$ * @@ -42,9 +41,9 @@ import net.fortuna.ical4j.model.ParameterList * @author fortuna * */ -public class CalScaleFactory extends AbstractPropertyFactory{ +class CalScaleFactory extends AbstractPropertyFactory{ - public Object newInstance(FactoryBuilderSupport builder, Object name, Object value, Map attributes) throws InstantiationException, IllegalAccessException { + Object newInstance(FactoryBuilderSupport builder, Object name, Object value, Map attributes) throws InstantiationException, IllegalAccessException { CalScale calScale if (FactoryBuilderSupport.checkValueIsTypeNotString(value, name, CalScale.class)) { calScale = (CalScale) value diff --git a/src/main/groovy/net/fortuna/ical4j/model/property/ClazzFactory.groovy b/src/main/groovy/net/fortuna/ical4j/model/property/ClazzFactory.groovy index 4c64dcfa7..5cd792930 100755 --- a/src/main/groovy/net/fortuna/ical4j/model/property/ClazzFactory.groovy +++ b/src/main/groovy/net/fortuna/ical4j/model/property/ClazzFactory.groovy @@ -1,39 +1,38 @@ -/** - * Copyright (c) 2012, Ben Fortuna - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * o Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * o Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * o Neither the name of Ben Fortuna nor the names of any other contributors - * may be used to endorse or promote products derived from this software - * without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF - * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ +/** + * Copyright (c) 2012, Ben Fortuna + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * o Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * o Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * o Neither the name of Ben Fortuna nor the names of any other contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, + * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF + * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ package net.fortuna.ical4j.model.property -import net.fortuna.ical4j.model.Parameter import net.fortuna.ical4j.model.ParameterList - + /** * $Id$ * @@ -42,9 +41,9 @@ import net.fortuna.ical4j.model.ParameterList * @author fortuna * */ -public class ClazzFactory extends AbstractPropertyFactory{ +class ClazzFactory extends AbstractPropertyFactory{ - public Object newInstance(FactoryBuilderSupport builder, Object name, Object value, Map attributes) throws InstantiationException, IllegalAccessException { + Object newInstance(FactoryBuilderSupport builder, Object name, Object value, Map attributes) throws InstantiationException, IllegalAccessException { Clazz clazz if (FactoryBuilderSupport.checkValueIsTypeNotString(value, name, Clazz.class)) { clazz = (Clazz) value diff --git a/src/main/groovy/net/fortuna/ical4j/model/property/DefaultPropertyFactory.groovy b/src/main/groovy/net/fortuna/ical4j/model/property/DefaultPropertyFactory.groovy index 829012b07..81eba941e 100644 --- a/src/main/groovy/net/fortuna/ical4j/model/property/DefaultPropertyFactory.groovy +++ b/src/main/groovy/net/fortuna/ical4j/model/property/DefaultPropertyFactory.groovy @@ -29,35 +29,35 @@ * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -package net.fortuna.ical4j.model.property - +package net.fortuna.ical4j.model.property + import net.fortuna.ical4j.model.ParameterList import net.fortuna.ical4j.model.Property -/** - * @author fortuna - * - */ -class DefaultPropertyFactory extends AbstractPropertyFactory { +/** + * @author fortuna + * + */ +class DefaultPropertyFactory extends AbstractPropertyFactory { Class klass - - public Object newInstance(FactoryBuilderSupport builder, Object name, Object value, Map attributes) throws InstantiationException, IllegalAccessException { - def property - if (FactoryBuilderSupport.checkValueIsTypeNotString(value, name, klass)) { - property = value - } + + Object newInstance(FactoryBuilderSupport builder, Object name, Object value, Map attributes) throws InstantiationException, IllegalAccessException { + def property + if (FactoryBuilderSupport.checkValueIsTypeNotString(value, name, klass)) { + property = value + } else if (attributes['value']) { - property = super.newInstance(builder, name, attributes.remove('value'), attributes); - } - else { - property = super.newInstance(builder, name, value, attributes); - } - return property - } - + property = super.newInstance(builder, name, attributes.remove('value'), attributes) + } + else { + property = super.newInstance(builder, name, value, attributes) + } + return property + } + protected Object newInstance(ParameterList parameters, String value) { - def constructor = klass.getConstructor(ParameterList, String) - constructor.newInstance(parameters, value) - } -} + def constructor = klass.getConstructor(ParameterList, String) + constructor.newInstance(parameters, value) + } +} diff --git a/src/main/groovy/net/fortuna/ical4j/model/property/DtStampFactory.groovy b/src/main/groovy/net/fortuna/ical4j/model/property/DtStampFactory.groovy index 06e2e4c6e..85eb3a9de 100644 --- a/src/main/groovy/net/fortuna/ical4j/model/property/DtStampFactory.groovy +++ b/src/main/groovy/net/fortuna/ical4j/model/property/DtStampFactory.groovy @@ -1,39 +1,40 @@ -/** - * Copyright (c) 2012, Ben Fortuna - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * o Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * o Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * o Neither the name of Ben Fortuna nor the names of any other contributors - * may be used to endorse or promote products derived from this software - * without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF - * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ +/** + * Copyright (c) 2012, Ben Fortuna + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * o Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * o Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * o Neither the name of Ben Fortuna nor the names of any other contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, + * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF + * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ package net.fortuna.ical4j.model.property -import net.fortuna.ical4j.model.Parameter -import net.fortuna.ical4j.model.ParameterList -import net.fortuna.ical4j.model.DateTime /** +import net.fortuna.ical4j.model.DateTime +import net.fortuna.ical4j.model.ParameterList + +/** * $Id$ * * Created on: 02/08/2009 @@ -41,15 +42,15 @@ import net.fortuna.ical4j.model.DateTime /** * @author fortuna * */ -public class DtStampFactory extends AbstractPropertyFactory{ +class DtStampFactory extends AbstractPropertyFactory{ - public Object newInstance(FactoryBuilderSupport builder, Object name, Object value, Map attributes) throws InstantiationException, IllegalAccessException { + Object newInstance(FactoryBuilderSupport builder, Object name, Object value, Map attributes) throws InstantiationException, IllegalAccessException { DtStamp dtStamp if (value && FactoryBuilderSupport.checkValueIsTypeNotString(value, name, DtStamp.class)) { dtStamp = (DtStamp) value } else { - dtStamp = super.newInstance(builder, name, value, attributes); + dtStamp = super.newInstance(builder, name, value, attributes) } return dtStamp } diff --git a/src/main/groovy/net/fortuna/ical4j/model/property/MethodFactory.groovy b/src/main/groovy/net/fortuna/ical4j/model/property/MethodFactory.groovy index 92d8af0d5..1717cf8e9 100755 --- a/src/main/groovy/net/fortuna/ical4j/model/property/MethodFactory.groovy +++ b/src/main/groovy/net/fortuna/ical4j/model/property/MethodFactory.groovy @@ -1,39 +1,38 @@ -/** - * Copyright (c) 2012, Ben Fortuna - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * o Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * o Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * o Neither the name of Ben Fortuna nor the names of any other contributors - * may be used to endorse or promote products derived from this software - * without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF - * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ +/** + * Copyright (c) 2012, Ben Fortuna + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * o Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * o Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * o Neither the name of Ben Fortuna nor the names of any other contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, + * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF + * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ package net.fortuna.ical4j.model.property -import net.fortuna.ical4j.model.Parameter import net.fortuna.ical4j.model.ParameterList - + /** * $Id$ * @@ -42,9 +41,9 @@ import net.fortuna.ical4j.model.ParameterList * @author fortuna * */ -public class MethodFactory extends AbstractPropertyFactory{ +class MethodFactory extends AbstractPropertyFactory{ - public Object newInstance(FactoryBuilderSupport builder, Object name, Object value, Map attributes) throws InstantiationException, IllegalAccessException { + Object newInstance(FactoryBuilderSupport builder, Object name, Object value, Map attributes) throws InstantiationException, IllegalAccessException { Method instance if (FactoryBuilderSupport.checkValueIsTypeNotString(value, name, Method.class)) { instance = (Method) value diff --git a/src/main/groovy/net/fortuna/ical4j/model/property/PriorityFactory.groovy b/src/main/groovy/net/fortuna/ical4j/model/property/PriorityFactory.groovy index 6f7fd7e75..99a3ec188 100755 --- a/src/main/groovy/net/fortuna/ical4j/model/property/PriorityFactory.groovy +++ b/src/main/groovy/net/fortuna/ical4j/model/property/PriorityFactory.groovy @@ -1,39 +1,38 @@ -/** - * Copyright (c) 2012, Ben Fortuna - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * o Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * o Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * o Neither the name of Ben Fortuna nor the names of any other contributors - * may be used to endorse or promote products derived from this software - * without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF - * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ +/** + * Copyright (c) 2012, Ben Fortuna + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * o Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * o Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * o Neither the name of Ben Fortuna nor the names of any other contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, + * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF + * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ package net.fortuna.ical4j.model.property -import net.fortuna.ical4j.model.Parameter import net.fortuna.ical4j.model.ParameterList - + /** * $Id$ * @@ -42,9 +41,9 @@ import net.fortuna.ical4j.model.ParameterList * @author fortuna * */ -public class PriorityFactory extends AbstractPropertyFactory{ +class PriorityFactory extends AbstractPropertyFactory{ - public Object newInstance(FactoryBuilderSupport builder, Object name, Object value, Map attributes) throws InstantiationException, IllegalAccessException { + Object newInstance(FactoryBuilderSupport builder, Object name, Object value, Map attributes) throws InstantiationException, IllegalAccessException { Priority instance if (FactoryBuilderSupport.checkValueIsTypeNotString(value, name, Priority.class)) { instance = (Priority) value diff --git a/src/main/groovy/net/fortuna/ical4j/model/property/RequestStatusFactory.groovy b/src/main/groovy/net/fortuna/ical4j/model/property/RequestStatusFactory.groovy index e85f43883..7a85cbf82 100755 --- a/src/main/groovy/net/fortuna/ical4j/model/property/RequestStatusFactory.groovy +++ b/src/main/groovy/net/fortuna/ical4j/model/property/RequestStatusFactory.groovy @@ -41,9 +41,9 @@ import net.fortuna.ical4j.model.ParameterList * @author fortuna * */ -public class RequestStatusFactory extends AbstractPropertyFactory{ +class RequestStatusFactory extends AbstractPropertyFactory{ - public Object newInstance(FactoryBuilderSupport builder, Object name, Object value, Map attributes) throws InstantiationException, IllegalAccessException { + Object newInstance(FactoryBuilderSupport builder, Object name, Object value, Map attributes) throws InstantiationException, IllegalAccessException { RequestStatus instance if (FactoryBuilderSupport.checkValueIsTypeNotString(value, name, RequestStatus.class)) { instance = (RequestStatus) value diff --git a/src/main/groovy/net/fortuna/ical4j/model/property/TranspFactory.groovy b/src/main/groovy/net/fortuna/ical4j/model/property/TranspFactory.groovy index 04f51d7bc..6150a4f67 100755 --- a/src/main/groovy/net/fortuna/ical4j/model/property/TranspFactory.groovy +++ b/src/main/groovy/net/fortuna/ical4j/model/property/TranspFactory.groovy @@ -1,39 +1,38 @@ -/** - * Copyright (c) 2012, Ben Fortuna - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * o Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * o Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * o Neither the name of Ben Fortuna nor the names of any other contributors - * may be used to endorse or promote products derived from this software - * without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF - * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ +/** + * Copyright (c) 2012, Ben Fortuna + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * o Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * o Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * o Neither the name of Ben Fortuna nor the names of any other contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, + * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF + * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ package net.fortuna.ical4j.model.property -import net.fortuna.ical4j.model.Parameter import net.fortuna.ical4j.model.ParameterList - + /** * $Id$ * @@ -42,9 +41,9 @@ import net.fortuna.ical4j.model.ParameterList * @author fortuna * */ -public class TranspFactory extends AbstractPropertyFactory{ +class TranspFactory extends AbstractPropertyFactory{ - public Object newInstance(FactoryBuilderSupport builder, Object name, Object value, Map attributes) throws InstantiationException, IllegalAccessException { + Object newInstance(FactoryBuilderSupport builder, Object name, Object value, Map attributes) throws InstantiationException, IllegalAccessException { Transp instance if (FactoryBuilderSupport.checkValueIsTypeNotString(value, name, Transp.class)) { instance = (Transp) value diff --git a/src/main/groovy/net/fortuna/ical4j/model/property/VersionFactory.groovy b/src/main/groovy/net/fortuna/ical4j/model/property/VersionFactory.groovy index 3ec77d01b..5947fd816 100644 --- a/src/main/groovy/net/fortuna/ical4j/model/property/VersionFactory.groovy +++ b/src/main/groovy/net/fortuna/ical4j/model/property/VersionFactory.groovy @@ -1,38 +1,38 @@ -/** - * Copyright (c) 2012, Ben Fortuna - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * o Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * o Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * o Neither the name of Ben Fortuna nor the names of any other contributors - * may be used to endorse or promote products derived from this software - * without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF - * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ +/** + * Copyright (c) 2012, Ben Fortuna + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * o Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * o Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * o Neither the name of Ben Fortuna nor the names of any other contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, + * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF + * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ package net.fortuna.ical4j.model.property -import net.fortuna.ical4j.model.Parameter -import net.fortuna.ical4j.model.ParameterList +import net.fortuna.ical4j.model.ParameterList + /** * $Id$ * @@ -41,9 +41,9 @@ import net.fortuna.ical4j.model.ParameterList * @author fortuna * */ -public class VersionFactory extends AbstractPropertyFactory{ +class VersionFactory extends AbstractPropertyFactory{ - public Object newInstance(FactoryBuilderSupport builder, Object name, Object value, Map attributes) throws InstantiationException, IllegalAccessException { + Object newInstance(FactoryBuilderSupport builder, Object name, Object value, Map attributes) throws InstantiationException, IllegalAccessException { Version version if (FactoryBuilderSupport.checkValueIsTypeNotString(value, name, Version.class)) { version = (Version) value diff --git a/src/main/groovy/net/fortuna/ical4j/model/property/XPropertyFactory.groovy b/src/main/groovy/net/fortuna/ical4j/model/property/XPropertyFactory.groovy index 14083306e..043368f0d 100755 --- a/src/main/groovy/net/fortuna/ical4j/model/property/XPropertyFactory.groovy +++ b/src/main/groovy/net/fortuna/ical4j/model/property/XPropertyFactory.groovy @@ -41,9 +41,9 @@ import net.fortuna.ical4j.model.ParameterList * @author fortuna * */ -public class XPropertyFactory extends AbstractPropertyFactory{ +class XPropertyFactory extends AbstractPropertyFactory{ - public Object newInstance(FactoryBuilderSupport builder, Object name, Object value, Map attributes) throws InstantiationException, IllegalAccessException { + Object newInstance(FactoryBuilderSupport builder, Object name, Object value, Map attributes) throws InstantiationException, IllegalAccessException { XProperty instance if (FactoryBuilderSupport.checkValueIsTypeNotString(value, name, XProperty.class)) { instance = (XProperty) value diff --git a/src/main/java/net/fortuna/ical4j/data/CalendarParserImpl.java b/src/main/java/net/fortuna/ical4j/data/CalendarParserImpl.java index 2e3c93d62..154f58d56 100644 --- a/src/main/java/net/fortuna/ical4j/data/CalendarParserImpl.java +++ b/src/main/java/net/fortuna/ical4j/data/CalendarParserImpl.java @@ -554,10 +554,8 @@ private int skipNewLines(StreamTokenizer tokeniser, Reader in, String token) thr * @param in * @param token * @return - * @throws ParserException - * @throws IOException */ - private String getSvalIgnoringBom(StreamTokenizer tokeniser, Reader in, String token) throws ParserException, IOException { + private String getSvalIgnoringBom(StreamTokenizer tokeniser, Reader in, String token) { if(tokeniser.sval != null) { if(tokeniser.sval.contains(token)) { return token; diff --git a/src/main/java/net/fortuna/ical4j/model/Calendar.java b/src/main/java/net/fortuna/ical4j/model/Calendar.java index 418e8cb54..e96ac3179 100644 --- a/src/main/java/net/fortuna/ical4j/model/Calendar.java +++ b/src/main/java/net/fortuna/ical4j/model/Calendar.java @@ -357,7 +357,7 @@ public void conformToRfc5545() throws IllegalAccessException, IllegalArgumentExc conformPropertiesToRfc5545(properties); - for(Component component : (List)components){ + for(Component component : components){ CountableProperties.removeExceededPropertiesForComponent(component); //each component @@ -392,12 +392,12 @@ private static void conformComponentToRfc5545(Component component){ RuleManager.applyTo(component); } - private static enum CountableProperties{ + private enum CountableProperties{ STATUS(Property.STATUS, 1); private int maxApparitionNumber; private String name; - private CountableProperties(String name, int maxApparitionNumber){ + CountableProperties(String name, int maxApparitionNumber){ this.maxApparitionNumber = maxApparitionNumber; this.name = name; } diff --git a/src/main/java/net/fortuna/ical4j/model/Component.java b/src/main/java/net/fortuna/ical4j/model/Component.java index 025137fb6..b8d939e36 100644 --- a/src/main/java/net/fortuna/ical4j/model/Component.java +++ b/src/main/java/net/fortuna/ical4j/model/Component.java @@ -291,12 +291,12 @@ public final PeriodList calculateRecurrenceSet(final Period period) { final PeriodList recurrenceSet = new PeriodList(); - final DtStart start = (DtStart) getProperty(Property.DTSTART); - DateProperty end = (DateProperty) getProperty(Property.DTEND); + final DtStart start = getProperty(Property.DTSTART); + DateProperty end = getProperty(Property.DTEND); if (end == null) { - end = (DateProperty) getProperty(Property.DUE); + end = getProperty(Property.DUE); } - Duration duration = (Duration) getProperty(Property.DURATION); + Duration duration = getProperty(Property.DURATION); // if no start date specified return empty list.. if (start == null) { diff --git a/src/main/java/net/fortuna/ical4j/model/IndexedPropertyList.java b/src/main/java/net/fortuna/ical4j/model/IndexedPropertyList.java index 8e2ac7b54..10b5e4e15 100644 --- a/src/main/java/net/fortuna/ical4j/model/IndexedPropertyList.java +++ b/src/main/java/net/fortuna/ical4j/model/IndexedPropertyList.java @@ -95,7 +95,7 @@ public PropertyList getProperties(final String paramValue) { public Property getProperty(final String paramValue) { final PropertyList properties = getProperties(paramValue); if (!properties.isEmpty()) { - return (Property) properties.iterator().next(); + return properties.iterator().next(); } return null; } diff --git a/src/main/java/net/fortuna/ical4j/model/Period.java b/src/main/java/net/fortuna/ical4j/model/Period.java index 913d6b8b2..8dab8a534 100644 --- a/src/main/java/net/fortuna/ical4j/model/Period.java +++ b/src/main/java/net/fortuna/ical4j/model/Period.java @@ -360,6 +360,6 @@ public final boolean equals(final Object o) { */ public final int hashCode() { return new HashCodeBuilder().append(getStart()) - .append((duration == null) ? (Object) getEnd() : duration).toHashCode(); + .append((duration == null) ? getEnd() : duration).toHashCode(); } } diff --git a/src/main/java/net/fortuna/ical4j/model/TimeZone.java b/src/main/java/net/fortuna/ical4j/model/TimeZone.java index e051aba78..c57f558dc 100644 --- a/src/main/java/net/fortuna/ical4j/model/TimeZone.java +++ b/src/main/java/net/fortuna/ical4j/model/TimeZone.java @@ -64,7 +64,7 @@ public class TimeZone extends java.util.TimeZone { */ public TimeZone(final VTimeZone vTimeZone) { this.vTimeZone = vTimeZone; - final TzId tzId = (TzId) vTimeZone.getProperty(Property.TZID); + final TzId tzId = vTimeZone.getProperty(Property.TZID); setID(tzId.getValue()); this.rawOffset = getRawOffset(vTimeZone); } @@ -95,7 +95,7 @@ public final int getOffset(final int era, final int year, final int month, final final Observance observance = vTimeZone.getApplicableObservance(new DateTime(cal.getTime())); if (observance != null) { - final TzOffsetTo offset = (TzOffsetTo) observance.getProperty(Property.TZOFFSETTO); + final TzOffsetTo offset = observance.getProperty(Property.TZOFFSETTO); return (int) offset.getOffset().getOffset(); } return 0; @@ -107,7 +107,7 @@ public final int getOffset(final int era, final int year, final int month, final public int getOffset(long date) { final Observance observance = vTimeZone.getApplicableObservance(new DateTime(date)); if (observance != null) { - final TzOffsetTo offset = (TzOffsetTo) observance.getProperty(Property.TZOFFSETTO); + final TzOffsetTo offset = observance.getProperty(Property.TZOFFSETTO); if (offset.getOffset().getOffset() < getRawOffset()) { return getRawOffset(); } else { @@ -190,7 +190,7 @@ private static int getRawOffset(VTimeZone vt) { latestSeasonalTime = seasonalTimes.get(0); } if (latestSeasonalTime != null) { - final TzOffsetTo offsetTo = (TzOffsetTo) latestSeasonalTime.getProperty(Property.TZOFFSETTO); + final TzOffsetTo offsetTo = latestSeasonalTime.getProperty(Property.TZOFFSETTO); if (offsetTo != null) { return (int) offsetTo.getOffset().getOffset(); } diff --git a/src/main/java/net/fortuna/ical4j/model/component/Available.java b/src/main/java/net/fortuna/ical4j/model/component/Available.java index dde351e88..c3bb72fcd 100644 --- a/src/main/java/net/fortuna/ical4j/model/component/Available.java +++ b/src/main/java/net/fortuna/ical4j/model/component/Available.java @@ -124,7 +124,7 @@ public final void validate(final boolean recurse) * "DATE-TIME" values specified as either date with UTC time or date * with local time and a time zone reference. */ - final DtStart start = (DtStart) getProperty(Property.DTSTART); + final DtStart start = getProperty(Property.DTSTART); if (Value.DATE.equals(start.getParameter(Parameter.VALUE))) { throw new ValidationException("Property [" + Property.DTSTART + "] must be a " + Value.DATE_TIME); @@ -153,7 +153,7 @@ public final void validate(final boolean recurse) PropertyValidator.getInstance().assertOne(Property.DTEND, getProperties()); /* Must be DATE_TIME */ - final DtEnd end = (DtEnd) getProperty(Property.DTEND); + final DtEnd end = getProperty(Property.DTEND); if (Value.DATE.equals(end.getParameter(Parameter.VALUE))) { throw new ValidationException("Property [" + Property.DTEND + "] must be a " + Value.DATE_TIME); diff --git a/src/main/java/net/fortuna/ical4j/model/component/VAvailability.java b/src/main/java/net/fortuna/ical4j/model/component/VAvailability.java index fc7549372..c29c41cbe 100644 --- a/src/main/java/net/fortuna/ical4j/model/component/VAvailability.java +++ b/src/main/java/net/fortuna/ical4j/model/component/VAvailability.java @@ -188,7 +188,7 @@ public final void validate(final boolean recurse) * "DATE-TIME" values specified as either date with UTC time or date * with local time and a time zone reference. */ - final DtStart start = (DtStart) getProperty(Property.DTSTART); + final DtStart start = getProperty(Property.DTSTART); if (Value.DATE.equals(start.getParameter(Parameter.VALUE))) { throw new ValidationException("Property [" + Property.DTSTART + "] must be a " + Value.DATE_TIME); @@ -202,7 +202,7 @@ public final void validate(final boolean recurse) PropertyValidator.getInstance().assertOne(Property.DTEND, getProperties()); /* Must be DATE_TIME */ - final DtEnd end = (DtEnd) getProperty(Property.DTEND); + final DtEnd end = getProperty(Property.DTEND); if (Value.DATE.equals(end.getParameter(Parameter.VALUE))) { throw new ValidationException("Property [" + Property.DTEND + "] must be a " + Value.DATE_TIME); diff --git a/src/main/java/net/fortuna/ical4j/model/component/VEvent.java b/src/main/java/net/fortuna/ical4j/model/component/VEvent.java index 5670718f2..3c45210e1 100644 --- a/src/main/java/net/fortuna/ical4j/model/component/VEvent.java +++ b/src/main/java/net/fortuna/ical4j/model/component/VEvent.java @@ -350,7 +350,7 @@ public final void validate(final boolean recurse) throws ValidationException { PropertyValidator.getInstance().assertOneOrLess(property, getProperties()); }); - final Status status = (Status) getProperty(Property.STATUS); + final Status status = getProperty(Property.STATUS); if (status != null && !Status.VEVENT_TENTATIVE.getValue().equals(status.getValue()) && !Status.VEVENT_CONFIRMED.getValue().equals(status.getValue()) && !Status.VEVENT_CANCELLED.getValue().equals(status.getValue())) { @@ -380,8 +380,8 @@ public final void validate(final boolean recurse) throws ValidationException { * anniversary type of "VEVENT" can span more than one date (i.e, "DTEND" property value is set to a * calendar date after the "DTSTART" property value). */ - final DtStart start = (DtStart) getProperty(Property.DTSTART); - final DtEnd end = (DtEnd) getProperty(Property.DTEND); + final DtStart start = getProperty(Property.DTSTART); + final DtEnd end = getProperty(Property.DTEND); if (start != null) { final Parameter startValue = start.getParameter(Parameter.VALUE); @@ -626,7 +626,7 @@ public final DtEnd getEndDate() { * @return The end for this VEVENT. */ public final DtEnd getEndDate(final boolean deriveFromDuration) { - DtEnd dtEnd = (DtEnd) getProperty(Property.DTEND); + DtEnd dtEnd = getProperty(Property.DTEND); // No DTEND? No problem, we'll use the DURATION. if (dtEnd == null && deriveFromDuration && getStartDate() != null) { final DtStart dtStart = getStartDate(); diff --git a/src/main/java/net/fortuna/ical4j/model/component/VFreeBusy.java b/src/main/java/net/fortuna/ical4j/model/component/VFreeBusy.java index 2747634c1..8731cd706 100644 --- a/src/main/java/net/fortuna/ical4j/model/component/VFreeBusy.java +++ b/src/main/java/net/fortuna/ical4j/model/component/VFreeBusy.java @@ -303,11 +303,11 @@ public VFreeBusy(final DateTime start, final DateTime end, final Dur duration) { public VFreeBusy(final VFreeBusy request, final ComponentList components) { this(); - final DtStart start = (DtStart) request.getProperty(Property.DTSTART); + final DtStart start = request.getProperty(Property.DTSTART); - final DtEnd end = (DtEnd) request.getProperty(Property.DTEND); + final DtEnd end = request.getProperty(Property.DTEND); - final Duration duration = (Duration) request.getProperty(Property.DURATION); + final Duration duration = request.getProperty(Property.DURATION); // 4.8.2.4 Date/Time Start: // @@ -518,7 +518,7 @@ public final void validate(final boolean recurse) throws ValidationException { }); // DtEnd value must be later in time that DtStart.. - final DtStart dtStart = (DtStart) getProperty(Property.DTSTART); + final DtStart dtStart = getProperty(Property.DTSTART); // 4.8.2.4 Date/Time Start: // @@ -529,7 +529,7 @@ public final void validate(final boolean recurse) throws ValidationException { throw new ValidationException("DTSTART must be specified in UTC time"); } - final DtEnd dtEnd = (DtEnd) getProperty(Property.DTEND); + final DtEnd dtEnd = getProperty(Property.DTEND); // 4.8.2.2 Date/Time End // diff --git a/src/main/java/net/fortuna/ical4j/model/component/VJournal.java b/src/main/java/net/fortuna/ical4j/model/component/VJournal.java index b0b7873a7..a5a479730 100644 --- a/src/main/java/net/fortuna/ical4j/model/component/VJournal.java +++ b/src/main/java/net/fortuna/ical4j/model/component/VJournal.java @@ -180,7 +180,7 @@ public final void validate(final boolean recurse) PropertyValidator.getInstance().assertOneOrLess(property, getProperties()); }); - final Status status = (Status) getProperty(Property.STATUS); + final Status status = getProperty(Property.STATUS); if (status != null && !Status.VJOURNAL_DRAFT.getValue().equals(status.getValue()) && !Status.VJOURNAL_FINAL.getValue().equals(status.getValue()) && !Status.VJOURNAL_CANCELLED.getValue().equals(status.getValue())) { diff --git a/src/main/java/net/fortuna/ical4j/model/component/VToDo.java b/src/main/java/net/fortuna/ical4j/model/component/VToDo.java index 1302a27a5..d2116fb59 100644 --- a/src/main/java/net/fortuna/ical4j/model/component/VToDo.java +++ b/src/main/java/net/fortuna/ical4j/model/component/VToDo.java @@ -257,7 +257,7 @@ public final void validate(final boolean recurse) PropertyValidator.getInstance().assertOneOrLess(property, getProperties()); }); - final Status status = (Status) getProperty(Property.STATUS); + final Status status = getProperty(Property.STATUS); if (status != null && !Status.VTODO_NEEDS_ACTION.getValue().equals(status.getValue()) && !Status.VTODO_COMPLETED.getValue().equals(status.getValue()) && !Status.VTODO_IN_PROCESS.getValue().equals(status.getValue()) diff --git a/src/main/java/net/fortuna/ical4j/model/property/Attach.java b/src/main/java/net/fortuna/ical4j/model/property/Attach.java index ba7b63cae..e2799cd69 100644 --- a/src/main/java/net/fortuna/ical4j/model/property/Attach.java +++ b/src/main/java/net/fortuna/ical4j/model/property/Attach.java @@ -223,10 +223,9 @@ public final URI getUri() { * location to binary data and is stored as such. * * @param aValue a string encoded binary or URI value - * @throws IOException where binary data cannot be decoded * @throws URISyntaxException where the specified value is not a valid URI */ - public final void setValue(final String aValue) throws IOException, + public final void setValue(final String aValue) throws URISyntaxException { // determine if ATTACH is a URI or an embedded diff --git a/src/main/java/net/fortuna/ical4j/model/property/Attendee.java b/src/main/java/net/fortuna/ical4j/model/property/Attendee.java index f16d492a9..0389592b0 100644 --- a/src/main/java/net/fortuna/ical4j/model/property/Attendee.java +++ b/src/main/java/net/fortuna/ical4j/model/property/Attendee.java @@ -160,7 +160,7 @@ public final void setCalAddress(final URI calAddress) { /** * {@inheritDoc} */ - public final Property copy() throws IOException, URISyntaxException, ParseException { + public final Property copy() { // URI are immutable return new Attendee(new ParameterList(getParameters(), false), calAddress); } diff --git a/src/main/java/net/fortuna/ical4j/transform/Transformer.java b/src/main/java/net/fortuna/ical4j/transform/Transformer.java index 69c6469a3..c5f0d4e99 100644 --- a/src/main/java/net/fortuna/ical4j/transform/Transformer.java +++ b/src/main/java/net/fortuna/ical4j/transform/Transformer.java @@ -47,5 +47,5 @@ public interface Transformer { * @param object a calendar object to transform * @return a transformed calendar object */ - public abstract T transform(final T object); + T transform(final T object); } diff --git a/src/main/java/net/fortuna/ical4j/util/Calendars.java b/src/main/java/net/fortuna/ical4j/util/Calendars.java index 9546ec61a..e929ec72c 100644 --- a/src/main/java/net/fortuna/ical4j/util/Calendars.java +++ b/src/main/java/net/fortuna/ical4j/util/Calendars.java @@ -150,7 +150,7 @@ public static Calendar[] split(final Calendar calendar) { continue; } - final Uid uid = (Uid) c.getProperty(Property.UID); + final Uid uid = c.getProperty(Property.UID); Calendar uidCal = calendars.get(uid); if (uidCal == null) { diff --git a/src/main/java/net/fortuna/ical4j/util/Dates.java b/src/main/java/net/fortuna/ical4j/util/Dates.java index a66172a07..8eb9a2e4e 100644 --- a/src/main/java/net/fortuna/ical4j/util/Dates.java +++ b/src/main/java/net/fortuna/ical4j/util/Dates.java @@ -131,7 +131,7 @@ private Dates() { public static int getAbsWeekNo(final java.util.Date date, final int weekNo) { if (weekNo == 0 || weekNo < -MAX_WEEKS_PER_YEAR || weekNo > MAX_WEEKS_PER_YEAR) { throw new IllegalArgumentException(MessageFormat.format(INVALID_WEEK_MESSAGE, - new Object[] {weekNo})); + weekNo)); } if (weekNo > 0) { return weekNo; @@ -161,7 +161,7 @@ public static int getAbsWeekNo(final java.util.Date date, final int weekNo) { public static int getAbsYearDay(final java.util.Date date, final int yearDay) { if (yearDay == 0 || yearDay < -MAX_DAYS_PER_YEAR || yearDay > MAX_DAYS_PER_YEAR) { throw new IllegalArgumentException(MessageFormat.format(INVALID_YEAR_DAY_MESSAGE, - new Object[] {yearDay})); + yearDay)); } if (yearDay > 0) { return yearDay; @@ -191,7 +191,7 @@ public static int getAbsYearDay(final java.util.Date date, final int yearDay) { public static int getAbsMonthDay(final java.util.Date date, final int monthDay) { if (monthDay == 0 || monthDay < -MAX_DAYS_PER_MONTH || monthDay > MAX_DAYS_PER_MONTH) { throw new IllegalArgumentException(MessageFormat.format(INVALID_MONTH_DAY_MESSAGE, - new Object[] {monthDay})); + monthDay)); } if (monthDay > 0) { return monthDay;