brooklyn-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From geomacy <...@git.apache.org>
Subject [GitHub] brooklyn-server pull request #737: Clean up inference around parsing `name:v...
Date Wed, 28 Jun 2017 10:52:55 GMT
Github user geomacy commented on a diff in the pull request:

    https://github.com/apache/brooklyn-server/pull/737#discussion_r124510037
  
    --- Diff: core/src/main/java/org/apache/brooklyn/core/catalog/internal/BasicBrooklynCatalog.java
---
    @@ -855,24 +893,50 @@ private boolean attemptType(String key, CatalogItemType candidateCiType)
{
                 }
                 // first look in collected items, if a key is given
                 String type = (String) item.get("type");
    -            String version = null;
    -            if (CatalogUtils.looksLikeVersionedId(type)) {
    -                version = CatalogUtils.getVersionFromVersionedId(type);
    -                type = CatalogUtils.getSymbolicNameFromVersionedId(type);
    -            }
    +            
                 if (type!=null && key!=null) {
                     for (CatalogItemDtoAbstract<?,?> candidate: itemsDefinedSoFar)
{
                         if (candidateCiType == candidate.getCatalogItemType() &&
                                 (type.equals(candidate.getSymbolicName()) || type.equals(candidate.getId())))
{
    -                        if (version==null || version.equals(candidate.getVersion()))
{
    -                            // matched - exit
    -                            catalogItemType = candidateCiType;
    -                            planYaml = candidateYaml;
    -                            resolved = true;
    -                            return true;
    +                        // matched - exit
    +                        catalogItemType = candidateCiType;
    +                        planYaml = candidateYaml;
    +                        resolved = true;
    +                        return true;
    +                    }
    +                }
    +            }
    +            {
    +                // legacy routine; should be the same as above code added in 0.12 because:
    +                // if type is symbolic_name, the type will match below, and version will
be null so any version allowed to match 
    --- End diff --
    
    grand, but how about the question above where type is of form symbolic_name:version? When
you say "the id will match", where does that happen?


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

Mime
View raw message