本文整理汇总了Java中org.eclipse.jdt.internal.compiler.classfmt.ClassFileConstants.AccStrictfp方法的典型用法代码示例。如果您正苦于以下问题:Java ClassFileConstants.AccStrictfp方法的具体用法?Java ClassFileConstants.AccStrictfp怎么用?Java ClassFileConstants.AccStrictfp使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.eclipse.jdt.internal.compiler.classfmt.ClassFileConstants
的用法示例。
在下文中一共展示了ClassFileConstants.AccStrictfp方法的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: SyntheticMethodBinding
import org.eclipse.jdt.internal.compiler.classfmt.ClassFileConstants; //导入方法依赖的package包/类
/**
* Construct enum special methods: values or valueOf methods
*/
public SyntheticMethodBinding(SourceTypeBinding declaringEnum, char[] selector) {
this.declaringClass = declaringEnum;
this.selector = selector;
this.modifiers = ClassFileConstants.AccPublic | ClassFileConstants.AccStatic;
this.tagBits |= (TagBits.AnnotationResolved | TagBits.DeprecatedAnnotationResolved);
LookupEnvironment environment = declaringEnum.scope.environment();
this.thrownExceptions = Binding.NO_EXCEPTIONS;
if (selector == TypeConstants.VALUES) {
this.returnType = environment.createArrayType(environment.convertToParameterizedType(declaringEnum), 1);
this.parameters = Binding.NO_PARAMETERS;
this.purpose = SyntheticMethodBinding.EnumValues;
} else if (selector == TypeConstants.VALUEOF) {
this.returnType = environment.convertToParameterizedType(declaringEnum);
this.parameters = new TypeBinding[]{ declaringEnum.scope.getJavaLangString() };
this.purpose = SyntheticMethodBinding.EnumValueOf;
}
SyntheticMethodBinding[] knownAccessMethods = ((SourceTypeBinding)this.declaringClass).syntheticMethods();
int methodId = knownAccessMethods == null ? 0 : knownAccessMethods.length;
this.index = methodId;
if (declaringEnum.isStrictfp()) {
this.modifiers |= ClassFileConstants.AccStrictfp;
}
}
示例2: MethodBinding
import org.eclipse.jdt.internal.compiler.classfmt.ClassFileConstants; //导入方法依赖的package包/类
public MethodBinding(int modifiers, char[] selector, TypeBinding returnType, TypeBinding[] parameters, ReferenceBinding[] thrownExceptions, ReferenceBinding declaringClass) {
this.modifiers = modifiers;
this.selector = selector;
this.returnType = returnType;
this.parameters = (parameters == null || parameters.length == 0) ? Binding.NO_PARAMETERS : parameters;
this.thrownExceptions = (thrownExceptions == null || thrownExceptions.length == 0) ? Binding.NO_EXCEPTIONS : thrownExceptions;
this.declaringClass = declaringClass;
// propagate the strictfp & deprecated modifiers
if (this.declaringClass != null) {
if (this.declaringClass.isStrictfp())
if (!(isNative() || isAbstract()))
this.modifiers |= ClassFileConstants.AccStrictfp;
}
}
示例3: decodeModifiers
import org.eclipse.jdt.internal.compiler.classfmt.ClassFileConstants; //导入方法依赖的package包/类
private static void decodeModifiers(Set<Modifier> result, int modifiers, int[] checkBits) {
if (checkBits == null) return;
for (int i = 0, max = checkBits.length; i < max; i++) {
switch(checkBits[i]) {
case ClassFileConstants.AccPublic :
appendModifier(result, modifiers, checkBits[i], Modifier.PUBLIC);
break;
case ClassFileConstants.AccProtected:
appendModifier(result, modifiers, checkBits[i], Modifier.PROTECTED);
break;
case ClassFileConstants.AccPrivate :
appendModifier(result, modifiers, checkBits[i], Modifier.PRIVATE);
break;
case ClassFileConstants.AccAbstract :
appendModifier(result, modifiers, checkBits[i], Modifier.ABSTRACT);
break;
case ClassFileConstants.AccStatic :
appendModifier(result, modifiers, checkBits[i], Modifier.STATIC);
break;
case ClassFileConstants.AccFinal :
appendModifier(result, modifiers, checkBits[i], Modifier.FINAL);
break;
case ClassFileConstants.AccSynchronized :
appendModifier(result, modifiers, checkBits[i], Modifier.SYNCHRONIZED);
break;
case ClassFileConstants.AccNative :
appendModifier(result, modifiers, checkBits[i], Modifier.NATIVE);
break;
case ClassFileConstants.AccStrictfp :
appendModifier(result, modifiers, checkBits[i], Modifier.STRICTFP);
break;
case ClassFileConstants.AccTransient :
appendModifier(result, modifiers, checkBits[i], Modifier.TRANSIENT);
break;
case ClassFileConstants.AccVolatile :
appendModifier(result, modifiers, checkBits[i], Modifier.VOLATILE);
break;
}
}
}
示例4: decodeModifiers
import org.eclipse.jdt.internal.compiler.classfmt.ClassFileConstants; //导入方法依赖的package包/类
private static void decodeModifiers(Set<Modifier> result, int modifiers, int[] checkBits) {
if (checkBits == null) return;
for (int i = 0, max = checkBits.length; i < max; i++) {
switch(checkBits[i]) {
case ClassFileConstants.AccPublic :
appendModifier(result, modifiers, checkBits[i], Modifier.PUBLIC);
break;
case ClassFileConstants.AccProtected:
appendModifier(result, modifiers, checkBits[i], Modifier.PROTECTED);
break;
case ClassFileConstants.AccPrivate :
appendModifier(result, modifiers, checkBits[i], Modifier.PRIVATE);
break;
case ClassFileConstants.AccAbstract :
appendModifier(result, modifiers, checkBits[i], Modifier.ABSTRACT);
break;
case ExtraCompilerModifiers.AccDefaultMethod :
try {
appendModifier(result, modifiers, checkBits[i], Modifier.valueOf("DEFAULT")); //$NON-NLS-1$
} catch(IllegalArgumentException iae) {
// Don't have JDK 1.8, just ignore and proceed.
}
break;
case ClassFileConstants.AccStatic :
appendModifier(result, modifiers, checkBits[i], Modifier.STATIC);
break;
case ClassFileConstants.AccFinal :
appendModifier(result, modifiers, checkBits[i], Modifier.FINAL);
break;
case ClassFileConstants.AccSynchronized :
appendModifier(result, modifiers, checkBits[i], Modifier.SYNCHRONIZED);
break;
case ClassFileConstants.AccNative :
appendModifier(result, modifiers, checkBits[i], Modifier.NATIVE);
break;
case ClassFileConstants.AccStrictfp :
appendModifier(result, modifiers, checkBits[i], Modifier.STRICTFP);
break;
case ClassFileConstants.AccTransient :
appendModifier(result, modifiers, checkBits[i], Modifier.TRANSIENT);
break;
case ClassFileConstants.AccVolatile :
appendModifier(result, modifiers, checkBits[i], Modifier.VOLATILE);
break;
}
}
}
示例5: isStrictfp
import org.eclipse.jdt.internal.compiler.classfmt.ClassFileConstants; //导入方法依赖的package包/类
/**
* Answer true if all float operations must adher to IEEE 754 float/double rules
*/
public final boolean isStrictfp() {
return (this.modifiers & ClassFileConstants.AccStrictfp) != 0;
}
示例6: isStrictfp
import org.eclipse.jdt.internal.compiler.classfmt.ClassFileConstants; //导入方法依赖的package包/类
public final boolean isStrictfp() {
return (this.modifiers & ClassFileConstants.AccStrictfp) != 0;
}
示例7: checkAndSetModifiersForConstructor
import org.eclipse.jdt.internal.compiler.classfmt.ClassFileConstants; //导入方法依赖的package包/类
/**
* Spec : 8.4.3 & 9.4
*/
private void checkAndSetModifiersForConstructor(MethodBinding methodBinding) {
int modifiers = methodBinding.modifiers;
final ReferenceBinding declaringClass = methodBinding.declaringClass;
if ((modifiers & ExtraCompilerModifiers.AccAlternateModifierProblem) != 0)
problemReporter().duplicateModifierForMethod(declaringClass, (AbstractMethodDeclaration) this.referenceContext);
if ((((ConstructorDeclaration) this.referenceContext).bits & ASTNode.IsDefaultConstructor) != 0) {
// certain flags are propagated from declaring class onto constructor
final int DECLARING_FLAGS = ClassFileConstants.AccEnum|ClassFileConstants.AccPublic|ClassFileConstants.AccProtected;
final int VISIBILITY_FLAGS = ClassFileConstants.AccPrivate|ClassFileConstants.AccPublic|ClassFileConstants.AccProtected;
int flags;
if ((flags = declaringClass.modifiers & DECLARING_FLAGS) != 0) {
if ((flags & ClassFileConstants.AccEnum) != 0) {
modifiers &= ~VISIBILITY_FLAGS;
modifiers |= ClassFileConstants.AccPrivate; // default constructor is implicitly private in enum
} else {
modifiers &= ~VISIBILITY_FLAGS;
modifiers |= flags; // propagate public/protected
}
}
}
// after this point, tests on the 16 bits reserved.
int realModifiers = modifiers & ExtraCompilerModifiers.AccJustFlag;
// check for abnormal modifiers
final int UNEXPECTED_MODIFIERS = ~(ClassFileConstants.AccPublic | ClassFileConstants.AccPrivate | ClassFileConstants.AccProtected | ClassFileConstants.AccStrictfp);
if (declaringClass.isEnum() && (((ConstructorDeclaration) this.referenceContext).bits & ASTNode.IsDefaultConstructor) == 0) {
final int UNEXPECTED_ENUM_CONSTR_MODIFIERS = ~(ClassFileConstants.AccPrivate | ClassFileConstants.AccStrictfp);
if ((realModifiers & UNEXPECTED_ENUM_CONSTR_MODIFIERS) != 0) {
problemReporter().illegalModifierForEnumConstructor((AbstractMethodDeclaration) this.referenceContext);
modifiers &= ~ExtraCompilerModifiers.AccJustFlag | ~UNEXPECTED_ENUM_CONSTR_MODIFIERS;
} else if ((((AbstractMethodDeclaration) this.referenceContext).modifiers & ClassFileConstants.AccStrictfp) != 0) {
// must check the parse node explicitly
problemReporter().illegalModifierForMethod((AbstractMethodDeclaration) this.referenceContext);
}
modifiers |= ClassFileConstants.AccPrivate; // enum constructor is implicitly private
} else if ((realModifiers & UNEXPECTED_MODIFIERS) != 0) {
problemReporter().illegalModifierForMethod((AbstractMethodDeclaration) this.referenceContext);
modifiers &= ~ExtraCompilerModifiers.AccJustFlag | ~UNEXPECTED_MODIFIERS;
} else if ((((AbstractMethodDeclaration) this.referenceContext).modifiers & ClassFileConstants.AccStrictfp) != 0) {
// must check the parse node explicitly
problemReporter().illegalModifierForMethod((AbstractMethodDeclaration) this.referenceContext);
}
// check for incompatible modifiers in the visibility bits, isolate the visibility bits
int accessorBits = realModifiers & (ClassFileConstants.AccPublic | ClassFileConstants.AccProtected | ClassFileConstants.AccPrivate);
if ((accessorBits & (accessorBits - 1)) != 0) {
problemReporter().illegalVisibilityModifierCombinationForMethod(declaringClass, (AbstractMethodDeclaration) this.referenceContext);
// need to keep the less restrictive so disable Protected/Private as necessary
if ((accessorBits & ClassFileConstants.AccPublic) != 0) {
if ((accessorBits & ClassFileConstants.AccProtected) != 0)
modifiers &= ~ClassFileConstants.AccProtected;
if ((accessorBits & ClassFileConstants.AccPrivate) != 0)
modifiers &= ~ClassFileConstants.AccPrivate;
} else if ((accessorBits & ClassFileConstants.AccProtected) != 0 && (accessorBits & ClassFileConstants.AccPrivate) != 0) {
modifiers &= ~ClassFileConstants.AccPrivate;
}
}
// // if the receiver's declaring class is a private nested type, then make sure the receiver is not private (causes problems for inner type emulation)
// if (declaringClass.isPrivate() && (modifiers & ClassFileConstants.AccPrivate) != 0)
// modifiers &= ~ClassFileConstants.AccPrivate;
methodBinding.modifiers = modifiers;
}
示例8: BinaryTypeBinding
import org.eclipse.jdt.internal.compiler.classfmt.ClassFileConstants; //导入方法依赖的package包/类
/**
* Standard constructor for creating binary type bindings from binary models (classfiles)
* @param packageBinding
* @param binaryType
* @param environment
* @param needFieldsAndMethods
*/
public BinaryTypeBinding(PackageBinding packageBinding, IBinaryType binaryType, LookupEnvironment environment, boolean needFieldsAndMethods) {
this.prototype = this;
this.compoundName = CharOperation.splitOn('/', binaryType.getName());
computeId();
this.tagBits |= TagBits.IsBinaryBinding;
this.environment = environment;
this.fPackage = packageBinding;
this.fileName = binaryType.getFileName();
/* https://bugs.eclipse.org/bugs/show_bug.cgi?id=324850, even in a 1.4 project, we
must internalize type variables and observe any parameterization of super class
and/or super interfaces in order to be able to detect overriding in the presence
of generics.
*/
char[] typeSignature = binaryType.getGenericSignature();
this.typeVariables = typeSignature != null && typeSignature.length > 0 && typeSignature[0] == Util.C_GENERIC_START
? null // is initialized in cachePartsFrom (called from LookupEnvironment.createBinaryTypeFrom())... must set to null so isGenericType() answers true
: Binding.NO_TYPE_VARIABLES;
this.sourceName = binaryType.getSourceName();
this.modifiers = binaryType.getModifiers();
if ((binaryType.getTagBits() & TagBits.HierarchyHasProblems) != 0)
this.tagBits |= TagBits.HierarchyHasProblems;
if (binaryType.isAnonymous()) {
this.tagBits |= TagBits.AnonymousTypeMask;
} else if (binaryType.isLocal()) {
this.tagBits |= TagBits.LocalTypeMask;
} else if (binaryType.isMember()) {
this.tagBits |= TagBits.MemberTypeMask;
}
// need enclosing type to access type variables
char[] enclosingTypeName = binaryType.getEnclosingTypeName();
if (enclosingTypeName != null) {
// attempt to find the enclosing type if it exists in the cache (otherwise - resolve it when requested)
this.enclosingType = environment.getTypeFromConstantPoolName(enclosingTypeName, 0, -1, true, null /* could not be missing */); // pretend parameterized to avoid raw
this.tagBits |= TagBits.MemberTypeMask; // must be a member type not a top-level or local type
this.tagBits |= TagBits.HasUnresolvedEnclosingType;
if (enclosingType().isStrictfp())
this.modifiers |= ClassFileConstants.AccStrictfp;
if (enclosingType().isDeprecated())
this.modifiers |= ExtraCompilerModifiers.AccDeprecatedImplicitly;
}
if (needFieldsAndMethods)
cachePartsFrom(binaryType, true);
}
示例9: checkAndSetModifiersForMethod
import org.eclipse.jdt.internal.compiler.classfmt.ClassFileConstants; //导入方法依赖的package包/类
/**
* Spec : 8.4.3 & 9.4
*/
private void checkAndSetModifiersForMethod(MethodBinding methodBinding) {
int modifiers = methodBinding.modifiers;
final ReferenceBinding declaringClass = methodBinding.declaringClass;
if ((modifiers & ExtraCompilerModifiers.AccAlternateModifierProblem) != 0)
problemReporter().duplicateModifierForMethod(declaringClass, (AbstractMethodDeclaration) this.referenceContext);
// after this point, tests on the 16 bits reserved.
int realModifiers = modifiers & ExtraCompilerModifiers.AccJustFlag;
// set the requested modifiers for a method in an interface/annotation
if (declaringClass.isInterface()) {
if ((realModifiers & ~(ClassFileConstants.AccPublic | ClassFileConstants.AccAbstract)) != 0) {
if ((declaringClass.modifiers & ClassFileConstants.AccAnnotation) != 0)
problemReporter().illegalModifierForAnnotationMember((AbstractMethodDeclaration) this.referenceContext);
else
problemReporter().illegalModifierForInterfaceMethod((AbstractMethodDeclaration) this.referenceContext);
}
return;
}
// check for abnormal modifiers
final int UNEXPECTED_MODIFIERS = ~(ClassFileConstants.AccPublic | ClassFileConstants.AccPrivate | ClassFileConstants.AccProtected
| ClassFileConstants.AccAbstract | ClassFileConstants.AccStatic | ClassFileConstants.AccFinal | ClassFileConstants.AccSynchronized | ClassFileConstants.AccNative | ClassFileConstants.AccStrictfp);
if ((realModifiers & UNEXPECTED_MODIFIERS) != 0) {
problemReporter().illegalModifierForMethod((AbstractMethodDeclaration) this.referenceContext);
modifiers &= ~ExtraCompilerModifiers.AccJustFlag | ~UNEXPECTED_MODIFIERS;
}
// check for incompatible modifiers in the visibility bits, isolate the visibility bits
int accessorBits = realModifiers & (ClassFileConstants.AccPublic | ClassFileConstants.AccProtected | ClassFileConstants.AccPrivate);
if ((accessorBits & (accessorBits - 1)) != 0) {
problemReporter().illegalVisibilityModifierCombinationForMethod(declaringClass, (AbstractMethodDeclaration) this.referenceContext);
// need to keep the less restrictive so disable Protected/Private as necessary
if ((accessorBits & ClassFileConstants.AccPublic) != 0) {
if ((accessorBits & ClassFileConstants.AccProtected) != 0)
modifiers &= ~ClassFileConstants.AccProtected;
if ((accessorBits & ClassFileConstants.AccPrivate) != 0)
modifiers &= ~ClassFileConstants.AccPrivate;
} else if ((accessorBits & ClassFileConstants.AccProtected) != 0 && (accessorBits & ClassFileConstants.AccPrivate) != 0) {
modifiers &= ~ClassFileConstants.AccPrivate;
}
}
// check for modifiers incompatible with abstract modifier
if ((modifiers & ClassFileConstants.AccAbstract) != 0) {
int incompatibleWithAbstract = ClassFileConstants.AccPrivate | ClassFileConstants.AccStatic | ClassFileConstants.AccFinal | ClassFileConstants.AccSynchronized | ClassFileConstants.AccNative | ClassFileConstants.AccStrictfp;
if ((modifiers & incompatibleWithAbstract) != 0)
problemReporter().illegalAbstractModifierCombinationForMethod(declaringClass, (AbstractMethodDeclaration) this.referenceContext);
if (!methodBinding.declaringClass.isAbstract())
problemReporter().abstractMethodInAbstractClass((SourceTypeBinding) declaringClass, (AbstractMethodDeclaration) this.referenceContext);
}
/* DISABLED for backward compatibility with javac (if enabled should also mark private methods as final)
// methods from a final class are final : 8.4.3.3
if (methodBinding.declaringClass.isFinal())
modifiers |= AccFinal;
*/
// native methods cannot also be tagged as strictfp
if ((modifiers & ClassFileConstants.AccNative) != 0 && (modifiers & ClassFileConstants.AccStrictfp) != 0)
problemReporter().nativeMethodsCannotBeStrictfp(declaringClass, (AbstractMethodDeclaration) this.referenceContext);
// static members are only authorized in a static member or top level type
if (((realModifiers & ClassFileConstants.AccStatic) != 0) && declaringClass.isNestedType() && !declaringClass.isStatic())
problemReporter().unexpectedStaticModifierForMethod(declaringClass, (AbstractMethodDeclaration) this.referenceContext);
methodBinding.modifiers = modifiers;
}
示例10: BinaryTypeBinding
import org.eclipse.jdt.internal.compiler.classfmt.ClassFileConstants; //导入方法依赖的package包/类
/**
* Standard constructor for creating binary type bindings from binary models (classfiles)
* @param packageBinding
* @param binaryType
* @param environment
*/
public BinaryTypeBinding(PackageBinding packageBinding, IBinaryType binaryType, LookupEnvironment environment) {
this.compoundName = CharOperation.splitOn('/', binaryType.getName());
computeId();
this.tagBits |= TagBits.IsBinaryBinding;
this.environment = environment;
this.fPackage = packageBinding;
this.fileName = binaryType.getFileName();
/* https://bugs.eclipse.org/bugs/show_bug.cgi?id=324850, even in a 1.4 project, we
must internalize type variables and observe any parameterization of super class
and/or super interfaces in order to be able to detect overriding in the presence
of generics.
*/
char[] typeSignature = binaryType.getGenericSignature();
this.typeVariables = typeSignature != null && typeSignature.length > 0 && typeSignature[0] == Util.C_GENERIC_START
? null // is initialized in cachePartsFrom (called from LookupEnvironment.createBinaryTypeFrom())... must set to null so isGenericType() answers true
: Binding.NO_TYPE_VARIABLES;
this.sourceName = binaryType.getSourceName();
this.modifiers = binaryType.getModifiers();
if ((binaryType.getTagBits() & TagBits.HierarchyHasProblems) != 0)
this.tagBits |= TagBits.HierarchyHasProblems;
if (binaryType.isAnonymous()) {
this.tagBits |= TagBits.AnonymousTypeMask;
} else if (binaryType.isLocal()) {
this.tagBits |= TagBits.LocalTypeMask;
} else if (binaryType.isMember()) {
this.tagBits |= TagBits.MemberTypeMask;
}
// need enclosing type to access type variables
char[] enclosingTypeName = binaryType.getEnclosingTypeName();
if (enclosingTypeName != null) {
// attempt to find the enclosing type if it exists in the cache (otherwise - resolve it when requested)
this.enclosingType = environment.getTypeFromConstantPoolName(enclosingTypeName, 0, -1, true, null /* could not be missing */); // pretend parameterized to avoid raw
this.tagBits |= TagBits.MemberTypeMask; // must be a member type not a top-level or local type
this.tagBits |= TagBits.HasUnresolvedEnclosingType;
if (enclosingType().isStrictfp())
this.modifiers |= ClassFileConstants.AccStrictfp;
if (enclosingType().isDeprecated())
this.modifiers |= ExtraCompilerModifiers.AccDeprecatedImplicitly;
}
}