Win a copy of Machine Learning Systems: Designs that scale this week in the Scala forum
or Xamarin in Action: Creating native cross-platform mobile apps in the Android forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Fixing deprecated Elements of Open Source SIMULA Project  RSS feed

Ranch Hand
Posts: 224
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I downloaded the source code for the SIMULA project from "" and noticed that when I compile the 35 Java files it consists of, all the files compile, but I get the message "Note: Some input files use or override a deprecated API. / Note: Recompile with -Xlint:deprecation for details. / Note: Some input files use unchecked or unsafe operations. / Note: Recompile with -Xlint:unchecked for details." I decided a nice project for me would be to modify the code so that it doesn't generate these warning messages. To start, I decided to take care of the deprecated code problems, so I went to "simags-src-2B\src" and executed "javac -d ..\target -deprecation". That gave me a whole bunch of warning messages, but it ended with: ".\ warning: [deprecation] handleEvent(Event) in Component has been deprecated / public boolean handleEvent(Event evt) {". It looks like the problem is that class {PaintDialog} extends class {Dialog} that extends class {Window} that extends class {Container} that extends class {Component}, and {Component} has a method {handleEvent()} that {PaintDialog} overrides, that is deprecated. The deprecation information for this method at "" says: "Deprecated. As of JDK version 1.1 replaced by processEvent(AWTEvent)".

So my guess is that where "" overrides method {handleEvent()}, I need to take that out and override method {processEvent()} instead. But the code for overriding {handleEvent()} is like follows:

Class {Event} clearly has an {x} member variable, a {y} member variable, and a {metaDown()} member method, while class {AWTEvent} doesn't have any of those members. Is there some way to generate the equivalent of the {x} and {y} variables for an {AWTEvent} object, so that I can write a {processEvent()} method that does the equivalent thing? And similarly for {metaDown()}? I noticed that {AWTEvent} does have an {id} member variable; can I assume that I can do the same thing with it in {processEvent()} that the existing {handleEvent()} does with {}? If I can't do any of these things, then what can I do to fix the code so that it makes the SIMULA project run right without using deprecated methods?
It is difficult to free fools from the chains they revere - Voltaire. tiny ad:
Rocket Oven Kickstarter - from the trailboss
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!