Bug 54900 [rulers] Java Editor does not show ruler on external Java files
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/javaeditor/CompilationUnitDocumentProvider.java
StringBuffer buffer= new StringBuffer(BUFFER_SIZE);
				char[] readBuffer= new char[READER_CHUNK_SIZE];
				int n;
				try {
					n= in.read(readBuffer);
					while (n > 0) {
						buffer.append(readBuffer, 0, n);
						n= in.read(readBuffer);
					}
				} catch (IOException e) {
					JavaPlugin.log(e);
				}
				cu.getBuffer().setContents(buffer.toString());
				cu.reconcile(AST.JLS3, false, null, getProgressMonitor());
			}
			return cu;
		} catch (CoreException ex) {
			return null;
		}
	}
    private void setUpSynchronization(CompilationUnitInfo cuInfo) {
        IDocument document= cuInfo.fTextFileBuffer.getDocument();
        IAnnotationModel model= cuInfo.fModel;
        if (document instanceof ISynchronizable && model instanceof ISynchronizable) {
            Object lock= ((ISynchronizable) document).getLockObject();
            ((ISynchronizable) model).setLockObject(lock);
        }
    }
    /*
	 * @see org.eclipse.ui.editors.text.TextFileDocumentProvider#disposeFileInfo(java.lang.Object, org.eclipse.ui.editors.text.TextFileDocumentProvider.FileInfo)