user496949
user496949

Reputation: 86055

why sometimes I have to put @Test in the seperate line for it to work in Eclipse

The following does not work sometimes

 @Test public void testBlah() throws Exception

I have to use

@Test
public void testBlah() throws Exception

I want to know why?

Upvotes: 1

Views: 76

Answers (1)

Adeel Ansari
Adeel Ansari

Reputation: 39887

I guess, because in the former Test is not imported, whereas when you press <enter> that tends to fix the import automatically without you noticing it, and you get the feeling that it doesn't work on the same line.

I can't think of any other reason.

Upvotes: 4

Related Questions