Skip to content

Commit da99d7f

Browse files
committed
core: Remove Stat.hasIno again
as per reviewer request (#153) Signed-off-by: Christian Kohlschütter <[email protected]>
1 parent 2f92e2b commit da99d7f

File tree

3 files changed

+5
-13
lines changed

3 files changed

+5
-13
lines changed

core/src/main/java/org/dcache/nfs/v4/OperationGETATTR.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -255,7 +255,7 @@ static Optional<? extends XdrAble> fattr2xdr(int fattr, VirtualFileSystem fs, In
255255
case nfs4_prot.FATTR4_CHOWN_RESTRICTED:
256256
return Optional.empty();
257257
case nfs4_prot.FATTR4_FILEID:
258-
if (stat.hasIno()) {
258+
if (stat.isDefined(StatAttribute.INO)) {
259259
return Optional.of(new fattr4_fileid(stat.getIno()));
260260
} else {
261261
return Optional.empty();
@@ -354,7 +354,7 @@ static Optional<? extends XdrAble> fattr2xdr(int fattr, VirtualFileSystem fs, In
354354
* TODO!!!:
355355
*/
356356

357-
if (!stat.hasIno()) {
357+
if (!stat.isDefined(StatAttribute.INO)) {
358358
return Optional.empty();
359359
}
360360
long mofi = stat.getIno();

core/src/main/java/org/dcache/nfs/vfs/Stat.java

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -153,15 +153,6 @@ public void setDev(int dev) {
153153
_dev = dev;
154154
}
155155

156-
/**
157-
* Checks if an inode number has been set (even if 0).
158-
*
159-
* @return {@code true} if set.
160-
*/
161-
public boolean hasIno() {
162-
return isDefined(StatAttribute.INO);
163-
}
164-
165156
/**
166157
* Returns file inode number.
167158
*/

core/src/test/java/org/dcache/nfs/vfs/StatTest.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
import java.text.SimpleDateFormat;
1010
import java.util.Calendar;
1111

12+
import org.dcache.nfs.vfs.Stat.StatAttribute;
1213
import org.junit.Assert;
1314
import org.junit.Test;
1415

@@ -168,9 +169,9 @@ public void testNotDefinedGetBtime() {
168169
@Test
169170
public void testGetIno() {
170171
Stat stat = new Stat();
171-
assertFalse(stat.hasIno());
172+
assertFalse(stat.isDefined(StatAttribute.INO));
172173
stat.setIno(1);
173-
assertTrue(stat.hasIno());
174+
assertTrue(stat.isDefined(StatAttribute.INO));
174175
assertEquals(1, stat.getIno());
175176

176177
}

0 commit comments

Comments
 (0)