Linked Questions

17 votes
3 answers
29k views

I'm getting a "Type safety: Unchecked cast from Object to ArrayList" warning on the line with readObject(), in this code snippet: // Read the Event List theEventArrayList = new ArrayList<Event>(...
Peter Nelson's user avatar
  • 5,987
1 vote
1 answer
8k views

I have an application and when I try to run it shows an error : uses unchecked or unsafe operations. Recompile with -Xlint:unchecked for details. If anyone has an idea why How do I solve this ...
Hawazen S. Al Rifai's user avatar
0 votes
2 answers
4k views

I am getting this error but don't know how to resolve it.I have already gone through the post but still confused. I tried to run Xlint File.java but its not working. While running this code, I am ...
Abhinay's user avatar
  • 1,816
2 votes
2 answers
1k views

I have built a GUI with JavaFX/Scenebuilder which has multiple dropdowns with similar functions. I want to use the same function for all dropdowns so I have to check where the action event came from. ...
lutkeveld's user avatar
0 votes
0 answers
4k views

I would like to avoid "unchecked or unsafe operations" message from java compiler, but I have no idea how to do it, when I have a generic method, and would like to return the values from a generic Map....
alternatiwe's user avatar
2 votes
3 answers
1k views

Possible Duplicate: How do I address unchecked cast warnings? My program compiles and works correctly when I compile with -Xlint:unchecked, but I am looking for assistance to remove this warning. ...
user avatar
0 votes
1 answer
380 views

I'm implementing a list link in the stack. The program successfully passes all the required tests, but I encounter this warning. There is no disruption in the implementation of the program, but I am ...
matin_mhz's user avatar
0 votes
0 answers
667 views

In my application, in which I have two JLists, I'm trying to show the contents of the second one depending on what is selected in the first one. Let's say I have group 1, group 2 and group 3 at List1, ...
Hector Guerra's user avatar
-1 votes
1 answer
153 views

How do I avoid using instanceof and casting in this situation if I want to have different validators where the method signatures differ? Code for(BatchValidator validator : validators) { try { ...
A_B's user avatar
  • 1,019
0 votes
0 answers
318 views

I have this API which I can't change: public interface A<T> { void onClick(T widget); } public interface B<T> { void use(A<T> a); } public interface C { B<?> apply(); } ...
Karlzio's user avatar
0 votes
1 answer
159 views

This seems like a pretty standard problem, but it's just so simple I don't know what to do about it. From what I've read elsewhere on SO, this is caused by Generics when ArrayLists are initialized ...
Scott Hetrick's user avatar
2 votes
1 answer
161 views

I want to be sure if the object I get is a List of Strings. Here's my code: Object obj = plugin.getConfig().get("groups"); if(obj instanceof List<?>){ // Is the Object a List ? List<?>...
Franckyi's user avatar
  • 243
1 vote
0 answers
24 views

I have recently started using generic methods in my projects. I am working on a chess project where every piece class extends to Pieces.java. Diagram of my pieces package And in the Player.java, I ...
Nishant Jalan's user avatar
337 votes
10 answers
565k views

In my spring application context file, I have something like: <util:map id="someMap" map-class="java.util.HashMap" key-type="java.lang.String" value-type="java....
Saj's user avatar
  • 18.8k
94 votes
13 answers
160k views

I'm a newbie with Hibernate, and I'm writing a simple method to return a list of objects matching a specific filter. List<Foo> seemed a natural return type. Whatever I do, I can't seem to make ...
LSerni's user avatar
  • 57.7k

15 30 50 per page