Revision: 43
Author: maka82
Date: Wed Jul 22 14:50:50 2009
Log: Bug causing that application newer really ends is fixed.
http://code.google.com/p/apache-rat-pd/source/detail?r=43

Modified:
 /trunk/src/main/java/org/apache/rat/pd/core/SourceCodeAnalyser.java
/trunk/src/main/java/org/apache/rat/pd/engines/google/GoogleCodeSearchParser.java

=======================================
--- /trunk/src/main/java/org/apache/rat/pd/core/SourceCodeAnalyser.java Mon Jul 20 14:56:49 2009 +++ /trunk/src/main/java/org/apache/rat/pd/core/SourceCodeAnalyser.java Wed Jul 22 14:50:50 2009
@@ -82,8 +82,10 @@
                        }

                };
+               //to ensure that this process will end together with the program
+               pauseListener.setDaemon(true);
                pauseListener.start();
-
+
        }

        /**
=======================================
--- /trunk/src/main/java/org/apache/rat/pd/engines/google/GoogleCodeSearchParser.java Tue Jul 7 17:06:24 2009 +++ /trunk/src/main/java/org/apache/rat/pd/engines/google/GoogleCodeSearchParser.java Wed Jul 22 14:50:50 2009
@@ -65,7 +65,7 @@
private static final String CODESEARCH_FEEDS_URL = "http://www.google.com/codesearch/feeds/search?";;

        public static final String RESULT_NUMBER = "20";
-
+
        /**
         * This class is there to estimate matching of results returned by
* GoogleCodeSearch with real code. It will read CodeSearchFeed and analyze
@@ -168,15 +168,16 @@
        }

        // FIXME URLEncoding is system dependent now
-       private void createUrl(String posibleCutAndPastedCode)
+       private URL createUrl(String posibleCutAndPastedCode)
                        throws MalformedURLException {
-               privateFeedUrl = new URL(CODESEARCH_FEEDS_URL
+               URL toret =  new URL(CODESEARCH_FEEDS_URL
                                + "as_lang=java&q="
                                + URLEncoder.encode(regexGenerator
                                                
.stringToRegex(posibleCutAndPastedCode))
                                + "&max-results=" + RESULT_NUMBER);
                // System.out.println(regexGenerator
                // .stringToRegex(posibleCutAndPastedCode));
+               return toret;
        }

        @Override
@@ -188,7 +189,7 @@
        public boolean gueryEngine(String posibleCutAndPastedCode)
                        throws IOException, ServiceException {
                boolean toreturn = false;
-               createUrl(posibleCutAndPastedCode);
+               this.privateFeedUrl = createUrl(posibleCutAndPastedCode);
                CodeSearchFeed myFeed = 
codesearchService.getFeed(privateFeedUrl,
                                CodeSearchFeed.class);
                toreturn = (myFeed.getEntries().size() > 0)

Reply via email to