Projects >> errai >>b871637a889f2528e1ecd4d504d121208e2de190

Chunk
Conflicting content
import java.util.Set;
import java.util.TreeSet;

<<<<<<< HEAD:errai-codegen/src/main/java/org/jboss/errai/codegen/framework/Context.java
import javax.enterprise.util.TypeLiteral;

import org.jboss.errai.codegen.framework.control.branch.Label;
import org.jboss.errai.codegen.framework.control.branch.LabelReference;
import org.jboss.errai.codegen.framework.exception.OutOfScopeException;
import org.jboss.errai.codegen.framework.meta.MetaClass;
import org.jboss.errai.codegen.framework.meta.MetaClassFactory;
import org.jboss.errai.codegen.framework.meta.MetaField;
import org.jboss.errai.codegen.framework.meta.MetaMethod;
import org.jboss.errai.codegen.framework.util.GenUtil;
=======
import org.jboss.errai.codegen.control.branch.Label;
import org.jboss.errai.codegen.control.branch.LabelReference;
import org.jboss.errai.codegen.exception.OutOfScopeException;
import org.jboss.errai.codegen.meta.MetaClass;
import org.jboss.errai.codegen.meta.MetaField;
import org.jboss.errai.codegen.meta.MetaMethod;
import org.jboss.errai.codegen.util.GenUtil;
import org.jboss.errai.common.client.framework.Assert;
>>>>>>> f2af4d2dc2686b08868316271c089b6ecc1156fa:errai-codegen/src/main/java/org/jboss/errai/codegen/Context.java

/**
 * This class represents a context in which {@link Statement}s are generated. 
Solution content
import java.util.Set;
import java.util.TreeSet;

import org.jboss.errai.codegen.control.branch.Label;
import org.jboss.errai.codegen.control.branch.LabelReference;
import org.jboss.errai.codegen.exception.OutOfScopeException;
import org.jboss.errai.codegen.meta.MetaClass;
import org.jboss.errai.codegen.meta.MetaClassFactory;
import org.jboss.errai.codegen.meta.MetaField;
import org.jboss.errai.codegen.meta.MetaMethod;
import org.jboss.errai.codegen.util.GenUtil;
import org.jboss.errai.common.client.framework.Assert;

/**
File
Context.java
Developer's decision
Manual
Kind of conflict
Import
Chunk
Conflicting content
    if (variables == null)
      return Collections. emptyList();

<<<<<<< HEAD:errai-codegen/src/main/java/org/jboss/errai/codegen/framework/Context.java
  public void addLiteralizableClasses(Collection> clazzes) {
    for (Class cls : clazzes) {
      addLiteralizableClass(cls);
    }
  }

  public void addLiteralizableMetaClasses(Collection clazzes) {
    for (MetaClass cls : clazzes) {
      addLiteralizableClass(cls);
    }
  }

  /**
   * Mark a class "literalizable". Meaning that all classes that are assignable to this type, are candidates for
   * reification to code snapshots for this context and all subcontexts. See {@link SnapshotMaker} for further
   * details.
   *
   * @param clazz the class, interface or superclass to be considered literalizable.
   */
  public void addLiteralizableClass(Class clazz) {
    addLiteralizableClass(MetaClassFactory.get(clazz));
  }

  /**
   * Mark a class "literalizable". Meaning that all classes that are assignable to this type, are candidates for
   * reification to code snapshots for this context and all subcontexts. See {@link SnapshotMaker} for further
   * details.
   *
   * @param clazz the class, interface or superclass to be considered literalizable.
   */
  public void addLiteralizableClass(MetaClass clazz) {
    literalizableClasses.add(clazz);
  }

  /**
   * Returns true if the specified class is literalizable.
   *
   * @see #addLiteralizableClass(Class)
   * @param clazz the class, interface or superclass to be tested if literalizable
   * @return true if the specified class is literalizable
   */
  public boolean isLiteralizableClass(final Class clazz) {
    return isLiteralizableClass(MetaClassFactory.get(clazz));
  }

  /**
   * Returns true if the specified class is literalizable.
   *
   * @see #addLiteralizableClass(org.jboss.errai.codegen.framework.meta.MetaClass)
   * @param clazz the class, interface or superclass to be tested if literalizable
   * @return true if the specified class is literalizable
   */
  public boolean isLiteralizableClass(final MetaClass clazz) {
    return getLiteralizableTargetType(clazz) != null;
  }

  /**
   * Returns the literalizable target type for any matching subtype. Meaning, that if say, the type 
   * is a subtype of the interface com.bar.Foo, which is itself marked literalizable, this method will return
   * a reference to the java.lang.Class instance for com.bar.Foo
   *
   * @param clazz the class, interface or superclass to obtain a literalizable target type for.
   * @return the literalizable target type that matches {@param clazz}. If there are no matches, returns null.
   */
  public Class getLiteralizableTargetType(final Class clazz) {
    return getLiteralizableTargetType(MetaClassFactory.get(clazz));
  }

  /**
   * Returns the literalizable target type for any matching subtype. Meaning, that if say, the type 
   * is a subtype of the interface com.bar.Foo, which is itself marked literalizable, this method will return
   * a reference to the java.lang.Class instance for com.bar.Foo
   *
   * @param clazz the class, interface or superclass to obtain a literalizable target type for.
   * @return the literalizable target type that matches {@param clazz}. If there are no matches, returns null.
   */
  public Class getLiteralizableTargetType(final MetaClass clazz) {
    Context ctx = this;
    do {
      MetaClass cls = clazz;
      do {
        if (ctx.literalizableClasses.contains(cls)) return cls.asClass();

        for (MetaClass iface : cls.getInterfaces()) {
          if (ctx.literalizableClasses.contains(iface)) return iface.asClass();
        }
      }
      while ((cls = cls.getSuperClass()) != null);
    }
    while ((ctx = ctx.parent) != null);

    return null;
  }

=======
    return variables.values();
  }

  /**
   * Returns all variables in this scope (does not include variables of parent scopes).
   * 
   * @return map of variable name to {@link Variable}, empty if no variables are in scope.
   */
  public Map getVariables() {
    if (variables == null)
      return Collections. emptyMap();

    return Collections. unmodifiableMap(variables);
  }

  /**
   * Attaches a class to the current scope.
   * 
   * @param clazz  class to attach.
   */
  public void attachClass(MetaClass clazz) {
    this.classContexts.add(clazz);
  }

  /**
   * Checks if automatic import is active.
   * 
   * @return true if auto import active, otherwise false.
   */
>>>>>>> f2af4d2dc2686b08868316271c089b6ecc1156fa:errai-codegen/src/main/java/org/jboss/errai/codegen/Context.java
  public boolean isAutoImportActive() {
    return autoImportActive;
  }
Solution content
      while ((cls = cls.getSuperClass()) != null);
    }
    if (variables == null)
      return Collections. emptyList();
    return variables.values();
  }

  public void addLiteralizableClasses(Collection> clazzes) {
    for (Class cls : clazzes) {
      addLiteralizableClass(cls);
    }
  }

  public void addLiteralizableMetaClasses(Collection clazzes) {
    for (MetaClass cls : clazzes) {
      addLiteralizableClass(cls);
    }
  }

  /**
   * Mark a class "literalizable". Meaning that all classes that are assignable to this type, are candidates for
   * reification to code snapshots for this context and all subcontexts. See {@link SnapshotMaker} for further
   * details.
   *
   * @param clazz the class, interface or superclass to be considered literalizable.
   */
  public void addLiteralizableClass(Class clazz) {
    addLiteralizableClass(MetaClassFactory.get(clazz));
  }

  /**
   * Mark a class "literalizable". Meaning that all classes that are assignable to this type, are candidates for
   * reification to code snapshots for this context and all subcontexts. See {@link SnapshotMaker} for further
   * details.
   *
   * @param clazz the class, interface or superclass to be considered literalizable.
   */
  public void addLiteralizableClass(MetaClass clazz) {
    literalizableClasses.add(clazz);
  }

  /**
   * Returns true if the specified class is literalizable.
   *
   * @see #addLiteralizableClass(Class)
   * @param clazz the class, interface or superclass to be tested if literalizable
   * @return true if the specified class is literalizable
   */
  public boolean isLiteralizableClass(final Class clazz) {
    return isLiteralizableClass(MetaClassFactory.get(clazz));
  }

  /**
   * Returns true if the specified class is literalizable.
   *
   * @see #addLiteralizableClass(org.jboss.errai.codegen.framework.meta.MetaClass)
   * @param clazz the class, interface or superclass to be tested if literalizable
   * @return true if the specified class is literalizable
   */
  public boolean isLiteralizableClass(final MetaClass clazz) {
    return getLiteralizableTargetType(clazz) != null;
  }

  /**
   * Returns the literalizable target type for any matching subtype. Meaning, that if say, the type 
   * is a subtype of the interface com.bar.Foo, which is itself marked literalizable, this method will return
   * a reference to the java.lang.Class instance for com.bar.Foo
   *
   * @param clazz the class, interface or superclass to obtain a literalizable target type for.
   * @return the literalizable target type that matches {@param clazz}. If there are no matches, returns null.
   */
  public Class getLiteralizableTargetType(final Class clazz) {
    return getLiteralizableTargetType(MetaClassFactory.get(clazz));
  }

  /**
   * Returns the literalizable target type for any matching subtype. Meaning, that if say, the type 
   * is a subtype of the interface com.bar.Foo, which is itself marked literalizable, this method will return
   * a reference to the java.lang.Class instance for com.bar.Foo
   *
   * @param clazz the class, interface or superclass to obtain a literalizable target type for.
   * @return the literalizable target type that matches {@param clazz}. If there are no matches, returns null.
   */
  public Class getLiteralizableTargetType(final MetaClass clazz) {
    Context ctx = this;
    do {
      MetaClass cls = clazz;
      do {
        if (ctx.literalizableClasses.contains(cls)) return cls.asClass();

        for (MetaClass iface : cls.getInterfaces()) {
          if (ctx.literalizableClasses.contains(iface)) return iface.asClass();
        }
      }
    while ((ctx = ctx.parent) != null);

    return null;
  }

  /**
   * Returns all variables in this scope (does not include variables of parent scopes).
   *
   * @return map of variable name to {@link Variable}, empty if no variables are in scope.
   */
  public Map getVariables() {
    if (variables == null)
      return Collections. emptyMap();

    return Collections. unmodifiableMap(variables);
  }

  /**
   * Attaches a class to the current scope.
   *
   * @param clazz  class to attach.
   */
  public void attachClass(MetaClass clazz) {
    this.classContexts.add(clazz);
  }

  /**
   * Checks if automatic import is active.
   *
   * @return true if auto import active, otherwise false.
   */
  public boolean isAutoImportActive() {
    return autoImportActive;
  }
File
Context.java
Developer's decision
Combination
Kind of conflict
Comment
Method declaration
Method invocation
Return statement
Chunk
Conflicting content
package org.jboss.errai.codegen.builder.callstack;

<<<<<<< HEAD:errai-codegen/src/main/java/org/jboss/errai/codegen/framework/builder/callstack/LoadLiteral.java
import org.jboss.errai.codegen.framework.Context;
import org.jboss.errai.codegen.framework.SnapshotMaker;
import org.jboss.errai.codegen.framework.Statement;
import org.jboss.errai.codegen.framework.exception.GenerationException;
import org.jboss.errai.codegen.framework.literal.LiteralFactory;
=======
import org.jboss.errai.codegen.Context;
import org.jboss.errai.codegen.Statement;
import org.jboss.errai.codegen.exception.GenerationException;
import org.jboss.errai.codegen.literal.LiteralFactory;
>>>>>>> f2af4d2dc2686b08868316271c089b6ecc1156fa:errai-codegen/src/main/java/org/jboss/errai/codegen/builder/callstack/LoadLiteral.java

/**
 * @author Mike Brock 
Solution content
package org.jboss.errai.codegen.builder.callstack;

import org.jboss.errai.codegen.Context;
import org.jboss.errai.codegen.Statement;
import org.jboss.errai.codegen.exception.GenerationException;
import org.jboss.errai.codegen.literal.LiteralFactory;

/**
 * @author Mike Brock 
File
LoadLiteral.java
Developer's decision
Version 2
Kind of conflict
Import
Chunk
Conflicting content
import org.jboss.errai.codegen.framework.SnapshotMaker;
import java.util.Map;
import java.util.Set;

<<<<<<< HEAD:errai-codegen/src/main/java/org/jboss/errai/codegen/framework/literal/LiteralFactory.java
import org.jboss.errai.codegen.framework.AnnotationEncoder;
import org.jboss.errai.codegen.framework.Context;
import org.jboss.errai.codegen.framework.meta.MetaClass;
import org.jboss.errai.codegen.framework.meta.MetaClassFactory;
import org.jboss.errai.codegen.framework.meta.MetaType;
=======
import org.jboss.errai.codegen.AnnotationEncoder;
import org.jboss.errai.codegen.Context;
import org.jboss.errai.codegen.meta.MetaClass;
import org.jboss.errai.codegen.meta.MetaClassFactory;
import org.jboss.errai.codegen.meta.MetaType;
>>>>>>> f2af4d2dc2686b08868316271c089b6ecc1156fa:errai-codegen/src/main/java/org/jboss/errai/codegen/literal/LiteralFactory.java

/**
 * The literal factory provides a LiteralValue for the specified object (if possible).
Solution content
import java.util.Map;
import java.util.Set;

import org.jboss.errai.codegen.AnnotationEncoder;
import org.jboss.errai.codegen.Context;
import org.jboss.errai.codegen.SnapshotMaker;
import org.jboss.errai.codegen.meta.MetaClass;
import org.jboss.errai.codegen.meta.MetaClassFactory;
import org.jboss.errai.codegen.meta.MetaType;

/**
 * The literal factory provides a LiteralValue for the specified object (if possible).
File
LiteralFactory.java
Developer's decision
Manual
Kind of conflict
Import