I defined a property in the constructor of my class the following way:
class Step(val message:String = "")
When I try access to message value from Java code y get a visbility error. Why?
Hi,
I need to instantiate a Spring bean in the same manner as this Java code:
MyClass foo = Mockito.mock(MyClass.class);
The XML I need will look something like:
<bean id="foo" class="Mockito" factory-method="mock">
<constructor-arg value="MyClass"/>
</bean>
I can't seem to find the correct syntax for passing a Class object as a parameter to the factory method.
Thanks,
Don
we are trying to re-direct the output of the list to a file using the below cmd(java) in ubuntu,
Pls let us know if this works or not ?
Process p = Runtime.getRuntime().exec("ls -l /home/blah blah/new.txt")
I want to use Oracle stored procedure or function via 'iBATIS 3 for Java' with annotation.
But I can't find any sample codes.
Can anyone help me? I need a simple sample code.
hi,
i used java reflections to get methods from a class(loaded those classes).Now i want to get the call hierarchy of those methods.How can i use call hierarchy option in eclipse IDE for that?any examples or links????
My application has recently started throwing NoClassDefFoundError errors when I am running my application from within NetBeans. It never used to do this.
And when I run this outside of NetBeans using the command line argument that it provides once built, these errors are not produced
Is this a bug with Netbeans?
I have reinstalled NetBeans as I recently had another that was resolved by reinstalling, however the problem still persists.
http://stackoverflow.com/questions/2654892/symbol-error-in-java-application-using-netbeans-6-8-when-adding-a-shared-project
Within Netbeans
Outside NetBeans
Hello All,
I want to connect to MS SQl server 2005 using hibernate in java. i am unable to find the jars and the hibernate.cfg.xml file for the same. can someone help me with the same
Thanks in Advance
Regards,
Rima
From what I understand, the object state is just stored (values for fields, etc.), however, the execution context is anyways going to be lost.
What's the point of this? What bad can happen if so?
Note* this was taken from Effective Java By Joshua Bloch
While debating which platform to use for what applications (specifically we debated c++, java, c# and f#) we tried finding scientific quality research on productivity (cost of ownership really) of similar applications build on various platforms/using the above mentioned languages. Any one know of such research?
I'm getting the Cannot find symbol error from my code. Does anyone know what can cause this problem?
// Register JDBC driver Class.forName("net.sourceforge.jtds.jdbc.Driver"); method forName(java.Lang.String)
Class.forName("net.sourceforge.jtds.jdbc.Driver);
^
Marking a variable as volatile in Java ensures that every thread sees the value that was last written to it instead of some stale value. I was wondering how this is actually achieved. Does the JVM emit special instructions that flush the CPU cashes or something?
Kryo is a very new and interesting Java serialization library, and one of the fastest in the thrift-protobuf benchmark. If you've used Kryo, has it already reached enough maturity to try it out in production code?
For a while I have been struggling to integrate scala with java methods that might return null. I came up with the following utility which helps a lot:
// produce an Option, nulls become None
object Maybe {
def apply[T](t:T) = if (t==null) None else Some(t)
}
Maybe(javaClass.getResultCouldBeNull()).map( result => doSomeWork(result) )
I have a few questions about this solution:
Is there a better or more standard pattern to use?
Am I duplicating something that already exists?
Does this functionality have hidden gotchas?
For a project at work, we're considering using the Maven plugin for Eclipse to automate our builds. Right now the procedure is far more complicated than it ought to be, and we're hoping that Maven will simplify things to a one-click build.
My question is, is there a wizard or automatic importer for converting an existing Eclipse Java project to a Maven project, using the Maven plugin? Or should I create a new Maven project and manually copy over all source files, libs, etc.
I have a Groovy application for Windows and am trying to convert a Hash object to an Apple plist file. What is the best way to go about this? Seems like this is something that must already be solved in Java but I can't seem to find any examples.
Thanks in advance
I have downloaded and installed the j2me polish successfully and i have tried to create the project but there is a reference problem showing that the specified folder does not contain the java platform but it is successfully working with normal project
instead of polish which LWUIT to use?
In VB6 there are local static variables that keep their values after the exit of procedure. It's like using public vars but on local block. For example:
sub count()
static x as integer
x = x + 1
end sub
After 10 calls, x will be 10. I tried to search the same thing in .NET (and even Java) but there was none. Why? Does it break the OOP model in some way, and is there a way to emulate that.
I want to create a simple chat application that supports voice and video (something like Skype or Google Talk). I don't want to write everything from scratch, so my question is do you know some good libraries for that?
I stumbled over libjingle (c++) and Smash (Java), both implementing the XMPP extension Jingle. Would you recommend one of those?
intellij has placed what look like no entry signs over my java files (red circles with a line through) searched around but cannot find why? Would anyone know please.
It's a maven project if that makes a difference
JAVA - NETBEANS
This is an IDE question
I am always working with collapsed methods, because I want to be able to see my methods all together. This is a little time consuming because I have to use the mouse to scroll up to the declaration of the method and click on the - (minus) icon. And then respectively go to the method I want to work on and click on the + (plus) icon.
Is there a way through a keyboard shortcut to do the collapse (and respectively the expand)?
lets say i have a method which has two parameters. i have been implementing them as:
if(aObj instance of Marble) {
if(bObj instance of Bomb) {
this.resolve((Marble)aObj,(Bomb)bObj);
}
}
as you can see its not a very pretty solution. i plan to implement using double dispatching, but with two parameters which both need double dispatching, im afraid im a bit stumped. any ideas please.
im implementing in java btw.
Are there any tools that can look at a database, and generate the basic mapping files?
It would be great if it could take a database, and create the actual model (java classes) with annotations, but not sure if that exists?