From bc8d9862a386d3a2496bffc65c99d8483afd7966 Mon Sep 17 00:00:00 2001 From: Stephan Herrmann Date: Tue, 22 Jan 2019 18:35:38 +0100 Subject: Bug 532145 - [9] NullPointerException when run with JRE 9 Change-Id: I72d65b4a0137c95fec7fdac55db8e576a15011f4 --- .../jdt/internal/compiler/apt/util/EclipseFileManager.java | 8 +++++--- .../eclipse/jdt/internal/compiler/tool/EclipseFileManager.java | 8 +++++--- 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/org.eclipse.jdt.compiler.apt/src/org/eclipse/jdt/internal/compiler/apt/util/EclipseFileManager.java b/org.eclipse.jdt.compiler.apt/src/org/eclipse/jdt/internal/compiler/apt/util/EclipseFileManager.java index b51cb094af..030258c7ef 100644 --- a/org.eclipse.jdt.compiler.apt/src/org/eclipse/jdt/internal/compiler/apt/util/EclipseFileManager.java +++ b/org.eclipse.jdt.compiler.apt/src/org/eclipse/jdt/internal/compiler/apt/util/EclipseFileManager.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2006, 2018 IBM Corporation and others. + * Copyright (c) 2006, 2019 IBM Corporation and others. * * This program and the accompanying materials * are made available under the terms of the Eclipse Public License 2.0 @@ -934,8 +934,10 @@ public class EclipseFileManager implements StandardJavaFileManager { for (Iterator iterator = iterable2.iterator(); iterator.hasNext(); ) { list.add(iterator.next()); } - for (Iterator iterator = iterable.iterator(); iterator.hasNext(); ) { - list.add(iterator.next()); + if (iterable != null) { + for (Iterator iterator = iterable.iterator(); iterator.hasNext(); ) { + list.add(iterator.next()); + } } return list; } diff --git a/org.eclipse.jdt.compiler.tool/src/org/eclipse/jdt/internal/compiler/tool/EclipseFileManager.java b/org.eclipse.jdt.compiler.tool/src/org/eclipse/jdt/internal/compiler/tool/EclipseFileManager.java index 37d9e294ef..05fcedbc18 100644 --- a/org.eclipse.jdt.compiler.tool/src/org/eclipse/jdt/internal/compiler/tool/EclipseFileManager.java +++ b/org.eclipse.jdt.compiler.tool/src/org/eclipse/jdt/internal/compiler/tool/EclipseFileManager.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2006, 2018 IBM Corporation and others. + * Copyright (c) 2006, 2019 IBM Corporation and others. * * This program and the accompanying materials * are made available under the terms of the Eclipse Public License 2.0 @@ -959,8 +959,10 @@ public class EclipseFileManager implements StandardJavaFileManager { for (Iterator iterator = iterable2.iterator(); iterator.hasNext(); ) { list.add(iterator.next()); } - for (Iterator iterator = iterable.iterator(); iterator.hasNext(); ) { - list.add(iterator.next()); + if (iterable != null) { + for (Iterator iterator = iterable.iterator(); iterator.hasNext(); ) { + list.add(iterator.next()); + } } return list; } -- cgit v1.2.3