Skip to content

License violation in JsonUtils #2762

Closed
Closed

Description

@ChristianOberleitner

Describe the bug
The file file micrometer-core/src/main/java/io/micrometer/core/instrument/util/JsonUtils.java contains a method named prettyPrint which is (as stated by the author of the class himself) directly taken over from stackoverflow.com. There's a similar (though not that grave, as it is just a one-liner) issue in the file micrometer-core/src/main/java/io/micrometer/core/instrument/util/TimeUtils.java, method format. The issue is that micrometer is licensed under Apache 2.0 and copying code snippets from stackoverflow into own code creates derivative work under the CC BY-SA 4.0 license (under which all stackoverflow.com content is licensed) which is incompatible with Apache 2.0 for various reasons (copyleft, patent rights etc.).

Environment
All environments

To Reproduce
Check the source code and compare with stackoverflow

Expected behavior
No stackoverflow code snippets are used

Additional context

Activity

  1. added and removed
    bugA general bug
    on Aug 25, 2021
  2. self-assigned this
    on Aug 26, 2021
  3. added this to the 1.6.11 milestone on Aug 26, 2021
  4. changed the title [-]License violations in micrometer-core[/-] [+]License violation in `JsonUtils`[/+] on Aug 26, 2021
  5. shakuzen commented on Aug 26, 2021

    @shakuzen
    Member

    I've renamed the issue to focus it on the code in JsonUtils. We can look at tackling other Stackoverflow code in a separate issue since the solution here is wholly removing the code, whereas other places it is more likely we will need an alternate Apache-friendly implementation.

  6. added a commit that references this issue on Aug 26, 2021
  7. shakuzen commented on Aug 26, 2021

    @shakuzen
    Member

    With 19e6bc6 I've removed the code for upcoming patch releases, leaving the JsonUtil class and its prettyPrint method deprecated with an implementation that returns the input string. Therefore, HttpSender.Request will no longer be pretty printed via its toString method.
    With d7bf555 I've deleted the JsonUtil class entirely for the upcoming feature release 1.8.

  8. added a commit that references this issue on Oct 15, 2021
  9. izeye commented on Oct 15, 2021

    @izeye
    Contributor

    I created #2833 to try to resolve the TimeUtils part.

  10. added a commit that references this issue on Oct 18, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

module: micrometer-coreAn issue that is related to our core modulerelease notesNoteworthy change to call out in the release notestype: taskA general task

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions