Download
Getting Started
Members
Projects
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
More
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
Toggle navigation
Bugzilla – Attachment 170635 Details for
Bug 313972
[projection] Java editor randomly crashes when opening certain Java files (throws IllegalStateException)
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read
this important communication.
[patch]
Fix
patch.txt (text/plain), 4.34 KB, created by
Dani Megert
on 2010-06-01 09:43:06 EDT
(
hide
)
Description:
Fix
Filename:
MIME Type:
Creator:
Dani Megert
Created:
2010-06-01 09:43:06 EDT
Size:
4.34 KB
patch
obsolete
>### Eclipse Workspace Patch 1.0 >#P org.eclipse.jdt.ui >Index: ui/org/eclipse/jdt/ui/text/folding/DefaultJavaFoldingStructureProvider.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.jdt.ui/ui/org/eclipse/jdt/ui/text/folding/DefaultJavaFoldingStructureProvider.java,v >retrieving revision 1.31 >diff -u -r1.31 DefaultJavaFoldingStructureProvider.java >--- ui/org/eclipse/jdt/ui/text/folding/DefaultJavaFoldingStructureProvider.java 8 Jul 2009 12:34:22 -0000 1.31 >+++ ui/org/eclipse/jdt/ui/text/folding/DefaultJavaFoldingStructureProvider.java 1 Jun 2010 13:41:39 -0000 >@@ -1,5 +1,5 @@ > /******************************************************************************* >- * Copyright (c) 2006, 2009 IBM Corporation and others. >+ * Copyright (c) 2006, 2010 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 >@@ -58,13 +58,13 @@ > import org.eclipse.jdt.core.IType; > import org.eclipse.jdt.core.JavaCore; > import org.eclipse.jdt.core.JavaModelException; >+import org.eclipse.jdt.core.SourceRange; > import org.eclipse.jdt.core.ToolFactory; > import org.eclipse.jdt.core.compiler.IProblem; > import org.eclipse.jdt.core.compiler.IScanner; > import org.eclipse.jdt.core.compiler.ITerminalSymbols; > import org.eclipse.jdt.core.compiler.InvalidInputException; > import org.eclipse.jdt.core.dom.CompilationUnit; >-import org.eclipse.jdt.core.SourceRange; > > import org.eclipse.jdt.ui.PreferenceConstants; > >@@ -480,12 +480,13 @@ > > if (captionLine < lastLine) { > int postOffset= document.getLineOffset(captionLine + 1); >- IRegion postRegion= new Region(postOffset, offset + length - postOffset); >- >- if (preRegion == null) >- return new IRegion[] { postRegion }; >- >- return new IRegion[] { preRegion, postRegion }; >+ int postLength= offset + length - postOffset; >+ if (postLength > 0) { >+ IRegion postRegion= new Region(postOffset, postLength); >+ if (preRegion == null) >+ return new IRegion[] { postRegion }; >+ return new IRegion[] { preRegion, postRegion }; >+ } > } > > if (preRegion != null) >@@ -611,12 +612,13 @@ > > if (captionLine < lastLine) { > int postOffset= document.getLineOffset(captionLine + 1); >- IRegion postRegion= new Region(postOffset, offset + length - postOffset); >- >- if (preRegion == null) >- return new IRegion[] { postRegion }; >- >- return new IRegion[] { preRegion, postRegion }; >+ int postLength= offset + length - postOffset; >+ if (postLength > 0) { >+ IRegion postRegion= new Region(postOffset, postLength); >+ if (preRegion == null) >+ return new IRegion[] { postRegion }; >+ return new IRegion[] { preRegion, postRegion }; >+ } > } > > if (preRegion != null) >#P org.eclipse.text >Index: projection/org/eclipse/jface/text/projection/ProjectionDocument.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.text/projection/org/eclipse/jface/text/projection/ProjectionDocument.java,v >retrieving revision 1.42 >diff -u -r1.42 ProjectionDocument.java >--- projection/org/eclipse/jface/text/projection/ProjectionDocument.java 22 Mar 2010 17:01:55 -0000 1.42 >+++ projection/org/eclipse/jface/text/projection/ProjectionDocument.java 1 Jun 2010 13:41:41 -0000 >@@ -806,7 +806,7 @@ > Position[] segments= getSegments(); > for (int i= 0; i < segments.length; i++) { > Segment segment= (Segment) segments[i]; >- if (segment.isDeleted() || (segment.getLength() == 0 && i < segments.length - 1)) { >+ if (segment.isDeleted() || (segment.getLength() == 0 && (i < segments.length - 1 || (i > 0 && segments[i - 1].isDeleted())))) { > try { > removePosition(fSegmentsCategory, segment); > fMasterDocument.removePosition(fFragmentsCategory, segment.fragment); >@@ -818,7 +818,9 @@ > Segment next= (Segment) segments[i + 1]; > if (next.isDeleted() || next.getLength() == 0) > continue; >+ > Fragment fragment= segment.fragment; >+ > if (fragment.getOffset() + fragment.getLength() == next.fragment.getOffset()) { > // join fragments and their corresponding segments > segment.setLength(segment.getLength() + next.getLength());
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 313972
:
169554
|
169555
|
169607
|
169727
|
170561
| 170635