Skip to content
This repository has been archived by the owner on Aug 11, 2020. It is now read-only.

Commit

Permalink
Add support for java 7 classfiles.
Browse files Browse the repository at this point in the history
  • Loading branch information
jsirois committed Sep 18, 2012
1 parent 130388e commit d3a10b1
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 6 deletions.
5 changes: 4 additions & 1 deletion src/com/sun/tools/jmake/ClassFileReader.java
Expand Up @@ -26,6 +26,7 @@ public class ClassFileReader extends BinaryFileReader {
public static final int JDK14_MAJOR_VERSION = 48;
public static final int JDK15_MAJOR_VERSION = 49;
public static final int JDK16_MAJOR_VERSION = 50;
public static final int JDK17_MAJOR_VERSION = 51;
public static final int CONSTANT_Utf8 = 1;
public static final int CONSTANT_Unicode = 2;
public static final int CONSTANT_Integer = 3;
Expand Down Expand Up @@ -71,7 +72,9 @@ private void readPreamble() {
if (majorVersion > JDK14_MAJOR_VERSION ||
versionWord(majorVersion, minorVersion) <
versionWord(JAVA_MIN_MAJOR_VERSION, JAVA_MIN_MINOR_VERSION) ) {
if (majorVersion == JDK16_MAJOR_VERSION) {
if (majorVersion == JDK17_MAJOR_VERSION) {
classInfo.javacTargetRelease = Utils.JAVAC_TARGET_RELEASE_17;
} else if (majorVersion == JDK16_MAJOR_VERSION) {
classInfo.javacTargetRelease = Utils.JAVAC_TARGET_RELEASE_16;
} else if (majorVersion == JDK15_MAJOR_VERSION) {
classInfo.javacTargetRelease = Utils.JAVAC_TARGET_RELEASE_15;
Expand Down
10 changes: 5 additions & 5 deletions src/com/sun/tools/jmake/Utils.java
Expand Up @@ -6,15 +6,14 @@
*/
package com.sun.tools.jmake;

import java.util.zip.ZipFile;
import java.util.zip.ZipEntry;

import java.io.PrintStream;
import java.io.File;
import java.io.FileInputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.io.FileInputStream;
import java.io.PrintStream;
import java.util.zip.ZipEntry;
import java.util.zip.ZipFile;

/**
* Utility functions used by other classes from this package.
Expand All @@ -34,6 +33,7 @@ public class Utils {
static final int JAVAC_TARGET_RELEASE_OLDEST = 0x01040000; // 1.4 and previous versions
static final int JAVAC_TARGET_RELEASE_15 = 0x01050000; // if class is compiled with -target 1.5
static final int JAVAC_TARGET_RELEASE_16 = 0x01060000; // if class is compiled with -target 1.6
static final int JAVAC_TARGET_RELEASE_17 = 0x01070000; // if class is compiled with -target 1.7
static int warningLimit = 20; // Maximum number of warnings to print
static final int TIMING_TOTAL = 0;
static final int TIMING_PDBREAD = 1;
Expand Down

0 comments on commit d3a10b1

Please sign in to comment.