Skip to content

The runtime result does not meet expert documented result #994

@nicuessa

Description

@nicuessa

In this chapter https://cap.cloud.sap/docs/java/reflection-api:

if (type.isSimple()) {   // true
  CdsSimpleType simple = type.as(CdsSimpleType.class);

  String typeName = simple.getQualifiedName();  // "cds.String"
  CdsBaseType baseType = simple.getType();      // CdsBaseType.STRING
  Class<?> javaType = simple.getJavaType();     // String.class
  **Boolean localized = simple.get("localized");  // true**
  Integer length = simple.get("length");        // 111
}

The actual value of localized is null.

In com.sap.cds.reflect.impl.CdsSimpleTypeBuilder, the property "localized" is not listed.

public <T> T get(String property) {
	switch (property) {
		case CdsConstants.LENGTH:
		case CdsConstants.PRECISION:
		case CdsConstants.SRID:
			return (T) Integer.valueOf(v1);
		default:
			return null;
	}
}

Metadata

Metadata

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions