Return-Path: X-Original-To: apmail-commons-issues-archive@minotaur.apache.org Delivered-To: apmail-commons-issues-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 11ED917A21 for ; Mon, 27 Apr 2015 19:57:40 +0000 (UTC) Received: (qmail 47406 invoked by uid 500); 27 Apr 2015 19:57:39 -0000 Delivered-To: apmail-commons-issues-archive@commons.apache.org Received: (qmail 47310 invoked by uid 500); 27 Apr 2015 19:57:39 -0000 Mailing-List: contact issues-help@commons.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: issues@commons.apache.org Delivered-To: mailing list issues@commons.apache.org Received: (qmail 47223 invoked by uid 99); 27 Apr 2015 19:57:39 -0000 Received: from arcas.apache.org (HELO arcas.apache.org) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 27 Apr 2015 19:57:39 +0000 Date: Mon, 27 Apr 2015 19:57:39 +0000 (UTC) From: "ASF GitHub Bot (JIRA)" To: issues@commons.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Commented] (LANG-1114) TypeUtils.ParameterizedType#equals doesn't work with wildcard types 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/LANG-1114?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14514848#comment-14514848 ] ASF GitHub Bot commented on LANG-1114: -------------------------------------- Github user britter commented on the pull request: https://github.com/apache/commons-lang/pull/65#issuecomment-96796890 @datalorax Commons Lang has been migrated from svn to git. Because of this the main branch has been renamed to 'master'. Can you please rebase your work against the master branch? Thank you! > TypeUtils.ParameterizedType#equals doesn't work with wildcard types > ------------------------------------------------------------------- > > Key: LANG-1114 > URL: https://issues.apache.org/jira/browse/LANG-1114 > Project: Commons Lang > Issue Type: Bug > Components: lang.reflect.* > Affects Versions: 3.3.2, 3.4 > Reporter: andrew coates > Assignee: Benedikt Ritter > Fix For: Review Patch > > > There is a bug in TypeUtils.equals(WilcardType, Type). It returns true if the other type is not a WildcardType, it should return false. See TypeUtils@1629 for v3.3.2 and TypeUtils@791 for v3.4 > Bug can be seen with the following test: > {code} > @Test > public void shouldHandleEqualityOfParameterizedTypesWithWildcards() throws Exception { > // Given: > class SomeType { > Collection field; > } > final ParameterizedType wildcardCollectionType = (ParameterizedType) SomeType.class.getDeclaredField("field").getGenericType(); > final WildcardType wildcard = (WildcardType) wildcardCollectionType.getActualTypeArguments()[0]; > final ParameterizedType ptWithWildcard = TypeUtils.parameterize(Collection.class, wildcard); > final ParameterizedType otherPt = TypeUtils.parameterize(Collection.class, String.class); > // Then: > assertThat(otherPt, is(not(equalTo(ptWithWildcard)))); // Passes > assertThat(ptWithWildcard, is(not(equalTo(otherPt)))); // Fails > } > {code} -- This message was sent by Atlassian JIRA (v6.3.4#6332)