summaryrefslogtreecommitdiff
path: root/reportbuilder
diff options
context:
space:
mode:
authorNoel Grandin <noel@peralex.com>2014-11-12 09:55:57 +0200
committerNoel Grandin <noelgrandin@gmail.com>2014-11-12 11:03:29 +0000
commitbb437029c1e5331bcc3f8fb2fc87837142a52f33 (patch)
tree56bde4059792a5284e90ae3b10ee4388cc913a54 /reportbuilder
parent84f7f412bfc9e18b1ff8b133ceda7757eae28c36 (diff)
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 <gerrit@libreoffice.org> Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
Diffstat (limited to 'reportbuilder')
-rw-r--r--reportbuilder/java/org/libreoffice/report/pentaho/SOFormulaParser.java6
-rw-r--r--reportbuilder/java/org/libreoffice/report/pentaho/StarFunctionDescription.java6
2 files changed, 3 insertions, 9 deletions
diff --git a/reportbuilder/java/org/libreoffice/report/pentaho/SOFormulaParser.java b/reportbuilder/java/org/libreoffice/report/pentaho/SOFormulaParser.java
index 7918826702ea..24bf1a682d3e 100644
--- a/reportbuilder/java/org/libreoffice/report/pentaho/SOFormulaParser.java
+++ b/reportbuilder/java/org/libreoffice/report/pentaho/SOFormulaParser.java
@@ -64,7 +64,6 @@ public final class SOFormulaParser extends ComponentBase
public static final int UNARY_OPERATORS = 2;
public static final int BINARY_OPERATORS = 3;
public static final int FUNCTIONS = 4;
- private final XComponentContext m_xContext;
private final PropertySetMixin m_prophlp;
private static final String __serviceName = "com.sun.star.report.meta.FormulaParser";
private static final String OPERATORS = "org.pentaho.reporting.libraries.formula.operators.";
@@ -82,14 +81,13 @@ public final class SOFormulaParser extends ComponentBase
public SOFormulaParser(final XComponentContext context)
{
- m_xContext = context;
final ClassLoader cl = java.lang.Thread.currentThread().getContextClassLoader();
Thread.currentThread().setContextClassLoader(this.getClass().getClassLoader());
parser = new FormulaParser();
try
{
- final XFormulaOpCodeMapper mapper = UnoRuntime.queryInterface(XFormulaOpCodeMapper.class, m_xContext.getServiceManager().createInstanceWithContext("simple.formula.FormulaOpCodeMapperObj", m_xContext));
+ final XFormulaOpCodeMapper mapper = UnoRuntime.queryInterface(XFormulaOpCodeMapper.class, context.getServiceManager().createInstanceWithContext("simple.formula.FormulaOpCodeMapperObj", context));
FormulaOpCodeMapEntry[] opCodes = mapper.getAvailableMappings(FormulaLanguage.ODFF, FormulaMapGroup.FUNCTIONS);
final DefaultFormulaContext defaultContext = new DefaultFormulaContext();
final FunctionRegistry functionRegistry = defaultContext.getFunctionRegistry();
@@ -136,7 +134,7 @@ public final class SOFormulaParser extends ComponentBase
// for your optional attributes if necessary. See the documentation
// of the PropertySetMixin helper for further information.
// Ensure that your attributes are initialized correctly!
- m_prophlp = new PropertySetMixin(m_xContext, this,
+ m_prophlp = new PropertySetMixin(context, this,
new Type(com.sun.star.report.meta.XFormulaParser.class), null);
}
diff --git a/reportbuilder/java/org/libreoffice/report/pentaho/StarFunctionDescription.java b/reportbuilder/java/org/libreoffice/report/pentaho/StarFunctionDescription.java
index 832137e2a4f4..b743ae08e4a1 100644
--- a/reportbuilder/java/org/libreoffice/report/pentaho/StarFunctionDescription.java
+++ b/reportbuilder/java/org/libreoffice/report/pentaho/StarFunctionDescription.java
@@ -34,17 +34,13 @@ public final class StarFunctionDescription extends WeakBase
implements com.sun.star.report.meta.XFunctionDescription
{
- private final XComponentContext m_xContext;
private final PropertySetMixin m_prophlp;
- // attributes
-// final private com.sun.star.report.meta.XFunctionCategory m_Category;
private final FunctionDescription functionDescription;
private final XFunctionCategory category;
private final Locale defaultLocale;
public StarFunctionDescription(final DefaultFormulaContext defaultContext, final XComponentContext context, final XFunctionCategory category, final FunctionDescription functionDescription)
{
- m_xContext = context;
this.category = category;
Locale locale;
try
@@ -63,7 +59,7 @@ public final class StarFunctionDescription extends WeakBase
// for your optional attributes if necessary. See the documentation
// of the PropertySetMixin helper for further information.
// Ensure that your attributes are initialized correctly!
- m_prophlp = new PropertySetMixin(m_xContext, this,
+ m_prophlp = new PropertySetMixin(context, this,
new Type(com.sun.star.report.meta.XFunctionDescription.class), null);
}