• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • paul wheaton
  • Liutauras Vilda
  • Ron McLeod
Sheriffs:
  • Jeanne Boyarsky
  • Devaka Cooray
  • Paul Clapham
Saloon Keepers:
  • Scott Selikoff
  • Tim Holloway
  • Piet Souris
  • Mikalai Zaikin
  • Frits Walraven
Bartenders:
  • Stephan van Hulst
  • Carey Brown

Errors while adding IBM Java Examples 3.5.3

 
Ranch Hand
Posts: 1157
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,
I had a rather inauspicious start to VisualAge for Java.I am using Version 3.5.3.When I tried to add a feature using QuickStart--->Features--->Add Feature--->IBM Java Examples 3.5.3, I happened to get Problems in the projects added to the workspace:
IBM Java Examples 11 Problems:0 Errors,11 Warnings
Sun BDK Examples 10 Problems:1 Errors, 9 Warnings
Please do let me know how do I get rid of the above problems.
Thanks in advance,
Sandeep
 
Ranch Hand
Posts: 399
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Go to the All Problems tab in the Workbench to see the problems.
In VAJ 3.5.2, most, if not all, of those "Warnings" are about deprecated methods. So just ignore them, and, when you write your code, do it the new way. Or you can hide deprecation warnings by right clicking in the "All Problems" panel, and selecting the Filter option to exclude deprecation warnings.
The "Error" in one of demos shouldn't cause you a problem unless you do something that tries to use that classs.
[This message has been edited by John Dale (edited July 03, 2001).]
 
Desai Sandeep
Ranch Hand
Posts: 1157
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi John,
Looking at the errors/warnings by clicking the All Problems tab, I find many deprecated messages and one error message.
As you said, the deprecated messages could be ignored.However, while giving more thought on how to get rid of the one error message, which is due to the workspace inability to find the StatusEvent type, the following queries came in my mind:

  1. Can we find out, which classes in the workspace implement the interface, i.e. does VA4J help us to find out dependencies?
  2. If the class/interface is being used in the workspace, does VA4J provide a mechanism to find the package where this class is defined?
  3. Once the package has been identified,do we need to import that package in the workspace.Alternatively, would it be OK if we put the path of the Jar(or class file) in the Workspace classpath?

  4. Thanks,
    Sandeep
 
John Dale
Ranch Hand
Posts: 399
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Someone not just starting with VAJ might be able to give you better ways, but here is my quick try. Once you do enough to get the slightest feel for how VAJ works (e.g., Stanchfield chapters 1-3), it is easy to do the kind of navigation required for your questions 1 and 2. (As I understand it, this is one of VAJ's particular strengths.)
So, assuming I'm understanding your questions...
"1. Can we find out, which classes in the workspace implement the interface, i.e. does VA4J help us to find out dependencies?"
Yes. In the Workbench, Interfaces tab, right-click the interface (StepEvent) and pick Implementors. There you will see all matches (maybe one in this case). Select one to see full name in status bar. Open it up (e.g., double click it), and you can see whatever you want.
"2. If the class/interface is being used in the workspace, does VA4J provide a mechanism to find the package where this class is defined?"
Yes. If you pick the type out the Class or Interfaces tab of Workbench, and check the status line for package name, or double-click to open and see whatever you want.
Or, if you select a type name it in, say, a method body, right-click, then Open on Selection.
(Of course, I didn't remember that "Open on Selection" existed, but I did know that if I right-clicked, I'd probably find what I needed.)
"3. Once the package has been identified,do we need to import that package in the workspace.Alternatively, would it be OK if we put the path of the Jar(or class file) in the Workspace classpath?"
So far, I've preferred to import thinks I'm using into the workspace so I could use VAJ to navigate the classes.
I think you can refer to external code if all you want to do is excute, not browse, but I'm just starting that chapter of the my book. I've not tried it so cannot quickly verify the details off the top of my head. I'm sure your books or the help will tell you how. (The IDE.PDF is well worth printing, especially if your books don't do a good job with the IDE.)
 
Desai Sandeep
Ranch Hand
Posts: 1157
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi John,
The information you furnished was quite helpful.Thanks!
Regarding the second question,"If the class/interface is being used in the workspace, does VA4J provide a mechanism to find the package where this class is defined?",I had asked specifically to find the package where StatusEvent has been defined.
I thought your suggestion to highlight the type,then rightclick and select "Open on Selection" would have worked in this case too.However, it seems that VA4J searches only for classes imported as projects in the workspace.Most probably, the package where StatusEvent is defined is not available in the current workspace and hence we don't get the source code for this class.Did I get this right?
If my conclusion is correct, then probably VA4J is logically having 2 classpaths - one for compilation and another for runtime.The Workspace classpath (Window -->Option-->Resources) would probably point to the runtime classpath.This means the name is somewhat misleading.The compile classpath would probably be the one which refers to all the class files in the workspace.I am assuming this since to compile the IBM Examples, the package where StatusEvent is defined has to be imported.I have tried all sorts of tricks to add as many JAR files as possible in the workspace classpath, but it simple doesn't work!The biggest problem is how do I find the package where StatusEvent is defined.
Please do let me know your views on this.
Thanks,
Sandeep
[This message has been edited by Desai Sandeep (edited July 04, 2001).]
 
John Dale
Ranch Hand
Posts: 399
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hmm. It seems that Open on Selection behaves differently, depending on where you are when you use it. (Like I said, I'm a beginner with VAJ.)
Here is one way, supposing you have this in the All Problems
<pre>
sunw.demo.quote 1 Errors, 0 Warnings
QuoteListenerGUI 1 Errors, 0 Warnings
void statusChanged(StatusEvent) 1 Errors, 0 Warnings
Method parameter type StatusEvent is missing
</pre>
Double-click on the line for QuoteLIstenerGUI to open a class browser. In its source panel, select StatusEvent and right-click, selecting Open on Selection. This opens a class browser for StatusEvent in sun.awt.im.iiimp (which is in the project Sun class libraries PM Win32 1.2.2, perhaps among others). Even though there is no source, you can select member to see a bit.
Here is another way, again assuming the code is loaded into your workspace. From Workbench, press F4 or select the Search icon (or Workspace - Search). Then type "StatusEvent", select Type, Definitions, Workspace, and Start. Select the match of interest in the match panel to see the "source" in the bottom panel.
Now, I'm not sure that sun.awt.im.iiimp.StatusEvent is really supposed to be referenced in sunw.demo.quote.QuoteListenerGUI, since this StatusEven is not public. If you comment out "void statusChanged(StatusEvent x);" in QuoteListenerGUI, the thing at least compiles. But I've not looked into the sunw.demo.quote example more deeply.
By the way, one great thing about VAJ is you can so easily tinker with an existing class to see if you can resolve a problem, and then, when you are finished, get back to where you started using "replace with". You'll be comfortable with this once you learn how the VAJ versions and repository work.
[This message has been edited by John Dale (edited July 04, 2001).]
 
Desai Sandeep
Ranch Hand
Posts: 1157
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
John,
Noticed a very strange thing.Yesterday, when I right-clicked and selected "Open on Selection" for StatusEvent by using the Interface tab, I couldn't see a Class Window for the Event class.
However, when I tried it today after opening the StatusEvent by using the All Problems tab, I was able to see the Class Window using both the tabs.
Please try the same on your system and let me know, if this is correct.Hope this was the indiscrepancy which you were refering to regarding "Open on Selection" behaving differently, depending on where you use it.
However, it seems if we select this class using the All Problems tab and then Interface tab, it seems "Open on Selection" is not behaving differently!


Originally Posted by John Dale:
Now, I'm not sure that sun.awt.im.iiimp.StatusEvent is really supposed to be referenced in sunw.demo.quote.QuoteListenerGUI, since this StatusEven is not public.


This precisely is the problem.The other event QuoteEvent is defined as public so there is no problem with it, while the StatusEvent has a package signature.
Could you explain, how I can modify and then undo the changes in VA4J.Say for instance, I want to change the signature of StatusEvent class to public and then revert back to the original version, then what should I do?
Thanks in advance,
Sandeep
[This message has been edited by Desai Sandeep (edited July 05, 2001).]
 
John Dale
Ranch Hand
Posts: 399
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I'll keep my eyes open for details on where "Open on selection" behaves how. I'm not going to take the time for more experiments now.
You can modify types for which the source is in the workspace, test, and to revert back to the previous editions. I doubt you can modify a type for which the source is not in the workspace. (Except maybe by creating source?)
Before you start to modify something expecting to be able to revert back to the original, you need start learning about editions and versioning for your level of VAJ, as well as navigating the IDE. (There are some difference in how this works for Enterprise vs Professional, since team development introduces complications that are unnecessary in solo work.) I suggest that instead of having a newbie like me give you detailed instructions that could leave you with a mess, you should work through the applicable section of your favorite VAJ book, and/or the ide.pdf. I found ide.pdf much more useful for this purpose than the getting started track, and Stanchfield & Mauny especially helpful.
To get ide.pdf, select Help - PDF Index, then Integrated Development Environment.
[This message has been edited by John Dale (edited July 05, 2001).]
 
Desai Sandeep
Ranch Hand
Posts: 1157
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
John,
Thanks very much for your help.You are certainly more informed than me on this product.So any instructions from you are more than welcome.I have started going through the PDF documents you mentioned.
I am glad that I found this forum for discussing the technical problems with this IDE.I was in a mess with Oracle JDeveloper IDE.
Managed to build my first applet with VA4J.I am surprised to find that there is no help on method selection while coding manually.In JDeveloper, when I type java.awt.List and then put a "." in front of it,I immediately get a pop-up menu showing all the possible methods for java.awt.List.
Is this feature absent in IBM VA4J?
Thanks in advance,
Sandeep
[This message has been edited by Desai Sandeep (edited July 05, 2001).]
 
John Dale
Ranch Hand
Posts: 399
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
There is a code assist feature. If you type java.awt.List, followed by a dot ("."), then control-spacebar, you will get the CLASS methods and variables, since that is all that is meaningful to type there. However, it you declare a variable "list" of type java.awt.List, then type "list." followed by control-spacebar, you will get a pop-up of all the INSTANCE methods and variables.
The feature, along with the ways in which its behavior might be altered on your system, is described in a help page called Code Assist. Search for it, or look under IDE Hints and Tips in the Reference section of Help.
 
Desai Sandeep
Ranch Hand
Posts: 1157
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
John,
Nice to know that the Code Assist feature is available.Thanks for the information.
-- Sandeep
 
Politics n. Poly "many" + ticks "blood sucking insects". Tiny ad:
Gift giving made easy with the permaculture playing cards
https://coderanch.com/t/777758/Gift-giving-easy-permaculture-playing
reply
    Bookmark Topic Watch Topic
  • New Topic