Source:
protected void checkAndSetModifiersForField(FieldBinding fieldBinding, FieldDeclaration fieldDecl) { int modifiers = fieldBinding.modifiers; final ReferenceBinding declaringClass = fieldBinding.declaringClass; if ((modifiers & ExtraCompilerModifiers.AccAlternateModifierProblem) != 0) { problemReporter().duplicateModifierForField(declaringClass, fieldDecl); } if (isTrait()) { final int unexpectedModifiers = ~(ClassFileConstants.AccPublic | ClassFileConstants.AccPrivate | ClassFileConstants.AccFinal | ClassFileConstants.AccStatic | ClassFileConstants.AccTransient | ClassFileConstants.AccVolatile); int realModifiers = modifiers & ExtraCompilerModifiers.AccJustFlag; if ((realModifiers & unexpectedModifiers) != 0) { problemReporter().illegalModifierForField(declaringClass, fieldDecl); modifiers &= ~ExtraCompilerModifiers.AccJustFlag | ~unexpectedModifiers; } int accessorBits = realModifiers & (ClassFileConstants.AccPublic | ClassFileConstants.AccPrivate); if ((accessorBits & (accessorBits - 1)) > 1) { problemReporter().illegalVisibilityModifierCombinationForField(declaringClass, fieldDecl); if ((accessorBits & ClassFileConstants.AccPublic) != 0) { if ((accessorBits & ClassFileConstants.AccPrivate) != 0) { modifiers &= ~ClassFileConstants.AccPrivate; } } else if ((accessorBits & ClassFileConstants.AccProtected) != 0 && (accessorBits & ClassFileConstants.AccPrivate) != 0) { modifiers &= ~ClassFileConstants.AccPrivate; } } if ((realModifiers & (ClassFileConstants.AccFinal | ClassFileConstants.AccVolatile)) == (ClassFileConstants.AccFinal | ClassFileConstants.AccVolatile)) { problemReporter().illegalModifierCombinationFinalVolatileForField(declaringClass, fieldDecl); } if (fieldDecl.initialization == null && (modifiers & ClassFileConstants.AccFinal) != 0) { modifiers |= ExtraCompilerModifiers.AccBlankFinal; } fieldBinding.modifiers = modifiers; } else { super.checkAndSetModifiersForField(fieldBinding, fieldDecl); } }

Target:
protected void checkAndSetModifiersForField(FieldBinding fieldBinding, FieldDeclaration fieldDecl) { if (isTrait()) { int modifiers = fieldBinding.modifiers; final ReferenceBinding declaringClass = fieldBinding.declaringClass; if ((modifiers & ExtraCompilerModifiers.AccAlternateModifierProblem) != 0) { problemReporter().duplicateModifierForField(declaringClass, fieldDecl); } final int unexpectedModifiers = ~(ClassFileConstants.AccPublic | ClassFileConstants.AccPrivate | ClassFileConstants.AccFinal | ClassFileConstants.AccStatic | ClassFileConstants.AccTransient | ClassFileConstants.AccVolatile); int realModifiers = modifiers & ExtraCompilerModifiers.AccJustFlag; if ((realModifiers & unexpectedModifiers) != 0) { problemReporter().illegalModifierForField(declaringClass, fieldDecl); modifiers &= ~ExtraCompilerModifiers.AccJustFlag | ~unexpectedModifiers; } int accessorBits = realModifiers & (ClassFileConstants.AccPublic | ClassFileConstants.AccPrivate); if ((accessorBits & (accessorBits - 1)) > 1) { problemReporter().illegalVisibilityModifierCombinationForField(declaringClass, fieldDecl); if ((accessorBits & ClassFileConstants.AccPublic) != 0) { if ((accessorBits & ClassFileConstants.AccPrivate) != 0) { modifiers &= ~ClassFileConstants.AccPrivate; } } else if ((accessorBits & ClassFileConstants.AccProtected) != 0 && (accessorBits & ClassFileConstants.AccPrivate) != 0) { modifiers &= ~ClassFileConstants.AccPrivate; } } if ((realModifiers & (ClassFileConstants.AccFinal | ClassFileConstants.AccVolatile)) == (ClassFileConstants.AccFinal | ClassFileConstants.AccVolatile)) { problemReporter().illegalModifierCombinationFinalVolatileForField(declaringClass, fieldDecl); } if (fieldDecl.initialization == null && (modifiers & ClassFileConstants.AccFinal) != 0) { modifiers |= ExtraCompilerModifiers.AccBlankFinal; } fieldBinding.modifiers = modifiers; } else { super.checkAndSetModifiersForField(fieldBinding, fieldDecl); } }