Return-Path: X-Original-To: apmail-felix-dev-archive@www.apache.org Delivered-To: apmail-felix-dev-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 3FEC710385 for ; Tue, 4 Mar 2014 14:49:26 +0000 (UTC) Received: (qmail 87904 invoked by uid 500); 4 Mar 2014 14:49:23 -0000 Delivered-To: apmail-felix-dev-archive@felix.apache.org Received: (qmail 87779 invoked by uid 500); 4 Mar 2014 14:49:20 -0000 Mailing-List: contact dev-help@felix.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@felix.apache.org Delivered-To: mailing list dev@felix.apache.org Received: (qmail 87769 invoked by uid 99); 4 Mar 2014 14:49:20 -0000 Received: from arcas.apache.org (HELO arcas.apache.org) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 04 Mar 2014 14:49:20 +0000 Date: Tue, 4 Mar 2014 14:49:20 +0000 (UTC) From: "Carsten Ziegeler (JIRA)" To: dev@felix.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Comment Edited] (FELIX-4393) @Property should accept empty name values on fields MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ https://issues.apache.org/jira/browse/FELIX-4393?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13919458#comment-13919458 ] Carsten Ziegeler edited comment on FELIX-4393 at 3/4/14 2:47 PM: ----------------------------------------------------------------- I see your point, however supporting this from the DS tooling if DS is not supporting it, sounds a little bit wrong So how about this: - in general the scr plugin will issue a warning if @Property is used on a non static field - we provide a switch (default off) which if enabled: 1. does not issue the warning above 2. behaves slightly different than today: for non static fields: if no name specified, it takes the name of the field; if no value specified it takes the initial value of the field was (Author: cziegeler): I see your point, however supporting this from the DS tooling if DS is not supporting it, sounds a little bit wrong So how about this: - in general the scr plugin will issue a warning if @Property is used on a non static field - we provide a switch (default off) which if enabled: 1. does not issue the warning above 2. behaves slightly different than today: if no name specified, it takes the name of the field; if no value specified it takes the initial value of the field > @Property should accept empty name values on fields > ----------------------------------------------------- > > Key: FELIX-4393 > URL: https://issues.apache.org/jira/browse/FELIX-4393 > Project: Felix > Issue Type: Improvement > Components: Maven SCR Plugin > Reporter: james strachan > Assignee: Carsten Ziegeler > Fix For: maven-scr-plugin 1.15.2, scr ant task 1.9.2, scr generator 1.8.4 > > > it'd be nice if @Property behaved like various other annotations (e.g. @Inject / @Resource) so that if a name is not specified and @Property is specified on a field, then the name value defaults to the field name. > It looks like name is optional with a default of "" - so its just the maven scr plugin which seems to barf if name is empty generating this kind of compile error: > {code} > @Property : Property name can not be empty. > {code} > It'd be nice if the name was optional; it makes the code more DRY and keeps things more refactoring safe etc -- This message was sent by Atlassian JIRA (v6.2#6252)