Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id 2B270200B66 for ; Thu, 18 Aug 2016 13:32:13 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id 29C8C160AAE; Thu, 18 Aug 2016 11:32:13 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id 6FF3B160AAB for ; Thu, 18 Aug 2016 13:32:12 +0200 (CEST) Received: (qmail 94280 invoked by uid 500); 18 Aug 2016 11:32:11 -0000 Mailing-List: contact dev-help@brooklyn.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@brooklyn.apache.org Delivered-To: mailing list dev@brooklyn.apache.org Received: (qmail 94269 invoked by uid 99); 18 Aug 2016 11:32:11 -0000 Received: from git1-us-west.apache.org (HELO git1-us-west.apache.org) (140.211.11.23) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 18 Aug 2016 11:32:11 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id 3B616E01E2; Thu, 18 Aug 2016 11:32:11 +0000 (UTC) From: aledsage To: dev@brooklyn.apache.org Reply-To: dev@brooklyn.apache.org References: In-Reply-To: Subject: [GitHub] brooklyn-server pull request #300: Location DSL Updates Content-Type: text/plain Message-Id: <20160818113211.3B616E01E2@git1-us-west.apache.org> Date: Thu, 18 Aug 2016 11:32:11 +0000 (UTC) archived-at: Thu, 18 Aug 2016 11:32:13 -0000 Github user aledsage commented on a diff in the pull request: https://github.com/apache/brooklyn-server/pull/300#discussion_r75291636 --- Diff: camp/camp-brooklyn/src/main/java/org/apache/brooklyn/camp/brooklyn/spi/dsl/methods/DslComponent.java --- @@ -84,51 +89,72 @@ public DslComponent(DslComponent scopeComponent, Scope scope, String componentId } // --------------------------- - + @Override - public Task newTask() { - return TaskBuilder.builder().displayName(toString()).tag(BrooklynTaskTags.TRANSIENT_TASK_TAG) - .body(new EntityInScopeFinder(scopeComponent, scope, componentId)).build(); + public Task newTask() { + return TaskBuilder.builder() + .displayName(toString()) + .tag(BrooklynTaskTags.TRANSIENT_TASK_TAG) + .body(new ObjectInScopeFinder(scopeComponent, scope, componentId)) + .build(); } - - protected static class EntityInScopeFinder implements Callable { + + protected static class ObjectInScopeFinder implements Callable { protected final DslComponent scopeComponent; protected final Scope scope; protected final String componentId; - public EntityInScopeFinder(DslComponent scopeComponent, Scope scope, String componentId) { + public ObjectInScopeFinder(DslComponent scopeComponent, Scope scope, String componentId) { this.scopeComponent = scopeComponent; this.scope = scope; this.componentId = componentId; } protected EntityInternal getEntity() { if (scopeComponent!=null) { - return (EntityInternal)scopeComponent.get(); + return (EntityInternal) scopeComponent.get(); --- End diff -- Seems strange to cast this to `EntityInternal`, now that you've generalised it to `ObjectInScopeFinder`. --- 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. ---