/** ***************************************************************************** */ BuenoLocationStatic(String proj, String nm, String ins, boolean after) { BumpClient bcc = BumpClient.getBump(); project_name = proj; package_name = null; class_name = null; location_file = null; insert_name = ins; insert_after = after; List<BumpLocation> locs = null; if (nm != null && nm.indexOf("<") < 0) locs = bcc.findPackage(proj, nm); if (locs != null && locs.size() > 0) { BumpLocation loc = locs.get(0); if (loc.getProject() != null) project_name = loc.getProject(); location_file = loc.getFile(); class_name = null; package_name = nm; } else if (nm != null) { locs = bcc.findClassDefinition(proj, nm); if (locs != null && locs.size() > 0) { BumpLocation loc = locs.get(0); // Is this always correct? if (loc.getProject() != null) project_name = loc.getProject(); location_file = loc.getFile(); String snm = loc.getSymbolName(); class_name = snm; String key = loc.getKey(); int ct = 0; for (int i = key.indexOf('$'); i >= 0; i = key.indexOf('$', i + 1)) ct++; int idx = snm.lastIndexOf("."); if (ct > 0) { for (int j = 0; idx > 0 && j < ct; ++j) { idx = snm.lastIndexOf(".", idx - 1); } } if (idx > 0) package_name = snm.substring(0, idx); } } }