-
Notifications
You must be signed in to change notification settings - Fork 17
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
refactor: get rid of Guava #669
base: master
Are you sure you want to change the base?
Conversation
This is not a breaking change but in case someone was using Guava classes in their projects without declaring a dependency, the fix is super simple - just add an entry to your POM. This will also help address dependency conflicts in case your project needs an older/newer version of Guava and you want to use Lyo. |
core/lyo-core-settings/src/main/java/org/eclipse/lyo/oslc4j/core/StringUtils.java
Outdated
Show resolved
Hide resolved
https://mvnrepository.com/artifact/com.google.guava/guava/33.4.0-jre 3MB, by the way. Lyo Core + Jena provider are barely 100 KB together. Also replaced Apache Commons Lang3 StringUtils use as well for consistency. Finally, with the stripping of Unicode Cc category control chars and Unicode normal form C normalization (e.g. Jena can be picky about it sometimes), our StringUtils class punches way above what's in Guava or Commons as far as RDF use is concerned. |
@@ -190,7 +187,7 @@ public void testSingleResourceRetrieved() | |||
resource2.getAbout(), ServiceProviderCatalog.class); | |||
|
|||
Assertions.assertThat(resourceUnderKey).isNotNull(); | |||
Assertions.assertThat(resourceUnderKey.getAbout().equals(resource2.getAbout())); | |||
Assertions.assertThat(resourceUnderKey.getAbout()).isEqualTo(resource2.getAbout()); |
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.
oops, that was a bug - the assertion was not checked
@@ -143,7 +140,7 @@ public void testStoreSuccessiveAddCombines() | |||
ServiceProviderCatalog.class); | |||
|
|||
Assertions.assertThat(catalogs).hasSize(2); | |||
Assertions.assertThat(Lists.newArrayList(catalogs) | |||
Assertions.assertThat(catalogs |
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.
in the newer JDKs, stream ops are available directly on a Collection
@@ -53,7 +53,7 @@ public void testSeqMarshalling() | |||
final Model expectedModel = RDFHelper.loadResourceModel("container-element.ttl"); | |||
final Container container = new Container(); | |||
container.setAbout(URI.create("urn:containerA")); | |||
final ImmutableList<Element> children = ImmutableList.of(element("A"), element("B")); | |||
final List<Element> children = List.of(element("A"), element("B")); |
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.
List.of
produces an immutable list out of the box.
Description
Gets rid of the Google Guava dependency. Rationale: reduce dependency list both to reduce maintenance burden for us and pass on size reduction for the users.
We only used string blankness checks as well as some immutable collection and stopwatch functionality. All has been replaced by JDK11/17+ code and a small
StringUtil
class.Checklist
Issues
Closes #650
(use exactly this syntax to link to issues, one issue per statement only!)