Skip to content

Commit 859b67a

Browse files
committed
Refactor utils
1 parent ce2f3fe commit 859b67a

32 files changed

+13035
-1886
lines changed

build.gradle.kts

Lines changed: 2 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -11,16 +11,14 @@ java {
1111
languageVersion = JavaLanguageVersion.of(25)
1212
}
1313
withSourcesJar()
14-
withJavadocJar()
14+
// withJavadocJar()
1515
}
1616

1717
repositories {
1818
mavenCentral()
1919
}
2020

2121
dependencies {
22-
implementation("org.apache.commons:commons-lang3:3.17.0")
23-
2422
testImplementation(platform("org.junit:junit-bom:5.11.4"))
2523
testImplementation("org.junit.jupiter:junit-jupiter")
2624
testImplementation("org.assertj:assertj-core:3.27.6")
@@ -33,24 +31,13 @@ tasks.test {
3331

3432
// Improved test output configuration for better feedback
3533
testLogging {
36-
events("passed", "skipped", "failed", "standardOut", "standardError")
34+
events("skipped", "failed")
3735

3836
// Show exceptions and their causes
3937
exceptionFormat = org.gradle.api.tasks.testing.logging.TestExceptionFormat.FULL
4038
showExceptions = true
4139
showCauses = true
4240
showStackTraces = true
43-
44-
// Display detailed test results
45-
showStandardStreams = false // Set to true for debugging specific tests
46-
47-
// Summary after test run
48-
displayGranularity = 2
49-
50-
// Show individual test results as they run
51-
info {
52-
events("passed", "skipped", "failed", "standardOut", "standardError")
53-
}
5441
}
5542

5643
// Generate detailed HTML reports for better analysis

src/main/java/uk/co/ryanharrison/mathengine/differential/symbolic/Differentiator.java

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
package uk.co.ryanharrison.mathengine.differential.symbolic;
22

3-
import org.apache.commons.lang3.StringUtils;
43
import uk.co.ryanharrison.mathengine.Function;
54
import uk.co.ryanharrison.mathengine.utils.Utils;
65

@@ -180,7 +179,7 @@ private static String optimizeSign(String s) {
180179
// replace "--" with "" or "+"
181180
while ((index = str.indexOf("--", index)) != -1)
182181
if (index == 0
183-
|| StringUtils.indexOfAny(str.substring(index - 1), '(', '+', '-', '/',
182+
|| Utils.indexOfAny(str.substring(index - 1), '(', '+', '-', '/',
184183
'*', '^') != -1) {
185184
str = str.delete(index, index + 2);
186185
} else {
@@ -195,7 +194,7 @@ private static String optimizeSign(String s) {
195194
private static String trim(double d) {
196195
String str = Double.toString(d);
197196
if (str.indexOf('.') != -1)
198-
str = StringUtils.stripEnd(str, "0");
199-
return StringUtils.stripEnd(str, ".");
197+
str = Utils.stripEnd(str, "0");
198+
return Utils.stripEnd(str, ".");
200199
}
201200
}

src/main/java/uk/co/ryanharrison/mathengine/differential/symbolic/ExpressionItem.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
package uk.co.ryanharrison.mathengine.differential.symbolic;
22

3-
import org.apache.commons.lang3.StringUtils;
43
import uk.co.ryanharrison.mathengine.Function;
54
import uk.co.ryanharrison.mathengine.utils.Utils;
65

@@ -20,7 +19,7 @@ public ExpressionItem(String input) {
2019
}
2120

2221
public String getInput() {
23-
if ((!Utils.isNumeric(input) && !input.equals("pi") && !input.equals("e")) && StringUtils.indexOfAny(input, operators) != -1)
22+
if ((!Utils.isNumeric(input) && !input.equals("pi") && !input.equals("e")) && Utils.indexOfAny(input, operators) != -1)
2423
return '(' + input + ')';
2524
return input;
2625
}

0 commit comments

Comments
 (0)