This method verifies that this GO has no PCI representation or that the PCI representation
is not dirty or new.
Otherwise it will throw an exception in order to prevent the dirty state of the GO and the
PC to result in conflicting updates in the database.
345722
void verifyPcNotDirty() {
		if (handle == null || handle.internalGetPCI() == null || 
				!handle.internalGetPCI().jdoZooIsDirty()) {
			ZooPC pc = jdoZooGetContext().getSession().internalGetCache().findCoByOID(
					jdoZooGetOid());
			if (pc == null || !pc.jdoZooIsDirty()) {
				return;
			}
		}
		throw DBLogger.newUser("This object has been modified via its Java class as well as via" +
				" the schema API. This is not allowed. Objectid: " + 
				Util.oidToString(jdoZooGetOid()));
	}
674596
public void verify() throws VerificationException {
        final Transaction fromTx = getOutpoint().fromTx;
        long spendingIndex = getOutpoint().getIndex();
        checkNotNull(fromTx, "Not connected");
        final TransactionOutput output = fromTx.getOutput((int) spendingIndex);
        verify(output);
    }
855712
def _is_empty_cache_record(self, rec):
        
        # these are taken from DataQuery.query_one_table()
        for k in [
            'by_version',
            'by_file_type',
            'by_installer',
            'by_implementation',
            'by_system',
            'by_distro',
            'by_country'
        ]:
            if k in rec and len(rec[k]) > 0:
                return False
        return True
313809
public boolean isConnectionError(SQLException ex) {
        final boolean isTraceOn = TraceComponent.isAnyTracingEnabled();

        if (isTraceOn && tc.isEntryEnabled())
            Tr.entry(this, tc, "isConnectionError", ex);

        // Maintain a set in order to check for cycles
        Set<Throwable> chain = new HashSet<Throwable>();

        boolean stale = super.isConnectionError(ex);
        for (Throwable t = ex; t != null && !stale && chain.add(t); t = t.getCause()) {
            SQLException sqlX = t instanceof SQLException ? (SQLException) t : null;
            if (isTraceOn && tc.isDebugEnabled())
                Tr.debug(this, tc, "checking " + t,
                         sqlX == null ? null : sqlX.getSQLState(),
                         sqlX == null ? null : sqlX.getErrorCode());
            if (sqlX != null)
                stale |= isDataDirectExp(ex)
                         ? staleDDErrorCodes.contains(sqlX.getErrorCode()) || staleDDSQLStates.contains(sqlX.getSQLState())
                         : staleMSErrorCodes.contains(sqlX.getErrorCode());
        }

        if (isTraceOn && tc.isEntryEnabled())
            Tr.exit(this, tc, "isConnectionError", stale);

        return stale;
    }
386459
protected final void checkIntegrity () throws InternetSCSIException {

        String exceptionMessage = "";
        switch (t) {
            case OUI_FORMAT :
                break;

            case IANA_ENTERPRISE_NUMBER :
                break;

            case RANDOM :
//                if (d != 0) {
//                    exceptionMessage = "The D field is reserved in this ISID Format.";
//                }
                break;

            case RESERVED :
                if (a != 0 && b != 0 && c != 0 && d != 0) {
                    exceptionMessage = "This ISID is not valid. All";
                }
                break;

            default :
                exceptionMessage = "This format is not supported.";
        }

        if (exceptionMessage.length() > 0) {
            throw new InternetSCSIException(exceptionMessage);
        } else {
            // no error occured... Nice! :-)
        }
    }
1289734
def is_dirty(using=None):
    
    if using is None:
        dirty = False
        for using in tldap.backend.connections:
            connection = tldap.backend.connections[using]
            if connection.is_dirty():
                dirty = True
        return dirty
    connection = tldap.backend.connections[using]
    return connection.is_dirty()
1102977
private void checkNewlySharded(DBObject dbObj, Map<String, String> currScalarMap) {
        if (!m_tableDef.isSharded()) {
            return;
        }
        String shardingFieldName = m_tableDef.getShardingField().getName();
        if (!currScalarMap.containsKey(shardingFieldName)) {
            m_dbTran.addAllObjectsColumn(m_tableDef, dbObj.getObjectID(), m_tableDef.getShardNumber(dbObj));
        }
    }
1264244
public boolean hasCardEncoding() {
    if (this.cardinalityEncoding == CardinalityEncoding.TOTALIZER)
      return this.totalizer.hasCreatedEncoding();
    else if (this.cardinalityEncoding == CardinalityEncoding.MTOTALIZER)
      return this.mtotalizer.hasCreatedEncoding();
    return false;
  }
121160
public synchronized boolean isValid() {
		if (!validState) {
			throw new InvalidStateException();
		}
		final long size = size();
		if (size == 0) {
			return true;
		}
		try {
			final long offset = (size - FOOTER_LEN);
			if (offset < 0) {
				return false;
			}
			if (offset >= offsetOutputCommited) {
				if (bufOutput.position() > 0) {
					log.warn("WARN: autoflush forced");
					flushBuffer();
				}
			}
			bufInput.clear();
			bufInput.limit(FOOTER_LEN);
			final int readed = fcInput.position(offset).read(bufInput);
			if (readed < FOOTER_LEN) {
				return false;
			}
			bufInput.flip();
			final int footer = bufInput.get(); 	// Footer (byte)
			if (footer != MAGIC_FOOT) {
				log.error("MAGIC FOOT fake=" + Integer.toHexString(footer) + " expected="
						+ Integer.toHexString(MAGIC_FOOT));
				return false;
			}
			return true;
		} catch (Exception e) {
			log.error("Exception in isValid()", e);
		}
		return false;
	}
133432
public boolean isAnAuthorizationException(SQLException x) {
        final boolean isTraceOn = TraceComponent.isAnyTracingEnabled();
        if (isTraceOn && tc.isEntryEnabled())
            Tr.entry(this, tc, "isAnAuthorizationException", x);

        boolean isAuthError = false;
        LinkedList<SQLException> stack = new LinkedList<SQLException>();
        if (x != null) 
            stack.push(x);

        // Limit the chain depth so that poorly written exceptions don't cause an infinite loop.
        for (int depth = 0; depth < 20 && !isAuthError && !stack.isEmpty(); depth++) {
            x = stack.pop();

            isAuthError |= isAuthException(x);

            // Add the chained exceptions to the stack.

            if (x.getNextException() != null)
                stack.push(x.getNextException());
            if (x.getCause() instanceof SQLException && x.getCause() != x.getNextException())
                stack.push((SQLException) x.getCause());
        }

        if (isTraceOn && tc.isEntryEnabled())
            Tr.exit(this, tc, "isAnAuthorizationException", isAuthError);
        return isAuthError;
    }
981881
def update(self, pci):
        """"""
        _PCI.update(self, pci)

        # now do the BACnet PCI fields
        self.pduExpectingReply = pci.pduExpectingReply
        self.pduNetworkPriority = pci.pduNetworkPriority
940181
public void doSet(Record record) throws DBException
    {
        if (this.lockOnDBTrxType(null, DBConstants.UPDATE_TYPE, true))
        {
            int iErrorCode = this.lockCurrentRecord();
            if ((iErrorCode == DBConstants.NORMAL_RETURN) || (iErrorCode == DBConstants.RECORD_CHANGED))
            {
                iErrorCode = record.refreshToCurrent(DBConstants.UPDATE_TYPE, true);
            }
        }
//        int iRowsUpdated = 0;
        Object bookmark = record.getHandle(DBConstants.BOOKMARK_HANDLE);
        CounterField fldID = (CounterField)record.getCounterField();
        if (fldID != null)
            if (record.isAutoSequence())
                fldID.setModified(false); // Never set a counter field
        String strRecordset = record.getSQLUpdate(SQLParams.USE_INSERT_UPDATE_LITERALS);
        int iType = DBConstants.SQL_UPDATE_TYPE;
            if (strRecordset != null)
                /*iRowsUpdated =*/ this.executeUpdate(strRecordset, iType);
//            else
//                iRowsUpdated = 1; // No changes
        if (this.lockOnDBTrxType(null, DBConstants.AFTER_UPDATE_TYPE, false))  // ADD_TYPE = Add new; Should I do the unlock in my code?
            this.unlockIfLocked(record, bookmark);
    }
1064252
def pci_contents(self, use_dict=None, as_class=dict):
        """"""
        if _debug: PCI._debug("pci_contents use_dict=%r as_class=%r", use_dict, as_class)

        # make/extend the dictionary of content
        if use_dict is None:
            use_dict = as_class()

        # call the parent class
        _PCI.pci_contents(self, use_dict=use_dict, as_class=as_class)

        # save the values
        use_dict.__setitem__('expectingReply', self.pduExpectingReply)
        use_dict.__setitem__('networkPriority', self.pduNetworkPriority)

        # return what we built/updated
        return use_dict
680545
private void unshallowIfNeeded(GitCommand gitCommand, ConsoleOutputStreamConsumer streamConsumer, Revision revision, File workingDir) {
        if (gitCommand.isShallow() && !gitCommand.containsRevisionInBranch(revision)) {
            gitCommand.unshallow(streamConsumer, UNSHALLOW_TRYOUT_STEP);

            if (gitCommand.isShallow() && !gitCommand.containsRevisionInBranch(revision)) {
                fullyUnshallow(gitCommand, streamConsumer);
            }
        }
    }
1328207
private boolean keyAlreadyExists(String newKey) {

        Collection<?> itemIds = m_table.getItemIds();
        for (Object itemId : itemIds) {
            if (m_table.getItem(itemId).getItemProperty(TableProperty.KEY).getValue().equals(newKey)) {
                return true;
            }
        }
        return false;
    }
804757
def card_nonce=(card_nonce)

      if !card_nonce.nil? && card_nonce.to_s.length > 192
        fail ArgumentError, "invalid value for 'card_nonce', the character length must be smaller than or equal to 192."
      end

      @card_nonce = card_nonce
    end
973990
public void noExceptionThrown() {
    Throwable thrown = getSpecificationContext().getThrownException();
    if (thrown == null) return;
    throw new UnallowedExceptionThrownError(null, thrown);
  }