java/src/org/openantivirus/engine ScanEngine.java,1.8,1.9 WriteableScanConfiguration.java,1.3,1.4

Kurt Huwig <[email protected]> Sat, 03 Sep 2005 16:16:42 +0000
Newsgroups gmane.comp.security.virus.openantivirus.cvs
Message-ID <[email protected]>
Update of /cvsroot/openantivirus/java/src/org/openantivirus/engine
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv28211/src/org/openantivirus/engine

Modified Files:
	ScanEngine.java WriteableScanConfiguration.java 
Log Message:
Code cleanup

Index: WriteableScanConfiguration.java
===================================================================
RCS file: /cvsroot/openantivirus/java/src/org/openantivirus/engine/WriteableScanConfiguration.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -d -r1.3 -r1.4
--- WriteableScanConfiguration.java	30 May 2004 00:52:44 -0000	1.3
+++ WriteableScanConfiguration.java	3 Sep 2005 16:16:40 -0000	1.4
@@ -113,13 +113,12 @@
 
         if (result != null) {
             return result;
-        } else {
-            if (parent != null) {
-                return parent.getObject(key);
-            } else {
-                throw new IllegalArgumentException("unknown key '" + key + "'");
-            }
         }
+        
+        if (parent != null) {
+            return parent.getObject(key);
+        }
+        throw new IllegalArgumentException("unknown key '" + key + "'");
     }
 
     public void putObject(String key, Object value) {

Index: ScanEngine.java
===================================================================
RCS file: /cvsroot/openantivirus/java/src/org/openantivirus/engine/ScanEngine.java,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -d -r1.8 -r1.9
--- ScanEngine.java	26 May 2004 20:19:52 -0000	1.8
+++ ScanEngine.java	3 Sep 2005 16:16:40 -0000	1.9
@@ -63,10 +63,10 @@
     throws IOException, CredoException {
         this.scanConfiguration = scanConfiguration;
         
-        loadCredoFiles(scanConfiguration);
+        loadCredoFiles();
     }
     
-    public void loadCredoFiles(ScanConfiguration scanConfiguration)
+    public void loadCredoFiles()
     throws CredoException, IOException {
         final StringSearch stringSearch;
         if (scanConfiguration.getBoolean("engine.use-trie")) {
@@ -91,7 +91,7 @@
 	 * @throws MalwareFoundException
 	 *             if malware has been found within this file
 	 */
-    public void scan(File file) throws MalwareFoundException, IOException {
+    public void scan(File file) throws MalwareFoundException {
         scan(file, scanConfiguration);
     }
  
@@ -104,7 +104,7 @@
 	 *             if malware has been found within this file
 	 */
     public void scan(File file, ScanConfiguration conf)
-        throws MalwareFoundException, IOException {
+        throws MalwareFoundException {
         notifyStartingScan();
         try {
             scan(new FileVfsEntry(file), conf);
@@ -163,9 +163,9 @@
                     container = containerFactories[i].getContainer(entry, conf);
                     if (container == null) {
                         continue;
-                    } else {
-                        containerFound = true;
                     }
+                    
+                    containerFound = true;
     
                     while (container.hasNext()) {
                         try {



-------------------------------------------------------
SF.Net email is Sponsored by the Better Software Conference & EXPO
September 19-22, 2005 * San Francisco, CA * Development Lifecycle Practices
Agile & Plan-Driven Development * Managing Projects & Teams * Testing & QA
Security * Process Improvement & Measurement * http://www.sqe.com/bsce5sf