This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.
Product Version = NetBeans IDE 8.1 (Build 201510222201) Operating System = Linux version 3.13.0-71-generic running on amd64 Java; VM; Vendor = 1.8.0_51 Runtime = Java HotSpot(TM) 64-Bit Server VM 25.51-b03 Reproducibility: Happens sometimes, but not always This happens occasionally. Can't reproduce at will. Once it starts happening in a given file, it continues to happen in that file until the file is closed and re-opened. Invoking the "Fix Imports" function really garbles up the imports. Below is a before and after of one such occurrence. BEFORE: import com.csc.mm.commonbase.MiscUtil; import com.csc.mm.commonbase.StringUtil; import com.csc.mm.commonjson.JSONArrayWrapper; import com.csc.mm.commonjson.JSONAware; import com.csc.mm.commonjson.JSONAwareList; import com.csc.mm.commonjson.JSONWrapper2; import com.mitchclaborn.hatcherymgr.common.cache.BreedCacheWeb; import com.mitchclaborn.hatcherymgr.common.cache.ClientCustomerFlagDefCacheWeb; import com.mitchclaborn.hatcherymgr.common.cache.ClientOptionCacheWeb; import com.mitchclaborn.hatcherymgr.common.cache.ClientOrderDetailOptionCacheWeb; import com.mitchclaborn.hatcherymgr.common.cache.CompanyCacheWeb; import com.mitchclaborn.hatcherymgr.common.cache.HatchEventCacheWeb; import com.mitchclaborn.hatcherymgr.common.cache.OperatorCacheWeb; import com.mitchclaborn.hatcherymgr.common.cache.PartnerCacheWeb; import com.mitchclaborn.hatcherymgr.common.cache.PricingTypeCacheWeb; import com.mitchclaborn.hatcherymgr.common.cache.ProductCacheWeb; import com.mitchclaborn.hatcherymgr.common.cache.RouteCacheWeb; import com.mitchclaborn.hatcherymgr.common.cache.SKUCacheWeb; import com.mitchclaborn.hatcherymgr.common.cache.ShipMethodCacheWeb; import com.mitchclaborn.hatcherymgr.common.cache.ShipRateTypeCacheWeb; import com.mitchclaborn.hatcherymgr.common.cache.SKUTypeCacheWeb; import com.mm.server.framework.lib.FrameworkGenericAction; import com.mm.server.framework.lib.ServerFunctionException; import java.math.BigInteger; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; AFTER: import com.csc.mm.FunctionResponse; import com.csc.mm.commonbase.MiscUtil; import com.csc.mm.commonbase.StringUtil; import com.csc.mm.commonjson.JSONArrayWrapper; import com.csc.mm.commonjson.JSONAware; import com.csc.mm.commonjson.JSONAwareList; import import com.mitchclaborn.gf.lib.Operator; com.csc.mm.commonjson.JSONWrapper2; import com.mitchclaborn.hatcherymgr.common.cache.BreedCacheWeb; import com.mitchclaborn.hatcherymgr.common.cache.ClientCustomerFlagDefCacheWeb; import com.mitchclaborn.hatcherymgr.common.cache.ClientOptionCacheWeb; import com.mitchclaborn.hatcherymgr.common.cache.ClientOrderDetailOptionCacheWeb; import com.mitchclaborn.hatcherymgr.common.cache.CompanyCacheWeb; import com.mitchclaborn.hatcherymgr.common.cache.HatchEventCacheWeb; import com.mitchclaborn.hatcherymgr.common.cache.OperatorCacheWeb; import com.mitchclaborn.hatcherymgr.common.cache.PartnerCacheWeb; import com.mitchclaborn.hatcherymgr.common.cache.PricingTypeCacheWeb; import com.mitchclaborn.hatcherymgr.common.cache.ProductCacheWeb; import com.mitchclaborn.hatcherymgr.common.cache.RouteCacheWeb; import com.mitchclaborn.hatcherymgr.common.cache.SKUCacheWeb; import com.mitchclaborn.hatcherymgr.common.cache.ShipMethodCacheWeb; import com.mitchclaborn.hatcherymgr.common.cache.ShipRateTypimport com.mitchclaborn.hatcherymgr.common.util.ServerCall; eCacheWeb; import com.mitchclaborn.hatcherymgr.common.cache.SKUTypeCacheWeb; import com.mm.server.framework.lib.FrameworkGenericAction; import com.mm.server.framework.lib.ServerFunctionException; import java.math.BigInteger; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory;
Created attachment 157752 [details] IDE log
Could not reproduce, sorry.
I can't reproduce it either, but it still happens to me 2 - 3 times per week. Is there some additional logging that can be enabled to help track this down? Or maybe something I should look for in the IDE log?
When you notice the source became corrupted, undo the operation, *save* the file and retry the operation. If you 'succeed' in corrupting the file again, close the file (reverting the fix import changes to the saved prev state), open again and Fix Imports again. In case you succeed, please attach or send me the file contents before the 'corrupting' operation.
No response for 2 months, closing as WFM
This has continued to be a problem for me, now in 8.2. I have reproduced the problem as you requested. I prefer not to attach the source file here. Please provide email address and I'll send it directly.
Created attachment 162471 [details] Before corruption
Created attachment 162472 [details] After corruption
Created attachment 162473 [details] Log file from today
Note to self: DialogBoxAllocationsForOrder.java
You can safely use sdedic@netbeans.org alias
File sent.
Created attachment 162474 [details] hints on wrong line Not sure if this helps, but the whole file is just acting weird. I had problems doing some "introduce constant" refactoring. Here is a screen shot where the hint icon is not showing on the correct line. Acts like the line numbers are somehow out of sync with the contents??
I couldn't reproduce the scenario. Perhaps I need an isolated sample. BUT the corruption look as if the first import, "com.csc.mm.FunctionResponse" was inserted, THEN the next import change was computed using an obsoleted CompilationInfo - which can happen, if, for example, a change is committed between the modification task end and modification result commit. Unlikely, but can happen. Modifications which are done in WORKER thread are OK - it has throughput 1, so parse+commit pairs are serialized. But I found a suspicious code in JavaFixAllImports, lines 172-182: this modification is spinned off to some uncontrolled thread (not EDT, nor WORKER) in parallel with displaying the dialog so WORKER and this runOffEDT guardedCommits() can be interleaved. Dusane - please advise: does the code try to commit partial (non-ambiguous) changes while the dialog shows all changes for confirmation ?
I'm fairly certain that 256526, 257103 and 267242 all have the same root cause. There is some action I do regularly that messes up some internal table of line numbers in the Java source file with what is actually present in the editor. (My hypothesis.) Once in this state, Fix Imports, refactoring and error/hint icons are all messed up. Closing the file and reopening it usually fixes the problem. How can I go about capturing what is needed to catch this?
See my previous comment. I'm fairly certain that some kind of line number mismatch or out-of-sync problem is behind all these: 267242, 257103, 267282, 267308. Just a few minutes ago, I pasted in a large block of code that also had some associated imports. A large number of import statements got corrupted and fix imports made it worse. I deleted the corrupted lines, closed the file, reopened the file then fix imports worked just fine. How can I capture debugging information to help figure this out?