Tries to find missing version from dependency list and dependency management.
If found, the artifact is updated with the correct version.

@param item  The item to fill in missing version details into
177498
private void fillMissingArtifactVersion(final ArtifactItem item) {
        log.trace("Attempting to find missing version in {}:{}", item.getGroupId() , item.getArtifactId());

        List list = project.getDependencies();

        for (int i = 0; i < list.size(); ++i) {
            Dependency dependency = (Dependency) list.get(i);

            if (dependency.getGroupId().equals(item.getGroupId())
                && dependency.getArtifactId().equals(item.getArtifactId())
                && dependency.getType().equals(item.getType()))
            {
                log.trace("Found missing version: {} in dependency list", dependency.getVersion());

                item.setVersion(dependency.getVersion());

                return;
            }
        }

        list = project.getDependencyManagement().getDependencies();

        for (int i = 0; i < list.size(); i++) {
            Dependency dependency = (Dependency) list.get(i);

            if (dependency.getGroupId().equals(item.getGroupId())
                && dependency.getArtifactId().equals(item.getArtifactId())
                && dependency.getType().equals(item.getType()))
            {
                log.trace("Found missing version: {} in dependency management list", dependency.getVersion());

                item.setVersion(dependency.getVersion());
            }
        }
    }
848965
@Override
    public void versionDownloadableFound(String versionDownloadable) {
        if (Comparator.isVersionDownloadableNewer(mActivity, versionDownloadable)) {
            if (hasToShowNotice(versionDownloadable) && !hasUserTappedToNotShowNoticeAgain(versionDownloadable)) {
                mLibraryResultCallaback.foundUpdateAndShowIt(versionDownloadable);
            } else {
                mLibraryResultCallaback.foundUpdateAndDontShowIt(versionDownloadable);
            }
        } else { // No new update available
            mLibraryResultCallaback.returnUpToDate(versionDownloadable);
        }

    }
1316889
protected void doChecks(CacheItem item, List<CacheItem> itemsToRefresh) {
        boolean expired;
        boolean willBeRefreshed;

        try {
            expired = checkForExpiration(item);
            if (expired) {
                if (logger.isDebugEnabled()) {
                    logger.debug(item + " was removed because it expired");
                }
            } else {
                willBeRefreshed = checkForRefresh(item, itemsToRefresh);
                if (willBeRefreshed) {
                    if (logger.isDebugEnabled()) {
                        logger.debug(item + " will be refreshed");
                    }
                }
            }
        } catch (Exception ex) {
            logger.warn("Exception while checking " + item + " for expiration/refresh", ex);
        }
    }
1058917
public void add(Item item)
    {
        Item innerItem = trie.get(item.key);
        if (innerItem == null)
        {
            innerItem = item;
            trie.put(innerItem.key, innerItem);
        }
        else
        {
            innerItem.combine(item);
        }
    }
225276
public boolean isModifiedOnVersion(String version) {
		if( this.modificationHistory.isModifiedOnVersion(version)
				|| this.outParameter.isModifiedOnVersion(version) ) {
			return true;
		}
		for(APIParameter inParameter : inParameters) {
			if(inParameter.isModifiedOnVersion(version)) {
				return true;
			}
		}
		return false;
	}
124340
protected void adopt(final CmsTreeItem item) {

        item.setParentItem(this);
        item.setTree(m_tree);
        onChangeChildren();
        if ((m_tree != null) && m_tree.isAnimationEnabled()) {
            // could be null if not yet attached
            item.getElement().getStyle().setOpacity(0);
            // animate
            (new Animation() {

                /**
                 * @see com.google.gwt.animation.client.Animation#onUpdate(double)
                 */
                @Override
                protected void onUpdate(double progress) {

                    item.getElement().getStyle().setOpacity(progress);
                }
            }).run(ANIMATION_DURATION);
        }
    }
234080
protected Artifact findFrameworkArtifact( boolean minVersionWins )
    {
        Artifact result = null;

        Set<?> artifacts = project.getArtifacts();
        for ( Iterator<?> iter = artifacts.iterator(); iter.hasNext(); )
        {
            Artifact artifact = (Artifact) iter.next();
            if ( "zip".equals( artifact.getType() ) )
            {
                if ( "framework".equals( artifact.getClassifier() ) )
                {
                    result = artifact;
                    if ( !minVersionWins )
                    {
                        break;
                    }
                    // System.out.println( "added framework: " + artifact.getGroupId() + ":" + artifact.getArtifactId()
                    // );
                    // don't break, maybe there is "framework-min" artifact too
                }
                // "module-min" overrides "module" (if present)
                else if ( "framework-min".equals( artifact.getClassifier() ) )
                {
                    result = artifact;
                    // System.out.println( "added framework-min: " + artifact.getGroupId() + ":"
                    // + artifact.getArtifactId() );
                    if ( minVersionWins )
                    {
                        break;
                    }
                }
            }
        }
        return result;
    }
825734
protected void addItem(ItemState item)
   {
      index.put(item.getData().getIdentifier(), item);
      index.put(item.getData().getQPath(), item);
      index.put(new ParentIDQPathBasedKey(item), item);
      index.put(new IDStateBasedKey(item.getData().getIdentifier(), item.getState()), item);

      if (item.getData().isNode())
      {
         Map<String, ItemState> children = lastChildNodeStates.get(item.getData().getParentIdentifier());
         if (children == null)
         {
            children = new HashMap<String, ItemState>();
            lastChildNodeStates.put(item.getData().getParentIdentifier(), children);
         }
         children.put(item.getData().getIdentifier(), item);

         List<ItemState> listItemState = childNodeStates.get(item.getData().getParentIdentifier());
         if (listItemState == null)
         {
            listItemState = new ArrayList<ItemState>();
            childNodeStates.put(item.getData().getParentIdentifier(), listItemState);
         }
         listItemState.add(item);
         if (item.isPathChanged())
         {
            if (allPathsChanged == null)
            {
               allPathsChanged = new ArrayList<ItemState>();
            }
            allPathsChanged.add(item);
         }
      }
      else
      {
         Map<String, ItemState> children = lastChildPropertyStates.get(item.getData().getParentIdentifier());
         if (children == null)
         {
            children = new HashMap<String, ItemState>();
            lastChildPropertyStates.put(item.getData().getParentIdentifier(), children);
         }
         children.put(item.getData().getIdentifier(), item);

         List<ItemState> listItemState = childPropertyStates.get(item.getData().getParentIdentifier());
         if (listItemState == null)
         {
            listItemState = new ArrayList<ItemState>();
            childPropertyStates.put(item.getData().getParentIdentifier(), listItemState);
         }
         listItemState.add(item);
      }

      if (item.isNode() && item.isPersisted())
      {
         int[] childInfo = childNodesInfo.get(item.getData().getParentIdentifier());
         if (childInfo == null)
         {
            childInfo = new int[2];
         }

         if (item.isDeleted())
         {
            --childInfo[CHILD_NODES_COUNT];
         }
         else if (item.isAdded())
         {
            ++childInfo[CHILD_NODES_COUNT];
            childInfo[CHILD_NODES_LAST_ORDER_NUMBER] = ((NodeData)item.getData()).getOrderNumber();

         }
         childNodesInfo.put(item.getData().getParentIdentifier(), childInfo);
      }
   }
204902
@PostConstruct
	protected void checkPluginDependencies() throws GeomajasException {
		if ("true".equals(System.getProperty("skipPluginDependencyCheck"))) {
			return;
		}

		if (null == declaredPlugins) {
			return;
		}

		// start by going through all plug-ins to build a map of versions for plug-in keys
		// includes verification that each key is only used once
		Map<String, String> versions = new HashMap<String, String>();
		for (PluginInfo plugin : declaredPlugins.values()) {
			String name = plugin.getVersion().getName();
			String version = plugin.getVersion().getVersion();
			// check for multiple plugin with same name but different versions (duplicates allowed for jar+source dep)
			if (null != version) {
				String otherVersion = versions.get(name);
				if (null != otherVersion) {
					if (!version.startsWith(EXPR_START)) {
						if (!otherVersion.startsWith(EXPR_START) && !otherVersion.equals(version)) {
							throw new GeomajasException(ExceptionCode.DEPENDENCY_CHECK_INVALID_DUPLICATE,
									name, version, versions.get(name));
						}
						versions.put(name, version);
					}
				} else {
					versions.put(name, version);
				}
			}
		}

		// Check dependencies
		StringBuilder message = new StringBuilder();
		String backendVersion = versions.get("Geomajas");
		for (PluginInfo plugin : declaredPlugins.values()) {
			String name = plugin.getVersion().getName();
			message.append(checkVersion(name, "Geomajas back-end", plugin.getBackendVersion(), backendVersion));
			List<PluginVersionInfo> dependencies = plugin.getDependencies();
			if (null != dependencies) {
				for (PluginVersionInfo dependency : plugin.getDependencies()) {
					String depName = dependency.getName();
					message.append(checkVersion(name, depName, dependency.getVersion(), versions.get(depName)));
				}
			}
			dependencies = plugin.getOptionalDependencies();
			if (null != dependencies) {
				for (PluginVersionInfo dependency : dependencies) {
					String depName = dependency.getName();
					String availableVersion = versions.get(depName);
					if (null != availableVersion) {
						message.append(checkVersion(name, depName, dependency.getVersion(), versions.get(depName)));
					}
				}
			}
		}
		if (message.length() > 0) {
			throw new GeomajasException(ExceptionCode.DEPENDENCY_CHECK_FAILED, message.toString());
		}

		recorder.record(GROUP, VALUE);
	}
666144
public void addNotCombine(Item item)
    {
        Item innerItem = trie.get(item.key);
        if (innerItem == null)
        {
            innerItem = item;
            trie.put(innerItem.key, innerItem);
        }
    }
621479
public boolean isUpToDate(final DbArtifact artifact) {
        final List<String> versions = repoHandler.getArtifactVersions(artifact);
        final String currentVersion = artifact.getVersion();

        final String lastDevVersion = getLastVersion(versions);
        final String lastReleaseVersion = getLastRelease(versions);

        if(lastDevVersion == null || lastReleaseVersion == null) {
            // Plain Text comparison against version "strings"
            for(final String version: versions){
                if(version.compareTo(currentVersion) > 0){
                    return false;
                }
            }
            return true;
        } else {
            return currentVersion.equals(lastDevVersion) || currentVersion.equals(lastReleaseVersion);
        }
    }
594604
@Override
    public double doCalculateItemAgreement(final ICodingAnnotationItem item)
    {
        SetAnnotation setAnnotation = null;
        int numberOfCategories = 0;
        for (IAnnotationUnit annotationUnit : item.getUnits()) {
            SetAnnotation raterSetAnnotation = (SetAnnotation) (annotationUnit
                    .getCategory());
            numberOfCategories += raterSetAnnotation.size();
            if (setAnnotation == null) {
                setAnnotation = new SetAnnotation(raterSetAnnotation);
            }
            else {
                setAnnotation.retainAll(raterSetAnnotation);
            }
            if (setAnnotation.size() == 0) {
                return 0.0;
            }
        }
        return item.getRaterCount() * item.getRaterCount()
                * setAnnotation.size() / (double) numberOfCategories;
    }
1287113
public void addItem (int index, T item)
    {
        if (_items == null) {
            return;
        }
        _items.add(index, item);
    }
654113
public void addDependency(Dependency dependency) {
        Dependency newDep = null;
        String classifier = dependency.getArtifact().getClassifier();
        if ( Const.TEST.equals( classifier ) || Const.TEST_JAR.equals( classifier ) ) {
            ArtifactType artifactType = new DefaultArtifactType( Const.TEST_JAR, Const.JAR, Const.TEST_JAR, null );
            
            Artifact artifact = dependency.getArtifact();
            
            artifact = new DefaultArtifact( artifact.getGroupId(), artifact.getArtifactId(),
                    null, Const.JAR, artifact.getBaseVersion(), artifactType );
            newDep =  new Dependency(artifact, dependency.getScope());
        } else {
            newDep = dependency;
        }
        dependencies.add(newDep);
    }
500382
def takeDependency(self, item):
        
        if ( not item in self._dependencies ):
            return
        
        item._reverseDependencies.pop(self)
        viewItem = self._dependencies.pop(item)
        
        scene    = viewItem.scene()
        if ( scene ):
            scene.removeItem(viewItem)
508084
public final void add(@NonNull final AbstractItem item) {
        Condition.INSTANCE.ensureNotNull(item, "The item may not be null");
        items.add(item);

        if (item instanceof Item && ((Item) item).getIcon() != null) {
            iconCount++;
        } else if (item instanceof Divider) {
            dividerCount++;
        }

        rawItems = null;
        notifyOnDataSetChanged();
    }
25340
@Override
    public void addOrUpdateItem(T item) {
        synchronized (LOCK) {
            // Update memory cache
            cache.onObjectUpdated(item.getEngineId(), item);

            List<T> items = new ArrayList<T>();
            items.add(item);
            asyncStorageInt.addOrUpdateItems(items);

            for (ListEngineDisplayListener<T> l : listeners) {
                l.addOrUpdate(item);
            }
        }
    }