Solved

GetPropertyAction in java 1.5

Posted on 2004-10-18
8
341 Views
Last Modified: 2008-02-01
String strTmpdir = ((String) AccessController.doPrivileged(new GetPropertyAction("java.io.tmpdir")));

I'm using NETBeans and I have this warning
...\JIntFrmRunTests.java:266: warning: [unchecked] unchecked conversion
found   : sun.security.action.GetPropertyAction
required: java.security.PrivilegedAction<T>
                            String strTmpdir = ((String) AccessController.doPrivileged(new GetPropertyAction("java.io.tmpdir")));

What shall I do to remove this warning?

thanks
MArcos
0
Comment
Question by:oleber
  • 2
  • 2
  • 2
  • +1
8 Comments
 
LVL 35

Expert Comment

by:TimYates
ID: 12337282
Can you do:

String strTmpdir = AccessController.doPrivileged(new GetPropertyAction<String>("java.io.tmpdir")) ;

?

Not sure it will work though...
0
 
LVL 10

Author Comment

by:oleber
ID: 12337339
Nope

...\JIntFrmRunTests.java:267: type sun.security.action.GetPropertyAction does not take parameters
                            String strTmpdir = AccessController.doPrivileged(new GetPropertyAction<String>("java.io.tmpdir")) ;
1 error
0
 
LVL 35

Expert Comment

by:TimYates
ID: 12337401
How about:

String strTmpdir = AccessController<String>.doPrivileged(new GetPropertyAction("java.io.tmpdir")) ;

The new typed parameters hurt my head ;-)
0
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 
LVL 86

Expert Comment

by:CEHJ
ID: 12339013
I don't know those classes but you can of course simply ignore the warnings ;-)
0
 
LVL 10

Author Comment

by:oleber
ID: 12356781
This will be points to me :)

Why not use 'System.getProperty("java.io.tmpdir")'?

0
 
LVL 86

Expert Comment

by:CEHJ
ID: 12356938
Well i assumed you needed to check access to that property ;-)
0
 

Accepted Solution

by:
modulo earned 0 total points
ID: 12808007
PAQed with points refunded (50)

modulo
Community Support Moderator
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
mapAB Challlenge 35 123
Python Assistance 7 71
why cannot we forward request once the response is committed 2 33
MySQL  on Tomcat 8 23
Are you developing a Java application and want to create Excel Spreadsheets? You have come to the right place, this article will describe how you can create Excel Spreadsheets from a Java Application. For the purposes of this article, I will be u…
Basic understanding on "OO- Object Orientation" is needed for designing a logical solution to solve a problem. Basic OOAD is a prerequisite for a coder to ensure that they follow the basic design of OO. This would help developers to understand the b…
Viewers learn about the “while” loop and how to utilize it correctly in Java. Additionally, viewers begin exploring how to include conditional statements within a while loop and avoid an endless loop. Define While Loop: Basic Example: Explanatio…
Viewers learn how to read error messages and identify possible mistakes that could cause hours of frustration. Coding is as much about debugging your code as it is about writing it. Define Error Message: Line Numbers: Type of Error: Break Down…

930 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now