Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Language IDEs » Java Development Tools (JDT) » Eclipse Is Reporting Non-Existant Errors
Eclipse Is Reporting Non-Existant Errors [message #1781603] Fri, 09 February 2018 09:57 Go to next message
Robert T is currently offline Robert TFriend
Messages: 1
Registered: February 2018
Junior Member
When I type a message like this, I only try to give relevant information but what I consider relevant and other people consider relevant is different because my brain works different then the average person because of autism.

So first off, I think when someone reports an error in any programming language it is a common response to say that they made a typo to explain it, especially if they are just learning the language. So I wanted to state two facts that I consider relevant before listing the error: I am extremely obsessive compulsive and do things a lot of times to make sure absolutely that no typo is involved. Also I wrote long computer programs 20 years ago, so even though it was a long time ago, I know how to program. I am only stating these two facts so that people know the error is not because of a typo in the code.

Here is the code where the error is occuring and I will explain what is happening after the code paste:

class Speak {
public static void main(String[] arguments) {
DogType Dog = new DogType();
Person John = new Person();

Dog.name = "Spock";
John.name = "John Smith";

System.out.println("The dog's name is " + Dog.name);
System.out.println("The person's name is " + John.name + "\n");

System.out.println("The dog will speak and sleep now:");
Dog.speak();
Dog.sleep();

System.out.println("The person will speak and sleep now:");
John.speak();
John.sleep();
}
}

First Eclipse was giving an error message on DogType Dog = new DogType();

I change the name of the DogType.java file and the name of the class in the file to DogAnimal then the error on that line goes away, but then there is an error message on the next line.

But guess what. All I do is hit the enter key between both the DogAnimal line and the Person line, to add a blank line between them and the error goes away: Proving it is a non-existant error.

Furthermore, the fact that, that line of code which is exactly identical except for renaming DogType to DogAnimal didn't have an error after renaming proves non-existant errors.

And lastly after all of the above happened, I went back and I renamed the DogAnimal back to DogType and took away the blank line between the DogAnimal and Person, and then no errors then?

And as I said, I think the fact that I programmed before and wrote very long programs and also the fact that I am extremely excessive compulsive and I checked the spelling of DogType in this code (which is like less then 50 lines of code) over 20 times. Proves that it can't be anything other then Eclipse reporting errors that aren't in the code. Or am I missing something here that I can't understand or see going on?




Re: Eclipse Is Reporting Non-Existant Errors [message #1781652 is a reply to message #1781603] Sat, 10 February 2018 19:14 Go to previous message
Stephan Herrmann is currently offline Stephan HerrmannFriend
Messages: 1613
Registered: July 2009
Senior Member
Hi Robert,

I appreciate the time you took for writing your post.

Since you are concerned about the relevance & completeness of information in the report, let me tell you that in most problem reports we receive the provided information does not initially suffice for taking any action (bug fix or conclusive answer). Apart from different attitudes / conditions of different people this is mostly due to different perspectives:

Reporters are surprised by the behavior of a tool and so they feel their problem is an obvious bug and believe that stating the most obvious symptom should suffice for fixing the problem.

We (JDT developers) know that for millions of hours of operation of JDT that particular problem has not yet surfaced (or wasn't important enough for a person to speak up). Our experience tells us that more often than not, the reporter did something different then others, perhaps quite subtly different.

Put bluntly: the typical bug in JDT is not: JDT cannot compile Java code, but it's usually a combination of several corner cases composed to something quite unique. Let me sketch a made-up example for illustration: the compiler is able to handle each of overloading, varargs, raw types, wildcard captures and visibility issues of inherited nested classes. Only if you overload a varargs method in a way that the a wildcard parameter has an upper bound of a nested type that is not visible to the caller, then bad things happen ... I hope you get the picture.

So, problem reporting quite normally is a dialog of questions (from us) and answers (by the reporter). Some reports are written quite sloppily, which then tells us it may be a long and bumpy road until we have enough information. Your report shows significant diligence and thus I'm confident we'll make progress if you accept the game of questions & answers.

As to your program, I agree that apparently the program should be accepted by the compiler with no errors, yet, I can't conclusively state, because what you showed us is not "self-contained", in particular we don't see the definitions of DogType and Person.

Now, instead of enumerating the individual things we'd like to see, I suggest you share the entire project (In Eclipse use "Export > General > Archive File"). With that information we will have much better chances to see what you are seeing.

Additionally, I'm curious regarding this sentence of your's:
Quote:
I change the name of the DogType.java file and the name of the class in the file to DogAnimal


You seem to be doing two changes where in intended usage of JDT only one operation would make both changes as one "refactoring". For such actions it may well be useful to describe exactly which hot-key or menu-action you used for making those changes. Particular interesting for us: at what points in time did you save which file.

best regards,
Stephan

[Updated on: Sat, 10 February 2018 19:30]

Report message to a moderator

Previous Topic:Label Indentation / Spaces before Comment Tag
Next Topic:Eclipse MAT heap dump import
Goto Forum:
  


Current Time: Mon Aug 20 06:55:57 GMT 2018

Powered by FUDForum. Page generated in 0.02081 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top