]> source.dussan.org Git - aspectj.git/commitdiff
fix for Bugzilla Bug 40206
authoracolyer <acolyer>
Thu, 29 Jul 2004 16:35:10 +0000 (16:35 +0000)
committeracolyer <acolyer>
Thu, 29 Jul 2004 16:35:10 +0000 (16:35 +0000)
  need common isAspectJSourceFile() method

ajbrowser/src/org/aspectj/tools/ajbrowser/BrowserManager.java
ajde/src/org/aspectj/ajde/internal/LstBuildConfigManager.java
ajde/src/org/aspectj/ajde/ui/BuildConfigNode.java
taskdefs/src/org/aspectj/tools/ant/taskdefs/Ajc10.java

index 8227c7fd00b048225c8c92a0003901d8569e4042..6b487439d371a2ff69eaf538ecfd7adc9fdd408c 100644 (file)
@@ -24,6 +24,7 @@ import org.aspectj.ajde.ui.*;
 import org.aspectj.ajde.ui.internal.UserPreferencesStore;
 import org.aspectj.ajde.ui.swing.*;
 import org.aspectj.asm.*;
+import org.aspectj.util.FileUtil;
 //import org.aspectj.asm.internal.*;
 
 /**
@@ -160,7 +161,7 @@ public class BrowserManager {
                        if (filePath.endsWith(".lst")) {
                                AjdeUIManager.getDefault().getBuildConfigEditor().openFile(filePath);
                                topFrame.setEditorPanel(AjdeUIManager.getDefault().getBuildConfigEditor());
-                       } else if (filePath.endsWith(".java") || filePath.endsWith(".aj")){
+                       } else if (FileUtil.hasSourceSuffix(filePath)){
                                editorManager.showSourceLine(filePath, 0, false);               
                        } else {
                                Ajde.getDefault().getErrorHandler().handleError("File: " + filePath 
index c1b0a3789ded29b2c342d22bac4fd1ea39907265..862602b1322e27f2992deaec613991a0903c03c7 100644 (file)
@@ -21,6 +21,7 @@ import org.aspectj.ajde.*;
 import org.aspectj.ajde.ui.*;
 import org.aspectj.bridge.*;
 import org.aspectj.util.ConfigParser;
+import org.aspectj.util.FileUtil;
 
 /**
  * @author     Mik Kersten
@@ -34,9 +35,7 @@ public class LstBuildConfigManager implements BuildConfigManager {
        
     private static final FilenameFilter SOURCE_FILE_FILTER = new FilenameFilter() {
         public boolean accept(File dir, String name) {
-            return name.endsWith(".java") 
-               || name.endsWith(".aj") 
-               || name.endsWith(".lst");
+            return FileUtil.hasSourceSuffix(name) || name.endsWith(".lst");
         }
     };
 
index 417e0e795697f454be88c8504bee29e370f3bf37..cea5fe9e15326442f80e6c81ff0b0cb1d1b4815b 100644 (file)
@@ -18,6 +18,7 @@ import java.io.*;
 import java.util.*;
 
 import org.aspectj.bridge.*;
+import org.aspectj.util.FileUtil;
 
 /**
  * @author Mik Kersten
@@ -159,9 +160,7 @@ public class BuildConfigNode {
        }
        
        public boolean isValidResource() {
-               return name.endsWith(".java") 
-                       || name.endsWith(".aj") 
-                       || name.endsWith(".lst");       
+               return FileUtil.hasSourceSuffix(name) || name.endsWith(".lst"); 
        }
        
        public boolean isActive() {
index 39bec81d4d68e68a95085c7169ad8d68408ef14f..010a3e4641073a398bf0c5430039d3063c05c3d4 100644 (file)
@@ -26,6 +26,7 @@ import org.aspectj.bridge.IMessageHolder;
 import org.aspectj.bridge.MessageHandler;
 import org.aspectj.tools.ajc.Main;
 import org.aspectj.tools.ajc.Main.MessagePrinter;
+import org.aspectj.util.FileUtil;
 
 import java.io.File;
 import java.util.Arrays;
@@ -457,8 +458,7 @@ public class Ajc10 extends MatchingTask {
                 String[] files = getDirectoryScanner(dir).getIncludedFiles();
                 for (int j = 0; j < files.length; j++) {
                     File file = new File(dir, files[j]);
-                    if (file.getName().endsWith(".java")
-                        || file.getName().endsWith(".aj")) {
+                    if (FileUtil.hasSourceSuffix(file)) {
                         cmd.createArgument().setFile(file);
                         numfiles++;
                     }