258 /** 259 * Returns an array of {@code Class} objects that represent the types 260 * of exceptions declared to be thrown by the underlying constructor 261 * represented by this {@code Constructor} object. Returns an array of 262 * length 0 if the constructor declares no exceptions in its {@code throws} clause. 263 * 264 * @return the exception types declared as being thrown by the 265 * constructor this object represents 266 */ 267 public Class<?>[] getExceptionTypes() { 268 return (Class<?>[])exceptionTypes.clone(); 269 } 270 271 272 /** 273 * Returns an array of {@code Type} objects that represent the 274 * exceptions declared to be thrown by this {@code Constructor} object. 275 * Returns an array of length 0 if the underlying method declares 276 * no exceptions in its {@code throws} clause. 277 * 278 * <p>If an exception type is a parameterized type, the {@code Type} 279 * object returned for it must accurately reflect the actual type 280 * parameters used in the source code. 281 * 282 * <p>If an exception type is a type variable or a parameterized 283 * type, it is created. Otherwise, it is resolved. 284 * 285 * @return an array of Types that represent the exception types 286 * thrown by the underlying method 287 * @throws GenericSignatureFormatError 288 * if the generic method signature does not conform to the format 289 * specified in the Java Virtual Machine Specification, 3rd edition 290 * @throws TypeNotPresentException if the underlying method's 291 * {@code throws} clause refers to a non-existent type declaration 292 * @throws MalformedParameterizedTypeException if 293 * the underlying method's {@code throws} clause refers to a 294 * parameterized type that cannot be instantiated for any reason 295 * @since 1.5 296 */ 297 public Type[] getGenericExceptionTypes() { 298 Type[] result; 299 if (getSignature() != null && 300 ( (result = getGenericInfo().getExceptionTypes()).length > 0 )) 301 return result; | 258 /** 259 * Returns an array of {@code Class} objects that represent the types 260 * of exceptions declared to be thrown by the underlying constructor 261 * represented by this {@code Constructor} object. Returns an array of 262 * length 0 if the constructor declares no exceptions in its {@code throws} clause. 263 * 264 * @return the exception types declared as being thrown by the 265 * constructor this object represents 266 */ 267 public Class<?>[] getExceptionTypes() { 268 return (Class<?>[])exceptionTypes.clone(); 269 } 270 271 272 /** 273 * Returns an array of {@code Type} objects that represent the 274 * exceptions declared to be thrown by this {@code Constructor} object. 275 * Returns an array of length 0 if the underlying method declares 276 * no exceptions in its {@code throws} clause. 277 * 278 * <p>If an exception type is a type variable or a parameterized 279 * type, it is created. Otherwise, it is resolved. 280 * 281 * @return an array of Types that represent the exception types 282 * thrown by the underlying method 283 * @throws GenericSignatureFormatError 284 * if the generic method signature does not conform to the format 285 * specified in the Java Virtual Machine Specification, 3rd edition 286 * @throws TypeNotPresentException if the underlying method's 287 * {@code throws} clause refers to a non-existent type declaration 288 * @throws MalformedParameterizedTypeException if 289 * the underlying method's {@code throws} clause refers to a 290 * parameterized type that cannot be instantiated for any reason 291 * @since 1.5 292 */ 293 public Type[] getGenericExceptionTypes() { 294 Type[] result; 295 if (getSignature() != null && 296 ( (result = getGenericInfo().getExceptionTypes()).length > 0 )) 297 return result; |