--- a/langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/tree/TreeInfo.java Thu Mar 31 11:50:26 2016 -0700
+++ b/langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/tree/TreeInfo.java Thu Mar 31 17:25:58 2016 -0400
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1999, 2015, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 2016, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -1152,7 +1152,8 @@
}
public static boolean isModuleInfo(JCCompilationUnit tree) {
- return tree.sourcefile.isNameCompatible("module-info", JavaFileObject.Kind.SOURCE);
+ return tree.sourcefile.isNameCompatible("module-info", JavaFileObject.Kind.SOURCE)
+ && tree.defs.nonEmpty() && tree.defs.head.hasTag(MODULEDEF);
}
public static JCModuleDecl getModule(JCCompilationUnit t) {