Handles the creation of ExpectationBuilder when an attribute is invoked.
486097
def attribute_invoked(self, sender, name, args, kwargs):
        ""
        return ExpectationBuilder(self.sender, self.delegate, self.add_invocation, self.add_expectations, '__call__')(*args, **kwargs)
113200
@Override
    protected void onCreate(Bundle savedInstanceState) {
        final RoboInjector injector = RoboGuice.getInjector(this);
        eventManager = injector.getInstance(EventManager.class);
        preferenceListener = injector.getInstance(PreferenceListener.class);
        injector.injectMembersWithoutViews(this);
        super.onCreate(savedInstanceState);
        eventManager.fire(new OnCreateEvent(savedInstanceState));
    }
1099633
protected void fireAttributeRemovedEvent(String name, AttributeValue oldValue) {
		if (this.listeners != null && isEventFirable()) {
			final AttributeChangeEvent event = new AttributeChangeEvent(
					//source
					this,
					//type
					Type.REMOVAL,
					//old name
					name,
					//old value
					oldValue,
					//current name
					name,
					//current value
					oldValue);
			for (final AttributeChangeListener listener : this.listeners) {
				listener.onAttributeChangeEvent(event);
			}
		}
	}
263009
protected synchronized void fireAttributeRemovedEvent(String name, AttributeValue oldValue) {
		if (this.listenerList != null && isEventFirable()) {
			final AttributeChangeListener[] list = new AttributeChangeListener[this.listenerList.size()];
			this.listenerList.toArray(list);
			final AttributeChangeEvent event = new AttributeChangeEvent(
					this,
					Type.REMOVAL,
					name,
					oldValue,
					name,
					oldValue);
			for (final AttributeChangeListener listener : list) {
				listener.onAttributeChangeEvent(event);
			}
		}
	}
817787
private void processStartElement() throws SAXException {
        if (openStartElement) {
            final QName qName = elementStack.getFirst(); // peek
            for (final NamespaceMapping p: qName.mappings) {
                if (p.newMapping) {
                    transformer.startPrefixMapping(p.prefix, p.uri);
                }
            }
            final Attributes atts = openAttributes != null ? openAttributes : EMPTY_ATTS;
            transformer.startElement(qName.uri, qName.localName, qName.qName, atts);
            openStartElement = false;
            openAttributes = null;
        }
    }
305311
static void initBuilder() {
		try {
			DocumentBuilderFactory docBuilderFactory = DocumentBuilderFactory.newInstance();
			docBuilderFactory.setNamespaceAware(true);
			docBuilder = docBuilderFactory.newDocumentBuilder();
		} catch (ParserConfigurationException ex) {
			throw new RuntimeException(ex);
		}
	}
553648
private static void setField(Class<?> expectedType, Object value, boolean saveOriginal) throws IllegalStateException {
        try {
            for (Field field : NamingManager.class.getDeclaredFields()) {
                if (expectedType.equals(field.getType())) {
                    field.setAccessible(true);
                    if (saveOriginal) {
                        if (expectedType.equals(InitialContextFactoryBuilder.class)) {
                            originalICFBuilder = (InitialContextFactoryBuilder) field.get(null);
                        } else {
                            originalOFBuilder = (ObjectFactoryBuilder) field.get(null);
                        }
                    }

                    field.set(null, value);
                }
            }
        } catch (Throwable t) {
            // Ignore
            LOGGER.debug("Error setting field.", t);
            throw new IllegalStateException(t);
        }
    }
28419
function handleSimpleAttribute() {
    SIMPLEATTR.lastIndex = nextchar-1;
    var matched = SIMPLEATTR.exec(chars);
    if (!matched) throw new Error("should never happen");
    var name = matched[1];
    if (!name) return false;
    var value = matched[2];
    var len = value.length;
    switch(value[0]) {
    case '"':
    case "'":
      value = value.substring(1, len-1);
      nextchar += (matched[0].length-1);
      tokenizer = after_attribute_value_quoted_state;
      break;
    default:
      tokenizer = before_attribute_name_state;
      nextchar += (matched[0].length-1);
      value = value.substring(0, len-1);
      break;
    }

    // Make sure there isn't already an attribute with this name
    // If there is, ignore this one.
    for(var i = 0; i < attributes.length; i++) {
      if (attributes[i][0] === name) return true;
    }

    attributes.push([name, value]);
    return true;
  }
911840
@Override
	public void waitForNotAttribute(String attributeName, String pattern) throws WidgetException {
		waitForNotAttribute(attributeName, pattern, getGUIDriver().getMaxRequestTimeout());
	}
804813
public static Expectation literal(String expected)
    {
        if (expected == null)
            throw new NullPointerException("expected");

        for (int i = factories.size() - 1; i >= 0; i--)
        {
            Factory<Expectation> factory = factories.get(i);
            Expectation expectation = factory.newInstance(expected);
            if (expectation != null)
                return expectation;
        }

        return new DuckExpectation(expected);
    }
562590
protected void setExpectation() {
		expectation = 0.0;
		for(Double d: insertStat.keySet()) {
			expectation += d*(insertStat.get(d)/observationCount);
		}
	}
1272716
public void notifyBeforeEvaluation(String expr) {
        if (getEvaluationListeners() == null)
            return;
        for (EvaluationListener listener: getEvaluationListeners()) {
            listener.beforeEvaluation(this, expr);
        }
    }
1187116
protected void fireAttributeChangedEvent(String name, AttributeValue oldValue, AttributeValue currentValue) {
		if (this.listeners != null && isEventFirable()) {
			final AttributeChangeEvent event = new AttributeChangeEvent(
					//source
					this,
					//type
					Type.VALUE_UPDATE,
					//old name
					name,
					//old value
					oldValue,
					//current name
					name,
					//current value
					currentValue);
			for (final AttributeChangeListener listener : this.listeners) {
				listener.onAttributeChangeEvent(event);
			}
		}
	}
1128696
final public ThenExpressionBuilder<T> ifExp() {
    return new ThenExpressionBuilder<T>(new ExpressionHandler<ThenBuilder<T>>() {
      public ThenBuilder<T> handleExpression(final Expression e) {
        return new ThenBuilder<T>(e, new IfStatementHandler<T>() {
          public T handleStatement(IfStatement ifStatement) {
            return statementHandler().handleStatement(ifStatement);
          }
        }, builder);
      }
    });
  }
85719
protected static void checkNotCreate(String view, String attribute, boolean create) {
    if (create) {
      throw new UnsupportedOperationException(
          "cannot set attribute '" + view + ":" + attribute + "' during file creation");
    }
  }
351315
protected void fireAttributeClearedEvent() {
		if (this.listeners != null && isEventFirable()) {
			final AttributeChangeEvent event = new AttributeChangeEvent(
					//source
					this,
					//type
					Type.REMOVE_ALL,
					//old name
					null,
					//old value
					null,
					//current name
					null,
					//current value
					null);
			for (final AttributeChangeListener listener : this.listeners) {
				listener.onAttributeChangeEvent(event);
			}
		}
	}
1302730
public static void generateGenericExecSQL(MethodSpec.Builder methodBuilder, final SQLiteModelMethod method) {

		boolean nullable;
		final List<String> paramsList = new ArrayList<String>();
		final List<String> contentValueList = new ArrayList<String>();
		final One<Boolean> columnsToUpdate = new One<Boolean>(true);

		String sql = JQLChecker.getInstance().replace(method, method.jql, new JQLReplacerListenerImpl(method) {

			@Override
			public void onWhereStatementBegin(Where_stmtContext ctx) {
				super.onWhereStatementBegin(ctx);

				columnsToUpdate.value0 = false;
			}

			@Override
			public void onWhereStatementEnd(Where_stmtContext ctx) {
				super.onWhereStatementEnd(ctx);

				columnsToUpdate.value0 = true;
			}

			@Override
			public String onColumnName(String columnName) {
				String resolvedName = currentSchema.findColumnNameByPropertyName(method, columnName);
				AssertKripton.assertTrueOrUnknownPropertyInJQLException(resolvedName != null, method, columnName);

				return resolvedName;

			}

			@Override
			public String onBindParameter(String bindParameterName, boolean inStatement) {
				String propertyName = method.findParameterAliasByName(bindParameterName);

				if (columnsToUpdate.value0) {
					contentValueList.add(propertyName);
				} else {
					paramsList.add(propertyName);
				}
				return "?";
			}
		});

		// update/insert columns
		final SQLiteEntity entity = method.getEntity();
		for (String item : contentValueList) {
			// ASSERT: property is always in entity
			String propertyName = method.findParameterNameByAlias(item);
			TypeName paramType = method.findParameterTypeByAliasOrName(item);

			SQLProperty property = entity.get(item);

			if (propertyName == null)
				throw (new PropertyNotFoundException(method, propertyName, paramType));

			Pair<String, TypeName> methodParam = new Pair<String, TypeName>(propertyName, paramType);

			// check same type
			TypeUtility.checkTypeCompatibility(method, methodParam, property);
			// check nullabliity
			// nullable = TypeUtility.isNullable(method, methodParam, property);
			//
			// if (nullable) {
			// // it use raw method param's typeName
			// methodBuilder.beginControlFlow("if ($L!=null)", methodParam.value0);
			// }

			if (method.isLogEnabled()) {
				methodBuilder.addCode("_contentValues.put($S, ", property.columnName);
			} else {
				methodBuilder.addCode("_contentValues.put(");
			}

			// it does not need to be converted in string
			SQLTransformer.javaMethodParam2ContentValues(methodBuilder, method, methodParam.value0, methodParam.value1,
					property);
			methodBuilder.addCode(");\n");
			// if (nullable) {
			// methodBuilder.nextControlFlow("else");
			//
			// if (method.isLogEnabled()) {
			// methodBuilder.addStatement("_contentValues.putNull($S)", property.columnName);
			// } else {
			// methodBuilder.addStatement("_contentValues.putNull()");
			// }
			//
			// methodBuilder.endControlFlow();
			// }

		}

		// where condition
		methodBuilder.addComment("build where condition");
		{
			// String separator = "";
			TypeName paramType;
			String realName;

			for (String item : paramsList) {
				methodBuilder.addCode("_contentValues.addWhereArgs(");

				paramType = method.findParameterTypeByAliasOrName(item);
				realName = method.findParameterNameByAlias(item);

				AssertKripton.assertTrueOrUnknownPropertyInJQLException(paramType != null, method, item);

				// code for query arguments
				nullable = TypeUtility.isNullable(paramType);
				if (nullable) {
					methodBuilder.addCode("($L==null?\"\":", realName);
				}

				// check for string conversion
				TypeUtility.beginStringConversion(methodBuilder, paramType);

				SQLTransformer.javaMethodParam2ContentValues(methodBuilder, method, realName, paramType, null);

				// check for string conversion
				TypeUtility.endStringConversion(methodBuilder, paramType);

				if (nullable) {
					methodBuilder.addCode(")");
				}

				methodBuilder.addCode(");\n");
			}
		}

		// log for where parames
		SqlBuilderHelper.generateLog(method, methodBuilder);

		// log
		methodBuilder.addCode("\n");
		methodBuilder.addStatement("database().execSQL($S, _contentValues.whereArgsAsArray())", sql);
	}