diff options
author | Herbert Dürr <hdu@apache.org> | 2013-02-25 07:53:56 +0000 |
---|---|---|
committer | Herbert Dürr <hdu@apache.org> | 2013-02-25 07:53:56 +0000 |
commit | 4e4dec8630e67f717c0fb968435cd5e1d85d9965 (patch) | |
tree | bde81b956d82331129878512795c01c78b6a55e0 /codemaker | |
parent | 1bfae56dd9d633a80924bfeefc03368100d75a8f (diff) |
#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 <pfg@apache.org>
Notes
Notes:
prefer: 26643fb59e0005f0bc83708b785d20d62d8e7411
Diffstat (limited to 'codemaker')
-rw-r--r-- | codemaker/source/javamaker/classfile.cxx | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/codemaker/source/javamaker/classfile.cxx b/codemaker/source/javamaker/classfile.cxx index f824eb25f5eb..1f154c775fd3 100644 --- a/codemaker/source/javamaker/classfile.cxx +++ b/codemaker/source/javamaker/classfile.cxx @@ -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)); |