MCPcopy Index your code
hub / github.com/apache/groovy / getValue

Method getValue

src/main/java/org/codehaus/groovy/vmplugin/v8/Java8.java:404–416  ·  view source on GitHub ↗

Returns the initial expression for given field. @return value expression or null @since 5.0.0

(final Field field)

Source from the content-addressed store, hash-verified

402 * @since 5.0.0
403 */
404 protected Expression getValue(final Field field) {
405 int modifiers = field.getModifiers();
406 // TODO: read ConstantValue from field attributes
407 if (Modifier.isFinal(modifiers) && Modifier.isStatic(modifiers)
408 && (Modifier.isPublic(modifiers) || Modifier.isProtected(modifiers))
409 && (field.getType().isPrimitive() || field.getType().equals(String.class))) {
410 try {
411 return new ConstantExpression(field.get(null), true);
412 } catch (ReflectiveOperationException | LinkageError e) {
413 }
414 }
415 return null;
416 }
417
418 /**
419 * Synthetic parameters such as those added for inner class constructors may

Callers 1

configureClassNodeMethod · 0.95

Calls 9

getModifiersMethod · 0.65
isFinalMethod · 0.65
isStaticMethod · 0.65
isPublicMethod · 0.65
isProtectedMethod · 0.65
isPrimitiveMethod · 0.65
getTypeMethod · 0.65
equalsMethod · 0.65
getMethod · 0.65

Tested by

no test coverage detected