Comments (4)
@nicoulaj what about Koloboke Compile? Why doesn't it work for you?
from koloboke.
@leventov I did not not know about it, thanks.
After giving it a try, it does work, but it has the following drawbacks in my use case:
- I work on a quite big project, and we already had bad experiences with annotation processors generating code (JMH, to name it), due to Eclipse incremental compilation. Eclipse would "forget" to invoke the annotation processor on change, and you run old code without being aware. For JMH, we ended up removing the annoation processor, and developping our own code that would invoke it at runtime before running the benchmarks. We try to stay away from it when not really needed.
- When working with a large team of developers, it is easier to tell people to just use
HashIntSets
/etc factories than to learn how to use koloboke-compile, which requires a bit more investment. And we have to pay attention so that developers do not create duplicate implementations everywhere.
For these reasons, I prefer to stick with good old compile dependency, but I understand koloboke-compile answers this need.
Anyway, the default static factories are contained in the API jar, so even when using koloboke-compile, someone could call it and get this kind of error at runtime:
java.lang.ExceptionInInitializerError: null
at com.koloboke.collect.set.hash.HashIntSets.getDefaultFactory(HashIntSets.java:51)
at com.koloboke.collect.set.hash.HashIntSets.newMutableSet(HashIntSets.java:70)
Caused by: java.util.NoSuchElementException: null
at java.util.ServiceLoader$LazyIterator.nextService(ServiceLoader.java:365)
at java.util.ServiceLoader$LazyIterator.next(ServiceLoader.java:404)
at java.util.ServiceLoader$1.next(ServiceLoader.java:480)
at com.koloboke.collect.set.hash.HashIntSets$DefaultFactoryHolder.<clinit>(HashIntSets.java:38)
... 33 common frames omitted
So in the end, I think the most simple solution could be to:
- move the
HashIntSets
/etc factories to the impl jar - no need to use ServiceLoader then
from koloboke.
- Unlike benchmarks, abstract classes (or interfaces) from which Koloboke Compile derives implementations are not supposed to be changed often, if ever since creation. Maybe only for adding new abstract methods or static factory methods, but you will immediately catch omission in compile time if Eclipse will "forget" to regenerate implementations in this case.
- In Koloboke Compile it is supposed that you create abstract classes with static factory methods in it, as a single entry point. People don't have to learn Koloboke Compile, they can just use
com.yourcompany.collections.YourHashIntSet.createWithExpectedSize()
or something like that. Similar toHashIntSets
, but defined by you. - Indeed, presence of classes
HashIntSets
in runtime deps needed for Koloboke Compile seems like a problem I didn't think about before; thanks for observation. In a long term it will be resolved by Koloboke Compile not requiring any runtime deps; In the meantime classes likeHashIntSets
may be inhibited in IDE settings (prevent from import, prohibit, mark as deprecated, etc.)
Nevertheless I acknowledge that api/impl jar separation of koloboke was an "overdesigned" decision and doens't really help anybody. I will try to do the next release unified.
from koloboke.
Anyway, this is a very minor annoyance, but thanks for listening :)
from koloboke.
Related Issues (20)
- Getters supporting optimistic read locking (StampedLock)
- putAll not overriden HOT 2
- Is it possible to allocate exact capacity? HOT 1
- Allow to disable usage of sun.misc.Unsafe in koloboke compile
- What is the license Koloboke and Koloboke compiler shipped with? HOT 4
- Koloboke Compile: NullPointerException at compile time
- Redundant cast warning in code generated by KolobokeMap
- Koloboke Fails to Compile on Java 9 HOT 5
- Performance issues when copying between Koloboke sets HOT 2
- build error using ./gradlew :buildMeta HOT 1
- failed to build with error below HOT 2
- java.lang.ClassCastException in very specific case on compiled ObjIntMap<String>.keySet().retainAll(...) HOT 2
- Koloboke annotation issue running Chronicle XCL tests... HOT 1
- Incorrect behavior of MutableLHashSeparateKVLongObjMapGO cursor
- Could not initialize class com.koloboke.collect.map.hash.HashIntObjMaps$DefaultFactoryHolder HOT 1
- MutableQHashSeparateKVLongObjMap rehash BUG
- koloboke.com seems to point to a wrong website
- Can't build the project
- The project can not be built
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from koloboke.