Skip to content

Commit 7c2104b

Browse files
TEZ-4712: Class-level SpotBugs exclusions for generated Protobuf classes (apache#489) (Raghav Aggarwal reviewed by Laszlo Bodor)
1 parent 57c7491 commit 7c2104b

8 files changed

Lines changed: 58 additions & 159 deletions

File tree

dev-support/spotless/license.java

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
/*
2+
* Licensed to the Apache Software Foundation (ASF) under one
3+
* or more contributor license agreements. See the NOTICE file
4+
* distributed with this work for additional information
5+
* regarding copyright ownership. The ASF licenses this file
6+
* to you under the Apache License, Version 2.0 (the
7+
* "License"); you may not use this file except in compliance
8+
* with the License. You may obtain a copy of the License at
9+
*
10+
* http://www.apache.org/licenses/LICENSE-2.0
11+
*
12+
* Unless required by applicable law or agreed to in writing,
13+
* software distributed under the License is distributed on an
14+
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15+
* KIND, either express or implied. See the License for the
16+
* specific language governing permissions and limitations
17+
* under the License.
18+
*/

dev-support/spotless/license.xml

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!--
3+
Licensed to the Apache Software Foundation (ASF) under one
4+
or more contributor license agreements. See the NOTICE file
5+
distributed with this work for additional information
6+
regarding copyright ownership. The ASF licenses this file
7+
to you under the Apache License, Version 2.0 (the
8+
"License"); you may not use this file except in compliance
9+
with the License. You may obtain a copy of the License at
10+
11+
http://www.apache.org/licenses/LICENSE-2.0
12+
13+
Unless required by applicable law or agreed to in writing,
14+
software distributed under the License is distributed on an
15+
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16+
KIND, either express or implied. See the License for the
17+
specific language governing permissions and limitations
18+
under the License.
19+
-->

pom.xml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1029,7 +1029,19 @@
10291029
<removeUnusedImports/>
10301030
<trimTrailingWhitespace/>
10311031
<endWithNewline/>
1032+
<licenseHeader>
1033+
<file>${maven.multiModuleProjectDirectory}/dev-support/spotless/license.java</file>
1034+
</licenseHeader>
10321035
</java>
1036+
<pom>
1037+
<includes>
1038+
<include>pom.xml</include>
1039+
</includes>
1040+
<licenseHeader>
1041+
<file>${maven.multiModuleProjectDirectory}/dev-support/spotless/license.xml</file>
1042+
<delimiter>^&lt;project|^&lt;configuration|^&lt;Configuration|^&lt;extensions|^&lt;component</delimiter>
1043+
</licenseHeader>
1044+
</pom>
10331045
</configuration>
10341046
</plugin>
10351047
<plugin>

tez-api/findbugs-exclude.xml

Lines changed: 3 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -14,57 +14,15 @@
1414
<FindBugsFilter>
1515

1616
<Match>
17-
<Class name="~org\.apache\.tez\.dag\.api\.client\.rpc\.DAGClientAMProtocolRPC\$.*Proto"/>
18-
<Field name="unknownFields"/>
19-
<Bug pattern="SE_BAD_FIELD"/>
17+
<Class name="~org\.apache\.tez\.dag\.api\.client\.rpc\.DAGClientAMProtocolRPC.*"/>
2018
</Match>
2119

2220
<Match>
23-
<Class name="~org\.apache\.tez\.dag\.api\.records\.DAGProtos\$.*"/>
24-
<Field name="unknownFields"/>
25-
<Bug pattern="SE_BAD_FIELD"/>
21+
<Class name="~org\.apache\.tez\.dag\.api\.records\.DAGProtos.*"/>
2622
</Match>
2723

2824
<Match>
29-
<Class name="~org\.apache\.tez\.runtime\.api\.events\.EventProtos\$.*Proto"/>
30-
<Field name="unknownFields"/>
31-
<Bug pattern="SE_BAD_FIELD"/>
32-
</Match>
33-
34-
<Match>
35-
<Class name="~org\.apache\.tez.dag\.api\.client\.rpc\.DAGClientAMProtocolRPC\$.*Proto"/>
36-
<Field name="PARSER"/>
37-
<Bug pattern="MS_SHOULD_BE_FINAL"/>
38-
</Match>
39-
40-
<Match>
41-
<Class name="~org\.apache\.tez\.dag\.api\.records\.DAGProtos\$.*"/>
42-
<Field name="PARSER"/>
43-
<Bug pattern="MS_SHOULD_BE_FINAL"/>
44-
</Match>
45-
46-
<Match>
47-
<Class name="~org\.apache\.tez\.runtime\.api\.events\.EventProtos\$*.*Proto"/>
48-
<Field name="PARSER"/>
49-
<Bug pattern="MS_SHOULD_BE_FINAL"/>
50-
</Match>
51-
52-
<Match>
53-
<Class name="~org\.apache\.tez\.dag\.api\.client\.rpc\.DAGClientAMProtocolRPC\$.*Proto\$Builder"/>
54-
<Method name="maybeForceBuilderInitialization"/>
55-
<Bug pattern="UCF_USELESS_CONTROL_FLOW"/>
56-
</Match>
57-
58-
<Match>
59-
<Class name="~org\.apache\.tez\.dag\.api\.records\.DAGProtos\$.*\$Builder"/>
60-
<Method name="maybeForceBuilderInitialization"/>
61-
<Bug pattern="UCF_USELESS_CONTROL_FLOW"/>
62-
</Match>
63-
64-
<Match>
65-
<Class name="~org\.apache\.tez\.runtime\.api\.events\.EventProtos\$*.*Proto\$Builder"/>
66-
<Method name="maybeForceBuilderInitialization"/>
67-
<Bug pattern="UCF_USELESS_CONTROL_FLOW"/>
25+
<Class name="~org\.apache\.tez\.runtime\.api\.events\.EventProtos.*"/>
6826
</Match>
6927

7028
<Match>

tez-dag/findbugs-exclude.xml

Lines changed: 1 addition & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -25,21 +25,7 @@
2525
</Match>
2626

2727
<Match>
28-
<Class name="~org\.apache\.tez\.dag\.recovery\.records\.RecoveryProtos\$.*Proto"/>
29-
<Field name="unknownFields"/>
30-
<Bug pattern="SE_BAD_FIELD"/>
31-
</Match>
32-
33-
<Match>
34-
<Class name="~org\.apache\.tez\.dag\.recovery\.records\.RecoveryProtos\$.*Proto"/>
35-
<Field name="PARSER"/>
36-
<Bug pattern="MS_SHOULD_BE_FINAL"/>
37-
</Match>
38-
39-
<Match>
40-
<Class name="~org\.apache\.tez\.dag\.recovery\.records\.RecoveryProtos\$.*Proto\$Builder"/>
41-
<Method name="maybeForceBuilderInitialization"/>
42-
<Bug pattern="UCF_USELESS_CONTROL_FLOW"/>
28+
<Class name="~org\.apache\.tez\.dag\.recovery\.records\.RecoveryProtos.*"/>
4329
</Match>
4430

4531
<Match>

tez-mapreduce/findbugs-exclude.xml

Lines changed: 1 addition & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -14,21 +14,7 @@
1414
<FindBugsFilter>
1515

1616
<Match>
17-
<Class name="~org\.apache\.tez\.mapreduce\.protos\.MRRuntimeProtos\$.*Proto"/>
18-
<Field name="unknownFields"/>
19-
<Bug pattern="SE_BAD_FIELD"/>
20-
</Match>
21-
22-
<Match>
23-
<Class name="~org\.apache\.tez\.mapreduce\.protos\.MRRuntimeProtos\$.*Proto"/>
24-
<Field name="PARSER"/>
25-
<Bug pattern="MS_SHOULD_BE_FINAL"/>
26-
</Match>
27-
28-
<Match>
29-
<Class name="org.apache.tez.mapreduce.protos.MRRuntimeProtos$MRSplitProto$Builder"/>
30-
<Method name="maybeForceBuilderInitialization"/>
31-
<Bug pattern="UCF_USELESS_CONTROL_FLOW"/>
17+
<Class name="~org\.apache\.tez\.mapreduce\.protos\.MRRuntimeProtos.*"/>
3218
</Match>
3319

3420
<Match>

tez-runtime-internals/findbugs-exclude.xml

Lines changed: 1 addition & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -40,21 +40,7 @@
4040
</Match>
4141

4242
<Match>
43-
<Class name="~org\.apache\.tez\.runtime\.internals\.api\.events\.SystemEventProtos\$.*Proto" />
44-
<Field name="PARSER"/>
45-
<Bug pattern="MS_SHOULD_BE_FINAL"/>
46-
</Match>
47-
48-
<Match>
49-
<Class name="~org\.apache\.tez\.runtime\.internals\.api\.events\.SystemEventProtos\$.*Proto" />
50-
<Field name="unknownFields"/>
51-
<Bug pattern="SE_BAD_FIELD"/>
52-
</Match>
53-
54-
<Match>
55-
<Class name="~org\.apache\.tez\.runtime\.internals\.api\.events\.SystemEventProtos\$.*Proto\$Builder" />
56-
<Method name="maybeForceBuilderInitialization"/>
57-
<Bug pattern="UCF_USELESS_CONTROL_FLOW"/>
43+
<Class name="~org\.apache\.tez\.runtime\.internals\.api\.events\.SystemEventProtos.*" />
5844
</Match>
5945

6046
<Match>

tez-runtime-library/findbugs-exclude.xml

Lines changed: 3 additions & 69 deletions
Original file line numberDiff line numberDiff line change
@@ -93,21 +93,15 @@
9393
</Match>
9494

9595
<Match>
96-
<Class name="~org\.apache\.tez\.runtime\.library\.shuffle\.impl\.ShuffleUserPayloads\$.*Proto"/>
97-
<Field name="PARSER"/>
98-
<Bug pattern="MS_SHOULD_BE_FINAL"/>
96+
<Class name="~org\.apache\.tez\.runtime\.library\.shuffle\.impl\.ShuffleUserPayloads.*"/>
9997
</Match>
10098

10199
<Match>
102-
<Class name="~org\.apache\.tez\.runtime\.library\.shuffle\.impl\.ShuffleUserPayloads\$.*Proto"/>
103-
<Field name="unknownFields"/>
104-
<Bug pattern="SE_BAD_FIELD"/>
100+
<Class name="~org\.apache\.tez\.runtime\.library\.cartesianproduct\.CartesianProductUserPayload.*"/>
105101
</Match>
106102

107103
<Match>
108-
<Class name="~org\.apache\.tez\.runtime\.library\.shuffle\.impl\.ShuffleUserPayloads\$.*Proto\$Builder"/>
109-
<Method name="maybeForceBuilderInitialization"/>
110-
<Bug pattern="UCF_USELESS_CONTROL_FLOW"/>
104+
<Class name="~org\.apache\.tez\.dag\.library\.vertexmanager\.FairShuffleUserPayloads.*"/>
111105
</Match>
112106

113107
<Match>
@@ -122,24 +116,6 @@
122116
<Bug pattern="DC_PARTIALLY_CONSTRUCTED"/>
123117
</Match>
124118

125-
<Match>
126-
<Class name="org.apache.tez.runtime.library.cartesianproduct.CartesianProductUserPayload$CartesianProductConfigProto"/>
127-
<Field name="unknownFields"/>
128-
<Bug pattern="SE_BAD_FIELD"/>
129-
</Match>
130-
131-
<Match>
132-
<Class name="org.apache.tez.runtime.library.cartesianproduct.CartesianProductUserPayload$CartesianProductConfigProto"/>
133-
<Field name="PARSER"/>
134-
<Bug pattern="MS_SHOULD_BE_FINAL"/>
135-
</Match>
136-
137-
<Match>
138-
<Class name="org.apache.tez.runtime.library.cartesianproduct.CartesianProductUserPayload$CartesianProductConfigProto$Builder"/>
139-
<Method name="maybeForceBuilderInitialization"/>
140-
<Bug pattern="UCF_USELESS_CONTROL_FLOW"/>
141-
</Match>
142-
143119
<Match>
144120
<Bug pattern="EI_EXPOSE_REP"/>
145121
<Or>
@@ -160,48 +136,6 @@
160136
<Bug pattern="IS2_INCONSISTENT_SYNC"/>
161137
</Match>
162138

163-
<Match>
164-
<Class name="org.apache.tez.dag.library.vertexmanager.FairShuffleUserPayloads$FairShuffleEdgeManagerConfigPayloadProto"/>
165-
<Field name="unknownFields"/>
166-
<Bug pattern="SE_BAD_FIELD"/>
167-
</Match>
168-
169-
<Match>
170-
<Class name="org.apache.tez.dag.library.vertexmanager.FairShuffleUserPayloads$FairShuffleEdgeManagerDestinationTaskPropProto"/>
171-
<Field name="unknownFields"/>
172-
<Bug pattern="SE_BAD_FIELD"/>
173-
</Match>
174-
175-
<Match>
176-
<Class name="org.apache.tez.dag.library.vertexmanager.FairShuffleUserPayloads$RangeProto"/>
177-
<Field name="unknownFields"/>
178-
<Bug pattern="SE_BAD_FIELD"/>
179-
</Match>
180-
181-
<Match>
182-
<Class name="org.apache.tez.dag.library.vertexmanager.FairShuffleUserPayloads$FairShuffleEdgeManagerConfigPayloadProto"/>
183-
<Field name="PARSER"/>
184-
<Bug pattern="MS_SHOULD_BE_FINAL"/>
185-
</Match>
186-
187-
<Match>
188-
<Class name="org.apache.tez.dag.library.vertexmanager.FairShuffleUserPayloads$FairShuffleEdgeManagerDestinationTaskPropProto"/>
189-
<Field name="PARSER"/>
190-
<Bug pattern="MS_SHOULD_BE_FINAL"/>
191-
</Match>
192-
193-
<Match>
194-
<Class name="org.apache.tez.dag.library.vertexmanager.FairShuffleUserPayloads$RangeProto"/>
195-
<Field name="PARSER"/>
196-
<Bug pattern="MS_SHOULD_BE_FINAL"/>
197-
</Match>
198-
199-
<Match>
200-
<Class name="org.apache.tez.dag.library.vertexmanager.FairShuffleUserPayloads$RangeProto$Builder"/>
201-
<Method name="maybeForceBuilderInitialization"/>
202-
<Bug pattern="UCF_USELESS_CONTROL_FLOW"/>
203-
</Match>
204-
205139
<Match>
206140
<Class name="org.apache.tez.runtime.library.common.sort.impl.IFile$Reader"/>
207141
<Field name="MAX_BUFFER_SIZE"/>

0 commit comments

Comments
 (0)