Skip to content

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

@msfroh

Description

@msfroh

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    LibrariesLucene Upgrades and Libraries, Any 3rd party library that Core depends on, ex: nebula; team is respobugSomething isn't workingv2.17.0v3.0.0Issues and PRs related to version 3.0.0

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions