File: ASTMergerExpected.java

package info (click to toggle)
eclipse-emf 2.5.0-1
  • links: PTS, VCS
  • area: main
  • in suites: squeeze
  • size: 50,912 kB
  • ctags: 60,697
  • sloc: java: 407,889; xml: 7,165; sh: 200; makefile: 13
file content (237 lines) | stat: -rwxr-xr-x 5,492 bytes parent folder | download | duplicates (8)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
/* 
 * source header 
 * 
 */
import java.util.*;
import java.awt.*;

/**
 * Source javadoc
 * set super interfaces
 * set this comment
 * set these flags
 * set this comment
 */
private class EchoSoapBindingImpl extends echo.EchoBindingImpl   implements echo.EchoSource1, EchoSource2 
{
  /*
   * set flags test
   */
  
  /**
   * source javadoc Non-existing fields in target
   */
  public static final double firstNotInTarget = Math.PI;

  public int splitN1 = Math.abs(-1);

  public int splitN2 = 3;

  public int splitN3;

  /**
   * source javadoc: Non-existing field with flags in reversed order
   * (starts with volatile)
   */
  volatile  transient  final static private     double reversedFlagsNotInTarget = 0;

  // target: no flags in target, should be brought from source
  public static final transient volatile int noFlagsInTarget;
  
  // target: many flags, should be removed
  protected final int manyFlagsInTarget = 0;
  
  private int split1 = 1;

  private int split2 = 2;

  // target: split1..3 must be split, all change flags
  private int split3 = 3;
  
  private int split5 = 5;

  /*
   * In JDOM multiple variable declarations can not have javadoc comment 
   * 
   * target non-javadoc: split4..6, split5 must be separated as it changes flag
   * new line of comment
   *  
   * line after empty line
   */
  public int split4 = 4, split6 = 6;  
  
  /*
   * set type test
   */
  
  // target: should change to Object
  Object noFlagsInTargetT;
  
  // target: should change to double
  private static final transient volatile double manyFlagsInTargetT = 0;
  
  public long splitT1 = 1;

  public long splitT2 = 2;

  // target: splitT1..T3 must split, all change types
  public long splitT3 = 3;
  
  public long splitT6 = 6;

  /*
   * target non-javadoc: splitT6 must be separated as it changes type
   */
  public int splitT4 = 4, splitT5 = 5;      
  
  // target: change type
  String stringT = new String();

  // target: change type
  java.lang.String stringLiteralT = "test"; 
  
  // Arrays
  double[]      simpleArrayT = { 1,
    2, 
    3};
  
  /*
   * set initializer test
   */

  /**
   * Source initializer comment
   * set this comment
   * set these flags
   */  
  static {
    System.out.println("Source class level initializer 1 line 1");    
    // begin-user-code
    // target line comment in initializer 1
    System.out.println("Target class level initializer 1 line 2");
    // end-user-code
    System.out.println("Source class level initializer 1 line 3");    
  }
  
  int noFlagsInsourceI = 1;

  // target: 
  int noFlagsInTargetI;
  
  // target: 
  private static final transient volatile int manyFlagsInTargetI;
  
  // target: should not be split, only initializers change
  public int splitI1 = 100, splitI2 = 200, splitI3 = 300;
  
  /**
   *  source javadoc: split I5 since it has a comment
   */
  public int splitI5 = 500;

  /**
   *  target javadoc: split due to setComment
   *  set this comment
   */
  public int splitI4 = 4, splitI6;      
  
  // Objects test
  Object stringI = "1" +
        "2" +
        "3";

  // Objects test 2
  java.lang.Object stringLiteralI = new String("test"); 
  
  // Arrays - no values changed
  int[] simpleArrayI1 = {1, 2,  3};

  // Arrays - only last value changed
  int[] simpleArrayI2 = {1, 2,  4};  
    
  /**
   * Note: JDOM removes final keyword from parameter
   * 
   * target comment
   * @param name
   * @throws java.rmi.RemoteException
   * @generated
   */
  public void hello(java.lang.Source sourceName1, final int[][][] sourceTripleArrayWithSourceName,  
      String paramOnNewLine) throws 
    java.rmi.RemoteException,
    BadAttributeValueExpException,
//  begin-user-code  
    NullPointerException,
    IllegalArgumentException,
//  end-user-code  
    TestS
    
  {
    // begin-user-code
    System.out.println("Source user code 1");
    // end-user-code    
    System.out.println("Source code 2");
    // source code to be overwritten
    return name;
  }
  
  /**
   * Method same as hello(..) but has different parameters
   * 
   * source method comment 1
   * @param sourceName1
   * @throws java.rmi.RemoteException
   * @throws BadAttributeValueExpException
   * @throws NullPointerException
   * @throws IllegalArgumentException
   * @throws TestS
   * 
   */
  public void hello(java.lang.Source sourceName1) throws 
    java.rmi.RemoteException,
    BadAttributeValueExpException,
  //begin-user-code  
    NullPointerException,
    IllegalArgumentException,
  //end-user-code  
    TestS {
    // begin-user-code
    System.out.println("Source user code 3");
    // end-user-code    
    System.out.println("Source code 4");
    // source code to be overwritten
    return name;
  }

  /**
   * target comment 1
   * this comment should not be modified
   * set this comment
   */
  // public void hello1(java.lang.String name) throws java.rmi.RemoteException {/** target */}
  /**
   * source method comment 2
   * 
   * @param name
   * @throws java.rmi.RemoteException
   */
  public void hello1(java.lang.String name) throws java.rmi.RemoteException
  {
//  not generated method, line comment starts at the beginning of the line
    // target comment
    return name;
  }
  
  /**
   * target comment 3
   * @param name
   * @throws java.rmi.RemoteException
   */
  public void hello2(java.lang.String name) throws java.rmi.RemoteException
  {
    // not generated, line comment indented
    // target comment
    return name;
  }
}