_id
stringlengths
2
7
title
stringlengths
3
140
partition
stringclasses
3 values
text
stringlengths
73
34.1k
language
stringclasses
1 value
meta_information
dict
q15700
FamFamFlags.getFlagFromLocale
train
@Nullable public static EFamFamFlagIcon getFlagFromLocale (@Nullable final Locale aFlagLocale) { if (aFlagLocale != null) { final String sCountry = aFlagLocale.getCountry (); if (StringHelper.hasText (sCountry)) return EFamFamFlagIcon.getFromIDOrNull (sCountry); } return null; ...
java
{ "resource": "" }
q15701
DynamicSelectEkstaziMojo.checkIfEkstaziDirCanBeCreated
train
private void checkIfEkstaziDirCanBeCreated() throws MojoExecutionException { File ekstaziDir = Config.createRootDir(parentdir); // If .ekstazi does not exist and cannot be created, let them // know. (We also remove directory if successfully created.) if (!ekstaziDir.exists() && (!ekstaz...
java
{ "resource": "" }
q15702
SystemMessageData.setSystemMessage
train
@Nonnull public EChange setSystemMessage (@Nonnull final ESystemMessageType eMessageType, @Nullable final String sMessage) { ValueEnforcer.notNull (eMessageType, "MessageType"); if (m_eMessageType.equals (eMessageType) && EqualsHelper.equals (m_sMessage, sMessage)) return EChange.UNCHANGED; inte...
java
{ "resource": "" }
q15703
CrtAuthServer.createChallenge
train
public String createChallenge(String request) throws IllegalArgumentException, ProtocolVersionException { String userName; userName = CrtAuthCodec.deserializeRequest(request); Fingerprint fingerprint; try { fingerprint = new Fingerprint(getKeyForUser(userName)); } catch (KeyNotFoundExc...
java
{ "resource": "" }
q15704
CrtAuthServer.getKeyForUser
train
private RSAPublicKey getKeyForUser(String userName) throws KeyNotFoundException { RSAPublicKey key = null; for (final KeyProvider keyProvider : keyProviders) { try { key = keyProvider.getKey(userName); break; } catch (KeyNotFoundException e) { // that's fine, try the next pro...
java
{ "resource": "" }
q15705
CrtAuthServer.createFakeFingerprint
train
private Fingerprint createFakeFingerprint(String userName) { byte[] usernameHmac = CrtAuthCodec.getAuthenticationCode( this.secret, userName.getBytes(Charsets.UTF_8)); return new Fingerprint(Arrays.copyOfRange(usernameHmac, 0, 6)); }
java
{ "resource": "" }
q15706
CrtAuthServer.createToken
train
public String createToken(String response) throws IllegalArgumentException, ProtocolVersionException { final Response decodedResponse; final Challenge challenge; decodedResponse = CrtAuthCodec.deserializeResponse(decode(response)); challenge = CrtAuthCodec.deserializeChallengeAuthenticated( ...
java
{ "resource": "" }
q15707
CrtAuthServer.validateToken
train
public String validateToken(String token) throws IllegalArgumentException, TokenExpiredException, ProtocolVersionException { final Token deserializedToken = CrtAuthCodec.deserializeTokenAuthenticated(decode(token), secret); if (deserializedToken.isExpired(timeSupplier)) { throw new TokenExpi...
java
{ "resource": "" }
q15708
Lexers.lookupLexer
train
public Optional<Object> lookupLexer(PyGateway gateway, String alias) { Object result = lexerCache.get(alias); if (result == null) { result = evalLookupLexer(gateway, alias, NULL); lexerCache.put(alias, result); } if (result == NULL) { return Optional...
java
{ "resource": "" }
q15709
ChannelSftpRunner.execute
train
@Nonnull public static ESuccess execute (@Nonnull final IJSchSessionProvider aSessionProvider, final int nChannelConnectTimeoutMillis, @Nonnull final IChannelSftpRunnable aRunnable) throws JSchException { ValueEnforcer.notNull (aSessionProvider...
java
{ "resource": "" }
q15710
GlobalPasswordSettings.setPasswordConstraintList
train
public static void setPasswordConstraintList (@Nonnull final IPasswordConstraintList aPasswordConstraintList) { ValueEnforcer.notNull (aPasswordConstraintList, "PasswordConstraintList"); // Create a copy final IPasswordConstraintList aRealPasswordConstraints = aPasswordConstraintList.getClone (); s_a...
java
{ "resource": "" }
q15711
EkstaziCFT.createCoverageClassVisitor
train
private CoverageClassVisitor createCoverageClassVisitor(String className, ClassWriter cv, boolean isRedefined) { // We cannot change classfiles if class is being redefined. return new CoverageClassVisitor(className, cv); }
java
{ "resource": "" }
q15712
EkstaziCFT.isMonitorAccessibleFromClassLoader
train
private boolean isMonitorAccessibleFromClassLoader(ClassLoader loader) { if (loader == null) { return false; } boolean isMonitorAccessible = true; InputStream monitorInputStream = null; try { monitorInputStream = loader.getResourceAsStream(COVERAGE_MONITOR...
java
{ "resource": "" }
q15713
EkstaziCFT.saveClassfileBufferForDebugging
train
@SuppressWarnings("unused") private void saveClassfileBufferForDebugging(String className, byte[] classfileBuffer) { try { if (className.contains("CX")) { java.io.DataOutputStream tmpout = new java.io.DataOutputStream(new java.io.FileOutputStream("out")); tmpout.w...
java
{ "resource": "" }
q15714
EkstaziCFT.instrumentClassFile
train
private static byte[] instrumentClassFile(byte[] classfileBuffer) { String className = new ClassReader(classfileBuffer).getClassName().replace("/", "."); ClassLoader currentClassLoader = Thread.currentThread().getContextClassLoader(); byte[] newClassfileBuffer = new EkstaziCFT().transform(curren...
java
{ "resource": "" }
q15715
CollectingJSCodeProvider.addAt
train
@Nonnull public CollectingJSCodeProvider addAt (@Nonnegative final int nIndex, @Nullable final IHasJSCode aProvider) { if (aProvider != null) m_aList.add (nIndex, aProvider); return this; }
java
{ "resource": "" }
q15716
JSFunction.name
train
@Nonnull public JSFunction name (@Nonnull @Nonempty final String sName) { if (!JSMarshaller.isJSIdentifier (sName)) throw new IllegalArgumentException ("The name '" + sName + "' is not a legal JS identifier!"); m_sName = sName; return this; }
java
{ "resource": "" }
q15717
TypeaheadEditSelection.getSelectionForRequiredObject
train
@Nonnull public static TypeaheadEditSelection getSelectionForRequiredObject (@Nonnull final IWebPageExecutionContext aWPEC, @Nullable final String sEditFieldName, @Nullable final...
java
{ "resource": "" }
q15718
BootstrapLoginHTMLProvider.createPageHeader
train
@Nullable @OverrideOnDemand protected IHCNode createPageHeader (@Nonnull final ISimpleWebExecutionContext aSWEC, @Nullable final IHCNode aPageTitle) { return BootstrapPageHeader.createOnDemand (aPageTitle); }
java
{ "resource": "" }
q15719
HCGoogleAnalytics.createEventTrackingCode
train
@Nonnull public static JSInvocation createEventTrackingCode (@Nonnull final String sCategory, @Nonnull final String sAction, @Nullable final String sLabel, ...
java
{ "resource": "" }
q15720
SemanticTypes.sanitiseSemanticTypes
train
public static Collection<String> sanitiseSemanticTypes(final Collection<String> semanticTypes) { if (semanticTypes == null) return ImmutableList.of(); // check that each of the given types are in the map we have, otherwise throw it away final Set<String> s = new LinkedHashSet<>(semanticTypes); ...
java
{ "resource": "" }
q15721
ASTPrinter.printComments
train
public static String printComments(String indent, List<JavaComment> comments) { final StringBuilder builder = new StringBuilder(); for (JavaComment comment : comments) { builder.append(print(indent, comment)); builder.append("\n"); } return builder.toString(); ...
java
{ "resource": "" }
q15722
ASTPrinter.print
train
public static String print(final String indent, JavaComment comment) { return comment.match(new JavaComment.MatchBlock<String>() { @Override public String _case(JavaDocComment x) { final StringBuilder builder = new StringBuilder(indent); builder.append(x....
java
{ "resource": "" }
q15723
ASTPrinter.print
train
public static String print(Arg arg) { return printArgModifiers(arg.modifiers) + print(arg.type) + " " + arg.name; }
java
{ "resource": "" }
q15724
ASTPrinter.printArgModifiers
train
public static String printArgModifiers(List<ArgModifier> modifiers) { final StringBuilder builder = new StringBuilder(); if (modifiers.contains(ArgModifier._Final())) { builder.append(print(ArgModifier._Final())); builder.append(" "); } if (modifiers.contains(ArgM...
java
{ "resource": "" }
q15725
ASTPrinter.print
train
public static String print(Type type) { return type.match(new Type.MatchBlock<String>(){ @Override public String _case(Ref x) { return print(x.type); } @Override public String _case(Primitive x) { return print(x.type); ...
java
{ "resource": "" }
q15726
ASTPrinter.print
train
public static String print(RefType type) { return type.match(new RefType.MatchBlock<String>() { @Override public String _case(ClassType x) { final StringBuilder builder = new StringBuilder(x.baseName); if (!x.typeArguments.isEmpty()) { ...
java
{ "resource": "" }
q15727
ASTPrinter.print
train
public static String print(PrimitiveType type) { return type.match(new PrimitiveType.MatchBlock<String>() { @Override public String _case(BooleanType x) { return "boolean"; } @Override public String _case(ByteType x) { ...
java
{ "resource": "" }
q15728
ASTPrinter.print
train
public static String print(ArgModifier modifier) { return modifier.match(new ArgModifier.MatchBlock<String>() { @Override public String _case(Final x) { return "final"; } @Override public String _case(Volatile x) { ret...
java
{ "resource": "" }
q15729
ASTPrinter.print
train
private static String print(final String indent, JDToken token) { return token.match(new JDToken.MatchBlock<String>() { @Override public String _case(JDAsterisk x) { return "*"; } @Override public String _case(JDEOL x) { ...
java
{ "resource": "" }
q15730
ASTPrinter.print
train
public static String print(final Literal literal) { return literal.match(new Literal.MatchBlock<String>() { @Override public String _case(StringLiteral x) { return x.content; } @Override public String _case(FloatingPointLiteral x) { ...
java
{ "resource": "" }
q15731
ASTPrinter.print
train
public static String print(Expression expression) { return expression.match(new Expression.MatchBlock<String>() { @Override public String _case(LiteralExpression x) { return print(x.literal); } @Override public String _case(VariableEx...
java
{ "resource": "" }
q15732
BootstrapSpacingBuilder.property
train
@Nonnull public BootstrapSpacingBuilder property (@Nonnull final EBootstrapSpacingPropertyType eProperty) { ValueEnforcer.notNull (eProperty, "Property"); m_eProperty = eProperty; return this; }
java
{ "resource": "" }
q15733
BootstrapSpacingBuilder.side
train
@Nonnull public BootstrapSpacingBuilder side (@Nonnull final EBootstrapSpacingSideType eSide) { ValueEnforcer.notNull (eSide, "Side"); m_eSide = eSide; return this; }
java
{ "resource": "" }
q15734
UIStateRegistry.registerState
train
@Nonnull @SuppressFBWarnings ("RCN_REDUNDANT_NULLCHECK_OF_NONNULL_VALUE") public EChange registerState (@Nonnull @Nonempty final String sStateID, @Nonnull final IHasUIState aNewState) { ValueEnforcer.notEmpty (sStateID, "StateID"); ValueEnforcer.notNull (aNewState, "NewState"); final ObjectType aOT =...
java
{ "resource": "" }
q15735
UIStateRegistry.registerState
train
@Nonnull public EChange registerState (@Nonnull final IHCElement <?> aNewElement) { ValueEnforcer.notNull (aNewElement, "NewElement"); if (aNewElement.hasNoID ()) LOGGER.warn ("Registering the state for an object that has no ID - creating a new ID now!"); return registerState (aNewElement.ensureI...
java
{ "resource": "" }
q15736
FineUploader5Chunking.setPartSize
train
@Nonnull public FineUploader5Chunking setPartSize (@Nonnegative final long nPartSize) { ValueEnforcer.isGT0 (nPartSize, "PartSize"); m_nChunkingPartSize = nPartSize; return this; }
java
{ "resource": "" }
q15737
FineUploader5Chunking.setParamNameChunkSize
train
@Nonnull public FineUploader5Chunking setParamNameChunkSize (@Nonnull @Nonempty final String sParamNameChunkSize) { ValueEnforcer.notEmpty (sParamNameChunkSize, "ParamNameChunkSize"); m_sChunkingParamNamesChunkSize = sParamNameChunkSize; return this; }
java
{ "resource": "" }
q15738
FineUploader5Chunking.setParamNamePartByteOffset
train
@Nonnull public FineUploader5Chunking setParamNamePartByteOffset (@Nonnull @Nonempty final String sParamNamePartByteOffset) { ValueEnforcer.notEmpty (sParamNamePartByteOffset, "ParamNamePartByteOffset"); m_sChunkingParamNamesPartByteOffset = sParamNamePartByteOffset; return this; }
java
{ "resource": "" }
q15739
FineUploader5Chunking.setParamNamePartIndex
train
@Nonnull public FineUploader5Chunking setParamNamePartIndex (@Nonnull @Nonempty final String sParamNamePartIndex) { ValueEnforcer.notEmpty (sParamNamePartIndex, "ParamNamePartIndex"); m_sChunkingParamNamesPartIndex = sParamNamePartIndex; return this; }
java
{ "resource": "" }
q15740
FineUploader5Chunking.setParamNameTotalParts
train
@Nonnull public FineUploader5Chunking setParamNameTotalParts (@Nonnull @Nonempty final String sParamNameTotalParts) { ValueEnforcer.notEmpty (sParamNameTotalParts, "ParamNameTotalParts"); m_sChunkingParamNamesTotalParts = sParamNameTotalParts; return this; }
java
{ "resource": "" }
q15741
BytecodeCleaner.removeDebugInfo
train
public static byte[] removeDebugInfo(byte[] bytes) { if (bytes.length >= 4) { // Check magic number. int magic = ((bytes[0] & 0xff) << 24) | ((bytes[1] & 0xff) << 16) | ((bytes[2] & 0xff) << 8) | (bytes[3] & 0xff); if (magic != 0xCAFEBABE) ...
java
{ "resource": "" }
q15742
HCSWFObject.addFlashVar
train
@Nonnull public final HCSWFObject addFlashVar (@Nonnull final String sName, final Object aValue) { if (!JSMarshaller.isJSIdentifier (sName)) throw new IllegalArgumentException ("The name '" + sName + "' is not a legal JS identifier!"); if (m_aFlashVars == null) m_aFlashVars = new CommonsLinkedH...
java
{ "resource": "" }
q15743
HCSWFObject.removeFlashVar
train
@Nonnull public final HCSWFObject removeFlashVar (@Nullable final String sName) { if (m_aFlashVars != null) m_aFlashVars.remove (sName); return this; }
java
{ "resource": "" }
q15744
DynamicEkstazi.initAgentAtRuntimeAndReportSuccess
train
public static Instrumentation initAgentAtRuntimeAndReportSuccess() { try { setSystemClassLoaderClassPath(); } catch (Exception e) { Log.e("Could not set classpath. Tool will be off.", e); return null; } try { return addClassfileTransformer(...
java
{ "resource": "" }
q15745
DynamicEkstazi.setSystemClassLoaderClassPath
train
private static void setSystemClassLoaderClassPath() throws Exception { Log.d("Setting classpath"); // We use agent class as we do not extract this class in newly created // jar (otherwise we may end up creating one -magic jar from another); // also it will exist even without JUnit classe...
java
{ "resource": "" }
q15746
DynamicEkstazi.addURL
train
private static void addURL(URL url) throws Exception { URLClassLoader sysloader = (URLClassLoader) ClassLoader.getSystemClassLoader(); Class<?> sysclass = URLClassLoader.class; Method method = sysclass.getDeclaredMethod("addURL", new Class[] { URL.class }); method.setAccessible(true); ...
java
{ "resource": "" }
q15747
CoverageMonitor.t
train
public static void t(Class<?> clz) { // Must be non null and type of interest. if (clz == null || ClassesCache.check(clz) || Types.isIgnorable(clz)) { return; } // Check and assign id to this class (this must be synchronized). try { sLock.lock(); ...
java
{ "resource": "" }
q15748
CoverageMonitor.t
train
public static void t(Class<?> clz, int probeId) { if (clz != null) { int index = probeId & PROBE_SIZE_MASK; if (PROBE_ARRAY[index] != clz) { PROBE_ARRAY[index] = clz; t(clz); } } }
java
{ "resource": "" }
q15749
CoverageMonitor.addFileURL
train
public static void addFileURL(File f) { String absolutePath = f.getAbsolutePath(); if (!filterFile(absolutePath)) { try { recordURL(f.toURI().toURL().toExternalForm()); } catch (MalformedURLException e) { // Never expected. } } ...
java
{ "resource": "" }
q15750
CoverageMonitor.recordURL
train
protected static void recordURL(String externalForm) { if (filterURL(externalForm)) { return; } if (isWellKnownUrl(externalForm)) { // Ignore JUnit classes if specified in configuration. if (Config.DEPENDENCIES_INCLUDE_WELLKNOWN_V) { safeRecor...
java
{ "resource": "" }
q15751
CoverageMonitor.safeRecordURL
train
private static void safeRecordURL(String externalForm) { try { sLock.lock(); sURLs.add(externalForm); } finally { sLock.unlock(); } }
java
{ "resource": "" }
q15752
Log.c
train
public static final void c(String msg) { if (msg.replaceAll("\\s+", "").equals("")) { println(CONF_TEXT); } else { println(CONF_TEXT + ": " + msg); } }
java
{ "resource": "" }
q15753
PathDescriptor.matchesParts
train
@Nonnull public PathMatchingResult matchesParts (@Nonnull final List <String> aPathParts) { ValueEnforcer.notNull (aPathParts, "PathParts"); final int nPartCount = m_aPathParts.size (); if (aPathParts.size () != nPartCount) { // Size must match return PathMatchingResult.NO_MATCH; } ...
java
{ "resource": "" }
q15754
FineUploader5Retry.setAutoAttemptDelay
train
@Nonnull public FineUploader5Retry setAutoAttemptDelay (@Nonnegative final int nAutoAttemptDelay) { ValueEnforcer.isGE0 (nAutoAttemptDelay, "AutoAttemptDelay"); m_nRetryAutoAttemptDelay = nAutoAttemptDelay; return this; }
java
{ "resource": "" }
q15755
FineUploader5Retry.setMaxAutoAttempts
train
@Nonnull public FineUploader5Retry setMaxAutoAttempts (@Nonnegative final int nMaxAutoAttempts) { ValueEnforcer.isGE0 (nMaxAutoAttempts, "MaxAutoAttempts"); m_nRetryMaxAutoAttempts = nMaxAutoAttempts; return this; }
java
{ "resource": "" }
q15756
FineUploader5Retry.setPreventRetryResponseProperty
train
@Nonnull public FineUploader5Retry setPreventRetryResponseProperty (@Nonnull @Nonempty final String sPreventRetryResponseProperty) { ValueEnforcer.notEmpty (sPreventRetryResponseProperty, "PreventRetryResponseProperty"); m_sRetryPreventRetryResponseProperty = sPreventRetryResponseProperty; return this; ...
java
{ "resource": "" }
q15757
RevocationStatus.markRevoked
train
public void markRevoked (@Nonnull @Nonempty final String sRevocationUserID, @Nonnull final LocalDateTime aRevocationDT, @Nonnull @Nonempty final String sRevocationReason) { ValueEnforcer.notEmpty (sRevocationUserID, "RevocationUserID"); ValueEnforcer.notNu...
java
{ "resource": "" }
q15758
SnomedCoderService.doc
train
@GET @Produces(MediaType.TEXT_PLAIN) public InputStream doc() throws IOException { //noinspection ConstantConditions return getClass().getClassLoader().getResource("SnomedCoderService_help.txt").openStream(); }
java
{ "resource": "" }
q15759
SnomedCoderService.mapTextWithOptions
train
@POST @Consumes(MediaType.APPLICATION_JSON) @Produces({MediaType.APPLICATION_JSON, MediaType.TEXT_XML}) public static Collection<Utterance> mapTextWithOptions(final AnalysisRequest r) throws IOException, InterruptedException, JAXBException, SQLException, ParserConfigurationException, ...
java
{ "resource": "" }
q15760
SnomedCoderService.destructiveFilter
train
private static Collection<Utterance> destructiveFilter(final MMOs root) { final Collection<Utterance> utterances = new ArrayList<>(); for (final MMO mmo : root.getMMO()) { for (final Utterance utterance : mmo.getUtterances().getUtterance()) { // clear candidates to save heap...
java
{ "resource": "" }
q15761
AbstractObjectDeliveryHttpHandler._initialFillSet
train
private static void _initialFillSet (@Nonnull final ICommonsOrderedSet <String> aSet, @Nullable final String sItemList, final boolean bUnify) { ValueEnforcer.notNull (aSet, "Set"); if (!aSet.isEmpty ()) throw new IllegalArgume...
java
{ "resource": "" }
q15762
TextStripper.extractText
train
public List<Page> extractText(InputStream src) throws IOException { List<Page> pages = Lists.newArrayList(); PdfReader reader = new PdfReader(src); RenderListener listener = new InternalListener(); PdfContentStreamProcessor processor = new PdfContentStreamProcessor(listener); f...
java
{ "resource": "" }
q15763
CrtAuthClient.createResponse
train
public String createResponse(String challenge) throws IllegalArgumentException, KeyNotFoundException, ProtocolVersionException { byte[] decodedChallenge = decode(challenge); Challenge deserializedChallenge = CrtAuthCodec.deserializeChallenge(decodedChallenge); if (!deserializedChallenge.getServerName(...
java
{ "resource": "" }
q15764
EkstaziAgent.initSingleCoverageMode
train
private static boolean initSingleCoverageMode(final String runName, Instrumentation instrumentation) { // Check if run is affected and if not start coverage. if (Ekstazi.inst().checkIfAffected(runName)) { Ekstazi.inst().startCollectingDependencies(runName); // End coverage when V...
java
{ "resource": "" }
q15765
AbstractHTMLProvider.addMetaElements
train
@OverrideOnDemand protected void addMetaElements (@Nonnull final IRequestWebScopeWithoutResponse aRequestScope, @Nonnull final HCHead aHead) { final ICommonsList <IMetaElement> aMetaElements = new CommonsArrayList <> (); { // add special meta element at the beginning ...
java
{ "resource": "" }
q15766
FineUploader5Core.setMaxConnections
train
@Nonnull public FineUploader5Core setMaxConnections (@Nonnegative final int nMaxConnections) { ValueEnforcer.isGT0 (nMaxConnections, "MaxConnections"); m_nCoreMaxConnections = nMaxConnections; return this; }
java
{ "resource": "" }
q15767
JSFormatter.outdentAlways
train
@Nonnull public JSFormatter outdentAlways () { if (m_nIndentLevel == 0) throw new IllegalStateException ("Nothing left to outdent!"); m_nIndentLevel--; m_sIndentCache = m_sIndentCache.substring (0, m_nIndentLevel * m_aSettings.getIndent ().length ()); return this; }
java
{ "resource": "" }
q15768
JSDefinedClass._extends
train
@Nonnull @CodingStyleguideUnaware public JSDefinedClass _extends (@Nonnull final AbstractJSClass aSuperClass) { m_aSuperClass = ValueEnforcer.notNull (aSuperClass, "SuperClass"); return this; }
java
{ "resource": "" }
q15769
JSDefinedClass.method
train
@Nonnull public JSMethod method (@Nonnull @Nonempty final String sName) { final JSMethod aMethod = new JSMethod (this, sName); m_aMethods.add (aMethod); return aMethod; }
java
{ "resource": "" }
q15770
BootstrapModal.openModal
train
@Nonnull public JSPackage openModal (@Nullable final EBootstrapModalOptionBackdrop aBackdrop, @Nullable final Boolean aKeyboard, @Nullable final Boolean aFocus, @Nullable final Boolean aShow, @Nulla...
java
{ "resource": "" }
q15771
AbstractWebPageSecurityObjectWithAttributes.onShowSelectedObjectCustomAttrs
train
@Nullable @OverrideOnDemand protected ICommonsSet <String> onShowSelectedObjectCustomAttrs (@Nonnull final WPECTYPE aWPEC, @Nonnull final DATATYPE aSelectedObject, @Nonnull final Map <...
java
{ "resource": "" }
q15772
AbstractWebPageSecurityObjectWithAttributes.validateCustomInputParameters
train
@OverrideOnDemand @Nullable protected ICommonsMap <String, String> validateCustomInputParameters (@Nonnull final WPECTYPE aWPEC, @Nullable final DATATYPE aSelectedObject, @...
java
{ "resource": "" }
q15773
UserUploadManager.addUploadedFile
train
public void addUploadedFile (@Nonnull @Nonempty final String sFieldName, @Nonnull final TemporaryUserDataObject aUDO) { ValueEnforcer.notEmpty (sFieldName, "FieldName"); ValueEnforcer.notNull (aUDO, "UDO"); m_aRWLock.writeLocked ( () -> { // Remove an eventually existing old UDO with the same filen...
java
{ "resource": "" }
q15774
UserUploadManager.confirmUploadedFiles
train
@Nonnull @ReturnsMutableCopy public ICommonsOrderedMap <String, UserDataObject> confirmUploadedFiles (@Nullable final String... aFieldNames) { final ICommonsOrderedMap <String, UserDataObject> ret = new CommonsLinkedHashMap <> (); if (aFieldNames != null) { m_aRWLock.writeLocked ( () -> { ...
java
{ "resource": "" }
q15775
UserUploadManager.confirmUploadedFile
train
@Nullable public UserDataObject confirmUploadedFile (@Nullable final String sFieldName) { return m_aRWLock.writeLocked ( () -> { if (StringHelper.hasText (sFieldName)) { // Remove an eventually existing old UDO final TemporaryUserDataObject aUDO = m_aMap.remove (sFieldName); ...
java
{ "resource": "" }
q15776
UserUploadManager.cancelUploadedFiles
train
@Nonnull @ReturnsMutableCopy public ICommonsList <String> cancelUploadedFiles (@Nullable final String... aFieldNames) { final ICommonsList <String> ret = new CommonsArrayList <> (); if (ArrayHelper.isNotEmpty (aFieldNames)) { m_aRWLock.writeLocked ( () -> { for (final String sFieldName :...
java
{ "resource": "" }
q15777
UserUploadManager.getUploadedFile
train
@Nullable public TemporaryUserDataObject getUploadedFile (@Nullable final String sFieldName) { if (StringHelper.hasNoText (sFieldName)) return null; return m_aRWLock.readLocked ( () -> m_aMap.get (sFieldName)); }
java
{ "resource": "" }
q15778
DefaultBootstrapFormGroupRenderer.modifyFirstControlIfLabelIsPresent
train
@OverrideOnDemand protected void modifyFirstControlIfLabelIsPresent (@Nonnull final IHCElementWithChildren <?> aLabel, @Nonnull final IHCControl <?> aFirstControl) { // Set the default placeholder (if none is present) if (aFirstControl instanceof IHCInput...
java
{ "resource": "" }
q15779
HCChart.getJSUpdateCode
train
@Nonnull public IHasJSCode getJSUpdateCode (@Nonnull final IJSExpression aJSDataVar) { final JSPackage ret = new JSPackage (); // Cleanup old chart ret.invoke (JSExpr.ref (getJSChartVar ()), "destroy"); // Use new chart ret.assign (JSExpr.ref (getJSChartVar ()), new JSDefinedClass ("Chart")._new...
java
{ "resource": "" }
q15780
PhotonJS.unregisterJSIncludeFromThisRequest
train
public static void unregisterJSIncludeFromThisRequest (@Nonnull final IJSPathProvider aJSPathProvider) { final JSResourceSet aSet = _getPerRequestSet (false); if (aSet != null) aSet.removeItem (aJSPathProvider); }
java
{ "resource": "" }
q15781
FileUtil.readFile
train
public static byte[] readFile(File file) throws IOException { // Open file RandomAccessFile f = new RandomAccessFile(file, "r"); try { // Get and check length long longlength = f.length(); int length = (int) longlength; if (length != longlength) { ...
java
{ "resource": "" }
q15782
FileUtil.writeFile
train
public static void writeFile(File file, byte[] bytes) throws IOException { FileOutputStream fos = null; try { fos = new FileOutputStream(file); fos.write(bytes); } finally { if (fos != null) { fos.close(); } } }
java
{ "resource": "" }
q15783
FileUtil.isSecondNewerThanFirst
train
public static boolean isSecondNewerThanFirst(File first, File second) { boolean isSecondNewerThanFirst = false; // If file does not exist, it cannot be newer. if (second.exists()) { long firstLastModified = first.lastModified(); long secondLastModified = second.lastModifi...
java
{ "resource": "" }
q15784
FileUtil.loadBytes
train
public static byte[] loadBytes(URL url) { byte[] bytes = null; try { bytes = loadBytes(url.openStream()); } catch (IOException ex) { // ex.printStackTrace(); } return bytes; }
java
{ "resource": "" }
q15785
WebSiteResourceBundleManager.getResourceBundleOfID
train
@Nullable public WebSiteResourceBundleSerialized getResourceBundleOfID (@Nullable final String sBundleID) { if (StringHelper.hasNoText (sBundleID)) return null; return m_aRWLock.readLocked ( () -> m_aMapToBundle.get (sBundleID)); }
java
{ "resource": "" }
q15786
WebSiteResourceBundleManager.containsResourceBundleOfID
train
public boolean containsResourceBundleOfID (@Nullable final String sBundleID) { if (StringHelper.hasNoText (sBundleID)) return false; return m_aRWLock.readLocked ( () -> m_aMapToBundle.containsKey (sBundleID)); }
java
{ "resource": "" }
q15787
AbstractMojoInterceptor.throwMojoExecutionException
train
protected static void throwMojoExecutionException(Object mojo, String message, Exception cause) throws Exception { Class<?> clz = mojo.getClass().getClassLoader().loadClass(MavenNames.MOJO_EXECUTION_EXCEPTION_BIN); Constructor<?> con = clz.getConstructor(String.class, Exception.class); Exception...
java
{ "resource": "" }
q15788
AbstractMojoInterceptor.invokeAndGetString
train
protected static String invokeAndGetString(String methodName, Object mojo) throws Exception { return (String) invokeGetMethod(methodName, mojo); }
java
{ "resource": "" }
q15789
AbstractMojoInterceptor.invokeAndGetBoolean
train
protected static boolean invokeAndGetBoolean(String methodName, Object mojo) throws Exception { return (Boolean) invokeGetMethod(methodName, mojo); }
java
{ "resource": "" }
q15790
AbstractMojoInterceptor.invokeAndGetList
train
@SuppressWarnings("unchecked") protected static List<String> invokeAndGetList(String methodName, Object mojo) throws Exception { return (List<String>) invokeGetMethod(methodName, mojo); }
java
{ "resource": "" }
q15791
AbstractMojoInterceptor.setField
train
protected static void setField(String fieldName, Object mojo, Object value) throws Exception { Field field = null; try { field = mojo.getClass().getDeclaredField(fieldName); } catch (NoSuchFieldException ex) { // Ignore exception and try superclass. field = mo...
java
{ "resource": "" }
q15792
AbstractMojoInterceptor.getField
train
protected static Object getField(String fieldName, Object mojo) throws Exception { Field field = null; try { field = mojo.getClass().getDeclaredField(fieldName); } catch (NoSuchFieldException ex) { // Ignore exception and try superclass. field = mojo.getClass(...
java
{ "resource": "" }
q15793
AgentLoader.loadAgent
train
public static boolean loadAgent(URL agentJarURL) throws Exception { File toolsJarFile = findToolsJar(); Class<?> vmClass = null; if (toolsJarFile == null || !toolsJarFile.exists()) { // likely Java 9+ (when tools.jar is not available). Java // 9 also requires that ...
java
{ "resource": "" }
q15794
AgentLoader.attachAgent
train
private static void attachAgent(Class<?> vmClass, URL agentJarURL) throws Exception { String pid = getPID(); String agentAbsolutePath = new File(agentJarURL.toURI().getSchemeSpecificPart()).getAbsolutePath(); Object vm = getAttachMethod(vmClass).invoke(null, new Object[] { pid }); getLo...
java
{ "resource": "" }
q15795
AgentLoader.getAttachMethod
train
private static Method getAttachMethod(Class<?> vmClass) throws SecurityException, NoSuchMethodException { return vmClass.getMethod("attach", new Class<?>[] { String.class }); }
java
{ "resource": "" }
q15796
AgentLoader.getLoadAgentMethod
train
private static Method getLoadAgentMethod(Class<?> vmClass) throws SecurityException, NoSuchMethodException { return vmClass.getMethod("loadAgent", new Class[] { String.class }); }
java
{ "resource": "" }
q15797
AgentLoader.getPID
train
private static String getPID() { String vmName = ManagementFactory.getRuntimeMXBean().getName(); return vmName.substring(0, vmName.indexOf("@")); }
java
{ "resource": "" }
q15798
AgentLoader.findToolsJar
train
private static File findToolsJar() { String javaHome = System.getProperty("java.home"); File javaHomeFile = new File(javaHome); File toolsJarFile = new File(javaHomeFile, "lib" + File.separator + TOOLS_JAR_NAME); if (!toolsJarFile.exists()) { toolsJarFile = new File(System.g...
java
{ "resource": "" }
q15799
JavaDocParserImpl.lookahead
train
public Token lookahead() { Token current = token; if (current.next == null) { current.next = token_source.getNextToken(); } return current.next; }
java
{ "resource": "" }