Java Code Examples for java.lang.invoke.MethodType#hashCode()
The following examples show how to use
java.lang.invoke.MethodType#hashCode() .
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: CompiledFunction.java From openjdk-8-source with GNU General Public License v2.0 | 6 votes |
private static int compareMethodTypes(final MethodType ownType, final MethodType otherType) { // Comparable interface demands that compareTo() should only return 0 if objects are equal. // Failing to meet this requirement causes same weight functions to replace each other in TreeSet, // so we go some lengths to come up with an ordering between same weight functions, // first falling back to parameter count and then to hash code. if (ownType.equals(otherType)) { return 0; } final int diff = weight(ownType) - weight(otherType); if (diff != 0) { return diff; } if (ownType.parameterCount() != otherType.parameterCount()) { return ownType.parameterCount() - otherType.parameterCount(); } // We're just interested in not returning 0 here, not correct ordering return ownType.hashCode() - otherType.hashCode(); }
Example 2
Source File: CompiledFunction.java From openjdk-8 with GNU General Public License v2.0 | 6 votes |
private static int compareMethodTypes(final MethodType ownType, final MethodType otherType) { // Comparable interface demands that compareTo() should only return 0 if objects are equal. // Failing to meet this requirement causes same weight functions to replace each other in TreeSet, // so we go some lengths to come up with an ordering between same weight functions, // first falling back to parameter count and then to hash code. if (ownType.equals(otherType)) { return 0; } final int diff = weight(ownType) - weight(otherType); if (diff != 0) { return diff; } if (ownType.parameterCount() != otherType.parameterCount()) { return ownType.parameterCount() - otherType.parameterCount(); } // We're just interested in not returning 0 here, not correct ordering return ownType.hashCode() - otherType.hashCode(); }
Example 3
Source File: MethodTypeTest.java From dragonwell8_jdk with GNU General Public License v2.0 | 5 votes |
/** * Test of hashCode method, of class MethodType. */ @Test public void testHashCode() { System.out.println("hashCode"); MethodType instance = mt_viS; ArrayList<Class<?>> types = new ArrayList<>(); types.add(instance.returnType()); types.addAll(instance.parameterList()); int expResult = types.hashCode(); int result = instance.hashCode(); assertEquals(expResult, result); }
Example 4
Source File: MethodTypeTest.java From TencentKona-8 with GNU General Public License v2.0 | 5 votes |
/** * Test of hashCode method, of class MethodType. */ @Test public void testHashCode() { System.out.println("hashCode"); MethodType instance = mt_viS; ArrayList<Class<?>> types = new ArrayList<>(); types.add(instance.returnType()); types.addAll(instance.parameterList()); int expResult = types.hashCode(); int result = instance.hashCode(); assertEquals(expResult, result); }
Example 5
Source File: MethodTypeTest.java From jdk8u60 with GNU General Public License v2.0 | 5 votes |
/** * Test of hashCode method, of class MethodType. */ @Test public void testHashCode() { System.out.println("hashCode"); MethodType instance = mt_viS; ArrayList<Class<?>> types = new ArrayList<>(); types.add(instance.returnType()); types.addAll(instance.parameterList()); int expResult = types.hashCode(); int result = instance.hashCode(); assertEquals(expResult, result); }
Example 6
Source File: MethodTypeTest.java From openjdk-jdk8u with GNU General Public License v2.0 | 5 votes |
/** * Test of hashCode method, of class MethodType. */ @Test public void testHashCode() { System.out.println("hashCode"); MethodType instance = mt_viS; ArrayList<Class<?>> types = new ArrayList<>(); types.add(instance.returnType()); types.addAll(instance.parameterList()); int expResult = types.hashCode(); int result = instance.hashCode(); assertEquals(expResult, result); }
Example 7
Source File: MethodTypeTest.java From openjdk-jdk8u-backup with GNU General Public License v2.0 | 5 votes |
/** * Test of hashCode method, of class MethodType. */ @Test public void testHashCode() { System.out.println("hashCode"); MethodType instance = mt_viS; ArrayList<Class<?>> types = new ArrayList<>(); types.add(instance.returnType()); types.addAll(instance.parameterList()); int expResult = types.hashCode(); int result = instance.hashCode(); assertEquals(expResult, result); }
Example 8
Source File: MethodTypeTest.java From openjdk-jdk9 with GNU General Public License v2.0 | 5 votes |
/** * Test of hashCode method, of class MethodType. */ @Test public void testHashCode() { System.out.println("hashCode"); MethodType instance = mt_viS; ArrayList<Class<?>> types = new ArrayList<>(); types.add(instance.returnType()); types.addAll(instance.parameterList()); int expResult = types.hashCode(); int result = instance.hashCode(); assertEquals(expResult, result); }
Example 9
Source File: MethodTypeTest.java From jdk8u-jdk with GNU General Public License v2.0 | 5 votes |
/** * Test of hashCode method, of class MethodType. */ @Test public void testHashCode() { System.out.println("hashCode"); MethodType instance = mt_viS; ArrayList<Class<?>> types = new ArrayList<>(); types.add(instance.returnType()); types.addAll(instance.parameterList()); int expResult = types.hashCode(); int result = instance.hashCode(); assertEquals(expResult, result); }
Example 10
Source File: MethodTypeTest.java From hottub with GNU General Public License v2.0 | 5 votes |
/** * Test of hashCode method, of class MethodType. */ @Test public void testHashCode() { System.out.println("hashCode"); MethodType instance = mt_viS; ArrayList<Class<?>> types = new ArrayList<>(); types.add(instance.returnType()); types.addAll(instance.parameterList()); int expResult = types.hashCode(); int result = instance.hashCode(); assertEquals(expResult, result); }
Example 11
Source File: MethodTypeTest.java From openjdk-8-source with GNU General Public License v2.0 | 5 votes |
/** * Test of hashCode method, of class MethodType. */ @Test public void testHashCode() { System.out.println("hashCode"); MethodType instance = mt_viS; ArrayList<Class<?>> types = new ArrayList<>(); types.add(instance.returnType()); types.addAll(instance.parameterList()); int expResult = types.hashCode(); int result = instance.hashCode(); assertEquals(expResult, result); }
Example 12
Source File: MethodTypeTest.java From openjdk-8 with GNU General Public License v2.0 | 5 votes |
/** * Test of hashCode method, of class MethodType. */ @Test public void testHashCode() { System.out.println("hashCode"); MethodType instance = mt_viS; ArrayList<Class<?>> types = new ArrayList<>(); types.add(instance.returnType()); types.addAll(instance.parameterList()); int expResult = types.hashCode(); int result = instance.hashCode(); assertEquals(expResult, result); }
Example 13
Source File: MethodTypeTest.java From jdk8u_jdk with GNU General Public License v2.0 | 5 votes |
/** * Test of hashCode method, of class MethodType. */ @Test public void testHashCode() { System.out.println("hashCode"); MethodType instance = mt_viS; ArrayList<Class<?>> types = new ArrayList<>(); types.add(instance.returnType()); types.addAll(instance.parameterList()); int expResult = types.hashCode(); int result = instance.hashCode(); assertEquals(expResult, result); }
Example 14
Source File: MethodTypeTest.java From jdk8u-jdk with GNU General Public License v2.0 | 5 votes |
/** * Test of hashCode method, of class MethodType. */ @Test public void testHashCode() { System.out.println("hashCode"); MethodType instance = mt_viS; ArrayList<Class<?>> types = new ArrayList<>(); types.add(instance.returnType()); types.addAll(instance.parameterList()); int expResult = types.hashCode(); int result = instance.hashCode(); assertEquals(expResult, result); }
Example 15
Source File: MethodTypeTest.java From jdk8u-dev-jdk with GNU General Public License v2.0 | 5 votes |
/** * Test of hashCode method, of class MethodType. */ @Test public void testHashCode() { System.out.println("hashCode"); MethodType instance = mt_viS; ArrayList<Class<?>> types = new ArrayList<>(); types.add(instance.returnType()); types.addAll(instance.parameterList()); int expResult = types.hashCode(); int result = instance.hashCode(); assertEquals(expResult, result); }