@@ -4094,10 +4094,18 @@ private boolean staticOnly() {
40944094 }
40954095
40964096 private CompletionProposal toProposal (TypeNameMatch typeNameMatch ) {
4097- return toProposal (typeNameMatch .getType (), typeNameMatch .getAccessibility ());
4097+ return toProposal (typeNameMatch .getType (), typeNameMatch .getAccessibility (), typeNameMatch . getModifiers () );
40984098 }
40994099
41004100 private CompletionProposal toProposal (IType type , int access ) {
4101+ try {
4102+ return toProposal (type , access , type .getFlags ());
4103+ } catch (JavaModelException ex ) {
4104+ return toProposal (type , access , 0 );
4105+ }
4106+ }
4107+
4108+ private CompletionProposal toProposal (IType type , int access , int modifiers ) {
41014109 DOMInternalCompletionProposal res = createProposal (CompletionProposal .TYPE_REF );
41024110 char [] simpleName = type .getElementName ().toCharArray ();
41034111 char [] signature = SignatureUtils .createSignature (type ).toCharArray ();
@@ -4172,11 +4180,7 @@ private CompletionProposal toProposal(IType type, int access) {
41724180 } else {
41734181 res .setReplaceRange (this .toComplete .getStartPosition (), this .offset );
41744182 }
4175- try {
4176- res .setFlags (type .getFlags ());
4177- } catch (JavaModelException ex ) {
4178- ILog .get ().error (ex .getMessage (), ex );
4179- }
4183+ res .setFlags (modifiers );
41804184 if (this .toComplete instanceof SimpleName ) {
41814185 res .setTokenRange (this .toComplete .getStartPosition (), this .toComplete .getStartPosition () + this .toComplete .getLength ());
41824186 } else if (this .toComplete instanceof MarkerAnnotation ) {
0 commit comments