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 118926 Details for
Bug 256735
Marker property value is too long for internal compiler error (java.lang.StackOverflowError)
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
[patch]
Proposed patch v3
256735.txt (text/plain), 4.14 KB, created by
Philipe Mulet
on 2008-11-27 11:08:42 EST
(
hide
)
Description:
Proposed patch v3
Filename:
MIME Type:
Creator:
Philipe Mulet
Created:
2008-11-27 11:08:42 EST
Size:
4.14 KB
patch
obsolete
>### Eclipse Workspace Patch 1.0 >#P org.eclipse.jdt.core >Index: compiler/org/eclipse/jdt/internal/compiler/util/Util.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/util/Util.java,v >retrieving revision 1.68 >diff -u -r1.68 Util.java >--- compiler/org/eclipse/jdt/internal/compiler/util/Util.java 27 Jun 2008 16:04:05 -0000 1.68 >+++ compiler/org/eclipse/jdt/internal/compiler/util/Util.java 27 Nov 2008 16:07:02 -0000 >@@ -18,6 +18,8 @@ > import java.io.IOException; > import java.io.InputStream; > import java.io.InputStreamReader; >+import java.io.PrintWriter; >+import java.io.StringWriter; > import java.io.UnsupportedEncodingException; > import java.util.StringTokenizer; > import java.util.zip.ZipEntry; >@@ -427,6 +429,42 @@ > return contents; > } > >+ /** >+ * Returns a one line summary for an exception (extracted from its stacktrace: name + first frame) >+ * @param exception >+ * @return one line summary for an exception >+ */ >+ public static String getExceptionSummary(Throwable exception) { >+ StringWriter stringWriter = new StringWriter(); >+ exception.printStackTrace(new PrintWriter(stringWriter)); >+ StringBuffer buffer = stringWriter.getBuffer(); >+ StringBuffer exceptionBuffer = new StringBuffer(50); >+ exceptionBuffer.append(exception.toString()); >+ // only keep leading frame portion of the trace (i.e. line no. 2 from the stacktrace) >+ lookupLine2: for (int i = 0, lineSep = 0, max = buffer.length(), line2Start = 0; i < max; i++) { >+ switch (buffer.charAt(i)) { >+ case '\n': >+ case '\r' : >+ if (line2Start > 0) { >+ exceptionBuffer.append(' ').append(buffer.substring(line2Start, i)); >+ break lookupLine2; >+ } >+ lineSep++; >+ break; >+ case ' ' : >+ case '\t' : >+ break; >+ default : >+ if (lineSep > 0) { >+ line2Start = i; >+ lineSep = 0; >+ } >+ break; >+ } >+ } >+ return exceptionBuffer.toString(); >+ } >+ > public static int getLineNumber(int position, int[] lineEnds, int g, int d) { > if (lineEnds == null) > return 1; >Index: compiler/org/eclipse/jdt/internal/compiler/messages.properties >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/messages.properties,v >retrieving revision 1.10 >diff -u -r1.10 messages.properties >--- compiler/org/eclipse/jdt/internal/compiler/messages.properties 27 May 2008 22:21:14 -0000 1.10 >+++ compiler/org/eclipse/jdt/internal/compiler/messages.properties 27 Nov 2008 16:07:02 -0000 >@@ -20,7 +20,7 @@ > compilation_done = [completed {2} - #{0}/{1}] > compilation_units = [{0} units compiled] > compilation_unit = [{0} unit compiled] >-compilation_internalError = Internal compiler error >+compilation_internalError = Internal compiler error: {0} > compilation_beginningToCompile=Beginning to compile > compilation_processing=Processing {0} > >Index: compiler/org/eclipse/jdt/internal/compiler/Compiler.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/Compiler.java,v >retrieving revision 1.109 >diff -u -r1.109 Compiler.java >--- compiler/org/eclipse/jdt/internal/compiler/Compiler.java 27 Jun 2008 16:04:07 -0000 1.109 >+++ compiler/org/eclipse/jdt/internal/compiler/Compiler.java 27 Nov 2008 16:07:02 -0000 >@@ -557,15 +557,10 @@ > boolean needToPrint = true; > if (result != null) { > /* create and record a compilation problem */ >- StringWriter stringWriter = new StringWriter(); >- PrintWriter writer = new PrintWriter(stringWriter); >- internalException.printStackTrace(writer); >- StringBuffer buffer = stringWriter.getBuffer(); >- >+ // only keep leading portion of the trace > String[] pbArguments = new String[] { >- Messages.compilation_internalError >- + "\n" //$NON-NLS-1$ >- + buffer.toString()}; >+ Messages.bind(Messages.compilation_internalError, Util.getExceptionSummary(internalException)), >+ }; > > result > .record(
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 256735
:
118874
|
118892
| 118926