java

Step through JDK source code in IntelliJ IDEA

How can I step through JDK source code in IntelliJ IDEA 7 and see the debug info? I can currently hit breakpoints and step through the code, but the debug info is not available. This means I can't see the value of local variables. I only want to step through the source code of one class, if that matters. (For what it's worth, it's th...

How are nested capturing groups numbered in regular expressions?

Is there a defined behavior for how regular expressions should handle the capturing behavior of nested parentheses? More specifically, can you reasonably expect that different engines will capture the outer parentheses in the first position, and nested parentheses in subsequent positions? Consider the following PHP code (using PCRE reg...

what does frame.setLayout(null)do?(frame is a JFrame)

I have seen this in a slide but I couldn't get that when and why we use this? ...

Hibernate save to get sequences a second time.

I have a class like this (with getters and setters, all mapped to hibernate, each with a sequence to oracle DB) public class A{ private B b; private C c; } i'm creating this object and saving it to the database. So i create an A object and populate it with a B object and call saveOrUpdate(a) so i can have "a" and ...

How to make WebLogic use all the processors on a multi processor machine

Hi, We noticed a peculiar behavior with Java/Web Logic on one of our multi-processor servers, yesterday, so wanted to get your thoughts on it. For some reason, Web Logic/Java use only one processor of the available two processors. When we ran some heavy load, I could see the CPU on one reaching almost 100% and the other processor is co...

Persist classes with inheritance using Gilead

I'm using Gilead to persist my entities in my GWT project and I've run into an issue. I'd like to create a parent class to hold some properties that are common throughout my entities (id, etc). When persisting I get a null pointer exception. Parent class: public abstract class Entity extends LightEntity implements Serializable { ...

Jetty: How to write to access logs

Hi all, In my Java servlet code, I want to be able to programatically write to the jetty access log. I am aware that jetty will automatically log every incoming HTTP request to the access log. However, my servlet needs to occasionally append it's own line to the access log. Has anyone here done something similar? Thanks! ...

Writing a new refactoring plugin for Eclipse?

Is there any good documentation on implementing new refactorings in Eclipse? Specifically, I'd like to access the AST for a Java class, make some non-trivial changes, and save the result back to the source file. So far, the only documentation I've found is (1) the source code for the existing refactorings and (2) a few articles on the L...

How to do JoinTable annotation mapping

Hi Gurus, I have a design/programming question. First I wanna ask if my design is good and then I wanna know how to. What I wanna do is to have an i18n page, which may or may not have a translation. e.g. Page A has English & Japanese, and Page B may only have English This is the DB layout page ---- id int topic varchar(128) content v...

[JAVA] Upload and POST file to PHP page

Hello I need a way to upload a file and POST it into php page... My php page is: <?php $maxsize = 10485760; $array_estensioni_ammesse=array('.tmp'); $uploaddir = 'uploads/'; if (is_uploaded_file($_FILES['file']['tmp_name'])) { if($_FILES['file']['size'] <= $maxsize) { $estensione = strtolower(substr($_FILES['file']['name...

Spring + GWT, How to disable User Authorization request for a Insert Query? Please check inside..

Hey StackOverFlow, I'm currently working on supporting a Spring + GWT intranet application that was given to me on the last hour, I need to implement a dozen fixes to this software, including tests and stuff. One thing that I could not find is that.. I have a view and a presenter, the presenter is responsible for the function that wil...

need help with a system call from java

I'm using Runtime to make a call to the system. When I call it with "ls -l" and read in what it gets, it prints the directory contents exactly as expected. However when I call it with "which ffmpeg" or "ffmpeg -i FILENAME" it comes back saying ffmpeg can't be located, even though when I use ffmpeg exactly the same way at the command li...

Java: File to Hex?

I have a file in Java FileInputStream in = null; try{ in = new FileInputStream("C:\\pic.bmp"); }catch{} I want to convert pic.bmp to an array of hex values so I can edit and save it as a modified version. Is there a java class to do this? ...

Versioned Serialization in Java

I have a simple Java class that I need to serialize to be stored as a value in an RDBMS or a key-value store. The class is just a collection of properties of simple types (native types or Maps/Lists of native types). The issue is that the class will likely be evolving over time (likely: adding new properties, less likely but still poss...

Using java map for range searches

I have a use case where if a number lies between 0-10 it should return 0 and if it lies between 11-20 it should return 1 etc 0 => 0-3, (0 and 3 are inclusive) 1 => 4-15, (4 and 15 are inclusive) 2 => 16-40, (16 and 40 are inclusive) 3 => 41-88, (41 and 88 are inclusive) 5 => 89-300 (89 and 300 are inclusive) I was thinking how could...

How to make the array sort by Product[counter].getProductTitle() ?

Question: Where does "productArray" come from in these: for ( Product product : productArray ) & Arrays.sort( productArray, new ProductComparator() ); Question: What am I doing wrong? How do I make this sort? Related Post from Yesterday EDIT :::EDIT::: Ok I took your advice here about Produ...

Mapping collection to XML in Castor

Hi, I'm trying to map a POJO to XML using Castor. Let's say I have a Order that has a collection of Items... is there any way of achieving an xml like the following: <order> ...order attributes <items> <item> ..item attributes </item> <item> ..other item </item> </items> </order> I could make something similar but wit...

The super class of all event classes

I can not get that that super class is AWTEvent class or EventObject? ...

Why won't this Swing tabbed pane display?

Hi all, Could someone explain what I am doing wrong with my classes that my JTabbedPane doesn't display when the JFrame.setvisible is set to true? Yes, the main method of the program (which I won't put here) uses the event dispatching thread to initiate ArionGUI. Here is my code for the JFrame: import javax.swing.*; public class ...

How does Java make its windows?

How does the JVM make it's windows, i know it has it's jar files and the executables, etc... what i would like to know is how exactly is a window made with java, the frame surrounding a desktop application. is it a graphics library standard on the machines it is installed in? ...