~ubuntu-branches/ubuntu/wily/aspectj/wily-proposed

« back to all changes in this revision

Viewing changes to org.aspectj/modules/weaver/src/org/aspectj/weaver/bcel/Range.java

  • Committer: Bazaar Package Importer
  • Author(s): Damien Raude-Morvan
  • Date: 2011-03-15 23:54:31 UTC
  • mfrom: (1.2.5 upstream)
  • mto: This revision was merged to the branch mainline in revision 9.
  • Revision ID: james.westby@ubuntu.com-20110315235431-iq2gxbsx08kpwuiw
* New upstream release.
* Updated Standards-Version to 3.9.1 (no changes needed).
* Fix local Javadoc links:
  - d/patches/07_javadoc_links.diff: Use locally installed
   javadoc packages and hyperlink with them.
  - d/control: Add B-D on default-java-doc and libasm3-java-doc.
* d/control: Drop B-D on itself (our new bootstrap infrastructure doesn't need
  that anymore).
* Split packages into :
  - aspectj: only contains CLI tools.
  - libaspectj-java: JAR librairies for /usr/share/java.
  - libaspectj-java-doc: 4 API's Javadoc.
  - aspectj-doc: Programming Guides and SDK Documentation.

Show diffs side-by-side

added added

removed removed

Lines of Context:
54
54
                // System.err.println("  looking for " + end);
55
55
                while (ih != end) {
56
56
                        // System.err.println("    ih " + ih);
57
 
                        if (!Range.isRangeHandle(ih))
 
57
                        if (!Range.isRangeHandle(ih)) {
58
58
                                return false;
 
59
                        }
59
60
                        ih = ih.getNext();
60
61
                }
61
62
                return true;
143
144
        }
144
145
 
145
146
        static InstructionHandle genStart(InstructionList body, InstructionHandle ih) {
146
 
                if (ih == null)
 
147
                if (ih == null) {
147
148
                        return genStart(body);
 
149
                }
148
150
                InstructionHandle freshIh = body.insert(ih, Range.RANGEINSTRUCTION);
149
151
                setLineNumberFromNext(freshIh);
150
152
                return freshIh;
151
153
        }
152
154
 
153
155
        static InstructionHandle genEnd(InstructionList body, InstructionHandle ih) {
154
 
                if (ih == null)
 
156
                if (ih == null) {
155
157
                        return genEnd(body);
 
158
                }
156
159
                return body.append(ih, Range.RANGEINSTRUCTION);
157
160
        }
158
161
 
168
171
 
169
172
        protected void updateTarget(InstructionHandle old_ih, InstructionHandle new_ih, InstructionList new_il) {
170
173
                old_ih.removeTargeter(this);
171
 
                if (new_ih != null)
 
174
                if (new_ih != null) {
172
175
                        new_ih.addTargeter(this);
 
176
                }
173
177
                body = new_il;
174
178
 
175
179
                if (old_ih == start) {
181
185
        }
182
186
 
183
187
        public static final boolean isRangeHandle(InstructionHandle ih) {
184
 
                if (ih == null)
 
188
                if (ih == null) {
185
189
                        return false;
 
190
                }
186
191
                return ih.getInstruction() == Range.RANGEINSTRUCTION;
187
192
        }
188
193
 
189
194
        protected static final Range getRange(InstructionHandle ih) {
190
195
                // assert isRangeHandle(ih)
191
196
                Range ret = null;
192
 
                Iterator tIter = ih.getTargeters().iterator();
 
197
                Iterator<InstructionTargeter> tIter = ih.getTargeters().iterator();
193
198
                while (tIter.hasNext()) {
194
 
                        InstructionTargeter targeter = (InstructionTargeter) tIter.next();
 
199
                        InstructionTargeter targeter = tIter.next();
195
200
                        if (targeter instanceof Range) {
196
201
                                Range r = (Range) targeter;
197
 
                                if (r.getStart() != ih && r.getEnd() != ih)
 
202
                                if (r.getStart() != ih && r.getEnd() != ih) {
198
203
                                        continue;
199
 
                                if (ret != null)
 
204
                                }
 
205
                                if (ret != null) {
200
206
                                        throw new BCException("multiple ranges on same range handle: " + ret + ",  " + targeter);
 
207
                                }
201
208
                                ret = r;
202
209
                        }
203
210
                }