Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -180,6 +180,16 @@ public static String capturingClass(String className) {
return className.split(LambdaUtils.SERIALIZATION_TEST_LAMBDA_CLASS_SPLIT_PATTERN)[0];
}

/**
* Checks if the passed class is a lambda class.
*
* @param type the type to be checked
* @return true if type is a lambda class, false instead
*/
public static boolean isLambdaClass(ResolvedJavaType type) {
return isLambdaClassName(type.toClassName());
}

/**
* Checks if the passed class is lambda class.
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -233,17 +233,20 @@ private RuntimeCPUFeatureRegion() {
* <p>
* All arguments must be compile-time constant.
*/
public static native RuntimeCPUFeatureRegion enter(@ConstantNodeParameter Enum<?> arg0);
public static native RuntimeCPUFeatureRegion enterSet(@ConstantNodeParameter EnumSet<?> features);

public static native RuntimeCPUFeatureRegion enterSet(@ConstantNodeParameter EnumSet<?> arg0);
/**
* @see #enterSet(EnumSet)
*/
public static native RuntimeCPUFeatureRegion enter(@ConstantNodeParameter Enum<?> arg0);

/**
* @see #enter(Enum)
* @see #enterSet(EnumSet)
*/
public static native <T extends Enum<T>> RuntimeCPUFeatureRegion enter(@ConstantNodeParameter Enum<T> arg0, @ConstantNodeParameter Enum<T> arg1);

/**
* @see #enter(Enum)
* @see #enterSet(EnumSet)
*/
public static native <T extends Enum<T>> RuntimeCPUFeatureRegion enter(@ConstantNodeParameter Enum<T> arg0, @ConstantNodeParameter Enum<T> arg1, @ConstantNodeParameter Enum<T> arg2);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -210,4 +210,20 @@ public static List<ResolvedJavaField> getAllFields(ResolvedJavaType declaringCla
System.arraycopy(instanceFields, 0, allFields, staticFields.length, instanceFields.length);
return Collections.unmodifiableList(Arrays.asList(allFields));
}

/**
* Gets the package name for a {@link ResolvedJavaType}. This is the same as calling
* {@link Class#getPackageName()} on the underlying class.
* <p>
* Implementation derived from {@link Class#getPackageName()}.
*/
public static String getPackageName(ResolvedJavaType type) {
ResolvedJavaType c = type.isArray() ? type.getElementalType() : type;
if (c.isPrimitive()) {
return "java.lang";
}
String cn = c.toClassName();
int dot = cn.lastIndexOf('.');
return (dot != -1) ? cn.substring(0, dot).intern() : "";
}
}