Commonx, a package of Java utility classes for the classes that are in java's hierarchy, or are considered to be so standard as to justify existence in java.
In short, this project is under the GPLv2 with classpath exception.
We have to choose such a license because a lot of codes are modified from java core library, which follows GPLv2 with classpath exception
Since We copied code there we must follow GPLv2 with classpath exception.
But if you only want to use this library commonly (but not copy the source code) then in most cases you have no need to care about GPLv2 with classpath exception because you are in the classpath exception.
In short, if in your use case you can use java core library, then you can use this library.
If a file in this project have a header of additional licenses, you shall follow it as well when you want to change that file.
If you see a file which you don't think it using other GPLv2 with classpath exception codes/libraries, and you just want a MIT licensed copy of it, please contact me (xenoamess@gmail.com).
Some(Nearly all of) code of this project is from others, or wrapper of other libraries, or modified from other's code.
Thanks for their effort.
For the open source.
I will point codes that from others and obey their licenses.
In short this library are composed by two parts:
some commonly used classes / utils.
To mark a field as "AsFinal".
This annotation is mainly used when a field shall be final, but it can't.
For example, lazy build for a singleton factory, or a resource field which shall be final but have to wait aftersome other classes init.
Utils for generating codes of this library. No meaning for others.
Primitive collections that compatible with generic interfaces.
For example, DoubleArrayList is an AbstractList and List, but in core it is primitive implement, and provides primitive method choice, and is very fast.
The basic usage of such classes is:
- when you want to use a method that accept or return generic, use methodname + Primitive instead. for example, add -> addPrimitive,set -> setPrimitive
- do not use foreach, use iterator and nextPrimitive instead.
Now we only translated class about ArrayList, and primitive array lists can run 10 times faster than ArrayList(according to test data.).
We planned to translate at least LinkedList, HashSet, TreeSet, HashMap, TreeMap.
And if I still have time for this, ConcurrentHashMap will be considered.
Extensions of some libraries / utility of some java core classes.
Some utils that too crazy / unsafe / unclear that refused by org.apache.commons.lang3.
But they are good functions... at least they are useful... sometimes...
Some extends for java.util.Arrays
Flip method for AtomicBoolean.
Util for detecting null parameters and creating IllegalArgumentExceptions
Notice that most methods of this classes are generated, so be careful when changing it.