Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Move Include to package-info #1852

Open
wants to merge 6 commits into
base: elide-4.x
Choose a base branch
from
Open

Move Include to package-info #1852

wants to merge 6 commits into from

Conversation

wcekan
Copy link
Contributor

@wcekan wcekan commented Feb 20, 2021

Description

Updated the example bean to move Include annotation into package-info. This will verify we locate the annotation correctly in package-info there is none on the bean.

Motivation and Context

Elide 5.x had an issue due to a migration bug and adding test to 4.x to make sure it is tested.

How Has This Been Tested?

Unit testing.

License

I confirm that this contribution is made under an Apache 2.0 license and that I have the authority necessary to make this contribution on behalf of its copyright owner.

Collections.synchronizedMap(new LinkedHashMap<>())));
}

for (Package beanPackage : beanPackages) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What's the purpose of the second scan? The classpath scans are pretty expensive (they take multiple seconds). This could slow down the build quite a bit.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Used one scan.

@@ -390,7 +400,7 @@ private void bindRelation(AccessibleObject fieldOrMethod, String fieldName, Clas

relationshipsDeque.push(fieldName);
fieldsToValues.put(fieldName, fieldOrMethod);
fieldsToTypes.put(fieldName, fieldType);
fieldsToTypes.put(fieldName, fieldType == null ? Void.class : fieldType);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same here.

Copy link
Contributor Author

@wcekan wcekan Mar 18, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I get a NPE running with MappedSuperclass which returns fieldType as null. fieldsToTypes map does not accept null as a value.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is it probably the generics that causes the null fieldType.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That is exactly the problem. RawType of type T is null.

return TypeUtils.getRawType(type, parentClass);

@wcekan wcekan requested a review from aklish March 22, 2021 15:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants