Checks whether the new {@link PojoSerializer} has new or removed fields compared to the previous one.
428018
private static boolean newPojoHasNewOrRemovedFields(
			LinkedOptionalMap<Field, TypeSerializerSnapshot<?>> fieldSerializerSnapshots,
			PojoSerializer<?> newPojoSerializer) {
		int numRemovedFields = fieldSerializerSnapshots.absentKeysOrValues().size();
		int numPreexistingFields = fieldSerializerSnapshots.size() - numRemovedFields;

		boolean hasRemovedFields = numRemovedFields > 0;
		boolean hasNewFields = newPojoSerializer.getFields().length - numPreexistingFields > 0;
		return hasRemovedFields || hasNewFields;
	}
295676
public JandexAssert hasNoFinalFieldsWithJsonbPropertyAnnotation() {
        // Precondition
        isNotNull();

        final RuleJsonbFieldNotFinal rule = new RuleJsonbFieldNotFinal();

        final StringBuilder sb = new StringBuilder();
        boolean ok = true;

        final Collection<ClassInfo> classes = actual.getKnownClasses();
        for (final ClassInfo clasz : classes) {
            final List<FieldInfo> fields = clasz.fields();
            for (final FieldInfo field : fields) {
                final AssertionResult result = rule.verify(field);
                if (!result.isValid()) {
                    ok = false;
                    sb.append(result.getErrorMessage());
                }
            }
        }

        if (!ok) {
            failWithMessage(
                    "At least one field has a 'final' modifier and is annotated with '@JsonbProperty' at the same time:\n" + sb.toString());
        }

        return this;
    }
1031781
private boolean alreadyReported(int stackPos) {
        if (stack.getStackDepth() <= stackPos) {
            return false;
        }

        OpcodeStack.Item item = stack.getStackItem(stackPos);
        XField field = item.getXField();
        if (field == null) {
            return false;
        }

        String fieldName = field.getName();
        return !checkedFields.add(fieldName);
    }
265192
@Override
    public boolean hasNext() {
        if(next != null){
            return true;
        }
        if(!recordReader.hasNext()){
            return false;
        }

        //Prefetch, until we find one that isn't filtered out - or we run out of data
        while(next == null && recordReader.hasNext()){
            Record r = recordReader.nextRecord();
            List<Writable> temp = transformProcess.execute(r.getRecord());
            if(temp == null){
                continue;
            }
            next = new org.datavec.api.records.impl.Record(temp, r.getMetaData());
        }

        return next != null;
    }
1014338
public static boolean isInheritedMapped(Class<?> classToCheck){
		
		for (Class<?> clazz : getAllsuperClasses(classToCheck)) 
			if(!isNull(clazz.getAnnotation(JGlobalMap.class))) 
				return true;

		for (Field field : getListOfFields(classToCheck)) 
			if(!isNull(field.getAnnotation(JMap.class))) 
				return true;
		
		return false;
	}
805220
public boolean isModified()
    {
        for (int iFieldSeq = 0; iFieldSeq < m_vFieldInfo.size(); iFieldSeq++)
        {
            if (this.getField(iFieldSeq).isModified())
                return true;
        }
        return false;
    }
192105
private static boolean hasChangesOfChildren(long last, PageContext pc, Class clazz) {

	java.lang.reflect.Method[] methods = clazz.getMethods();
	java.lang.reflect.Method method;
	Class[] params;
	for (int i = 0; i < methods.length; i++) {
	    method = methods[i];
	    if (method.getDeclaringClass() == clazz) {
		if (_hasChangesOfChildren(pc, last, method.getReturnType())) return true;
		params = method.getParameterTypes();
		for (int y = 0; y < params.length; y++) {
		    if (_hasChangesOfChildren(pc, last, params[y])) return true;
		}
	    }
	}
	return false;
    }
1119004
public static void validateUpdate(FieldMapping oldFieldMapping, FieldMapping newFieldMapping)
            throws TypeUpdateException {
        Map<String, AttributeInfo> newFields = newFieldMapping.fields;
        for (AttributeInfo attribute : oldFieldMapping.fields.values()) {
            if (newFields.containsKey(attribute.name)) {
                AttributeInfo newAttribute = newFields.get(attribute.name);
                //If old attribute is also in new definition, only allowed change is multiplicity change from REQUIRED to OPTIONAL
                if (!newAttribute.equals(attribute)) {
                    if (attribute.multiplicity == Multiplicity.REQUIRED
                            && newAttribute.multiplicity == Multiplicity.OPTIONAL) {
                        continue;
                    } else {
                        throw new TypeUpdateException("Attribute " + attribute.name + " can't be updated");
                    }
                }

            } else {
                //If old attribute is missing in new definition, return false as attributes can't be deleted
                throw new TypeUpdateException("Old Attribute " + attribute.name + " is missing");
            }
        }

        //Only new attributes
        Set<String> newAttributes = new HashSet<>(ImmutableList.copyOf(newFields.keySet()));
        newAttributes.removeAll(oldFieldMapping.fields.keySet());
        for (String attributeName : newAttributes) {
            AttributeInfo newAttribute = newFields.get(attributeName);
            //New required attribute can't be added
            if (newAttribute.multiplicity == Multiplicity.REQUIRED) {
                throw new TypeUpdateException("Can't add required attribute " + attributeName);
            }
        }
    }
1087004
public boolean hasField(@NonNull String fieldName) {
      return ClassDescriptorCache.getInstance()
                                 .getClassDescriptor(clazz)
                                 .getFields(accessAll)
                                 .stream()
                                 .anyMatch(f -> f.getName().equals(fieldName));
   }
567295
public static boolean hasForUpdate(Object parameter) {
        if (parameter != null && parameter instanceof Example) {
            Example example = (Example) parameter;
            return example.isForUpdate();
        }
        return false;
    }
540175
@Override
    public boolean hasNext() {
        try {
            return hasNextValue();
        } catch (JsonMappingException e) {
            throw new RuntimeJsonMappingException(e.getMessage(), e);
        } catch (IOException e) {
            throw new RuntimeException(e.getMessage(), e);
        }
    }
1252847
private boolean isCandidate(Field field) {
		return !Modifier.isStatic(field.getModifiers()) && field.getAnnotation(Transient.class) == null;
	}
904918
static List<DiffBean> diff(Map<String, Object> oldObject, Map<String, Object> newObject) {
        if (oldObject == null)
            oldObject = Objects.newHashMap();
        if (newObject == null)
            newObject = Objects.newHashMap();
        oldObject = Objects.copy(oldObject);
        newObject = Objects.copy(newObject);
        final List<DiffBean> diff = Objects.newArrayList();

        Closure<TwoMapDiffBean, Object> itr = new Closure<TwoMapDiffBean, Object>() {
            @Override
            public Object call(final TwoMapDiffBean d) {
                ObjectIterator.iterate(d.getM1(), new Closure<ObjectIterator.IterateBean, Object>() {
                    @Override
                    public Object call(ObjectIterator.IterateBean i) {
                        Object o = i.getValue();
                        if (o instanceof Map) {

                        } else if (o instanceof List) {

                        } else {
                            Object oo = null;
                            if (!Objects.isNullOrEmpty(i.getPath()))
                                oo = ObjectPath.get(d.getM2(), i.getPath(), null);
                            if (d.isM1Old()) {
                                if (!Objects.equals(o, oo)) {
                                    final DiffBean res = new DiffBean(i.getPath(),o,oo);
                                    if (Objects.find(diff, new Closure<DiffBean, Boolean>() {
                                        @Override
                                        public Boolean call(DiffBean input) {
                                            return input.getPath().equals(res.getPath());
                                        }
                                    }) == null)
                                        diff.add(res);
                                }
                            } else {
                                if (!Objects.equals(o, oo)) {
                                    final DiffBean res = new DiffBean(i.getPath(),oo,o);
                                    if (Objects.find(diff, new Closure<DiffBean, Boolean>() {
                                        @Override
                                        public Boolean call(DiffBean input) {
                                            return input.getPath().equals(res.getPath());
                                        }
                                    }) == null)
                                        diff.add(res);
                                }
                            }
                        }
                        return o;
                    }
                });
                return null;
            }
        };
        itr.call(new TwoMapDiffBean(oldObject, newObject, true));
        itr.call(new TwoMapDiffBean(newObject, oldObject, false));

        return diff;
    }
666052
protected function propertyHasChanged()
    {
        foreach ($this->dbFields as $field => $value) {
            if (isset($this->fields[$field]) && ($this->fields[$field] != $value)) {
                return true;
            }
        }

        return false;
    }
283597
public static boolean compareAnnotatedTypes(AnnotatedType<?> t1, AnnotatedType<?> t2) {
        if (!t1.getJavaClass().equals(t2.getJavaClass())) {
            return false;
        }
        if (!compareAnnotated(t1, t2)) {
            return false;
        }

        if (t1.getFields().size() != t2.getFields().size()) {
            return false;
        }
        Map<Field, AnnotatedField<?>> fields = new HashMap<Field, AnnotatedField<?>>();
        for (AnnotatedField<?> f : t2.getFields()) {
            fields.put(f.getJavaMember(), f);
        }
        for (AnnotatedField<?> f : t1.getFields()) {
            if (fields.containsKey(f.getJavaMember())) {
                if (!compareAnnotatedField(f, fields.get(f.getJavaMember()))) {
                    return false;
                }
            } else {
                return false;
            }
        }

        if (t1.getMethods().size() != t2.getMethods().size()) {
            return false;
        }
        Map<Method, AnnotatedMethod<?>> methods = new HashMap<Method, AnnotatedMethod<?>>();
        for (AnnotatedMethod<?> f : t2.getMethods()) {
            methods.put(f.getJavaMember(), f);
        }
        for (AnnotatedMethod<?> f : t1.getMethods()) {
            if (methods.containsKey(f.getJavaMember())) {
                if (!compareAnnotatedCallable(f, methods.get(f.getJavaMember()))) {
                    return false;
                }
            } else {
                return false;
            }
        }
        if (t1.getConstructors().size() != t2.getConstructors().size()) {
            return false;
        }
        Map<Constructor<?>, AnnotatedConstructor<?>> constructors = new HashMap<Constructor<?>, AnnotatedConstructor<?>>();
        for (AnnotatedConstructor<?> f : t2.getConstructors()) {
            constructors.put(f.getJavaMember(), f);
        }
        for (AnnotatedConstructor<?> f : t1.getConstructors()) {
            if (constructors.containsKey(f.getJavaMember())) {
                if (!compareAnnotatedCallable(f, constructors.get(f.getJavaMember()))) {
                    return false;
                }
            } else {
                return false;
            }
        }
        return true;

    }
974427
def get_diff(self, new_mapping):
        
        import copy
        result = copy.deepcopy(new_mapping)
        result.clear_properties()

        no_check_types = (BooleanField, IntegerField, FloatField, DateField, LongField, BinaryField,
                          GeoPointField, IpField)

        old_fields = set(self.properties.keys())
        new_fields = set(new_mapping.properties.keys())
        #we propagate new fields
        added = new_fields - old_fields
        if added:
            for add in added:
                result.add_property(new_mapping.properties[add])

        #we check common fields
        common_fields = new_fields & old_fields

        #removing standard data
        common_fields = [c for c in common_fields if not isinstance(new_mapping.properties[c], no_check_types)]

        for field in common_fields:
            prop = new_mapping.properties[field]
            if isinstance(prop, StringField):
                continue
            if isinstance(prop, MultiField):
                diff = prop.get_diff(self.properties[field])
                if diff:
                    result.add_property(diff)
            elif isinstance(prop, ObjectField):
                diff = self.properties[field].get_diff(prop)
                if diff:
                    result.add_property(diff)

        if len(result.properties) > 0:
            return result
        return None
794514
protected boolean hasSerializationOverviewTags(FieldDoc field) {
        Content output = new ContentBuilder();
        TagletWriter.genTagOuput(configuration.tagletManager, field,
            configuration.tagletManager.getCustomTaglets(field),
                getTagletWriterInstance(false), output);
        return !output.isEmpty();
    }