Skip to content

Commit

Permalink
[format] Enable formatting which just trims whitespace in this case
Browse files Browse the repository at this point in the history
  • Loading branch information
hazendaz committed Oct 20, 2024
1 parent 2981293 commit 98c3cc6
Show file tree
Hide file tree
Showing 33 changed files with 522 additions and 220 deletions.
312 changes: 312 additions & 0 deletions format.xml

Large diffs are not rendered by default.

2 changes: 0 additions & 2 deletions src/it/check-multi-filter-dups/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -60,5 +60,3 @@
</plugins>
</build>
</project>


1 change: 0 additions & 1 deletion src/it/no-src/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -50,4 +50,3 @@
</plugins>
</reporting>
</project>

Original file line number Diff line number Diff line change
Expand Up @@ -364,7 +364,7 @@ abstract class BaseViolationCheckMojo extends AbstractMojo {
* @since 2.4.1
*/
@Parameter(property = "spotbugs.maxAllowedViolations", defaultValue = "0")
int maxAllowedViolations
int maxAllowedViolations

/** Disable bugs log. */
@Parameter(defaultValue = "false", property = "spotbugs.quiet")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1288,7 +1288,7 @@ class SpotBugsMojo extends AbstractMavenReport implements SpotBugsPluginsTrait {

/**
* Set report output directory, allowed to be not read only as defined in AbstractMavenParent.
*
*
* @see AbstractMavenReport#setReportOutputDirectory(File)
*/
@Override
Expand Down
14 changes: 7 additions & 7 deletions src/site/resources/examples/spotbugsXml.xml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="windows-1252"?>
<!--
Copyright 2005-2023 the original author or authors.
Copyright 2005-2024 the original author or authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -76,14 +76,14 @@ public void foo() {
&lt;p&gt;Such assignments are useless, and may indicate a logic error or typo.&lt;/p&gt;

</Details></BugPattern><BugPattern abbrev='NP' category='BAD_PRACTICE' type='NP_EQUALS_SHOULD_HANDLE_NULL_ARGUMENT'><ShortDescription>equals() method does not check for null argument</ShortDescription><Details>

&lt;p&gt;
This implementation of equals(Object) violates the contract defined
by java.lang.Object.equals() because it does not check for null
being passed as the argument. All equals() methods should return
false if passed a null value.
&lt;/p&gt;

</Details></BugPattern><BugPattern abbrev='RE' category='CORRECTNESS' type='RE_POSSIBLE_UNINTENDED_PATTERN'><ShortDescription>"." or "|" used for regular expression</ShortDescription><Details>

&lt;p&gt;
Expand Down Expand Up @@ -153,13 +153,13 @@ block for an &lt;code&gt;if&lt;/code&gt; statement:&lt;/p&gt;
&lt;p&gt;Assigning the same value to a variable twice is useless, and may indicate a logic error or typo.&lt;/p&gt;

</Details></BugPattern><BugPattern abbrev='NP' category='BAD_PRACTICE' type='NP_CLONE_COULD_RETURN_NULL'><ShortDescription>Clone method may return null</ShortDescription><Details>

&lt;p&gt;
This clone method seems to return null in some circumstances, but clone is never
allowed to return a null value. If you are convinced this path is unreachable, throw an AssertionError
instead.
&lt;/p&gt;

</Details></BugPattern><BugPattern abbrev='HE' category='BAD_PRACTICE' type='HE_INHERITS_EQUALS_USE_HASHCODE'><ShortDescription>Class inherits equals() and uses Object.hashCode()</ShortDescription><Details>

&lt;p&gt; This class inherits &lt;code&gt;equals(Object)&lt;/code&gt; from an abstract
Expand Down Expand Up @@ -202,7 +202,7 @@ The field is public or protected, so perhaps
consider removing it from the class.&lt;/p&gt;

</Details></BugPattern><BugPattern abbrev='IO' category='CORRECTNESS' type='IO_APPENDING_TO_OBJECT_OUTPUT_STREAM'><ShortDescription>Doomed attempt to append to an object output stream</ShortDescription><Details>

&lt;p&gt;
This code opens a file in append mode and then wraps the result in an object output stream like as follows:
&lt;/p&gt;
Expand All @@ -216,7 +216,7 @@ consider removing it from the class.&lt;/p&gt;
could work is if on reading the file you plan to open it in random access mode and seek to the byte offset
where the append started.
&lt;/p&gt;

</Details></BugPattern><BugPattern abbrev='FI' category='BAD_PRACTICE' type='FI_USELESS'><ShortDescription>Finalizer does nothing but call superclass finalizer</ShortDescription><Details>

&lt;p&gt; The only thing this &lt;code&gt;finalize()&lt;/code&gt; method does is call
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<!--
Copyright 2005-2023 the original author or authors.
Copyright 2005-2024 the original author or authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -39,21 +39,21 @@
<a class="jxr_linenumber" name="L14" href="#L14">14</a> <em class="jxr_comment"> * limitations under the License.</em>
<a class="jxr_linenumber" name="L15" href="#L15">15</a> <em class="jxr_comment"> */</em>
<a class="jxr_linenumber" name="L16" href="#L16">16</a> <strong class="jxr_keyword">package</strong> org.codehaus.mojo.spotbugsmavenplugin.it;
<a class="jxr_linenumber" name="L17" href="#L17">17</a>
<a class="jxr_linenumber" name="L17" href="#L17">17</a>
<a class="jxr_linenumber" name="L18" href="#L18">18</a> <em class="jxr_javadoccomment">/**</em>
<a class="jxr_linenumber" name="L19" href="#L19">19</a> <em class="jxr_javadoccomment"> * Hello world!</em>
<a class="jxr_linenumber" name="L20" href="#L20">20</a> <em class="jxr_javadoccomment"> *</em>
<a class="jxr_linenumber" name="L21" href="#L21">21</a> <em class="jxr_javadoccomment"> */</em>
<a class="jxr_linenumber" name="L22" href="#L22">22</a> <strong class="jxr_keyword">public</strong> <strong class="jxr_keyword">class</strong> <a name="App" href="../../../../../org/codehaus/mojo/spotbugsmavenplugin/it/App.html#App">App</a> <strong class="jxr_keyword">implements</strong> Cloneable {
<a class="jxr_linenumber" name="L23" href="#L23">23</a>
<a class="jxr_linenumber" name="L23" href="#L23">23</a>
<a class="jxr_linenumber" name="L24" href="#L24">24</a> <strong class="jxr_keyword">public</strong> <strong class="jxr_keyword">static</strong> <strong class="jxr_keyword">void</strong> main( String[] args ) {
<a class="jxr_linenumber" name="L25" href="#L25">25</a> System.out.println( <span class="jxr_string">"Hello World!"</span> );
<a class="jxr_linenumber" name="L26" href="#L26">26</a> }
<a class="jxr_linenumber" name="L27" href="#L27">27</a>
<a class="jxr_linenumber" name="L27" href="#L27">27</a>
<a class="jxr_linenumber" name="L28" href="#L28">28</a> <strong class="jxr_keyword">public</strong> Object clone() {
<a class="jxr_linenumber" name="L29" href="#L29">29</a> <strong class="jxr_keyword">return</strong> <strong class="jxr_keyword">null</strong>; <em class="jxr_comment">// Does not call 'super.clone()'.</em>
<a class="jxr_linenumber" name="L30" href="#L30">30</a> }
<a class="jxr_linenumber" name="L31" href="#L31">31</a>
<a class="jxr_linenumber" name="L31" href="#L31">31</a>
<a class="jxr_linenumber" name="L32" href="#L32">32</a> }
</pre>
<hr/>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<!--
Copyright 2005-2023 the original author or authors.
Copyright 2005-2024 the original author or authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -39,23 +39,23 @@
<a class="jxr_linenumber" name="L14" href="#L14">14</a> <em class="jxr_comment"> * limitations under the License.</em>
<a class="jxr_linenumber" name="L15" href="#L15">15</a> <em class="jxr_comment"> */</em>
<a class="jxr_linenumber" name="L16" href="#L16">16</a> <strong class="jxr_keyword">package</strong> org.codehaus.mojo.spotbugsmavenplugin.it;
<a class="jxr_linenumber" name="L17" href="#L17">17</a>
<a class="jxr_linenumber" name="L18" href="#L18">18</a>
<a class="jxr_linenumber" name="L17" href="#L17">17</a>
<a class="jxr_linenumber" name="L18" href="#L18">18</a>
<a class="jxr_linenumber" name="L19" href="#L19">19</a> <strong class="jxr_keyword">import</strong> org.junit.jupiter.api.Test;
<a class="jxr_linenumber" name="L20" href="#L20">20</a> <strong class="jxr_keyword">import</strong> org.junit.jupiter.api.Disabled;
<a class="jxr_linenumber" name="L21" href="#L21">21</a>
<a class="jxr_linenumber" name="L21" href="#L21">21</a>
<a class="jxr_linenumber" name="L22" href="#L22">22</a> <em class="jxr_javadoccomment">/**</em>
<a class="jxr_linenumber" name="L23" href="#L23">23</a> <em class="jxr_javadoccomment"> * Tests for {@link Foo}.</em>
<a class="jxr_linenumber" name="L24" href="#L24">24</a> <em class="jxr_javadoccomment"> *</em>
<a class="jxr_linenumber" name="L25" href="#L25">25</a> <em class="jxr_javadoccomment"> * @author user@example.com (John Doe)</em>
<a class="jxr_linenumber" name="L26" href="#L26">26</a> <em class="jxr_javadoccomment"> */</em>
<a class="jxr_linenumber" name="L27" href="#L27">27</a> <strong class="jxr_keyword">class</strong> <a name="FooTest" href="../../../../../org/codehaus/mojo/spotbugsmavenplugin/it/FooTest.html#FooTest">FooTest</a> {
<a class="jxr_linenumber" name="L28" href="#L28">28</a>
<a class="jxr_linenumber" name="L28" href="#L28">28</a>
<a class="jxr_linenumber" name="L29" href="#L29">29</a> @Test
<a class="jxr_linenumber" name="L30" href="#L30">30</a> <strong class="jxr_keyword">void</strong> thisAlwaysPasses() {
<a class="jxr_linenumber" name="L31" href="#L31">31</a> <em class="jxr_comment">// Do nothing</em>
<a class="jxr_linenumber" name="L32" href="#L32">32</a> }
<a class="jxr_linenumber" name="L33" href="#L33">33</a>
<a class="jxr_linenumber" name="L33" href="#L33">33</a>
<a class="jxr_linenumber" name="L34" href="#L34">34</a> @Disabled
<a class="jxr_linenumber" name="L35" href="#L35">35</a> @Test
<a class="jxr_linenumber" name="L36" href="#L36">36</a> <strong class="jxr_keyword">void</strong> thisIsIgnored() {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<!--
Copyright 2005-2023 the original author or authors.
Copyright 2005-2024 the original author or authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
Expand All @@ -15,7 +15,6 @@
limitations under the License.
-->

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xml:lang="en" lang="en">
<!-- generated by Apache Maven JXR (jdk8) -->
Expand Down Expand Up @@ -58,7 +57,7 @@
</div>
<a name="skip-navbar_top"><!-- --></a>
</div>

<div class="header">
<h1 title="Package" class="title">Package org.codehaus.mojo.spotbugsmavenplugin.it</h1>
</div>
Expand Down Expand Up @@ -88,7 +87,7 @@ <h1 title="Package" class="title">Package org.codehaus.mojo.spotbugsmavenplugin.
</li>
</ul>
</div>

<div class="bottomNav">
<a name="navbar_bottom"><!-- --></a>
<a href="#skip-navbar_bottom" title="Skip navigation links"></a>
Expand Down Expand Up @@ -121,7 +120,7 @@ <h1 title="Package" class="title">Package org.codehaus.mojo.spotbugsmavenplugin.
</div>
<a name="skip-navbar_bottom"><!-- --></a>
</div>

<div id="footer">
Copyright &#169; 2023. All rights reserved.
</div>
Expand Down
9 changes: 4 additions & 5 deletions src/site/resources/examples/xref-test/overview-summary.html
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<!--
Copyright 2005-2023 the original author or authors.
Copyright 2005-2024 the original author or authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
Expand All @@ -15,7 +15,6 @@
limitations under the License.
-->

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xml:lang="en" lang="en">
<!-- generated by Apache Maven JXR (jdk7) -->
Expand Down Expand Up @@ -52,7 +51,7 @@
</ul>
<a name="skip-navbar_top"><!-- --></a>
</div>

<div class="header">
<h1 class="title">basic-1 testing Reference</h1>
</div>
Expand All @@ -73,7 +72,7 @@ <h1 class="title">basic-1 testing Reference</h1>
</tbody>
</table>
</div>

<div class="bottomNav">
<a name="navbar_bottom"><!-- --></a>
<a href="#skip-navbar_bottom" title="Skip navigation links"></a>
Expand Down Expand Up @@ -101,7 +100,7 @@ <h1 class="title">basic-1 testing Reference</h1>
</ul>
<a name="skip-navbar_bottom"><!-- --></a>
</div>

<div id="footer">
Copyright &#169; 2023. All rights reserved.
</div>
Expand Down
15 changes: 7 additions & 8 deletions src/site/resources/examples/xref-test/stylesheet.css
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* Copyright 2005-2023 the original author or authors.
* Copyright 2005-2024 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand All @@ -13,7 +13,6 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
/* Javadoc style sheet */
/*
Overall document style
*/
Expand Down Expand Up @@ -146,7 +145,7 @@ Navigation bar styles
height:2.8em;
padding-top:10px;
overflow:hidden;
font-size:12px;
font-size:12px;
}
.bottomNav {
margin-top:10px;
Expand Down Expand Up @@ -346,7 +345,7 @@ ul.blockList li.blockList, ul.blockListLast li.blockList {
}
ul.blockList ul.blockList li.blockList, ul.blockList ul.blockListLast li.blockList {
padding:0px 20px 5px 10px;
border:1px solid #ededed;
border:1px solid #ededed;
background-color:#f8f8f8;
}
ul.blockList ul.blockList ul.blockList li.blockList, ul.blockList ul.blockList ul.blockListLast li.blockList {
Expand Down Expand Up @@ -374,9 +373,9 @@ Table styles
*/
.overviewSummary, .memberSummary, .typeSummary, .useSummary, .constantsSummary, .deprecatedSummary {
width:100%;
border-left:1px solid #EEE;
border-right:1px solid #EEE;
border-bottom:1px solid #EEE;
border-left:1px solid #EEE;
border-right:1px solid #EEE;
border-bottom:1px solid #EEE;
}
.overviewSummary, .memberSummary {
padding:0px;
Expand Down Expand Up @@ -461,7 +460,7 @@ Table styles
display:none;
width:5px;
margin-right:3px;
position:relative;
position:relative;
float:left;
background-color:#F8981D;
}
Expand Down
16 changes: 8 additions & 8 deletions src/site/resources/examples/xref/AbstractMissingHashCode.html
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<!--
Copyright 2005-2023 the original author or authors.
Copyright 2005-2024 the original author or authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
Expand All @@ -25,32 +25,32 @@
<div id="overview"><a href="../apidocs/AbstractMissingHashCode.html">View Javadoc</a></div><pre>
<a class="jxr_linenumber" name="L1" href="#L1">1</a> <strong class="jxr_keyword">import</strong> edu.umd.cs.findbugs.annotations.ExpectWarning;
<a class="jxr_linenumber" name="L2" href="#L2">2</a> <strong class="jxr_keyword">import</strong> edu.umd.cs.findbugs.annotations.NoWarning;
<a class="jxr_linenumber" name="L3" href="#L3">3</a>
<a class="jxr_linenumber" name="L3" href="#L3">3</a>
<a class="jxr_linenumber" name="L4" href="#L4">4</a> <strong class="jxr_keyword">abstract</strong> <strong class="jxr_keyword">class</strong> <a name="AbstractMissingHashCode" href="..//AbstractMissingHashCode.html#AbstractMissingHashCode">AbstractMissingHashCode</a> {
<a class="jxr_linenumber" name="L5" href="#L5">5</a> <strong class="jxr_keyword">int</strong> x;
<a class="jxr_linenumber" name="L6" href="#L6">6</a>
<a class="jxr_linenumber" name="L6" href="#L6">6</a>
<a class="jxr_linenumber" name="L7" href="#L7">7</a> @Override
<a class="jxr_linenumber" name="L8" href="#L8">8</a> @ExpectWarning(<span class="jxr_string">"HE_EQUALS_USE_HASHCODE"</span>)
<a class="jxr_linenumber" name="L9" href="#L9">9</a> <strong class="jxr_keyword">public</strong> <strong class="jxr_keyword">boolean</strong> equals(Object o) {
<a class="jxr_linenumber" name="L10" href="#L10">10</a> <strong class="jxr_keyword">if</strong> (!(o instanceof <a name="AbstractMissingHashCode" href="..//AbstractMissingHashCode.html#AbstractMissingHashCode">AbstractMissingHashCode</a>))
<a class="jxr_linenumber" name="L11" href="#L11">11</a> <strong class="jxr_keyword">return</strong> false;
<a class="jxr_linenumber" name="L12" href="#L12">12</a> <strong class="jxr_keyword">return</strong> x == ((<a name="AbstractMissingHashCode" href="..//AbstractMissingHashCode.html#AbstractMissingHashCode">AbstractMissingHashCode</a>) o).x;
<a class="jxr_linenumber" name="L13" href="#L13">13</a> }
<a class="jxr_linenumber" name="L14" href="#L14">14</a>
<a class="jxr_linenumber" name="L14" href="#L14">14</a>
<a class="jxr_linenumber" name="L15" href="#L15">15</a> @ExpectWarning(<span class="jxr_string">"HE_INHERITS_EQUALS_USE_HASHCODE"</span>)
<a class="jxr_linenumber" name="L16" href="#L16">16</a> <strong class="jxr_keyword">static</strong> <strong class="jxr_keyword">class</strong> StillMissingHashCode <strong class="jxr_keyword">extends</strong> <a name="AbstractMissingHashCode" href="..//AbstractMissingHashCode.html#AbstractMissingHashCode">AbstractMissingHashCode</a> {
<a class="jxr_linenumber" name="L17" href="#L17">17</a> <strong class="jxr_keyword">int</strong> y;
<a class="jxr_linenumber" name="L18" href="#L18">18</a> }
<a class="jxr_linenumber" name="L19" href="#L19">19</a>
<a class="jxr_linenumber" name="L19" href="#L19">19</a>
<a class="jxr_linenumber" name="L20" href="#L20">20</a> <strong class="jxr_keyword">static</strong> <strong class="jxr_keyword">class</strong> Concrete <strong class="jxr_keyword">extends</strong> StillMissingHashCode {
<a class="jxr_linenumber" name="L21" href="#L21">21</a> <strong class="jxr_keyword">public</strong> <strong class="jxr_keyword">int</strong> z;
<a class="jxr_linenumber" name="L22" href="#L22">22</a>
<a class="jxr_linenumber" name="L22" href="#L22">22</a>
<a class="jxr_linenumber" name="L23" href="#L23">23</a> @Override
<a class="jxr_linenumber" name="L24" href="#L24">24</a> @NoWarning(<span class="jxr_string">"HE"</span>)
<a class="jxr_linenumber" name="L25" href="#L25">25</a> <strong class="jxr_keyword">public</strong> <strong class="jxr_keyword">int</strong> hashCode(){
<a class="jxr_linenumber" name="L26" href="#L26">26</a> <strong class="jxr_keyword">return</strong> 0;
<a class="jxr_linenumber" name="L27" href="#L27">27</a> }
<a class="jxr_linenumber" name="L28" href="#L28">28</a>
<a class="jxr_linenumber" name="L28" href="#L28">28</a>
<a class="jxr_linenumber" name="L29" href="#L29">29</a> @ExpectWarning(<span class="jxr_string">"EQ_UNUSUAL"</span>)
<a class="jxr_linenumber" name="L30" href="#L30">30</a> @Override
<a class="jxr_linenumber" name="L31" href="#L31">31</a> <strong class="jxr_keyword">public</strong> <strong class="jxr_keyword">boolean</strong> equals(Object o) {
Expand All @@ -61,7 +61,7 @@
<a class="jxr_linenumber" name="L36" href="#L36">36</a> <strong class="jxr_keyword">return</strong> o == <strong class="jxr_keyword">this</strong>;
<a class="jxr_linenumber" name="L37" href="#L37">37</a> }
<a class="jxr_linenumber" name="L38" href="#L38">38</a> }
<a class="jxr_linenumber" name="L39" href="#L39">39</a>
<a class="jxr_linenumber" name="L39" href="#L39">39</a>
<a class="jxr_linenumber" name="L40" href="#L40">40</a> @ExpectWarning(<span class="jxr_string">"EQ_DOESNT_OVERRIDE_EQUALS"</span>)
<a class="jxr_linenumber" name="L41" href="#L41">41</a> <strong class="jxr_keyword">static</strong> <strong class="jxr_keyword">class</strong> ConcreteMissingEquals <strong class="jxr_keyword">extends</strong> Concrete {
<a class="jxr_linenumber" name="L42" href="#L42">42</a> <strong class="jxr_keyword">int</strong> z;
Expand Down
Loading

0 comments on commit 98c3cc6

Please sign in to comment.