-
Notifications
You must be signed in to change notification settings - Fork 693
[GEODE-10516] Java Documentation Modernization: Stable Aggregation, Legacy Tomcat Neutralization, and Compliance Readiness #7926
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
JinwooHwang
wants to merge
11
commits into
apache:develop
Choose a base branch
from
JinwooHwang:docsbase
base: develop
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
11 commits
Select commit
Hold shift + click to select a range
5de4fb5
Execution optimizations
JinwooHwang e899ebc
Cross-project runtimeClasspath resolution
JinwooHwang 3fced77
Merge remote-tracking branch 'origin/runtimeClasspath' into Execution…
JinwooHwang 4e30f32
geode-assembly-docs
JinwooHwang 8b8b234
geode-assembly-docs
JinwooHwang 40bd7c4
Revert "Execution optimizations"
JinwooHwang 832b69c
Revert "Cross-project runtimeClasspath resolution"
JinwooHwang f676842
remove exclude examples/security
JinwooHwang 4d87eba
addressed format
JinwooHwang 43c72e5
added impl
JinwooHwang 940324c
Merge branch 'develop' into docsbase
JinwooHwang File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
21 changes: 21 additions & 0 deletions
21
geode-assembly/src/javadocStubs/java/org/apache/catalina/LifecycleListener.java
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,21 @@ | ||
| /* | ||
| * Licensed to the Apache Software Foundation (ASF) under one or more | ||
| * contributor license agreements. See the NOTICE file distributed with | ||
| * this work for additional information regarding copyright ownership. | ||
| * The ASF licenses this file to You under the Apache License, Version 2.0 | ||
| * (the "License"); you may not use this file except in compliance with | ||
| * the License. You may obtain a copy of the License at | ||
| * | ||
| * http://www.apache.org/licenses/LICENSE-2.0 | ||
| * | ||
| * Unless required by applicable law or agreed to in writing, software | ||
| * distributed under the License is distributed on an "AS IS" BASIS, | ||
| * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
| * See the License for the specific language governing permissions and | ||
| * limitations under the License. | ||
| */ | ||
| package org.apache.catalina; | ||
|
|
||
| /** Minimal placeholder for legacy Tomcat LifecycleListener. */ | ||
| public interface LifecycleListener { | ||
| } |
24 changes: 24 additions & 0 deletions
24
geode-assembly/src/javadocStubs/java/org/apache/catalina/Realm.java
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,24 @@ | ||
| /* | ||
| * Licensed to the Apache Software Foundation (ASF) under one or more | ||
| * contributor license agreements. See the NOTICE file distributed with | ||
| * this work for additional information regarding copyright ownership. | ||
| * The ASF licenses this file to You under the Apache License, Version 2.0 | ||
| * (the "License"); you may not use this file except in compliance with | ||
| * the License. You may obtain a copy of the License at | ||
| * | ||
| * http://www.apache.org/licenses/LICENSE-2.0 | ||
| * | ||
| * Unless required by applicable law or agreed to in writing, software | ||
| * distributed under the License is distributed on an "AS IS" BASIS, | ||
| * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
| * See the License for the specific language governing permissions and | ||
| * limitations under the License. | ||
| */ | ||
| package org.apache.catalina; | ||
|
|
||
| import java.security.Principal; | ||
|
|
||
| /** Minimal placeholder for legacy Tomcat Realm. */ | ||
| public interface Realm { | ||
| Principal authenticate(String username, String credentials); | ||
| } |
61 changes: 61 additions & 0 deletions
61
...-assembly/src/javadocStubs/java/org/apache/catalina/ha/session/SerializablePrincipal.java
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,61 @@ | ||
| /* | ||
| * Licensed to the Apache Software Foundation (ASF) under one or more | ||
| * contributor license agreements. See the NOTICE file distributed with | ||
| * this work for additional information regarding copyright ownership. | ||
| * The ASF licenses this file to You under the Apache License, Version 2.0 | ||
| * (the "License"); you may not use this file except in compliance with | ||
| * the License. You may obtain a copy of the License at | ||
| * | ||
| * http://www.apache.org/licenses/LICENSE-2.0 | ||
| * | ||
| * Unless required by applicable law or agreed to in writing, software | ||
| * distributed under the License is distributed on an "AS IS" BASIS, | ||
| * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
| * See the License for the specific language governing permissions and | ||
| * limitations under the License. | ||
| * | ||
| * Javadoc stub for legacy Tomcat class org.apache.catalina.ha.session.SerializablePrincipal. | ||
| * Only the minimal surface required by DeltaSession is implemented. This stub exists | ||
| * exclusively for aggregate Javadoc generation and MUST NOT be on any runtime classpath. | ||
| */ | ||
| package org.apache.catalina.ha.session; | ||
|
|
||
| import java.io.Serializable; | ||
| import java.security.Principal; | ||
|
|
||
| import org.apache.catalina.Realm; | ||
| import org.apache.catalina.realm.GenericPrincipal; | ||
|
|
||
| @SuppressWarnings({"unused"}) | ||
| public class SerializablePrincipal implements Serializable { | ||
| private static final long serialVersionUID = 1L; | ||
| private final String name; | ||
|
|
||
| public SerializablePrincipal(String name) { | ||
| this.name = name; | ||
| } | ||
|
|
||
| public static SerializablePrincipal createPrincipal(GenericPrincipal gp) { | ||
| return new SerializablePrincipal(gp == null ? null : gp.getName()); | ||
| } | ||
|
|
||
| public Principal getPrincipal(Realm realm) { | ||
| // Provide a minimal Principal; GenericPrincipal construction not reproduced. | ||
| return new Principal() { | ||
| @Override | ||
| public String getName() { | ||
| return name; | ||
| } | ||
|
|
||
| @Override | ||
| public String toString() { | ||
| return name; | ||
| } | ||
| }; | ||
| } | ||
|
|
||
| @Override | ||
| public String toString() { | ||
| return name; | ||
| } | ||
| } |
38 changes: 38 additions & 0 deletions
38
geode-assembly/src/javadocStubs/java/org/apache/catalina/realm/GenericPrincipal.java
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,38 @@ | ||
| /* | ||
| * Licensed to the Apache Software Foundation (ASF) under one or more | ||
| * contributor license agreements. See the NOTICE file distributed with | ||
| * this work for additional information regarding copyright ownership. | ||
| * The ASF licenses this file to You under the Apache License, Version 2.0 | ||
| * (the "License"); you may not use this file except in compliance with | ||
| * the License. You may obtain a copy of the License at | ||
| * | ||
| * http://www.apache.org/licenses/LICENSE-2.0 | ||
| * | ||
| * Unless required by applicable law or agreed to in writing, software | ||
| * distributed under the License is distributed on an "AS IS" BASIS, | ||
| * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
| * See the License for the specific language governing permissions and | ||
| * limitations under the License. | ||
| */ | ||
| package org.apache.catalina.realm; | ||
|
|
||
| import java.security.Principal; | ||
|
|
||
| /** Minimal placeholder for legacy Tomcat GenericPrincipal used only for name access. */ | ||
| public class GenericPrincipal implements Principal { | ||
| private final String name; | ||
|
|
||
| public GenericPrincipal(String name) { | ||
| this.name = name; | ||
| } | ||
|
|
||
| @Override | ||
| public String getName() { | ||
| return name; | ||
| } | ||
|
|
||
| @Override | ||
| public String toString() { | ||
| return name; | ||
| } | ||
| } |
54 changes: 54 additions & 0 deletions
54
geode-assembly/src/javadocStubs/java/org/apache/catalina/util/LifecycleSupport.java
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,54 @@ | ||
| /* | ||
| * Licensed to the Apache Software Foundation (ASF) under one or more | ||
| * contributor license agreements. See the NOTICE file distributed with | ||
| * this work for additional information regarding copyright ownership. | ||
| * The ASF licenses this file to You under the Apache License, Version 2.0 | ||
| * (the "License"); you may not use this file except in compliance with | ||
| * the License. You may obtain a copy of the License at | ||
| * | ||
| * http://www.apache.org/licenses/LICENSE-2.0 | ||
| * | ||
| * Unless required by applicable law or agreed to in writing, software | ||
| * distributed under the License is distributed on an "AS IS" BASIS, | ||
| * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
| * See the License for the specific language governing permissions and | ||
| * limitations under the License. | ||
| * | ||
| * Javadoc stub for legacy Tomcat 6 class org.apache.catalina.util.LifecycleSupport. | ||
| * This is provided solely to satisfy aggregate Javadoc generation for deprecated | ||
| * session manager implementations that still reference the Tomcat 6 API. It is NOT | ||
| * a functional replacement and MUST NOT be placed on any runtime classpath. | ||
| */ | ||
| package org.apache.catalina.util; | ||
|
|
||
| import org.apache.catalina.LifecycleListener; | ||
|
|
||
| /** | ||
| * Minimal no-op implementation exposing only the methods invoked by Geode's | ||
| * deprecated Tomcat6/7 session manager code during Javadoc compilation. | ||
| * All operations are no-ops. | ||
| */ | ||
| @SuppressWarnings({"unused", "deprecation"}) | ||
| public class LifecycleSupport { | ||
| private final Object source; | ||
|
|
||
| public LifecycleSupport(Object source) { | ||
| this.source = source; | ||
| } | ||
|
|
||
| public void addLifecycleListener(LifecycleListener listener) { | ||
| // no-op | ||
| } | ||
|
|
||
| public LifecycleListener[] findLifecycleListeners() { | ||
| return new LifecycleListener[0]; | ||
| } | ||
|
|
||
| public void fireLifecycleEvent(String type, Object data) { | ||
| // no-op | ||
| } | ||
|
|
||
| public void removeLifecycleListener(LifecycleListener listener) { | ||
| // no-op | ||
| } | ||
| } |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Your PR description says you're "replacing earlier brittle workarounds (class exclusions, legacy extraction reliance) with a stable classpath-only symbol resolution strategy" - but the implementation still includes both legacy JAR
extraction AND stub classes. This seems contradictory to the stated goal.
Core Issue
You're solving the same problem in two different ways simultaneously:
This puts three different versions of the same classes on the Javadoc classpath, which could lead to unpredictable symbol resolution depending on classpath ordering.
Key Questions
Suggested Path Forward
Pick one approach and commit to it:
The current dual approach increases complexity rather than reducing it, which goes against your stated objective of creating a "stable" solution.
What was the specific reason for keeping both approaches? Were the stubs insufficient on their own?
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @sboorlagadda,
Thanks for pointing that out—excellent observation. Your thoughtful feedback is much appreciated.
We need all three layers because they solve different, mutually exclusive problems:
The stubs DON'T work alone. Here is the evidence:
Legacy JARs provide the bulk coverage:
Stubs provide surgical fixes:
Why not "just stubs"? Because creating and maintaining 30+ accurate stubs would be error-prone and high-maintenance.
Why not "just legacy JARs"? Because newer modules (like geode-modules-tomcat9) need modern Tomcat 9 APIs that don't exist in Tomcat 6.
Each layer reduces a different failure mode. Removing any single layer breaks some subset of symbols.
The current configuration implicitly tests and tolerates that scenario. The build succeeds with exit code 0 for :geode-assembly:docs, which would fail immediately on a binary or signature mismatch if resolution were ambiguous in a harmful way.
Evidence of the conflict:
How the conflict is resolved:
The classpath order in the docs task is:
Because stubs are last, any class present in both a JAR and the stubs is resolved from the earlier entry (the real Tomcat class). The stub then becomes an inert fallback. That ordering is deliberate and safe.
Why this is safe:
The Tomcat APIs ARE incompatible—that's exactly WHY both versions are needed.
Evidence of version-specific needs:
Modern code needs Tomcat 9:
Legacy code needs Tomcat 6:
Safe mixing strategy:
Please let me know if I’ve misunderstood anything. As I’m still new to the community, I may not be as familiar with certain nuances. Your thoughtful guidance and seasoned experience would be greatly appreciated as I continue to get up to speed. Thank you so much for your help, @sboorlagadda .