package com.xtremelabs.robolectric.shadows;

import android.widget.RelativeLayout;
import com.xtremelabs.robolectric.internal.Implementation;
import com.xtremelabs.robolectric.internal.Implements;

/**
 * Shadow for {@link android.view.ViewGroup.MarginLayoutParams} that simulates its implementation.
 */
@SuppressWarnings("UnusedDeclaration")
@Implements(RelativeLayout.LayoutParams.class)
public class ShadowRelativeLayoutParams extends ShadowMarginLayoutParams {
    int rules[] = new int[16]; // not the right way to do this

    @Implementation
    public void addRule(int verb) {
        addRule(verb, -1);
    }

    @Implementation
    public void addRule(int verb, int anchor) {
        rules[verb] = anchor;
    }

    @Implementation
    public int[] getRules() {
        return rules;
    }
}

@@ -467,66 +467,190 @@
     
-int rules%5B%5D = new int%5B16%5D; // not the right way to do this
+// VERB_COUNT is defined in RelativeLayout.java and is private, so we duplicate it here.%0A    private static final int VERB_COUNT = 16;%0A%0A    private int rules%5B%5D = new int%5BVERB_COUNT%5D;
 %0A%0A  

Spell out where VERB_COUNT comes from.