@@ -40,23 +40,20 @@ public PipelineTest() {
4040 @ Test
4141 public void testNavigatorResourceJava () throws Exception {
4242
43+ String [] exts = { COMMON_NAVIGATOR_RESOURCE_EXT , COMMON_NAVIGATOR_JAVA_EXT };
4344 assertEquals (
4445 "There should be no visible extensions for the pipeline viewer." ,
4546 0 , _contentService .getVisibleExtensionIds ().length );
4647
47- _contentService .bindExtensions (new String [] {
48- COMMON_NAVIGATOR_RESOURCE_EXT , COMMON_NAVIGATOR_JAVA_EXT },
49- false );
48+ _contentService .bindExtensions (exts , false );
5049
5150 // Note this test will fail showing only one if the JDT stuff
5251 // is not included in the executing bundles (which it normally is)
5352 assertEquals (
5453 "There should be two visible extensions for the pipeline viewer." ,
5554 2 , _contentService .getVisibleExtensionIds ().length );
5655
57- _contentService .getActivationService ().activateExtensions (
58- new String [] { COMMON_NAVIGATOR_RESOURCE_EXT ,
59- COMMON_NAVIGATOR_JAVA_EXT }, true );
56+ _contentService .getActivationService ().activateExtensions (exts , true );
6057
6158 refreshViewer ();
6259
@@ -100,8 +97,7 @@ public void testNavigatorResourceJava() throws Exception {
10097
10198 boolean found = false ;
10299 for (int i = 0 ; i < rootItems .length && !found ; i ++) {
103- if (rootItems [i ].getData () instanceof IProject ) {
104- IProject newProjectFromTree = (IProject ) rootItems [i ].getData ();
100+ if (rootItems [i ].getData () instanceof IProject newProjectFromTree ) {
105101 if (newProject .equals (newProjectFromTree ))
106102 found = true ;
107103 }
@@ -112,12 +108,9 @@ public void testNavigatorResourceJava() throws Exception {
112108 // Make sure problems in bad extension points are reported well
113109 @ Test
114110 public void testInterceptAddThrow () throws Exception {
115- _contentService .bindExtensions (new String [] {
116- COMMON_NAVIGATOR_RESOURCE_EXT , TEST_CONTENT_RESOURCE_OVERRIDE },
117- false );
118- _contentService .getActivationService ().activateExtensions (
119- new String [] { COMMON_NAVIGATOR_RESOURCE_EXT ,
120- TEST_CONTENT_RESOURCE_OVERRIDE }, true );
111+ String [] exts = { COMMON_NAVIGATOR_RESOURCE_EXT , TEST_CONTENT_RESOURCE_OVERRIDE };
112+ _contentService .bindExtensions (exts , false );
113+ _contentService .getActivationService ().activateExtensions (exts , true );
121114
122115 refreshViewer ();
123116
@@ -137,12 +130,9 @@ public void testInterceptAddThrow() throws Exception {
137130
138131 private void testHasNoChildrenOverride (boolean hasChildren ) throws Exception {
139132 TestContentProviderNoChildren ._hasChildrenTrue = hasChildren ;
140- _contentService .bindExtensions (new String [] {
141- COMMON_NAVIGATOR_RESOURCE_EXT , TEST_CONTENT_NO_CHILDREN },
142- false );
143- _contentService .getActivationService ().activateExtensions (
144- new String [] { COMMON_NAVIGATOR_RESOURCE_EXT ,
145- TEST_CONTENT_NO_CHILDREN }, true );
133+ String [] exts = { COMMON_NAVIGATOR_RESOURCE_EXT , TEST_CONTENT_NO_CHILDREN };
134+ _contentService .bindExtensions (exts , false );
135+ _contentService .getActivationService ().activateExtensions (exts , true );
146136
147137 refreshViewer ();
148138
0 commit comments