@java.lang.Override public int hashCode() { if (memoizedHashCode != 0) { return memoizedHashCode; } int hash = 41; hash = (19 * hash) + getDescriptorForType().hashCode(); if (hasMessage()) { hash = (37 * hash) + MESSAGE_FIELD_NUMBER; hash = (53 * hash) + getMessage().hashCode(); } if (hasTrace()) { hash = (37 * hash) + TRACE_FIELD_NUMBER; hash = (53 * hash) + getTrace().hashCode(); } if (hasClassName()) { hash = (37 * hash) + CLASS_NAME_FIELD_NUMBER; hash = (53 * hash) + getClassName().hashCode(); } if (hasCause()) { hash = (37 * hash) + CAUSE_FIELD_NUMBER; hash = (53 * hash) + getCause().hashCode(); } hash = (29 * hash) + getUnknownFields().hashCode(); memoizedHashCode = hash; return hash; }
@Test public void testBeforeInit() throws Exception { SerializedExceptionProto defaultProto = SerializedExceptionProto.newBuilder().build(); SerializedExceptionPBImpl pb1 = new SerializedExceptionPBImpl(); Assert.assertNull(pb1.getCause()); SerializedExceptionPBImpl pb2 = new SerializedExceptionPBImpl(); Assert.assertEquals(defaultProto, pb2.getProto()); SerializedExceptionPBImpl pb3 = new SerializedExceptionPBImpl(); Assert.assertEquals(defaultProto.getTrace(), pb3.getRemoteTrace()); } }
@Test public void testBeforeInit() throws Exception { SerializedExceptionProto defaultProto = SerializedExceptionProto.newBuilder().build(); SerializedExceptionPBImpl pb1 = new SerializedExceptionPBImpl(); Assert.assertNull(pb1.getCause()); SerializedExceptionPBImpl pb2 = new SerializedExceptionPBImpl(); Assert.assertEquals(defaultProto, pb2.getProto()); SerializedExceptionPBImpl pb3 = new SerializedExceptionPBImpl(); Assert.assertEquals(defaultProto.getTrace(), pb3.getRemoteTrace()); }
@Test public void testBeforeInit() throws Exception { SerializedExceptionProto defaultProto = SerializedExceptionProto.newBuilder().build(); SerializedExceptionPBImpl pb1 = new SerializedExceptionPBImpl(); Assert.assertNull(pb1.getCause()); SerializedExceptionPBImpl pb2 = new SerializedExceptionPBImpl(); Assert.assertEquals(defaultProto, pb2.getProto()); SerializedExceptionPBImpl pb3 = new SerializedExceptionPBImpl(); Assert.assertEquals(defaultProto.getTrace(), pb3.getRemoteTrace()); }
/** * <code>optional string trace = 2;</code> */ public Builder clearTrace() { bitField0_ = (bitField0_ & ~0x00000002); trace_ = getDefaultInstance().getTrace(); onChanged(); return this; } /**