Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Language IDEs » Java Development Tools (JDT) » Compiler shows no errer about static class
Compiler shows no errer about static class [message #1767068] Fri, 30 June 2017 10:27 Go to next message
Veselin Markov is currently offline Veselin MarkovFriend
Messages: 15
Registered: February 2012
Junior Member
Hi,

I had the strangest problem today - I tried to instantiate a class with a constructor and got an InstantiationError:

My application was as follows:
public class A {
	public void method(){
		new D();
	}
}

public class B{
	public asbtract static class C<M, V> {
		public static class D {
		}
	}
}


As soon as I removed the static from C it worked but I also had to implement a method in C. Is it a bug in the compiler error that I got no warning in the java and an the error in run time?
Re: Compiler shows no errer about static class [message #1767307 is a reply to message #1767068] Tue, 04 July 2017 14:46 Go to previous message
Stephan Herrmann is currently offline Stephan HerrmannFriend
Messages: 1853
Registered: July 2009
Senior Member
Hm, when I turn your example into something that compiles and runs, there is no InstantiationError.
OTOH, if you can provide a complete example that demonstrates the InstantiationError, please file a bug at https://bugs.eclipse.org/bugs/enter_bug.cgi?product=JDT&component=Core
when doing so, please also specify the exact version of JDT.
Previous Topic:Eclipse IDE fails to start after May Windows Updates
Next Topic:Cleaning up Git repository misbehaving
Goto Forum:
  


Current Time: Thu Oct 10 21:29:56 GMT 2024

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

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

Back to the top