You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
There are historical Java classes which are thread-unsafe, and/or have been superseded.
Those classes should be avoided in regular code. At most one could wrap them in a library, so the gotchas are abstracted away.
Task
Create a linter that analyzes :imports (or even a whole namespace - imports aren't mandatory) finding references to a class blacklist: SimpleDateFormat, URL, GregorianCalendar, DecimalFormat, and etc (research).
Acceptance criteria
Analyzes :imports with different syntaxes
Or better: Uses ns-publics or such to query the currently imported clases
Analyzes whole namespaces (each defn, etc), including metadata
This is necesary (even if querying ns-publics) since code can refer to classes that were not :imported
Semi-related, (def foo (java.text.Collator/getInstance)) is correct but potentially slow in a threaded context because it's a synchronized class. It's better but in a defn.
Activity
vemv commentedon Jun 10, 2020
Semi-related,
(def foo (java.text.Collator/getInstance))is correct but potentially slow in a threaded context because it's asynchronizedclass. It's better but in adefn.http://hg.openjdk.java.net/jdk7/jdk7/jdk/file/00cd9dc3c2b5/src/share/classes/java/text/Collator.java