On Thu, Jun 16, 2016 at 6:16 AM, Wang Tao <cr3...@gmail.com> wrote: > private Object lookup(Key<?> key) { > for (int i = 0; i < keyValueEntries.length; i++) { > if (key.equals(keyValueEntries[i][0])) { // here use an equals method? > > It is purposefully using reference equality. In earlier versions we overrode equals and used the Key name for equality. However, we swapped to using reference equality to allow users to have finer control over who can access the value (like with public/protected/private). If you don't have a reference to the Key, you can't get the value.
Would it be easier for you if it did override equals? -- You received this message because you are subscribed to the Google Groups "grpc.io" group. To unsubscribe from this group and stop receiving emails from it, send an email to grpc-io+unsubscr...@googlegroups.com. To post to this group, send email to grpc-io@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/grpc-io/CA%2B4M1oOHQn6OwboUjfGnN3uoUTsJU2f%2BCRC4Kg_K%3DwP_nH%3DWxw%40mail.gmail.com. For more options, visit https://groups.google.com/d/optout.