< prev index next >

src/java.base/share/classes/jdk/internal/classfile/impl/verifier/ParserVerifier.java

Print this page

232             }
233             case DeprecatedAttribute _ ->
234                 0;
235             case EnclosingMethodAttribute ema -> {
236                 ema.enclosingClass();
237                 ema.enclosingMethod();
238                 yield 4;
239             }
240             case ExceptionsAttribute ea ->
241                 2 + 2 * ea.exceptions().size();
242             case InnerClassesAttribute ica -> {
243                 for (var ici : ica.classes()) {
244                     if (ici.outerClass().isPresent() && ici.outerClass().get().equals(ici.innerClass())) {
245                         errors.add(new VerifyError("Class is both outer and inner class in %s".formatted(toString(ae))));
246                     }
247                 }
248                 yield 2 + 8 * ica.classes().size();
249             }
250             case LineNumberTableAttribute lta ->
251                 2 + 4 * lta.lineNumbers().size();


252             case LocalVariableTableAttribute lvta ->
253                 2 + 10 * lvta.localVariables().size();
254             case LocalVariableTypeTableAttribute lvta ->
255                 2 + 10 * lvta.localVariableTypes().size();
256             case MethodParametersAttribute mpa ->
257                 1 + 4 * mpa.parameters().size();
258             case ModuleAttribute ma ->
259                 16 + subSize(ma.exports(), ModuleExportInfo::exportsTo, 6, 2)
260                    + subSize(ma.opens(), ModuleOpenInfo::opensTo, 6, 2)
261                    + subSize(ma.provides(), ModuleProvideInfo::providesWith, 4, 2)
262                    + 6 * ma.requires().size()
263                    + 2 * ma.uses().size();
264             case ModuleHashesAttribute mha ->
265                 2 + moduleHashesSize(mha.hashes());
266             case ModuleMainClassAttribute mmca -> {
267                 mmca.mainClass();
268                 yield 2;
269             }
270             case ModulePackagesAttribute mpa ->
271                 2 + 2 * mpa.packages().size();

232             }
233             case DeprecatedAttribute _ ->
234                 0;
235             case EnclosingMethodAttribute ema -> {
236                 ema.enclosingClass();
237                 ema.enclosingMethod();
238                 yield 4;
239             }
240             case ExceptionsAttribute ea ->
241                 2 + 2 * ea.exceptions().size();
242             case InnerClassesAttribute ica -> {
243                 for (var ici : ica.classes()) {
244                     if (ici.outerClass().isPresent() && ici.outerClass().get().equals(ici.innerClass())) {
245                         errors.add(new VerifyError("Class is both outer and inner class in %s".formatted(toString(ae))));
246                     }
247                 }
248                 yield 2 + 8 * ica.classes().size();
249             }
250             case LineNumberTableAttribute lta ->
251                 2 + 4 * lta.lineNumbers().size();
252             case LoadableDescriptorsAttribute lda ->
253                 2 + 2 * lda.loadableDescriptors().size();
254             case LocalVariableTableAttribute lvta ->
255                 2 + 10 * lvta.localVariables().size();
256             case LocalVariableTypeTableAttribute lvta ->
257                 2 + 10 * lvta.localVariableTypes().size();
258             case MethodParametersAttribute mpa ->
259                 1 + 4 * mpa.parameters().size();
260             case ModuleAttribute ma ->
261                 16 + subSize(ma.exports(), ModuleExportInfo::exportsTo, 6, 2)
262                    + subSize(ma.opens(), ModuleOpenInfo::opensTo, 6, 2)
263                    + subSize(ma.provides(), ModuleProvideInfo::providesWith, 4, 2)
264                    + 6 * ma.requires().size()
265                    + 2 * ma.uses().size();
266             case ModuleHashesAttribute mha ->
267                 2 + moduleHashesSize(mha.hashes());
268             case ModuleMainClassAttribute mmca -> {
269                 mmca.mainClass();
270                 yield 2;
271             }
272             case ModulePackagesAttribute mpa ->
273                 2 + 2 * mpa.packages().size();
< prev index next >