Skip to content
This repository was archived by the owner on Jan 30, 2019. It is now read-only.

Commit c1579bd

Browse files
author
coffeys
committed
Fix Bug 6375606 Regression: JavaHelp search highlighting broken in Java 1.5.0_06
svn path=/trunk/; revision=51
1 parent 1bc3c20 commit c1579bd

File tree

4 files changed

+46
-12
lines changed

4 files changed

+46
-12
lines changed

javahelp_nbproject/build.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22
<!--
3-
Copyright (c) 2006 Sun Microsystems, Inc. All Rights Reserved.
3+
Copyright (c) 2007 Sun Microsystems, Inc. All Rights Reserved.
44
DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
55
66
This code is free software; you can redistribute it and/or modify it
@@ -52,7 +52,7 @@ have any questions.
5252

5353

5454
<target name="release-source" description="Build the source zip file">
55-
<property name="version" value="2.0.02"/>
55+
<property name="version" value="2.0.05"/>
5656
<mkdir dir="dist"/>
5757
<zip destfile="dist/javahelp2-src-${version}.zip" >
5858
<zipfileset dir=".." prefix="javahelp2-${version}">

jhMaster/JSearch/indexer/com/sun/java/help/search/HTMLIndexerKit.java

Lines changed: 28 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/*
22
* @(#)HTMLIndexerKit.java 1.26 06/10/30
33
*
4-
* Copyright (c) 2006 Sun Microsystems, Inc. All Rights Reserved.
4+
* Copyright (c) 2007 Sun Microsystems, Inc. All Rights Reserved.
55
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
66
*
77
* This code is free software; you can redistribute it and/or modify it
@@ -827,6 +827,10 @@ class ConvertAction extends TagAction {
827827
}
828828

829829
class AnchorAction extends CharacterAction {
830+
// This class has a dependancy on the "one[0]" character
831+
// used in javax.swing.text.html.HTMLDocument$AnchorAction
832+
// we need to ensure we use the same character value.
833+
private boolean post4207472 = isPost4207472();
830834

831835
public void start(HTML.Tag t, MutableAttributeSet attr) {
832836
// set flag to catch empty anchors
@@ -841,13 +845,34 @@ public void end(HTML.Tag t) {
841845
// named anchor point and we don't want to throw
842846
// it away.
843847
char[] one = new char[1];
844-
one[0] = ' ';
848+
if (post4207472)
849+
one[0] = '\n';
850+
else
851+
one[0] = ' ';
845852
debug ("emptyAnchor currentPos=" + currentPos);
846853
addContent(one, 0, 1);
847-
}
854+
}
848855
// remove tag done in super
849856
super.end(t);
850857
}
858+
private boolean isPost4207472() {
859+
try {
860+
String ver = System.getProperty("java.version");
861+
int major = Integer.parseInt(ver.substring(2,3));
862+
int minor = 0;
863+
// allow for FCS case - we leave minor as 0 if dealing with FCS
864+
if (ver.length() > 6)
865+
minor = Integer.parseInt(ver.substring(6,8));
866+
if ((major > 5 ) || (major==5 && minor >= 4)) {
867+
return true;
868+
} else {
869+
return false;
870+
}
871+
} catch (Exception e) {
872+
debug ("Exception in isPost4207472 : " + e);
873+
return true; // assume true if we encounter problem
874+
}
875+
}
851876
}
852877

853878
class TitleAction extends HiddenAction {

jhMaster/JavaHelp/README

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
README: JavaHelp 2.0_04 Release
1+
README: JavaHelp 2.0_05 Release
22
-------------------------------
3-
September 2006
3+
May 2007
44
Contents:
55

66
* Bug Fixes in this Release
@@ -18,6 +18,10 @@ Contents:
1818
---------------------------------------------------------------------
1919
BUG FIXES IN THIS RELEASE
2020

21+
- Bug 6375606 - Regression: JavaHelp search highlighting broken in Java 1.5.0_06
22+
23+
Bug Fixes in the V2.0_04 release
24+
2125
- Bug 6394203 - ArrayIndexOutOfError thrown on multiple threaded machines under
2226
certian controled circumstances
2327

jhMaster/JavaHelp/README.html

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,16 @@
11
<html>
22
<head>
3-
<title>JavaHelp 2.0_04 README - September 2006</title>
3+
<title>JavaHelp 2.0_05 README - May 2007</title>
44
<link rel="stylesheet" type="text/css" href="readme.css" title="Style">
55
</head>
66
<body>
7-
<h1>README: JavaHelp<sup><font size="-1">TM</font></sup> 2.0_04
8-
- December 2004</h1>
7+
<h1>README: JavaHelp<sup><font size="-1">TM</font></sup> 2.0_05
8+
- May 2007</h1>
99

1010
<h3>Contents: </h3>
1111
<ul>
12-
<li><a href="#204bugfixes">Bug Fixes in this Release</a></li>
12+
<li><a href="#205bugfixes">Bug Fixes in this Release</a></li>
13+
<li><a href="#204bugfixes">Bug Fixes in the 2.0_04 Release</a></li>
1314
<li><a href="#203bugfixes">Bug Fixes in the 2.0_03 Release</a></li>
1415
<li><a href="#202bugfixes">Bug Fixes in the 2.0_02 Release</a></li>
1516
<li><a href="#201bugfixes">Bug Fixes in the 2.0_01 Release</a></li>
@@ -25,7 +26,11 @@ <h3>Contents: </h3>
2526
<li><a href="#Limitations">Limitations and Bugs</a> </li>
2627
<li><a href="#Copyright">Copyright</a> </li>
2728
</ul>
28-
<h2><a name="204bugfixes">Bug Fixes in this Release</a></h2>
29+
<h2><a name="205bugfixes">Bug Fixes in this Release</a></h2>
30+
<ul>
31+
<li>Bug 6375606 - Regression: JavaHelp search highlighting broken in Java 1.5.0_06</li>
32+
</ul>
33+
<h2><a name="204bugfixes">Bug Fixes in the 2.0_04 Release</a></h2>
2934
<ul>
3035
<li>Bug 6394203 - ArrayIndexOutOfError thrown on multiple threaded
3136
machines under certian controled circumstances.</li>

0 commit comments

Comments
 (0)