You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@karaf.apache.org by gn...@apache.org on 2014/04/29 01:34:00 UTC
[4/7] git commit: Code formatting and other checkstyle issues
Code formatting and other checkstyle issues
Project: http://git-wip-us.apache.org/repos/asf/karaf/repo
Commit: http://git-wip-us.apache.org/repos/asf/karaf/commit/b6c5a173
Tree: http://git-wip-us.apache.org/repos/asf/karaf/tree/b6c5a173
Diff: http://git-wip-us.apache.org/repos/asf/karaf/diff/b6c5a173
Branch: refs/heads/master
Commit: b6c5a173035e9903dddcb128138c6b9de3db7915
Parents: 06b62c0
Author: Guillaume Nodet <gn...@gmail.com>
Authored: Tue Apr 29 00:38:58 2014 +0200
Committer: Guillaume Nodet <gn...@gmail.com>
Committed: Tue Apr 29 00:38:58 2014 +0200
----------------------------------------------------------------------
features/core/pom.xml | 1 -
.../org/apache/karaf/features/BundleInfo.java | 6 +-
.../apache/karaf/features/ConfigFileInfo.java | 12 +-
.../org/apache/karaf/features/Dependency.java | 27 +-
.../apache/karaf/features/EventConstants.java | 1 -
.../java/org/apache/karaf/features/Feature.java | 4 +-
.../karaf/features/FeaturesNamespaces.java | 11 +-
.../apache/karaf/features/FeaturesService.java | 16 +-
.../org/apache/karaf/features/Repository.java | 2 +-
.../internal/download/DownloadManager.java | 2 +-
.../download/simple/SimpleDownloader.java | 4 +-
.../management/FeaturesServiceMBeanImpl.java | 58 +-
.../management/StandardEmitterMBean.java | 32 +-
.../karaf/features/internal/model/Bundle.java | 141 ++---
.../features/internal/model/Capability.java | 65 +-
.../features/internal/model/Conditional.java | 7 +-
.../karaf/features/internal/model/Config.java | 74 +--
.../features/internal/model/ConfigFile.java | 97 ++-
.../karaf/features/internal/model/Content.java | 12 +-
.../features/internal/model/Dependency.java | 80 +--
.../karaf/features/internal/model/Feature.java | 192 +++---
.../karaf/features/internal/model/Features.java | 96 ++-
.../karaf/features/internal/model/JaxbUtil.java | 57 +-
.../features/internal/model/ObjectFactory.java | 58 +-
.../features/internal/model/Requirement.java | 58 +-
.../features/internal/model/ScopeFilter.java | 4 +-
.../karaf/features/internal/model/Scoping.java | 9 +-
.../features/internal/model/package-info.java | 31 +-
.../karaf/features/internal/osgi/Activator.java | 76 ++-
.../region/AbstractRegionDigraphVisitor.java | 7 +-
.../internal/region/CandidateComparator.java | 35 +-
.../features/internal/region/Subsystem.java | 4 +-
.../internal/region/SubsystemResolver.java | 15 +-
.../internal/repository/JsonRepository.java | 8 +-
.../internal/repository/StaxParser.java | 130 ++--
.../features/internal/repository/UrlLoader.java | 2 +-
.../internal/resolver/CapabilityImpl.java | 122 +---
.../internal/resolver/CapabilitySet.java | 499 ++++++---------
.../internal/resolver/FeatureResource.java | 14 +-
.../internal/resolver/RequirementImpl.java | 37 +-
.../internal/resolver/ResourceBuilder.java | 618 +++++++------------
.../internal/resolver/ResourceImpl.java | 64 +-
.../internal/resolver/ResourceUtils.java | 5 +-
.../internal/resolver/SimpleFilter.java | 518 ++++++----------
.../internal/resolver/Slf4jResolverLog.java | 24 +-
.../features/internal/service/Artifact.java | 6 +-
.../internal/service/BootFeaturesInstaller.java | 10 +-
.../internal/service/BundleComparator.java | 2 -
.../internal/service/EventAdminListener.java | 32 +-
.../service/FeatureConfigInstaller.java | 47 +-
.../internal/service/FeatureValidationUtil.java | 18 +-
.../internal/service/FeaturesServiceImpl.java | 89 ++-
.../features/internal/service/Overrides.java | 19 +-
.../internal/service/RepositoryImpl.java | 2 +-
.../internal/service/RequirementSort.java | 5 +-
.../features/internal/service/StateStorage.java | 17 +-
.../features/internal/util/ChecksumUtils.java | 2 +-
.../features/internal/util/JsonReader.java | 147 ++---
.../features/internal/util/JsonWriter.java | 47 +-
.../karaf/features/internal/util/Macro.java | 65 +-
.../karaf/features/internal/util/MapUtils.java | 9 +-
.../features/internal/util/MultiException.java | 15 +-
.../management/FeaturesServiceMBean.java | 96 +--
.../features/management/codec/JmxFeature.java | 68 +-
.../management/codec/JmxFeatureEvent.java | 13 +-
.../management/codec/JmxRepository.java | 28 +-
.../management/codec/JmxRepositoryEvent.java | 13 +-
.../equinox/internal/region/DigraphHelper.java | 11 +-
68 files changed, 1761 insertions(+), 2335 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/karaf/blob/b6c5a173/features/core/pom.xml
----------------------------------------------------------------------
diff --git a/features/core/pom.xml b/features/core/pom.xml
index 75fdf94..7972022 100644
--- a/features/core/pom.xml
+++ b/features/core/pom.xml
@@ -136,7 +136,6 @@
org.apache.felix.utils.manifest,
org.apache.karaf.util,
org.apache.karaf.util.collections,
- org.apache.karaf.util.json,
org.apache.karaf.util.tracker,
org.eclipse.equinox.internal.region.*;-split-package:=merge-first,
</Private-Package>
http://git-wip-us.apache.org/repos/asf/karaf/blob/b6c5a173/features/core/src/main/java/org/apache/karaf/features/BundleInfo.java
----------------------------------------------------------------------
diff --git a/features/core/src/main/java/org/apache/karaf/features/BundleInfo.java b/features/core/src/main/java/org/apache/karaf/features/BundleInfo.java
index 97a541f..c1a4c05 100644
--- a/features/core/src/main/java/org/apache/karaf/features/BundleInfo.java
+++ b/features/core/src/main/java/org/apache/karaf/features/BundleInfo.java
@@ -21,10 +21,10 @@ package org.apache.karaf.features;
*/
public interface BundleInfo {
- String getLocation();
-
+ String getLocation();
+
int getStartLevel();
-
+
boolean isStart();
boolean isDependency();
http://git-wip-us.apache.org/repos/asf/karaf/blob/b6c5a173/features/core/src/main/java/org/apache/karaf/features/ConfigFileInfo.java
----------------------------------------------------------------------
diff --git a/features/core/src/main/java/org/apache/karaf/features/ConfigFileInfo.java b/features/core/src/main/java/org/apache/karaf/features/ConfigFileInfo.java
index 960fb31..11dbef2 100644
--- a/features/core/src/main/java/org/apache/karaf/features/ConfigFileInfo.java
+++ b/features/core/src/main/java/org/apache/karaf/features/ConfigFileInfo.java
@@ -17,11 +17,11 @@
package org.apache.karaf.features;
public interface ConfigFileInfo {
-
- String getLocation();
-
- String getFinalname();
-
- boolean isOverride();
+
+ String getLocation();
+
+ String getFinalname();
+
+ boolean isOverride();
}
http://git-wip-us.apache.org/repos/asf/karaf/blob/b6c5a173/features/core/src/main/java/org/apache/karaf/features/Dependency.java
----------------------------------------------------------------------
diff --git a/features/core/src/main/java/org/apache/karaf/features/Dependency.java b/features/core/src/main/java/org/apache/karaf/features/Dependency.java
index cafdd92..5e019c7 100644
--- a/features/core/src/main/java/org/apache/karaf/features/Dependency.java
+++ b/features/core/src/main/java/org/apache/karaf/features/Dependency.java
@@ -1,23 +1,20 @@
/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*/
-
package org.apache.karaf.features;
public interface Dependency {
http://git-wip-us.apache.org/repos/asf/karaf/blob/b6c5a173/features/core/src/main/java/org/apache/karaf/features/EventConstants.java
----------------------------------------------------------------------
diff --git a/features/core/src/main/java/org/apache/karaf/features/EventConstants.java b/features/core/src/main/java/org/apache/karaf/features/EventConstants.java
index f83f185..5c819a0 100644
--- a/features/core/src/main/java/org/apache/karaf/features/EventConstants.java
+++ b/features/core/src/main/java/org/apache/karaf/features/EventConstants.java
@@ -42,5 +42,4 @@ public final class EventConstants {
}
-
}
http://git-wip-us.apache.org/repos/asf/karaf/blob/b6c5a173/features/core/src/main/java/org/apache/karaf/features/Feature.java
----------------------------------------------------------------------
diff --git a/features/core/src/main/java/org/apache/karaf/features/Feature.java b/features/core/src/main/java/org/apache/karaf/features/Feature.java
index 06235e2..de2de9b 100644
--- a/features/core/src/main/java/org/apache/karaf/features/Feature.java
+++ b/features/core/src/main/java/org/apache/karaf/features/Feature.java
@@ -24,7 +24,7 @@ import java.util.Map;
*/
public interface Feature {
- public static String DEFAULT_INSTALL_MODE = "auto";
+ String DEFAULT_INSTALL_MODE = "auto";
String getId();
@@ -51,7 +51,7 @@ public interface Feature {
List<ConfigFileInfo> getConfigurationFiles();
List<? extends Conditional> getConditional();
-
+
int getStartLevel();
List<? extends Capability> getCapabilities();
http://git-wip-us.apache.org/repos/asf/karaf/blob/b6c5a173/features/core/src/main/java/org/apache/karaf/features/FeaturesNamespaces.java
----------------------------------------------------------------------
diff --git a/features/core/src/main/java/org/apache/karaf/features/FeaturesNamespaces.java b/features/core/src/main/java/org/apache/karaf/features/FeaturesNamespaces.java
index 282ff71..becc252 100644
--- a/features/core/src/main/java/org/apache/karaf/features/FeaturesNamespaces.java
+++ b/features/core/src/main/java/org/apache/karaf/features/FeaturesNamespaces.java
@@ -5,13 +5,14 @@
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
+ *
* http://www.apache.org/licenses/LICENSE-2.0
*
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*/
package org.apache.karaf.features;
http://git-wip-us.apache.org/repos/asf/karaf/blob/b6c5a173/features/core/src/main/java/org/apache/karaf/features/FeaturesService.java
----------------------------------------------------------------------
diff --git a/features/core/src/main/java/org/apache/karaf/features/FeaturesService.java b/features/core/src/main/java/org/apache/karaf/features/FeaturesService.java
index 178f404..d8f3d50 100644
--- a/features/core/src/main/java/org/apache/karaf/features/FeaturesService.java
+++ b/features/core/src/main/java/org/apache/karaf/features/FeaturesService.java
@@ -38,7 +38,7 @@ public interface FeaturesService {
/**
* Validate repository contents.
- *
+ *
* @param uri Repository uri.
* @throws Exception When validation fails.
*/
@@ -51,19 +51,19 @@ public interface FeaturesService {
void removeRepository(URI uri) throws Exception;
void removeRepository(URI uri, boolean uninstall) throws Exception;
-
+
void restoreRepository(URI uri) throws Exception;
Repository[] listRequiredRepositories() throws Exception;
Repository[] listRepositories() throws Exception;
-
+
Repository getRepository(String repoName) throws Exception;
void installFeature(String name) throws Exception;
void installFeature(String name, EnumSet<Option> options) throws Exception;
-
+
void installFeature(String name, String version) throws Exception;
void installFeature(String name, String version, EnumSet<Option> options) throws Exception;
@@ -79,7 +79,7 @@ public interface FeaturesService {
void uninstallFeature(String name) throws Exception;
void uninstallFeature(String name, String version, EnumSet<Option> options) throws Exception;
-
+
void uninstallFeature(String name, String version) throws Exception;
void uninstallFeatures(Set<String> features, EnumSet<Option> options) throws Exception;
@@ -100,10 +100,10 @@ public interface FeaturesService {
Feature getFeature(String name) throws Exception;
- void refreshRepository(URI uri) throws Exception;
+ void refreshRepository(URI uri) throws Exception;
- public URI getRepositoryUriFor(String name, String version);
+ URI getRepositoryUriFor(String name, String version);
- public String[] getRepositoryNames();
+ String[] getRepositoryNames();
}
http://git-wip-us.apache.org/repos/asf/karaf/blob/b6c5a173/features/core/src/main/java/org/apache/karaf/features/Repository.java
----------------------------------------------------------------------
diff --git a/features/core/src/main/java/org/apache/karaf/features/Repository.java b/features/core/src/main/java/org/apache/karaf/features/Repository.java
index 84d4a50..0385e4b 100644
--- a/features/core/src/main/java/org/apache/karaf/features/Repository.java
+++ b/features/core/src/main/java/org/apache/karaf/features/Repository.java
@@ -31,5 +31,5 @@ public interface Repository {
URI[] getRepositories() throws Exception;
Feature[] getFeatures() throws Exception;
-
+
}
http://git-wip-us.apache.org/repos/asf/karaf/blob/b6c5a173/features/core/src/main/java/org/apache/karaf/features/internal/download/DownloadManager.java
----------------------------------------------------------------------
diff --git a/features/core/src/main/java/org/apache/karaf/features/internal/download/DownloadManager.java b/features/core/src/main/java/org/apache/karaf/features/internal/download/DownloadManager.java
index 0bac194..d9094a1 100644
--- a/features/core/src/main/java/org/apache/karaf/features/internal/download/DownloadManager.java
+++ b/features/core/src/main/java/org/apache/karaf/features/internal/download/DownloadManager.java
@@ -22,6 +22,6 @@ public interface DownloadManager {
Downloader createDownloader();
- Map<String,StreamProvider> getProviders();
+ Map<String, StreamProvider> getProviders();
}
http://git-wip-us.apache.org/repos/asf/karaf/blob/b6c5a173/features/core/src/main/java/org/apache/karaf/features/internal/download/simple/SimpleDownloader.java
----------------------------------------------------------------------
diff --git a/features/core/src/main/java/org/apache/karaf/features/internal/download/simple/SimpleDownloader.java b/features/core/src/main/java/org/apache/karaf/features/internal/download/simple/SimpleDownloader.java
index 11b20cd..91caac6 100644
--- a/features/core/src/main/java/org/apache/karaf/features/internal/download/simple/SimpleDownloader.java
+++ b/features/core/src/main/java/org/apache/karaf/features/internal/download/simple/SimpleDownloader.java
@@ -35,7 +35,7 @@ import org.apache.karaf.features.internal.download.Downloader;
import org.apache.karaf.features.internal.download.StreamProvider;
import org.apache.karaf.features.internal.util.MultiException;
- import static java.util.jar.JarFile.MANIFEST_NAME;
+import static java.util.jar.JarFile.MANIFEST_NAME;
public class SimpleDownloader implements DownloadManager, Downloader {
@@ -102,7 +102,7 @@ public class SimpleDownloader implements DownloadManager, Downloader {
protected Map<String, String> doGetMetadata() throws IOException {
try (
- InputStream is = open()
+ InputStream is = open()
) {
ZipInputStream zis = new ZipInputStream(is);
ZipEntry entry;
http://git-wip-us.apache.org/repos/asf/karaf/blob/b6c5a173/features/core/src/main/java/org/apache/karaf/features/internal/management/FeaturesServiceMBeanImpl.java
----------------------------------------------------------------------
diff --git a/features/core/src/main/java/org/apache/karaf/features/internal/management/FeaturesServiceMBeanImpl.java b/features/core/src/main/java/org/apache/karaf/features/internal/management/FeaturesServiceMBeanImpl.java
index b1a5865..4bed3c6 100644
--- a/features/core/src/main/java/org/apache/karaf/features/internal/management/FeaturesServiceMBeanImpl.java
+++ b/features/core/src/main/java/org/apache/karaf/features/internal/management/FeaturesServiceMBeanImpl.java
@@ -1,15 +1,18 @@
/*
- * Licensed under the Apache License, Version 2.0 (the "License"); you may not
- * use this file except in compliance with the License. You may obtain a copy of
- * the License at
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
- * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
- * License for the specific language governing permissions and limitations under
- * the License.
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*/
package org.apache.karaf.features.internal.management;
@@ -28,7 +31,12 @@ import javax.management.Notification;
import javax.management.ObjectName;
import javax.management.openmbean.TabularData;
-import org.apache.karaf.features.*;
+import org.apache.karaf.features.Feature;
+import org.apache.karaf.features.FeatureEvent;
+import org.apache.karaf.features.FeaturesListener;
+import org.apache.karaf.features.FeaturesService;
+import org.apache.karaf.features.Repository;
+import org.apache.karaf.features.RepositoryEvent;
import org.apache.karaf.features.management.FeaturesServiceMBean;
import org.apache.karaf.features.management.codec.JmxFeature;
import org.apache.karaf.features.management.codec.JmxFeatureEvent;
@@ -49,9 +57,9 @@ public class FeaturesServiceMBeanImpl extends StandardEmitterMBean implements
private ObjectName objectName;
- private volatile long sequenceNumber = 0;
+ private volatile long sequenceNumber;
- private org.apache.karaf.features.FeaturesService featuresService;
+ private FeaturesService featuresService;
public FeaturesServiceMBeanImpl() throws NotCompliantMBeanException {
super(FeaturesServiceMBean.class);
@@ -81,7 +89,7 @@ public class FeaturesServiceMBeanImpl extends StandardEmitterMBean implements
try {
List<Feature> allFeatures = Arrays.asList(featuresService.listFeatures());
List<Feature> insFeatures = Arrays.asList(featuresService.listInstalledFeatures());
- ArrayList<JmxFeature> features = new ArrayList<JmxFeature>();
+ ArrayList<JmxFeature> features = new ArrayList<>();
for (Feature feature : allFeatures) {
try {
features.add(new JmxFeature(feature, insFeatures.contains(feature)));
@@ -89,8 +97,7 @@ public class FeaturesServiceMBeanImpl extends StandardEmitterMBean implements
t.printStackTrace();
}
}
- TabularData table = JmxFeature.tableFrom(features);
- return table;
+ return JmxFeature.tableFrom(features);
} catch (Throwable t) {
t.printStackTrace();
return null;
@@ -103,7 +110,7 @@ public class FeaturesServiceMBeanImpl extends StandardEmitterMBean implements
public TabularData getRepositories() throws Exception {
try {
List<Repository> allRepositories = Arrays.asList(featuresService.listRepositories());
- ArrayList<JmxRepository> repositories = new ArrayList<JmxRepository>();
+ ArrayList<JmxRepository> repositories = new ArrayList<>();
for (Repository repository : allRepositories) {
try {
repositories.add(new JmxRepository(repository));
@@ -111,8 +118,7 @@ public class FeaturesServiceMBeanImpl extends StandardEmitterMBean implements
t.printStackTrace();
}
}
- TabularData table = JmxRepository.tableFrom(repositories);
- return table;
+ return JmxRepository.tableFrom(repositories);
} catch (Throwable t) {
t.printStackTrace();
return null;
@@ -202,16 +208,15 @@ public class FeaturesServiceMBeanImpl extends StandardEmitterMBean implements
}
private TabularData infoFeature(Feature feature) throws Exception {
- JmxFeature jmxFeature = null;
+ JmxFeature jmxFeature;
if (featuresService.isInstalled(feature)) {
jmxFeature = new JmxFeature(feature, true);
} else {
jmxFeature = new JmxFeature(feature, false);
}
- ArrayList<JmxFeature> features = new ArrayList<JmxFeature>();
+ ArrayList<JmxFeature> features = new ArrayList<>();
features.add(jmxFeature);
- TabularData table = JmxFeature.tableFrom(features);
- return table;
+ return JmxFeature.tableFrom(features);
}
public void uninstallFeature(String name) throws Exception {
@@ -233,7 +238,7 @@ public class FeaturesServiceMBeanImpl extends StandardEmitterMBean implements
public void uninstallFeature(String name, String version, boolean noRefresh) throws Exception {
EnumSet<org.apache.karaf.features.FeaturesService.Option> options = EnumSet.noneOf(org.apache.karaf.features.FeaturesService.Option.class);
if (noRefresh) {
- options.add(org.apache.karaf.features.FeaturesService.Option.NoAutoRefreshBundles);
+ options.add(FeaturesService.Option.NoAutoRefreshBundles);
}
featuresService.uninstallFeature(name, version, options);
}
@@ -242,7 +247,7 @@ public class FeaturesServiceMBeanImpl extends StandardEmitterMBean implements
this.bundleContext = bundleContext;
}
- public void setFeaturesService(org.apache.karaf.features.FeaturesService featuresService) {
+ public void setFeaturesService(FeaturesService featuresService) {
this.featuresService = featuresService;
}
@@ -264,13 +269,6 @@ public class FeaturesServiceMBeanImpl extends StandardEmitterMBean implements
}
}
- public boolean equals(Object o) {
- if (this == o) {
- return true;
- }
- return o.equals(this);
- }
-
};
}
http://git-wip-us.apache.org/repos/asf/karaf/blob/b6c5a173/features/core/src/main/java/org/apache/karaf/features/internal/management/StandardEmitterMBean.java
----------------------------------------------------------------------
diff --git a/features/core/src/main/java/org/apache/karaf/features/internal/management/StandardEmitterMBean.java b/features/core/src/main/java/org/apache/karaf/features/internal/management/StandardEmitterMBean.java
index 13a4b6c..37792f3 100644
--- a/features/core/src/main/java/org/apache/karaf/features/internal/management/StandardEmitterMBean.java
+++ b/features/core/src/main/java/org/apache/karaf/features/internal/management/StandardEmitterMBean.java
@@ -1,26 +1,38 @@
/*
- * Licensed under the Apache License, Version 2.0 (the "License"); you may not
- * use this file except in compliance with the License. You may obtain a copy of
- * the License at
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
- * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
- * License for the specific language governing permissions and limitations under
- * the License.
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*/
package org.apache.karaf.features.internal.management;
-import javax.management.*;
+import javax.management.ListenerNotFoundException;
+import javax.management.MBeanInfo;
+import javax.management.MBeanNotificationInfo;
+import javax.management.NotCompliantMBeanException;
+import javax.management.Notification;
+import javax.management.NotificationBroadcasterSupport;
+import javax.management.NotificationEmitter;
+import javax.management.NotificationFilter;
+import javax.management.NotificationListener;
+import javax.management.StandardMBean;
public class StandardEmitterMBean extends StandardMBean implements NotificationEmitter {
private final NotificationBroadcasterSupport emitter;
@SuppressWarnings("rawtypes")
- public StandardEmitterMBean(Class mbeanInterface) throws NotCompliantMBeanException {
+ public StandardEmitterMBean(Class mbeanInterface) throws NotCompliantMBeanException {
super(mbeanInterface);
this.emitter = new NotificationBroadcasterSupport() {
@Override
http://git-wip-us.apache.org/repos/asf/karaf/blob/b6c5a173/features/core/src/main/java/org/apache/karaf/features/internal/model/Bundle.java
----------------------------------------------------------------------
diff --git a/features/core/src/main/java/org/apache/karaf/features/internal/model/Bundle.java b/features/core/src/main/java/org/apache/karaf/features/internal/model/Bundle.java
index 7eebbe5..82b3ec3 100644
--- a/features/core/src/main/java/org/apache/karaf/features/internal/model/Bundle.java
+++ b/features/core/src/main/java/org/apache/karaf/features/internal/model/Bundle.java
@@ -1,23 +1,20 @@
/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*/
-
package org.apache.karaf.features.internal.model;
import javax.xml.bind.annotation.XmlAccessType;
@@ -26,18 +23,18 @@ import javax.xml.bind.annotation.XmlAttribute;
import javax.xml.bind.annotation.XmlSchemaType;
import javax.xml.bind.annotation.XmlType;
import javax.xml.bind.annotation.XmlValue;
+
import org.apache.karaf.features.BundleInfo;
/**
- *
* Deployable element to install.
- *
- *
+ * <p/>
+ * <p/>
* <p>Java class for bundle complex type.
- *
+ * <p/>
* <p>The following schema fragment specifies the expected content contained within this class.
- *
+ * <p/>
* <pre>
* <complexType name="bundle">
* <simpleContent>
@@ -49,13 +46,11 @@ import org.apache.karaf.features.BundleInfo;
* </simpleContent>
* </complexType>
* </pre>
- *
- *
*/
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "bundle", propOrder = {
- "value"
-})
+ "value"
+ })
public class Bundle implements BundleInfo {
@XmlValue
@@ -64,7 +59,7 @@ public class Bundle implements BundleInfo {
@XmlAttribute(name = "start-level")
protected Integer startLevel;
@XmlAttribute
- protected Boolean start;// = true;
+ protected Boolean start; // = true;
@XmlAttribute
protected Boolean dependency;
@@ -78,11 +73,9 @@ public class Bundle implements BundleInfo {
/**
* Gets the value of the value property.
- *
- * @return
- * possible object is
- * {@link String }
- *
+ *
+ * @return possible object is
+ * {@link String }
*/
public String getLocation() {
return value;
@@ -90,11 +83,9 @@ public class Bundle implements BundleInfo {
/**
* Sets the value of the value property.
- *
- * @param value
- * allowed object is
- * {@link String }
- *
+ *
+ * @param value allowed object is
+ * {@link String }
*/
public void setLocation(String value) {
this.value = value;
@@ -102,23 +93,19 @@ public class Bundle implements BundleInfo {
/**
* Gets the value of the startLevel property.
- *
- * @return
- * possible object is
- * {@link Integer }
- *
+ *
+ * @return possible object is
+ * {@link Integer }
*/
public int getStartLevel() {
- return startLevel == null? 0: startLevel;
+ return startLevel == null ? 0 : startLevel;
}
/**
* Sets the value of the startLevel property.
- *
- * @param value
- * allowed object is
- * {@link Integer }
- *
+ *
+ * @param value allowed object is
+ * {@link Integer }
*/
public void setStartLevel(Integer value) {
this.startLevel = value;
@@ -126,23 +113,19 @@ public class Bundle implements BundleInfo {
/**
* Gets the value of the start property.
- *
- * @return
- * possible object is
- * {@link Boolean }
- *
+ *
+ * @return possible object is
+ * {@link Boolean }
*/
public boolean isStart() {
- return start == null? true: start;
+ return start == null ? true : start;
}
/**
* Sets the value of the start property.
- *
- * @param value
- * allowed object is
- * {@link Boolean }
- *
+ *
+ * @param value allowed object is
+ * {@link Boolean }
*/
public void setStart(Boolean value) {
this.start = value;
@@ -150,23 +133,19 @@ public class Bundle implements BundleInfo {
/**
* Gets the value of the dependency property.
- *
- * @return
- * possible object is
- * {@link Boolean }
- *
+ *
+ * @return possible object is
+ * {@link Boolean }
*/
public boolean isDependency() {
- return dependency == null? false: dependency;
+ return dependency == null ? false : dependency;
}
/**
* Sets the value of the dependency property.
- *
- * @param value
- * allowed object is
- * {@link Boolean }
- *
+ *
+ * @param value allowed object is
+ * {@link Boolean }
*/
public void setDependency(Boolean value) {
this.dependency = value;
@@ -174,16 +153,26 @@ public class Bundle implements BundleInfo {
@Override
public boolean equals(Object o) {
- if (this == o) return true;
- if (o == null || getClass() != o.getClass()) return false;
+ if (this == o) {
+ return true;
+ }
+ if (o == null || getClass() != o.getClass()) {
+ return false;
+ }
Bundle bundle = (Bundle) o;
-
- if (dependency != bundle.dependency) return false;
- if (start != bundle.start) return false;
- if (startLevel != bundle.startLevel) return false;
- if (value != null ? !value.equals(bundle.value) : bundle.value != null) return false;
-
+ if (dependency != bundle.dependency) {
+ return false;
+ }
+ if (start != bundle.start) {
+ return false;
+ }
+ if ((startLevel != null ? startLevel : 0) != (bundle.startLevel != null ? bundle.startLevel : 0)) {
+ return false;
+ }
+ if (value != null ? !value.equals(bundle.value) : bundle.value != null) {
+ return false;
+ }
return true;
}
http://git-wip-us.apache.org/repos/asf/karaf/blob/b6c5a173/features/core/src/main/java/org/apache/karaf/features/internal/model/Capability.java
----------------------------------------------------------------------
diff --git a/features/core/src/main/java/org/apache/karaf/features/internal/model/Capability.java b/features/core/src/main/java/org/apache/karaf/features/internal/model/Capability.java
index b866151..c2ee7b7 100644
--- a/features/core/src/main/java/org/apache/karaf/features/internal/model/Capability.java
+++ b/features/core/src/main/java/org/apache/karaf/features/internal/model/Capability.java
@@ -1,44 +1,35 @@
/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*/
-
-
package org.apache.karaf.features.internal.model;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
-import javax.xml.bind.annotation.XmlAttribute;
-import javax.xml.bind.annotation.XmlSchemaType;
import javax.xml.bind.annotation.XmlType;
import javax.xml.bind.annotation.XmlValue;
-import org.apache.karaf.features.BundleInfo;
-
/**
- *
* Additional capability for a feature.
- *
- *
+ * <p/>
+ * <p/>
* <p>Java class for bundle complex type.
- *
+ * <p/>
* <p>The following schema fragment specifies the expected content contained within this class.
- *
+ * <p/>
* <pre>
* <complexType name="capability">
* <simpleContent>
@@ -47,13 +38,9 @@ import org.apache.karaf.features.BundleInfo;
* </simpleContent>
* </complexType>
* </pre>
- *
- *
*/
@XmlAccessorType(XmlAccessType.FIELD)
-@XmlType(name = "capability", propOrder = {
- "value"
-})
+@XmlType(name = "capability", propOrder = {"value"})
public class Capability implements org.apache.karaf.features.Capability {
@XmlValue
@@ -73,19 +60,21 @@ public class Capability implements org.apache.karaf.features.Capability {
@Override
public boolean equals(Object o) {
- if (this == o) return true;
- if (o == null || getClass() != o.getClass()) return false;
-
+ if (this == o) {
+ return true;
+ }
+ if (o == null || getClass() != o.getClass()) {
+ return false;
+ }
Capability bundle = (Capability) o;
-
- if (value != null ? !value.equals(bundle.value) : bundle.value != null) return false;
-
+ if (value != null ? !value.equals(bundle.value) : bundle.value != null) {
+ return false;
+ }
return true;
}
@Override
public int hashCode() {
- int result = value != null ? value.hashCode() : 0;
- return result;
+ return value != null ? value.hashCode() : 0;
}
}
http://git-wip-us.apache.org/repos/asf/karaf/blob/b6c5a173/features/core/src/main/java/org/apache/karaf/features/internal/model/Conditional.java
----------------------------------------------------------------------
diff --git a/features/core/src/main/java/org/apache/karaf/features/internal/model/Conditional.java b/features/core/src/main/java/org/apache/karaf/features/internal/model/Conditional.java
index ed0e8ff..ae309e5 100644
--- a/features/core/src/main/java/org/apache/karaf/features/internal/model/Conditional.java
+++ b/features/core/src/main/java/org/apache/karaf/features/internal/model/Conditional.java
@@ -17,12 +17,13 @@
package org.apache.karaf.features.internal.model;
import java.util.ArrayList;
-import java.util.Iterator;
import java.util.List;
+
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlType;
+
import org.apache.karaf.features.Feature;
@XmlAccessorType(XmlAccessType.FIELD)
@@ -32,7 +33,7 @@ import org.apache.karaf.features.Feature;
"configfile",
"feature",
"bundle"
-})
+ })
public class Conditional extends Content implements org.apache.karaf.features.Conditional {
@XmlElement(name = "condition")
@@ -40,7 +41,7 @@ public class Conditional extends Content implements org.apache.karaf.features.Co
public List<String> getCondition() {
if (condition == null) {
- this.condition = new ArrayList<String>();
+ this.condition = new ArrayList<>();
}
return condition;
}
http://git-wip-us.apache.org/repos/asf/karaf/blob/b6c5a173/features/core/src/main/java/org/apache/karaf/features/internal/model/Config.java
----------------------------------------------------------------------
diff --git a/features/core/src/main/java/org/apache/karaf/features/internal/model/Config.java b/features/core/src/main/java/org/apache/karaf/features/internal/model/Config.java
index a2c6674..4a89187 100644
--- a/features/core/src/main/java/org/apache/karaf/features/internal/model/Config.java
+++ b/features/core/src/main/java/org/apache/karaf/features/internal/model/Config.java
@@ -1,22 +1,19 @@
/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*/
-
package org.apache.karaf.features.internal.model;
import javax.xml.bind.annotation.XmlAccessType;
@@ -27,15 +24,14 @@ import javax.xml.bind.annotation.XmlValue;
/**
- *
* Configuration entries which should be created during feature installation. This
* configuration may be used with OSGi Configuration Admin.
- *
- *
+ * <p/>
+ * <p/>
* <p>Java class for config complex type.
- *
+ * <p/>
* <p>The following schema fragment specifies the expected content contained within this class.
- *
+ * <p/>
* <pre>
* <complexType name="config">
* <simpleContent>
@@ -45,13 +41,9 @@ import javax.xml.bind.annotation.XmlValue;
* </simpleContent>
* </complexType>
* </pre>
- *
- *
*/
@XmlAccessorType(XmlAccessType.FIELD)
-@XmlType(name = "config", propOrder = {
- "value"
-})
+@XmlType(name = "config", propOrder = {"value"})
public class Config {
@XmlValue
@@ -61,11 +53,9 @@ public class Config {
/**
* Gets the value of the value property.
- *
- * @return
- * possible object is
- * {@link String }
- *
+ *
+ * @return possible object is
+ * {@link String }
*/
public String getValue() {
return value;
@@ -73,11 +63,9 @@ public class Config {
/**
* Sets the value of the value property.
- *
- * @param value
- * allowed object is
- * {@link String }
- *
+ *
+ * @param value allowed object is
+ * {@link String }
*/
public void setValue(String value) {
this.value = value;
@@ -85,11 +73,9 @@ public class Config {
/**
* Gets the value of the name property.
- *
- * @return
- * possible object is
- * {@link String }
- *
+ *
+ * @return possible object is
+ * {@link String }
*/
public String getName() {
return name;
@@ -97,11 +83,9 @@ public class Config {
/**
* Sets the value of the name property.
- *
- * @param value
- * allowed object is
- * {@link String }
- *
+ *
+ * @param value allowed object is
+ * {@link String }
*/
public void setName(String value) {
this.name = value;
http://git-wip-us.apache.org/repos/asf/karaf/blob/b6c5a173/features/core/src/main/java/org/apache/karaf/features/internal/model/ConfigFile.java
----------------------------------------------------------------------
diff --git a/features/core/src/main/java/org/apache/karaf/features/internal/model/ConfigFile.java b/features/core/src/main/java/org/apache/karaf/features/internal/model/ConfigFile.java
index e5d9d94..a418622 100644
--- a/features/core/src/main/java/org/apache/karaf/features/internal/model/ConfigFile.java
+++ b/features/core/src/main/java/org/apache/karaf/features/internal/model/ConfigFile.java
@@ -1,22 +1,19 @@
/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*/
-
package org.apache.karaf.features.internal.model;
import javax.xml.bind.annotation.XmlAccessType;
@@ -24,18 +21,18 @@ import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlAttribute;
import javax.xml.bind.annotation.XmlType;
import javax.xml.bind.annotation.XmlValue;
+
import org.apache.karaf.features.ConfigFileInfo;
/**
- *
* Additional configuration files which should be created during feature installation.
- *
- *
+ * <p/>
+ * <p/>
* <p>Java class for configFile complex type.
- *
+ * <p/>
* <p>The following schema fragment specifies the expected content contained within this class.
- *
+ * <p/>
* <pre>
* <complexType name="configFile">
* <simpleContent>
@@ -46,13 +43,9 @@ import org.apache.karaf.features.ConfigFileInfo;
* </simpleContent>
* </complexType>
* </pre>
- *
- *
*/
@XmlAccessorType(XmlAccessType.FIELD)
-@XmlType(name = "configFile", propOrder = {
- "value"
-})
+@XmlType(name = "configFile", propOrder = {"value"})
public class ConfigFile implements ConfigFileInfo {
@XmlValue
@@ -64,11 +57,9 @@ public class ConfigFile implements ConfigFileInfo {
/**
* Gets the value of the value property.
- *
- * @return
- * possible object is
- * {@link String }
- *
+ *
+ * @return possible object is
+ * {@link String }
*/
public String getLocation() {
return value;
@@ -76,11 +67,9 @@ public class ConfigFile implements ConfigFileInfo {
/**
* Sets the value of the value property.
- *
- * @param value
- * allowed object is
- * {@link String }
- *
+ *
+ * @param value allowed object is
+ * {@link String }
*/
public void setLocation(String value) {
this.value = value;
@@ -88,11 +77,9 @@ public class ConfigFile implements ConfigFileInfo {
/**
* Gets the value of the finalname property.
- *
- * @return
- * possible object is
- * {@link String }
- *
+ *
+ * @return possible object is
+ * {@link String }
*/
public String getFinalname() {
return finalname;
@@ -100,37 +87,31 @@ public class ConfigFile implements ConfigFileInfo {
/**
* Sets the value of the finalname property.
- *
- * @param value
- * allowed object is
- * {@link String }
- *
+ *
+ * @param value allowed object is
+ * {@link String }
*/
public void setFinalname(String value) {
- this.finalname = value;
+ this.finalname = value;
}
/**
* Gets the value of the override property.
- *
- * @return
- * possible object is
- * {@link Boolean }
- *
+ *
+ * @return possible object is
+ * {@link Boolean }
*/
public boolean isOverride() {
- return override == null? false: override;
+ return override == null ? false : override;
}
/**
* Sets the value of the override property.
- *
- * @param value
- * allowed object is
- * {@link Boolean }
- *
+ *
+ * @param value allowed object is
+ * {@link Boolean }
*/
public void setOverride(Boolean value) {
- this.override = value;
+ this.override = value;
}
}
http://git-wip-us.apache.org/repos/asf/karaf/blob/b6c5a173/features/core/src/main/java/org/apache/karaf/features/internal/model/Content.java
----------------------------------------------------------------------
diff --git a/features/core/src/main/java/org/apache/karaf/features/internal/model/Content.java b/features/core/src/main/java/org/apache/karaf/features/internal/model/Content.java
index 756e4c1..3702901 100644
--- a/features/core/src/main/java/org/apache/karaf/features/internal/model/Content.java
+++ b/features/core/src/main/java/org/apache/karaf/features/internal/model/Content.java
@@ -27,7 +27,9 @@ import java.util.Map;
import java.util.Properties;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
+
import javax.xml.bind.annotation.XmlTransient;
+
import org.apache.karaf.features.BundleInfo;
import org.apache.karaf.features.ConfigFileInfo;
@@ -88,7 +90,7 @@ public class Content {
*/
public List<ConfigFile> getConfigfile() {
if (configfile == null) {
- configfile = new ArrayList<ConfigFile>();
+ configfile = new ArrayList<>();
}
return this.configfile;
}
@@ -115,7 +117,7 @@ public class Content {
*/
public List<Dependency> getFeature() {
if (feature == null) {
- feature = new ArrayList<Dependency>();
+ feature = new ArrayList<>();
}
return this.feature;
}
@@ -142,7 +144,7 @@ public class Content {
*/
public List<Bundle> getBundle() {
if (bundle == null) {
- bundle = new ArrayList<Bundle>();
+ bundle = new ArrayList<>();
}
return this.bundle;
}
@@ -181,8 +183,8 @@ public class Content {
}
@SuppressWarnings("rawtypes")
- protected void interpolation(Properties properties) {
- for (Enumeration e = properties.propertyNames(); e.hasMoreElements(); ) {
+ protected void interpolation(Properties properties) {
+ for (Enumeration e = properties.propertyNames(); e.hasMoreElements();) {
String key = (String) e.nextElement();
String val = properties.getProperty(key);
Matcher matcher = Pattern.compile("\\$\\{([^}]+)\\}").matcher(val);
http://git-wip-us.apache.org/repos/asf/karaf/blob/b6c5a173/features/core/src/main/java/org/apache/karaf/features/internal/model/Dependency.java
----------------------------------------------------------------------
diff --git a/features/core/src/main/java/org/apache/karaf/features/internal/model/Dependency.java b/features/core/src/main/java/org/apache/karaf/features/internal/model/Dependency.java
index 9c92a93..b099f28 100644
--- a/features/core/src/main/java/org/apache/karaf/features/internal/model/Dependency.java
+++ b/features/core/src/main/java/org/apache/karaf/features/internal/model/Dependency.java
@@ -1,23 +1,19 @@
/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*/
-
-
package org.apache.karaf.features.internal.model;
import javax.xml.bind.annotation.XmlAccessType;
@@ -28,14 +24,13 @@ import javax.xml.bind.annotation.XmlValue;
/**
- *
* Dependency of feature.
- *
- *
+ * <p/>
+ * <p/>
* <p>Java class for dependency complex type.
- *
+ * <p/>
* <p>The following schema fragment specifies the expected content contained within this class.
- *
+ * <p/>
* <pre>
* <complexType name="dependency">
* <simpleContent>
@@ -45,13 +40,9 @@ import javax.xml.bind.annotation.XmlValue;
* </simpleContent>
* </complexType>
* </pre>
- *
- *
*/
@XmlAccessorType(XmlAccessType.FIELD)
-@XmlType(name = "dependency", propOrder = {
- "value"
-})
+@XmlType(name = "dependency", propOrder = {"value"})
public class Dependency implements org.apache.karaf.features.Dependency {
@XmlValue
@@ -60,14 +51,10 @@ public class Dependency implements org.apache.karaf.features.Dependency {
protected String version;
/**
- *
* Feature name should be non empty string.
- *
- *
- * @return
- * possible object is
- * {@link String }
- *
+ *
+ * @return possible object is
+ * {@link String }
*/
public String getName() {
return value;
@@ -75,11 +62,9 @@ public class Dependency implements org.apache.karaf.features.Dependency {
/**
* Sets the value of the value property.
- *
- * @param value
- * allowed object is
- * {@link String }
- *
+ *
+ * @param value allowed object is
+ * {@link String }
*/
public void setName(String value) {
this.value = value;
@@ -87,11 +72,9 @@ public class Dependency implements org.apache.karaf.features.Dependency {
/**
* Gets the value of the version property.
- *
- * @return
- * possible object is
- * {@link String }
- *
+ *
+ * @return possible object is
+ * {@link String }
*/
public String getVersion() {
if (version == null) {
@@ -103,19 +86,16 @@ public class Dependency implements org.apache.karaf.features.Dependency {
/**
* Sets the value of the version property.
- *
- * @param value
- * allowed object is
- * {@link String }
- *
+ *
+ * @param value allowed object is
+ * {@link String }
*/
public void setVersion(String value) {
this.version = value;
}
public String toString() {
- String ret = getName() + Feature.SPLIT_FOR_NAME_AND_VERSION + getVersion();
- return ret;
+ return getName() + Feature.SPLIT_FOR_NAME_AND_VERSION + getVersion();
}
}
http://git-wip-us.apache.org/repos/asf/karaf/blob/b6c5a173/features/core/src/main/java/org/apache/karaf/features/internal/model/Feature.java
----------------------------------------------------------------------
diff --git a/features/core/src/main/java/org/apache/karaf/features/internal/model/Feature.java b/features/core/src/main/java/org/apache/karaf/features/internal/model/Feature.java
index 0aa5eb5..154e89a 100644
--- a/features/core/src/main/java/org/apache/karaf/features/internal/model/Feature.java
+++ b/features/core/src/main/java/org/apache/karaf/features/internal/model/Feature.java
@@ -1,22 +1,19 @@
/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*/
-
package org.apache.karaf.features.internal.model;
import java.util.ArrayList;
@@ -33,14 +30,13 @@ import javax.xml.bind.annotation.XmlType;
/**
- *
* Definition of the Feature.
- *
- *
+ * <p/>
+ * <p/>
* <p>Java class for feature complex type.
- *
+ * <p/>
* <p>The following schema fragment specifies the expected content contained within this class.
- *
+ * <p/>
* <pre>
* <complexType name="feature">
* <complexContent>
@@ -63,24 +59,23 @@ import javax.xml.bind.annotation.XmlType;
* </complexContent>
* </complexType>
* </pre>
- *
- *
*/
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "feature", propOrder = {
- "details",
- "config",
- "configfile",
- "feature",
- "bundle",
- "conditional",
- "capability",
- "requirement",
- "scoping"
-})
+ "details",
+ "config",
+ "configfile",
+ "feature",
+ "bundle",
+ "conditional",
+ "capability",
+ "requirement",
+ "scoping"
+ })
public class Feature extends Content implements org.apache.karaf.features.Feature {
- public static String SPLIT_FOR_NAME_AND_VERSION = "/";
- public static String DEFAULT_VERSION = "0.0.0";
+
+ public static final String SPLIT_FOR_NAME_AND_VERSION = "/";
+ public static final String DEFAULT_VERSION = "0.0.0";
protected String details;
@@ -115,14 +110,14 @@ public class Feature extends Content implements org.apache.karaf.features.Featur
public static org.apache.karaf.features.Feature valueOf(String str) {
- if (str.contains(SPLIT_FOR_NAME_AND_VERSION)) {
- String strName = str.substring(0, str.indexOf(SPLIT_FOR_NAME_AND_VERSION));
- String strVersion = str.substring(str.indexOf(SPLIT_FOR_NAME_AND_VERSION)
- + SPLIT_FOR_NAME_AND_VERSION.length(), str.length());
- return new Feature(strName, strVersion);
- } else {
- return new Feature(str);
- }
+ if (str.contains(SPLIT_FOR_NAME_AND_VERSION)) {
+ String strName = str.substring(0, str.indexOf(SPLIT_FOR_NAME_AND_VERSION));
+ String strVersion = str.substring(str.indexOf(SPLIT_FOR_NAME_AND_VERSION)
+ + SPLIT_FOR_NAME_AND_VERSION.length(), str.length());
+ return new Feature(strName, strVersion);
+ } else {
+ return new Feature(str);
+ }
}
@@ -134,11 +129,9 @@ public class Feature extends Content implements org.apache.karaf.features.Featur
/**
* Gets the value of the name property.
- *
- * @return
- * possible object is
- * {@link String }
- *
+ *
+ * @return possible object is
+ * {@link String }
*/
public String getName() {
return name;
@@ -146,11 +139,9 @@ public class Feature extends Content implements org.apache.karaf.features.Featur
/**
* Sets the value of the name property.
- *
- * @param value
- * allowed object is
- * {@link String }
- *
+ *
+ * @param value allowed object is
+ * {@link String }
*/
public void setName(String value) {
this.name = value;
@@ -158,11 +149,9 @@ public class Feature extends Content implements org.apache.karaf.features.Featur
/**
* Gets the value of the version property.
- *
- * @return
- * possible object is
- * {@link String }
- *
+ *
+ * @return possible object is
+ * {@link String }
*/
public String getVersion() {
if (version == null) {
@@ -174,11 +163,9 @@ public class Feature extends Content implements org.apache.karaf.features.Featur
/**
* Sets the value of the version property.
- *
- * @param value
- * allowed object is
- * {@link String }
- *
+ *
+ * @param value allowed object is
+ * {@link String }
*/
public void setVersion(String value) {
this.version = value;
@@ -194,11 +181,9 @@ public class Feature extends Content implements org.apache.karaf.features.Featur
/**
* Gets the value of the description property.
- *
- * @return
- * possible object is
- * {@link String }
- *
+ *
+ * @return possible object is
+ * {@link String }
*/
public String getDescription() {
return description;
@@ -206,11 +191,9 @@ public class Feature extends Content implements org.apache.karaf.features.Featur
/**
* Sets the value of the description property.
- *
- * @param value
- * allowed object is
- * {@link String }
- *
+ *
+ * @param value allowed object is
+ * {@link String }
*/
public void setDescription(String value) {
this.description = value;
@@ -226,11 +209,9 @@ public class Feature extends Content implements org.apache.karaf.features.Featur
/**
* Gets the value of the resolver property.
- *
- * @return
- * possible object is
- * {@link String }
- *
+ *
+ * @return possible object is
+ * {@link String }
*/
public String getResolver() {
return resolver;
@@ -246,35 +227,29 @@ public class Feature extends Content implements org.apache.karaf.features.Featur
/**
* Sets the value of the resolver property.
- *
- * @param value
- * allowed object is
- * {@link String }
- *
+ *
+ * @param value allowed object is
+ * {@link String }
*/
public void setResolver(String value) {
this.resolver = value;
}
-
+
/**
* Gets the value of the startLevel property.
- *
- * @return
- * possible object is
- * {@link Integer }
- *
+ *
+ * @return possible object is
+ * {@link Integer }
*/
public int getStartLevel() {
- return startLevel == null? 0: startLevel;
+ return startLevel == null ? 0 : startLevel;
}
/**
* Sets the value of the startLevel property.
- *
- * @param value
- * allowed object is
- * {@link Integer }
- *
+ *
+ * @param value allowed object is
+ * {@link Integer }
*/
public void setStartLevel(Integer value) {
this.startLevel = value;
@@ -302,21 +277,21 @@ public class Feature extends Content implements org.apache.karaf.features.Featur
*/
public List<Conditional> getConditional() {
if (conditional == null) {
- conditional = new ArrayList<Conditional>();
+ conditional = new ArrayList<>();
}
return this.conditional;
}
public List<Capability> getCapabilities() {
if (capability == null) {
- capability = new ArrayList<Capability>();
+ capability = new ArrayList<>();
}
return this.capability;
}
public List<Requirement> getRequirements() {
if (requirement == null) {
- requirement = new ArrayList<Requirement>();
+ requirement = new ArrayList<>();
}
return this.requirement;
}
@@ -330,19 +305,24 @@ public class Feature extends Content implements org.apache.karaf.features.Featur
}
public String toString() {
- return getId();
+ return getId();
}
@Override
public boolean equals(Object o) {
- if (this == o) return true;
- if (o == null || getClass() != o.getClass()) return false;
-
+ if (this == o) {
+ return true;
+ }
+ if (o == null || getClass() != o.getClass()) {
+ return false;
+ }
Feature feature = (Feature) o;
-
- if (name != null ? !name.equals(feature.name) : feature.name != null) return false;
- if (version != null ? !version.equals(feature.version) : feature.version != null) return false;
-
+ if (name != null ? !name.equals(feature.name) : feature.name != null) {
+ return false;
+ }
+ if (version != null ? !version.equals(feature.version) : feature.version != null) {
+ return false;
+ }
return true;
}
@@ -354,7 +334,7 @@ public class Feature extends Content implements org.apache.karaf.features.Featur
}
@SuppressWarnings("rawtypes")
- protected void interpolation(Properties properties) {
+ protected void interpolation(Properties properties) {
for (Enumeration e = properties.propertyNames(); e.hasMoreElements();) {
String key = (String) e.nextElement();
String val = properties.getProperty(key);
http://git-wip-us.apache.org/repos/asf/karaf/blob/b6c5a173/features/core/src/main/java/org/apache/karaf/features/internal/model/Features.java
----------------------------------------------------------------------
diff --git a/features/core/src/main/java/org/apache/karaf/features/internal/model/Features.java b/features/core/src/main/java/org/apache/karaf/features/internal/model/Features.java
index e116f31..0aacf63 100644
--- a/features/core/src/main/java/org/apache/karaf/features/internal/model/Features.java
+++ b/features/core/src/main/java/org/apache/karaf/features/internal/model/Features.java
@@ -1,26 +1,24 @@
/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*/
-
package org.apache.karaf.features.internal.model;
import java.util.ArrayList;
import java.util.List;
+
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlAttribute;
@@ -30,16 +28,15 @@ import javax.xml.bind.annotation.XmlType;
/**
- *
* Root element of Feature definition. It contains optional attribute which allow
* name of repository. This name will be used in shell to display source repository
* of given feature.
- *
- *
+ * <p/>
+ * <p/>
* <p>Java class for featuresRoot complex type.
- *
+ * <p/>
* <p>The following schema fragment specifies the expected content contained within this class.
- *
+ * <p/>
* <pre>
* <complexType name="features">
* <complexContent>
@@ -53,15 +50,10 @@ import javax.xml.bind.annotation.XmlType;
* </complexContent>
* </complexType>
* </pre>
- *
- *
*/
@XmlRootElement(name = "features")
@XmlAccessorType(XmlAccessType.FIELD)
-@XmlType(name = "features", propOrder = {
- "repository",
- "feature"
-})
+@XmlType(name = "features", propOrder = {"repository", "feature"})
public class Features {
@XmlSchemaType(name = "anyURI")
@@ -72,69 +64,63 @@ public class Features {
/**
* Gets the value of the repository property.
- *
- * <p>
+ * <p/>
+ * <p/>
* This accessor method returns a reference to the live list,
* not a snapshot. Therefore any modification you make to the
* returned list will be present inside the JAXB object.
* This is why there is not a <CODE>set</CODE> method for the repository property.
- *
- * <p>
+ * <p/>
+ * <p/>
* For example, to add a new item, do as follows:
* <pre>
* getRepository().add(newItem);
* </pre>
- *
- *
- * <p>
+ * <p/>
+ * <p/>
+ * <p/>
* Objects of the following type(s) are allowed in the list
* {@link String }
- *
- *
*/
public List<String> getRepository() {
if (repository == null) {
- repository = new ArrayList<String>();
+ repository = new ArrayList<>();
}
return this.repository;
}
/**
* Gets the value of the feature property.
- *
- * <p>
+ * <p/>
+ * <p/>
* This accessor method returns a reference to the live list,
* not a snapshot. Therefore any modification you make to the
* returned list will be present inside the JAXB object.
* This is why there is not a <CODE>set</CODE> method for the feature property.
- *
- * <p>
+ * <p/>
+ * <p/>
* For example, to add a new item, do as follows:
* <pre>
* getFeature().add(newItem);
* </pre>
- *
- *
- * <p>
+ * <p/>
+ * <p/>
+ * <p/>
* Objects of the following type(s) are allowed in the list
* {@link Feature }
- *
- *
*/
public List<Feature> getFeature() {
if (feature == null) {
- feature = new ArrayList<Feature>();
+ feature = new ArrayList<>();
}
return this.feature;
}
/**
* Gets the value of the name property.
- *
- * @return
- * possible object is
- * {@link String }
- *
+ *
+ * @return possible object is
+ * {@link String }
*/
public String getName() {
return name;
@@ -142,11 +128,9 @@ public class Features {
/**
* Sets the value of the name property.
- *
- * @param value
- * allowed object is
- * {@link String }
- *
+ *
+ * @param value allowed object is
+ * {@link String }
*/
public void setName(String value) {
this.name = value;
http://git-wip-us.apache.org/repos/asf/karaf/blob/b6c5a173/features/core/src/main/java/org/apache/karaf/features/internal/model/JaxbUtil.java
----------------------------------------------------------------------
diff --git a/features/core/src/main/java/org/apache/karaf/features/internal/model/JaxbUtil.java b/features/core/src/main/java/org/apache/karaf/features/internal/model/JaxbUtil.java
index 9b5d7b6..35bc0df 100644
--- a/features/core/src/main/java/org/apache/karaf/features/internal/model/JaxbUtil.java
+++ b/features/core/src/main/java/org/apache/karaf/features/internal/model/JaxbUtil.java
@@ -1,20 +1,18 @@
/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*/
package org.apache.karaf.features.internal.model;
@@ -32,7 +30,6 @@ import javax.xml.bind.JAXBContext;
import javax.xml.bind.JAXBException;
import javax.xml.bind.Marshaller;
import javax.xml.bind.Unmarshaller;
-import javax.xml.namespace.QName;
import javax.xml.transform.dom.DOMSource;
import javax.xml.transform.sax.SAXSource;
import javax.xml.transform.stream.StreamSource;
@@ -53,10 +50,12 @@ import org.xml.sax.XMLFilter;
import org.xml.sax.XMLReader;
import org.xml.sax.helpers.XMLFilterImpl;
-public class JaxbUtil {
+public final class JaxbUtil {
private static final Logger LOGGER = LoggerFactory.getLogger(JaxbUtil.class);
private static final JAXBContext FEATURES_CONTEXT;
+ private static final Map<String, Schema> SCHEMAS = new ConcurrentHashMap<>();
+
static {
try {
FEATURES_CONTEXT = JAXBContext.newInstance(Features.class);
@@ -65,6 +64,9 @@ public class JaxbUtil {
}
}
+ private JaxbUtil() {
+ }
+
public static void marshal(Features features, OutputStream out) throws JAXBException {
Marshaller marshaller = FEATURES_CONTEXT.createMarshaller();
@@ -139,20 +141,24 @@ public class JaxbUtil {
}
}
- private static Map<String, Schema> schemas = new ConcurrentHashMap<String, Schema>();
private static Schema getSchema(String namespace) throws SAXException {
- Schema schema = schemas.get(namespace);
+ Schema schema = SCHEMAS.get(namespace);
if (schema == null) {
String schemaLocation;
- if (FeaturesNamespaces.URI_1_0_0.equals(namespace)) {
+ switch (namespace) {
+ case FeaturesNamespaces.URI_1_0_0:
schemaLocation = "/org/apache/karaf/features/karaf-features-1.0.0.xsd";
- } else if (FeaturesNamespaces.URI_1_1_0.equals(namespace)) {
+ break;
+ case FeaturesNamespaces.URI_1_1_0:
schemaLocation = "/org/apache/karaf/features/karaf-features-1.1.0.xsd";
- } else if (FeaturesNamespaces.URI_1_2_0.equals(namespace)) {
+ break;
+ case FeaturesNamespaces.URI_1_2_0:
schemaLocation = "/org/apache/karaf/features/karaf-features-1.2.0.xsd";
- } else if (FeaturesNamespaces.URI_1_3_0.equals(namespace)) {
+ break;
+ case FeaturesNamespaces.URI_1_3_0:
schemaLocation = "/org/apache/karaf/features/karaf-features-1.3.0.xsd";
- } else {
+ break;
+ default:
throw new IllegalArgumentException("Unsupported namespace: " + namespace);
}
@@ -163,7 +169,7 @@ public class JaxbUtil {
throw new IllegalStateException("Could not find resource: " + schemaLocation);
}
schema = factory.newSchema(new StreamSource(url.toExternalForm()));
- schemas.put(namespace, schema);
+ SCHEMAS.put(namespace, schema);
}
return schema;
}
@@ -206,7 +212,7 @@ public class JaxbUtil {
* Converts all elements to the features namespace to make old feature files
* compatible to the new format
*/
- public static class NoSourceAndNamespaceFilter extends XMLFilterImpl {
+ public static class NoSourceAndNamespaceFilter extends XMLFilterImpl {
private static final InputSource EMPTY_INPUT_SOURCE = new InputSource(new ByteArrayInputStream(new byte[0]));
public NoSourceAndNamespaceFilter(XMLReader xmlReader) {
@@ -229,5 +235,4 @@ public class JaxbUtil {
}
}
-
}
http://git-wip-us.apache.org/repos/asf/karaf/blob/b6c5a173/features/core/src/main/java/org/apache/karaf/features/internal/model/ObjectFactory.java
----------------------------------------------------------------------
diff --git a/features/core/src/main/java/org/apache/karaf/features/internal/model/ObjectFactory.java b/features/core/src/main/java/org/apache/karaf/features/internal/model/ObjectFactory.java
index 96fbb0f..7ad5c18 100644
--- a/features/core/src/main/java/org/apache/karaf/features/internal/model/ObjectFactory.java
+++ b/features/core/src/main/java/org/apache/karaf/features/internal/model/ObjectFactory.java
@@ -1,22 +1,19 @@
/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*/
-
package org.apache.karaf.features.internal.model;
import javax.xml.bind.JAXBElement;
@@ -26,34 +23,31 @@ import javax.xml.namespace.QName;
/**
- * This object contains factory methods for each
- * Java content interface and Java element interface
+ * This object contains factory methods for each
+ * Java content interface and Java element interface
* generated in the org.apache.karaf.features.wrapper package.
- * <p>An ObjectFactory allows you to programatically
- * construct new instances of the Java representation
- * for XML content. The Java representation of XML
- * content can consist of schema derived interfaces
- * and classes representing the binding of schema
- * type definitions, element declarations and model
- * groups. Factory methods for each of these are
+ * <p>An ObjectFactory allows you to programatically
+ * construct new instances of the Java representation
+ * for XML content. The Java representation of XML
+ * content can consist of schema derived interfaces
+ * and classes representing the binding of schema
+ * type definitions, element declarations and model
+ * groups. Factory methods for each of these are
* provided in this class.
- *
*/
@XmlRegistry
public class ObjectFactory {
- private final static QName _Features_QNAME = new QName("http://karaf.apache.org/xmlns/features/v1.0.0", "features");
+ private static final QName FEATURES_QNAME = new QName("http://karaf.apache.org/xmlns/features/v1.0.0", "features");
/**
* Create a new ObjectFactory that can be used to create new instances of schema derived classes for package: org.apache.karaf.features.wrapper
- *
*/
public ObjectFactory() {
}
/**
* Create an instance of {@link ConfigFile }
- *
*/
public ConfigFile createConfigFile() {
return new ConfigFile();
@@ -61,7 +55,6 @@ public class ObjectFactory {
/**
* Create an instance of {@link Dependency }
- *
*/
public Dependency createDependency() {
return new Dependency();
@@ -69,7 +62,6 @@ public class ObjectFactory {
/**
* Create an instance of {@link Bundle }
- *
*/
public Bundle createBundle() {
return new Bundle();
@@ -77,7 +69,6 @@ public class ObjectFactory {
/**
* Create an instance of {@link Features }
- *
*/
public Features createFeaturesRoot() {
return new Features();
@@ -85,7 +76,6 @@ public class ObjectFactory {
/**
* Create an instance of {@link Config }
- *
*/
public Config createConfig() {
return new Config();
@@ -93,7 +83,6 @@ public class ObjectFactory {
/**
* Create an instance of {@link Feature }
- *
*/
public Feature createFeature() {
return new Feature();
@@ -101,11 +90,10 @@ public class ObjectFactory {
/**
* Create an instance of {@link JAXBElement }{@code <}{@link Features }{@code >}}
- *
*/
@XmlElementDecl(namespace = "http://karaf.apache.org/xmlns/features/v1.0.0", name = "features")
public JAXBElement<Features> createFeatures(Features value) {
- return new JAXBElement<Features>(_Features_QNAME, Features.class, null, value);
+ return new JAXBElement<>(FEATURES_QNAME, Features.class, null, value);
}
}