Data dodania Pytanie
2017-11-07 13:11 javascript DOM manipulation doesn't work when trying to configure CSRFGuard »
I am trying to protect my app from CSRF attack. I chose to configure CSRFGuard on my app. https://www.owasp.org/index.php/CSRFGuard_3_User_Manual Unf...
(0) odpowiedzi
2017-11-07 09:11 Primitive type and Wrapper type for Arrays.asList »
I have following simple test case @Test public void testArraysAsList() { Character[] chars1 = new Character[]{'a', 'b'}; System.out.println(A...
(4) odpowiedzi
2017-11-06 23:11 Are Class.cast and Class.isInstance methods in Java 9 actually intrinsic when invoking via class variable? »
I was looking through new intrinsic methods in Java 9 and found that now the method Class.cast is intrinsic too along with Class.isInstance. I did si...
(1) odpowiedzi
2017-11-06 22:11 How to load resource properties in a JUnit Spring context in a multi Gradle project? »
I have the following project tree: ├── app │   ├── build.gradle │   └── src │   ├── main │   │   ...
(1) odpowiedzi
2017-11-06 19:11 How to convert a list of strings into a list of objects? »
I have a list of roles in a database. They are of the form application.Role1.read application.Role1.write application.Role2.read application.Role3.re...
(3) odpowiedzi
2017-11-06 14:11 Great difference in Time Execution Groovy vs Beanshell »
I'm interpreting a same script in both Groovy and Beanshell. Groovy takes a very long time(26 mins 25 secs), while Beanshell takes only 20 secs. I'm...
(1) odpowiedzi
2017-11-06 13:11 Failed to update a row in oracle sql database from java jdbc, java code stuck at update »
I'm facing a problem, that for one particular record(randomly) in an Oracle SQL table, the updating and select is not working from Java JDBC code, The...
(1) odpowiedzi
2017-11-06 11:11 Polymorphism with Retrofit »
Here is my Retrofit instance: @Provides @Singleton ApiManager provideApiManager() { RxJava2CallAdapterFactory rxAdapter = RxJava2CallAdapterFacto...
(1) odpowiedzi
2017-11-05 22:11 Java8 Stream: Why the method Stream.skip(long n) takes long instead of int as parameter? »
Here the definition of the skip method of Stream : skip(long n) Returns a stream consisting of the remaining elements of this stream after disc...
(3) odpowiedzi
2017-11-05 00:11 Is static int thread safe if it is incremented in a single method? »
I want to track getVariableAndLogAccess(RequestInfo requestInfo) using the code below. Will it be thread safe if only these two methods access variabl...
(4) odpowiedzi
2017-11-05 00:11 Puzzling behavior from Java.Random.nextInt() »
I'm implementing a SkipList. At one point in the algorithm, we are to toss a coin, and do something over and over as long as it keeps coming up heads...
(2) odpowiedzi
2017-11-04 23:11 Upcasting external java libraries in scala using "with" keyword produces type mismatch error »
I am utilizing an external Java library with a class that implements several interfaces, but I am confounded about the details of how to properly inst...
(1) odpowiedzi
2017-11-04 16:11 How to write binary data fast in Java? »
I am writing an STL file which consists of an 80 byte header, a 4 byte integer, and then records of 50 bytes each consisting of floats and a short int...
(3) odpowiedzi
2017-11-04 14:11 First list is sorted and the other is unsorted now which is the better approach to merge both list »
I have one Sorted ArrayList A and one unsorted ArrayList B, now I want to merge items of B in A such that A remains sorted. Now I can think of only t...
(2) odpowiedzi
2017-11-04 11:11 Eclipse issue with java 9 and maven »
I installed Version: Oxygen.1a Release (4.7.1a) Build id: 20171005-1200 supporting Java 9. With suggested configuratio on eclipse.ini -vm C:\Program...
(1) odpowiedzi
2017-11-04 08:11 How to Restore ViewPager from savedInstanceState »
So I have a problem that I can't seem to solve. I have a ViewPager in one of my activities, say MainActivity. I am implementing all the required metho...
(3) odpowiedzi
2017-11-04 06:11 Run as java application brings up select java application screen, no further instruction »
Asking because I'm following Guru99's time sensitive selenium course and the code that I have downloaded as part of my project will not run as a java ...
(1) odpowiedzi
2017-11-03 22:11 how to shutdown all MessageListenerContainer with Lambda »
In a few words, I am trying to write this in lambda syntax: bean = context.getBean(JmsListenerEndpointRegistry.class); for (MessageListenerContainer ...
(1) odpowiedzi
2017-11-03 20:11 Is there a way to add maven dependencies while using the maven-jlink-plugin? »
I'm using this Github project to get exposed to the new modular features in Java 9. I would like to add dependencies to the project and be able to bui...
(1) odpowiedzi
2017-11-03 19:11 How to generate random values where a percentage of them are 0? »
I create a random stream Random random = new Random(); Stream<Integer> boxed = random.ints(0, 100000000).boxed(); But I need 60% of the numbe...
(8) odpowiedzi
2017-11-03 17:11 Java Lambda to comparator conversion - intermediate representation »
I'm trying to make sense of how Comparator.comparing function works. I created my own comparing method to understand it. private static <T,U exten...
(2) odpowiedzi
2017-11-02 21:11 Bad practice in JDK's try-with-resources example? »
I found this example in the try-with-resources documentation for Java: static String readFirstLineFromFile(String path) throws IOException { try ...
(2) odpowiedzi
2017-11-02 21:11 Java type inference of generic exception type »
I'm trying to have a functor F which may throw multiple exceptions (in the example below Checked and SQLException). I want to be able to call a functi...
(3) odpowiedzi
2017-11-02 21:11 Pattern "YYYY-MM-dd HH:mm:ss Z" causes parsing exception where Jodatime did not »
I am trying parse ZonedDateTimes from Strings in the following format: 2017-08-10 16:48:37 -0500 I had previously done so successfully using Jodatim...
(1) odpowiedzi
2017-11-02 18:11 Passing parameters to Facebook App Links in Android »
I just began implementing Facebook App Linking into my application. I have got my app ID and app link URL from Facebook and I can share links from my ...
(0) odpowiedzi
2017-11-01 18:11 JDBC and utf8mb4 encoding the emoji symbol 🔥 »
I use Mysql 5.7.18 and I faced an issue with emoji symbols when updating from JDBC. Table creation: body is typed utf8 and localizations is utf8mb4 ...
(1) odpowiedzi
2017-11-01 18:11 How to read a Stream one by one? »
The Java Stream.forEach function has the serious limitation that it's impossible for its consumer to throw checked exceptions. As such, I would like t...
(1) odpowiedzi
2017-11-01 13:11 Using Generic Type for same functionality »
I am having a scenario where two functions are identically similar but the Class object used in the two differ, similar like this, public int functio...
(3) odpowiedzi
2017-11-01 09:11 Happens-before for direct ByteBuffer »
I have a direct ByteBuffer (off-heap) in one thread and safely publish it to a different thread using one of the mechanisms given to me by JMM. Does t...
(2) odpowiedzi
2017-10-31 23:10 Remove all entries where value is an empty Optional from map »
I want to remove all entries where value is an empty Optional from the map. It would seem that nothing complicated, but I am trying to find a better s...
(5) odpowiedzi
2017-10-31 13:10 How to add Menus and SubMenus recursively in JavaFX? »
I have created CustomMenuBar class that extends javafx.scene.control.MenuBar, and the thing I want to implement is to add new menus only by String val...
(2) odpowiedzi
2017-10-31 12:10 Initializing multiple variables from same source in one line (JAVA) »
Given the method: private Object[] method(){ //run some codes return new Object[]{Obj1, Obj2}; } Note that 2 different runs will give uniqu...
(2) odpowiedzi
2017-10-31 11:10 Check if object is null after each method call »
I have this simple fragment that I would like to reengineer in a more elegant way maybe with the latest JDK 8 features: String x = methodCall(); if(x...
(3) odpowiedzi
2017-10-31 09:10 AngularJS XSRF strategy does not honour cookie paths »
I have three spring boot applications running on the same server with different paths. All three of them expose API endpoints and one of them also ser...
(1) odpowiedzi
2017-10-30 16:10 Effects of violating compareTo transitivity contract »
I have some numbers I'm trying to compare. They represent lengths of paths through different spaces. Unfortunately for me, some imprecision was caus...
(3) odpowiedzi