query
stringlengths
1
74.9k
positive
stringlengths
0
174k
negative
stringlengths
1
174k
label
float64
1
1
task_name
stringclasses
33 values
What is the best practice when implementing equals() for entities with generated ids
Should I write equals() and hashCode() methods in JPA entities?
How to inject custom object ids into JPA entities
1
stackoverflowdupquestions
I want to decrease the font size if text doesn't fit in JLabel
How to change the size of the font of a JLabel to take the maximum size
How to change JLabel's size when the font size is changed?
1
stackoverflowdupquestions
Does java have a clamp function?
I am trying to create a Clamp method in java
Return value of a function
1
stackoverflowdupquestions
CharSequence VS String in Java?
When to use CharSequence in an API
Convert float to CharSequence in android?
1
stackoverflowdupquestions
prefetch instruction in JVM/JAVA
Why doesn't the JVM emit prefetch instructions on Windows x86
bad using of if instruction
1
stackoverflowdupquestions
java 'jar' is not recognized as an internal or external command
How can I solve the error : 'jar' is not recognized as an internal or external command, operable program or batch file?
'export' is not recognized as an internal or external command,
1
stackoverflowdupquestions
How to add Image using CDATA tag in KML / XML?
java adding cdata to xml string
using CDATA in an xml file for to parsing html data
1
stackoverflowdupquestions
How to get the user entered values of username and password in a spring security authenticated login
Spring form get password entered
Spring Security logout does not work - does not clear security context and authenticated user still exists
1
stackoverflowdupquestions
Embedded MongoDB when running integration tests
Integration tests with MongoDB?
Updating an embedded document in MongoDB using Java
1
stackoverflowdupquestions
How to add border to panel of javafx?
How to create LEGEND (text in chart border) in JavaFX
JavaFX Panel inside Panel auto resizing
1
stackoverflowdupquestions
JLayeredPane with a JDialog
JLayeredPane and painting
JLayeredPane with gridlayout?
1
stackoverflowdupquestions
httpOnly Session Cookie + Servlet 3.0 (e.g. Glassfish v3)
Jetty httpOnly cookies configurarion like on Tomcat
Missing HttpOnly Attribute in Session Cookie
1
stackoverflowdupquestions
Apache Maven install "'mvn' not recognized as an internal or external command" after setting OS environmental variables?
'mvn' is not recognized as an internal or external command,
'export' is not recognized as an internal or external command,
1
stackoverflowdupquestions
How to highlight part of a JLabel?
how to highlight part of a JLabel at runtime?
JLabel on top of another JLabel
1
stackoverflowdupquestions
Serving static files with embedded Jetty
jetty 9 serving HTML file PWC6117: File not found
Set up embedded jetty with document root
1
stackoverflowdupquestions
Default XML namespace, JDOM, and XPath
Modifying XML file (namespace) using Java, JDom, XPath
JDOM 2 and xpath
1
stackoverflowdupquestions
Better choice for cross-platform development: Java or C#?
Is .NET/Mono or Java the better choice for cross-platform development?
Cross platform real-time-data
1
stackoverflowdupquestions
Exception java.util.zip.ZipFile.ensureOpenOrZipException with WAS 7
java.util.zip.ZipFile.ensureOpenOrZipException with WAS 7
java.util.zip - ZipInputStream v.s. ZipFile
1
stackoverflowdupquestions
Hash Collisions in HashMap
Exact cause of hash code collisions in HashMap
HashMap collisions: is my code correct?
1
stackoverflowdupquestions
Learning Apache POI for Java
Learning Apache POI
Apache POI 3.9 can not get HSSFPalette
1
stackoverflowdupquestions
Spring MVC + JSON = 406 Not Acceptable
HTTP Status 406. Spring MVC 4.0, jQuery, JSON
406 Error when trying to parse json returned from Spring-MVC Controller
1
stackoverflowdupquestions
Handling errors in ANTLR4
Parse a formula using ANTLR4
How to check whether ANTLR4 rule is null?
1
stackoverflowdupquestions
Convert a Julian Date to an Instant
Converting Julian date to Java date but still cannot get Month
Check if two instances of "Instant" are on the same date in Java 8
1
stackoverflowdupquestions
Color Class in Java
Convert RGB values to color name
How can i color my text?
1
stackoverflowdupquestions
How to print used SQL query when using PreparedStatement (JDBC)
How can I get the SQL of a PreparedStatement?
JDBC: Create Table with PreparedStatement, SQL Syntax Error or not?
1
stackoverflowdupquestions
Including elements from unmodified lists in modified lists in a 2D list with Streams
How to include elements from unmodified list in modified list with Java Streams?
What are Lists in Java
1
stackoverflowdupquestions
How do I configure client authentication with generated certificate in apache-commons net
How to configure client authentication with apache.commons.net.ftps?
What is execProt("P") in Apache Commons net?
1
stackoverflowdupquestions
GSON parsing without a lot of classes
Parsing JSON array with gson
parsing json with gson in java
1
stackoverflowdupquestions
HTMLUnit doesn't wait for Javascript 2
Get the changed HTML content after it's updated by Javascript? (htmlunit)
Java/HtmlUnit - How to get an HtmlImage from an HtmlImageInput?
1
stackoverflowdupquestions
Running a java program as an exe in Windows without JRE installed
How to run java application file (exe not jar) without installing jdk nor jre
Do I need both JRE 1.6 and JRE 1.7?
1
stackoverflowdupquestions
Cannot write output after reading input
error: Cannot write output after reading input
Reading from a file in Java
1
stackoverflowdupquestions
NoClassDefFoundError sometimes for a standard class after System.out.close()
Why am I getting a NoClassDefFoundError in Java?
NoClassDefFoundError when running a class
1
stackoverflowdupquestions
Tree (directed acyclic graph) implementation
How to build in Java a Weighted Directed Acyclic Graph
Edge reversing on directed graph
1
stackoverflowdupquestions
Javascript Callback function pass to Android
Android : callback function from java script to java
What is callback in Android?
1
stackoverflowdupquestions
How to get audio data from a MP3?
How to Read MP3
how to remove ".mp3" from "xxx.mp3" string
1
stackoverflowdupquestions
android java A* Pathfinding help needed
A* Pathfinding java not working properly
a* pathFinding, implementation not working correctly? any suggestions?
1
stackoverflowdupquestions
Java read actual file type by reading first few bytes (Forensic)
Read First 4 Bytes of File
Java writing and reading bytes to/from a file
1
stackoverflowdupquestions
Enums as replacement of Constants in Java
Should you always use enums instead of constants in Java
Why use Enums instead of Constants? Which is better in terms of software design and readability
1
stackoverflowdupquestions
What function can be used to sort a Vector?
How to sort a Vector of String in java-me?
What is the differenece between Vector and Vector<>
1
stackoverflowdupquestions
<my:foo> Tag Library supports namespace: http://java.sun.com/jsf/composite/mycomponents, but no tag was defined for name: foo
JSF 2.1.13 custom component not found: Tag Library supports namespace: <namsepace> but no tag was defined for name: <compositecomponent>
Create a custom tag library which extends the Spring tag library
1
stackoverflowdupquestions
debug jdk source can't watch variable what it is
Want to debug the source code of JDK
which java jdk to use?
1
stackoverflowdupquestions
Handle unauthorized error message for Basic Authentication in Spring Security
Spring Security, REST basic authentication issue
How to do basic authentication with empty password using spring security?
1
stackoverflowdupquestions
Invoke Java method with parameters from Freemarker
How do I call java methods on an object from a FreeMarker template?
FreeMarker: Check if map value is null
1
stackoverflowdupquestions
Share data source for two comboboxes
Shared data between two comboboxes
JSF form not executing action because comboboxes
1
stackoverflowdupquestions
Creating new users with Spring Data LdapRepository fails with LDAP error code 32
Ldap error code 32 while adding user to ldap
How to read values from ldap using spring-ldap
1
stackoverflowdupquestions
autocomplete JTextField for netbeans
Is it possible to have an autocomplete using jtextfield and a Jlist?
Java/Netbeans -- Reference a jTextfield dynamically?
1
stackoverflowdupquestions
Best way to format multiple 'or' conditions in an if statement (Java)
How can I create an if statement with 3 conditions? (Java)
Correct way to use multiple conditions in If statement?
1
stackoverflowdupquestions
Calculating the distance between two resources of DBPedia in JENA
Load DBpedia locally using Jena TDB?
Error with retrieving data from dbpedia
1
stackoverflowdupquestions
How to format java.time.LocalDateTime and java.time.LocalDate with pattern?
Convert LocalDate to LocalDateTime or java.sql.Timestamp
Joda LocalDate To LocalDateTime
1
stackoverflowdupquestions
how does java.math.RoundingMode work?
DecimalFormat using incorrect RoundingMode even when set explicitly
RoundingMode HALF_EVEN analogous to the rounding policy used for float
1
stackoverflowdupquestions
Java: How to control JPanel aspect ratio?
How to keep aspect ratio in JPanel
getting the desired aspect ratio for BufferedImage
1
stackoverflowdupquestions
What are the strategies for catching unboxing and autoboxing issues at compile time?
Why do we use autoboxing and unboxing in Java?
Autoboxing Unboxing in java using Object
1
stackoverflowdupquestions
split a string in java into equal length substrings while maintaining word boundaries
Split string to equal length substrings in Java
getting substrings from a string (i get the string from a text file)
1
stackoverflowdupquestions
Using JMockit with Tycho
JMockit - initialization problem
How to mock create in jmockit
1
stackoverflowdupquestions
Method Synchronization
How Synchronization works in Java?
Java synchronization not working
1
stackoverflowdupquestions
When Hibernate flushes a Session, how does it decide which objects in the session are dirty?
How to avoid excessive hibernate flushes to DB
Does java web application contains only one hibernate session and how to clear this hibernate session?
1
stackoverflowdupquestions
JPA Multiple Embedded fields
How use multiple @Embedded in same entity?
Java - JPA @Basic and @Embedded annotations
1
stackoverflowdupquestions
JSch: UnknownHostKey exception when Host Key is in known_hosts AND after adding JCE
JSch: UnknownHostKey exception even when the hostkey fingerprint is present in the known_hosts file
What are the key file formats of JSch and sharpSSH?
1
stackoverflowdupquestions
How do I determine the resolution of the screen where the JFrame resides?
How can I get screen resolution in java?
How is type resolution done?
1
stackoverflowdupquestions
Ignore System.exit() from other class
Java: How to test methods that call System.exit()?
Is it possible to ignore an exception?
1
stackoverflowdupquestions
if statement vs OO Design
“if” statement vs OO Design - 2
OO Design - Public API method implementation
1
stackoverflowdupquestions
C# Java HashMap equivalent
How to create a HashMap in C#
How to name a HashMap in Java?
1
stackoverflowdupquestions
Write operations are not allowed in read-only mode - Issue while persisting
Java / Hibernate - Write operations are not allowed in read-only mode
Persisting 2 table with the same generated id
1
stackoverflowdupquestions
JPA CriteriaQuery Order By Latest Child Property
JPA 2 CriteriaQuery, using a limit
JPA 2.0 CriteriaQuery on tables in @ManyToMany relationship
1
stackoverflowdupquestions
public methods in package-private classes
Why have public methods inside private classes?
How can a public method return a private type?
1
stackoverflowdupquestions
Extracting phone number from string
Extracting Phone number from a String
Extracting values from file
1
stackoverflowdupquestions
Arrays.sort and Arrays.parallelSort function behavior
Difference between Arrays.sort() and Arrays.parallelSort()
Arrays sort method behavior
1
stackoverflowdupquestions
how to restart tomcat from a running webapp?
Restart tomcat through webapp
Tomcat need to restart after database restart
1
stackoverflowdupquestions
inner class non-final variable java
The pattern of final array instead of non-final variable for boolean flag in inner class
Cannot refer to a non-final variable inside an inner class defined in a different method
1
stackoverflowdupquestions
Using existing plug in project created from library in OSGi bundle for Kura
Using an external java library in OSGI bundle
How to make data appear on Kura Web UI?
1
stackoverflowdupquestions
EOFException - how to handle?
How to handle EOFException?
Java EOFException Server/Client TCP application
1
stackoverflowdupquestions
JDBC Type 4 Driver
Difference between JDBC Driver type numbers
Wrong JDBC driver being used?
1
stackoverflowdupquestions
How should I throw a divide by zero exception in Java without actually dividing by zero?
JAVA - Dividing by Zero & Returning a Correct Answer = Undefined
Split zero in String
1
stackoverflowdupquestions
Wildcard matching in Java
Java Simple Wildcard Match
What is the need for WildCard when Object type is available?
1
stackoverflowdupquestions
Does Spring (3) have any built in support for pagination?
How to implement pagination in Spring MVC 3
Pagination with spring boot usiing jpa
1
stackoverflowdupquestions
What does -XX:MaxPermSize do?
OpenJDK 64-Bit Server VM warning: ignoring option MaxPermSize=350m;
Optimizing Xms/Xmx/XX:MaxPermSize in JVM
1
stackoverflowdupquestions
Format Stopwatch to display 00:00
problem with stopWatch in android
I want to be able to make something like a background stopwatch?
1
stackoverflowdupquestions
Find known sub image in larger image
Find an Image within an Image
java sub image display
1
stackoverflowdupquestions
RSA read PublicKey
RSA and PublicKey interop with dotnet
RSA in Java: BitInteger and byte[]
1
stackoverflowdupquestions
Use SWIG to Handle C Function Returning A Pointer to Array of Structure in Java
Accessing an array of pointers within a structure from Java with SWIG
Passing Java Map<String, String> to C++ method using SWIG
1
stackoverflowdupquestions
Java String trim has no effect
string trim function is not working
Trim text file to first column with java
1
stackoverflowdupquestions
Throttling CPU from within Java
Throttling CPU/Memory usage of a Thread in Java?
Any out-of-box methods to implement request throttling in Java?
1
stackoverflowdupquestions
Java Equivalent for .NET Encryption-DESCryptoServiceProvider
Equivalent to CryptoStream .NET in Java?
Simple encryption
1
stackoverflowdupquestions
Spring boot -- Unable to start EmbeddedWebApplicationContext due to missing EmbeddedServletContainerFactory bean
Spring Boot: Unable to start EmbeddedWebApplicationContext due to missing EmbeddedServletContainerFactory bean
Spring boot CrudRepo Define a bean
1
stackoverflowdupquestions
Guava libraries and GWT
Trouble with GWT and Guava
Using Google Guava to get List
1
stackoverflowdupquestions
How to Execute Windows Commands Using Java - Change Network Settings
How to run Windows commands in JAVA and return the result text as a string
java code to execute commands
1
stackoverflowdupquestions
What is the difference between Step Into and Step Over in the Eclipse debugger?
Where is Step out in eclipse ide debugger?
Creating a step by step validation
1
stackoverflowdupquestions
Proper use of volatile variables and synchronized blocks
Why do I need to use synchronized for multiple threads over volatile?
Volatile and synchronized keywords in Java
1
stackoverflowdupquestions
Very lightweight Eclipse-Maven integration - dependency management only?
Eclipse: Dependency Management
Maven Eclipse Integration Issue
1
stackoverflowdupquestions
Scalable solution for Rock-Paper-Scissor
A Java code about scissor-rock-paper game
Java GUI: Rock, scissor paper game
1
stackoverflowdupquestions
Spring: Using builder pattern to create a bean
How to initialize a bean which follows the Builder Pattern
Builder pattern not working
1
stackoverflowdupquestions
Why is it considered good practice to mark method parameters as final?
Why would one mark local variables and method parameters as "final" in Java?
File I/O Practice.
1
stackoverflowdupquestions
What is the difference between JAAS and JAAP?
where we use JAAS
Login a user programmatically via JAAS
1
stackoverflowdupquestions
Shifting a Java BitSet
Why does Java `BitSet` not have `shiftLeft` and `shiftRight` functions?
Python equivalent to Java's BitSet
1
stackoverflowdupquestions
Why can we have static final members but cant have static method in an inner class?
Why a non-static inner-class cannot have static members (fields and methods)?
Use a non-static method inside a inner class of a static class
1
stackoverflowdupquestions
Java - Download image from URL
how to download image from any web page in java
how to download a file in java?
1
stackoverflowdupquestions
java.net.SocketException: Software caused connection abort: recv failed, with java.net.SocketException: Connection reset
java.net.SocketException: Software caused connection abort: recv failed
What should I do if the creting a connection failed?
1
stackoverflowdupquestions
Why does this Java regex cause "illegal escape character" errors?
java regex illegal escape character error not occurring from command line arguments
2 Errors: illegal start of expression [Java]
1
stackoverflowdupquestions
org.json.JSONException: No value for
org.json.JSONException: No value for {...}
Error parsing data org.json.JSONException: Expected ':' after n
1
stackoverflowdupquestions
Java path to file in src/main/resources
How to get the path of src/test/resources directory in JUnit?
Can't read from my src/main/resources directory
1
stackoverflowdupquestions