Win a copy of Think Java: How to Think Like a Computer Scientist this week in the Java in General forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

What Does This Warning Mean?

 
Mark Wuest
Ranch Hand
Posts: 88
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'm not sure what eclipse/javac is trying to tell me here. Maybe I need more coffee... Anyone know what it means?

"Any data in the field "attribsToCopyInit" should not be specific to the caller of this service. Values in this field will not be consistent across operations or event handlers on this class."

"Any data in the field "attribsToCopy" should not be specific to the caller of this service. Values in this field will not be consistent across operations or event handlers on this class."

Here's the code:

Thanks,

Mark
 
Ernest Friedman-Hill
author and iconoclast
Marshal
Pie
Posts: 24211
35
Chrome Eclipse IDE Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Makes no sense to me. Surely it's not a javac message; if it's an Eclipse message, maybe it's from some non-standard add-on? What sort of stuff have you got installed?
 
Mark Wuest
Ranch Hand
Posts: 88
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I shoulda pasted the code instead of typing it - it's a web service. I edited the code to include the annotations...

It's "BEA Workshop for WebLogic Platform", eclipse based.

Mark
 
Mark Wuest
Ranch Hand
Posts: 88
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hmmm - the IDE started going nuts and crashing (and sending bug reports). I moved the HashSet to be method local (which means the HashSet gets re-initialized each time the method gets called) and it fixed things. Not effecient, but at least the IDE doesn't crash and I don't get warnings... Weird..

Mark
 
Campbell Ritchie
Sheriff
Posts: 48917
58
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If the HashSet always contains the same data, why don't you make it static? And maybe even final?
 
Mark Wuest
Ranch Hand
Posts: 88
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Campbell Ritchie wrote:If the HashSet always contains the same data, why don't you make it static? And maybe even final?


Yeah - I intended to do that, but having it anything other than method-local makes the IDE crash. Weird, huh?

Mark
 
Campbell Ritchie
Sheriff
Posts: 48917
58
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Try navigating into your eclipse directories with a command line/terminal/shell, and compile and execute the classes from the terminal. See whether it still produces any errors. You might get complaints from Eclipse later if it finds two copies of a file, but you can sort that out easily enough.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic