Skip to content

Commit

Permalink
Code clean up
Browse files Browse the repository at this point in the history
  • Loading branch information
benfortuna committed Jan 29, 2017
1 parent bb2f5b6 commit 6af2a70
Show file tree
Hide file tree
Showing 14 changed files with 28 additions and 33 deletions.
1 change: 1 addition & 0 deletions etc/scripts/generate-htaccess-alias.sh
@@ -1,3 +1,4 @@
#!/usr/bin/env bash
## An AWK script for reading the Olson backward compatibility file and generating an htaccess file
#
## Latest tzdata available here: ftp://elsie.nci.nih.gov/pub/
Expand Down
1 change: 1 addition & 0 deletions etc/scripts/generate-tz-alias.sh
@@ -1,3 +1,4 @@
#!/usr/bin/env bash
## An AWK script for reading the Olson backward compatibility file and generating an alias properties file
#
## Latest tzdata available here: ftp://elsie.nci.nih.gov/pub/
Expand Down
4 changes: 2 additions & 2 deletions etc/scripts/update_zoneinfo.sh
@@ -1,5 +1,5 @@
#!/bin/sh
export TZURL_HOME=/home/build/tzurl
rsync -av $TZURL_HOME/zoneinfo
rsync -av $TZURL_HOME/zoneinfo-global
rsync -av ${TZURL_HOME}/zoneinfo
rsync -av ${TZURL_HOME}/zoneinfo-global

13 changes: 8 additions & 5 deletions src/main/java/net/fortuna/ical4j/model/Calendar.java
Expand Up @@ -32,9 +32,14 @@
package net.fortuna.ical4j.model;

import net.fortuna.ical4j.model.component.CalendarComponent;
import net.fortuna.ical4j.model.property.*;
import net.fortuna.ical4j.model.property.CalScale;
import net.fortuna.ical4j.model.property.Method;
import net.fortuna.ical4j.model.property.ProdId;
import net.fortuna.ical4j.model.property.Version;
import net.fortuna.ical4j.util.Strings;
import net.fortuna.ical4j.validate.*;
import net.fortuna.ical4j.validate.AbstractCalendarValidatorFactory;
import net.fortuna.ical4j.validate.ValidationException;
import net.fortuna.ical4j.validate.Validator;
import org.apache.commons.lang3.builder.EqualsBuilder;
import org.apache.commons.lang3.builder.HashCodeBuilder;

Expand Down Expand Up @@ -189,7 +194,7 @@ public Calendar(Calendar c) throws ParseException, IOException,
* {@inheritDoc}
*/
public final String toString() {
String buffer = BEGIN +
return BEGIN +
':' +
VCALENDAR +
Strings.LINE_SEPARATOR +
Expand All @@ -199,8 +204,6 @@ public final String toString() {
':' +
VCALENDAR +
Strings.LINE_SEPARATOR;

return buffer;
}

/**
Expand Down
4 changes: 1 addition & 3 deletions src/main/java/net/fortuna/ical4j/model/Component.java
Expand Up @@ -144,7 +144,7 @@ protected Component(final String s, final PropertyList p) {
* {@inheritDoc}
*/
public String toString() {
String buffer = BEGIN +
return BEGIN +
':' +
getName() +
Strings.LINE_SEPARATOR +
Expand All @@ -153,8 +153,6 @@ public String toString() {
':' +
getName() +
Strings.LINE_SEPARATOR;

return buffer;
}

/**
Expand Down
3 changes: 1 addition & 2 deletions src/main/java/net/fortuna/ical4j/model/DateTime.java
Expand Up @@ -494,9 +494,8 @@ public final TimeZone getTimeZone() {
* {@inheritDoc}
*/
public final String toString() {
String b = super.toString() + 'T' +
return super.toString() + 'T' +
time.toString();
return b;
}

/**
Expand Down
Expand Up @@ -56,7 +56,7 @@ public abstract class CalendarComponent extends Component {
/**
* Validator instance that does nothing.
*/
protected static final Validator EMPTY_VALIDATOR = new EmptyValidator();
protected static final Validator<CalendarComponent> EMPTY_VALIDATOR = new EmptyValidator<>();

/**
* @param name component name
Expand All @@ -79,7 +79,7 @@ public CalendarComponent(final String name, final PropertyList properties) {
* @throws ValidationException where the component does not comply with RFC2446
*/
public final void validate(Method method) throws ValidationException {
final Validator validator = getValidator(method);
final Validator<CalendarComponent> validator = getValidator(method);
if (validator != null) {
validator.validate(this);
}
Expand All @@ -92,7 +92,7 @@ public final void validate(Method method) throws ValidationException {
* @param method a method to validate on
* @return a validator for the specified method or null if the method is not supported
*/
protected abstract Validator getValidator(Method method);
protected abstract Validator<CalendarComponent> getValidator(Method method);

/**
* Apply validation for METHOD=PUBLISH.
Expand Down
Expand Up @@ -149,7 +149,7 @@ public final ComponentList<Available> getAvailable() {
* {@inheritDoc}
*/
public final String toString() {
String b = BEGIN +
return BEGIN +
':' +
getName() +
Strings.LINE_SEPARATOR +
Expand All @@ -159,7 +159,6 @@ public final String toString() {
':' +
getName() +
Strings.LINE_SEPARATOR;
return b;
}

/**
Expand Down
3 changes: 1 addition & 2 deletions src/main/java/net/fortuna/ical4j/model/component/VEvent.java
Expand Up @@ -294,7 +294,7 @@ public final ComponentList<VAlarm> getAlarms() {
* {@inheritDoc}
*/
public final String toString() {
String b = BEGIN +
return BEGIN +
':' +
getName() +
Strings.LINE_SEPARATOR +
Expand All @@ -304,7 +304,6 @@ public final String toString() {
':' +
getName() +
Strings.LINE_SEPARATOR;
return b;
}

/**
Expand Down
Expand Up @@ -170,7 +170,7 @@ public VTimeZone(final PropertyList properties,
* {@inheritDoc}
*/
public final String toString() {
String b = BEGIN +
return BEGIN +
':' +
getName() +
Strings.LINE_SEPARATOR +
Expand All @@ -180,7 +180,6 @@ public final String toString() {
':' +
getName() +
Strings.LINE_SEPARATOR;
return b;
}

/**
Expand Down
3 changes: 1 addition & 2 deletions src/main/java/net/fortuna/ical4j/model/component/VToDo.java
Expand Up @@ -208,7 +208,7 @@ public final ComponentList<VAlarm> getAlarms() {
* {@inheritDoc}
*/
public final String toString() {
String buffer = BEGIN +
return BEGIN +
':' +
getName() +
Strings.LINE_SEPARATOR +
Expand All @@ -218,7 +218,6 @@ public final String toString() {
':' +
getName() +
Strings.LINE_SEPARATOR;
return buffer;
}

/**
Expand Down
3 changes: 1 addition & 2 deletions src/main/java/net/fortuna/ical4j/model/component/VVenue.java
Expand Up @@ -115,7 +115,7 @@ public VVenue(final PropertyList properties) {
* {@inheritDoc}
*/
public final String toString() {
String b = BEGIN +
return BEGIN +
':' +
getName() +
Strings.LINE_SEPARATOR +
Expand All @@ -124,7 +124,6 @@ public final String toString() {
':' +
getName() +
Strings.LINE_SEPARATOR;
return b;
}

/**
Expand Down
7 changes: 3 additions & 4 deletions src/main/java/net/fortuna/ical4j/util/DecoderFactory.java
Expand Up @@ -31,13 +31,12 @@
*/
package net.fortuna.ical4j.util;

import java.io.UnsupportedEncodingException;

import net.fortuna.ical4j.model.parameter.Encoding;

import org.apache.commons.codec.BinaryDecoder;
import org.apache.commons.codec.StringDecoder;

import java.io.UnsupportedEncodingException;

/**
* Abstract base class for decoder factory implementations.
*
Expand Down Expand Up @@ -70,7 +69,7 @@ public abstract class DecoderFactory {
/**
* @return Returns the instance.
*/
public static final DecoderFactory getInstance() {
public static DecoderFactory getInstance() {
return instance;
}

Expand Down
7 changes: 3 additions & 4 deletions src/main/java/net/fortuna/ical4j/util/EncoderFactory.java
Expand Up @@ -31,13 +31,12 @@
*/
package net.fortuna.ical4j.util;

import java.io.UnsupportedEncodingException;

import net.fortuna.ical4j.model.parameter.Encoding;

import org.apache.commons.codec.BinaryEncoder;
import org.apache.commons.codec.StringEncoder;

import java.io.UnsupportedEncodingException;

/**
* Abstract base class for encoder factory implementations.
*
Expand Down Expand Up @@ -70,7 +69,7 @@ public abstract class EncoderFactory {
/**
* @return Returns the instance.
*/
public static final EncoderFactory getInstance() {
public static EncoderFactory getInstance() {
return instance;
}

Expand Down

0 comments on commit 6af2a70

Please sign in to comment.