[prev in list] [next in list] [prev in thread] [next in thread] 

List:       xwt-patches
Subject:    Re: [patches] friendlier error when attempting to redirect to a
From:       Adam Megacz <adam () xwt ! org>
Date:       2004-03-22 11:57:18
Message-ID: m1ad29qee1.fsf () nowhere ! com
[Download RAW message or body]


I'd prefer it if you used instanceof instead of catching an
exception...  could you check it in that way?

  - a

tupshin@xwt.org (Tupshin Harper) writes:
> Context:
>
> [fixed heinous breakage, added backtrace support
> adam@megacz.com**20040317103854] 
> [two Hash font optimization
> tupshin@tupshin.com**20040310011604
>  This patch makes a huge difference in startup performance. 
>  Scenario: A simple app that contains 240 boxes each with text foo.
>  Measurement: time from launch until core stops using 100% CPU
>  normal Font.java: 61 seconds
>  this Font.java: 7 seconds
> ] 
> [fixed bugs 495 and 499
> adam@megacz.com**20040316041449] 
> [TAG RC3
> adam@megacz.com**20040316022807] 
>
> New patches:
>
> [friendlier error when attempting to redirect to a non-box value
> tupshin@tupshin.com**20040319183242] {
> hunk ./src/org/ibex/Box.java 561
> -            for(Box cur = (Box)value; cur != null; cur = cur.parent)
> -                if (cur == redirect) {
> -                    redirect = (Box)value;
> -                    return;
> -                }
> -            JS.error("redirect can only be set to a descendant of its current value");
> +	    try {
> +		for(Box cur = (Box)value; cur != null; cur = cur.parent)
> +		    if (cur == redirect) {
> +			redirect = (Box)value;
> +			return;
> +		    }
> +	    }
> +	    catch (Exception e) {
> +		throw new JSExn("cannot redirect to non Box target " + value + "(" + ")");
> +	    }
> +	    JS.error("redirect can only be set to a descendant of its current value");
> }
>
>
>
>
> _______________________________________________
> patches mailing list
> patches@lists.xwt.org
> http://lists.xwt.org/listinfo/patches
>

-- 
"It's lucky," he added, after a pause, "that there are such a lot of
islands in the world.  I almost envy you, Mr. Watson."

                                                   -- Mustapha Mond

_______________________________________________
patches mailing list
patches@lists.xwt.org
http://lists.xwt.org/listinfo/patches
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic