@@ -38,7 +38,7 @@ class CompatibilityUtil {
38
38
private CompatibilityUtil () {
39
39
}
40
40
41
- static void run () throws CoreException {
41
+ static void run () {
42
42
Preferences preferences = PreferencesFactory .getWorkspacePreferences ();
43
43
Version previousVersion = getPreviousVersion ( preferences );
44
44
Version currentVersion = getCurrentVersion ();
@@ -57,20 +57,31 @@ static Version getCurrentVersion() {
57
57
return Activator .getDefault ().getBundle ().getVersion ();
58
58
}
59
59
60
- private static void firstRun ( Version previousVersion , Version currentVersion ) throws CoreException {
60
+ private static void firstRun ( Version previousVersion , Version currentVersion ) {
61
61
IProject [] projects = ResourcesPlugin .getWorkspace ().getRoot ().getProjects ();
62
62
for ( IProject project : projects ) {
63
63
if ( project .isAccessible () ) {
64
- updateObsoleteBuilderId ( project );
65
- movePropertiesFromObsoleteNode ( project );
66
- turnEnabledToIncludes ( project );
67
- if ( !isGreaterOrEqual ( previousVersion , 0 , 9 , 4 ) ) {
68
- fixPre09FolderExcludePatterns ( project );
64
+ try {
65
+ updateProject ( project , previousVersion , currentVersion );
66
+ } catch ( CoreException exception ) {
67
+ Activator .logError ( "Failed to update project metadata:" + project .getName (), exception );
69
68
}
70
69
}
71
70
}
72
71
}
73
72
73
+ private static void updateProject ( IProject project ,
74
+ Version previousVersion ,
75
+ Version currentVersion ) throws CoreException
76
+ {
77
+ updateObsoleteBuilderId ( project );
78
+ movePropertiesFromObsoleteNode ( project );
79
+ turnEnabledToIncludes ( project );
80
+ if ( !isGreaterOrEqual ( previousVersion , 0 , 9 , 4 ) ) {
81
+ fixPre09FolderExcludePatterns ( project );
82
+ }
83
+ }
84
+
74
85
private static boolean isGreaterOrEqual ( Version version , int major , int minor , int micro ) {
75
86
boolean result = false ;
76
87
if ( version != null ) {
@@ -138,9 +149,13 @@ private static List<String> createBasicIncludesList() {
138
149
return list ;
139
150
}
140
151
141
- private static void setVersion ( Preferences preferences , Version version ) throws CoreException {
152
+ private static void setVersion ( Preferences preferences , Version version ) {
142
153
preferences .put ( KEY_PLUGIN_VERSION , version .toString () );
143
- flushPreferences ( preferences );
154
+ try {
155
+ flushPreferences ( preferences );
156
+ } catch ( CoreException exception ) {
157
+ Activator .logError ( "Failed to store new jshint-eclipse version in workspace" , exception );
158
+ }
144
159
}
145
160
146
161
private static String [] readPreferencesKeys ( Preferences preferences ) throws CoreException {
0 commit comments