Skip to content

Commit 0891858

Browse files
committed
absolute: no need for Java
1 parent cf3ae6d commit 0891858

File tree

2 files changed

+4
-5
lines changed

2 files changed

+4
-5
lines changed

+stdlib/absolute.m

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,9 @@
2323
c = p;
2424
end
2525

26-
if ~stdlib.is_absolute(c)
26+
if stdlib.is_absolute(c)
27+
c = stdlib.posix(c);
28+
else
2729
% .getAbsolutePath(), .toAbsolutePath()
2830
% default is Documents/Matlab, which is probably not wanted.
2931
if isempty(base) || strlength(base) == 0
@@ -33,8 +35,7 @@
3335
end
3436
end
3537

38+
% not needed:
3639
% https://docs.oracle.com/en/java/javase/21/docs/api/java.base/java/io/File.html#getAbsolutePath()
3740

38-
c = stdlib.posix(java.io.File(c).getAbsolutePath());
39-
4041
end % function

test/TestResolve.m

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,6 @@ function test_absolute(tc)
99
import matlab.unittest.constraints.StartsWithSubstring
1010
import matlab.unittest.constraints.EndsWithSubstring
1111

12-
tc.assumeTrue(stdlib.has_java)
13-
1412
td = tc.applyFixture(TemporaryFolderFixture).Folder;
1513
tc.applyFixture(CurrentFolderFixture(td))
1614

0 commit comments

Comments
 (0)