Polish "Ensure indexer gracefully handle missing meta annotations"

Closes gh-22385
This commit is contained in:
Stephane Nicoll
2019-02-14 10:16:32 +01:00
parent 87e5f0db01
commit 0cc77e812c
2 changed files with 6 additions and 2 deletions

View File

@@ -114,7 +114,8 @@ class TypeHelper {
try {
return this.env.getElementUtils().getAllAnnotationMirrors(e);
}
catch (Throwable ex) {
catch (Exception ex) {
// This may fail if one of the annotation is not available
return Collections.emptyList();
}
}

View File

@@ -19,9 +19,12 @@ package org.springframework.context.index.sample.cdi;
import javax.transaction.Transactional;
/**
* Test candidate for {@link Transactional}.
* Test candidate for {@link Transactional}. This verifies that the annotation processor
* can process an annotation that declares itself an annotation that is not on the
* classpath.
*
* @author Vedran Pavic
* @author Stephane Nicoll
*/
@Transactional
public class SampleTransactional {