Java is a high-level, platform-independent, object-oriented programming language originally developed by Sun Microsystems. Java is currently owned by Oracle, which purchased Sun in 2010.

learn more… | top users | synonyms

2
votes
2answers
117 views

Distinguish different type of Comments

I would like to provide design decisions in the comments as well. I want design decision comments to be distinguishable from function contract comments, on cursory examination of source code. How to ...
0
votes
1answer
137 views

Business logic - Server side vs client side [duplicate]

In my current project, I have a screen which pulls data from several webservices, pulls data from database via backend API and checks that all resources have the same data or not. The other ...
2
votes
1answer
150 views

When to lock an object in a game

I'm writing a game in Java where each game object has a number of properties, but these can all be changed in one of two ways: Every second, a tick runs which may automatically cause a change. Users ...
1
vote
1answer
60 views

Software architecture for uploading dynamically created websites

I have a question that is crucial for my end of year project. Background My web application allows users to build other webapps based on drag&drop (within the domain of the webapp). These ...
-2
votes
0answers
59 views

How to use a class, located in another project? [on hold]

I need to use in the my current project a class A from another project (IDE – Eclipse). To do this I add this another project in "Java build path" tab "Project". Compiling was successful, but I get a ...
-1
votes
0answers
48 views

Sorting a 2d array in java [on hold]

I'm a high school student who is interested in computer science, I asked this question to my teacher but she told me not to bother messing around with code and trying to understand how to modify ...
0
votes
1answer
104 views

How to name this class? Is it a pattern?

I need to create a class which will have the following structure: public class MyClass { ArrayList<File> myList = new ArrayList<>(); public void addFile(File f) { myList....
1
vote
1answer
37 views

jersey post with a huge payload

I have a requirement to write a POST endpoint where the payload is huge(not normal). In the order 10s of Megabytes. And this endpoint will be accessed by a lot of clients (in the order of 1000s) ...
2
votes
0answers
28 views

Maven Build Lifecycle: validate

In the build lifecycle in maven, I encountered the validate phase described as validate the project is correct and all necessary information is available to complete a build 1. what are the check ...
1
vote
1answer
118 views

What are the significant memory management models aside from Java (GC) and C++ (manual approach)? [on hold]

There are at least two distinct memory management models: Java (we do it for you) C++ (it is your responsibility) I have two questions: (1) Is GC language specific or compiler specific? (2) Do ...
-3
votes
0answers
90 views

Which form of Java 6 resource exception handling is better and why? [on hold]

BufferedReader input = null; try { input = new BufferedReader(new FileReader(someFile)); input.readLine(); } catch (IOException ex) { ex.printStackTrace(); } finally { if (input != ...
1
vote
1answer
35 views

What is the recommended way to handle exception in Spring MVC

I have a Spring application, where we make few service calls to fetch data. There is a Data Layer in between the Controller and the Service layers. Controller (Request-Mapping) -> Data Layer -> ...
4
votes
3answers
468 views

Is it a good practice to use suppress warnings in your code?

I use @SuppressWarnings("unchecked") and @SuppressWarnings("null") mostly above methods to let the code compile without any warnings but I have my doubts. Found this Stackoverflow question. Jon Skeet ...
-3
votes
0answers
65 views

How to design property files

I always wonder what is the best way to design your property files. I have few questions that I didn't find an answer to them Do we place all our labels / error messages in one file? Do we split the ...
-1
votes
0answers
37 views

Android - Information leakage flaw

I have developed an application in the Cordova Framework, and I have added a camera plugin for capture functionality. I am getting an Information Leakage flaw in the code below, using veracode to scan ...
0
votes
2answers
63 views

Many instances of application, or single application with many threads?

I'm developing a Java application that will handle huge XML files (up to 300mb each and hundreds of thousands of lines). They are grouped usually with 20 to 40 similar XML files that also need ...
0
votes
0answers
23 views

The best implementation for fromJson factory method and json-mappings with inheritance?

I have BaseComponent (with field "type") and it's subclasses TextComponent, ListComponent, etc. Some of them has same fields. I want to create them and init their fields from json. Some of possible ...
0
votes
1answer
36 views

How to deal with automatic binding exceptions with Jersey?

It's really nice to have automatic binding with Jersey-Jackson (well, I believe it's actually MOXy the one who manages the bindings), so object serialization and deserialization is done under the hood....
2
votes
2answers
124 views

Should I return a 204 or a 404 response when a resource is not found?

I am developing a simple RESTful service for tournaments and schedules. When a tournament is created through a POST request containing a JSON body, the tournament is inserted in a BiMap, declared as ...
7
votes
3answers
220 views

Why does java.time have methods for creating objects instead of just constructors?

In the new java.time package the core classes are using the factory method of instead of a public constructor. Even though I like the cosmetics of the of method I can't see a good reason to not use a ...
0
votes
1answer
59 views

Divide java web app into smaller web app

I'm not sure if I should ask here or stackoverflow. Please let me know. I've a web application that consists of 3 main technologies: JSF, jax-rs and websocket. All three are coupled together with the ...
1
vote
2answers
99 views

Data structure to hold Excel column names with their values

I am learning how to read Excel workbooks in Java and want to know what a good Data Structure will be for holding Column names with the values under them. Example: I want to be able to call a ...
0
votes
0answers
31 views

asynchronous event notifications? Sprint Boot

how to implement notifications on the client side (HTML, JS), sent by an asynchronous method on the server side? I'm using Spring Boot. Understand the cycle: the user performs a procedure in the ...
0
votes
1answer
113 views

Using database connection on multiple threads

let's say I have a database connection in the class Database which offers the following public methods public synchronized void open() {} public synchronized void close() {} public synchronized void ...
0
votes
2answers
169 views

What is the role of “throws exeption” in method definition in Java?

Some methods are deciared this way: public int myMethod() throws Exception { (return an int or throw Exception if method fails). However, stub methods in NetBeans look like public class JavaApp { ...
1
vote
0answers
55 views

PDF encryption anomaly; version 1.5 using AES

I'm not sure if this is the correct forum to ask this question so please accept my apologies in advance if this is the wrong place. I recently created an encrypted PDF file using PDF Studio 11. The ...
0
votes
0answers
61 views

How to return Java object from REST service jersey

I have spent days trying to fix a problem. I have a REST method that accepts a Java object, does some calculations through a rules engine (Drools) and return another Java object. The rule engine ...
1
vote
1answer
143 views

what is this kind of object creation?

final CyclicBarrier cb = new CyclicBarrier(value,new Runnable(){ public void run(){ ...statements } }); suppose you have a cyclic barrier in which one of the the arguments is the direct ...
0
votes
0answers
103 views

Best way to spawn enemies with independent (x, y) positions?

I am trying to spawn simple GRect enemies on different (x, y) positions, although, the problem is that I need the enemies to operate on different movement speeds. while(true) { enemy[i]....
0
votes
0answers
22 views

Java Drag and Drop, registering certain parts of the object

Say I have an application where the use creates an electrical circuit visually, how would I go about registering when two ends meet? I've seen this thread http://stackoverflow.com/questions/8562743/...