code stringlengths 73 34.1k | label stringclasses 1
value |
|---|---|
@Nonnull
public EChange addListener (@Nonnull final EventListener aListener)
{
ValueEnforcer.notNull (aListener, "Listener");
// Small consistency check
if (!(aListener instanceof ServletContextListener) &&
!(aListener instanceof HttpSessionListener) &&
!(aListener instanceof ServletReq... | java |
public static void forEachURLSet (@Nonnull final Consumer <? super XMLSitemapURLSet> aConsumer)
{
ValueEnforcer.notNull (aConsumer, "Consumer");
for (final IXMLSitemapProviderSPI aSPI : s_aProviders)
{
final XMLSitemapURLSet aURLSet = aSPI.createURLSet ();
aConsumer.accept (aURLSet);
}
} | java |
public Matrix4f getViewMatrix() {
if (updateViewMatrix) {
rotationMatrixInverse = Matrix4f.createRotation(rotation);
final Matrix4f rotationMatrix = Matrix4f.createRotation(rotation.invert());
final Matrix4f positionMatrix = Matrix4f.createTranslation(position.negate());
... | java |
public static Camera createPerspective(float fieldOfView, int windowWidth, int windowHeight, float near, float far) {
return new Camera(Matrix4f.createPerspective(fieldOfView, (float) windowWidth / windowHeight, near, far));
} | java |
public static X509Certificate readPemCertificate(final File file)
throws IOException, CertificateException
{
final String privateKeyAsString = readPemFileAsBase64(file);
final byte[] decoded = new Base64().decode(privateKeyAsString);
return readCertificate(decoded);
} | java |
@OverrideOnDemand
protected boolean isLogRequest (@Nonnull final HttpServletRequest aHttpRequest,
@Nonnull final HttpServletResponse aHttpResponse)
{
boolean bLog = isGloballyEnabled () && m_aLogger.isInfoEnabled ();
if (bLog)
{
// Check for excluded path
fi... | java |
@Nonnull
public CloseableHttpResponse execute (@Nonnull final HttpUriRequest aRequest) throws IOException
{
return execute (aRequest, (HttpContext) null);
} | java |
@Nonnull
public CloseableHttpResponse execute (@Nonnull final HttpUriRequest aRequest,
@Nullable final HttpContext aHttpContext) throws IOException
{
checkIfClosed ();
HttpDebugger.beforeRequest (aRequest, aHttpContext);
CloseableHttpResponse ret = null;
Throw... | java |
@Nullable
public <T> T execute (@Nonnull final HttpUriRequest aRequest,
@Nonnull final ResponseHandler <T> aResponseHandler) throws IOException
{
return execute (aRequest, (HttpContext) null, aResponseHandler);
} | java |
@Nonnull
public static EChange setMailQueueSize (@Nonnegative final int nMaxMailQueueLen,
@Nonnegative final int nMaxMailSendCount)
{
ValueEnforcer.isGT0 (nMaxMailQueueLen, "MaxMailQueueLen");
ValueEnforcer.isGT0 (nMaxMailSendCount, "MaxMailSendCount");
ValueEnf... | java |
@Nonnull
public static EChange setUseSSL (final boolean bUseSSL)
{
return s_aRWLock.writeLocked ( () -> {
if (s_bUseSSL == bUseSSL)
return EChange.UNCHANGED;
s_bUseSSL = bUseSSL;
return EChange.CHANGED;
});
} | java |
@Nonnull
public static EChange setUseSTARTTLS (final boolean bUseSTARTTLS)
{
return s_aRWLock.writeLocked ( () -> {
if (s_bUseSTARTTLS == bUseSTARTTLS)
return EChange.UNCHANGED;
s_bUseSTARTTLS = bUseSTARTTLS;
return EChange.CHANGED;
});
} | java |
@Nonnull
public static EChange setConnectionTimeoutMilliSecs (final long nMilliSecs)
{
return s_aRWLock.writeLocked ( () -> {
if (s_nConnectionTimeoutMilliSecs == nMilliSecs)
return EChange.UNCHANGED;
if (nMilliSecs <= 0)
LOGGER.warn ("You are setting an indefinite connection timeout... | java |
@Nonnull
public static EChange setTimeoutMilliSecs (final long nMilliSecs)
{
return s_aRWLock.writeLocked ( () -> {
if (s_nTimeoutMilliSecs == nMilliSecs)
return EChange.UNCHANGED;
if (nMilliSecs <= 0)
LOGGER.warn ("You are setting an indefinite socket timeout for the mail transport ... | java |
public static void addConnectionListener (@Nonnull final ConnectionListener aConnectionListener)
{
ValueEnforcer.notNull (aConnectionListener, "ConnectionListener");
s_aRWLock.writeLocked ( () -> s_aConnectionListeners.add (aConnectionListener));
} | java |
@Nonnull
public static EChange removeConnectionListener (@Nullable final ConnectionListener aConnectionListener)
{
if (aConnectionListener == null)
return EChange.UNCHANGED;
return s_aRWLock.writeLocked ( () -> s_aConnectionListeners.removeObject (aConnectionListener));
} | java |
public static void addEmailDataTransportListener (@Nonnull final IEmailDataTransportListener aEmailDataTransportListener)
{
ValueEnforcer.notNull (aEmailDataTransportListener, "EmailDataTransportListener");
s_aRWLock.writeLocked ( () -> s_aEmailDataTransportListeners.add (aEmailDataTransportListener));
} | java |
@Nonnull
public static EChange removeEmailDataTransportListener (@Nullable final IEmailDataTransportListener aEmailDataTransportListener)
{
if (aEmailDataTransportListener == null)
return EChange.UNCHANGED;
return s_aRWLock.writeLocked ( () -> s_aEmailDataTransportListeners.removeObject (aEmailDataTr... | java |
@SuppressFBWarnings ("LG_LOST_LOGGER_DUE_TO_WEAK_REFERENCE")
public static void enableJavaxMailDebugging (final boolean bDebug)
{
java.util.logging.Logger.getLogger ("com.sun.mail.smtp").setLevel (bDebug ? Level.FINEST : Level.INFO);
java.util.logging.Logger.getLogger ("com.sun.mail.smtp.protocol").setLevel... | java |
public static void setToDefault ()
{
s_aRWLock.writeLocked ( () -> {
s_nMaxMailQueueLen = DEFAULT_MAX_QUEUE_LENGTH;
s_nMaxMailSendCount = DEFAULT_MAX_SEND_COUNT;
s_bUseSSL = DEFAULT_USE_SSL;
s_bUseSTARTTLS = DEFAULT_USE_STARTTLS;
s_nConnectionTimeoutMilliSecs = DEFAULT_CONNECT_TIMEOU... | java |
public static byte[] convertToKeyByteArray(String yourGooglePrivateKeyString)
{
yourGooglePrivateKeyString = yourGooglePrivateKeyString.replace('-', '+');
yourGooglePrivateKeyString = yourGooglePrivateKeyString.replace('_', '/');
return Base64.getDecoder().decode(yourGooglePrivateKeyString);
} | java |
public static String signRequest(final String yourGooglePrivateKeyString, final String path,
final String query) throws NoSuchAlgorithmException, InvalidKeyException,
UnsupportedEncodingException, URISyntaxException
{
// Retrieve the proper URL components to sign
final String resource = path + '?' + query;
... | java |
public static String signRequest(final URL url, final String yourGooglePrivateKeyString)
throws NoSuchAlgorithmException, InvalidKeyException, UnsupportedEncodingException,
URISyntaxException
{
// Retrieve the proper URL components to sign
final String resource = url.getPath() + '?' + url.getQuery();
// Ge... | java |
public static void setResponseHeader (@Nonnull @Nonempty final String sName, @Nonnull @Nonempty final String sValue)
{
ValueEnforcer.notEmpty (sName, "Name");
ValueEnforcer.notEmpty (sValue, "Value");
s_aRWLock.writeLocked ( () -> s_aResponseHeaderMap.setHeader (sName, sValue));
} | java |
public static void addResponseHeader (@Nonnull @Nonempty final String sName, @Nonnull @Nonempty final String sValue)
{
ValueEnforcer.notEmpty (sName, "Name");
ValueEnforcer.notEmpty (sValue, "Value");
s_aRWLock.writeLocked ( () -> s_aResponseHeaderMap.addHeader (sName, sValue));
} | java |
public static <S, T> Map<S, T> merge(Map<S, T> map, Map<S, T> toMerge) {
Map<S, T> ret = new HashMap<S, T>();
ret.putAll(ensure(map));
ret.putAll(ensure(toMerge));
return ret;
} | java |
public void addHeader (@Nonnull final String sName, @Nullable final String sValue)
{
ValueEnforcer.notNull (sName, "HeaderName");
final String sNameLower = sName.toLowerCase (Locale.US);
m_aRWLock.writeLocked ( () -> {
ICommonsList <String> aHeaderValueList = m_aHeaderNameToValueListMap.get (sName... | java |
public static void checkVersion(GLVersioned required, GLVersioned object) {
if (!debug) {
return;
}
final GLVersion requiredVersion = required.getGLVersion();
final GLVersion objectVersion = object.getGLVersion();
if (objectVersion.getMajor() > requiredVersion.getMajo... | java |
public static int[] getPackedPixels(ByteBuffer imageData, Format format, Rectangle size) {
final int[] pixels = new int[size.getArea()];
final int width = size.getWidth();
final int height = size.getHeight();
for (int x = 0; x < width; x++) {
for (int y = 0; y < height; y++) ... | java |
public static BufferedImage getImage(ByteBuffer imageData, Format format, Rectangle size) {
final int width = size.getWidth();
final int height = size.getHeight();
final BufferedImage image = new BufferedImage(width, height, BufferedImage.TYPE_INT_ARGB);
final int[] pixels = ((DataBuffer... | java |
public static Vector4f fromIntRGBA(int r, int g, int b, int a) {
return new Vector4f((r & 0xff) / 255f, (g & 0xff) / 255f, (b & 0xff) / 255f, (a & 0xff) / 255f);
} | java |
public static ByteBuffer createByteBuffer(int capacity) {
return ByteBuffer.allocateDirect(capacity * DataType.BYTE.getByteSize()).order(ByteOrder.nativeOrder());
} | java |
protected UnmappedReads<Read> getUnmappedMatesOfMappedReads(String readsetId)
throws GeneralSecurityException, IOException {
LOG.info("Collecting unmapped mates of mapped reads for injection");
final Iterable<Read> unmappedReadsIterable = getUnmappedReadsIterator(readsetId);
final UnmappedReads<Read... | java |
public void set(Rectangle rectangle) {
set(rectangle.getX(), rectangle.getY(), rectangle.getWidth(), rectangle.getHeight());
} | java |
@Nullable
public static ISessionWebScope getSessionWebScopeOfSession (@Nullable final HttpSession aHttpSession)
{
return aHttpSession == null ? null : getSessionWebScopeOfID (aHttpSession.getId ());
} | java |
public static void destroyAllWebSessions ()
{
// destroy all session web scopes (make a copy, because we're invalidating
// the sessions!)
for (final ISessionWebScope aSessionScope : getAllSessionWebScopes ())
{
// Unfortunately we need a special handling here
if (aSessionScope.selfDestruc... | java |
private void writeObject (final ObjectOutputStream aOS) throws IOException
{
// Read the data
if (m_aDFOS.isInMemory ())
{
_ensureCachedContentIsPresent ();
}
else
{
m_aCachedContent = null;
m_aDFOSFile = m_aDFOS.getFile ();
}
// write out values
aOS.defaultWrite... | java |
@Nonnegative
public long getSize ()
{
if (m_nSize >= 0)
return m_nSize;
if (m_aCachedContent != null)
return m_aCachedContent.length;
if (m_aDFOS.isInMemory ())
return m_aDFOS.getDataLength ();
return m_aDFOS.getFile ().length ();
} | java |
@ReturnsMutableObject ("Speed")
@SuppressFBWarnings ("EI_EXPOSE_REP")
@Nullable
public byte [] directGet ()
{
if (isInMemory ())
{
_ensureCachedContentIsPresent ();
return m_aCachedContent;
}
return SimpleFileIO.getAllFileBytes (m_aDFOS.getFile ());
} | java |
@Nonnull
public String getStringWithFallback (@Nonnull final Charset aFallbackCharset)
{
final String sCharset = getCharSet ();
final Charset aCharset = CharsetHelper.getCharsetFromNameOrDefault (sCharset, aFallbackCharset);
return getString (aCharset);
} | java |
public void run(String[] args) {
LOG.info("Starting GA4GHPicardRunner");
try {
parseCmdLine(args);
buildPicardCommand();
startProcess();
pumpInputData();
waitForProcessEnd();
} catch (Exception e) {
System.out.println(e.getMessage());
e.printStackTrace();
}
} | java |
void parseCmdLine(String[] args) {
JCommander parser = new JCommander(this, args);
parser.setProgramName("GA4GHPicardRunner");
LOG.info("Cmd line parsed");
} | java |
private void buildPicardCommand()
throws IOException, GeneralSecurityException, URISyntaxException {
File picardJarPath = new File(picardPath, "picard.jar");
if (!picardJarPath.exists()) {
throw new IOException("Picard tool not found at " +
picardJarPath.getAbsolutePath());
}
... | java |
private Input processGA4GHInput(String input) throws IOException, GeneralSecurityException, URISyntaxException {
GA4GHUrl url = new GA4GHUrl(input);
SAMFilePump pump;
if (usingGrpc) {
factoryGrpc.configure(url.getRootUrl(),
new Settings(clientSecretsFilename, apiKey, noLocalServer));
pu... | java |
private Input processRegularFileInput(String input) throws IOException {
File inputFile = new File(input);
if (!inputFile.exists()) {
throw new IOException("Input does not exist: " + input);
}
if (pipeFiles) {
SamReader samReader = SamReaderFactory.makeDefault().open(inputFile);
return... | java |
private void startProcess() throws IOException {
LOG.info("Building process");
ProcessBuilder processBuilder = new ProcessBuilder(command);
processBuilder.redirectError(ProcessBuilder.Redirect.INHERIT);
processBuilder.redirectOutput(ProcessBuilder.Redirect.INHERIT);
LOG.info("Starting process");
... | java |
private void pumpInputData() throws IOException {
for (Input input : inputs) {
if (input.pump == null) {
continue;
}
OutputStream os;
if (input.pipeName.equals(STDIN_FILE_NAME)) {
os = process.getOutputStream();
} else {
throw new IOException("Only stdin piping ... | java |
@Nonnull
public static DefaultTreeWithGlobalUniqueID <String, NetworkInterface> createNetworkInterfaceTree ()
{
final DefaultTreeWithGlobalUniqueID <String, NetworkInterface> ret = new DefaultTreeWithGlobalUniqueID <> ();
// Build basic level - all IFs without a parent
final ICommonsList <NetworkInterf... | java |
public static Runner runnerForClass0(RunnerBuilder builder, Class<?> testClass) throws Throwable {
if (recursiveDepth > 1 ||
isOnStack(0, CoverageRunner.class.getCanonicalName())) {
return builder.runnerForClass(testClass);
}
AffectingBuilder affectingBuilder = new Affect... | java |
private static boolean isOnStack(int moreThan, String canonicalName) {
StackTraceElement[] stackTrace = Thread.currentThread().getStackTrace();
int count = 0;
for (StackTraceElement element : stackTrace) {
if (element.getClassName().startsWith(canonicalName)) {
count+... | java |
public static void validateHTMLConfiguration () throws IllegalStateException
{
// This will throw an IllegalStateException for wrong files in html/js.xml
// and html/css.xml
PhotonCSS.readCSSIncludesForGlobal (new ClassPathResource (PhotonCSS.DEFAULT_FILENAME));
PhotonJS.readJSIncludesForGlobal (new C... | java |
@Nonnull
public FineUploader5Form setElementID (@Nonnull @Nonempty final String sElementID)
{
ValueEnforcer.notEmpty (sElementID, "ElementID");
m_sFormElementID = sElementID;
return this;
} | java |
public static void setAuditor (@Nonnull final IAuditor aAuditor)
{
ValueEnforcer.notNull (aAuditor, "Auditor");
s_aRWLock.writeLocked ( () -> s_aAuditor = aAuditor);
} | java |
private static boolean startsWith(String str, String... prefixes) {
for (String prefix : prefixes) {
if (str.startsWith(prefix)) return true;
}
return false;
} | java |
private static List<String> extractClassNames(String jarName) throws IOException {
List<String> classes = new LinkedList<String>();
ZipInputStream orig = new ZipInputStream(new FileInputStream(jarName));
for (ZipEntry entry = orig.getNextEntry(); entry != null; entry = orig.getNextEntry()) {
... | java |
public static void main(String[] args) throws IOException {
if (args.length != 1) {
System.out.println("There should be an argument: path to a jar.");
System.exit(0);
}
String jarInput = args[0];
extract(new File(jarInput), new File("/tmp/junit-ekstazi-agent.jar")... | java |
public static boolean isJSNode (@Nullable final IHCNode aNode)
{
final IHCNode aUnwrappedNode = HCHelper.getUnwrappedNode (aNode);
return isDirectJSNode (aUnwrappedNode);
} | java |
public static boolean isJSInlineNode (@Nullable final IHCNode aNode)
{
final IHCNode aUnwrappedNode = HCHelper.getUnwrappedNode (aNode);
return isDirectJSInlineNode (aUnwrappedNode);
} | java |
public static boolean isJSFileNode (@Nullable final IHCNode aNode)
{
final IHCNode aUnwrappedNode = HCHelper.getUnwrappedNode (aNode);
return isDirectJSFileNode (aUnwrappedNode);
} | java |
@Nonnull
public JSVar param (@Nonnull @Nonempty final String sName)
{
final JSVar aVar = new JSVar (sName, null);
m_aParams.add (aVar);
return aVar;
} | java |
@Nonnull
public JSBlock body ()
{
if (m_aBody == null)
m_aBody = new JSBlock ().newlineAtEnd (false);
return m_aBody;
} | java |
@Nonnull
public static HCCol perc (@Nonnegative final int nPerc)
{
return new HCCol ().setWidth (ECSSUnit.perc (nPerc));
} | java |
public int enrichXml(final MMOs root) throws SQLException {
int count = 0;
// TODO: take out the print statements
for (final MMO mmo : root.getMMO()) {
for (final Utterance utterance : mmo.getUtterances().getUtterance()) {
for (final Phrase phrase : utterance.getPhras... | java |
public boolean addSnomedId(final Candidate candidate) throws SQLException {
final SnomedTerm result = findFromCuiAndDesc(candidate.getCandidateCUI(), candidate.getCandidatePreferred());
if (result != null) {
candidate.setSnomedId(result.snomedId);
candidate.setTermType(result.ter... | java |
public static boolean looksLikeXHTML (@Nullable final String sText)
{
// If the text contains an open angle bracket followed by a character that
// we think of it as HTML
// (?s) enables the "dotall" mode - see Pattern.DOTALL
return StringHelper.hasText (sText) && RegExHelper.stringMatchesPattern ("(?... | java |
public boolean isValidXHTMLFragment (@Nullable final String sXHTMLFragment)
{
return StringHelper.hasNoText (sXHTMLFragment) || parseXHTMLFragment (sXHTMLFragment) != null;
} | java |
@Nullable
public IMicroContainer unescapeXHTMLFragment (@Nullable final String sXHTML)
{
// Ensure that the content is surrounded by a single tag
final IMicroDocument aDoc = parseXHTMLFragment (sXHTML);
if (aDoc != null && aDoc.getDocumentElement () != null)
{
// Find "body" case insensitive
... | java |
@Nullable
@ContainsSoftMigration
public static LocalDateTime readAsLocalDateTime (@Nonnull final IMicroElement aElement,
@Nonnull final IMicroQName aLDTName,
@Nonnull final String aDTName)
{
LocalDateTime aLD... | java |
@Nonnull
public BootstrapDisplayBuilder display (@Nonnull final EBootstrapDisplayType eDisplay)
{
ValueEnforcer.notNull (eDisplay, "eDisplay");
m_eDisplay = eDisplay;
return this;
} | java |
@Nonnull
public final HCHead addCSSAt (@Nonnegative final int nIndex, @Nonnull final IHCNode aCSS)
{
ValueEnforcer.notNull (aCSS, "CSS");
if (!HCCSSNodeDetector.isCSSNode (aCSS))
throw new IllegalArgumentException (aCSS + " is not a valid CSS node!");
m_aCSS.add (nIndex, aCSS);
return this;
... | java |
@Nonnull
public final HCHead addJS (@Nonnull final IHCNode aJS)
{
ValueEnforcer.notNull (aJS, "JS");
if (!HCJSNodeDetector.isJSNode (aJS))
throw new IllegalArgumentException (aJS + " is not a valid JS node!");
m_aJS.add (aJS);
return this;
} | java |
@Nonnull
public final HCHead addJSAt (@Nonnegative final int nIndex, @Nonnull final IHCNode aJS)
{
ValueEnforcer.notNull (aJS, "JS");
if (!HCJSNodeDetector.isJSNode (aJS))
throw new IllegalArgumentException (aJS + " is not a valid JS node!");
m_aJS.add (nIndex, aJS);
return this;
} | java |
public static Ekstazi inst() {
if (inst != null) return inst;
synchronized (Ekstazi.class) {
if (inst == null) {
inst = new Ekstazi();
}
}
return inst;
} | java |
public void endClassCoverage(String className, boolean isFailOrError) {
File testResultsDir = new File(Config.ROOT_DIR_V, Names.TEST_RESULTS_DIR_NAME);
File outcomeFile = new File(testResultsDir, className);
if (isFailOrError) {
// TODO: long names.
testResultsDir.mkdirs(... | java |
private boolean initAndReportSuccess() {
// Load configuration.
Config.loadConfig();
// Initialize storer, hashes, and analyzer.
mDependencyAnalyzer = Config.createDepenencyAnalyzer();
// Establish if Tool is enabled.
boolean isEnabled = establishIfEnabled();
// ... | java |
protected void emitPluginLines (final MarkdownHCStack aOut, final Line aLines, @Nonnull final String sMeta)
{
Line aLine = aLines;
String sIDPlugin = sMeta;
String sParams = null;
ICommonsMap <String, String> aParams = null;
final int nIdxOfSpace = sMeta.indexOf (' ');
if (nIdxOfSpace != -1)
... | java |
public static Date copy(final Date d) {
if (d == null) {
return null;
} else {
return new Date(d.getTime());
}
} | java |
public static <A> List<A> list(A... elements) {
final List<A> list = new ArrayList<A>(elements.length);
for (A element : elements) {
list.add(element);
}
return list;
} | java |
public static <A> Set<A> set(A... elements) {
final Set<A> set = new HashSet<A>(elements.length);
for (A element : elements) {
set.add(element);
}
return set;
} | java |
public static <A> A execute(ExceptionAction<A> action) {
try {
return action.doAction();
} catch (RuntimeException e) {
throw e;
} catch (Error e) {
throw e;
} catch (Throwable e) {
throw new RuntimeException(e);
}
} | java |
public void addFieldInfo (@Nonnull @Nonempty final String sFieldName, @Nonnull @Nonempty final String sText)
{
add (SingleError.builderInfo ().setErrorFieldName (sFieldName).setErrorText (sText).build ());
} | java |
public void addFieldWarning (@Nonnull @Nonempty final String sFieldName, @Nonnull @Nonempty final String sText)
{
add (SingleError.builderWarn ().setErrorFieldName (sFieldName).setErrorText (sText).build ());
} | java |
public void addFieldError (@Nonnull @Nonempty final String sFieldName, @Nonnull @Nonempty final String sText)
{
add (SingleError.builderError ().setErrorFieldName (sFieldName).setErrorText (sText).build ());
} | java |
@Nonnull
public IUserGroup createNewUserGroup (@Nonnull @Nonempty final String sName,
@Nullable final String sDescription,
@Nullable final Map <String, String> aCustomAttrs)
{
// Create user group
final UserGroup aUserGroup = ne... | java |
@Nonnull
public IUserGroup createPredefinedUserGroup (@Nonnull @Nonempty final String sID,
@Nonnull @Nonempty final String sName,
@Nullable final String sDescription,
@Nullable ... | java |
@Nonnull
public EChange deleteUserGroup (@Nullable final String sUserGroupID)
{
if (StringHelper.hasNoText (sUserGroupID))
return EChange.UNCHANGED;
final UserGroup aDeletedUserGroup = getOfID (sUserGroupID);
if (aDeletedUserGroup == null)
{
AuditHelper.onAuditDeleteFailure (UserGroup.O... | java |
@Nonnull
public EChange undeleteUserGroup (@Nullable final String sUserGroupID)
{
final UserGroup aUserGroup = getOfID (sUserGroupID);
if (aUserGroup == null)
{
AuditHelper.onAuditUndeleteFailure (UserGroup.OT, sUserGroupID, "no-such-id");
return EChange.UNCHANGED;
}
m_aRWLock.write... | java |
@Nonnull
public EChange renameUserGroup (@Nullable final String sUserGroupID, @Nonnull @Nonempty final String sNewName)
{
// Resolve user group
final UserGroup aUserGroup = getOfID (sUserGroupID);
if (aUserGroup == null)
{
AuditHelper.onAuditModifyFailure (UserGroup.OT, sUserGroupID, "no-such-... | java |
@Nonnull
public EChange unassignUserFromAllUserGroups (@Nullable final String sUserID)
{
if (StringHelper.hasNoText (sUserID))
return EChange.UNCHANGED;
final ICommonsList <IUserGroup> aAffectedUserGroups = new CommonsArrayList <> ();
m_aRWLock.writeLock ().lock ();
try
{
EChange eC... | java |
@Nonnull
@ReturnsMutableCopy
public ICommonsList <IUserGroup> getAllUserGroupsWithAssignedUser (@Nullable final String sUserID)
{
if (StringHelper.hasNoText (sUserID))
return new CommonsArrayList <> ();
return getAll (aUserGroup -> aUserGroup.containsUserID (sUserID));
} | java |
@Nonnull
@ReturnsMutableCopy
public ICommonsList <String> getAllUserGroupIDsWithAssignedUser (@Nullable final String sUserID)
{
if (StringHelper.hasNoText (sUserID))
return new CommonsArrayList <> ();
return getAllMapped (aUserGroup -> aUserGroup.containsUserID (sUserID), aUserGroup -> aUserGroup.g... | java |
@Nonnull
public EChange unassignRoleFromAllUserGroups (@Nullable final String sRoleID)
{
if (StringHelper.hasNoText (sRoleID))
return EChange.UNCHANGED;
final ICommonsList <IUserGroup> aAffectedUserGroups = new CommonsArrayList <> ();
m_aRWLock.writeLock ().lock ();
try
{
EChange eC... | java |
@Nonnull
@ReturnsMutableCopy
public ICommonsList <String> getAllUserGroupIDsWithAssignedRole (@Nullable final String sRoleID)
{
if (StringHelper.hasNoText (sRoleID))
return getNone ();
return getAllMapped (aUserGroup -> aUserGroup.containsRoleID (sRoleID), IUserGroup::getID);
} | java |
public final void internalSetNodeState (@Nonnull final EHCNodeState eNodeState)
{
if (DEBUG_NODE_STATE)
{
ValueEnforcer.notNull (eNodeState, "NodeState");
if (m_eNodeState.isAfter (eNodeState))
HCConsistencyChecker.consistencyError ("The new node state is invalid. Got " +
... | java |
public static boolean check(Class<?> clz) {
if (Config.CACHE_SEEN_CLASSES_V) {
int index = hash(clz);
if (CACHE[index] == clz) {
return true;
}
CACHE[index] = clz;
}
return false;
} | java |
public Map<String, String> getResults() {
final Map<String, String> results = new HashMap<String, String>(sinks.size());
for (Map.Entry<String, StringSink> entry : sinks.entrySet()) {
results.put(entry.getKey(), entry.getValue().result());
}
return Collections.unmodifiableMap... | java |
public static void main(String[] args) {
// Parse arguments.
String coverageDirName = null;
if (args.length == 0) {
System.out.println("Incorrect arguments. Directory with coverage has to be specified.");
System.exit(1);
}
coverageDirName = args[0];
... | java |
private static List<String> findNonAffectedClasses(String workingDirectory) {
Set<String> allClasses = new HashSet<String>();
Set<String> affectedClasses = new HashSet<String>();
loadConfig(workingDirectory);
// Find non affected classes.
List<String> nonAffectedClasses = findNon... | java |
private static void printNonAffectedClasses(Set<String> allClasses, Set<String> affectedClasses,
List<String> nonAffectedClasses, String mode) {
if (mode != null && mode.equals(ANT_MODE)) {
StringBuilder sb = new StringBuilder();
for (String className : nonAffectedClasses) {
... | java |
private static void includeAffected(Set<String> allClasses, Set<String> affectedClasses, List<File> sortedFiles) {
Storer storer = Config.createStorer();
Hasher hasher = Config.createHasher();
NameBasedCheck classCheck = Config.DEBUG_MODE_V != Config.DebugMode.NONE ?
new DebugNameCh... | java |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.