testmycode / tmc-netbeans

Test My Code NetBeans plugin
GNU General Public License v2.0
19 stars 18 forks source link

Project icon not always updated when opening exercises #10

Closed mpartel closed 12 years ago

mpartel commented 13 years ago

The following sequence of events was witnessed (with missing information unfortunately missed/forgotten): exercises were downloaded, completed and submitted, then the exercises were deleted from NB (and due to #9 their directories were deleted by hand). Then, TMC->Open current exercises was selected and the exercises appeard with black dots. After restarting NB, the dots finally turned green.

All this happened on Windows, but that's probably irrelevant.

mpartel commented 13 years ago

OpenExercisesAction does trigger courseDb.save(), which in turn should trigger ExerciseIconAnnotator.updateAllIcons().

mpartel commented 13 years ago

Sometimes the icon annotations don't appear at all. Restarting NB may help, but according to some reports it doesn't.

mpartel commented 12 years ago

Witnessed it occurring when the following error was logged

WARNING [fi.helsinki.cs.tmc.model.CourseDb]: Failed to load course database
java.lang.NullPointerException
    at com.google.gson.FieldAttributes.getAnnotationFromArray(FieldAttributes.java:231)
    at com.google.gson.FieldAttributes.getAnnotation(FieldAttributes.java:150)
    at com.google.gson.SerializedNameAnnotationInterceptingNamingPolicy.translateName(SerializedNameAnnotationInterceptingNamingPolicy.java:45)
    at com.google.gson.JsonObjectDeserializationVisitor.getFieldName(JsonObjectDeserializationVisitor.java:93)
    at com.google.gson.JsonObjectDeserializationVisitor.visitFieldUsingCustomHandler(JsonObjectDeserializationVisitor.java:98)
    at com.google.gson.ReflectingFieldNavigator.visitFieldsReflectively(ReflectingFieldNavigator.java:63)
    at com.google.gson.ObjectNavigator.accept(ObjectNavigator.java:120)
    at com.google.gson.JsonDeserializationContextDefault.fromJsonObject(JsonDeserializationContextDefault.java:76)
    at com.google.gson.JsonDeserializationContextDefault.deserialize(JsonDeserializationContextDefault.java:54)
    at com.google.gson.Gson.fromJson(Gson.java:551)
    at com.google.gson.Gson.fromJson(Gson.java:498)
    at com.google.gson.Gson.fromJson(Gson.java:441)
    at fi.helsinki.cs.tmc.model.CourseDb.loadFromFile(CourseDb.java:149)
[catch] at fi.helsinki.cs.tmc.model.CourseDb.<init>(CourseDb.java:46)
    at fi.helsinki.cs.tmc.model.CourseDb.<init>(CourseDb.java:38)
    at fi.helsinki.cs.tmc.model.CourseDb.getInstance(CourseDb.java:26)
    at fi.helsinki.cs.tmc.ui.ExerciseIconAnnotator.<init>(ExerciseIconAnnotator.java:32)
    at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
    at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57)
    at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
    at java.lang.reflect.Constructor.newInstance(Constructor.java:532)
    at java.lang.Class.newInstance0(Class.java:372)
    at java.lang.Class.newInstance(Class.java:325)
    at org.openide.util.lookup.implspi.SharedClassObjectBridge.newInstance(SharedClassObjectBridge.java:64)
    at org.openide.util.lookup.MetaInfServicesLookup$P.getInstance(MetaInfServicesLookup.java:488)
    at org.openide.util.lookup.AbstractLookup$R.allInstances(AbstractLookup.java:1005)
    at org.openide.util.lookup.ProxyLookup$R.computeResult(ProxyLookup.java:557)
    at org.openide.util.lookup.ProxyLookup$R.allInstances(ProxyLookup.java:497)
    at org.netbeans.api.project.ProjectUtils$AnnotateIconProxyProjectInformation.annotatorsChanged(ProjectUtils.java:282)
    at org.netbeans.api.project.ProjectUtils$AnnotateIconProxyProjectInformation.<init>(ProjectUtils.java:278)
    at org.netbeans.api.project.ProjectUtils.getInformation(ProjectUtils.java:102)
    at org.netbeans.spi.project.support.GenericSources$GenericOnlySources.getSourceGroups(GenericSources.java:91)
    at org.netbeans.modules.localhistory.LocalHistory.setRoots(LocalHistory.java:164)
    at org.netbeans.modules.localhistory.LocalHistory.access$100(LocalHistory.java:84)
    at org.netbeans.modules.localhistory.LocalHistory$1.run(LocalHistory.java:154)
    at org.openide.util.RequestProcessor$Task.run(RequestProcessor.java:1424)
    at org.openide.util.RequestProcessor$Processor.run(RequestProcessor.java:1968)
mpartel commented 12 years ago

Witnessed again on Windows, but nothing suspicious in .netbeans/var/log/messages.log. Icon annotation fixed when clicking on the [+] icon next to the project.