### Eclipse Workspace Patch 1.0 #P org.eclipse.jdt.core Index: model/org/eclipse/jdt/internal/core/ClassFileWorkingCopy.java =================================================================== RCS file: /cvsroot/eclipse/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/ClassFileWorkingCopy.java,v retrieving revision 1.53 diff -u -r1.53 ClassFileWorkingCopy.java --- model/org/eclipse/jdt/internal/core/ClassFileWorkingCopy.java 27 Jun 2008 16:03:51 -0000 1.53 +++ model/org/eclipse/jdt/internal/core/ClassFileWorkingCopy.java 4 Sep 2011 21:39:46 -0000 @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2008 IBM Corporation and others. + * Copyright (c) 2000, 2011 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -81,21 +81,18 @@ protected IBuffer openBuffer(IProgressMonitor pm, Object info) throws JavaModelException { // create buffer - IBuffer buffer = this.owner.createBuffer(this); - if (buffer == null) return null; + IBuffer buffer = BufferManager.createBuffer(this); // set the buffer source - if (buffer.getCharacters() == null) { - IBuffer classFileBuffer = this.classFile.getBuffer(); - if (classFileBuffer != null) { - buffer.setContents(classFileBuffer.getCharacters()); - } else { - // Disassemble - IClassFileReader reader = ToolFactory.createDefaultClassFileReader(this.classFile, IClassFileReader.ALL); - Disassembler disassembler = new Disassembler(); - String contents = disassembler.disassemble(reader, Util.getLineSeparator("", getJavaProject()), ClassFileBytesDisassembler.WORKING_COPY); //$NON-NLS-1$ - buffer.setContents(contents); - } + IBuffer classFileBuffer = this.classFile.getBuffer(); + if (classFileBuffer != null) { + buffer.setContents(classFileBuffer.getCharacters()); + } else { + // Disassemble + IClassFileReader reader = ToolFactory.createDefaultClassFileReader(this.classFile, IClassFileReader.ALL); + Disassembler disassembler = new Disassembler(); + String contents = disassembler.disassemble(reader, Util.getLineSeparator("", getJavaProject()), ClassFileBytesDisassembler.WORKING_COPY); //$NON-NLS-1$ + buffer.setContents(contents); } // add buffer to buffer cache #P org.eclipse.jdt.core.tests.model Index: src/org/eclipse/jdt/core/tests/model/WorkingCopyTests.java =================================================================== RCS file: /cvsroot/eclipse/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/WorkingCopyTests.java,v retrieving revision 1.46 diff -u -r1.46 WorkingCopyTests.java --- src/org/eclipse/jdt/core/tests/model/WorkingCopyTests.java 28 Apr 2009 17:49:28 -0000 1.46 +++ src/org/eclipse/jdt/core/tests/model/WorkingCopyTests.java 4 Sep 2011 21:39:48 -0000 @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2009 IBM Corporation and others. + * Copyright (c) 2000, 2011 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -202,8 +202,9 @@ /** * Test creating a working copy on a class file with a customized buffer. + * As of https://bugs.eclipse.org/337935 this test is no longer valid. */ -public void testOnClassFile() throws JavaModelException, IOException { +public void _testOnClassFile() throws JavaModelException, IOException { // ensure the external JCL is copied setupExternalJCL("jclMin");