public synchronized boolean equals(java.lang.Object obj) {
   if (!(obj instanceof WarningListType)) return false;
   WarningListType other = (WarningListType) obj;
   if (obj == null) return false;
   if (this == obj) return true;
   if (__equalsCalc != null) {
     return (__equalsCalc == obj);
   }
   __equalsCalc = obj;
   boolean _equals;
   _equals =
       true
           && ((this.phraseIgnored == null && other.getPhraseIgnored() == null)
               || (this.phraseIgnored != null
                   && java.util.Arrays.equals(this.phraseIgnored, other.getPhraseIgnored())))
           && ((this.quotedPhraseNotFound == null && other.getQuotedPhraseNotFound() == null)
               || (this.quotedPhraseNotFound != null
                   && java.util.Arrays.equals(
                       this.quotedPhraseNotFound, other.getQuotedPhraseNotFound())))
           && ((this.outputMessage == null && other.getOutputMessage() == null)
               || (this.outputMessage != null
                   && java.util.Arrays.equals(this.outputMessage, other.getOutputMessage())));
   __equalsCalc = null;
   return _equals;
 }
Пример #2
0
  public boolean equals(SliceRange that) {
    if (that == null) return false;

    boolean this_present_start = true && this.isSetStart();
    boolean that_present_start = true && that.isSetStart();
    if (this_present_start || that_present_start) {
      if (!(this_present_start && that_present_start)) return false;
      if (!java.util.Arrays.equals(this.start, that.start)) return false;
    }

    boolean this_present_finish = true && this.isSetFinish();
    boolean that_present_finish = true && that.isSetFinish();
    if (this_present_finish || that_present_finish) {
      if (!(this_present_finish && that_present_finish)) return false;
      if (!java.util.Arrays.equals(this.finish, that.finish)) return false;
    }

    boolean this_present_reversed = true;
    boolean that_present_reversed = true;
    if (this_present_reversed || that_present_reversed) {
      if (!(this_present_reversed && that_present_reversed)) return false;
      if (this.reversed != that.reversed) return false;
    }

    boolean this_present_count = true;
    boolean that_present_count = true;
    if (this_present_count || that_present_count) {
      if (!(this_present_count && that_present_count)) return false;
      if (this.count != that.count) return false;
    }

    return true;
  }
 public synchronized boolean equals(java.lang.Object obj) {
   if (!(obj instanceof ExecuteListViewResult)) return false;
   ExecuteListViewResult other = (ExecuteListViewResult) obj;
   if (obj == null) return false;
   if (this == obj) return true;
   if (__equalsCalc != null) {
     return (__equalsCalc == obj);
   }
   __equalsCalc = obj;
   boolean _equals;
   _equals =
       true
           && ((this.columns == null && other.getColumns() == null)
               || (this.columns != null
                   && java.util.Arrays.equals(this.columns, other.getColumns())))
           && ((this.developerName == null && other.getDeveloperName() == null)
               || (this.developerName != null
                   && this.developerName.equals(other.getDeveloperName())))
           && this.done == other.isDone()
           && ((this.id == null && other.getId() == null)
               || (this.id != null && this.id.equals(other.getId())))
           && ((this.label == null && other.getLabel() == null)
               || (this.label != null && this.label.equals(other.getLabel())))
           && ((this.records == null && other.getRecords() == null)
               || (this.records != null
                   && java.util.Arrays.equals(this.records, other.getRecords())))
           && this.size == other.getSize();
   __equalsCalc = null;
   return _equals;
 }
  private boolean checkBroadcastMergeJoin(DualInputPlanNode join, SingleInputPlanNode reducer) {
    if (DriverStrategy.MERGE == join.getDriverStrategy()) {
      // driver keys
      Assert.assertEquals(set0, join.getKeysForInput1());
      Assert.assertEquals(set0, join.getKeysForInput2());

      // local strategies
      Assert.assertEquals(LocalStrategy.SORT, join.getInput1().getLocalStrategy());
      Assert.assertEquals(LocalStrategy.SORT, join.getInput2().getLocalStrategy());
      Assert.assertEquals(LocalStrategy.COMBININGSORT, reducer.getInput().getLocalStrategy());

      // local strategy keys
      Assert.assertEquals(set0, join.getInput1().getLocalStrategyKeys());
      Assert.assertEquals(set0, join.getInput2().getLocalStrategyKeys());
      Assert.assertTrue(
          Arrays.equals(
              join.getInput1().getLocalStrategySortOrder(),
              join.getInput2().getLocalStrategySortOrder()));
      Assert.assertEquals(set01, reducer.getInput().getLocalStrategyKeys());
      Assert.assertEquals(set01, reducer.getKeys(0));
      Assert.assertTrue(
          Arrays.equals(reducer.getInput().getLocalStrategySortOrder(), reducer.getSortOrders(0)));
      return true;
    } else {
      return false;
    }
  }
 @Action
 public void changePasword() {
   char[] trueOldPasword = user.getPassword();
   char[] passedOldPassword = oldPasswordField.getPassword();
   char[] newPassword = newPasswordField.getPassword();
   char[] confirmPassword = confirmPasswordField.getPassword();
   if (!Arrays.equals(passedOldPassword, trueOldPasword)) {
     showWarningMessage("Please enter the correct old password.", oldPasswordField);
     oldPasswordField.setText("");
     return;
   }
   if (!Arrays.equals(newPassword, confirmPassword)) {
     showWarningMessage("Your new and confirmation passwords do not match.", newPasswordField);
     newPasswordField.setText("");
     confirmPasswordField.setText("");
     return;
   }
   user.setPassword(newPassword);
   try {
     userManager.modifyUser(user);
     dispose();
     showInformationMessage("Your password has been changed!", okButton);
   } catch (PersistenceManagerException ex) {
     Logger.getLogger(PersistenceManager.class.getName()).log(Level.SEVERE, null, ex);
     showErrorMessage(ex.getMessage(), okButton);
   }
 }
 public synchronized boolean equals(java.lang.Object obj) {
   if (!(obj instanceof ContentTargeting)) return false;
   ContentTargeting other = (ContentTargeting) obj;
   if (obj == null) return false;
   if (this == obj) return true;
   if (__equalsCalc != null) {
     return (__equalsCalc == obj);
   }
   __equalsCalc = obj;
   boolean _equals;
   _equals =
       true
           && ((this.targetedContentIds == null && other.getTargetedContentIds() == null)
               || (this.targetedContentIds != null
                   && java.util.Arrays.equals(
                       this.targetedContentIds, other.getTargetedContentIds())))
           && ((this.excludedContentIds == null && other.getExcludedContentIds() == null)
               || (this.excludedContentIds != null
                   && java.util.Arrays.equals(
                       this.excludedContentIds, other.getExcludedContentIds())))
           && ((this.targetedVideoCategoryIds == null
                   && other.getTargetedVideoCategoryIds() == null)
               || (this.targetedVideoCategoryIds != null
                   && java.util.Arrays.equals(
                       this.targetedVideoCategoryIds, other.getTargetedVideoCategoryIds())))
           && ((this.excludedVideoCategoryIds == null
                   && other.getExcludedVideoCategoryIds() == null)
               || (this.excludedVideoCategoryIds != null
                   && java.util.Arrays.equals(
                       this.excludedVideoCategoryIds, other.getExcludedVideoCategoryIds())));
   __equalsCalc = null;
   return _equals;
 }
 public synchronized boolean equals(java.lang.Object obj) {
   if (!(obj instanceof TelephonySpecialNumberCustomListReturn)) return false;
   TelephonySpecialNumberCustomListReturn other = (TelephonySpecialNumberCustomListReturn) obj;
   if (obj == null) return false;
   if (this == obj) return true;
   if (__equalsCalc != null) {
     return (__equalsCalc == obj);
   }
   __equalsCalc = obj;
   boolean _equals;
   _equals =
       true
           && ((this.easyNumbers == null && other.getEasyNumbers() == null)
               || (this.easyNumbers != null
                   && java.util.Arrays.equals(this.easyNumbers, other.getEasyNumbers())))
           && ((this.staticAttributionRange == null && other.getStaticAttributionRange() == null)
               || (this.staticAttributionRange != null
                   && java.util.Arrays.equals(
                       this.staticAttributionRange, other.getStaticAttributionRange())))
           && ((this.proposedNumbers == null && other.getProposedNumbers() == null)
               || (this.proposedNumbers != null
                   && java.util.Arrays.equals(this.proposedNumbers, other.getProposedNumbers())));
   __equalsCalc = null;
   return _equals;
 }
  /** @tests java.util.Arrays#sort(float[]) */
  public void test_sort$F() {
    // Test a basic sort
    float[] reversedArray = new float[100];
    for (int counter = 0; counter < reversedArray.length; counter++) {
      reversedArray[counter] = (reversedArray.length - counter - 1);
    }
    Arrays.sort(reversedArray);
    for (int counter = 0; counter < reversedArray.length; counter++) {
      assertTrue("Assert 0: Resulting array not sorted", reversedArray[counter] == counter);
    }

    float[] specials1 =
        new float[] {
          Float.NaN,
          Float.MAX_VALUE,
          Float.MIN_VALUE,
          0f,
          -0f,
          Float.POSITIVE_INFINITY,
          Float.NEGATIVE_INFINITY
        };
    float[] specials2 =
        new float[] {
          0f,
          Float.POSITIVE_INFINITY,
          -0f,
          Float.NEGATIVE_INFINITY,
          Float.MIN_VALUE,
          Float.NaN,
          Float.MAX_VALUE
        };
    float[] answer =
        new float[] {
          Float.NEGATIVE_INFINITY,
          -0f,
          0f,
          Float.MIN_VALUE,
          Float.MAX_VALUE,
          Float.POSITIVE_INFINITY,
          Float.NaN
        };

    Arrays.sort(specials1);
    Object[] print1 = new Object[specials1.length];
    for (int i = 0; i < specials1.length; i++) {
      print1[i] = new Float(specials1[i]);
    }
    assertTrue(
        "Assert 1: specials sort incorrectly" + Arrays.asList(print1),
        Arrays.equals(specials1, answer));

    Arrays.sort(specials2);
    Object[] print2 = new Object[specials2.length];
    for (int i = 0; i < specials2.length; i++) {
      print2[i] = new Float(specials2[i]);
    }
    assertTrue(
        "Assert 2: specials sort incorrectly" + Arrays.asList(print2),
        Arrays.equals(specials2, answer));
  }
Пример #9
0
  /**
   * Validate an expected handshake on a connection.
   *
   * <p>Reads an expected handshake message from the given connected socket, parses it and validates
   * that the torrent hash_info corresponds to the torrent we're sharing, and that the peerId
   * matches the peer ID we expect to see coming from the remote peer.
   *
   * @param socket The connected socket to the remote peer.
   * @param peerId The peer ID we expect in the handshake. If <em>null</em>, any peer ID is accepted
   *     (this is the case for incoming connections).
   * @return The validated handshake message object.
   */
  private Handshake validateHandshake(Socket socket, byte[] peerId)
      throws IOException, ParseException {
    InputStream is = socket.getInputStream();

    // Read the handshake from the wire
    int pstrlen = is.read();
    byte[] data = new byte[Handshake.BASE_HANDSHAKE_LENGTH + pstrlen];
    data[0] = (byte) pstrlen;
    is.read(data, 1, data.length - 1);

    // Parse and check the handshake
    Handshake hs = Handshake.parse(ByteBuffer.wrap(data));
    if (!Arrays.equals(hs.getInfoHash(), this.torrent.getInfoHash())) {
      throw new ParseException(
          "Handshake for unknow torrent "
              + Torrent.byteArrayToHexString(hs.getInfoHash())
              + " from "
              + this.socketRepr(socket)
              + ".",
          pstrlen + 9);
    }

    if (peerId != null && !Arrays.equals(hs.getPeerId(), peerId)) {
      throw new ParseException(
          "Announced peer ID "
              + Torrent.byteArrayToHexString(hs.getPeerId())
              + " did not match expected peer ID "
              + Torrent.byteArrayToHexString(peerId)
              + ".",
          pstrlen + 29);
    }

    return hs;
  }
 @Override
 public synchronized boolean equals(java.lang.Object obj) {
   if (!(obj instanceof DFUSearchResponse)) {
     return false;
   }
   DFUSearchResponse other = (DFUSearchResponse) obj;
   if (obj == null) {
     return false;
   }
   if (this == obj) {
     return true;
   }
   if (__equalsCalc != null) {
     return (__equalsCalc == obj);
   }
   __equalsCalc = obj;
   boolean _equals;
   _equals =
       true
           && ((this.exceptions == null && other.getExceptions() == null)
               || (this.exceptions != null && this.exceptions.equals(other.getExceptions())))
           && ((this.showExample == null && other.getShowExample() == null)
               || (this.showExample != null && this.showExample.equals(other.getShowExample())))
           && ((this.clusterNames == null && other.getClusterNames() == null)
               || (this.clusterNames != null
                   && java.util.Arrays.equals(this.clusterNames, other.getClusterNames())))
           && ((this.fileTypes == null && other.getFileTypes() == null)
               || (this.fileTypes != null
                   && java.util.Arrays.equals(this.fileTypes, other.getFileTypes())));
   __equalsCalc = null;
   return _equals;
 }
Пример #11
0
 public synchronized boolean equals(java.lang.Object obj) {
   if (!(obj instanceof GetGroupUserRsp)) return false;
   GetGroupUserRsp other = (GetGroupUserRsp) obj;
   if (obj == null) return false;
   if (this == obj) return true;
   if (__equalsCalc != null) {
     return (__equalsCalc == obj);
   }
   __equalsCalc = obj;
   boolean _equals;
   _equals =
       true
           && ((this.groupList == null && other.getGroupList() == null)
               || (this.groupList != null
                   && java.util.Arrays.equals(this.groupList, other.getGroupList())))
           && ((this.groupUserList == null && other.getGroupUserList() == null)
               || (this.groupUserList != null
                   && java.util.Arrays.equals(this.groupUserList, other.getGroupUserList())))
           && ((this.returnCode == null && other.getReturnCode() == null)
               || (this.returnCode != null && this.returnCode.equals(other.getReturnCode())))
           && ((this.returnMessage == null && other.getReturnMessage() == null)
               || (this.returnMessage != null
                   && this.returnMessage.equals(other.getReturnMessage())));
   __equalsCalc = null;
   return _equals;
 }
Пример #12
0
 @Override
 public boolean equals(Object obj) {
   if (!(obj instanceof WildcardType)) return false;
   WildcardType other = (WildcardType) obj;
   return Arrays.equals(lowerBounds, other.getLowerBounds())
       && Arrays.equals(upperBounds, other.getUpperBounds());
 }
Пример #13
0
  /**
   * Checks if rasters are equal.
   *
   * @param ras1 Raster to check.
   * @return True if
   */
  public boolean equals(Object o1) {

    // ras1 = object coerced to raster

    GeospatialRaster0 ras1;

    if (!(o1 instanceof GeospatialRaster0)) {
      return false;
    } else {
      ras1 = (GeospatialRaster0) o1;
    }

    if (!Arrays.equals(this.getLatitudes(), ras1.getLatitudes())) {
      return false;
    }
    if (!Arrays.equals(this.getLongitudes(), ras1.getLongitudes())) {
      return false;
    }
    if (!Arrays.equals(this.getTimes(), ras1.getTimes())) {
      return false;
    }
    if (!Arrays.equals(this.getVerts(), ras1.getVerts())) {
      return false;
    }
    if (!sVarName.equals(ras1.sVarName)) {
      return false;
    }
    if (!sVarUnits.equals(ras1.sVarUnits)) {
      return false;
    }
    return true;
  }
Пример #14
0
 public synchronized boolean equals(java.lang.Object obj) {
   if (!(obj instanceof ParamsRequestCampaign)) return false;
   ParamsRequestCampaign other = (ParamsRequestCampaign) obj;
   if (obj == null) return false;
   if (this == obj) return true;
   if (__equalsCalc != null) {
     return (__equalsCalc == obj);
   }
   __equalsCalc = obj;
   boolean _equals;
   _equals =
       true
           && ((this.source == null && other.getSource() == null)
               || (this.source != null && this.source.equals(other.getSource())))
           && ((this.campaignId == null && other.getCampaignId() == null)
               || (this.campaignId != null && this.campaignId.equals(other.getCampaignId())))
           && ((this.leadList == null && other.getLeadList() == null)
               || (this.leadList != null
                   && java.util.Arrays.equals(this.leadList, other.getLeadList())))
           && ((this.programName == null && other.getProgramName() == null)
               || (this.programName != null && this.programName.equals(other.getProgramName())))
           && ((this.campaignName == null && other.getCampaignName() == null)
               || (this.campaignName != null && this.campaignName.equals(other.getCampaignName())))
           && ((this.programTokenList == null && other.getProgramTokenList() == null)
               || (this.programTokenList != null
                   && java.util.Arrays.equals(
                       this.programTokenList, other.getProgramTokenList())));
   __equalsCalc = null;
   return _equals;
 }
  @Override
  public boolean equals(Object o) {
    if (this == o) return true;
    if (o == null || getClass() != o.getClass()) return false;
    if (!super.equals(o)) return false;

    final A a = (A) o;

    if (a7 != a.a7) return false;
    if (a8 != a.a8) return false;
    if (a9 != a.a9) return false;
    if (a10 != a.a10) return false;
    if (Float.compare(a.a11, a11) != 0) return false;
    if (Double.compare(a.a12, a12) != 0) return false;
    // Probably incorrect - comparing Object[] arrays with Arrays.equals
    if (!Arrays.equals(a1, a.a1)) return false;
    if (!Arrays.deepEquals(a2, a.a2)) return false;
    // Probably incorrect - comparing Object[] arrays with Arrays.equals
    if (!Arrays.equals(a3, a.a3)) return false;
    if (!Arrays.deepEquals(a4, a.a4)) return false;
    if (!Arrays.equals(a5, a.a5)) return false;
    if (!Arrays.deepEquals(a6, a.a6)) return false;
    if (!a13.equals(a.a13)) return false;
    if (!a14.equals(a.a14)) return false;

    return true;
  }
 public synchronized boolean equals(java.lang.Object obj) {
   if (!(obj instanceof PackageAndItemUpdateRequest)) return false;
   PackageAndItemUpdateRequest other = (PackageAndItemUpdateRequest) obj;
   if (obj == null) return false;
   if (this == obj) return true;
   if (__equalsCalc != null) {
     return (__equalsCalc == obj);
   }
   __equalsCalc = obj;
   boolean _equals;
   _equals =
       true
           && this.orderID == other.getOrderID()
           && ((this.packages == null && other.getPackages() == null)
               || (this.packages != null
                   && java.util.Arrays.equals(this.packages, other.getPackages())))
           && ((this.items == null && other.getItems() == null)
               || (this.items != null && java.util.Arrays.equals(this.items, other.getItems())))
           && ((this.packagesToRemove == null && other.getPackagesToRemove() == null)
               || (this.packagesToRemove != null
                   && java.util.Arrays.equals(this.packagesToRemove, other.getPackagesToRemove())))
           && ((this.orderPackages == null && other.getOrderPackages() == null)
               || (this.orderPackages != null
                   && java.util.Arrays.equals(this.orderPackages, other.getOrderPackages())));
   __equalsCalc = null;
   return _equals;
 }
Пример #17
0
  public void testGetLocalBlessingNames() throws Exception {
    VContext context = V.init();
    VPrincipal p1 = VSecurity.newPrincipal();
    VPrincipal p2 = VSecurity.newPrincipal();
    Blessings alice = p1.blessSelf("alice");
    VSecurity.addToRoots(p2, alice);

    Blessings aliceWorkFriend =
        p1.bless(p2.publicKey(), alice, "work:friend", VSecurity.newUnconstrainedUseCaveat());
    Call call =
        VSecurity.newCall(
            new CallParams().withLocalBlessings(aliceWorkFriend).withLocalPrincipal(p2));
    String[] blessings = VSecurity.getLocalBlessingNames(context, call);
    if (!Arrays.equals(new String[] {"alice:work:friend"}, blessings)) {
      fail(
          String.format(
              "Expected blessings [\"alice:work:friend\"], got %s", Arrays.toString(blessings)));
    }
    blessings = VSecurity.getBlessingNames(p2, aliceWorkFriend);
    if (!Arrays.equals(new String[] {"alice:work:friend"}, blessings)) {
      fail(
          String.format(
              "Expected blessings [\"alice:work:friend\"], got %s", Arrays.toString(blessings)));
    }
    blessings = VSecurity.getBlessingNames(p1, aliceWorkFriend);
    if (!Arrays.equals(new String[] {}, blessings)) {
      fail(String.format("Expected blessings [], got %s", Arrays.toString(blessings)));
    }
  }
 public synchronized boolean equals(java.lang.Object obj) {
   if (!(obj instanceof WorkflowAlert)) return false;
   WorkflowAlert other = (WorkflowAlert) obj;
   if (obj == null) return false;
   if (this == obj) return true;
   if (__equalsCalc != null) {
     return (__equalsCalc == obj);
   }
   __equalsCalc = obj;
   boolean _equals;
   _equals =
       super.equals(obj)
           && ((this.ccEmails == null && other.getCcEmails() == null)
               || (this.ccEmails != null
                   && java.util.Arrays.equals(this.ccEmails, other.getCcEmails())))
           && ((this.description == null && other.getDescription() == null)
               || (this.description != null && this.description.equals(other.getDescription())))
           && this._protected == other.is_protected()
           && ((this.recipients == null && other.getRecipients() == null)
               || (this.recipients != null
                   && java.util.Arrays.equals(this.recipients, other.getRecipients())))
           && ((this.template == null && other.getTemplate() == null)
               || (this.template != null && this.template.equals(other.getTemplate())));
   __equalsCalc = null;
   return _equals;
 }
Пример #19
0
  @Test(groups = {"functional.encode", "subscriberInformation"})
  public void testEncode() throws Exception {
    RequestedInfoImpl requestedInfo =
        new RequestedInfoImpl(true, true, null, false, null, false, false, false);
    AsnOutputStream asnOS = new AsnOutputStream();
    requestedInfo.encodeAll(asnOS, Tag.CLASS_CONTEXT_SPECIFIC, 1);

    byte[] encodedData = asnOS.toByteArray();
    assertTrue(Arrays.equals(encodedData, data));

    requestedInfo =
        new RequestedInfoImpl(
            true,
            true,
            MAPExtensionContainerTest.GetTestExtensionContainer(),
            true,
            DomainType.psDomain,
            true,
            true,
            true);
    asnOS = new AsnOutputStream();
    requestedInfo.encodeAll(asnOS);

    encodedData = asnOS.toByteArray();
    assertTrue(Arrays.equals(encodedData, dataFull));
  }
Пример #20
0
  public static ImageType guessImageType(byte[] magicNumber) {
    ImageType imageType = ImageType.UNKNOWN;
    // Check image type
    if (Arrays.equals(magicNumber, TIFF_II) || Arrays.equals(magicNumber, TIFF_MM))
      imageType = ImageType.TIFF;
    else if (Arrays.equals(magicNumber, PNG)) imageType = ImageType.PNG;
    else if (Arrays.equals(magicNumber, GIF)) imageType = ImageType.GIF;
    else if (magicNumber[0] == JPG[0] && magicNumber[1] == JPG[1] && magicNumber[2] == JPG[2])
      imageType = ImageType.JPG;
    else if (magicNumber[0] == BM[0] && magicNumber[1] == BM[1]) imageType = ImageType.BMP;
    else if (magicNumber[0] == PCX[0]) imageType = ImageType.PCX;
    else if (Arrays.equals(magicNumber, JPG2000)) {
      imageType = ImageType.JPG2000;
    } else if (magicNumber[1] == 0 || magicNumber[1] == 1) {
      switch (magicNumber[2]) {
        case 0:
        case 1:
        case 2:
        case 3:
        case 9:
        case 10:
        case 11:
        case 32:
        case 33:
          imageType = ImageType.TGA;
      }
    } else {
      LOGGER.error("Unknown format!");
    }

    return imageType;
  }
 public synchronized boolean equals(java.lang.Object obj) {
   if (!(obj instanceof Get_entry_list_result_version2)) return false;
   Get_entry_list_result_version2 other = (Get_entry_list_result_version2) obj;
   if (obj == null) return false;
   if (this == obj) return true;
   if (__equalsCalc != null) {
     return (__equalsCalc == obj);
   }
   __equalsCalc = obj;
   boolean _equals;
   _equals =
       true
           && this.result_count == other.getResult_count()
           && this.total_count == other.getTotal_count()
           && this.next_offset == other.getNext_offset()
           && ((this.entry_list == null && other.getEntry_list() == null)
               || (this.entry_list != null
                   && java.util.Arrays.equals(this.entry_list, other.getEntry_list())))
           && ((this.relationship_list == null && other.getRelationship_list() == null)
               || (this.relationship_list != null
                   && java.util.Arrays.equals(
                       this.relationship_list, other.getRelationship_list())));
   __equalsCalc = null;
   return _equals;
 }
 public synchronized boolean equals(java.lang.Object obj) {
   if (!(obj instanceof BaseVideoCreative)) return false;
   BaseVideoCreative other = (BaseVideoCreative) obj;
   if (obj == null) return false;
   if (this == obj) return true;
   if (__equalsCalc != null) {
     return (__equalsCalc == obj);
   }
   __equalsCalc = obj;
   boolean _equals;
   _equals =
       super.equals(obj)
           && ((this.duration == null && other.getDuration() == null)
               || (this.duration != null && this.duration.equals(other.getDuration())))
           && ((this.allowDurationOverride == null && other.getAllowDurationOverride() == null)
               || (this.allowDurationOverride != null
                   && this.allowDurationOverride.equals(other.getAllowDurationOverride())))
           && ((this.trackingUrls == null && other.getTrackingUrls() == null)
               || (this.trackingUrls != null
                   && java.util.Arrays.equals(this.trackingUrls, other.getTrackingUrls())))
           && ((this.companionCreativeIds == null && other.getCompanionCreativeIds() == null)
               || (this.companionCreativeIds != null
                   && java.util.Arrays.equals(
                       this.companionCreativeIds, other.getCompanionCreativeIds())))
           && ((this.customParameters == null && other.getCustomParameters() == null)
               || (this.customParameters != null
                   && this.customParameters.equals(other.getCustomParameters())));
   __equalsCalc = null;
   return _equals;
 }
Пример #23
0
  /** Test vector conversions. */
  public void testVectorConversion() {
    RingFactory<BigRational> z = new BigRational(0);
    JLAdapterFactory<BigRational> fac = new JLAdapterFactory<BigRational>(z);

    JLAdapter<BigRational>[] vec1 = fac.getArray(ll);
    // System.out.println("vec1 =" + Arrays.toString(vec1));

    RingElem<BigRational>[] v1 = JLAdapterUtil.<BigRational>fromJLAdapter(vec1);
    // System.out.println("v1   =" + Arrays.toString(v1));

    JLAdapter<BigRational>[] vec2 = JLAdapterUtil.<BigRational>toJLAdapterRE(v1);
    // System.out.println("vec2 =" + Arrays.toString(vec2));

    assertTrue("v1[] == v2[] ", Arrays.equals(vec1, vec2));

    BigRational[] v2 = new BigRational[ll];
    for (int i = 0; i < v2.length; i++) {
      v2[i] = z.random(kl);
    }
    // System.out.println("v2   =" + Arrays.toString(v2));

    JLAdapter<BigRational>[] vec3 = JLAdapterUtil.<BigRational>toJLAdapter(v2);
    // System.out.println("vec3 =" + Arrays.toString(vec3));

    RingElem<BigRational>[] v3 = JLAdapterUtil.<BigRational>fromJLAdapter(vec3);
    // System.out.println("v3   =" + Arrays.toString(v3));

    assertTrue("v2[] == v3[] ", Arrays.equals(v2, v3));
  }
Пример #24
0
  /**
   * Tests whether this DefineFont2 tag is equivalent to another DefineFont2 tag instance.
   *
   * @param object Another DefineFont2 instance to test for equality.
   * @return true if the given instance is considered equal to this instance
   */
  public boolean equals(Object object) {
    boolean isEqual = false;

    if (object instanceof DefineFont2 && super.equals(object)) {
      DefineFont2 defineFont = (DefineFont2) object;

      // wideOffsets and wideCodes not considered in the equality check
      // as these are determined at encoding time

      if ((defineFont.hasLayout == this.hasLayout)
          && (defineFont.shiftJIS == this.shiftJIS)
          && (defineFont.ansi == this.ansi)
          && (defineFont.italic == this.italic)
          && (defineFont.bold == this.bold)
          && (defineFont.langCode == this.langCode)
          && (defineFont.ascent == this.ascent)
          && (defineFont.descent == this.descent)
          && (defineFont.leading == this.leading)
          && (defineFont.kerningCount == this.kerningCount)
          && equals(defineFont.name, this.name)
          && equals(defineFont.fontName, this.fontName)
          && Arrays.equals(defineFont.glyphShapeTable, this.glyphShapeTable)
          && Arrays.equals(defineFont.codeTable, this.codeTable)
          && Arrays.equals(defineFont.advanceTable, this.advanceTable)
          && Arrays.equals(defineFont.boundsTable, this.boundsTable)
          && Arrays.equals(defineFont.kerningTable, this.kerningTable)) {
        isEqual = true;
      }
    }

    return isEqual;
  }
Пример #25
0
 @Test
 public final void testGetPosition() {
   double pos1[] = {2, 3.5, 4};
   assertTrue(Arrays.equals(pos1, log1.getPosition()));
   double pos2[] = {2.1, 3, 0};
   assertTrue(Arrays.equals(pos2, log2.getPosition()));
 }
Пример #26
0
  @Test
  public void toArray() {
    assertTrue(Arrays.equals(toTest.toArray(), new Serializable[] {}));

    toTest.add("Test1");
    toTest.add("Test2");

    assertTrue(Arrays.equals(toTest.toArray(), new String[] {"Test1", "Test2"}));

    String[] sArray = new String[2];
    String[] result = toTest.toArray(sArray);

    assertSame(sArray, result);
    assertTrue(Arrays.equals(sArray, new String[] {"Test1", "Test2"}));

    sArray = new String[3];
    result = toTest.toArray(sArray);

    assertSame(sArray, result);
    assertTrue(Arrays.equals(sArray, new String[] {"Test1", "Test2", null}));

    result = toTest.toArray(new String[] {});

    assertTrue(Arrays.equals(result, new String[] {"Test1", "Test2"}));
  }
Пример #27
0
 void run() throws Exception {
   Cipher cipher = Cipher.getInstance("RC2/ECB/NOPADDING", "SunJCE");
   SecretKey keySpec = new SecretKeySpec(key, "RC2");
   RC2ParameterSpec rc2Spec = new RC2ParameterSpec(effectiveKeySize);
   cipher.init(Cipher.ENCRYPT_MODE, keySpec, rc2Spec);
   byte[] enc = cipher.doFinal(plaintext);
   if (Arrays.equals(ciphertext, enc) == false) {
     System.out.println("RC2AlgorithmParameters Cipher test " + "encryption failed:");
     System.out.println("plaintext:  " + RC2AlgorithmParameters.toString(plaintext));
     System.out.println("ciphertext: " + RC2AlgorithmParameters.toString(ciphertext));
     System.out.println("encrypted:  " + RC2AlgorithmParameters.toString(enc));
     System.out.println("key:        " + RC2AlgorithmParameters.toString(key));
     System.out.println("effective key length:        " + effectiveKeySize);
     throw new Exception("RC2AlgorithmParameters Cipher test " + "encryption failed");
   }
   enc = cipher.doFinal(plaintext);
   if (Arrays.equals(ciphertext, enc) == false) {
     throw new Exception("Re-encryption test failed");
   }
   cipher.init(Cipher.DECRYPT_MODE, keySpec, rc2Spec);
   byte[] dec = cipher.doFinal(ciphertext);
   if (Arrays.equals(plaintext, dec) == false) {
     System.out.println("RC2AlgorithmParameters Cipher test " + "decryption failed:");
     System.out.println("plaintext:  " + RC2AlgorithmParameters.toString(plaintext));
     System.out.println("ciphertext: " + RC2AlgorithmParameters.toString(ciphertext));
     System.out.println("decrypted:  " + RC2AlgorithmParameters.toString(dec));
     System.out.println("key:        " + RC2AlgorithmParameters.toString(key));
     System.out.println("effective key length:        " + effectiveKeySize);
     throw new Exception("RC2AlgorithmParameters Cipher test " + "decryption failed");
   }
   System.out.println("passed");
 }
Пример #28
0
 // This test stems from a real bug found by andrewk
 public void testAsList_subList_toArray_roundTrip() {
   float[] array = {(float) 0, (float) 1, (float) 2, (float) 3};
   List<Float> list = Floats.asList(array);
   assertTrue(
       Arrays.equals(new float[] {(float) 1, (float) 2}, Floats.toArray(list.subList(1, 3))));
   assertTrue(Arrays.equals(new float[] {}, Floats.toArray(list.subList(2, 2))));
 }
Пример #29
0
 public synchronized boolean equals(java.lang.Object obj) {
   if (!(obj instanceof RunTestsResult)) return false;
   RunTestsResult other = (RunTestsResult) obj;
   if (obj == null) return false;
   if (this == obj) return true;
   if (__equalsCalc != null) {
     return (__equalsCalc == obj);
   }
   __equalsCalc = obj;
   boolean _equals;
   _equals =
       true
           && ((this.codeCoverage == null && other.getCodeCoverage() == null)
               || (this.codeCoverage != null
                   && java.util.Arrays.equals(this.codeCoverage, other.getCodeCoverage())))
           && ((this.codeCoverageWarnings == null && other.getCodeCoverageWarnings() == null)
               || (this.codeCoverageWarnings != null
                   && java.util.Arrays.equals(
                       this.codeCoverageWarnings, other.getCodeCoverageWarnings())))
           && ((this.failures == null && other.getFailures() == null)
               || (this.failures != null
                   && java.util.Arrays.equals(this.failures, other.getFailures())))
           && this.numFailures == other.getNumFailures()
           && this.numTestsRun == other.getNumTestsRun()
           && ((this.successes == null && other.getSuccesses() == null)
               || (this.successes != null
                   && java.util.Arrays.equals(this.successes, other.getSuccesses())))
           && this.totalTime == other.getTotalTime();
   __equalsCalc = null;
   return _equals;
 }
 public synchronized boolean equals(java.lang.Object obj) {
   if (!(obj instanceof ImageOverlayCreative)) return false;
   ImageOverlayCreative other = (ImageOverlayCreative) obj;
   if (obj == null) return false;
   if (this == obj) return true;
   if (__equalsCalc != null) {
     return (__equalsCalc == obj);
   }
   __equalsCalc = obj;
   boolean _equals;
   _equals =
       super.equals(obj)
           && ((this.companionCreativeIds == null && other.getCompanionCreativeIds() == null)
               || (this.companionCreativeIds != null
                   && java.util.Arrays.equals(
                       this.companionCreativeIds, other.getCompanionCreativeIds())))
           && ((this.trackingUrls == null && other.getTrackingUrls() == null)
               || (this.trackingUrls != null
                   && java.util.Arrays.equals(this.trackingUrls, other.getTrackingUrls())))
           && ((this.lockedOrientation == null && other.getLockedOrientation() == null)
               || (this.lockedOrientation != null
                   && this.lockedOrientation.equals(other.getLockedOrientation())))
           && ((this.customParameters == null && other.getCustomParameters() == null)
               || (this.customParameters != null
                   && this.customParameters.equals(other.getCustomParameters())))
           && ((this.duration == null && other.getDuration() == null)
               || (this.duration != null && this.duration.equals(other.getDuration())))
           && ((this.vastPreviewUrl == null && other.getVastPreviewUrl() == null)
               || (this.vastPreviewUrl != null
                   && this.vastPreviewUrl.equals(other.getVastPreviewUrl())));
   __equalsCalc = null;
   return _equals;
 }