Hazelcast + Spring Boot + Cache Manager

I'm trying to create a instance of Hazelcast client but I can't Override the Cache Manager implementation from Spring. I don't want to use a hazelcast.xml (so, I'm in a spring boot application). There is a way to do it? Follow my test: @Bean CacheM...
more »

2017-04-18 23:04 (1) Answers

Get only latest posts of Facebook using RestFB

I'm using RestFB to get posts from pages of facebook. The problem is I only want the latests posts of the page, let's say, the posts of the last month. With my code I get all the history and it take a lot of time. How do I do that? I havn't read abou...
more »

2017-04-18 20:04 (0) Answers

Jooq Schema Case Sensitivity

I have a case where I am switching between Oracle and MySql using the same schema name. I want to generate classes using either database type and performing operations on the other. Due to case sensitivity issues, I figured out that the approach whic...
more »

2017-04-18 19:04 (1) Answers

Type erasure in generics confusion

I was reading concept of type erasure in generics. While executing the below piece of code I got confused. public class CollectionsWild { void Test(Collection<?> t){ System.out.println("Collection"); } void Test(List<I...
more »

2017-04-18 17:04 (2) Answers

Java create generic class with generic type

I'm trying to implement a generic cache class using the DualCache library. When instantiating the DualCache class one also needs to provide a serializer instance which itself is a generic class that should be of the same type as the DualCache its att...
more »

2017-04-18 15:04 (1) Answers

25 Random Numbers Generator of Even and Odd

I need to generate 25 random numbers and then separate them into two arrays, depending on whether they are odd or even. This is my expected output: Even: 40 10 70 58 20 18 74 44 14 54 50 42 Odd: 21 75 29 69 7 41 33 35 21 13 93 73 33 This is what I ...
more »

2017-04-18 15:04 (5) Answers

Convert String in EST to Date in PST

I tried the below approach and searched in Web to find the solution for this but no luck : looking for the solution for converting a String in IST to PST: String string = new Date().toString(); System.out.println(string); SimpleDateF...
more »

2017-04-18 15:04 (2) Answers

How to extract a method across files?

In all my java files of my project, I want to replace occurrences of this: myObject.getName() == null With that: myObject.hasName() Is there any action or strategy to do this with IntelliJ IDEA? I want it to be specific to the getName method ...
more »

2017-04-18 14:04 (3) Answers

@PathVariable in SpringBoot with slashes in URL

I have to get params from URL using @PathValiable in SpringBoot application. These params often have slashes. I don't have a control about what a user would enter in URL so I would like to get what he has entered and then I can handle with it. I hav...
more »

2017-04-18 13:04 (3) Answers

LocalDate minus a Period get wrong result

LocalDate minus a Period(like "28 years, 1 months and 27 days"),get wrong result. But minus a Period(only have days unit ,like "10282"days) get right result. Is there anything to notice? public static void main(String[] args) { printAgeAndBirth...
more »

2017-04-18 13:04 (1) Answers

How to include a War file instead of Jar file

First of all I am a ColdFusion developer and do not really know how Java works. I have a situation whereby we need to integrate a Java client file into a project that is hosted by a ColdFusion 9 server, with JRun application server, and it need AXIS...
more »

2017-04-18 13:04 (0) Answers

Define a sourceset for all aspectJ

I'm using this gradle plugin for build aspectJ classes: https://github.com/eveoh/gradle-aspectj The main problem is that i've seen that when I build and deploy to wildfly, if I only modify Aspect class (.aj) it says "UP TO DATE" and doesn't cha...
more »

2017-04-18 11:04 (0) Answers

Hibernate Caching and lazy loaded associations

I got a typical entity association of order and items. To make it possible to read only orders, the items set is default FetchType.LAZY. 2nd level and query cache is enabled. To read an order with associated items, I'm using a JPQL query. The query a...
more »

2017-04-18 10:04 (0) Answers

Unable to send too many emails in short time

i have a correspondence application where each user creates a correspondence and send it to multiple users (average send us between 2-30 user), with each send i open a new thread and send email to group of users in the following flow (connect to mail...
more »

2017-04-18 10:04 (1) Answers

Can this be achieved on Mac OSX?

I am trying to make my JFrame appear next to my dock on Mac OSX using the following code but it doesn't work. Is it even possible to do make a frame appear there? I am using Java. frame.setLocation(5, Toolkit.getDefaultToolkit().getScreenSize().heig...
more »

2017-04-18 10:04 (1) Answers

What does protected <T> T function() means?

While looking into some code I found out that there is following kind of syntax. protected <T> T Execute(Class<T> returnType){ T t; return t; } What does this mean?? What if I want to save the outcome in some variable of o...
more »

2017-04-18 09:04 (2) Answers

How to calla method only once in a Controller

I have a REST API and I want to call a method which creates the TreeMap from a csv file and I want to use the TreeMap for rest of the each API calls.So I just want to call the method to set the TreeMap and want to use the TreeMap for rest of the API ...
more »

2017-04-18 04:04 (1) Answers