Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(78)

Unified Diff: editor/tools/plugins/com.google.dart.tools.core_test/src/com/google/dart/tools/core/mock/MockDelta.java

Issue 11415253: Refactored analysis into a build participant (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 8 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: editor/tools/plugins/com.google.dart.tools.core_test/src/com/google/dart/tools/core/mock/MockDelta.java
===================================================================
--- editor/tools/plugins/com.google.dart.tools.core_test/src/com/google/dart/tools/core/mock/MockDelta.java (revision 15619)
+++ editor/tools/plugins/com.google.dart.tools.core_test/src/com/google/dart/tools/core/mock/MockDelta.java (working copy)
@@ -64,6 +64,16 @@
* @return the new delta
*/
public MockDelta add(MockResource resource, int kind) {
+ if (!(this.resource instanceof MockContainer)) {
+ throw new RuntimeException("Cannot add to a file delta: " + this.resource);
+ }
+ if (resource.getParent() != this.resource) {
+ throw new RuntimeException("Added resource is not a child of the receiver's resource: "
+ + resource);
+ }
+ if (this.kind == ADDED || this.kind == REMOVED) {
+ throw new RuntimeException("Cannot add a delta to a delta marked ADDED or REMOVED");
+ }
MockDelta childDelta = new MockDelta(resource, kind);
if (children == null) {
children = new ArrayList<MockDelta>();

Powered by Google App Engine
This is Rietveld 408576698