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

Deletes input source files under some circumstances #368

Closed
gmerr3 opened this issue Oct 24, 2024 · 1 comment
Closed

Deletes input source files under some circumstances #368

gmerr3 opened this issue Oct 24, 2024 · 1 comment

Comments

@gmerr3
Copy link
Contributor

gmerr3 commented Oct 24, 2024

File 1(A.java):

import java.io.IOException;
import java.net.InetAddress;
import java.net.InetSocketAddress;
import java.nio.channels.AsynchronousSocketChannel;

public class A{
	public AsynchronousSocketChannel client;
	public A(AsynchronousSocketChannel client){
		this.client=client;
	}
	public InetAddress test(){
		try {
			if(client.getRemoteAddress() instanceof InetSocketAddress isa)
				return isa.getAddress();
		} catch (IOException e) {
			
		}
		return null;
	}
}

File 2(B.java):


import java.io.IOException;
import java.net.InetAddress;

public class B extends A {

    @Override
    public InetAddress test(){
        return super.test();
    }
}

Command:

gradlew run  --args="--outputDirectory \"/tmp/specimin328479325\" --root \"/path/to/src/main/java\" --targetFile \"B.java\" --targetMethod \"B#test()\""

The source file A.java is deleted when running the above command.
It is deleted at this point:

at org.checkerframework.specimin.UnsolvedSymbolVisitor.deleteOldSyntheticClass(UnsolvedSymbolVisitor.java:3201)
at org.checkerframework.specimin.UnsolvedSymbolVisitor.updateSyntheticSourceCode(UnsolvedSymbolVisitor.java:3182)
at org.checkerframework.specimin.SpeciminRunner.performMinimizationImpl(SpeciminRunner.java:303)
at org.checkerframework.specimin.SpeciminRunner.performMinimization(SpeciminRunner.java:163)
at org.checkerframework.specimin.SpeciminRunner.main(SpeciminRunner.java:90)
kelloggm pushed a commit that referenced this issue Nov 7, 2024
Fix issue #368 , issue #370 , and issue #361 .
Tests have been added.
One existing test(Issue103) fails, but it was already failing in the
main branch.
@gmerr3
Copy link
Contributor Author

gmerr3 commented Nov 7, 2024

fixed in #371

@gmerr3 gmerr3 closed this as completed Nov 7, 2024
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

No branches or pull requests

1 participant