takeWhile, dropWhile laziness java9

In scala those methods works fine but in java9 dropWhile works differently I think. Here is example for takeWhile Stream.of("a", "b", "c", "de", "f", "g", "h") .peek(System.out::println) .takeWhile(s -> s.length()...
more »

2017-01-11 23:01 (4) Answers

Static Binding in Tomcat Multiple SLF4j Bindings

I have a gradle java project that I use Spring Boot to deploy. When I startup Spring-Boot with my jar file, I receive the following warning: SLF4J: Class path contains multiple SLF4J bindings SLF4J: Found binding in [apache-tomcat-8.0.23/lib...
more »

2017-01-11 23:01 (0) Answers

Java sort array by the third element

i want to sort a String array descendant by it's third column in descend, the problem is that i want to sort by it's numeric value. Example: If i have this array initially: String [][] array = new String[][] { {"Barcelona", "156", "1604"}, {"...
more »

2017-01-11 22:01 (2) Answers

C server returns only first message

I have a simple C server and simple Java client. Client takes input from keyboard and sends it to server. Server prints it and sends it back. But it works only for the first time, what can be the problem? Main: package test; import java.util.Scann...
more »

2017-01-11 21:01 (3) Answers

Debug Gradle app during server startup

I've found a lot of posts about debugging Gradle in general, and using IntelliJ IDEA specifically. But my issue is that the app crashes during startup, and as far as I can tell, IntelliJ won't/can't attach a debugger until after the server has compl...
more »

2017-01-11 19:01 (1) Answers

Gradle applicationDistribution in java plugin

I am writing custom gradle plugin in Java. As an input my plugin has org.gradle.api.Project object which should have application plugin enabled meaning in build.gradle file of input project the following line should be present: apply plugin: 'appli...
more »

2017-01-11 19:01 (0) Answers

Why is this javaclass getting this exception?

I got this code off of a website to adapt to use for something else, but when I tried it on Netbeans, it kept giving me issues. I looked through it and it looks solid but, I apparently not... The exceptions are: "'{' Expected" and "class, interf...
more »

2017-01-11 18:01 (2) Answers

Spring Security test returns 401 (unauthorized)

In this documentation Spring Security MVC Test it is described how to test secured ressources with Spring Security. I followed all the steps provided but accessing a protected ressource still returns the error code 401 (unauthorized). Here is my tes...
more »

2017-01-11 17:01 (1) Answers

Can't find an object in ArrayList

I'm trying to find an object in an array list that's in another class by using the name of the object. private void listParticipant() { System.out.print("Put in name of participant to see if currently registered: "); String name = readString...
more »

2017-01-11 13:01 (1) Answers

Java method not found running on oracle database

I have can not deal with execute my java method on oracle server. I load my java class on database using loadjava and create function using this query: create or replace function getPeriodIdDay (multiplicity number, stardDate date, endDate date) ret...
more »

2017-01-11 12:01 (1) Answers

Javaslang object decomposition not working

I am using Javaslang-2.1.0-alpha and its Javaslang-match equivalent to do some object decomposition. According to this by blog post by Daniel in the "Match the Fancy way" section: Match(person).of( Case(Person("Carl", Address($(), $())), (street...
more »

2017-01-11 11:01 (1) Answers

Java classloader tracing

My webapplication throws the following ClassCastException: java.lang.ClassCastException: org.postgresql.jdbc4.Jdbc4ResultSetMetaData cannot be cast to org.postgresql.jdbc4.Jdbc4ResultSetMetaData Obviously the classes are the same, so this is a str...
more »

2017-01-11 10:01 (0) Answers

Java Hide Dock Icon in Mac osx

I want to make a system tray without icon of Mac osx dock, just only tray icon using java code. I developed the tray function but I cannot hide the dock icon. Is it possible? What can i do for that? help me. ...
more »

2017-01-11 09:01 (0) Answers

Adding element to 2d arraylist in java

ArrayList<Integer> a =new ArrayList<Integer>(); ArrayList<ArrayList<Integer>> j =new ArrayList<ArrayList<Integer>>(); a.add(1); a.add(2); a.add(3); for(int c=0; c<10; c++){ j.add(a); } j.get(3).add(1); Sys...
more »

2017-01-11 08:01 (4) Answers

Jacoco gradle multi module

We have a gradle project with mutliple modules - so each module - eg admin, ends up having something like this: task admintest(type: Test) { description = "Tests of admin" testClassesDir = sourceSets.admintest.output.classesDir classpath...
more »

2017-01-11 03:01 (1) Answers

Calling Method on Generic Type Java 8

I have a function that accepts a parameter that has some generic type public < T extends SomeA > String foo(T t) {...} Now... SomeA contains a series of methods that can be called, like baz1(), baz2(), baz3(), etc... Now, here's the rub T...
more »

2017-01-10 21:01 (2) Answers