Java software developer, game developer, gamer.

May
21
comment How to disable debug messages on sockjs- STOMP
For anyone else coming here, the documentation (jmesnil.net/stomp-websocket/doc) states that you can set client.debug to any function, and that function gets run with each message. So in addition to being able to set debug to null you can change it to any function to manage your own debugging (set it by a GET variable or anything you want)
May
20
comment Checking if a Set of items exist in database quickly
I did it this way, iterating over the external ids, adding them to a set and then querying select * from items where id in (...) and returning a list of ids that matched. I then iterated over the original set of external items again, and for every one that was in the resultset, i did a session.load() and for every one that wasn't in the resultset I created new and saved everything afterwards. The operation is now 2-3 seconds long, which is much more reasonable for a webapp.
May
20
accepted Checking if a Set of items exist in database quickly
May
20
comment Checking if a Set of items exist in database quickly
@eckes So I guess I would batch them into groups of 20 or so, do a native select where id in (id1,id2,...,id20) and then investigate the returned structure for what ids of that original list are returned.
May
20
revised Checking if a Set of items exist in database quickly
added 6 characters in body
May
20
asked Checking if a Set of items exist in database quickly
May
8
comment How can I mock an instance of an enum class with PowerMock & Mockito?
@Toby, enum classes can have methods defined that you may want to seperate out from your class under test.
May
8
comment How can I mock an instance of an enum class with PowerMock & Mockito?
That second link looks like an example, is there something that doesn't work when you try it?
May
8
comment How can I mock an instance of an enum class with PowerMock & Mockito?
Enum classes are final classes so you can't mock them. Perhaps create a higher level interface that your Enum can implement, and then mock that?
May
8
comment rmi eclipse UnmarshalException ClassNotFoundException
Can you add some more information, like a stacktrace indicating what class it's saying is not found and what line is causing the problem?
May
7
awarded Autobiographer
May
7
awarded Autobiographer
May
7
awarded Autobiographer
May
7
awarded Autobiographer
May
7
comment How to get actual return type of a generic static method in Java
I thought the point of generics is that you don't care what the type actually is
May
7
comment Cannot make a static reference to the non-static method setDisplayShowHomeEnabled(boolean) from the type ActionBar
All the ActionBar methods you are calling are non-static, meaning you need to have an instance of ActionBar to call them on. If you call them on the Class name, you don't have an instance of that class. As others have mentioned, you can use getSupportActionBar() to get an instance of that class where you are, and run the commands on that.
May
7
awarded Yearling
May
7
awarded Informed
May
7
awarded Yearling
May
7
comment How to unit test a builder which uses a static singleton factory in its builder() method?
Thanks. The other method allows you a little bit more freedom in the retrieval of your builder, but I can understand the uneasiness in how it works. If you think about extending the class, you can now get a different factory in your subclasses, but leave everything else the same
1 2 3 4