< prev index next >

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

Print this page

243             }
244             case DeprecatedAttribute _ ->
245                 0;
246             case EnclosingMethodAttribute ema -> {
247                 ema.enclosingClass();
248                 ema.enclosingMethod();
249                 yield 4;
250             }
251             case ExceptionsAttribute ea ->
252                 2 + 2 * ea.exceptions().size();
253             case InnerClassesAttribute ica -> {
254                 for (var ici : ica.classes()) {
255                     if (ici.outerClass().isPresent() && ici.outerClass().get().equals(ici.innerClass())) {
256                         errors.add(new VerifyError("Class is both outer and inner class in %s".formatted(toString(ae))));
257                     }
258                 }
259                 yield 2 + 8 * ica.classes().size();
260             }
261             case LineNumberTableAttribute lta ->
262                 2 + 4 * lta.lineNumbers().size();


263             case LocalVariableTableAttribute lvta ->
264                 2 + 10 * lvta.localVariables().size();
265             case LocalVariableTypeTableAttribute lvta ->
266                 2 + 10 * lvta.localVariableTypes().size();
267             case MethodParametersAttribute mpa ->
268                 1 + 4 * mpa.parameters().size();
269             case ModuleAttribute ma ->
270                 16 + subSize(ma.exports(), ModuleExportInfo::exportsTo, 6, 2)
271                    + subSize(ma.opens(), ModuleOpenInfo::opensTo, 6, 2)
272                    + subSize(ma.provides(), ModuleProvideInfo::providesWith, 4, 2)
273                    + 6 * ma.requires().size()
274                    + 2 * ma.uses().size();
275             case ModuleHashesAttribute mha ->
276                 2 + moduleHashesSize(mha.hashes());
277             case ModuleMainClassAttribute mmca -> {
278                 mmca.mainClass();
279                 yield 2;
280             }
281             case ModulePackagesAttribute mpa ->
282                 2 + 2 * mpa.packages().size();

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