Skip to content
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

[BUG] Replace (and block) uses of org.apache.logging.log4j.util.Strings #15211

Closed
msfroh opened this issue Aug 12, 2024 · 1 comment · Fixed by #15238
Closed

[BUG] Replace (and block) uses of org.apache.logging.log4j.util.Strings #15211

msfroh opened this issue Aug 12, 2024 · 1 comment · Fixed by #15238
Labels
bug Something isn't working Libraries Lucene Upgrades and Libraries, Any 3rd party library that Core depends on, ex: nebula; team is respo v2.17.0 v3.0.0 Issues and PRs related to version 3.0.0

Comments

@msfroh
Copy link
Collaborator

msfroh commented Aug 12, 2024

Describe the bug

In #13620, @reta correctly caught an incorrect use of org.apache.logging.log4j.util.Strings instead of org.opensearch.core.common.Strings.

I tried adding org.apache.logging.log4j.util.String to https://github.com/opensearch-project/OpenSearch/blob/main/buildSrc/src/main/resources/forbidden/opensearch-all-signatures.txt, and got the following errors (including the one I had added by accident):

Forbidden class/interface use: org.apache.logging.log4j.util.Strings [use (or add) helpers to org.opensearch.common.util instead]
  in org.opensearch.env.NodeEnvironment (NodeEnvironment.java:1303)
Forbidden class/interface use: org.apache.logging.log4j.util.Strings [use (or add) helpers to org.opensearch.common.util instead]
  in org.opensearch.index.IndexModule$DataLocalityType (IndexModule.java:583)
Forbidden class/interface use: org.apache.logging.log4j.util.Strings [use (or add) helpers to org.opensearch.common.util instead]
  in org.opensearch.gateway.remote.RemoteClusterStateCleanupManager (RemoteClusterStateCleanupManager.java:128)
Forbidden class/interface use: org.apache.logging.log4j.util.Strings [use (or add) helpers to org.opensearch.common.util instead]
  in org.opensearch.gateway.remote.RemoteClusterStateCleanupManager (RemoteClusterStateCleanupManager.java:129)
Forbidden class/interface use: org.apache.logging.log4j.util.Strings [use (or add) helpers to org.opensearch.common.util instead]
  in org.opensearch.index.shard.ShardPath (ShardPath.java:208)
Forbidden class/interface use: org.apache.logging.log4j.util.Strings [use (or add) helpers to org.opensearch.common.util instead]
  in org.opensearch.common.xcontent.JsonToStringXContentParser (JsonToStringXContentParser.java:113)
Forbidden class/interface use: org.apache.logging.log4j.util.Strings [use (or add) helpers to org.opensearch.common.util instead]
  in org.opensearch.common.logging.JsonThrowablePatternConverter (JsonThrowablePatternConverter.java:87)
Scanned 7503 class file(s) for forbidden API invocations (in 13.70s), 7 error(s).

Related component

Libraries

To Reproduce

  1. Add org.apache.logging.log4j.util.Strings and joptsimple.internal.Strings to https://github.com/opensearch-project/OpenSearch/blob/main/buildSrc/src/main/resources/forbidden/opensearch-all-signatures.txt
  2. Run ./gradlew precommit
  3. Observe build failures.

Expected behavior

These existing uses of org.apache.logging.log4j.util.Strings should be replaced with uses of org.opensearch.core.common.Strings.

Additional Details

N/A

@msfroh msfroh added bug Something isn't working untriaged labels Aug 12, 2024
@github-actions github-actions bot added the Libraries Lucene Upgrades and Libraries, Any 3rd party library that Core depends on, ex: nebula; team is respo label Aug 12, 2024
@msfroh
Copy link
Collaborator Author

msfroh commented Aug 12, 2024

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working Libraries Lucene Upgrades and Libraries, Any 3rd party library that Core depends on, ex: nebula; team is respo v2.17.0 v3.0.0 Issues and PRs related to version 3.0.0
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants