mirror of
https://github.com/tiennm99/lombok.git
synced 2026-10-14 12:16:49 +00:00
Fix for reported NPEs by Stephen Haberman.
This commit is contained in:
1 parent
ffedb71cb5
commit
16a24525bf
2 files changed
+5
-1
No files matched your search
@@ -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() {
|
||||
|
||||
@@ -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;
|
||||
|
||||
Reference in new issue
Block a user