Bug 40205 automatically insert closing brace: does not handle '//' in strings
200307150800 1. Try this snippet { String s= "//"; void m() <CURSOR> } 2. Insert an opening brace 3. Press <ENTER> The expected closing brace does not get inserted
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/text/java/JavaAutoIndentStrategy.java
contents.append(source);
			contents.append('}');
			
			char[] buffer= contents.toString().toCharArray();
	
			return new CompilationUnitInfo(buffer, sourceRange.getOffset() - methodOffset);
	
		} catch (BadLocationException e) {
			JavaPlugin.log(e);
		}
	
		return null;
	}
	
	private static boolean areBlocksConsistent(IDocument document, int offset) {
		JavaCodeReader reader= new JavaCodeReader();
		try { 
			int begin= offset;
			int end= offset;
			
			while (true) {
				begin= searchForOpeningPeer(reader, begin, '{', '}', document);
				end= searchForClosingPeer(reader, end, '{', '}', document);
				if (begin == -1 && end == -1)
					return true;
				if (begin == -1 || end == -1)
					return false;
			}
		} catch (IOException e) {
			return false;