Skip to content

Commit ff48ed3

Browse files
Merge branch 'trunk' of https://github.com/anmolanmol1234/hadoop into HADOOP-19472_fix
2 parents cd7da4c + ee73a9b commit ff48ed3

21 files changed

Lines changed: 1249 additions & 532 deletions

File tree

LICENSE-binary

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -411,20 +411,20 @@ org.apache.yetus:audience-annotations:0.5.0
411411
org.apache.zookeeper:zookeeper:3.8.4
412412
org.codehaus.jettison:jettison:1.5.4
413413
org.conscrypt:conscrypt-openjdk-uber:2.5.2
414-
org.eclipse.jetty:jetty-annotations:9.4.57.v20241219
415-
org.eclipse.jetty:jetty-http:9.4.57.v20241219
416-
org.eclipse.jetty:jetty-io:9.4.57.v20241219
417-
org.eclipse.jetty:jetty-jndi:9.4.57.v20241219
418-
org.eclipse.jetty:jetty-plus:9.4.57.v20241219
419-
org.eclipse.jetty:jetty-security:9.4.57.v20241219
420-
org.eclipse.jetty:jetty-server:9.4.57.v20241219
421-
org.eclipse.jetty:jetty-servlet:9.4.57.v20241219
422-
org.eclipse.jetty:jetty-util:9.4.57.v20241219
423-
org.eclipse.jetty:jetty-util-ajax:9.4.57.v20241219
424-
org.eclipse.jetty:jetty-webapp:9.4.57.v20241219
425-
org.eclipse.jetty:jetty-xml:9.4.57.v20241219
426-
org.eclipse.jetty.websocket:javax-websocket-client-impl:9.4.57.v20241219
427-
org.eclipse.jetty.websocket:javax-websocket-server-impl:9.4.57.v20241219
414+
org.eclipse.jetty:jetty-annotations:9.4.58.v20250814
415+
org.eclipse.jetty:jetty-http:9.4.58.v20250814
416+
org.eclipse.jetty:jetty-io:9.4.58.v20250814
417+
org.eclipse.jetty:jetty-jndi:9.4.58.v20250814
418+
org.eclipse.jetty:jetty-plus:9.4.58.v20250814
419+
org.eclipse.jetty:jetty-security:9.4.58.v20250814
420+
org.eclipse.jetty:jetty-server:9.4.58.v20250814
421+
org.eclipse.jetty:jetty-servlet:9.4.58.v20250814
422+
org.eclipse.jetty:jetty-util:9.4.58.v20250814
423+
org.eclipse.jetty:jetty-util-ajax:9.4.58.v20250814
424+
org.eclipse.jetty:jetty-webapp:9.4.58.v20250814
425+
org.eclipse.jetty:jetty-xml:9.4.58.v20250814
426+
org.eclipse.jetty.websocket:javax-websocket-client-impl:9.4.58.v20250814
427+
org.eclipse.jetty.websocket:javax-websocket-server-impl:9.4.58.v20250814
428428
org.ehcache:ehcache:3.8.2
429429
org.ini4j:ini4j:0.5.4
430430
org.objenesis:objenesis:2.6

hadoop-common-project/hadoop-annotations/pom.xml

Lines changed: 15 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -31,50 +31,24 @@
3131

3232
<dependencies>
3333
<dependency>
34-
<groupId>jdiff</groupId>
34+
<groupId>io.github.zhtttylz</groupId>
3535
<artifactId>jdiff</artifactId>
3636
<scope>provided</scope>
3737
</dependency>
3838
</dependencies>
3939

40-
<profiles>
41-
<profile>
42-
<id>jdk1.8</id>
43-
<activation>
44-
<jdk>1.8</jdk>
45-
</activation>
46-
<dependencies>
47-
<dependency>
48-
<groupId>jdk.tools</groupId>
49-
<artifactId>jdk.tools</artifactId>
50-
<version>1.8</version>
51-
<scope>system</scope>
52-
<systemPath>${java.home}/../lib/tools.jar</systemPath>
53-
</dependency>
54-
</dependencies>
55-
<build>
56-
<plugins>
57-
<plugin>
58-
<groupId>org.codehaus.mojo</groupId>
59-
<artifactId>build-helper-maven-plugin</artifactId>
60-
<executions>
61-
<execution>
62-
<id>add-source</id>
63-
<phase>generate-sources</phase>
64-
<goals>
65-
<goal>add-source</goal>
66-
</goals>
67-
<configuration>
68-
<sources>
69-
<source>${basedir}/src/main/java8</source>
70-
</sources>
71-
</configuration>
72-
</execution>
73-
</executions>
74-
</plugin>
75-
</plugins>
76-
</build>
77-
</profile>
78-
</profiles>
79-
40+
<build>
41+
<plugins>
42+
<plugin>
43+
<groupId>org.apache.maven.plugins</groupId>
44+
<artifactId>maven-compiler-plugin</artifactId>
45+
<configuration>
46+
<compilerArgs>
47+
<arg>--add-modules</arg>
48+
<arg>jdk.javadoc</arg>
49+
</compilerArgs>
50+
</configuration>
51+
</plugin>
52+
</plugins>
53+
</build>
8054
</project>

hadoop-common-project/hadoop-annotations/src/main/java8/org/apache/hadoop/classification/tools/ExcludePrivateAnnotationsJDiffDoclet.java renamed to hadoop-common-project/hadoop-annotations/src/main/java/org/apache/hadoop/classification/tools/ExcludePrivateAnnotationsJDiffDoclet.java

Lines changed: 45 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -17,41 +17,72 @@
1717
*/
1818
package org.apache.hadoop.classification.tools;
1919

20-
import com.sun.javadoc.DocErrorReporter;
21-
import com.sun.javadoc.LanguageVersion;
22-
import com.sun.javadoc.RootDoc;
20+
import jdk.javadoc.doclet.DocletEnvironment;
21+
import jdk.javadoc.doclet.Reporter;
22+
import javax.lang.model.SourceVersion;
2323

2424
import jdiff.JDiff;
2525

2626
/**
27-
* A <a href="http://java.sun.com/javase/6/docs/jdk/api/javadoc/doclet/">Doclet</a>
28-
* for excluding elements that are annotated with
27+
* <a href=
28+
* "https://docs.oracle.com/en/java/javase/17/docs/api/jdk.javadoc/jdk/javadoc/doclet/Doclet.html">
29+
* Doclet</a> for excluding elements that are annotated with
2930
* {@link org.apache.hadoop.classification.InterfaceAudience.Private} or
3031
* {@link org.apache.hadoop.classification.InterfaceAudience.LimitedPrivate}.
3132
* It delegates to the JDiff Doclet, and takes the same options.
3233
*/
33-
public class ExcludePrivateAnnotationsJDiffDoclet {
34-
35-
public static LanguageVersion languageVersion() {
36-
return LanguageVersion.JAVA_1_5;
34+
public final class ExcludePrivateAnnotationsJDiffDoclet {
35+
36+
/**
37+
* Returns the source version used by this doclet.
38+
*
39+
* @return the supported source version
40+
*/
41+
public static SourceVersion languageVersion() {
42+
return SourceVersion.RELEASE_17;
3743
}
38-
39-
public static boolean start(RootDoc root) {
44+
45+
/**
46+
* Legacy doclet entry point used by JDiff/Javadoc.
47+
*
48+
* @param root the doclet environment
49+
* @return true if the doclet completed successfully
50+
*/
51+
public static boolean start(DocletEnvironment root) {
4052
System.out.println(
4153
ExcludePrivateAnnotationsJDiffDoclet.class.getSimpleName());
4254
return JDiff.start(RootDocProcessor.process(root));
4355
}
44-
56+
57+
/**
58+
* Utility class: provides only static entry points for JDiff.
59+
*/
60+
private ExcludePrivateAnnotationsJDiffDoclet() {
61+
}
62+
63+
/**
64+
* Returns the length of a supported option.
65+
*
66+
* @param option the option name
67+
* @return the number of arguments including the option itself
68+
*/
4569
public static int optionLength(String option) {
4670
Integer length = StabilityOptions.optionLength(option);
4771
if (length != null) {
4872
return length;
4973
}
5074
return JDiff.optionLength(option);
5175
}
52-
76+
77+
/**
78+
* Validates options before running the doclet.
79+
*
80+
* @param options the options to validate
81+
* @param reporter the reporter to use for diagnostics
82+
* @return true if the options are valid
83+
*/
5384
public static boolean validOptions(String[][] options,
54-
DocErrorReporter reporter) {
85+
Reporter reporter) {
5586
StabilityOptions.validOptions(options, reporter);
5687
String[][] filteredOptions = StabilityOptions.filterOptions(options);
5788
return JDiff.validOptions(filteredOptions, reporter);
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,203 @@
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, software
13+
* distributed under the License is distributed on an "AS IS" BASIS,
14+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15+
* See the License for the specific language governing permissions and
16+
* limitations under the License.
17+
*/
18+
package org.apache.hadoop.classification.tools;
19+
20+
import jdk.javadoc.doclet.Doclet;
21+
import jdk.javadoc.doclet.DocletEnvironment;
22+
import jdk.javadoc.doclet.Reporter;
23+
import javax.lang.model.SourceVersion;
24+
25+
import jdk.javadoc.doclet.StandardDoclet;
26+
27+
import java.util.Locale;
28+
import java.util.Set;
29+
30+
/**
31+
* <a href=
32+
* "https://docs.oracle.com/en/java/javase/17/docs/api/jdk.javadoc/jdk/javadoc/doclet/Doclet.html">
33+
* Doclet</a> for excluding elements that are
34+
* annotated with {@link org.apache.hadoop.classification.InterfaceAudience.Private}
35+
* or {@link org.apache.hadoop.classification.InterfaceAudience.LimitedPrivate}.
36+
* It delegates to the Standard Doclet, and takes the same options.
37+
*/
38+
public class ExcludePrivateAnnotationsStandardDoclet implements Doclet {
39+
40+
private final StandardDoclet delegate = new StandardDoclet();
41+
private Reporter reporter;
42+
private Locale locale;
43+
44+
/**
45+
* Public no-arg constructor required by the Javadoc tool.
46+
*/
47+
public ExcludePrivateAnnotationsStandardDoclet() {
48+
}
49+
50+
/**
51+
* Returns the source version used by this doclet.
52+
*
53+
* @return the supported source version
54+
*/
55+
public static SourceVersion languageVersion() {
56+
return SourceVersion.RELEASE_17;
57+
}
58+
59+
/**
60+
* Legacy doclet entry point used by Javadoc.
61+
*
62+
* @param root the doclet environment
63+
* @return true if the doclet completed successfully
64+
*/
65+
public static boolean start(DocletEnvironment root) {
66+
System.out.println(ExcludePrivateAnnotationsStandardDoclet.class.getSimpleName());
67+
if (root.getSpecifiedElements().isEmpty()) {
68+
return true;
69+
}
70+
return new StandardDoclet().run(root);
71+
}
72+
73+
/**
74+
* Returns the length of a supported option.
75+
*
76+
* @param option the option name
77+
* @return the number of arguments including the option itself
78+
*/
79+
public static int optionLength(String option) {
80+
Integer length = StabilityOptions.optionLength(option);
81+
if (length != null) {
82+
return length;
83+
}
84+
for (Doclet.Option o : new StandardDoclet().getSupportedOptions()) {
85+
for (String name : o.getNames()) {
86+
if (name.equals(option)) {
87+
return o.getArgumentCount() + 1;
88+
}
89+
}
90+
}
91+
return 0;
92+
}
93+
94+
/**
95+
* Validates options before running the doclet.
96+
*
97+
* @param options the options to validate
98+
* @param reporter the reporter to use for diagnostics
99+
* @return true if the options are valid
100+
*/
101+
public static boolean validOptions(String[][] options, Reporter reporter) {
102+
StabilityOptions.validOptions(options, reporter);
103+
return true;
104+
}
105+
106+
@Override
107+
public void init(Locale initLocale, Reporter initReporter) {
108+
this.locale = initLocale;
109+
this.reporter = initReporter;
110+
delegate.init(locale, reporter);
111+
}
112+
113+
@Override
114+
public String getName() {
115+
return getClass().getSimpleName();
116+
}
117+
118+
@Override
119+
public Set<Option> getSupportedOptions() {
120+
Set<Option> s = new java.util.HashSet<>(delegate.getSupportedOptions());
121+
s.add(new Option() {
122+
@Override
123+
public int getArgumentCount() {
124+
return 0;
125+
}
126+
127+
@Override
128+
public String getDescription() {
129+
return "";
130+
}
131+
132+
@Override
133+
public Kind getKind() {
134+
return Kind.OTHER;
135+
}
136+
137+
@Override
138+
public java.util.List<String> getNames() {
139+
return java.util.Collections.singletonList("-unstable");
140+
}
141+
142+
@Override
143+
public String getParameters() {
144+
return "";
145+
}
146+
147+
@Override
148+
public boolean process(String opt, java.util.List<String> args) {
149+
StabilityOptions.setLevel(StabilityOptions.Level.UNSTABLE);
150+
return true;
151+
}
152+
});
153+
s.add(new Option() {
154+
@Override
155+
public int getArgumentCount() {
156+
return 0;
157+
}
158+
159+
@Override
160+
public String getDescription() {
161+
return "";
162+
}
163+
164+
@Override
165+
public Kind getKind() {
166+
return Kind.OTHER;
167+
}
168+
169+
@Override
170+
public java.util.List<String> getNames() {
171+
return java.util.Collections.singletonList("-evolving");
172+
}
173+
174+
@Override
175+
public String getParameters() {
176+
return "";
177+
}
178+
179+
@Override
180+
public boolean process(String opt, java.util.List<String> args) {
181+
StabilityOptions.setLevel(StabilityOptions.Level.EVOLVING);
182+
return true;
183+
}
184+
});
185+
return s;
186+
}
187+
188+
@Override
189+
public SourceVersion getSupportedSourceVersion() {
190+
return SourceVersion.RELEASE_17;
191+
}
192+
193+
@Override
194+
public boolean run(DocletEnvironment environment) {
195+
StabilityOptions.applyToRootProcessor();
196+
RootDocProcessor.process(environment);
197+
198+
if (environment.getIncludedElements().isEmpty()) {
199+
return true;
200+
}
201+
return delegate.run(environment);
202+
}
203+
}

0 commit comments

Comments
 (0)