title: Conflicting enum values java
body: <p>I have 2 enums defined as below in 2 separate files:
  <code>MyErrorCodes.java</code></p>
  <pre><code>@Getter
  public enum MyErrorCodes implements ErrorCode {
      ERROR1(90, 1, 01),
      ERROR2(90, 1, 02),
      ERROR3(90, 1, 03),
      ERROR4(90, 1, 04),
      ERROR5(90, 1, 05);
      ....
  }
  
  </code></pre>
  <p><code>ErrorCategory.java</code></p>
  <pre><code>public class ErrorCategory {
  @AllArgsConstructor
      public enum ErrorCodes {
          EXECUTION_ERROR(&quot;execution.error&quot;, &quot;Error in executing {0}.&quot;, INTERNAL_ERROR,
                               MyErrorCodes.ERROR1),
          DESERIALIZATION_ERROR(&quot;...&quot;, &quot;...&quot;,BAD_REQUEST_ERROR, MyErrorCodes.ERROR2),
          DEFAULT_INTERNAL_ERROR(&quot;...&quot;, &quot;...&quot;, INTERNAL_ERROR, MyErrorCodes.ERROR3),
          INVALID_RESPONSE(&quot;...&quot;, &quot;...&quot;, INTERNAL_ERROR, MyErrorCodes.ERROR4),
          MAPPING_ERROR(&quot;...&quot;, &quot;...&quot;, INTERNAL_ERROR, MyErrorCodes.ERROR5);
     }
  }
  </code></pre>
  <p>At Runtime I am getting error:</p>
  <pre class="lang-none prettyprint-override"><code>Conflicting enum values. Name 'ERROR4' uses ordinal value (4) that is also used for name 'MAPPING_ERROR' 
  </code></pre>
  <p><code>ERROR4</code> is 4th element in enum#1 while <code>MAPPING_ERROR</code> is 5th element in the enum#2.
  Then Why am I getting conflict error when they are completely different enums?</p>
  <p>P.S. the interface implemented by enum#1 looks like this:</p>
  <pre><code>public interface ErrorCode {
      int getErrorCode();
      String getKey();
  
  }
  </code></pre>
  <p>stacktrace:</p>
  <pre><code>at io.opentracing.contrib.concurrent.TracedRunnable.run(TracedRunnable.java:30)
      at org.springframework.scheduling.support.DelegatingErrorHandlingRunnable.run(DelegatingErrorHandlingRunnable.java:54)
     
      at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515)
      at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
      at java.base/java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:304)
      at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
      at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
      at java.base/java.lang.Thread.run(Thread.java:829)
  Caused by: org.apache.ignite.binary.BinaryObjectException: Conflicting enum values. Name 'ERROR4' uses ordinal value (4) that is also used for name 'MAPPING_ERROR'
      at org.apache.ignite.internal.binary.BinaryUtils.mergeEnumValues(BinaryUtils.java:2538)
      at org.apache.ignite.internal.binary.BinaryUtils.mergeMetadata(BinaryUtils.java:1028)
      at org.apache.ignite.internal.processors.cache.binary.BinaryMetadataTransport.requestMetadataUpdate(BinaryMetadataTransport.java:211)
      at org.apache.ignite.internal.processors.cache.binary.CacheObjectBinaryProcessorImpl.addMeta(CacheObjectBinaryProcessorImpl.java:606)
      at org.apache.ignite.internal.processors.cache.binary.CacheObjectBinaryProcessorImpl$1.addMeta(CacheObjectBinaryProcessorImpl.java:288)
      at org.apache.ignite.internal.binary.BinaryContext.registerUserClassDescriptor(BinaryContext.java:828)
      at org.apache.ignite.internal.binary.BinaryContext.registerDescriptor(BinaryContext.java:784)
      at org.apache.ignite.internal.binary.BinaryContext.registerClass(BinaryContext.java:581)
      at org.apache.ignite.internal.binary.BinaryContext.registerClass(BinaryContext.java:556)
      at org.apache.ignite.internal.binary.BinaryWriterExImpl.doWriteEnum(BinaryWriterExImpl.java:829)
      at org.apache.ignite.internal.binary.BinaryWriterExImpl.writeEnumField(BinaryWriterExImpl.java:1323)
      at org.apache.ignite.internal.binary.BinaryFieldAccessor$DefaultFinalClassAccessor.write0(BinaryFieldAccessor.java:670)
      at org.apache.ignite.internal.binary.BinaryFieldAccessor.write(BinaryFieldAccessor.java:157)
      ... 115 common frames omitted
      ```
  </code></pre>