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
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.
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 ...
-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 ...
-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 ...
-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 ...
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 ...
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. ...
-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 ...
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 ...
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 ...
-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 ...
-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 ...
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 ...
-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
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 ...
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[]) { ...
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 ...
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
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 ...
-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 ...
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 ...
-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; } ...
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 ...
-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?
-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 = ...
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 ...
-6
votes
0answers
33 views

How interface used as listeners in java? [closed]

I have seen in Java in many place interfaces are used as listeners in Java. Also whenever we need to access some system service then Java provides interfaces for that. Please tell me why and how ...
-6
votes
0answers
34 views

Java HttpURLConnection how to change URL [closed]

I'm writing a program which needs to crawl through a website to find data. I have managed to use HttpURLConnection to first login to the website so I can collect the login cookies that i can send on ...
1
vote
1answer
91 views

Compiler design prevent register override

I'm trying to write a compiler for a self-designed CPU with accompanying instruction set. The CPU has 3 registers, 2 input registers (B and C) and one output register (D). When for example an ADD ...
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, ...
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
46 views

Running Java and RIOT-OS together [closed]

I was wondering if the following would be possible to do (but not necessarily easy or the most elegant solution): Fork the open source OpenJDK HotSpot Java Virtual Machine code (written in C). ...
0
votes
2answers
85 views

Design pattern to holds API exchanges?

I'm developing a simple application that crawls in web pages to obtain some information. For this I used and tested some libraries, like crawler4j, jsoup, jaunt and htmlunit. I exchanged several ...
0
votes
0answers
88 views

Java Multi-threading

I was solving this question in Java where the user enters a partitioned array. The computer then determines what all elements from that array can be used as pivots. (Pivots are the same pivots that ...
-1
votes
0answers
130 views

Building a mini programming language for the end user

I'm developing a web application using Java EE that should provide a user-friendly interface which allows users to supply some algorithms using some variables (Some entity attributes of the ...
6
votes
2answers
283 views

Is using this complex data structure bad practice?

Right now in my current company I must "parse" a csv and extract some data out of it (in the sense of data mining). I surprised myself by defining the following data structure (Java 8): static ...
1
vote
1answer
83 views

How is this Java Keystore cert still valid?

I maintain an old Java app that deploys to Tomcat and which uses SSL (and hence a keystore). It is important to note that this app will not even start up if the SSL cert is bad/expired/invalid! Every ...
1
vote
2answers
102 views

Does an interface including several methods that return instances of Object make sense?

I am in the process of writing my first true API. In the process, I am defining an interface for mapping complex data structures onto other complex data structures. At the moment, the interface ...
0
votes
1answer
33 views

Concurrent and atomic updates to multiple properties/variable of an object

I have a class with multiple setters and want to make atomic updates to multiple properties/variables. As far as I can see there are three methods that could work: Call all setters in synchronized ...
0
votes
2answers
76 views

Moving Java static variables into XML

I've been working on a small Java project by myself for a department that does not do a lot of software development but mostly database stuff. I showed my boss the code I've been writing and he saw ...
0
votes
0answers
33 views

Libgdx texture and sound disposing

I'm writing a game and in the game, I use an asset manager that is in a singleton class, which holds my textures and sounds. If I create several enemies (lets say 4) which call upon my asset manager, ...