You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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
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.
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.
Activity
Deprecate JsonUtils and remove implementation
[-]License violations in micrometer-core[/-][+]License violation in `JsonUtils`[/+]shakuzen commentedon Aug 26, 2021
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.
Delete JsonUtils
shakuzen commentedon Aug 26, 2021
With 19e6bc6 I've removed the code for upcoming patch releases, leaving the
JsonUtilclass and itsprettyPrintmethod deprecated with an implementation that returns the input string. Therefore,HttpSender.Requestwill no longer be pretty printed via itstoStringmethod.With d7bf555 I've deleted the
JsonUtilclass entirely for the upcoming feature release 1.8.Reimplement TimeUtils.format()
izeye commentedon Oct 15, 2021
I created #2833 to try to resolve the
TimeUtilspart.Reimplement TimeUtils.format() (#2833)