Apache rat pd

Author: k | 2025-04-24

★★★★☆ (4.4 / 3202 reviews)

where is elton john performing tonight

apache-rat-pd. There was an error getting resource 'source':-1: apache-rat-pd. There was an error getting resource 'source':-1:

make iron man suit

apache-rat-pd - Google Search

Revision: 53Author: maka82Date: Fri Aug 21 17:04:14 2009Log: Comments in whole project have been write down according to javadoc standard trying to give more informations about parameters and about returning informations for functions.Some misspelled words have been written correct now.Also, CamelCases are used now in a project where it is needed.Some TODOs are fixed. /trunk/src/main/java/org/apache/rat/pd/core/PdCommandLine.java /trunk/src/main/java/org/apache/rat/pd/core/PlagiarismDetector.java /trunk/src/main/java/org/apache/rat/pd/core/SourceCodeAnalyser.java /trunk/src/main/java/org/apache/rat/pd/engines/ISearchEngine.java /trunk/src/main/java/org/apache/rat/pd/engines/KodersCodeSearchParser.java /trunk/src/main/java/org/apache/rat/pd/engines/Managable.java /trunk/src/main/java/org/apache/rat/pd/engines/RetryManager.java /trunk/src/main/java/org/apache/rat/pd/engines/google/GoogleCodeSearchParser.java /trunk/src/main/java/org/apache/rat/pd/engines/google/MultilineRegexGenerator.java /trunk/src/main/java/org/apache/rat/pd/heuristic/functions/CPPFunctionHeuristicChecker.java /trunk/src/main/java/org/apache/rat/pd/heuristic/functions/FortranFunctionHeuristicChecker.java /trunk/src/main/java/org/apache/rat/pd/heuristic/misspellings/MisspellingsHeuristicChecker.java /trunk/src/main/java/org/apache/rat/pd/util/FileManipulator.java /trunk/src/test/java/org/apache/rat/pd/core/SlidingWindowAlgorithmTest.java /trunk/src/test/java/org/apache/rat/pd/engines/google/RegexGeneratorTest.java /trunk/src/test/java/org/apache/rat/pd/heuristic/functions/CPPFunctionHeuristicCheckerTest.java=======================================--- /trunk/src/main/java/org/apache/rat/pd/core/PdCommandLine.java Fri Aug 21 06:53:09 2009+++ /trunk/src/main/java/org/apache/rat/pd/core/PdCommandLine.java Fri Aug 21 17:04:14 2009@@ -173,7 +173,7 @@ } catch (Exception e) { // oops, something went wrong this.out.println("Parsing failed. Reason: " + e.getMessage());- // if any error is happened, we can say that not all arguments are+ // if any error happened, we can say that not all arguments are // correct allArgumentsCorrect = false; }@@ -194,6 +194,8 @@ * Parse arguments and gets parameters from them. * * @param args command line arguments+ * @throws ParseException+ * @throws NumberFormatException */ private void parseArguments(String[] args) throws ParseException, NumberFormatException { CommandLineParser parser = new GnuParser();@@ -260,7 +262,8 @@ * If some property is invalid an exception is thrown. * * @param line CommandLine- * @throws NumberFormatException , IllegalArgumentException+ * @throws NumberFormatException+ * @throws IllegalArgumentException */ private void parseCommandLineArguments(CommandLine line) throws NumberFormatException, IllegalArgumentException {=======================================--- /trunk/src/main/java/org/apache/rat/pd/core/PlagiarismDetector.java Fri Aug 21 06:53:09 2009+++ /trunk/src/main/java/org/apache/rat/pd/core/PlagiarismDetector.java Fri Aug 21 17:04:14 2009@@ -91,6 +91,7 @@ /** * @param args * @throws RatReportFailedException+ * @throws IOException */ public static void main(String[] args) throws RatReportFailedException, IOException { // instance of PlagiarismDetector@@ -129,7 +130,7 @@ * Decide which format of report will be used. * * @param pdCommandLine command line object to read report format from- * @return+ * @return which format of report will be used */ private Report configureReport(PdCommandLine pdCommandLine) { Report reportDocument;=======================================--- /trunk/src/main/java/org/apache/rat/pd/core/SourceCodeAnalyser.java Fri Aug 21 06:53:09 2009+++ /trunk/src/main/java/org/apache/rat/pd/core/SourceCodeAnalyser.java Fri Aug 21 17:04:14 2009@@ -58,7 +58,7 @@ * @param searchEngines list of chosen search engine parsers * @param algorithmsForChecking list of chosen heuristic algorithms * @param reportDocument chosen report- * @param out printStream wnere current information are be printed+ * @param out printStream where current information are to be printed */ public SourceCodeAnalyser(List searchEngines, List algorithmsForChecking, Report reportDocument, PrintStream out) {@@ -133,18 +133,18 @@ * @throws IOException */ private String readFile(Reader reader) throws IOException {- String toret = "";+ String toRet = ""; // TODO encoding is system default now!!!! BufferedReader input = new BufferedReader(reader); try { String line = null; while ((line = input.readLine()) != null) {- toret += line + "\n";+ toRet += line + "\n"; } } finally { input.close(); }- return toret;+ return toRet; } /**@@ -209,16 +209,16 @@ } /**- * Search for code in all engines. If code is found, an reportEntry will be- * returned Otherwise, null will be returned.+ * Search for code in all engines. If code is found, a reportEntry will be+ * returned. Otherwise, null will be returned. * * @param searchEngines list of chosen search engine parsers * @param code code to be checked * @param fileName source

marijuana emoji gif

apache-rat-pd 0.1.2 - Download - Softpedia

File name- * @return an report entry+ * @return a report entry */ private ReportEntry searchOnInternet(List searchEngines, String code, String fileName) {- ReportEntry toret = null;+ ReportEntry toRet = null; List found = new ArrayList(); for (ISearchEngine searchEngine : searchEngines) { if (searchEngine.isCodeFound(code.toString())) {@@ -226,36 +226,36 @@ } } if (!found.isEmpty()) {- toret = new ReportEntry(found, code, fileName);- }- return toret;+ toRet = new ReportEntry(found, code, fileName);+ }+ return toRet; } /**- * @param heuristicCheckers lit of chosen heuristic checkers+ * @param heuristicCheckers list of chosen heuristic checkers * @param toCheck code to be checked * @return heuristicCheckerResult with proper information for sliding window * algorithm */ private HeuristicCheckerResult isCheckOnInternetNeaded(List heuristicCheckers, String toCheck) {- HeuristicCheckerResult toret = new HeuristicCheckerResult(false, true, toCheck, null);+ HeuristicCheckerResult toRet = new HeuristicCheckerResult(false, true, toCheck, null); for (IHeuristicChecker checker : heuristicCheckers) {- toret = checker.checkByHeuristic(toCheck);- if (toret.isShouldStretch()) {+ toRet = checker.checkByHeuristic(toCheck);+ if (toRet.isShouldStretch()) { break; } }- return toret;+ return toRet; } /** * Append tokens from start position until end. * * @param tokens list of tokens to combine- * @param start position- * @param end position+ * @param start index of start position+ * @param end index of end position * @return appended tokens */ private StringBuffer combineTokens(String[] tokens, int start, int end) {@@ -290,9 +290,9 @@ * * Example:Analyzing file : c:\HelloWorld.java Progress: 2/200 (1%) *- * @param whole is number of all tokens we iterate- * @param current is current position of iteration- * @param fileName is file name of source file+ * @param whole number of all tokens we iterate+ * @param current current position of iteration+ * @param fileName file name of source file */ private void printProgress(int whole, int current, String fileName) { // clear previous state=======================================--- /trunk/src/main/java/org/apache/rat/pd/engines/ISearchEngine.java Fri Aug 21 06:53:09 2009+++ /trunk/src/main/java/org/apache/rat/pd/engines/ISearchEngine.java Fri Aug 21 17:04:14 2009@@ -33,10 +33,10 @@ /** * Checks if code part exist on this code search engine *- * @param posibleCutAndPastedCode+ * @param possibleCopyAndPastedCode code currently being checked * @return boolean - true if this code is found on search engine */- boolean isCodeFound(String posibleCutAndPastedCode);+ boolean isCodeFound(String possibleCopyAndPastedCode); /** * This method can return search results with link where we can see exactly=======================================--- /trunk/src/main/java/org/apache/rat/pd/engines/KodersCodeSearchParser.java Fri Aug 21 06:53:09 2009+++ /trunk/src/main/java/org/apache/rat/pd/engines/KodersCodeSearchParser.java Fri Aug 21 17:04:14 2009@@ -31,7 +31,7 @@ private static final String serch = " @Override- public boolean isCodeFound(String posibleCutAndPastedCode) {+ public boolean isCodeFound(String possibleCopyAndPastedCode) { // TODO Auto-generated method stub return false; }=======================================--- /trunk/src/main/java/org/apache/rat/pd/engines/Managable.java Fri Aug 21 06:53:09 2009+++ /trunk/src/main/java/org/apache/rat/pd/engines/Managable.java Fri Aug 21 17:04:14 2009@@ -35,10 +35,10 @@ * This function can retrieve information about potentially plagiarised code * from search engine. NOTE: for now there are only this types of exceptions *- * @param posibleCutAndPastedCode- * @return+ * @param possibleCopyAndPastedCode code currently being checked+ * @return information about if code is found * @throws IOException * @throws ServiceException */- boolean gueryEngine(String posibleCutAndPastedCode) throws IOException, ServiceException;-}+ boolean gueryEngine(String possibleCopyAndPastedCode) throws IOException, ServiceException;+}=======================================--- /trunk/src/main/java/org/apache/rat/pd/engines/RetryManager.java Fri Aug 21 06:53:09 2009+++ /trunk/src/main/java/org/apache/rat/pd/engines/RetryManager.java Fri Aug 21 17:04:14 2009@@ -51,14 +51,14 @@ * query SearchEngine for

Apache-rat-pd (LifeTime) Activation Code

Products New Products Most Popular Products All Products Clearance Products 3rd Hands Products Adhesives & Fillers Fastcaps & Fastedge Hardware Lean Books & Lean Organization Magnetic Products Measuring & Layout Products Peel & Stick Products Safety Products Saw Stand Products Woodworking & Construction Work Wear Other Innovative Products Gift Certificates Promotional Products My Account Videos Lean Videos FastCap History FastCap Videos FastCap Tour Videos Español Videos Dealers Dealer Map International About About FastCap Contact Us Shop Tips Product Ideas Raving Fans Frequently Asked Questions MSDS Sheets Shipping & Returns Links Paul Akers Website Paul Akers Lean Books Lean PD App 2 Second Lean App Lean Hub Cruzin Cap Website Puka Patch Website RAT Grips Website Catalog Subscribe SKU: - The EZ-Stripe makes organization clean and easy. Use it to mark pathways for foot traffic, to indicated safe distances from potentially dangerous machines, or to maintain visual control in the workplace. Overview Product Videos (4) Reviews (0) EZ-Stripe EZ-Stripe Parking Spot EZ installation 6-Feet Indicator Related Products #wrapper { top:25px;}We will be closed for the Holidays Dec. 24th - 25th and Jan 1st.-->. apache-rat-pd. There was an error getting resource 'source':-1:

Apache-rat-pd Активация (LifeTime) Activation Code

*"); lines = excludeBlankLines(lines); for (int i = 0; i - toret += LINE_BEGINNING_REGEX + ZERO_OR_MORE_BLANK_SPACE + super.stringToRegex(lines[i]);+ toRet += LINE_BEGINNING_REGEX + ZERO_OR_MORE_BLANK_SPACE + super.stringToRegex(lines[i]); // for current line, it is better not to add LINE_END_REGEX.- // we don't know is end of real line in code is reached+ // we don't know if end of real line in code is reached if (i != lines.length - 1) {- toret += ZERO_OR_MORE_BLANK_SPACE + LINE_END_REGEX + BLANK_MARK_FOR_URL;+ toRet += ZERO_OR_MORE_BLANK_SPACE + LINE_END_REGEX + BLANK_MARK_FOR_URL; } }- return toret;+ return toRet; } /**@@ -72,14 +72,14 @@ } } // copy non-blank lines- String[] toret = new String[lentgh];+ String[] toRet = new String[lentgh]; int index = 0; for (String line : lines) { if (!line.trim().isEmpty()) {- toret[index] = line;+ toRet[index] = line; index++; } }- return toret;+ return toRet; } }=======================================--- /trunk/src/main/java/org/apache/rat/pd/heuristic/functions/CPPFunctionHeuristicChecker.java Fri Aug 21 06:53:09 2009+++ /trunk/src/main/java/org/apache/rat/pd/heuristic/functions/CPPFunctionHeuristicChecker.java Fri Aug 21 17:04:14 2009@@ -47,8 +47,6 @@ * rhs.GetItsVal()); } */ private static final String CPP_FUNCTION_REGEX_2 = "^[\t ]*[\\w+ \\*&]+\\s*\\:\\:\\s*[*&~]?\\s*\\w+ *\\([^()]*?\\)( *const *)?(\\s)*\\{[\\s\\S]*\\}[\n\r]*";- // TODO add regular expression which will match functions with a reference- // to a string as a returning type for example. private static final String CPP_FUNCTION_REGEX = "(" + CPP_FUNCTION_REGEX_1 + ")|(" + CPP_FUNCTION_REGEX_2 + ")"; /**=======================================--- /trunk/src/main/java/org/apache/rat/pd/heuristic/functions/FortranFunctionHeuristicChecker.java Fri Aug 21 06:53:09 2009+++ /trunk/src/main/java/org/apache/rat/pd/heuristic/functions/FortranFunctionHeuristicChecker.java Fri Aug 21 17:04:14 2009@@ -114,9 +114,11 @@ * or after subprogram. Depends on limit property, function can return false * if matched subprogram length is smaller then limit value. *- * @param codeToBeChecked- * @param functionHeader- * @param functionEndRegex+ * @param codeToBeChecked code currently being checked+ * @param functionHeader regular expression which match header of a+ * subprogram in Fortran+ * @param functionEndRegex regular expression which match end of a+ * subprogram in Fortran * @return true if this is Fortran subprogram. */ boolean isFortranFunction(String codeToBeChecked, String functionHeader, String functionEndRegex) {@@ -141,9 +143,11 @@ /** * Method will return functions name from a functions header *- * @param functionHeader- * @param keywordRegex- * @param functionNameRegex+ * @param functionHeader regular expression which match header of a+ * subprogram in Fortran+ * @param keywordRegex keyword for function and subroutine+ * @param functionNameRegex regular expression which match keyword and name+ * of a subprogram in Fortran * @return functions name */ String getFunctionName(String functionHeader, String keywordRegex, String functionNameRegex) {@@ -165,8 +169,8 @@ * Method will return functions header from a string. Functions header is * matched by a regular expression regex. *- * @param codeToBeChecked- * @param regex+ * @param codeToBeChecked code currently being checked+ * @param regex regular expression which match subprogram's header * @return functions header if it functions */ String getFunctionHeader(String codeToBeChecked, String regex) {=======================================--- /trunk/src/main/java/org/apache/rat/pd/heuristic/misspellings/MisspellingsHeuristicChecker.java Fri Aug 21 06:53:09 2009+++ /trunk/src/main/java/org/apache/rat/pd/heuristic/misspellings/MisspellingsHeuristicChecker.java Fri Aug 21 17:04:14 2009@@ -64,7 +64,7 @@ */ @Override public HeuristicCheckerResult checkByHeuristic(String codeToBeChecked) {- HeuristicCheckerResult toret = new HeuristicCheckerResult(false, true, codeToBeChecked, this.getClass());+ HeuristicCheckerResult toRet = new HeuristicCheckerResult(false, true, codeToBeChecked, this.getClass()); boolean isCheckingOnInternetNeaded = true; List words = filterWordsFromCode(codeToBeChecked); for (String word : words) {@@ -75,8 +75,8 @@ out.println("Error in decomposing word:" +

Apache-rat-pd Crack Keygen Full Version [Latest]

Word + " We consider that it is misspelled."); } }- toret = new HeuristicCheckerResult(!isCheckingOnInternetNeaded, false, codeToBeChecked, this.getClass());- return toret;+ toRet = new HeuristicCheckerResult(!isCheckingOnInternetNeaded, false, codeToBeChecked, this.getClass());+ return toRet; } /**@@ -87,24 +87,24 @@ * @return list of words in codeToBeChecked */ List filterWordsFromCode(String codeToBeChecked) {- List toret = new ArrayList();+ List toRet = new ArrayList(); Pattern p = Pattern.compile("[a-zA-Z_]+", Pattern.MULTILINE); Matcher m = p.matcher(codeToBeChecked); while (m.find()) {- toret.add(m.group());- }- return toret;+ toRet.add(m.group());+ }+ return toRet; } boolean isWordCorrect(List combinedWords) throws IOException {- boolean toret = true;+ boolean toRet = true; for (String word : combinedWords) { // it is assumed that words with capital case are equal to word with // all small case in dictionary- toret = toret && spellChecker.exist(word.toLowerCase());- out.println(word + " " + toret);- }- return toret;+ toRet = toRet && spellChecker.exist(word.toLowerCase());+ out.println(word + " " + toRet);+ }+ return toRet; } /**@@ -118,11 +118,11 @@ */ List decomposeCombinedWord(String combinedWord) throws IllegalArgumentException { Validate.isTrue(combinedWord.matches("[a-zA-Z_]+"));- List toret = new ArrayList();- toret.add(combinedWord);- toret = decomposeUnderscoreCombinedWords(toret);- toret = decomposeCamelCombinedWords(toret);- return toret;+ List toRet = new ArrayList();+ toRet.add(combinedWord);+ toRet = decomposeUnderscoreCombinedWords(toRet);+ toRet = decomposeCamelCombinedWords(toRet);+ return toRet; } /**@@ -133,15 +133,15 @@ * @return list of decomposed words */ List decomposeUnderscoreCombinedWords(List combinedWord) {- List toret = new ArrayList();+ List toRet = new ArrayList(); for (String word : combinedWord) {- toret.addAll(new ArrayList(Arrays.asList(word.split("_+"))));+ toRet.addAll(new ArrayList(Arrays.asList(word.split("_+")))); // sometimes empty string is entered in list // this remove such entries- toret.remove("");+ toRet.remove(""); }- return toret;+ return toRet; } /**@@ -152,14 +152,14 @@ * @return list of decomposed words */ List decomposeCamelCombinedWords(List combinedWord) {- List toret = new ArrayList();+ List toRet = new ArrayList(); for (String word : combinedWord) { // extract only first part with small caps of string if it exists // example: thisIsMyName -> this Pattern p = Pattern.compile("\\b[a-z]+"); Matcher m = p.matcher(word); if (m.find()) {- toret.add(m.group());+ toRet.add(m.group()); } // extract all parts of string which starts with capital case to@@ -168,10 +168,10 @@ p = Pattern.compile("[A-Z][a-z]*"); m = p.matcher(word); while (m.find()) {- toret.add(m.group());+ toRet.add(m.group()); } }- return toret;+ return toRet; } @Override=======================================--- /trunk/src/main/java/org/apache/rat/pd/util/FileManipulator.java Fri Aug 21 06:53:09 2009+++ /trunk/src/main/java/org/apache/rat/pd/util/FileManipulator.java Fri Aug 21 17:04:14 2009@@ -46,17 +46,17 @@ static public String readFile(String path) throws IOException { File aFile = new File(path);- String toret = "";+ String toRet = ""; BufferedReader input = new BufferedReader(new FileReader(aFile)); try { String line = null; while ((line = input.readLine()) != null) {- toret += line + "\n";+ toRet += line + "\n"; } } finally { input.close(); }- return toret;+ return toRet; } public static String convertStreamToString(InputStream is) {=======================================--- /trunk/src/test/java/org/apache/rat/pd/core/SlidingWindowAlgorithmTest.java Fri Aug 21 06:53:09 2009+++ /trunk/src/test/java/org/apache/rat/pd/core/SlidingWindowAlgorithmTest.java Fri Aug 21 17:04:14 2009@@ -201,8 +201,8 @@ } @Override- public boolean isCodeFound(String posibleCutAndPastedCode) {- String temp = posibleCutAndPastedCode.replaceAll("(F )*(T )*TEND", "");+ public boolean isCodeFound(String possibleCopyAndPastedCode) {+ String temp = possibleCopyAndPastedCode.replaceAll("(F )*(T )*TEND", ""); if (temp.trim().length() > 0) { return false; } else=======================================--- /trunk/src/test/java/org/apache/rat/pd/engines/google/RegexGeneratorTest.java Fri Aug 21 06:53:09 2009+++ /trunk/src/test/java/org/apache/rat/pd/engines/google/RegexGeneratorTest.java Fri Aug 21 17:04:14 2009@@ -29,11 +29,7 @@ private RegexGenerator regexGenerator = new RegexGenerator(); private String TEST_CASE_1 = "public static void

[apache-rat-pd] r53 committed - Comments in whole project

// pozovi svaki url i parsiraj rezultate u zajednicku mapu+ public boolean gueryEngine(String possibleCopyAndPastedCode) throws IOException, ServiceException {+ boolean toReturn = false;++ List listOfFeedUrl = splitLongUrl(possibleCopyAndPastedCode, CODESEARCH_QUERY_MAX_LENGTH);+ // call every URL and parse results in one map for (URL url : listOfFeedUrl) { CodeSearchFeed myFeed = codesearchService.getFeed(url, CodeSearchFeed.class);- List srList = createSearchResutl(myFeed, posibleCutAndPastedCode);- boolean found = (srList.size() > 0) && (postprocessor.isMatchFound(srList, posibleCutAndPastedCode));-- toreturn = toreturn || found;+ List srList = createSearchResutl(myFeed, possibleCopyAndPastedCode);+ boolean found = (srList.size() > 0) && (postprocessor.isMatchFound(srList, possibleCopyAndPastedCode));++ toReturn = toReturn || found; if (found) { searchResults.addAll(srList); }- // for test porposes- // try {- // printAdditionalInformation(myFeed, System.out);- // } catch (Exception e) {- // // TODO Auto-generated catch block- // e.printStackTrace();- // } }- return toreturn;+ return toReturn; } /** * This method can split code to produce URLs that will not be greater then * length. For GoogleCodeSearch length is 1024. *- * @param posibleCutAndPastedCode code to be checked+ * @param possibleCopyAndPastedCode code to be checked * @param length maximum length of query which code search engine can manage- * @return list of url-s not longer then @length+ * @return list of URL-s not longer then @length * @throws IOException */- List splitLongUrl(String posibleCutAndPastedCode, int length) throws IOException {- List toret = new ArrayList();+ List splitLongUrl(String possibleCopyAndPastedCode, int length) throws IOException {+ List toRet = new ArrayList(); // lines must be less then 1024 characters- String[] lines = posibleCutAndPastedCode.split("\n *");+ String[] lines = possibleCopyAndPastedCode.split("\n *"); URL url = null; int i = 0;@@ -266,6 +258,7 @@ while (j StringBuffer currenCodePart = combineLines(lines, i, j); URL currentUrl = createUrl(currenCodePart.toString());+ if (currentUrl.toString().length() url = currentUrl; j++;@@ -275,23 +268,23 @@ } } if (url != null) {- toret.add(url);+ toRet.add(url); url = null; } if (j == lines.length) { break; } }- return toret;+ return toRet; } /** * Append tokens from start position until end, inclusive. *- * @param tokens- * @param start- * @param end- * @return+ * @param tokens list of tokens to combine+ * @param start index of start position+ * @param end index of end position+ * @return appended tokens */ private StringBuffer combineLines(String[] tokens, int start, int end) {@@ -310,7 +303,6 @@ * @param myFeed GoogleCodeSearch feed * @param entry Google CodeSearchEntry * @param out print stream for printing current information- * @throws Exception */ private void printAdditionalInformation(CodeSearchFeed myFeed, CodeSearchEntry entry) { out.println("\tgetEtag: " + entry.getEtag());@@ -340,15 +332,15 @@ * us form. * * @param myFeed GoogleCodeSearch feed- * @param posibleCutAndPastedCode code to be checked+ * @param possibleCopyAndPastedCode code to be checked * @return list of search result retrieved from GoogleCodeSearch feed */- private List createSearchResutl(CodeSearchFeed myFeed, String posibleCutAndPastedCode) {+ private List createSearchResutl(CodeSearchFeed myFeed, String possibleCopyAndPastedCode) { List toRet = new ArrayList(); for (CodeSearchEntry entry : myFeed.getEntries()) { SearchResult searchResult = new SearchResult(); searchResult.setEngine("GoogleCodeSearch");- searchResult.setCodeForQuery(posibleCutAndPastedCode);+ searchResult.setCodeForQuery(possibleCopyAndPastedCode); searchResult.setLink(entry.getHtmlLink().getHref()); searchResult.setProjectName(entry.getPackage().getName()); searchResult.setOwner(entry.getAuthors().get(0).getName());=======================================--- /trunk/src/main/java/org/apache/rat/pd/engines/google/MultilineRegexGenerator.java Fri Aug 21 06:53:09 2009+++ /trunk/src/main/java/org/apache/rat/pd/engines/google/MultilineRegexGenerator.java Fri Aug 21 17:04:14 2009@@ -43,18 +43,18 @@ */ @Override public String stringToRegex(String sourceCode) {- String toret = "";+ String toRet = ""; String[] lines = sourceCode.split("\n. apache-rat-pd. There was an error getting resource 'source':-1: apache-rat-pd. There was an error getting resource 'source':-1:

Comments

User1030

Revision: 53Author: maka82Date: Fri Aug 21 17:04:14 2009Log: Comments in whole project have been write down according to javadoc standard trying to give more informations about parameters and about returning informations for functions.Some misspelled words have been written correct now.Also, CamelCases are used now in a project where it is needed.Some TODOs are fixed. /trunk/src/main/java/org/apache/rat/pd/core/PdCommandLine.java /trunk/src/main/java/org/apache/rat/pd/core/PlagiarismDetector.java /trunk/src/main/java/org/apache/rat/pd/core/SourceCodeAnalyser.java /trunk/src/main/java/org/apache/rat/pd/engines/ISearchEngine.java /trunk/src/main/java/org/apache/rat/pd/engines/KodersCodeSearchParser.java /trunk/src/main/java/org/apache/rat/pd/engines/Managable.java /trunk/src/main/java/org/apache/rat/pd/engines/RetryManager.java /trunk/src/main/java/org/apache/rat/pd/engines/google/GoogleCodeSearchParser.java /trunk/src/main/java/org/apache/rat/pd/engines/google/MultilineRegexGenerator.java /trunk/src/main/java/org/apache/rat/pd/heuristic/functions/CPPFunctionHeuristicChecker.java /trunk/src/main/java/org/apache/rat/pd/heuristic/functions/FortranFunctionHeuristicChecker.java /trunk/src/main/java/org/apache/rat/pd/heuristic/misspellings/MisspellingsHeuristicChecker.java /trunk/src/main/java/org/apache/rat/pd/util/FileManipulator.java /trunk/src/test/java/org/apache/rat/pd/core/SlidingWindowAlgorithmTest.java /trunk/src/test/java/org/apache/rat/pd/engines/google/RegexGeneratorTest.java /trunk/src/test/java/org/apache/rat/pd/heuristic/functions/CPPFunctionHeuristicCheckerTest.java=======================================--- /trunk/src/main/java/org/apache/rat/pd/core/PdCommandLine.java Fri Aug 21 06:53:09 2009+++ /trunk/src/main/java/org/apache/rat/pd/core/PdCommandLine.java Fri Aug 21 17:04:14 2009@@ -173,7 +173,7 @@ } catch (Exception e) { // oops, something went wrong this.out.println("Parsing failed. Reason: " + e.getMessage());- // if any error is happened, we can say that not all arguments are+ // if any error happened, we can say that not all arguments are // correct allArgumentsCorrect = false; }@@ -194,6 +194,8 @@ * Parse arguments and gets parameters from them. * * @param args command line arguments+ * @throws ParseException+ * @throws NumberFormatException */ private void parseArguments(String[] args) throws ParseException, NumberFormatException { CommandLineParser parser = new GnuParser();@@ -260,7 +262,8 @@ * If some property is invalid an exception is thrown. * * @param line CommandLine- * @throws NumberFormatException , IllegalArgumentException+ * @throws NumberFormatException+ * @throws IllegalArgumentException */ private void parseCommandLineArguments(CommandLine line) throws NumberFormatException, IllegalArgumentException {=======================================--- /trunk/src/main/java/org/apache/rat/pd/core/PlagiarismDetector.java Fri Aug 21 06:53:09 2009+++ /trunk/src/main/java/org/apache/rat/pd/core/PlagiarismDetector.java Fri Aug 21 17:04:14 2009@@ -91,6 +91,7 @@ /** * @param args * @throws RatReportFailedException+ * @throws IOException */ public static void main(String[] args) throws RatReportFailedException, IOException { // instance of PlagiarismDetector@@ -129,7 +130,7 @@ * Decide which format of report will be used. * * @param pdCommandLine command line object to read report format from- * @return+ * @return which format of report will be used */ private Report configureReport(PdCommandLine pdCommandLine) { Report reportDocument;=======================================--- /trunk/src/main/java/org/apache/rat/pd/core/SourceCodeAnalyser.java Fri Aug 21 06:53:09 2009+++ /trunk/src/main/java/org/apache/rat/pd/core/SourceCodeAnalyser.java Fri Aug 21 17:04:14 2009@@ -58,7 +58,7 @@ * @param searchEngines list of chosen search engine parsers * @param algorithmsForChecking list of chosen heuristic algorithms * @param reportDocument chosen report- * @param out printStream wnere current information are be printed+ * @param out printStream where current information are to be printed */ public SourceCodeAnalyser(List searchEngines, List algorithmsForChecking, Report reportDocument, PrintStream out) {@@ -133,18 +133,18 @@ * @throws IOException */ private String readFile(Reader reader) throws IOException {- String toret = "";+ String toRet = ""; // TODO encoding is system default now!!!! BufferedReader input = new BufferedReader(reader); try { String line = null; while ((line = input.readLine()) != null) {- toret += line + "\n";+ toRet += line + "\n"; } } finally { input.close(); }- return toret;+ return toRet; } /**@@ -209,16 +209,16 @@ } /**- * Search for code in all engines. If code is found, an reportEntry will be- * returned Otherwise, null will be returned.+ * Search for code in all engines. If code is found, a reportEntry will be+ * returned. Otherwise, null will be returned. * * @param searchEngines list of chosen search engine parsers * @param code code to be checked * @param fileName source

2025-04-15
User3744

File name- * @return an report entry+ * @return a report entry */ private ReportEntry searchOnInternet(List searchEngines, String code, String fileName) {- ReportEntry toret = null;+ ReportEntry toRet = null; List found = new ArrayList(); for (ISearchEngine searchEngine : searchEngines) { if (searchEngine.isCodeFound(code.toString())) {@@ -226,36 +226,36 @@ } } if (!found.isEmpty()) {- toret = new ReportEntry(found, code, fileName);- }- return toret;+ toRet = new ReportEntry(found, code, fileName);+ }+ return toRet; } /**- * @param heuristicCheckers lit of chosen heuristic checkers+ * @param heuristicCheckers list of chosen heuristic checkers * @param toCheck code to be checked * @return heuristicCheckerResult with proper information for sliding window * algorithm */ private HeuristicCheckerResult isCheckOnInternetNeaded(List heuristicCheckers, String toCheck) {- HeuristicCheckerResult toret = new HeuristicCheckerResult(false, true, toCheck, null);+ HeuristicCheckerResult toRet = new HeuristicCheckerResult(false, true, toCheck, null); for (IHeuristicChecker checker : heuristicCheckers) {- toret = checker.checkByHeuristic(toCheck);- if (toret.isShouldStretch()) {+ toRet = checker.checkByHeuristic(toCheck);+ if (toRet.isShouldStretch()) { break; } }- return toret;+ return toRet; } /** * Append tokens from start position until end. * * @param tokens list of tokens to combine- * @param start position- * @param end position+ * @param start index of start position+ * @param end index of end position * @return appended tokens */ private StringBuffer combineTokens(String[] tokens, int start, int end) {@@ -290,9 +290,9 @@ * * Example:Analyzing file : c:\HelloWorld.java Progress: 2/200 (1%) *- * @param whole is number of all tokens we iterate- * @param current is current position of iteration- * @param fileName is file name of source file+ * @param whole number of all tokens we iterate+ * @param current current position of iteration+ * @param fileName file name of source file */ private void printProgress(int whole, int current, String fileName) { // clear previous state=======================================--- /trunk/src/main/java/org/apache/rat/pd/engines/ISearchEngine.java Fri Aug 21 06:53:09 2009+++ /trunk/src/main/java/org/apache/rat/pd/engines/ISearchEngine.java Fri Aug 21 17:04:14 2009@@ -33,10 +33,10 @@ /** * Checks if code part exist on this code search engine *- * @param posibleCutAndPastedCode+ * @param possibleCopyAndPastedCode code currently being checked * @return boolean - true if this code is found on search engine */- boolean isCodeFound(String posibleCutAndPastedCode);+ boolean isCodeFound(String possibleCopyAndPastedCode); /** * This method can return search results with link where we can see exactly=======================================--- /trunk/src/main/java/org/apache/rat/pd/engines/KodersCodeSearchParser.java Fri Aug 21 06:53:09 2009+++ /trunk/src/main/java/org/apache/rat/pd/engines/KodersCodeSearchParser.java Fri Aug 21 17:04:14 2009@@ -31,7 +31,7 @@ private static final String serch = " @Override- public boolean isCodeFound(String posibleCutAndPastedCode) {+ public boolean isCodeFound(String possibleCopyAndPastedCode) { // TODO Auto-generated method stub return false; }=======================================--- /trunk/src/main/java/org/apache/rat/pd/engines/Managable.java Fri Aug 21 06:53:09 2009+++ /trunk/src/main/java/org/apache/rat/pd/engines/Managable.java Fri Aug 21 17:04:14 2009@@ -35,10 +35,10 @@ * This function can retrieve information about potentially plagiarised code * from search engine. NOTE: for now there are only this types of exceptions *- * @param posibleCutAndPastedCode- * @return+ * @param possibleCopyAndPastedCode code currently being checked+ * @return information about if code is found * @throws IOException * @throws ServiceException */- boolean gueryEngine(String posibleCutAndPastedCode) throws IOException, ServiceException;-}+ boolean gueryEngine(String possibleCopyAndPastedCode) throws IOException, ServiceException;+}=======================================--- /trunk/src/main/java/org/apache/rat/pd/engines/RetryManager.java Fri Aug 21 06:53:09 2009+++ /trunk/src/main/java/org/apache/rat/pd/engines/RetryManager.java Fri Aug 21 17:04:14 2009@@ -51,14 +51,14 @@ * query SearchEngine for

2025-04-09
User5628

*"); lines = excludeBlankLines(lines); for (int i = 0; i - toret += LINE_BEGINNING_REGEX + ZERO_OR_MORE_BLANK_SPACE + super.stringToRegex(lines[i]);+ toRet += LINE_BEGINNING_REGEX + ZERO_OR_MORE_BLANK_SPACE + super.stringToRegex(lines[i]); // for current line, it is better not to add LINE_END_REGEX.- // we don't know is end of real line in code is reached+ // we don't know if end of real line in code is reached if (i != lines.length - 1) {- toret += ZERO_OR_MORE_BLANK_SPACE + LINE_END_REGEX + BLANK_MARK_FOR_URL;+ toRet += ZERO_OR_MORE_BLANK_SPACE + LINE_END_REGEX + BLANK_MARK_FOR_URL; } }- return toret;+ return toRet; } /**@@ -72,14 +72,14 @@ } } // copy non-blank lines- String[] toret = new String[lentgh];+ String[] toRet = new String[lentgh]; int index = 0; for (String line : lines) { if (!line.trim().isEmpty()) {- toret[index] = line;+ toRet[index] = line; index++; } }- return toret;+ return toRet; } }=======================================--- /trunk/src/main/java/org/apache/rat/pd/heuristic/functions/CPPFunctionHeuristicChecker.java Fri Aug 21 06:53:09 2009+++ /trunk/src/main/java/org/apache/rat/pd/heuristic/functions/CPPFunctionHeuristicChecker.java Fri Aug 21 17:04:14 2009@@ -47,8 +47,6 @@ * rhs.GetItsVal()); } */ private static final String CPP_FUNCTION_REGEX_2 = "^[\t ]*[\\w+ \\*&]+\\s*\\:\\:\\s*[*&~]?\\s*\\w+ *\\([^()]*?\\)( *const *)?(\\s)*\\{[\\s\\S]*\\}[\n\r]*";- // TODO add regular expression which will match functions with a reference- // to a string as a returning type for example. private static final String CPP_FUNCTION_REGEX = "(" + CPP_FUNCTION_REGEX_1 + ")|(" + CPP_FUNCTION_REGEX_2 + ")"; /**=======================================--- /trunk/src/main/java/org/apache/rat/pd/heuristic/functions/FortranFunctionHeuristicChecker.java Fri Aug 21 06:53:09 2009+++ /trunk/src/main/java/org/apache/rat/pd/heuristic/functions/FortranFunctionHeuristicChecker.java Fri Aug 21 17:04:14 2009@@ -114,9 +114,11 @@ * or after subprogram. Depends on limit property, function can return false * if matched subprogram length is smaller then limit value. *- * @param codeToBeChecked- * @param functionHeader- * @param functionEndRegex+ * @param codeToBeChecked code currently being checked+ * @param functionHeader regular expression which match header of a+ * subprogram in Fortran+ * @param functionEndRegex regular expression which match end of a+ * subprogram in Fortran * @return true if this is Fortran subprogram. */ boolean isFortranFunction(String codeToBeChecked, String functionHeader, String functionEndRegex) {@@ -141,9 +143,11 @@ /** * Method will return functions name from a functions header *- * @param functionHeader- * @param keywordRegex- * @param functionNameRegex+ * @param functionHeader regular expression which match header of a+ * subprogram in Fortran+ * @param keywordRegex keyword for function and subroutine+ * @param functionNameRegex regular expression which match keyword and name+ * of a subprogram in Fortran * @return functions name */ String getFunctionName(String functionHeader, String keywordRegex, String functionNameRegex) {@@ -165,8 +169,8 @@ * Method will return functions header from a string. Functions header is * matched by a regular expression regex. *- * @param codeToBeChecked- * @param regex+ * @param codeToBeChecked code currently being checked+ * @param regex regular expression which match subprogram's header * @return functions header if it functions */ String getFunctionHeader(String codeToBeChecked, String regex) {=======================================--- /trunk/src/main/java/org/apache/rat/pd/heuristic/misspellings/MisspellingsHeuristicChecker.java Fri Aug 21 06:53:09 2009+++ /trunk/src/main/java/org/apache/rat/pd/heuristic/misspellings/MisspellingsHeuristicChecker.java Fri Aug 21 17:04:14 2009@@ -64,7 +64,7 @@ */ @Override public HeuristicCheckerResult checkByHeuristic(String codeToBeChecked) {- HeuristicCheckerResult toret = new HeuristicCheckerResult(false, true, codeToBeChecked, this.getClass());+ HeuristicCheckerResult toRet = new HeuristicCheckerResult(false, true, codeToBeChecked, this.getClass()); boolean isCheckingOnInternetNeaded = true; List words = filterWordsFromCode(codeToBeChecked); for (String word : words) {@@ -75,8 +75,8 @@ out.println("Error in decomposing word:" +

2025-03-25
User8739

Word + " We consider that it is misspelled."); } }- toret = new HeuristicCheckerResult(!isCheckingOnInternetNeaded, false, codeToBeChecked, this.getClass());- return toret;+ toRet = new HeuristicCheckerResult(!isCheckingOnInternetNeaded, false, codeToBeChecked, this.getClass());+ return toRet; } /**@@ -87,24 +87,24 @@ * @return list of words in codeToBeChecked */ List filterWordsFromCode(String codeToBeChecked) {- List toret = new ArrayList();+ List toRet = new ArrayList(); Pattern p = Pattern.compile("[a-zA-Z_]+", Pattern.MULTILINE); Matcher m = p.matcher(codeToBeChecked); while (m.find()) {- toret.add(m.group());- }- return toret;+ toRet.add(m.group());+ }+ return toRet; } boolean isWordCorrect(List combinedWords) throws IOException {- boolean toret = true;+ boolean toRet = true; for (String word : combinedWords) { // it is assumed that words with capital case are equal to word with // all small case in dictionary- toret = toret && spellChecker.exist(word.toLowerCase());- out.println(word + " " + toret);- }- return toret;+ toRet = toRet && spellChecker.exist(word.toLowerCase());+ out.println(word + " " + toRet);+ }+ return toRet; } /**@@ -118,11 +118,11 @@ */ List decomposeCombinedWord(String combinedWord) throws IllegalArgumentException { Validate.isTrue(combinedWord.matches("[a-zA-Z_]+"));- List toret = new ArrayList();- toret.add(combinedWord);- toret = decomposeUnderscoreCombinedWords(toret);- toret = decomposeCamelCombinedWords(toret);- return toret;+ List toRet = new ArrayList();+ toRet.add(combinedWord);+ toRet = decomposeUnderscoreCombinedWords(toRet);+ toRet = decomposeCamelCombinedWords(toRet);+ return toRet; } /**@@ -133,15 +133,15 @@ * @return list of decomposed words */ List decomposeUnderscoreCombinedWords(List combinedWord) {- List toret = new ArrayList();+ List toRet = new ArrayList(); for (String word : combinedWord) {- toret.addAll(new ArrayList(Arrays.asList(word.split("_+"))));+ toRet.addAll(new ArrayList(Arrays.asList(word.split("_+")))); // sometimes empty string is entered in list // this remove such entries- toret.remove("");+ toRet.remove(""); }- return toret;+ return toRet; } /**@@ -152,14 +152,14 @@ * @return list of decomposed words */ List decomposeCamelCombinedWords(List combinedWord) {- List toret = new ArrayList();+ List toRet = new ArrayList(); for (String word : combinedWord) { // extract only first part with small caps of string if it exists // example: thisIsMyName -> this Pattern p = Pattern.compile("\\b[a-z]+"); Matcher m = p.matcher(word); if (m.find()) {- toret.add(m.group());+ toRet.add(m.group()); } // extract all parts of string which starts with capital case to@@ -168,10 +168,10 @@ p = Pattern.compile("[A-Z][a-z]*"); m = p.matcher(word); while (m.find()) {- toret.add(m.group());+ toRet.add(m.group()); } }- return toret;+ return toRet; } @Override=======================================--- /trunk/src/main/java/org/apache/rat/pd/util/FileManipulator.java Fri Aug 21 06:53:09 2009+++ /trunk/src/main/java/org/apache/rat/pd/util/FileManipulator.java Fri Aug 21 17:04:14 2009@@ -46,17 +46,17 @@ static public String readFile(String path) throws IOException { File aFile = new File(path);- String toret = "";+ String toRet = ""; BufferedReader input = new BufferedReader(new FileReader(aFile)); try { String line = null; while ((line = input.readLine()) != null) {- toret += line + "\n";+ toRet += line + "\n"; } } finally { input.close(); }- return toret;+ return toRet; } public static String convertStreamToString(InputStream is) {=======================================--- /trunk/src/test/java/org/apache/rat/pd/core/SlidingWindowAlgorithmTest.java Fri Aug 21 06:53:09 2009+++ /trunk/src/test/java/org/apache/rat/pd/core/SlidingWindowAlgorithmTest.java Fri Aug 21 17:04:14 2009@@ -201,8 +201,8 @@ } @Override- public boolean isCodeFound(String posibleCutAndPastedCode) {- String temp = posibleCutAndPastedCode.replaceAll("(F )*(T )*TEND", "");+ public boolean isCodeFound(String possibleCopyAndPastedCode) {+ String temp = possibleCopyAndPastedCode.replaceAll("(F )*(T )*TEND", ""); if (temp.trim().length() > 0) { return false; } else=======================================--- /trunk/src/test/java/org/apache/rat/pd/engines/google/RegexGeneratorTest.java Fri Aug 21 06:53:09 2009+++ /trunk/src/test/java/org/apache/rat/pd/engines/google/RegexGeneratorTest.java Fri Aug 21 17:04:14 2009@@ -29,11 +29,7 @@ private RegexGenerator regexGenerator = new RegexGenerator(); private String TEST_CASE_1 = "public static void

2025-04-12

Add Comment