Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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
assume unfound classes to be in the same package as the current class #57
assume unfound classes to be in the same package as the current class #57
Changes from 2 commits
8a8a818
cc07484
fb95084
b5216e0
c388c0d
2be3a83
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This code should also call
createUnsolvedClass
(and then calladdMethod
on the result)There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
as we've added
updateMissingClass
to theupdateUnsolvedClass
method, I think we can't callupdateUnsolvedClass
here because we need to add the method to theUnsolvedClass
instance before updating the list of missing classes.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why? The pointer is still valid, and I don't think there's any reason to believe that any computation will be done with the list of missing classes before the call to
addMethod
is executed (assuming a sequential Java semantics, but I'm okay with that assumption here given the way the JVM works).There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No, I am wrong:
updateMissingClass
does more computation than I expected. I was incorrectly thinking that it just updates a data structure; it also does computation over the list of methods.Can you modify
updateUnsolvedClass
to take a varargs array of methods and add them all to the class before it callsupdateMissingClass
?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Professor, I'm afraid that might make
updateUnsolvedClass
more complicated than it should be. The reason is that it will require an additional array as an argument whenever it is called, even if there is no methods added (such as in line 529 and 674). And even at line 704, while there is a method added, there is only one method added. So modifyingupdateUnsolvedClass
to take an array of methods as an argument seems to be unnecessary.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It will not, if you use the varargs feature as I suggested. It is designed for exactly this situation, and the resulting code should be simpler than what you currently have.