Kaydet (Commit) 26643fb5 authored tarafından Michael Stahl's avatar Michael Stahl

codemaker: write version 49 (1.5) class files

The trick of writing generic types into class files of versions < 49
does no longer work with javac from OpenJDK 7:

/comphelper/qa/complex/comphelper/Map.java:154: error: type Pair does
not take parameters
  Pair< ?, ? >[] initialMappings = new Pair< ?, ? >[ _keys.length ];

There appears to be a related JDK bug for this, at some time javac had
an undocumented option to produce similar class files that are also
rejected now, this has been closed as "Not a Defect":

http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=7078419

Change-Id: I8a504f6cbb3bb58cd914aebb88637cc6feb0bd48
üst e81f0279
......@@ -693,7 +693,7 @@ void ClassFile::addMethod(
void ClassFile::write(FileStream & file) const {
writeU4(file, 0xCAFEBABE);
writeU2(file, 0);
writeU2(file, 46);
writeU2(file, 49); // class file version of JRE 1.5
writeU2(file, m_constantPoolCount);
writeStream(file, m_constantPool);
writeU2(file, static_cast< sal_uInt16 >(m_accessFlags));
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment