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
OneCricketeer
  • 179,855
  • 19
  • 132
  • 245
TmTron
  • 17,012
  • 10
  • 94
  • 142
  • Interface static methods were added in Java 8. Android has been only recently added Java 8 compilation. That's just a guess, though – OneCricketeer Nov 19 '16 at 17:16
  • You can find all the answers in this thread: https://stackoverflow.com/questions/512877/why-cant-i-define-a-static-method-in-a-java-interface?rq=1 – Tibor Leó Sáfár Dec 14 '18 at 20:14
  • 1
    @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. – TmTron Dec 15 '18 at 08:15

0 Answers0