You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@felix.apache.org by mc...@apache.org on 2012/06/15 15:28:02 UTC
svn commit: r1350613 [1/14] - in
/felix/trunk/bundleplugin/src/main/java/aQute: bnd/annotation/
bnd/annotation/component/ bnd/annotation/metatype/ bnd/build/
bnd/compatibility/ bnd/component/ bnd/differ/ bnd/help/ bnd/make/
bnd/make/calltree/ bnd/make/...
Author: mcculls
Date: Fri Jun 15 13:27:53 2012
New Revision: 1350613
URL: http://svn.apache.org/viewvc?rev=1350613&view=rev
Log:
Latest bnd code
Added:
felix/trunk/bundleplugin/src/main/java/aQute/bnd/build/ProjectMessages.java (with props)
felix/trunk/bundleplugin/src/main/java/aQute/bnd/differ/RepositoryElement.java (with props)
felix/trunk/bundleplugin/src/main/java/aQute/lib/converter/TypeReference.java (with props)
felix/trunk/bundleplugin/src/main/java/aQute/lib/getopt/CommandLineMessages.java (with props)
felix/trunk/bundleplugin/src/main/java/aQute/lib/osgi/AnalyzerMessages.java (with props)
felix/trunk/bundleplugin/src/main/java/aQute/libg/reporter/Message.java (with props)
felix/trunk/bundleplugin/src/main/java/aQute/libg/reporter/Messages.java (with props)
felix/trunk/bundleplugin/src/main/java/aQute/libg/reporter/ReporterMessages.java (with props)
Modified:
felix/trunk/bundleplugin/src/main/java/aQute/bnd/annotation/ConsumerType.java
felix/trunk/bundleplugin/src/main/java/aQute/bnd/annotation/Export.java
felix/trunk/bundleplugin/src/main/java/aQute/bnd/annotation/ProviderType.java
felix/trunk/bundleplugin/src/main/java/aQute/bnd/annotation/UsePolicy.java
felix/trunk/bundleplugin/src/main/java/aQute/bnd/annotation/Version.java
felix/trunk/bundleplugin/src/main/java/aQute/bnd/annotation/component/Activate.java
felix/trunk/bundleplugin/src/main/java/aQute/bnd/annotation/component/Component.java
felix/trunk/bundleplugin/src/main/java/aQute/bnd/annotation/component/ConfigurationPolicy.java
felix/trunk/bundleplugin/src/main/java/aQute/bnd/annotation/component/Deactivate.java
felix/trunk/bundleplugin/src/main/java/aQute/bnd/annotation/component/Modified.java
felix/trunk/bundleplugin/src/main/java/aQute/bnd/annotation/component/Reference.java
felix/trunk/bundleplugin/src/main/java/aQute/bnd/annotation/metatype/Configurable.java
felix/trunk/bundleplugin/src/main/java/aQute/bnd/annotation/metatype/Meta.java
felix/trunk/bundleplugin/src/main/java/aQute/bnd/build/CircularDependencyException.java
felix/trunk/bundleplugin/src/main/java/aQute/bnd/build/Container.java
felix/trunk/bundleplugin/src/main/java/aQute/bnd/build/Project.java
felix/trunk/bundleplugin/src/main/java/aQute/bnd/build/ProjectBuilder.java
felix/trunk/bundleplugin/src/main/java/aQute/bnd/build/ProjectLauncher.java
felix/trunk/bundleplugin/src/main/java/aQute/bnd/build/ProjectTester.java
felix/trunk/bundleplugin/src/main/java/aQute/bnd/build/ReflectAction.java
felix/trunk/bundleplugin/src/main/java/aQute/bnd/build/ScriptAction.java
felix/trunk/bundleplugin/src/main/java/aQute/bnd/build/Workspace.java
felix/trunk/bundleplugin/src/main/java/aQute/bnd/compatibility/GenericParameter.java
felix/trunk/bundleplugin/src/main/java/aQute/bnd/compatibility/GenericType.java
felix/trunk/bundleplugin/src/main/java/aQute/bnd/compatibility/Kind.java
felix/trunk/bundleplugin/src/main/java/aQute/bnd/compatibility/ParseSignatureBuilder.java
felix/trunk/bundleplugin/src/main/java/aQute/bnd/compatibility/RuntimeSignatureBuilder.java
felix/trunk/bundleplugin/src/main/java/aQute/bnd/compatibility/Scope.java
felix/trunk/bundleplugin/src/main/java/aQute/bnd/compatibility/SignatureGenerator.java
felix/trunk/bundleplugin/src/main/java/aQute/bnd/compatibility/Signatures.java
felix/trunk/bundleplugin/src/main/java/aQute/bnd/component/AnnotationReader.java
felix/trunk/bundleplugin/src/main/java/aQute/bnd/component/ComponentDef.java
felix/trunk/bundleplugin/src/main/java/aQute/bnd/component/DSAnnotations.java
felix/trunk/bundleplugin/src/main/java/aQute/bnd/component/ReferenceDef.java
felix/trunk/bundleplugin/src/main/java/aQute/bnd/differ/Baseline.java
felix/trunk/bundleplugin/src/main/java/aQute/bnd/differ/DiffImpl.java
felix/trunk/bundleplugin/src/main/java/aQute/bnd/differ/DiffPluginImpl.java
felix/trunk/bundleplugin/src/main/java/aQute/bnd/differ/Element.java
felix/trunk/bundleplugin/src/main/java/aQute/bnd/differ/JavaElement.java
felix/trunk/bundleplugin/src/main/java/aQute/bnd/help/Syntax.java
felix/trunk/bundleplugin/src/main/java/aQute/bnd/make/Make.java
felix/trunk/bundleplugin/src/main/java/aQute/bnd/make/MakeBnd.java
felix/trunk/bundleplugin/src/main/java/aQute/bnd/make/MakeCopy.java
felix/trunk/bundleplugin/src/main/java/aQute/bnd/make/calltree/CalltreeResource.java
felix/trunk/bundleplugin/src/main/java/aQute/bnd/make/component/ComponentAnnotationReader.java
felix/trunk/bundleplugin/src/main/java/aQute/bnd/make/component/ServiceComponent.java
felix/trunk/bundleplugin/src/main/java/aQute/bnd/make/coverage/Coverage.java
felix/trunk/bundleplugin/src/main/java/aQute/bnd/make/coverage/CoverageResource.java
felix/trunk/bundleplugin/src/main/java/aQute/bnd/make/metatype/MetaTypeReader.java
felix/trunk/bundleplugin/src/main/java/aQute/bnd/make/metatype/MetatypePlugin.java
felix/trunk/bundleplugin/src/main/java/aQute/bnd/maven/BsnToMavenPath.java
felix/trunk/bundleplugin/src/main/java/aQute/bnd/maven/MavenCommand.java
felix/trunk/bundleplugin/src/main/java/aQute/bnd/maven/MavenDependencyGraph.java
felix/trunk/bundleplugin/src/main/java/aQute/bnd/maven/MavenDeploy.java
felix/trunk/bundleplugin/src/main/java/aQute/bnd/maven/MavenDeployCmd.java
felix/trunk/bundleplugin/src/main/java/aQute/bnd/maven/MavenGroup.java
felix/trunk/bundleplugin/src/main/java/aQute/bnd/maven/MavenRepository.java
felix/trunk/bundleplugin/src/main/java/aQute/bnd/maven/PomFromManifest.java
felix/trunk/bundleplugin/src/main/java/aQute/bnd/maven/PomParser.java
felix/trunk/bundleplugin/src/main/java/aQute/bnd/maven/PomResource.java
felix/trunk/bundleplugin/src/main/java/aQute/bnd/maven/support/CachedPom.java
felix/trunk/bundleplugin/src/main/java/aQute/bnd/maven/support/Maven.java
felix/trunk/bundleplugin/src/main/java/aQute/bnd/maven/support/MavenEntry.java
felix/trunk/bundleplugin/src/main/java/aQute/bnd/maven/support/MavenRemoteRepository.java
felix/trunk/bundleplugin/src/main/java/aQute/bnd/maven/support/Pom.java
felix/trunk/bundleplugin/src/main/java/aQute/bnd/maven/support/ProjectPom.java
felix/trunk/bundleplugin/src/main/java/aQute/bnd/repo/eclipse/EclipseRepo.java
felix/trunk/bundleplugin/src/main/java/aQute/bnd/service/AnalyzerPlugin.java
felix/trunk/bundleplugin/src/main/java/aQute/bnd/service/BndListener.java
felix/trunk/bundleplugin/src/main/java/aQute/bnd/service/CommandPlugin.java
felix/trunk/bundleplugin/src/main/java/aQute/bnd/service/Compiler.java
felix/trunk/bundleplugin/src/main/java/aQute/bnd/service/DependencyContributor.java
felix/trunk/bundleplugin/src/main/java/aQute/bnd/service/Deploy.java
felix/trunk/bundleplugin/src/main/java/aQute/bnd/service/EclipseJUnitTester.java
felix/trunk/bundleplugin/src/main/java/aQute/bnd/service/IndexProvider.java
felix/trunk/bundleplugin/src/main/java/aQute/bnd/service/MakePlugin.java
felix/trunk/bundleplugin/src/main/java/aQute/bnd/service/Plugin.java
felix/trunk/bundleplugin/src/main/java/aQute/bnd/service/Refreshable.java
felix/trunk/bundleplugin/src/main/java/aQute/bnd/service/Registry.java
felix/trunk/bundleplugin/src/main/java/aQute/bnd/service/RegistryPlugin.java
felix/trunk/bundleplugin/src/main/java/aQute/bnd/service/RemoteRepositoryPlugin.java
felix/trunk/bundleplugin/src/main/java/aQute/bnd/service/RepositoryListenerPlugin.java
felix/trunk/bundleplugin/src/main/java/aQute/bnd/service/RepositoryPlugin.java
felix/trunk/bundleplugin/src/main/java/aQute/bnd/service/ResourceHandle.java
felix/trunk/bundleplugin/src/main/java/aQute/bnd/service/Scripter.java
felix/trunk/bundleplugin/src/main/java/aQute/bnd/service/SignerPlugin.java
felix/trunk/bundleplugin/src/main/java/aQute/bnd/service/action/Action.java
felix/trunk/bundleplugin/src/main/java/aQute/bnd/service/action/NamedAction.java
felix/trunk/bundleplugin/src/main/java/aQute/bnd/service/diff/Delta.java
felix/trunk/bundleplugin/src/main/java/aQute/bnd/service/diff/Diff.java
felix/trunk/bundleplugin/src/main/java/aQute/bnd/service/diff/Differ.java
felix/trunk/bundleplugin/src/main/java/aQute/bnd/service/diff/Tree.java
felix/trunk/bundleplugin/src/main/java/aQute/bnd/service/diff/Type.java
felix/trunk/bundleplugin/src/main/java/aQute/bnd/service/packageinfo
felix/trunk/bundleplugin/src/main/java/aQute/bnd/service/url/TaggedData.java
felix/trunk/bundleplugin/src/main/java/aQute/bnd/service/url/URLConnector.java
felix/trunk/bundleplugin/src/main/java/aQute/bnd/settings/Settings.java
felix/trunk/bundleplugin/src/main/java/aQute/bnd/signing/JartoolSigner.java
felix/trunk/bundleplugin/src/main/java/aQute/bnd/signing/Signer.java
felix/trunk/bundleplugin/src/main/java/aQute/configurable/Config.java
felix/trunk/bundleplugin/src/main/java/aQute/configurable/Configurable.java
felix/trunk/bundleplugin/src/main/java/aQute/lib/base64/Base64.java
felix/trunk/bundleplugin/src/main/java/aQute/lib/codec/Codec.java
felix/trunk/bundleplugin/src/main/java/aQute/lib/codec/HCodec.java
felix/trunk/bundleplugin/src/main/java/aQute/lib/collections/EnumerationIterator.java
felix/trunk/bundleplugin/src/main/java/aQute/lib/collections/ExtList.java
felix/trunk/bundleplugin/src/main/java/aQute/lib/collections/IteratorList.java
felix/trunk/bundleplugin/src/main/java/aQute/lib/collections/LineCollection.java
felix/trunk/bundleplugin/src/main/java/aQute/lib/collections/Logic.java
felix/trunk/bundleplugin/src/main/java/aQute/lib/collections/MultiMap.java
felix/trunk/bundleplugin/src/main/java/aQute/lib/collections/SortedList.java
felix/trunk/bundleplugin/src/main/java/aQute/lib/converter/Converter.java
felix/trunk/bundleplugin/src/main/java/aQute/lib/data/AllowNull.java
felix/trunk/bundleplugin/src/main/java/aQute/lib/data/Data.java
felix/trunk/bundleplugin/src/main/java/aQute/lib/data/Numeric.java
felix/trunk/bundleplugin/src/main/java/aQute/lib/data/Validator.java
felix/trunk/bundleplugin/src/main/java/aQute/lib/deployer/FileInstallRepo.java
felix/trunk/bundleplugin/src/main/java/aQute/lib/deployer/FileRepo.java
felix/trunk/bundleplugin/src/main/java/aQute/lib/filter/Filter.java
felix/trunk/bundleplugin/src/main/java/aQute/lib/getopt/CommandLine.java
felix/trunk/bundleplugin/src/main/java/aQute/lib/getopt/Options.java
felix/trunk/bundleplugin/src/main/java/aQute/lib/hex/Hex.java
felix/trunk/bundleplugin/src/main/java/aQute/lib/index/Index.java
felix/trunk/bundleplugin/src/main/java/aQute/lib/io/IO.java
felix/trunk/bundleplugin/src/main/java/aQute/lib/io/LimitedInputStream.java
felix/trunk/bundleplugin/src/main/java/aQute/lib/json/ArrayHandler.java
felix/trunk/bundleplugin/src/main/java/aQute/lib/json/BooleanHandler.java
felix/trunk/bundleplugin/src/main/java/aQute/lib/json/ByteArrayHandler.java
felix/trunk/bundleplugin/src/main/java/aQute/lib/json/CharacterHandler.java
felix/trunk/bundleplugin/src/main/java/aQute/lib/json/CollectionHandler.java
felix/trunk/bundleplugin/src/main/java/aQute/lib/json/DateHandler.java
felix/trunk/bundleplugin/src/main/java/aQute/lib/json/Decoder.java
felix/trunk/bundleplugin/src/main/java/aQute/lib/json/Encoder.java
felix/trunk/bundleplugin/src/main/java/aQute/lib/json/EnumHandler.java
felix/trunk/bundleplugin/src/main/java/aQute/lib/json/FileHandler.java
felix/trunk/bundleplugin/src/main/java/aQute/lib/json/Handler.java
felix/trunk/bundleplugin/src/main/java/aQute/lib/json/JSONCodec.java
felix/trunk/bundleplugin/src/main/java/aQute/lib/json/MapHandler.java
felix/trunk/bundleplugin/src/main/java/aQute/lib/json/NumberHandler.java
felix/trunk/bundleplugin/src/main/java/aQute/lib/json/ObjectHandler.java
felix/trunk/bundleplugin/src/main/java/aQute/lib/json/SpecialHandler.java
felix/trunk/bundleplugin/src/main/java/aQute/lib/json/StringHandler.java
felix/trunk/bundleplugin/src/main/java/aQute/lib/justif/Justif.java
felix/trunk/bundleplugin/src/main/java/aQute/lib/osgi/About.java
felix/trunk/bundleplugin/src/main/java/aQute/lib/osgi/AbstractResource.java
felix/trunk/bundleplugin/src/main/java/aQute/lib/osgi/Analyzer.java
felix/trunk/bundleplugin/src/main/java/aQute/lib/osgi/Annotation.java
felix/trunk/bundleplugin/src/main/java/aQute/lib/osgi/Builder.java
felix/trunk/bundleplugin/src/main/java/aQute/lib/osgi/BundleId.java
felix/trunk/bundleplugin/src/main/java/aQute/lib/osgi/ClassDataCollector.java
felix/trunk/bundleplugin/src/main/java/aQute/lib/osgi/Clazz.java
felix/trunk/bundleplugin/src/main/java/aQute/lib/osgi/CombinedResource.java
felix/trunk/bundleplugin/src/main/java/aQute/lib/osgi/CommandResource.java
felix/trunk/bundleplugin/src/main/java/aQute/lib/osgi/Constants.java
felix/trunk/bundleplugin/src/main/java/aQute/lib/osgi/Descriptors.java
felix/trunk/bundleplugin/src/main/java/aQute/lib/osgi/Domain.java
felix/trunk/bundleplugin/src/main/java/aQute/lib/osgi/EmbeddedResource.java
felix/trunk/bundleplugin/src/main/java/aQute/lib/osgi/FileResource.java
felix/trunk/bundleplugin/src/main/java/aQute/lib/osgi/Instruction.java
felix/trunk/bundleplugin/src/main/java/aQute/lib/osgi/Instructions.java
felix/trunk/bundleplugin/src/main/java/aQute/lib/osgi/Jar.java
felix/trunk/bundleplugin/src/main/java/aQute/lib/osgi/JarResource.java
felix/trunk/bundleplugin/src/main/java/aQute/lib/osgi/Macro.java
felix/trunk/bundleplugin/src/main/java/aQute/lib/osgi/OpCodes.java
felix/trunk/bundleplugin/src/main/java/aQute/lib/osgi/Packages.java
felix/trunk/bundleplugin/src/main/java/aQute/lib/osgi/PreprocessResource.java
felix/trunk/bundleplugin/src/main/java/aQute/lib/osgi/Processor.java
felix/trunk/bundleplugin/src/main/java/aQute/lib/osgi/Resource.java
felix/trunk/bundleplugin/src/main/java/aQute/lib/osgi/TagResource.java
felix/trunk/bundleplugin/src/main/java/aQute/lib/osgi/URLResource.java
felix/trunk/bundleplugin/src/main/java/aQute/lib/osgi/Verifier.java
felix/trunk/bundleplugin/src/main/java/aQute/lib/osgi/WriteResource.java
felix/trunk/bundleplugin/src/main/java/aQute/lib/osgi/ZipResource.java
felix/trunk/bundleplugin/src/main/java/aQute/lib/osgi/eclipse/EclipseClasspath.java
felix/trunk/bundleplugin/src/main/java/aQute/lib/putjar/DirectoryInputStream.java
felix/trunk/bundleplugin/src/main/java/aQute/lib/spring/JPAComponent.java
felix/trunk/bundleplugin/src/main/java/aQute/lib/spring/SpringComponent.java
felix/trunk/bundleplugin/src/main/java/aQute/lib/spring/SpringXMLType.java
felix/trunk/bundleplugin/src/main/java/aQute/lib/spring/XMLType.java
felix/trunk/bundleplugin/src/main/java/aQute/lib/spring/XMLTypeProcessor.java
felix/trunk/bundleplugin/src/main/java/aQute/lib/tag/Tag.java
felix/trunk/bundleplugin/src/main/java/aQute/libg/asn1/BER.java
felix/trunk/bundleplugin/src/main/java/aQute/libg/asn1/PDU.java
felix/trunk/bundleplugin/src/main/java/aQute/libg/asn1/Types.java
felix/trunk/bundleplugin/src/main/java/aQute/libg/cafs/CAFS.java
felix/trunk/bundleplugin/src/main/java/aQute/libg/classdump/ClassDumper.java
felix/trunk/bundleplugin/src/main/java/aQute/libg/classloaders/URLClassLoaderWrapper.java
felix/trunk/bundleplugin/src/main/java/aQute/libg/clauses/Clauses.java
felix/trunk/bundleplugin/src/main/java/aQute/libg/clauses/Selector.java
felix/trunk/bundleplugin/src/main/java/aQute/libg/command/Command.java
felix/trunk/bundleplugin/src/main/java/aQute/libg/cryptography/Crypto.java
felix/trunk/bundleplugin/src/main/java/aQute/libg/cryptography/Digest.java
felix/trunk/bundleplugin/src/main/java/aQute/libg/cryptography/Digester.java
felix/trunk/bundleplugin/src/main/java/aQute/libg/cryptography/Key.java
felix/trunk/bundleplugin/src/main/java/aQute/libg/cryptography/MD5.java
felix/trunk/bundleplugin/src/main/java/aQute/libg/cryptography/RSA.java
felix/trunk/bundleplugin/src/main/java/aQute/libg/cryptography/SHA1.java
felix/trunk/bundleplugin/src/main/java/aQute/libg/cryptography/SHA256.java
felix/trunk/bundleplugin/src/main/java/aQute/libg/cryptography/Signer.java
felix/trunk/bundleplugin/src/main/java/aQute/libg/cryptography/Verifier.java
felix/trunk/bundleplugin/src/main/java/aQute/libg/fileiterator/FileIterator.java
felix/trunk/bundleplugin/src/main/java/aQute/libg/filelock/DirectoryLock.java
felix/trunk/bundleplugin/src/main/java/aQute/libg/filerepo/FileRepo.java
felix/trunk/bundleplugin/src/main/java/aQute/libg/forker/Forker.java
felix/trunk/bundleplugin/src/main/java/aQute/libg/generics/Create.java
felix/trunk/bundleplugin/src/main/java/aQute/libg/glob/Glob.java
felix/trunk/bundleplugin/src/main/java/aQute/libg/gzip/GZipUtils.java
felix/trunk/bundleplugin/src/main/java/aQute/libg/header/Attrs.java
felix/trunk/bundleplugin/src/main/java/aQute/libg/header/OSGiHeader.java
felix/trunk/bundleplugin/src/main/java/aQute/libg/header/Parameters.java
felix/trunk/bundleplugin/src/main/java/aQute/libg/log/Logger.java
felix/trunk/bundleplugin/src/main/java/aQute/libg/map/MAP.java
felix/trunk/bundleplugin/src/main/java/aQute/libg/qtokens/QuotedTokenizer.java
felix/trunk/bundleplugin/src/main/java/aQute/libg/reporter/Reporter.java
felix/trunk/bundleplugin/src/main/java/aQute/libg/reporter/ReporterAdapter.java
felix/trunk/bundleplugin/src/main/java/aQute/libg/sax/ContentFilter.java
felix/trunk/bundleplugin/src/main/java/aQute/libg/sax/ContentFilterImpl.java
felix/trunk/bundleplugin/src/main/java/aQute/libg/sax/SAXElement.java
felix/trunk/bundleplugin/src/main/java/aQute/libg/sax/SAXUtil.java
felix/trunk/bundleplugin/src/main/java/aQute/libg/sax/filters/ElementSelectionFilter.java
felix/trunk/bundleplugin/src/main/java/aQute/libg/sax/filters/MergeContentFilter.java
felix/trunk/bundleplugin/src/main/java/aQute/libg/sed/Replacer.java
felix/trunk/bundleplugin/src/main/java/aQute/libg/sed/Sed.java
felix/trunk/bundleplugin/src/main/java/aQute/libg/tarjan/Tarjan.java
felix/trunk/bundleplugin/src/main/java/aQute/libg/tuple/Pair.java
felix/trunk/bundleplugin/src/main/java/aQute/libg/version/Version.java
felix/trunk/bundleplugin/src/main/java/aQute/libg/version/VersionRange.java
felix/trunk/bundleplugin/src/main/java/aQute/libg/xslt/Transform.java
Modified: felix/trunk/bundleplugin/src/main/java/aQute/bnd/annotation/ConsumerType.java
URL: http://svn.apache.org/viewvc/felix/trunk/bundleplugin/src/main/java/aQute/bnd/annotation/ConsumerType.java?rev=1350613&r1=1350612&r2=1350613&view=diff
==============================================================================
--- felix/trunk/bundleplugin/src/main/java/aQute/bnd/annotation/ConsumerType.java (original)
+++ felix/trunk/bundleplugin/src/main/java/aQute/bnd/annotation/ConsumerType.java Fri Jun 15 13:27:53 2012
@@ -7,8 +7,9 @@ import java.lang.annotation.*;
* that package will not change this interface in a minor update. Any backward
* compatible change to this interface requires a major update of the version of
* this package.
- *
*/
-@Retention(RetentionPolicy.CLASS) @Target(ElementType.TYPE) public @interface ConsumerType {
+@Retention(RetentionPolicy.CLASS)
+@Target(ElementType.TYPE)
+public @interface ConsumerType {
}
Modified: felix/trunk/bundleplugin/src/main/java/aQute/bnd/annotation/Export.java
URL: http://svn.apache.org/viewvc/felix/trunk/bundleplugin/src/main/java/aQute/bnd/annotation/Export.java?rev=1350613&r1=1350612&r2=1350613&view=diff
==============================================================================
--- felix/trunk/bundleplugin/src/main/java/aQute/bnd/annotation/Export.java (original)
+++ felix/trunk/bundleplugin/src/main/java/aQute/bnd/annotation/Export.java Fri Jun 15 13:27:53 2012
@@ -5,26 +5,26 @@ import java.lang.annotation.*;
@Retention(RetentionPolicy.CLASS)
@Target(ElementType.PACKAGE)
public @interface Export {
- String MANDATORY = "mandatory";
- String OPTIONAL = "optional";
- String USES = "uses";
- String EXCLUDE = "exclude";
- String INCLUDE = "include";
-
- String[] mandatory() default "";
-
- String[] optional() default "";
-
- Class<?>[] exclude() default Object.class;
-
- Class<?>[] include() default Object.class;
-
- /**
- * Use {@link @Version} annotation instead
- * @return
- */
- @Deprecated()
- String version() default "";
-
-
+ String MANDATORY = "mandatory";
+ String OPTIONAL = "optional";
+ String USES = "uses";
+ String EXCLUDE = "exclude";
+ String INCLUDE = "include";
+
+ String[] mandatory() default "";
+
+ String[] optional() default "";
+
+ Class< ? >[] exclude() default Object.class;
+
+ Class< ? >[] include() default Object.class;
+
+ /**
+ * Use {@link @Version} annotation instead
+ *
+ * @return
+ */
+ @Deprecated()
+ String version() default "";
+
}
Modified: felix/trunk/bundleplugin/src/main/java/aQute/bnd/annotation/ProviderType.java
URL: http://svn.apache.org/viewvc/felix/trunk/bundleplugin/src/main/java/aQute/bnd/annotation/ProviderType.java?rev=1350613&r1=1350612&r2=1350613&view=diff
==============================================================================
--- felix/trunk/bundleplugin/src/main/java/aQute/bnd/annotation/ProviderType.java (original)
+++ felix/trunk/bundleplugin/src/main/java/aQute/bnd/annotation/ProviderType.java Fri Jun 15 13:27:53 2012
@@ -3,14 +3,10 @@ package aQute.bnd.annotation;
import java.lang.annotation.*;
/**
- * This type is provided for convenience because it is the default. A change
- * in a provider type (that is all except Consumer types) can be changed with
- * only a minor update to the package API version number.
- *
- * This interface is similar to the Eclipse @noextend and @noimplement annotations.
- *
- *
- *
+ * This type is provided for convenience because it is the default. A change in
+ * a provider type (that is all except Consumer types) can be changed with only
+ * a minor update to the package API version number. This interface is similar
+ * to the Eclipse @noextend and @noimplement annotations.
*/
@Retention(RetentionPolicy.CLASS)
@Target(ElementType.TYPE)
Modified: felix/trunk/bundleplugin/src/main/java/aQute/bnd/annotation/UsePolicy.java
URL: http://svn.apache.org/viewvc/felix/trunk/bundleplugin/src/main/java/aQute/bnd/annotation/UsePolicy.java?rev=1350613&r1=1350612&r2=1350613&view=diff
==============================================================================
--- felix/trunk/bundleplugin/src/main/java/aQute/bnd/annotation/UsePolicy.java (original)
+++ felix/trunk/bundleplugin/src/main/java/aQute/bnd/annotation/UsePolicy.java Fri Jun 15 13:27:53 2012
@@ -7,14 +7,14 @@ import java.lang.annotation.*;
* treated as a use policy, not an implementation policy. Many package have
* interfaces that are very stable and can be maintained backward compatible for
* implementers during minor changes. For example, in Event Admin, the
- * EventAdmin implementers should follow the minor version, e.g. [1.1,1.2), however,
- * an implementer of EventHandler should not require such a small range. Therefore
- * an interface like EventHandler should use this anotation.
+ * EventAdmin implementers should follow the minor version, e.g. [1.1,1.2),
+ * however, an implementer of EventHandler should not require such a small
+ * range. Therefore an interface like EventHandler should use this anotation.
*/
@Retention(RetentionPolicy.CLASS)
@Target(ElementType.TYPE)
@Deprecated
public @interface UsePolicy {
- String RNAME = "LaQute/bnd/annotation/UsePolicy;";
+ String RNAME = "LaQute/bnd/annotation/UsePolicy;";
}
Modified: felix/trunk/bundleplugin/src/main/java/aQute/bnd/annotation/Version.java
URL: http://svn.apache.org/viewvc/felix/trunk/bundleplugin/src/main/java/aQute/bnd/annotation/Version.java?rev=1350613&r1=1350612&r2=1350613&view=diff
==============================================================================
--- felix/trunk/bundleplugin/src/main/java/aQute/bnd/annotation/Version.java (original)
+++ felix/trunk/bundleplugin/src/main/java/aQute/bnd/annotation/Version.java Fri Jun 15 13:27:53 2012
@@ -3,7 +3,9 @@ package aQute.bnd.annotation;
import java.lang.annotation.*;
@Retention(RetentionPolicy.CLASS)
-@Target({ElementType.PACKAGE})
+@Target({
+ ElementType.PACKAGE
+})
public @interface Version {
String value();
}
Modified: felix/trunk/bundleplugin/src/main/java/aQute/bnd/annotation/component/Activate.java
URL: http://svn.apache.org/viewvc/felix/trunk/bundleplugin/src/main/java/aQute/bnd/annotation/component/Activate.java?rev=1350613&r1=1350612&r2=1350613&view=diff
==============================================================================
--- felix/trunk/bundleplugin/src/main/java/aQute/bnd/annotation/component/Activate.java (original)
+++ felix/trunk/bundleplugin/src/main/java/aQute/bnd/annotation/component/Activate.java Fri Jun 15 13:27:53 2012
@@ -5,6 +5,6 @@ import java.lang.annotation.*;
@Retention(RetentionPolicy.CLASS)
@Target(ElementType.METHOD)
public @interface Activate {
- String RNAME = "LaQute/bnd/annotation/component/Activate;";
-
+ String RNAME = "LaQute/bnd/annotation/component/Activate;";
+
}
Modified: felix/trunk/bundleplugin/src/main/java/aQute/bnd/annotation/component/Component.java
URL: http://svn.apache.org/viewvc/felix/trunk/bundleplugin/src/main/java/aQute/bnd/annotation/component/Component.java?rev=1350613&r1=1350612&r2=1350613&view=diff
==============================================================================
--- felix/trunk/bundleplugin/src/main/java/aQute/bnd/annotation/component/Component.java (original)
+++ felix/trunk/bundleplugin/src/main/java/aQute/bnd/annotation/component/Component.java Fri Jun 15 13:27:53 2012
@@ -2,7 +2,9 @@ package aQute.bnd.annotation.component;
import java.lang.annotation.*;
-@Retention(RetentionPolicy.CLASS) @Target(ElementType.TYPE) public @interface Component {
+@Retention(RetentionPolicy.CLASS)
+@Target(ElementType.TYPE)
+public @interface Component {
String RNAME = "LaQute/bnd/annotation/component/Component;";
String PROVIDE = "provide";
String NAME = "name";
@@ -18,7 +20,7 @@ import java.lang.annotation.*;
String name() default "";
- Class<?>[] provide() default Object.class;
+ Class< ? >[] provide() default Object.class;
String factory() default "";
@@ -32,7 +34,7 @@ import java.lang.annotation.*;
String[] properties() default {};
- Class<?> designate() default Object.class;
+ Class< ? > designate() default Object.class;
- Class<?> designateFactory() default Object.class;
+ Class< ? > designateFactory() default Object.class;
}
Modified: felix/trunk/bundleplugin/src/main/java/aQute/bnd/annotation/component/ConfigurationPolicy.java
URL: http://svn.apache.org/viewvc/felix/trunk/bundleplugin/src/main/java/aQute/bnd/annotation/component/ConfigurationPolicy.java?rev=1350613&r1=1350612&r2=1350613&view=diff
==============================================================================
--- felix/trunk/bundleplugin/src/main/java/aQute/bnd/annotation/component/ConfigurationPolicy.java (original)
+++ felix/trunk/bundleplugin/src/main/java/aQute/bnd/annotation/component/ConfigurationPolicy.java Fri Jun 15 13:27:53 2012
@@ -1,5 +1,5 @@
package aQute.bnd.annotation.component;
public enum ConfigurationPolicy {
- optional, require, ignore;
+ optional, require, ignore;
}
Modified: felix/trunk/bundleplugin/src/main/java/aQute/bnd/annotation/component/Deactivate.java
URL: http://svn.apache.org/viewvc/felix/trunk/bundleplugin/src/main/java/aQute/bnd/annotation/component/Deactivate.java?rev=1350613&r1=1350612&r2=1350613&view=diff
==============================================================================
--- felix/trunk/bundleplugin/src/main/java/aQute/bnd/annotation/component/Deactivate.java (original)
+++ felix/trunk/bundleplugin/src/main/java/aQute/bnd/annotation/component/Deactivate.java Fri Jun 15 13:27:53 2012
@@ -5,6 +5,6 @@ import java.lang.annotation.*;
@Retention(RetentionPolicy.CLASS)
@Target(ElementType.METHOD)
public @interface Deactivate {
- String RNAME = "LaQute/bnd/annotation/component/Deactivate;";
+ String RNAME = "LaQute/bnd/annotation/component/Deactivate;";
}
Modified: felix/trunk/bundleplugin/src/main/java/aQute/bnd/annotation/component/Modified.java
URL: http://svn.apache.org/viewvc/felix/trunk/bundleplugin/src/main/java/aQute/bnd/annotation/component/Modified.java?rev=1350613&r1=1350612&r2=1350613&view=diff
==============================================================================
--- felix/trunk/bundleplugin/src/main/java/aQute/bnd/annotation/component/Modified.java (original)
+++ felix/trunk/bundleplugin/src/main/java/aQute/bnd/annotation/component/Modified.java Fri Jun 15 13:27:53 2012
@@ -5,6 +5,6 @@ import java.lang.annotation.*;
@Retention(RetentionPolicy.CLASS)
@Target(ElementType.METHOD)
public @interface Modified {
- String RNAME = "LaQute/bnd/annotation/component/Modified;";
+ String RNAME = "LaQute/bnd/annotation/component/Modified;";
}
Modified: felix/trunk/bundleplugin/src/main/java/aQute/bnd/annotation/component/Reference.java
URL: http://svn.apache.org/viewvc/felix/trunk/bundleplugin/src/main/java/aQute/bnd/annotation/component/Reference.java?rev=1350613&r1=1350612&r2=1350613&view=diff
==============================================================================
--- felix/trunk/bundleplugin/src/main/java/aQute/bnd/annotation/component/Reference.java (original)
+++ felix/trunk/bundleplugin/src/main/java/aQute/bnd/annotation/component/Reference.java Fri Jun 15 13:27:53 2012
@@ -5,29 +5,29 @@ import java.lang.annotation.*;
@Retention(RetentionPolicy.CLASS)
@Target(ElementType.METHOD)
public @interface Reference {
- String RNAME = "LaQute/bnd/annotation/component/Reference;";
- String NAME = "name";
- String SERVICE = "service";
- String OPTIONAL = "optional";
- String MULTIPLE = "multiple";
- String DYNAMIC = "dynamic";
- String TARGET = "target";
- String TYPE = "type";
- String UNBIND = "unbind";
+ String RNAME = "LaQute/bnd/annotation/component/Reference;";
+ String NAME = "name";
+ String SERVICE = "service";
+ String OPTIONAL = "optional";
+ String MULTIPLE = "multiple";
+ String DYNAMIC = "dynamic";
+ String TARGET = "target";
+ String TYPE = "type";
+ String UNBIND = "unbind";
- String name() default "";
+ String name() default "";
- Class<?> service() default Object.class;
+ Class< ? > service() default Object.class;
- boolean optional() default false;
+ boolean optional() default false;
- boolean multiple() default false;
+ boolean multiple() default false;
- boolean dynamic() default false;
+ boolean dynamic() default false;
- String target() default "";
-
- String unbind() default "";
+ String target() default "";
- char type() default 0;
+ String unbind() default "";
+
+ char type() default 0;
}
Modified: felix/trunk/bundleplugin/src/main/java/aQute/bnd/annotation/metatype/Configurable.java
URL: http://svn.apache.org/viewvc/felix/trunk/bundleplugin/src/main/java/aQute/bnd/annotation/metatype/Configurable.java?rev=1350613&r1=1350612&r2=1350613&view=diff
==============================================================================
--- felix/trunk/bundleplugin/src/main/java/aQute/bnd/annotation/metatype/Configurable.java (original)
+++ felix/trunk/bundleplugin/src/main/java/aQute/bnd/annotation/metatype/Configurable.java Fri Jun 15 13:27:53 2012
@@ -4,17 +4,21 @@ import java.lang.reflect.*;
import java.util.*;
import java.util.regex.*;
-@SuppressWarnings( { "unchecked", "rawtypes" }) public class Configurable<T> {
-
- public static <T> T createConfigurable(Class<T> c, Map<?, ?> properties) {
- Object o = Proxy.newProxyInstance(c.getClassLoader(), new Class<?>[] { c },
- new ConfigurableHandler(properties, c.getClassLoader()));
+@SuppressWarnings({
+ "unchecked", "rawtypes"
+})
+public class Configurable<T> {
+
+ public static <T> T createConfigurable(Class<T> c, Map< ? , ? > properties) {
+ Object o = Proxy.newProxyInstance(c.getClassLoader(), new Class< ? >[] {
+ c
+ }, new ConfigurableHandler(properties, c.getClassLoader()));
return c.cast(o);
}
- public static <T> T createConfigurable(Class<T> c, Dictionary<?, ?> properties) {
+ public static <T> T createConfigurable(Class<T> c, Dictionary< ? , ? > properties) {
Map<Object,Object> alt = new HashMap<Object,Object>();
- for( Enumeration<?> e = properties.keys(); e.hasMoreElements(); ) {
+ for (Enumeration< ? > e = properties.keys(); e.hasMoreElements();) {
Object key = e.nextElement();
alt.put(key, properties.get(key));
}
@@ -22,10 +26,10 @@ import java.util.regex.*;
}
static class ConfigurableHandler implements InvocationHandler {
- final Map<?, ?> properties;
- final ClassLoader loader;
+ final Map< ? , ? > properties;
+ final ClassLoader loader;
- ConfigurableHandler(Map<?, ?> properties, ClassLoader loader) {
+ ConfigurableHandler(Map< ? , ? > properties, ClassLoader loader) {
this.properties = properties;
this.loader = loader;
}
@@ -42,8 +46,7 @@ import java.util.regex.*;
if (o == null) {
if (ad != null) {
if (ad.required())
- throw new IllegalStateException("Attribute is required but not set "
- + method.getName());
+ throw new IllegalStateException("Attribute is required but not set " + method.getName());
o = ad.deflt();
if (o.equals(Meta.NULL))
@@ -51,10 +54,10 @@ import java.util.regex.*;
}
}
if (o == null) {
- Class<?> rt = method.getReturnType();
- if ( rt == boolean.class || rt==Boolean.class)
+ Class< ? > rt = method.getReturnType();
+ if (rt == boolean.class || rt == Boolean.class)
return false;
-
+
if (method.getReturnType().isPrimitive()) {
o = "0";
@@ -65,8 +68,7 @@ import java.util.regex.*;
return convert(method.getGenericReturnType(), o);
}
- public Object convert(Type type, Object o)
- throws Exception {
+ public Object convert(Type type, Object o) throws Exception {
if (type instanceof ParameterizedType) {
ParameterizedType pType = (ParameterizedType) type;
return convert(pType, o);
@@ -77,20 +79,20 @@ import java.util.regex.*;
return convertArray(gType.getGenericComponentType(), o);
}
- Class<?> resultType = (Class<?>) type;
+ Class< ? > resultType = (Class< ? >) type;
if (resultType.isArray()) {
return convertArray(resultType.getComponentType(), o);
}
- Class<?> actualType = o.getClass();
+ Class< ? > actualType = o.getClass();
if (actualType.isAssignableFrom(resultType))
return o;
if (resultType == boolean.class || resultType == Boolean.class) {
- if ( actualType == boolean.class || actualType == Boolean.class)
+ if (actualType == boolean.class || actualType == Boolean.class)
return o;
-
+
if (Number.class.isAssignableFrom(actualType)) {
double b = ((Number) o).doubleValue();
if (b == 0)
@@ -99,7 +101,7 @@ import java.util.regex.*;
return true;
}
return true;
-
+
} else if (resultType == byte.class || resultType == Byte.class) {
if (Number.class.isAssignableFrom(actualType))
return ((Number) o).byteValue();
@@ -148,37 +150,41 @@ import java.util.regex.*;
}
try {
- Constructor<?> c = resultType.getConstructor(String.class);
+ Constructor< ? > c = resultType.getConstructor(String.class);
return c.newInstance(o.toString());
- } catch (Throwable t) {
+ }
+ catch (Throwable t) {
// handled on next line
}
- throw new IllegalArgumentException("No conversion to " + resultType + " from "
- + actualType + " value " + o);
+ throw new IllegalArgumentException("No conversion to " + resultType + " from " + actualType + " value " + o);
}
private Object convert(ParameterizedType pType, Object o) throws InstantiationException,
IllegalAccessException, Exception {
- Class<?> resultType = (Class<?>) pType.getRawType();
+ Class< ? > resultType = (Class< ? >) pType.getRawType();
if (Collection.class.isAssignableFrom(resultType)) {
- Collection<?> input = toCollection(o);
+ Collection< ? > input = toCollection(o);
if (resultType.isInterface()) {
if (resultType == Collection.class || resultType == List.class)
resultType = ArrayList.class;
else if (resultType == Set.class || resultType == SortedSet.class)
resultType = TreeSet.class;
- else if (resultType == Queue.class /*|| resultType == Deque.class*/)
+ else if (resultType == Queue.class /*
+ * || resultType ==
+ * Deque.class
+ */)
resultType = LinkedList.class;
- else if (resultType == Queue.class /*|| resultType == Deque.class*/)
+ else if (resultType == Queue.class /*
+ * || resultType ==
+ * Deque.class
+ */)
resultType = LinkedList.class;
else
throw new IllegalArgumentException(
- "Unknown interface for a collection, no concrete class found: "
- + resultType);
+ "Unknown interface for a collection, no concrete class found: " + resultType);
}
-
- Collection<Object> result = (Collection<Object>) resultType
- .newInstance();
+
+ Collection<Object> result = (Collection<Object>) resultType.newInstance();
Type componentType = pType.getActualTypeArguments()[0];
for (Object i : input) {
@@ -188,8 +194,8 @@ import java.util.regex.*;
} else if (pType.getRawType() == Class.class) {
return loader.loadClass(o.toString());
}
- if (Map.class.isAssignableFrom(resultType)){
- Map<?,?> input = toMap(o);
+ if (Map.class.isAssignableFrom(resultType)) {
+ Map< ? , ? > input = toMap(o);
if (resultType.isInterface()) {
if (resultType == SortedMap.class)
resultType = TreeMap.class;
@@ -197,16 +203,14 @@ import java.util.regex.*;
resultType = LinkedHashMap.class;
else
throw new IllegalArgumentException(
- "Unknown interface for a collection, no concrete class found: "
- + resultType);
+ "Unknown interface for a collection, no concrete class found: " + resultType);
}
- Map<Object,Object> result = (Map<Object,Object>) resultType
- .newInstance();
+ Map<Object,Object> result = (Map<Object,Object>) resultType.newInstance();
Type keyType = pType.getActualTypeArguments()[0];
Type valueType = pType.getActualTypeArguments()[1];
- for ( Map.Entry<?, ?> entry : input.entrySet()) {
- result.put(convert(keyType,entry.getKey()), convert(valueType,entry.getValue()));
+ for (Map.Entry< ? , ? > entry : input.entrySet()) {
+ result.put(convert(keyType, entry.getKey()), convert(valueType, entry.getValue()));
}
return result;
}
@@ -214,10 +218,9 @@ import java.util.regex.*;
+ " because it uses generics and is not a Collection or a map");
}
-
Object convertArray(Type componentType, Object o) throws Exception {
- Collection<?> input = toCollection(o);
- Class<?> componentClass = getRawClass(componentType);
+ Collection< ? > input = toCollection(o);
+ Class< ? > componentClass = getRawClass(componentType);
Object array = Array.newInstance(componentClass, input.size());
int i = 0;
@@ -227,67 +230,63 @@ import java.util.regex.*;
return array;
}
- private Class<?> getRawClass(Type type) {
+ private Class< ? > getRawClass(Type type) {
if (type instanceof Class)
- return (Class<?>) type;
+ return (Class< ? >) type;
if (type instanceof ParameterizedType)
- return (Class<?>) ((ParameterizedType) type).getRawType();
+ return (Class< ? >) ((ParameterizedType) type).getRawType();
- throw new IllegalArgumentException(
- "For the raw type, type must be ParamaterizedType or Class but is " + type);
+ throw new IllegalArgumentException("For the raw type, type must be ParamaterizedType or Class but is "
+ + type);
}
- private Collection<?> toCollection(Object o) {
+ private Collection< ? > toCollection(Object o) {
if (o instanceof Collection)
- return (Collection<?>) o;
+ return (Collection< ? >) o;
if (o.getClass().isArray()) {
- if ( o.getClass().getComponentType().isPrimitive()) {
+ if (o.getClass().getComponentType().isPrimitive()) {
int length = Array.getLength(o);
List<Object> result = new ArrayList<Object>(length);
- for ( int i=0; i<length; i++) {
- result.add( Array.get(o, i));
+ for (int i = 0; i < length; i++) {
+ result.add(Array.get(o, i));
}
return result;
} else
return Arrays.asList((Object[]) o);
}
- if ( o instanceof String) {
- String s = (String)o;
- if (s.indexOf('|')>0)
- return Arrays.asList(s.split("\\|"));
+ if (o instanceof String) {
+ String s = (String) o;
+ if (s.indexOf('|') > 0)
+ return Arrays.asList(s.split("\\|"));
}
return Arrays.asList(o);
}
-
- private Map<?, ?> toMap(Object o) {
- if ( o instanceof Map)
- return (Map<?, ?>) o;
-
- throw new IllegalArgumentException(
- "Cannot convert " + o + " to a map as requested");
- }
+ private Map< ? , ? > toMap(Object o) {
+ if (o instanceof Map)
+ return (Map< ? , ? >) o;
+
+ throw new IllegalArgumentException("Cannot convert " + o + " to a map as requested");
+ }
}
-
-
+
public static String mangleMethodName(String id) {
StringBuilder sb = new StringBuilder(id);
- for ( int i =0; i<sb.length(); i++) {
- char c = sb.charAt(i);
- boolean twice = i < sb.length()-1 && sb.charAt(i+1) ==c;
- if ( c == '$' || c == '_') {
- if ( twice )
- sb.deleteCharAt(i+1);
- else
- if ( c == '$')
- sb.deleteCharAt(i--); // Remove dollars
- else
- sb.setCharAt(i, '.'); // Make _ into .
- }
+ for (int i = 0; i < sb.length(); i++) {
+ char c = sb.charAt(i);
+ boolean twice = i < sb.length() - 1 && sb.charAt(i + 1) == c;
+ if (c == '$' || c == '_') {
+ if (twice)
+ sb.deleteCharAt(i + 1);
+ else if (c == '$')
+ sb.deleteCharAt(i--); // Remove dollars
+ else
+ sb.setCharAt(i, '.'); // Make _ into .
+ }
}
return sb.toString();
}
Modified: felix/trunk/bundleplugin/src/main/java/aQute/bnd/annotation/metatype/Meta.java
URL: http://svn.apache.org/viewvc/felix/trunk/bundleplugin/src/main/java/aQute/bnd/annotation/metatype/Meta.java?rev=1350613&r1=1350612&r2=1350613&view=diff
==============================================================================
--- felix/trunk/bundleplugin/src/main/java/aQute/bnd/annotation/metatype/Meta.java (original)
+++ felix/trunk/bundleplugin/src/main/java/aQute/bnd/annotation/metatype/Meta.java Fri Jun 15 13:27:53 2012
@@ -13,16 +13,7 @@ import java.lang.annotation.*;
public interface Meta {
enum Type {
- Boolean,
- Byte,
- Character,
- Short,
- Integer,
- Long,
- Float,
- Double,
- String,
- Password
+ Boolean, Byte, Character, Short, Integer, Long, Float, Double, String, Password
}
/**
@@ -34,9 +25,10 @@ public interface Meta {
* The OCD Annotation maps to the OCD element in the Metatype specification.
* The only difference is that it is possible to create a Designate element
* as well.
- *
*/
- @Target(ElementType.TYPE) @Retention(RetentionPolicy.RUNTIME) @interface OCD {
+ @Target(ElementType.TYPE)
+ @Retention(RetentionPolicy.RUNTIME)
+ @interface OCD {
/**
* The name for this component. The default name is a the short class
* name that us un-camel cased to make it more readable.
@@ -48,7 +40,6 @@ public interface Meta {
/**
* The id of the component. Default the name of the class in FQN
* notation but with nested classes using the $ as separator (not .).
- *
* The Felix webconsole always uses this id as the PID and not the pid
* in the Designate element. Reported as an error.
*
@@ -79,9 +70,10 @@ public interface Meta {
/**
* The AD element in the Metatype specification.
- *
*/
- @Target(ElementType.METHOD) @Retention(RetentionPolicy.RUNTIME) @interface AD {
+ @Target(ElementType.METHOD)
+ @Retention(RetentionPolicy.RUNTIME)
+ @interface AD {
/**
* A description of the attribute. Default is empty.
*
@@ -119,10 +111,9 @@ public interface Meta {
/**
* The cardinality of the attribute. If not explicitly set it will be
* derived from the attributes return type. Collections return
- * Integer.MIN_VALUE and arrays use Integer.MAX_VALUE.
- *
- * If a single string needs to be converted to a Collection or array
- * then the | will be used as a separator to split the line.
+ * Integer.MIN_VALUE and arrays use Integer.MAX_VALUE. If a single
+ * string needs to be converted to a Collection or array then the | will
+ * be used as a separator to split the line.
*
* @return the cardinality of the attribute
*/
Modified: felix/trunk/bundleplugin/src/main/java/aQute/bnd/build/CircularDependencyException.java
URL: http://svn.apache.org/viewvc/felix/trunk/bundleplugin/src/main/java/aQute/bnd/build/CircularDependencyException.java?rev=1350613&r1=1350612&r2=1350613&view=diff
==============================================================================
--- felix/trunk/bundleplugin/src/main/java/aQute/bnd/build/CircularDependencyException.java (original)
+++ felix/trunk/bundleplugin/src/main/java/aQute/bnd/build/CircularDependencyException.java Fri Jun 15 13:27:53 2012
@@ -1,10 +1,10 @@
package aQute.bnd.build;
public class CircularDependencyException extends Exception {
- public CircularDependencyException(String string) {
- super(string);
- }
+ public CircularDependencyException(String string) {
+ super(string);
+ }
- private static final long serialVersionUID = 1L;
+ private static final long serialVersionUID = 1L;
}
Modified: felix/trunk/bundleplugin/src/main/java/aQute/bnd/build/Container.java
URL: http://svn.apache.org/viewvc/felix/trunk/bundleplugin/src/main/java/aQute/bnd/build/Container.java?rev=1350613&r1=1350612&r2=1350613&view=diff
==============================================================================
--- felix/trunk/bundleplugin/src/main/java/aQute/bnd/build/Container.java (original)
+++ felix/trunk/bundleplugin/src/main/java/aQute/bnd/build/Container.java Fri Jun 15 13:27:53 2012
@@ -18,12 +18,12 @@ public class Container {
final String version;
final String error;
final Project project;
- volatile Map<String, String> attributes;
+ volatile Map<String,String> attributes;
private long manifestTime;
private Manifest manifest;
Container(Project project, String bsn, String version, TYPE type, File source, String error,
- Map<String, String> attributes) {
+ Map<String,String> attributes) {
this.bsn = bsn;
this.version = version;
this.type = type;
@@ -57,32 +57,32 @@ public class Container {
*/
public boolean contributeFiles(List<File> files, Processor reporter) throws Exception {
switch (type) {
- case EXTERNAL:
- case REPO:
- files.add(file);
- return true;
-
- case PROJECT:
- File[] fs = project.build();
- reporter.getInfo(project);
- if (fs == null)
- return false;
-
- for (File f : fs)
- files.add(f);
- return true;
-
- case LIBRARY:
- List<Container> containers = getMembers();
- for (Container container : containers) {
- if (!container.contributeFiles(files, reporter))
+ case EXTERNAL :
+ case REPO :
+ files.add(file);
+ return true;
+
+ case PROJECT :
+ File[] fs = project.build();
+ reporter.getInfo(project);
+ if (fs == null)
return false;
- }
- return true;
- case ERROR:
- reporter.error(error);
- return false;
+ for (File f : fs)
+ files.add(f);
+ return true;
+
+ case LIBRARY :
+ List<Container> containers = getMembers();
+ for (Container container : containers) {
+ if (!container.contributeFiles(files, reporter))
+ return false;
+ }
+ return true;
+
+ case ERROR :
+ reporter.error(error);
+ return false;
}
return false;
}
@@ -130,13 +130,13 @@ public class Container {
return getFile().getAbsolutePath();
}
- public Map<String, String> getAttributes() {
+ public Map<String,String> getAttributes() {
return attributes;
}
-
+
public void putAttribute(String name, String value) {
- if (attributes == Collections.<String,String>emptyMap())
- attributes = new HashMap<String, String>(1);
+ if (attributes == Collections.<String, String> emptyMap())
+ attributes = new HashMap<String,String>(1);
attributes.put(name, value);
}
@@ -162,8 +162,7 @@ public class Container {
String line;
try {
in = new FileInputStream(file);
- rd = new BufferedReader(new InputStreamReader(in,
- Constants.DEFAULT_CHARSET));
+ rd = new BufferedReader(new InputStreamReader(in, Constants.DEFAULT_CHARSET));
while ((line = rd.readLine()) != null) {
line = line.trim();
if (!line.startsWith("#") && line.length() > 0) {
@@ -171,7 +170,8 @@ public class Container {
result.addAll(list);
}
}
- } finally {
+ }
+ finally {
if (rd != null) {
rd.close();
}
@@ -201,7 +201,8 @@ public class Container {
manifest = jin.getManifest();
jin.close();
manifestTime = getFile().lastModified();
- } finally {
+ }
+ finally {
in.close();
}
}
Modified: felix/trunk/bundleplugin/src/main/java/aQute/bnd/build/Project.java
URL: http://svn.apache.org/viewvc/felix/trunk/bundleplugin/src/main/java/aQute/bnd/build/Project.java?rev=1350613&r1=1350612&r2=1350613&view=diff
==============================================================================
--- felix/trunk/bundleplugin/src/main/java/aQute/bnd/build/Project.java (original)
+++ felix/trunk/bundleplugin/src/main/java/aQute/bnd/build/Project.java Fri Jun 15 13:27:53 2012
@@ -5,7 +5,6 @@ import java.lang.reflect.*;
import java.net.*;
import java.util.*;
import java.util.Map.Entry;
-import java.util.concurrent.*;
import java.util.concurrent.locks.*;
import java.util.jar.*;
@@ -19,14 +18,12 @@ import aQute.lib.osgi.*;
import aQute.lib.osgi.eclipse.*;
import aQute.libg.generics.*;
import aQute.libg.header.*;
+import aQute.libg.reporter.*;
import aQute.libg.sed.*;
import aQute.libg.version.*;
/**
* This class is NOT threadsafe
- *
- * @author aqute
- *
*/
public class Project extends Processor {
@@ -56,6 +53,7 @@ public class Project extends Processor {
File files[];
static List<Project> trail = new ArrayList<Project>();
boolean delayRunDependencies = false;
+ final ProjectMessages msgs = ReporterMessages.base(this, ProjectMessages.class);
public Project(Workspace workspace, File projectDir, File buildFile) throws Exception {
super(workspace);
@@ -76,7 +74,7 @@ public class Project extends Processor {
File f = getFile("build.properties");
if (f.isFile()) {
Properties p = loadProperties(f);
- for (Enumeration<?> e = p.propertyNames(); e.hasMoreElements();) {
+ for (Enumeration< ? > e = p.propertyNames(); e.hasMoreElements();) {
String key = (String) e.nextElement();
String newkey = key;
if (key.indexOf('$') >= 0) {
@@ -85,7 +83,8 @@ public class Project extends Processor {
setProperty(newkey, p.getProperty(key));
}
}
- } catch (Exception e) {
+ }
+ catch (Exception e) {
e.printStackTrace();
}
}
@@ -206,7 +205,7 @@ public class Project extends Processor {
getWorkspace().changedFile(output);
}
if (!output.isDirectory())
- error("Can not find output directory: " + output);
+ msgs.NoOutputDirectory_(output);
else {
Container c = new Container(this, output);
if (!buildpath.contains(c))
@@ -240,7 +239,7 @@ public class Project extends Processor {
for (String p : requiredProjectNames) {
Project required = getWorkspace().getProject(p);
if (required == null)
- error("No such project " + p + " on " + Constants.DEPENDSON);
+ msgs.MissingDependson_(p);
else {
dependencies.add(required);
}
@@ -279,11 +278,13 @@ public class Project extends Processor {
}
if (isOk())
preparedPaths = true;
- } finally {
+ }
+ finally {
inPrepare = false;
}
}
- } finally {
+ }
+ finally {
trail.remove(this);
}
}
@@ -315,8 +316,8 @@ public class Project extends Processor {
* @param entries
* The input list of classpath entries
*/
- private void doPath(Collection<Container> resultpath, Collection<Project> projects,
- Collection<Container> entries, Collection<Container> bootclasspath) {
+ private void doPath(Collection<Container> resultpath, Collection<Project> projects, Collection<Container> entries,
+ Collection<Container> bootclasspath) {
for (Container cpe : entries) {
if (cpe.getError() != null)
error(cpe.getError());
@@ -324,8 +325,8 @@ public class Project extends Processor {
if (cpe.getType() == Container.TYPE.PROJECT) {
projects.add(cpe.getProject());
}
- if (bootclasspath != null && cpe.getBundleSymbolicName().startsWith("ee.")
- || cpe.getAttributes().containsKey("boot"))
+ if (bootclasspath != null
+ && (cpe.getBundleSymbolicName().startsWith("ee.") || cpe.getAttributes().containsKey("boot")))
bootclasspath.add(cpe);
else
resultpath.add(cpe);
@@ -335,7 +336,6 @@ public class Project extends Processor {
/**
* Parse the list of bundles that are a prerequisite to this project.
- *
* Bundles are listed in repo specific names. So we just let our repo
* plugins iterate over the list of bundles and we get the highest version
* from them.
@@ -344,10 +344,8 @@ public class Project extends Processor {
*/
private List<Container> parseBuildpath() throws Exception {
- List<Container> bundles = getBundles(Strategy.LOWEST, getProperty(Constants.BUILDPATH),
- Constants.BUILDPATH);
- appendPackages(Strategy.LOWEST, getProperty(Constants.BUILDPACKAGES), bundles,
- ResolverMode.build);
+ List<Container> bundles = getBundles(Strategy.LOWEST, getProperty(Constants.BUILDPATH), Constants.BUILDPATH);
+ appendPackages(Strategy.LOWEST, getProperty(Constants.BUILDPACKAGES), bundles, ResolverMode.build);
return bundles;
}
@@ -378,16 +376,15 @@ public class Project extends Processor {
* @return
*/
- public List<Container> getBundles(Strategy strategyx, String spec, String source)
- throws Exception {
+ public List<Container> getBundles(Strategy strategyx, String spec, String source) throws Exception {
List<Container> result = new ArrayList<Container>();
Parameters bundles = new Parameters(spec);
try {
- for (Iterator<Entry<String, Attrs>> i = bundles.entrySet().iterator(); i.hasNext();) {
- Entry<String, Attrs> entry = i.next();
- String bsn = entry.getKey();
- Map<String, String> attrs = entry.getValue();
+ for (Iterator<Entry<String,Attrs>> i = bundles.entrySet().iterator(); i.hasNext();) {
+ Entry<String,Attrs> entry = i.next();
+ String bsn = removeDuplicateMarker(entry.getKey());
+ Map<String,String> attrs = entry.getValue();
Container found = null;
@@ -399,16 +396,13 @@ public class Project extends Processor {
}
}
if (found == null) {
- if (versionRange != null
- && (versionRange.equals("project") || versionRange.equals("latest"))) {
+ if (versionRange != null && (versionRange.equals("project") || versionRange.equals("latest"))) {
Project project = getWorkspace().getProject(bsn);
if (project != null && project.exists()) {
File f = project.getOutput();
- found = new Container(project, bsn, versionRange,
- Container.TYPE.PROJECT, f, null, attrs);
+ found = new Container(project, bsn, versionRange, Container.TYPE.PROJECT, f, null, attrs);
} else {
- error("Reference to project that does not exist in workspace\n"
- + " Project %s\n" + " Specification %s", bsn, spec);
+ msgs.NoSuchProject(bsn, spec);
continue;
}
} else if (versionRange != null && versionRange.equals("file")) {
@@ -417,11 +411,9 @@ public class Project extends Processor {
if (!f.exists())
error = "File does not exist: " + f.getAbsolutePath();
if (f.getName().endsWith(".lib")) {
- found = new Container(this, bsn, "file", Container.TYPE.LIBRARY, f,
- error, attrs);
+ found = new Container(this, bsn, "file", Container.TYPE.LIBRARY, f, error, attrs);
} else {
- found = new Container(this, bsn, "file", Container.TYPE.EXTERNAL, f,
- error, attrs);
+ found = new Container(this, bsn, "file", Container.TYPE.EXTERNAL, f, error, attrs);
}
} else {
found = getBundle(bsn, versionRange, strategyx, attrs);
@@ -432,26 +424,27 @@ public class Project extends Processor {
List<Container> libs = found.getMembers();
for (Container cc : libs) {
if (result.contains(cc))
- warning("Multiple bundles with the same final URL: " + cc);
-
- result.add(cc);
+ warning("Multiple bundles with the same final URL: %s, dropped duplicate", cc);
+ else
+ result.add(cc);
}
} else {
// Oops, not a bundle in sight :-(
- Container x = new Container(this, bsn, versionRange, Container.TYPE.ERROR,
- null, bsn + ";version=" + versionRange + " not found", attrs);
+ Container x = new Container(this, bsn, versionRange, Container.TYPE.ERROR, null, bsn + ";version="
+ + versionRange + " not found", attrs);
result.add(x);
warning("Can not find URL for bsn " + bsn);
}
}
- } catch (CircularDependencyException e) {
+ }
+ catch (CircularDependencyException e) {
String message = e.getMessage();
if (source != null)
message = String.format("%s (from property: %s)", message, source);
- error("Circular dependency detected from project %s: %s", e, getName(), message);
- } catch (Exception e) {
- error("Unexpected error while trying to get the bundles from " + spec, e);
- e.printStackTrace();
+ msgs.CircularDependencyContext_Message_(getName(), message);
+ }
+ catch (Exception e) {
+ msgs.Unexpected_Error_(spec, e);
}
return result;
}
@@ -460,7 +453,6 @@ public class Project extends Processor {
* Just calls a new method with a default parm.
*
* @throws Exception
- *
*/
Collection<Container> getBundles(Strategy strategy, String spec) throws Exception {
return getBundles(strategy, spec, null);
@@ -476,18 +468,18 @@ public class Project extends Processor {
* The value of the @{code -buildpackages} instruction.
* @throws Exception
*/
- public void appendPackages(Strategy strategyx, String spec, List<Container> resolvedBundles,
- ResolverMode mode) throws Exception {
- Map<File, Container> pkgResolvedBundles = new HashMap<File, Container>();
+ public void appendPackages(Strategy strategyx, String spec, List<Container> resolvedBundles, ResolverMode mode)
+ throws Exception {
+ Map<File,Container> pkgResolvedBundles = new HashMap<File,Container>();
- List<Entry<String, Attrs>> queue = new LinkedList<Map.Entry<String, Attrs>>();
+ List<Entry<String,Attrs>> queue = new LinkedList<Map.Entry<String,Attrs>>();
queue.addAll(new Parameters(spec).entrySet());
while (!queue.isEmpty()) {
- Entry<String, Attrs> entry = queue.remove(0);
+ Entry<String,Attrs> entry = queue.remove(0);
String pkgName = entry.getKey();
- Map<String, String> attrs = entry.getValue();
+ Map<String,String> attrs = entry.getValue();
Container found = null;
@@ -520,8 +512,8 @@ public class Project extends Processor {
}
} else {
// Unable to resolve
- Container x = new Container(this, "X", versionRange, Container.TYPE.ERROR, null,
- "package " + pkgName + ";version=" + versionRange + " not found", attrs);
+ Container x = new Container(this, "X", versionRange, Container.TYPE.ERROR, null, "package " + pkgName
+ + ";version=" + versionRange + " not found", attrs);
resolvedBundles.add(x);
warning("Can not find URL for package " + pkgName);
}
@@ -576,14 +568,14 @@ public class Project extends Processor {
* @return
* @throws Exception
*/
- public Container getPackage(String packageName, String range, Strategy strategyx,
- Map<String, String> attrs, ResolverMode mode) throws Exception {
+ public Container getPackage(String packageName, String range, Strategy strategyx, Map<String,String> attrs,
+ ResolverMode mode) throws Exception {
if ("snapshot".equals(range))
return new Container(this, "", range, Container.TYPE.ERROR, null,
"snapshot not supported for package lookups", null);
if (attrs == null)
- attrs = new HashMap<String, String>(2);
+ attrs = new HashMap<String,String>(2);
attrs.put("package", packageName);
attrs.put("mode", mode.name());
@@ -595,23 +587,20 @@ public class Project extends Processor {
File result = plugin.get(null, range, useStrategy, attrs);
if (result != null) {
if (result.getName().endsWith("lib"))
- return new Container(this, result.getName(), range, Container.TYPE.LIBRARY,
- result, null, attrs);
- else
- return new Container(this, result.getName(), range, Container.TYPE.REPO,
- result, null, attrs);
+ return new Container(this, result.getName(), range, Container.TYPE.LIBRARY, result, null, attrs);
+ return new Container(this, result.getName(), range, Container.TYPE.REPO, result, null, attrs);
}
- } catch (Exception e) {
+ }
+ catch (Exception e) {
// Ignore... lots of repos will fail here
}
}
- return new Container(this, "X", range, Container.TYPE.ERROR, null, "package " + packageName
- + ";version=" + range + " Not found in " + plugins, null);
+ return new Container(this, "X", range, Container.TYPE.ERROR, null, "package " + packageName + ";version="
+ + range + " Not found in " + plugins, null);
}
- private Strategy findStrategy(Map<String, String> attrs, Strategy defaultStrategy,
- String versionRange) {
+ private Strategy findStrategy(Map<String,String> attrs, Strategy defaultStrategy, String versionRange) {
Strategy useStrategy = defaultStrategy;
String overrideStrategy = attrs.get("strategy");
if (overrideStrategy != null) {
@@ -640,11 +629,10 @@ public class Project extends Processor {
* @throws Exception
* anything goes wrong
*/
- public void doMavenPom(Strategy strategyx, List<Container> result, String action)
- throws Exception {
+ public void doMavenPom(Strategy strategyx, List<Container> result, String action) throws Exception {
File pomFile = getFile("pom.xml");
if (!pomFile.isFile())
- error("Specified to use pom.xml but the project directory does not contain a pom.xml file");
+ msgs.MissingPom();
else {
ProjectPom pom = getWorkspace().getMaven().createProjectModel(pomFile);
if (action == null)
@@ -706,8 +694,7 @@ public class Project extends Processor {
boolean result;
String runBuildsStr = getProperty(Constants.RUNBUILDS);
if (runBuildsStr == null)
- result = !getPropertiesFile().getName().toLowerCase()
- .endsWith(Constants.DEFAULT_BNDRUN_EXTENSION);
+ result = !getPropertiesFile().getName().toLowerCase().endsWith(Constants.DEFAULT_BNDRUN_EXTENSION);
else
result = Boolean.parseBoolean(runBuildsStr);
return result;
@@ -758,7 +745,7 @@ public class Project extends Processor {
return list(args, toFiles(getDependson()));
}
- private Collection<?> toFiles(Collection<Project> projects) {
+ private Collection< ? > toFiles(Collection<Project> projects) {
List<File> files = new ArrayList<File>();
for (Project p : projects) {
files.add(p.getBase());
@@ -792,11 +779,10 @@ public class Project extends Processor {
return getOutput().getAbsolutePath();
}
- private String list(String[] args, Collection<?> list) {
+ private String list(String[] args, Collection< ? > list) {
if (args.length > 3)
throw new IllegalArgumentException("${" + args[0]
- + "[;<separator>]} can only take a separator as argument, has "
- + Arrays.toString(args));
+ + "[;<separator>]} can only take a separator as argument, has " + Arrays.toString(args));
String separator = ",";
@@ -808,7 +794,9 @@ public class Project extends Processor {
}
protected Object[] getMacroDomains() {
- return new Object[] { workspace };
+ return new Object[] {
+ workspace
+ };
}
public File release(Jar jar) throws Exception {
@@ -846,16 +834,17 @@ public class Project extends Processor {
try {
File file = rp.put(jar);
trace("Released %s to file %s in repository %s", jar.getName(), file, rp);
- } catch (Exception e) {
- error("Deploying " + jar.getName() + " on " + rp.getName(), e);
- } finally {
+ }
+ catch (Exception e) {
+ msgs.Release_Into_Exception_(jar, rp, e);
+ }
+ finally {
jar.close();
}
} else if (name == null)
- error("There is no writable repository (no repo name specified)");
+ msgs.NoNameForReleaseRepository();
else
- error("Cannot find a writeable repository with the name %s from the repositiories %s",
- name, plugins);
+ msgs.ReleaseRepository_NotFoundIn_(name, plugins);
return null;
@@ -888,7 +877,8 @@ public class Project extends Processor {
Jar j = new Jar(jar);
try {
release(name, j);
- } finally {
+ }
+ finally {
j.close();
}
}
@@ -911,8 +901,7 @@ public class Project extends Processor {
* when something goes wrong
*/
- public Container getBundle(String bsn, String range, Strategy strategy,
- Map<String, String> attrs) throws Exception {
+ public Container getBundle(String bsn, String range, Strategy strategy, Map<String,String> attrs) throws Exception {
if (range == null)
range = "0";
@@ -946,15 +935,14 @@ public class Project extends Processor {
return toContainer(bsn, range, attrs, result);
}
} else {
- VersionRange versionRange = "latest".equals(range) ? new VersionRange("0")
- : new VersionRange(range);
+ VersionRange versionRange = "latest".equals(range) ? new VersionRange("0") : new VersionRange(range);
// We have a range search. Gather all the versions in all the repos
// and make a decision on that choice. If the same version is found
// in
// multiple repos we take the first
- SortedMap<Version, RepositoryPlugin> versions = new TreeMap<Version, RepositoryPlugin>();
+ SortedMap<Version,RepositoryPlugin> versions = new TreeMap<Version,RepositoryPlugin>();
for (RepositoryPlugin plugin : plugins) {
try {
List<Version> vs = plugin.versions(bsn);
@@ -964,7 +952,8 @@ public class Project extends Processor {
versions.put(v, plugin);
}
}
- } catch (UnsupportedOperationException ose) {
+ }
+ catch (UnsupportedOperationException ose) {
// We have a plugin that cannot list versions, try
// if it has this specific version
// The main reaosn for this code was the Maven Remote
@@ -987,13 +976,13 @@ public class Project extends Processor {
Version provider = null;
switch (useStrategy) {
- case HIGHEST:
- provider = versions.lastKey();
- break;
-
- case LOWEST:
- provider = versions.firstKey();
- break;
+ case HIGHEST :
+ provider = versions.lastKey();
+ break;
+
+ case LOWEST :
+ provider = versions.firstKey();
+ break;
}
if (provider != null) {
RepositoryPlugin repo = versions.get(provider);
@@ -1002,16 +991,15 @@ public class Project extends Processor {
if (result != null)
return toContainer(bsn, version, attrs, result);
} else
- error("Unexpected, found versions %s but then not provider for startegy %s?",
- versions, useStrategy);
+ msgs.FoundVersions_ForStrategy_ButNoProvider(versions, useStrategy);
}
}
//
// If we get this far we ran into an error somewhere
- return new Container(this, bsn, range, Container.TYPE.ERROR, null, bsn + ";version="
- + range + " Not found in " + plugins, null);
+ return new Container(this, bsn, range, Container.TYPE.ERROR, null, bsn + ";version=" + range + " Not found in "
+ + plugins, null);
}
@@ -1020,7 +1008,7 @@ public class Project extends Processor {
* @param useStrategy
* @return
*/
- protected Strategy overrideStrategy(Map<String, String> attrs, Strategy useStrategy) {
+ protected Strategy overrideStrategy(Map<String,String> attrs, Strategy useStrategy) {
if (attrs != null) {
String overrideStrategy = attrs.get("strategy");
@@ -1043,10 +1031,10 @@ public class Project extends Processor {
* @param result
* @return
*/
- protected Container toContainer(String bsn, String range, Map<String, String> attrs, File result) {
+ protected Container toContainer(String bsn, String range, Map<String,String> attrs, File result) {
File f = result;
if (f == null) {
- error("Result file for toContainer is unexpectedly null, not sure what to do");
+ msgs.ConfusedNoContainerFile();
f = new File("was null");
}
if (f.getName().endsWith("lib"))
@@ -1066,7 +1054,7 @@ public class Project extends Processor {
* @return
* @throws Exception
*/
- private Container getBundleFromProject(String bsn, Map<String, String> attrs) throws Exception {
+ private Container getBundleFromProject(String bsn, Map<String,String> attrs) throws Exception {
String pname = bsn;
while (true) {
Project p = getWorkspace().getProject(pname);
@@ -1112,9 +1100,11 @@ public class Project extends Processor {
try {
rp.put(jar);
return;
- } catch (Exception e) {
- error("Deploying " + file + " on " + rp.getName(), e);
- } finally {
+ }
+ catch (Exception e) {
+ msgs.DeployingFile_On_Exception_(file, rp.getName(), e);
+ }
+ finally {
jar.close();
}
return;
@@ -1154,27 +1144,29 @@ public class Project extends Processor {
try {
if (d.deploy(this, jar))
trace("deployed %s successfully to %s", output, d);
- } catch (Exception e) {
- error("Error while deploying %s, %s", this, e);
- e.printStackTrace();
+ }
+ catch (Exception e) {
+ msgs.Deploying(e);
}
}
- } finally {
+ }
+ finally {
jar.close();
}
}
}
/**
- * Macro access to the repository
- *
- * ${repo;<bsn>[;<version>[;<low|high>]]}
+ * Macro access to the repository ${repo;<bsn>[;<version>[;<low|high>]]}
*/
+ static String _repoHelp = "${repo ';'<bsn> [ ; <version> [; ('HIGHEST'|'LOWEST')]}";
+
public String _repo(String args[]) throws Exception {
- if (args.length < 2)
- throw new IllegalArgumentException(
- "Too few arguments for repo, syntax=: ${repo ';'<bsn> [ ; <version> [; ('HIGHEST'|'LOWEST')]}");
+ if (args.length < 2) {
+ msgs.RepoTooFewArguments(_repoHelp, args);
+ return null;
+ }
String bsns = args[1];
String version = null;
@@ -1190,8 +1182,7 @@ public class Project extends Processor {
else if (args[3].equalsIgnoreCase("EXACT"))
strategy = Strategy.EXACT;
else
- error("${repo;<bsn>;<version>;<'highest'|'lowest'|'exact'>} macro requires a strategy of 'highest' or 'lowest', and is "
- + args[3]);
+ msgs.InvalidStrategy(_repoHelp, args);
}
}
@@ -1215,8 +1206,8 @@ public class Project extends Processor {
if (container.getError() == null)
paths.add(container.getFile().getAbsolutePath());
else {
- paths.add("<<${repo} = " + container.getBundleSymbolicName() + "-"
- + container.getVersion() + " : " + container.getError() + ">>");
+ paths.add("<<${repo} = " + container.getBundleSymbolicName() + "-" + container.getVersion() + " : "
+ + container.getError() + ">>");
if (isPedantic()) {
warning("Could not expand repo path request: %s ", container);
@@ -1266,13 +1257,24 @@ public class Project extends Processor {
/**
* Check if this project needs building. This is defined as:
- *
*/
public boolean isStale() throws Exception {
+ Set<Project> visited = new HashSet<Project>();
+ return isStale(visited);
+ }
+
+ boolean isStale(Set<Project> visited) throws Exception {
// When we do not generate anything ...
if (isNoBundles())
return false;
+ if (visited.contains(this)) {
+ msgs.CircularDependencyContext_Message_(this.getName(), visited.toString());
+ return false;
+ }
+
+ visited.add(this);
+
long buildTime = 0;
files = getBuildFiles(false);
@@ -1288,6 +1290,9 @@ public class Project extends Processor {
}
for (Project dependency : getDependson()) {
+ if (dependency == this)
+ continue;
+
if (dependency.isStale())
return true;
@@ -1305,11 +1310,8 @@ public class Project extends Processor {
/**
* This method must only be called when it is sure that the project has been
- * build before in the same session.
- *
- * It is a bit yucky, but ant creates different class spaces which makes it
- * hard to detect we already build it.
- *
+ * build before in the same session. It is a bit yucky, but ant creates
+ * different class spaces which makes it hard to detect we already build it.
* This method remembers the files in the appropriate instance vars.
*
* @return
@@ -1334,7 +1336,7 @@ public class Project extends Processor {
if (!ff.isFile()) {
// Originally we warned the user
// but lets just rebuild. That way
- // the error is not noticed but
+ // the error is not noticed but
// it seems better to correct,
// See #154
rdr.close();
@@ -1344,7 +1346,8 @@ public class Project extends Processor {
files.add(ff);
}
return this.files = files.toArray(new File[files.size()]);
- } finally {
+ }
+ finally {
rdr.close();
}
}
@@ -1371,35 +1374,42 @@ public class Project extends Processor {
files = null;
ProjectBuilder builder = getBuilder(null);
- if (underTest)
- builder.setProperty(Constants.UNDERTEST, "true");
- Jar jars[] = builder.builds();
- File[] files = new File[jars.length];
-
- for (int i = 0; i < jars.length; i++) {
- Jar jar = jars[i];
- files[i] = saveBuild(jar);
- }
- getInfo(builder);
- builder.close();
- if (isOk()) {
- this.files = files;
-
- // Write out the filenames in the buildfiles file
- // so we can get them later evenin another process
- Writer fw = IO.writer(bfs);
- try {
- for (File f : files) {
- fw.append(f.getAbsolutePath());
- fw.append("\n");
+ try {
+ if (underTest)
+ builder.setProperty(Constants.UNDERTEST, "true");
+ Jar jars[] = builder.builds();
+ File[] files = new File[jars.length];
+
+ getInfo(builder);
+
+ if (isOk()) {
+ this.files = files;
+
+ for (int i = 0; i < jars.length; i++) {
+ Jar jar = jars[i];
+ files[i] = saveBuild(jar);
}
- } finally {
- fw.close();
- }
- getWorkspace().changedFile(bfs);
- return files;
- } else
- return null;
+
+ // Write out the filenames in the buildfiles file
+ // so we can get them later evenin another process
+ Writer fw = IO.writer(bfs);
+ try {
+ for (File f : files) {
+ fw.append(f.getAbsolutePath());
+ fw.append("\n");
+ }
+ }
+ finally {
+ fw.close();
+ }
+ getWorkspace().changedFile(bfs);
+ return files;
+ } else
+ return null;
+ }
+ finally {
+ builder.close();
+ }
}
/**
@@ -1429,7 +1439,8 @@ public class Project extends Processor {
}
trace(jar.getName() + " (" + f.getName() + ") " + jar.getResources().size() + " " + msg);
return f;
- } finally {
+ }
+ finally {
jar.close();
}
}
@@ -1442,7 +1453,7 @@ public class Project extends Processor {
if (isTrue(getProperty(Constants.REPORTNEWER))) {
StringBuilder sb = new StringBuilder();
String del = "Newer than " + new Date(lastModified);
- for (Map.Entry<String, Resource> entry : jar.getResources().entrySet()) {
+ for (Map.Entry<String,Resource> entry : jar.getResources().entrySet()) {
if (entry.getValue().lastModified() > lastModified) {
sb.append(del);
del = ", \n ";
@@ -1480,13 +1491,13 @@ public class Project extends Processor {
return getBase().getName();
}
- public Map<String, Action> getActions() {
- Map<String, Action> all = newMap();
- Map<String, Action> actions = newMap();
+ public Map<String,Action> getActions() {
+ Map<String,Action> all = newMap();
+ Map<String,Action> actions = newMap();
fillActions(all);
getWorkspace().fillActions(all);
- for (Map.Entry<String, Action> action : all.entrySet()) {
+ for (Map.Entry<String,Action> action : all.entrySet()) {
String key = getReplacer().process(action.getKey());
if (key != null && key.trim().length() != 0)
actions.put(key, action.getValue());
@@ -1494,20 +1505,19 @@ public class Project extends Processor {
return actions;
}
- public void fillActions(Map<String, Action> all) {
+ public void fillActions(Map<String,Action> all) {
List<NamedAction> plugins = getPlugins(NamedAction.class);
for (NamedAction a : plugins)
all.put(a.getName(), a);
Parameters actions = new Parameters(getProperty("-actions", DEFAULT_ACTIONS));
- for (Entry<String, Attrs> entry : actions.entrySet()) {
+ for (Entry<String,Attrs> entry : actions.entrySet()) {
String key = Processor.removeDuplicateMarker(entry.getKey());
Action action;
if (entry.getValue().get("script") != null) {
// TODO check for the type
- action = new ScriptAction(entry.getValue().get("type"), entry.getValue().get(
- "script"));
+ action = new ScriptAction(entry.getValue().get("type"), entry.getValue().get("script"));
} else {
action = new ReflectAction(key);
}
@@ -1593,7 +1603,8 @@ public class Project extends Processor {
try {
Jar jar = new Jar(url.getFile().replace('/', '.'), in, System.currentTimeMillis());
return getValidJar(jar, url.toString());
- } finally {
+ }
+ finally {
in.close();
}
}
@@ -1681,7 +1692,8 @@ public class Project extends Processor {
bndfile += "\n# Added by by bump\nBundle-Version: 0.0.0\n";
IO.store(bndfile, getPropertiesFile());
}
- } finally {
+ }
+ finally {
forceRefresh();
}
}
@@ -1697,7 +1709,7 @@ public class Project extends Processor {
}
public void action(String command) throws Throwable {
- Map<String, Action> actions = getActions();
+ Map<String,Action> actions = getActions();
Action a = actions.get(command);
if (a == null)
@@ -1706,7 +1718,8 @@ public class Project extends Processor {
before(this, command);
try {
a.execute(this, command);
- } catch (Throwable t) {
+ }
+ catch (Throwable t) {
after(this, command, t);
throw t;
}
@@ -1714,7 +1727,6 @@ public class Project extends Processor {
/**
* Run all before command plugins
- *
*/
void before(Project p, String a) {
List<CommandPlugin> testPlugins = getPlugins(CommandPlugin.class);
@@ -1762,15 +1774,17 @@ public class Project extends Processor {
refresh();
}
- @SuppressWarnings("unchecked") public void script(String type, String script) throws Exception {
+ @SuppressWarnings("unchecked")
+ public void script(String type, String script) throws Exception {
// TODO check tyiping
List<Scripter> scripters = getPlugins(Scripter.class);
if (scripters.isEmpty()) {
- error("Can not execute script because there are no scripters registered: %s", script);
+ msgs.NoScripters_(script);
return;
}
- @SuppressWarnings("rawtypes") Map x = (Map) getProperties();
- scripters.get(0).eval((Map<String, Object>) x, new StringReader(script));
+ @SuppressWarnings("rawtypes")
+ Map x = (Map) getProperties();
+ scripters.get(0).eval((Map<String,Object>) x, new StringReader(script));
}
public String _repos(String args[]) throws Exception {
@@ -1811,16 +1825,15 @@ public class Project extends Processor {
* Otherwise it contains all the sub bnd files.
*
* @return A collection of containers
- *
* @throws Exception
*/
public Collection<Container> getDeliverables() throws Exception {
List<Container> result = new ArrayList<Container>();
- Collection<? extends Builder> builders = getSubBuilders();
+ Collection< ? extends Builder> builders = getSubBuilders();
for (Builder builder : builders) {
- Container c = new Container(this, builder.getBsn(), builder.getVersion(),
- Container.TYPE.PROJECT, getOutputFile(builder.getBsn()), null, null);
+ Container c = new Container(this, builder.getBsn(), builder.getVersion(), Container.TYPE.PROJECT,
+ getOutputFile(builder.getBsn()), null, null);
result.add(c);
}
return result;
@@ -1847,7 +1860,7 @@ public class Project extends Processor {
if (!bndFile.getAbsolutePath().startsWith(base.getAbsolutePath()))
return null;
- Collection<? extends Builder> builders = getSubBuilders();
+ Collection< ? extends Builder> builders = getSubBuilders();
for (Builder sub : builders) {
File propertiesFile = sub.getPropertiesFile();
if (propertiesFile != null) {
@@ -1868,8 +1881,8 @@ public class Project extends Processor {
* @return null or the builder for a sub file.
* @throws Exception
*/
- public Container getDeliverable(String bsn, Map<String, String> attrs) throws Exception {
- Collection<? extends Builder> builders = getSubBuilders();
+ public Container getDeliverable(String bsn, Map<String,String> attrs) throws Exception {
+ Collection< ? extends Builder> builders = getSubBuilders();
for (Builder sub : builders) {
if (sub.getBsn().equals(bsn))
return new Container(this, getOutputFile(bsn));
@@ -1886,7 +1899,7 @@ public class Project extends Processor {
* @return A list of builders.
* @throws Exception
*/
- public Collection<? extends Builder> getSubBuilders() throws Exception {
+ public Collection< ? extends Builder> getSubBuilders() throws Exception {
return getBuilder(null).getSubBuilders();
}
@@ -1910,7 +1923,7 @@ public class Project extends Processor {
return hdr.keySet();
}
- public Map<String, String> getRunProperties() {
+ public Map<String,String> getRunProperties() {
return OSGiHeader.parseProperties(getProperty(RUNPROPERTIES));
}
@@ -1921,17 +1934,16 @@ public class Project extends Processor {
* @throws Exception
*/
public ProjectLauncher getProjectLauncher() throws Exception {
- return getHandler(ProjectLauncher.class, getRunpath(), LAUNCHER_PLUGIN,
- "biz.aQute.launcher");
+ return getHandler(ProjectLauncher.class, getRunpath(), LAUNCHER_PLUGIN, "biz.aQute.launcher");
}
public ProjectTester getProjectTester() throws Exception {
return getHandler(ProjectTester.class, getTestpath(), TESTER_PLUGIN, "biz.aQute.junit");
}
- private <T> T getHandler(Class<T> target, Collection<Container> containers, String header,
- String defaultHandler) throws Exception {
- Class<? extends T> handlerClass = target;
+ private <T> T getHandler(Class<T> target, Collection<Container> containers, String header, String defaultHandler)
+ throws Exception {
+ Class< ? extends T> handlerClass = target;
// Make sure we find at least one handler, but hope to find an earlier
// one
@@ -1946,15 +1958,13 @@ public class Project extends Processor {
if (manifest != null) {
String launcher = manifest.getMainAttributes().getValue(header);
if (launcher != null) {
- Class<?> clz = getClass(launcher, c.getFile());
+ Class< ? > clz = getClass(launcher, c.getFile());
if (clz != null) {
if (!target.isAssignableFrom(clz)) {
- error("Found a %s class in %s but it is not compatible with: %s", clz,
- c, target);
+ msgs.IncompatibleHandler_For_(launcher, defaultHandler);
} else {
handlerClass = clz.asSubclass(target);
- Constructor<? extends T> constructor = handlerClass
- .getConstructor(Project.class);
+ Constructor< ? extends T> constructor = handlerClass.getConstructor(Project.class);
return constructor.newInstance(this);
}
}
@@ -1962,34 +1972,13 @@ public class Project extends Processor {
}
}
- throw new IllegalArgumentException("Default handler for " + header + " not found in "
- + defaultHandler);
- }
-
- public synchronized boolean lock(String reason) throws InterruptedException {
- if (!lock.tryLock(5, TimeUnit.SECONDS)) {
- error("Could not acquire lock for %s, was locked by %s for %s", reason, lockingThread,
- lockingReason);
- System.err.printf("Could not acquire lock for %s, was locked by %s for %s%n", reason,
- lockingThread, lockingReason);
- System.err.flush();
- return false;
- }
- this.lockingReason = reason;
- this.lockingThread = Thread.currentThread();
- return true;
- }
-
- public void unlock() {
- lockingReason = null;
- lock.unlock();
+ throw new IllegalArgumentException("Default handler for " + header + " not found in " + defaultHandler);
}
/**
- * Make this project delay the calculation of the run dependencies.
- *
- * The run dependencies calculation can be done in prepare or until the
- * dependencies are actually needed.
+ * Make this project delay the calculation of the run dependencies. The run
+ * dependencies calculation can be done in prepare or until the dependencies
+ * are actually needed.
*/
public void setDelayRunDependencies(boolean x) {
delayRunDependencies = x;
@@ -2006,8 +1995,9 @@ public class Project extends Processor {
public void setPackageInfo(String packageName, Version version) {
try {
updatePackageInfoFile(packageName, version);
- } catch (Exception e) {
- error(e.getMessage(), e);
+ }
+ catch (Exception e) {
+ msgs.SettingPackageInfoException_(e);
}
}
@@ -2061,7 +2051,8 @@ public class Project extends Processor {
return Version.parseVersion(line.substring(8));
}
}
- } finally {
+ }
+ finally {
if (reader != null) {
IO.close(reader);
}
@@ -2073,19 +2064,19 @@ public class Project extends Processor {
* bnd maintains a class path that is set by the environment, i.e. bnd is
* not in charge of it.
*/
-
- public void addClasspath( File f) {
- if ( !f.isFile()) {
- error("Adding non existent file to the classpath %s", f);
+
+ public void addClasspath(File f) {
+ if (!f.isFile() && !f.isDirectory()) {
+ msgs.AddingNonExistentFileToClassPath_(f);
}
Container container = new Container(f);
classpath.add(container);
}
-
+
public void clearClasspath() {
classpath.clear();
}
-
+
public Collection<Container> getClasspath() {
return classpath;
}