src/share/classes/java/lang/reflect/Executable.java

Print this page




 309         final Parameter[] out = new Parameter[realparams];
 310         for (int i = 0; i < realparams; i++)
 311             // TODO: is there a way to synthetically derive the
 312             // modifiers?  Probably not in the general case, since
 313             // we'd have no way of knowing about them, but there
 314             // may be specific cases.
 315             out[i] = new Parameter("arg" + i, 0, this, i);
 316         return out;
 317     }
 318 
 319     private Parameter[] privateGetParameters() {
 320         // Use tmp to avoid multiple writes to a volatile.
 321         Parameter[] tmp = parameters;
 322 
 323         if (tmp == null) {
 324 
 325             // Otherwise, go to the JVM to get them
 326             tmp = getParameters0();
 327 
 328             // If we get back nothing, then synthesize parameters
 329             if (tmp == null)

 330                 tmp = synthesizeAllParams();



 331 
 332             parameters = tmp;
 333         }
 334 
 335         return tmp;
 336     }
 337 










 338     private transient volatile Parameter[] parameters;
 339 
 340     private native Parameter[] getParameters0();
 341 
 342     /**
 343      * Returns an array of {@code Class} objects that represent the
 344      * types of exceptions declared to be thrown by the underlying
 345      * executable represented by this object.  Returns an array of
 346      * length 0 if the executable declares no exceptions in its {@code
 347      * throws} clause.
 348      *
 349      * @return the exception types declared as being thrown by the
 350      * executable this object represents
 351      */
 352     public abstract Class<?>[] getExceptionTypes();
 353 
 354     /**
 355      * Returns an array of {@code Type} objects that represent the
 356      * exceptions declared to be thrown by this executable object.
 357      * Returns an array of length 0 if the underlying executable declares




 309         final Parameter[] out = new Parameter[realparams];
 310         for (int i = 0; i < realparams; i++)
 311             // TODO: is there a way to synthetically derive the
 312             // modifiers?  Probably not in the general case, since
 313             // we'd have no way of knowing about them, but there
 314             // may be specific cases.
 315             out[i] = new Parameter("arg" + i, 0, this, i);
 316         return out;
 317     }
 318 
 319     private Parameter[] privateGetParameters() {
 320         // Use tmp to avoid multiple writes to a volatile.
 321         Parameter[] tmp = parameters;
 322 
 323         if (tmp == null) {
 324 
 325             // Otherwise, go to the JVM to get them
 326             tmp = getParameters0();
 327 
 328             // If we get back nothing, then synthesize parameters
 329             if (tmp == null) {
 330                 hasRealParameterData = false;
 331                 tmp = synthesizeAllParams();
 332             } else {
 333                 hasRealParameterData = true;
 334             }
 335 
 336             parameters = tmp;
 337         }
 338 
 339         return tmp;
 340     }
 341 
 342     boolean hasRealParameterData() {
 343         // If this somehow gets called before parameters gets
 344         // initialized, force it into existence.
 345         if (parameters == null)
 346             privateGetParameters();
 347 
 348         return hasRealParameterData;
 349     }
 350 
 351     private boolean hasRealParameterData;
 352     private transient volatile Parameter[] parameters;
 353 
 354     private native Parameter[] getParameters0();
 355 
 356     /**
 357      * Returns an array of {@code Class} objects that represent the
 358      * types of exceptions declared to be thrown by the underlying
 359      * executable represented by this object.  Returns an array of
 360      * length 0 if the executable declares no exceptions in its {@code
 361      * throws} clause.
 362      *
 363      * @return the exception types declared as being thrown by the
 364      * executable this object represents
 365      */
 366     public abstract Class<?>[] getExceptionTypes();
 367 
 368     /**
 369      * Returns an array of {@code Type} objects that represent the
 370      * exceptions declared to be thrown by this executable object.
 371      * Returns an array of length 0 if the underlying executable declares