File tree Expand file tree Collapse file tree
src/main/java/com/junichi11/netbeans/modules/github/issues Expand file tree Collapse file tree Original file line number Diff line number Diff line change 33 <modelVersion >4.0.0</modelVersion >
44 <groupId >com.junichi11</groupId >
55 <artifactId >netbeans-github-issues</artifactId >
6- <version >0.1.3 </version >
6+ <version >0.1.4-SNAPSHOT </version >
77 <packaging >nbm</packaging >
88 <build >
99 <plugins >
Original file line number Diff line number Diff line change 4949import java .text .ParseException ;
5050import java .text .SimpleDateFormat ;
5151import java .util .ArrayList ;
52- import java .util .Arrays ;
5352import java .util .Date ;
5453import java .util .prefs .BackingStoreException ;
5554import java .util .prefs .Preferences ;
@@ -248,9 +247,16 @@ public String[] getTemplateNames() {
248247 names .add (DEFAULT_TEMPLATE_NAME );
249248 Preferences preferences = getPreferences ().node (TEMPLATE );
250249 try {
250+ // contains the default template if it was edited
251251 String [] childrenNames = preferences .keys ();
252- names .addAll (Arrays .asList (childrenNames ));
253- return names .toArray (new String [childrenNames .length + 1 ]);
252+ int count = 1 ; // default template
253+ for (String childName : childrenNames ) {
254+ if (!childName .equals (DEFAULT_TEMPLATE_NAME )) {
255+ names .add (childName );
256+ count ++;
257+ }
258+ }
259+ return names .toArray (new String [count ]);
254260 } catch (BackingStoreException ex ) {
255261 Exceptions .printStackTrace (ex );
256262 }
You can’t perform that action at this time.
0 commit comments