Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[imp-dev] Re: [imp-commit] r20437 - org.eclipse.imp.runtime/trunk/src/org/eclipse/imp/builder


Hi Bob,

The new method is in BuilderBase, which is already abstract.  I did consider making the new method abstract but, as you would expect, that leads to compile errors in all projects with builders of that type.  So I did make the method concrete for the sake of backward compatibility.  Since the method is new, though, no existing (concrete) builders should be referring to it.  I neglected to mention this, but I also adapted our builder template, so all newly generated (or regenerated) builders going forward will have a non-exception-throwing implementation of the method.  I would think this would be pretty safe at both compile and run time, and I haven't seen any problems with builders in my workspaces.  Am I missing something?

Thanks,

Stan

Stan Sutton, Ph. D.
IBM T. J. Watson Research Center
19 Skyline Drive, Hawthorne, NY 10532 USA
telephone:  1-914-784-7316, FAX:  1-914-784-7455, T/L 863
e-mail:  suttons@xxxxxxxxxx, Stan Sutton/Watson/IBM@IBMUS



"Robert M. Fuhrer" <rfuhrer@xxxxxxxxxxxxxx>

10/10/2008 10:56 AM

To
Stan Sutton/Watson/IBM@IBMUS
cc
imp-dev <imp-dev@xxxxxxxxxxx>
Subject
Re: [imp-commit] r20437 - org.eclipse.imp.runtime/trunk/src/org/eclipse/imp/builder





Hi Stan,

I think rather than adding a concrete method that throws an exception,
it would be better to make this an abstract class, even if that seems to
break backward compatibility. As it is, they'll still have to modify  
their
builder class to avoid the run-time exception, and they won't know
until run-time that there's a problem.

Remember, all other things considered equal, compile-time errors
are greatly preferable to run-time errors.

On Oct 9, 2008, at 4:41 PM, genie@xxxxxxxxxxx wrote:
> Author: ssutton
> Date: 2008-10-09 16:41:42 -0400 (Thu, 09 Oct 2008)
> New Revision: 20437
>
> Modified:
>   org.eclipse.imp.runtime/trunk/src/org/eclipse/imp/builder/
> BuilderBase.java
> Log:
> Added a concrete but unimplemented method getBuilderID().  Also  
> changed "field" to "resource" and "resource" to "field" in various  
> places to better match associated types.
>
> Modified: org.eclipse.imp.runtime/trunk/src/org/eclipse/imp/builder/
> BuilderBase.java
> ===================================================================
> --- org.eclipse.imp.runtime/trunk/src/org/eclipse/imp/builder/
> BuilderBase.java                 2008-10-09 20:26:32 UTC (rev 20436)
> +++ org.eclipse.imp.runtime/trunk/src/org/eclipse/imp/builder/
> BuilderBase.java                 2008-10-09 20:41:42 UTC (rev 20437)
> @@ -34,6 +34,7 @@
> import org.eclipse.core.runtime.Path;
> import org.eclipse.imp.runtime.PluginBase;
> import org.eclipse.imp.runtime.RuntimePlugin;
> +import org.eclipse.imp.utils.UnimplementedError;
> import org.eclipse.jface.dialogs.MessageDialog;
> import org.eclipse.swt.widgets.Shell;
> import org.eclipse.ui.PlatformUI;
> @@ -49,9 +50,16 @@
>     protected abstract PluginBase getPlugin();
>
>     /**
> +     * @return the extension ID of this builder
> +     */
> +    public String getBuilderID() {
> +                     throw new UnimplementedError("Not implemented for builder for  
> plug-in " + getPlugin().getID());
> +    }
> +
>
> _______________________________________________
> imp-commit mailing list
> imp-commit@xxxxxxxxxxx
> https://dev.eclipse.org/mailman/listinfo/imp-commit

Cheers,
 - Bob



Back to the top