@@ -75,70 +75,41 @@ trait HasFlags {
75
75
* flag carrying entity.
76
76
*/
77
77
def resolveOverloadedFlag (flag : Long ): String = Flags .flagToString(flag)
78
-
79
- def privateWithinString = if (hasAccessBoundary) privateWithin.toString else " "
80
-
81
- protected def isSetting (f : Long , mask : Long ) = ! hasFlag(f) && ((mask & f) != 0L )
82
- protected def isClearing (f : Long , mask : Long ) = hasFlag(f) && ((mask & f) != 0L )
83
78
84
79
// Tests which come through cleanly: both Symbol and Modifiers use these
85
80
// identically, testing for a single flag.
86
- def isCase = hasFlag(CASE )
87
- def isFinal = hasFlag(FINAL )
88
- def isImplicit = hasFlag(IMPLICIT )
89
- def isLazy = hasFlag(LAZY )
90
- def isMutable = hasFlag(MUTABLE ) // in Modifiers, formerly isVariable
91
- def isOverride = hasFlag(OVERRIDE )
92
- def isPrivate = hasFlag(PRIVATE )
93
- def isProtected = hasFlag(PROTECTED )
94
- def isSynthetic = hasFlag(SYNTHETIC )
95
- def isInterface = hasFlag(INTERFACE )
96
-
97
- // Newly introduced based on having a reasonably obvious clean translation.
98
- def isPrivateLocal = hasAllFlags(PrivateLocal )
99
- def isProtectedLocal = hasAllFlags(ProtectedLocal )
100
- def isParamAccessor = hasFlag(PARAMACCESSOR )
101
- def isCaseAccessor = hasFlag(CASEACCESSOR )
102
- def isSuperAccessor = hasFlag(SUPERACCESSOR )
103
- def isLifted = hasFlag(LIFTED )
104
-
105
- // Formerly the Modifiers impl did not include the access boundary check,
106
- // which must have been a bug.
107
- def isPublic = hasNoFlags(PRIVATE | PROTECTED ) && ! hasAccessBoundary
108
-
109
- // Removed isClass qualification since the flag isn't overloaded and
110
- // sym.isClass is enforced in Namers#validate.
111
- def isSealed = hasFlag(SEALED )
112
-
113
- // Removed !isClass qualification since the flag isn't overloaded.
114
- def isDeferred = hasFlag(DEFERRED )
115
-
116
- // Dropped isTerm condition because flag isn't overloaded.
81
+ def hasAbstractFlag = hasFlag(ABSTRACT )
82
+ def hasAccessorFlag = hasFlag(ACCESSOR )
83
+ def hasDefault = hasAllFlags(DEFAULTPARAM | PARAM )
84
+ def hasLocalFlag = hasFlag(LOCAL )
85
+ def hasModuleFlag = hasFlag(MODULE )
86
+ def hasPackageFlag = hasFlag(PACKAGE )
87
+ def hasStableFlag = hasFlag(STABLE )
88
+ def hasStaticFlag = hasFlag(STATIC )
117
89
def isAbstractOverride = hasFlag(ABSOVERRIDE )
118
- def isAnyOverride = hasFlag(OVERRIDE | ABSOVERRIDE )
119
-
120
- // Disambiguating: DEFAULTPARAM, TRAIT
121
- def hasDefault = hasAllFlags(DEFAULTPARAM | PARAM )
122
- def isTrait = hasFlag(TRAIT ) && ! hasFlag(PARAM )
123
-
124
- // Straightforwardly named accessors already being used differently.
125
- // These names are most likely temporary.
126
- def hasAbstractFlag = hasFlag(ABSTRACT )
127
- def hasAccessorFlag = hasFlag(ACCESSOR )
128
- def hasLocalFlag = hasFlag(LOCAL )
129
- def hasModuleFlag = hasFlag(MODULE )
130
- def hasPackageFlag = hasFlag(PACKAGE )
131
- def hasStableFlag = hasFlag(STABLE )
132
- def hasStaticFlag = hasFlag(STATIC )
133
-
134
- // Disambiguating: LABEL, CONTRAVARIANT, INCONSTRUCTOR
135
- def isLabel = hasAllFlags(LABEL | METHOD ) && ! hasAccessorFlag
136
- // Cannot effectively disambiguate the others at this level.
137
- def hasContravariantFlag = hasFlag(CONTRAVARIANT )
138
- def hasInConstructorFlag = hasFlag(INCONSTRUCTOR )
139
-
140
- // Name
141
- def isJavaDefined = hasFlag(JAVA )
90
+ def isAnyOverride = hasFlag(OVERRIDE | ABSOVERRIDE )
91
+ def isCase = hasFlag(CASE )
92
+ def isCaseAccessor = hasFlag(CASEACCESSOR )
93
+ def isDeferred = hasFlag(DEFERRED )
94
+ def isFinal = hasFlag(FINAL )
95
+ def isImplicit = hasFlag(IMPLICIT )
96
+ def isInterface = hasFlag(INTERFACE )
97
+ def isJavaDefined = hasFlag(JAVA )
98
+ def isLabel = hasAllFlags(LABEL | METHOD ) && ! hasAccessorFlag
99
+ def isLazy = hasFlag(LAZY )
100
+ def isLifted = hasFlag(LIFTED )
101
+ def isMutable = hasFlag(MUTABLE )
102
+ def isOverride = hasFlag(OVERRIDE )
103
+ def isParamAccessor = hasFlag(PARAMACCESSOR )
104
+ def isPrivate = hasFlag(PRIVATE )
105
+ def isPrivateLocal = hasAllFlags(PrivateLocal )
106
+ def isProtected = hasFlag(PROTECTED )
107
+ def isProtectedLocal = hasAllFlags(ProtectedLocal )
108
+ def isPublic = hasNoFlags(PRIVATE | PROTECTED ) && ! hasAccessBoundary
109
+ def isSealed = hasFlag(SEALED )
110
+ def isSuperAccessor = hasFlag(SUPERACCESSOR )
111
+ def isSynthetic = hasFlag(SYNTHETIC )
112
+ def isTrait = hasFlag(TRAIT ) && ! hasFlag(PARAM )
142
113
143
114
def flagBitsToString (bits : Long ): String = {
144
115
// Fast path for common case
@@ -162,7 +133,7 @@ trait HasFlags {
162
133
}
163
134
164
135
def accessString : String = {
165
- val pw = privateWithinString
136
+ val pw = if (hasAccessBoundary) privateWithin.toString else " "
166
137
167
138
if (pw == " " ) {
168
139
if (hasAllFlags(PrivateLocal )) " private[this]"
@@ -188,8 +159,6 @@ trait HasFlags {
188
159
def hasTraitFlag = hasFlag(TRAIT )
189
160
@ deprecated(" Use hasDefault" , " 2.10.0" )
190
161
def hasDefaultFlag = hasFlag(DEFAULTPARAM )
191
- @ deprecated(" " , " 2.9.0" )
192
- def isAbstract = hasFlag(ABSTRACT )
193
162
@ deprecated(" Use isValueParameter or isTypeParameter" , " 2.10.0" )
194
163
def isParameter = hasFlag(PARAM )
195
164
@ deprecated(" Use flagString" , " 2.10.0" )
0 commit comments