Consider the following simplified interface inheritence hierarchy:
// Starting point:
public interface Base {
void Foo();
}
public interface Derived extends Base {
}
It is intended to move the Foo method from the Base interface to the Derived interface:
// Desired end-point:
public interface Base {
}
public interface Derived ex...
I'm working on a project where I'm using RandomAccessFile. The biggest issue I am having is that even though I close the file after it being accessed the file does not close until the entire application exits. Is this standard behavior or does anyone have some idea what's going on? The code basically looks like:
RandomAccessFile raf ...
I hate to code what is already available. I can't seem to find in Jakarta commons a method that would to the following:
long x= 12345;
int[] digits = toDigitsArray(x); //[1,2,3,4,5]
So before I code my own toDigitsArray() method does anyone know if the equivalent exists either in j2se or in commons?
...
I want to include a open-street-map widget into my apache wicket application. Im using the wicket-contrib-openlayers component from wicket-stuff and the following code:
List<Layer> layers = new ArrayList<Layer>();
Layer layerOSMTilesAtHome = new OSM("Osmarender", OSMLayer.TilesAtHome);
Layer layerOSMMapnik = new OSM("Mapnik", OSMLaye...
I am running a Java web applet on one of my servers. For some reason a particular user cannot access it (an error text appears in place of the applet that reads "Error. Click for details"; it is not text I placed between the tags, i.e., his JRE is installed and appears to at the very least be installed correctly but for some reason it i...
This morning my boss and I had a long and ultimately fruitless discussion about this, in the context of trying to diagnose performance problems with a web application. We didn't really come to any conclusions.
I think we're right in thinking that Serializable non-static inner classes have issues, but we're not sure precisely what the i...
If you've used JBoss SEAM you've probably used the s:decorate tag. Quite a handy tag.
Anyway I need to a way to set its invalid state through java.
I've bound the xml tags to UIDecorate instance but I'll be damned if I can figure out how to set the 'invalid' state so that the decorator will apply the appropriate error CSS classes when...
Hello!
My java app is dumping stacktrace to a log file.
However, the solution center wants an "easier" way to understand the generated stacktrace.
Other than training them in java, is there a stacktrace editor or gui that could make their life easier?
Thanks so much in advance!
...
I am using reflection to get all the get all the methods in a class like this:
Method[] allMethods = c.getDeclaredMethods();
After that I am iterating through the methods
for (Method m: allMethods){
//I want to find out if the return is is a parameterized type or not
m.getReturnType();
}
For example: if I have a method like...
Hello.
I'm using Java's DecimalFormat class to print out numbers in Scientific Notation. However, there is one problem that I have. I need the strings to be of fixed length regardless of the value, and the sign on the power of ten is throwing it off. Currently, this is what my format looks like:
DecimalFormat format = new DecimalFor...
Hi all,
I am looking for a good Hosting provider for Java either running Jetty or Tomcat. I currently use PairOne/OddHost and my monthly rate is 5.99 which isn't bad, but I am thinking I would like to move up to a virtual private host.
What are my alternatives? I don't contact support that much - only when configuring my application ...
HI
I want to run a method in my program evry X hours, how to do that ?
Im googling and there is nothing :/
...
This question is inspired from Joel's "Making Wrong Code Look Wrong"
http://www.joelonsoftware.com/articles/Wrong.html
Sometimes you can use types to enforce semantics on objects beyond their interfaces. For example, the Java interface Serializable does not actually define methods, but the fact that an object implements Serializable sa...
I'm trying to make a simple class to open a URL but when I run it it gives a null pointer exception as soon as I initialize the Applet. Here is the class:
package com.agentsheets.component;
import java.net.*;
import java.applet.*;
public class URLOpener extends Applet{
public void openURL(String inputURL) {
try { ...
I am trying to draw a transparent plane (X[0..100],Y[0..100],Z=0) in Java 3D, but can't figure out how. I've looked on the tutorial page and still can't find any sample programs.
I am attempting to find a "plane" object as a BranchGroup to add to my existing TransformGroup, but there isn't such a plane object; what should I use? And how...
Hi,
Just for the disclaimer, I'm not trying to win the prize in Android Developer Challenge, but just want to participate.
I heard about the Android buzz lately and got interested in it. And today I stumbled upon a site talking about Android Developer Challenge 2. Luckily, the submission hasn't ended but unfortunately it starts tomorrow...
I have been asked to automate a particular task at work today which takes up a lot of our time! The following is what needs to be done and I would appreciate any help on how I can do this (Implementation Advice) within the realms of my knowledge, if possible.
Problem
I have a PowerPoint document (.ppt). I would like to extract text fro...
I am stumped about this, so I thought I'd ask in case any of you have come across it, since HttpClient development is a little bit of an art.
The problem I am facing is this: An application is using the Apache HttpClient Java library to communicate to a server in the same company network. Most of the time it works without a problem, bu...
I need to replicate a sequence/counter across an eight node cluster. This means that each http request receives the next value in the sequence by calling something like getNextIntAndIncrement(), where the sequence state is synchronized across all servers. To clarify, this must exist at application/global scope, not session. I know it ...
This is related to a previous question. I've pulled out the main problem as I've updated much of the code but I still have an issue. How can I have a custom SOAPHandler class add a new element to a SOAP message? I need to add a username and password to the message. If I use:
public boolean handleMessage(SOAPMessageContext context) {...