bugKawa - Bugs: bug #33140, ant task jemacs-swt-classes does...

 
 

bug #33140: ant task jemacs-swt-classes does not build successfully

Submitter:  Shad Gregory <shadgregory>
Submitted:  Thu 21 Apr 2011 08:39:27 PM UTC
   
 
Category:  JEmacs Severity:  3 - Normal
Item Group:  Problem building Kawa Status:  Fixed
Privacy:  Public Assigned to:  bothner
Open/Closed:  Closed
* Mandatory Fields

Add a New Comment Rich Markup
   

Jump to the original submission

Sun 01 May 2011 04:50:14 PM UTC, comment #7: 

I checked in the patch.  Thanks!

Per Bothner <bothner>
Group administrator
Sun 01 May 2011 03:56:22 AM UTC, comment #6: 

The last patch looks good.

Shad Gregory <shadgregory>
Sat 30 Apr 2011 06:10:38 AM UTC, comment #5: 

Could you try the attached swt3.patch?

(file #23327)

Per Bothner <bothner>
Group administrator
Wed 27 Apr 2011 07:14:23 PM UTC, comment #4: 

Ah, I see. Well, here's the error message from ant just in case:

jemacs-swt-classes:
    [javac] Compiling 2 source files to /home/shad/mysrc/kawa
    [javac] /home/shad/mysrc/kawa/gnu/jemacs/swt/SwtBuffer.java:108: cannot find symbol
    [javac] symbol  : variable n
    [javac] location: class gnu.jemacs.swt.SwtBuffer
    [javac]     String str = Marker.repeatChar(ch, n);
    [javac]                                        ^
    [javac] /home/shad/mysrc/kawa/gnu/jemacs/swt/SwtBuffer.java:108: non-static method repeatChar(int,int) cannot be referenced from a static context
    [javac]     String str = Marker.repeatChar(ch, n);
    [javac]                        ^
    [javac] Note: /home/shad/mysrc/kawa/gnu/jemacs/buffer/Marker.java uses unchecked or unsafe operations.
    [javac] Note: Recompile with -Xlint:unchecked for details.
    [javac] 2 errors

Shad Gregory <shadgregory>
Wed 27 Apr 2011 07:02:29 PM UTC, comment #3: 

Actually, I mean to make Marker.repeatChar a static method.

Per Bothner <bothner>
Group administrator
Wed 27 Apr 2011 06:56:22 PM UTC, comment #2: 

I did have a problem building SwtBuffer.java. Did you mean to do something like this?

  public void insertChar(int ch, int count, Object style)
  {
    // TODO: Handle styles !
    String str = pointMarker.repeatChar(ch, count);
    bufferContent.replaceTextRange(getDot(), 0, str);
    setDot(getDot() + 1);
  }

The other changes worked fine.

Shad Gregory <shadgregory>
Wed 27 Apr 2011 07:12:30 AM UTC, comment #1: 

Thanks!  I checked in the SwtFrame.java fix.

I think the SwtCharBuffer.java fix is wrong.
I've added an new attachment swt2.patch - could you try it?

The SwtBuffer.java fix is OK, but it doesn't handle characters whose value is >= 0x10000.  I know there are lots of ways such characters won't work, but there is code Marker#insertChar to handle this case using surrogate pairs, so I figured might as well reuse that code.

So please try out the attached patch and let me know how it works.

(file #23311)

Per Bothner <bothner>
Group administrator
Thu 21 Apr 2011 08:39:27 PM UTC, original submission:  

Running the jemacs-swt-classes produces the following error:
jemacs-swt-classes:

    [javac] Compiling 3 source files to /home/shad/mysrc/kawa
    [javac] /home/shad/mysrc/kawa/gnu/jemacs/swt/SwtBuffer.java:112: possible loss of precision
    [javac] found   : int
    [javac] required: char
    [javac]       charr[i] = ch;
    [javac]                  ^
    [javac] /home/shad/mysrc/kawa/gnu/jemacs/swt/SwtCharBuffer.java:81: gapReserve(int) in gnu.jemacs.swt.SwtCharBuffer cannot override gapReserve(int) in gnu.lists.GapVector; overridden method is final
    [javac]   protected void gapReserve(int size)
    [javac]                  ^
    [javac] /home/shad/mysrc/kawa/gnu/jemacs/swt/SwtFrame.java:62: cannot find symbol
    [javac] symbol  : variable MessageDialog
    [javac] location: class gnu.jemacs.swt.SwtFrame
    [javac]     MessageDialog.openInformation(shell, "Information", aboutMessage());
    [javac]     ^
    [javac] /home/shad/mysrc/kawa/gnu/jemacs/swt/SwtFrame.java:116: car has protected access in gnu.lists.Pair
    [javac]           CharSequence menuName = (CharSequence) ((Pair) o).car;
    [javac]                                                            ^
    [javac] /home/shad/mysrc/kawa/gnu/jemacs/swt/SwtFrame.java:119: cdr has protected access in gnu.lists.Pair
    [javac]           setMenuHelper(subMenu, (LList) ((Pair) o).cdr);
    [javac]                                                    ^
    [javac] 5 errors

It looks like the swt code is a victim of bit rot. I have attached a diff that will allow the code to compile successfully.

Shad Gregory <shadgregory>

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach Files:
   
   
Comment:
   

Attached Files
file #23327:  swt3.patch added by bothner (2KiB - text/x-patch)
file #23311:  swt2.patch added by bothner (2KiB - text/x-patch)
file #23285:  swt.diff added by shadgregory (2KiB - text/x-patch)

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by bothner (Updated the item)
  • -email is unavailable- added by shadgregory (Submitted the item)
  •  

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

    Only logged-in users can vote.

     

    Follow 7 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2011-05-01 bothner StatusIn Progress Fixed
        Open/ClosedOpen Closed
    2011-04-30 bothner Attached File- Added swt3.patch, #23327
    2011-04-27 bothner Attached File- Added swt2.patch, #23311
        StatusNone In Progress
        Assigned toNone bothner
    2011-04-21 shadgregory Attached File- Added swt.diff, #23285

    Back to the top

    Powered by Savane 3.13-4b48.
    Corresponding source code