[prev in list] [next in list] [prev in thread] [next in thread] 

List:       groovy-scm
Subject:    [groovy-scm] [scm-git][3/8] GROOVY-6412: CLONE - Incorrect parameter for annotations throws compilat
From:       Paul King <git () codehaus ! org>
Date:       2014-05-31 20:56:40
Message-ID: 20140531205640.2B8ECB10BA () codehaus01 ! managed ! contegix ! com
[Download RAW message or body]

commit 66ab413c76a4ac15fcc3f2fe0507455961fd189a
Author:     Paul King <paulk@asert.com.au>
AuthorDate: Thu, 29 May 2014 19:40:17 +1000
Commit:     Paul King <paulk@asert.com.au>
CommitDate: Thu, 29 May 2014 19:40:17 +1000

    GROOVY-6412: CLONE - Incorrect parameter for annotations throws compilation \
exception with obfuscated message

diff --git a/src/main/org/codehaus/groovy/vmplugin/v5/Java5.java \
b/src/main/org/codehaus/groovy/vmplugin/v5/Java5.java index 9bea21d..69abb90 100644
--- a/src/main/org/codehaus/groovy/vmplugin/v5/Java5.java
+++ b/src/main/org/codehaus/groovy/vmplugin/v5/Java5.java
@@ -227,6 +227,7 @@ public class Java5 implements VMPlugin {
             ListExpression le = (ListExpression) exp;
             int bitmap = 0;
             for (Expression e : le.getExpressions()) {
+                if (!(e instanceof PropertyExpression)) return;
                 PropertyExpression element = (PropertyExpression) e;
                 String name = element.getPropertyAsString();
                 ElementType value = ElementType.valueOf(name);


[Attachment #3 (text/html)]

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" \
"http://www.w3.org/TR/REC-html40/loose.dtd"> <html style="font-size: 12px;">
<head><meta http-equiv="Content-type" content="text/html; charset=utf-8"></head>
<body style="font-size: 12px;">
<style type="text/css">
dt:after { content: ':' !important; }
> </style>
<dl class="title" style="font-size: 12px; font-family: Verdana; background-color: \
#ddd; padding: 10px;"> <dt style="font-size: 12px; float: left; font-weight: bold; \
min-width: 6em;">Commit</dt> <dd style="font-size: \
12px;">66ab413c76a4ac15fcc3f2fe0507455961fd189a</dd> <dt style="font-size: 12px; \
float: left; font-weight: bold; min-width: 6em;">Branch</dt> <dd style="font-size: \
12px;">master</dd> <dt style="font-size: 12px; float: left; font-weight: bold; \
min-width: 6em;">Author</dt> <dd style="font-size: 12px;">Paul King \
&lt;paulk@asert.com.au&gt;</dd> <dt style="font-size: 12px; float: left; font-weight: \
bold; min-width: 6em;">Date</dt> <dd style="font-size: 12px;">Thu, 29 May 2014 \
19:40:17 +1000</dd> <dt style="font-size: 12px; float: left; font-weight: bold; \
min-width: 6em;">Message</dt> <dd class="" style="font-size: 12px;">GROOVY-6412: \
CLONE - Incorrect parameter for annotations throws compilation exception with \
obfuscated message</dd> </dl>
<h2 id="src/main/org/codehaus/groovy/vmplugin/v5/Java5.java" style="font-size: 12px; \
font-family: Verdana; font-weight: bold; line-height: 25px; margin-bottom: 2px; \
padding-left: 5px; background-color: #bbb;">Changed file \
src/main/org/codehaus/groovy/vmplugin/v5/Java5.java</h2>

<table style="font-size: 12px; width: 100%; border-collapse: collapse;">
<tr style="font-size: 12px;">
<td class="ln" style="font-size: 12px; color: #000; font-family: 'Bitstream Vera Sans \
Mono','Monaco','Courier',monospace; width: 23px; text-align: right; background-color: \
#ccc;" align="right" bgcolor="#ccc">227</td> <td class="ln" style="font-size: 12px; \
color: #000; font-family: 'Bitstream Vera Sans Mono','Monaco','Courier',monospace; \
width: 23px; text-align: right; background-color: #ccc;" align="right" \
bgcolor="#ccc">227</td> <td style="font-size: 12px; color: #000; font-family: \
'Bitstream Vera Sans Mono','Monaco','Courier',monospace;">                          \
ListExpression  le  =  (ListExpression)  exp; </td>
</tr>
<tr style="font-size: 12px;">
<td class="ln" style="font-size: 12px; color: #000; font-family: 'Bitstream Vera Sans \
Mono','Monaco','Courier',monospace; width: 23px; text-align: right; background-color: \
#ccc;" align="right" bgcolor="#ccc">228</td> <td class="ln" style="font-size: 12px; \
color: #000; font-family: 'Bitstream Vera Sans Mono','Monaco','Courier',monospace; \
width: 23px; text-align: right; background-color: #ccc;" align="right" \
bgcolor="#ccc">228</td> <td style="font-size: 12px; color: #000; font-family: \
'Bitstream Vera Sans Mono','Monaco','Courier',monospace;">                          \
int  bitmap  =  0; </td>
</tr>
<tr style="font-size: 12px;">
<td class="ln" style="font-size: 12px; color: #000; font-family: 'Bitstream Vera Sans \
Mono','Monaco','Courier',monospace; width: 23px; text-align: right; background-color: \
#ccc;" align="right" bgcolor="#ccc">229</td> <td class="ln" style="font-size: 12px; \
color: #000; font-family: 'Bitstream Vera Sans Mono','Monaco','Courier',monospace; \
width: 23px; text-align: right; background-color: #ccc;" align="right" \
bgcolor="#ccc">229</td> <td style="font-size: 12px; color: #000; font-family: \
'Bitstream Vera Sans Mono','Monaco','Courier',monospace;">                          \
for  (Expression  e  :  le.getExpressions())  { </td>
</tr>
<tr class="a" style="font-size: 12px; background-color: #dfd;" bgcolor="#dfd">
<td class="ln" style="font-size: 12px; color: #000; font-family: 'Bitstream Vera Sans \
Mono','Monaco','Courier',monospace; width: 23px; text-align: right; background-color: \
#ccc;" align="right" bgcolor="#ccc"></td> <td class="ln" style="font-size: 12px; \
color: #000; font-family: 'Bitstream Vera Sans Mono','Monaco','Courier',monospace; \
width: 23px; text-align: right; background-color: #ccc;" align="right" \
bgcolor="#ccc">230</td> <td style="font-size: 12px; color: #000; font-family: \
'Bitstream Vera Sans Mono','Monaco','Courier',monospace;">                            \
if  (!(e  instanceof  PropertyExpression))  return; </td>
</tr>
<tr style="font-size: 12px;">
<td class="ln" style="font-size: 12px; color: #000; font-family: 'Bitstream Vera Sans \
Mono','Monaco','Courier',monospace; width: 23px; text-align: right; background-color: \
#ccc;" align="right" bgcolor="#ccc">230</td> <td class="ln" style="font-size: 12px; \
color: #000; font-family: 'Bitstream Vera Sans Mono','Monaco','Courier',monospace; \
width: 23px; text-align: right; background-color: #ccc;" align="right" \
bgcolor="#ccc">231</td> <td style="font-size: 12px; color: #000; font-family: \
'Bitstream Vera Sans Mono','Monaco','Courier',monospace;">                            \
PropertyExpression  element  =  (PropertyExpression)  e; </td>
</tr>
<tr style="font-size: 12px;">
<td class="ln" style="font-size: 12px; color: #000; font-family: 'Bitstream Vera Sans \
Mono','Monaco','Courier',monospace; width: 23px; text-align: right; background-color: \
#ccc;" align="right" bgcolor="#ccc">231</td> <td class="ln" style="font-size: 12px; \
color: #000; font-family: 'Bitstream Vera Sans Mono','Monaco','Courier',monospace; \
width: 23px; text-align: right; background-color: #ccc;" align="right" \
bgcolor="#ccc">232</td> <td style="font-size: 12px; color: #000; font-family: \
'Bitstream Vera Sans Mono','Monaco','Courier',monospace;">                            \
String  name  =  element.getPropertyAsString(); </td>
</tr>
<tr style="font-size: 12px;">
<td class="ln" style="font-size: 12px; color: #000; font-family: 'Bitstream Vera Sans \
Mono','Monaco','Courier',monospace; width: 23px; text-align: right; background-color: \
#ccc;" align="right" bgcolor="#ccc">232</td> <td class="ln" style="font-size: 12px; \
color: #000; font-family: 'Bitstream Vera Sans Mono','Monaco','Courier',monospace; \
width: 23px; text-align: right; background-color: #ccc;" align="right" \
bgcolor="#ccc">233</td> <td style="font-size: 12px; color: #000; font-family: \
'Bitstream Vera Sans Mono','Monaco','Courier',monospace;">                            \
ElementType  value  =  ElementType.valueOf(name); </td>
</tr>
</table>
<br style="font-size: 12px;"><br style="font-size: 12px;">
</body>
</html>



[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic