Paul Clapham

+ Follow
since Oct 14, 2005
Paul likes ...
Eclipse IDE Firefox Browser MySQL Database
Vancouver, Canada
Cows and Likes
Total received
In last 30 days
Total given
Total received
Received in last 30 days
Total given
Given in last 30 days
Forums and Threads
Scavenger Hunt
expand Rancher Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Paul Clapham

Ted Gress wrote:I'm not following your logic. Because I've got an error I can't solve, and neither can you there is something wrong with my post?

Let's put it this way: in your original post there was some code and a stack trace indicating that an error was thrown at line 23 of that code. But if that error was thrown at line 23, then it should already have been thrown at line 11. So there's something wrong with something, and what you posted originally wasn't enough to dispel the confusion.
8 hours ago
You're looking for a configuration entry which incorrectly contains the string "2000". So that file isn't the one you're looking for.
16 hours ago
Your observation is correct. One place requires a Predicate and the other place requires a Consumer. As Prasad demonstrated, the same sequence of characters can be interpreted as either a Predicate or a Consumer; the compiler knows that filter() requires a Predicate and that forEach requires a Consumer, so that's how the compiler knows to interpret that sequence of characters.

Alex Zhou wrote:When a boolean is expected, the compiler chooses to return a boolean; when nothing is expected, the compiler chooses to ignore the returned value of test().

No, it's not that a boolean is expected, it's that a Predicate is expected. Likewise it's not that nothing is expected, it's that a Consumer is expected.
Here's the relevant error message:

Caused by: org.hibernate.MappingException: No Dialect mapping for JDBC type: 2000

So your configuration setup which describes your database isn't correct. I'd expect the name of a database there (like "DB2" for example) and not a number.
1 day ago
If I understand it right, the lambda expression "i->test()" in that context is equivalent to something roughly like

Where X means

There may be some mis-steps there but I think that's the general idea. So you'll see that in this context it's quite all right to disregard the value returned by the test() method -- disregarding a method's returned value is not unusual in Java at all.

And why is it wrong to have a constant as a lambda expression in that context? Well, um... maybe "i->true" would work differently?

Tim Holloway wrote:The "default" mechanism is an additional kludge. As I said earlier, it's a good way to add features to new classes while keeping the all-important backwards compatibility that is a hallmark of Java. But since it is a back-door version of multiple inheritance, it also allows some of the same problems that multiple inheritance has.

One of the kludgy rules prevents a class from implementing two interfaces which have default methods with the same signature... or something like that which prevents the "diamond problem" from happening.
Or as the API documentation says:

If a thread-safe highly-concurrent implementation is desired, then it is recommended to use ConcurrentHashMap in place of Hashtable.

1 day ago
Yes, that's correct. Do you think your code is an example of that?
1 day ago

Arun Singh Raaj wrote:If it is thread-safe object...

You seem to be basing your question on the idea that Hashtable is thread-safe. But it isn't.
1 day ago
Indeed, the question you asked is specifically covered in the tutorial you linked to. Scroll down to the sub-heading "volatile is Not Always Enough" and read all about it.
1 day ago
Like any other programming language, XSLT works better when you have some known rules which you want to implement in code. So, yes, provided you know what the rules are for the transformation you want to do, then you can write XSLT code to do that.

Your statement that the structure of the input file is different for every report isn't too encouraging, but I can say that doing transformations in XSLT is a lot easier than writing low-level Java code, especially using SAX parser code. So you may find that XSLT will be a suitable tool. (I would even go so far as to say that if you can't do the job in XSLT then chances are you can't do it at all.)

It may also happen that you have to write several different XSLT transformations for different classes of RDL -- I don't know anything about RDL so I'm just speculating. Also bear in mind that if you don't already know XSLT (and it sounds like you don't) then it's going to take you a while before you get used to it. Often when people start out with XSLT they struggle to get things done, until they stop writing procedural code and start writing functional code.
I see from the stack trace that you're using Java 9 -- is your version of Eclipse known to handle Java 9 correctly?

(I know, blaming the compiler is the last defense of a scoundrel, but there are times when it's the right thing to do.)
1 day ago

Vaibhav Gargs wrote:And, it is said that if we have one writer and multiple readers for volatile variables, then we won't have any race conditions.

Who said that? And what exactly did they say?
2 days ago
I have no idea. Just saying that your requirements "include Java" means nothing.
2 days ago
I have a feeling you didn't read that tutorial yet. It should take you more than half an hour to read it and think about it.
2 days ago