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

0
votes
0answers
10 views

Approach for querying an arbitrary set of user submitted fields and values in Spring application? Like a shopping site sidebar search?

I am working on a Spring Boot and Angular application which has a requirement to search based on any number of the available filters being applied to a list. For example, a user searches on 'Title' ...
-5
votes
0answers
14 views

java-gnome Builder: GtkSoureView invalid object type

I'm trying to use java-gnome with Glade but when I run it then Java write this error: Exception in thread "main" java.text.ParseException: Invalid object type „GtkSourceView“ on line 255 at ...
-6
votes
1answer
69 views

How to enable 'for-each' loop in my own linked list class? [on hold]

Please guide me on code additions that will allow someone to iterate over a custom linked list implementation using "for-each" loop, just like existing collection classes or arrays. All I know is that ...
1
vote
1answer
469 views

How to efficiently handle related data in MVC?

Talking about MVC with servlets and JSP's, in a context about products and manufacturers , when querying the application for a list of products: the servlet loads a list of products from the ...
-6
votes
0answers
38 views

How to update null value in MySQL boolean (tinyint) field instead of boolean value [on hold]

I want to update null value in MySQL boolean field through Hibernate which is initialized ones with boolean value.
1
vote
1answer
86 views

(Spring) AOP Design of Transactions

In our application we have several transactions, where each step is extensively logged. Pseudocode: @Component public class OurServiceImpl implements OurService { ... @Transactional public ...
0
votes
1answer
383 views

Apache Wicket, updating data without using a form, is it safe?

I have a ListUser.java class with a datatable, displaying UserData information, displays 4 columns, the last column is an AbstractColumn that has on it's populateItm method has added a inner class ...
0
votes
0answers
20 views

use of minOccurs=“0” without nillable=“true” in SOAP

I have received an XSD from a 3rd party supplier generated from a Java based system; which is to be used to create a SOAP endpoint for us to receive data transfers. Their XSD does not make any use of ...
0
votes
0answers
15 views

Implementing logging interceptor next to BeanPostProcessors and BeanNameAutoProxyCreator

I want to implement simple mechanism based on annotation on method in different classes. The case is, that I have some beans created as a proxies with transaction interceptors like this: <bean ...
-6
votes
5answers
144 views

Java constructor: I can't understand

I am learning Java and I have a problem understanding the concept of constructor for the field variables. What is the problem with the following code. It shows "null" as an output. public class ...
-4
votes
0answers
16 views

Getting directions using my own voice samples regarding a gpx track [on hold]

My goal is to create an app in android that loads a gpx track Compares my gps position to the track and gives me directions using my own voice (samples) as in Go to the right soon Go to the left ...
-2
votes
0answers
33 views

Can I change continue statement to other loop? [on hold]

I need some help with this loop statement I want to change continue to other loop and still work the same This is the code String searchMe ="Look fr a substring in me,"+"i have many subclasses of ...
1
vote
1answer
201 views

Decoupled architecture in Android

I am building an app for Android that will have multiple data sources depending on who is using it. N-tier architecture with a repository pattern seems like the right way to go about this but I am ...
3
votes
1answer
103 views

what happens at Java interpreter level when IncompatibleClassChangeError is thrown?

I am a noob at JVM internals. Can someone explain what happens at Java interpreter level when IncompatibleClassChangeError is thrown? I am facing an issue similar to the one described here: ...
-6
votes
0answers
15 views

When adding JCheckBoxes to JPanel, the JPanel resizes instead of using a JScrollPane [on hold]

So essentially I am adding JCheckBoxes to a JPanel dynamically. I've added a vertical scroll bar to try and keep the panel the same size no matter how many checkboxes it has, but alas, it makes the ...
4
votes
2answers
1k views

Programmatically extending Hibernate table/entity definitions in Spring, how?

I would like to know if there is a way —maybe with AOP— to extend table/entity definitions so that I can add functionality across the board that requires persistence. Let me explain what I want to do ...
14
votes
2answers
455 views

What are the reasons for why a Java/Linux stack fails to be “real time”?

I have often heard developers mention that Java can't "do Real Time", meaning a Java app running on Linux cannot meet the requirements of a deterministic real-time system, such as something running on ...
0
votes
0answers
29 views

How can I paint a custom circular JComponent without an “invisible box” around it? [migrated]

I'm writing a JApplet that displays a diagram with numbers in circles and lines connecting the circles. I've created a class that extends JComponent to act as the circles. I overrode the ...
4
votes
9answers
324 views

Why is using an optional preferential to null-checking the variable?

Take the two code examples: if(optional.isPresent()) { //do your thing } if(variable != null) { //do your thing } As far as I can tell the most obvious difference is that the Optional ...
3
votes
2answers
262 views

Is turning a method into a class too use it across many classes bad practice? [on hold]

Let's say I have a sort method inside of my class and another class that has no relationship with that class needs the same method. Instead of writing that method twice and breaking the do not repeat ...
4
votes
1answer
152 views

Detecting surface faces of a huge 3D mesh/grid

I've written a module in my application that creates a mesh from existing coordinate and face data. The number of vertices in the mesh could easily exceed 10 million and the same goes for the faces. ...
0
votes
1answer
88 views

Communicating with third party API

I am working on an App which basically communicate with a third party API, it has no back-end. The front-end will be a SPA. Here is the overall scenario: The external API needs current user's Id to ...
0
votes
0answers
19 views

WCF security with Java client

I'm about to develop a WCF service which is going to be called by an external Java client. I've developed a couple of services before but they were called internally, so security is now a concern. ...
1
vote
1answer
34 views

TreeItem containing non-String object displaying strange text

Hello StackExchange community! This is my first post and appreciate any help anyone can offer. I'm new to Java, and I'm sure this issue is simply due to my misunderstanding of the fundamentals. I ...
2
votes
1answer
549 views

Emulation of MMU accessing the contents of the registers

I'm having a play around with emulating a simple old CPU. I've set the structure up, so far anyway, as follows: The device is the main and creates an instance of the CPU. The CPU then creates ...
51
votes
8answers
15k views

Why should I use a factory class instead of direct object construction?

I have seen the history of several С# and Java class library projects on GitHub and CodePlex, and I see a trend of switching to factory classes as opposed to direct object instantiation. Why should I ...
53
votes
7answers
24k views

Excessive use “final” keyword in Java [duplicate]

While I understand what the final keyword is used for in the context of classes and methods as well as the intent of its use for in regards to variables; however, the project I just started working on ...
-5
votes
0answers
39 views

Measuring sound frequency [closed]

I've been looking around for a Java API that measures the frequency of the sound, the project idea is to browse an audio file from the computer (contains only piano music) and to convert these music ...
2
votes
1answer
69 views

How to access environment-specific configuration in an enterprise application?

My application is a generic enterprise application which can be deployed on any application server running on any OS. I don't know how/where to configure my application, except for the database ...
3
votes
1answer
704 views

Do I need JUnit tests for the controller layer on a MVC when I have a database layer

I have a MVC which has this structure: ui controller db model Basically the controller doesn't really do much more than connection ui with db layer. Do I need to provide JUnit tests for the ...
-2
votes
3answers
135 views

What is the most elemental workflow for TDD?

Gradle is such an interesting build tool that it prompted me to look at Spock and JUnit -- which I've never done before. What is the basic workflow with TDD? My approach has been to do frequent ...
0
votes
1answer
83 views

Whether to use enum vs map vs config file?

I have ~30 resources each having ~10 attributes. I want to store some information about each attribute. Ex: It's multiplicity, it RW (Read/Write), RO (Read only), longName, shortname. So I was ...
-2
votes
0answers
42 views

Android App - GPS Help [on hold]

I'm currently working on a project that includes making an app for android phone using the phone's GPS. I'm looking for some insight into how to approach the project. The app needs to receive a ...
1
vote
1answer
44 views

Service/component based application in Java

I have a Java project whose architecture is quite component-oriented, and I am wondering if this is a common way to organize code which rules/patterns are used, if there is a name for this coding ...
0
votes
1answer
221 views

In which cases and examples String in Java is not immutable? [duplicate]

If Strings are immutable in Java, why is the output of this code 2GB, instead of 1GB? class Laptop { String memory = "1GB"; } class Workshop { public static void main(String args[]) { ...
0
votes
0answers
29 views

Handling multiple rest api versions within Android Java client

Actual architecture I have an app where a model is attached to every activity. The model ask a repository for information that can come from server or local db depending on many factors. When it asks ...
1
vote
2answers
91 views

Which layer should validation located?

I'm creating Rest API using (Spring Boot) and i using Hibernate Validation to validate request input. But I also need other validation, example when update data need to check, if company id not ...
2
votes
1answer
56 views

How to paginate local and remote data?

My team is currently facing a problem that we don't know how to tackle. Some technical details: we use Java 8, Hibernate, Spring, MySQL, and AngularJS for the front-end. We need to do pagination on ...
5
votes
2answers
184 views

Is it an antipattern to use peek() to modify a stream element?

Suppose I have a stream of Things and I want to "enrich" them mid stream, I can use peek() to do this, eg: streamOfThings.peek(this::thingMutator).forEach(this::someConsumer); Assume that mutating ...
32
votes
8answers
7k views

Is it an antipattern, modifying an incoming parameter? [closed]

I am programming in Java, and I always make converters sort of like this: public OtherObject MyObject2OtherObject(MyObject mo){ ... Do the conversion return otherObject; } At the new ...
-2
votes
0answers
27 views

Java 8 on Weblogic 12.1.3, Weblogic roadmap

I would like to upgrade Java to 8 from 7. We use Weblogic 12.1.3 and 12.1.1 I wonder if my web application would work with Weblogic and Java 8. What could be the problems? We are using JavaEE, JMS, ...
-1
votes
0answers
28 views

Does java ee include java se? [duplicate]

I'm new to java EE. I am setting up my machine for java EE projects. If I install java EE package from oracle, do i have to install java SE also? Or does the java EE package already contain the SE ...
-4
votes
0answers
62 views

Trying to flip a picture horizontally in java, any help? [closed]

Need help getting a picture to flip in Java. How do I do it? Here's my code public void flipHorizontal() { Color tempColor; //FILL THESE OUT AND THEN UNCOMMENT THEM! int limit1 = ...
-1
votes
0answers
34 views

DAO only static methods [duplicate]

DAO public interface UserDao { boolean addUser(User user); User findUser(String email, String password); } DAO Impl public class UserDaoImpl implements UserDao { @Override public ...
1
vote
1answer
140 views

Is stack allocation in Java implementation dependent?

I've looked through the different threads, and there are a lot of conflicting information out there. The most useful article I found was this: Java theory and practice: Urban performance legends, ...
0
votes
0answers
48 views

Options for implementing database and programming logic for statistics application?

I am implementing a statistics driven web application. The statistics relate to sporting events. Right now I have a postgresql database with a table that holds a row for each match. This is a ...
-3
votes
0answers
108 views

Cons and Pros of ternary operator instead of if/else [closed]

I have some set of code in which same code is written by using two logics. which are as follows. 1. if (cart.getFacebookShare()) { return BigDecimal.TEN; }else{ return BigDecimal.ZERO; } ...
96
votes
13answers
14k views

Should we avoid language features that C++ has but Java doesn't to increase maintainability? [closed]

Suppose I am limited to use C++ by the environment in the project. Is it good to prevent the use of some language features that C++ has but Java doesn't have (e.g.: multiple inheritance, operator ...
-6
votes
0answers
31 views

How to get precise Math.exp() in j2me [closed]

I am using j2me and I need to get quite precise exp() for values up to 4. Problem with the j2me is that it's Math library doesn't have pow() and exp() method. To solve this, I just used this method to ...
-6
votes
0answers
21 views

Need Help With JDBC, connect Java to MySql. I have a error and I can't create a program that I want to create [closed]

I need help to connect Java to MySql, but I can't do it. Before I had searching about this, but I can't find anything that I want. Anyone can help me, please?