You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@lucene.apache.org by Uwe Schindler <uw...@thetaphi.de> on 2017/10/17 07:45:01 UTC

RE: run in eclipse error

Hi,

this has nothing to do with the Java version. I generally ignore this Eclipse-failure as I only develop in Eclipse, but run from command line. The reason for this behaviour is a problem with Eclipse's resource management/compiler with the way how some classes in Solr (especially facet component) are setup.

In general, it is nowadays a no-go to have so called "non-inner" pkg-private classes. These are classes which share the same source code file, but are not nested in the main class. Instead they appear next to each other in the source file. This is a relic from Java 1.0 and should really no longer used!

Unfortunately some Solr developers still create such non-nested classes. Whenever I see them I change them to be static inner classes. The problem with the bug caused by this is that Eclipse randomly fails (it depends on the order how it compiles). The problem is that Eclipse (but also other tools) cannot relate the non-inner class file to a source file and therefore cannot figure out when it needs to be recompiled.

BTW. The same problem applies to other build system like javac and Ant when it needs to compile. When you change such an inner non-nested inner class, it fails to compile in most cases unless you do "ant clean". The problem is again, that the compiler cannot relate the class files to source code files!

We should really fix those classes to be static and inner - or place them in separate source files. I am looking to find a solution to detect this with forbiddenapis or our Source Code Regexes, if anybody has an idea: tell me!

Uwe

-----
Uwe Schindler
Achterdiek 19, D-28357 Bremen
http://www.thetaphi.de
eMail: uwe@thetaphi.de

> -----Original Message-----
> From: 380382856@qq.com [mailto:380382856@qq.com]
> Sent: Tuesday, October 17, 2017 4:43 AM
> To: java-user <ja...@lucene.apache.org>
> Subject: run in eclipse error
> 
> i am trying to run solr in eclipse. but got the error "The type
> FacetDoubleMerger is already defined". i don't know why. Whether it is jdk
> version wrong?
> Does git master need to use java9 for development?
> 
> 
> 380382856@qq.com


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: dev-help@lucene.apache.org


Re: run in eclipse error

Posted by Erick Erickson <er...@gmail.com>.
Anyone can raise a JIRA and submit a patch, it's then up to one of the
committers to pick it up and commit to the code lines. You have to
create an ID of course.

See: https://issues.apache.org/jira/

On Tue, Oct 17, 2017 at 5:04 AM, Mike Sokolov <ms...@gmail.com> wrote:
> Checkstyle has a onetoplevelclass rule that would enforce this
>
> On October 17, 2017 3:45:01 AM EDT, Uwe Schindler <uw...@thetaphi.de> wrote:
>>Hi,
>>
>>this has nothing to do with the Java version. I generally ignore this
>>Eclipse-failure as I only develop in Eclipse, but run from command
>>line. The reason for this behaviour is a problem with Eclipse's
>>resource management/compiler with the way how some classes in Solr
>>(especially facet component) are setup.
>>
>>In general, it is nowadays a no-go to have so called "non-inner"
>>pkg-private classes. These are classes which share the same source code
>>file, but are not nested in the main class. Instead they appear next to
>>each other in the source file. This is a relic from Java 1.0 and should
>>really no longer used!
>>
>>Unfortunately some Solr developers still create such non-nested
>>classes. Whenever I see them I change them to be static inner classes.
>>The problem with the bug caused by this is that Eclipse randomly fails
>>(it depends on the order how it compiles). The problem is that Eclipse
>>(but also other tools) cannot relate the non-inner class file to a
>>source file and therefore cannot figure out when it needs to be
>>recompiled.
>>
>>BTW. The same problem applies to other build system like javac and Ant
>>when it needs to compile. When you change such an inner non-nested
>>inner class, it fails to compile in most cases unless you do "ant
>>clean". The problem is again, that the compiler cannot relate the class
>>files to source code files!
>>
>>We should really fix those classes to be static and inner - or place
>>them in separate source files. I am looking to find a solution to
>>detect this with forbiddenapis or our Source Code Regexes, if anybody
>>has an idea: tell me!
>>
>>Uwe
>>
>>-----
>>Uwe Schindler
>>Achterdiek 19, D-28357 Bremen
>>http://www.thetaphi.de
>>eMail: uwe@thetaphi.de
>>
>>> -----Original Message-----
>>> From: 380382856@qq.com [mailto:380382856@qq.com]
>>> Sent: Tuesday, October 17, 2017 4:43 AM
>>> To: java-user <ja...@lucene.apache.org>
>>> Subject: run in eclipse error
>>>
>>> i am trying to run solr in eclipse. but got the error "The type
>>> FacetDoubleMerger is already defined". i don't know why. Whether it
>>is jdk
>>> version wrong?
>>> Does git master need to use java9 for development?
>>>
>>>
>>> 380382856@qq.com
>>
>>
>>---------------------------------------------------------------------
>>To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
>>For additional commands, e-mail: java-user-help@lucene.apache.org
>
> --
> Sent from my Android device with K-9 Mail. Please excuse my brevity.

---------------------------------------------------------------------
To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
For additional commands, e-mail: java-user-help@lucene.apache.org


RE: run in eclipse error

Posted by Mike Sokolov <ms...@gmail.com>.
Checkstyle has a onetoplevelclass rule that would enforce this

On October 17, 2017 3:45:01 AM EDT, Uwe Schindler <uw...@thetaphi.de> wrote:
>Hi,
>
>this has nothing to do with the Java version. I generally ignore this
>Eclipse-failure as I only develop in Eclipse, but run from command
>line. The reason for this behaviour is a problem with Eclipse's
>resource management/compiler with the way how some classes in Solr
>(especially facet component) are setup.
>
>In general, it is nowadays a no-go to have so called "non-inner"
>pkg-private classes. These are classes which share the same source code
>file, but are not nested in the main class. Instead they appear next to
>each other in the source file. This is a relic from Java 1.0 and should
>really no longer used!
>
>Unfortunately some Solr developers still create such non-nested
>classes. Whenever I see them I change them to be static inner classes.
>The problem with the bug caused by this is that Eclipse randomly fails
>(it depends on the order how it compiles). The problem is that Eclipse
>(but also other tools) cannot relate the non-inner class file to a
>source file and therefore cannot figure out when it needs to be
>recompiled.
>
>BTW. The same problem applies to other build system like javac and Ant
>when it needs to compile. When you change such an inner non-nested
>inner class, it fails to compile in most cases unless you do "ant
>clean". The problem is again, that the compiler cannot relate the class
>files to source code files!
>
>We should really fix those classes to be static and inner - or place
>them in separate source files. I am looking to find a solution to
>detect this with forbiddenapis or our Source Code Regexes, if anybody
>has an idea: tell me!
>
>Uwe
>
>-----
>Uwe Schindler
>Achterdiek 19, D-28357 Bremen
>http://www.thetaphi.de
>eMail: uwe@thetaphi.de
>
>> -----Original Message-----
>> From: 380382856@qq.com [mailto:380382856@qq.com]
>> Sent: Tuesday, October 17, 2017 4:43 AM
>> To: java-user <ja...@lucene.apache.org>
>> Subject: run in eclipse error
>> 
>> i am trying to run solr in eclipse. but got the error "The type
>> FacetDoubleMerger is already defined". i don't know why. Whether it
>is jdk
>> version wrong?
>> Does git master need to use java9 for development?
>> 
>> 
>> 380382856@qq.com
>
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
>For additional commands, e-mail: java-user-help@lucene.apache.org

-- 
Sent from my Android device with K-9 Mail. Please excuse my brevity.

RE: run in eclipse error

Posted by Mike Sokolov <ms...@gmail.com>.
Checkstyle has a onetoplevelclass rule that would enforce this

On October 17, 2017 3:45:01 AM EDT, Uwe Schindler <uw...@thetaphi.de> wrote:
>Hi,
>
>this has nothing to do with the Java version. I generally ignore this
>Eclipse-failure as I only develop in Eclipse, but run from command
>line. The reason for this behaviour is a problem with Eclipse's
>resource management/compiler with the way how some classes in Solr
>(especially facet component) are setup.
>
>In general, it is nowadays a no-go to have so called "non-inner"
>pkg-private classes. These are classes which share the same source code
>file, but are not nested in the main class. Instead they appear next to
>each other in the source file. This is a relic from Java 1.0 and should
>really no longer used!
>
>Unfortunately some Solr developers still create such non-nested
>classes. Whenever I see them I change them to be static inner classes.
>The problem with the bug caused by this is that Eclipse randomly fails
>(it depends on the order how it compiles). The problem is that Eclipse
>(but also other tools) cannot relate the non-inner class file to a
>source file and therefore cannot figure out when it needs to be
>recompiled.
>
>BTW. The same problem applies to other build system like javac and Ant
>when it needs to compile. When you change such an inner non-nested
>inner class, it fails to compile in most cases unless you do "ant
>clean". The problem is again, that the compiler cannot relate the class
>files to source code files!
>
>We should really fix those classes to be static and inner - or place
>them in separate source files. I am looking to find a solution to
>detect this with forbiddenapis or our Source Code Regexes, if anybody
>has an idea: tell me!
>
>Uwe
>
>-----
>Uwe Schindler
>Achterdiek 19, D-28357 Bremen
>http://www.thetaphi.de
>eMail: uwe@thetaphi.de
>
>> -----Original Message-----
>> From: 380382856@qq.com [mailto:380382856@qq.com]
>> Sent: Tuesday, October 17, 2017 4:43 AM
>> To: java-user <ja...@lucene.apache.org>
>> Subject: run in eclipse error
>> 
>> i am trying to run solr in eclipse. but got the error "The type
>> FacetDoubleMerger is already defined". i don't know why. Whether it
>is jdk
>> version wrong?
>> Does git master need to use java9 for development?
>> 
>> 
>> 380382856@qq.com
>
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
>For additional commands, e-mail: java-user-help@lucene.apache.org

-- 
Sent from my Android device with K-9 Mail. Please excuse my brevity.

Re: RE: run in eclipse error

Posted by "380382856@qq.com" <38...@qq.com>.
I recently look at solr and lucene source, I do not know if I can solve this error and submit a patch?



380382856@qq.com
 
From: Uwe Schindler
Date: 2017-10-17 15:45
To: java-user@lucene.apache.org
CC: dev@lucene.apache.org
Subject: RE: run in eclipse error
Hi,
 
this has nothing to do with the Java version. I generally ignore this Eclipse-failure as I only develop in Eclipse, but run from command line. The reason for this behaviour is a problem with Eclipse's resource management/compiler with the way how some classes in Solr (especially facet component) are setup.
 
In general, it is nowadays a no-go to have so called "non-inner" pkg-private classes. These are classes which share the same source code file, but are not nested in the main class. Instead they appear next to each other in the source file. This is a relic from Java 1.0 and should really no longer used!
 
Unfortunately some Solr developers still create such non-nested classes. Whenever I see them I change them to be static inner classes. The problem with the bug caused by this is that Eclipse randomly fails (it depends on the order how it compiles). The problem is that Eclipse (but also other tools) cannot relate the non-inner class file to a source file and therefore cannot figure out when it needs to be recompiled.
 
BTW. The same problem applies to other build system like javac and Ant when it needs to compile. When you change such an inner non-nested inner class, it fails to compile in most cases unless you do "ant clean". The problem is again, that the compiler cannot relate the class files to source code files!
 
We should really fix those classes to be static and inner - or place them in separate source files. I am looking to find a solution to detect this with forbiddenapis or our Source Code Regexes, if anybody has an idea: tell me!
 
Uwe
 
-----
Uwe Schindler
Achterdiek 19, D-28357 Bremen
http://www.thetaphi.de
eMail: uwe@thetaphi.de
 
> -----Original Message-----
> From: 380382856@qq.com [mailto:380382856@qq.com]
> Sent: Tuesday, October 17, 2017 4:43 AM
> To: java-user <ja...@lucene.apache.org>
> Subject: run in eclipse error
> 
> i am trying to run solr in eclipse. but got the error "The type
> FacetDoubleMerger is already defined". i don't know why. Whether it is jdk
> version wrong?
> Does git master need to use java9 for development?
> 
> 
> 380382856@qq.com
 
 
---------------------------------------------------------------------
To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
For additional commands, e-mail: java-user-help@lucene.apache.org
 

Re: RE: run in eclipse error

Posted by "380382856@qq.com" <38...@qq.com>.
I recently look at solr and lucene source, I do not know if I can solve this error and submit a patch?



380382856@qq.com
 
From: Uwe Schindler
Date: 2017-10-17 15:45
To: java-user@lucene.apache.org
CC: dev@lucene.apache.org
Subject: RE: run in eclipse error
Hi,
 
this has nothing to do with the Java version. I generally ignore this Eclipse-failure as I only develop in Eclipse, but run from command line. The reason for this behaviour is a problem with Eclipse's resource management/compiler with the way how some classes in Solr (especially facet component) are setup.
 
In general, it is nowadays a no-go to have so called "non-inner" pkg-private classes. These are classes which share the same source code file, but are not nested in the main class. Instead they appear next to each other in the source file. This is a relic from Java 1.0 and should really no longer used!
 
Unfortunately some Solr developers still create such non-nested classes. Whenever I see them I change them to be static inner classes. The problem with the bug caused by this is that Eclipse randomly fails (it depends on the order how it compiles). The problem is that Eclipse (but also other tools) cannot relate the non-inner class file to a source file and therefore cannot figure out when it needs to be recompiled.
 
BTW. The same problem applies to other build system like javac and Ant when it needs to compile. When you change such an inner non-nested inner class, it fails to compile in most cases unless you do "ant clean". The problem is again, that the compiler cannot relate the class files to source code files!
 
We should really fix those classes to be static and inner - or place them in separate source files. I am looking to find a solution to detect this with forbiddenapis or our Source Code Regexes, if anybody has an idea: tell me!
 
Uwe
 
-----
Uwe Schindler
Achterdiek 19, D-28357 Bremen
http://www.thetaphi.de
eMail: uwe@thetaphi.de
 
> -----Original Message-----
> From: 380382856@qq.com [mailto:380382856@qq.com]
> Sent: Tuesday, October 17, 2017 4:43 AM
> To: java-user <ja...@lucene.apache.org>
> Subject: run in eclipse error
> 
> i am trying to run solr in eclipse. but got the error "The type
> FacetDoubleMerger is already defined". i don't know why. Whether it is jdk
> version wrong?
> Does git master need to use java9 for development?
> 
> 
> 380382856@qq.com
 
 
---------------------------------------------------------------------
To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
For additional commands, e-mail: java-user-help@lucene.apache.org
 

Re: RE: run in eclipse error

Posted by "380382856@qq.com" <38...@qq.com>.
Thank you for your reply, this question confused me for a long time



380382856@qq.com
 
From: Uwe Schindler
Date: 2017-10-17 15:45
To: java-user@lucene.apache.org
CC: dev@lucene.apache.org
Subject: RE: run in eclipse error
Hi,
 
this has nothing to do with the Java version. I generally ignore this Eclipse-failure as I only develop in Eclipse, but run from command line. The reason for this behaviour is a problem with Eclipse's resource management/compiler with the way how some classes in Solr (especially facet component) are setup.
 
In general, it is nowadays a no-go to have so called "non-inner" pkg-private classes. These are classes which share the same source code file, but are not nested in the main class. Instead they appear next to each other in the source file. This is a relic from Java 1.0 and should really no longer used!
 
Unfortunately some Solr developers still create such non-nested classes. Whenever I see them I change them to be static inner classes. The problem with the bug caused by this is that Eclipse randomly fails (it depends on the order how it compiles). The problem is that Eclipse (but also other tools) cannot relate the non-inner class file to a source file and therefore cannot figure out when it needs to be recompiled.
 
BTW. The same problem applies to other build system like javac and Ant when it needs to compile. When you change such an inner non-nested inner class, it fails to compile in most cases unless you do "ant clean". The problem is again, that the compiler cannot relate the class files to source code files!
 
We should really fix those classes to be static and inner - or place them in separate source files. I am looking to find a solution to detect this with forbiddenapis or our Source Code Regexes, if anybody has an idea: tell me!
 
Uwe
 
-----
Uwe Schindler
Achterdiek 19, D-28357 Bremen
http://www.thetaphi.de
eMail: uwe@thetaphi.de
 
> -----Original Message-----
> From: 380382856@qq.com [mailto:380382856@qq.com]
> Sent: Tuesday, October 17, 2017 4:43 AM
> To: java-user <ja...@lucene.apache.org>
> Subject: run in eclipse error
> 
> i am trying to run solr in eclipse. but got the error "The type
> FacetDoubleMerger is already defined". i don't know why. Whether it is jdk
> version wrong?
> Does git master need to use java9 for development?
> 
> 
> 380382856@qq.com
 
 
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: dev-help@lucene.apache.org