Imported Upstream version 2.10+ds
[debian/jabref.git] / src / java / net / sf / jabref / aspects / violations / DetectSwingSingleThreadRuleViolations.aj
index 16af20d78df5953f3a12c2ccc5fd839d709d3206..17dcdfd030dd0e31c650e1fcd543b2b9478d0b95 100644 (file)
@@ -1,41 +1,41 @@
-/*\r
- * Package package net.sf.jabref.aspects.violations;\r
- * Created on Nov 6, 2004\r
- * Author mspiegel\r
- *\r
- */\r
-package net.sf.jabref.aspects.violations;\r
-\r
-import java.awt.Component;\r
-import java.awt.EventQueue;\r
-\r
-public aspect DetectSwingSingleThreadRuleViolations {\r
-\r
-       pointcut guiUpdates(Component component)\r
-               :       call(* java..Component+.*(..)) && \r
-                   !call(* net..jabref+.*(..)) && target(component);                   \r
-    \r
-       pointcut safeGuiCalls()\r
-               : call (* javax..JComponent.repaint(..))\r
-                       || call(* javax..JComponent.revalidate(..))\r
-                   || call(* javax..JComponent.invalidate(..))\r
-                   || call(* javax..*.add*Listener(..))\r
-                   || call(* javax..*.remove*Listener(..));\r
-                       \r
-       pointcut unsafeGuiCalls(Component component)\r
-               : guiUpdates(component) && !safeGuiCalls();\r
-    \r
-    before(Component component) : unsafeGuiCalls(component) \r
-       && if (!EventQueue.isDispatchThread() && (component != null) &&\r
-                       component.isDisplayable() && !Thread.currentThread().getName().equals("main")) {\r
-            System.err.println(        \r
-                    "Violation: Swing component method called from nonAWT thread"\r
-                    + "\nCalled method: " + thisJoinPointStaticPart.getSignature()\r
-                    + "\nCaller:" + thisEnclosingJoinPointStaticPart.getSignature()\r
-                    + "\nSource Location:" + thisJoinPointStaticPart.getSourceLocation()\r
-                    + "\nThread:" + Thread.currentThread() \r
-                    + "\nChange code to use EventQueue.invokeLater() or EventQueue.invokeAndWait()"\r
-                    + "\n");\r
-       }\r
-    \r
-}\r
+/*
+ * Package package net.sf.jabref.aspects.violations;
+ * Created on Nov 6, 2004
+ * Author mspiegel
+ *
+ */
+package net.sf.jabref.aspects.violations;
+
+import java.awt.Component;
+import java.awt.EventQueue;
+
+public aspect DetectSwingSingleThreadRuleViolations {
+
+       pointcut guiUpdates(Component component)
+               :       call(* java..Component+.*(..)) && 
+                   !call(* net..jabref+.*(..)) && target(component);                   
+    
+       pointcut safeGuiCalls()
+               : call (* javax..JComponent.repaint(..))
+                       || call(* javax..JComponent.revalidate(..))
+                   || call(* javax..JComponent.invalidate(..))
+                   || call(* javax..*.add*Listener(..))
+                   || call(* javax..*.remove*Listener(..));
+                       
+       pointcut unsafeGuiCalls(Component component)
+               : guiUpdates(component) && !safeGuiCalls();
+    
+    before(Component component) : unsafeGuiCalls(component) 
+       && if (!EventQueue.isDispatchThread() && (component != null) &&
+                       component.isDisplayable() && !Thread.currentThread().getName().equals("main")) {
+            System.err.println(        
+                    "Violation: Swing component method called from nonAWT thread"
+                    + "\nCalled method: " + thisJoinPointStaticPart.getSignature()
+                    + "\nCaller:" + thisEnclosingJoinPointStaticPart.getSignature()
+                    + "\nSource Location:" + thisJoinPointStaticPart.getSourceLocation()
+                    + "\nThread:" + Thread.currentThread() 
+                    + "\nChange code to use EventQueue.invokeLater() or EventQueue.invokeAndWait()"
+                    + "\n");
+       }
+    
+}