IDEMPIERE-2544:to more warning compiler hidden good warning

code warning
This commit is contained in:
hieplq 2017-12-03 14:37:20 +01:00
parent 0305e1bf32
commit 7245687377
3 changed files with 22 additions and 15 deletions

View File

@ -101,7 +101,10 @@ Import-Package: com.sun.mail.smtp;version="1.5",
org.osgi.framework, org.osgi.framework,
org.osgi.service.cm;version="1.3.0", org.osgi.service.cm;version="1.3.0",
org.osgi.service.component;version="1.1.0", org.osgi.service.component;version="1.1.0",
org.osgi.service.component.runtime;version="1.3.0",
org.osgi.service.component.runtime.dto;version="1.3.0",
org.osgi.service.event;version="1.2.0", org.osgi.service.event;version="1.2.0",
org.osgi.util.promise;version="1.0.0",
org.osgi.util.tracker;version="1.5.0", org.osgi.util.tracker;version="1.5.0",
org.restlet, org.restlet,
org.restlet.data, org.restlet.data,

View File

@ -19,10 +19,9 @@ import java.io.FileNotFoundException;
import java.io.FileReader; import java.io.FileReader;
import java.io.IOException; import java.io.IOException;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Collection;
import java.util.List; import java.util.List;
import org.apache.felix.scr.Component;
import org.apache.felix.scr.ScrService;
import org.compiere.util.Ini; import org.compiere.util.Ini;
import org.compiere.util.Util; import org.compiere.util.Util;
import org.osgi.framework.BundleContext; import org.osgi.framework.BundleContext;
@ -30,6 +29,8 @@ import org.osgi.framework.ServiceEvent;
import org.osgi.framework.ServiceListener; import org.osgi.framework.ServiceListener;
import org.osgi.framework.ServiceReference; import org.osgi.framework.ServiceReference;
import org.osgi.service.component.ComponentConstants; import org.osgi.service.component.ComponentConstants;
import org.osgi.service.component.runtime.ServiceComponentRuntime;
import org.osgi.service.component.runtime.dto.ComponentDescriptionDTO;
/** /**
* @author hengsin * @author hengsin
@ -37,11 +38,11 @@ import org.osgi.service.component.ComponentConstants;
*/ */
public class ComponentBlackListService implements ServiceListener { public class ComponentBlackListService implements ServiceListener {
private ScrService scrService = null; private ServiceComponentRuntime scrService = null;
private List<String> blackListComponentNames = null; private List<String> blackListComponentNames = null;
protected ComponentBlackListService(BundleContext context) { protected ComponentBlackListService(BundleContext context) {
ServiceReference<ScrService> ref = context.getServiceReference(ScrService.class); ServiceReference<ServiceComponentRuntime> ref = context.getServiceReference(ServiceComponentRuntime.class);
scrService = context.getService(ref); scrService = context.getService(ref);
blackListComponentNames = new ArrayList<String>(); blackListComponentNames = new ArrayList<String>();
retrieveBlacklistCandidates(); retrieveBlacklistCandidates();
@ -89,20 +90,20 @@ public class ComponentBlackListService implements ServiceListener {
private void disableComponents() private void disableComponents()
{ {
Component[] comps = scrService.getComponents(); Collection<ComponentDescriptionDTO> comps = scrService.getComponentDescriptionDTOs();
for (Component comp : comps) { for (ComponentDescriptionDTO comp : comps) {
if (blackListComponentNames.contains(comp.getName())) { if (blackListComponentNames.contains(comp.name)) {
comp.disable(); scrService.disableComponent(comp);
} }
} }
} }
private void disableComponent(String componentName) private void disableComponent(String componentName)
{ {
Component[] comps = scrService.getComponents(); Collection<ComponentDescriptionDTO> comps = scrService.getComponentDescriptionDTOs();
for (Component comp : comps) { for (ComponentDescriptionDTO comp : comps) {
if (comp.getName().equals(componentName)) { if (comp.name.equals(componentName)) {
comp.disable(); scrService.disableComponent(comp);
break; break;
} }
} }

View File

@ -2,10 +2,12 @@ package org.adempiere.report.jasper;
import java.awt.Graphics2D; import java.awt.Graphics2D;
import java.awt.geom.Rectangle2D; import java.awt.geom.Rectangle2D;
import net.sf.jasperreports.engine.JRAbstractSvgRenderer; import net.sf.jasperreports.engine.JRException;
import net.sf.jasperreports.engine.JasperReportsContext;
import net.sf.jasperreports.renderers.AbstractRenderToImageDataRenderer;
import net.sourceforge.barbecue.Barcode; import net.sourceforge.barbecue.Barcode;
public class Barbecue extends JRAbstractSvgRenderer public class Barbecue extends AbstractRenderToImageDataRenderer
{ {
private static final long serialVersionUID = 5112469398754718739L; private static final long serialVersionUID = 5112469398754718739L;
@ -29,7 +31,8 @@ public class Barbecue extends JRAbstractSvgRenderer
m_barcode.setDrawingText(showDrawingText); m_barcode.setDrawingText(showDrawingText);
} }
public void render(Graphics2D grx, Rectangle2D rectangle) @Override
public void render(JasperReportsContext jasperReportsContext, Graphics2D grx, Rectangle2D rectangle) throws JRException
{ {
try try
{ {