/** * Test a newly found property */ private boolean testProperty(final ClassDescription current, final Map<String, PropertyDescription> allProperties, final PropertyDescription newProperty, final boolean isInspectedClass ) { final String propName = newProperty.getName(); if ( !StringUtils.isEmpty(propName) ) { if ( allProperties.containsKey(propName) ) { // if the current class is the class we are currently inspecting, we // have found a duplicate definition if ( isInspectedClass ) { iLog.addError("Duplicate definition for property " + propName + " in class " + current.getDescribedClass().getName(), current.getSource() ); } return false; } allProperties.put(propName, newProperty); } else { // no name - generate a unique one allProperties.put(UUID.randomUUID().toString(), newProperty); } return true; }
/** * Test a newly found reference */ private void testReference(final ClassDescription current, final Map<String, ReferenceDescription> allReferences, final ReferenceDescription newReference, final boolean isInspectedClass ) { String refName = newReference.getName(); if ( refName == null) { refName = newReference.getInterfaceName(); } if ( refName != null ) { if ( allReferences.containsKey( refName ) ) { // if the current class is the class we are currently inspecting, we // have found a duplicate definition if ( isInspectedClass ) { iLog.addError("Duplicate definition for reference " + refName + " in class " + current.getDescribedClass().getName(), current.getSource() ); } } else { allReferences.put(refName, newReference); } } else { // no name - generate a unique one allReferences.put(UUID.randomUUID().toString(), newReference); } } }
throw new SCRDescriptorException("Multi value property '" + key + "' has different types: " + found.getType() + " & " + propType, describedClass.getSource()); if ( spec == null ) { throw new SCRDescriptorException("Unknown xmlns attribute value: " + cad.getValue("xmlns"), describedClass.getSource());
if ( org.osgi.framework.Constants.SERVICE_ID.equals(name) ) { iLog.addError("Class " + current.getDescribedClass().getName() + " is declaring " + "the protected property 'service.id'.", current.getSource() ); continue; iLog.addWarning("Property " + pd.getName() + " in class " + current.getDescribedClass().getName() + " is set as private. " + "This is redundant as no metatype will be generated.", current.getSource() );
} else { iLog.addWarning( "Component factory " + componentDesc.getName() + " should not set metatype factory pid.", desc.getSource() ); if ( componentDesc.getLabel() != null && componentDesc.getLabel().trim().length() > 0 ) { iLog.addWarning(" Component " + componentDesc.getName() + " has set a label. However metatype is set to false. This label is ignored.", desc.getSource()); desc.getSource()); "deprecated inheritance feature and inherits from " + current.getDescribedClass().getName() + ". This feature will be removed in future versions.", desc.getSource()); } catch ( final SCRDescriptorFailureException sde) { this.logger.debug(sde.getMessage(), sde); iLog.addError(sde.getMessage(), current.getSource()); } catch ( final SCRDescriptorException sde) { this.logger.debug(sde.getSourceLocation() + " : " + sde.getMessage(), sde); iLog.addError("Component " + container + " requires spec version " + container.getComponentDescription().getSpecVersion().name() + " but component is configured to use version " + intitialComponentSpecVersion.name(), desc.getSource());
final List<ComponentContainer> processedContainers = new ArrayList<ComponentContainer>(); for (final ClassDescription desc : scannedDescriptions) { this.logger.debug("Processing component class " + desc.getSource()); result.addProcessedSourceFile(desc.getSource()); iLog.addError("Class has more than one component definition." + " Check the annotations and merge the definitions to a single definition.", desc.getSource()); } else { final ComponentContainer container = this.createComponent(desc, iLog); desc.getSource()); } else { specVersion = container.getComponentDescription().getSpecVersion();