@@ -59,18 +59,21 @@ protected String getProjectName() {
59
59
}
60
60
61
61
private void createFeature (FeatureData fd , boolean patch , Object modelObject ) throws Exception {
62
- if (fd == null )
62
+ if (fd == null ) {
63
63
fd = DEFAULT_FEATURE_DATA ;
64
+ }
64
65
IProject project = ResourcesPlugin .getWorkspace ().getRoot ().getProject (PROJECT_NAME );
65
66
IPath path = Platform .getLocation ();
66
67
IRunnableWithProgress op ;
67
- if ((patch && !(modelObject instanceof IFeatureModel )) || (!patch && modelObject != null && !(modelObject instanceof IPluginBase [])))
68
+ if ((patch && !(modelObject instanceof IFeatureModel )) || (!patch && modelObject != null && !(modelObject instanceof IPluginBase []))) {
68
69
fail ("Unaccepted model object passed..." + modelObject );
70
+ }
69
71
70
- if (patch )
72
+ if (patch ) {
71
73
op = new CreateFeaturePatchOperation (project , path , fd , (IFeatureModel ) modelObject , PDEPlugin .getActiveWorkbenchShell ());
72
- else
74
+ } else {
73
75
op = new CreateFeatureProjectOperation (project , path , fd , (IPluginBase []) modelObject , PDEPlugin .getActiveWorkbenchShell ());
76
+ }
74
77
IProgressService progressService = PlatformUI .getWorkbench ().getProgressService ();
75
78
progressService .runInUI (progressService , op , null );
76
79
}
@@ -89,9 +92,10 @@ public void testCreationFeatureProject() throws Exception {
89
92
@ Test
90
93
public void testCreationFeaturePatch () throws Exception {
91
94
IFeatureModel [] models = PDECore .getDefault ().getFeatureModelManager ().getModels ();
92
- if (models .length == 0 )
95
+ if (models .length == 0 ) {
93
96
// cant test patches if no feature models exist
94
97
return ;
98
+ }
95
99
createFeature (DEFAULT_FEATURE_DATA , true , models [0 ]);
96
100
verifyProjectExistence ();
97
101
verifyFeatureNature ();
0 commit comments