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 7.0 RC1 (Build 201103280000) Operating System = Linux version 2.6.35-28-generic running on i386 Java; VM; Vendor = 1.6.0_24 Runtime = Java HotSpot(TM) Client VM 19.1-b02 There was a git merge conflict, and after resolving it (outside the IDE, using Meld), I find that the IDE is reporting the conflicted class as Duplicate class. I am using the GIT plugin.
What does it mean "Duplicate class"? Can you make a screenshot?
Please explain further
The problem occurs under the following circumstances: 1. the netbeans git plugin is installed 2. a merge/rebase is performed with the remote git repo 3. there is a conflict in one of the files 4. the conflict is resolved using an external tool (like Meld) 4. after the conflict is resolved, and the change commited, netbeans shows Duplicate class error for the class for which there was a conflict. Hope that helps. I am unable to reproduce this error right now since there are no conflicts.
> Hope that helps. I am unable to reproduce this error right now since there are > no conflicts. I cannot reproduce either. Merged, resolved conflicts in commandline and then switched back to IDE, but got no such error. When it occurs again, attach the message.log (http://wiki.netbeans.org/FaqLogMessagesFile) and make a screenshot, honestly i have no idea what the "Duplicate class error" could be.
Created attachment 109519 [details] screencap showing duplicate file warning screencap of issue. message log to follow.
Created attachment 109520 [details] ~/.netbeans/var/log/message.log message log
re-opened because I also have this issue. i am unable to "fix"/workaround.
(In reply to comment #7) Did this happen also after a merge? > re-opened because I also have this issue. i am unable to "fix"/workaround. Well, isn't this because the merge failed and CUPI class is now coded twice in the file?
(In reply to comment #8) > (In reply to comment #7) > Did this happen also after a merge? Most likely, but I'm not sure the exactly steps I took to get here. > > re-opened because I also have this issue. i am unable to "fix"/workaround. > Well, isn't this because the merge failed and CUPI class is now coded twice in > the file? No, there is only a single class defined in the .java source file. Even though the IDE shows errors due to the "duplicate class", I can still edit the file, F9 (compile) file, Shift+F6 (run), etc.
Annotations are probably not recomputed after the file gets to the correct state after a merge, reassigning to java. Could you look at it?
Not sure if still relevant, but the problem is netbeans for sure. Happens to me all the time after merge conflicts. Workaround to solve this: * close netbeans * Delete netbeans cache directory. For linux it's: ~/.netbeans/<version>/var/cache/*. Where <version> is the netbeans version, like 7.0 * restart netbeans
Same bug, same circumstances : git > merge with conflict > edited with an other tools (outside Netbeans) > Duplicate class. Like in screensshoot, all class in the same package are considered like duplicate class. Other packages are not affected. Workaround purpose by guyer@netbeans.org work correctly. Thank you Good bye
I had the same problem on Ubuntu and I deleted cache dir like guyer@netbeans.org said, and now everything works fine. Thanks guyer !!!
I also met this problem several times. The latest one is now with NB7.2 on Mac. Due to some unknown problem, SVN update report error on some file that can not updated due to MD5 not match. So I have to delete the dir which contains the file and re-checkout the whole dir. This resolved the SVN issue, but NetBeans will report the error "Duplicate class error" on the source file editor. This error will cause other issues, such as report warning when use findbugs, can not refactor the class etc. I thought maybe a simple solution is just add an action to context menu just delete cached index items. Currently my work around is manually delete the whole index dir in cache.
Got the same one after trying to rebase. Had to git rebase --abort and git reset --hard HEAD^, after that found the Duplicate class error when opening NetBeans. The same version of the code on the other machine compiles perfectly and I can ant clean && ant build from command line on this machine just fine. Checked the netbeans cache directory, using "grep -R 'Dual' ~/.netbeans/7.1.2/var/cache/", where "Dual" is the name of the supposedly duplicate class. I think this part of it is relevant: .../var/cache/index/s83/java/14/classes/se/lth/cs/srl/Dual/java/BACKUP/4846.rs:se.lth.cs.srl.Dual .../var/cache/index/s83/java/14/classes/se/lth/cs/srl/Dual/java/BACKUP/4846.rs:se.lth.cs.srl.Dual$1 .../var/cache/index/s83/java/14/classes/se/lth/cs/srl/Dual/java/BACKUP/4846.rs:se.lth.cs.srl.Dual$ROLE_CORR_MATR_MODE .../var/cache/index/s83/java/14/classes/se/lth/cs/srl/Dual/java/BASE/4846.rs:se.lth.cs.srl.Dual .../var/cache/index/s83/java/14/classes/se/lth/cs/srl/Dual/java/BASE/4846.rs:se.lth.cs.srl.Dual$1 .../var/cache/index/s83/java/14/classes/se/lth/cs/srl/Dual/java/BASE/4846.rs:se.lth.cs.srl.Dual$ROLE_CORR_MATR_MODE .../var/cache/index/s83/java/14/classes/se/lth/cs/srl/Dual/java/LOCAL/4846.rs:se.lth.cs.srl.Dual .../var/cache/index/s83/java/14/classes/se/lth/cs/srl/Dual/java/LOCAL/4846.rs:se.lth.cs.srl.Dual$1 .../var/cache/index/s83/java/14/classes/se/lth/cs/srl/Dual/java/LOCAL/4846.rs:se.lth.cs.srl.Dual$ROLE_CORR_MATR_MODE .../var/cache/index/s83/java/14/classes/se/lth/cs/srl/Dual/java/REMOTE/4846.rs:se.lth.cs.srl.Dual .../var/cache/index/s83/java/14/classes/se/lth/cs/srl/Dual/java/REMOTE/4846.rs:se.lth.cs.srl.Dual$1 .../var/cache/index/s83/java/14/classes/se/lth/cs/srl/Dual/java/REMOTE/4846.rs:se.lth.cs.srl.Dual$ROLE_CORR_MATR_MODE P.S. that's on Mac OS X 10.5, Netbeans 7.1.2
Hey, Netbeans guys! Everybody who use GIT have to delete that cache folder or use another IDE. Why it is still not fixed?
(In reply to comment #17) > Hey, Netbeans guys! Everybody who use GIT have to delete that cache folder or > use another IDE. Why it is still not fixed? Hi, If you can provide steps to reproduce (i.e. clone this repository, run this command, then this command and then you will see the bug), that would surely going to help a lot and would allow us to provide a fix much faster. Thanks.
Sure. You just need to get any conflict in git while netbeans have opened. ... few minutes later That's really strange. I get the issue _every_ time I get _any_ conflict in my java-freeform project (actually, it's android project), but I've tried to reproduce the issue by creating a conflict in helloworld project and fresh git repository and I am unable to reproduce it :-/ I keep you informed.
Hi, I am using Netbeans 7.2 on OpenSuse 12.2 with subversion to googlecode. I have the same error with a duplicate class that was previously with a svn conflic. I delete the VAR folders and restart the netbeans. ~/.netbeans/7.2/var/ /usr/local/netbeans-7.2/nb/var This did not solved the problem. The project compiles well in the Netbeans and directly in the folder with the Maven command
UPD: Seems it happens only while resolving conflicts of REBASE'ing. Deleting contents of var/cache/ always resolves the issue.
(In reply to comment #21) > UPD: Seems it happens only while resolving conflicts of REBASE'ing. Deleting > contents of var/cache/ always resolves the issue. Hi, I delete the var folder mentioned before with not success. I solve the problem closing the netbeans and changing the Class name (also, file name) and reopened the project. I did the rename process out of the IDE because it don't let me change the name where there are conflicts on the class.
I had the same problem with NB 7.2 on Win 7. The cache directory solution worked for me, cache on windows platform is lacated there : C:\Users\$userName\AppData\Local\NetBeans\Cache\7.2
*** Bug 198466 has been marked as a duplicate of this bug. ***
Workaround under Debian with NB 7.2: delete ~/.cache/netbeans/VERSION/
I created a small java project with instructions on how to reproduce the bug: https://github.com/hennr/NetBeansDupplicateClassMergeBug The README provides a step-by-step guide to reproduce the bug. If you got further questions please let me know.
(In reply to comment #26) > I created a small java project with instructions on how to reproduce the bug: > > https://github.com/hennr/NetBeansDupplicateClassMergeBug > > The README provides a step-by-step guide to reproduce the bug. > If you got further questions please let me know. Thank you very much for the test case. This should solve the problem: http://hg.netbeans.org/jet-main/rev/724bc2a2a94d A note should be added to this bug when a daily build will be available with the bugfix - would be awesome if someone could try to verify the problem is really solved. Thank you.
Integrated into 'main-golden', will be available in build *201211090001* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress) Changeset: http://hg.netbeans.org/main-golden/rev/724bc2a2a94d User: Jan Lahoda <jlahoda@netbeans.org> Log: #197983: while conflicts are resolved inside a git repository, several files that contain dots and have the .java extension are generated. Correct .rs files must be generated for them, on correct places, and these must not be deleted while deleting a different Java file
I can't confirm the bug any more either, thanks! I'm very impressed by your processes here by the way. Love the update we got from the build management tool.
*** Bug 215437 has been marked as a duplicate of this bug. ***
SPAM - Removed by Administrator
I still have this issue in 7.4. Sorry I was not able to find another place to comment.
i got it too today solved by deleting the cache
version 7.4, linux sorry for the double comment anyway this reminds me the good old days of the first netbeans 5 releases where deleting the cache was part of the development process :)
I am glad I found this post,thanks to everyone! I am having the same problem using Netbeans 7.3 with Mercurial (after homemade "rebase" by creating a new repository) - almost 3 years after this trail began. Especially valuable was the post by sdaclin@netbeans.org pointing me to the correct windows directory and the correct NB cache: C:\Users\$userName\AppData\Local\NetBeans\Cache\7.3
I had an unexpected "duplicate class" error using NetBeans 8. I have a class named "Whatever", NetBeans thought I had multiple classes called "Whatever". Thanks to the previous post by pwvirgo@netbeans.org 2014-04-16 21:20:02 UTC I renamed: C:\Users\$userName\AppData\Local\NetBeans\Cache\8.0 to become C:\Users\$userName\AppData\Local\NetBeans\Cache\8.0hidden and that solved the problem, for now. Unlike earlier posts, I had not been doing any messing about the repository. We use SVN.
Just had this happen to me as well on version 8.0.2. Workaround was same as vincewebb. In my case, I am using git and problem occurred after refactoring (renaming) a class/file several times.
Just experienced a similar problem, in NetBeans 8.0.2 (Java 7u45 x64, on Windows 7 Enterprise SP1 x64). I had several Maven NetBeans Module project open. One of them was highlighted in the "Projects" pane as "containing errors", which came from "Bundle.java" under "Generated Sources (annotations)" folder. Opening that file in the editor showed no errors. Doing "Clean & Build" worked every time, without errors. Attempting incremental "Build" resulted in "duplicate class" error on that generated Bundle class. This error started happening immediately after I updated nbm-maven-plugin from 3.13 to 3.14 and cleaned the local Maven repo. Deleting NetBeans' cache directory solved the problem completely -- no more error messages or failed incremental builds.
In addition to my previous comment: We found a semi-consistent way to reproduce this problem, and the "duplicate class" error only appears to happen with maven-compiler-plugin versions 3.2 and 3.3. I cannot reproduce this problem with versions 2.5.1, 3.0, or 3.1. So it could be something specific to those plugins.
Thanks @vincewebb -- I renamed: C:\Users\$userName\AppData\Local\NetBeans\Cache\8.1 to become C:\Users\$userName\AppData\Local\NetBeans\Cache\8.1_ and that solved the problem, for now. --