加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 编程开发 > Java > 正文

java – Eclipse查找方法的引用

发布时间:2020-12-14 16:43:08 所属栏目:Java 来源:网络整理
导读:我想找到以下类的方法“get”的所有调用者: package com.zzz.zzz.zzz.services;public final class EMF { private static final EntityManagerFactory emfInstance = Persistence.createEntityManagerFactory("obamaCareIsGood4U"); private EMF() {} publi
我想找到以下类的方法“get”的所有调用者:
package com.zzz.zzz.zzz.services;

public final class EMF {
  private static final EntityManagerFactory emfInstance =
    Persistence.createEntityManagerFactory("obamaCareIsGood4U");

  private EMF() {}

  public static EntityManagerFactory get() {
    return emfInstance;
  }
}

所以我把文本“get”和右键单击引用 – 项目.但是它返回引用每个叫做“get”的方法,而不是仅仅引用com.zzz.zzz.zzz.services.EMF.get().

这是一个eclipse bug吗?如何让Eclipse仅显示对com.zzz.zzz.zzz.services.EMF.get()的引用?

Eclipse Platform  Version:
4.2.0.v20120608-135145-9JF7BHV8FyMteji0Oi_ePMz0xuZ8TVo7lV0z0ecb
Build id:
I20120608-1400,Spring Tool Suite Version: 3.0.0.M3 Build Id: 201207050802

参考搜索输出:

com.google.common.base - guava-12.0.jar - C:UsersSofiaVergara.m2repositorycomgoogleguavaguava12.0 - PatientCare
com.google.common.base - guava-gwt-12.0.jar - C:UsersSofiaVergara.m2repositorycomgoogleguavaguava-gwt12.0 - PatientCare
com.google.gwt.junit.server - gwt-user-2.4.0.jar - C:UsersSofiaVergara.m2repositorycomgooglegwtgwt-user2.4.0 - PatientCare
com.google.gwt.requestfactory.server - gwt-servlet-2.2.0.jar - C:UsersSofiaVergara.m2repositorycomgooglegwtgwt-servlet2.2.0 - PatientCare
com.google.gwt.resources.rg - gwt-user-2.4.0.jar - C:UsersSofiaVergara.m2repositorycomgooglegwtgwt-user2.4.0 - PatientCare
com.google.gwt.user.cellview.client - gwt-servlet-2.2.0.jar - C:UsersSofiaVergara.m2repositorycomgooglegwtgwt-servlet2.2.0 - PatientCare
com.google.gwt.validation.rebind - gwt-user-2.4.0.jar - C:UsersSofiaVergara.m2repositorycomgooglegwtgwt-user2.4.0 - PatientCare
com.google.web.bindery.requestfactory.apt - gwt-user-2.4.0.jar - C:UsersSofiaVergara.m2repositorycomgooglegwtgwt-user2.4.0 - PatientCare
com.google.web.bindery.requestfactory.gwt.rebind.model - gwt-user-2.4.0.jar - C:UsersSofiaVergara.m2repositorycomgooglegwtgwt-user2.4.0 - PatientCare
com.google.web.bindery.requestfactory.vm - gwt-user-2.4.0.jar - C:UsersSofiaVergara.m2repositorycomgooglegwtgwt-user2.4.0 - PatientCare
com.zzz.zzz.zzz.PatientCare.services.impl - src/main/java/server - PatientCare
com.sun.istack - jaxb-impl-2.2.4.jar - C:UsersSofiaVergara.m2repositorycomsunxmlbindjaxb-impl2.2.4 - PatientCare
com.sun.xml.bind.v2 - jaxb-impl-2.2.4.jar - C:UsersSofiaVergara.m2repositorycomsunxmlbindjaxb-impl2.2.4 - PatientCare
com.sun.xml.bind.v2.runtime - jaxb-impl-2.2.4.jar - C:UsersSofiaVergara.m2repositorycomsunxmlbindjaxb-impl2.2.4 - PatientCare
com.sun.xml.bind.v2.runtime.output - jaxb-impl-2.2.4.jar - C:UsersSofiaVergara.m2repositorycomsunxmlbindjaxb-impl2.2.4 - PatientCare
com.sun.xml.bind.v2.runtime.property - jaxb-impl-2.2.4.jar - C:UsersSofiaVergara.m2repositorycomsunxmlbindjaxb-impl2.2.4 - PatientCare
com.sun.xml.bind.v2.runtime.reflect - jaxb-impl-2.2.4.jar - C:UsersSofiaVergara.m2repositorycomsunxmlbindjaxb-impl2.2.4 - PatientCare
com.sun.xml.bind.v2.runtime.reflect.opt - jaxb-impl-2.2.4.jar - C:UsersSofiaVergara.m2repositorycomsunxmlbindjaxb-impl2.2.4 - PatientCare
com.sun.xml.bind.v2.runtime.unmarshaller - jaxb-impl-2.2.4.jar - C:UsersSofiaVergara.m2repositorycomsunxmlbindjaxb-impl2.2.4 - PatientCare
javax.persistence.spi - hibernate-jpa-2.0-api-1.0.1.Final.jar - C:UsersSofiaVergara.m2repositoryorghibernatejavaxpersistencehibernate-jpa-2.0-api1.0.1.Final - PatientCare
javax.xml.bind - jaxb-api-2.2.3.jar - C:UsersSofiaVergara.m2repositoryjavaxxmlbindjaxb-api2.2.3 - PatientCare
org.codehaus.jackson - jackson-core-asl-1.8.5.jar - C:UsersSofiaVergara.m2repositoryorgcodehausjacksonjackson-core-asl1.8.5 - PatientCare
org.codehaus.jackson.impl - jackson-core-asl-1.8.5.jar - C:UsersSofiaVergara.m2repositoryorgcodehausjacksonjackson-core-asl1.8.5 - PatientCare
org.codehaus.jackson.io - jackson-core-asl-1.8.5.jar - C:UsersSofiaVergara.m2repositoryorgcodehausjacksonjackson-core-asl1.8.5 - PatientCare
org.codehaus.jackson.map.ext - jackson-mapper-asl-1.8.5.jar - C:UsersSofiaVergara.m2repositoryorgcodehausjacksonjackson-mapper-asl1.8.5 - PatientCare
org.codehaus.jackson.map.ser - jackson-mapper-asl-1.8.5.jar - C:UsersSofiaVergara.m2repositoryorgcodehausjacksonjackson-mapper-asl1.8.5 - PatientCare
org.fusesource.restygwt.client.dispatcher - restygwt-1.3-SNAPSHOT.jar - C:UsersSofiaVergara.m2repositoryorgfusesourcerestygwtrestygwt1.3-SNAPSHOT - PatientCare
org.hibernate.context - hibernate-core-3.6.10.Final.jar - C:UsersSofiaVergara.m2repositoryorghibernatehibernate-core3.6.10.Final - PatientCare
org.hibernate.stat - hibernate-core-3.6.10.Final.jar - C:UsersSofiaVergara.m2repositoryorghibernatehibernate-core3.6.10.Final - PatientCare
org.hibernate.util - hibernate-core-3.6.10.Final.jar - C:UsersSofiaVergara.m2repositoryorghibernatehibernate-core3.6.10.Final - PatientCare
org.hibernate.validator.internal.util - hibernate-validator-4.3.0.Final.jar - C:UsersSofiaVergara.m2repositoryorghibernatehibernate-validator4.3.0.Final - PatientCare
org.hibernate.validator.internal.util.scriptengine - hibernate-validator-4.3.0.Final.jar - C:UsersSofiaVergara.m2repositoryorghibernatehibernate-validator4.3.0.Final - PatientCare
org.jboss.resteasy.client - resteasy-jaxrs-2.3.4.Final.jar - C:UsersSofiaVergara.m2repositoryorgjbossresteasyresteasy-jaxrs2.3.4.Final - PatientCare
org.jboss.resteasy.client.cache - resteasy-jaxrs-2.3.4.Final.jar - C:UsersSofiaVergara.m2repositoryorgjbossresteasyresteasy-jaxrs2.3.4.Final - PatientCare
org.jboss.resteasy.core - resteasy-jaxrs-2.3.4.Final.jar - C:UsersSofiaVergara.m2repositoryorgjbossresteasyresteasy-jaxrs2.3.4.Final - PatientCare
org.jboss.resteasy.spi - resteasy-jaxrs-2.3.4.Final.jar - C:UsersSofiaVergara.m2repositoryorgjbossresteasyresteasy-jaxrs2.3.4.Final - PatientCare
org.jboss.resteasy.util - resteasy-jaxrs-2.3.4.Final.jar - C:UsersSofiaVergara.m2repositoryorgjbossresteasyresteasy-jaxrs2.3.4.Final - PatientCare

解决方法

在项目中查找引用依赖于方法名称,这就是为什么它不准确.尝试使用呼叫层次结构.

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读