Two methods in PcTextScreen.java would go

Project:JNode Core
Component:Code
Category:bug report
Priority:minor
Assigned:Unassigned
Status:closed
Description

Two methods in PcTextScreen.java would go into an infinite recursion loop
if they were ever called. Here is a patch.

Index: core/src/driver/org/jnode/driver/textscreen/x86/PcTextScreen.java
===================================================================
--- core/src/driver/org/jnode/driver/textscreen/x86/PcTextScreen.java (revision 2533)
+++ core/src/driver/org/jnode/driver/textscreen/x86/PcTextScreen.java (working copy)
@@ -172,10 +172,10 @@
}

public void setCursor( int x, int y ) {
- instance.setCursor( x,y);
+ // instance.setCursor( x,y);
}

public void setCursorVisible( boolean visible ) {
- instance.setCursorVisible( visible );
+ // instance.setCursorVisible( visible );
}
}

hmm, that patch doesn't

hmm, that patch doesn't modify anything, isn't it ?

maybe you wanted to add "if (instance != this)" at the begin of the methods Smiling ?

Fabien

my blog (in english and french)

Read the code more carefully

Unless I am mistaken, "instance == this" is always true.

What my patch actually does

FWIW, my patch simply comments out dangerous code. A better patch would be (maybe) to implement the functionality or (maybe) to throw
and UnsupportedOperationException.

well, to me it looks like

Well, to me it looks like you are right in the recursive calls. And the best would be to implement the missing functionality, untill then I find it better not to use the UnsupportedOperationException, but maybe something like the gnu.classpath.NotImplementedException as there is a difference in not supporting and not finished implementation. Maybe we should introduce an org.jnode.NotImplementedException in the core module instead of using the classpath exception, that way we better can find what's not implementated in JNode.

#1

Status:active» fixed

I have added TODOs in the methods. marking as fixed.

#3

Status:fixed» closed

Manually closed.