This week's book giveaway is in the OO, Patterns, UML and Refactoring forum.
We're giving away four copies of Refactoring for Software Design Smells: Managing Technical Debt and have Girish Suryanarayana, Ganesh Samarthyam & Tushar Sharma on-line!
See this thread for details.
The moose likes Applets and the fly likes Commenting lines in Java policy file Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

JavaRanch » Java Forums » Java » Applets
Bookmark "Commenting lines in Java policy file" Watch "Commenting lines in Java policy file" New topic

Commenting lines in Java policy file

Amarnath Vadivelu

Joined: Mar 22, 2010
Posts: 3

In the java policy file what will happen if we comment out

//permission java.lang.RuntimePermission "stopThread";.

My understanding is that we can't call thread.stop() anywhere in the program am i rite?
If we call it should say "Access denied"... But we should be able to work on with thread.start and

If any Text area is built with AWT closing it by clicking on "X" on the window will call this thread.stop() method?
Tony Docherty

Joined: Aug 07, 2007
Posts: 2724
This permission only allows code to stop a thread if it has previously been granted permission to access that thread.
However, you shouldn't be calling the stop() method on a Thread anyway. The method was deprecated years ago because it is inherently unsafe and can cause bugs which are horribly difficult to trace. Consequently you should never grant this permission.

Closing an AWT window doesn't call stop() on any thread as far as I'm aware.
I’ve looked at a lot of different solutions, and in my humble opinion Aspose is the way to go. Here’s the link:
subject: Commenting lines in Java policy file
jQuery in Action, 3rd edition