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

Fix incorrect class name generation from file path when path contains /java #39

Merged
merged 1 commit into from
Dec 21, 2023

Conversation

sweetStreet
Copy link
Contributor

The original implementation of this method led to incorrect class name generation when the file path contained the substring /java.

Previously, a file path like "com/amazon/sqs/javamessaging/AmazonSQSExtendedClient.java" would incorrectly generate the class name "com.amazon.sqsmessaging.AmazonSQSExtendedClient". This was due to the premature removal of the /java segment.

@sweetStreet sweetStreet changed the title fix path to class name when path contains /java Fix incorrect className generation from file path when path contains /java Dec 21, 2023
@sweetStreet sweetStreet changed the title Fix incorrect className generation from file path when path contains /java Fix incorrect class name generation from file path when path contains /java Dec 21, 2023
@I-Al-Istannen
Copy link
Owner

That is true :) Won't really happen in the problem domain this codebase is used in, but still worth fixing. I guess a nice stripSuffix method is missing in the JDK string…

How did you find this? Just searched on github for the two replacement patterns? It looks like you are also working on automatic program testing/analysis, so that sounds interesting :)

@I-Al-Istannen I-Al-Istannen merged commit c2f1c24 into I-Al-Istannen:master Dec 21, 2023
2 checks passed
@sweetStreet
Copy link
Contributor Author

sweetStreet commented Dec 22, 2023 via email

@I-Al-Istannen
Copy link
Owner

Ah, neat. Have you seen https://arxiv.org/pdf/2212.11077.pdf or https://arxiv.org/pdf/2302.04547.pdf? How do you collect runtime values? I wrote some PoC code for that a while ago.

The other part that would interest me is how you create the tests. Do you synthesize java code or reconstruct the objects and values from JSON/XML/Protobuf/whatever? I.e. do you generate a test like

Bar foo = new Bar(x, y);
assert(foo.whatever() == 20);

or

Bar foo = fromJson("constant");
assert(foo.whatever() == fromJson("expected"));

@sweetStreet
Copy link
Contributor Author

sweetStreet commented Jan 10, 2024 via email

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.

2 participants