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: 8
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: 1527
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:compilerArg for batch compiler/PDE Build -warn:-raw not working
Next Topic:Cleaning up Git repository misbehaving
Goto Forum:
  


Current Time: Mon Nov 20 02:19:46 GMT 2017

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

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