Menu

#453 Failure of Jalopy Printer

1.5b5
closed
S
5
2005-12-19
2005-11-22
eggic
No

Output from the format pasted below. Will send the source file and
coding conventions file to assignee of the bug.

Formatting Application.java...
[INFO] /Users/etmeek/dev/working/ReST/edu/utk/cs/icl/rest/
installer/Application.java:
Parse
[DEBUG] /Users/etmeek/dev/working/ReST/edu/utk/cs/icl/rest/
installer/Application.java:
parsing took 325
[DEBUG] /Users/etmeek/dev/working/ReST/edu/utk/cs/icl/rest/
installer/Application.java:
transform
[DEBUG] /Users/etmeek/dev/working/ReST/edu/utk/cs/icl/rest/
installer/Application.java:
transforming took 15
[DEBUG] /Users/etmeek/dev/working/ReST/edu/utk/cs/icl/rest/
installer/Application.java:
Created backup -- "/Users/etmeek/.jalopy.15/default/bak/
Application.java~1~"
[DEBUG] /Users/etmeek/dev/working/ReST/edu/utk/cs/icl/rest/
installer/Application.java:
print
/Users/etmeek/dev/working/ReST/edu/utk/cs/icl/rest/installer/
Application.java:0:0: Index: -1, Size: 0
java.lang.IndexOutOfBoundsException: Index: -1, Size: 0
at java.util.LinkedList.entry(LinkedList.java:360)
at java.util.LinkedList.get(LinkedList.java:303)
at de.hunsicker.jalopy.printer.Markers.get(Markers.java:135)
at de.hunsicker.jalopy.printer.Markers.getLast(Markers.java:53)
at de.hunsicker.jalopy.printer.LeftParenthesisPrinter.wrap
(LeftParenthesisPrinter.java:179)
at de.hunsicker.jalopy.printer.LeftParenthesisPrinter.print
(LeftParenthesisPrinter.java:108)
at
de.hunsicker.jalopy.printer.OperatorPrinter.printWithParentheses
(OperatorPrinter.java:545)
at de.hunsicker.jalopy.printer.InfixOperatorPrinter.printImpl
(InfixOperatorPrinter.java:434)
at de.hunsicker.jalopy.printer.InfixOperatorPrinter.print
(InfixOperatorPrinter.java:235)
at de.hunsicker.jalopy.printer.AssignmentOperatorPrinter.print
(AssignmentOperatorPrinter.java:63)
at de.hunsicker.jalopy.printer.ExpressionPrinter.print
(ExpressionPrinter.java:65)
at de.hunsicker.jalopy.printer.BlockPrinter.print(BlockPrinter.java:
433)
at de.hunsicker.jalopy.printer.ForPrinter.print(ForPrinter.java:122)
at de.hunsicker.jalopy.printer.BlockPrinter.print(BlockPrinter.java:
433)
at de.hunsicker.jalopy.printer.TryCatchFinallyPrinter.print
(TryCatchFinallyPrinter.java:73)
at de.hunsicker.jalopy.printer.BlockPrinter.print(BlockPrinter.java:
433)
at de.hunsicker.jalopy.printer.MethodDeclarationPrinter.print
(MethodDeclarationPrinter.java:122)
at de.hunsicker.jalopy.printer.BlockPrinter.print(BlockPrinter.java:
433)
at de.hunsicker.jalopy.printer.ClassDeclarationPrinter.print
(ClassDeclarationPrinter.java:92)
at de.hunsicker.jalopy.printer.JavaPrinter.print(JavaPrinter.java:
113)
at de.hunsicker.jalopy.Jalopy.print(Jalopy.java:2274)
at de.hunsicker.jalopy.Jalopy.format(Jalopy.java:1399)
at de.hunsicker.jalopy.Jalopy.format(Jalopy.java:1056)
at de.hunsicker.jalopy.plugin.AbstractPlugin.format
(AbstractPlugin.java:549)
at de.hunsicker.jalopy.plugin.AbstractPlugin
$ActionWorker.construct(AbstractPlugin.java:901)
at de.hunsicker.swing.util.SwingWorker$2.call(SwingWorker.java:
323)
at de.hunsicker.util.concurrent.FutureResult$1.run
(FutureResult.java:198)
at de.hunsicker.swing.util.SwingWorker.run(SwingWorker.java:
346)
at java.lang.Thread.run(Thread.java:552)
[INFO] /Users/etmeek/dev/working/ReST/edu/utk/cs/icl/rest/
installer/Application.java:
Restored backup "/Users/etmeek/.jalopy.15/default/bak/
Application.java~1~"
Failed.

Discussion

  • eggic

    eggic - 2005-11-23

    Logged In: YES
    user_id=590454

    After playing around with the source code, it turns out that the printer is
    failing when it encounters a class cast of the return from a method inside a
    try method. Here is the exception

    [DEBUG] /Users/etmeek/dev/working/ReST/edu/utk/cs/icl/rest/wizard/
    WizardApplication.java:
    print
    /Users/etmeek/dev/working/ReST/edu/utk/cs/icl/rest/wizard/
    WizardApplication.java:0:0: unexpected TYPE, was "TYPE", <18>, par (, prev (,
    next (, [255:59-255:88], 0,0
    java.lang.RuntimeException: unexpected TYPE, was "TYPE", <18>, par (, prev
    (, next (, [255:59-255:88], 0,0
    at de.hunsicker.jalopy.printer.MethodCallPrinter.print
    (MethodCallPrinter.java:256)

    The lines the exception occurs on are

    java.lang.reflect.Constructor tmpConst = (java.lang.reflect.Constructor)
    tmpObject
    .getConstructor
    (panelParams);

    java.net.JarURLConnection uc = (java.net.JarURLConnection) u
    .openConnection();

    If I comment these lines in their respective files, the printing succeeds.

     
  • S

    S - 2005-11-24

    Logged In: YES
    user_id=723231

    Tested with default conventions and did not see any failure.
    Can you send me your code conventions (and possible full
    source) so I can try it with them ?

    Thanks
    Z

     
  • S

    S - 2005-11-24
    • assigned_to: nobody --> notzippy
     
  • S

    S - 2005-11-25

    Logged In: YES
    user_id=723231

    The operator wasnt adding a marker and the left/right paren
    printers where expecting at least 1. Added a marker before
    printing of parens and removed it after. Changes in cvs

     
  • S

    S - 2005-11-25
    • status: open --> pending
     
  • S

    S - 2005-12-19
    • status: pending --> closed
     

Log in to post a comment.