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

Error when decompiling specific test case #46

Open
rbonifacio opened this issue Apr 1, 2022 · 0 comments
Open

Error when decompiling specific test case #46

rbonifacio opened this issue Apr 1, 2022 · 0 comments

Comments

@rbonifacio
Copy link
Collaborator

When we try to decompile this code:

public class Vanilla {
	public static void main(String[] args) {
		List<Student> students = Collections.emptyList();
		students.add(new Student("Pedro", 30));
		students.add(new Student("João", 25));
		
		Predicate<Student> p = s -> s.name == "Pedro";
		
		Vanilla v = new Vanilla();
		
	}
	
	public List<Student> vanilla(List<Student> students, Predicate<Student> p, Function<Student, Student> f) {
		List<Student> result = Collections.emptyList();
		boolean over = false;
		
		while(!over) {
			List<Student> sub = auxState.subList(0, auxState.size());
			
			if(p.test(auxState.get(0))) {
				result.add(f.apply(auxState.get(0)));
			}
			
			auxState = sub;
                }
		
		return result;
	}
	
	public List<Student> withFStream(List<Student> students, Predicate<Student> p, Function<Student, Student> f) {
		return Collections.emptyList();
	}

An exception occurs:

java.util.EmptyStackException
	at java.base/java.util.Stack.peek(Stack.java:102)
	at java.base/java.util.Stack.pop(Stack.java:84)
	at lang.jimple.internal.Decompiler$InstructionSetVisitor.returnIns(Decompiler.java:1269)
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