(Eclipse Window Builder) java.lang.IllegalArgumentException: несоответствие типов аргументов - PullRequest
0 голосов
/ 05 июля 2019

Я пытаюсь выяснить, почему на вкладке дизайна Window Builder отображается ошибка.

Код компилируется и работает нормально, но когда Window Builder пытается его проанализировать (когда я открываю вкладку дизайна), возникает исключение ниже.

Это ошибка в Window Builder?

Поскольку в исключении не упоминается ни один мой код, я не смог найти никаких подсказок в трассировке стека, кроме тех, которые выполняют отражение.

new CustomerInfoSection(customerInfo, this)



Internal Error

WindowBuilder encountered unexpected internal error. 

This could be caused by a WindowBuilder bug or by a misconfiguration issue, conflict, partial update, etc.

java.lang.IllegalArgumentException: argument type mismatch





Hide stack trace. 



Stack trace:
java.lang.IllegalArgumentException: argument type mismatch
    at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
    at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)
    at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source)
    at java.lang.reflect.Constructor.newInstance(Unknown Source)
    at org.eclipse.wb.internal.swing.model.component.SwingInvocationEvaluatorInterceptor.evaluateSwing(SwingInvocationEvaluatorInterceptor.java:73)
    at org.eclipse.wb.internal.swing.model.component.SwingInvocationEvaluatorInterceptor.evaluate(SwingInvocationEvaluatorInterceptor.java:59)
    at org.eclipse.wb.internal.core.eval.evaluators.InvocationEvaluator.tryInterceptors(InvocationEvaluator.java:378)
    at org.eclipse.wb.internal.core.eval.evaluators.InvocationEvaluator.evaluate(InvocationEvaluator.java:255)
    at org.eclipse.wb.internal.core.eval.evaluators.InvocationEvaluator.evaluate(InvocationEvaluator.java:81)
    at org.eclipse.wb.core.eval.AstEvaluationEngine.evaluate0(AstEvaluationEngine.java:177)
    at org.eclipse.wb.core.eval.AstEvaluationEngine.evaluate(AstEvaluationEngine.java:61)
    at org.eclipse.wb.internal.core.model.JavaInfoEvaluationHelper.evaluateExpression(JavaInfoEvaluationHelper.java:630)
    at org.eclipse.wb.internal.core.model.JavaInfoEvaluationHelper.evaluate(JavaInfoEvaluationHelper.java:502)
    at org.eclipse.wb.core.model.JavaInfo$8.postVisit(JavaInfo.java:1143)
    at sun.reflect.GeneratedMethodAccessor93.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
    at java.lang.reflect.Method.invoke(Unknown Source)
    at org.eclipse.wb.core.eval.ExecutionFlowUtils$1.intercept(ExecutionFlowUtils.java:399)
    at org.eclipse.jdt.core.dom.ASTVisitor$$EnhancerByCGLIB$$b546b182.postVisit(<generated>)
    at org.eclipse.jdt.core.dom.ASTNode.accept(ASTNode.java:2803)
    at org.eclipse.jdt.core.dom.ASTNode.acceptChild(ASTNode.java:2848)
    at org.eclipse.jdt.core.dom.Assignment.accept0(Assignment.java:303)
    at org.eclipse.jdt.core.dom.ASTNode.accept(ASTNode.java:2800)
    at org.eclipse.jdt.core.dom.ASTNode.acceptChild(ASTNode.java:2848)
    at org.eclipse.jdt.core.dom.ExpressionStatement.accept0(ExpressionStatement.java:136)
    at org.eclipse.jdt.core.dom.ASTNode.accept(ASTNode.java:2800)
    at org.eclipse.wb.core.eval.ExecutionFlowUtils.visitStatement0(ExecutionFlowUtils.java:354)
    at org.eclipse.wb.core.eval.ExecutionFlowUtils.visitStatement(ExecutionFlowUtils.java:315)
    at org.eclipse.wb.core.eval.ExecutionFlowUtils.visitStatement0(ExecutionFlowUtils.java:336)
    at org.eclipse.wb.core.eval.ExecutionFlowUtils.visitStatement(ExecutionFlowUtils.java:315)
    at org.eclipse.wb.core.eval.ExecutionFlowUtils.visit(ExecutionFlowUtils.java:247)
    at org.eclipse.wb.core.eval.ExecutionFlowUtils.visit(ExecutionFlowUtils.java:228)
    at org.eclipse.wb.core.eval.ExecutionFlowUtils.visit(ExecutionFlowUtils.java:191)
    at org.eclipse.wb.core.model.JavaInfo.refresh_create(JavaInfo.java:1199)
    at org.eclipse.wb.core.model.ObjectInfo.refreshCreate0(ObjectInfo.java:550)
    at org.eclipse.wb.core.model.ObjectInfo.access$0(ObjectInfo.java:546)
    at org.eclipse.wb.core.model.ObjectInfo$5$1.run(ObjectInfo.java:486)
    at org.eclipse.wb.internal.core.utils.execution.ExecutionUtils.runDesignTime(ExecutionUtils.java:145)
    at org.eclipse.wb.core.model.ObjectInfo$5.run(ObjectInfo.java:484)
    at org.eclipse.wb.internal.swing.utils.SwingUtils$2.run(SwingUtils.java:76)
    at java.awt.event.InvocationEvent.dispatch(Unknown Source)
    at java.awt.EventQueue.dispatchEventImpl(Unknown Source)
    at java.awt.EventQueue.access$500(Unknown Source)
    at java.awt.EventQueue$3.run(Unknown Source)
    at java.awt.EventQueue$3.run(Unknown Source)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(Unknown Source)
    at java.awt.EventQueue.dispatchEvent(Unknown Source)
    at java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source)
    at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)
    at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
    at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
    at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
    at java.awt.EventDispatchThread.run(Unknown Source)


Full context stack trace:
java.lang.IllegalArgumentException: argument type mismatch
    at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
    at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)
    at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source)
    at java.lang.reflect.Constructor.newInstance(Unknown Source)
    at org.eclipse.wb.internal.swing.model.component.SwingInvocationEvaluatorInterceptor.evaluateSwing(SwingInvocationEvaluatorInterceptor.java:73)
    at org.eclipse.wb.internal.swing.model.component.SwingInvocationEvaluatorInterceptor.evaluate(SwingInvocationEvaluatorInterceptor.java:59)
    at org.eclipse.wb.internal.core.eval.evaluators.InvocationEvaluator.tryInterceptors(InvocationEvaluator.java:378)
    at org.eclipse.wb.internal.core.eval.evaluators.InvocationEvaluator.evaluate(InvocationEvaluator.java:255)
    at org.eclipse.wb.internal.core.eval.evaluators.InvocationEvaluator.evaluate(InvocationEvaluator.java:81)
    at org.eclipse.wb.core.eval.AstEvaluationEngine.evaluate0(AstEvaluationEngine.java:177)
    at org.eclipse.wb.core.eval.AstEvaluationEngine.evaluate(AstEvaluationEngine.java:61)
    at org.eclipse.wb.internal.core.model.JavaInfoEvaluationHelper.evaluateExpression(JavaInfoEvaluationHelper.java:630)
    at org.eclipse.wb.internal.core.model.JavaInfoEvaluationHelper.evaluate(JavaInfoEvaluationHelper.java:502)
    at org.eclipse.wb.core.model.JavaInfo$8.postVisit(JavaInfo.java:1143)
    at sun.reflect.GeneratedMethodAccessor93.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
    at java.lang.reflect.Method.invoke(Unknown Source)
    at org.eclipse.wb.core.eval.ExecutionFlowUtils$1.intercept(ExecutionFlowUtils.java:399)
    at org.eclipse.jdt.core.dom.ASTVisitor$$EnhancerByCGLIB$$b546b182.postVisit(<generated>)
    at org.eclipse.jdt.core.dom.ASTNode.accept(ASTNode.java:2803)
    at org.eclipse.jdt.core.dom.ASTNode.acceptChild(ASTNode.java:2848)
    at org.eclipse.jdt.core.dom.Assignment.accept0(Assignment.java:303)
    at org.eclipse.jdt.core.dom.ASTNode.accept(ASTNode.java:2800)
    at org.eclipse.jdt.core.dom.ASTNode.acceptChild(ASTNode.java:2848)
    at org.eclipse.jdt.core.dom.ExpressionStatement.accept0(ExpressionStatement.java:136)
    at org.eclipse.jdt.core.dom.ASTNode.accept(ASTNode.java:2800)
    at org.eclipse.wb.core.eval.ExecutionFlowUtils.visitStatement0(ExecutionFlowUtils.java:354)
    at org.eclipse.wb.core.eval.ExecutionFlowUtils.visitStatement(ExecutionFlowUtils.java:315)
    at org.eclipse.wb.core.eval.ExecutionFlowUtils.visitStatement0(ExecutionFlowUtils.java:336)
    at org.eclipse.wb.core.eval.ExecutionFlowUtils.visitStatement(ExecutionFlowUtils.java:315)
    at org.eclipse.wb.core.eval.ExecutionFlowUtils.visit(ExecutionFlowUtils.java:247)
    at org.eclipse.wb.core.eval.ExecutionFlowUtils.visit(ExecutionFlowUtils.java:228)
    at org.eclipse.wb.core.eval.ExecutionFlowUtils.visit(ExecutionFlowUtils.java:191)
    at org.eclipse.wb.core.model.JavaInfo.refresh_create(JavaInfo.java:1199)
    at org.eclipse.wb.core.model.ObjectInfo.refreshCreate0(ObjectInfo.java:550)
    at org.eclipse.wb.core.model.ObjectInfo.access$0(ObjectInfo.java:546)
    at org.eclipse.wb.core.model.ObjectInfo$5$1.run(ObjectInfo.java:486)
    at org.eclipse.wb.internal.core.utils.execution.ExecutionUtils.runDesignTime(ExecutionUtils.java:145)
    at org.eclipse.wb.core.model.ObjectInfo$5.run(ObjectInfo.java:484)
    at org.eclipse.wb.internal.swing.utils.SwingUtils$2.run(SwingUtils.java:76)
    at java.awt.event.InvocationEvent.dispatch(Unknown Source)
    at java.awt.EventQueue.dispatchEventImpl(Unknown Source)
    at java.awt.EventQueue.access$500(Unknown Source)
    at java.awt.EventQueue$3.run(Unknown Source)
    at java.awt.EventQueue$3.run(Unknown Source)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(Unknown Source)
    at java.awt.EventQueue.dispatchEvent(Unknown Source)
    at java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source)
    at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)
    at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
    at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
    at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
    at java.awt.EventDispatchThread.run(Unknown Source)

Это фрагмент, где происходит ошибка и соответствующий код:

this.customerInfoSection = new CustomerInfoSection(customerInfo, this);

CustomerInfoSection.java

package testwindowbuilder;

import java.util.Objects;

import javax.swing.ImageIcon;
import javax.swing.JButton;
import javax.swing.JPanel;

public class CustomerInfoSection extends JPanel {

    private static final long serialVersionUID = 1L;

    private JButton btnImprimir;
    private boolean isLoadingIconShowing = false;

    private final CustomerInfo customerInfo;
    private final JDViewCustomer jDViewCustomer;

    public CustomerInfoSection(CustomerInfo customerInfo, JDViewCustomer jDViewCustomer) {
        this.customerInfo = Objects.requireNonNull(customerInfo);
        this.jDViewCustomer = Objects.requireNonNull(jDViewCustomer);
    }

    public CustomerInfo getCustomerInfo() {
        return customerInfo;
    }

    public boolean isLoadingIconShowing() {
        return this.isLoadingIconShowing;
    }

    public void setLoadingIconVisibility(boolean showing) {
        btnImprimir.setIcon(new ImageIcon(JDViewCustomer.class.getResource(
                "/deliveryappconnect/images/loading.gif")));

        btnImprimir.setEnabled(!showing);
        isLoadingIconShowing = showing;
    }
}

JDViewCustomer.java

package testwindowbuilder;

import javax.swing.BoxLayout;
import javax.swing.JPanel;

import net.sf.jasperreports.engine.JRException;

public class JDViewCustomer extends javax.swing.JDialog {

    private static final long serialVersionUID = 1L;

    private final CustomerInfoSection customerInfoSection;

    private JPanel panelContainingTheOtherPanels;

    private final int customerId;

    public JDViewCustomer(java.awt.Frame parent, boolean modal, CustomerInfo customerInfo,
            int customerId, int maxPage) {
        super(parent, modal);
        this.customerInfoSection = new CustomerInfoSection(customerInfo, this);
        this.customerId = customerId;

        getContentPane().setLayout(new BoxLayout(getContentPane(), BoxLayout.Y_AXIS));

        panelContainingTheOtherPanels = new JPanel();
        panelContainingTheOtherPanels.setLayout(new BoxLayout(panelContainingTheOtherPanels, BoxLayout.Y_AXIS));
        getContentPane().add(panelContainingTheOtherPanels);

        panelContainingTheOtherPanels.add(customerInfoSection);

        initComponents();
    }

    public void loadCustomerOrdersAndGenerateReport() throws JRException {

        if (false == customerInfoSection.isLoadingIconShowing()) {
            customerInfoSection.setLoadingIconVisibility(true);
        }
    }

    private void initComponents() {

        setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE);
        setTitle("Ver Cliente");

        pack();

        setLocationRelativeTo(getParent());

    }

    public void setLoadingIconVisibility(boolean showing) {
        customerInfoSection.setLoadingIconVisibility(showing);
    }
}

CustomerInfo.java

package testwindowbuilder;

import java.time.LocalDate;

public class CustomerInfo {

    private final int orderNumber;
    private final String name;
    private final String email;
    private final LocalDate birthday;
    private final String ddd;
    private final String phone;
    private final String observacao;

    public CustomerInfo(int orderNumber, String name, String email, LocalDate birthday, String ddd, String phone, String observacao) {
        this.orderNumber = orderNumber;
        this.name = name;
        this.email = email;
        this.birthday = birthday;
        this.ddd = ddd;
        this.phone = phone;
        this.observacao = observacao;
    }

    public int getOrderNumber() {
        return orderNumber;
    }

    public String getName() {
        return name;
    }

    public String getEmail() {
        return email;
    }

    public LocalDate getBirthday() {
        return birthday;
    }

    public String getDdd() {
        return ddd;
    }

    public String getPhone() {
        return phone;
    }

    public String getObservacao() {
        return observacao;
    }
}
Добро пожаловать на сайт PullRequest, где вы можете задавать вопросы и получать ответы от других членов сообщества.
...