aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorReinier Zwitserloot <reinier@zwitserloot.com>2010-11-19 10:26:29 +0100
committerReinier Zwitserloot <reinier@zwitserloot.com>2010-11-19 10:26:29 +0100
commit16a24525bf8c40549ded60678a4c4ec25fce35c5 (patch)
tree6d6545a22522debd94b944c1472671392ee849c1
parentffedb71cb52e32657d0426ef667f701a88f3fb9a (diff)
downloadlombok-16a24525bf8c40549ded60678a4c4ec25fce35c5.tar.gz
lombok-16a24525bf8c40549ded60678a4c4ec25fce35c5.tar.bz2
lombok-16a24525bf8c40549ded60678a4c4ec25fce35c5.zip
Fix for reported NPEs by Stephen Haberman.
-rw-r--r--src/core/lombok/core/Version.java2
-rw-r--r--src/eclipseAgent/lombok/eclipse/agent/PatchVal.java4
2 files changed, 5 insertions, 1 deletions
diff --git a/src/core/lombok/core/Version.java b/src/core/lombok/core/Version.java
index 8bd39dd4..37b1a173 100644
--- a/src/core/lombok/core/Version.java
+++ b/src/core/lombok/core/Version.java
@@ -26,7 +26,7 @@ package lombok.core;
*/
public class Version {
// ** CAREFUL ** - this class must always compile with 0 dependencies (it must not refer to any other sources or libraries).
- private static final String VERSION = "0.10.0-BETA1";
+ private static final String VERSION = "0.10.0-BETA2";
private static final String RELEASE_NAME = "Burning Emu";
private Version() {
diff --git a/src/eclipseAgent/lombok/eclipse/agent/PatchVal.java b/src/eclipseAgent/lombok/eclipse/agent/PatchVal.java
index 84f03115..b93fc4f1 100644
--- a/src/eclipseAgent/lombok/eclipse/agent/PatchVal.java
+++ b/src/eclipseAgent/lombok/eclipse/agent/PatchVal.java
@@ -18,6 +18,8 @@
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
+ *
+ * Thanks to Stephen Haberman for a patch to solve some NPEs in Eclipse.
*/
package lombok.eclipse.agent;
@@ -262,6 +264,7 @@ public class PatchVal {
} else return false;
TypeBinding component = getForEachComponentType(forEach.collection, scope);
+ if (component == null) return false;
TypeReference replacement = Eclipse.makeType(component, forEach.elementVariable.type, false);
forEach.elementVariable.modifiers |= ClassFileConstants.AccFinal;
@@ -274,6 +277,7 @@ public class PatchVal {
private static TypeBinding getForEachComponentType(Expression collection, BlockScope scope) {
if (collection != null) {
TypeBinding resolved = collection.resolveType(scope);
+ if (resolved == null) return null;
if (resolved.isArrayType()) {
resolved = ((ArrayBinding) resolved).elementsType();
return resolved;