Skip to content

Commit 2062ca9

Browse files
kopporpalukku
andauthored
Remove obsolete dependency (#14433)
* Remove obsolete dependency * Remove empty line * Fix alphabetic ordering * Add ArchUnit test for jackson * Re-add missing test * Fix dependencies * Fix spaces * fix format test --------- Co-authored-by: Philip <[email protected]>
1 parent 0ad9461 commit 2062ca9

File tree

4 files changed

+18
-9
lines changed

4 files changed

+18
-9
lines changed

.jbang/JabLsLauncher.java

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -15,19 +15,13 @@
1515

1616
// from jabls
1717
//DEPS com.fasterxml.jackson.core:jackson-annotations:2.20
18-
//DEPS tools.jackson.core:jackson-core:3.0.2
19-
//DEPS tools.jackson.core:jackson-databind:3.0.2
20-
//DEPS tools.jackson.dataformat:jackson-dataformat-yaml:3.0.2
2118
//DEPS info.picocli:picocli:4.7.7
2219
//DEPS org.apache.logging.log4j:log4j-to-slf4j:2.25.2
2320
//DEPS org.eclipse.lsp4j:org.eclipse.lsp4j:0.24.0
24-
//DEPS org.jabref:afterburner.fx:2.0.0
2521
//DEPS org.slf4j:jul-to-slf4j:2.0.17
2622
//DEPS org.slf4j:slf4j-api:2.0.17
2723
//DEPS org.tinylog:slf4j-tinylog:2.7.0
2824
//DEPS org.tinylog:tinylog-impl:2.7.0
29-
//DEPS com.github.ben-manes.caffeine:caffeine:3.2.3
30-
//DEPS org.apache.commons:commons-lang3:3.20.0
3125

3226
//SOURCES ../jabls/src/main/java/org/jabref/languageserver/BibtexTextDocumentService.java
3327
//SOURCES ../jabls/src/main/java/org/jabref/languageserver/BibtexWorkspaceService.java

jabgui/src/main/java/org/jabref/gui/preferences/JabRefGuiPreferences.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1216,7 +1216,7 @@ public DonationPreferences getDonationPreferences() {
12161216
}
12171217

12181218
donationPreferences = getDonationPreferencesFromBackingStore(DonationPreferences.getDefault());
1219-
1219+
12201220
EasyBind.listen(donationPreferences.neverShowAgainProperty(), (_, _, newValue) -> putBoolean(DONATION_NEVER_SHOW, newValue));
12211221
EasyBind.listen(donationPreferences.lastShownEpochDayProperty(), (_, _, newValue) -> putInt(DONATION_LAST_SHOWN_EPOCH_DAY, newValue.intValue()));
12221222
return donationPreferences;

jablib/build.gradle.kts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -604,7 +604,6 @@ javaModuleTesting.whitebox(testing.suites["test"]) {
604604
requires.add("org.xmlunit")
605605
requires.add("org.xmlunit.matchers")
606606

607-
608607
requires.add("com.tngtech.archunit")
609608
requires.add("com.tngtech.archunit.junit5.api")
610609
}

test-support/src/main/java/org/jabref/support/CommonArchitectureTest.java

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,9 @@
1818
import com.tngtech.archunit.lang.syntax.ArchRuleDefinition;
1919
import com.tngtech.archunit.library.GeneralCodingRules;
2020

21+
import static com.tngtech.archunit.base.DescribedPredicate.not;
22+
import static com.tngtech.archunit.core.domain.JavaClass.Predicates.resideInAnyPackage;
23+
2124
/**
2225
* This class checks JabRef's shipped classes for architecture quality.
2326
* Does not analyze test classes. Hint from <a href="https://stackoverflow.com/a/44681895/873282">StackOverflow</a>
@@ -57,6 +60,19 @@ public void doNotUseSwing(JavaClasses classes) {
5760
.check(classes);
5861
}
5962

63+
@ArchTest
64+
public void doNotUseJackson2(JavaClasses classes) {
65+
// annotations still reside in com.fasterxml package:
66+
ArchRuleDefinition.noClasses()
67+
.should()
68+
.dependOnClassesThat(
69+
resideInAnyPackage("com.fasterxml..")
70+
// https://github.com/FasterXML/jackson-databind/blob/37b593e4836af62a267f09d2193414078df36eb0/src/test/java/tools/jackson/databind/deser/AnySetterTest.java#L7C8-L7C42
71+
.and(not(resideInAnyPackage("com.fasterxml.jackson.annotation..")))
72+
)
73+
.check(classes);
74+
}
75+
6076
@ArchTest
6177
public void doNotUseAssertJ(JavaClasses classes) {
6278
ArchRuleDefinition.noClasses().should().accessClassesThat().resideInAPackage("org.assertj..")
@@ -66,7 +82,7 @@ public void doNotUseAssertJ(JavaClasses classes) {
6682
@ArchTest
6783
public void doNotUseJavaAWT(JavaClasses classes) {
6884
ArchRuleDefinition.noClasses().that().areNotAnnotatedWith(AllowedToUseAwt.class)
69-
.should().accessClassesThat().resideInAPackage(PACKAGE_JAVA_AWT)
85+
.should().dependOnClassesThat().resideInAPackage(PACKAGE_JAVA_AWT)
7086
.check(classes);
7187
}
7288

0 commit comments

Comments
 (0)