Community
Participate
Working Groups
Build Identifier: 20110916-0149 I a million of these exceptions in my log and on the IDE after my .plugins/org.eclipse.wst.validation/dep.index file got accidentally truncated to 0 bytes. !ENTRY org.eclipse.wst.validation 4 0 2011-10-15 23:26:46.779 !MESSAGE !STACK 0 java.lang.NullPointerException at org.eclipse.wst.validation.internal.DependencyIndex.getSet(DependencyIndex.java:102) at org.eclipse.wst.validation.internal.DependencyIndex.set(DependencyIndex.java:223) at org.eclipse.wst.validation.Validator$V2.validate(Validator.java:1178) at org.eclipse.wst.validation.internal.ValManager.validate(ValManager.java:704) at org.eclipse.wst.validation.internal.ValManager$1.visit(ValManager.java:665) at org.eclipse.wst.validation.internal.ValManager.accept(ValManager.java:810) at org.eclipse.wst.validation.internal.ValManager.validate(ValManager.java:669) at org.eclipse.wst.validation.internal.ValBuilderJob$Visitor.visit(ValBuilderJob.java:299) at org.eclipse.core.internal.resources.Resource$2.visit(Resource.java:106) at org.eclipse.core.internal.resources.Resource$1.visitElement(Resource.java:65) at org.eclipse.core.internal.watson.ElementTreeIterator.doIteration(ElementTreeIterator.java:82) at org.eclipse.core.internal.watson.ElementTreeIterator.doIteration(ElementTreeIterator.java:86) at org.eclipse.core.internal.watson.ElementTreeIterator.doIteration(ElementTreeIterator.java:86) at org.eclipse.core.internal.watson.ElementTreeIterator.doIteration(ElementTreeIterator.java:86) at org.eclipse.core.internal.watson.ElementTreeIterator.iterate(ElementTreeIterator.java:127) at org.eclipse.core.internal.resources.Resource.accept(Resource.java:75) at org.eclipse.core.internal.resources.Resource.accept(Resource.java:104) at org.eclipse.core.internal.resources.Resource.accept(Resource.java:88) at org.eclipse.wst.validation.internal.ValBuilderJob.fullBuild(ValBuilderJob.java:219) at org.eclipse.wst.validation.internal.ValBuilderJob.run(ValBuilderJob.java:178) at org.eclipse.wst.validation.internal.ValBuilderJob.runInWorkspace(ValBuilderJob.java:126) at org.eclipse.core.internal.resources.InternalWorkspaceJob.run(InternalWorkspaceJob.java:38) at org.eclipse.core.internal.jobs.Worker.run(Worker.java:54) There probably just needs to be guards put up earlier on in the process to watch for a badly formatted dep.index file like mine? Maybe schema check it or do a little HSQL db in its place? Workaround: I renamed my dep.index file to dep.index.old. Eclipse then regenerated a proper dep.index file and I got no further errors. I'd class this as Minor except I had to do quite a bit of googling on the DependencyIndex to infer that dep.index could be a potential troublemaker. I doubt many would be as tenacious and would just nuke their workspace and start fresh. Reproducible: Didn't try Steps to Reproduce: 1. Make dep.index have 0 bytes 2. You'll get NPE errors during validation or Clean ...
Move to WebTools
Well, I think we can consider this case, dep.index file size = 0, like the case where file does not exists. In terms of getting dependencies, in both cases there will not be dependencies. Attaching a new patch where, if the file size = 0, the _dependsOn and _dependents maps are just crated. Doing that, NPE can be avoided.
Created attachment 213188 [details] Proposed HEAD patch Simple fix to check if the file size is 0
Rosendo, this has all the approvals it needs to get into WTP 3.4.2. Please commit it as soon as WTP 3.4.1 is final.
Committed and pushed.