Skip to content

Commit be12918

Browse files
Lubos KoscoLubos Kosco
Lubos Kosco
authored and
Lubos Kosco
committed
bug #625 xref links containing \u don't seem to be working
1 parent a7f94bf commit be12918

File tree

4 files changed

+55
-13
lines changed

4 files changed

+55
-13
lines changed

opengrok-web-nbproject/nbproject/build-impl.xml

+41-10
Original file line numberDiff line numberDiff line change
@@ -101,12 +101,24 @@
101101
<condition property="do.display.browser">
102102
<istrue value="${display.browser}"/>
103103
</condition>
104+
<condition property="do.display.browser.debug.old">
105+
<and>
106+
<isset property="do.display.browser"/>
107+
<not>
108+
<isset property="do.debug.client"/>
109+
</not>
110+
<not>
111+
<isset property="browser.context"/>
112+
</not>
113+
</and>
114+
</condition>
104115
<condition property="do.display.browser.debug">
105116
<and>
106117
<isset property="do.display.browser"/>
107118
<not>
108119
<isset property="do.debug.client"/>
109120
</not>
121+
<isset property="browser.context"/>
110122
</and>
111123
</condition>
112124
<available file="${conf.dir}/MANIFEST.MF" property="has.custom.manifest"/>
@@ -445,7 +457,7 @@ or ant -Dj2ee.platform.classpath=&lt;server_classpath&gt; (where no properties f
445457
</condition>
446458
<union id="test.set"/>
447459
<taskdef classname="org.testng.TestNGAntTask" classpath="${run.test.classpath}" name="testng"/>
448-
<testng classfilesetref="test.set" failureProperty="tests.failed" methods="${testng.methods.arg}" mode="${testng.mode}" outputdir="${build.test.results.dir}" suitename="opengrok-web-nbproject" testname="TestNG tests" workingDir="${basedir}">
460+
<testng classfilesetref="test.set" failureProperty="tests.failed" listeners="org.testng.reporters.VerboseReporter" methods="${testng.methods.arg}" mode="${testng.mode}" outputdir="${build.test.results.dir}" suitename="opengrok-web-nbproject" testname="TestNG tests" workingDir="${basedir}">
449461
<xmlfileset dir="${build.test.classes.dir}" includes="@{testincludes}"/>
450462
<propertyset>
451463
<propertyref prefix="test-sys-prop."/>
@@ -947,28 +959,28 @@ exists or setup the property manually. For example like this:
947959
<dirname file="${dist.war}" property="dist.jar.dir"/>
948960
<mkdir dir="${dist.jar.dir}"/>
949961
<jar compress="${jar.compress}" jarfile="${dist.war}">
950-
<fileset dir="${build.web.dir}" excludes="WEB-INF/classes/.netbeans_*"/>
962+
<fileset dir="${build.web.dir}" excludes="WEB-INF/classes/.netbeans_*,${dist.archive.excludes}"/>
951963
</jar>
952964
</target>
953965
<target depends="init,compile,compile-jsps,-pre-dist" if="do.war.package.with.custom.manifest" name="-do-dist-with-manifest">
954966
<dirname file="${dist.war}" property="dist.jar.dir"/>
955967
<mkdir dir="${dist.jar.dir}"/>
956968
<jar compress="${jar.compress}" jarfile="${dist.war}" manifest="${build.meta.inf.dir}/MANIFEST.MF">
957-
<fileset dir="${build.web.dir}" excludes="WEB-INF/classes/.netbeans_*"/>
969+
<fileset dir="${build.web.dir}" excludes="WEB-INF/classes/.netbeans_*,${dist.archive.excludes}"/>
958970
</jar>
959971
</target>
960972
<target depends="init,compile,compile-jsps,-pre-dist" if="do.tmp.war.package.without.custom.manifest" name="-do-tmp-dist-without-manifest">
961973
<dirname file="${dist.war}" property="dist.jar.dir"/>
962974
<mkdir dir="${dist.jar.dir}"/>
963975
<jar compress="${jar.compress}" jarfile="${dist.war}">
964-
<fileset dir="${build.web.dir}" excludes="WEB-INF/classes/.netbeans_*"/>
976+
<fileset dir="${build.web.dir}" excludes="WEB-INF/classes/.netbeans_*,${dist.archive.excludes}"/>
965977
</jar>
966978
</target>
967979
<target depends="init,compile,compile-jsps,-pre-dist" if="do.tmp.war.package.with.custom.manifest" name="-do-tmp-dist-with-manifest">
968980
<dirname file="${dist.war}" property="dist.jar.dir"/>
969981
<mkdir dir="${dist.jar.dir}"/>
970982
<jar compress="${jar.compress}" jarfile="${dist.war}" manifest="${build.meta.inf.dir}/MANIFEST.MF">
971-
<fileset dir="${build.web.dir}" excludes="WEB-INF/classes/.netbeans_*"/>
983+
<fileset dir="${build.web.dir}" excludes="WEB-INF/classes/.netbeans_*,${dist.archive.excludes}"/>
972984
</jar>
973985
</target>
974986
<target depends="init,compile,compile-jsps,-pre-dist,-do-dist-with-manifest,-do-dist-without-manifest" name="do-dist"/>
@@ -1003,7 +1015,7 @@ exists or setup the property manually. For example like this:
10031015
<dirname file="${dist.ear.war}" property="dist.jar.dir"/>
10041016
<mkdir dir="${dist.jar.dir}"/>
10051017
<jar compress="${jar.compress}" jarfile="${dist.ear.war}" manifest="${build.web.dir}/META-INF/MANIFEST.MF">
1006-
<fileset dir="${build.web.dir}" excludes="WEB-INF/classes/.netbeans_*"/>
1018+
<fileset dir="${build.web.dir}" excludes="WEB-INF/classes/.netbeans_*,${dist.archive.excludes}"/>
10071019
</jar>
10081020
</target>
10091021
<target name="-post-dist">
@@ -1052,18 +1064,32 @@ exists or setup the property manually. For example like this:
10521064
<target depends="init,-pre-dist,dist,-post-dist" name="verify">
10531065
<nbverify file="${dist.war}"/>
10541066
</target>
1055-
<target depends="run-deploy,-init-display-browser,-display-browser-nb,-display-browser-cl" name="run-display-browser"/>
1067+
<target depends="run-deploy,-init-display-browser,-display-browser-nb-old,-display-browser-nb,-display-browser-cl" name="run-display-browser"/>
10561068
<target if="do.display.browser" name="-init-display-browser">
1069+
<condition property="do.display.browser.nb.old">
1070+
<and>
1071+
<isset property="netbeans.home"/>
1072+
<not>
1073+
<isset property="browser.context"/>
1074+
</not>
1075+
</and>
1076+
</condition>
10571077
<condition property="do.display.browser.nb">
1058-
<isset property="netbeans.home"/>
1078+
<and>
1079+
<isset property="netbeans.home"/>
1080+
<isset property="browser.context"/>
1081+
</and>
10591082
</condition>
10601083
<condition property="do.display.browser.cl">
10611084
<isset property="deploy.ant.enabled"/>
10621085
</condition>
10631086
</target>
1064-
<target if="do.display.browser.nb" name="-display-browser-nb">
1087+
<target if="do.display.browser.nb.old" name="-display-browser-nb-old">
10651088
<nbbrowse url="${client.url}"/>
10661089
</target>
1090+
<target if="do.display.browser.nb" name="-display-browser-nb">
1091+
<nbbrowse context="${browser.context}" url="${client.url}" urlPath="${client.urlPart}"/>
1092+
</target>
10671093
<target if="do.display.browser.cl" name="-get-browser" unless="browser">
10681094
<condition property="browser" value="rundll32">
10691095
<os family="windows"/>
@@ -1131,6 +1157,7 @@ exists or setup the property manually. For example like this:
11311157
<nbstartserver debugmode="true"/>
11321158
<antcall target="connect-debugger"/>
11331159
<nbdeploy clientUrlPart="${client.urlPart}" debugmode="true" forceRedeploy="true"/>
1160+
<antcall target="debug-display-browser-old"/>
11341161
<antcall target="debug-display-browser"/>
11351162
<antcall target="connect-client-debugger"/>
11361163
</target>
@@ -1147,9 +1174,12 @@ exists or setup the property manually. For example like this:
11471174
</sourcepath>
11481175
</nbjpdaconnect>
11491176
</target>
1150-
<target if="do.display.browser.debug" name="debug-display-browser">
1177+
<target if="do.display.browser.debug.old" name="debug-display-browser-old">
11511178
<nbbrowse url="${client.url}"/>
11521179
</target>
1180+
<target if="do.display.browser.debug" name="debug-display-browser">
1181+
<nbbrowse context="${browser.context}" url="${client.url}" urlPath="${client.urlPart}"/>
1182+
</target>
11531183
<target if="do.debug.client" name="connect-client-debugger">
11541184
<webproject1:nbjsdebugstart webUrl="${client.url}"/>
11551185
</target>
@@ -1244,6 +1274,7 @@ exists or setup the property manually. For example like this:
12441274
<startprofiler/>
12451275
<nbstartserver profilemode="true"/>
12461276
<nbdeploy clientUrlPart="${client.urlPart}" forceRedeploy="true" profilemode="true"/>
1277+
<antcall target="debug-display-browser-old"/>
12471278
<antcall target="debug-display-browser"/>
12481279
<antcall target="-profile-start-loadgen"/>
12491280
</target>

src/org/opensolaris/opengrok/index/IndexDatabase.java

+2
Original file line numberDiff line numberDiff line change
@@ -1078,6 +1078,8 @@ public static Definitions getDefinitions(File file)
10781078
throws IOException, ParseException, ClassNotFoundException {
10791079
RuntimeEnvironment env = RuntimeEnvironment.getInstance();
10801080
String path = env.getPathRelativeToSourceRoot(file, 0);
1081+
//sanitize windows path delimiters
1082+
path=path.replace("\\", "/");
10811083

10821084
IndexReader ireader = getIndexReader(path);
10831085

test/org/opensolaris/opengrok/index/IndexDatabaseTest.java

+9
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,15 @@ public void testGetDefinitions() throws Exception {
7777
assertTrue(defs1.hasSymbol("a"));
7878
assertFalse(defs1.hasSymbol("b"));
7979
assertTrue(defs1.hasDefinitionAt("foobar", 1, new String[1]));
80+
81+
//same for windows delimiters
82+
f1 = new File(repository.getSourceRoot() + "\\c\\foobar.c");
83+
defs1 = IndexDatabase.getDefinitions(f1);
84+
assertNotNull(defs1);
85+
assertTrue(defs1.hasSymbol("foobar"));
86+
assertTrue(defs1.hasSymbol("a"));
87+
assertFalse(defs1.hasSymbol("b"));
88+
assertTrue(defs1.hasDefinitionAt("foobar", 1, new String[1]));
8089

8190
// Test that we get null back if we request definitions for a file
8291
// that's not in the repository.

web/help.jsp

+3-3
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ A <dfn>Query</dfn> is a series of clauses. A clause may be prefixed by:</p>
119119
e.g. /[mb]an/ - will search for man or for ban;<br>
120120
NOTE: path field search escapes "/" by default, so it only supports
121121
regexps when the search string <u>starts and ends</u> with "/".<br>
122-
More info can be found on <a href="http://lucene.apache.org/core/4_3_1/core/org/apache/lucene/util/automaton/RegExp.html?is-external=true">lucene regexp page</a>.
122+
More info can be found on <a href="http://lucene.apache.org/core/4_5_0/core/org/apache/lucene/util/automaton/RegExp.html?is-external=true">lucene regexp page</a>.
123123
</li>
124124
<li>to perform a single character wildcard search use the "<b>?</b>" symbol,
125125
e.g. te?t</li>
@@ -173,7 +173,7 @@ So searching for <b>\+1</b> or <b>\+ 1</b> will both find <b>+1</b> and <b>+ 1</
173173
<dd>Only finds symbols (e.g. methods, classes, functions, variables).</dd>
174174

175175
<dt>path</dt>
176-
<dd>path of the source file (no need to use dividers).</dd>
176+
<dd>path of the source file (no need to use dividers, or if, then use "/" - Windows users, "\" is an escape key in lucene query syntax! Please don't use "\", or replace it with "/".).</dd>
177177

178178
<dt>hist</dt>
179179
<dd>History log comments.</dd>
@@ -189,7 +189,7 @@ the term (phrases) can be boosted (making it more relevant) using a caret
189189
</p>
190190

191191
<p>Opengrok search is powered by <a href="http://lucene.apache.org/"
192-
>lucene</a>, for more detail on query syntax refer to <a href="http://lucene.apache.org/core/4_3_1/queryparser/org/apache/lucene/queryparser/classic/package-summary.html#package_description">lucene docs</a>.<br>
192+
>lucene</a>, for more detail on query syntax refer to <a href="http://lucene.apache.org/core/4_5_0/queryparser/org/apache/lucene/queryparser/classic/package-summary.html#package_description">lucene docs</a>.<br>
193193
</p>
194194
</div>
195195
<%

0 commit comments

Comments
 (0)