I was 'forced' to add myLocalVar = null; statement into finally clause just before leaving method. Reason is to help GC. I was told I will get SMS's during night when server crashes next time, so I better did it :-).
I think this is pointless, as myLocalVar is scoped to method, and will be 'lost' as soon as method exits. Extra nulling j...
Basically the situation we have is we need to be able to take data from an arbitrary data source (database, flat file, it could be anything really), morph the data so it maps to the schema we have, and then send us the data so we can store it. The data will be coming from ~200 different physical locations around the country and we'd lik...
I seem to be using the wrong search terms for this in Google...
I have written a Generic Class for Many-To-Many Associations, but I'm guessing this has already been done. It is highly likely that it exists in an implementation much better than my own. This is my first foray into writing a generic class.
For a better idea of what I'm ...
I'm using Spring + JPA + Hibernate. I'm trying to enable Hibernate's second level cache. In my Spring's applicationContext.xml I have:
<prop key="hibernate.cache.provider_class">net.sf.ehcache.hibernate.SingletonEhCacheProvider</prop>
<prop key="hibernate.cache.provider_configuration_file_resource_path">/ehcache.xml</prop>
When I run ...
Is there any command which would list down all the JRE versions and releases installed on a system?
...
I'm looking for something similar to the Proxy pattern or the Dynamic Proxy Classes, only that I don't want to intercept method calls before they are invoked on the real object, but rather I'd like to intercept properties that are being changed. I'd like the proxy to be able to represent multiple objects with different sets of properties...
I am just starting to learn ADF and I am tasked with examining how ADF's gantt chart works.
I have completed Oracle's tutorial of it, however I feel that all the tutorial teaches is how to use the tutorial.
Basically I am looking for a good tutorial to show how from an empty project:
create a collection of dummy data [ not from a data...
Hi
I have an array in the form of 'int[][]' that represents the co-ordinates of a small grid. Each co-ordinate has been assigned its own value. eg array[0][4] = 28......
I have two questions. Firstly, how do I iterate through all the stored values. Secondly, I want to be able to input a value and have its specific co-ordinates in the g...
I'm trying to work with fractions in Java.
I want to implement arithmetic functions. For this, I will first require a way to normalize the functions. I know I can't add 1/6 and 1/2 until I have a common denominator. I will have to add 1/6 and 3/6. A naive approach would have me add 2/12 and 6/12 and then reduce. How can I achieve a...
While trying to connect to a database that's set to read only, the connection cannot be made. I get the following error:
Cannot create PoolableConnectionFactory (Io exception: The Network Adapter could not
establish the connection)
The application needs to run in read-write mode and then automatically handle the switch to read-only ...
Do any of the IDEs (or any other tool for that matter) have the ability to generate a POM based on an existing project?
...
In Java, an array IS AN Object. My question is... is an Object constructor called when new arrays is being created? We would like to use this fact to instrument Object constructor with some extra bytecode which checks length of array being constructed. Would that work?
...
I'm learning Java (and OOP) and although it might irrelevant for where I'm at right now, I was wondering if SO could share some common pitfalls or good design practices.
...
I am a freshman in college which has been Java programming for over a year. I haven taken a couple of programming courses, both of which were with Java. And I have done web development for several years. So overall, I would't say that I am a complete beginner in programming.
Recently, I have developed a strong interest in developing fo...
What are the best tools/libraries (in any language) for working with 2D constructive area geometry?
That is, a library working with more or less arbitrary two dimensional shapes and supplying union, intersection, difference and XOR.
My baseline is the java.awt.geom.Area class, and that's serviceable if slow. What's out there that's ...
I'm writing my first Maven Mojo, in it I'm wanting to take a file set and process all the files it refers to.
In pseudo code what I'd like to do...
void myCode(org.apache.maven.model.FileSet fileSet) {
List<java.io.File> files = FileSetTransformer.toFileList(fileSet);
for (File f : files) {
doSomething(f);
}
}
So ...
Hi all,
I'm using the Maven Cargo Plugin to startup a Jetty web container for running some integration tests in a separate project module.
The problem i'm battling with occurs when i added taglibs into the jsp pages and tried hitting them from the integration tests. When jetty tries to compile the pages it fails with this error:
org....
Is there any tool that lists which and when some classes are effectively used by an app or, even-better, automatically trims JAR libraries to only provide classes that are both referenced and used?
...
I'm in the process of learning Java and my first project is a calculator, however I've run into a snag. I'm trying to get my calculator to let me enter a number then click an operator (+, -, x, /), enter another number then hit an operator again and have the display update and be able to keep this going.
Example, I would like to be abl...
How can I read/write serializable object instances to a RandomAccessFile in Java? I want to be able to do this the same way you do it in c++ through structs. In java only ObjectInputStreams/ObjectOutputStreamscan can read/Write objects. I am amazed Java does not have something already implemented.
...