CPD Results

The following document contains the results of PMD's CPD 4.2.2.

Duplications

File Line
org/jomc/ri/DefaultObjectManager.java 178
org/jomc/ri/DefaultObjectManager.java 399
            if ( i.getLocation() != null )
            {
                if ( s.getClazz() == null )
                {
                    if ( this.isLoggable( Level.WARNING ) )
                    {
                        this.log( Level.WARNING, this.getMissingSpecificationClassMessage( s ), new Exception() );
                    }

                    return null;
                }

                final Object object = this.getObject(
                    Class.forName( s.getClazz(), true, classLoader ), i.getLocationUri(), classLoader );

                if ( object == null )
                {
                    if ( this.isLoggable( Level.WARNING ) )
                    {
                        this.log( Level.WARNING, this.getMissingObjectMessage(
                            i.getIdentifier(), i.getName() ), new Exception() );

                    }

                    return null;
                }

                return object;
            }
            else if ( !i.isAbstract() )
            {
                final Instance instance = model.getInstance( i.getIdentifier() );
                if ( instance == null )
                {
                    if ( this.isLoggable( Level.WARNING ) )
                    {
                        this.log( Level.WARNING, this.getMissingInstanceMessage(
                            i.getIdentifier(), i.getName() ), new Exception() );

                    }

                    return null;
                }

                final Object object = this.getObject( scope, instance, classLoader );
                if ( object == null )
                {
                    if ( this.isLoggable( Level.WARNING ) )
                    {
                        this.log( Level.WARNING, this.getMissingObjectMessage(
                            i.getIdentifier(), i.getName() ), new Exception() );

                    }

                    return null;
                }

                return object;
            }

File Line
org/jomc/ri/DefaultObjectManager.java 122
org/jomc/ri/DefaultObjectManager.java 334
            throw new NullPointerException( "implementationName" );
        }

        try
        {
            this.initialize();

            final ClassLoader classLoader = getClassLoader( specification );
            final Modules model = this.getModules( classLoader );
            final Specification s = model.getSpecification( specification );

            if ( s == null )
            {
                if ( this.isLoggable( Level.WARNING ) )
                {
                    this.log( Level.WARNING, this.getMissingSpecificationMessage(
                        specification.getName() ), new Exception() );

                }

                return null;
            }

            Scope scope = null;
            if ( s.getScope() != null )
            {
                scope = this.getScope( classLoader, s.getScope() );

                if ( scope == null )
                {
                    if ( this.isLoggable( Level.WARNING ) )
                    {
                        this.log( Level.WARNING, this.getMissingScopeMessage( s.getScope() ), null );
                    }

                    return null;
                }
            }

            final Implementations available = model.getImplementations( s.getIdentifier() );
            if ( available == null || available.getImplementation().isEmpty() )
            {
                if ( this.isLoggable( Level.WARNING ) )
                {
                    this.log( Level.WARNING, this.getMissingImplementationsMessage(
                        specification.getName() ), new Exception() );

                }

                return null;
            }

File Line
org/jomc/ri/DefaultInvoker.java 100
org/jomc/ri/DefaultInvoker.java 141
                synchronized ( invocation.getObject() )
                {
                    try
                    {
                        current = this.preInvoke( current );
                    }
                    catch ( final Throwable t )
                    {
                        this.handleException( current, t );
                    }

                    if ( !( current.getResult() instanceof Throwable ) )
                    {
                        try
                        {
                            current.setResult( current.getMethod().invoke( current.getObject(),
                                                                           current.getArguments() ) );

                        }
                        catch ( final Throwable t )
                        {
                            this.handleException( current, t );
                        }
                    }

                    try
                    {
                        current = this.postInvoke( current );
                    }
                    catch ( final Throwable t )
                    {
                        this.handleException( current, t );
                    }

                    if ( current.getResult() instanceof Throwable )
                    {
                        throw (Throwable) current.getResult();
                    }

                    return current.getResult();
                }