|
|
@ -308,39 +308,45 @@ public class ClassWriter { |
|
|
|
List<StructModuleAttribute.RequiresEntry> requiresEntries = moduleAttribute.requires; |
|
|
|
List<StructModuleAttribute.RequiresEntry> requiresEntries = moduleAttribute.requires; |
|
|
|
if (!requiresEntries.isEmpty()) { |
|
|
|
if (!requiresEntries.isEmpty()) { |
|
|
|
for (StructModuleAttribute.RequiresEntry requires : requiresEntries) { |
|
|
|
for (StructModuleAttribute.RequiresEntry requires : requiresEntries) { |
|
|
|
buffer.appendIndent(1).append("requires ").append(requires.moduleName.replace('/', '.')).append(';').appendLineSeparator(); |
|
|
|
if (!isGenerated(requires.flags)) { |
|
|
|
|
|
|
|
buffer.appendIndent(1).append("requires ").append(requires.moduleName.replace('/', '.')).append(';').appendLineSeparator(); |
|
|
|
|
|
|
|
newLineNeeded = true; |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
newLineNeeded = true; |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
List<StructModuleAttribute.ExportsEntry> exportsEntries = moduleAttribute.exports; |
|
|
|
List<StructModuleAttribute.ExportsEntry> exportsEntries = moduleAttribute.exports; |
|
|
|
if (!exportsEntries.isEmpty()) { |
|
|
|
if (!exportsEntries.isEmpty()) { |
|
|
|
if (newLineNeeded) buffer.appendLineSeparator(); |
|
|
|
if (newLineNeeded) buffer.appendLineSeparator(); |
|
|
|
for (StructModuleAttribute.ExportsEntry exports : exportsEntries) { |
|
|
|
for (StructModuleAttribute.ExportsEntry exports : exportsEntries) { |
|
|
|
buffer.appendIndent(1).append("exports ").append(exports.packageName.replace('/', '.')); |
|
|
|
if (!isGenerated(exports.flags)) { |
|
|
|
List<String> exportToModules = exports.exportToModules; |
|
|
|
buffer.appendIndent(1).append("exports ").append(exports.packageName.replace('/', '.')); |
|
|
|
if (exportToModules.size() > 0) { |
|
|
|
List<String> exportToModules = exports.exportToModules; |
|
|
|
buffer.append(" to").appendLineSeparator(); |
|
|
|
if (exportToModules.size() > 0) { |
|
|
|
appendFQClassNames(buffer, exportToModules); |
|
|
|
buffer.append(" to").appendLineSeparator(); |
|
|
|
|
|
|
|
appendFQClassNames(buffer, exportToModules); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
buffer.append(';').appendLineSeparator(); |
|
|
|
|
|
|
|
newLineNeeded = true; |
|
|
|
} |
|
|
|
} |
|
|
|
buffer.append(';').appendLineSeparator(); |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
newLineNeeded = true; |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
List<StructModuleAttribute.OpensEntry> opensEntries = moduleAttribute.opens; |
|
|
|
List<StructModuleAttribute.OpensEntry> opensEntries = moduleAttribute.opens; |
|
|
|
if (!opensEntries.isEmpty()) { |
|
|
|
if (!opensEntries.isEmpty()) { |
|
|
|
if (newLineNeeded) buffer.appendLineSeparator(); |
|
|
|
if (newLineNeeded) buffer.appendLineSeparator(); |
|
|
|
for (StructModuleAttribute.OpensEntry opens : opensEntries) { |
|
|
|
for (StructModuleAttribute.OpensEntry opens : opensEntries) { |
|
|
|
buffer.appendIndent(1).append("opens ").append(opens.packageName.replace('/', '.')); |
|
|
|
if (!isGenerated(opens.flags)) { |
|
|
|
List<String> opensToModules = opens.opensToModules; |
|
|
|
buffer.appendIndent(1).append("opens ").append(opens.packageName.replace('/', '.')); |
|
|
|
if (opensToModules.size() > 0) { |
|
|
|
List<String> opensToModules = opens.opensToModules; |
|
|
|
buffer.append(" to").appendLineSeparator(); |
|
|
|
if (opensToModules.size() > 0) { |
|
|
|
appendFQClassNames(buffer, opensToModules); |
|
|
|
buffer.append(" to").appendLineSeparator(); |
|
|
|
|
|
|
|
appendFQClassNames(buffer, opensToModules); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
buffer.append(';').appendLineSeparator(); |
|
|
|
|
|
|
|
newLineNeeded = true; |
|
|
|
} |
|
|
|
} |
|
|
|
buffer.append(';').appendLineSeparator(); |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
newLineNeeded = true; |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
List<String> usesEntries = moduleAttribute.uses; |
|
|
|
List<String> usesEntries = moduleAttribute.uses; |
|
|
@ -363,6 +369,10 @@ public class ClassWriter { |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private static boolean isGenerated(int flags) { |
|
|
|
|
|
|
|
return (flags & (CodeConstants.ACC_SYNTHETIC | CodeConstants.ACC_MANDATED)) != 0; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
private static void addTracer(StructClass cls, StructMethod method, BytecodeMappingTracer tracer) { |
|
|
|
private static void addTracer(StructClass cls, StructMethod method, BytecodeMappingTracer tracer) { |
|
|
|
StructLineNumberTableAttribute table = method.getAttribute(StructGeneralAttribute.ATTRIBUTE_LINE_NUMBER_TABLE); |
|
|
|
StructLineNumberTableAttribute table = method.getAttribute(StructGeneralAttribute.ATTRIBUTE_LINE_NUMBER_TABLE); |
|
|
|
tracer.setLineNumberTable(table); |
|
|
|
tracer.setLineNumberTable(table); |
|
|
@ -1266,4 +1276,4 @@ public class ClassWriter { |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |