Inheritance: java.lang.Object, java.io.Serializable
コード例 #1
0
ファイル: CodeSource.cs プロジェクト: ranganathsb/JavaSharp
        /// <summary>
        /// Tests for equality between the specified object and this
        /// object. Two CodeSource objects are considered equal if their
        /// locations are of identical value and if their signer certificate
        /// chains are of identical value. It is not required that
        /// the certificate chains be in the same order.
        /// </summary>
        /// <param name="obj"> the object to test for equality with this object.
        /// </param>
        /// <returns> true if the objects are considered equal, false otherwise. </returns>
        public override bool Equals(Object obj)
        {
            if (obj == this)
            {
                return(true);
            }

            // objects types must be equal
            if (!(obj is CodeSource))
            {
                return(false);
            }

            CodeSource cs = (CodeSource)obj;

            // URLs must match
            if (Location_Renamed == null)
            {
                // if location is null, then cs.location must be null as well
                if (cs.Location_Renamed != null)
                {
                    return(false);
                }
            }
            else
            {
                // if location is not null, then it must equal cs.location
                if (!Location_Renamed.Equals(cs.Location_Renamed))
                {
                    return(false);
                }
            }

            // certs must match
            return(MatchCerts(cs, true));
        }
コード例 #2
0
 private static void EnsureCodeSource(CodeSource cSource)
 {
     if (cSource == null)
         throw new InvalidOperationException();
 }