Author: hdu
Date: Mon Feb 25 08:53:56 2013
New Revision: 1449622

URL: http://svn.apache.org/r1449622
Log:
#i121098# use a classfile format compatible with at least JDK 5/6/7

According to http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=7078419
JDK 7 and up will never support classfile formats 48 or earlier because
they lack generic signature attributes. Our current baseline is JDK 5
anyway which has the classfile format 49
(see e.g. http://en.wikipedia.org/wiki/Java_class_file or the JVM spec)

Suggested by: Pedro Giffuni <p...@apache.org>

Modified:
    openoffice/trunk/main/codemaker/source/javamaker/classfile.cxx

Modified: openoffice/trunk/main/codemaker/source/javamaker/classfile.cxx
URL: 
http://svn.apache.org/viewvc/openoffice/trunk/main/codemaker/source/javamaker/classfile.cxx?rev=1449622&r1=1449621&r2=1449622&view=diff
==============================================================================
--- openoffice/trunk/main/codemaker/source/javamaker/classfile.cxx (original)
+++ openoffice/trunk/main/codemaker/source/javamaker/classfile.cxx Mon Feb 25 
08:53:56 2013
@@ -692,10 +692,12 @@ void ClassFile::addMethod(
     appendSignatureAttribute(m_methods, signature);
 }
 
+#define CLASSFILE_FMT 49.0 // a classfile format understood by JDK 5/6/7
+
 void ClassFile::write(FileStream & file) const {
     writeU4(file, 0xCAFEBABE);
-    writeU2(file, 0);
-    writeU2(file, 46);
+    writeU2(file, 
static_cast<sal_uInt16>((CLASSFILE_FMT-(int)CLASSFILE_FMT)*100000));
+    writeU2(file, static_cast<sal_uInt16>((int)CLASSFILE_FMT));
     writeU2(file, m_constantPoolCount);
     writeStream(file, m_constantPool);
     writeU2(file, static_cast< sal_uInt16 >(m_accessFlags));


Reply via email to