Trail:

Changeset 60

Show
Ignore:
Timestamp:
06/17/09 14:25:24 (3 years ago)
Author:
harald
Message:

--

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/src/org/fluffnstuff/asdoclet/generator/AsGenerator.java

    r56 r60  
    142142                type = resolveTypeArguments(classType, methodType, type); 
    143143 
    144                 method.addParam(name, type.getName()); 
     144                if (unit != null) method.addParam(name, type.getName()); 
    145145                if (proxyUnit != null) proxyMethod.addParam(name, type.getName()); 
    146146 
     
    193193                returnType = resolveTypeArguments(classType, methodType, returnType); 
    194194 
    195                 method = type.newMethod(methodName, getVisibility(modifier), returnType.getName()); 
     195                if (unit != null) { 
     196                        method = type.newMethod(methodName, getVisibility(modifier), returnType.getName()); 
     197                } 
    196198 
    197199                if (proxyUnit != null) { 
     
    264266                        } 
    265267                } 
     268 
     269                proxyMethod = null; 
     270                method = null; 
    266271        } 
    267272 
    268273        public void endProxy() { 
    269                 proxyImports.addAll(imports); 
    270274                for (String imp : proxyImports) proxyUnit.getPackage().addImport(imp); 
    271275                proxyImports = null; 
     
    292296 
    293297        public void setMethodDescription(String description) { 
    294                 if (!StringUtils.isEmpty(description)) method.setDescription(description.trim()); 
     298                if (unit != null && !StringUtils.isEmpty(description)) method.setDescription(description.trim()); 
    295299        } 
    296300 
     
    315319 
    316320        private void end() { 
    317                 if (unit != null) for (String imp : imports) { 
    318                         unit.getPackage().addImport(imp); 
    319                 } 
     321                for (String imp : imports) unit.getPackage().addImport(imp); 
     322 
     323                type = null; 
     324                unit = null; 
     325                imports = null; 
    320326        } 
    321327 
     
    378384        private void addImport(String name) { 
    379385                if (name.indexOf('.') > -1) { 
    380                         imports.add(name); 
    381                         if (proxyImports != null) proxyImports.add(name); 
     386                        if (unit != null) imports.add(name); 
     387                        if (proxyUnit != null) proxyImports.add(name); 
    382388                } 
    383389        }