Android Studio: breakpoint in static method of interface does not work
Asked Answered
F

0

6

Android Studio does not stop on lines in a static method of an interface.

Example: see method getFilteredNotes in the interface Utils.java of project Conductor (version 0.9.3):

public interface Utils {
    // some lines removed for readability

    static List<Note> getFilteredNotes(AppState appState) {
        List<Note> notes = appState.notes();
        NotesFilter filter = appState.filter();
        return filter(ConsPStack.from(notes), note ->
                filter == NotesFilter.ALL
                        || filter == NotesFilter.CHECKED && note.checked
                        || filter == NotesFilter.UNCHECKED && !note.checked);
    }

when I convert the interface to a class, then it works:

public class Utils 

Why do the breakpoints not work on the interface?

More details:

  • Android Studio Version 2.2.2
  • Virtual Device: Nexus_6_API_25.avd
    • Android: 7.1.1
    • CPU: x86
  • setting minifyEnabled=false for the debug build did not help
  • the project is using retrolambda
Fantasist answered 19/11, 2016 at 17:9 Comment(3)
Interface static methods were added in Java 8. Android has been only recently added Java 8 compilation. That's just a guess, thoughBalinese
You can find all the answers in this thread: #513377Sublimation
@TiborLeóSáfár I don't see what the linked answer has to do with my question. I am asking why the breakpoints don't work on static interface methods. Static interface methods DO of course work.Fantasist

© 2022 - 2024 — McMap. All rights reserved.