|
From: <caw...@us...> - 2007-05-29 13:45:47
|
Revision: 2548
http://svn.sourceforge.net/rubyeclipse/?rev=2548&view=rev
Author: cawilliams
Date: 2007-05-29 06:45:45 -0700 (Tue, 29 May 2007)
Log Message:
-----------
try to capture more information in the logs about when we might hit problems parsing out local gem info
Modified Paths:
--------------
trunk/com.aptana.rdt/src/com/aptana/rdt/internal/core/gems/GemManager.java
Modified: trunk/com.aptana.rdt/src/com/aptana/rdt/internal/core/gems/GemManager.java
===================================================================
--- trunk/com.aptana.rdt/src/com/aptana/rdt/internal/core/gems/GemManager.java 2007-05-29 13:22:45 UTC (rev 2547)
+++ trunk/com.aptana.rdt/src/com/aptana/rdt/internal/core/gems/GemManager.java 2007-05-29 13:45:45 UTC (rev 2548)
@@ -322,24 +322,29 @@
private Set<Gem> parseOutGems(List<String> lines) {
Set<Gem> gems = new HashSet<Gem>();
for (int i = 0; i < lines.size();) {
- String nameAndVersion = lines.get(i);
- String description = lines.get(i + 1);
- int j = 2;
- if ((i + 2) < lines.size()) {
- String nextLine = lines.get(i + 2);
- while (nextLine.trim().length() != 0) {
- j++;
- description += " " + nextLine.trim();
- nextLine = lines.get(i + j);
+ try {
+ String nameAndVersion = lines.get(i);
+ String description = lines.get(i + 1);
+ int j = 2;
+ if ((i + 2) < lines.size()) {
+ String nextLine = lines.get(i + 2);
+ while (nextLine.trim().length() != 0) {
+ j++;
+ description += " " + nextLine.trim();
+ nextLine = lines.get(i + j);
+ }
}
+ int openParen = nameAndVersion.indexOf('(');
+ int closeParen = nameAndVersion.indexOf(')');
+ String name = nameAndVersion.substring(0, openParen);
+ String version = nameAndVersion
+ .substring(openParen + 1, closeParen);
+ gems.add(new Gem(name.trim(), version, description.trim()));
+ i += (j + 1);
+ } catch (RuntimeException e) {
+ AptanaRDTPlugin.log(new IllegalStateException("Was unable to parse local gems correctly from: " + lines.toString()));
+ AptanaRDTPlugin.log(e);
}
- int openParen = nameAndVersion.indexOf('(');
- int closeParen = nameAndVersion.indexOf(')');
- String name = nameAndVersion.substring(0, openParen);
- String version = nameAndVersion
- .substring(openParen + 1, closeParen);
- gems.add(new Gem(name.trim(), version, description.trim()));
- i += (j + 1);
}
return gems;
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|