Hello Guys
I did realize the follow
I could have the follow code (I am using a similar code taken from a tutorial with the same structure)
This code with Maven 2.2.1 and JDK 6 - 21, compile wellCode:package com.manuel.jordan; public class ManuelThread implements Runnable { @Override public void run() { } }
Did realize yourself, none warning or something related is shown aboveCode:....> mvn clean compile [INFO] Scanning for projects... [INFO] ------------------------------------------------------------------------ [INFO] Building channels [INFO] task-segment: [clean, compile] [INFO] ------------------------------------------------------------------------ [INFO] [clean:clean {execution: default-clean}] [INFO] Deleting directory ....\target [INFO] [resources:resources {execution: default-resources}] [INFO] Using 'UTF-8' encoding to copy filtered resources. [INFO] Copying 8 resources [INFO] [compiler:compile {execution: default-compile}] [INFO] Compiling 27 source files to .....\target\classes [INFO] ------------------------------------------------------------------------ [INFO] BUILD SUCCESSFUL [INFO] ------------------------------------------------------------------------ [INFO] Total time: 2 seconds [INFO] Finished at: Thu Jul 14 12:09:54 COT 2011 [INFO] Final Memory: 12M/30M [INFO] ------------------------------------------------------------------------ ....>
But the same java code shown above opened in STS 2.6.1 or with STS 2.7.0 and using the same JDK 6 - 21, I got the follow error when the editor is open.
To avoid this, is mandatory commenting the annotationCode:Multiple markers at this line - implements java.lang.Runnable.run - The method run() of type ManuelThread must override a superclass method
Why this behavior?, I know @Override should be used only in inheritance of classes.Code://@Override public void run() { }
But since I am using my code which is similar from a code taken from a tutorial with the same structure, I just did realize this situation working with STS, where this @Override is being applied with an Interface
Of course could be illogic apply this approach working with interfaces, but in Google I did realize that in many tutorials (not all) the same approach is used above.
Furthermore this same error situation appear if I use for example the follow code
Where MessageCreator is an interface, see the API hereCode:jmsTemplate.send(new MessageCreator() { @Override public javax.jms.Message createMessage(Session session) throws JMSException { MapMessage message = session.createMapMessage(); logger.info("Sending message: " + message); return message; } });
Yes a Interface and working with new
Anyway with STS I got
How I can handle this?, I need the code totally portable to work with and without STSCode:Multiple markers at this line - The method createMessage(Session) of type new MessageCreator(){} must override a superclass method - implements org.springframework.jms.core.MessageCreator.createMessage
Thanks in advanced


Reply With Quote