Add ability to load previously found bugs back out of the database.
[cfb.git] / prod / net / jaekl / cfb / store / Location.java
index 2cd91c80f70e5a81c5f5df4e8b00f97b55cd954b..8755fe6cc5945a7e18d298f6bb3f09bcad450de5 100644 (file)
@@ -5,8 +5,10 @@ import net.jaekl.cfb.xml.BugMethod;
 import net.jaekl.cfb.xml.SourceLine;
 
 public class Location {
+       Long m_id;
        String m_className;
        String m_methodName;
+       String m_methodRole;
        int m_startLine;
        int m_endLine;
        
@@ -20,6 +22,15 @@ public class Location {
                init(method.getSourceLines());
                m_className = method.getClassName();
                m_methodName = method.getMethodName();
+               m_methodRole = method.getRole();
+       }
+       
+       public Location(BugMethod method, SourceLine sourceLine)
+       {
+               init(sourceLine);
+               m_className = method.getClassName();
+               m_methodName = method.getMethodName();
+               m_methodRole = method.getRole();
        }
        
        public Location(BugClass bugClass)
@@ -28,8 +39,14 @@ public class Location {
                m_className = bugClass.getClassName();
        }
        
+       public Location(Long id, String className, String methodName, String methodRole, long startLine, long endLine)
+       {
+               
+       }
+       
        public String getClassName() { return m_className; }
        public String getMethodName() { return m_methodName; }
+       public String getMethodRole() { return m_methodRole; }
        public int getStart() { return m_startLine; }
        public int getEnd() { return m_endLine; }
        
@@ -40,12 +57,19 @@ public class Location {
                        init(sourceLines[0]);
                }               
        }
+       
+       private void init(SourceLine sourceLine) 
+       {
+               init(sourceLine.getClassName(), sourceLine.getStart(), sourceLine.getEnd());
+       }
 
-       private void init(SourceLine sourceLine)
+       private void init(String className, int startLine, int endLine)
        {
-               m_className = sourceLine.getClassName();
+               m_id = null;
+               m_className = className;
                m_methodName = null;
-               m_startLine = sourceLine.getStart();
-               m_endLine = sourceLine.getEnd();
+               m_methodRole = null;
+               m_startLine = startLine;
+               m_endLine = endLine;
        }
 }