javax.annotation.OverridingMethodsMustInvokeSuper Java Examples

The following examples show how to use javax.annotation.OverridingMethodsMustInvokeSuper. 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: AbstractMicroNodeWithChildren.java    From ph-commons with Apache License 2.0 6 votes vote down vote up
@OverridingMethodsMustInvokeSuper
public boolean isEqualContent (@Nullable final IMicroNode o)
{
  if (o == this)
    return true;
  if (o == null || !getClass ().equals (o.getClass ()))
    return false;
  final AbstractMicroNodeWithChildren rhs = (AbstractMicroNodeWithChildren) o;
  if (m_aChildren == null && rhs.m_aChildren == null)
    return true;
  if (m_aChildren == null || rhs.m_aChildren == null)
    return false;
  final int nMax = m_aChildren.size ();
  final int nMaxRhs = rhs.m_aChildren.size ();
  if (nMax != nMaxRhs)
    return false;
  for (int i = 0; i < nMax; ++i)
  {
    final IMicroNode aChild1 = m_aChildren.get (i);
    final IMicroNode aChild2 = rhs.m_aChildren.get (i);
    if (!aChild1.isEqualContent (aChild2))
      return false;
  }
  return true;
}
 
Example #2
Source File: WEBUI_M_HU_MoveToAnotherWarehouse_Helper.java    From metasfresh-webui-api-legacy with GNU General Public License v3.0 6 votes vote down vote up
@Override
@OverridingMethodsMustInvokeSuper
protected ProcessPreconditionsResolution checkPreconditionsApplicable()
{
	if (!isHUEditorView())
	{
		return ProcessPreconditionsResolution.rejectWithInternalReason("not the HU view");
	}

	if (!streamSelectedHUIds(Select.ONLY_TOPLEVEL).findAny().isPresent())
	{
		return ProcessPreconditionsResolution.reject(msgBL.getTranslatableMsgText(WEBUI_HU_Constants.MSG_WEBUI_ONLY_TOP_LEVEL_HU));
	}

	final boolean activeTopLevelHUsSelected = streamSelectedHUs(Select.ONLY_TOPLEVEL)
			.filter(huRecord -> huStatusBL.isPhysicalHU(huRecord))
			.findAny()
			.isPresent();
	if (!activeTopLevelHUsSelected)
	{
		return ProcessPreconditionsResolution.rejectWithInternalReason("no physical (etc active) hus selected");
	}

	return ProcessPreconditionsResolution.accept();
}
 
Example #3
Source File: CSSPropertyEnumOrNumbers.java    From ph-css with Apache License 2.0 6 votes vote down vote up
@Override
@OverridingMethodsMustInvokeSuper
public boolean isValidValue (@Nullable final String sValue)
{
  if (sValue == null)
    return false;

  // Split by whitespaces " a b " results in { "a", "b" }
  final String [] aParts = RegExHelper.getSplitToArray (sValue.trim (), "\\s+");
  if (aParts.length < m_nMinNumbers || aParts.length > m_nMaxNumbers)
    return false;

  for (final String aPart : aParts)
  {
    final String sTrimmedPart = aPart.trim ();
    if (!super.isValidValue (sTrimmedPart) && !CSSNumberHelper.isValueWithUnit (sTrimmedPart, m_bWithPercentage))
      return false;
  }
  return true;
}
 
Example #4
Source File: CSSPropertyColors.java    From ph-css with Apache License 2.0 6 votes vote down vote up
@Override
@OverridingMethodsMustInvokeSuper
public boolean isValidValue (@Nullable final String sValue)
{
  if (sValue == null)
    return false;

  // Split by whitespaces " a b " results in { "a", "b" }
  final String [] aParts = RegExHelper.getSplitToArray (sValue.trim (), "\\s+");
  if (aParts.length < getMinimumArgumentCount () || aParts.length > getMaximumArgumentCount ())
    return false;

  // Check each value
  for (final String aPart : aParts)
  {
    final String sTrimmedPart = aPart.trim ();
    if (!super.isValidValue (sTrimmedPart) && !CSSColorHelper.isColorValue (sTrimmedPart))
      return false;
  }
  return true;
}
 
Example #5
Source File: CSSPropertyEnums.java    From ph-css with Apache License 2.0 6 votes vote down vote up
@Override
@OverridingMethodsMustInvokeSuper
public boolean isValidValue (@Nullable final String sValue)
{
  if (sValue == null)
    return false;

  // Split by whitespaces " a b " results in { "a", "b" }
  final String [] aParts = RegExHelper.getSplitToArray (sValue.trim (), "\\s+");
  if (aParts.length < getMinimumArgumentCount () || aParts.length > getMaximumArgumentCount ())
    return false;

  for (final String sPart : aParts)
    if (!super.isValidValue (sPart.trim ()))
      return false;
  return true;
}
 
Example #6
Source File: CSSPropertyNumbers.java    From ph-css with Apache License 2.0 6 votes vote down vote up
@Override
@OverridingMethodsMustInvokeSuper
public boolean isValidValue (@Nullable final String sValue)
{
  if (super.isValidValue (sValue))
    return true;

  if (sValue == null)
    return false;

  // Split by whitespaces
  final String [] aParts = RegExHelper.getSplitToArray (sValue.trim (), "\\s+");
  if (aParts.length < m_nMinArgCount || aParts.length > m_nMaxArgCount)
    return false;

  // Check if each part is a valid number
  for (final String sPart : aParts)
    if (!CSSNumberHelper.isValueWithUnit (sPart.trim (), m_bWithPercentage))
      return false;
  return true;
}
 
Example #7
Source File: CSSPropertyEnumOrColors.java    From ph-css with Apache License 2.0 6 votes vote down vote up
@Override
@OverridingMethodsMustInvokeSuper
public boolean isValidValue (@Nullable final String sValue)
{
  if (sValue == null)
    return false;

  // Split by whitespaces " a b " results in { "a", "b" }
  final String [] aParts = RegExHelper.getSplitToArray (sValue.trim (), "\\s+");
  if (aParts.length < getMinimumArgumentCount () || aParts.length > getMaximumArgumentCount ())
    return false;

  // Check each value
  for (final String aPart : aParts)
  {
    final String sTrimmedPart = aPart.trim ();
    if (!super.isValidValue (sTrimmedPart) && !CSSColorHelper.isColorValue (sTrimmedPart))
      return false;
  }
  return true;
}
 
Example #8
Source File: MappedCache.java    From ph-commons with Apache License 2.0 6 votes vote down vote up
@Nonnull
@OverridingMethodsMustInvokeSuper
public EChange removeFromCache (final KEYTYPE aKey)
{
  final KEYSTORETYPE aCacheKey = _getCacheKeyNonnull (aKey);

  m_aRWLock.writeLock ().lock ();
  try
  {
    if (m_aCache == null || m_aCache.remove (aCacheKey) == null)
      return EChange.UNCHANGED;
  }
  finally
  {
    m_aRWLock.writeLock ().unlock ();
  }

  m_aStatsCountRemove.increment ();
  if (LOGGER.isDebugEnabled ())
    LOGGER.debug (_getCacheLogText () + "Cache key '" + aKey + "' was removed.");
  return EChange.CHANGED;
}
 
Example #9
Source File: MappedCache.java    From ph-commons with Apache License 2.0 6 votes vote down vote up
@Nonnull
@OverridingMethodsMustInvokeSuper
public EChange clearCache ()
{
  m_aRWLock.writeLock ().lock ();
  try
  {
    if (m_aCache == null || m_aCache.isEmpty ())
      return EChange.UNCHANGED;

    m_aCache.clear ();
  }
  finally
  {
    m_aRWLock.writeLock ().unlock ();
  }

  m_aStatsCountClear.increment ();
  if (LOGGER.isDebugEnabled ())
    LOGGER.debug (_getCacheLogText () + "Cache was cleared");
  return EChange.CHANGED;
}
 
Example #10
Source File: ImprovedInputStream.java    From nomulus with Apache License 2.0 5 votes vote down vote up
@Override
@OverridingMethodsMustInvokeSuper
public int read() throws IOException {
  int result = in.read();
  if (result != -1) {
    count++;
  }
  return result;
}
 
Example #11
Source File: AbstractMapBasedMultilingualText.java    From ph-commons with Apache License 2.0 5 votes vote down vote up
@Override
@OverridingMethodsMustInvokeSuper
public String toString ()
{
  return ToStringGenerator.getDerived (super.toString ())
                          .appendIf ("ChangeNotifyCallbacks", m_aChangeNotifyCallbacks, CallbackList::isNotEmpty)
                          .getToString ();
}
 
Example #12
Source File: QuadTransformer.java    From CodeChickenLib with GNU Lesser General Public License v2.1 5 votes vote down vote up
@Override
@OverridingMethodsMustInvokeSuper
public void setInputQuad(Quad quad) {
    if (consumer instanceof IPipelineConsumer) {
        ((IPipelineConsumer) consumer).setInputQuad(quad);
    }
}
 
Example #13
Source File: ViewBasedProcessTemplate.java    From metasfresh-webui-api-legacy with GNU General Public License v3.0 5 votes vote down vote up
@OverridingMethodsMustInvokeSuper
protected IViewRow getSingleSelectedRow()
{
	final DocumentIdsSelection selectedRowIds = getSelectedRowIds();
	final DocumentId documentId = selectedRowIds.getSingleDocumentId();
	return getView().getById(documentId);
}
 
Example #14
Source File: HUEditorViewFactoryTemplate.java    From metasfresh-webui-api-legacy with GNU General Public License v3.0 5 votes vote down vote up
@OverridingMethodsMustInvokeSuper
protected DocumentFilterDescriptorsProvider createFilterDescriptorsProvider()
{
	final DocumentEntityDescriptor huEntityDescriptor = getHUEntityDescriptor();
	final Collection<DocumentFilterDescriptor> huStandardFilters = huEntityDescriptor.getFilterDescriptors().getAll();
	return ImmutableDocumentFilterDescriptorsProvider.builder()
			.addDescriptors(huStandardFilters)
			.addDescriptor(HUBarcodeSqlDocumentFilterConverter.createDocumentFilterDescriptor())
			.build();
}
 
Example #15
Source File: EntityInsentientPet.java    From SonarPet with GNU General Public License v3.0 5 votes vote down vote up
@OverridingMethodsMustInvokeSuper
public void initiateEntityPet() {
    this.resetEntitySize();
    getBukkitEntity().setMaxHealth(getPet().getPetType().getMaxHealth());
    getBukkitEntity().setHealth((float) getPet().getPetType().getMaxHealth());
    jumpHeight = EchoPet.getOptions().getRideJumpHeight(this.getPet().getPetType());
    rideSpeed = EchoPet.getOptions().getRideSpeed(this.getPet().getPetType());
    this.setPathfinding();
}
 
Example #16
Source File: AbstractActivity.java    From ground-android with Apache License 2.0 5 votes vote down vote up
/** Adjust UI elements with respect to top/bottom insets. */
@OverridingMethodsMustInvokeSuper
protected void onWindowInsetChanged(WindowInsetsCompat insets) {
  findViewById(R.id.status_bar_scrim)
      .setLayoutParams(
          new FrameLayout.LayoutParams(
              LayoutParams.MATCH_PARENT, insets.getSystemWindowInsetTop()));
}
 
Example #17
Source File: ImprovedOutputStream.java    From nomulus with Apache License 2.0 5 votes vote down vote up
/** @see java.io.FilterOutputStream#write(byte[], int, int) */
@Override
@OverridingMethodsMustInvokeSuper
public void write(byte[] b, int off, int len) throws IOException {
  out.write(b, off, len);
  count += len;
}
 
Example #18
Source File: ImprovedInputStream.java    From nomulus with Apache License 2.0 5 votes vote down vote up
@Override
@OverridingMethodsMustInvokeSuper
public int read(byte[] b, int off, int len) throws IOException {
  int result = in.read(b, off, len);
  if (result != -1) {
    count += result;
  }
  return result;
}
 
Example #19
Source File: GriefDefenderImplModule.java    From GriefDefender with MIT License 5 votes vote down vote up
@Override
@OverridingMethodsMustInvokeSuper
protected void configure() {
    this.bindAndExpose(Core.class).to(GDCore.class);
    this.bindAndExpose(EventManager.class).to(GDEventManager.class);
    this.bindAndExpose(PermissionManager.class).to(GDPermissionManager.class);
    this.bindAndExpose(Registry.class).to(GDRegistry.class);
    this.bindAndExpose(Version.class).to(GDVersion.class);

    this.requestStaticInjection(GriefDefender.class);
}
 
Example #20
Source File: ImprovedOutputStream.java    From nomulus with Apache License 2.0 5 votes vote down vote up
/** @see java.io.FilterOutputStream#write(int) */
@Override
@OverridingMethodsMustInvokeSuper
public void write(int b) throws IOException {
  out.write(b);
  ++count;
}
 
Example #21
Source File: AbstractEntityData.java    From Diorite with MIT License 5 votes vote down vote up
@OverridingMethodsMustInvokeSuper
@Override
public void serialize(SerializationData data)
{
    data.add("type", this.type);
    data.add("name", this.namee);
    data.addNumber("age", this.age, 3);
    data.add("special", this.special);
    data.add("displayName", this.displayName);
    data.addMappedList("metaObjects", MetaObject.class, this.metaObjects, o -> o.name);
    data.addMapAsListWithKeys("uuidMetaObjectMap", this.uuidMetaObjectMap, MetaObject.class, "uuid");
    data.addCollection("propertiesCollection", this.propertiesCollection, SomeProperties.class);
}
 
Example #22
Source File: AbstractWALDAO.java    From ph-commons with Apache License 2.0 5 votes vote down vote up
/**
 * This method must be called every time something changed in the DAO. It
 * triggers the writing to a file if auto-save is active. This method must be
 * called within a write-lock as it is not locked!
 *
 * @param aModifiedElement
 *        The modified data element. May not be <code>null</code>.
 * @param eActionType
 *        The action that was performed. May not be <code>null</code>.
 */
@MustBeLocked (ELockType.WRITE)
@OverridingMethodsMustInvokeSuper
protected void markAsChanged (@Nonnull final DATATYPE aModifiedElement, @Nonnull final EDAOActionType eActionType)
{
  ValueEnforcer.notNull (aModifiedElement, "ModifiedElement");
  ValueEnforcer.notNull (eActionType, "ActionType");

  // Convert single item to list
  markAsChanged (new CommonsArrayList <> (aModifiedElement), eActionType);
}
 
Example #23
Source File: AbstractReadOnlyMapBasedMultilingualText.java    From ph-commons with Apache License 2.0 5 votes vote down vote up
@Override
@OverridingMethodsMustInvokeSuper
public boolean equals (final Object o)
{
  if (o == this)
    return true;
  if (o == null || !getClass ().equals (o.getClass ()))
    return false;
  final AbstractReadOnlyMapBasedMultilingualText rhs = (AbstractReadOnlyMapBasedMultilingualText) o;
  return m_aTexts.equals (rhs.m_aTexts);
}
 
Example #24
Source File: GriefDefenderImplModule.java    From GriefDefender with MIT License 5 votes vote down vote up
@Override
@OverridingMethodsMustInvokeSuper
protected void configure() {
    this.bindAndExpose(Core.class).to(GDCore.class);
    this.bindAndExpose(EventManager.class).to(GDEventManager.class);
    this.bindAndExpose(PermissionManager.class).to(GDPermissionManager.class);
    this.bindAndExpose(Registry.class).to(GDRegistry.class);
    this.bindAndExpose(Version.class).to(GDVersion.class);

    this.requestStaticInjection(GriefDefender.class);
}
 
Example #25
Source File: AbstractPSBoundSchema.java    From ph-schematron with Apache License 2.0 5 votes vote down vote up
@OverridingMethodsMustInvokeSuper
protected void warn (@Nonnull final IPSElement aSourceElement, @Nonnull final String sMsg)
{
  getErrorHandler ().handleError (SingleError.builderWarn ()
                                             .setErrorLocation (new SimpleLocation (m_aOrigSchema.getResource ()
                                                                                                 .getPath ()))
                                             .setErrorFieldName (IPSErrorHandler.getErrorFieldName (aSourceElement))
                                             .setErrorText (sMsg)
                                             .build ());
}
 
Example #26
Source File: AbstractPSBoundSchema.java    From ph-schematron with Apache License 2.0 5 votes vote down vote up
@OverridingMethodsMustInvokeSuper
protected void error (@Nonnull final IPSElement aSourceElement,
                      @Nonnull final String sMsg,
                      @Nullable final Throwable t)
{
  getErrorHandler ().handleError (SingleError.builderError ()
                                             .setErrorLocation (new SimpleLocation (m_aOrigSchema.getResource ()
                                                                                                 .getPath ()))
                                             .setErrorFieldName (IPSErrorHandler.getErrorFieldName (aSourceElement))
                                             .setErrorText (sMsg)
                                             .setLinkedException (t)
                                             .build ());
}
 
Example #27
Source File: AbstractIpmiCommand.java    From ipmi4j with Apache License 2.0 5 votes vote down vote up
@Override
@OverridingMethodsMustInvokeSuper
public void toStringBuilder(StringBuilder buf, int depth) {
    appendHeader(buf, depth, "IpmiHeader");
    depth++;
    appendValue(buf, depth, "IpmiPayloadType", getPayloadType());
    appendValue(buf, depth, "IpmiCommand", getCommandName());
    appendValue(buf, depth, "SourceAddress", "0x" + UnsignedBytes.toString(getSourceAddress(), 16));
    appendValue(buf, depth, "SourceLun", getSourceLun());
    appendValue(buf, depth, "TargetAddress", "0x" + UnsignedBytes.toString(getTargetAddress(), 16));
    appendValue(buf, depth, "TargetLun", getTargetLun());
    appendValue(buf, depth, "SequenceNumber", getSequenceNumber());
}
 
Example #28
Source File: RetryConfiguration.java    From divolte-collector with Apache License 2.0 5 votes vote down vote up
@OverridingMethodsMustInvokeSuper
protected MoreObjects.ToStringHelper toStringHelper() {
    return MoreObjects.toStringHelper(this)
        .add("maxAttempts", maxAttempts)
        .add("totalTimeout", totalTimeout)
        .add("initialRetryDelay", initialRetryDelay)
        .add("retryDelayMultiplier", retryDelayMultiplier)
        .add("maxRetryDelay", maxRetryDelay);
}
 
Example #29
Source File: SinkTypeConfiguration.java    From divolte-collector with Apache License 2.0 5 votes vote down vote up
@OverridingMethodsMustInvokeSuper
protected MoreObjects.ToStringHelper toStringHelper() {
    return MoreObjects.toStringHelper(this)
            .add("enabled", enabled)
            .add("bufferSize", bufferSize)
            .add("threads", threads);
}
 
Example #30
Source File: BaseResultReceiver.java    From crate with Apache License 2.0 5 votes vote down vote up
@Override
@OverridingMethodsMustInvokeSuper
public void allFinished(boolean interrupted) {
    if (interrupted) {
        completionFuture.completeExceptionally(new ClientInterrupted());
    } else {
        completionFuture.complete(null);
    }
}