Skip to content

Commit 3ee5019

Browse files
committed
Reformatted code to solve a large number of checkstyle reported
errors.
1 parent 7c6e0ae commit 3ee5019

File tree

115 files changed

+8383
-7795
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

115 files changed

+8383
-7795
lines changed

src/main/java/org/codehaus/plexus/util/AbstractScanner.java

Lines changed: 58 additions & 97 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@
1616
* limitations under the License.
1717
*/
1818

19-
2019
import java.io.File;
2120
import java.util.ArrayList;
2221
import java.util.List;
@@ -30,7 +29,7 @@ public abstract class AbstractScanner
3029
/**
3130
* Patterns which should be excluded by default, like SCM files
3231
* <ul>
33-
* <li>Misc: &#42;&#42;/&#42;~, &#42;&#42;/#&#42;#, &#42;&#42;/.#&#42;, &#42;&#42;/%&#42;%, &#42;&#42;/._&#42; </li>
32+
* <li>Misc: &#42;&#42;/&#42;~, &#42;&#42;/#&#42;#, &#42;&#42;/.#&#42;, &#42;&#42;/%&#42;%, &#42;&#42;/._&#42;</li>
3433
* <li>CVS: &#42;&#42;/CVS, &#42;&#42;/CVS/&#42;&#42;, &#42;&#42;/.cvsignore</li>
3534
* <li>RCS: &#42;&#42;/RCS, &#42;&#42;/RCS/&#42;&#42;</li>
3635
* <li>SCCS: &#42;&#42;/SCCS, &#42;&#42;/SCCS/&#42;&#42;</li>
@@ -44,8 +43,10 @@ public abstract class AbstractScanner
4443
* <li>Serena Dimension: &#42;&#42;/.metadata, &#42;&#42;/.metadata/&#42;&#42;</li>
4544
* <li>Mercurial: &#42;&#42;/.hg, &#42;&#42;/.hg/&#42;&#42;, &#42;&#42;/.hgignore</li>
4645
* <li>GIT: &#42;&#42;/.git, &#42;&#42;/.gitignore, &#42;&#42;/.gitattributes, &#42;&#42;/.git/&#42;&#42;</li>
47-
* <li>Bitkeeper: &#42;&#42;/BitKeeper, &#42;&#42;/BitKeeper/&#42;&#42;, &#42;&#42;/ChangeSet, &#42;&#42;/ChangeSet/&#42;&#42;</li>
48-
* <li>Darcs: &#42;&#42;/_darcs, &#42;&#42;/_darcs/&#42;&#42;, &#42;&#42;/.darcsrepo, &#42;&#42;/.darcsrepo/&#42;&#42;&#42;&#42;/-darcs-backup&#42;, &#42;&#42;/.darcs-temp-mail
46+
* <li>Bitkeeper: &#42;&#42;/BitKeeper, &#42;&#42;/BitKeeper/&#42;&#42;, &#42;&#42;/ChangeSet,
47+
* &#42;&#42;/ChangeSet/&#42;&#42;</li>
48+
* <li>Darcs: &#42;&#42;/_darcs, &#42;&#42;/_darcs/&#42;&#42;, &#42;&#42;/.darcsrepo,
49+
* &#42;&#42;/.darcsrepo/&#42;&#42;&#42;&#42;/-darcs-backup&#42;, &#42;&#42;/.darcs-temp-mail
4950
* </ul>
5051
*
5152
* @see #addDefaultExcludes()
@@ -75,10 +76,10 @@ public abstract class AbstractScanner
7576
// Arch
7677
"**/.arch-ids", "**/.arch-ids/**",
7778

78-
//Bazaar
79+
// Bazaar
7980
"**/.bzr", "**/.bzr/**",
8081

81-
//SurroundSCM
82+
// SurroundSCM
8283
"**/.MySCMServerInfo",
8384

8485
// Mac
@@ -114,58 +115,45 @@ public abstract class AbstractScanner
114115
private MatchPatterns excludesPatterns;
115116

116117
/**
117-
* Whether or not the file system should be treated as a case sensitive
118-
* one.
118+
* Whether or not the file system should be treated as a case sensitive one.
119119
*/
120120
protected boolean isCaseSensitive = true;
121121

122122
/**
123123
* Sets whether or not the file system should be regarded as case sensitive.
124124
*
125-
* @param isCaseSensitive whether or not the file system should be
126-
* regarded as a case sensitive one
125+
* @param isCaseSensitive whether or not the file system should be regarded as a case sensitive one
127126
*/
128127
public void setCaseSensitive( boolean isCaseSensitive )
129128
{
130129
this.isCaseSensitive = isCaseSensitive;
131130
}
132131

133132
/**
134-
* Tests whether or not a given path matches the start of a given
135-
* pattern up to the first "**".
133+
* Tests whether or not a given path matches the start of a given pattern up to the first "**".
136134
* <p/>
137-
* This is not a general purpose test and should only be used if you
138-
* can live with false positives. For example, <code>pattern=**\a</code>
139-
* and <code>str=b</code> will yield <code>true</code>.
135+
* This is not a general purpose test and should only be used if you can live with false positives. For example,
136+
* <code>pattern=**\a</code> and <code>str=b</code> will yield <code>true</code>.
140137
*
141-
* @param pattern The pattern to match against. Must not be
142-
* <code>null</code>.
143-
* @param str The path to match, as a String. Must not be
144-
* <code>null</code>.
145-
* @return whether or not a given path matches the start of a given
146-
* pattern up to the first "**".
138+
* @param pattern The pattern to match against. Must not be <code>null</code>.
139+
* @param str The path to match, as a String. Must not be <code>null</code>.
140+
* @return whether or not a given path matches the start of a given pattern up to the first "**".
147141
*/
148142
protected static boolean matchPatternStart( String pattern, String str )
149143
{
150144
return SelectorUtils.matchPatternStart( pattern, str );
151145
}
152146

153147
/**
154-
* Tests whether or not a given path matches the start of a given
155-
* pattern up to the first "**".
148+
* Tests whether or not a given path matches the start of a given pattern up to the first "**".
156149
* <p/>
157-
* This is not a general purpose test and should only be used if you
158-
* can live with false positives. For example, <code>pattern=**\a</code>
159-
* and <code>str=b</code> will yield <code>true</code>.
150+
* This is not a general purpose test and should only be used if you can live with false positives. For example,
151+
* <code>pattern=**\a</code> and <code>str=b</code> will yield <code>true</code>.
160152
*
161-
* @param pattern The pattern to match against. Must not be
162-
* <code>null</code>.
163-
* @param str The path to match, as a String. Must not be
164-
* <code>null</code>.
165-
* @param isCaseSensitive Whether or not matching should be performed
166-
* case sensitively.
167-
* @return whether or not a given path matches the start of a given
168-
* pattern up to the first "**".
153+
* @param pattern The pattern to match against. Must not be <code>null</code>.
154+
* @param str The path to match, as a String. Must not be <code>null</code>.
155+
* @param isCaseSensitive Whether or not matching should be performed case sensitively.
156+
* @return whether or not a given path matches the start of a given pattern up to the first "**".
169157
*/
170158
protected static boolean matchPatternStart( String pattern, String str, boolean isCaseSensitive )
171159
{
@@ -175,12 +163,9 @@ protected static boolean matchPatternStart( String pattern, String str, boolean
175163
/**
176164
* Tests whether or not a given path matches a given pattern.
177165
*
178-
* @param pattern The pattern to match against. Must not be
179-
* <code>null</code>.
180-
* @param str The path to match, as a String. Must not be
181-
* <code>null</code>.
182-
* @return <code>true</code> if the pattern matches against the string,
183-
* or <code>false</code> otherwise.
166+
* @param pattern The pattern to match against. Must not be <code>null</code>.
167+
* @param str The path to match, as a String. Must not be <code>null</code>.
168+
* @return <code>true</code> if the pattern matches against the string, or <code>false</code> otherwise.
184169
*/
185170
protected static boolean matchPath( String pattern, String str )
186171
{
@@ -190,71 +175,53 @@ protected static boolean matchPath( String pattern, String str )
190175
/**
191176
* Tests whether or not a given path matches a given pattern.
192177
*
193-
* @param pattern The pattern to match against. Must not be
194-
* <code>null</code>.
195-
* @param str The path to match, as a String. Must not be
196-
* <code>null</code>.
197-
* @param isCaseSensitive Whether or not matching should be performed
198-
* case sensitively.
199-
* @return <code>true</code> if the pattern matches against the string,
200-
* or <code>false</code> otherwise.
178+
* @param pattern The pattern to match against. Must not be <code>null</code>.
179+
* @param str The path to match, as a String. Must not be <code>null</code>.
180+
* @param isCaseSensitive Whether or not matching should be performed case sensitively.
181+
* @return <code>true</code> if the pattern matches against the string, or <code>false</code> otherwise.
201182
*/
202183
protected static boolean matchPath( String pattern, String str, boolean isCaseSensitive )
203184
{
204185
return SelectorUtils.matchPath( pattern, str, isCaseSensitive );
205186
}
206187

207188
/**
208-
* Tests whether or not a string matches against a pattern.
209-
* The pattern may contain two special characters:<br>
189+
* Tests whether or not a string matches against a pattern. The pattern may contain two special characters:<br>
210190
* '*' means zero or more characters<br>
211191
* '?' means one and only one character
212192
*
213-
* @param pattern The pattern to match against.
214-
* Must not be <code>null</code>.
215-
* @param str The string which must be matched against the pattern.
216-
* Must not be <code>null</code>.
217-
* @return <code>true</code> if the string matches against the pattern,
218-
* or <code>false</code> otherwise.
193+
* @param pattern The pattern to match against. Must not be <code>null</code>.
194+
* @param str The string which must be matched against the pattern. Must not be <code>null</code>.
195+
* @return <code>true</code> if the string matches against the pattern, or <code>false</code> otherwise.
219196
*/
220197
public static boolean match( String pattern, String str )
221198
{
222199
return SelectorUtils.match( pattern, str );
223200
}
224201

225202
/**
226-
* Tests whether or not a string matches against a pattern.
227-
* The pattern may contain two special characters:<br>
203+
* Tests whether or not a string matches against a pattern. The pattern may contain two special characters:<br>
228204
* '*' means zero or more characters<br>
229205
* '?' means one and only one character
230206
*
231-
* @param pattern The pattern to match against.
232-
* Must not be <code>null</code>.
233-
* @param str The string which must be matched against the pattern.
234-
* Must not be <code>null</code>.
235-
* @param isCaseSensitive Whether or not matching should be performed
236-
* case sensitively.
237-
* @return <code>true</code> if the string matches against the pattern,
238-
* or <code>false</code> otherwise.
207+
* @param pattern The pattern to match against. Must not be <code>null</code>.
208+
* @param str The string which must be matched against the pattern. Must not be <code>null</code>.
209+
* @param isCaseSensitive Whether or not matching should be performed case sensitively.
210+
* @return <code>true</code> if the string matches against the pattern, or <code>false</code> otherwise.
239211
*/
240212
protected static boolean match( String pattern, String str, boolean isCaseSensitive )
241213
{
242214
return SelectorUtils.match( pattern, str, isCaseSensitive );
243215
}
244216

245-
246217
/**
247-
* Sets the list of include patterns to use. All '/' and '\' characters
248-
* are replaced by <code>File.separatorChar</code>, so the separator used
249-
* need not match <code>File.separatorChar</code>.
218+
* Sets the list of include patterns to use. All '/' and '\' characters are replaced by
219+
* <code>File.separatorChar</code>, so the separator used need not match <code>File.separatorChar</code>.
250220
* <p/>
251221
* When a pattern ends with a '/' or '\', "**" is appended.
252222
*
253-
* @param includes A list of include patterns.
254-
* May be <code>null</code>, indicating that all files
255-
* should be included. If a non-<code>null</code>
256-
* list is given, all elements must be
257-
* non-<code>null</code>.
223+
* @param includes A list of include patterns. May be <code>null</code>, indicating that all files should be
224+
* included. If a non-<code>null</code> list is given, all elements must be non-<code>null</code>.
258225
*/
259226
public void setIncludes( String[] includes )
260227
{
@@ -272,21 +239,18 @@ public void setIncludes( String[] includes )
272239
list.add( normalizePattern( include ) );
273240
}
274241
}
275-
this.includes = list.toArray( new String[ list.size() ] );
242+
this.includes = list.toArray( new String[list.size()] );
276243
}
277244
}
278245

279246
/**
280-
* Sets the list of exclude patterns to use. All '/' and '\' characters
281-
* are replaced by <code>File.separatorChar</code>, so the separator used
282-
* need not match <code>File.separatorChar</code>.
247+
* Sets the list of exclude patterns to use. All '/' and '\' characters are replaced by
248+
* <code>File.separatorChar</code>, so the separator used need not match <code>File.separatorChar</code>.
283249
* <p/>
284250
* When a pattern ends with a '/' or '\', "**" is appended.
285251
*
286-
* @param excludes A list of exclude patterns.
287-
* May be <code>null</code>, indicating that no files
288-
* should be excluded. If a non-<code>null</code> list is
289-
* given, all elements must be non-<code>null</code>.
252+
* @param excludes A list of exclude patterns. May be <code>null</code>, indicating that no files should be
253+
* excluded. If a non-<code>null</code> list is given, all elements must be non-<code>null</code>.
290254
*/
291255
public void setExcludes( String[] excludes )
292256
{
@@ -304,7 +268,7 @@ public void setExcludes( String[] excludes )
304268
list.add( normalizePattern( exclude ) );
305269
}
306270
}
307-
this.excludes = list.toArray( new String[ list.size() ] );
271+
this.excludes = list.toArray( new String[list.size()] );
308272
}
309273
}
310274

@@ -343,12 +307,11 @@ private String normalizePattern( String pattern )
343307
}
344308

345309
/**
346-
* Tests whether or not a name matches against at least one include
347-
* pattern.
310+
* Tests whether or not a name matches against at least one include pattern.
348311
*
349312
* @param name The name to match. Must not be <code>null</code>.
350-
* @return <code>true</code> when the name matches against at least one
351-
* include pattern, or <code>false</code> otherwise.
313+
* @return <code>true</code> when the name matches against at least one include pattern, or <code>false</code>
314+
* otherwise.
352315
*/
353316
protected boolean isIncluded( String name )
354317
{
@@ -361,25 +324,23 @@ protected boolean isIncluded( String name, String[] tokenizedName )
361324
}
362325

363326
/**
364-
* Tests whether or not a name matches the start of at least one include
365-
* pattern.
327+
* Tests whether or not a name matches the start of at least one include pattern.
366328
*
367329
* @param name The name to match. Must not be <code>null</code>.
368-
* @return <code>true</code> when the name matches against the start of at
369-
* least one include pattern, or <code>false</code> otherwise.
330+
* @return <code>true</code> when the name matches against the start of at least one include pattern, or
331+
* <code>false</code> otherwise.
370332
*/
371333
protected boolean couldHoldIncluded( String name )
372334
{
373-
return includesPatterns.matchesPatternStart(name, isCaseSensitive);
335+
return includesPatterns.matchesPatternStart( name, isCaseSensitive );
374336
}
375337

376338
/**
377-
* Tests whether or not a name matches against at least one exclude
378-
* pattern.
339+
* Tests whether or not a name matches against at least one exclude pattern.
379340
*
380341
* @param name The name to match. Must not be <code>null</code>.
381-
* @return <code>true</code> when the name matches against at least one
382-
* exclude pattern, or <code>false</code> otherwise.
342+
* @return <code>true</code> when the name matches against at least one exclude pattern, or <code>false</code>
343+
* otherwise.
383344
*/
384345
protected boolean isExcluded( String name )
385346
{

0 commit comments

Comments
 (0)