From bb437029c1e5331bcc3f8fb2fc87837142a52f33 Mon Sep 17 00:00:00 2001 From: Noel Grandin Date: Wed, 12 Nov 2014 09:55:57 +0200 Subject: java: convert fields to local variables where possible found by PMD Change-Id: I05b45382b8fb1b734657ce9421a20e6ef6fbe542 Reviewed-on: https://gerrit.libreoffice.org/12376 Tested-by: LibreOffice gerrit bot Reviewed-by: Noel Grandin --- extensions/qa/integration/extensions/MethodHandler.java | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) (limited to 'extensions/qa') diff --git a/extensions/qa/integration/extensions/MethodHandler.java b/extensions/qa/integration/extensions/MethodHandler.java index b2a56037b4a6..c362fae60609 100644 --- a/extensions/qa/integration/extensions/MethodHandler.java +++ b/extensions/qa/integration/extensions/MethodHandler.java @@ -25,22 +25,19 @@ import com.sun.star.inspection.*; public class MethodHandler implements XPropertyHandler { - private XComponentContext m_context; private XIntrospection m_introspection; - private XIntrospectionAccess m_introspectionAccess; private XIdlMethod[] m_methods; private java.util.HashMap m_methodsHash; /** Creates a new instance of MethodHandler */ public MethodHandler( XComponentContext _context ) { - m_context = _context; m_methodsHash = new java.util.HashMap(); try { m_introspection = UnoRuntime.queryInterface( XIntrospection.class, - m_context.getServiceManager().createInstanceWithContext( "com.sun.star.beans.Introspection", m_context ) + _context.getServiceManager().createInstanceWithContext( "com.sun.star.beans.Introspection", _context ) ); } catch( com.sun.star.uno.Exception e ) @@ -162,15 +159,14 @@ public class MethodHandler implements XPropertyHandler if ( m_introspection == null ) return; - m_introspectionAccess = null; m_methods = null; m_methodsHash = new java.util.HashMap(); - m_introspectionAccess = m_introspection.inspect( _component ); - if ( m_introspectionAccess == null ) + XIntrospectionAccess introspectionAccess = m_introspection.inspect( _component ); + if ( introspectionAccess == null ) return; - m_methods = m_introspectionAccess.getMethods( MethodConcept.ALL ); + m_methods = introspectionAccess.getMethods( MethodConcept.ALL ); } public boolean isComposable(String _propertyName) throws com.sun.star.beans.UnknownPropertyException -- cgit v1.2.3