Community
Participate
Working Groups
See Bug 367378. When reading a file with an open <head> but no closing </head>, org.eclipse.jface.internal.text.html.HTML2TextReader.read hangs. Here is a simple main class that reproduces the problem: public static void main(String[] args) { StringReader reader = new StringReader("<head>"); char[] cb = new char[20]; try { new org.eclipse.wst.sse.ui.internal.derived.HTML2TextReader(reader, null).read(cb); } catch (IOException e) { e.printStackTrace(); } System.out.println(cb); } The program goes into an infinite loop. Change "<head>" to "<head></head>" and the program terminates as expected. Seems like once an open <head> is found, there needs to be a lookahead performed to see if a close tag exists.
Created attachment 210456 [details] patch Should stop the infinite loop from occurring.
Code checked in.