@@ -68,21 +68,21 @@ public void init(Base base) {
6868 public static List <String > findFiles (Path path , String fileExtension ) throws IOException {
6969
7070 if (!Files .isDirectory (path )) {
71- throw new IllegalArgumentException ("Path must be a directory!" );
71+ throw new IllegalArgumentException ("Path must be a directory!" );
7272 }
7373
7474 List <String > result ;
7575
7676 try (Stream <Path > walk = Files .walk (path )) {
77- System .out .println ("Walking " +path .toString ());
78- result = walk
79- .filter (p -> !Files .isDirectory (p ))
80- // this is a path, not string,
81- // convert path to string first
82- .map (p -> p .toAbsolutePath ().toString ())
83- // this only test if pathname ends with a certain extension
84- .filter (f -> f .toLowerCase ().endsWith (fileExtension ))
85- .collect (Collectors .toList ());
77+ // System.out.println("Walking "+path.toString());
78+ result = walk
79+ .filter (p -> !Files .isDirectory (p ))
80+ // this is a path, not string,
81+ // convert path to string first
82+ .map (p -> p .toAbsolutePath ().toString ())
83+ // this only test if pathname ends with a certain extension
84+ .filter (f -> f .toLowerCase ().endsWith (fileExtension ))
85+ .collect (Collectors .toList ());
8686 }
8787
8888 return result ;
@@ -122,12 +122,12 @@ public void run() {
122122 File folder = sketch .getFolder ();
123123 String extraLibs = getJarsInDir (Paths .get (Preferences .getSketchbookPath ()+(isWindows ?'\\' :'/' )+"libraries" ));
124124 extraLibs += getJarsInDir (folder );
125- extraLibs += getJarsInDir (processing . app . Platform .getContentFile ("modes/java/libraries" ));
125+ extraLibs += getJarsInDir (Platform .getContentFile ("modes/java/libraries" ));
126126 SketchCode codes [] = sketch .getCode ();
127127 String mainTab = codes [0 ].getProgram ();
128128 if (!mainTab .contains ("setup" ) && !mainTab .contains ("draw" )) {
129- System .err .println ("Can only generate JavaDoc for sketches in dynamic mode." );
130- return ;
129+ System .err .println ("Can only generate JavaDoc for sketches in dynamic mode." );
130+ return ;
131131 }
132132 try {
133133 File ref = new File (folder , "reference" );
@@ -144,23 +144,22 @@ public void run() {
144144 boolean blockComment = false ;
145145 for (String line : code ) {
146146 if (blockComment ) {
147- int lineComment = line .indexOf ("//" );
148- int stopComment = line .indexOf ("*/" );
149- if (stopComment >=0 ) {
150- int startComment = line .indexOf ("/*" );
151- if (startComment <stopComment ) {
152- blockComment = false ;
153- }
154- }
155- } else {
156- int lineComment = line .indexOf ("//" );
147+ int stopComment = line .indexOf ("*/" );
148+ if (stopComment >= 0 ) {
157149 int startComment = line .indexOf ("/*" );
158- if (startComment >=0 && (lineComment <0 || lineComment >startComment )) {
159- int stopComment = line .indexOf ("*/" );
160- if (startComment >stopComment ) {
161- blockComment = true ;
162- }
150+ if (startComment < stopComment ) {
151+ blockComment = false ;
152+ }
153+ }
154+ } else {
155+ int lineComment = line .indexOf ("//" );
156+ int startComment = line .indexOf ("/*" );
157+ if (startComment >= 0 && (lineComment < 0 || lineComment > startComment )) {
158+ int stopComment = line .indexOf ("*/" );
159+ if (startComment > stopComment ) {
160+ blockComment = true ;
163161 }
162+ }
164163 }
165164 if (!blockComment && line .trim ().startsWith ("import" )) {
166165 imports .append (line );
0 commit comments