PofAnnotations in 3.7.1

I built a bunch of tests for PofAnnotations, looks really good.
Couple of small issues :
Setter problem_
If you run the sample in the documentation with just
@PortableProperty public String getSampleString() { return sampleString; }You get the following error :
An error occurred in discovering the compliment of method = public java.lang.String com.rbs.hpc.incubator.newPof.PofSampleObj.getSampleString(),
assuming compliment method name is setSampleString) java.lang.NoSuchMethodException: com.rbs.hpc.incubator.newPof.PofSampleObj.setSampleString(java.lang.String)Note there is a bracket missing in this message (I'm a pedant).
Once you put the setter in everything is ok, but I think you may want to support readOnly methods.
Array problem*
@PortableProperty public PofSampleObj[] sampleArray;
Can not set [Lcom.rbs.hpc.incubator.newPof.PofSampleObj; field com.rbs.hpc.incubator.newPof.PofSampleObj.sampleArray to [Ljava.lang.Object;
at sun.reflect.UnsafeFieldAccessorImpl.throwSetIllegalArgumentException(UnsafeFieldAccessorImpl.java:146)Only supports type of Object - should support typed arrays.
Collection Type*+
These come back as com.tangosol.util.ImmutableArrayList$ListView which is an Inner private class rather than the ArrayList I passed in. This isn't necessarily a problem, but causes my equals method to blow up ;-) HashMap comes back nicely as HashMap for Map types...
pof-config.xml documentation issue*
http://docs.oracle.com/cd/E24290_01/coh.371/e22837/api_pof.htm#BABGDHED
This code runs fine, but the XSD complains. I think the XSD should be fixed :
                <init-param>
                   <param-type>class</param-type>
                   <param-value>{class}</param-value>
                </init-param>
Requires
                <init-param>
                   <param-type>java.lang.Class</param-type>
                   <param-value>{class}</param-value>
                </init-param>
Simplifying config*
We certainly want to use the auto-config going forward. Rather than having to specify the Serializer, Type, Class and Boolean for each class we'd just like a boolean at the top
eg. useAutoConfig="true"
That will make things much easier.
POF Domains / C# support*
Obviously we'd like this in the future.
Really nice piece of work guys. I'm happy to raise this as an SR if it helps...
Best, Andrew.

Hey Andrew,
RE: Setter Problem - thanks for finding this, its extremely useful that you provide that feedback for what many people would simply side-step. thanks!
RE: Array Problem - ah, deffo bug. In the interim you could provide a Codec implementation such as below. This can be used uniformly for all arrays:
     * Workaround for incorrect array component casting.
     * @author hr
    public class ObjectArrayCodec
            implements Codec
        // ----- Codec methods ----------------------------------------------
         * {@inheritDoc}
        @Override
        public Object decode(PofReader in, int iProp) throws IOException
            Object[] aoProperty = in.readObjectArray(iProp, new Object[0]);
            if (aoProperty.length == 0)
                return null;
            Class<?> clz = aoProperty[0].getClass();
            Object   ao  = Array.newInstance(clz, aoProperty.length);
            System.arraycopy(aoProperty, 0, ao, 0, aoProperty.length);
            return ao;
         * {@inheritDoc}
        @Override
        public void encode(PofWriter out, int iProp, Object value) throws IOException
            out.writeObjectArray(iProp, (Object[]) value);
        }RE: Collection Type, this was the main driver in introducing Codecs. Alternatively you could register a serializer against List which would always instantiate and return an ArrayList if you wanted to make the sweeping assumption, otherwise its a codec for each property. Out of interest do you see any benefit in a "defaults" for codecs, i.e. for all List.class types use ArrayListCodec?
RE: XSD, i'll take a look.
RE: Simplifying config, completely agree that the ~8 lines of xml to say 0 || 1 is overkill :) When we extend the auto-indexing functionality we will hopefully / eventually invert the current default.
RE: POF Domains, its definitely on the list - its pretty long list tho ;)
Cheers,
Harvey

Similar Messages

Maybe you are looking for

  • AVReceive2 and AVTransmit2 not work the same...HELP

    I am using AVReceive2 and AVTranmit2 in a programs I am developing. I have run the two programs as the standalones they are and I get the video or audio I send across. But in my program when the program calls up the routines it launches and only does

  • Print multiple page ranges based on radio button group choices

    Hi ... I have a PDF that is a combined application form made up of 6 separate forms. On the front page, I have 6 groups of "Yes / No" radio buttons. If the radio button for one or more of these groups is selected as "Yes" then when the Print button (

  • With iCloud Keychain, no automatic password suggestion

    Today I activated iCloud Keychain on my Mac and my iPhone. The system is generally working as it is supposed to, with one exception. On many sites (for example: outlook.com and yahoo.com), Keychain will not suggest a password. Is it because these sit

  • Google map in internet explorer

    anybody out there that can help me embed a google map using dreamweaver cs4 that will display correctly in internet explorer? or any map for that matter! Running dreamweaver cs4 on a G5 imac

  • IMac won't boot 10.6.4 but will Windows 7

    Was playing a game on Windows 7 via Bootcamp. I restarted, and my iMac took an age to get to a blue screen on my Mac partition and then hung. Reset the PRAM, rebooted and then it got to the Snow Leopard screen, but I couldn't select either of the use