This week's book giveaway is in the Java 9 forum.
We're giving away four copies of Java 9 Modularity: Patterns and Practices for Developing Maintainable Applications and have Sander Mak & Paul Bakker on-line!
See this thread for details.
Win a copy of Java 9 Modularity: Patterns and Practices for Developing Maintainable Applications this week in the Java 9 forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

is it illegal to alter the signature of lock()/unlock() method in Data class ?  RSS feed

 
morph wang
Ranch Hand
Posts: 38
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
is it illegal to alter the signature of lock()/unlock() method in Data class ?
If not, I think it's hard to track the client ID in it. (I'm using RMI)
 
veron luis
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
You can do whatever you want in you program (assignment) as long as you can explain the reason in you "design" documentation.

Cheers,
luis
 
John Lee
Ranch Hand
Posts: 2545
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It is legal not to alter the signature of lock()/unlock() method in Data class.
What I did is:
public void lock( int record )
{
synthronized(this) {
....................
}
}
Don
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!