Note that there are some explanatory texts on larger screens.

plurals
  1. POChanging function prototype generates "cannot be resolved. It is indirectly referenced" error
    primarykey
    data
    text
    <p>In researching this problem, I've run into a lot of posts that have seen errors similar to the title of this post. This problem is different in that the error only shows up when I try to pass <em>String</em> to functions of a plugin class I'm developing.</p> <p>I did find one post <a href="https://stackoverflow.com/questions/12221594/rap-how-to-access-object-in-viewpart">RAP: How to access Object in ViewPart</a> that may be hinting at my issue.</p> <p>Although I'm running Eclipse 3.6.1, I think this question is about general Java. My main issue is that I have a class (class A) in one Eclipse project that uses another class (class B) in an Eclipse plug-in project. A cannot call any functions of class B that require a <em>String</em> as one of the arguments. I generated a dummy class C (along with a dummy Java project) that uses class B and I still have the same issues. Let me elaborate some.</p> <p>I have two projects in Eclipse. One of them is an Eclipse plugin project that contains a class that is essentially a plotter and that extends <em>org.eclipse.ui.part.ViewPart</em>. I am instantiating this plotter class from another non-plugin project which cannot call any member functions from the plotter class that expect a <em>String</em> as one of the arguments.</p> <p>For example, the following code snippet:</p> <pre><code>Plotter myPlotter = new Plotter(); myPlotter.plot(); </code></pre> <p>works correctly when run from my non-plugin project. If, however, I modify <em>plot</em> to expect a <em>String</em> (say, for a label), or even create a new function that prints a <em>String</em>:</p> <pre><code>Plotter myPlotter = new Plotter(); String theString = "I'm the String"; myPlotter.plot(theString); myPlotter.printMe(theString); </code></pre> <p>Eclipse gives me red underlines under <em>printMe</em> and <em>plot</em> indicating an error. When I hover over <em>printMe</em>, I get the error: <em>The type org.eclipse.ui.part.ViewPart cannot be resolved. It is indirectly referenced from required .class files</em></p> <p>To try to understand this problem a little better, I built another two classes in the plugin project to test the issue, one whose superclass is <em>java.lang.Object</em>, the other whose superclass is <em>org.eclipse.ui.part.ViewPart</em>. I can call functions with <em>String</em> arguments from the <em>Object</em>-based class but I cannot call functions with String as arguments from the <em>ViewPart</em>-based class. So it has something to do with <em>ViewPart</em> (I can drill down to subsequent superclasses and still have the problem if the class inherits from <em>EventManager</em>). Just for kicks, I tried changing the class so it extends <em>Vector</em> and my problem disappears. It looks to me like the problem is related to <em>EventManager</em> and/or <em>ViewPart</em>.</p> <p>Any insights would be greatly appreciated.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload