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

Add files via upload #100

Merged
merged 4 commits into from
Nov 16, 2023
Merged

Add files via upload #100

merged 4 commits into from
Nov 16, 2023

Conversation

DhillonTaran
Copy link
Collaborator

for issue #35

Copy link
Collaborator

@liamhyde02 liamhyde02 left a comment

Choose a reason for hiding this comment

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

this needs to implement the EntityParsingStep interface and add stuff to the Singleton, not return a static set

@DhillonTaran DhillonTaran changed the base branch from 35-feat-get-the-name-for-all-classes-a-java-entity-extends to mainline November 15, 2023 16:53
@Override
public JavaEntity construct(EntityBuilder builder, CompilationUnit declaration) {
// Existing logic to parse the entity
JavaEntity entity = next.construct(builder, declaration);
Copy link
Collaborator

Choose a reason for hiding this comment

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

you don't need to parse the entity here, just put everything into the builder

Set<String> associatedClassNames = getAssociatedClassNames(entity);
associatedClassNames.forEach(builder::addAssociation);

return entity;
Copy link
Collaborator

Choose a reason for hiding this comment

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

need to return next.construct here

Copy link
Collaborator

@buk0vec buk0vec left a comment

Choose a reason for hiding this comment

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

This is supposed to address issue #35

@Override
public JavaEntity construct(EntityBuilder builder, CompilationUnit declaration) {
// Existing logic to parse the entity
JavaEntity entity = next.construct(builder, declaration);
Copy link
Collaborator

Choose a reason for hiding this comment

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

Call this at the end of the function!

Copy link
Collaborator

Choose a reason for hiding this comment

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

Otherwise it will run out of order. Just look at the other steps

return entity;
}

private Set<String> getAssociatedClassNames(Object entity) {
Copy link
Collaborator

Choose a reason for hiding this comment

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

Isn't your task to just get the parent class of the ClassOrInterfaceDeclaration if it has one? Kind of confused on why all this logic is needed

Copy link
Collaborator

@buk0vec buk0vec left a comment

Choose a reason for hiding this comment

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

lgtm

Copy link
Collaborator

@liamhyde02 liamhyde02 left a comment

Choose a reason for hiding this comment

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

lgtm

@liamhyde02 liamhyde02 merged commit 58df643 into mainline Nov 16, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants