• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Do you have to implemente SecurityException?

 
Ixus See
Ranch Hand
Posts: 160
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Do I have to create a class for it or I can use it as java's SecurityException...
 
Sean Keane
Ranch Hand
Posts: 582
Chrome Eclipse IDE Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Might be of use...
 
Ixus See
Ranch Hand
Posts: 160
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Sean Keane wrote:Might be of use...


Well I did read before I posted but... I'm still unsure if I should implement it.. since is kind of meaningless
 
Roel De Nijs
Sheriff
Posts: 10446
137
AngularJS Chrome Eclipse IDE Hibernate Java jQuery MySQL Database Spring Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I think you should create your own SecurityException, instead of using the one in Java's API.
 
Dennis Grimbergen
Ranch Hand
Posts: 159
IntelliJ IDE Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Just create your own SecurityException as a member of the suncertify.db package.
That's all. Now focus on the next issue Good luck!
 
Sean Keane
Ranch Hand
Posts: 582
Chrome Eclipse IDE Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Ixus See wrote:
Sean Keane wrote:Might be of use...


Well I did read before I posted but... I'm still unsure if I should implement it.. since is kind of meaningless


The very first result from Google answers your question, no?

What do you think the exception is meaningless?
 
Dmitri Cherkas
Ranch Hand
Posts: 40
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Excuse me, but... what advantages can be of using own suncertify.db.SecurityException instead of standard java.lang.SecurityException ?
 
Matthew Brown
Bartender
Posts: 4568
9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
java.lang.SecurityException has a specific meaning:
Javadocs wrote:Thrown by the security manager to indicate a security violation.

I think it's misleading to use it for something else, which is why I implemented my own. In my opinion, it's just a coincidence that there's a core library exception with the same name.
 
Roel De Nijs
Sheriff
Posts: 10446
137
AngularJS Chrome Eclipse IDE Hibernate Java jQuery MySQL Database Spring Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Dmitri Cherkas wrote:what advantages can be of using own suncertify.db.SecurityException instead of standard java.lang.SecurityException ?

No real advantages. But the exception from java.lang has (according to its documentation) nothing to do with the exception in the given interface and therefore I would suggest creating your own exception.
 
Dmitri Cherkas
Ranch Hand
Posts: 40
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
May be if I will write in my choices.txt :

"I implement my own suncertify.db.SecurityException because following to my assignment instructions : I "must not require the installation of a security manager." and from API of java.lang.SecurityException : "Thrown by the security manager to indicate a security violation." therefore it seems that java.lang.SecurityException is bind to using of security manager."

Does seem it logic ?

I think to do my suncertify.db.SecurityException as unchecked exception, is it a good choice ?
 
Roel De Nijs
Sheriff
Posts: 10446
137
AngularJS Chrome Eclipse IDE Hibernate Java jQuery MySQL Database Spring Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Dmitri Cherkas wrote:I think to do my suncertify.db.SecurityException as unchecked exception, is it a good choice ?

To me it can only be an unchecked exception, so
 
Dmitri Cherkas
Ranch Hand
Posts: 40
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thank you Roel, thank you Matthew !
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic