diff -Nru equinox-bundles-4.11/bundles/org.eclipse.equinox.app/META-INF/MANIFEST.MF equinox-bundles-4.12/bundles/org.eclipse.equinox.app/META-INF/MANIFEST.MF
--- equinox-bundles-4.11/bundles/org.eclipse.equinox.app/META-INF/MANIFEST.MF 2019-03-05 22:25:38.000000000 +0000
+++ equinox-bundles-4.12/bundles/org.eclipse.equinox.app/META-INF/MANIFEST.MF 2019-05-28 12:57:39.000000000 +0000
@@ -2,7 +2,7 @@
Bundle-ManifestVersion: 2
Bundle-Name: %pluginName
Bundle-SymbolicName: org.eclipse.equinox.app; singleton:=true
-Bundle-Version: 1.4.100.qualifier
+Bundle-Version: 1.4.200.qualifier
Bundle-Vendor: %providerName
Bundle-Activator: org.eclipse.equinox.internal.app.Activator
Bundle-Localization: plugin
diff -Nru equinox-bundles-4.11/bundles/org.eclipse.equinox.app/osgi/org/osgi/service/application/ApplicationAdminPermission.java equinox-bundles-4.12/bundles/org.eclipse.equinox.app/osgi/org/osgi/service/application/ApplicationAdminPermission.java
--- equinox-bundles-4.11/bundles/org.eclipse.equinox.app/osgi/org/osgi/service/application/ApplicationAdminPermission.java 2019-03-05 22:25:38.000000000 +0000
+++ equinox-bundles-4.12/bundles/org.eclipse.equinox.app/osgi/org/osgi/service/application/ApplicationAdminPermission.java 2019-05-28 12:57:39.000000000 +0000
@@ -37,7 +37,7 @@
* permission {@code schedule} implies the permission
* {@code lifecycle}.
*
- * @version $Id: 8c7941578972d6f61ed9aeffac374a0b8c294056 $
+ * @version $Id: d3217381d6d6c37fd6e96123337865abcc204bcb $
*/
public class ApplicationAdminPermission extends Permission {
private static final long serialVersionUID = 1L;
@@ -180,6 +180,7 @@
* @param otherPermission the implied permission
* @return true if this permission implies the {@code otherPermission}, false otherwise.
*/
+ @Override
public boolean implies(Permission otherPermission) {
if( otherPermission == null )
return false;
@@ -220,6 +221,7 @@
return true;
}
+ @Override
public boolean equals(Object with) {
if( with == null || !(with instanceof ApplicationAdminPermission) )
return false;
@@ -256,6 +258,7 @@
return a.equals(b);
}
+ @Override
public int hashCode() {
int hc = 0;
for( int i=0; i != actionsVector.size(); i++ )
@@ -270,6 +273,7 @@
* Returns the actions of this permission.
* @return the actions specified when this permission was created
*/
+ @Override
public String getActions() {
return actions;
}
@@ -318,6 +322,7 @@
this.appDesc = appDesc;
}
+ @Override
public boolean equals(Object o) {
if (!(o instanceof SignerWrapper))
return false;
diff -Nru equinox-bundles-4.11/bundles/org.eclipse.equinox.app/osgi/org/osgi/service/application/ApplicationDescriptor.java equinox-bundles-4.12/bundles/org.eclipse.equinox.app/osgi/org/osgi/service/application/ApplicationDescriptor.java
--- equinox-bundles-4.11/bundles/org.eclipse.equinox.app/osgi/org/osgi/service/application/ApplicationDescriptor.java 2019-03-05 22:25:38.000000000 +0000
+++ equinox-bundles-4.12/bundles/org.eclipse.equinox.app/osgi/org/osgi/service/application/ApplicationDescriptor.java 2019-05-28 12:57:39.000000000 +0000
@@ -309,12 +309,8 @@
checkArgs(arguments, false);
try {
return launchSpecific(arguments);
- } catch (IllegalStateException ise) {
+ } catch (IllegalStateException | SecurityException | ApplicationException ise) {
throw ise;
- } catch (SecurityException se) {
- throw se;
- } catch (ApplicationException ae) {
- throw ae;
} catch (Exception t) {
throw new ApplicationException(ApplicationException.APPLICATION_INTERNAL_ERROR, t);
}
diff -Nru equinox-bundles-4.11/bundles/org.eclipse.equinox.app/osgi/org/osgi/service/application/ApplicationException.java equinox-bundles-4.12/bundles/org.eclipse.equinox.app/osgi/org/osgi/service/application/ApplicationException.java
--- equinox-bundles-4.11/bundles/org.eclipse.equinox.app/osgi/org/osgi/service/application/ApplicationException.java 2019-03-05 22:25:38.000000000 +0000
+++ equinox-bundles-4.12/bundles/org.eclipse.equinox.app/osgi/org/osgi/service/application/ApplicationException.java 2019-05-28 12:57:39.000000000 +0000
@@ -44,7 +44,7 @@
* startup arguments is invalid, for example its type is not permitted.
*
*
- * @version $Id: be377d8ecd052974b3c5952c95af5c3df7334759 $
+ * @version $Id: 170922efd3358e6133e95d2e0a05d91f4f3447a3 $
*/
public class ApplicationException extends Exception {
private static final long serialVersionUID = -7173190453622508207L;
@@ -146,6 +146,7 @@
* @return The cause of this exception or {@code null} if no cause was
* set.
*/
+ @Override
public Throwable getCause() {
return super.getCause();
}
diff -Nru equinox-bundles-4.11/bundles/org.eclipse.equinox.app/pom.xml equinox-bundles-4.12/bundles/org.eclipse.equinox.app/pom.xml
--- equinox-bundles-4.11/bundles/org.eclipse.equinox.app/pom.xml 2019-03-05 22:25:38.000000000 +0000
+++ equinox-bundles-4.12/bundles/org.eclipse.equinox.app/pom.xml 2019-05-28 12:57:39.000000000 +0000
@@ -14,12 +14,12 @@
rt.equinox.bundlesorg.eclipse.equinox.bundles
- 4.11.0-SNAPSHOT
+ 4.12.0-SNAPSHOT../../org.eclipse.equinoxorg.eclipse.equinox.app
- 1.4.100-SNAPSHOT
+ 1.4.200-SNAPSHOTeclipse-plugin
diff -Nru equinox-bundles-4.11/bundles/org.eclipse.equinox.app/src/org/eclipse/equinox/internal/app/AppPersistence.java equinox-bundles-4.12/bundles/org.eclipse.equinox.app/src/org/eclipse/equinox/internal/app/AppPersistence.java
--- equinox-bundles-4.11/bundles/org.eclipse.equinox.app/src/org/eclipse/equinox/internal/app/AppPersistence.java 2019-03-05 22:25:38.000000000 +0000
+++ equinox-bundles-4.12/bundles/org.eclipse.equinox.app/src/org/eclipse/equinox/internal/app/AppPersistence.java 2019-05-28 12:57:39.000000000 +0000
@@ -273,9 +273,7 @@
}
} catch (InvalidSyntaxException e) {
throw new IOException(e.getMessage());
- } catch (NoClassDefFoundError e) {
- throw new IOException(e.getMessage());
- } catch (ClassNotFoundException e) {
+ } catch (NoClassDefFoundError | ClassNotFoundException e) {
throw new IOException(e.getMessage());
}
}
diff -Nru equinox-bundles-4.11/bundles/org.eclipse.equinox.app/src/org/eclipse/equinox/internal/app/EclipseAppHandle.java equinox-bundles-4.12/bundles/org.eclipse.equinox.app/src/org/eclipse/equinox/internal/app/EclipseAppHandle.java
--- equinox-bundles-4.11/bundles/org.eclipse.equinox.app/src/org/eclipse/equinox/internal/app/EclipseAppHandle.java 2019-03-05 22:25:38.000000000 +0000
+++ equinox-bundles-4.12/bundles/org.eclipse.equinox.app/src/org/eclipse/equinox/internal/app/EclipseAppHandle.java 2019-05-28 12:57:39.000000000 +0000
@@ -386,9 +386,7 @@
public synchronized Object waitForResult(int timeout) {
try {
return getExitValue(timeout);
- } catch (ApplicationException e) {
- // return null
- } catch (InterruptedException e) {
+ } catch (ApplicationException | InterruptedException e) {
// return null
}
return null;
diff -Nru equinox-bundles-4.11/bundles/org.eclipse.equinox.bidi/.classpath equinox-bundles-4.12/bundles/org.eclipse.equinox.bidi/.classpath
--- equinox-bundles-4.11/bundles/org.eclipse.equinox.bidi/.classpath 2019-03-05 22:25:38.000000000 +0000
+++ equinox-bundles-4.12/bundles/org.eclipse.equinox.bidi/.classpath 2019-05-28 12:57:39.000000000 +0000
@@ -1,6 +1,6 @@
-
+
diff -Nru equinox-bundles-4.11/bundles/org.eclipse.equinox.bidi/META-INF/MANIFEST.MF equinox-bundles-4.12/bundles/org.eclipse.equinox.bidi/META-INF/MANIFEST.MF
--- equinox-bundles-4.11/bundles/org.eclipse.equinox.bidi/META-INF/MANIFEST.MF 2019-03-05 22:25:38.000000000 +0000
+++ equinox-bundles-4.12/bundles/org.eclipse.equinox.bidi/META-INF/MANIFEST.MF 2019-05-28 12:57:39.000000000 +0000
@@ -3,9 +3,9 @@
Bundle-Name: %pluginName
Bundle-Vendor: %providerName
Bundle-SymbolicName: org.eclipse.equinox.bidi;singleton:=true
-Bundle-Version: 1.1.300.qualifier
+Bundle-Version: 1.2.0.qualifier
Bundle-Localization: plugin
-Bundle-RequiredExecutionEnvironment: J2SE-1.4
+Bundle-RequiredExecutionEnvironment: JavaSE-1.7
Bundle-ActivationPolicy: lazy
Export-Package: org.eclipse.equinox.bidi,
org.eclipse.equinox.bidi.advanced,
diff -Nru equinox-bundles-4.11/bundles/org.eclipse.equinox.bidi/pom.xml equinox-bundles-4.12/bundles/org.eclipse.equinox.bidi/pom.xml
--- equinox-bundles-4.11/bundles/org.eclipse.equinox.bidi/pom.xml 2019-03-05 22:25:38.000000000 +0000
+++ equinox-bundles-4.12/bundles/org.eclipse.equinox.bidi/pom.xml 2019-05-28 12:57:39.000000000 +0000
@@ -14,11 +14,11 @@
rt.equinox.bundlesorg.eclipse.equinox.bundles
- 4.11.0-SNAPSHOT
+ 4.12.0-SNAPSHOT../../org.eclipse.equinoxorg.eclipse.equinox.bidi
- 1.1.300-SNAPSHOT
+ 1.2.0-SNAPSHOTeclipse-plugin
diff -Nru equinox-bundles-4.11/bundles/org.eclipse.equinox.bidi/.settings/org.eclipse.jdt.core.prefs equinox-bundles-4.12/bundles/org.eclipse.equinox.bidi/.settings/org.eclipse.jdt.core.prefs
--- equinox-bundles-4.11/bundles/org.eclipse.equinox.bidi/.settings/org.eclipse.jdt.core.prefs 2019-03-05 22:25:38.000000000 +0000
+++ equinox-bundles-4.12/bundles/org.eclipse.equinox.bidi/.settings/org.eclipse.jdt.core.prefs 2019-05-28 12:57:39.000000000 +0000
@@ -8,16 +8,16 @@
org.eclipse.jdt.core.classpath.multipleOutputLocations=enabled
org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
org.eclipse.jdt.core.compiler.codegen.methodParameters=do not generate
-org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.2
+org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.7
org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
-org.eclipse.jdt.core.compiler.compliance=1.4
+org.eclipse.jdt.core.compiler.compliance=1.7
org.eclipse.jdt.core.compiler.debug.lineNumber=generate
org.eclipse.jdt.core.compiler.debug.localVariable=generate
org.eclipse.jdt.core.compiler.debug.sourceFile=generate
org.eclipse.jdt.core.compiler.doc.comment.support=enabled
org.eclipse.jdt.core.compiler.maxProblemPerUnit=1000
org.eclipse.jdt.core.compiler.problem.annotationSuperInterface=warning
-org.eclipse.jdt.core.compiler.problem.assertIdentifier=warning
+org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
org.eclipse.jdt.core.compiler.problem.autoboxing=ignore
org.eclipse.jdt.core.compiler.problem.comparingIdentical=warning
org.eclipse.jdt.core.compiler.problem.deprecation=warning
@@ -25,7 +25,7 @@
org.eclipse.jdt.core.compiler.problem.deprecationWhenOverridingDeprecatedMethod=enabled
org.eclipse.jdt.core.compiler.problem.discouragedReference=error
org.eclipse.jdt.core.compiler.problem.emptyStatement=warning
-org.eclipse.jdt.core.compiler.problem.enumIdentifier=warning
+org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
org.eclipse.jdt.core.compiler.problem.fallthroughCase=ignore
org.eclipse.jdt.core.compiler.problem.fatalOptionalError=enabled
org.eclipse.jdt.core.compiler.problem.fieldHiding=warning
@@ -87,23 +87,27 @@
org.eclipse.jdt.core.compiler.problem.unusedPrivateMember=error
org.eclipse.jdt.core.compiler.problem.unusedWarningToken=warning
org.eclipse.jdt.core.compiler.problem.varargsArgumentNeedCast=warning
-org.eclipse.jdt.core.compiler.source=1.3
+org.eclipse.jdt.core.compiler.source=1.7
org.eclipse.jdt.core.formatter.align_type_members_on_columns=false
+org.eclipse.jdt.core.formatter.alignment_for_additive_operator=16
org.eclipse.jdt.core.formatter.alignment_for_arguments_in_allocation_expression=16
org.eclipse.jdt.core.formatter.alignment_for_arguments_in_enum_constant=16
org.eclipse.jdt.core.formatter.alignment_for_arguments_in_explicit_constructor_call=16
org.eclipse.jdt.core.formatter.alignment_for_arguments_in_method_invocation=16
org.eclipse.jdt.core.formatter.alignment_for_arguments_in_qualified_allocation_expression=16
org.eclipse.jdt.core.formatter.alignment_for_assignment=0
-org.eclipse.jdt.core.formatter.alignment_for_binary_expression=16
+org.eclipse.jdt.core.formatter.alignment_for_bitwise_operator=16
org.eclipse.jdt.core.formatter.alignment_for_compact_if=16
org.eclipse.jdt.core.formatter.alignment_for_conditional_expression=80
org.eclipse.jdt.core.formatter.alignment_for_enum_constants=0
org.eclipse.jdt.core.formatter.alignment_for_expressions_in_array_initializer=16
+org.eclipse.jdt.core.formatter.alignment_for_logical_operator=16
org.eclipse.jdt.core.formatter.alignment_for_multiple_fields=16
+org.eclipse.jdt.core.formatter.alignment_for_multiplicative_operator=16
org.eclipse.jdt.core.formatter.alignment_for_parameters_in_constructor_declaration=16
org.eclipse.jdt.core.formatter.alignment_for_parameters_in_method_declaration=16
org.eclipse.jdt.core.formatter.alignment_for_selector_in_method_invocation=16
+org.eclipse.jdt.core.formatter.alignment_for_string_concatenation=16
org.eclipse.jdt.core.formatter.alignment_for_superclass_in_type_declaration=16
org.eclipse.jdt.core.formatter.alignment_for_superinterfaces_in_enum_declaration=16
org.eclipse.jdt.core.formatter.alignment_for_superinterfaces_in_type_declaration=16
@@ -173,11 +177,12 @@
org.eclipse.jdt.core.formatter.insert_new_line_in_empty_enum_declaration=insert
org.eclipse.jdt.core.formatter.insert_new_line_in_empty_method_body=insert
org.eclipse.jdt.core.formatter.insert_new_line_in_empty_type_declaration=insert
+org.eclipse.jdt.core.formatter.insert_space_after_additive_operator=insert
org.eclipse.jdt.core.formatter.insert_space_after_and_in_type_parameter=insert
org.eclipse.jdt.core.formatter.insert_space_after_assignment_operator=insert
org.eclipse.jdt.core.formatter.insert_space_after_at_in_annotation=do not insert
org.eclipse.jdt.core.formatter.insert_space_after_at_in_annotation_type_declaration=do not insert
-org.eclipse.jdt.core.formatter.insert_space_after_binary_operator=insert
+org.eclipse.jdt.core.formatter.insert_space_after_bitwise_operator=insert
org.eclipse.jdt.core.formatter.insert_space_after_closing_angle_bracket_in_type_arguments=insert
org.eclipse.jdt.core.formatter.insert_space_after_closing_angle_bracket_in_type_parameters=insert
org.eclipse.jdt.core.formatter.insert_space_after_closing_brace_in_block=insert
@@ -207,6 +212,8 @@
org.eclipse.jdt.core.formatter.insert_space_after_comma_in_type_arguments=insert
org.eclipse.jdt.core.formatter.insert_space_after_comma_in_type_parameters=insert
org.eclipse.jdt.core.formatter.insert_space_after_ellipsis=insert
+org.eclipse.jdt.core.formatter.insert_space_after_logical_operator=insert
+org.eclipse.jdt.core.formatter.insert_space_after_multiplicative_operator=insert
org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_parameterized_type_reference=do not insert
org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_type_arguments=do not insert
org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_type_parameters=do not insert
@@ -230,12 +237,16 @@
org.eclipse.jdt.core.formatter.insert_space_after_prefix_operator=do not insert
org.eclipse.jdt.core.formatter.insert_space_after_question_in_conditional=insert
org.eclipse.jdt.core.formatter.insert_space_after_question_in_wildcard=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_relational_operator=insert
org.eclipse.jdt.core.formatter.insert_space_after_semicolon_in_for=insert
+org.eclipse.jdt.core.formatter.insert_space_after_shift_operator=insert
+org.eclipse.jdt.core.formatter.insert_space_after_string_concatenation=insert
org.eclipse.jdt.core.formatter.insert_space_after_unary_operator=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_additive_operator=insert
org.eclipse.jdt.core.formatter.insert_space_before_and_in_type_parameter=insert
org.eclipse.jdt.core.formatter.insert_space_before_assignment_operator=insert
org.eclipse.jdt.core.formatter.insert_space_before_at_in_annotation_type_declaration=insert
-org.eclipse.jdt.core.formatter.insert_space_before_binary_operator=insert
+org.eclipse.jdt.core.formatter.insert_space_before_bitwise_operator=insert
org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_parameterized_type_reference=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_type_arguments=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_type_parameters=do not insert
@@ -281,6 +292,8 @@
org.eclipse.jdt.core.formatter.insert_space_before_comma_in_type_arguments=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_comma_in_type_parameters=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_ellipsis=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_logical_operator=insert
+org.eclipse.jdt.core.formatter.insert_space_before_multiplicative_operator=insert
org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_parameterized_type_reference=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_type_arguments=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_type_parameters=do not insert
@@ -316,8 +329,11 @@
org.eclipse.jdt.core.formatter.insert_space_before_prefix_operator=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_question_in_conditional=insert
org.eclipse.jdt.core.formatter.insert_space_before_question_in_wildcard=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_relational_operator=insert
org.eclipse.jdt.core.formatter.insert_space_before_semicolon=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_semicolon_in_for=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_shift_operator=insert
+org.eclipse.jdt.core.formatter.insert_space_before_string_concatenation=insert
org.eclipse.jdt.core.formatter.insert_space_before_unary_operator=do not insert
org.eclipse.jdt.core.formatter.insert_space_between_brackets_in_array_type_reference=do not insert
org.eclipse.jdt.core.formatter.insert_space_between_empty_braces_in_array_initializer=do not insert
@@ -340,6 +356,10 @@
org.eclipse.jdt.core.formatter.tabulation.char=tab
org.eclipse.jdt.core.formatter.tabulation.size=4
org.eclipse.jdt.core.formatter.use_tabs_only_for_leading_indentations=false
-org.eclipse.jdt.core.formatter.wrap_before_binary_operator=true
+org.eclipse.jdt.core.formatter.wrap_before_additive_operator=true
+org.eclipse.jdt.core.formatter.wrap_before_bitwise_operator=true
+org.eclipse.jdt.core.formatter.wrap_before_logical_operator=true
+org.eclipse.jdt.core.formatter.wrap_before_multiplicative_operator=true
+org.eclipse.jdt.core.formatter.wrap_before_string_concatenation=true
org.eclipse.jdt.core.incompatibleJDKLevel=ignore
org.eclipse.jdt.core.incompleteClasspath=error
diff -Nru equinox-bundles-4.11/bundles/org.eclipse.equinox.bidi/src/org/eclipse/equinox/bidi/advanced/StructuredTextEnvironment.java equinox-bundles-4.12/bundles/org.eclipse.equinox.bidi/src/org/eclipse/equinox/bidi/advanced/StructuredTextEnvironment.java
--- equinox-bundles-4.11/bundles/org.eclipse.equinox.bidi/src/org/eclipse/equinox/bidi/advanced/StructuredTextEnvironment.java 2019-03-05 22:25:38.000000000 +0000
+++ equinox-bundles-4.12/bundles/org.eclipse.equinox.bidi/src/org/eclipse/equinox/bidi/advanced/StructuredTextEnvironment.java 2019-05-28 12:57:39.000000000 +0000
@@ -211,6 +211,7 @@
*
* @return the hash code.
*/
+ @Override
public int hashCode() {
final int prime = 31;
int result = 1;
@@ -229,6 +230,7 @@
*
* @return true if the 2 instances can be used interchangeably.
*/
+ @Override
public boolean equals(Object obj) {
if (this == obj)
return true;
diff -Nru equinox-bundles-4.11/bundles/org.eclipse.equinox.bidi/src/org/eclipse/equinox/bidi/advanced/StructuredTextExpertFactory.java equinox-bundles-4.12/bundles/org.eclipse.equinox.bidi/src/org/eclipse/equinox/bidi/advanced/StructuredTextExpertFactory.java
--- equinox-bundles-4.11/bundles/org.eclipse.equinox.bidi/src/org/eclipse/equinox/bidi/advanced/StructuredTextExpertFactory.java 2019-03-05 22:25:38.000000000 +0000
+++ equinox-bundles-4.12/bundles/org.eclipse.equinox.bidi/src/org/eclipse/equinox/bidi/advanced/StructuredTextExpertFactory.java 2019-05-28 12:57:39.000000000 +0000
@@ -50,9 +50,9 @@
*/
private static final String defaultSeparators = StructuredTextProcessor.getDefaultSeparators();
- static private Map sharedDefaultExperts = new HashMap(); // String type -> expert
+ static private Map sharedDefaultExperts = new HashMap<>(); // String type -> expert
- static private Map sharedExperts = new HashMap(); // String type -> map of { environment -> expert }
+ static private Map> sharedExperts = new HashMap<>(); // String type -> map of { environment -> expert }
static private IStructuredTextExpert defaultExpert;
@@ -90,7 +90,7 @@
static public IStructuredTextExpert getExpert(String type) {
IStructuredTextExpert expert;
synchronized (sharedDefaultExperts) {
- expert = (IStructuredTextExpert) sharedDefaultExperts.get(type);
+ expert = sharedDefaultExperts.get(type);
if (expert == null) {
StructuredTextTypeHandler handler = StructuredTextTypeHandlerFactory.getHandler(type);
if (handler == null)
@@ -124,18 +124,18 @@
if (environment == null)
environment = StructuredTextEnvironment.DEFAULT;
synchronized (sharedExperts) {
- Map experts = (Map) sharedExperts.get(type);
+ Map experts = sharedExperts.get(type);
if (experts == null) {
- experts = new HashMap(); // environment -> expert
+ experts = new HashMap(); // environment -> expert
sharedExperts.put(type, experts);
}
- expert = (IStructuredTextExpert) experts.get(environment);
+ expert = experts.get(environment);
if (expert == null) {
StructuredTextTypeHandler handler = StructuredTextTypeHandlerFactory.getHandler(type);
if (handler == null)
throw new IllegalArgumentException("Invalid type argument"); //$NON-NLS-1$
expert = new StructuredTextImpl(handler, environment, false);
- experts.put(type, expert);
+ experts.put(environment, expert);
}
}
return expert;
diff -Nru equinox-bundles-4.11/bundles/org.eclipse.equinox.bidi/src/org/eclipse/equinox/bidi/custom/StructuredTextTypeHandler.java equinox-bundles-4.12/bundles/org.eclipse.equinox.bidi/src/org/eclipse/equinox/bidi/custom/StructuredTextTypeHandler.java
--- equinox-bundles-4.11/bundles/org.eclipse.equinox.bidi/src/org/eclipse/equinox/bidi/custom/StructuredTextTypeHandler.java 2019-03-05 22:25:38.000000000 +0000
+++ equinox-bundles-4.12/bundles/org.eclipse.equinox.bidi/src/org/eclipse/equinox/bidi/custom/StructuredTextTypeHandler.java 2019-05-28 12:57:39.000000000 +0000
@@ -363,6 +363,7 @@
return false;
}
+ @Override
public String toString() {
return super.toString() + " [" + separators + "]"; //$NON-NLS-1$ //$NON-NLS-2$
}
diff -Nru equinox-bundles-4.11/bundles/org.eclipse.equinox.bidi/src/org/eclipse/equinox/bidi/internal/consumable/StructuredTextEmail.java equinox-bundles-4.12/bundles/org.eclipse.equinox.bidi/src/org/eclipse/equinox/bidi/internal/consumable/StructuredTextEmail.java
--- equinox-bundles-4.11/bundles/org.eclipse.equinox.bidi/src/org/eclipse/equinox/bidi/internal/consumable/StructuredTextEmail.java 2019-03-05 22:25:38.000000000 +0000
+++ equinox-bundles-4.12/bundles/org.eclipse.equinox.bidi/src/org/eclipse/equinox/bidi/internal/consumable/StructuredTextEmail.java 2019-05-28 12:57:39.000000000 +0000
@@ -29,6 +29,7 @@
super("<>.:,;@"); //$NON-NLS-1$
}
+ @Override
public int getDirection(IStructuredTextExpert expert, String text) {
return getDirection(expert, text, new StructuredTextCharTypes(expert, text));
}
@@ -44,6 +45,7 @@
*
* Otherwise, returns {@link IStructuredTextExpert#DIR_LTR DIR_LTR}.
*/
+ @Override
public int getDirection(IStructuredTextExpert expert, String text, StructuredTextCharTypes charTypes) {
String language = expert.getEnvironment().getLanguage();
if (!language.equals("ar")) //$NON-NLS-1$
@@ -63,6 +65,7 @@
/**
* @return 2 as number of special cases handled by this handler.
*/
+ @Override
public int getSpecialsCount(IStructuredTextExpert expert) {
return 2;
}
@@ -70,6 +73,7 @@
/**
* @return parentheses and quotation marks as delimiters.
*/
+ @Override
protected String getDelimiters() {
return "()\"\""; //$NON-NLS-1$
}
diff -Nru equinox-bundles-4.11/bundles/org.eclipse.equinox.bidi/src/org/eclipse/equinox/bidi/internal/consumable/StructuredTextJava.java equinox-bundles-4.12/bundles/org.eclipse.equinox.bidi/src/org/eclipse/equinox/bidi/internal/consumable/StructuredTextJava.java
--- equinox-bundles-4.11/bundles/org.eclipse.equinox.bidi/src/org/eclipse/equinox/bidi/internal/consumable/StructuredTextJava.java 2019-03-05 22:25:38.000000000 +0000
+++ equinox-bundles-4.12/bundles/org.eclipse.equinox.bidi/src/org/eclipse/equinox/bidi/internal/consumable/StructuredTextJava.java 2019-05-28 12:57:39.000000000 +0000
@@ -45,6 +45,7 @@
/**
* @return 4 as the number of special cases handled by this handler.
*/
+ @Override
public int getSpecialsCount(IStructuredTextExpert expert) {
return 4;
}
@@ -58,6 +59,7 @@
*
comments starting with slash-slash
*
*/
+ @Override
public int indexOfSpecial(IStructuredTextExpert expert, String text, StructuredTextCharTypes charTypes, StructuredTextOffsets offsets, int caseNumber, int fromIndex) {
switch (caseNumber) {
case 1 : /* space */
@@ -82,6 +84,7 @@
*
skip until after a line separator
*
*/
+ @Override
public int processSpecial(IStructuredTextExpert expert, String text, StructuredTextCharTypes charTypes, StructuredTextOffsets offsets, int caseNumber, int separLocation) {
int location, counter, i;
diff -Nru equinox-bundles-4.11/bundles/org.eclipse.equinox.bidi/src/org/eclipse/equinox/bidi/internal/consumable/StructuredTextRegex.java equinox-bundles-4.12/bundles/org.eclipse.equinox.bidi/src/org/eclipse/equinox/bidi/internal/consumable/StructuredTextRegex.java
--- equinox-bundles-4.11/bundles/org.eclipse.equinox.bidi/src/org/eclipse/equinox/bidi/internal/consumable/StructuredTextRegex.java 2019-03-05 22:25:38.000000000 +0000
+++ equinox-bundles-4.12/bundles/org.eclipse.equinox.bidi/src/org/eclipse/equinox/bidi/internal/consumable/StructuredTextRegex.java 2019-05-28 12:57:39.000000000 +0000
@@ -71,6 +71,7 @@
*
* @return the number of special cases for this handler.
*/
+ @Override
public int getSpecialsCount(IStructuredTextExpert expert) {
return maxSpecial;
}
@@ -79,6 +80,7 @@
* Locates occurrences of the syntactic strings and of
* R, AL, EN, AN characters.
*/
+ @Override
public int indexOfSpecial(IStructuredTextExpert expert, String text, StructuredTextCharTypes charTypes, StructuredTextOffsets offsets, int caseNumber, int fromIndex) {
// In this method, L, R, AL, AN and EN represent bidi categories
// as defined in the Unicode Bidirectional Algorithm
@@ -147,6 +149,7 @@
/**
* Processes the special cases.
*/
+ @Override
public int processSpecial(IStructuredTextExpert expert, String text, StructuredTextCharTypes charTypes, StructuredTextOffsets offsets, int caseNumber, int separLocation) {
int location;
@@ -221,6 +224,7 @@
return text.length();
}
+ @Override
public int getDirection(IStructuredTextExpert expert, String text) {
return getDirection(expert, text, new StructuredTextCharTypes(expert, text));
}
@@ -237,6 +241,7 @@
*
* Otherwise, returns {@link IStructuredTextExpert#DIR_LTR DIR_LTR}.
*/
+ @Override
public int getDirection(IStructuredTextExpert expert, String text, StructuredTextCharTypes charTypes) {
StructuredTextEnvironment environment = expert.getEnvironment();
String language = environment.getLanguage();
diff -Nru equinox-bundles-4.11/bundles/org.eclipse.equinox.bidi/src/org/eclipse/equinox/bidi/internal/consumable/StructuredTextSql.java equinox-bundles-4.12/bundles/org.eclipse.equinox.bidi/src/org/eclipse/equinox/bidi/internal/consumable/StructuredTextSql.java
--- equinox-bundles-4.11/bundles/org.eclipse.equinox.bidi/src/org/eclipse/equinox/bidi/internal/consumable/StructuredTextSql.java 2019-03-05 22:25:38.000000000 +0000
+++ equinox-bundles-4.12/bundles/org.eclipse.equinox.bidi/src/org/eclipse/equinox/bidi/internal/consumable/StructuredTextSql.java 2019-05-28 12:57:39.000000000 +0000
@@ -46,6 +46,7 @@
/**
* @return 5 as the number of special cases handled by this handler.
*/
+ @Override
public int getSpecialsCount(IStructuredTextExpert expert) {
return 5;
}
@@ -60,6 +61,7 @@
*
comments starting with hyphen-hyphen
*
*/
+ @Override
public int indexOfSpecial(IStructuredTextExpert expert, String text, StructuredTextCharTypes charTypes, StructuredTextOffsets offsets, int caseNumber, int fromIndex) {
switch (caseNumber) {
case 1 : /* space */
@@ -87,6 +89,7 @@
*
skip until after a line separator
*
*/
+ @Override
public int processSpecial(IStructuredTextExpert expert, String text, StructuredTextCharTypes charTypes, StructuredTextOffsets offsets, int caseNumber, int separLocation) {
int location;
diff -Nru equinox-bundles-4.11/bundles/org.eclipse.equinox.bidi/src/org/eclipse/equinox/bidi/internal/consumable/StructuredTextXPath.java equinox-bundles-4.12/bundles/org.eclipse.equinox.bidi/src/org/eclipse/equinox/bidi/internal/consumable/StructuredTextXPath.java
--- equinox-bundles-4.11/bundles/org.eclipse.equinox.bidi/src/org/eclipse/equinox/bidi/internal/consumable/StructuredTextXPath.java 2019-03-05 22:25:38.000000000 +0000
+++ equinox-bundles-4.12/bundles/org.eclipse.equinox.bidi/src/org/eclipse/equinox/bidi/internal/consumable/StructuredTextXPath.java 2019-05-28 12:57:39.000000000 +0000
@@ -28,6 +28,7 @@
/**
* @return 2 as the number of special cases handled by this handler.
*/
+ @Override
public int getSpecialsCount(IStructuredTextExpert expert) {
return 2;
}
@@ -35,6 +36,7 @@
/**
* @return apostrophe and quotation mark as delimiters.
*/
+ @Override
protected String getDelimiters() {
return "''\"\""; //$NON-NLS-1$
}
diff -Nru equinox-bundles-4.11/bundles/org.eclipse.equinox.bidi/src/org/eclipse/equinox/bidi/internal/StructuredTextActivator.java equinox-bundles-4.12/bundles/org.eclipse.equinox.bidi/src/org/eclipse/equinox/bidi/internal/StructuredTextActivator.java
--- equinox-bundles-4.11/bundles/org.eclipse.equinox.bidi/src/org/eclipse/equinox/bidi/internal/StructuredTextActivator.java 2019-03-05 22:25:38.000000000 +0000
+++ equinox-bundles-4.12/bundles/org.eclipse.equinox.bidi/src/org/eclipse/equinox/bidi/internal/StructuredTextActivator.java 2019-05-28 12:57:39.000000000 +0000
@@ -25,7 +25,7 @@
*/
public class StructuredTextActivator implements BundleActivator {
- private ServiceTracker logTracker = null;
+ private ServiceTracker logTracker = null;
private BundleContext bundleContext;
private static StructuredTextActivator instance;
@@ -71,7 +71,7 @@
public Locale getDefaultLocale() {
// use OSGi service
- ServiceReference[] references = null;
+ ServiceReference>[] references = null;
try {
references = bundleContext.getAllServiceReferences(null, LocaleProvider.class.getName());
} catch (InvalidSyntaxException e) {
@@ -92,10 +92,10 @@
private FrameworkLog getFrameworkLog() {
if (logTracker == null) {
- logTracker = new ServiceTracker(bundleContext, FrameworkLog.class.getName(), null);
+ logTracker = new ServiceTracker<>(bundleContext, FrameworkLog.class, null);
logTracker.open();
}
- return (FrameworkLog) logTracker.getService();
+ return logTracker.getService();
}
static public void logError(String message, Exception e) {
diff -Nru equinox-bundles-4.11/bundles/org.eclipse.equinox.bidi/src/org/eclipse/equinox/bidi/internal/StructuredTextDelimsEsc.java equinox-bundles-4.12/bundles/org.eclipse.equinox.bidi/src/org/eclipse/equinox/bidi/internal/StructuredTextDelimsEsc.java
--- equinox-bundles-4.11/bundles/org.eclipse.equinox.bidi/src/org/eclipse/equinox/bidi/internal/StructuredTextDelimsEsc.java 2019-03-05 22:25:38.000000000 +0000
+++ equinox-bundles-4.12/bundles/org.eclipse.equinox.bidi/src/org/eclipse/equinox/bidi/internal/StructuredTextDelimsEsc.java 2019-05-28 12:57:39.000000000 +0000
@@ -49,6 +49,7 @@
* and skips until after the matching end delimiter,
* ignoring possibly escaped end delimiters.
*/
+ @Override
public int processSpecial(IStructuredTextExpert expert, String text, StructuredTextCharTypes charTypes, StructuredTextOffsets offsets, int caseNumber, int separLocation) {
StructuredTextTypeHandler.processSeparator(text, charTypes, offsets, separLocation);
int location = separLocation + 1;
diff -Nru equinox-bundles-4.11/bundles/org.eclipse.equinox.bidi/src/org/eclipse/equinox/bidi/internal/StructuredTextDelims.java equinox-bundles-4.12/bundles/org.eclipse.equinox.bidi/src/org/eclipse/equinox/bidi/internal/StructuredTextDelims.java
--- equinox-bundles-4.11/bundles/org.eclipse.equinox.bidi/src/org/eclipse/equinox/bidi/internal/StructuredTextDelims.java 2019-03-05 22:25:38.000000000 +0000
+++ equinox-bundles-4.12/bundles/org.eclipse.equinox.bidi/src/org/eclipse/equinox/bidi/internal/StructuredTextDelims.java 2019-05-28 12:57:39.000000000 +0000
@@ -45,6 +45,7 @@
*
* @see #getDelimiters
*/
+ @Override
public int indexOfSpecial(IStructuredTextExpert expert, String text, StructuredTextCharTypes charTypes, StructuredTextOffsets offsets, int caseNumber, int fromIndex) {
char delim = getDelimiters().charAt((caseNumber - 1) * 2);
return text.indexOf(delim, fromIndex);
@@ -59,6 +60,7 @@
* @return the position after the matching end delimiter, or the length
* of text if no end delimiter is found.
*/
+ @Override
public int processSpecial(IStructuredTextExpert expert, String text, StructuredTextCharTypes charTypes, StructuredTextOffsets offsets, int caseNumber, int separLocation) {
StructuredTextTypeHandler.processSeparator(text, charTypes, offsets, separLocation);
int loc = separLocation + 1;
diff -Nru equinox-bundles-4.11/bundles/org.eclipse.equinox.bidi/src/org/eclipse/equinox/bidi/internal/StructuredTextImpl.java equinox-bundles-4.12/bundles/org.eclipse.equinox.bidi/src/org/eclipse/equinox/bidi/internal/StructuredTextImpl.java
--- equinox-bundles-4.11/bundles/org.eclipse.equinox.bidi/src/org/eclipse/equinox/bidi/internal/StructuredTextImpl.java 2019-03-05 22:25:38.000000000 +0000
+++ equinox-bundles-4.12/bundles/org.eclipse.equinox.bidi/src/org/eclipse/equinox/bidi/internal/StructuredTextImpl.java 2019-05-28 12:57:39.000000000 +0000
@@ -81,28 +81,34 @@
sharedExpert = shared;
}
+ @Override
public StructuredTextTypeHandler getTypeHandler() {
return handler;
}
+ @Override
public StructuredTextEnvironment getEnvironment() {
return environment;
}
+ @Override
public int getTextDirection(String text) {
return handler.getDirection(this, text);
}
+ @Override
public void clearState() {
if (sharedExpert)
state = null;
}
+ @Override
public void setState(Object newState) {
if (sharedExpert)
state = newState;
}
+ @Override
public Object getState() {
return state;
}
@@ -248,6 +254,7 @@
* formatting characters as either prefix or suffix of the full text.
*
*/
+ @Override
public String leanToFullText(String text) {
int len = text.length();
if (len == 0)
@@ -259,6 +266,7 @@
return insertMarks(text, offsets.getOffsets(), direction, prefixLength);
}
+ @Override
public int[] leanToFullMap(String text) {
int len = text.length();
if (len == 0)
@@ -279,6 +287,7 @@
return map;
}
+ @Override
public int[] leanBidiCharOffsets(String text) {
int len = text.length();
if (len == 0)
@@ -342,6 +351,7 @@
return offsets;
}
+ @Override
public String fullToLeanText(String full) {
if (full.length() == 0)
return full;
@@ -446,6 +456,7 @@
return lean;
}
+ @Override
public int[] fullToLeanMap(String full) {
int lenFull = full.length();
if (lenFull == 0)
@@ -477,6 +488,7 @@
return map;
}
+ @Override
public int[] fullBidiCharOffsets(String full) {
int lenFull = full.length();
if (lenFull == 0)
@@ -497,6 +509,7 @@
return offsets.getOffsets();
}
+ @Override
public String insertMarks(String text, int[] offsets, int direction, int affixLength) {
if (direction != DIR_LTR && direction != DIR_RTL)
throw new IllegalArgumentException("Invalid direction"); //$NON-NLS-1$
@@ -545,6 +558,7 @@
return new String(fullChars);
}
+ @Override
public String toString() {
return super.toString() + " [handler=" + handler.toString() + "]"; //$NON-NLS-1$ //$NON-NLS-2$
}
diff -Nru equinox-bundles-4.11/bundles/org.eclipse.equinox.bidi/src/org/eclipse/equinox/bidi/internal/StructuredTextSingle.java equinox-bundles-4.12/bundles/org.eclipse.equinox.bidi/src/org/eclipse/equinox/bidi/internal/StructuredTextSingle.java
--- equinox-bundles-4.11/bundles/org.eclipse.equinox.bidi/src/org/eclipse/equinox/bidi/internal/StructuredTextSingle.java 2019-03-05 22:25:38.000000000 +0000
+++ equinox-bundles-4.12/bundles/org.eclipse.equinox.bidi/src/org/eclipse/equinox/bidi/internal/StructuredTextSingle.java 2019-05-28 12:57:39.000000000 +0000
@@ -41,6 +41,7 @@
*
* @see #getSeparators getSeparators
*/
+ @Override
public int indexOfSpecial(IStructuredTextExpert expert, String text, StructuredTextCharTypes charTypes, StructuredTextOffsets offsets, int caseNumber, int fromIndex) {
return text.indexOf(this.getSeparators(expert).charAt(0), fromIndex);
}
@@ -51,6 +52,7 @@
*
* @return the length of text.
*/
+ @Override
public int processSpecial(IStructuredTextExpert expert, String text, StructuredTextCharTypes charTypes, StructuredTextOffsets offsets, int caseNumber, int separLocation) {
StructuredTextTypeHandler.processSeparator(text, charTypes, offsets, separLocation);
return text.length();
@@ -61,6 +63,7 @@
*
* @return 1.
*/
+ @Override
public int getSpecialsCount(IStructuredTextExpert expert) {
return 1;
}
diff -Nru equinox-bundles-4.11/bundles/org.eclipse.equinox.bidi/src/org/eclipse/equinox/bidi/internal/StructuredTextStringRecord.java equinox-bundles-4.12/bundles/org.eclipse.equinox.bidi/src/org/eclipse/equinox/bidi/internal/StructuredTextStringRecord.java
--- equinox-bundles-4.11/bundles/org.eclipse.equinox.bidi/src/org/eclipse/equinox/bidi/internal/StructuredTextStringRecord.java 2019-03-05 22:25:38.000000000 +0000
+++ equinox-bundles-4.12/bundles/org.eclipse.equinox.bidi/src/org/eclipse/equinox/bidi/internal/StructuredTextStringRecord.java 2019-05-28 12:57:39.000000000 +0000
@@ -47,7 +47,8 @@
private static boolean wrapAround;
// the pool
- private static SoftReference[] recordRefs = new SoftReference[POOLSIZE];
+ @SuppressWarnings("unchecked")
+ private static SoftReference[] recordRefs = new SoftReference[POOLSIZE];
// hash code of the recorded strings
private static int[] hashArray = new int[POOLSIZE];
@@ -124,10 +125,10 @@
}
StructuredTextStringRecord record = null;
if (recordRefs[last] != null)
- record = (StructuredTextStringRecord) recordRefs[last].get();
+ record = recordRefs[last].get();
if (record == null) {
record = new StructuredTextStringRecord();
- recordRefs[last] = new SoftReference(record);
+ recordRefs[last] = new SoftReference<>(record);
}
hashArray[last] = string.hashCode();
for (int i = 0; i < record.usedSegmentCount; i++)
@@ -208,7 +209,7 @@
for (int i = myLast; i >= 0; i--) {
if (hash != hashArray[i])
continue;
- record = (StructuredTextStringRecord) recordRefs[i].get();
+ record = recordRefs[i].get();
if (record == null)
continue;
if (string.equals(record.string))
@@ -219,7 +220,7 @@
for (int i = MAXINDEX; i > myLast; i--) {
if (hash != hashArray[i])
continue;
- record = (StructuredTextStringRecord) recordRefs[i].get();
+ record = recordRefs[i].get();
if (record == null)
continue;
if (string.equals(record.string))
@@ -304,10 +305,10 @@
public static synchronized void clear() {
for (int i = 0; i <= MAXINDEX; i++) {
hashArray[i] = 0;
- SoftReference softRef = recordRefs[i];
+ SoftReference softRef = recordRefs[i];
if (softRef == null)
continue;
- StructuredTextStringRecord record = (StructuredTextStringRecord) softRef.get();
+ StructuredTextStringRecord record = softRef.get();
if (record == null)
continue;
record.boundaries = null;
diff -Nru equinox-bundles-4.11/bundles/org.eclipse.equinox.bidi/src/org/eclipse/equinox/bidi/internal/StructuredTextTypesCollector.java equinox-bundles-4.12/bundles/org.eclipse.equinox.bidi/src/org/eclipse/equinox/bidi/internal/StructuredTextTypesCollector.java
--- equinox-bundles-4.11/bundles/org.eclipse.equinox.bidi/src/org/eclipse/equinox/bidi/internal/StructuredTextTypesCollector.java 2019-03-05 22:25:38.000000000 +0000
+++ equinox-bundles-4.12/bundles/org.eclipse.equinox.bidi/src/org/eclipse/equinox/bidi/internal/StructuredTextTypesCollector.java 2019-05-28 12:57:39.000000000 +0000
@@ -30,8 +30,8 @@
private static final String ATTR_TYPE = "type"; //$NON-NLS-1$
private static final String ATTR_HANDLER = "class"; //$NON-NLS-1$
- private Map types;
- private Map factories;
+ private Map types;
+ private Map factories;
static private StructuredTextTypesCollector instance = new StructuredTextTypesCollector();
@@ -76,12 +76,12 @@
private void read() {
if (types == null)
- types = new HashMap();
+ types = new HashMap<>();
else
types.clear();
if (factories == null)
- factories = new HashMap();
+ factories = new HashMap();
else
factories.clear();
@@ -107,8 +107,10 @@
StructuredTextActivator.logError("BiDi types: unable to create handler for " + type, e); //$NON-NLS-1$
continue;
}
- types.put(type, handler);
- factories.put(type, confElements[j]);
+ if (handler instanceof StructuredTextTypeHandler) {
+ types.put(type, (StructuredTextTypeHandler) handler);
+ factories.put(type, confElements[j]);
+ }
}
}
}
@@ -140,8 +142,8 @@
* @return a map from structured text type handler identifier (key type: {@link String})
* to structured text type handler (value type: {@link StructuredTextTypeHandler}).
*/
- public static Map getDefaultTypeHandlers() {
- Map types = new LinkedHashMap();
+ public static Map getDefaultTypeHandlers() {
+ Map types = new LinkedHashMap();
types.put(StructuredTextTypeHandlerFactory.COMMA_DELIMITED, new StructuredTextComma());
types.put(StructuredTextTypeHandlerFactory.EMAIL, new StructuredTextEmail());
diff -Nru equinox-bundles-4.11/bundles/org.eclipse.equinox.bidi.tests/.classpath equinox-bundles-4.12/bundles/org.eclipse.equinox.bidi.tests/.classpath
--- equinox-bundles-4.11/bundles/org.eclipse.equinox.bidi.tests/.classpath 2019-03-05 22:25:38.000000000 +0000
+++ equinox-bundles-4.12/bundles/org.eclipse.equinox.bidi.tests/.classpath 2019-05-28 12:57:39.000000000 +0000
@@ -1,7 +1,11 @@
-
+
-
+
+
+
+
+
diff -Nru equinox-bundles-4.11/bundles/org.eclipse.equinox.bidi.tests/META-INF/MANIFEST.MF equinox-bundles-4.12/bundles/org.eclipse.equinox.bidi.tests/META-INF/MANIFEST.MF
--- equinox-bundles-4.11/bundles/org.eclipse.equinox.bidi.tests/META-INF/MANIFEST.MF 2019-03-05 22:25:38.000000000 +0000
+++ equinox-bundles-4.12/bundles/org.eclipse.equinox.bidi.tests/META-INF/MANIFEST.MF 2019-05-28 12:57:39.000000000 +0000
@@ -2,12 +2,12 @@
Bundle-ManifestVersion: 2
Bundle-Name: BiDi tests
Bundle-SymbolicName: org.eclipse.equinox.bidi.tests;singleton:=true
-Bundle-Version: 1.0.400.qualifier
+Bundle-Version: 1.1.0.qualifier
Require-Bundle: org.eclipse.equinox.bidi;bundle-version="1.0.0",
org.eclipse.equinox.registry;bundle-version="3.5.0",
org.junit;bundle-version="4.12.0"
Bundle-ActivationPolicy: lazy
-Bundle-RequiredExecutionEnvironment: J2SE-1.5
+Bundle-RequiredExecutionEnvironment: JavaSE-1.7
Export-Package: org.eclipse.equinox.bidi.internal.tests;x-internal:=true,
org.eclipse.equinox.bidi.tests
Eclipse-BundleShape: dir
diff -Nru equinox-bundles-4.11/bundles/org.eclipse.equinox.bidi.tests/pom.xml equinox-bundles-4.12/bundles/org.eclipse.equinox.bidi.tests/pom.xml
--- equinox-bundles-4.11/bundles/org.eclipse.equinox.bidi.tests/pom.xml 2019-03-05 22:25:38.000000000 +0000
+++ equinox-bundles-4.12/bundles/org.eclipse.equinox.bidi.tests/pom.xml 2019-05-28 12:57:39.000000000 +0000
@@ -14,11 +14,11 @@
tests-pomorg.eclipse.equinox.bundles
- 4.11.0-SNAPSHOT
+ 4.12.0-SNAPSHOT../../tests-pom/org.eclipse.equinoxorg.eclipse.equinox.bidi.tests
- 1.0.400-SNAPSHOT
+ 1.1.0-SNAPSHOTeclipse-test-plugin
diff -Nru equinox-bundles-4.11/bundles/org.eclipse.equinox.bidi.tests/.settings/org.eclipse.jdt.core.prefs equinox-bundles-4.12/bundles/org.eclipse.equinox.bidi.tests/.settings/org.eclipse.jdt.core.prefs
--- equinox-bundles-4.11/bundles/org.eclipse.equinox.bidi.tests/.settings/org.eclipse.jdt.core.prefs 2019-03-05 22:25:38.000000000 +0000
+++ equinox-bundles-4.12/bundles/org.eclipse.equinox.bidi.tests/.settings/org.eclipse.jdt.core.prefs 2019-05-28 12:57:39.000000000 +0000
@@ -7,9 +7,9 @@
org.eclipse.jdt.core.classpath.exclusionPatterns=enabled
org.eclipse.jdt.core.classpath.multipleOutputLocations=enabled
org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
-org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.8
+org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.7
org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
-org.eclipse.jdt.core.compiler.compliance=1.8
+org.eclipse.jdt.core.compiler.compliance=1.7
org.eclipse.jdt.core.compiler.debug.lineNumber=generate
org.eclipse.jdt.core.compiler.debug.localVariable=generate
org.eclipse.jdt.core.compiler.debug.sourceFile=generate
@@ -91,23 +91,27 @@
org.eclipse.jdt.core.compiler.problem.unusedPrivateMember=error
org.eclipse.jdt.core.compiler.problem.unusedWarningToken=warning
org.eclipse.jdt.core.compiler.problem.varargsArgumentNeedCast=warning
-org.eclipse.jdt.core.compiler.source=1.8
+org.eclipse.jdt.core.compiler.source=1.7
org.eclipse.jdt.core.formatter.align_type_members_on_columns=false
+org.eclipse.jdt.core.formatter.alignment_for_additive_operator=16
org.eclipse.jdt.core.formatter.alignment_for_arguments_in_allocation_expression=16
org.eclipse.jdt.core.formatter.alignment_for_arguments_in_enum_constant=16
org.eclipse.jdt.core.formatter.alignment_for_arguments_in_explicit_constructor_call=16
org.eclipse.jdt.core.formatter.alignment_for_arguments_in_method_invocation=16
org.eclipse.jdt.core.formatter.alignment_for_arguments_in_qualified_allocation_expression=16
org.eclipse.jdt.core.formatter.alignment_for_assignment=0
-org.eclipse.jdt.core.formatter.alignment_for_binary_expression=16
+org.eclipse.jdt.core.formatter.alignment_for_bitwise_operator=16
org.eclipse.jdt.core.formatter.alignment_for_compact_if=16
org.eclipse.jdt.core.formatter.alignment_for_conditional_expression=80
org.eclipse.jdt.core.formatter.alignment_for_enum_constants=0
org.eclipse.jdt.core.formatter.alignment_for_expressions_in_array_initializer=16
+org.eclipse.jdt.core.formatter.alignment_for_logical_operator=16
org.eclipse.jdt.core.formatter.alignment_for_multiple_fields=16
+org.eclipse.jdt.core.formatter.alignment_for_multiplicative_operator=16
org.eclipse.jdt.core.formatter.alignment_for_parameters_in_constructor_declaration=16
org.eclipse.jdt.core.formatter.alignment_for_parameters_in_method_declaration=16
org.eclipse.jdt.core.formatter.alignment_for_selector_in_method_invocation=16
+org.eclipse.jdt.core.formatter.alignment_for_string_concatenation=16
org.eclipse.jdt.core.formatter.alignment_for_superclass_in_type_declaration=16
org.eclipse.jdt.core.formatter.alignment_for_superinterfaces_in_enum_declaration=16
org.eclipse.jdt.core.formatter.alignment_for_superinterfaces_in_type_declaration=16
@@ -177,11 +181,12 @@
org.eclipse.jdt.core.formatter.insert_new_line_in_empty_enum_declaration=insert
org.eclipse.jdt.core.formatter.insert_new_line_in_empty_method_body=insert
org.eclipse.jdt.core.formatter.insert_new_line_in_empty_type_declaration=insert
+org.eclipse.jdt.core.formatter.insert_space_after_additive_operator=insert
org.eclipse.jdt.core.formatter.insert_space_after_and_in_type_parameter=insert
org.eclipse.jdt.core.formatter.insert_space_after_assignment_operator=insert
org.eclipse.jdt.core.formatter.insert_space_after_at_in_annotation=do not insert
org.eclipse.jdt.core.formatter.insert_space_after_at_in_annotation_type_declaration=do not insert
-org.eclipse.jdt.core.formatter.insert_space_after_binary_operator=insert
+org.eclipse.jdt.core.formatter.insert_space_after_bitwise_operator=insert
org.eclipse.jdt.core.formatter.insert_space_after_closing_angle_bracket_in_type_arguments=insert
org.eclipse.jdt.core.formatter.insert_space_after_closing_angle_bracket_in_type_parameters=insert
org.eclipse.jdt.core.formatter.insert_space_after_closing_brace_in_block=insert
@@ -211,6 +216,8 @@
org.eclipse.jdt.core.formatter.insert_space_after_comma_in_type_arguments=insert
org.eclipse.jdt.core.formatter.insert_space_after_comma_in_type_parameters=insert
org.eclipse.jdt.core.formatter.insert_space_after_ellipsis=insert
+org.eclipse.jdt.core.formatter.insert_space_after_logical_operator=insert
+org.eclipse.jdt.core.formatter.insert_space_after_multiplicative_operator=insert
org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_parameterized_type_reference=do not insert
org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_type_arguments=do not insert
org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_type_parameters=do not insert
@@ -234,12 +241,16 @@
org.eclipse.jdt.core.formatter.insert_space_after_prefix_operator=do not insert
org.eclipse.jdt.core.formatter.insert_space_after_question_in_conditional=insert
org.eclipse.jdt.core.formatter.insert_space_after_question_in_wildcard=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_relational_operator=insert
org.eclipse.jdt.core.formatter.insert_space_after_semicolon_in_for=insert
+org.eclipse.jdt.core.formatter.insert_space_after_shift_operator=insert
+org.eclipse.jdt.core.formatter.insert_space_after_string_concatenation=insert
org.eclipse.jdt.core.formatter.insert_space_after_unary_operator=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_additive_operator=insert
org.eclipse.jdt.core.formatter.insert_space_before_and_in_type_parameter=insert
org.eclipse.jdt.core.formatter.insert_space_before_assignment_operator=insert
org.eclipse.jdt.core.formatter.insert_space_before_at_in_annotation_type_declaration=insert
-org.eclipse.jdt.core.formatter.insert_space_before_binary_operator=insert
+org.eclipse.jdt.core.formatter.insert_space_before_bitwise_operator=insert
org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_parameterized_type_reference=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_type_arguments=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_type_parameters=do not insert
@@ -285,6 +296,8 @@
org.eclipse.jdt.core.formatter.insert_space_before_comma_in_type_arguments=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_comma_in_type_parameters=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_ellipsis=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_logical_operator=insert
+org.eclipse.jdt.core.formatter.insert_space_before_multiplicative_operator=insert
org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_parameterized_type_reference=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_type_arguments=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_type_parameters=do not insert
@@ -320,8 +333,11 @@
org.eclipse.jdt.core.formatter.insert_space_before_prefix_operator=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_question_in_conditional=insert
org.eclipse.jdt.core.formatter.insert_space_before_question_in_wildcard=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_relational_operator=insert
org.eclipse.jdt.core.formatter.insert_space_before_semicolon=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_semicolon_in_for=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_shift_operator=insert
+org.eclipse.jdt.core.formatter.insert_space_before_string_concatenation=insert
org.eclipse.jdt.core.formatter.insert_space_before_unary_operator=do not insert
org.eclipse.jdt.core.formatter.insert_space_between_brackets_in_array_type_reference=do not insert
org.eclipse.jdt.core.formatter.insert_space_between_empty_braces_in_array_initializer=do not insert
@@ -344,6 +360,10 @@
org.eclipse.jdt.core.formatter.tabulation.char=tab
org.eclipse.jdt.core.formatter.tabulation.size=4
org.eclipse.jdt.core.formatter.use_tabs_only_for_leading_indentations=false
-org.eclipse.jdt.core.formatter.wrap_before_binary_operator=true
+org.eclipse.jdt.core.formatter.wrap_before_additive_operator=true
+org.eclipse.jdt.core.formatter.wrap_before_bitwise_operator=true
+org.eclipse.jdt.core.formatter.wrap_before_logical_operator=true
+org.eclipse.jdt.core.formatter.wrap_before_multiplicative_operator=true
+org.eclipse.jdt.core.formatter.wrap_before_string_concatenation=true
org.eclipse.jdt.core.incompatibleJDKLevel=ignore
org.eclipse.jdt.core.incompleteClasspath=error
diff -Nru equinox-bundles-4.11/bundles/org.eclipse.equinox.cm/pom.xml equinox-bundles-4.12/bundles/org.eclipse.equinox.cm/pom.xml
--- equinox-bundles-4.11/bundles/org.eclipse.equinox.cm/pom.xml 2019-03-05 22:25:38.000000000 +0000
+++ equinox-bundles-4.12/bundles/org.eclipse.equinox.cm/pom.xml 2019-05-28 12:57:39.000000000 +0000
@@ -14,7 +14,7 @@
rt.equinox.bundlesorg.eclipse.equinox.bundles
- 4.11.0-SNAPSHOT
+ 4.12.0-SNAPSHOT../../org.eclipse.equinox
diff -Nru equinox-bundles-4.11/bundles/org.eclipse.equinox.cm.test/pom.xml equinox-bundles-4.12/bundles/org.eclipse.equinox.cm.test/pom.xml
--- equinox-bundles-4.11/bundles/org.eclipse.equinox.cm.test/pom.xml 2019-03-05 22:25:38.000000000 +0000
+++ equinox-bundles-4.12/bundles/org.eclipse.equinox.cm.test/pom.xml 2019-05-28 12:57:39.000000000 +0000
@@ -14,7 +14,7 @@
rt.equinox.bundlesorg.eclipse.equinox.bundles
- 4.11.0-SNAPSHOT
+ 4.12.0-SNAPSHOT../../org.eclipse.equinox
diff -Nru equinox-bundles-4.11/bundles/org.eclipse.equinox.common/META-INF/MANIFEST.MF equinox-bundles-4.12/bundles/org.eclipse.equinox.common/META-INF/MANIFEST.MF
--- equinox-bundles-4.11/bundles/org.eclipse.equinox.common/META-INF/MANIFEST.MF 2019-03-05 22:25:38.000000000 +0000
+++ equinox-bundles-4.12/bundles/org.eclipse.equinox.common/META-INF/MANIFEST.MF 2019-05-28 12:57:39.000000000 +0000
@@ -2,7 +2,7 @@
Bundle-ManifestVersion: 2
Bundle-Name: %pluginName
Bundle-SymbolicName: org.eclipse.equinox.common; singleton:=true
-Bundle-Version: 3.10.300.qualifier
+Bundle-Version: 3.10.400.qualifier
Bundle-Localization: plugin
Export-Package: org.eclipse.core.internal.boot;x-friends:="org.eclipse.core.resources,org.eclipse.core.runtime.compatibility,org.eclipse.pde.build",
org.eclipse.core.internal.runtime;common=split;mandatory:=common;
diff -Nru equinox-bundles-4.11/bundles/org.eclipse.equinox.common/pom.xml equinox-bundles-4.12/bundles/org.eclipse.equinox.common/pom.xml
--- equinox-bundles-4.11/bundles/org.eclipse.equinox.common/pom.xml 2019-03-05 22:25:38.000000000 +0000
+++ equinox-bundles-4.12/bundles/org.eclipse.equinox.common/pom.xml 2019-05-28 12:57:39.000000000 +0000
@@ -5,7 +5,7 @@
are made available under the terms of the Eclipse Distribution License v1.0
which accompanies this distribution, and is available at
http://www.eclipse.org/org/documents/edl-v10.php
-
+
Contributors:
Igor Fedorenko - initial implementation
-->
@@ -14,11 +14,11 @@
rt.equinox.bundlesorg.eclipse.equinox.bundles
- 4.11.0-SNAPSHOT
+ 4.12.0-SNAPSHOT../../org.eclipse.equinoxorg.eclipse.equinox.common
- 3.10.300-SNAPSHOT
+ 3.10.400-SNAPSHOTeclipse-plugin
diff -Nru equinox-bundles-4.11/bundles/org.eclipse.equinox.common/src/org/eclipse/core/internal/runtime/LocalizationUtils.java equinox-bundles-4.12/bundles/org.eclipse.equinox.common/src/org/eclipse/core/internal/runtime/LocalizationUtils.java
--- equinox-bundles-4.11/bundles/org.eclipse.equinox.common/src/org/eclipse/core/internal/runtime/LocalizationUtils.java 2019-03-05 22:25:38.000000000 +0000
+++ equinox-bundles-4.12/bundles/org.eclipse.equinox.common/src/org/eclipse/core/internal/runtime/LocalizationUtils.java 2019-05-28 12:57:39.000000000 +0000
@@ -42,17 +42,7 @@
Object value = field.get(null);
if (value instanceof String)
return (String) value;
- } catch (ClassNotFoundException e) {
- // eat exception and fall through
- } catch (NoClassDefFoundError e) {
- // eat exception and fall through
- } catch (SecurityException e) {
- // eat exception and fall through
- } catch (NoSuchFieldException e) {
- // eat exception and fall through
- } catch (IllegalArgumentException e) {
- // eat exception and fall through
- } catch (IllegalAccessException e) {
+ } catch (ClassNotFoundException | NoClassDefFoundError | SecurityException | NoSuchFieldException | IllegalArgumentException | IllegalAccessException e) {
// eat exception and fall through
}
return key;
diff -Nru equinox-bundles-4.11/bundles/org.eclipse.equinox.common/src/org/eclipse/core/internal/runtime/RuntimeLog.java equinox-bundles-4.12/bundles/org.eclipse.equinox.common/src/org/eclipse/core/internal/runtime/RuntimeLog.java
--- equinox-bundles-4.11/bundles/org.eclipse.equinox.common/src/org/eclipse/core/internal/runtime/RuntimeLog.java 2019-03-05 22:25:38.000000000 +0000
+++ equinox-bundles-4.12/bundles/org.eclipse.equinox.common/src/org/eclipse/core/internal/runtime/RuntimeLog.java 2019-05-28 12:57:39.000000000 +0000
@@ -104,9 +104,7 @@
for (int i = 0; i < listeners.length; i++) {
try {
listeners[i].logging(status, IRuntimeConstants.PI_RUNTIME);
- } catch (Exception e) {
- handleException(e);
- } catch (LinkageError e) {
+ } catch (Exception | LinkageError e) {
handleException(e);
}
}
@@ -162,9 +160,7 @@
for (int i = 0; i < listeners.length; i++) {
try {
listeners[i].logging(status, IRuntimeConstants.PI_RUNTIME);
- } catch (Exception e) {
- handleException(e);
- } catch (LinkageError e) {
+ } catch (Exception | LinkageError e) {
handleException(e);
}
}
diff -Nru equinox-bundles-4.11/bundles/org.eclipse.equinox.common/src/org/eclipse/core/runtime/SafeRunner.java equinox-bundles-4.12/bundles/org.eclipse.equinox.common/src/org/eclipse/core/runtime/SafeRunner.java
--- equinox-bundles-4.11/bundles/org.eclipse.equinox.common/src/org/eclipse/core/runtime/SafeRunner.java 2019-03-05 22:25:38.000000000 +0000
+++ equinox-bundles-4.12/bundles/org.eclipse.equinox.common/src/org/eclipse/core/runtime/SafeRunner.java 2019-05-28 12:57:39.000000000 +0000
@@ -43,11 +43,7 @@
Assert.isNotNull(code);
try {
code.run();
- } catch (Exception e) {
- handleException(code, e);
- } catch (LinkageError e) {
- handleException(code, e);
- } catch (AssertionError e) {
+ } catch (Exception | LinkageError | AssertionError e) {
handleException(code, e);
}
}
diff -Nru equinox-bundles-4.11/bundles/org.eclipse.equinox.common/src/org/eclipse/core/runtime/SubMonitor.java equinox-bundles-4.12/bundles/org.eclipse.equinox.common/src/org/eclipse/core/runtime/SubMonitor.java
--- equinox-bundles-4.11/bundles/org.eclipse.equinox.common/src/org/eclipse/core/runtime/SubMonitor.java 2019-03-05 22:25:38.000000000 +0000
+++ equinox-bundles-4.12/bundles/org.eclipse.equinox.common/src/org/eclipse/core/runtime/SubMonitor.java 2019-05-28 12:57:39.000000000 +0000
@@ -1041,4 +1041,10 @@
}
RuntimeLog.log(new Status(IStatus.WARNING, "org.eclipse.core.runtime", message, new Throwable())); //$NON-NLS-1$
}
+
+ @Override
+ public String toString() {
+ return "SubMonitor [totalParent=" + totalParent + ", usedForParent=" + usedForParent + ", usedForChildren=" + usedForChildren + ", totalForChildren=" + totalForChildren + ", beginTaskCalled=" + beginTaskCalled + "]";
+ }
+
}
diff -Nru equinox-bundles-4.11/bundles/org.eclipse.equinox.common.tests/pom.xml equinox-bundles-4.12/bundles/org.eclipse.equinox.common.tests/pom.xml
--- equinox-bundles-4.11/bundles/org.eclipse.equinox.common.tests/pom.xml 2019-03-05 22:25:38.000000000 +0000
+++ equinox-bundles-4.12/bundles/org.eclipse.equinox.common.tests/pom.xml 2019-05-28 12:57:39.000000000 +0000
@@ -14,7 +14,7 @@
tests-pomorg.eclipse.equinox.bundles
- 4.11.0-SNAPSHOT
+ 4.12.0-SNAPSHOT../../tests-pom/org.eclipse.equinox
diff -Nru equinox-bundles-4.11/bundles/org.eclipse.equinox.compendium.tests/bundles_src/metatype/tb9/OSGI-INF/metatype/metadata.xml equinox-bundles-4.12/bundles/org.eclipse.equinox.compendium.tests/bundles_src/metatype/tb9/OSGI-INF/metatype/metadata.xml
--- equinox-bundles-4.11/bundles/org.eclipse.equinox.compendium.tests/bundles_src/metatype/tb9/OSGI-INF/metatype/metadata.xml 2019-03-05 22:25:38.000000000 +0000
+++ equinox-bundles-4.12/bundles/org.eclipse.equinox.compendium.tests/bundles_src/metatype/tb9/OSGI-INF/metatype/metadata.xml 2019-05-28 12:57:39.000000000 +0000
@@ -5,9 +5,9 @@
xsi:schemaLocation="http://www.org.osgi/xmlns/metatype/v1.2.0/md metatype.xsd">
-
-
-
+
+
+
diff -Nru equinox-bundles-4.11/bundles/org.eclipse.equinox.compendium.tests/pom.xml equinox-bundles-4.12/bundles/org.eclipse.equinox.compendium.tests/pom.xml
--- equinox-bundles-4.11/bundles/org.eclipse.equinox.compendium.tests/pom.xml 2019-03-05 22:25:38.000000000 +0000
+++ equinox-bundles-4.12/bundles/org.eclipse.equinox.compendium.tests/pom.xml 2019-05-28 12:57:39.000000000 +0000
@@ -14,7 +14,7 @@
tests-pomorg.eclipse.equinox.bundles
- 4.11.0-SNAPSHOT
+ 4.12.0-SNAPSHOT../../tests-pom/org.eclipse.equinox
diff -Nru equinox-bundles-4.11/bundles/org.eclipse.equinox.compendium.tests/src/org/eclipse/equinox/coordinator/tests/CoordinationMaxTimeoutTest.java equinox-bundles-4.12/bundles/org.eclipse.equinox.compendium.tests/src/org/eclipse/equinox/coordinator/tests/CoordinationMaxTimeoutTest.java
--- equinox-bundles-4.11/bundles/org.eclipse.equinox.compendium.tests/src/org/eclipse/equinox/coordinator/tests/CoordinationMaxTimeoutTest.java 2019-03-05 22:25:38.000000000 +0000
+++ equinox-bundles-4.12/bundles/org.eclipse.equinox.compendium.tests/src/org/eclipse/equinox/coordinator/tests/CoordinationMaxTimeoutTest.java 2019-05-28 12:57:39.000000000 +0000
@@ -150,6 +150,7 @@
}
@Before
+ @Override
public void setUp() throws Exception {
System.setProperty(PROPERTY_NAME, String.valueOf(TIMEOUT));
assertSystemProperty(PROPERTY_NAME, String.valueOf(TIMEOUT));
diff -Nru equinox-bundles-4.11/bundles/org.eclipse.equinox.compendium.tests/src/org/eclipse/equinox/metatype/tests/AbstractTest.java equinox-bundles-4.12/bundles/org.eclipse.equinox.compendium.tests/src/org/eclipse/equinox/metatype/tests/AbstractTest.java
--- equinox-bundles-4.11/bundles/org.eclipse.equinox.compendium.tests/src/org/eclipse/equinox/metatype/tests/AbstractTest.java 2019-03-05 22:25:38.000000000 +0000
+++ equinox-bundles-4.12/bundles/org.eclipse.equinox.compendium.tests/src/org/eclipse/equinox/metatype/tests/AbstractTest.java 2019-05-28 12:57:39.000000000 +0000
@@ -17,8 +17,6 @@
import static org.junit.Assert.fail;
import java.io.*;
-import javax.swing.Icon;
-import javax.swing.ImageIcon;
import org.eclipse.equinox.compendium.tests.Activator;
import org.eclipse.equinox.metatype.EquinoxMetaTypeService;
import org.eclipse.osgi.tests.bundles.BundleInstaller;
@@ -72,8 +70,7 @@
} finally {
icon.close();
}
- Icon i = new ImageIcon(baos.toByteArray());
- Assert.assertEquals("Wrong icon size", size, i.getIconHeight() * i.getIconWidth()); //$NON-NLS-1$
+ Assert.assertEquals("Wrong size.", size, baos.size()); //$NON-NLS-1$
} finally {
baos.close();
}
@@ -146,18 +143,35 @@
@Before
public void setUp() throws Exception {
+ startMetatype();
+ bundleInstaller = new BundleInstaller("bundle_tests/metatype", Activator.getBundleContext()); //$NON-NLS-1$
+ }
+
+ private void startMetatype() throws Exception {
Activator.getBundle(Activator.BUNDLE_METATYPE).start();
metaTypeReference = Activator.getBundleContext().getServiceReference(EquinoxMetaTypeService.class);
Assert.assertNotNull("Metatype service reference not found", metaTypeReference); //$NON-NLS-1$
metatype = Activator.getBundleContext().getService(metaTypeReference);
Assert.assertNotNull("Metatype service not found", metatype); //$NON-NLS-1$
- bundleInstaller = new BundleInstaller("bundle_tests/metatype", Activator.getBundleContext()); //$NON-NLS-1$
}
@After
public void tearDown() throws Exception {
bundleInstaller.shutdown();
+ stopMetatype();
+ }
+
+ private void stopMetatype() throws Exception {
Activator.getBundleContext().ungetService(metaTypeReference);
Activator.getBundle(Activator.BUNDLE_METATYPE).stop();
}
+
+ public void restartMetatype() {
+ try {
+ stopMetatype();
+ startMetatype();
+ } catch (Exception e) {
+ fail(e.getMessage());
+ }
+ }
}
diff -Nru equinox-bundles-4.11/bundles/org.eclipse.equinox.compendium.tests/src/org/eclipse/equinox/metatype/tests/AttributeTypePasswordTest.java equinox-bundles-4.12/bundles/org.eclipse.equinox.compendium.tests/src/org/eclipse/equinox/metatype/tests/AttributeTypePasswordTest.java
--- equinox-bundles-4.11/bundles/org.eclipse.equinox.compendium.tests/src/org/eclipse/equinox/metatype/tests/AttributeTypePasswordTest.java 2019-03-05 22:25:38.000000000 +0000
+++ equinox-bundles-4.12/bundles/org.eclipse.equinox.compendium.tests/src/org/eclipse/equinox/metatype/tests/AttributeTypePasswordTest.java 2019-05-28 12:57:39.000000000 +0000
@@ -21,23 +21,24 @@
private Bundle bundle;
@Before
+ @Override
public void setUp() throws Exception {
super.setUp();
bundle = bundleInstaller.installBundle("tb1"); //$NON-NLS-1$
bundle.start();
}
- @After
- public void tearDown() throws Exception {
- bundle.stop();
- super.tearDown();
- }
-
/*
* Ensures the PASSWORD type is recognized.
*/
@Test
public void testAttributeTypePassword1() {
+ doTestAttributeTypePassword1();
+ restartMetatype();
+ doTestAttributeTypePassword1();
+ }
+
+ private void doTestAttributeTypePassword1() {
MetaTypeInformation mti = metatype.getMetaTypeInformation(bundle);
ObjectClassDefinition ocd = mti.getObjectClassDefinition("org.eclipse.equinox.metatype.tests.tb1", null); //$NON-NLS-1$
AttributeDefinition[] ads = ocd.getAttributeDefinitions(ObjectClassDefinition.ALL);
@@ -53,6 +54,12 @@
*/
@Test
public void testAttributeTypePassword2() {
+ doTestAttributeTypePassword2();
+ restartMetatype();
+ doTestAttributeTypePassword2();
+ }
+
+ private void doTestAttributeTypePassword2() {
MetaTypeInformation mti = metatype.getMetaTypeInformation(bundle);
ObjectClassDefinition ocd = mti.getObjectClassDefinition("org.eclipse.equinox.metatype.tests.tb1", null); //$NON-NLS-1$
AttributeDefinition[] ads = ocd.getAttributeDefinitions(ObjectClassDefinition.ALL);
@@ -66,6 +73,12 @@
*/
@Test
public void testAttributeTypePassword3() {
+ doTestAttributeTypePassword3();
+ restartMetatype();
+ doTestAttributeTypePassword3();
+ }
+
+ private void doTestAttributeTypePassword3() {
MetaTypeInformation mti = metatype.getMetaTypeInformation(bundle);
ObjectClassDefinition ocd = mti.getObjectClassDefinition("org.eclipse.equinox.metatype.tests.tb1", null); //$NON-NLS-1$
AttributeDefinition[] ads = ocd.getAttributeDefinitions(ObjectClassDefinition.ALL);
@@ -80,6 +93,12 @@
*/
@Test
public void testAttributeTypePassword4() {
+ doTestAttributeTypePassword4();
+ restartMetatype();
+ doTestAttributeTypePassword4();
+ }
+
+ private void doTestAttributeTypePassword4() {
MetaTypeInformation mti = metatype.getMetaTypeInformation(bundle);
ObjectClassDefinition ocd = mti.getObjectClassDefinition("org.eclipse.equinox.metatype.tests.tb1", null); //$NON-NLS-1$
AttributeDefinition[] ads = ocd.getAttributeDefinitions(ObjectClassDefinition.ALL);
@@ -95,6 +114,12 @@
*/
@Test
public void testAttributeTypePassword5() {
+ doTestAttributeTypePassword5();
+ restartMetatype();
+ doTestAttributeTypePassword5();
+ }
+
+ private void doTestAttributeTypePassword5() {
MetaTypeInformation mti = metatype.getMetaTypeInformation(bundle);
ObjectClassDefinition ocd = mti.getObjectClassDefinition("org.eclipse.equinox.metatype.tests.tb1", null); //$NON-NLS-1$
AttributeDefinition[] ads = ocd.getAttributeDefinitions(ObjectClassDefinition.ALL);
@@ -110,6 +135,12 @@
*/
@Test
public void testAttributeTypePassword6() {
+ doTestAttributeTypePassword6();
+ restartMetatype();
+ doTestAttributeTypePassword6();
+ }
+
+ private void doTestAttributeTypePassword6() {
MetaTypeInformation mti = metatype.getMetaTypeInformation(bundle);
ObjectClassDefinition ocd = mti.getObjectClassDefinition("org.eclipse.equinox.metatype.tests.tb1", null); //$NON-NLS-1$
AttributeDefinition[] ads = ocd.getAttributeDefinitions(ObjectClassDefinition.ALL);
diff -Nru equinox-bundles-4.11/bundles/org.eclipse.equinox.compendium.tests/src/org/eclipse/equinox/metatype/tests/Bug332161Test.java equinox-bundles-4.12/bundles/org.eclipse.equinox.compendium.tests/src/org/eclipse/equinox/metatype/tests/Bug332161Test.java
--- equinox-bundles-4.11/bundles/org.eclipse.equinox.compendium.tests/src/org/eclipse/equinox/metatype/tests/Bug332161Test.java 2019-03-05 22:25:38.000000000 +0000
+++ equinox-bundles-4.12/bundles/org.eclipse.equinox.compendium.tests/src/org/eclipse/equinox/metatype/tests/Bug332161Test.java 2019-05-28 12:57:39.000000000 +0000
@@ -109,6 +109,12 @@
*/
@Test
public void test1() {
+ doTest1();
+ restartMetatype();
+ doTest1();
+ }
+
+ private void doTest1() {
AttributeDefinition ad = findAttributeDefinitionById("char1", ads); //$NON-NLS-1$
Assert.assertNotNull("Attribute definition not found", ad); //$NON-NLS-1$
String defaultValue = getFirstDefaultValue(ad.getDefaultValue());
@@ -133,6 +139,12 @@
*/
@Test
public void test2() {
+ doTest2();
+ restartMetatype();
+ doTest2();
+ }
+
+ private void doTest2() {
AttributeDefinition ad = findAttributeDefinitionById("string1", ads); //$NON-NLS-1$
Assert.assertNotNull("Attribute definition not found", ad); //$NON-NLS-1$
String defaultValue = getFirstDefaultValue(ad.getDefaultValue());
@@ -148,6 +160,12 @@
*/
@Test
public void test3() {
+ doTest3();
+ restartMetatype();
+ doTest3();
+ }
+
+ private void doTest3() {
AttributeDefinition ad = findAttributeDefinitionById("string2", ads); //$NON-NLS-1$
Assert.assertNotNull("Attribute definition not found", ad); //$NON-NLS-1$
String[] defaultValue = ad.getDefaultValue();
@@ -186,6 +204,12 @@
*/
@Test
public void test4() {
+ doTest4();
+ restartMetatype();
+ doTest4();
+ }
+
+ private void doTest4() {
AttributeDefinition ad = findAttributeDefinitionById("string3", ads); //$NON-NLS-1$
Assert.assertNotNull("Attribute definition not found", ad); //$NON-NLS-1$
assertNull("Default value was not null", ad.getDefaultValue()); //$NON-NLS-1$
@@ -196,6 +220,12 @@
*/
@Test
public void test5() {
+ doTest5();
+ restartMetatype();
+ doTest5();
+ }
+
+ private void doTest5() {
AttributeDefinition ad = findAttributeDefinitionById("char2", ads); //$NON-NLS-1$
Assert.assertNotNull("Attribute definition not found", ad); //$NON-NLS-1$
assertNull("Default value was not null", ad.getDefaultValue()); //$NON-NLS-1$
@@ -208,6 +238,12 @@
*/
@Test
public void test6() {
+ doTest6();
+ restartMetatype();
+ doTest6();
+ }
+
+ private void doTest6() {
AttributeDefinition ad = findAttributeDefinitionById("string3", ads); //$NON-NLS-1$
Assert.assertNotNull("Attribute definition not found", ad); //$NON-NLS-1$
assertValidationFail(null, ad);
@@ -222,6 +258,12 @@
*/
@Test
public void test7() {
+ doTest7();
+ restartMetatype();
+ doTest7();
+ }
+
+ private void doTest7() {
AttributeDefinition ad = findAttributeDefinitionById("char3", ads); //$NON-NLS-1$
Assert.assertNotNull("Attribute definition not found", ad); //$NON-NLS-1$
assertValidationPass("\\\u0009", ad); //$NON-NLS-1$
@@ -242,6 +284,12 @@
*/
@Test
public void test8() {
+ doTest8();
+ restartMetatype();
+ doTest8();
+ }
+
+ private void doTest8() {
AttributeDefinition ad = findAttributeDefinitionById("string4", ads); //$NON-NLS-1$
Assert.assertNotNull("Attribute definition not found", ad); //$NON-NLS-1$
String[] defaultValue = ad.getDefaultValue();
@@ -262,6 +310,12 @@
*/
@Test
public void test9() {
+ doTest9();
+ restartMetatype();
+ doTest9();
+ }
+
+ private void doTest9() {
AttributeDefinition ad = findAttributeDefinitionById("integer1", ads); //$NON-NLS-1$
Assert.assertNotNull("Attribute definition not found", ad); //$NON-NLS-1$
String[] defaultValue = ad.getDefaultValue();
@@ -276,6 +330,12 @@
*/
@Test
public void test10() {
+ doTest10();
+ restartMetatype();
+ doTest10();
+ }
+
+ private void doTest10() {
AttributeDefinition ad = findAttributeDefinitionById("string5", ads); //$NON-NLS-1$
Assert.assertNotNull("Attribute definition not found", ad); //$NON-NLS-1$
String[] defaultValue = ad.getDefaultValue();
@@ -294,10 +354,15 @@
}
@Before
+ @Override
public void setUp() throws Exception {
super.setUp();
bundle = bundleInstaller.installBundle("tb4"); //$NON-NLS-1$
bundle.start();
+ getMetatypeObjects();
+ }
+
+ private void getMetatypeObjects() {
mti = metatype.getMetaTypeInformation(bundle);
Assert.assertNotNull("Metatype information not found", mti); //$NON-NLS-1$
ocd = mti.getObjectClassDefinition("org.eclipse.equinox.metatype.tests.tb4", null); //$NON-NLS-1$
@@ -307,10 +372,10 @@
Assert.assertEquals("Wrong number of attribute definitions", 9, ads.length); //$NON-NLS-1$
}
- @After
- public void tearDown() throws Exception {
- bundle.stop();
- super.tearDown();
+ @Override
+ public void restartMetatype() {
+ super.restartMetatype();
+ getMetatypeObjects();
}
private void validateChar1Options(String[] optionLabels, String[] optionValues) {
diff -Nru equinox-bundles-4.11/bundles/org.eclipse.equinox.compendium.tests/src/org/eclipse/equinox/metatype/tests/Bug340899Test.java equinox-bundles-4.12/bundles/org.eclipse.equinox.compendium.tests/src/org/eclipse/equinox/metatype/tests/Bug340899Test.java
--- equinox-bundles-4.11/bundles/org.eclipse.equinox.compendium.tests/src/org/eclipse/equinox/metatype/tests/Bug340899Test.java 2019-03-05 22:25:38.000000000 +0000
+++ equinox-bundles-4.12/bundles/org.eclipse.equinox.compendium.tests/src/org/eclipse/equinox/metatype/tests/Bug340899Test.java 2019-05-28 12:57:39.000000000 +0000
@@ -31,6 +31,12 @@
*/
@Test
public void test1() throws Exception {
+ doTest1();
+ restartMetatype();
+ doTest1();
+ }
+
+ private void doTest1() throws Exception {
execute("tb5", "org.eclipse.equinox.metatype.tests.tb5"); //$NON-NLS-1$ //$NON-NLS-2$
}
@@ -41,6 +47,12 @@
*/
@Test
public void test2() throws Exception {
+ doTest2();
+ restartMetatype();
+ doTest2();
+ }
+
+ private void doTest2() throws Exception {
execute("tb6", "org.eclipse.equinox.metatype.tests.tb6"); //$NON-NLS-1$ //$NON-NLS-2$
}
@@ -51,6 +63,12 @@
*/
@Test
public void test3() throws Exception {
+ doTest3();
+ restartMetatype();
+ doTest3();
+ }
+
+ private void doTest3() throws Exception {
execute("tb7", "org.eclipse.equinox.metatype.tests.tb7"); //$NON-NLS-1$ //$NON-NLS-2$
}
diff -Nru equinox-bundles-4.11/bundles/org.eclipse.equinox.compendium.tests/src/org/eclipse/equinox/metatype/tests/Bug395196Test.java equinox-bundles-4.12/bundles/org.eclipse.equinox.compendium.tests/src/org/eclipse/equinox/metatype/tests/Bug395196Test.java
--- equinox-bundles-4.11/bundles/org.eclipse.equinox.compendium.tests/src/org/eclipse/equinox/metatype/tests/Bug395196Test.java 2019-03-05 22:25:38.000000000 +0000
+++ equinox-bundles-4.12/bundles/org.eclipse.equinox.compendium.tests/src/org/eclipse/equinox/metatype/tests/Bug395196Test.java 2019-05-28 12:57:39.000000000 +0000
@@ -34,17 +34,28 @@
private ObjectClassDefinition ocd;
@Test
- public void testRejectDefaultValueWhenNotAnOption() {
+ public void testRejectDefaultValueWhenNotAnOption() throws Exception {
+ doTestRejectDefaultValueWhenNotAnOption();
+ restartMetatype();
+ doTestRejectDefaultValueWhenNotAnOption();
+ }
+
+ private void doTestRejectDefaultValueWhenNotAnOption() {
AttributeDefinition ad = findAttributeDefinitionById("ocd3-ad1", ads); //$NON-NLS-1$
Assert.assertNotNull("Attribute definition not found", ad); //$NON-NLS-1$
assertNull("Default value not matching one of the options was not rejected", ad.getDefaultValue()); //$NON-NLS-1$
}
@Before
+ @Override
public void setUp() throws Exception {
super.setUp();
bundle = bundleInstaller.installBundle("tb1"); //$NON-NLS-1$
bundle.start();
+ getMetaTypeObjects();
+ }
+
+ private void getMetaTypeObjects() {
mti = metatype.getMetaTypeInformation(bundle);
Assert.assertNotNull("Metatype information not found", mti); //$NON-NLS-1$
ocd = mti.getObjectClassDefinition("org.eclipse.equinox.metatype.tests.tb1.testRejectDefaultValueWhenNotAnOption", null); //$NON-NLS-1$
@@ -54,9 +65,9 @@
Assert.assertEquals("Wrong number of attribute definitions", 1, ads.length); //$NON-NLS-1$
}
- @After
- public void tearDown() throws Exception {
- bundle.stop();
- super.tearDown();
+ @Override
+ public void restartMetatype() {
+ super.restartMetatype();
+ getMetaTypeObjects();
}
}
diff -Nru equinox-bundles-4.11/bundles/org.eclipse.equinox.compendium.tests/src/org/eclipse/equinox/metatype/tests/BugTests.java equinox-bundles-4.12/bundles/org.eclipse.equinox.compendium.tests/src/org/eclipse/equinox/metatype/tests/BugTests.java
--- equinox-bundles-4.11/bundles/org.eclipse.equinox.compendium.tests/src/org/eclipse/equinox/metatype/tests/BugTests.java 2019-03-05 22:25:38.000000000 +0000
+++ equinox-bundles-4.12/bundles/org.eclipse.equinox.compendium.tests/src/org/eclipse/equinox/metatype/tests/BugTests.java 2019-05-28 12:57:39.000000000 +0000
@@ -27,7 +27,13 @@
* A cardinality of zero should not require a default value to be specified.
*/
@Test
- public void test334642() {
+ public void test334642() throws Exception {
+ doTest334642();
+ restartMetatype();
+ doTest334642();
+ }
+
+ private void doTest334642() {
MetaTypeInformation mti = metatype.getMetaTypeInformation(bundle);
Assert.assertNotNull("Metatype information not found", mti); //$NON-NLS-1$
ObjectClassDefinition ocd = mti.getObjectClassDefinition("org.eclipse.equinox.metatype.tests.tb3", null); //$NON-NLS-1$
@@ -62,7 +68,13 @@
* StringIndexOutOfBoundsException when description or name attributes are an empty string
*/
@Test
- public void test341963() {
+ public void test341963() throws Exception {
+ doTest341963();
+ restartMetatype();
+ doTest341963();
+ }
+
+ private void doTest341963() {
MetaTypeInformation mti = metatype.getMetaTypeInformation(bundle);
Assert.assertNotNull("Metatype information not found", mti); //$NON-NLS-1$
ObjectClassDefinition ocd = mti.getObjectClassDefinition("ocd2", null); //$NON-NLS-1$
@@ -80,15 +92,11 @@
}
@Before
+ @Override
public void setUp() throws Exception {
super.setUp();
bundle = bundleInstaller.installBundle("tb3"); //$NON-NLS-1$
bundle.start();
}
- @After
- public void tearDown() throws Exception {
- bundle.stop();
- super.tearDown();
- }
}
diff -Nru equinox-bundles-4.11/bundles/org.eclipse.equinox.compendium.tests/src/org/eclipse/equinox/metatype/tests/ExtendableTest.java equinox-bundles-4.12/bundles/org.eclipse.equinox.compendium.tests/src/org/eclipse/equinox/metatype/tests/ExtendableTest.java
--- equinox-bundles-4.11/bundles/org.eclipse.equinox.compendium.tests/src/org/eclipse/equinox/metatype/tests/ExtendableTest.java 2019-03-05 22:25:38.000000000 +0000
+++ equinox-bundles-4.12/bundles/org.eclipse.equinox.compendium.tests/src/org/eclipse/equinox/metatype/tests/ExtendableTest.java 2019-05-28 12:57:39.000000000 +0000
@@ -26,6 +26,7 @@
private Bundle bundle;
@Before
+ @Override
public void setUp() throws Exception {
super.setUp();
bundle = bundleInstaller.installBundle("extendable.tb1"); //$NON-NLS-1$
@@ -33,7 +34,13 @@
}
@Test
- public void testExtensions() {
+ public void testExtensions() throws Exception {
+ doTestExtensions();
+ restartMetatype();
+ doTestExtensions();
+ }
+
+ private void doTestExtensions() {
EquinoxMetaTypeInformation mti = metatype.getMetaTypeInformation(bundle);
EquinoxObjectClassDefinition ocd = mti.getObjectClassDefinition("metatype.extendable.tb1.1", null); //$NON-NLS-1$
Set schemas = ocd.getExtensionUris();
diff -Nru equinox-bundles-4.11/bundles/org.eclipse.equinox.compendium.tests/src/org/eclipse/equinox/metatype/tests/GetDefaultValueTest.java equinox-bundles-4.12/bundles/org.eclipse.equinox.compendium.tests/src/org/eclipse/equinox/metatype/tests/GetDefaultValueTest.java
--- equinox-bundles-4.11/bundles/org.eclipse.equinox.compendium.tests/src/org/eclipse/equinox/metatype/tests/GetDefaultValueTest.java 2019-03-05 22:25:38.000000000 +0000
+++ equinox-bundles-4.12/bundles/org.eclipse.equinox.compendium.tests/src/org/eclipse/equinox/metatype/tests/GetDefaultValueTest.java 2019-05-28 12:57:39.000000000 +0000
@@ -30,7 +30,13 @@
private Bundle bundle;
@Test
- public void testGetDefaultValue() {
+ public void testGetDefaultValue() throws Exception {
+ doTestGetDefaultValue();
+ restartMetatype();
+ doTestGetDefaultValue();
+ }
+
+ private void doTestGetDefaultValue() {
MetaTypeInformation mti = metatype.getMetaTypeInformation(bundle);
Assert.assertNotNull("Metatype information was null", mti); //$NON-NLS-1$
ObjectClassDefinition ocd = mti.getObjectClassDefinition("org.eclipse.equinox.metatype.tests.tb1.getDefaultValues", null); //$NON-NLS-1$
@@ -120,6 +126,7 @@
}
@Before
+ @Override
public void setUp() throws Exception {
super.setUp();
bundle = bundleInstaller.installBundle("tb1"); //$NON-NLS-1$
diff -Nru equinox-bundles-4.11/bundles/org.eclipse.equinox.compendium.tests/src/org/eclipse/equinox/metatype/tests/GetMinMaxTest.java equinox-bundles-4.12/bundles/org.eclipse.equinox.compendium.tests/src/org/eclipse/equinox/metatype/tests/GetMinMaxTest.java
--- equinox-bundles-4.11/bundles/org.eclipse.equinox.compendium.tests/src/org/eclipse/equinox/metatype/tests/GetMinMaxTest.java 2019-03-05 22:25:38.000000000 +0000
+++ equinox-bundles-4.12/bundles/org.eclipse.equinox.compendium.tests/src/org/eclipse/equinox/metatype/tests/GetMinMaxTest.java 2019-05-28 12:57:39.000000000 +0000
@@ -25,6 +25,7 @@
private EquinoxObjectClassDefinition ocd;
@Before
+ @Override
public void setUp() throws Exception {
super.setUp();
bundle = bundleInstaller.installBundle("getMinMax.tb1"); //$NON-NLS-1$
diff -Nru equinox-bundles-4.11/bundles/org.eclipse.equinox.compendium.tests/src/org/eclipse/equinox/metatype/tests/IconTest.java equinox-bundles-4.12/bundles/org.eclipse.equinox.compendium.tests/src/org/eclipse/equinox/metatype/tests/IconTest.java
--- equinox-bundles-4.11/bundles/org.eclipse.equinox.compendium.tests/src/org/eclipse/equinox/metatype/tests/IconTest.java 2019-03-05 22:25:38.000000000 +0000
+++ equinox-bundles-4.12/bundles/org.eclipse.equinox.compendium.tests/src/org/eclipse/equinox/metatype/tests/IconTest.java 2019-05-28 12:57:39.000000000 +0000
@@ -15,7 +15,8 @@
import static org.junit.Assert.assertNull;
-import org.junit.*;
+import org.junit.Before;
+import org.junit.Test;
import org.osgi.framework.Bundle;
import org.osgi.service.metatype.*;
@@ -38,6 +39,12 @@
@Test
public void testIcon() throws Exception {
+ doTestIcon();
+ restartMetatype();
+ doTestIcon();
+ }
+
+ private void doTestIcon() throws Exception {
MetaTypeInformation mti = metatype.getMetaTypeInformation(bundle);
assertNotNull(mti);
ObjectClassDefinition ocd = mti.getObjectClassDefinition("org.eclipse.equinox.metatype.tests.tb9", null); //$NON-NLS-1$
@@ -45,19 +52,23 @@
AttributeDefinition[] ads = ocd.getAttributeDefinitions(ObjectClassDefinition.ALL);
assertAttributeDefinitions(ads, 1);
assertAttributeDefinition(ads[0], 0, null, null, "1", "ad1", null, null, AttributeDefinition.STRING); //$NON-NLS-1$ //$NON-NLS-2$
- assertIcon(ocd.getIcon(10000), 10000);
- assertIcon(ocd.getIcon(22500), 22500);
- assertIcon(ocd.getIcon(40000), 40000);
- assertIcon(ocd.getIcon(5000), 10000);
- assertIcon(ocd.getIcon(50000), 40000);
- assertIcon(ocd.getIcon(16249), 10000);
- assertIcon(ocd.getIcon(16251), 22500);
- assertIcon(ocd.getIcon(31249), 22500);
- assertIcon(ocd.getIcon(31251), 40000);
+ assertIcon(ocd.getIcon(4931), 4931);
+ assertIcon(ocd.getIcon(7933), 7933);
+ assertIcon(ocd.getIcon(10182), 10182);
+ assertIcon(ocd.getIcon(5000), 4931);
+ assertIcon(ocd.getIcon(50000), 10182);
+ assertIcon(ocd.getIcon(6400), 4931);
+ assertIcon(ocd.getIcon(6500), 7933);
}
@Test
public void testNullIcon() throws Exception {
+ doTestNullIcon();
+ restartMetatype();
+ doTestNullIcon();
+ }
+
+ private void doTestNullIcon() throws Exception {
MetaTypeInformation mti = metatype.getMetaTypeInformation(bundle);
assertNotNull(mti);
ObjectClassDefinition ocd = mti.getObjectClassDefinition("org.eclipse.equinox.metatype.tests.tb9.2", null); //$NON-NLS-1$
@@ -69,14 +80,9 @@
}
@Before
+ @Override
public void setUp() throws Exception {
super.setUp();
bundle = bundleInstaller.installBundle("tb9"); //$NON-NLS-1$
}
-
- @After
- public void tearDown() throws Exception {
- bundle.uninstall();
- super.tearDown();
- }
}
diff -Nru equinox-bundles-4.11/bundles/org.eclipse.equinox.compendium.tests/src/org/eclipse/equinox/metatype/tests/NoADTest.java equinox-bundles-4.12/bundles/org.eclipse.equinox.compendium.tests/src/org/eclipse/equinox/metatype/tests/NoADTest.java
--- equinox-bundles-4.11/bundles/org.eclipse.equinox.compendium.tests/src/org/eclipse/equinox/metatype/tests/NoADTest.java 2019-03-05 22:25:38.000000000 +0000
+++ equinox-bundles-4.12/bundles/org.eclipse.equinox.compendium.tests/src/org/eclipse/equinox/metatype/tests/NoADTest.java 2019-05-28 12:57:39.000000000 +0000
@@ -13,38 +13,18 @@
*******************************************************************************/
package org.eclipse.equinox.metatype.tests;
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertNotNull;
-
-import org.eclipse.equinox.compendium.tests.Activator;
-import org.eclipse.osgi.tests.bundles.BundleInstaller;
import org.junit.*;
import org.osgi.framework.Bundle;
-import org.osgi.framework.ServiceReference;
import org.osgi.service.metatype.*;
-public class NoADTest {
+public class NoADTest extends AbstractTest {
private Bundle bundle;
- private BundleInstaller bundleInstaller;
- private MetaTypeService metaType;
- private ServiceReference metaTypeReference;
@Before
+ @Override
public void setUp() throws Exception {
- Activator.getBundle(Activator.BUNDLE_METATYPE).start();
- metaTypeReference = Activator.getBundleContext().getServiceReference(MetaTypeService.class);
- metaType = Activator.getBundleContext().getService(metaTypeReference);
- bundleInstaller = new BundleInstaller("bundle_tests/metatype", Activator.getBundleContext()); //$NON-NLS-1$
- bundleInstaller.refreshPackages(null);
+ super.setUp();
bundle = bundleInstaller.installBundle("tb10"); //$NON-NLS-1$
- bundle.start();
- }
-
- @After
- public void tearDown() throws Exception {
- bundleInstaller.shutdown();
- Activator.getBundleContext().ungetService(metaTypeReference);
- Activator.getBundle(Activator.BUNDLE_METATYPE).stop();
}
/*
@@ -52,17 +32,23 @@
*/
@Test
public void testNoADs() {
- MetaTypeInformation mti = metaType.getMetaTypeInformation(bundle);
+ doTestNoADs();
+ restartMetatype();
+ doTestNoADs();
+ }
+
+ private void doTestNoADs() {
+ MetaTypeInformation mti = metatype.getMetaTypeInformation(bundle);
String[] pids = mti.getPids();
- assertNotNull("The pid was not present.", pids); //$NON-NLS-1$
- assertEquals("Not the expected number of pids.", 1, pids.length); //$NON-NLS-1$
- assertEquals("Expected pid was not present.", "no.ad.designate", pids[0]); //$NON-NLS-1$ //$NON-NLS-2$
+ Assert.assertNotNull("The pid was not present.", pids); //$NON-NLS-1$
+ Assert.assertEquals("Not the expected number of pids.", 1, pids.length); //$NON-NLS-1$
+ Assert.assertEquals("Expected pid was not present.", "no.ad.designate", pids[0]); //$NON-NLS-1$ //$NON-NLS-2$
ObjectClassDefinition ocd = mti.getObjectClassDefinition(pids[0], null);
AttributeDefinition[] ads = ocd.getAttributeDefinitions(ObjectClassDefinition.ALL);
// seems we are not really spec compliant here
if (ads != null) {
// should really be null, but if not then make sure it is an empty array
- assertEquals("Found some ads: " + ads, 0, ads.length); //$NON-NLS-1$
+ Assert.assertEquals("Found some ads: " + ads, 0, ads.length); //$NON-NLS-1$
}
}
}
diff -Nru equinox-bundles-4.11/bundles/org.eclipse.equinox.compendium.tests/src/org/eclipse/equinox/metatype/tests/SameOcdPidFactoryPidTest.java equinox-bundles-4.12/bundles/org.eclipse.equinox.compendium.tests/src/org/eclipse/equinox/metatype/tests/SameOcdPidFactoryPidTest.java
--- equinox-bundles-4.11/bundles/org.eclipse.equinox.compendium.tests/src/org/eclipse/equinox/metatype/tests/SameOcdPidFactoryPidTest.java 2019-03-05 22:25:38.000000000 +0000
+++ equinox-bundles-4.12/bundles/org.eclipse.equinox.compendium.tests/src/org/eclipse/equinox/metatype/tests/SameOcdPidFactoryPidTest.java 2019-05-28 12:57:39.000000000 +0000
@@ -13,41 +13,21 @@
*******************************************************************************/
package org.eclipse.equinox.metatype.tests;
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertNotNull;
-
-import org.eclipse.equinox.compendium.tests.Activator;
-import org.eclipse.osgi.tests.bundles.BundleInstaller;
import org.junit.*;
import org.osgi.framework.Bundle;
-import org.osgi.framework.ServiceReference;
import org.osgi.service.metatype.MetaTypeInformation;
-import org.osgi.service.metatype.MetaTypeService;
-public class SameOcdPidFactoryPidTest {
+public class SameOcdPidFactoryPidTest extends AbstractTest {
private Bundle bundle;
- private BundleInstaller bundleInstaller;
- private MetaTypeService metaType;
- private ServiceReference metaTypeReference;
@Before
+ @Override
public void setUp() throws Exception {
- Activator.getBundle(Activator.BUNDLE_METATYPE).start();
- metaTypeReference = Activator.getBundleContext().getServiceReference(MetaTypeService.class);
- metaType = Activator.getBundleContext().getService(metaTypeReference);
- bundleInstaller = new BundleInstaller("bundle_tests/metatype", Activator.getBundleContext()); //$NON-NLS-1$
- bundleInstaller.refreshPackages(null);
+ super.setUp();
bundle = bundleInstaller.installBundle("tb2"); //$NON-NLS-1$
bundle.start();
}
- @After
- public void tearDown() throws Exception {
- bundleInstaller.shutdown();
- Activator.getBundleContext().ungetService(metaTypeReference);
- Activator.getBundle(Activator.BUNDLE_METATYPE).stop();
- }
-
/*
* Ensures the same OCD referred to by two Designate elements, one using
* the factoryPid attribute and the other only the pid attribute, is
@@ -55,14 +35,20 @@
*/
@Test
public void test1() {
- MetaTypeInformation mti = metaType.getMetaTypeInformation(bundle);
+ doTest1();
+ restartMetatype();
+ doTest1();
+ }
+
+ private void doTest1() {
+ MetaTypeInformation mti = metatype.getMetaTypeInformation(bundle);
String[] pids = mti.getPids();
- assertNotNull("The pid 'singleton' was not present.", pids); //$NON-NLS-1$
- assertEquals("Not the expected number of pids.", 1, pids.length); //$NON-NLS-1$
- assertEquals("Expected pid was not present.", "singleton", pids[0]); //$NON-NLS-1$ //$NON-NLS-2$
+ Assert.assertNotNull("The pid 'singleton' was not present.", pids); //$NON-NLS-1$
+ Assert.assertEquals("Not the expected number of pids.", 1, pids.length); //$NON-NLS-1$
+ Assert.assertEquals("Expected pid was not present.", "singleton", pids[0]); //$NON-NLS-1$ //$NON-NLS-2$
String[] factoryPids = mti.getFactoryPids();
- assertNotNull("The factory pid 'factory' was not present.", factoryPids); //$NON-NLS-1$
- assertEquals("Not the expected number of factory pids.", 1, factoryPids.length); //$NON-NLS-1$
- assertEquals("Expected factory pid was not present.", "factory", factoryPids[0]); //$NON-NLS-1$ //$NON-NLS-2$
+ Assert.assertNotNull("The factory pid 'factory' was not present.", factoryPids); //$NON-NLS-1$
+ Assert.assertEquals("Not the expected number of factory pids.", 1, factoryPids.length); //$NON-NLS-1$
+ Assert.assertEquals("Expected factory pid was not present.", "factory", factoryPids[0]); //$NON-NLS-1$ //$NON-NLS-2$
}
}
diff -Nru equinox-bundles-4.11/bundles/org.eclipse.equinox.compendium.tests/src/org/eclipse/equinox/metatype/tests/UnresolvedBundleTest.java equinox-bundles-4.12/bundles/org.eclipse.equinox.compendium.tests/src/org/eclipse/equinox/metatype/tests/UnresolvedBundleTest.java
--- equinox-bundles-4.11/bundles/org.eclipse.equinox.compendium.tests/src/org/eclipse/equinox/metatype/tests/UnresolvedBundleTest.java 2019-03-05 22:25:38.000000000 +0000
+++ equinox-bundles-4.12/bundles/org.eclipse.equinox.compendium.tests/src/org/eclipse/equinox/metatype/tests/UnresolvedBundleTest.java 2019-05-28 12:57:39.000000000 +0000
@@ -57,6 +57,7 @@
}
@Before
+ @Override
public void setUp() throws Exception {
super.setUp();
bundle = bundleInstaller.installBundle("tb8"); //$NON-NLS-1$
diff -Nru equinox-bundles-4.11/bundles/org.eclipse.equinox.concurrent/META-INF/MANIFEST.MF equinox-bundles-4.12/bundles/org.eclipse.equinox.concurrent/META-INF/MANIFEST.MF
--- equinox-bundles-4.11/bundles/org.eclipse.equinox.concurrent/META-INF/MANIFEST.MF 2019-03-05 22:25:38.000000000 +0000
+++ equinox-bundles-4.12/bundles/org.eclipse.equinox.concurrent/META-INF/MANIFEST.MF 2019-05-28 12:57:39.000000000 +0000
@@ -2,7 +2,7 @@
Bundle-ManifestVersion: 2
Bundle-Name: %pluginName
Bundle-SymbolicName: org.eclipse.equinox.concurrent
-Bundle-Version: 1.1.200.qualifier
+Bundle-Version: 1.1.300.qualifier
Bundle-Vendor: %pluginProvider
Bundle-RequiredExecutionEnvironment: J2SE-1.5
Import-Package: org.eclipse.core.runtime;version="3.4.0";common=split,
diff -Nru equinox-bundles-4.11/bundles/org.eclipse.equinox.concurrent/pom.xml equinox-bundles-4.12/bundles/org.eclipse.equinox.concurrent/pom.xml
--- equinox-bundles-4.11/bundles/org.eclipse.equinox.concurrent/pom.xml 2019-03-05 22:25:38.000000000 +0000
+++ equinox-bundles-4.12/bundles/org.eclipse.equinox.concurrent/pom.xml 2019-05-28 12:57:39.000000000 +0000
@@ -5,7 +5,7 @@
are made available under the terms of the Eclipse Distribution License v1.0
which accompanies this distribution, and is available at
http://www.eclipse.org/org/documents/edl-v10.php
-
+
Contributors:
Igor Fedorenko - initial implementation
-->
@@ -14,11 +14,11 @@
rt.equinox.bundlesorg.eclipse.equinox.bundles
- 4.11.0-SNAPSHOT
+ 4.12.0-SNAPSHOT../../org.eclipse.equinoxorg.eclipse.equinox.concurrent
- 1.1.200-SNAPSHOT
+ 1.1.300-SNAPSHOTeclipse-plugin
diff -Nru equinox-bundles-4.11/bundles/org.eclipse.equinox.concurrent/src/org/eclipse/equinox/concurrent/future/SingleOperationListenableFuture.java equinox-bundles-4.12/bundles/org.eclipse.equinox.concurrent/src/org/eclipse/equinox/concurrent/future/SingleOperationListenableFuture.java
--- equinox-bundles-4.11/bundles/org.eclipse.equinox.concurrent/src/org/eclipse/equinox/concurrent/future/SingleOperationListenableFuture.java 2019-03-05 22:25:38.000000000 +0000
+++ equinox-bundles-4.12/bundles/org.eclipse.equinox.concurrent/src/org/eclipse/equinox/concurrent/future/SingleOperationListenableFuture.java 2019-05-28 12:57:39.000000000 +0000
@@ -62,6 +62,7 @@
}
}
+ @Override
public void runWithProgress(final IProgressRunnable> runnable) {
Assert.isNotNull(runnable);
if (!isCanceled()) {
diff -Nru equinox-bundles-4.11/bundles/org.eclipse.equinox.console/META-INF/MANIFEST.MF equinox-bundles-4.12/bundles/org.eclipse.equinox.console/META-INF/MANIFEST.MF
--- equinox-bundles-4.11/bundles/org.eclipse.equinox.console/META-INF/MANIFEST.MF 2019-03-05 22:25:38.000000000 +0000
+++ equinox-bundles-4.12/bundles/org.eclipse.equinox.console/META-INF/MANIFEST.MF 2019-05-28 12:57:39.000000000 +0000
@@ -2,7 +2,7 @@
Bundle-ManifestVersion: 2
Bundle-Name: %bundleName
Bundle-SymbolicName: org.eclipse.equinox.console
-Bundle-Version: 1.3.200.qualifier
+Bundle-Version: 1.3.300.qualifier
Bundle-Activator: org.eclipse.equinox.console.command.adapter.Activator
Bundle-Vendor: %bundleVendor
Bundle-Localization: plugin
diff -Nru equinox-bundles-4.11/bundles/org.eclipse.equinox.console/pom.xml equinox-bundles-4.12/bundles/org.eclipse.equinox.console/pom.xml
--- equinox-bundles-4.11/bundles/org.eclipse.equinox.console/pom.xml 2019-03-05 22:25:38.000000000 +0000
+++ equinox-bundles-4.12/bundles/org.eclipse.equinox.console/pom.xml 2019-05-28 12:57:39.000000000 +0000
@@ -14,11 +14,11 @@
rt.equinox.bundlesorg.eclipse.equinox.bundles
- 4.11.0-SNAPSHOT
+ 4.12.0-SNAPSHOT../../org.eclipse.equinoxorg.eclipse.equinox.console
- 1.3.200-SNAPSHOT
+ 1.3.300-SNAPSHOTeclipse-plugin
diff -Nru equinox-bundles-4.11/bundles/org.eclipse.equinox.console/src/org/eclipse/equinox/console/command/adapter/CustomCommandInterpreter.java equinox-bundles-4.12/bundles/org.eclipse.equinox.console/src/org/eclipse/equinox/console/command/adapter/CustomCommandInterpreter.java
--- equinox-bundles-4.11/bundles/org.eclipse.equinox.console/src/org/eclipse/equinox/console/command/adapter/CustomCommandInterpreter.java 2019-03-05 22:25:38.000000000 +0000
+++ equinox-bundles-4.12/bundles/org.eclipse.equinox.console/src/org/eclipse/equinox/console/command/adapter/CustomCommandInterpreter.java 2019-05-28 12:57:39.000000000 +0000
@@ -121,8 +121,7 @@
out.println("Nested Exception");
printStackTrace(nested);
}
- } catch (IllegalAccessException e) {
- } catch (InvocationTargetException e) {
+ } catch (IllegalAccessException | InvocationTargetException e) {
}
}
}
diff -Nru equinox-bundles-4.11/bundles/org.eclipse.equinox.console/src/org/eclipse/equinox/console/commands/EquinoxCommandProvider.java equinox-bundles-4.12/bundles/org.eclipse.equinox.console/src/org/eclipse/equinox/console/commands/EquinoxCommandProvider.java
--- equinox-bundles-4.11/bundles/org.eclipse.equinox.console/src/org/eclipse/equinox/console/commands/EquinoxCommandProvider.java 2019-03-05 22:25:38.000000000 +0000
+++ equinox-bundles-4.12/bundles/org.eclipse.equinox.console/src/org/eclipse/equinox/console/commands/EquinoxCommandProvider.java 2019-05-28 12:57:39.000000000 +0000
@@ -423,10 +423,7 @@
if (stateFilter == -1)
stateFilter = 0;
stateFilter |= match.getInt(match);
- } catch (NoSuchFieldException e) {
- System.out.println(ConsoleMsg.CONSOLE_INVALID_INPUT + ": " + desiredState); //$NON-NLS-1$
- throw new IllegalArgumentException();
- } catch (IllegalAccessException e) {
+ } catch (NoSuchFieldException | IllegalAccessException e) {
System.out.println(ConsoleMsg.CONSOLE_INVALID_INPUT + ": " + desiredState); //$NON-NLS-1$
throw new IllegalArgumentException();
}
diff -Nru equinox-bundles-4.11/bundles/org.eclipse.equinox.console.jaas.fragment/pom.xml equinox-bundles-4.12/bundles/org.eclipse.equinox.console.jaas.fragment/pom.xml
--- equinox-bundles-4.11/bundles/org.eclipse.equinox.console.jaas.fragment/pom.xml 2019-03-05 22:25:38.000000000 +0000
+++ equinox-bundles-4.12/bundles/org.eclipse.equinox.console.jaas.fragment/pom.xml 2019-05-28 12:57:39.000000000 +0000
@@ -14,7 +14,7 @@
rt.equinox.bundlesorg.eclipse.equinox.bundles
- 4.11.0-SNAPSHOT
+ 4.12.0-SNAPSHOT../../org.eclipse.equinox
diff -Nru equinox-bundles-4.11/bundles/org.eclipse.equinox.console.ssh/META-INF/MANIFEST.MF equinox-bundles-4.12/bundles/org.eclipse.equinox.console.ssh/META-INF/MANIFEST.MF
--- equinox-bundles-4.11/bundles/org.eclipse.equinox.console.ssh/META-INF/MANIFEST.MF 2019-03-05 22:25:38.000000000 +0000
+++ equinox-bundles-4.12/bundles/org.eclipse.equinox.console.ssh/META-INF/MANIFEST.MF 2019-05-28 12:57:39.000000000 +0000
@@ -2,7 +2,7 @@
Bundle-ManifestVersion: 2
Bundle-Name: %bundleName
Bundle-SymbolicName: org.eclipse.equinox.console.ssh
-Bundle-Version: 1.2.100.qualifier
+Bundle-Version: 1.2.200.qualifier
Bundle-Activator: org.eclipse.equinox.console.ssh.Activator
Bundle-Vendor: %bundleVendor
Bundle-Localization: plugin
diff -Nru equinox-bundles-4.11/bundles/org.eclipse.equinox.console.ssh/pom.xml equinox-bundles-4.12/bundles/org.eclipse.equinox.console.ssh/pom.xml
--- equinox-bundles-4.11/bundles/org.eclipse.equinox.console.ssh/pom.xml 2019-03-05 22:25:38.000000000 +0000
+++ equinox-bundles-4.12/bundles/org.eclipse.equinox.console.ssh/pom.xml 2019-05-28 12:57:39.000000000 +0000
@@ -14,11 +14,11 @@
rt.equinox.bundlesorg.eclipse.equinox.bundles
- 4.11.0-SNAPSHOT
+ 4.12.0-SNAPSHOT../../org.eclipse.equinoxorg.eclipse.equinox.console.ssh
- 1.2.100-SNAPSHOT
+ 1.2.200-SNAPSHOTeclipse-plugin
diff -Nru equinox-bundles-4.11/bundles/org.eclipse.equinox.console.ssh/src/org/eclipse/equinox/console/jaas/SecureStorageLoginModule.java equinox-bundles-4.12/bundles/org.eclipse.equinox.console.ssh/src/org/eclipse/equinox/console/jaas/SecureStorageLoginModule.java
--- equinox-bundles-4.11/bundles/org.eclipse.equinox.console.ssh/src/org/eclipse/equinox/console/jaas/SecureStorageLoginModule.java 2019-03-05 22:25:38.000000000 +0000
+++ equinox-bundles-4.12/bundles/org.eclipse.equinox.console.ssh/src/org/eclipse/equinox/console/jaas/SecureStorageLoginModule.java 2019-05-28 12:57:39.000000000 +0000
@@ -55,9 +55,7 @@
PasswordCallback passwordCallback = new PasswordCallback("password: ", false);
try {
callbackHandler.handle(new Callback[]{nameCallback, passwordCallback});
- } catch (IOException e) {
- throw new FailedLoginException("Cannot get username and password");
- } catch (UnsupportedCallbackException e) {
+ } catch (IOException | UnsupportedCallbackException e) {
throw new FailedLoginException("Cannot get username and password");
}
diff -Nru equinox-bundles-4.11/bundles/org.eclipse.equinox.console.ssh.tests/pom.xml equinox-bundles-4.12/bundles/org.eclipse.equinox.console.ssh.tests/pom.xml
--- equinox-bundles-4.11/bundles/org.eclipse.equinox.console.ssh.tests/pom.xml 2019-03-05 22:25:38.000000000 +0000
+++ equinox-bundles-4.12/bundles/org.eclipse.equinox.console.ssh.tests/pom.xml 2019-05-28 12:57:39.000000000 +0000
@@ -14,7 +14,7 @@
tests-pomorg.eclipse.equinox.bundles
- 4.11.0-SNAPSHOT
+ 4.12.0-SNAPSHOT../../tests-pom/
diff -Nru equinox-bundles-4.11/bundles/org.eclipse.equinox.console.tests/pom.xml equinox-bundles-4.12/bundles/org.eclipse.equinox.console.tests/pom.xml
--- equinox-bundles-4.11/bundles/org.eclipse.equinox.console.tests/pom.xml 2019-03-05 22:25:38.000000000 +0000
+++ equinox-bundles-4.12/bundles/org.eclipse.equinox.console.tests/pom.xml 2019-05-28 12:57:39.000000000 +0000
@@ -14,7 +14,7 @@
tests-pomorg.eclipse.equinox.bundles
- 4.11.0-SNAPSHOT
+ 4.12.0-SNAPSHOT../../tests-pom/org.eclipse.equinox
diff -Nru equinox-bundles-4.11/bundles/org.eclipse.equinox.coordinator/pom.xml equinox-bundles-4.12/bundles/org.eclipse.equinox.coordinator/pom.xml
--- equinox-bundles-4.11/bundles/org.eclipse.equinox.coordinator/pom.xml 2019-03-05 22:25:38.000000000 +0000
+++ equinox-bundles-4.12/bundles/org.eclipse.equinox.coordinator/pom.xml 2019-05-28 12:57:39.000000000 +0000
@@ -14,7 +14,7 @@
rt.equinox.bundlesorg.eclipse.equinox.bundles
- 4.11.0-SNAPSHOT
+ 4.12.0-SNAPSHOT../../org.eclipse.equinox
diff -Nru equinox-bundles-4.11/bundles/org.eclipse.equinox.device/pom.xml equinox-bundles-4.12/bundles/org.eclipse.equinox.device/pom.xml
--- equinox-bundles-4.11/bundles/org.eclipse.equinox.device/pom.xml 2019-03-05 22:25:38.000000000 +0000
+++ equinox-bundles-4.12/bundles/org.eclipse.equinox.device/pom.xml 2019-05-28 12:57:39.000000000 +0000
@@ -14,7 +14,7 @@
rt.equinox.bundlesorg.eclipse.equinox.bundles
- 4.11.0-SNAPSHOT
+ 4.12.0-SNAPSHOT../../org.eclipse.equinox
diff -Nru equinox-bundles-4.11/bundles/org.eclipse.equinox.ds/pom.xml equinox-bundles-4.12/bundles/org.eclipse.equinox.ds/pom.xml
--- equinox-bundles-4.11/bundles/org.eclipse.equinox.ds/pom.xml 2019-03-05 22:25:38.000000000 +0000
+++ equinox-bundles-4.12/bundles/org.eclipse.equinox.ds/pom.xml 2019-05-28 12:57:39.000000000 +0000
@@ -14,7 +14,7 @@
rt.equinox.bundlesorg.eclipse.equinox.bundles
- 4.11.0-SNAPSHOT
+ 4.12.0-SNAPSHOT../../org.eclipse.equinox
diff -Nru equinox-bundles-4.11/bundles/org.eclipse.equinox.ds.tests/bundles_src/tb1/org/eclipse/equinox/ds/tests/tb1/BindUnbindSuccessor.java equinox-bundles-4.12/bundles/org.eclipse.equinox.ds.tests/bundles_src/tb1/org/eclipse/equinox/ds/tests/tb1/BindUnbindSuccessor.java
--- equinox-bundles-4.11/bundles/org.eclipse.equinox.ds.tests/bundles_src/tb1/org/eclipse/equinox/ds/tests/tb1/BindUnbindSuccessor.java 2019-03-05 22:25:38.000000000 +0000
+++ equinox-bundles-4.12/bundles/org.eclipse.equinox.ds.tests/bundles_src/tb1/org/eclipse/equinox/ds/tests/tb1/BindUnbindSuccessor.java 2019-05-28 12:57:39.000000000 +0000
@@ -46,6 +46,7 @@
else ctxt.disableComponent(name);
}
+ @Override
public Dictionary getProperties() {
return ctxt.getProperties();
}
diff -Nru equinox-bundles-4.11/bundles/org.eclipse.equinox.ds.tests/bundles_src/tb12/org/eclipse/equinox/ds/tests/tb12/Bc100.java equinox-bundles-4.12/bundles/org.eclipse.equinox.ds.tests/bundles_src/tb12/org/eclipse/equinox/ds/tests/tb12/Bc100.java
--- equinox-bundles-4.11/bundles/org.eclipse.equinox.ds.tests/bundles_src/tb12/org/eclipse/equinox/ds/tests/tb12/Bc100.java 2019-03-05 22:25:38.000000000 +0000
+++ equinox-bundles-4.12/bundles/org.eclipse.equinox.ds.tests/bundles_src/tb12/org/eclipse/equinox/ds/tests/tb12/Bc100.java 2019-05-28 12:57:39.000000000 +0000
@@ -16,6 +16,7 @@
public class Bc100 extends CallRegistrator {
+ @Override
public String getName() {
return "org.eclipse.equinox.ds.tests.tb12.Bc100";
}
diff -Nru equinox-bundles-4.11/bundles/org.eclipse.equinox.ds.tests/bundles_src/tb12/org/eclipse/equinox/ds/tests/tb12/Bc110.java equinox-bundles-4.12/bundles/org.eclipse.equinox.ds.tests/bundles_src/tb12/org/eclipse/equinox/ds/tests/tb12/Bc110.java
--- equinox-bundles-4.11/bundles/org.eclipse.equinox.ds.tests/bundles_src/tb12/org/eclipse/equinox/ds/tests/tb12/Bc110.java 2019-03-05 22:25:38.000000000 +0000
+++ equinox-bundles-4.12/bundles/org.eclipse.equinox.ds.tests/bundles_src/tb12/org/eclipse/equinox/ds/tests/tb12/Bc110.java 2019-05-28 12:57:39.000000000 +0000
@@ -16,6 +16,7 @@
public class Bc110 extends CallRegistrator {
+ @Override
public String getName() {
return "org.eclipse.equinox.ds.tests.tb12.Bc110";
}
diff -Nru equinox-bundles-4.11/bundles/org.eclipse.equinox.ds.tests/bundles_src/tb12/org/eclipse/equinox/ds/tests/tb12/NoArgs100.java equinox-bundles-4.12/bundles/org.eclipse.equinox.ds.tests/bundles_src/tb12/org/eclipse/equinox/ds/tests/tb12/NoArgs100.java
--- equinox-bundles-4.11/bundles/org.eclipse.equinox.ds.tests/bundles_src/tb12/org/eclipse/equinox/ds/tests/tb12/NoArgs100.java 2019-03-05 22:25:38.000000000 +0000
+++ equinox-bundles-4.12/bundles/org.eclipse.equinox.ds.tests/bundles_src/tb12/org/eclipse/equinox/ds/tests/tb12/NoArgs100.java 2019-05-28 12:57:39.000000000 +0000
@@ -16,6 +16,7 @@
public class NoArgs100 extends CallRegistrator {
+ @Override
public String getName() {
return "org.eclipse.equinox.ds.tests.tb12.NoArgs100";
}
diff -Nru equinox-bundles-4.11/bundles/org.eclipse.equinox.ds.tests/bundles_src/tb12/org/eclipse/equinox/ds/tests/tb12/NoArgs110.java equinox-bundles-4.12/bundles/org.eclipse.equinox.ds.tests/bundles_src/tb12/org/eclipse/equinox/ds/tests/tb12/NoArgs110.java
--- equinox-bundles-4.11/bundles/org.eclipse.equinox.ds.tests/bundles_src/tb12/org/eclipse/equinox/ds/tests/tb12/NoArgs110.java 2019-03-05 22:25:38.000000000 +0000
+++ equinox-bundles-4.12/bundles/org.eclipse.equinox.ds.tests/bundles_src/tb12/org/eclipse/equinox/ds/tests/tb12/NoArgs110.java 2019-05-28 12:57:39.000000000 +0000
@@ -16,6 +16,7 @@
public class NoArgs110 extends CallRegistrator {
+ @Override
public String getName() {
return "org.eclipse.equinox.ds.tests.tb12.NoArgs110";
}
diff -Nru equinox-bundles-4.11/bundles/org.eclipse.equinox.ds.tests/bundles_src/tb4/org/eclipse/equinox/ds/tests/tb4/impl/NamedFactory.java equinox-bundles-4.12/bundles/org.eclipse.equinox.ds.tests/bundles_src/tb4/org/eclipse/equinox/ds/tests/tb4/impl/NamedFactory.java
--- equinox-bundles-4.11/bundles/org.eclipse.equinox.ds.tests/bundles_src/tb4/org/eclipse/equinox/ds/tests/tb4/impl/NamedFactory.java 2019-03-05 22:25:38.000000000 +0000
+++ equinox-bundles-4.12/bundles/org.eclipse.equinox.ds.tests/bundles_src/tb4/org/eclipse/equinox/ds/tests/tb4/impl/NamedFactory.java 2019-05-28 12:57:39.000000000 +0000
@@ -39,6 +39,7 @@
return name;
}
+ @Override
public String toString() {
return name;
}
diff -Nru equinox-bundles-4.11/bundles/org.eclipse.equinox.ds.tests/META-INF/MANIFEST.MF equinox-bundles-4.12/bundles/org.eclipse.equinox.ds.tests/META-INF/MANIFEST.MF
--- equinox-bundles-4.11/bundles/org.eclipse.equinox.ds.tests/META-INF/MANIFEST.MF 2019-03-05 22:25:38.000000000 +0000
+++ equinox-bundles-4.12/bundles/org.eclipse.equinox.ds.tests/META-INF/MANIFEST.MF 2019-05-28 12:57:39.000000000 +0000
@@ -3,7 +3,7 @@
Bundle-Name: Declarative Services Tests
Bundle-Category: test
Bundle-SymbolicName: org.eclipse.equinox.ds.tests
-Bundle-Version: 1.5.300.qualifier
+Bundle-Version: 1.5.400.qualifier
Bundle-Activator: org.eclipse.equinox.ds.tests.DSTestsActivator
Bundle-ActivationPolicy: lazy
Require-Bundle: org.junit
diff -Nru equinox-bundles-4.11/bundles/org.eclipse.equinox.ds.tests/pom.xml equinox-bundles-4.12/bundles/org.eclipse.equinox.ds.tests/pom.xml
--- equinox-bundles-4.11/bundles/org.eclipse.equinox.ds.tests/pom.xml 2019-03-05 22:25:38.000000000 +0000
+++ equinox-bundles-4.12/bundles/org.eclipse.equinox.ds.tests/pom.xml 2019-05-28 12:57:39.000000000 +0000
@@ -5,7 +5,7 @@
are made available under the terms of the Eclipse Distribution License v1.0
which accompanies this distribution, and is available at
http://www.eclipse.org/org/documents/edl-v10.php
-
+
Contributors:
Igor Fedorenko - initial implementation
-->
@@ -14,11 +14,11 @@
tests-pomorg.eclipse.equinox.bundles
- 4.11.0-SNAPSHOT
+ 4.12.0-SNAPSHOT../../tests-pom/org.eclipse.equinoxorg.eclipse.equinox.ds.tests
- 1.5.300-SNAPSHOT
+ 1.5.400-SNAPSHOTeclipse-test-plugin
diff -Nru equinox-bundles-4.11/bundles/org.eclipse.equinox.ds.tests/src/org/eclipse/equinox/ds/tests/tbc/DSEvent.java equinox-bundles-4.12/bundles/org.eclipse.equinox.ds.tests/src/org/eclipse/equinox/ds/tests/tbc/DSEvent.java
--- equinox-bundles-4.11/bundles/org.eclipse.equinox.ds.tests/src/org/eclipse/equinox/ds/tests/tbc/DSEvent.java 2019-03-05 22:25:38.000000000 +0000
+++ equinox-bundles-4.12/bundles/org.eclipse.equinox.ds.tests/src/org/eclipse/equinox/ds/tests/tbc/DSEvent.java 2019-05-28 12:57:39.000000000 +0000
@@ -86,6 +86,7 @@
}
}
+ @Override
public String toString() {
StringBuffer buf = new StringBuffer("DSEvent[");
buf.append("time=" + this.time + ";action=");
diff -Nru equinox-bundles-4.11/bundles/org.eclipse.equinox.ds.tests/src/org/eclipse/equinox/ds/tests/tbc/DSTest.java equinox-bundles-4.12/bundles/org.eclipse.equinox.ds.tests/src/org/eclipse/equinox/ds/tests/tbc/DSTest.java
--- equinox-bundles-4.11/bundles/org.eclipse.equinox.ds.tests/src/org/eclipse/equinox/ds/tests/tbc/DSTest.java 2019-03-05 22:25:38.000000000 +0000
+++ equinox-bundles-4.12/bundles/org.eclipse.equinox.ds.tests/src/org/eclipse/equinox/ds/tests/tbc/DSTest.java 2019-05-28 12:57:39.000000000 +0000
@@ -1242,6 +1242,7 @@
final Bundle tb4 = installBundle("tb4");
new Thread() {
+ @Override
public void run() {
try {
tb2.start(); // start the blocking service
@@ -1252,6 +1253,7 @@
sleep0(scr_restart_timeout + timeout * 2);
new Thread() {
+ @Override
public void run() {
try {
tb4.start(); // start the other
@@ -1276,6 +1278,7 @@
// start the other blocking bundle
new Thread() {
+ @Override
public void run() {
try {
tb3.start();
@@ -1288,6 +1291,7 @@
// start the non-blocking bundle
new Thread() {
+ @Override
public void run() {
try {
tb4.start(); // start the other
@@ -2158,6 +2162,7 @@
this.lastComp = last;
}
+ @Override
public void run() {
ConfigurationAdmin cm = (ConfigurationAdmin) trackerCM.getService();
assertNotNull("The ConfigurationAdmin should be available", cm);
diff -Nru equinox-bundles-4.11/bundles/org.eclipse.equinox.event/META-INF/MANIFEST.MF equinox-bundles-4.12/bundles/org.eclipse.equinox.event/META-INF/MANIFEST.MF
--- equinox-bundles-4.11/bundles/org.eclipse.equinox.event/META-INF/MANIFEST.MF 2019-03-05 22:25:38.000000000 +0000
+++ equinox-bundles-4.12/bundles/org.eclipse.equinox.event/META-INF/MANIFEST.MF 2019-05-28 12:57:39.000000000 +0000
@@ -1,6 +1,6 @@
Bundle-ManifestVersion: 2
Bundle-Name: %bundleName
-Bundle-Version: 1.5.0.qualifier
+Bundle-Version: 1.5.100.qualifier
Bundle-SymbolicName: org.eclipse.equinox.event
Bundle-Activator: org.eclipse.equinox.internal.event.Activator
Import-Package: org.eclipse.osgi.framework.eventmgr;version="1.1.0",
diff -Nru equinox-bundles-4.11/bundles/org.eclipse.equinox.event/pom.xml equinox-bundles-4.12/bundles/org.eclipse.equinox.event/pom.xml
--- equinox-bundles-4.11/bundles/org.eclipse.equinox.event/pom.xml 2019-03-05 22:25:38.000000000 +0000
+++ equinox-bundles-4.12/bundles/org.eclipse.equinox.event/pom.xml 2019-05-28 12:57:39.000000000 +0000
@@ -14,11 +14,11 @@
rt.equinox.bundlesorg.eclipse.equinox.bundles
- 4.11.0-SNAPSHOT
+ 4.12.0-SNAPSHOT../../org.eclipse.equinoxorg.eclipse.equinox.event
- 1.5.0-SNAPSHOT
+ 1.5.100-SNAPSHOTeclipse-plugin
diff -Nru equinox-bundles-4.11/bundles/org.eclipse.equinox.http.jetty/META-INF/MANIFEST.MF equinox-bundles-4.12/bundles/org.eclipse.equinox.http.jetty/META-INF/MANIFEST.MF
--- equinox-bundles-4.11/bundles/org.eclipse.equinox.http.jetty/META-INF/MANIFEST.MF 2019-03-05 22:25:38.000000000 +0000
+++ equinox-bundles-4.12/bundles/org.eclipse.equinox.http.jetty/META-INF/MANIFEST.MF 2019-05-28 12:57:39.000000000 +0000
@@ -4,7 +4,7 @@
Bundle-Vendor: %providerName
Bundle-Localization: plugin
Bundle-SymbolicName: org.eclipse.equinox.http.jetty
-Bundle-Version: 3.7.0.qualifier
+Bundle-Version: 3.7.100.qualifier
Bundle-Activator: org.eclipse.equinox.http.jetty.internal.Activator
Import-Package: javax.servlet;version="[3.1.0,5.0.0)",
javax.servlet.http;version="[3.1.0,5.0.0)",
diff -Nru equinox-bundles-4.11/bundles/org.eclipse.equinox.http.jetty/pom.xml equinox-bundles-4.12/bundles/org.eclipse.equinox.http.jetty/pom.xml
--- equinox-bundles-4.11/bundles/org.eclipse.equinox.http.jetty/pom.xml 2019-03-05 22:25:38.000000000 +0000
+++ equinox-bundles-4.12/bundles/org.eclipse.equinox.http.jetty/pom.xml 2019-05-28 12:57:39.000000000 +0000
@@ -16,11 +16,11 @@
rt.equinox.bundlesorg.eclipse.equinox.bundles
- 4.11.0-SNAPSHOT
+ 4.12.0-SNAPSHOT../../org.eclipse.equinoxorg.eclipse.equinox.http.jetty
- 3.7.0-SNAPSHOT
+ 3.7.100-SNAPSHOTeclipse-plugin
diff -Nru equinox-bundles-4.11/bundles/org.eclipse.equinox.http.jetty/src/org/eclipse/equinox/http/jetty/internal/HttpServerManager.java equinox-bundles-4.12/bundles/org.eclipse.equinox.http.jetty/src/org/eclipse/equinox/http/jetty/internal/HttpServerManager.java
--- equinox-bundles-4.11/bundles/org.eclipse.equinox.http.jetty/src/org/eclipse/equinox/http/jetty/internal/HttpServerManager.java 2019-03-05 22:25:38.000000000 +0000
+++ equinox-bundles-4.12/bundles/org.eclipse.equinox.http.jetty/src/org/eclipse/equinox/http/jetty/internal/HttpServerManager.java 2019-05-28 12:57:39.000000000 +0000
@@ -337,9 +337,7 @@
thread.setContextClassLoader(contextLoader);
try {
sessionDestroyed.invoke(httpServiceServlet, event.getSession().getId());
- } catch (IllegalAccessException e) {
- // not likely
- } catch (IllegalArgumentException e) {
+ } catch (IllegalAccessException | IllegalArgumentException e) {
// not likely
} catch (InvocationTargetException e) {
throw new RuntimeException(e.getCause());
@@ -355,9 +353,7 @@
thread.setContextClassLoader(contextLoader);
try {
sessionIdChanged.invoke(httpServiceServlet, oldSessionId);
- } catch (IllegalAccessException e) {
- // not likely
- } catch (IllegalArgumentException e) {
+ } catch (IllegalAccessException | IllegalArgumentException e) {
// not likely
} catch (InvocationTargetException e) {
throw new RuntimeException(e.getCause());
diff -Nru equinox-bundles-4.11/bundles/org.eclipse.equinox.http.jetty.starter/pom.xml equinox-bundles-4.12/bundles/org.eclipse.equinox.http.jetty.starter/pom.xml
--- equinox-bundles-4.11/bundles/org.eclipse.equinox.http.jetty.starter/pom.xml 2019-03-05 22:25:38.000000000 +0000
+++ equinox-bundles-4.12/bundles/org.eclipse.equinox.http.jetty.starter/pom.xml 2019-05-28 12:57:39.000000000 +0000
@@ -15,7 +15,7 @@
rt.equinox.bundlesorg.eclipse.equinox.bundles
- 4.11.0-SNAPSHOT
+ 4.12.0-SNAPSHOT../../org.eclipse.equinox
diff -Nru equinox-bundles-4.11/bundles/org.eclipse.equinox.http.registry/pom.xml equinox-bundles-4.12/bundles/org.eclipse.equinox.http.registry/pom.xml
--- equinox-bundles-4.11/bundles/org.eclipse.equinox.http.registry/pom.xml 2019-03-05 22:25:38.000000000 +0000
+++ equinox-bundles-4.12/bundles/org.eclipse.equinox.http.registry/pom.xml 2019-05-28 12:57:39.000000000 +0000
@@ -14,7 +14,7 @@
rt.equinox.bundlesorg.eclipse.equinox.bundles
- 4.11.0-SNAPSHOT
+ 4.12.0-SNAPSHOT../../org.eclipse.equinox
diff -Nru equinox-bundles-4.11/bundles/org.eclipse.equinox.http.servlet/META-INF/MANIFEST.MF equinox-bundles-4.12/bundles/org.eclipse.equinox.http.servlet/META-INF/MANIFEST.MF
--- equinox-bundles-4.11/bundles/org.eclipse.equinox.http.servlet/META-INF/MANIFEST.MF 2019-03-05 22:25:38.000000000 +0000
+++ equinox-bundles-4.12/bundles/org.eclipse.equinox.http.servlet/META-INF/MANIFEST.MF 2019-05-28 12:57:39.000000000 +0000
@@ -3,7 +3,7 @@
Bundle-Name: %bundleName
Bundle-Vendor: %providerName
Bundle-SymbolicName: org.eclipse.equinox.http.servlet
-Bundle-Version: 1.6.0.qualifier
+Bundle-Version: 1.6.100.qualifier
Bundle-Activator: org.eclipse.equinox.http.servlet.internal.Activator
Bundle-Localization: plugin
Bundle-RequiredExecutionEnvironment: JavaSE-1.7
diff -Nru equinox-bundles-4.11/bundles/org.eclipse.equinox.http.servlet/pom.xml equinox-bundles-4.12/bundles/org.eclipse.equinox.http.servlet/pom.xml
--- equinox-bundles-4.11/bundles/org.eclipse.equinox.http.servlet/pom.xml 2019-03-05 22:25:38.000000000 +0000
+++ equinox-bundles-4.12/bundles/org.eclipse.equinox.http.servlet/pom.xml 2019-05-28 12:57:39.000000000 +0000
@@ -15,11 +15,11 @@
rt.equinox.bundlesorg.eclipse.equinox.bundles
- 4.11.0-SNAPSHOT
+ 4.12.0-SNAPSHOT../../org.eclipse.equinoxorg.eclipse.equinox.http.servlet
- 1.6.0-SNAPSHOT
+ 1.6.100-SNAPSHOTeclipse-plugin
diff -Nru equinox-bundles-4.11/bundles/org.eclipse.equinox.http.servlet/src/org/eclipse/equinox/http/servlet/internal/context/ContextController.java equinox-bundles-4.12/bundles/org.eclipse.equinox.http.servlet/src/org/eclipse/equinox/http/servlet/internal/context/ContextController.java
--- equinox-bundles-4.11/bundles/org.eclipse.equinox.http.servlet/src/org/eclipse/equinox/http/servlet/internal/context/ContextController.java 2019-03-05 22:25:38.000000000 +0000
+++ equinox-bundles-4.12/bundles/org.eclipse.equinox.http.servlet/src/org/eclipse/equinox/http/servlet/internal/context/ContextController.java 2019-05-28 12:57:39.000000000 +0000
@@ -602,19 +602,27 @@
shutdown = true;
}
+ public void createContextAttributes() {
+ getProxyContext().createContextAttributes(this);
+ }
+
+ public void destroyContextAttributes() {
+ if (shutdown) {
+ return;
+ }
+
+ proxyContext.destroyContextAttributes(this);
+ }
+
public boolean isLegacyContext() {
return serviceReference.getProperty(HTTP_SERVICE_CONTEXT_PROPERTY) != null;
}
public String getContextName() {
- checkShutdown();
-
return contextName;
}
public String getContextPath() {
- checkShutdown();
-
return contextPath;
}
@@ -769,26 +777,18 @@
}
public Map getActiveSessions() {
- checkShutdown();
-
return activeSessions;
}
public Set> getEndpointRegistrations() {
- checkShutdown();
-
return endpointRegistrations;
}
public EventListeners getEventListeners() {
- checkShutdown();
-
return eventListeners;
}
public Set getFilterRegistrations() {
- checkShutdown();
-
return filterRegistrations;
}
@@ -824,8 +824,6 @@
}
public HttpServiceRuntimeImpl getHttpServiceRuntime() {
- checkShutdown();
-
return httpServiceRuntime;
}
@@ -834,29 +832,21 @@
}
public Set getListenerRegistrations() {
- checkShutdown();
-
return listenerRegistrations;
}
public ProxyContext getProxyContext() {
- checkShutdown();
-
return proxyContext;
}
public long getServiceId() {
- checkShutdown();
-
return contextServiceId;
}
public synchronized ServletContextDTO getServletContextDTO(){
- checkShutdown();
-
ServletContextDTO servletContextDTO = new ServletContextDTO();
- ServletContext servletContext = getProxyContext().getServletContext();
+ ServletContext servletContext = proxyContext.getServletContext();
servletContextDTO.attributes = getDTOAttributes(servletContext);
servletContextDTO.contextPath = getContextPath();
@@ -872,13 +862,21 @@
}
public boolean matches(ServiceReference> whiteBoardService) {
- String contextSelector = (String) whiteBoardService.getProperty(
- HTTP_WHITEBOARD_CONTEXT_SELECT);
// make sure the context helper is either one of the built-in ones registered by this http whiteboard implementation;
// or is visible to the whiteboard registering bundle.
+
if (!visibleContextHelper(whiteBoardService)) {
return false;
}
+
+ String contextSelector = (String) whiteBoardService.getProperty(
+ HTTP_WHITEBOARD_CONTEXT_SELECT);
+
+ // custom equinox behaviour
+ if (contextName.equals(contextSelector)) {
+ return true;
+ }
+
if (contextSelector == null) {
contextSelector = httpServiceRuntime.getDefaultContextSelectFilter(whiteBoardService);
if (contextSelector == null) {
@@ -888,25 +886,31 @@
}
}
- if (!contextSelector.startsWith(Const.OPEN_PAREN)) {
- contextSelector = Const.OPEN_PAREN +
- HTTP_WHITEBOARD_CONTEXT_NAME +
- Const.EQUAL + contextSelector + Const.CLOSE_PAREN;
- }
+ if (contextSelector.startsWith(Const.OPEN_PAREN)) {
+ org.osgi.framework.Filter targetFilter;
- org.osgi.framework.Filter targetFilter;
+ try {
+ targetFilter = FrameworkUtil.createFilter(contextSelector);
+ }
+ catch (InvalidSyntaxException ise) {
+ throw new IllegalArgumentException(ise);
+ }
- try {
- targetFilter = FrameworkUtil.createFilter(contextSelector);
- }
- catch (InvalidSyntaxException ise) {
- throw new HttpWhiteboardFailureException(ise.getMessage(), DTOConstants.FAILURE_REASON_VALIDATION_FAILED);
+ if (matches(targetFilter)) {
+ return true;
+ }
}
- return matches(targetFilter);
+ return false;
}
private boolean visibleContextHelper(ServiceReference> whiteBoardService) {
+ if (consumingContext.getBundle().equals(serviceReference.getBundle())) {
+ Boolean defaultContextHelper = (Boolean) serviceReference.getProperty(Const.EQUINOX_HTTP_WHITEBOARD_CONTEXT_HELPER_DEFAULT);
+ if (defaultContextHelper == null) {
+ return true;
+ }
+ }
try {
if (whiteBoardService.getBundle().getBundleContext().getAllServiceReferences(ServletContextHelper.class.getName(), servletContextHelperRefFilter) != null) {
return true;
@@ -1253,6 +1257,10 @@
}
public void fireSessionIdChanged(String oldSessionId) {
+ if (shutdown) {
+ return;
+ }
+
ServletContext servletContext = proxyContext.getServletContext();
if ((servletContext.getMajorVersion() <= 3) && (servletContext.getMinorVersion() < 1)) {
return;
diff -Nru equinox-bundles-4.11/bundles/org.eclipse.equinox.http.servlet/src/org/eclipse/equinox/http/servlet/internal/context/DispatchTargets.java equinox-bundles-4.12/bundles/org.eclipse.equinox.http.servlet/src/org/eclipse/equinox/http/servlet/internal/context/DispatchTargets.java
--- equinox-bundles-4.11/bundles/org.eclipse.equinox.http.servlet/src/org/eclipse/equinox/http/servlet/internal/context/DispatchTargets.java 2019-03-05 22:25:38.000000000 +0000
+++ equinox-bundles-4.12/bundles/org.eclipse.equinox.http.servlet/src/org/eclipse/equinox/http/servlet/internal/context/DispatchTargets.java 2019-05-28 12:57:39.000000000 +0000
@@ -246,6 +246,7 @@
servletRequest.setAttribute(name, value);
}
+ @Override
public void close() {
for (Map.Entry oldValue : oldValues.entrySet()) {
if (oldValue.getValue() == null) {
diff -Nru equinox-bundles-4.11/bundles/org.eclipse.equinox.http.servlet/src/org/eclipse/equinox/http/servlet/internal/customizer/ContextListenerTrackerCustomizer.java equinox-bundles-4.12/bundles/org.eclipse.equinox.http.servlet/src/org/eclipse/equinox/http/servlet/internal/customizer/ContextListenerTrackerCustomizer.java
--- equinox-bundles-4.11/bundles/org.eclipse.equinox.http.servlet/src/org/eclipse/equinox/http/servlet/internal/customizer/ContextListenerTrackerCustomizer.java 2019-03-05 22:25:38.000000000 +0000
+++ equinox-bundles-4.12/bundles/org.eclipse.equinox.http.servlet/src/org/eclipse/equinox/http/servlet/internal/customizer/ContextListenerTrackerCustomizer.java 2019-05-28 12:57:39.000000000 +0000
@@ -67,13 +67,23 @@
Object listenerObj = serviceReference.getProperty(HttpWhiteboardConstants.HTTP_WHITEBOARD_LISTENER);
- if (!(listenerObj instanceof Boolean) && !(listenerObj instanceof String)) {
+ if (!(listenerObj instanceof Boolean) &&
+ !"true".equalsIgnoreCase(String.valueOf(listenerObj)) && //$NON-NLS-1$
+ !"false".equalsIgnoreCase(String.valueOf(listenerObj)) && //$NON-NLS-1$
+ !"1".equalsIgnoreCase(String.valueOf(listenerObj)) && //$NON-NLS-1$
+ !"0".equalsIgnoreCase(String.valueOf(listenerObj)) && //$NON-NLS-1$
+ !"yes".equalsIgnoreCase(String.valueOf(listenerObj)) && //$NON-NLS-1$
+ !"no".equalsIgnoreCase(String.valueOf(listenerObj)) //$NON-NLS-1$
+ ) {
throw new HttpWhiteboardFailureException(
HttpWhiteboardConstants.HTTP_WHITEBOARD_LISTENER + "=" + listenerObj + " is not a valid option. Ignoring!", //$NON-NLS-1$ //$NON-NLS-2$
DTOConstants.FAILURE_REASON_VALIDATION_FAILED);
}
- if (Boolean.FALSE.equals(listenerObj) || !Boolean.valueOf(String.valueOf(listenerObj)).booleanValue()) {
+ if (Boolean.FALSE.equals(listenerObj) ||
+ "false".equalsIgnoreCase(String.valueOf(listenerObj)) || //$NON-NLS-1$
+ "0".equalsIgnoreCase(String.valueOf(listenerObj)) || //$NON-NLS-1$
+ "no".equalsIgnoreCase(String.valueOf(listenerObj))) { //$NON-NLS-1$
// Asks to be ignored.
return result;
}
diff -Nru equinox-bundles-4.11/bundles/org.eclipse.equinox.http.servlet/src/org/eclipse/equinox/http/servlet/internal/HttpServiceImpl.java equinox-bundles-4.12/bundles/org.eclipse.equinox.http.servlet/src/org/eclipse/equinox/http/servlet/internal/HttpServiceImpl.java
--- equinox-bundles-4.11/bundles/org.eclipse.equinox.http.servlet/src/org/eclipse/equinox/http/servlet/internal/HttpServiceImpl.java 2019-03-05 22:25:38.000000000 +0000
+++ equinox-bundles-4.12/bundles/org.eclipse.equinox.http.servlet/src/org/eclipse/equinox/http/servlet/internal/HttpServiceImpl.java 2019-05-28 12:57:39.000000000 +0000
@@ -54,18 +54,14 @@
public synchronized HttpContext createDefaultHttpContext() {
checkShutdown();
- DefaultServletContextHelper defaultServletContextHelper = bundle.getBundleContext().getService(httpServiceRuntime.defaultContextReg.getReference());
- HttpContextHolder httpContextHolder = new HttpContextHolder(defaultServletContextHelper, httpServiceRuntime.defaultContextReg);
- httpContextHolder.incrementUseCount();
- httpServiceRuntime.legacyContextMap.putIfAbsent(defaultServletContextHelper, httpContextHolder);
-
- return defaultServletContextHelper;
+ return new DefaultServletContextHelper(bundle);
}
/**
* @throws ServletException
* @see ExtendedHttpService#registerFilter(String, Filter, Dictionary, HttpContext)
*/
+ @Override
public synchronized void registerFilter(
final String alias, final Filter filter,
final Dictionary initparams,
@@ -73,8 +69,8 @@
throws ServletException {
checkShutdown();
- httpContext = httpContext == null ? createDefaultHttpContext() : registerContext(httpContext);
- final HttpContextHolder httpContextHolder = httpServiceRuntime.legacyContextMap.get(httpContext);
+
+ final HttpContextHolder httpContextHolder = getHttpContextHolder(httpContext);
try {
AccessController.doPrivileged(new PrivilegedExceptionAction() {
@Override
@@ -90,6 +86,14 @@
}
+ private HttpContextHolder getHttpContextHolder(HttpContext httpContext) {
+ if (httpContext == null) {
+ httpContext = createDefaultHttpContext();
+ }
+ registerContext(httpContext);
+ return httpServiceRuntime.legacyContextMap.get(httpContext);
+ }
+
/**
* @throws NamespaceException
* @see HttpService#registerResources(String, String, HttpContext)
@@ -99,8 +103,7 @@
throws NamespaceException {
checkShutdown();
- httpContext = httpContext == null ? createDefaultHttpContext() : registerContext(httpContext);
- final HttpContextHolder httpContextHolder = httpServiceRuntime.legacyContextMap.get(httpContext);
+ final HttpContextHolder httpContextHolder = getHttpContextHolder(httpContext);
try {
AccessController.doPrivileged(new PrivilegedExceptionAction() {
@Override
@@ -126,8 +129,7 @@
throws ServletException, NamespaceException {
checkShutdown();
- httpContext = httpContext == null ? createDefaultHttpContext() : registerContext(httpContext);
- final HttpContextHolder httpContextHolder = httpServiceRuntime.legacyContextMap.get(httpContext);
+ final HttpContextHolder httpContextHolder = getHttpContextHolder(httpContext);
try {
AccessController.doPrivileged(new PrivilegedExceptionAction() {
@Override
@@ -153,6 +155,7 @@
/**
* @see ExtendedHttpService#unregisterFilter(Filter)
*/
+ @Override
public synchronized void unregisterFilter(Filter filter) {
checkShutdown();
@@ -181,7 +184,7 @@
HttpContextHolder httpContextHolder = httpServiceRuntime.legacyContextMap.get(httpContext);
if (httpContextHolder == null) {
- String legacyId = httpContext.getClass().getName().replaceAll("[^a-zA-Z_0-9\\-]", "_") + "-" + generateLegacyId(); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
+ String legacyId= httpContext.getClass().getName().replaceAll("[^a-zA-Z_0-9\\-]", "_") + "-" + generateLegacyId(); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
Dictionary props = new Hashtable();
props.put(HTTP_WHITEBOARD_CONTEXT_NAME, legacyId);
props.put(HTTP_WHITEBOARD_CONTEXT_PATH, "/"); //$NON-NLS-1$
@@ -196,6 +199,8 @@
httpContextHolder.incrementUseCount();
httpServiceRuntime.legacyContextMap.put(httpContext, httpContextHolder);
+ } else {
+ httpContextHolder.incrementUseCount();
}
return httpContext;
diff -Nru equinox-bundles-4.11/bundles/org.eclipse.equinox.http.servlet/src/org/eclipse/equinox/http/servlet/internal/HttpServiceRuntimeImpl.java equinox-bundles-4.12/bundles/org.eclipse.equinox.http.servlet/src/org/eclipse/equinox/http/servlet/internal/HttpServiceRuntimeImpl.java
--- equinox-bundles-4.11/bundles/org.eclipse.equinox.http.servlet/src/org/eclipse/equinox/http/servlet/internal/HttpServiceRuntimeImpl.java 2019-03-05 22:25:38.000000000 +0000
+++ equinox-bundles-4.12/bundles/org.eclipse.equinox.http.servlet/src/org/eclipse/equinox/http/servlet/internal/HttpServiceRuntimeImpl.java 2019-05-28 12:57:39.000000000 +0000
@@ -57,7 +57,6 @@
HttpServiceRuntime,
ServiceTrackerCustomizer> {
- @SuppressWarnings("unchecked")
public HttpServiceRuntimeImpl(
BundleContext trackingContext, BundleContext consumingContext,
ServletContext parentServletContext, Dictionary attributes) {
@@ -69,7 +68,7 @@
this.servletServiceFilter = createServletFilter(consumingContext);
this.resourceServiceFilter = createResourceFilter(consumingContext);
this.filterServiceFilter = createFilterFilter(consumingContext);
- this.listenerServiceFilter = createListenerFilter(consumingContext);
+ this.listenerServiceFilter = createListenerFilter(consumingContext, parentServletContext);
this.parentServletContext = parentServletContext;
this.attributes = new UMDictionaryMap(attributes);
@@ -110,9 +109,9 @@
defaultContextProps.put(Constants.SERVICE_RANKING, Integer.MIN_VALUE);
defaultContextProps.put(HTTP_WHITEBOARD_CONTEXT_PATH, Const.SLASH);
defaultContextProps.put(HTTP_WHITEBOARD_TARGET, this.targetFilter);
- defaultContextProps.put(HTTP_SERVICE_CONTEXT_PROPERTY, HTTP_WHITEBOARD_DEFAULT_CONTEXT_NAME);
- defaultContextReg = (ServiceRegistration) consumingContext.registerService(
- new String [] {ServletContextHelper.class.getName(), DefaultServletContextHelper.class.getName()}, new DefaultServletContextHelperFactory(), defaultContextProps);
+ defaultContextProps.put(Const.EQUINOX_HTTP_WHITEBOARD_CONTEXT_HELPER_DEFAULT, Boolean.TRUE);
+ defaultContextReg = consumingContext.registerService(
+ ServletContextHelper.class, new DefaultServletContextHelperFactory(), defaultContextProps);
}
public synchronized void open() {
@@ -689,7 +688,8 @@
props.put(HTTP_WHITEBOARD_TARGET, targetFilter);
props.put(HTTP_WHITEBOARD_FILTER_PATTERN, alias);
props.put(HTTP_WHITEBOARD_FILTER_NAME, filterName);
- props.put(HTTP_WHITEBOARD_CONTEXT_SELECT, getFilter(httpContextHolder.getServiceReference()));
+ props.put(HTTP_WHITEBOARD_CONTEXT_SELECT, "(" + Const.EQUINOX_LEGACY_CONTEXT_HELPER + "=true)"); //$NON-NLS-1$ //$NON-NLS-2$
+ props.put(Const.EQUINOX_LEGACY_CONTEXT_SELECT, getFilter(httpContextHolder.getServiceReference()));
props.put(Const.EQUINOX_LEGACY_TCCL_PROP, Thread.currentThread().getContextClassLoader());
props.put(Constants.SERVICE_RANKING, findFilterPriority(initparams));
fillInitParams(props, initparams, HTTP_WHITEBOARD_FILTER_INIT_PARAM_PREFIX);
@@ -700,7 +700,6 @@
// check that init got called and did not throw an exception
filterFactory.checkForError();
- httpContextHolder.incrementUseCount();
objectRegistration = new HttpServiceObjectRegistration(filter, registration, httpContextHolder, bundle);
Set objectRegistrations = bundleRegistrations.get(bundle);
@@ -802,7 +801,6 @@
props.put(Constants.SERVICE_RANKING, Integer.MAX_VALUE);
props.put(Const.EQUINOX_LEGACY_TCCL_PROP, Thread.currentThread().getContextClassLoader());
registration = bundle.getBundleContext().registerService(String.class, "resource", props); //$NON-NLS-1$
- httpContextHolder.incrementUseCount();
objectRegistration = new HttpServiceObjectRegistration(fullAlias, registration, httpContextHolder, bundle);
@@ -891,7 +889,6 @@
// check that init got called and did not throw an exception
legacyServlet.checkForError();
- httpContextHolder.incrementUseCount();
objectRegistration = new HttpServiceObjectRegistration(fullAlias, registration, httpContextHolder, bundle);
@@ -1082,7 +1079,7 @@
}
}
- private static org.osgi.framework.Filter createListenerFilter(BundleContext context) {
+ private static org.osgi.framework.Filter createListenerFilter(BundleContext context, ServletContext servletContext) {
StringBuilder sb = new StringBuilder();
sb.append("(&"); //$NON-NLS-1$
@@ -1094,7 +1091,9 @@
sb.append("(objectClass=").append(ServletRequestAttributeListener.class.getName()).append(")"); //$NON-NLS-1$ //$NON-NLS-2$
sb.append("(objectClass=").append(HttpSessionListener.class.getName()).append(")"); //$NON-NLS-1$ //$NON-NLS-2$
sb.append("(objectClass=").append(HttpSessionAttributeListener.class.getName()).append(")"); //$NON-NLS-1$ //$NON-NLS-2$
- sb.append("(objectClass=").append(HttpSessionIdListener.class.getName()).append(")"); //$NON-NLS-1$ //$NON-NLS-2$
+ if ((servletContext.getMajorVersion() >= 3) && (servletContext.getMinorVersion() > 0)) {
+ sb.append("(objectClass=").append(HttpSessionIdListener.class.getName()).append(")"); //$NON-NLS-1$ //$NON-NLS-2$
+ }
sb.append(")"); //$NON-NLS-1$
sb.append(")"); //$NON-NLS-1$
@@ -1284,7 +1283,7 @@
private final Map attributes;
private final String targetFilter;
- final ServiceRegistration defaultContextReg;
+ final ServiceRegistration defaultContextReg;
private final ServletContext parentServletContext;
private final BundleContext trackingContext;
private final BundleContext consumingContext;
diff -Nru equinox-bundles-4.11/bundles/org.eclipse.equinox.http.servlet/src/org/eclipse/equinox/http/servlet/internal/multipart/MultipartSupportImpl.java equinox-bundles-4.12/bundles/org.eclipse.equinox.http.servlet/src/org/eclipse/equinox/http/servlet/internal/multipart/MultipartSupportImpl.java
--- equinox-bundles-4.11/bundles/org.eclipse.equinox.http.servlet/src/org/eclipse/equinox/http/servlet/internal/multipart/MultipartSupportImpl.java 2019-03-05 22:25:38.000000000 +0000
+++ equinox-bundles-4.12/bundles/org.eclipse.equinox.http.servlet/src/org/eclipse/equinox/http/servlet/internal/multipart/MultipartSupportImpl.java 2019-05-28 12:57:39.000000000 +0000
@@ -78,6 +78,7 @@
accessControlContext.checkPermission(new FilePermission(baseStorage.getAbsolutePath(), "read,write")); //$NON-NLS-1$
}
+ @Override
public Map parseRequest(HttpServletRequest request) throws IOException, ServletException {
if (upload == null) {
throw new IllegalStateException("Servlet was not configured for multipart!"); //$NON-NLS-1$
diff -Nru equinox-bundles-4.11/bundles/org.eclipse.equinox.http.servlet/src/org/eclipse/equinox/http/servlet/internal/registration/EndpointRegistration.java equinox-bundles-4.12/bundles/org.eclipse.equinox.http.servlet/src/org/eclipse/equinox/http/servlet/internal/registration/EndpointRegistration.java
--- equinox-bundles-4.11/bundles/org.eclipse.equinox.http.servlet/src/org/eclipse/equinox/http/servlet/internal/registration/EndpointRegistration.java 2019-03-05 22:25:38.000000000 +0000
+++ equinox-bundles-4.12/bundles/org.eclipse.equinox.http.servlet/src/org/eclipse/equinox/http/servlet/internal/registration/EndpointRegistration.java 2019-05-28 12:57:39.000000000 +0000
@@ -54,6 +54,7 @@
createContextAttributes();
}
+ @Override
public void destroy() {
ClassLoader original = Thread.currentThread().getContextClassLoader();
try {
@@ -162,13 +163,11 @@
}
private void createContextAttributes() {
- contextController.getProxyContext().createContextAttributes(
- contextController);
+ contextController.createContextAttributes();
}
private void destroyContextAttributes() {
- contextController.getProxyContext().destroyContextAttributes(
- contextController);
+ contextController.destroyContextAttributes();
}
@Override
diff -Nru equinox-bundles-4.11/bundles/org.eclipse.equinox.http.servlet/src/org/eclipse/equinox/http/servlet/internal/registration/FilterRegistration.java equinox-bundles-4.12/bundles/org.eclipse.equinox.http.servlet/src/org/eclipse/equinox/http/servlet/internal/registration/FilterRegistration.java
--- equinox-bundles-4.11/bundles/org.eclipse.equinox.http.servlet/src/org/eclipse/equinox/http/servlet/internal/registration/FilterRegistration.java 2019-03-05 22:25:38.000000000 +0000
+++ equinox-bundles-4.12/bundles/org.eclipse.equinox.http.servlet/src/org/eclipse/equinox/http/servlet/internal/registration/FilterRegistration.java 2019-05-28 12:57:39.000000000 +0000
@@ -25,6 +25,8 @@
import org.eclipse.equinox.http.servlet.internal.servlet.FilterChainImpl;
import org.eclipse.equinox.http.servlet.internal.servlet.Match;
import org.eclipse.equinox.http.servlet.internal.util.Const;
+import org.osgi.framework.FrameworkUtil;
+import org.osgi.framework.InvalidSyntaxException;
import org.osgi.framework.wiring.BundleWiring;
import org.osgi.service.http.runtime.dto.FilterDTO;
@@ -56,10 +58,26 @@
} else {
classLoader = filterHolder.getBundle().adapt(BundleWiring.class).getClassLoader();
}
- initDestoyWithContextController = true;
+ String legacyContextFilter = (String) filterHolder.getServiceReference().getProperty(Const.EQUINOX_LEGACY_CONTEXT_SELECT);
+ if (legacyContextFilter != null) {
+ // This is a legacy Filter registration.
+ // This filter tells us the real context controller,
+ // backed by an HttpContext that should be used to init/destroy this Filter
+ org.osgi.framework.Filter f = null;
+ try {
+ f = FrameworkUtil.createFilter(legacyContextFilter);
+ }
+ catch (InvalidSyntaxException e) {
+ // nothing
+ }
+ initDestoyWithContextController = f == null || contextController.matches(f);
+ } else {
+ initDestoyWithContextController = true;
+ }
needDecode = MatchableRegistration.patternsRequireDecode(filterDTO.patterns);
}
+ @Override
public int compareTo(FilterRegistration otherFilterRegistration) {
int priorityDifference = priority - otherFilterRegistration.priority;
if (priorityDifference != 0)
@@ -72,6 +90,7 @@
return (thisId < otherId) ? -1 : ((thisId == otherId) ? 0 : 1);
}
+ @Override
public void destroy() {
if (!initDestoyWithContextController) {
return;
@@ -188,13 +207,11 @@
}
private void createContextAttributes() {
- contextController.getProxyContext().createContextAttributes(
- contextController);
+ contextController.createContextAttributes();
}
private void destroyContextAttributes() {
- contextController.getProxyContext().destroyContextAttributes(
- contextController);
+ contextController.destroyContextAttributes();
}
protected boolean isPathWildcardMatch(String pattern, String path) {
diff -Nru equinox-bundles-4.11/bundles/org.eclipse.equinox.http.servlet/src/org/eclipse/equinox/http/servlet/internal/registration/ListenerRegistration.java equinox-bundles-4.12/bundles/org.eclipse.equinox.http.servlet/src/org/eclipse/equinox/http/servlet/internal/registration/ListenerRegistration.java
--- equinox-bundles-4.11/bundles/org.eclipse.equinox.http.servlet/src/org/eclipse/equinox/http/servlet/internal/registration/ListenerRegistration.java 2019-03-05 22:25:38.000000000 +0000
+++ equinox-bundles-4.12/bundles/org.eclipse.equinox.http.servlet/src/org/eclipse/equinox/http/servlet/internal/registration/ListenerRegistration.java 2019-05-28 12:57:39.000000000 +0000
@@ -122,13 +122,11 @@
}
private void createContextAttributes() {
- contextController.getProxyContext().createContextAttributes(
- contextController);
+ contextController.createContextAttributes();
}
private void destroyContextAttributes() {
- contextController.getProxyContext().destroyContextAttributes(
- contextController);
+ contextController.destroyContextAttributes();
}
ClassLoader getClassLoader() {
diff -Nru equinox-bundles-4.11/bundles/org.eclipse.equinox.http.servlet/src/org/eclipse/equinox/http/servlet/internal/servlet/ResourceServlet.java equinox-bundles-4.12/bundles/org.eclipse.equinox.http.servlet/src/org/eclipse/equinox/http/servlet/internal/servlet/ResourceServlet.java
--- equinox-bundles-4.11/bundles/org.eclipse.equinox.http.servlet/src/org/eclipse/equinox/http/servlet/internal/servlet/ResourceServlet.java 2019-03-05 22:25:38.000000000 +0000
+++ equinox-bundles-4.12/bundles/org.eclipse.equinox.http.servlet/src/org/eclipse/equinox/http/servlet/internal/servlet/ResourceServlet.java 2019-05-28 12:57:39.000000000 +0000
@@ -72,6 +72,7 @@
try {
AccessController.doPrivileged(new PrivilegedExceptionAction() {
+ @Override
public Boolean run() throws Exception {
URLConnection connection = resourceURL.openConnection();
long lastModified = connection.getLastModified();
diff -Nru equinox-bundles-4.11/bundles/org.eclipse.equinox.http.servlet/src/org/eclipse/equinox/http/servlet/internal/servlet/ResponseStateHandler.java equinox-bundles-4.12/bundles/org.eclipse.equinox.http.servlet/src/org/eclipse/equinox/http/servlet/internal/servlet/ResponseStateHandler.java
--- equinox-bundles-4.11/bundles/org.eclipse.equinox.http.servlet/src/org/eclipse/equinox/http/servlet/internal/servlet/ResponseStateHandler.java 2019-03-05 22:25:38.000000000 +0000
+++ equinox-bundles-4.12/bundles/org.eclipse.equinox.http.servlet/src/org/eclipse/equinox/http/servlet/internal/servlet/ResponseStateHandler.java 2019-05-28 12:57:39.000000000 +0000
@@ -156,10 +156,7 @@
try (ServletOutputStream outputStream = response.getOutputStream()) {
// just force a close
}
- catch (IllegalStateException ise2) {
- // ignore
- }
- catch (IOException ioe) {
+ catch (IllegalStateException | IOException ise2) {
// ignore
}
}
diff -Nru equinox-bundles-4.11/bundles/org.eclipse.equinox.http.servlet/src/org/eclipse/equinox/http/servlet/internal/servlet/ServletContextAdaptor.java equinox-bundles-4.12/bundles/org.eclipse.equinox.http.servlet/src/org/eclipse/equinox/http/servlet/internal/servlet/ServletContextAdaptor.java
--- equinox-bundles-4.11/bundles/org.eclipse.equinox.http.servlet/src/org/eclipse/equinox/http/servlet/internal/servlet/ServletContextAdaptor.java 2019-03-05 22:25:38.000000000 +0000
+++ equinox-bundles-4.12/bundles/org.eclipse.equinox.http.servlet/src/org/eclipse/equinox/http/servlet/internal/servlet/ServletContextAdaptor.java 2019-05-28 12:57:39.000000000 +0000
@@ -101,6 +101,7 @@
curClassLoader, interfaces, new AdaptorInvocationHandler());
}
+ @Override
public boolean equals (Object obj) {
if (!(obj instanceof ServletContext)) {
return false;
@@ -159,6 +160,7 @@
try {
mimeType = AccessController.doPrivileged(
new PrivilegedExceptionAction() {
+ @Override
public String run() throws Exception {
return servletContextHelper.getMimeType(name);
}
@@ -187,6 +189,7 @@
try {
return AccessController.doPrivileged(
new PrivilegedExceptionAction() {
+ @Override
public String run() throws Exception {
return servletContextHelper.getRealPath(path);
}
@@ -223,6 +226,7 @@
try {
return AccessController.doPrivileged(
new PrivilegedExceptionAction() {
+ @Override
public URL run() throws Exception {
return servletContextHelper.getResource(name);
}
@@ -261,6 +265,7 @@
try {
return AccessController.doPrivileged(
new PrivilegedExceptionAction>() {
+ @Override
public Set run() throws Exception {
return servletContextHelper.getResourcePaths(name);
}
@@ -278,6 +283,7 @@
return contextController.getContextName();
}
+ @Override
public int hashCode() {
return contextController.hashCode();
}
@@ -381,6 +387,7 @@
}
}
+ @Override
public String toString() {
String value = string;
@@ -431,6 +438,7 @@
return contextController;
}
+ @Override
public Object invoke(Object proxy, Method method, Object[] args)
throws Throwable {
diff -Nru equinox-bundles-4.11/bundles/org.eclipse.equinox.http.servlet/src/org/eclipse/equinox/http/servlet/internal/util/Const.java equinox-bundles-4.12/bundles/org.eclipse.equinox.http.servlet/src/org/eclipse/equinox/http/servlet/internal/util/Const.java
--- equinox-bundles-4.11/bundles/org.eclipse.equinox.http.servlet/src/org/eclipse/equinox/http/servlet/internal/util/Const.java 2019-03-05 22:25:38.000000000 +0000
+++ equinox-bundles-4.12/bundles/org.eclipse.equinox.http.servlet/src/org/eclipse/equinox/http/servlet/internal/util/Const.java 2019-05-28 12:57:39.000000000 +0000
@@ -48,8 +48,10 @@
public static final String EQUINOX_HTTP_MULTIPART_MAXFILESIZE = "equinox.http.whiteboard.servlet.multipart.maxFileSize"; //$NON-NLS-1$
public static final String EQUINOX_HTTP_MULTIPART_MAXREQUESTSIZE = "equinox.http.whiteboard.servlet.multipart.maxRequestSize"; //$NON-NLS-1$
public static final String EQUINOX_LEGACY_TCCL_PROP = "equinox.legacy.tccl"; //$NON-NLS-1$
+ public static final String EQUINOX_LEGACY_CONTEXT_SELECT = "equinox.context.select"; //$NON-NLS-1$
public static final String EQUINOX_LEGACY_CONTEXT_HELPER = "equinox.legacy.context.helper"; //$NON-NLS-1$
public static final String EQUINOX_LEGACY_HTTP_CONTEXT_INITIATING_ID = "equinox.legacy.http.context.initiating.id"; //$NON-NLS-1$
+ public static final String EQUINOX_HTTP_WHITEBOARD_CONTEXT_HELPER_DEFAULT = "equinox.http.whiteboard.context.helper.default"; //$NON-NLS-1$
public static final String UTF8 = "UTF-8"; //$NON-NLS-1$
}
diff -Nru equinox-bundles-4.11/bundles/org.eclipse.equinox.http.servletbridge/pom.xml equinox-bundles-4.12/bundles/org.eclipse.equinox.http.servletbridge/pom.xml
--- equinox-bundles-4.11/bundles/org.eclipse.equinox.http.servletbridge/pom.xml 2019-03-05 22:25:38.000000000 +0000
+++ equinox-bundles-4.12/bundles/org.eclipse.equinox.http.servletbridge/pom.xml 2019-05-28 12:57:39.000000000 +0000
@@ -14,7 +14,7 @@
rt.equinox.bundlesorg.eclipse.equinox.bundles
- 4.11.0-SNAPSHOT
+ 4.12.0-SNAPSHOT../../org.eclipse.equinox
diff -Nru equinox-bundles-4.11/bundles/org.eclipse.equinox.http.servlet.tests/bundles_src/tb1/org/eclipse/equinox/http/servlet/tests/tb1/TestServlet2.java equinox-bundles-4.12/bundles/org.eclipse.equinox.http.servlet.tests/bundles_src/tb1/org/eclipse/equinox/http/servlet/tests/tb1/TestServlet2.java
--- equinox-bundles-4.11/bundles/org.eclipse.equinox.http.servlet.tests/bundles_src/tb1/org/eclipse/equinox/http/servlet/tests/tb1/TestServlet2.java 2019-03-05 22:25:38.000000000 +0000
+++ equinox-bundles-4.12/bundles/org.eclipse.equinox.http.servlet.tests/bundles_src/tb1/org/eclipse/equinox/http/servlet/tests/tb1/TestServlet2.java 2019-05-28 12:57:39.000000000 +0000
@@ -35,6 +35,7 @@
}
+ @Override
protected void handleDoGet(HttpServletRequest request, PrintWriter writer) throws ServletException, IOException {
int version = getEffectiveMajorVersion();
writer.print(version);
diff -Nru equinox-bundles-4.11/bundles/org.eclipse.equinox.http.servlet.tests/bundles_src/tb1/org/eclipse/equinox/http/servlet/tests/tb1/TestServlet3.java equinox-bundles-4.12/bundles/org.eclipse.equinox.http.servlet.tests/bundles_src/tb1/org/eclipse/equinox/http/servlet/tests/tb1/TestServlet3.java
--- equinox-bundles-4.11/bundles/org.eclipse.equinox.http.servlet.tests/bundles_src/tb1/org/eclipse/equinox/http/servlet/tests/tb1/TestServlet3.java 2019-03-05 22:25:38.000000000 +0000
+++ equinox-bundles-4.12/bundles/org.eclipse.equinox.http.servlet.tests/bundles_src/tb1/org/eclipse/equinox/http/servlet/tests/tb1/TestServlet3.java 2019-05-28 12:57:39.000000000 +0000
@@ -30,6 +30,7 @@
public class TestServlet3 extends AbstractTestServlet {
private static final long serialVersionUID = 1L;
+ @Override
protected void handleDoGet(HttpServletRequest request, PrintWriter writer) throws ServletException, IOException {
String expected = "Equinox"; //$NON-NLS-1$
try {
diff -Nru equinox-bundles-4.11/bundles/org.eclipse.equinox.http.servlet.tests/bundles_src/tb1/org/eclipse/equinox/http/servlet/tests/tb1/TestServlet9.java equinox-bundles-4.12/bundles/org.eclipse.equinox.http.servlet.tests/bundles_src/tb1/org/eclipse/equinox/http/servlet/tests/tb1/TestServlet9.java
--- equinox-bundles-4.11/bundles/org.eclipse.equinox.http.servlet.tests/bundles_src/tb1/org/eclipse/equinox/http/servlet/tests/tb1/TestServlet9.java 2019-03-05 22:25:38.000000000 +0000
+++ equinox-bundles-4.12/bundles/org.eclipse.equinox.http.servlet.tests/bundles_src/tb1/org/eclipse/equinox/http/servlet/tests/tb1/TestServlet9.java 2019-05-28 12:57:39.000000000 +0000
@@ -36,6 +36,7 @@
private static final long serialVersionUID = 1L;
private final DispatchTo dispatchTo = new DispatchTo();
+ @Override
public void activate(ComponentContext componentContext) throws ServletException, NamespaceException {
HttpService service = getHttpService();
HttpContext context = service.createDefaultHttpContext();
diff -Nru equinox-bundles-4.11/bundles/org.eclipse.equinox.http.servlet.tests/META-INF/MANIFEST.MF equinox-bundles-4.12/bundles/org.eclipse.equinox.http.servlet.tests/META-INF/MANIFEST.MF
--- equinox-bundles-4.11/bundles/org.eclipse.equinox.http.servlet.tests/META-INF/MANIFEST.MF 2019-03-05 22:25:38.000000000 +0000
+++ equinox-bundles-4.12/bundles/org.eclipse.equinox.http.servlet.tests/META-INF/MANIFEST.MF 2019-05-28 12:57:39.000000000 +0000
@@ -2,7 +2,7 @@
Bundle-ManifestVersion: 2
Bundle-Name: org.eclipse.equinox.http.servlet.tests
Bundle-SymbolicName: org.eclipse.equinox.http.servlet.tests
-Bundle-Version: 1.6.0.qualifier
+Bundle-Version: 1.6.100.qualifier
Bundle-RequiredExecutionEnvironment: JavaSE-1.7
Eclipse-BundleShape: dir
Require-Bundle: org.junit;bundle-version="4.0"
diff -Nru equinox-bundles-4.11/bundles/org.eclipse.equinox.http.servlet.tests/pom.xml equinox-bundles-4.12/bundles/org.eclipse.equinox.http.servlet.tests/pom.xml
--- equinox-bundles-4.11/bundles/org.eclipse.equinox.http.servlet.tests/pom.xml 2019-03-05 22:25:38.000000000 +0000
+++ equinox-bundles-4.12/bundles/org.eclipse.equinox.http.servlet.tests/pom.xml 2019-05-28 12:57:39.000000000 +0000
@@ -14,12 +14,12 @@
tests-pomorg.eclipse.equinox.bundles
- 4.11.0-SNAPSHOT
+ 4.12.0-SNAPSHOT../../tests-pom/org.eclipse.equinoxorg.eclipse.equinox.http.servlet.tests
- 1.6.0-SNAPSHOT
+ 1.6.100-SNAPSHOTeclipse-test-plugin
diff -Nru equinox-bundles-4.11/bundles/org.eclipse.equinox.http.servlet.tests/src/org/eclipse/equinox/http/servlet/testbase/AllTests.java equinox-bundles-4.12/bundles/org.eclipse.equinox.http.servlet.tests/src/org/eclipse/equinox/http/servlet/testbase/AllTests.java
--- equinox-bundles-4.11/bundles/org.eclipse.equinox.http.servlet.tests/src/org/eclipse/equinox/http/servlet/testbase/AllTests.java 2019-03-05 22:25:38.000000000 +0000
+++ equinox-bundles-4.12/bundles/org.eclipse.equinox.http.servlet.tests/src/org/eclipse/equinox/http/servlet/testbase/AllTests.java 2019-05-28 12:57:39.000000000 +0000
@@ -13,6 +13,7 @@
*******************************************************************************/
package org.eclipse.equinox.http.servlet.testbase;
+import org.eclipse.equinox.http.servlet.tests.ContextHelperCustomizerTests;
import org.eclipse.equinox.http.servlet.tests.AuthenticationTest;
import org.eclipse.equinox.http.servlet.tests.DispatchingTest;
import org.eclipse.equinox.http.servlet.tests.PreprocessorTestCase;
@@ -35,6 +36,7 @@
import org.eclipse.equinox.http.servlet.tests.Test_140_4_9;
import org.eclipse.equinox.http.servlet.tests.Test_140_6_1;
import org.eclipse.equinox.http.servlet.tests.Test_140_6_20to21_commonProperties;
+import org.eclipse.equinox.http.servlet.tests.Test_140_7_validation;
import org.eclipse.equinox.http.servlet.tests.Test_140_9_ServletContextDTO_custom_listener;
import org.eclipse.equinox.http.servlet.tests.Test_140_9_ServletContextDTO_default_listener;
import org.eclipse.equinox.http.servlet.tests.Test_table_140_1_HTTP_WHITEBOARD_CONTEXT_NAME_bindUsingContextSelect;
@@ -74,6 +76,7 @@
Test_140_4_9.class,
Test_140_6_1.class,
Test_140_6_20to21_commonProperties.class,
+ Test_140_7_validation.class,
Test_140_9_ServletContextDTO_custom_listener.class,
Test_140_9_ServletContextDTO_default_listener.class,
Test_table_140_1_HTTP_WHITEBOARD_CONTEXT_NAME_bindUsingContextSelect.class,
@@ -91,6 +94,7 @@
TestHttpServiceAndErrorPage.class,
TestHttpServiceAndNamedServlet.class,
TestUpload.class,
+ ContextHelperCustomizerTests.class
})
public class AllTests {
// see @SuiteClasses
diff -Nru equinox-bundles-4.11/bundles/org.eclipse.equinox.http.servlet.tests/src/org/eclipse/equinox/http/servlet/testbase/BaseTest.java equinox-bundles-4.12/bundles/org.eclipse.equinox.http.servlet.tests/src/org/eclipse/equinox/http/servlet/testbase/BaseTest.java
--- equinox-bundles-4.11/bundles/org.eclipse.equinox.http.servlet.tests/src/org/eclipse/equinox/http/servlet/testbase/BaseTest.java 2019-03-05 22:25:38.000000000 +0000
+++ equinox-bundles-4.12/bundles/org.eclipse.equinox.http.servlet.tests/src/org/eclipse/equinox/http/servlet/testbase/BaseTest.java 2019-05-28 12:57:39.000000000 +0000
@@ -66,10 +66,12 @@
import org.osgi.service.http.runtime.dto.ErrorPageDTO;
import org.osgi.service.http.runtime.dto.FailedErrorPageDTO;
import org.osgi.service.http.runtime.dto.FailedFilterDTO;
+import org.osgi.service.http.runtime.dto.FailedListenerDTO;
import org.osgi.service.http.runtime.dto.FailedResourceDTO;
import org.osgi.service.http.runtime.dto.FailedServletContextDTO;
import org.osgi.service.http.runtime.dto.FailedServletDTO;
import org.osgi.service.http.runtime.dto.FilterDTO;
+import org.osgi.service.http.runtime.dto.ListenerDTO;
import org.osgi.service.http.runtime.dto.RequestInfoDTO;
import org.osgi.service.http.runtime.dto.ResourceDTO;
import org.osgi.service.http.runtime.dto.ServletContextDTO;
@@ -339,6 +341,22 @@
return getBundleContext().getService(serviceReference);
}
+ protected ListenerDTO getListenerDTOByServiceId(String contextName, long serviceId) {
+ ServletContextDTO servletContextDTO = getServletContextDTOByName(contextName);
+
+ if (servletContextDTO == null) {
+ return null;
+ }
+
+ for (ListenerDTO listenerDTO : servletContextDTO.listenerDTOs) {
+ if (serviceId == listenerDTO.serviceId) {
+ return listenerDTO;
+ }
+ }
+
+ return null;
+ }
+
protected long getServiceId(ServiceRegistration> sr) {
return (Long) sr.getReference().getProperty(Constants.SERVICE_ID);
}
@@ -441,6 +459,20 @@
return getHttpServiceRuntime().getRuntimeDTO().failedFilterDTOs;
}
+ protected FailedListenerDTO getFailedListenerDTOByServiceId(long serviceId) {
+ for (FailedListenerDTO failedListenerDTO : getFailedListenerDTOs()) {
+ if (serviceId == failedListenerDTO.serviceId) {
+ return failedListenerDTO;
+ }
+ }
+
+ return null;
+ }
+
+ protected FailedListenerDTO[] getFailedListenerDTOs() {
+ return getHttpServiceRuntime().getRuntimeDTO().failedListenerDTOs;
+ }
+
protected FailedServletContextDTO getFailedServletContextDTOByName(String name) {
for (FailedServletContextDTO failedServletContextDTO : getFailedServletContextDTOs()) {
if (name.equals(failedServletContextDTO.name)) {
@@ -662,10 +694,10 @@
}
- protected static class TestContextPathAdaptor extends ContextPathCustomizer {
- private final String defaultFilter;
- private final String contextPrefix;
- private final String testName;
+ protected class TestContextPathAdaptor extends ContextPathCustomizer {
+ protected final String defaultFilter;
+ protected final String contextPrefix;
+ protected final String testName;
/**
* @param defaultFilter
diff -Nru equinox-bundles-4.11/bundles/org.eclipse.equinox.http.servlet.tests/src/org/eclipse/equinox/http/servlet/tests/ContextHelperCustomizerTests.java equinox-bundles-4.12/bundles/org.eclipse.equinox.http.servlet.tests/src/org/eclipse/equinox/http/servlet/tests/ContextHelperCustomizerTests.java
--- equinox-bundles-4.11/bundles/org.eclipse.equinox.http.servlet.tests/src/org/eclipse/equinox/http/servlet/tests/ContextHelperCustomizerTests.java 1970-01-01 00:00:00.000000000 +0000
+++ equinox-bundles-4.12/bundles/org.eclipse.equinox.http.servlet.tests/src/org/eclipse/equinox/http/servlet/tests/ContextHelperCustomizerTests.java 2019-05-28 12:57:39.000000000 +0000
@@ -0,0 +1,322 @@
+/*******************************************************************************
+ * Copyright (c) 2019 IBM Corporation and others.
+ *
+ * This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License 2.0
+ * which accompanies this distribution, and is available at
+ * https://www.eclipse.org/legal/epl-2.0/
+ *
+ * SPDX-License-Identifier: EPL-2.0
+ *
+ *******************************************************************************/
+package org.eclipse.equinox.http.servlet.tests;
+
+import static org.junit.Assert.assertNotNull;
+
+import java.util.Collection;
+import java.util.Dictionary;
+import java.util.Hashtable;
+import java.util.Iterator;
+import java.util.concurrent.atomic.AtomicReference;
+
+import javax.servlet.Servlet;
+import javax.servlet.ServletContext;
+import javax.servlet.ServletContextListener;
+
+import org.eclipse.equinox.http.servlet.context.ContextPathCustomizer;
+import org.eclipse.equinox.http.servlet.testbase.BaseTest;
+import org.eclipse.equinox.http.servlet.tests.util.BaseServlet;
+import org.eclipse.equinox.http.servlet.tests.util.MockSCL;
+import org.junit.After;
+import org.junit.Assert;
+import org.junit.Before;
+import org.junit.Rule;
+import org.junit.Test;
+import org.junit.rules.TestName;
+import org.osgi.framework.BundleContext;
+import org.osgi.framework.ServiceReference;
+import org.osgi.framework.ServiceRegistration;
+import org.osgi.framework.hooks.service.FindHook;
+import org.osgi.service.http.HttpContext;
+import org.osgi.service.http.HttpService;
+import org.osgi.service.http.context.ServletContextHelper;
+import org.osgi.service.http.whiteboard.HttpWhiteboardConstants;
+
+public class ContextHelperCustomizerTests extends BaseTest {
+ @Rule
+ public TestName testName = new TestName();
+ private ServiceReference httpServiceReference;
+ private HttpService httpService;
+ private BundleContext context;
+
+ @Before
+ public void begin() throws Exception {
+ httpServiceReference = getBundleContext().getServiceReference(HttpService.class);
+ context = httpServiceReference.getBundle().getBundleContext();
+ httpService = context.getService(httpServiceReference);
+ }
+
+ @After
+ public void end() throws Exception {
+ context.ungetService(httpServiceReference);
+ }
+
+ @Test
+ public void testCreateDefaultHttpContextCreatesNewServletContextHelper() throws Exception {
+ HttpContext context1 = httpService.createDefaultHttpContext();
+ HttpContext context2 = httpService.createDefaultHttpContext();
+ Assert.assertNotEquals(context1, context2);
+ }
+
+ @Test
+ public void testServletContextHelpersNotHiddenWhenRegisteredUsingConsumingContext() throws Exception {
+ ServiceRegistration helperReg = null;
+ ServiceRegistration findHookReg = null;
+
+ try {
+ Dictionary properties = new Hashtable();
+ properties.put(HttpWhiteboardConstants.HTTP_WHITEBOARD_CONTEXT_NAME, "context1");
+ properties.put(HttpWhiteboardConstants.HTTP_WHITEBOARD_CONTEXT_PATH, "/context1");
+ //register a ServletContextHelper using the consuming bundle context "org.eclipse.equinox.http.servlet"
+ helperReg = context.registerService(ServletContextHelper.class, new ServletContextHelper() {}, properties);
+
+ FindHook findHook = new FindHook() {
+
+ @Override
+ public void find(
+ BundleContext bundleContext, String name, String filter,
+ boolean allServices, Collection> references) {
+
+ if (bundleContext != context) {
+ return;
+ }
+
+ // don't show ServletContextHelper
+ for (Iterator> iterator = references.iterator(); iterator.hasNext();) {
+ ServiceReference> sr = iterator.next();
+
+ if ("context1".equals(sr.getProperty("osgi.http.whiteboard.context.name"))) {
+ iterator.remove();
+ }
+ }
+ }
+
+ };
+
+ findHookReg = context.registerService(FindHook.class, findHook, null);
+ AtomicReference sc1 = new AtomicReference();
+
+ properties = new Hashtable();
+ properties.put(HttpWhiteboardConstants.HTTP_WHITEBOARD_LISTENER, "true");
+ properties.put(HttpWhiteboardConstants.HTTP_WHITEBOARD_CONTEXT_SELECT, "(osgi.http.whiteboard.context.name=context1)");
+ context.registerService(ServletContextListener.class, new MockSCL(sc1), properties);
+
+ //ServletContextHelpers registered using the consuming context should not be hidden
+ assertNotNull(sc1.get());
+ } finally {
+ if (helperReg != null) {
+ helperReg.unregister();
+ }
+ if (findHookReg != null) {
+ findHookReg.unregister();
+ }
+ }
+
+ }
+
+ @Test
+ public void testWBServletContextPathCustomizerContextPrefix() throws Exception {
+ ServiceRegistration pathAdaptorReg = null;
+ ServiceRegistration helperReg = null;
+ ServiceRegistration servlet = null;
+ ServiceRegistration findHookReg = null;
+
+ try {
+ Dictionary helperProps = new Hashtable();
+ helperProps.put(HttpWhiteboardConstants.HTTP_WHITEBOARD_CONTEXT_NAME, "testContext" + testName.getMethodName());
+ helperProps.put(HttpWhiteboardConstants.HTTP_WHITEBOARD_CONTEXT_PATH, "/helperContext");
+ helperProps.put(TEST_PATH_CUSTOMIZER_NAME, testName.getMethodName());
+ helperReg = context.registerService(ServletContextHelper.class, new TestServletContextHelperFactory(), helperProps);
+
+ //Pass the context path prefix paramater
+ ContextPathCustomizer pathAdaptor = new TestContextPathAdaptor(null, "testPrefix", testName.getMethodName());
+ pathAdaptorReg = context.registerService(ContextPathCustomizer.class, pathAdaptor, null);
+
+ FindHook findHook = new FindHook() {
+
+ @Override
+ public void find(
+ BundleContext bundleContext, String name, String filter,
+ boolean allServices, Collection> references) {
+
+ if (bundleContext != context) {
+ return;
+ }
+
+ // don't show ServletContextHelper
+ for (Iterator> iterator = references.iterator(); iterator.hasNext();) {
+ ServiceReference> sr = iterator.next();
+ if (("testContext" + testName.getMethodName()).equals(sr.getProperty(HttpWhiteboardConstants.HTTP_WHITEBOARD_CONTEXT_NAME))) {
+ iterator.remove();
+ }
+ }
+ }
+
+ };
+
+ findHookReg = context.registerService(FindHook.class, findHook, null);
+
+ //Register a servlet service with a matching context helper
+ BaseServlet baseServlet = new BaseServlet("content");
+ Dictionary serviceProps = new Hashtable();
+ serviceProps.put(HttpWhiteboardConstants.HTTP_WHITEBOARD_SERVLET_PATTERN, "/servlet");
+ serviceProps.put(HttpWhiteboardConstants.HTTP_WHITEBOARD_CONTEXT_SELECT, "(" + HttpWhiteboardConstants.HTTP_WHITEBOARD_CONTEXT_NAME + "=" + "testContext" + testName.getMethodName() + ")");
+ servlet = context.registerService(Servlet.class, baseServlet, serviceProps);
+
+ String actual = requestAdvisor.request("testPrefix/helperContext/servlet");
+ Assert.assertEquals("content", actual);
+ } finally {
+ if (helperReg != null) {
+ helperReg.unregister();
+ }
+ if (pathAdaptorReg != null) {
+ pathAdaptorReg.unregister();
+ }
+ if (servlet != null) {
+ servlet.unregister();
+ }
+ if (findHookReg != null) {
+ findHookReg.unregister();
+ }
+ }
+ }
+
+ @Test
+ public void testWBServletContextPathCustomizerDefaultFilter() throws Exception {
+ ServiceRegistration pathAdaptorReg = null;
+ ServiceRegistration helperReg = null;
+ ServiceRegistration servlet = null;
+ ServiceRegistration findHookReg = null;
+
+ try {
+ Dictionary helperProps = new Hashtable();
+ helperProps.put(HttpWhiteboardConstants.HTTP_WHITEBOARD_CONTEXT_NAME, "testContext" + testName.getMethodName());
+ helperProps.put(HttpWhiteboardConstants.HTTP_WHITEBOARD_CONTEXT_PATH, "/helperContext");
+ helperProps.put(TEST_PATH_CUSTOMIZER_NAME, testName.getMethodName());
+ helperReg = context.registerService(ServletContextHelper.class, new TestServletContextHelperFactory(), helperProps);
+
+ //Pass the filter parameter
+ ContextPathCustomizer pathAdaptor = new TestContextPathAdaptor("(" + HttpWhiteboardConstants.HTTP_WHITEBOARD_CONTEXT_NAME + "=" + "testContext" + testName.getMethodName() + ")", null, testName.getMethodName());
+ pathAdaptorReg = context.registerService(ContextPathCustomizer.class, pathAdaptor, null);
+
+ FindHook findHook = new FindHook() {
+
+ @Override
+ public void find(
+ BundleContext bundleContext, String name, String filter,
+ boolean allServices, Collection> references) {
+
+ if (bundleContext != context) {
+ return;
+ }
+
+ // don't show ServletContextHelper
+ for (Iterator> iterator = references.iterator(); iterator.hasNext();) {
+ ServiceReference> sr = iterator.next();
+ if (("testContext" + testName.getMethodName()).equals(sr.getProperty(HttpWhiteboardConstants.HTTP_WHITEBOARD_CONTEXT_NAME))) {
+ iterator.remove();
+ }
+ }
+ }
+
+ };
+
+ findHookReg = context.registerService(FindHook.class, findHook, null);
+
+ //Register a servlet service with a matching context helper
+ BaseServlet baseServlet = new BaseServlet("content");
+ Dictionary serviceProps = new Hashtable();
+ serviceProps.put(HttpWhiteboardConstants.HTTP_WHITEBOARD_SERVLET_PATTERN, "/servlet");
+ //Filter property
+ serviceProps.put("servlet.init." + TEST_PATH_CUSTOMIZER_NAME, testName.getMethodName());
+ servlet = context.registerService(Servlet.class, baseServlet, serviceProps);
+
+ String actual = requestAdvisor.request("helperContext/servlet");
+ Assert.assertEquals("content", actual);
+ } finally {
+ if (helperReg != null) {
+ helperReg.unregister();
+ }
+ if (pathAdaptorReg != null) {
+ pathAdaptorReg.unregister();
+ }
+ if (servlet != null) {
+ servlet.unregister();
+ }
+ if (findHookReg != null) {
+ findHookReg.unregister();
+ }
+ }
+ }
+
+ @Test
+ public void testLegacyServletContextPathCustomizerContextPrefix() throws Exception {
+ ServiceRegistration pathAdaptorReg = null;
+ ServiceRegistration findHookReg = null;
+
+ try {
+ //Pass the context path prefix paramater
+ ContextPathCustomizer pathAdaptor = new TestContextPathAdaptor(null, "testPrefix", testName.getMethodName()) {
+
+ @Override
+ public String getContextPathPrefix(ServiceReference helper) {
+ if (Boolean.TRUE.equals(helper.getProperty("equinox.legacy.context.helper"))) {
+ return contextPrefix;
+ }
+ return null;
+ }
+ };
+ pathAdaptorReg = context.registerService(ContextPathCustomizer.class, pathAdaptor, null);
+
+ FindHook findHook = new FindHook() {
+
+ @Override
+ public void find(
+ BundleContext bundleContext, String name, String filter,
+ boolean allServices, Collection> references) {
+
+ if (bundleContext != context) {
+ return;
+ }
+
+ // don't show ServletContextHelper
+ for (Iterator> iterator = references.iterator(); iterator.hasNext();) {
+ ServiceReference> sr = iterator.next();
+ if (Boolean.TRUE.equals(sr.getProperty("equinox.legacy.context.helper"))) {
+ iterator.remove();
+ }
+ iterator.remove();
+ }
+ }
+ };
+
+ findHookReg = context.registerService(FindHook.class, findHook, null);
+ //Register a servlet service using HttpService
+ BaseServlet baseServlet = new BaseServlet("content");
+ httpService.registerServlet("/servlet", baseServlet, null, null);
+
+ String actual = requestAdvisor.request("testPrefix/servlet");
+ Assert.assertEquals("content", actual);
+ } finally {
+ if (pathAdaptorReg != null) {
+ pathAdaptorReg.unregister();
+ }
+ if (findHookReg != null) {
+ findHookReg.unregister();
+ }
+ httpService.unregister("/servlet");
+ }
+ }
+}
+
+
diff -Nru equinox-bundles-4.11/bundles/org.eclipse.equinox.http.servlet.tests/src/org/eclipse/equinox/http/servlet/tests/Test_140_7_validation.java equinox-bundles-4.12/bundles/org.eclipse.equinox.http.servlet.tests/src/org/eclipse/equinox/http/servlet/tests/Test_140_7_validation.java
--- equinox-bundles-4.11/bundles/org.eclipse.equinox.http.servlet.tests/src/org/eclipse/equinox/http/servlet/tests/Test_140_7_validation.java 1970-01-01 00:00:00.000000000 +0000
+++ equinox-bundles-4.12/bundles/org.eclipse.equinox.http.servlet.tests/src/org/eclipse/equinox/http/servlet/tests/Test_140_7_validation.java 2019-05-28 12:57:39.000000000 +0000
@@ -0,0 +1,70 @@
+/*******************************************************************************
+ * Copyright (c) Mar. 28, 2019 Liferay, Inc.
+ *
+ * This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License 2.0
+ * which accompanies this distribution, and is available at
+ * https://www.eclipse.org/legal/epl-2.0/
+ *
+ * SPDX-License-Identifier: EPL-2.0
+ *
+ * Contributors:
+ * Liferay, Inc. - tests
+ ******************************************************************************/
+
+package org.eclipse.equinox.http.servlet.tests;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertNull;
+
+import java.util.Dictionary;
+import java.util.Hashtable;
+import java.util.concurrent.atomic.AtomicReference;
+
+import javax.servlet.ServletContext;
+import javax.servlet.ServletContextListener;
+
+import org.eclipse.equinox.http.servlet.testbase.BaseTest;
+import org.eclipse.equinox.http.servlet.tests.util.MockSCL;
+import org.junit.Test;
+import org.osgi.framework.BundleContext;
+import org.osgi.framework.ServiceRegistration;
+import org.osgi.service.http.runtime.dto.DTOConstants;
+import org.osgi.service.http.runtime.dto.FailedListenerDTO;
+import org.osgi.service.http.runtime.dto.ListenerDTO;
+import org.osgi.service.http.whiteboard.HttpWhiteboardConstants;
+
+public class Test_140_7_validation extends BaseTest {
+
+ @Test
+ public void test_140_7_validation() throws Exception {
+ BundleContext context = getBundleContext();
+
+ Dictionary properties = new Hashtable();
+ properties.put(HttpWhiteboardConstants.HTTP_WHITEBOARD_LISTENER, "true");
+ ServiceRegistration> sr = context.registerService(
+ ServletContextListener.class, new MockSCL(new AtomicReference()), properties);
+ registrations.add(sr);
+
+ ListenerDTO listenerDTO = getListenerDTOByServiceId(DEFAULT, getServiceId(sr));
+ assertNotNull(listenerDTO);
+
+ properties.remove(HttpWhiteboardConstants.HTTP_WHITEBOARD_LISTENER);
+ sr.setProperties(properties);
+
+ listenerDTO = getListenerDTOByServiceId(DEFAULT, getServiceId(sr));
+ assertNull(listenerDTO);
+
+ properties.put(HttpWhiteboardConstants.HTTP_WHITEBOARD_LISTENER, "blah");
+ sr.setProperties(properties);
+
+ FailedListenerDTO failedListenerDTO = getFailedListenerDTOByServiceId(getServiceId(sr));
+ assertNotNull(failedListenerDTO);
+ assertEquals(DTOConstants.FAILURE_REASON_VALIDATION_FAILED, failedListenerDTO.failureReason);
+
+ listenerDTO = getListenerDTOByServiceId(DEFAULT, getServiceId(sr));
+ assertNull(listenerDTO);
+ }
+
+}
diff -Nru equinox-bundles-4.11/bundles/org.eclipse.equinox.io/pom.xml equinox-bundles-4.12/bundles/org.eclipse.equinox.io/pom.xml
--- equinox-bundles-4.11/bundles/org.eclipse.equinox.io/pom.xml 2019-03-05 22:25:38.000000000 +0000
+++ equinox-bundles-4.12/bundles/org.eclipse.equinox.io/pom.xml 2019-05-28 12:57:39.000000000 +0000
@@ -14,7 +14,7 @@
rt.equinox.bundlesorg.eclipse.equinox.bundles
- 4.11.0-SNAPSHOT
+ 4.12.0-SNAPSHOT../../org.eclipse.equinox
diff -Nru equinox-bundles-4.11/bundles/org.eclipse.equinox.ip/pom.xml equinox-bundles-4.12/bundles/org.eclipse.equinox.ip/pom.xml
--- equinox-bundles-4.11/bundles/org.eclipse.equinox.ip/pom.xml 2019-03-05 22:25:38.000000000 +0000
+++ equinox-bundles-4.12/bundles/org.eclipse.equinox.ip/pom.xml 2019-05-28 12:57:39.000000000 +0000
@@ -14,7 +14,7 @@
rt.equinox.bundlesorg.eclipse.equinox.bundles
- 4.11.0-SNAPSHOT
+ 4.12.0-SNAPSHOT../../org.eclipse.equinox
diff -Nru equinox-bundles-4.11/bundles/org.eclipse.equinox.jsp.jasper/pom.xml equinox-bundles-4.12/bundles/org.eclipse.equinox.jsp.jasper/pom.xml
--- equinox-bundles-4.11/bundles/org.eclipse.equinox.jsp.jasper/pom.xml 2019-03-05 22:25:38.000000000 +0000
+++ equinox-bundles-4.12/bundles/org.eclipse.equinox.jsp.jasper/pom.xml 2019-05-28 12:57:39.000000000 +0000
@@ -14,7 +14,7 @@
rt.equinox.bundlesorg.eclipse.equinox.bundles
- 4.11.0-SNAPSHOT
+ 4.12.0-SNAPSHOT../../org.eclipse.equinox
diff -Nru equinox-bundles-4.11/bundles/org.eclipse.equinox.jsp.jasper.registry/pom.xml equinox-bundles-4.12/bundles/org.eclipse.equinox.jsp.jasper.registry/pom.xml
--- equinox-bundles-4.11/bundles/org.eclipse.equinox.jsp.jasper.registry/pom.xml 2019-03-05 22:25:38.000000000 +0000
+++ equinox-bundles-4.12/bundles/org.eclipse.equinox.jsp.jasper.registry/pom.xml 2019-05-28 12:57:39.000000000 +0000
@@ -14,7 +14,7 @@
rt.equinox.bundlesorg.eclipse.equinox.bundles
- 4.11.0-SNAPSHOT
+ 4.12.0-SNAPSHOT../../org.eclipse.equinox
diff -Nru equinox-bundles-4.11/bundles/org.eclipse.equinox.log.stream/pom.xml equinox-bundles-4.12/bundles/org.eclipse.equinox.log.stream/pom.xml
--- equinox-bundles-4.11/bundles/org.eclipse.equinox.log.stream/pom.xml 2019-03-05 22:25:38.000000000 +0000
+++ equinox-bundles-4.12/bundles/org.eclipse.equinox.log.stream/pom.xml 2019-05-28 12:57:39.000000000 +0000
@@ -14,7 +14,7 @@
rt.equinox.bundlesorg.eclipse.equinox.bundles
- 4.11.0-SNAPSHOT
+ 4.12.0-SNAPSHOT../../org.eclipse.equinox
diff -Nru equinox-bundles-4.11/bundles/org.eclipse.equinox.metatype/.classpath equinox-bundles-4.12/bundles/org.eclipse.equinox.metatype/.classpath
--- equinox-bundles-4.11/bundles/org.eclipse.equinox.metatype/.classpath 2019-03-05 22:25:38.000000000 +0000
+++ equinox-bundles-4.12/bundles/org.eclipse.equinox.metatype/.classpath 2019-05-28 12:57:39.000000000 +0000
@@ -1,6 +1,6 @@
-
+
diff -Nru equinox-bundles-4.11/bundles/org.eclipse.equinox.metatype/META-INF/MANIFEST.MF equinox-bundles-4.12/bundles/org.eclipse.equinox.metatype/META-INF/MANIFEST.MF
--- equinox-bundles-4.11/bundles/org.eclipse.equinox.metatype/META-INF/MANIFEST.MF 2019-03-05 22:25:38.000000000 +0000
+++ equinox-bundles-4.12/bundles/org.eclipse.equinox.metatype/META-INF/MANIFEST.MF 2019-05-28 12:57:39.000000000 +0000
@@ -1,6 +1,6 @@
Bundle-ManifestVersion: 2
Bundle-Name: %bundleName
-Bundle-Version: 1.4.600.qualifier
+Bundle-Version: 1.5.0.qualifier
Bundle-SymbolicName: org.eclipse.equinox.metatype
Bundle-Activator: org.eclipse.equinox.metatype.impl.Activator
Import-Package: javax.xml.parsers,
@@ -17,7 +17,7 @@
org.eclipse.equinox.metatype.impl;version="1.3.0";x-friends:=org.eclipse.equinox.compendium.tests
Bundle-Vendor: %bundleVendor
Bundle-Localization: plugin
-Bundle-RequiredExecutionEnvironment: J2SE-1.5
+Bundle-RequiredExecutionEnvironment: JavaSE-1.7
Provide-Capability: osgi.implementation;
osgi.implementation="osgi.metatype";
version:Version="1.4";
diff -Nru equinox-bundles-4.11/bundles/org.eclipse.equinox.metatype/pom.xml equinox-bundles-4.12/bundles/org.eclipse.equinox.metatype/pom.xml
--- equinox-bundles-4.11/bundles/org.eclipse.equinox.metatype/pom.xml 2019-03-05 22:25:38.000000000 +0000
+++ equinox-bundles-4.12/bundles/org.eclipse.equinox.metatype/pom.xml 2019-05-28 12:57:39.000000000 +0000
@@ -14,12 +14,12 @@
rt.equinox.bundlesorg.eclipse.equinox.bundles
- 4.11.0-SNAPSHOT
+ 4.12.0-SNAPSHOT../../org.eclipse.equinoxorg.eclipse.equinox.metatype
- 1.4.600-SNAPSHOT
+ 1.5.0-SNAPSHOTeclipse-plugin
diff -Nru equinox-bundles-4.11/bundles/org.eclipse.equinox.metatype/.settings/org.eclipse.jdt.core.prefs equinox-bundles-4.12/bundles/org.eclipse.equinox.metatype/.settings/org.eclipse.jdt.core.prefs
--- equinox-bundles-4.11/bundles/org.eclipse.equinox.metatype/.settings/org.eclipse.jdt.core.prefs 2019-03-05 22:25:38.000000000 +0000
+++ equinox-bundles-4.12/bundles/org.eclipse.equinox.metatype/.settings/org.eclipse.jdt.core.prefs 2019-05-28 12:57:39.000000000 +0000
@@ -13,9 +13,9 @@
org.eclipse.jdt.core.compiler.annotation.nullable=org.eclipse.jdt.annotation.Nullable
org.eclipse.jdt.core.compiler.annotation.nullanalysis=disabled
org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
-org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.5
+org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.7
org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
-org.eclipse.jdt.core.compiler.compliance=1.5
+org.eclipse.jdt.core.compiler.compliance=1.7
org.eclipse.jdt.core.compiler.debug.lineNumber=generate
org.eclipse.jdt.core.compiler.debug.localVariable=generate
org.eclipse.jdt.core.compiler.debug.sourceFile=generate
@@ -113,23 +113,27 @@
org.eclipse.jdt.core.compiler.problem.unusedTypeParameter=ignore
org.eclipse.jdt.core.compiler.problem.unusedWarningToken=warning
org.eclipse.jdt.core.compiler.problem.varargsArgumentNeedCast=warning
-org.eclipse.jdt.core.compiler.source=1.5
+org.eclipse.jdt.core.compiler.source=1.7
org.eclipse.jdt.core.formatter.align_type_members_on_columns=false
+org.eclipse.jdt.core.formatter.alignment_for_additive_operator=16
org.eclipse.jdt.core.formatter.alignment_for_arguments_in_allocation_expression=16
org.eclipse.jdt.core.formatter.alignment_for_arguments_in_enum_constant=16
org.eclipse.jdt.core.formatter.alignment_for_arguments_in_explicit_constructor_call=16
org.eclipse.jdt.core.formatter.alignment_for_arguments_in_method_invocation=16
org.eclipse.jdt.core.formatter.alignment_for_arguments_in_qualified_allocation_expression=16
org.eclipse.jdt.core.formatter.alignment_for_assignment=0
-org.eclipse.jdt.core.formatter.alignment_for_binary_expression=16
+org.eclipse.jdt.core.formatter.alignment_for_bitwise_operator=16
org.eclipse.jdt.core.formatter.alignment_for_compact_if=16
org.eclipse.jdt.core.formatter.alignment_for_conditional_expression=80
org.eclipse.jdt.core.formatter.alignment_for_enum_constants=0
org.eclipse.jdt.core.formatter.alignment_for_expressions_in_array_initializer=16
+org.eclipse.jdt.core.formatter.alignment_for_logical_operator=16
org.eclipse.jdt.core.formatter.alignment_for_multiple_fields=16
+org.eclipse.jdt.core.formatter.alignment_for_multiplicative_operator=16
org.eclipse.jdt.core.formatter.alignment_for_parameters_in_constructor_declaration=16
org.eclipse.jdt.core.formatter.alignment_for_parameters_in_method_declaration=16
org.eclipse.jdt.core.formatter.alignment_for_selector_in_method_invocation=16
+org.eclipse.jdt.core.formatter.alignment_for_string_concatenation=16
org.eclipse.jdt.core.formatter.alignment_for_superclass_in_type_declaration=16
org.eclipse.jdt.core.formatter.alignment_for_superinterfaces_in_enum_declaration=16
org.eclipse.jdt.core.formatter.alignment_for_superinterfaces_in_type_declaration=16
@@ -199,11 +203,12 @@
org.eclipse.jdt.core.formatter.insert_new_line_in_empty_enum_declaration=insert
org.eclipse.jdt.core.formatter.insert_new_line_in_empty_method_body=insert
org.eclipse.jdt.core.formatter.insert_new_line_in_empty_type_declaration=insert
+org.eclipse.jdt.core.formatter.insert_space_after_additive_operator=insert
org.eclipse.jdt.core.formatter.insert_space_after_and_in_type_parameter=insert
org.eclipse.jdt.core.formatter.insert_space_after_assignment_operator=insert
org.eclipse.jdt.core.formatter.insert_space_after_at_in_annotation=do not insert
org.eclipse.jdt.core.formatter.insert_space_after_at_in_annotation_type_declaration=do not insert
-org.eclipse.jdt.core.formatter.insert_space_after_binary_operator=insert
+org.eclipse.jdt.core.formatter.insert_space_after_bitwise_operator=insert
org.eclipse.jdt.core.formatter.insert_space_after_closing_angle_bracket_in_type_arguments=insert
org.eclipse.jdt.core.formatter.insert_space_after_closing_angle_bracket_in_type_parameters=insert
org.eclipse.jdt.core.formatter.insert_space_after_closing_brace_in_block=insert
@@ -233,6 +238,8 @@
org.eclipse.jdt.core.formatter.insert_space_after_comma_in_type_arguments=insert
org.eclipse.jdt.core.formatter.insert_space_after_comma_in_type_parameters=insert
org.eclipse.jdt.core.formatter.insert_space_after_ellipsis=insert
+org.eclipse.jdt.core.formatter.insert_space_after_logical_operator=insert
+org.eclipse.jdt.core.formatter.insert_space_after_multiplicative_operator=insert
org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_parameterized_type_reference=do not insert
org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_type_arguments=do not insert
org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_type_parameters=do not insert
@@ -256,12 +263,16 @@
org.eclipse.jdt.core.formatter.insert_space_after_prefix_operator=do not insert
org.eclipse.jdt.core.formatter.insert_space_after_question_in_conditional=insert
org.eclipse.jdt.core.formatter.insert_space_after_question_in_wildcard=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_relational_operator=insert
org.eclipse.jdt.core.formatter.insert_space_after_semicolon_in_for=insert
+org.eclipse.jdt.core.formatter.insert_space_after_shift_operator=insert
+org.eclipse.jdt.core.formatter.insert_space_after_string_concatenation=insert
org.eclipse.jdt.core.formatter.insert_space_after_unary_operator=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_additive_operator=insert
org.eclipse.jdt.core.formatter.insert_space_before_and_in_type_parameter=insert
org.eclipse.jdt.core.formatter.insert_space_before_assignment_operator=insert
org.eclipse.jdt.core.formatter.insert_space_before_at_in_annotation_type_declaration=insert
-org.eclipse.jdt.core.formatter.insert_space_before_binary_operator=insert
+org.eclipse.jdt.core.formatter.insert_space_before_bitwise_operator=insert
org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_parameterized_type_reference=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_type_arguments=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_type_parameters=do not insert
@@ -307,6 +318,8 @@
org.eclipse.jdt.core.formatter.insert_space_before_comma_in_type_arguments=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_comma_in_type_parameters=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_ellipsis=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_logical_operator=insert
+org.eclipse.jdt.core.formatter.insert_space_before_multiplicative_operator=insert
org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_parameterized_type_reference=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_type_arguments=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_type_parameters=do not insert
@@ -342,8 +355,11 @@
org.eclipse.jdt.core.formatter.insert_space_before_prefix_operator=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_question_in_conditional=insert
org.eclipse.jdt.core.formatter.insert_space_before_question_in_wildcard=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_relational_operator=insert
org.eclipse.jdt.core.formatter.insert_space_before_semicolon=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_semicolon_in_for=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_shift_operator=insert
+org.eclipse.jdt.core.formatter.insert_space_before_string_concatenation=insert
org.eclipse.jdt.core.formatter.insert_space_before_unary_operator=do not insert
org.eclipse.jdt.core.formatter.insert_space_between_brackets_in_array_type_reference=do not insert
org.eclipse.jdt.core.formatter.insert_space_between_empty_braces_in_array_initializer=do not insert
@@ -366,6 +382,10 @@
org.eclipse.jdt.core.formatter.tabulation.char=tab
org.eclipse.jdt.core.formatter.tabulation.size=4
org.eclipse.jdt.core.formatter.use_tabs_only_for_leading_indentations=false
-org.eclipse.jdt.core.formatter.wrap_before_binary_operator=true
+org.eclipse.jdt.core.formatter.wrap_before_additive_operator=true
+org.eclipse.jdt.core.formatter.wrap_before_bitwise_operator=true
+org.eclipse.jdt.core.formatter.wrap_before_logical_operator=true
+org.eclipse.jdt.core.formatter.wrap_before_multiplicative_operator=true
+org.eclipse.jdt.core.formatter.wrap_before_string_concatenation=true
org.eclipse.jdt.core.incompatibleJDKLevel=ignore
org.eclipse.jdt.core.incompleteClasspath=error
diff -Nru equinox-bundles-4.11/bundles/org.eclipse.equinox.metatype/src/org/eclipse/equinox/metatype/impl/Activator.java equinox-bundles-4.12/bundles/org.eclipse.equinox.metatype/src/org/eclipse/equinox/metatype/impl/Activator.java
--- equinox-bundles-4.11/bundles/org.eclipse.equinox.metatype/src/org/eclipse/equinox/metatype/impl/Activator.java 2019-03-05 22:25:38.000000000 +0000
+++ equinox-bundles-4.12/bundles/org.eclipse.equinox.metatype/src/org/eclipse/equinox/metatype/impl/Activator.java 2019-05-28 12:57:39.000000000 +0000
@@ -13,13 +13,13 @@
*******************************************************************************/
package org.eclipse.equinox.metatype.impl;
+import java.io.IOException;
import java.util.Dictionary;
import java.util.Hashtable;
import javax.xml.parsers.SAXParserFactory;
import org.eclipse.equinox.metatype.EquinoxMetaTypeService;
import org.osgi.framework.*;
import org.osgi.service.cm.ManagedService;
-import org.osgi.service.log.LogService;
import org.osgi.service.metatype.MetaTypeProvider;
import org.osgi.service.metatype.MetaTypeService;
import org.osgi.util.tracker.ServiceTracker;
@@ -64,7 +64,7 @@
}
// Do this first to make logging available as early as possible.
lsTracker.open();
- lsTracker.log(LogService.LOG_DEBUG, "====== Meta Type Service starting ! ====="); //$NON-NLS-1$
+ lsTracker.log(LogTracker.LOG_DEBUG, "====== Meta Type Service starting ! ====="); //$NON-NLS-1$
// Do this next to make MetaTypeProviders available as early as possible.
mtpTracker.open();
// Do this last because it may result in the MetaTypeService being registered.
@@ -84,7 +84,7 @@
mtpTracker = metaTypeProviderTracker;
lsTracker = logServiceTracker;
}
- lsTracker.log(LogService.LOG_DEBUG, "====== Meta Type Service stopping ! ====="); //$NON-NLS-1$
+ lsTracker.log(LogTracker.LOG_DEBUG, "====== Meta Type Service stopping ! ====="); //$NON-NLS-1$
spfTracker.close();
mtpTracker.close();
// Do this last to leave logging available as long as possible.
@@ -228,6 +228,11 @@
service = metaTypeService = new MetaTypeServiceImpl(saxParserFactory, logService, mtpTracker);
}
bundleCtx.addBundleListener(service);
+ try {
+ service.load(bundleCtx, logService, mtpTracker);
+ } catch (IOException e) {
+ logService.log(LogTracker.LOG_WARNING, "Error loading cached metatype info.", e); //$NON-NLS-1$
+ }
ServiceRegistration> registration = bundleCtx.registerService(new String[] {MetaTypeService.class.getName(), EquinoxMetaTypeService.class.getName()}, service, properties);
synchronized (this) {
metaTypeServiceRegistration = registration;
@@ -252,6 +257,11 @@
private void unregisterMetaTypeService(ServiceRegistration> registration, MetaTypeServiceImpl service) {
registration.unregister();
bundleCtx.removeBundleListener(service);
+ try {
+ service.save(bundleCtx);
+ } catch (IOException e) {
+ logService.log(LogTracker.LOG_WARNING, "Error saving metatype cache.", e); //$NON-NLS-1$
+ }
}
}
}
diff -Nru equinox-bundles-4.11/bundles/org.eclipse.equinox.metatype/src/org/eclipse/equinox/metatype/impl/AttributeDefinitionImpl.java equinox-bundles-4.12/bundles/org.eclipse.equinox.metatype/src/org/eclipse/equinox/metatype/impl/AttributeDefinitionImpl.java
--- equinox-bundles-4.11/bundles/org.eclipse.equinox.metatype/src/org/eclipse/equinox/metatype/impl/AttributeDefinitionImpl.java 2019-03-05 22:25:38.000000000 +0000
+++ equinox-bundles-4.12/bundles/org.eclipse.equinox.metatype/src/org/eclipse/equinox/metatype/impl/AttributeDefinitionImpl.java 2019-05-28 12:57:39.000000000 +0000
@@ -13,32 +13,37 @@
*******************************************************************************/
package org.eclipse.equinox.metatype.impl;
+import java.io.IOException;
+import java.math.BigDecimal;
+import java.math.BigInteger;
import java.util.*;
import org.eclipse.equinox.metatype.EquinoxAttributeDefinition;
+import org.eclipse.equinox.metatype.impl.Persistence.Reader;
+import org.eclipse.equinox.metatype.impl.Persistence.Writer;
import org.eclipse.osgi.util.NLS;
-import org.osgi.service.log.LogService;
+import org.osgi.service.metatype.AttributeDefinition;
/**
* Implementation of AttributeDefintion
*/
public class AttributeDefinitionImpl extends LocalizationElement implements EquinoxAttributeDefinition, Cloneable {
- String _name;
- String _id;
- String _description;
- int _cardinality = 0;
- int _dataType;
- Object _minValue = null;
- Object _maxValue = null;
- boolean _isRequired = true;
-
- String[] _defaults = null;
- Vector _values = new Vector(7);
- Vector _labels = new Vector(7);
+ private final String _name;
+ private final String _id;
+ private final String _description;
+ private final int _cardinality;
+ private final int _dataType;
+ private final Object _minValue;
+ private final Object _maxValue;
+ private final boolean _isRequired;
private final LogTracker logger;
private final ExtendableHelper helper;
+ private volatile String[] _defaults = null;
+ private volatile ArrayList _values = new ArrayList(7);
+ private volatile ArrayList _labels = new ArrayList(7);
+
/**
* Constructor of class AttributeDefinitionImpl.
*/
@@ -63,21 +68,22 @@
/*
*
*/
- public synchronized Object clone() {
+ @Override
+ public Object clone() {
AttributeDefinitionImpl ad = new AttributeDefinitionImpl(_id, _name, _description, _dataType, _cardinality, _minValue, _maxValue, _isRequired, getLocalization(), logger, helper);
- if (_defaults != null) {
- ad.setDefaultValue(_defaults.clone());
- }
- if ((_labels != null) && (_values != null)) {
- @SuppressWarnings("unchecked")
- Vector labels = (Vector) _labels.clone();
- @SuppressWarnings("unchecked")
- Vector values = (Vector) _values.clone();
- ad.setOption(labels, values, false);
+ String[] curDefaults = _defaults;
+ if (curDefaults != null) {
+ ad.setDefaultValue(curDefaults.clone());
}
+ @SuppressWarnings("unchecked")
+ ArrayList labels = (ArrayList) _labels.clone();
+ @SuppressWarnings("unchecked")
+ ArrayList values = (ArrayList) _values.clone();
+ ad.setOption(labels, values, false);
+
return ad;
}
@@ -90,13 +96,6 @@
return getLocalized(_name);
}
- /**
- * Method to set the name of AttributeDefinition.
- */
- void setName(String name) {
- this._name = name;
- }
-
/*
* (non-Javadoc)
*
@@ -106,13 +105,6 @@
return _id;
}
- /**
- * Method to set the ID of AttributeDefinition.
- */
- void setID(String id) {
- this._id = id;
- }
-
/*
* (non-Javadoc)
*
@@ -122,13 +114,6 @@
return getLocalized(_description);
}
- /**
- * Method to set the description of AttributeDefinition.
- */
- void setDescription(String description) {
- this._description = description;
- }
-
/*
* (non-Javadoc)
*
@@ -138,13 +123,6 @@
return _cardinality;
}
- /**
- * Method to set the cardinality of AttributeDefinition.
- */
- void setCardinality(int cardinality) {
- this._cardinality = cardinality;
- }
-
/*
* (non-Javadoc)
*
@@ -155,26 +133,12 @@
}
/**
- * Method to set the data type of AttributeDefinition.
- */
- void setType(int type) {
- this._dataType = type;
- }
-
- /**
* Method to get the required flag of AttributeDefinition.
*/
boolean isRequired() {
return _isRequired;
}
- /**
- * Method to set the required flag of AttributeDefinition.
- */
- void setRequired(boolean isRequired) {
- this._isRequired = isRequired;
- }
-
/*
* (non-Javadoc)
*
@@ -182,15 +146,14 @@
*/
public String[] getOptionLabels() {
- if ((_labels == null) || (_labels.size() == 0)) {
+ List curLabels = _labels;
+ if (curLabels.isEmpty()) {
return null;
}
- String[] returnedLabels = new String[_labels.size()];
- Enumeration labelKeys = _labels.elements();
+ String[] returnedLabels = new String[curLabels.size()];
int i = 0;
- while (labelKeys.hasMoreElements()) {
- String labelKey = labelKeys.nextElement();
+ for (String labelKey : curLabels) {
returnedLabels[i] = getLocalized(labelKey);
i++;
}
@@ -203,41 +166,47 @@
* @see org.osgi.service.metatype.AttributeDefinition#getOptionValues()
*/
public String[] getOptionValues() {
+ List curValues = _values;
- if ((_values == null) || (_values.size() == 0)) {
+ if (curValues.isEmpty()) {
return null;
}
- return _values.toArray(new String[_values.size()]);
+ return curValues.toArray(MetaTypeInformationImpl.emptyStringArray);
}
/**
* Method to set the Option values of AttributeDefinition.
*/
- void setOption(Vector labels, Vector values, boolean needValidation) {
+ void setOption(ArrayList labels, ArrayList values, boolean needValidation) {
if ((labels == null) || (values == null)) {
- logger.log(LogService.LOG_ERROR, NLS.bind(MetaTypeMsg.NULL_OPTIONS, getID()));
+ logger.log(LogTracker.LOG_ERROR, NLS.bind(MetaTypeMsg.NULL_OPTIONS, getID()));
return;
}
if (labels.size() != values.size()) {
- logger.log(LogService.LOG_ERROR, NLS.bind(MetaTypeMsg.INCONSISTENT_OPTIONS, getID()));
+ logger.log(LogTracker.LOG_ERROR, NLS.bind(MetaTypeMsg.INCONSISTENT_OPTIONS, getID()));
return;
}
- _labels = labels;
- _values = values;
if (needValidation) {
- for (int index = 0; index < _values.size(); index++) {
- ValueTokenizer vt = new ValueTokenizer(_values.get(index), logger);
- _values.set(index, vt.getValuesAsString());
+ for (int index = 0; index < values.size(); index++) {
+ ValueTokenizer vt = new ValueTokenizer(values.get(index), logger);
+ values.set(index, vt.getValuesAsString());
String reason = vt.validate(this);
if ((reason != null) && reason.length() > 0) {
- logger.log(LogService.LOG_WARNING, NLS.bind(MetaTypeMsg.INVALID_OPTIONS, new Object[] {_values.get(index), getID(), reason}));
- _labels.remove(index);
- _values.remove(index);
+ logger.log(LogTracker.LOG_WARNING, NLS.bind(MetaTypeMsg.INVALID_OPTIONS, new Object[] {values.get(index), getID(), reason}));
+ labels.remove(index);
+ values.remove(index);
index--; // Because this one has been removed.
}
}
}
+ _labels = labels;
+ _values = values;
+ }
+
+ boolean containsInvalidValue(String value) {
+ List curValues = _values;
+ return !curValues.isEmpty() && !curValues.contains(value);
}
/*
@@ -257,7 +226,7 @@
ValueTokenizer vt = new ValueTokenizer(defaults_str, logger);
String reason = vt.validate(this);
if ((reason != null) && reason.length() > 0) {
- logger.log(LogService.LOG_WARNING, NLS.bind(MetaTypeMsg.INVALID_DEFAULTS, new Object[] {vt.getValuesAsString(), getID(), reason}));
+ logger.log(LogTracker.LOG_WARNING, NLS.bind(MetaTypeMsg.INVALID_DEFAULTS, new Object[] {vt.getValuesAsString(), getID(), reason}));
return;
}
String[] defaults = vt.getValuesAsArray();
@@ -277,20 +246,6 @@
_defaults = defaults;
}
- /**
- * Method to set the validation value - min of AttributeDefinition.
- */
- void setMinValue(Object minValue) {
- this._minValue = minValue;
- }
-
- /**
- * Method to set the validation value - max of AttributeDefinition.
- */
- void setMaxValue(Object maxValue) {
- this._maxValue = maxValue;
- }
-
/*
* (non-Javadoc)
* In order to be valid, a value must pass all of the following tests.
@@ -309,19 +264,217 @@
return vt.validate(this);
}
+ @Override
public Map getExtensionAttributes(String schema) {
return helper.getExtensionAttributes(schema);
}
+ @Override
public Set getExtensionUris() {
return helper.getExtensionUris();
}
+ @Override
public String getMax() {
return _maxValue == null ? null : String.valueOf(_maxValue);
}
+ @Override
public String getMin() {
return _minValue == null ? null : String.valueOf(_minValue);
}
+
+ Object getMaxValue() {
+ return _maxValue;
+ }
+
+ Object getMinValue() {
+ return _minValue;
+ }
+
+ void getStrings(Set strings) {
+ String[] curDefaults = _defaults;
+ if (curDefaults != null) {
+ for (String string : curDefaults) {
+ strings.add(string);
+ }
+ }
+ strings.add(_description);
+ strings.add(_id);
+ strings.add(_name);
+ strings.add(getLocalization());
+ for (String string : _values) {
+ strings.add(string);
+ }
+
+ for (String string : _labels) {
+ strings.add(string);
+ }
+ helper.getStrings(strings);
+ if (getType() == AttributeDefinition.STRING || getType() == AttributeDefinition.PASSWORD) {
+ if (_maxValue != null) {
+ strings.add(getMax());
+ }
+ if (_minValue != null) {
+ strings.add(getMin());
+ }
+ }
+ }
+
+ public static AttributeDefinitionImpl load(Reader reader, LogTracker logger) throws IOException {
+ String id = reader.readString();
+ String description = reader.readString();
+ String name = reader.readString();
+ int type = reader.readInt();
+ int cardinality = reader.readInt();
+ boolean isRequired = reader.readBoolean();
+ String localization = reader.readString();
+
+ String[] defaults = null;
+ if (reader.readBoolean()) {
+ int numDefaults = reader.readInt();
+ defaults = new String[numDefaults];
+ for (int i = 0; i < numDefaults; i++) {
+ defaults[i] = reader.readString();
+ }
+ }
+ int numLabels = reader.readInt();
+ ArrayList labels = new ArrayList<>(numLabels);
+ for (int i = 0; i < numLabels; i++) {
+ labels.add(reader.readString());
+ }
+ int numValues = reader.readInt();
+ ArrayList values = new ArrayList<>();
+ for (int i = 0; i < numValues; i++) {
+ values.add(reader.readString());
+ }
+ ExtendableHelper helper = ExtendableHelper.load(reader);
+ Object min = readMinMax(type, reader);
+ Object max = readMinMax(type, reader);
+
+ AttributeDefinitionImpl result = new AttributeDefinitionImpl(id, name, description, type, cardinality, min, max, isRequired, localization, logger, helper);
+ result.setDefaultValue(defaults);
+ result.setOption(labels, values, false);
+ return result;
+ }
+
+ public void write(Writer writer) throws IOException {
+ writer.writeString(_id);
+ writer.writeString(_description);
+ writer.writeString(_name);
+ writer.writeInt(_dataType);
+ writer.writeInt(_cardinality);
+ writer.writeBoolean(_isRequired);
+ writer.writeString(getLocalization());
+ String[] curDefaults = _defaults;
+ if (curDefaults == null) {
+ writer.writeBoolean(false);
+ } else {
+ writer.writeBoolean(true);
+ writer.writeInt(curDefaults.length);
+ for (String defaultValue : curDefaults) {
+ writer.writeString(defaultValue);
+ }
+ }
+ List curLabels = _labels;
+ writer.writeInt(curLabels.size());
+ for (String label : curLabels) {
+ writer.writeString(label);
+ }
+ List curValues = _values;
+ writer.writeInt(curValues.size());
+ for (String value : curValues) {
+ writer.writeString(value);
+ }
+ helper.write(writer);
+ writeMinMax(_minValue, writer);
+ writeMinMax(_maxValue, writer);
+ }
+
+ @SuppressWarnings("deprecation")
+ private static Object readMinMax(int dataType, Reader reader) throws IOException {
+ boolean isNull = reader.readBoolean();
+ if (isNull) {
+ return null;
+ }
+ switch (dataType) {
+ // PASSWORD should be treated like STRING.
+ case AttributeDefinition.PASSWORD :
+ case AttributeDefinition.STRING :
+ return reader.readString();
+ case AttributeDefinition.LONG :
+ return reader.readLong();
+ case AttributeDefinition.INTEGER :
+ return reader.readInt();
+ case AttributeDefinition.SHORT :
+ return reader.readShort();
+ case AttributeDefinition.CHARACTER :
+ return reader.readCharacter();
+ case AttributeDefinition.BYTE :
+ return reader.readByte();
+ case AttributeDefinition.DOUBLE :
+ return reader.readDouble();
+ case AttributeDefinition.FLOAT :
+ return reader.readFloat();
+ case AttributeDefinition.BIGINTEGER :
+ return new BigInteger(reader.readString());
+ case AttributeDefinition.BIGDECIMAL :
+ return new BigDecimal(reader.readString());
+ case AttributeDefinition.BOOLEAN :
+ return reader.readBoolean();
+ default :
+ return reader.readString();
+ }
+ }
+
+ @SuppressWarnings("deprecation")
+ private void writeMinMax(Object v, Writer writer) throws IOException {
+ if (v == null) {
+ writer.writeBoolean(true);
+ return;
+ }
+ writer.writeBoolean(false);
+ switch (_dataType) {
+ // PASSWORD should be treated like STRING.
+ case AttributeDefinition.PASSWORD :
+ case AttributeDefinition.STRING :
+ writer.writeString((String) v);
+ return;
+ case AttributeDefinition.LONG :
+ writer.writeLong((Long) v);
+ return;
+ case AttributeDefinition.INTEGER :
+ writer.writeInt((Integer) v);
+ return;
+ case AttributeDefinition.SHORT :
+ writer.writeShort((Short) v);
+ return;
+ case AttributeDefinition.CHARACTER :
+ writer.writeCharacter((Character) v);
+ return;
+ case AttributeDefinition.BYTE :
+ writer.writeByte((Byte) v);
+ return;
+ case AttributeDefinition.DOUBLE :
+ writer.writeDouble((Double) v);
+ return;
+ case AttributeDefinition.FLOAT :
+ writer.writeFloat((Float) v);
+ return;
+ case AttributeDefinition.BIGINTEGER :
+ writer.writeString(v.toString());
+ return;
+ case AttributeDefinition.BIGDECIMAL :
+ writer.writeString(v.toString());
+ return;
+ case AttributeDefinition.BOOLEAN :
+ writer.writeBoolean((Boolean) v);
+ return;
+ default :
+ // Unknown data type
+ writer.writeString(String.valueOf(v));
+ return;
+ }
+ }
+
}
diff -Nru equinox-bundles-4.11/bundles/org.eclipse.equinox.metatype/src/org/eclipse/equinox/metatype/impl/DataParser.java equinox-bundles-4.12/bundles/org.eclipse.equinox.metatype/src/org/eclipse/equinox/metatype/impl/DataParser.java
--- equinox-bundles-4.11/bundles/org.eclipse.equinox.metatype/src/org/eclipse/equinox/metatype/impl/DataParser.java 2019-03-05 22:25:38.000000000 +0000
+++ equinox-bundles-4.12/bundles/org.eclipse.equinox.metatype/src/org/eclipse/equinox/metatype/impl/DataParser.java 2019-05-28 12:57:39.000000000 +0000
@@ -21,7 +21,6 @@
import javax.xml.parsers.SAXParser;
import org.eclipse.osgi.util.NLS;
import org.osgi.framework.Bundle;
-import org.osgi.service.log.LogService;
import org.osgi.service.metatype.AttributeDefinition;
import org.xml.sax.*;
import org.xml.sax.helpers.DefaultHandler;
@@ -79,15 +78,15 @@
protected XMLReader _dp_xmlReader;
// DesignateHanders in DataParser class
- Vector _dp_designateHandlers = new Vector(7);
+ List _dp_designateHandlers = new ArrayList<>(7);
// ObjectClassDefinitions in DataParser class w/ corresponding reference keys
- Hashtable _dp_OCDs = new Hashtable(7);
+ Map _dp_OCDs = new HashMap<>(7);
// Localization in DataParser class
String _dp_localization;
// Default visibility to avoid a plethora of synthetic accessor method warnings.
final LogTracker logger;
- final Collection designates = new ArrayList(7);
+ final Collection designates = new ArrayList<>(7);
/*
* Constructor of class DataParser.
@@ -109,7 +108,7 @@
_dp_xmlReader.setErrorHandler(new MyErrorHandler(System.err));
InputStream is = _dp_url.openStream();
InputSource isource = new InputSource(is);
- logger.log(LogService.LOG_DEBUG, "Starting to parse " + _dp_url); //$NON-NLS-1$
+ logger.log(LogTracker.LOG_DEBUG, "Starting to parse " + _dp_url); //$NON-NLS-1$
_dp_xmlReader.parse(isource);
return designates;
}
@@ -117,6 +116,7 @@
/*
* Convert String for expected data type.
*/
+ @SuppressWarnings("deprecation")
static Object convert(String value, int type) {
if (value == null) {
@@ -174,16 +174,19 @@
elementName = name;
}
+ @Override
public void endElement(String namespaceURI, String localName, String qName) {
finished();
// Let parent resume handling SAX events
_dp_xmlReader.setContentHandler(_doc_handler);
}
+ @Override
public void startElement(String uri, String localName, String qName, Attributes attributes) throws SAXException {
throw new SAXException(NLS.bind(MetaTypeMsg.UNEXPECTED_ELEMENT, new Object[] {qName, attributes.getValue(ID), _dp_url, _dp_bundle.getBundleId(), _dp_bundle.getSymbolicName()}));
}
+ @Override
public void characters(char[] buf, int start, int end) throws SAXException {
String s = new String(buf, start, end).trim();
if (s.length() > 0) {
@@ -223,18 +226,20 @@
super();
}
+ @Override
public void startElement(String uri, String localName, String qName, Attributes attributes) {
- logger.log(LogService.LOG_DEBUG, "Here is AbstractHandler:startElement():" //$NON-NLS-1$
+ logger.log(LogTracker.LOG_DEBUG, "Here is AbstractHandler:startElement():" //$NON-NLS-1$
+ qName);
String name = getName(localName, qName);
if (name.equalsIgnoreCase(METADATA)) {
new MetaDataHandler(this).init(name, attributes);
} else {
- logger.log(LogService.LOG_WARNING, NLS.bind(MetaTypeMsg.UNEXPECTED_ELEMENT, new Object[] {name, attributes.getValue(ID), _dp_url, _dp_bundle.getBundleId(), _dp_bundle.getSymbolicName()}));
+ logger.log(LogTracker.LOG_WARNING, NLS.bind(MetaTypeMsg.UNEXPECTED_ELEMENT, new Object[] {name, attributes.getValue(ID), _dp_url, _dp_bundle.getBundleId(), _dp_bundle.getSymbolicName()}));
}
}
+ @Override
public void setDocumentLocator(Locator locator) {
// do nothing
}
@@ -249,9 +254,10 @@
super(handler);
}
+ @Override
public void init(String name, Attributes attributes) {
- logger.log(LogService.LOG_DEBUG, "Here is MetaDataHandler():init()"); //$NON-NLS-1$
+ logger.log(LogTracker.LOG_DEBUG, "Here is MetaDataHandler():init()"); //$NON-NLS-1$
super.init(name, attributes);
_dp_localization = attributes.getValue(LOCALIZATION);
if (_dp_localization == null) {
@@ -261,44 +267,43 @@
// OcdHandler and AttributeDefinitionHandler later.
}
+ @Override
public void startElement(String uri, String localName, String qName, Attributes atts) {
- logger.log(LogService.LOG_DEBUG, "Here is MetaDataHandler:startElement():" //$NON-NLS-1$
+ logger.log(LogTracker.LOG_DEBUG, "Here is MetaDataHandler:startElement():" //$NON-NLS-1$
+ qName);
String name = getName(localName, qName);
if (name.equalsIgnoreCase(DESIGNATE)) {
DesignateHandler designateHandler = new DesignateHandler(this);
designateHandler.init(name, atts);
if (designateHandler._isParsedDataValid) {
- _dp_designateHandlers.addElement(designateHandler);
+ _dp_designateHandlers.add(designateHandler);
}
} else if (name.equalsIgnoreCase(OCD)) {
OcdHandler ocdHandler = new OcdHandler(this);
ocdHandler.init(name, atts, _dp_OCDs);
} else {
- logger.log(LogService.LOG_WARNING, NLS.bind(MetaTypeMsg.UNEXPECTED_ELEMENT, new Object[] {name, atts.getValue(ID), _dp_url, _dp_bundle.getBundleId(), _dp_bundle.getSymbolicName()}));
+ logger.log(LogTracker.LOG_WARNING, NLS.bind(MetaTypeMsg.UNEXPECTED_ELEMENT, new Object[] {name, atts.getValue(ID), _dp_url, _dp_bundle.getBundleId(), _dp_bundle.getSymbolicName()}));
}
}
+ @Override
protected void finished() {
- logger.log(LogService.LOG_DEBUG, "Here is MetaDataHandler():finished()"); //$NON-NLS-1$
+ logger.log(LogTracker.LOG_DEBUG, "Here is MetaDataHandler():finished()"); //$NON-NLS-1$
if (_dp_designateHandlers.size() == 0) {
// Schema defines at least one DESIGNATE is required.
_isParsedDataValid = false;
- logger.log(LogService.LOG_WARNING, NLS.bind(MetaTypeMsg.MISSING_ELEMENT, new Object[] {DESIGNATE, METADATA, elementId, _dp_url, _dp_bundle.getBundleId(), _dp_bundle.getSymbolicName()}));
+ logger.log(LogTracker.LOG_WARNING, NLS.bind(MetaTypeMsg.MISSING_ELEMENT, new Object[] {DESIGNATE, METADATA, elementId, _dp_url, _dp_bundle.getBundleId(), _dp_bundle.getSymbolicName()}));
return;
}
- Enumeration designateHandlerKeys = _dp_designateHandlers.elements();
- while (designateHandlerKeys.hasMoreElements()) {
- DesignateHandler dh = designateHandlerKeys.nextElement();
+ for (DesignateHandler dh : _dp_designateHandlers) {
ObjectClassDefinitionImpl ocd = _dp_OCDs.get(dh._ocdref);
if (ocd != null) {
designates.add(new Designate.Builder(ocd).bundle(dh._bundle_val).factoryPid(dh._factory_val).merge(dh._merge_val).pid(dh._pid_val).optional(dh._optional_val).build());
} else {
- logger.log(LogService.LOG_ERROR, NLS.bind(MetaTypeMsg.OCD_REF_NOT_FOUND, new Object[] {dh._pid_val, dh._factory_val, dh._ocdref, _dp_url, _dp_bundle.getBundleId(), _dp_bundle.getSymbolicName()}));
-
+ logger.log(LogTracker.LOG_ERROR, NLS.bind(MetaTypeMsg.OCD_REF_NOT_FOUND, new Object[] {dh._pid_val, dh._factory_val, dh._ocdref, _dp_url, _dp_bundle.getBundleId(), _dp_bundle.getSymbolicName()}));
}
}
}
@@ -309,28 +314,28 @@
*/
private class OcdHandler extends AbstractHandler {
- Hashtable _parent_OCDs_hashtable;
+ Map _parent_OCDs;
// This ID "_refID" is only used for reference by Designate element,
// not the PID or FPID of this OCD.
String _refID;
ObjectClassDefinitionImpl _ocd;
- Vector _ad_vector = new Vector(7);
+ List _ads = new ArrayList(7);
List icons = new ArrayList(5);
public OcdHandler(ContentHandler handler) {
super(handler);
}
- public void init(String name, Attributes atts, Hashtable ocds_hashtable) {
+ public void init(String name, Attributes atts, Map ocds_hashtable) {
- logger.log(LogService.LOG_DEBUG, "Here is OcdHandler():init()"); //$NON-NLS-1$
+ logger.log(LogTracker.LOG_DEBUG, "Here is OcdHandler():init()"); //$NON-NLS-1$
super.init(name, atts);
- _parent_OCDs_hashtable = ocds_hashtable;
+ _parent_OCDs = ocds_hashtable;
collectExtensionAttributes(atts);
String ocd_name_val = atts.getValue(NAME);
if (ocd_name_val == null) {
_isParsedDataValid = false;
- logger.log(LogService.LOG_ERROR, NLS.bind(MetaTypeMsg.MISSING_ATTRIBUTE, new Object[] {NAME, name, atts.getValue(ID), _dp_url, _dp_bundle.getBundleId(), _dp_bundle.getSymbolicName()}));
+ logger.log(LogTracker.LOG_ERROR, NLS.bind(MetaTypeMsg.MISSING_ATTRIBUTE, new Object[] {NAME, name, atts.getValue(ID), _dp_url, _dp_bundle.getBundleId(), _dp_bundle.getSymbolicName()}));
return;
}
@@ -342,16 +347,17 @@
_refID = atts.getValue(ID);
if (_refID == null) {
_isParsedDataValid = false;
- logger.log(LogService.LOG_ERROR, NLS.bind(MetaTypeMsg.MISSING_ATTRIBUTE, new Object[] {ID, name, atts.getValue(ID), _dp_url, _dp_bundle.getBundleId(), _dp_bundle.getSymbolicName()}));
+ logger.log(LogTracker.LOG_ERROR, NLS.bind(MetaTypeMsg.MISSING_ATTRIBUTE, new Object[] {ID, name, atts.getValue(ID), _dp_url, _dp_bundle.getBundleId(), _dp_bundle.getSymbolicName()}));
return;
}
_ocd = new ObjectClassDefinitionImpl(ocd_name_val, ocd_description_val, _refID, _dp_localization, extensionAttributes);
}
+ @Override
public void startElement(String uri, String localName, String qName, Attributes atts) {
- logger.log(LogService.LOG_DEBUG, "Here is OcdHandler:startElement():" //$NON-NLS-1$
+ logger.log(LogTracker.LOG_DEBUG, "Here is OcdHandler:startElement():" //$NON-NLS-1$
+ qName);
if (!_isParsedDataValid)
return;
@@ -359,29 +365,28 @@
String name = getName(localName, qName);
if (name.equalsIgnoreCase(AD)) {
AttributeDefinitionHandler attributeDefHandler = new AttributeDefinitionHandler(this);
- attributeDefHandler.init(name, atts, _ad_vector);
+ attributeDefHandler.init(name, atts, _ads);
} else if (name.equalsIgnoreCase(ICON)) {
IconHandler iconHandler = new IconHandler(this);
iconHandler.init(name, atts);
if (iconHandler._isParsedDataValid)
icons.add(iconHandler._icon);
} else {
- logger.log(LogService.LOG_WARNING, NLS.bind(MetaTypeMsg.UNEXPECTED_ELEMENT, new Object[] {name, atts.getValue(ID), _dp_url, _dp_bundle.getBundleId(), _dp_bundle.getSymbolicName()}));
+ logger.log(LogTracker.LOG_WARNING, NLS.bind(MetaTypeMsg.UNEXPECTED_ELEMENT, new Object[] {name, atts.getValue(ID), _dp_url, _dp_bundle.getBundleId(), _dp_bundle.getSymbolicName()}));
}
}
+ @Override
protected void finished() {
- logger.log(LogService.LOG_DEBUG, "Here is OcdHandler():finished()"); //$NON-NLS-1$
+ logger.log(LogTracker.LOG_DEBUG, "Here is OcdHandler():finished()"); //$NON-NLS-1$
if (!_isParsedDataValid)
return;
// OCD gets all parsed ADs.
- Enumeration adKey = _ad_vector.elements();
- while (adKey.hasMoreElements()) {
- AttributeDefinitionImpl ad = adKey.nextElement();
- _ocd.addAttributeDefinition(ad, ad._isRequired);
+ for (AttributeDefinitionImpl ad : _ads) {
+ _ocd.addAttributeDefinition(ad, ad.isRequired());
}
_ocd.setIcons(icons);
- _parent_OCDs_hashtable.put(_refID, _ocd);
+ _parent_OCDs.put(_refID, _ocd);
}
}
@@ -396,14 +401,15 @@
super(handler);
}
+ @Override
public void init(String name, Attributes atts) {
- logger.log(LogService.LOG_DEBUG, "Here is IconHandler:init()"); //$NON-NLS-1$
+ logger.log(LogTracker.LOG_DEBUG, "Here is IconHandler:init()"); //$NON-NLS-1$
super.init(name, atts);
String icon_resource_val = atts.getValue(RESOURCE);
if (icon_resource_val == null) {
_isParsedDataValid = false;
- logger.log(LogService.LOG_ERROR, NLS.bind(MetaTypeMsg.MISSING_ATTRIBUTE, new Object[] {RESOURCE, name, atts.getValue(ID), _dp_url, _dp_bundle.getBundleId(), _dp_bundle.getSymbolicName()}));
+ logger.log(LogTracker.LOG_ERROR, NLS.bind(MetaTypeMsg.MISSING_ATTRIBUTE, new Object[] {RESOURCE, name, atts.getValue(ID), _dp_url, _dp_bundle.getBundleId(), _dp_bundle.getSymbolicName()}));
return;
}
@@ -427,9 +433,9 @@
AttributeDefinitionImpl _ad;
int _dataType;
- Vector _parent_ADs_vector;
- Vector _optionLabel_vector = new Vector(7);
- Vector _optionValue_vector = new Vector(7);
+ List _parent_ADs;
+ ArrayList _optionLabels = new ArrayList<>(7);
+ ArrayList _optionValues = new ArrayList<>(7);
private String ad_defaults_str;
@@ -437,11 +443,11 @@
super(handler);
}
- public void init(String name, Attributes atts, Vector ad_vector) {
+ public void init(String name, Attributes atts, List ads) {
- logger.log(LogService.LOG_DEBUG, "Here is AttributeDefinitionHandler():init()"); //$NON-NLS-1$
+ logger.log(LogTracker.LOG_DEBUG, "Here is AttributeDefinitionHandler():init()"); //$NON-NLS-1$
super.init(name, atts);
- _parent_ADs_vector = ad_vector;
+ _parent_ADs = ads;
collectExtensionAttributes(atts);
String ad_name_val = atts.getValue(NAME);
if (ad_name_val == null) {
@@ -456,14 +462,14 @@
String ad_id_val = atts.getValue(ID);
if (ad_id_val == null) {
_isParsedDataValid = false;
- logger.log(LogService.LOG_ERROR, NLS.bind(MetaTypeMsg.MISSING_ATTRIBUTE, new Object[] {ID, name, atts.getValue(ID), _dp_url, _dp_bundle.getBundleId(), _dp_bundle.getSymbolicName()}));
+ logger.log(LogTracker.LOG_ERROR, NLS.bind(MetaTypeMsg.MISSING_ATTRIBUTE, new Object[] {ID, name, atts.getValue(ID), _dp_url, _dp_bundle.getBundleId(), _dp_bundle.getSymbolicName()}));
return;
}
String ad_type_val = atts.getValue(TYPE);
if (ad_type_val == null) {
_isParsedDataValid = false;
- logger.log(LogService.LOG_ERROR, NLS.bind(MetaTypeMsg.MISSING_ATTRIBUTE, new Object[] {TYPE, name, atts.getValue(ID), _dp_url, _dp_bundle.getBundleId(), _dp_bundle.getSymbolicName()}));
+ logger.log(LogTracker.LOG_ERROR, NLS.bind(MetaTypeMsg.MISSING_ATTRIBUTE, new Object[] {TYPE, name, atts.getValue(ID), _dp_url, _dp_bundle.getBundleId(), _dp_bundle.getSymbolicName()}));
return;
}
if (ad_type_val.equalsIgnoreCase(STRING)) {
@@ -488,7 +494,7 @@
_dataType = AttributeDefinition.PASSWORD;
} else {
_isParsedDataValid = false;
- logger.log(LogService.LOG_ERROR, NLS.bind(MetaTypeMsg.INVALID_TYPE, new Object[] {ad_type_val, ad_id_val, _dp_url, _dp_bundle.getBundleId(), _dp_bundle.getSymbolicName()}));
+ logger.log(LogTracker.LOG_ERROR, NLS.bind(MetaTypeMsg.INVALID_TYPE, new Object[] {ad_type_val, ad_id_val, _dp_url, _dp_bundle.getBundleId(), _dp_bundle.getSymbolicName()}));
return;
}
@@ -526,9 +532,10 @@
_ad = new AttributeDefinitionImpl(ad_id_val, ad_name_val, ad_description_val, _dataType, ad_cardinality_val, convert(ad_min_val, _dataType), convert(ad_max_val, _dataType), Boolean.valueOf(ad_required_val).booleanValue(), _dp_localization, logger, extensionAttributes);
}
+ @Override
public void startElement(String uri, String localName, String qName, Attributes atts) {
- logger.log(LogService.LOG_DEBUG, "Here is AttributeDefinitionHandler:startElement():" //$NON-NLS-1$
+ logger.log(LogTracker.LOG_DEBUG, "Here is AttributeDefinitionHandler:startElement():" //$NON-NLS-1$
+ qName);
if (!_isParsedDataValid)
return;
@@ -539,34 +546,35 @@
optionHandler.init(name, atts);
if (optionHandler._isParsedDataValid) {
// Only add valid Option
- _optionLabel_vector.addElement(optionHandler._label_val);
- _optionValue_vector.addElement(optionHandler._value_val);
+ _optionLabels.add(optionHandler._label_val);
+ _optionValues.add(optionHandler._value_val);
}
} else {
- logger.log(LogService.LOG_WARNING, NLS.bind(MetaTypeMsg.UNEXPECTED_ELEMENT, new Object[] {name, atts.getValue(ID), _dp_url, _dp_bundle.getBundleId(), _dp_bundle.getSymbolicName()}));
+ logger.log(LogTracker.LOG_WARNING, NLS.bind(MetaTypeMsg.UNEXPECTED_ELEMENT, new Object[] {name, atts.getValue(ID), _dp_url, _dp_bundle.getBundleId(), _dp_bundle.getSymbolicName()}));
}
}
+ @Override
protected void finished() {
- logger.log(LogService.LOG_DEBUG, "Here is AttributeDefinitionHandler():finished()"); //$NON-NLS-1$
+ logger.log(LogTracker.LOG_DEBUG, "Here is AttributeDefinitionHandler():finished()"); //$NON-NLS-1$
if (!_isParsedDataValid)
return;
- int numOfValues = _optionValue_vector.size();
- _ad.setOption(_optionLabel_vector, _optionValue_vector, true);
+ int numOfValues = _optionValues.size();
+ _ad.setOption(_optionLabels, _optionValues, true);
String[] values = _ad.getOptionValues();
if (values == null)
values = new String[0];
if (numOfValues != values.length)
- logger.log(LogService.LOG_WARNING, NLS.bind(MetaTypeMsg.INVALID_OPTIONS_XML, new Object[] {elementId, _dp_url, _dp_bundle.getBundleId(), _dp_bundle.getSymbolicName()}));
+ logger.log(LogTracker.LOG_WARNING, NLS.bind(MetaTypeMsg.INVALID_OPTIONS_XML, new Object[] {elementId, _dp_url, _dp_bundle.getBundleId(), _dp_bundle.getSymbolicName()}));
if (ad_defaults_str != null) {
_ad.setDefaultValue(ad_defaults_str, true);
if (_ad.getDefaultValue() == null)
- logger.log(LogService.LOG_WARNING, NLS.bind(MetaTypeMsg.INVALID_DEFAULTS_XML, new Object[] {ad_defaults_str, elementId, _dp_url, _dp_bundle.getBundleId(), _dp_bundle.getSymbolicName()}));
+ logger.log(LogTracker.LOG_WARNING, NLS.bind(MetaTypeMsg.INVALID_DEFAULTS_XML, new Object[] {ad_defaults_str, elementId, _dp_url, _dp_bundle.getBundleId(), _dp_bundle.getSymbolicName()}));
}
- _parent_ADs_vector.addElement(_ad);
+ _parent_ADs.add(_ad);
}
}
@@ -582,70 +590,27 @@
super(handler);
}
+ @Override
public void init(String name, Attributes atts) {
- logger.log(LogService.LOG_DEBUG, "Here is OptionHandler:init()"); //$NON-NLS-1$
+ logger.log(LogTracker.LOG_DEBUG, "Here is OptionHandler:init()"); //$NON-NLS-1$
super.init(name, atts);
_label_val = atts.getValue(LABEL);
if (_label_val == null) {
_isParsedDataValid = false;
- logger.log(LogService.LOG_ERROR, NLS.bind(MetaTypeMsg.MISSING_ATTRIBUTE, new Object[] {LABEL, name, atts.getValue(ID), _dp_url, _dp_bundle.getBundleId(), _dp_bundle.getSymbolicName()}));
+ logger.log(LogTracker.LOG_ERROR, NLS.bind(MetaTypeMsg.MISSING_ATTRIBUTE, new Object[] {LABEL, name, atts.getValue(ID), _dp_url, _dp_bundle.getBundleId(), _dp_bundle.getSymbolicName()}));
return;
}
_value_val = atts.getValue(VALUE);
if (_value_val == null) {
_isParsedDataValid = false;
- logger.log(LogService.LOG_ERROR, NLS.bind(MetaTypeMsg.MISSING_ATTRIBUTE, new Object[] {VALUE, name, atts.getValue(ID), _dp_url, _dp_bundle.getBundleId(), _dp_bundle.getSymbolicName()}));
+ logger.log(LogTracker.LOG_ERROR, NLS.bind(MetaTypeMsg.MISSING_ATTRIBUTE, new Object[] {VALUE, name, atts.getValue(ID), _dp_url, _dp_bundle.getBundleId(), _dp_bundle.getSymbolicName()}));
return;
}
}
}
- // /**
- // * Handler for the Simple Value element.
- // */
- // private class SimpleValueHandler extends AbstractHandler {
- //
- // StringBuffer _buffer = new StringBuffer();
- // Vector _parent_value_vector;
- // String _elementName;
- //
- // public SimpleValueHandler(ContentHandler handler) {
- // super(handler);
- // }
- //
- // public void init(String name, Attributes atts, Vector value_vector)
- // throws SAXException {
- //
- // Logging.log(LogService.LOG_DEBUG,
- // "Here is SimpleValueHandler():init()"); //$NON-NLS-1$
- // _elementName = name;
- // _parent_value_vector = value_vector;
- // }
- //
- // protected void finished() throws SAXException {
- //
- // Logging.log(LogService.LOG_DEBUG,
- // "Here is SimpleValueHandler():finished()"); //$NON-NLS-1$
- // if (_parent_value_vector != null) {
- // _parent_value_vector.addElement(_buffer.toString());
- // }
- // }
- //
- // public void characters(char buf[], int offset, int len)
- // throws SAXException {
- //
- // Logging.log(LogService.LOG_DEBUG,
- // "Here is SimpleValueHandler(" //$NON-NLS-1$
- // + _elementName
- // + "):characters():[" //$NON-NLS-1$
- // + new String(buf, offset, len)
- // + "]"); //$NON-NLS-1$
- // _buffer.append(new String(buf, offset, len));
- // }
- // }
-
/**
* Handler for the Designate element.
*/
@@ -664,14 +629,15 @@
super(handler);
}
+ @Override
public void init(String name, Attributes atts) {
- logger.log(LogService.LOG_DEBUG, "Here is DesignateHandler():init()"); //$NON-NLS-1$
+ logger.log(LogTracker.LOG_DEBUG, "Here is DesignateHandler():init()"); //$NON-NLS-1$
super.init(name, atts);
_pid_val = atts.getValue(PID);
_factory_val = atts.getValue(FACTORY);
if (_pid_val == null && _factory_val == null) {
_isParsedDataValid = false;
- logger.log(LogService.LOG_ERROR, NLS.bind(MetaTypeMsg.MISSING_DESIGNATE_PID_AND_FACTORYPID, new Object[] {elementId, _dp_url, _dp_bundle.getBundleId(), _dp_bundle.getSymbolicName()}));
+ logger.log(LogTracker.LOG_ERROR, NLS.bind(MetaTypeMsg.MISSING_DESIGNATE_PID_AND_FACTORYPID, new Object[] {elementId, _dp_url, _dp_bundle.getBundleId(), _dp_bundle.getSymbolicName()}));
return;
}
@@ -699,9 +665,10 @@
}
}
+ @Override
public void startElement(String uri, String localName, String qName, Attributes atts) {
- logger.log(LogService.LOG_DEBUG, "Here is DesignateHandler:startElement():" //$NON-NLS-1$
+ logger.log(LogTracker.LOG_DEBUG, "Here is DesignateHandler:startElement():" //$NON-NLS-1$
+ qName);
if (!_isParsedDataValid)
return;
@@ -714,20 +681,21 @@
_ocdref = objectHandler._ocdref;
}
} else {
- logger.log(LogService.LOG_WARNING, NLS.bind(MetaTypeMsg.UNEXPECTED_ELEMENT, new Object[] {name, atts.getValue(ID), _dp_url, _dp_bundle.getBundleId(), _dp_bundle.getSymbolicName()}));
+ logger.log(LogTracker.LOG_WARNING, NLS.bind(MetaTypeMsg.UNEXPECTED_ELEMENT, new Object[] {name, atts.getValue(ID), _dp_url, _dp_bundle.getBundleId(), _dp_bundle.getSymbolicName()}));
}
}
+ @Override
protected void finished() {
- logger.log(LogService.LOG_DEBUG, "Here is DesignateHandler():finished()"); //$NON-NLS-1$
+ logger.log(LogTracker.LOG_DEBUG, "Here is DesignateHandler():finished()"); //$NON-NLS-1$
if (!_isParsedDataValid)
return;
if (_ocdref == null) {
_isParsedDataValid = false;
// Schema defines at least one OBJECT is required.
- logger.log(LogService.LOG_ERROR, NLS.bind(MetaTypeMsg.MISSING_ELEMENT, new Object[] {OBJECT, DESIGNATE, elementId, _dp_url, _dp_bundle.getBundleId(), _dp_bundle.getSymbolicName()}));
+ logger.log(LogTracker.LOG_ERROR, NLS.bind(MetaTypeMsg.MISSING_ELEMENT, new Object[] {OBJECT, DESIGNATE, elementId, _dp_url, _dp_bundle.getBundleId(), _dp_bundle.getSymbolicName()}));
return;
}
@@ -745,21 +713,23 @@
super(handler);
}
+ @Override
public void init(String name, Attributes atts) {
- logger.log(LogService.LOG_DEBUG, "Here is ObjectHandler():init()"); //$NON-NLS-1$
+ logger.log(LogTracker.LOG_DEBUG, "Here is ObjectHandler():init()"); //$NON-NLS-1$
super.init(name, atts);
_ocdref = atts.getValue(OCDREF);
if (_ocdref == null) {
_isParsedDataValid = false;
- logger.log(LogService.LOG_ERROR, NLS.bind(MetaTypeMsg.MISSING_ATTRIBUTE, new Object[] {OCDREF, name, atts.getValue(ID), _dp_url, _dp_bundle.getBundleId(), _dp_bundle.getSymbolicName()}));
+ logger.log(LogTracker.LOG_ERROR, NLS.bind(MetaTypeMsg.MISSING_ATTRIBUTE, new Object[] {OCDREF, name, atts.getValue(ID), _dp_url, _dp_bundle.getBundleId(), _dp_bundle.getSymbolicName()}));
return;
}
}
+ @Override
public void startElement(String uri, String localName, String qName, Attributes atts) {
- logger.log(LogService.LOG_DEBUG, "Here is ObjectHandler:startElement():" //$NON-NLS-1$
+ logger.log(LogTracker.LOG_DEBUG, "Here is ObjectHandler:startElement():" //$NON-NLS-1$
+ qName);
if (!_isParsedDataValid)
return;
@@ -770,7 +740,7 @@
attributeHandler.init(name, atts);
// The ATTRIBUTE element is only used by RFC94, do nothing for it here.
} else {
- logger.log(LogService.LOG_WARNING, NLS.bind(MetaTypeMsg.UNEXPECTED_ELEMENT, new Object[] {name, atts.getValue(ID), _dp_url, _dp_bundle.getBundleId(), _dp_bundle.getSymbolicName()}));
+ logger.log(LogTracker.LOG_WARNING, NLS.bind(MetaTypeMsg.UNEXPECTED_ELEMENT, new Object[] {name, atts.getValue(ID), _dp_url, _dp_bundle.getBundleId(), _dp_bundle.getSymbolicName()}));
}
}
}
@@ -789,21 +759,22 @@
super(handler);
}
+ @Override
public void init(String name, Attributes atts) {
- logger.log(LogService.LOG_DEBUG, "Here is AttributeHandler():init()"); //$NON-NLS-1$
+ logger.log(LogTracker.LOG_DEBUG, "Here is AttributeHandler():init()"); //$NON-NLS-1$
super.init(name, atts);
_adref_val = atts.getValue(ADREF);
if (_adref_val == null) {
_isParsedDataValid = false;
- logger.log(LogService.LOG_ERROR, NLS.bind(MetaTypeMsg.MISSING_ATTRIBUTE, new Object[] {ADREF, name, atts.getValue(ID), _dp_url, _dp_bundle.getBundleId(), _dp_bundle.getSymbolicName()}));
+ logger.log(LogTracker.LOG_ERROR, NLS.bind(MetaTypeMsg.MISSING_ATTRIBUTE, new Object[] {ADREF, name, atts.getValue(ID), _dp_url, _dp_bundle.getBundleId(), _dp_bundle.getSymbolicName()}));
return;
}
_content_val = atts.getValue(CONTENT);
if (_content_val == null) {
_isParsedDataValid = false;
- logger.log(LogService.LOG_ERROR, NLS.bind(MetaTypeMsg.MISSING_ATTRIBUTE, new Object[] {CONTENT, name, atts.getValue(ID), _dp_url, _dp_bundle.getBundleId(), _dp_bundle.getSymbolicName()}));
+ logger.log(LogTracker.LOG_ERROR, NLS.bind(MetaTypeMsg.MISSING_ATTRIBUTE, new Object[] {CONTENT, name, atts.getValue(ID), _dp_url, _dp_bundle.getBundleId(), _dp_bundle.getSymbolicName()}));
return;
}
}
@@ -839,15 +810,18 @@
// The following methods are standard SAX ErrorHandler methods.
// See SAX documentation for more info.
+ @Override
public void warning(SAXParseException spe) {
_out.println("Warning: " + getParseExceptionInfo(spe)); //$NON-NLS-1$
}
+ @Override
public void error(SAXParseException spe) throws SAXException {
String message = "Error: " + getParseExceptionInfo(spe); //$NON-NLS-1$
throw new SAXException(message);
}
+ @Override
public void fatalError(SAXParseException spe) throws SAXException {
String message = "Fatal Error: " + getParseExceptionInfo(spe); //$NON-NLS-1$
throw new SAXException(message);
diff -Nru equinox-bundles-4.11/bundles/org.eclipse.equinox.metatype/src/org/eclipse/equinox/metatype/impl/ExtendableHelper.java equinox-bundles-4.12/bundles/org.eclipse.equinox.metatype/src/org/eclipse/equinox/metatype/impl/ExtendableHelper.java
--- equinox-bundles-4.11/bundles/org.eclipse.equinox.metatype/src/org/eclipse/equinox/metatype/impl/ExtendableHelper.java 2019-03-05 22:25:38.000000000 +0000
+++ equinox-bundles-4.12/bundles/org.eclipse.equinox.metatype/src/org/eclipse/equinox/metatype/impl/ExtendableHelper.java 2019-05-28 12:57:39.000000000 +0000
@@ -13,28 +13,74 @@
*******************************************************************************/
package org.eclipse.equinox.metatype.impl;
+import java.io.IOException;
import java.util.*;
+import java.util.Map.Entry;
import org.eclipse.equinox.metatype.Extendable;
+import org.eclipse.equinox.metatype.impl.Persistence.Reader;
+import org.eclipse.equinox.metatype.impl.Persistence.Writer;
public class ExtendableHelper implements Extendable {
- private final Map> attributes;
+ private final Map> extensions;
public ExtendableHelper() {
this(Collections.> emptyMap());
}
- public ExtendableHelper(Map> attributes) {
- if (attributes == null)
+ public ExtendableHelper(Map> extensions) {
+ if (extensions == null)
throw new NullPointerException();
- this.attributes = attributes;
+ this.extensions = extensions;
}
+ @Override
public Map getExtensionAttributes(String schema) {
- return Collections.unmodifiableMap(attributes.get(schema));
+ return Collections.unmodifiableMap(extensions.get(schema));
}
+ @Override
public Set getExtensionUris() {
- return Collections.unmodifiableSet(attributes.keySet());
+ return Collections.unmodifiableSet(extensions.keySet());
+ }
+
+ void getStrings(Set strings) {
+ for (Entry> e1 : extensions.entrySet()) {
+ strings.add(e1.getKey());
+ for (Entry e2 : e1.getValue().entrySet()) {
+ strings.add(e2.getKey());
+ strings.add(e2.getValue());
+ }
+ }
+ }
+
+ public static ExtendableHelper load(Reader reader) throws IOException {
+ Map> extensions = new HashMap<>();
+ int numExtensions = reader.readInt();
+ for (int i = 0; i < numExtensions; i++) {
+ String extKey = reader.readString();
+ int numAttrs = reader.readInt();
+ Map extensionAttrs = new HashMap<>();
+ for (int j = 0; j < numAttrs; j++) {
+ String attrKey = reader.readString();
+ String attrValue = reader.readString();
+ extensionAttrs.put(attrKey, attrValue);
+ }
+ extensions.put(extKey, extensionAttrs);
+ }
+ return new ExtendableHelper(extensions);
+ }
+
+ public void write(Writer writer) throws IOException {
+ writer.writeInt(extensions.size());
+ for (Entry> extensionEntry : extensions.entrySet()) {
+ writer.writeString(extensionEntry.getKey());
+ Map extensionAttrs = extensionEntry.getValue();
+ writer.writeInt(extensionAttrs.size());
+ for (Entry attrs : extensionAttrs.entrySet()) {
+ writer.writeString(attrs.getKey());
+ writer.writeString(attrs.getValue());
+ }
+ }
}
}
diff -Nru equinox-bundles-4.11/bundles/org.eclipse.equinox.metatype/src/org/eclipse/equinox/metatype/impl/Icon.java equinox-bundles-4.12/bundles/org.eclipse.equinox.metatype/src/org/eclipse/equinox/metatype/impl/Icon.java
--- equinox-bundles-4.11/bundles/org.eclipse.equinox.metatype/src/org/eclipse/equinox/metatype/impl/Icon.java 2019-03-05 22:25:38.000000000 +0000
+++ equinox-bundles-4.12/bundles/org.eclipse.equinox.metatype/src/org/eclipse/equinox/metatype/impl/Icon.java 2019-05-28 12:57:39.000000000 +0000
@@ -13,6 +13,10 @@
*******************************************************************************/
package org.eclipse.equinox.metatype.impl;
+import java.io.IOException;
+import java.util.Set;
+import org.eclipse.equinox.metatype.impl.Persistence.Reader;
+import org.eclipse.equinox.metatype.impl.Persistence.Writer;
import org.osgi.framework.Bundle;
/**
@@ -21,19 +25,20 @@
class Icon implements Cloneable {
private final String _fileName;
- private final Integer _size;
+ private final int _size;
private final Bundle _bundle;
/**
* Constructor of class Icon.
*/
- public Icon(String fileName, Integer size, Bundle bundle) {
+ public Icon(String fileName, int size, Bundle bundle) {
this._fileName = fileName;
this._size = size;
this._bundle = bundle;
}
+ @Override
public Object clone() {
return new Icon(this._fileName, this._size, this._bundle);
}
@@ -60,4 +65,19 @@
Bundle getIconBundle() {
return _bundle;
}
+
+ void getStrings(Set strings) {
+ strings.add(_fileName);
+ }
+
+ public static Icon load(Reader reader, Bundle b) throws IOException {
+ int size = reader.readInt();
+ String fileName = reader.readString();
+ return new Icon(fileName, size, b);
+ }
+
+ public void write(Writer writer) throws IOException {
+ writer.writeInt(_size);
+ writer.writeString(_fileName);
+ }
}
diff -Nru equinox-bundles-4.11/bundles/org.eclipse.equinox.metatype/src/org/eclipse/equinox/metatype/impl/LogTracker.java equinox-bundles-4.12/bundles/org.eclipse.equinox.metatype/src/org/eclipse/equinox/metatype/impl/LogTracker.java
--- equinox-bundles-4.11/bundles/org.eclipse.equinox.metatype/src/org/eclipse/equinox/metatype/impl/LogTracker.java 2019-03-05 22:25:38.000000000 +0000
+++ equinox-bundles-4.12/bundles/org.eclipse.equinox.metatype/src/org/eclipse/equinox/metatype/impl/LogTracker.java 2019-05-28 12:57:39.000000000 +0000
@@ -27,6 +27,19 @@
*/
public class LogTracker extends ServiceTracker {
+
+ @SuppressWarnings("deprecation")
+ final static int LOG_ERROR = LogService.LOG_ERROR;
+
+ @SuppressWarnings("deprecation")
+ final static int LOG_WARNING = LogService.LOG_WARNING;
+
+ @SuppressWarnings("deprecation")
+ final static int LOG_INFO = LogService.LOG_INFO;
+
+ @SuppressWarnings("deprecation")
+ final static int LOG_DEBUG = LogService.LOG_DEBUG;
+
/** LogService interface class name */
protected final static String clazz = "org.osgi.service.log.LogService"; //$NON-NLS-1$
@@ -63,7 +76,7 @@
}
@SuppressWarnings("deprecation")
- public synchronized void log(ServiceReference> reference, int level, String message, Throwable exception) {
+ public void log(ServiceReference> reference, int level, String message, Throwable exception) {
ServiceReference[] references = getServiceReferences();
if (references != null) {
@@ -94,7 +107,6 @@
* @param throwable Log exception or null if none.
* @param reference ServiceReference associated with message or null if none.
*/
- @SuppressWarnings("deprecation")
protected void noLogService(int level, String message, Throwable throwable, ServiceReference> reference) {
if (out != null) {
synchronized (out) {
@@ -104,22 +116,22 @@
out.print(timestamp + " "); //$NON-NLS-1$
switch (level) {
- case LogService.LOG_DEBUG : {
+ case LOG_DEBUG : {
out.print(LogTrackerMsg.Debug);
break;
}
- case LogService.LOG_INFO : {
+ case LOG_INFO : {
out.print(LogTrackerMsg.Info);
break;
}
- case LogService.LOG_WARNING : {
+ case LOG_WARNING : {
out.print(LogTrackerMsg.Warning);
break;
}
- case LogService.LOG_ERROR : {
+ case LOG_ERROR : {
out.print(LogTrackerMsg.Error);
break;
diff -Nru equinox-bundles-4.11/bundles/org.eclipse.equinox.metatype/src/org/eclipse/equinox/metatype/impl/MetaTypeInformationImpl.java equinox-bundles-4.12/bundles/org.eclipse.equinox.metatype/src/org/eclipse/equinox/metatype/impl/MetaTypeInformationImpl.java
--- equinox-bundles-4.11/bundles/org.eclipse.equinox.metatype/src/org/eclipse/equinox/metatype/impl/MetaTypeInformationImpl.java 2019-03-05 22:25:38.000000000 +0000
+++ equinox-bundles-4.12/bundles/org.eclipse.equinox.metatype/src/org/eclipse/equinox/metatype/impl/MetaTypeInformationImpl.java 2019-05-28 12:57:39.000000000 +0000
@@ -13,11 +13,14 @@
*******************************************************************************/
package org.eclipse.equinox.metatype.impl;
-import java.util.Enumeration;
-import java.util.Vector;
+import java.io.IOException;
+import java.util.HashMap;
+import java.util.Map;
+import java.util.Map.Entry;
import javax.xml.parsers.SAXParser;
import org.eclipse.equinox.metatype.EquinoxMetaTypeInformation;
-import org.osgi.framework.Bundle;
+import org.eclipse.equinox.metatype.impl.Persistence.Writer;
+import org.osgi.framework.*;
/**
* Implementation of MetaTypeProvider
@@ -30,6 +33,7 @@
*
*/
public class MetaTypeInformationImpl extends MetaTypeProviderImpl implements EquinoxMetaTypeInformation {
+ static final String[] emptyStringArray = new String[0];
/**
* Constructor of class MetaTypeInformationImpl.
@@ -38,6 +42,10 @@
super(bundle, parser, logger);
}
+ public MetaTypeInformationImpl(Bundle bundle, LogTracker logger, Map pidOCDs, Map fPidOCDs) {
+ super(bundle, logger, pidOCDs, fPidOCDs);
+ }
+
/*
* (non-Javadoc)
*
@@ -45,19 +53,10 @@
*/
public String[] getPids() {
- if (_allPidOCDs.size() == 0) {
- return new String[0];
+ if (_allPidOCDs.isEmpty()) {
+ return emptyStringArray;
}
-
- Vector pids = new Vector(7);
- Enumeration e = _allPidOCDs.keys();
- while (e.hasMoreElements()) {
- pids.addElement(e.nextElement());
- }
-
- String[] retvalue = new String[pids.size()];
- pids.toArray(retvalue);
- return retvalue;
+ return _allPidOCDs.keySet().toArray(emptyStringArray);
}
/*
@@ -66,17 +65,10 @@
* @see org.osgi.service.metatype.MetaTypeInformation#getFactoryPids()
*/
public String[] getFactoryPids() {
- if (_allFPidOCDs.size() == 0) {
- return new String[0];
+ if (_allFPidOCDs.isEmpty()) {
+ return emptyStringArray;
}
- Vector fpids = new Vector(7);
- Enumeration e = _allFPidOCDs.keys();
- while (e.hasMoreElements()) {
- fpids.addElement(e.nextElement());
- }
- String[] retvalue = new String[fpids.size()];
- fpids.toArray(retvalue);
- return retvalue;
+ return _allFPidOCDs.keySet().toArray(emptyStringArray);
}
/*
@@ -87,4 +79,54 @@
public Bundle getBundle() {
return this._bundle;
}
+
+ static MetaTypeInformationImpl load(BundleContext systemContext, LogTracker log, Persistence.Reader reader) throws IOException {
+ long id = reader.readLong();
+ Bundle b = systemContext.getBundle(id);
+ boolean valid = true;
+ if (b == null) {
+ valid = false;
+ // just use the system bundle for load purposes
+ b = systemContext.getBundle(Constants.SYSTEM_BUNDLE_LOCATION);
+ }
+
+ long lastModified = reader.readLong();
+ if (lastModified != b.getLastModified()) {
+ valid = false;
+ }
+ Map allPidOCDs = new HashMap<>();
+ int numPidOCDs = reader.readInt();
+ for (int i = 0; i < numPidOCDs; i++) {
+ String key = reader.readString();
+ ObjectClassDefinitionImpl ocd = ObjectClassDefinitionImpl.load(b, log, reader);
+ allPidOCDs.put(key, ocd);
+ }
+ Map allFPidOCDs = new HashMap<>();
+ int numFPidOCDs = reader.readInt();
+ for (int i = 0; i < numFPidOCDs; i++) {
+ String key = reader.readString();
+ ObjectClassDefinitionImpl ocd = ObjectClassDefinitionImpl.load(b, log, reader);
+ allFPidOCDs.put(key, ocd);
+ }
+
+ return !valid ? null : new MetaTypeInformationImpl(b, log, allPidOCDs, allFPidOCDs);
+ }
+
+ void write(Writer writer) throws IOException {
+ writer.writeLong(getBundle().getBundleId());
+ writer.writeLong(getBundle().getLastModified());
+
+ writer.writeInt(_allPidOCDs.size());
+ for (Entry entry : _allPidOCDs.entrySet()) {
+ writer.writeString(entry.getKey());
+ entry.getValue().write(writer);
+ }
+
+ writer.writeInt(_allFPidOCDs.size());
+ for (Entry entry : _allFPidOCDs.entrySet()) {
+ writer.writeString(entry.getKey());
+ entry.getValue().write(writer);
+ }
+ }
+
}
diff -Nru equinox-bundles-4.11/bundles/org.eclipse.equinox.metatype/src/org/eclipse/equinox/metatype/impl/MetaTypeProviderImpl.java equinox-bundles-4.12/bundles/org.eclipse.equinox.metatype/src/org/eclipse/equinox/metatype/impl/MetaTypeProviderImpl.java
--- equinox-bundles-4.11/bundles/org.eclipse.equinox.metatype/src/org/eclipse/equinox/metatype/impl/MetaTypeProviderImpl.java 2019-03-05 22:25:38.000000000 +0000
+++ equinox-bundles-4.12/bundles/org.eclipse.equinox.metatype/src/org/eclipse/equinox/metatype/impl/MetaTypeProviderImpl.java 2019-05-28 12:57:39.000000000 +0000
@@ -15,12 +15,12 @@
import java.net.URL;
import java.util.*;
+import java.util.Map.Entry;
import javax.xml.parsers.SAXParser;
import org.eclipse.equinox.metatype.EquinoxObjectClassDefinition;
import org.eclipse.osgi.util.NLS;
import org.osgi.framework.Bundle;
import org.osgi.framework.Constants;
-import org.osgi.service.log.LogService;
import org.osgi.service.metatype.MetaTypeProvider;
import org.osgi.service.metatype.MetaTypeService;
@@ -38,13 +38,13 @@
public static final String RESOURCE_FILE_EXT = ".properties"; //$NON-NLS-1$
public static final char DIRECTORY_SEP = '/';
- Bundle _bundle;
+ final Bundle _bundle;
- Hashtable _allPidOCDs = new Hashtable(7);
- Hashtable _allFPidOCDs = new Hashtable(7);
+ final Map _allPidOCDs;
+ final Map _allFPidOCDs;
String[] _locales;
- boolean _isThereMeta = false;
+ final boolean _isThereMeta;
// Give access to subclasses.
protected final LogTracker logger;
@@ -56,15 +56,24 @@
this._bundle = bundle;
this.logger = logger;
-
+ this._allPidOCDs = new HashMap<>();
+ this._allFPidOCDs = new HashMap<>();
// read all bundle's metadata files and build internal data structures
_isThereMeta = readMetaFiles(bundle, parser);
if (!_isThereMeta) {
- logger.log(LogService.LOG_DEBUG, NLS.bind(MetaTypeMsg.METADATA_NOT_FOUND, bundle.getSymbolicName(), bundle.getBundleId()));
+ logger.log(LogTracker.LOG_DEBUG, NLS.bind(MetaTypeMsg.METADATA_NOT_FOUND, bundle.getSymbolicName(), bundle.getBundleId()));
}
}
+ public MetaTypeProviderImpl(Bundle bundle, LogTracker logger, Map pidOCDs, Map fPidOCDs) {
+ this._bundle = bundle;
+ this.logger = logger;
+ this._isThereMeta = true;
+ this._allPidOCDs = pidOCDs;
+ this._allFPidOCDs = fPidOCDs;
+ }
+
/**
* This method should do the following:
*
- Obtain a SAX parser from the XML Parser Service:
@@ -107,7 +116,7 @@
}
}
} catch (Exception e) {
- logger.log(LogService.LOG_WARNING, NLS.bind(MetaTypeMsg.METADATA_FILE_PARSE_ERROR, new Object[] {entry, bundle.getBundleId(), bundle.getSymbolicName()}), e);
+ logger.log(LogTracker.LOG_WARNING, NLS.bind(MetaTypeMsg.METADATA_FILE_PARSE_ERROR, new Object[] {entry, bundle.getBundleId(), bundle.getSymbolicName()}), e);
}
}
return result;
@@ -167,19 +176,15 @@
public synchronized String[] getLocales() {
if (_locales != null)
return checkForDefault(_locales);
- Vector localizationFiles = new Vector(7);
+ List localizationFiles = new ArrayList(7);
// get all the localization resources for PIDS
- Enumeration ocds = _allPidOCDs.elements();
- while (ocds.hasMoreElements()) {
- ObjectClassDefinitionImpl ocd = ocds.nextElement();
+ for (ObjectClassDefinitionImpl ocd : _allPidOCDs.values()) {
String localization = ocd.getLocalization();
if (localization != null && !localizationFiles.contains(localization))
localizationFiles.add(localization);
}
// get all the localization resources for FPIDS
- ocds = _allFPidOCDs.elements();
- while (ocds.hasMoreElements()) {
- ObjectClassDefinitionImpl ocd = ocds.nextElement();
+ for (ObjectClassDefinitionImpl ocd : _allFPidOCDs.values()) {
String localization = ocd.getLocalization();
if (localization != null && !localizationFiles.contains(localization))
localizationFiles.add(localization);
@@ -187,9 +192,7 @@
if (localizationFiles.size() == 0)
localizationFiles.add(getBundleLocalization(_bundle));
Vector locales = new Vector(7);
- Enumeration eLocalizationFiles = localizationFiles.elements();
- while (eLocalizationFiles.hasMoreElements()) {
- String localizationFile = eLocalizationFiles.nextElement();
+ for (String localizationFile : localizationFiles) {
int iSlash = localizationFile.lastIndexOf(DIRECTORY_SEP);
String baseDir;
String baseFileName;
@@ -230,4 +233,15 @@
return null;
return locales;
}
+
+ void getStrings(Set strings) {
+ for (Entry entry : _allPidOCDs.entrySet()) {
+ strings.add(entry.getKey());
+ entry.getValue().getStrings(strings);
+ }
+ for (Entry entry : _allFPidOCDs.entrySet()) {
+ strings.add(entry.getKey());
+ entry.getValue().getStrings(strings);
+ }
+ }
}
diff -Nru equinox-bundles-4.11/bundles/org.eclipse.equinox.metatype/src/org/eclipse/equinox/metatype/impl/MetaTypeProviderTracker.java equinox-bundles-4.12/bundles/org.eclipse.equinox.metatype/src/org/eclipse/equinox/metatype/impl/MetaTypeProviderTracker.java
--- equinox-bundles-4.11/bundles/org.eclipse.equinox.metatype/src/org/eclipse/equinox/metatype/impl/MetaTypeProviderTracker.java 2019-03-05 22:25:38.000000000 +0000
+++ equinox-bundles-4.12/bundles/org.eclipse.equinox.metatype/src/org/eclipse/equinox/metatype/impl/MetaTypeProviderTracker.java 2019-05-28 12:57:39.000000000 +0000
@@ -22,7 +22,6 @@
import org.osgi.framework.*;
import org.osgi.service.cm.ManagedService;
import org.osgi.service.cm.ManagedServiceFactory;
-import org.osgi.service.log.LogService;
import org.osgi.service.metatype.*;
import org.osgi.util.tracker.ServiceTracker;
@@ -69,6 +68,7 @@
return _bundle;
}
+ @Override
public EquinoxObjectClassDefinition getObjectClassDefinition(String id, String locale) {
if (_bundle.getState() != Bundle.ACTIVE)
return null; // return none if not active
@@ -158,7 +158,7 @@
e = ase;
}
}
- log.log(LogService.LOG_WARNING, NLS.bind(MetaTypeMsg.INVALID_PID_METATYPE_PROVIDER_IGNORED, new Object[] {_bundle.getSymbolicName(), _bundle.getBundleId(), name, value}), e);
+ log.log(LogTracker.LOG_WARNING, NLS.bind(MetaTypeMsg.INVALID_PID_METATYPE_PROVIDER_IGNORED, new Object[] {_bundle.getSymbolicName(), _bundle.getBundleId(), name, value}), e);
return new String[0];
}
@@ -214,14 +214,17 @@
return ocd.getIcon(size);
}
+ @Override
public Map getExtensionAttributes(String schema) {
return Collections. emptyMap();
}
+ @Override
public Set getExtensionUris() {
return Collections. emptySet();
}
+ @Override
public EquinoxAttributeDefinition[] getAttributeDefinitions(int filter) {
AttributeDefinition[] ads = ocd.getAttributeDefinitions(filter);
if (ads == null || ads.length == 0)
@@ -265,18 +268,22 @@
return ad.getDefaultValue();
}
+ @Override
public Map getExtensionAttributes(String schema) {
return Collections. emptyMap();
}
+ @Override
public Set getExtensionUris() {
return Collections. emptySet();
}
+ @Override
public String getMax() {
return null;
}
+ @Override
public String getMin() {
return null;
}
diff -Nru equinox-bundles-4.11/bundles/org.eclipse.equinox.metatype/src/org/eclipse/equinox/metatype/impl/MetaTypeServiceImpl.java equinox-bundles-4.12/bundles/org.eclipse.equinox.metatype/src/org/eclipse/equinox/metatype/impl/MetaTypeServiceImpl.java
--- equinox-bundles-4.11/bundles/org.eclipse.equinox.metatype/src/org/eclipse/equinox/metatype/impl/MetaTypeServiceImpl.java 2019-03-05 22:25:38.000000000 +0000
+++ equinox-bundles-4.12/bundles/org.eclipse.equinox.metatype/src/org/eclipse/equinox/metatype/impl/MetaTypeServiceImpl.java 2019-05-28 12:57:39.000000000 +0000
@@ -13,15 +13,18 @@
*******************************************************************************/
package org.eclipse.equinox.metatype.impl;
+import java.io.*;
import java.security.AccessController;
import java.security.PrivilegedAction;
-import java.util.Hashtable;
+import java.util.*;
import javax.xml.parsers.*;
import org.eclipse.equinox.metatype.EquinoxMetaTypeInformation;
import org.eclipse.equinox.metatype.EquinoxMetaTypeService;
+import org.eclipse.equinox.metatype.impl.Persistence.Reader;
+import org.eclipse.equinox.metatype.impl.Persistence.Writer;
import org.eclipse.osgi.util.NLS;
import org.osgi.framework.*;
-import org.osgi.service.log.LogService;
+import org.osgi.service.metatype.MetaTypeInformation;
import org.osgi.util.tracker.ServiceTracker;
import org.xml.sax.SAXException;
@@ -29,7 +32,7 @@
* Implementation of MetaTypeService
*/
public class MetaTypeServiceImpl implements EquinoxMetaTypeService, SynchronousBundleListener {
-
+ private static String CACHE_FILE = "metaTypeCache"; //$NON-NLS-1$
SAXParserFactory _parserFactory;
private Hashtable _mtps = new Hashtable(7);
@@ -50,6 +53,7 @@
*
* @see org.osgi.service.metatype.MetaTypeService#getMetaTypeInformation(org.osgi.framework.Bundle)
*/
+ @Override
public EquinoxMetaTypeInformation getMetaTypeInformation(Bundle bundle) {
return getMetaTypeProvider(bundle);
}
@@ -66,12 +70,13 @@
if (_mtps.containsKey(bID))
return _mtps.get(bID);
EquinoxMetaTypeInformation mti = AccessController.doPrivileged(new PrivilegedAction() {
+ @Override
public EquinoxMetaTypeInformation run() {
MetaTypeInformationImpl impl = null;
try {
impl = new MetaTypeInformationImpl(b, newParser(), loggerTemp);
} catch (Exception e) {
- loggerTemp.log(LogService.LOG_ERROR, NLS.bind(MetaTypeMsg.METADATA_PARSE_ERROR, b.getBundleId(), b.getSymbolicName()), e);
+ loggerTemp.log(LogTracker.LOG_ERROR, NLS.bind(MetaTypeMsg.METADATA_PARSE_ERROR, b.getBundleId(), b.getSymbolicName()), e);
}
if (impl == null || !impl._isThereMeta)
return new MetaTypeProviderTracker(b, loggerTemp, tracker);
@@ -135,4 +140,70 @@
break;
}
}
+
+ void load(BundleContext context, LogTracker log, ServiceTracker