tim1004457 / simple

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

JDK 6 methods usage vs Android's JDK 5 #2

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
I've found the usage of several methods introduced in JDK 6, but AFAIK
Android 1.5 contains JDK 5.

1. String(byte[],Charset) at com.google.devtools.simple.util.Files:91:
return new String(data, Charset.forName(encoding));
2. String.getBytes(String) at
com.google.devtools.simple.classfiles.ConstantPool:345:
this.string = string.getBytes(Charset.forName("UTF-8"));
3. String.isEmpty() at com.google.devtools.simple.compiler.Compiler:423:
if (keyLocation != null && !keyLocation.isEmpty()) {

Btw, it is not an issue until Simple compiler is not intended to run on
Android platform.

But in build.xml:153 I see that runtime itself is compiled for 1.6. So,
compiler will not protect us from JDK 6 methods' usage in runtime. And it
potentially leads to runtime errors on target platform.

    <target name="SimpleAndroidRuntime" depends="init" description="Build
Simple runtime libraries">
        <javac debug="true" destdir="${build.simpleruntime.android}"
source="1.6" target="1.6">

Original issue reported on code.google.com by demakov@gmail.com on 29 Jul 2009 at 6:22

GoogleCodeExporter commented 8 years ago
The compiler is not intended to run on Android or any other platform that 
doesn't support JDK 1.6.

Compiling the Simple for Android runtime on the other hand should indeed use 
1.5 rather than 1.6. I have committed a change for this.

Thanks for pointing this out!

Original comment by simpleco...@gmail.com on 29 Jul 2009 at 8:26