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 EC5BC200BF5 for ; Sat, 7 Jan 2017 11:48:00 +0100 (CET) Received: by cust-asf.ponee.io (Postfix) id EAE55160B4A; Sat, 7 Jan 2017 10:48:00 +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 41330160B3C for ; Sat, 7 Jan 2017 11:48:00 +0100 (CET) Received: (qmail 14861 invoked by uid 500); 7 Jan 2017 10:47:58 -0000 Mailing-List: contact issues-help@maven.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@maven.apache.org Delivered-To: mailing list issues@maven.apache.org Received: (qmail 14780 invoked by uid 99); 7 Jan 2017 10:47:58 -0000 Received: from arcas.apache.org (HELO arcas) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 07 Jan 2017 10:47:58 +0000 Received: from arcas.apache.org (localhost [127.0.0.1]) by arcas (Postfix) with ESMTP id 7D7242C1F54 for ; Sat, 7 Jan 2017 10:47:58 +0000 (UTC) Date: Sat, 7 Jan 2017 10:47:58 +0000 (UTC) From: "Michael Osipov (JIRA)" To: issues@maven.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Assigned] (MSHARED-489) AbstractMavenReportRenderer#linkPatternedText ignores name if href is invalid MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 archived-at: Sat, 07 Jan 2017 10:48:01 -0000 [ https://issues.apache.org/jira/browse/MSHARED-489?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Michael Osipov reassigned MSHARED-489: -------------------------------------- Assignee: Michael Osipov > AbstractMavenReportRenderer#linkPatternedText ignores name if href is invalid > ----------------------------------------------------------------------------- > > Key: MSHARED-489 > URL: https://issues.apache.org/jira/browse/MSHARED-489 > Project: Maven Shared Components > Issue Type: Bug > Components: maven-reporting-impl > Affects Versions: maven-reporting-impl 2.4 > Reporter: Michael Osipov > Assignee: Michael Osipov > Fix For: maven-reporting-impl 3.0 > > > Consider this input: > {noformat} > {My Text, ftp://host/file.txt} or {My Text, http:/host/file.txt} (typo) > {noformat} > The current output simply be {{ftp://host/file.txt}} or {{http:/host/file.txt}} but I would expect it to be {{My Text}} in both cases. > The problem is burried in the current code: > {code:java} > for ( Iterator it = segments.iterator(); it.hasNext(); ) > { > String name = it.next(); > String href = it.next(); > if ( href == null ) > { > text( name ); > } > else > { > if ( getValidHref( href ) != null ) > { > link( getValidHref( href ), name ); > } > else > { > text( href ); > } > } > } > {code} > The invalid {{href}} would be printed out instead of {{name}}. I think the code should read: > {code:java} > for ( Iterator it = segments.iterator(); it.hasNext(); ) > { > String name = it.next(); > String href = it.next(); > if ( getValidHref( href ) == null ) > { > text( name ); > } > else > { > link( getValidHref( href ), name ); > } > } > {code} > Produce link if href isn't null and is valid otherwise add name (text) only. -- This message was sent by Atlassian JIRA (v6.3.4#6332)