annotations for software defect detection€¦ · jsr 303 bean validation api author: benjamin...

21
JSR 305 Annotations for Software Defect Detection http://http://www.flickr.com/photos/furryscalyman/428682623/

Upload: others

Post on 30-Jan-2021

4 views

Category:

Documents


0 download

TRANSCRIPT

  • JSR 305 Annotations for Software Defect Detection

    http://http://www.flickr.com/photos/furryscalyman/428682623/

  • Agenda

    Bye-bye NPE - JSR 305 NonNull und Nullable 2 |

  • JSR-305

    l

    l

    l

    Bye-bye NPE - JSR 305 NonNull und Nullable 3 |

  • Übersicht: Defect Annotations APIs

    javax.annotation.Nullable

    javax.annotation.Nonnull

    edu.umd.cs.findbugs.annotations.Nullable

    edu.umd.cs.findbugs.annotations.NonNull

    org.jetbrains.annotations.Nullable

    org.jetbrains.annotations.NotNull

    org.eclipse.jdt.annotation.NonNull

    org.eclipse.jdt.annotation.Nullable

    org.eclipse.jdt.annotation.NonNullByDefault

    Bye-bye NPE - JSR 305 NonNull und Nullable 4 |

  • Weitere Annotations in JSR-305

    Bye-bye NPE - JSR 305 NonNull und Nullable 5 |

  • JSR-305 : Verbreitung

    l

    l

    Bye-bye NPE - JSR 305 NonNull und Nullable 6 |

  • Semantik von @Nullable / @Nonnull

    l

    l

    l

    l

    Bye-bye NPE - JSR 305 NonNull und Nullable 7 |

  • Semantik von @Nullable / @Nonnull in der Praxis

    Bye-bye NPE - JSR 305 NonNull und Nullable 8 |

  • Semantik von @Nullable / @Nonnull in der Praxis

    Map x;

    x.get() -> @Nullable? @Nonnull?

    Bye-bye NPE - JSR 305 NonNull und Nullable 9 |

  • When

    l

    l

    Bye-bye NPE - JSR 305 NonNull und Nullable 10 |

    @Nonnull(when=When.NEVER)

    @Nullable(when=When.ALWAYS)

    @Nullable(when=When.MAYBE)

    @Nonnull(when=When.UNKNOWN)

  • Vererbung & Implementierung

    l

    l

    Bye-bye NPE - JSR 305 NonNull und Nullable 11 |

  • IDE Integration

    Bye-bye NPE - JSR 305 NonNull und Nullable 12 |

  • IDE-Integration

    l

    l

    l

    l

    l

    l

    Bye-bye NPE - JSR 305 NonNull und Nullable 13 |

  • IDE –Integration: IDEA (Konfiguration)

    Bye-bye NPE - JSR 305 NonNull und Nullable 14 |

  • IDE –Integration: IDEA (Prüfungen)

    Bye-bye NPE - JSR 305 NonNull und Nullable 15 |

  • IDE –Integration: IDEA (Intentions)

    l

    l

    l

    Bye-bye NPE - JSR 305 NonNull und Nullable 16 |

  • IDE-Integration : Eclipse (Konfiguration)

    Bye-bye NPE - JSR 305 NonNull und Nullable 17 |

  • IDE-Integration : Eclipse (Visualisierung)

    Bye-bye NPE - JSR 305 NonNull und Nullable 18 |

  • Fazit & Praxistipps

    Bye-bye NPE - JSR 305 NonNull und Nullable 19 |

  • Best Practices

    l

    l

    l

    Bye-bye NPE - JSR 305 NonNull und Nullable 20 |

  • Fazit

    l

    l

    l

    Bye-bye NPE - JSR 305 NonNull und Nullable 21 |