-
Notifications
You must be signed in to change notification settings - Fork 3
Benchmarks Patterns
Marcelo Sousa edited this page May 6, 2015
·
3 revisions
- Throw unsupported operations exceptions
- AbstractAspectJAdvisorFactoryTests: public int compareTo(Object arg0) {throw new UnsupportedOperationException();}
- AbstractMemoryHttpDataTest: public int compareTo(InterfaceHttpData o) {throw new UnsupportedOperationException("Should never be called.");}
- Empty method definition
- AccountModel: public int compareTo(com.liferay.portal.model.Account account);
- AddressModel: public int compareTo(com.liferay.portal.model.Address address);
- Call to other comparators (fields, other classes, related to abstract classes?)
- AbstractByteBuf: public int compareTo(ByteBuf that) {return ByteBufUtil.compare(this, that);} (We have ByteBuf)
- AbstractChannelBuffer: public int compareTo(ChannelBuffer that) {return ChannelBuffers.compare(this, that);}
- AbstractHandlerMethodMapping: public int compare(Match match1, Match match2) {return this.comparator.compare(match1.mapping, match2.mapping);}
- AbstractMemoryHttpDataTest: same as AbstractHandlerMethodMapping
- AbstractMediaTypeExpression: public int compareTo(AbstractMediaTypeExpression other) {return MediaType.SPECIFICITY_COMPARATOR.compare(this.getMediaType(), other.getMediaType());}
- AbstractQueueSorterImpl:
- AccountWrapper: public int compareTo(com.liferay.portal.model.Account account) { return _account.compareTo(account); }
- ActionComparator:
- AddressableNode: public int compareTo(AddressableNode node) {return this.address.compareTo(node.address);}
- AddressWrapper:
- Implement comparator based on fields
- AccountModelImpl:
- ActivityChooserModel:
- ActivityManagerService:
- AddressModelImpl:
- Check for equality via address and then call other comparators of specific fields
- AbstractChannel (int): public final int compareTo(Channel o) {if (this == o) {return 0;} return id().compareTo(o.id());}
- Check for null (ret -1 does not seem correct.) and then call field comparators
- AbstractConfigurator (Strings): public int compareTo(Configurator o) {if (o == null) {return -1;} return getUrl().getHost().compareTo(o.getUrl().getHost());}
- Check for equality via address, use hashCode to compare and other comparators
- AbstractConstant:
- Call comparators of Strings (fields or via toString)
- AbstractConfigurator:
- AbstractFieldMapper: public int compare(Mapper o1, Mapper o2) {return o1.name().compareTo(o2.name());}
- Simple comparators (integer, long comparators)
- AbstractProject: public int compare(Integer o1, Integer o2) {return o2-o1;}
- AbstractQueueSorterImpl:
- ActionFilters:
- Call comparators of Integers
- AC: public int compareTo(Ac ac) {return this.getPriority()-ac.getPriority();}
- AccessPointControllerImpl: public int compare(AccessPoint lhs, AccessPoint rhs) {return -Integer.compare(score(lhs), score(rhs));}
- Complex comparators (equality via address, null, field comparators, for loops, etc.)
- AccountManagerServiceTest:
- ActivateComparator: