Re: Incorporating VPP code into cgen

From: Mike Kienenberger (mkienen..laska.net)
Date: Mon May 23 2005 - 21:06:46 EDT

  • Next message: Erik Hatcher: "Re: Incorporating VPP code into cgen"

    Erik Hatcher <eri..hatchersolutions.com> wrote:
    >
    > On May 23, 2005, at 6:13 PM, Mike Kienenberger wrote:
    > > Having this method in tools.CayenneGenerator ant task causes a runtime
    > > dependency on VPP.
    > > I'm not sure why. I'll try to figure it out tomorrow.
    > > Commenting out
    > > just this code makes the v1.1 cgen task work without VPP in the
    > > classpath.
    > > Maybe I need to use a different ant nested parameter method. (I
    > > just copied
    > > this one from the VppCopy task).
    > >
    > > public void addConfiguredConfig(VPPConfig vppConfig) {
    > > this.vppConfig = vppConfig;
    > > }
    >
    > Simply importing something, even if its not used, still requires the
    > dependency be available at run-time.

    I'm no expert on this, so all I can point to is the emperical behavior:
    Neither importing nor declaring an instance variable introduces a run-time
    dependency. Having unexecuted code that references the instance variable
    also doesn't introduce the dependency.

    Doing something like this:

            if (false ==
    ClassGenerator.VERSION_1_1.equals(generator.getVersionString()))
            {
                initializeVppConfig();
                generator.setVppConfig(vppConfig);
            }

    also does not introduce a run-time dependency, at least not for Sun Java
    1.4.2.

    Having the following method does introduce a dependency.

        public void addConfiguredConfig(VPPConfig vppConfig) {
            this.vppConfig = vppConfig; // commenting out just this line is
    also insufficient.
        }

    Doing the following works, but I suspect it breaks Ant.

      public void addConfiguredConfig(Object vppConfig) {
          this.vppConfig = (VPPConfig)vppConfig;
      }

    -Mike



    This archive was generated by hypermail 2.0.0 : Mon May 23 2005 - 21:04:36 EDT