meyers8686 / plist

Automatically exported from code.google.com/p/plist
0 stars 0 forks source link

does not run on JRE 5 #10

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
is it possible to compile the lib with "-target 1.5" ?

otherwise it wouldn't run under websphere 6.1 which is unfortunately still 
popular enough...

Original issue reported on code.google.com by maxim....@gmail.com on 18 Jul 2011 at 5:29

GoogleCodeExporter commented 9 years ago
I don't see why not.  It works for me.

Original comment by kei...@alum.mit.edu on 18 Jul 2011 at 6:53

GoogleCodeExporter commented 9 years ago
it compiles, but the following call fails - 

java.lang.NoSuchMethodError: java/util/Arrays.copyOf([BI)[B
    at com.dd.plist.PropertyListParser.parse(PropertyListParser.java:60)
/**
public static byte[] copyOf(byte[] original, int newLength)
Since:
1.6
*/

Original comment by maxim....@gmail.com on 19 Jul 2011 at 8:19

GoogleCodeExporter commented 9 years ago
Ah, I see - that call only happens when calling parse(byte[]), not 
parse(InputStream).  Should be easy to work around.  Have you seen any other 
1.6-isms?  I can parse and unparse files on 1.5 without problems.

Original comment by kei...@alum.mit.edu on 19 Jul 2011 at 2:16

GoogleCodeExporter commented 9 years ago
indeed -
        //byte[] magic = Arrays.copyOf(bytes, 8);
    byte[] magic = new byte[8];
    System.arraycopy(bytes, 0, magic, 0, 8); 

haven't spotted any other 1.6-isms yet

any plans to implement saveAsBinary()?

Original comment by maxim....@gmail.com on 19 Jul 2011 at 2:24

GoogleCodeExporter commented 9 years ago
I've implemented it - see issue #3.  Care to code review it?

Original comment by kei...@alum.mit.edu on 19 Jul 2011 at 6:55

GoogleCodeExporter commented 9 years ago
[deleted comment]
GoogleCodeExporter commented 9 years ago
[deleted comment]
GoogleCodeExporter commented 9 years ago
thanks very much indeed! i was busy messing around with extracting public keys 
from client certificates installed onto iOS devices, therefore late reply

so basically i favor http://c2.com/cgi/wiki?GuardClause
and for the rest it is readable enough methinks

Original comment by maxim....@gmail.com on 21 Jul 2011 at 9:45

Attachments:

GoogleCodeExporter commented 9 years ago
p.s. serializing to a File only is bad bad bad
please make it an OutputStream or something

Original comment by maxim....@gmail.com on 21 Jul 2011 at 9:51

GoogleCodeExporter commented 9 years ago
Let's move this discussion to issue #3 where it belongs.

Original comment by kei...@alum.mit.edu on 22 Jul 2011 at 12:48

GoogleCodeExporter commented 9 years ago
Patch committed, r20.

Original comment by kei...@alum.mit.edu on 22 Jul 2011 at 6:23