langtools/test/tools/javac/MethodParametersTest.java
changeset 24604 7f68545b5128
parent 16307 3027c91f329a
child 30730 d3ce7619db2c
equal deleted inserted replaced
24603:43e7e44d63da 24604:7f68545b5128
     1 /*
     1 /*
     2  * Copyright (c) 2012, 2013, Oracle and/or its affiliates. All rights reserved.
     2  * Copyright (c) 2012, 2014, Oracle and/or its affiliates. All rights reserved.
     3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
     3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
     4  *
     4  *
     5  * This code is free software; you can redistribute it and/or modify it
     5  * This code is free software; you can redistribute it and/or modify it
     6  * under the terms of the GNU General Public License version 2 only, as
     6  * under the terms of the GNU General Public License version 2 only, as
     7  * published by the Free Software Foundation.
     7  * published by the Free Software Foundation.
   127         pw.close();
   127         pw.close();
   128         final String out = sw.toString();
   128         final String out = sw.toString();
   129         if (out.length() > 0)
   129         if (out.length() > 0)
   130             System.err.println(out);
   130             System.err.println(out);
   131 
   131 
   132         // Now get the class reader, construct a name for Baz, and load it.
   132         // Now get the class finder, construct a name for Baz, and load it.
   133         com.sun.tools.javac.jvm.ClassReader cr =
   133         com.sun.tools.javac.code.ClassFinder cf =
   134             com.sun.tools.javac.jvm.ClassReader.instance(context);
   134             com.sun.tools.javac.code.ClassFinder.instance(context);
   135         Name name = Names.instance(context).fromString(Baz_name);
   135         Name name = Names.instance(context).fromString(Baz_name);
   136 
   136 
   137         // Now walk down the language model and check the name of the
   137         // Now walk down the language model and check the name of the
   138         // parameter.
   138         // parameter.
   139         final Element baz = cr.loadClass(name);
   139         final Element baz = cf.loadClass(name);
   140         for (Element e : baz.getEnclosedElements()) {
   140         for (Element e : baz.getEnclosedElements()) {
   141             if (e instanceof ExecutableElement) {
   141             if (e instanceof ExecutableElement) {
   142                 final ExecutableElement ee = (ExecutableElement) e;
   142                 final ExecutableElement ee = (ExecutableElement) e;
   143                 final List<? extends VariableElement> params =
   143                 final List<? extends VariableElement> params =
   144                     ee.getParameters();
   144                     ee.getParameters();