Search code examples
javaperformancecoding-stylefinal

Open source Java projects that use `final` modifiers everywhere


The issue of using or not using the Java final keyword has been discussed many times on SO. I am trying to collect some well-known open source Java projects that are using it. I haven't found any so far. Can you tell me some?

Questions about using or not using final:

Why would one mark local variables and method parameters as "final" in Java?

Using "final" modifier whenever applicable in java

Why are local variables not declared final in most open source java projects?


Solution

  • Here are some projects that use final parameters and locals. They are not selected for prominence or activity. I'm not sure how I would do that.

    I gathered them from Google: allintext: "final" import site:sourceforge.net

    • wnpojo.sf.net wraps WordNet entities in Java classes
    • spnego.sf.net integrates Windows authentication in Java
    • waterken.sf.net provides asynchronous invocation over HTTP
    • jeuclid.sf.net renders MathML
    • statcvs.sf.net describes CVS projects as tables and charts

    Here are some highly prominent projects that do not (at least, not in the files that I inspected) use final parameters and locals in their Java code.

    • GNU: GNU Classpath
    • Samba: JCIFS
    • MySQL: Connector/J
    • ANTLR
    • Amazon Web Services (AWS) Toolkit for Eclipse
    • Apache Tomcat
    • Bouncy Castle
    • Eclipse: Java Developer Toolkit (JDT), core UI
    • Google Web Toolkit (GWT): Mobile WebKit
    • International Components for Unicode for Java (ICU4J)
    • JUnit
    • OpenJDK
    • Spring: Spring Framework