Thread: [Japi-cvs] SF.net SVN: japi:[689] libs/lang/trunk/src/prj/net/sf/japi/lang/ PropertyComparator.java
Status: Beta
Brought to you by:
christianhujer
From: <chr...@us...> - 2008-10-07 20:56:36
|
Revision: 689 http://japi.svn.sourceforge.net/japi/?rev=689&view=rev Author: christianhujer Date: 2008-10-07 20:56:33 +0000 (Tue, 07 Oct 2008) Log Message: ----------- Updated TODO comments to match code conventions. Modified Paths: -------------- libs/lang/trunk/src/prj/net/sf/japi/lang/PropertyComparator.java Modified: libs/lang/trunk/src/prj/net/sf/japi/lang/PropertyComparator.java =================================================================== --- libs/lang/trunk/src/prj/net/sf/japi/lang/PropertyComparator.java 2008-10-07 20:55:01 UTC (rev 688) +++ libs/lang/trunk/src/prj/net/sf/japi/lang/PropertyComparator.java 2008-10-07 20:56:33 UTC (rev 689) @@ -74,7 +74,7 @@ } catch (final IllegalAccessException e) { throw new IllegalAccessError(e.getMessage()); } catch (final InvocationTargetException e) { - throw new RuntimeException(e); // TODO use something better than RuntimeException + throw new RuntimeException(e); // TODO:christianhujer:use something better than RuntimeException } } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <chr...@us...> - 2009-02-15 12:30:54
|
Revision: 878 http://japi.svn.sourceforge.net/japi/?rev=878&view=rev Author: christianhujer Date: 2009-02-15 12:30:51 +0000 (Sun, 15 Feb 2009) Log Message: ----------- Fixed checkstyle issues. Includes change of all TODO comments into a format with date. Modified Paths: -------------- libs/lang/trunk/src/prj/net/sf/japi/lang/PropertyComparator.java Modified: libs/lang/trunk/src/prj/net/sf/japi/lang/PropertyComparator.java =================================================================== --- libs/lang/trunk/src/prj/net/sf/japi/lang/PropertyComparator.java 2009-02-15 12:30:40 UTC (rev 877) +++ libs/lang/trunk/src/prj/net/sf/japi/lang/PropertyComparator.java 2009-02-15 12:30:51 UTC (rev 878) @@ -73,7 +73,7 @@ } catch (final IllegalAccessException e) { throw new IllegalAccessError(e.getMessage()); } catch (final InvocationTargetException e) { - throw new RuntimeException(e); // TODO:christianhujer:use something better than RuntimeException + throw new RuntimeException(e); // TODO:2009-02-15:christianhujer:use something better than RuntimeException } } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <chr...@us...> - 2009-02-15 13:28:27
|
Revision: 891 http://japi.svn.sourceforge.net/japi/?rev=891&view=rev Author: christianhujer Date: 2009-02-15 13:28:23 +0000 (Sun, 15 Feb 2009) Log Message: ----------- Fixed several javadoc issues. Modified Paths: -------------- libs/lang/trunk/src/prj/net/sf/japi/lang/PropertyComparator.java Modified: libs/lang/trunk/src/prj/net/sf/japi/lang/PropertyComparator.java =================================================================== --- libs/lang/trunk/src/prj/net/sf/japi/lang/PropertyComparator.java 2009-02-15 13:28:04 UTC (rev 890) +++ libs/lang/trunk/src/prj/net/sf/japi/lang/PropertyComparator.java 2009-02-15 13:28:23 UTC (rev 891) @@ -38,16 +38,24 @@ /** Serial version. */ private static final long serialVersionUID = 1L; - /** The target class. */ + /** The target class. + * @serial include + */ @Nullable private final Class<C> targetClass; - /** The comparator to compare the property value. */ + /** The comparator to compare the property value. + * @serial include + */ @Nullable private final Comparator<T> delegate; - /** The name of the property to get. */ + /** The name of the property to get. + * @serial include + */ @NotNull private final String propertyName; - /** The getter to read the property. */ + /** The getter to read the property. + * @serial include + */ @Nullable private final Method getter; /** Create a PropertyComparator. This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <chr...@us...> - 2009-02-16 03:16:32
|
Revision: 913 http://japi.svn.sourceforge.net/japi/?rev=913&view=rev Author: christianhujer Date: 2009-02-16 03:16:30 +0000 (Mon, 16 Feb 2009) Log Message: ----------- Added documentation about serialization. Modified Paths: -------------- libs/lang/trunk/src/prj/net/sf/japi/lang/PropertyComparator.java Modified: libs/lang/trunk/src/prj/net/sf/japi/lang/PropertyComparator.java =================================================================== --- libs/lang/trunk/src/prj/net/sf/japi/lang/PropertyComparator.java 2009-02-15 23:08:49 UTC (rev 912) +++ libs/lang/trunk/src/prj/net/sf/japi/lang/PropertyComparator.java 2009-02-16 03:16:30 UTC (rev 913) @@ -31,7 +31,8 @@ * @param <T> Property type to compare. * @param <C> Class of which to compare a property. * @author <a href="mailto:ch...@ri...">Christian Hujer</a> - * @todo think whether net.sf.japi.lang really is the correct package or this should rather go to something like net.sf.japi.beans or net.sf.japi.util. + * @todo 2009-02-16:christianhujer:Think whether net.sf.japi.lang really is the correct package or this should rather go to something like net.sf.japi.beans or net.sf.japi.util. + * @todo 2009-02-16:christianhujer:This class is not yet implemented Serializable. */ public class PropertyComparator<T, C> implements Comparator<C>, Serializable { @@ -46,6 +47,8 @@ /** The comparator to compare the property value. * @serial include */ + // If this field cannot be serialized, the default error mechanisms are sufficient and shall apply. + @SuppressWarnings({"NonSerializableFieldInSerializableClass"}) @Nullable private final Comparator<T> delegate; /** The name of the property to get. @@ -56,7 +59,7 @@ /** The getter to read the property. * @serial include */ - @Nullable private final Method getter; + @Nullable private final Method getter; // TODO:2009-02-16:christianhujer:Handle this field. /** Create a PropertyComparator. * @param targetClass The target class of which properties should be compared, maybe <code>null</code> in which case the target class will be evaluated dynamically. This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
[Japi-cvs] SF.net SVN: japi:[1339]
libs/lang/trunk/src/prj/net/sf/japi/lang/ PropertyComparator.java
From: <chr...@us...> - 2009-06-14 09:25:11
|
Revision: 1339 http://japi.svn.sourceforge.net/japi/?rev=1339&view=rev Author: christianhujer Date: 2009-06-14 09:25:09 +0000 (Sun, 14 Jun 2009) Log Message: ----------- Handle serialization of the getter method. Modified Paths: -------------- libs/lang/trunk/src/prj/net/sf/japi/lang/PropertyComparator.java Modified: libs/lang/trunk/src/prj/net/sf/japi/lang/PropertyComparator.java =================================================================== --- libs/lang/trunk/src/prj/net/sf/japi/lang/PropertyComparator.java 2009-06-14 09:20:46 UTC (rev 1338) +++ libs/lang/trunk/src/prj/net/sf/japi/lang/PropertyComparator.java 2009-06-14 09:25:09 UTC (rev 1339) @@ -18,6 +18,8 @@ package net.sf.japi.lang; +import java.io.IOException; +import java.io.ObjectInputStream; import java.io.Serializable; import java.lang.reflect.InvocationTargetException; import java.lang.reflect.Method; @@ -60,7 +62,7 @@ /** The getter to read the property. * @serial include */ - @Nullable private final Method getter; // TODO:2009-02-16:christianhujer:Handle this field. + @Nullable private transient Method getter; /** Create a PropertyComparator. * @param targetClass The target class of which properties should be compared, maybe <code>null</code> in which case the target class will be evaluated dynamically. @@ -75,6 +77,12 @@ } /** {@inheritDoc} */ + private void readObject(@NotNull final ObjectInputStream in) throws ClassNotFoundException, IOException { + in.defaultReadObject(); + getter = targetClass == null ? null : getPropertyGetter(targetClass, propertyName); + } + + /** {@inheritDoc} */ public int compare(final C o1, final C o2) { try { final Method o1Getter = getter != null ? getter : getPropertyGetter(o1.getClass(), propertyName); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |