Пример #1
0
 @Override
 public String getNodeName() {
   DBSObject object = getObject();
   if (object == null) {
     return DBConstants.NULL_VALUE_LABEL;
   }
   String objectName;
   if (object instanceof DBPOverloadedObject) {
     objectName = ((DBPOverloadedObject) object).getOverloadedName();
   } else {
     objectName = object.getName();
   }
   if (CommonUtils.isEmpty(objectName)) {
     objectName = object.toString();
     if (CommonUtils.isEmpty(objectName)) {
       objectName = object.getClass().getName() + "@" + object.hashCode(); // $NON-NLS-1$
     }
   }
   /*
           if (object instanceof DBSObjectUnique) {
               String uniqueName = ((DBSObjectUnique) object).getUniqueName();
               if (!uniqueName.equals(objectName)) {
                   if (uniqueName.startsWith(objectName)) {
                       uniqueName = uniqueName.substring(objectName.length());
                   }
                   objectName += " (" + uniqueName + ")";
               }
           }
   */
   return objectName;
 }
Пример #2
0
 private static boolean equalObjects(DBSObject object1, DBSObject object2) {
   if (object1 == object2) {
     return true;
   }
   if (object1 == null || object2 == null) {
     return false;
   }
   while (object1 != null && object2 != null) {
     if (object1.getClass() != object2.getClass()
         || !CommonUtils.equalObjects(
             DBUtils.getObjectUniqueName(object1), DBUtils.getObjectUniqueName(object2))) {
       return false;
     }
     object1 = object1.getParentObject();
     object2 = object2.getParentObject();
   }
   return true;
 }