Return-Path: X-Original-To: apmail-cxf-issues-archive@www.apache.org Delivered-To: apmail-cxf-issues-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 65580DAFC for ; Wed, 15 May 2013 10:39:18 +0000 (UTC) Received: (qmail 95211 invoked by uid 500); 15 May 2013 10:39:18 -0000 Delivered-To: apmail-cxf-issues-archive@cxf.apache.org Received: (qmail 95127 invoked by uid 500); 15 May 2013 10:39:18 -0000 Mailing-List: contact issues-help@cxf.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@cxf.apache.org Delivered-To: mailing list issues@cxf.apache.org Received: (qmail 95001 invoked by uid 99); 15 May 2013 10:39:15 -0000 Received: from arcas.apache.org (HELO arcas.apache.org) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 15 May 2013 10:39:15 +0000 Date: Wed, 15 May 2013 10:39:15 +0000 (UTC) From: "Vadim Kirilchuk (JIRA)" To: issues@cxf.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Closed] (CXF-5008) PhaseInterceptorChain insertInterceptor gives wrong ordering 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/CXF-5008?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Vadim Kirilchuk closed CXF-5008. -------------------------------- Resolution: Won't Fix Works as designed > PhaseInterceptorChain insertInterceptor gives wrong ordering > ------------------------------------------------------------ > > Key: CXF-5008 > URL: https://issues.apache.org/jira/browse/CXF-5008 > Project: CXF > Issue Type: Bug > Reporter: Vadim Kirilchuk > Priority: Minor > Attachments: PhaseInterceptorChainTest.patch > > > Hi everyone, > I am playing along with PhaseInterceptorChain#insertInterceptor and confused by ordering. As i understand this code have to order interceptors according to their before/after dependencies. > I have 5 interceptors with names "0","1","2","3","4" > "0" must be before "1" and "4" > "1" must be before "2" but after "0" > "2" must be before "4" but after "1" > "3" must be after "1" and "2" > "4" has no befors or afters > as you can see the rule is very simple > n-th element befors can be any from n + 1 > n-th element afters can be any from 0, n > Now i try to add this interceptors in shuffled order: 4, 2, 0, 1, 3 > Here is what i get in the chain step by step > 4 > 2, 4 > 2, 0, 4 > 1, 2, 0, 4 > 1, 2, 0, 4, 3 > as you can see constraint for "0" is broken, it must be at the head! > Also i don't see any checks for case when you met firstBefore and then met lastAfter which means that your interceptors have conflicting dependencies. Is it OK? > Example: interceptor C must be before D but after B, and interceptor B must be after D > when you start adding them as D B C you first add D to chain > D > then B, and see that it have to be after D > D B > then you try to add C and see, that it must be before D but after B > c D B c > and no exceptions or something is thrown. > I am attaching tests as well. > Please check them and tell me if i just doing something wrong. > Thanks in advance. -- This message is automatically generated by JIRA. If you think it was sent incorrectly, please contact your JIRA administrators For more information on JIRA, see: http://www.atlassian.com/software/jira