repo stringlengths 7 58 | path stringlengths 12 218 | func_name stringlengths 3 140 | original_string stringlengths 73 34.1k | language stringclasses 1
value | code stringlengths 73 34.1k | code_tokens list | docstring stringlengths 3 16k | docstring_tokens list | sha stringlengths 40 40 | url stringlengths 105 339 | partition stringclasses 1
value |
|---|---|---|---|---|---|---|---|---|---|---|---|
JetBrains/xodus | entity-store/src/main/java/jetbrains/exodus/entitystore/PersistentEntityStoreImpl.java | PersistentEntityStoreImpl.getEntityTypeId | @Deprecated
public int getEntityTypeId(@NotNull final String entityType, final boolean allowCreate) {
return getEntityTypeId(txnProvider, entityType, allowCreate);
} | java | @Deprecated
public int getEntityTypeId(@NotNull final String entityType, final boolean allowCreate) {
return getEntityTypeId(txnProvider, entityType, allowCreate);
} | [
"@",
"Deprecated",
"public",
"int",
"getEntityTypeId",
"(",
"@",
"NotNull",
"final",
"String",
"entityType",
",",
"final",
"boolean",
"allowCreate",
")",
"{",
"return",
"getEntityTypeId",
"(",
"txnProvider",
",",
"entityType",
",",
"allowCreate",
")",
";",
"}"
] | Gets or creates id of the entity type.
@param entityType entity type name.
@param allowCreate if set to true and if there is no entity type like entityType,
create the new id for the entityType.
@return entity type id. | [
"Gets",
"or",
"creates",
"id",
"of",
"the",
"entity",
"type",
"."
] | 7b3476c4e81db66f9c7529148c761605cc8eea6d | https://github.com/JetBrains/xodus/blob/7b3476c4e81db66f9c7529148c761605cc8eea6d/entity-store/src/main/java/jetbrains/exodus/entitystore/PersistentEntityStoreImpl.java#L1587-L1590 | train |
JetBrains/xodus | entity-store/src/main/java/jetbrains/exodus/entitystore/PersistentEntityStoreImpl.java | PersistentEntityStoreImpl.getPropertyId | public int getPropertyId(@NotNull final PersistentStoreTransaction txn, @NotNull final String propertyName, final boolean allowCreate) {
return allowCreate ? propertyIds.getOrAllocateId(txn, propertyName) : propertyIds.getId(txn, propertyName);
} | java | public int getPropertyId(@NotNull final PersistentStoreTransaction txn, @NotNull final String propertyName, final boolean allowCreate) {
return allowCreate ? propertyIds.getOrAllocateId(txn, propertyName) : propertyIds.getId(txn, propertyName);
} | [
"public",
"int",
"getPropertyId",
"(",
"@",
"NotNull",
"final",
"PersistentStoreTransaction",
"txn",
",",
"@",
"NotNull",
"final",
"String",
"propertyName",
",",
"final",
"boolean",
"allowCreate",
")",
"{",
"return",
"allowCreate",
"?",
"propertyIds",
".",
"getOrA... | Gets id of a property and creates the new one if necessary.
@param txn transaction
@param propertyName name of the property.
@param allowCreate if set to true and if there is no property named as propertyName,
create the new id for the propertyName.
@return < 0 if there is no such property and create=false, ... | [
"Gets",
"id",
"of",
"a",
"property",
"and",
"creates",
"the",
"new",
"one",
"if",
"necessary",
"."
] | 7b3476c4e81db66f9c7529148c761605cc8eea6d | https://github.com/JetBrains/xodus/blob/7b3476c4e81db66f9c7529148c761605cc8eea6d/entity-store/src/main/java/jetbrains/exodus/entitystore/PersistentEntityStoreImpl.java#L1725-L1727 | train |
JetBrains/xodus | entity-store/src/main/java/jetbrains/exodus/entitystore/PersistentEntityStoreImpl.java | PersistentEntityStoreImpl.getLinkId | public int getLinkId(@NotNull final PersistentStoreTransaction txn, @NotNull final String linkName, final boolean allowCreate) {
return allowCreate ? linkIds.getOrAllocateId(txn, linkName) : linkIds.getId(txn, linkName);
} | java | public int getLinkId(@NotNull final PersistentStoreTransaction txn, @NotNull final String linkName, final boolean allowCreate) {
return allowCreate ? linkIds.getOrAllocateId(txn, linkName) : linkIds.getId(txn, linkName);
} | [
"public",
"int",
"getLinkId",
"(",
"@",
"NotNull",
"final",
"PersistentStoreTransaction",
"txn",
",",
"@",
"NotNull",
"final",
"String",
"linkName",
",",
"final",
"boolean",
"allowCreate",
")",
"{",
"return",
"allowCreate",
"?",
"linkIds",
".",
"getOrAllocateId",
... | Gets id of a link and creates the new one if necessary.
@param linkName name of the link.
@param allowCreate if set to true and if there is no link named as linkName,
create the new id for the linkName.
@return < 0 if there is no such link and create=false, else id of the link | [
"Gets",
"id",
"of",
"a",
"link",
"and",
"creates",
"the",
"new",
"one",
"if",
"necessary",
"."
] | 7b3476c4e81db66f9c7529148c761605cc8eea6d | https://github.com/JetBrains/xodus/blob/7b3476c4e81db66f9c7529148c761605cc8eea6d/entity-store/src/main/java/jetbrains/exodus/entitystore/PersistentEntityStoreImpl.java#L1751-L1753 | train |
JetBrains/xodus | utils/src/main/java/jetbrains/exodus/core/execution/ThreadJobProcessor.java | ThreadJobProcessor.start | @Override
public synchronized void start() {
if (!started.getAndSet(true)) {
finished.set(false);
thread.start();
}
} | java | @Override
public synchronized void start() {
if (!started.getAndSet(true)) {
finished.set(false);
thread.start();
}
} | [
"@",
"Override",
"public",
"synchronized",
"void",
"start",
"(",
")",
"{",
"if",
"(",
"!",
"started",
".",
"getAndSet",
"(",
"true",
")",
")",
"{",
"finished",
".",
"set",
"(",
"false",
")",
";",
"thread",
".",
"start",
"(",
")",
";",
"}",
"}"
] | Starts processor thread. | [
"Starts",
"processor",
"thread",
"."
] | 7b3476c4e81db66f9c7529148c761605cc8eea6d | https://github.com/JetBrains/xodus/blob/7b3476c4e81db66f9c7529148c761605cc8eea6d/utils/src/main/java/jetbrains/exodus/core/execution/ThreadJobProcessor.java#L53-L59 | train |
JetBrains/xodus | utils/src/main/java/jetbrains/exodus/core/execution/ThreadJobProcessor.java | ThreadJobProcessor.finish | @Override
public void finish() {
if (started.get() && !finished.getAndSet(true)) {
waitUntilFinished();
super.finish();
// recreate thread (don't start) for processor reuse
createProcessorThread();
clearQueues();
started.set(false);
... | java | @Override
public void finish() {
if (started.get() && !finished.getAndSet(true)) {
waitUntilFinished();
super.finish();
// recreate thread (don't start) for processor reuse
createProcessorThread();
clearQueues();
started.set(false);
... | [
"@",
"Override",
"public",
"void",
"finish",
"(",
")",
"{",
"if",
"(",
"started",
".",
"get",
"(",
")",
"&&",
"!",
"finished",
".",
"getAndSet",
"(",
"true",
")",
")",
"{",
"waitUntilFinished",
"(",
")",
";",
"super",
".",
"finish",
"(",
")",
";",
... | Signals that the processor to finish and waits until it finishes. | [
"Signals",
"that",
"the",
"processor",
"to",
"finish",
"and",
"waits",
"until",
"it",
"finishes",
"."
] | 7b3476c4e81db66f9c7529148c761605cc8eea6d | https://github.com/JetBrains/xodus/blob/7b3476c4e81db66f9c7529148c761605cc8eea6d/utils/src/main/java/jetbrains/exodus/core/execution/ThreadJobProcessor.java#L64-L74 | train |
JetBrains/xodus | environment/src/main/java/jetbrains/exodus/env/ReentrantTransactionDispatcher.java | ReentrantTransactionDispatcher.acquireTransaction | int acquireTransaction(@NotNull final Thread thread) {
try (CriticalSection ignored = criticalSection.enter()) {
final int currentThreadPermits = getThreadPermitsToAcquire(thread);
waitForPermits(thread, currentThreadPermits > 0 ? nestedQueue : regularQueue, 1, currentThreadPermits);
... | java | int acquireTransaction(@NotNull final Thread thread) {
try (CriticalSection ignored = criticalSection.enter()) {
final int currentThreadPermits = getThreadPermitsToAcquire(thread);
waitForPermits(thread, currentThreadPermits > 0 ? nestedQueue : regularQueue, 1, currentThreadPermits);
... | [
"int",
"acquireTransaction",
"(",
"@",
"NotNull",
"final",
"Thread",
"thread",
")",
"{",
"try",
"(",
"CriticalSection",
"ignored",
"=",
"criticalSection",
".",
"enter",
"(",
")",
")",
"{",
"final",
"int",
"currentThreadPermits",
"=",
"getThreadPermitsToAcquire",
... | Acquire transaction with a single permit in a thread. Transactions are acquired reentrantly, i.e.
with respect to transactions already acquired in the thread.
@return the number of acquired permits, identically equal to 1. | [
"Acquire",
"transaction",
"with",
"a",
"single",
"permit",
"in",
"a",
"thread",
".",
"Transactions",
"are",
"acquired",
"reentrantly",
"i",
".",
"e",
".",
"with",
"respect",
"to",
"transactions",
"already",
"acquired",
"in",
"the",
"thread",
"."
] | 7b3476c4e81db66f9c7529148c761605cc8eea6d | https://github.com/JetBrains/xodus/blob/7b3476c4e81db66f9c7529148c761605cc8eea6d/environment/src/main/java/jetbrains/exodus/env/ReentrantTransactionDispatcher.java#L68-L74 | train |
JetBrains/xodus | environment/src/main/java/jetbrains/exodus/env/ReentrantTransactionDispatcher.java | ReentrantTransactionDispatcher.releaseTransaction | void releaseTransaction(@NotNull final Thread thread, final int permits) {
try (CriticalSection ignored = criticalSection.enter()) {
int currentThreadPermits = getThreadPermits(thread);
if (permits > currentThreadPermits) {
throw new ExodusException("Can't release more pe... | java | void releaseTransaction(@NotNull final Thread thread, final int permits) {
try (CriticalSection ignored = criticalSection.enter()) {
int currentThreadPermits = getThreadPermits(thread);
if (permits > currentThreadPermits) {
throw new ExodusException("Can't release more pe... | [
"void",
"releaseTransaction",
"(",
"@",
"NotNull",
"final",
"Thread",
"thread",
",",
"final",
"int",
"permits",
")",
"{",
"try",
"(",
"CriticalSection",
"ignored",
"=",
"criticalSection",
".",
"enter",
"(",
")",
")",
"{",
"int",
"currentThreadPermits",
"=",
... | Release transaction that was acquired in a thread with specified permits. | [
"Release",
"transaction",
"that",
"was",
"acquired",
"in",
"a",
"thread",
"with",
"specified",
"permits",
"."
] | 7b3476c4e81db66f9c7529148c761605cc8eea6d | https://github.com/JetBrains/xodus/blob/7b3476c4e81db66f9c7529148c761605cc8eea6d/environment/src/main/java/jetbrains/exodus/env/ReentrantTransactionDispatcher.java#L121-L136 | train |
JetBrains/xodus | environment/src/main/java/jetbrains/exodus/env/ReentrantTransactionDispatcher.java | ReentrantTransactionDispatcher.tryAcquireExclusiveTransaction | private int tryAcquireExclusiveTransaction(@NotNull final Thread thread, final int timeout) {
long nanos = TimeUnit.MILLISECONDS.toNanos(timeout);
try (CriticalSection ignored = criticalSection.enter()) {
if (getThreadPermits(thread) > 0) {
throw new ExodusException("Exclusiv... | java | private int tryAcquireExclusiveTransaction(@NotNull final Thread thread, final int timeout) {
long nanos = TimeUnit.MILLISECONDS.toNanos(timeout);
try (CriticalSection ignored = criticalSection.enter()) {
if (getThreadPermits(thread) > 0) {
throw new ExodusException("Exclusiv... | [
"private",
"int",
"tryAcquireExclusiveTransaction",
"(",
"@",
"NotNull",
"final",
"Thread",
"thread",
",",
"final",
"int",
"timeout",
")",
"{",
"long",
"nanos",
"=",
"TimeUnit",
".",
"MILLISECONDS",
".",
"toNanos",
"(",
"timeout",
")",
";",
"try",
"(",
"Crit... | Wait for exclusive permit during a timeout in milliseconds.
@return number of acquired permits if > 0 | [
"Wait",
"for",
"exclusive",
"permit",
"during",
"a",
"timeout",
"in",
"milliseconds",
"."
] | 7b3476c4e81db66f9c7529148c761605cc8eea6d | https://github.com/JetBrains/xodus/blob/7b3476c4e81db66f9c7529148c761605cc8eea6d/environment/src/main/java/jetbrains/exodus/env/ReentrantTransactionDispatcher.java#L193-L223 | train |
JetBrains/xodus | utils/src/main/java/jetbrains/exodus/core/execution/JobProcessorQueueAdapter.java | JobProcessorQueueAdapter.waitForJobs | protected boolean waitForJobs() throws InterruptedException {
final Pair<Long, Job> peekPair;
try (Guard ignored = timeQueue.lock()) {
peekPair = timeQueue.peekPair();
}
if (peekPair == null) {
awake.acquire();
return true;
}
final long... | java | protected boolean waitForJobs() throws InterruptedException {
final Pair<Long, Job> peekPair;
try (Guard ignored = timeQueue.lock()) {
peekPair = timeQueue.peekPair();
}
if (peekPair == null) {
awake.acquire();
return true;
}
final long... | [
"protected",
"boolean",
"waitForJobs",
"(",
")",
"throws",
"InterruptedException",
"{",
"final",
"Pair",
"<",
"Long",
",",
"Job",
">",
"peekPair",
";",
"try",
"(",
"Guard",
"ignored",
"=",
"timeQueue",
".",
"lock",
"(",
")",
")",
"{",
"peekPair",
"=",
"t... | returns true if a job was queued within a timeout | [
"returns",
"true",
"if",
"a",
"job",
"was",
"queued",
"within",
"a",
"timeout"
] | 7b3476c4e81db66f9c7529148c761605cc8eea6d | https://github.com/JetBrains/xodus/blob/7b3476c4e81db66f9c7529148c761605cc8eea6d/utils/src/main/java/jetbrains/exodus/core/execution/JobProcessorQueueAdapter.java#L229-L243 | train |
JetBrains/xodus | entity-store/src/main/java/jetbrains/exodus/entitystore/PersistentStoreTransaction.java | PersistentStoreTransaction.apply | void apply() {
final FlushLog log = new FlushLog();
store.logOperations(txn, log);
final BlobVault blobVault = store.getBlobVault();
if (blobVault.requiresTxn()) {
try {
blobVault.flushBlobs(blobStreams, blobFiles, deferredBlobsToDelete, txn);
} ca... | java | void apply() {
final FlushLog log = new FlushLog();
store.logOperations(txn, log);
final BlobVault blobVault = store.getBlobVault();
if (blobVault.requiresTxn()) {
try {
blobVault.flushBlobs(blobStreams, blobFiles, deferredBlobsToDelete, txn);
} ca... | [
"void",
"apply",
"(",
")",
"{",
"final",
"FlushLog",
"log",
"=",
"new",
"FlushLog",
"(",
")",
";",
"store",
".",
"logOperations",
"(",
"txn",
",",
"log",
")",
";",
"final",
"BlobVault",
"blobVault",
"=",
"store",
".",
"getBlobVault",
"(",
")",
";",
"... | exposed only for tests | [
"exposed",
"only",
"for",
"tests"
] | 7b3476c4e81db66f9c7529148c761605cc8eea6d | https://github.com/JetBrains/xodus/blob/7b3476c4e81db66f9c7529148c761605cc8eea6d/entity-store/src/main/java/jetbrains/exodus/entitystore/PersistentStoreTransaction.java#L851-L873 | train |
JetBrains/xodus | entity-store/src/main/java/jetbrains/exodus/entitystore/StoreNamingRules.java | StoreNamingRules.getFQName | @NotNull
private String getFQName(@NotNull final String localName, Object... params) {
final StringBuilder builder = new StringBuilder();
builder.append(storeName);
builder.append('.');
builder.append(localName);
for (final Object param : params) {
builder.append(... | java | @NotNull
private String getFQName(@NotNull final String localName, Object... params) {
final StringBuilder builder = new StringBuilder();
builder.append(storeName);
builder.append('.');
builder.append(localName);
for (final Object param : params) {
builder.append(... | [
"@",
"NotNull",
"private",
"String",
"getFQName",
"(",
"@",
"NotNull",
"final",
"String",
"localName",
",",
"Object",
"...",
"params",
")",
"{",
"final",
"StringBuilder",
"builder",
"=",
"new",
"StringBuilder",
"(",
")",
";",
"builder",
".",
"append",
"(",
... | Gets fully-qualified name of a table or sequence.
@param localName local table name.
@param params params.
@return fully-qualified table name. | [
"Gets",
"fully",
"-",
"qualified",
"name",
"of",
"a",
"table",
"or",
"sequence",
"."
] | 7b3476c4e81db66f9c7529148c761605cc8eea6d | https://github.com/JetBrains/xodus/blob/7b3476c4e81db66f9c7529148c761605cc8eea6d/entity-store/src/main/java/jetbrains/exodus/entitystore/StoreNamingRules.java#L144-L156 | train |
JetBrains/xodus | utils/src/main/java/jetbrains/exodus/util/UTFUtil.java | UTFUtil.writeUTF | public static void writeUTF(@NotNull final OutputStream stream, @NotNull final String str) throws IOException {
try (DataOutputStream dataStream = new DataOutputStream(stream)) {
int len = str.length();
if (len < SINGLE_UTF_CHUNK_SIZE) {
dataStream.writeUTF(str);
... | java | public static void writeUTF(@NotNull final OutputStream stream, @NotNull final String str) throws IOException {
try (DataOutputStream dataStream = new DataOutputStream(stream)) {
int len = str.length();
if (len < SINGLE_UTF_CHUNK_SIZE) {
dataStream.writeUTF(str);
... | [
"public",
"static",
"void",
"writeUTF",
"(",
"@",
"NotNull",
"final",
"OutputStream",
"stream",
",",
"@",
"NotNull",
"final",
"String",
"str",
")",
"throws",
"IOException",
"{",
"try",
"(",
"DataOutputStream",
"dataStream",
"=",
"new",
"DataOutputStream",
"(",
... | Writes long strings to output stream as several chunks.
@param stream stream to write to.
@param str string to be written.
@throws IOException if something went wrong | [
"Writes",
"long",
"strings",
"to",
"output",
"stream",
"as",
"several",
"chunks",
"."
] | 7b3476c4e81db66f9c7529148c761605cc8eea6d | https://github.com/JetBrains/xodus/blob/7b3476c4e81db66f9c7529148c761605cc8eea6d/utils/src/main/java/jetbrains/exodus/util/UTFUtil.java#L39-L57 | train |
JetBrains/xodus | utils/src/main/java/jetbrains/exodus/util/UTFUtil.java | UTFUtil.readUTF | @Nullable
public static String readUTF(@NotNull final InputStream stream) throws IOException {
final DataInputStream dataInput = new DataInputStream(stream);
if (stream instanceof ByteArraySizedInputStream) {
final ByteArraySizedInputStream sizedStream = (ByteArraySizedInputStream) strea... | java | @Nullable
public static String readUTF(@NotNull final InputStream stream) throws IOException {
final DataInputStream dataInput = new DataInputStream(stream);
if (stream instanceof ByteArraySizedInputStream) {
final ByteArraySizedInputStream sizedStream = (ByteArraySizedInputStream) strea... | [
"@",
"Nullable",
"public",
"static",
"String",
"readUTF",
"(",
"@",
"NotNull",
"final",
"InputStream",
"stream",
")",
"throws",
"IOException",
"{",
"final",
"DataInputStream",
"dataInput",
"=",
"new",
"DataInputStream",
"(",
"stream",
")",
";",
"if",
"(",
"str... | Reads a string from input stream saved as a sequence of UTF chunks.
@param stream stream to read from.
@return output string
@throws IOException if something went wrong | [
"Reads",
"a",
"string",
"from",
"input",
"stream",
"saved",
"as",
"a",
"sequence",
"of",
"UTF",
"chunks",
"."
] | 7b3476c4e81db66f9c7529148c761605cc8eea6d | https://github.com/JetBrains/xodus/blob/7b3476c4e81db66f9c7529148c761605cc8eea6d/utils/src/main/java/jetbrains/exodus/util/UTFUtil.java#L66-L119 | train |
JetBrains/xodus | environment/src/main/java/jetbrains/exodus/tree/btree/BasePageMutable.java | BasePageMutable.save | protected long save() {
// save leaf nodes
ReclaimFlag flag = saveChildren();
// save self. complementary to {@link load()}
final byte type = getType();
final BTreeBase tree = getTree();
final int structureId = tree.structureId;
final Log log = tree.log;
i... | java | protected long save() {
// save leaf nodes
ReclaimFlag flag = saveChildren();
// save self. complementary to {@link load()}
final byte type = getType();
final BTreeBase tree = getTree();
final int structureId = tree.structureId;
final Log log = tree.log;
i... | [
"protected",
"long",
"save",
"(",
")",
"{",
"// save leaf nodes",
"ReclaimFlag",
"flag",
"=",
"saveChildren",
"(",
")",
";",
"// save self. complementary to {@link load()}",
"final",
"byte",
"type",
"=",
"getType",
"(",
")",
";",
"final",
"BTreeBase",
"tree",
"=",... | Save page to log
@return address of this page after save | [
"Save",
"page",
"to",
"log"
] | 7b3476c4e81db66f9c7529148c761605cc8eea6d | https://github.com/JetBrains/xodus/blob/7b3476c4e81db66f9c7529148c761605cc8eea6d/environment/src/main/java/jetbrains/exodus/tree/btree/BasePageMutable.java#L113-L143 | train |
JetBrains/xodus | openAPI/src/main/java/jetbrains/exodus/env/EnvironmentConfig.java | EnvironmentConfig.setSetting | @Override
public EnvironmentConfig setSetting(@NotNull final String key, @NotNull final Object value) {
return (EnvironmentConfig) super.setSetting(key, value);
} | java | @Override
public EnvironmentConfig setSetting(@NotNull final String key, @NotNull final Object value) {
return (EnvironmentConfig) super.setSetting(key, value);
} | [
"@",
"Override",
"public",
"EnvironmentConfig",
"setSetting",
"(",
"@",
"NotNull",
"final",
"String",
"key",
",",
"@",
"NotNull",
"final",
"Object",
"value",
")",
"{",
"return",
"(",
"EnvironmentConfig",
")",
"super",
".",
"setSetting",
"(",
"key",
",",
"val... | Sets the value of the setting with the specified key.
@param key name of the setting
@param value the setting value
@return this {@code EnvironmentConfig} instance | [
"Sets",
"the",
"value",
"of",
"the",
"setting",
"with",
"the",
"specified",
"key",
"."
] | 7b3476c4e81db66f9c7529148c761605cc8eea6d | https://github.com/JetBrains/xodus/blob/7b3476c4e81db66f9c7529148c761605cc8eea6d/openAPI/src/main/java/jetbrains/exodus/env/EnvironmentConfig.java#L674-L677 | train |
JetBrains/xodus | openAPI/src/main/java/jetbrains/exodus/entitystore/BlobVault.java | BlobVault.getStringContent | @Nullable
public final String getStringContent(final long blobHandle, @NotNull final Transaction txn) throws IOException {
String result;
result = stringContentCache.tryKey(this, blobHandle);
if (result == null) {
final InputStream content = getContent(blobHandle, txn);
... | java | @Nullable
public final String getStringContent(final long blobHandle, @NotNull final Transaction txn) throws IOException {
String result;
result = stringContentCache.tryKey(this, blobHandle);
if (result == null) {
final InputStream content = getContent(blobHandle, txn);
... | [
"@",
"Nullable",
"public",
"final",
"String",
"getStringContent",
"(",
"final",
"long",
"blobHandle",
",",
"@",
"NotNull",
"final",
"Transaction",
"txn",
")",
"throws",
"IOException",
"{",
"String",
"result",
";",
"result",
"=",
"stringContentCache",
".",
"tryKe... | Returns string content of blob identified by specified blob handle. String contents cache is used.
@param blobHandle blob handle
@param txn {@linkplain Transaction} instance
@return string content of blob identified by specified blob handle
@throws IOException if something went wrong | [
"Returns",
"string",
"content",
"of",
"blob",
"identified",
"by",
"specified",
"blob",
"handle",
".",
"String",
"contents",
"cache",
"is",
"used",
"."
] | 7b3476c4e81db66f9c7529148c761605cc8eea6d | https://github.com/JetBrains/xodus/blob/7b3476c4e81db66f9c7529148c761605cc8eea6d/openAPI/src/main/java/jetbrains/exodus/entitystore/BlobVault.java#L199-L216 | train |
JetBrains/xodus | utils/src/main/java/jetbrains/exodus/core/execution/JobProcessorAdapter.java | JobProcessorAdapter.queueIn | @Override
public final Job queueIn(final Job job, final long millis) {
return pushAt(job, System.currentTimeMillis() + millis);
} | java | @Override
public final Job queueIn(final Job job, final long millis) {
return pushAt(job, System.currentTimeMillis() + millis);
} | [
"@",
"Override",
"public",
"final",
"Job",
"queueIn",
"(",
"final",
"Job",
"job",
",",
"final",
"long",
"millis",
")",
"{",
"return",
"pushAt",
"(",
"job",
",",
"System",
".",
"currentTimeMillis",
"(",
")",
"+",
"millis",
")",
";",
"}"
] | Queues a job for execution in specified time.
@param job the job.
@param millis execute the job in this time. | [
"Queues",
"a",
"job",
"for",
"execution",
"in",
"specified",
"time",
"."
] | 7b3476c4e81db66f9c7529148c761605cc8eea6d | https://github.com/JetBrains/xodus/blob/7b3476c4e81db66f9c7529148c761605cc8eea6d/utils/src/main/java/jetbrains/exodus/core/execution/JobProcessorAdapter.java#L116-L119 | train |
JetBrains/xodus | entity-store/src/main/java/jetbrains/exodus/entitystore/tables/BlobsTable.java | BlobsTable.put | public void put(@NotNull final Transaction txn, final long localId,
final int blobId, @NotNull final ByteIterable value) {
primaryStore.put(txn, PropertyKey.propertyKeyToEntry(new PropertyKey(localId, blobId)), value);
allBlobsIndex.put(txn, IntegerBinding.intToCompressedEntry(blobId... | java | public void put(@NotNull final Transaction txn, final long localId,
final int blobId, @NotNull final ByteIterable value) {
primaryStore.put(txn, PropertyKey.propertyKeyToEntry(new PropertyKey(localId, blobId)), value);
allBlobsIndex.put(txn, IntegerBinding.intToCompressedEntry(blobId... | [
"public",
"void",
"put",
"(",
"@",
"NotNull",
"final",
"Transaction",
"txn",
",",
"final",
"long",
"localId",
",",
"final",
"int",
"blobId",
",",
"@",
"NotNull",
"final",
"ByteIterable",
"value",
")",
"{",
"primaryStore",
".",
"put",
"(",
"txn",
",",
"Pr... | Setter for blob handle value.
@param txn enclosing transaction
@param localId entity local id.
@param blobId blob id
@param value property value. | [
"Setter",
"for",
"blob",
"handle",
"value",
"."
] | 7b3476c4e81db66f9c7529148c761605cc8eea6d | https://github.com/JetBrains/xodus/blob/7b3476c4e81db66f9c7529148c761605cc8eea6d/entity-store/src/main/java/jetbrains/exodus/entitystore/tables/BlobsTable.java#L62-L66 | train |
JetBrains/xodus | entity-store/src/main/java/jetbrains/exodus/entitystore/tables/PropertiesTable.java | PropertiesTable.put | public void put(@NotNull final PersistentStoreTransaction txn,
final long localId,
@NotNull final ByteIterable value,
@Nullable final ByteIterable oldValue,
final int propertyId,
@NotNull final ComparableValueType type) ... | java | public void put(@NotNull final PersistentStoreTransaction txn,
final long localId,
@NotNull final ByteIterable value,
@Nullable final ByteIterable oldValue,
final int propertyId,
@NotNull final ComparableValueType type) ... | [
"public",
"void",
"put",
"(",
"@",
"NotNull",
"final",
"PersistentStoreTransaction",
"txn",
",",
"final",
"long",
"localId",
",",
"@",
"NotNull",
"final",
"ByteIterable",
"value",
",",
"@",
"Nullable",
"final",
"ByteIterable",
"oldValue",
",",
"final",
"int",
... | Setter for property value. Doesn't affect entity version and doesn't
invalidate any of the cached entity iterables.
@param localId entity local id.
@param value property value.
@param oldValue property old value
@param propertyId property id | [
"Setter",
"for",
"property",
"value",
".",
"Doesn",
"t",
"affect",
"entity",
"version",
"and",
"doesn",
"t",
"invalidate",
"any",
"of",
"the",
"cached",
"entity",
"iterables",
"."
] | 7b3476c4e81db66f9c7529148c761605cc8eea6d | https://github.com/JetBrains/xodus/blob/7b3476c4e81db66f9c7529148c761605cc8eea6d/entity-store/src/main/java/jetbrains/exodus/entitystore/tables/PropertiesTable.java#L74-L97 | train |
JetBrains/xodus | utils/src/main/java/jetbrains/exodus/core/dataStructures/persistent/AbstractPersistent23Tree.java | AbstractPersistent23Tree.tailIterator | public Iterator<K> tailIterator(@NotNull final K key) {
return new Iterator<K>() {
private Stack<TreePos<K>> stack;
private boolean hasNext;
private boolean hasNextValid;
@Override
public boolean hasNext() {
if (hasNextValid) {
... | java | public Iterator<K> tailIterator(@NotNull final K key) {
return new Iterator<K>() {
private Stack<TreePos<K>> stack;
private boolean hasNext;
private boolean hasNextValid;
@Override
public boolean hasNext() {
if (hasNextValid) {
... | [
"public",
"Iterator",
"<",
"K",
">",
"tailIterator",
"(",
"@",
"NotNull",
"final",
"K",
"key",
")",
"{",
"return",
"new",
"Iterator",
"<",
"K",
">",
"(",
")",
"{",
"private",
"Stack",
"<",
"TreePos",
"<",
"K",
">",
">",
"stack",
";",
"private",
"bo... | Returns an iterator that iterates over all elements greater or equal to key in ascending order
@param key key
@return iterator | [
"Returns",
"an",
"iterator",
"that",
"iterates",
"over",
"all",
"elements",
"greater",
"or",
"equal",
"to",
"key",
"in",
"ascending",
"order"
] | 7b3476c4e81db66f9c7529148c761605cc8eea6d | https://github.com/JetBrains/xodus/blob/7b3476c4e81db66f9c7529148c761605cc8eea6d/utils/src/main/java/jetbrains/exodus/core/dataStructures/persistent/AbstractPersistent23Tree.java#L146-L215 | train |
JetBrains/xodus | entity-store/src/main/java/jetbrains/exodus/entitystore/tables/TwoColumnTable.java | TwoColumnTable.get | @Nullable
public ByteIterable get(@NotNull final Transaction txn, @NotNull final ByteIterable first) {
return this.first.get(txn, first);
} | java | @Nullable
public ByteIterable get(@NotNull final Transaction txn, @NotNull final ByteIterable first) {
return this.first.get(txn, first);
} | [
"@",
"Nullable",
"public",
"ByteIterable",
"get",
"(",
"@",
"NotNull",
"final",
"Transaction",
"txn",
",",
"@",
"NotNull",
"final",
"ByteIterable",
"first",
")",
"{",
"return",
"this",
".",
"first",
".",
"get",
"(",
"txn",
",",
"first",
")",
";",
"}"
] | Search for the first entry in the first database. Use this method for databases configured with no duplicates.
@param txn enclosing transaction
@param first first key.
@return null if no entry found, otherwise the value. | [
"Search",
"for",
"the",
"first",
"entry",
"in",
"the",
"first",
"database",
".",
"Use",
"this",
"method",
"for",
"databases",
"configured",
"with",
"no",
"duplicates",
"."
] | 7b3476c4e81db66f9c7529148c761605cc8eea6d | https://github.com/JetBrains/xodus/blob/7b3476c4e81db66f9c7529148c761605cc8eea6d/entity-store/src/main/java/jetbrains/exodus/entitystore/tables/TwoColumnTable.java#L54-L57 | train |
JetBrains/xodus | entity-store/src/main/java/jetbrains/exodus/entitystore/tables/TwoColumnTable.java | TwoColumnTable.get2 | @Nullable
public ByteIterable get2(@NotNull final Transaction txn, @NotNull final ByteIterable second) {
return this.second.get(txn, second);
} | java | @Nullable
public ByteIterable get2(@NotNull final Transaction txn, @NotNull final ByteIterable second) {
return this.second.get(txn, second);
} | [
"@",
"Nullable",
"public",
"ByteIterable",
"get2",
"(",
"@",
"NotNull",
"final",
"Transaction",
"txn",
",",
"@",
"NotNull",
"final",
"ByteIterable",
"second",
")",
"{",
"return",
"this",
".",
"second",
".",
"get",
"(",
"txn",
",",
"second",
")",
";",
"}"... | Search for the second entry in the second database. Use this method for databases configured with no duplicates.
@param second second key (value for first).
@return null if no entry found, otherwise the value. | [
"Search",
"for",
"the",
"second",
"entry",
"in",
"the",
"second",
"database",
".",
"Use",
"this",
"method",
"for",
"databases",
"configured",
"with",
"no",
"duplicates",
"."
] | 7b3476c4e81db66f9c7529148c761605cc8eea6d | https://github.com/JetBrains/xodus/blob/7b3476c4e81db66f9c7529148c761605cc8eea6d/entity-store/src/main/java/jetbrains/exodus/entitystore/tables/TwoColumnTable.java#L65-L68 | train |
OpenHFT/Chronicle-Network | src/main/java/net/openhft/chronicle/network/connection/TcpChannelHub.java | TcpChannelHub.close | @Override
public void close() {
if (closed)
return;
closed = true;
tcpSocketConsumer.prepareToShutdown();
if (shouldSendCloseMessage)
eventLoop.addHandler(new EventHandler() {
@Override
public boolean action() throws InvalidEv... | java | @Override
public void close() {
if (closed)
return;
closed = true;
tcpSocketConsumer.prepareToShutdown();
if (shouldSendCloseMessage)
eventLoop.addHandler(new EventHandler() {
@Override
public boolean action() throws InvalidEv... | [
"@",
"Override",
"public",
"void",
"close",
"(",
")",
"{",
"if",
"(",
"closed",
")",
"return",
";",
"closed",
"=",
"true",
";",
"tcpSocketConsumer",
".",
"prepareToShutdown",
"(",
")",
";",
"if",
"(",
"shouldSendCloseMessage",
")",
"eventLoop",
".",
"addHa... | called when we are completed finished with using the TcpChannelHub | [
"called",
"when",
"we",
"are",
"completed",
"finished",
"with",
"using",
"the",
"TcpChannelHub"
] | b50d232a1763b1400d5438c7925dce845e5c387a | https://github.com/OpenHFT/Chronicle-Network/blob/b50d232a1763b1400d5438c7925dce845e5c387a/src/main/java/net/openhft/chronicle/network/connection/TcpChannelHub.java#L490-L529 | train |
OpenHFT/Chronicle-Network | src/main/java/net/openhft/chronicle/network/connection/TcpChannelHub.java | TcpChannelHub.sendCloseMessage | private void sendCloseMessage() {
this.lock(() -> {
TcpChannelHub.this.writeMetaDataForKnownTID(0, outWire, null, 0);
TcpChannelHub.this.outWire.writeDocument(false, w ->
w.writeEventName(EventId.onClientClosing).text(""));
}, TryLock.LOCK);
// wa... | java | private void sendCloseMessage() {
this.lock(() -> {
TcpChannelHub.this.writeMetaDataForKnownTID(0, outWire, null, 0);
TcpChannelHub.this.outWire.writeDocument(false, w ->
w.writeEventName(EventId.onClientClosing).text(""));
}, TryLock.LOCK);
// wa... | [
"private",
"void",
"sendCloseMessage",
"(",
")",
"{",
"this",
".",
"lock",
"(",
"(",
")",
"->",
"{",
"TcpChannelHub",
".",
"this",
".",
"writeMetaDataForKnownTID",
"(",
"0",
",",
"outWire",
",",
"null",
",",
"0",
")",
";",
"TcpChannelHub",
".",
"this",
... | used to signal to the server that the client is going to drop the connection, and waits up to
one second for the server to acknowledge the receipt of this message | [
"used",
"to",
"signal",
"to",
"the",
"server",
"that",
"the",
"client",
"is",
"going",
"to",
"drop",
"the",
"connection",
"and",
"waits",
"up",
"to",
"one",
"second",
"for",
"the",
"server",
"to",
"acknowledge",
"the",
"receipt",
"of",
"this",
"message"
] | b50d232a1763b1400d5438c7925dce845e5c387a | https://github.com/OpenHFT/Chronicle-Network/blob/b50d232a1763b1400d5438c7925dce845e5c387a/src/main/java/net/openhft/chronicle/network/connection/TcpChannelHub.java#L535-L556 | train |
OpenHFT/Chronicle-Network | src/main/java/net/openhft/chronicle/network/connection/TcpChannelHub.java | TcpChannelHub.nextUniqueTransaction | public long nextUniqueTransaction(long timeMs) {
long id = timeMs;
for (; ; ) {
long old = transactionID.get();
if (old >= id)
id = old + 1;
if (transactionID.compareAndSet(old, id))
break;
}
return id;
} | java | public long nextUniqueTransaction(long timeMs) {
long id = timeMs;
for (; ; ) {
long old = transactionID.get();
if (old >= id)
id = old + 1;
if (transactionID.compareAndSet(old, id))
break;
}
return id;
} | [
"public",
"long",
"nextUniqueTransaction",
"(",
"long",
"timeMs",
")",
"{",
"long",
"id",
"=",
"timeMs",
";",
"for",
"(",
";",
";",
")",
"{",
"long",
"old",
"=",
"transactionID",
".",
"get",
"(",
")",
";",
"if",
"(",
"old",
">=",
"id",
")",
"id",
... | the transaction id are generated as unique timestamps
@param timeMs in milliseconds
@return a unique transactionId | [
"the",
"transaction",
"id",
"are",
"generated",
"as",
"unique",
"timestamps"
] | b50d232a1763b1400d5438c7925dce845e5c387a | https://github.com/OpenHFT/Chronicle-Network/blob/b50d232a1763b1400d5438c7925dce845e5c387a/src/main/java/net/openhft/chronicle/network/connection/TcpChannelHub.java#L564-L574 | train |
OpenHFT/Chronicle-Network | src/main/java/net/openhft/chronicle/network/connection/TcpChannelHub.java | TcpChannelHub.checkConnection | public void checkConnection() {
long start = Time.currentTimeMillis();
while (clientChannel == null) {
tcpSocketConsumer.checkNotShutdown();
if (start + timeoutMs > Time.currentTimeMillis())
try {
condition.await(1, TimeUnit.MILLISECONDS);
... | java | public void checkConnection() {
long start = Time.currentTimeMillis();
while (clientChannel == null) {
tcpSocketConsumer.checkNotShutdown();
if (start + timeoutMs > Time.currentTimeMillis())
try {
condition.await(1, TimeUnit.MILLISECONDS);
... | [
"public",
"void",
"checkConnection",
"(",
")",
"{",
"long",
"start",
"=",
"Time",
".",
"currentTimeMillis",
"(",
")",
";",
"while",
"(",
"clientChannel",
"==",
"null",
")",
"{",
"tcpSocketConsumer",
".",
"checkNotShutdown",
"(",
")",
";",
"if",
"(",
"start... | blocks until there is a connection | [
"blocks",
"until",
"there",
"is",
"a",
"connection"
] | b50d232a1763b1400d5438c7925dce845e5c387a | https://github.com/OpenHFT/Chronicle-Network/blob/b50d232a1763b1400d5438c7925dce845e5c387a/src/main/java/net/openhft/chronicle/network/connection/TcpChannelHub.java#L944-L964 | train |
OpenHFT/Chronicle-Network | src/main/java/net/openhft/chronicle/network/VanillaNetworkContext.java | VanillaNetworkContext.closeAtomically | protected boolean closeAtomically() {
if (isClosed.compareAndSet(false, true)) {
Closeable.closeQuietly(networkStatsListener);
return true;
} else {
//was already closed.
return false;
}
} | java | protected boolean closeAtomically() {
if (isClosed.compareAndSet(false, true)) {
Closeable.closeQuietly(networkStatsListener);
return true;
} else {
//was already closed.
return false;
}
} | [
"protected",
"boolean",
"closeAtomically",
"(",
")",
"{",
"if",
"(",
"isClosed",
".",
"compareAndSet",
"(",
"false",
",",
"true",
")",
")",
"{",
"Closeable",
".",
"closeQuietly",
"(",
"networkStatsListener",
")",
";",
"return",
"true",
";",
"}",
"else",
"{... | Close the connection atomically.
@return true if state changed to closed; false if nothing changed. | [
"Close",
"the",
"connection",
"atomically",
"."
] | b50d232a1763b1400d5438c7925dce845e5c387a | https://github.com/OpenHFT/Chronicle-Network/blob/b50d232a1763b1400d5438c7925dce845e5c387a/src/main/java/net/openhft/chronicle/network/VanillaNetworkContext.java#L183-L191 | train |
OpenHFT/Chronicle-Network | src/main/java/net/openhft/chronicle/network/WireTcpHandler.java | WireTcpHandler.onRead0 | private void onRead0() {
assert inWire.startUse();
ensureCapacity();
try {
while (!inWire.bytes().isEmpty()) {
try (DocumentContext dc = inWire.readingDocument()) {
if (!dc.isPresent())
return;
try {... | java | private void onRead0() {
assert inWire.startUse();
ensureCapacity();
try {
while (!inWire.bytes().isEmpty()) {
try (DocumentContext dc = inWire.readingDocument()) {
if (!dc.isPresent())
return;
try {... | [
"private",
"void",
"onRead0",
"(",
")",
"{",
"assert",
"inWire",
".",
"startUse",
"(",
")",
";",
"ensureCapacity",
"(",
")",
";",
"try",
"{",
"while",
"(",
"!",
"inWire",
".",
"bytes",
"(",
")",
".",
"isEmpty",
"(",
")",
")",
"{",
"try",
"(",
"Do... | process all messages in this batch, provided there is plenty of output space. | [
"process",
"all",
"messages",
"in",
"this",
"batch",
"provided",
"there",
"is",
"plenty",
"of",
"output",
"space",
"."
] | b50d232a1763b1400d5438c7925dce845e5c387a | https://github.com/OpenHFT/Chronicle-Network/blob/b50d232a1763b1400d5438c7925dce845e5c387a/src/main/java/net/openhft/chronicle/network/WireTcpHandler.java#L188-L215 | train |
OpenHFT/Chronicle-Network | src/main/java/net/openhft/chronicle/network/cluster/handlers/HeartbeatHandler.java | HeartbeatHandler.hasReceivedHeartbeat | private boolean hasReceivedHeartbeat() {
long currentTimeMillis = System.currentTimeMillis();
boolean result = lastTimeMessageReceived + heartbeatTimeoutMs >= currentTimeMillis;
if (!result)
Jvm.warn().on(getClass(), Integer.toHexString(hashCode()) + " missed heartbeat, lastTimeMess... | java | private boolean hasReceivedHeartbeat() {
long currentTimeMillis = System.currentTimeMillis();
boolean result = lastTimeMessageReceived + heartbeatTimeoutMs >= currentTimeMillis;
if (!result)
Jvm.warn().on(getClass(), Integer.toHexString(hashCode()) + " missed heartbeat, lastTimeMess... | [
"private",
"boolean",
"hasReceivedHeartbeat",
"(",
")",
"{",
"long",
"currentTimeMillis",
"=",
"System",
".",
"currentTimeMillis",
"(",
")",
";",
"boolean",
"result",
"=",
"lastTimeMessageReceived",
"+",
"heartbeatTimeoutMs",
">=",
"currentTimeMillis",
";",
"if",
"(... | called periodically to check that the heartbeat has been received
@return {@code true} if we have received a heartbeat recently | [
"called",
"periodically",
"to",
"check",
"that",
"the",
"heartbeat",
"has",
"been",
"received"
] | b50d232a1763b1400d5438c7925dce845e5c387a | https://github.com/OpenHFT/Chronicle-Network/blob/b50d232a1763b1400d5438c7925dce845e5c387a/src/main/java/net/openhft/chronicle/network/cluster/handlers/HeartbeatHandler.java#L185-L193 | train |
Stratio/cassandra-lucene-index | plugin/src/main/java/com/stratio/cassandra/lucene/schema/mapping/Mapper.java | Mapper.mapsCell | public boolean mapsCell(String cell) {
return mappedCells.stream().anyMatch(x -> x.equals(cell));
} | java | public boolean mapsCell(String cell) {
return mappedCells.stream().anyMatch(x -> x.equals(cell));
} | [
"public",
"boolean",
"mapsCell",
"(",
"String",
"cell",
")",
"{",
"return",
"mappedCells",
".",
"stream",
"(",
")",
".",
"anyMatch",
"(",
"x",
"->",
"x",
".",
"equals",
"(",
"cell",
")",
")",
";",
"}"
] | Returns if this maps the specified cell.
@param cell the cell name
@return {@code true} if this maps the column, {@code false} otherwise | [
"Returns",
"if",
"this",
"maps",
"the",
"specified",
"cell",
"."
] | a94a4d9af6c25d40e1108729974c35c27c54441c | https://github.com/Stratio/cassandra-lucene-index/blob/a94a4d9af6c25d40e1108729974c35c27c54441c/plugin/src/main/java/com/stratio/cassandra/lucene/schema/mapping/Mapper.java#L192-L194 | train |
Stratio/cassandra-lucene-index | plugin/src/main/java/com/stratio/cassandra/lucene/common/GeoDistance.java | GeoDistance.getDegrees | public double getDegrees() {
double kms = getValue(GeoDistanceUnit.KILOMETRES);
return DistanceUtils.dist2Degrees(kms, DistanceUtils.EARTH_MEAN_RADIUS_KM);
} | java | public double getDegrees() {
double kms = getValue(GeoDistanceUnit.KILOMETRES);
return DistanceUtils.dist2Degrees(kms, DistanceUtils.EARTH_MEAN_RADIUS_KM);
} | [
"public",
"double",
"getDegrees",
"(",
")",
"{",
"double",
"kms",
"=",
"getValue",
"(",
"GeoDistanceUnit",
".",
"KILOMETRES",
")",
";",
"return",
"DistanceUtils",
".",
"dist2Degrees",
"(",
"kms",
",",
"DistanceUtils",
".",
"EARTH_MEAN_RADIUS_KM",
")",
";",
"}"... | Return the numeric distance value in degrees.
@return the degrees | [
"Return",
"the",
"numeric",
"distance",
"value",
"in",
"degrees",
"."
] | a94a4d9af6c25d40e1108729974c35c27c54441c | https://github.com/Stratio/cassandra-lucene-index/blob/a94a4d9af6c25d40e1108729974c35c27c54441c/plugin/src/main/java/com/stratio/cassandra/lucene/common/GeoDistance.java#L62-L65 | train |
Stratio/cassandra-lucene-index | plugin/src/main/java/com/stratio/cassandra/lucene/schema/mapping/DateRangeMapper.java | DateRangeMapper.makeShape | public NRShape makeShape(Date from, Date to) {
UnitNRShape fromShape = tree.toUnitShape(from);
UnitNRShape toShape = tree.toUnitShape(to);
return tree.toRangeShape(fromShape, toShape);
} | java | public NRShape makeShape(Date from, Date to) {
UnitNRShape fromShape = tree.toUnitShape(from);
UnitNRShape toShape = tree.toUnitShape(to);
return tree.toRangeShape(fromShape, toShape);
} | [
"public",
"NRShape",
"makeShape",
"(",
"Date",
"from",
",",
"Date",
"to",
")",
"{",
"UnitNRShape",
"fromShape",
"=",
"tree",
".",
"toUnitShape",
"(",
"from",
")",
";",
"UnitNRShape",
"toShape",
"=",
"tree",
".",
"toUnitShape",
"(",
"to",
")",
";",
"retur... | Makes an spatial shape representing the time range defined by the two specified dates.
@param from the start {@link Date}
@param to the end {@link Date}
@return a shape | [
"Makes",
"an",
"spatial",
"shape",
"representing",
"the",
"time",
"range",
"defined",
"by",
"the",
"two",
"specified",
"dates",
"."
] | a94a4d9af6c25d40e1108729974c35c27c54441c | https://github.com/Stratio/cassandra-lucene-index/blob/a94a4d9af6c25d40e1108729974c35c27c54441c/plugin/src/main/java/com/stratio/cassandra/lucene/schema/mapping/DateRangeMapper.java#L123-L127 | train |
Stratio/cassandra-lucene-index | plugin/src/main/java/com/stratio/cassandra/lucene/common/GeospatialUtils.java | GeospatialUtils.validateGeohashMaxLevels | public static int validateGeohashMaxLevels(Integer userMaxLevels, int defaultMaxLevels) {
int maxLevels = userMaxLevels == null ? defaultMaxLevels : userMaxLevels;
if (maxLevels < 1 || maxLevels > GeohashPrefixTree.getMaxLevelsPossible()) {
throw new IndexException("max_levels must be in ran... | java | public static int validateGeohashMaxLevels(Integer userMaxLevels, int defaultMaxLevels) {
int maxLevels = userMaxLevels == null ? defaultMaxLevels : userMaxLevels;
if (maxLevels < 1 || maxLevels > GeohashPrefixTree.getMaxLevelsPossible()) {
throw new IndexException("max_levels must be in ran... | [
"public",
"static",
"int",
"validateGeohashMaxLevels",
"(",
"Integer",
"userMaxLevels",
",",
"int",
"defaultMaxLevels",
")",
"{",
"int",
"maxLevels",
"=",
"userMaxLevels",
"==",
"null",
"?",
"defaultMaxLevels",
":",
"userMaxLevels",
";",
"if",
"(",
"maxLevels",
"<... | Checks if the specified max levels is correct.
@param userMaxLevels the maximum number of levels in the tree
@param defaultMaxLevels the default max number of levels
@return the validated max levels | [
"Checks",
"if",
"the",
"specified",
"max",
"levels",
"is",
"correct",
"."
] | a94a4d9af6c25d40e1108729974c35c27c54441c | https://github.com/Stratio/cassandra-lucene-index/blob/a94a4d9af6c25d40e1108729974c35c27c54441c/plugin/src/main/java/com/stratio/cassandra/lucene/common/GeospatialUtils.java#L51-L59 | train |
Stratio/cassandra-lucene-index | plugin/src/main/java/com/stratio/cassandra/lucene/common/GeospatialUtils.java | GeospatialUtils.checkLatitude | public static Double checkLatitude(String name, Double latitude) {
if (latitude == null) {
throw new IndexException("{} required", name);
} else if (latitude < MIN_LATITUDE || latitude > MAX_LATITUDE) {
throw new IndexException("{} must be in range [{}, {}], but found {}",
... | java | public static Double checkLatitude(String name, Double latitude) {
if (latitude == null) {
throw new IndexException("{} required", name);
} else if (latitude < MIN_LATITUDE || latitude > MAX_LATITUDE) {
throw new IndexException("{} must be in range [{}, {}], but found {}",
... | [
"public",
"static",
"Double",
"checkLatitude",
"(",
"String",
"name",
",",
"Double",
"latitude",
")",
"{",
"if",
"(",
"latitude",
"==",
"null",
")",
"{",
"throw",
"new",
"IndexException",
"(",
"\"{} required\"",
",",
"name",
")",
";",
"}",
"else",
"if",
... | Checks if the specified latitude is correct.
@param name the name of the latitude field
@param latitude the value of the latitude field
@return the latitude | [
"Checks",
"if",
"the",
"specified",
"latitude",
"is",
"correct",
"."
] | a94a4d9af6c25d40e1108729974c35c27c54441c | https://github.com/Stratio/cassandra-lucene-index/blob/a94a4d9af6c25d40e1108729974c35c27c54441c/plugin/src/main/java/com/stratio/cassandra/lucene/common/GeospatialUtils.java#L68-L79 | train |
Stratio/cassandra-lucene-index | plugin/src/main/java/com/stratio/cassandra/lucene/common/GeospatialUtils.java | GeospatialUtils.checkLongitude | public static Double checkLongitude(String name, Double longitude) {
if (longitude == null) {
throw new IndexException("{} required", name);
} else if (longitude < MIN_LONGITUDE || longitude > MAX_LONGITUDE) {
throw new IndexException("{} must be in range [{}, {}], but found {}",... | java | public static Double checkLongitude(String name, Double longitude) {
if (longitude == null) {
throw new IndexException("{} required", name);
} else if (longitude < MIN_LONGITUDE || longitude > MAX_LONGITUDE) {
throw new IndexException("{} must be in range [{}, {}], but found {}",... | [
"public",
"static",
"Double",
"checkLongitude",
"(",
"String",
"name",
",",
"Double",
"longitude",
")",
"{",
"if",
"(",
"longitude",
"==",
"null",
")",
"{",
"throw",
"new",
"IndexException",
"(",
"\"{} required\"",
",",
"name",
")",
";",
"}",
"else",
"if",... | Checks if the specified longitude is correct.
@param name the name of the longitude field
@param longitude the value of the longitude field
@return the longitude | [
"Checks",
"if",
"the",
"specified",
"longitude",
"is",
"correct",
"."
] | a94a4d9af6c25d40e1108729974c35c27c54441c | https://github.com/Stratio/cassandra-lucene-index/blob/a94a4d9af6c25d40e1108729974c35c27c54441c/plugin/src/main/java/com/stratio/cassandra/lucene/common/GeospatialUtils.java#L88-L99 | train |
Stratio/cassandra-lucene-index | plugin/src/main/java/com/stratio/cassandra/lucene/search/Search.java | Search.postProcessingFields | public Set<String> postProcessingFields() {
Set<String> fields = new LinkedHashSet<>();
query.forEach(condition -> fields.addAll(condition.postProcessingFields()));
sort.forEach(condition -> fields.addAll(condition.postProcessingFields()));
return fields;
} | java | public Set<String> postProcessingFields() {
Set<String> fields = new LinkedHashSet<>();
query.forEach(condition -> fields.addAll(condition.postProcessingFields()));
sort.forEach(condition -> fields.addAll(condition.postProcessingFields()));
return fields;
} | [
"public",
"Set",
"<",
"String",
">",
"postProcessingFields",
"(",
")",
"{",
"Set",
"<",
"String",
">",
"fields",
"=",
"new",
"LinkedHashSet",
"<>",
"(",
")",
";",
"query",
".",
"forEach",
"(",
"condition",
"->",
"fields",
".",
"addAll",
"(",
"condition",... | Returns the names of the involved fields when post processing.
@return the names of the involved fields | [
"Returns",
"the",
"names",
"of",
"the",
"involved",
"fields",
"when",
"post",
"processing",
"."
] | a94a4d9af6c25d40e1108729974c35c27c54441c | https://github.com/Stratio/cassandra-lucene-index/blob/a94a4d9af6c25d40e1108729974c35c27c54441c/plugin/src/main/java/com/stratio/cassandra/lucene/search/Search.java#L189-L194 | train |
Stratio/cassandra-lucene-index | builder/src/main/java/com/stratio/cassandra/lucene/builder/Builder.java | Builder.index | public static Index index(String keyspace, String table, String name) {
return new Index(table, name).keyspace(keyspace);
} | java | public static Index index(String keyspace, String table, String name) {
return new Index(table, name).keyspace(keyspace);
} | [
"public",
"static",
"Index",
"index",
"(",
"String",
"keyspace",
",",
"String",
"table",
",",
"String",
"name",
")",
"{",
"return",
"new",
"Index",
"(",
"table",
",",
"name",
")",
".",
"keyspace",
"(",
"keyspace",
")",
";",
"}"
] | Returns a new index creation statement using the session's keyspace.
@param keyspace the keyspace name
@param table the table name
@param name the index name
@return a new index creation statement | [
"Returns",
"a",
"new",
"index",
"creation",
"statement",
"using",
"the",
"session",
"s",
"keyspace",
"."
] | a94a4d9af6c25d40e1108729974c35c27c54441c | https://github.com/Stratio/cassandra-lucene-index/blob/a94a4d9af6c25d40e1108729974c35c27c54441c/builder/src/main/java/com/stratio/cassandra/lucene/builder/Builder.java#L61-L63 | train |
Stratio/cassandra-lucene-index | builder/src/main/java/com/stratio/cassandra/lucene/builder/index/schema/mapping/GeoShapeMapper.java | GeoShapeMapper.transform | public GeoShapeMapper transform(GeoTransformation... transformations) {
if (this.transformations == null) {
this.transformations = Arrays.asList(transformations);
} else {
this.transformations.addAll(Arrays.asList(transformations));
}
return this;
} | java | public GeoShapeMapper transform(GeoTransformation... transformations) {
if (this.transformations == null) {
this.transformations = Arrays.asList(transformations);
} else {
this.transformations.addAll(Arrays.asList(transformations));
}
return this;
} | [
"public",
"GeoShapeMapper",
"transform",
"(",
"GeoTransformation",
"...",
"transformations",
")",
"{",
"if",
"(",
"this",
".",
"transformations",
"==",
"null",
")",
"{",
"this",
".",
"transformations",
"=",
"Arrays",
".",
"asList",
"(",
"transformations",
")",
... | Sets the transformations to be applied to the shape before indexing it.
@param transformations the sequence of transformations
@return this with the specified sequence of transformations | [
"Sets",
"the",
"transformations",
"to",
"be",
"applied",
"to",
"the",
"shape",
"before",
"indexing",
"it",
"."
] | a94a4d9af6c25d40e1108729974c35c27c54441c | https://github.com/Stratio/cassandra-lucene-index/blob/a94a4d9af6c25d40e1108729974c35c27c54441c/builder/src/main/java/com/stratio/cassandra/lucene/builder/index/schema/mapping/GeoShapeMapper.java#L74-L81 | train |
Stratio/cassandra-lucene-index | plugin/src/main/java/com/stratio/cassandra/lucene/search/SearchBuilderLegacy.java | SearchBuilderLegacy.paging | @JsonProperty("paging")
void paging(String paging) {
builder.paging(IndexPagingState.fromByteBuffer(ByteBufferUtils.byteBuffer(paging)));
} | java | @JsonProperty("paging")
void paging(String paging) {
builder.paging(IndexPagingState.fromByteBuffer(ByteBufferUtils.byteBuffer(paging)));
} | [
"@",
"JsonProperty",
"(",
"\"paging\"",
")",
"void",
"paging",
"(",
"String",
"paging",
")",
"{",
"builder",
".",
"paging",
"(",
"IndexPagingState",
".",
"fromByteBuffer",
"(",
"ByteBufferUtils",
".",
"byteBuffer",
"(",
"paging",
")",
")",
")",
";",
"}"
] | Sets the specified starting partition key.
@param paging a paging state | [
"Sets",
"the",
"specified",
"starting",
"partition",
"key",
"."
] | a94a4d9af6c25d40e1108729974c35c27c54441c | https://github.com/Stratio/cassandra-lucene-index/blob/a94a4d9af6c25d40e1108729974c35c27c54441c/plugin/src/main/java/com/stratio/cassandra/lucene/search/SearchBuilderLegacy.java#L86-L89 | train |
Stratio/cassandra-lucene-index | plugin/src/main/java/com/stratio/cassandra/lucene/schema/Schema.java | Schema.mapsCell | public boolean mapsCell(String cell) {
return mappers.values().stream().anyMatch(mapper -> mapper.mapsCell(cell));
} | java | public boolean mapsCell(String cell) {
return mappers.values().stream().anyMatch(mapper -> mapper.mapsCell(cell));
} | [
"public",
"boolean",
"mapsCell",
"(",
"String",
"cell",
")",
"{",
"return",
"mappers",
".",
"values",
"(",
")",
".",
"stream",
"(",
")",
".",
"anyMatch",
"(",
"mapper",
"->",
"mapper",
".",
"mapsCell",
"(",
"cell",
")",
")",
";",
"}"
] | Returns if this has any mapping for the specified cell.
@param cell the cell name
@return {@code true} if there is any mapping for the cell, {@code false} otherwise | [
"Returns",
"if",
"this",
"has",
"any",
"mapping",
"for",
"the",
"specified",
"cell",
"."
] | a94a4d9af6c25d40e1108729974c35c27c54441c | https://github.com/Stratio/cassandra-lucene-index/blob/a94a4d9af6c25d40e1108729974c35c27c54441c/plugin/src/main/java/com/stratio/cassandra/lucene/schema/Schema.java#L150-L152 | train |
dlew/joda-time-android | library/src/main/java/net/danlew/android/joda/ResUtils.java | ResUtils.convertPathToResource | private static String convertPathToResource(String path) {
File file = new File(path);
List<String> parts = new ArrayList<String>();
do {
parts.add(file.getName());
file = file.getParentFile();
}
while (file != null);
StringBuffer sb = new StringB... | java | private static String convertPathToResource(String path) {
File file = new File(path);
List<String> parts = new ArrayList<String>();
do {
parts.add(file.getName());
file = file.getParentFile();
}
while (file != null);
StringBuffer sb = new StringB... | [
"private",
"static",
"String",
"convertPathToResource",
"(",
"String",
"path",
")",
"{",
"File",
"file",
"=",
"new",
"File",
"(",
"path",
")",
";",
"List",
"<",
"String",
">",
"parts",
"=",
"new",
"ArrayList",
"<",
"String",
">",
"(",
")",
";",
"do",
... | Converts any path into something that can be placed in an Android directory.
Traverses any subdirectories and flattens it all into a single filename. Also
gets rid of commonly seen illegal characters in tz identifiers, and lower cases
the entire thing.
@param path the path to convert
@return a flat path with no dire... | [
"Converts",
"any",
"path",
"into",
"something",
"that",
"can",
"be",
"placed",
"in",
"an",
"Android",
"directory",
"."
] | 5bf96f6ef4ea63ee91e73e1e528896fa00108dec | https://github.com/dlew/joda-time-android/blob/5bf96f6ef4ea63ee91e73e1e528896fa00108dec/library/src/main/java/net/danlew/android/joda/ResUtils.java#L31-L51 | train |
dlew/joda-time-android | library/src/main/java/net/danlew/android/joda/DateUtils.java | DateUtils.formatDateTime | public static String formatDateTime(Context context, ReadablePartial time, int flags) {
return android.text.format.DateUtils.formatDateTime(context, toMillis(time), flags | FORMAT_UTC);
} | java | public static String formatDateTime(Context context, ReadablePartial time, int flags) {
return android.text.format.DateUtils.formatDateTime(context, toMillis(time), flags | FORMAT_UTC);
} | [
"public",
"static",
"String",
"formatDateTime",
"(",
"Context",
"context",
",",
"ReadablePartial",
"time",
",",
"int",
"flags",
")",
"{",
"return",
"android",
".",
"text",
".",
"format",
".",
"DateUtils",
".",
"formatDateTime",
"(",
"context",
",",
"toMillis",... | Formats a date or a time according to the local conventions.
Since ReadablePartials don't support all fields, we fill in any blanks
needed for formatting by using the epoch (1970-01-01T00:00:00Z).
See {@link android.text.format.DateUtils#formatDateTime} for full docs.
@param context the context is required only if t... | [
"Formats",
"a",
"date",
"or",
"a",
"time",
"according",
"to",
"the",
"local",
"conventions",
"."
] | 5bf96f6ef4ea63ee91e73e1e528896fa00108dec | https://github.com/dlew/joda-time-android/blob/5bf96f6ef4ea63ee91e73e1e528896fa00108dec/library/src/main/java/net/danlew/android/joda/DateUtils.java#L79-L81 | train |
dlew/joda-time-android | library/src/main/java/net/danlew/android/joda/DateUtils.java | DateUtils.formatDateRange | public static String formatDateRange(Context context, ReadablePartial start, ReadablePartial end, int flags) {
return formatDateRange(context, toMillis(start), toMillis(end), flags);
} | java | public static String formatDateRange(Context context, ReadablePartial start, ReadablePartial end, int flags) {
return formatDateRange(context, toMillis(start), toMillis(end), flags);
} | [
"public",
"static",
"String",
"formatDateRange",
"(",
"Context",
"context",
",",
"ReadablePartial",
"start",
",",
"ReadablePartial",
"end",
",",
"int",
"flags",
")",
"{",
"return",
"formatDateRange",
"(",
"context",
",",
"toMillis",
"(",
"start",
")",
",",
"to... | Formats a date or a time range according to the local conventions.
You should ensure that start/end are in the same timezone; formatDateRange()
doesn't handle start/end in different timezones well.
See {@link android.text.format.DateUtils#formatDateRange} for full docs.
@param context the context is required only if... | [
"Formats",
"a",
"date",
"or",
"a",
"time",
"range",
"according",
"to",
"the",
"local",
"conventions",
"."
] | 5bf96f6ef4ea63ee91e73e1e528896fa00108dec | https://github.com/dlew/joda-time-android/blob/5bf96f6ef4ea63ee91e73e1e528896fa00108dec/library/src/main/java/net/danlew/android/joda/DateUtils.java#L111-L113 | train |
dlew/joda-time-android | library/src/main/java/net/danlew/android/joda/DateUtils.java | DateUtils.getRelativeTimeSpanString | public static CharSequence getRelativeTimeSpanString(Context context, ReadableInstant time, int flags) {
boolean abbrevRelative = (flags & (FORMAT_ABBREV_RELATIVE | FORMAT_ABBREV_ALL)) != 0;
// We set the millis to 0 so we aren't off by a fraction of a second when counting intervals
DateTime no... | java | public static CharSequence getRelativeTimeSpanString(Context context, ReadableInstant time, int flags) {
boolean abbrevRelative = (flags & (FORMAT_ABBREV_RELATIVE | FORMAT_ABBREV_ALL)) != 0;
// We set the millis to 0 so we aren't off by a fraction of a second when counting intervals
DateTime no... | [
"public",
"static",
"CharSequence",
"getRelativeTimeSpanString",
"(",
"Context",
"context",
",",
"ReadableInstant",
"time",
",",
"int",
"flags",
")",
"{",
"boolean",
"abbrevRelative",
"=",
"(",
"flags",
"&",
"(",
"FORMAT_ABBREV_RELATIVE",
"|",
"FORMAT_ABBREV_ALL",
"... | Returns a string describing 'time' as a time relative to 'now'.
See {@link android.text.format.DateUtils#getRelativeTimeSpanString} for full docs.
@param context the context
@param time the time to describe
@param flags a bit mask for formatting options, usually FORMAT_ABBREV_RELATIVE
@return a string describing 'tim... | [
"Returns",
"a",
"string",
"describing",
"time",
"as",
"a",
"time",
"relative",
"to",
"now",
"."
] | 5bf96f6ef4ea63ee91e73e1e528896fa00108dec | https://github.com/dlew/joda-time-android/blob/5bf96f6ef4ea63ee91e73e1e528896fa00108dec/library/src/main/java/net/danlew/android/joda/DateUtils.java#L246-L339 | train |
dlew/joda-time-android | library/src/main/java/net/danlew/android/joda/DateUtils.java | DateUtils.formatDuration | public static CharSequence formatDuration(Context context, ReadableDuration readableDuration) {
Resources res = context.getResources();
Duration duration = readableDuration.toDuration();
final int hours = (int) duration.getStandardHours();
if (hours != 0) {
return res.getQua... | java | public static CharSequence formatDuration(Context context, ReadableDuration readableDuration) {
Resources res = context.getResources();
Duration duration = readableDuration.toDuration();
final int hours = (int) duration.getStandardHours();
if (hours != 0) {
return res.getQua... | [
"public",
"static",
"CharSequence",
"formatDuration",
"(",
"Context",
"context",
",",
"ReadableDuration",
"readableDuration",
")",
"{",
"Resources",
"res",
"=",
"context",
".",
"getResources",
"(",
")",
";",
"Duration",
"duration",
"=",
"readableDuration",
".",
"t... | Return given duration in a human-friendly format. For example, "4
minutes" or "1 second". Returns only largest meaningful unit of time,
from seconds up to hours.
The longest duration it supports is hours.
This method assumes that there are 60 minutes in an hour,
60 seconds in a minute and 1000 milliseconds in a secon... | [
"Return",
"given",
"duration",
"in",
"a",
"human",
"-",
"friendly",
"format",
".",
"For",
"example",
"4",
"minutes",
"or",
"1",
"second",
".",
"Returns",
"only",
"largest",
"meaningful",
"unit",
"of",
"time",
"from",
"seconds",
"up",
"to",
"hours",
"."
] | 5bf96f6ef4ea63ee91e73e1e528896fa00108dec | https://github.com/dlew/joda-time-android/blob/5bf96f6ef4ea63ee91e73e1e528896fa00108dec/library/src/main/java/net/danlew/android/joda/DateUtils.java#L489-L505 | train |
dlew/joda-time-android | library/src/main/java/net/danlew/android/joda/ResourceZoneInfoProvider.java | ResourceZoneInfoProvider.getZone | public DateTimeZone getZone(String id) {
if (id == null) {
return null;
}
Object obj = iZoneInfoMap.get(id);
if (obj == null) {
return null;
}
if (id.equals(obj)) {
// Load zone data for the first time.
return loadZoneData... | java | public DateTimeZone getZone(String id) {
if (id == null) {
return null;
}
Object obj = iZoneInfoMap.get(id);
if (obj == null) {
return null;
}
if (id.equals(obj)) {
// Load zone data for the first time.
return loadZoneData... | [
"public",
"DateTimeZone",
"getZone",
"(",
"String",
"id",
")",
"{",
"if",
"(",
"id",
"==",
"null",
")",
"{",
"return",
"null",
";",
"}",
"Object",
"obj",
"=",
"iZoneInfoMap",
".",
"get",
"(",
"id",
")",
";",
"if",
"(",
"obj",
"==",
"null",
")",
"... | If an error is thrown while loading zone data, the exception is logged
to system error and null is returned for this and all future requests.
@param id the id to load
@return the loaded zone | [
"If",
"an",
"error",
"is",
"thrown",
"while",
"loading",
"zone",
"data",
"the",
"exception",
"is",
"logged",
"to",
"system",
"error",
"and",
"null",
"is",
"returned",
"for",
"this",
"and",
"all",
"future",
"requests",
"."
] | 5bf96f6ef4ea63ee91e73e1e528896fa00108dec | https://github.com/dlew/joda-time-android/blob/5bf96f6ef4ea63ee91e73e1e528896fa00108dec/library/src/main/java/net/danlew/android/joda/ResourceZoneInfoProvider.java#L49-L77 | train |
kiegroup/jbpm-designer | jbpm-designer-client/src/main/java/org/jbpm/designer/client/notification/DesignerNotificationPopupsManager.java | DesignerNotificationPopupsManager.addNotification | public void addNotification(@Observes final DesignerNotificationEvent event) {
if (user.getIdentifier().equals(event.getUserId())) {
if (event.getNotification() != null && !event.getNotification().equals("openinxmleditor")) {
final NotificationPopupView view = new NotificationPopupV... | java | public void addNotification(@Observes final DesignerNotificationEvent event) {
if (user.getIdentifier().equals(event.getUserId())) {
if (event.getNotification() != null && !event.getNotification().equals("openinxmleditor")) {
final NotificationPopupView view = new NotificationPopupV... | [
"public",
"void",
"addNotification",
"(",
"@",
"Observes",
"final",
"DesignerNotificationEvent",
"event",
")",
"{",
"if",
"(",
"user",
".",
"getIdentifier",
"(",
")",
".",
"equals",
"(",
"event",
".",
"getUserId",
"(",
")",
")",
")",
"{",
"if",
"(",
"eve... | Display a Notification message
@param event | [
"Display",
"a",
"Notification",
"message"
] | 97b048d06f083a1f831c971c2e9fdfd0952d2b0b | https://github.com/kiegroup/jbpm-designer/blob/97b048d06f083a1f831c971c2e9fdfd0952d2b0b/jbpm-designer-client/src/main/java/org/jbpm/designer/client/notification/DesignerNotificationPopupsManager.java#L51-L74 | train |
kiegroup/jbpm-designer | jbpm-designer-client/src/main/java/org/jbpm/designer/client/notification/DesignerNotificationPopupsManager.java | DesignerNotificationPopupsManager.remove | private void remove() {
if (removing) {
return;
}
if (deactiveNotifications.size() == 0) {
return;
}
removing = true;
final NotificationPopupView view = deactiveNotifications.get(0);
final LinearFadeOutAnimation fadeOutAnimation = new Linea... | java | private void remove() {
if (removing) {
return;
}
if (deactiveNotifications.size() == 0) {
return;
}
removing = true;
final NotificationPopupView view = deactiveNotifications.get(0);
final LinearFadeOutAnimation fadeOutAnimation = new Linea... | [
"private",
"void",
"remove",
"(",
")",
"{",
"if",
"(",
"removing",
")",
"{",
"return",
";",
"}",
"if",
"(",
"deactiveNotifications",
".",
"size",
"(",
")",
"==",
"0",
")",
"{",
"return",
";",
"}",
"removing",
"=",
"true",
";",
"final",
"NotificationP... | Remove a notification message. Recursive until all pending removals have been completed. | [
"Remove",
"a",
"notification",
"message",
".",
"Recursive",
"until",
"all",
"pending",
"removals",
"have",
"been",
"completed",
"."
] | 97b048d06f083a1f831c971c2e9fdfd0952d2b0b | https://github.com/kiegroup/jbpm-designer/blob/97b048d06f083a1f831c971c2e9fdfd0952d2b0b/jbpm-designer-client/src/main/java/org/jbpm/designer/client/notification/DesignerNotificationPopupsManager.java#L87-L121 | train |
kiegroup/jbpm-designer | jbpm-designer-backend/src/main/java/org/jbpm/designer/server/EditorHandler.java | EditorHandler.readDesignerVersion | public static String readDesignerVersion(ServletContext context) {
String retStr = "";
BufferedReader br = null;
try {
InputStream inputStream = context.getResourceAsStream("/META-INF/MANIFEST.MF");
br = new BufferedReader(new InputStreamReader(inputStream,
... | java | public static String readDesignerVersion(ServletContext context) {
String retStr = "";
BufferedReader br = null;
try {
InputStream inputStream = context.getResourceAsStream("/META-INF/MANIFEST.MF");
br = new BufferedReader(new InputStreamReader(inputStream,
... | [
"public",
"static",
"String",
"readDesignerVersion",
"(",
"ServletContext",
"context",
")",
"{",
"String",
"retStr",
"=",
"\"\"",
";",
"BufferedReader",
"br",
"=",
"null",
";",
"try",
"{",
"InputStream",
"inputStream",
"=",
"context",
".",
"getResourceAsStream",
... | Returns the designer version from the manifest.
@param context
@return version | [
"Returns",
"the",
"designer",
"version",
"from",
"the",
"manifest",
"."
] | 97b048d06f083a1f831c971c2e9fdfd0952d2b0b | https://github.com/kiegroup/jbpm-designer/blob/97b048d06f083a1f831c971c2e9fdfd0952d2b0b/jbpm-designer-backend/src/main/java/org/jbpm/designer/server/EditorHandler.java#L476-L500 | train |
kiegroup/jbpm-designer | jbpm-designer-client/src/main/java/org/jbpm/designer/client/popup/ActivityDataIOEditorWidget.java | ActivityDataIOEditorWidget.isDuplicateName | public boolean isDuplicateName(String name) {
if (name == null || name.trim().isEmpty()) {
return false;
}
List<AssignmentRow> as = view.getAssignmentRows();
if (as != null && !as.isEmpty()) {
int nameCount = 0;
for (AssignmentRow row : as) {
... | java | public boolean isDuplicateName(String name) {
if (name == null || name.trim().isEmpty()) {
return false;
}
List<AssignmentRow> as = view.getAssignmentRows();
if (as != null && !as.isEmpty()) {
int nameCount = 0;
for (AssignmentRow row : as) {
... | [
"public",
"boolean",
"isDuplicateName",
"(",
"String",
"name",
")",
"{",
"if",
"(",
"name",
"==",
"null",
"||",
"name",
".",
"trim",
"(",
")",
".",
"isEmpty",
"(",
")",
")",
"{",
"return",
"false",
";",
"}",
"List",
"<",
"AssignmentRow",
">",
"as",
... | Tests whether a Row name occurs more than once in the list of rows
@param name
@return | [
"Tests",
"whether",
"a",
"Row",
"name",
"occurs",
"more",
"than",
"once",
"in",
"the",
"list",
"of",
"rows"
] | 97b048d06f083a1f831c971c2e9fdfd0952d2b0b | https://github.com/kiegroup/jbpm-designer/blob/97b048d06f083a1f831c971c2e9fdfd0952d2b0b/jbpm-designer-client/src/main/java/org/jbpm/designer/client/popup/ActivityDataIOEditorWidget.java#L221-L238 | train |
kiegroup/jbpm-designer | jbpm-designer-client/src/main/java/org/jbpm/designer/client/util/ListBoxValues.java | ListBoxValues.getValueForDisplayValue | public String getValueForDisplayValue(final String key) {
if (mapDisplayValuesToValues.containsKey(key)) {
return mapDisplayValuesToValues.get(key);
}
return key;
} | java | public String getValueForDisplayValue(final String key) {
if (mapDisplayValuesToValues.containsKey(key)) {
return mapDisplayValuesToValues.get(key);
}
return key;
} | [
"public",
"String",
"getValueForDisplayValue",
"(",
"final",
"String",
"key",
")",
"{",
"if",
"(",
"mapDisplayValuesToValues",
".",
"containsKey",
"(",
"key",
")",
")",
"{",
"return",
"mapDisplayValuesToValues",
".",
"get",
"(",
"key",
")",
";",
"}",
"return",... | Returns real unquoted value for a DisplayValue
@param key
@return | [
"Returns",
"real",
"unquoted",
"value",
"for",
"a",
"DisplayValue"
] | 97b048d06f083a1f831c971c2e9fdfd0952d2b0b | https://github.com/kiegroup/jbpm-designer/blob/97b048d06f083a1f831c971c2e9fdfd0952d2b0b/jbpm-designer-client/src/main/java/org/jbpm/designer/client/util/ListBoxValues.java#L275-L280 | train |
kiegroup/jbpm-designer | jbpm-designer-client/src/main/java/org/jbpm/designer/client/shared/AssignmentData.java | AssignmentData.getAssignmentRows | public List<AssignmentRow> getAssignmentRows(VariableType varType) {
List<AssignmentRow> rows = new ArrayList<AssignmentRow>();
List<Variable> handledVariables = new ArrayList<Variable>();
// Create an AssignmentRow for each Assignment
for (Assignment assignment : assignments) {
... | java | public List<AssignmentRow> getAssignmentRows(VariableType varType) {
List<AssignmentRow> rows = new ArrayList<AssignmentRow>();
List<Variable> handledVariables = new ArrayList<Variable>();
// Create an AssignmentRow for each Assignment
for (Assignment assignment : assignments) {
... | [
"public",
"List",
"<",
"AssignmentRow",
">",
"getAssignmentRows",
"(",
"VariableType",
"varType",
")",
"{",
"List",
"<",
"AssignmentRow",
">",
"rows",
"=",
"new",
"ArrayList",
"<",
"AssignmentRow",
">",
"(",
")",
";",
"List",
"<",
"Variable",
">",
"handledVa... | Gets a list of AssignmentRows based on the current Assignments
@return | [
"Gets",
"a",
"list",
"of",
"AssignmentRows",
"based",
"on",
"the",
"current",
"Assignments"
] | 97b048d06f083a1f831c971c2e9fdfd0952d2b0b | https://github.com/kiegroup/jbpm-designer/blob/97b048d06f083a1f831c971c2e9fdfd0952d2b0b/jbpm-designer-client/src/main/java/org/jbpm/designer/client/shared/AssignmentData.java#L530-L567 | train |
kiegroup/jbpm-designer | jbpm-designer-backend/src/main/java/org/jbpm/designer/server/diagram/DiagramBuilder.java | DiagramBuilder.parseJson | public static Diagram parseJson(String json,
Boolean keepGlossaryLink) throws JSONException {
JSONObject modelJSON = new JSONObject(json);
return parseJson(modelJSON,
keepGlossaryLink);
} | java | public static Diagram parseJson(String json,
Boolean keepGlossaryLink) throws JSONException {
JSONObject modelJSON = new JSONObject(json);
return parseJson(modelJSON,
keepGlossaryLink);
} | [
"public",
"static",
"Diagram",
"parseJson",
"(",
"String",
"json",
",",
"Boolean",
"keepGlossaryLink",
")",
"throws",
"JSONException",
"{",
"JSONObject",
"modelJSON",
"=",
"new",
"JSONObject",
"(",
"json",
")",
";",
"return",
"parseJson",
"(",
"modelJSON",
",",
... | Parse the json string to the diagram model, assumes that the json is
hierarchical ordered
@param json
@return Model with all shapes defined in JSON
@throws org.json.JSONException | [
"Parse",
"the",
"json",
"string",
"to",
"the",
"diagram",
"model",
"assumes",
"that",
"the",
"json",
"is",
"hierarchical",
"ordered"
] | 97b048d06f083a1f831c971c2e9fdfd0952d2b0b | https://github.com/kiegroup/jbpm-designer/blob/97b048d06f083a1f831c971c2e9fdfd0952d2b0b/jbpm-designer-backend/src/main/java/org/jbpm/designer/server/diagram/DiagramBuilder.java#L49-L54 | train |
kiegroup/jbpm-designer | jbpm-designer-backend/src/main/java/org/jbpm/designer/server/diagram/DiagramBuilder.java | DiagramBuilder.parseJson | public static Diagram parseJson(JSONObject json,
Boolean keepGlossaryLink) throws JSONException {
ArrayList<Shape> shapes = new ArrayList<Shape>();
HashMap<String, JSONObject> flatJSON = flatRessources(json);
for (String resourceId : flatJSON.keySet()) {
... | java | public static Diagram parseJson(JSONObject json,
Boolean keepGlossaryLink) throws JSONException {
ArrayList<Shape> shapes = new ArrayList<Shape>();
HashMap<String, JSONObject> flatJSON = flatRessources(json);
for (String resourceId : flatJSON.keySet()) {
... | [
"public",
"static",
"Diagram",
"parseJson",
"(",
"JSONObject",
"json",
",",
"Boolean",
"keepGlossaryLink",
")",
"throws",
"JSONException",
"{",
"ArrayList",
"<",
"Shape",
">",
"shapes",
"=",
"new",
"ArrayList",
"<",
"Shape",
">",
"(",
")",
";",
"HashMap",
"<... | do the parsing on an JSONObject, assumes that the json is hierarchical
ordered, so all shapes are reachable over child relations
@param json hierarchical JSON object
@return Model with all shapes defined in JSON
@throws org.json.JSONException | [
"do",
"the",
"parsing",
"on",
"an",
"JSONObject",
"assumes",
"that",
"the",
"json",
"is",
"hierarchical",
"ordered",
"so",
"all",
"shapes",
"are",
"reachable",
"over",
"child",
"relations"
] | 97b048d06f083a1f831c971c2e9fdfd0952d2b0b | https://github.com/kiegroup/jbpm-designer/blob/97b048d06f083a1f831c971c2e9fdfd0952d2b0b/jbpm-designer-backend/src/main/java/org/jbpm/designer/server/diagram/DiagramBuilder.java#L68-L105 | train |
kiegroup/jbpm-designer | jbpm-designer-backend/src/main/java/org/jbpm/designer/server/diagram/DiagramBuilder.java | DiagramBuilder.parseRessource | private static void parseRessource(ArrayList<Shape> shapes,
HashMap<String, JSONObject> flatJSON,
String resourceId,
Boolean keepGlossaryLink)
throws JSONException {
JSONObject modelJ... | java | private static void parseRessource(ArrayList<Shape> shapes,
HashMap<String, JSONObject> flatJSON,
String resourceId,
Boolean keepGlossaryLink)
throws JSONException {
JSONObject modelJ... | [
"private",
"static",
"void",
"parseRessource",
"(",
"ArrayList",
"<",
"Shape",
">",
"shapes",
",",
"HashMap",
"<",
"String",
",",
"JSONObject",
">",
"flatJSON",
",",
"String",
"resourceId",
",",
"Boolean",
"keepGlossaryLink",
")",
"throws",
"JSONException",
"{",... | Parse one resource to a shape object and add it to the shapes array
@param shapes
@param flatJSON
@param resourceId
@throws org.json.JSONException | [
"Parse",
"one",
"resource",
"to",
"a",
"shape",
"object",
"and",
"add",
"it",
"to",
"the",
"shapes",
"array"
] | 97b048d06f083a1f831c971c2e9fdfd0952d2b0b | https://github.com/kiegroup/jbpm-designer/blob/97b048d06f083a1f831c971c2e9fdfd0952d2b0b/jbpm-designer-backend/src/main/java/org/jbpm/designer/server/diagram/DiagramBuilder.java#L114-L142 | train |
kiegroup/jbpm-designer | jbpm-designer-backend/src/main/java/org/jbpm/designer/server/diagram/DiagramBuilder.java | DiagramBuilder.parseStencil | private static void parseStencil(JSONObject modelJSON,
Shape current) throws JSONException {
// get stencil type
if (modelJSON.has("stencil")) {
JSONObject stencil = modelJSON.getJSONObject("stencil");
// TODO other attributes of stencil
... | java | private static void parseStencil(JSONObject modelJSON,
Shape current) throws JSONException {
// get stencil type
if (modelJSON.has("stencil")) {
JSONObject stencil = modelJSON.getJSONObject("stencil");
// TODO other attributes of stencil
... | [
"private",
"static",
"void",
"parseStencil",
"(",
"JSONObject",
"modelJSON",
",",
"Shape",
"current",
")",
"throws",
"JSONException",
"{",
"// get stencil type",
"if",
"(",
"modelJSON",
".",
"has",
"(",
"\"stencil\"",
")",
")",
"{",
"JSONObject",
"stencil",
"=",... | parse the stencil out of a JSONObject and set it to the current shape
@param modelJSON
@param current
@throws org.json.JSONException | [
"parse",
"the",
"stencil",
"out",
"of",
"a",
"JSONObject",
"and",
"set",
"it",
"to",
"the",
"current",
"shape"
] | 97b048d06f083a1f831c971c2e9fdfd0952d2b0b | https://github.com/kiegroup/jbpm-designer/blob/97b048d06f083a1f831c971c2e9fdfd0952d2b0b/jbpm-designer-backend/src/main/java/org/jbpm/designer/server/diagram/DiagramBuilder.java#L150-L162 | train |
kiegroup/jbpm-designer | jbpm-designer-backend/src/main/java/org/jbpm/designer/server/diagram/DiagramBuilder.java | DiagramBuilder.parseStencilSet | private static void parseStencilSet(JSONObject modelJSON,
Diagram current) throws JSONException {
// get stencil type
if (modelJSON.has("stencilset")) {
JSONObject object = modelJSON.getJSONObject("stencilset");
String url = null;
... | java | private static void parseStencilSet(JSONObject modelJSON,
Diagram current) throws JSONException {
// get stencil type
if (modelJSON.has("stencilset")) {
JSONObject object = modelJSON.getJSONObject("stencilset");
String url = null;
... | [
"private",
"static",
"void",
"parseStencilSet",
"(",
"JSONObject",
"modelJSON",
",",
"Diagram",
"current",
")",
"throws",
"JSONException",
"{",
"// get stencil type",
"if",
"(",
"modelJSON",
".",
"has",
"(",
"\"stencilset\"",
")",
")",
"{",
"JSONObject",
"object",... | crates a StencilSet object and add it to the current diagram
@param modelJSON
@param current
@throws org.json.JSONException | [
"crates",
"a",
"StencilSet",
"object",
"and",
"add",
"it",
"to",
"the",
"current",
"diagram"
] | 97b048d06f083a1f831c971c2e9fdfd0952d2b0b | https://github.com/kiegroup/jbpm-designer/blob/97b048d06f083a1f831c971c2e9fdfd0952d2b0b/jbpm-designer-backend/src/main/java/org/jbpm/designer/server/diagram/DiagramBuilder.java#L170-L189 | train |
kiegroup/jbpm-designer | jbpm-designer-backend/src/main/java/org/jbpm/designer/server/diagram/DiagramBuilder.java | DiagramBuilder.parseProperties | @SuppressWarnings("unchecked")
private static void parseProperties(JSONObject modelJSON,
Shape current,
Boolean keepGlossaryLink) throws JSONException {
if (modelJSON.has("properties")) {
JSONObject propsObject = mod... | java | @SuppressWarnings("unchecked")
private static void parseProperties(JSONObject modelJSON,
Shape current,
Boolean keepGlossaryLink) throws JSONException {
if (modelJSON.has("properties")) {
JSONObject propsObject = mod... | [
"@",
"SuppressWarnings",
"(",
"\"unchecked\"",
")",
"private",
"static",
"void",
"parseProperties",
"(",
"JSONObject",
"modelJSON",
",",
"Shape",
"current",
",",
"Boolean",
"keepGlossaryLink",
")",
"throws",
"JSONException",
"{",
"if",
"(",
"modelJSON",
".",
"has"... | create a HashMap form the json properties and add it to the shape
@param modelJSON
@param current
@throws org.json.JSONException | [
"create",
"a",
"HashMap",
"form",
"the",
"json",
"properties",
"and",
"add",
"it",
"to",
"the",
"shape"
] | 97b048d06f083a1f831c971c2e9fdfd0952d2b0b | https://github.com/kiegroup/jbpm-designer/blob/97b048d06f083a1f831c971c2e9fdfd0952d2b0b/jbpm-designer-backend/src/main/java/org/jbpm/designer/server/diagram/DiagramBuilder.java#L197-L229 | train |
kiegroup/jbpm-designer | jbpm-designer-backend/src/main/java/org/jbpm/designer/server/diagram/DiagramBuilder.java | DiagramBuilder.parseSsextensions | private static void parseSsextensions(JSONObject modelJSON,
Diagram current) throws JSONException {
if (modelJSON.has("ssextensions")) {
JSONArray array = modelJSON.getJSONArray("ssextensions");
for (int i = 0; i < array.length(); i++) {
... | java | private static void parseSsextensions(JSONObject modelJSON,
Diagram current) throws JSONException {
if (modelJSON.has("ssextensions")) {
JSONArray array = modelJSON.getJSONArray("ssextensions");
for (int i = 0; i < array.length(); i++) {
... | [
"private",
"static",
"void",
"parseSsextensions",
"(",
"JSONObject",
"modelJSON",
",",
"Diagram",
"current",
")",
"throws",
"JSONException",
"{",
"if",
"(",
"modelJSON",
".",
"has",
"(",
"\"ssextensions\"",
")",
")",
"{",
"JSONArray",
"array",
"=",
"modelJSON",
... | adds all json extension to an diagram
@param modelJSON
@param current
@throws org.json.JSONException | [
"adds",
"all",
"json",
"extension",
"to",
"an",
"diagram"
] | 97b048d06f083a1f831c971c2e9fdfd0952d2b0b | https://github.com/kiegroup/jbpm-designer/blob/97b048d06f083a1f831c971c2e9fdfd0952d2b0b/jbpm-designer-backend/src/main/java/org/jbpm/designer/server/diagram/DiagramBuilder.java#L237-L245 | train |
kiegroup/jbpm-designer | jbpm-designer-backend/src/main/java/org/jbpm/designer/server/diagram/DiagramBuilder.java | DiagramBuilder.parseOutgoings | private static void parseOutgoings(ArrayList<Shape> shapes,
JSONObject modelJSON,
Shape current) throws JSONException {
if (modelJSON.has("outgoing")) {
ArrayList<Shape> outgoings = new ArrayList<Shape>();
JSON... | java | private static void parseOutgoings(ArrayList<Shape> shapes,
JSONObject modelJSON,
Shape current) throws JSONException {
if (modelJSON.has("outgoing")) {
ArrayList<Shape> outgoings = new ArrayList<Shape>();
JSON... | [
"private",
"static",
"void",
"parseOutgoings",
"(",
"ArrayList",
"<",
"Shape",
">",
"shapes",
",",
"JSONObject",
"modelJSON",
",",
"Shape",
"current",
")",
"throws",
"JSONException",
"{",
"if",
"(",
"modelJSON",
".",
"has",
"(",
"\"outgoing\"",
")",
")",
"{"... | parse the outgoings form an json object and add all shape references to
the current shapes, add new shapes to the shape array
@param shapes
@param modelJSON
@param current
@throws org.json.JSONException | [
"parse",
"the",
"outgoings",
"form",
"an",
"json",
"object",
"and",
"add",
"all",
"shape",
"references",
"to",
"the",
"current",
"shapes",
"add",
"new",
"shapes",
"to",
"the",
"shape",
"array"
] | 97b048d06f083a1f831c971c2e9fdfd0952d2b0b | https://github.com/kiegroup/jbpm-designer/blob/97b048d06f083a1f831c971c2e9fdfd0952d2b0b/jbpm-designer-backend/src/main/java/org/jbpm/designer/server/diagram/DiagramBuilder.java#L255-L271 | train |
kiegroup/jbpm-designer | jbpm-designer-backend/src/main/java/org/jbpm/designer/server/diagram/DiagramBuilder.java | DiagramBuilder.parseChildShapes | private static void parseChildShapes(ArrayList<Shape> shapes,
JSONObject modelJSON,
Shape current) throws JSONException {
if (modelJSON.has("childShapes")) {
ArrayList<Shape> childShapes = new ArrayList<Shape>();
... | java | private static void parseChildShapes(ArrayList<Shape> shapes,
JSONObject modelJSON,
Shape current) throws JSONException {
if (modelJSON.has("childShapes")) {
ArrayList<Shape> childShapes = new ArrayList<Shape>();
... | [
"private",
"static",
"void",
"parseChildShapes",
"(",
"ArrayList",
"<",
"Shape",
">",
"shapes",
",",
"JSONObject",
"modelJSON",
",",
"Shape",
"current",
")",
"throws",
"JSONException",
"{",
"if",
"(",
"modelJSON",
".",
"has",
"(",
"\"childShapes\"",
")",
")",
... | creates a shape list containing all child shapes and set it to the
current shape new shape get added to the shape array
@param shapes
@param modelJSON
@param current
@throws org.json.JSONException | [
"creates",
"a",
"shape",
"list",
"containing",
"all",
"child",
"shapes",
"and",
"set",
"it",
"to",
"the",
"current",
"shape",
"new",
"shape",
"get",
"added",
"to",
"the",
"shape",
"array"
] | 97b048d06f083a1f831c971c2e9fdfd0952d2b0b | https://github.com/kiegroup/jbpm-designer/blob/97b048d06f083a1f831c971c2e9fdfd0952d2b0b/jbpm-designer-backend/src/main/java/org/jbpm/designer/server/diagram/DiagramBuilder.java#L281-L300 | train |
kiegroup/jbpm-designer | jbpm-designer-backend/src/main/java/org/jbpm/designer/server/diagram/DiagramBuilder.java | DiagramBuilder.parseDockers | private static void parseDockers(JSONObject modelJSON,
Shape current) throws JSONException {
if (modelJSON.has("dockers")) {
ArrayList<Point> dockers = new ArrayList<Point>();
JSONArray dockersObject = modelJSON.getJSONArray("dockers");
f... | java | private static void parseDockers(JSONObject modelJSON,
Shape current) throws JSONException {
if (modelJSON.has("dockers")) {
ArrayList<Point> dockers = new ArrayList<Point>();
JSONArray dockersObject = modelJSON.getJSONArray("dockers");
f... | [
"private",
"static",
"void",
"parseDockers",
"(",
"JSONObject",
"modelJSON",
",",
"Shape",
"current",
")",
"throws",
"JSONException",
"{",
"if",
"(",
"modelJSON",
".",
"has",
"(",
"\"dockers\"",
")",
")",
"{",
"ArrayList",
"<",
"Point",
">",
"dockers",
"=",
... | creates a point array of all dockers and add it to the current shape
@param modelJSON
@param current
@throws org.json.JSONException | [
"creates",
"a",
"point",
"array",
"of",
"all",
"dockers",
"and",
"add",
"it",
"to",
"the",
"current",
"shape"
] | 97b048d06f083a1f831c971c2e9fdfd0952d2b0b | https://github.com/kiegroup/jbpm-designer/blob/97b048d06f083a1f831c971c2e9fdfd0952d2b0b/jbpm-designer-backend/src/main/java/org/jbpm/designer/server/diagram/DiagramBuilder.java#L308-L324 | train |
kiegroup/jbpm-designer | jbpm-designer-backend/src/main/java/org/jbpm/designer/server/diagram/DiagramBuilder.java | DiagramBuilder.parseBounds | private static void parseBounds(JSONObject modelJSON,
Shape current) throws JSONException {
if (modelJSON.has("bounds")) {
JSONObject boundsObject = modelJSON.getJSONObject("bounds");
current.setBounds(new Bounds(new Point(boundsObject.getJSONObject("l... | java | private static void parseBounds(JSONObject modelJSON,
Shape current) throws JSONException {
if (modelJSON.has("bounds")) {
JSONObject boundsObject = modelJSON.getJSONObject("bounds");
current.setBounds(new Bounds(new Point(boundsObject.getJSONObject("l... | [
"private",
"static",
"void",
"parseBounds",
"(",
"JSONObject",
"modelJSON",
",",
"Shape",
"current",
")",
"throws",
"JSONException",
"{",
"if",
"(",
"modelJSON",
".",
"has",
"(",
"\"bounds\"",
")",
")",
"{",
"JSONObject",
"boundsObject",
"=",
"modelJSON",
".",... | creates a bounds object with both point parsed from the json and set it
to the current shape
@param modelJSON
@param current
@throws org.json.JSONException | [
"creates",
"a",
"bounds",
"object",
"with",
"both",
"point",
"parsed",
"from",
"the",
"json",
"and",
"set",
"it",
"to",
"the",
"current",
"shape"
] | 97b048d06f083a1f831c971c2e9fdfd0952d2b0b | https://github.com/kiegroup/jbpm-designer/blob/97b048d06f083a1f831c971c2e9fdfd0952d2b0b/jbpm-designer-backend/src/main/java/org/jbpm/designer/server/diagram/DiagramBuilder.java#L333-L343 | train |
kiegroup/jbpm-designer | jbpm-designer-backend/src/main/java/org/jbpm/designer/server/diagram/DiagramBuilder.java | DiagramBuilder.parseTarget | private static void parseTarget(ArrayList<Shape> shapes,
JSONObject modelJSON,
Shape current) throws JSONException {
if (modelJSON.has("target")) {
JSONObject targetObject = modelJSON.getJSONObject("target");
if (tar... | java | private static void parseTarget(ArrayList<Shape> shapes,
JSONObject modelJSON,
Shape current) throws JSONException {
if (modelJSON.has("target")) {
JSONObject targetObject = modelJSON.getJSONObject("target");
if (tar... | [
"private",
"static",
"void",
"parseTarget",
"(",
"ArrayList",
"<",
"Shape",
">",
"shapes",
",",
"JSONObject",
"modelJSON",
",",
"Shape",
"current",
")",
"throws",
"JSONException",
"{",
"if",
"(",
"modelJSON",
".",
"has",
"(",
"\"target\"",
")",
")",
"{",
"... | parse the target resource and add it to the current shape
@param shapes
@param modelJSON
@param current
@throws org.json.JSONException | [
"parse",
"the",
"target",
"resource",
"and",
"add",
"it",
"to",
"the",
"current",
"shape"
] | 97b048d06f083a1f831c971c2e9fdfd0952d2b0b | https://github.com/kiegroup/jbpm-designer/blob/97b048d06f083a1f831c971c2e9fdfd0952d2b0b/jbpm-designer-backend/src/main/java/org/jbpm/designer/server/diagram/DiagramBuilder.java#L352-L362 | train |
kiegroup/jbpm-designer | jbpm-designer-backend/src/main/java/org/jbpm/designer/server/diagram/DiagramBuilder.java | DiagramBuilder.flatRessources | public static HashMap<String, JSONObject> flatRessources(JSONObject object) throws JSONException {
HashMap<String, JSONObject> result = new HashMap<String, JSONObject>();
// no cycle in hierarchies!!
if (object.has("resourceId") && object.has("childShapes")) {
result.put(object.getS... | java | public static HashMap<String, JSONObject> flatRessources(JSONObject object) throws JSONException {
HashMap<String, JSONObject> result = new HashMap<String, JSONObject>();
// no cycle in hierarchies!!
if (object.has("resourceId") && object.has("childShapes")) {
result.put(object.getS... | [
"public",
"static",
"HashMap",
"<",
"String",
",",
"JSONObject",
">",
"flatRessources",
"(",
"JSONObject",
"object",
")",
"throws",
"JSONException",
"{",
"HashMap",
"<",
"String",
",",
"JSONObject",
">",
"result",
"=",
"new",
"HashMap",
"<",
"String",
",",
"... | Prepare a model JSON for analyze, resolves the hierarchical structure
creates a HashMap which contains all resourceIds as keys and for each key
the JSONObject, all id are keys of this map
@param object
@return a HashMap keys: all ressourceIds values: all child JSONObjects
@throws org.json.JSONException | [
"Prepare",
"a",
"model",
"JSON",
"for",
"analyze",
"resolves",
"the",
"hierarchical",
"structure",
"creates",
"a",
"HashMap",
"which",
"contains",
"all",
"resourceIds",
"as",
"keys",
"and",
"for",
"each",
"key",
"the",
"JSONObject",
"all",
"id",
"are",
"keys",... | 97b048d06f083a1f831c971c2e9fdfd0952d2b0b | https://github.com/kiegroup/jbpm-designer/blob/97b048d06f083a1f831c971c2e9fdfd0952d2b0b/jbpm-designer-backend/src/main/java/org/jbpm/designer/server/diagram/DiagramBuilder.java#L388-L403 | train |
kiegroup/jbpm-designer | jbpm-designer-client/src/main/java/org/jbpm/designer/client/util/DataIOEditorNameTextBox.java | DataIOEditorNameTextBox.setInvalidValues | public void setInvalidValues(final Set<String> invalidValues,
final boolean isCaseSensitive,
final String invalidValueErrorMessage) {
if (isCaseSensitive) {
this.invalidValues = invalidValues;
} else {
this.invalid... | java | public void setInvalidValues(final Set<String> invalidValues,
final boolean isCaseSensitive,
final String invalidValueErrorMessage) {
if (isCaseSensitive) {
this.invalidValues = invalidValues;
} else {
this.invalid... | [
"public",
"void",
"setInvalidValues",
"(",
"final",
"Set",
"<",
"String",
">",
"invalidValues",
",",
"final",
"boolean",
"isCaseSensitive",
",",
"final",
"String",
"invalidValueErrorMessage",
")",
"{",
"if",
"(",
"isCaseSensitive",
")",
"{",
"this",
".",
"invali... | Sets the invalid values for the TextBox
@param invalidValues
@param isCaseSensitive
@param invalidValueErrorMessage | [
"Sets",
"the",
"invalid",
"values",
"for",
"the",
"TextBox"
] | 97b048d06f083a1f831c971c2e9fdfd0952d2b0b | https://github.com/kiegroup/jbpm-designer/blob/97b048d06f083a1f831c971c2e9fdfd0952d2b0b/jbpm-designer-client/src/main/java/org/jbpm/designer/client/util/DataIOEditorNameTextBox.java#L47-L60 | train |
kiegroup/jbpm-designer | jbpm-designer-client/src/main/java/org/jbpm/designer/client/util/DataIOEditorNameTextBox.java | DataIOEditorNameTextBox.setRegExp | public void setRegExp(final String pattern,
final String invalidCharactersInNameErrorMessage,
final String invalidCharacterTypedMessage) {
regExp = RegExp.compile(pattern);
this.invalidCharactersInNameErrorMessage = invalidCharactersInNameErrorMessage;... | java | public void setRegExp(final String pattern,
final String invalidCharactersInNameErrorMessage,
final String invalidCharacterTypedMessage) {
regExp = RegExp.compile(pattern);
this.invalidCharactersInNameErrorMessage = invalidCharactersInNameErrorMessage;... | [
"public",
"void",
"setRegExp",
"(",
"final",
"String",
"pattern",
",",
"final",
"String",
"invalidCharactersInNameErrorMessage",
",",
"final",
"String",
"invalidCharacterTypedMessage",
")",
"{",
"regExp",
"=",
"RegExp",
".",
"compile",
"(",
"pattern",
")",
";",
"t... | Sets the RegExp pattern for the TextBox
@param pattern
@param invalidCharactersInNameErrorMessage | [
"Sets",
"the",
"RegExp",
"pattern",
"for",
"the",
"TextBox"
] | 97b048d06f083a1f831c971c2e9fdfd0952d2b0b | https://github.com/kiegroup/jbpm-designer/blob/97b048d06f083a1f831c971c2e9fdfd0952d2b0b/jbpm-designer-client/src/main/java/org/jbpm/designer/client/util/DataIOEditorNameTextBox.java#L67-L73 | train |
kiegroup/jbpm-designer | jbpm-designer-backend/src/main/java/org/jbpm/designer/server/diagram/Shape.java | Shape.getProperties | public HashMap<String, String> getProperties() {
if (this.properties == null) {
this.properties = new HashMap<String, String>();
}
return properties;
} | java | public HashMap<String, String> getProperties() {
if (this.properties == null) {
this.properties = new HashMap<String, String>();
}
return properties;
} | [
"public",
"HashMap",
"<",
"String",
",",
"String",
">",
"getProperties",
"(",
")",
"{",
"if",
"(",
"this",
".",
"properties",
"==",
"null",
")",
"{",
"this",
".",
"properties",
"=",
"new",
"HashMap",
"<",
"String",
",",
"String",
">",
"(",
")",
";",
... | return a HashMap with all properties, name as key, value as value
@return the properties | [
"return",
"a",
"HashMap",
"with",
"all",
"properties",
"name",
"as",
"key",
"value",
"as",
"value"
] | 97b048d06f083a1f831c971c2e9fdfd0952d2b0b | https://github.com/kiegroup/jbpm-designer/blob/97b048d06f083a1f831c971c2e9fdfd0952d2b0b/jbpm-designer-backend/src/main/java/org/jbpm/designer/server/diagram/Shape.java#L153-L158 | train |
kiegroup/jbpm-designer | jbpm-designer-backend/src/main/java/org/jbpm/designer/server/diagram/Shape.java | Shape.putProperty | public String putProperty(String key,
String value) {
return this.getProperties().put(key,
value);
} | java | public String putProperty(String key,
String value) {
return this.getProperties().put(key,
value);
} | [
"public",
"String",
"putProperty",
"(",
"String",
"key",
",",
"String",
"value",
")",
"{",
"return",
"this",
".",
"getProperties",
"(",
")",
".",
"put",
"(",
"key",
",",
"value",
")",
";",
"}"
] | changes an existing property with the same name, or adds a new one
@param key property name with which the specified value is to be
associated
@param value value to be associated with the specified property name
@return the previous value associated with property name, or null if
there was no mapping for property name.... | [
"changes",
"an",
"existing",
"property",
"with",
"the",
"same",
"name",
"or",
"adds",
"a",
"new",
"one"
] | 97b048d06f083a1f831c971c2e9fdfd0952d2b0b | https://github.com/kiegroup/jbpm-designer/blob/97b048d06f083a1f831c971c2e9fdfd0952d2b0b/jbpm-designer-backend/src/main/java/org/jbpm/designer/server/diagram/Shape.java#L177-L181 | train |
kiegroup/jbpm-designer | jbpm-designer-backend/src/main/java/org/jbpm/designer/web/server/CalledElementServlet.java | CalledElementServlet.getRuleFlowNames | List<String> getRuleFlowNames(HttpServletRequest req) {
final String[] projectAndBranch = getProjectAndBranchNames(req);
// Query RuleFlowGroups for asset project and branch
List<RefactoringPageRow> results = queryService.query(
DesignerFindRuleFlowNamesQuery.NAME,
... | java | List<String> getRuleFlowNames(HttpServletRequest req) {
final String[] projectAndBranch = getProjectAndBranchNames(req);
// Query RuleFlowGroups for asset project and branch
List<RefactoringPageRow> results = queryService.query(
DesignerFindRuleFlowNamesQuery.NAME,
... | [
"List",
"<",
"String",
">",
"getRuleFlowNames",
"(",
"HttpServletRequest",
"req",
")",
"{",
"final",
"String",
"[",
"]",
"projectAndBranch",
"=",
"getProjectAndBranchNames",
"(",
"req",
")",
";",
"// Query RuleFlowGroups for asset project and branch",
"List",
"<",
"Re... | package scope in order to test the method | [
"package",
"scope",
"in",
"order",
"to",
"test",
"the",
"method"
] | 97b048d06f083a1f831c971c2e9fdfd0952d2b0b | https://github.com/kiegroup/jbpm-designer/blob/97b048d06f083a1f831c971c2e9fdfd0952d2b0b/jbpm-designer-backend/src/main/java/org/jbpm/designer/web/server/CalledElementServlet.java#L206-L249 | train |
kiegroup/jbpm-designer | jbpm-designer-backend/src/main/java/org/jbpm/designer/web/plugin/impl/PluginServiceImpl.java | PluginServiceImpl.getLocalPluginsRegistry | public static Map<String, IDiagramPlugin>
getLocalPluginsRegistry(ServletContext context) {
if (LOCAL == null) {
LOCAL = initializeLocalPlugins(context);
}
return LOCAL;
} | java | public static Map<String, IDiagramPlugin>
getLocalPluginsRegistry(ServletContext context) {
if (LOCAL == null) {
LOCAL = initializeLocalPlugins(context);
}
return LOCAL;
} | [
"public",
"static",
"Map",
"<",
"String",
",",
"IDiagramPlugin",
">",
"getLocalPluginsRegistry",
"(",
"ServletContext",
"context",
")",
"{",
"if",
"(",
"LOCAL",
"==",
"null",
")",
"{",
"LOCAL",
"=",
"initializeLocalPlugins",
"(",
"context",
")",
";",
"}",
"r... | Initialize the local plugins registry
@param context the servlet context necessary to grab
the files inside the servlet.
@return the set of local plugins organized by name | [
"Initialize",
"the",
"local",
"plugins",
"registry"
] | 97b048d06f083a1f831c971c2e9fdfd0952d2b0b | https://github.com/kiegroup/jbpm-designer/blob/97b048d06f083a1f831c971c2e9fdfd0952d2b0b/jbpm-designer-backend/src/main/java/org/jbpm/designer/web/plugin/impl/PluginServiceImpl.java#L81-L87 | train |
kiegroup/jbpm-designer | jbpm-designer-backend/src/main/java/org/jbpm/designer/server/diagram/Diagram.java | Diagram.addSsextension | public boolean addSsextension(String ssExt) {
if (this.ssextensions == null) {
this.ssextensions = new ArrayList<String>();
}
return this.ssextensions.add(ssExt);
} | java | public boolean addSsextension(String ssExt) {
if (this.ssextensions == null) {
this.ssextensions = new ArrayList<String>();
}
return this.ssextensions.add(ssExt);
} | [
"public",
"boolean",
"addSsextension",
"(",
"String",
"ssExt",
")",
"{",
"if",
"(",
"this",
".",
"ssextensions",
"==",
"null",
")",
"{",
"this",
".",
"ssextensions",
"=",
"new",
"ArrayList",
"<",
"String",
">",
"(",
")",
";",
"}",
"return",
"this",
"."... | Add an additional SSExtension
@param ssExt the ssextension to set | [
"Add",
"an",
"additional",
"SSExtension"
] | 97b048d06f083a1f831c971c2e9fdfd0952d2b0b | https://github.com/kiegroup/jbpm-designer/blob/97b048d06f083a1f831c971c2e9fdfd0952d2b0b/jbpm-designer-backend/src/main/java/org/jbpm/designer/server/diagram/Diagram.java#L101-L106 | train |
kiegroup/jbpm-designer | jbpm-designer-backend/src/main/java/org/jbpm/designer/server/diagram/JSONBuilder.java | JSONBuilder.parseStencil | private static JSONObject parseStencil(String stencilId) throws JSONException {
JSONObject stencilObject = new JSONObject();
stencilObject.put("id",
stencilId.toString());
return stencilObject;
} | java | private static JSONObject parseStencil(String stencilId) throws JSONException {
JSONObject stencilObject = new JSONObject();
stencilObject.put("id",
stencilId.toString());
return stencilObject;
} | [
"private",
"static",
"JSONObject",
"parseStencil",
"(",
"String",
"stencilId",
")",
"throws",
"JSONException",
"{",
"JSONObject",
"stencilObject",
"=",
"new",
"JSONObject",
"(",
")",
";",
"stencilObject",
".",
"put",
"(",
"\"id\"",
",",
"stencilId",
".",
"toStri... | Delivers the correct JSON Object for the stencilId
@param stencilId
@throws org.json.JSONException | [
"Delivers",
"the",
"correct",
"JSON",
"Object",
"for",
"the",
"stencilId"
] | 97b048d06f083a1f831c971c2e9fdfd0952d2b0b | https://github.com/kiegroup/jbpm-designer/blob/97b048d06f083a1f831c971c2e9fdfd0952d2b0b/jbpm-designer-backend/src/main/java/org/jbpm/designer/server/diagram/JSONBuilder.java#L66-L73 | train |
kiegroup/jbpm-designer | jbpm-designer-backend/src/main/java/org/jbpm/designer/server/diagram/JSONBuilder.java | JSONBuilder.parseChildShapesRecursive | private static JSONArray parseChildShapesRecursive(ArrayList<Shape> childShapes) throws JSONException {
if (childShapes != null) {
JSONArray childShapesArray = new JSONArray();
for (Shape childShape : childShapes) {
JSONObject childShapeObject = new JSONObject();
... | java | private static JSONArray parseChildShapesRecursive(ArrayList<Shape> childShapes) throws JSONException {
if (childShapes != null) {
JSONArray childShapesArray = new JSONArray();
for (Shape childShape : childShapes) {
JSONObject childShapeObject = new JSONObject();
... | [
"private",
"static",
"JSONArray",
"parseChildShapesRecursive",
"(",
"ArrayList",
"<",
"Shape",
">",
"childShapes",
")",
"throws",
"JSONException",
"{",
"if",
"(",
"childShapes",
"!=",
"null",
")",
"{",
"JSONArray",
"childShapesArray",
"=",
"new",
"JSONArray",
"(",... | Parses all child Shapes recursively and adds them to the correct JSON
Object
@param childShapes
@throws org.json.JSONException | [
"Parses",
"all",
"child",
"Shapes",
"recursively",
"and",
"adds",
"them",
"to",
"the",
"correct",
"JSON",
"Object"
] | 97b048d06f083a1f831c971c2e9fdfd0952d2b0b | https://github.com/kiegroup/jbpm-designer/blob/97b048d06f083a1f831c971c2e9fdfd0952d2b0b/jbpm-designer-backend/src/main/java/org/jbpm/designer/server/diagram/JSONBuilder.java#L82-L116 | train |
kiegroup/jbpm-designer | jbpm-designer-backend/src/main/java/org/jbpm/designer/server/diagram/JSONBuilder.java | JSONBuilder.parseTarget | private static JSONObject parseTarget(Shape target) throws JSONException {
JSONObject targetObject = new JSONObject();
targetObject.put("resourceId",
target.getResourceId().toString());
return targetObject;
} | java | private static JSONObject parseTarget(Shape target) throws JSONException {
JSONObject targetObject = new JSONObject();
targetObject.put("resourceId",
target.getResourceId().toString());
return targetObject;
} | [
"private",
"static",
"JSONObject",
"parseTarget",
"(",
"Shape",
"target",
")",
"throws",
"JSONException",
"{",
"JSONObject",
"targetObject",
"=",
"new",
"JSONObject",
"(",
")",
";",
"targetObject",
".",
"put",
"(",
"\"resourceId\"",
",",
"target",
".",
"getResou... | Delivers the correct JSON Object for the target
@param target
@throws org.json.JSONException | [
"Delivers",
"the",
"correct",
"JSON",
"Object",
"for",
"the",
"target"
] | 97b048d06f083a1f831c971c2e9fdfd0952d2b0b | https://github.com/kiegroup/jbpm-designer/blob/97b048d06f083a1f831c971c2e9fdfd0952d2b0b/jbpm-designer-backend/src/main/java/org/jbpm/designer/server/diagram/JSONBuilder.java#L124-L131 | train |
kiegroup/jbpm-designer | jbpm-designer-backend/src/main/java/org/jbpm/designer/server/diagram/JSONBuilder.java | JSONBuilder.parseDockers | private static JSONArray parseDockers(ArrayList<Point> dockers) throws JSONException {
if (dockers != null) {
JSONArray dockersArray = new JSONArray();
for (Point docker : dockers) {
JSONObject dockerObject = new JSONObject();
dockerObject.put("x",
... | java | private static JSONArray parseDockers(ArrayList<Point> dockers) throws JSONException {
if (dockers != null) {
JSONArray dockersArray = new JSONArray();
for (Point docker : dockers) {
JSONObject dockerObject = new JSONObject();
dockerObject.put("x",
... | [
"private",
"static",
"JSONArray",
"parseDockers",
"(",
"ArrayList",
"<",
"Point",
">",
"dockers",
")",
"throws",
"JSONException",
"{",
"if",
"(",
"dockers",
"!=",
"null",
")",
"{",
"JSONArray",
"dockersArray",
"=",
"new",
"JSONArray",
"(",
")",
";",
"for",
... | Delivers the correct JSON Object for the dockers
@param dockers
@throws org.json.JSONException | [
"Delivers",
"the",
"correct",
"JSON",
"Object",
"for",
"the",
"dockers"
] | 97b048d06f083a1f831c971c2e9fdfd0952d2b0b | https://github.com/kiegroup/jbpm-designer/blob/97b048d06f083a1f831c971c2e9fdfd0952d2b0b/jbpm-designer-backend/src/main/java/org/jbpm/designer/server/diagram/JSONBuilder.java#L139-L158 | train |
kiegroup/jbpm-designer | jbpm-designer-backend/src/main/java/org/jbpm/designer/server/diagram/JSONBuilder.java | JSONBuilder.parseOutgoings | private static JSONArray parseOutgoings(ArrayList<Shape> outgoings) throws JSONException {
if (outgoings != null) {
JSONArray outgoingsArray = new JSONArray();
for (Shape outgoing : outgoings) {
JSONObject outgoingObject = new JSONObject();
outgoingObjec... | java | private static JSONArray parseOutgoings(ArrayList<Shape> outgoings) throws JSONException {
if (outgoings != null) {
JSONArray outgoingsArray = new JSONArray();
for (Shape outgoing : outgoings) {
JSONObject outgoingObject = new JSONObject();
outgoingObjec... | [
"private",
"static",
"JSONArray",
"parseOutgoings",
"(",
"ArrayList",
"<",
"Shape",
">",
"outgoings",
")",
"throws",
"JSONException",
"{",
"if",
"(",
"outgoings",
"!=",
"null",
")",
"{",
"JSONArray",
"outgoingsArray",
"=",
"new",
"JSONArray",
"(",
")",
";",
... | Delivers the correct JSON Object for outgoings
@param outgoings
@throws org.json.JSONException | [
"Delivers",
"the",
"correct",
"JSON",
"Object",
"for",
"outgoings"
] | 97b048d06f083a1f831c971c2e9fdfd0952d2b0b | https://github.com/kiegroup/jbpm-designer/blob/97b048d06f083a1f831c971c2e9fdfd0952d2b0b/jbpm-designer-backend/src/main/java/org/jbpm/designer/server/diagram/JSONBuilder.java#L166-L182 | train |
kiegroup/jbpm-designer | jbpm-designer-backend/src/main/java/org/jbpm/designer/server/diagram/JSONBuilder.java | JSONBuilder.parseProperties | private static JSONObject parseProperties(HashMap<String, String> properties) throws JSONException {
if (properties != null) {
JSONObject propertiesObject = new JSONObject();
for (String key : properties.keySet()) {
String propertyValue = properties.get(key);
... | java | private static JSONObject parseProperties(HashMap<String, String> properties) throws JSONException {
if (properties != null) {
JSONObject propertiesObject = new JSONObject();
for (String key : properties.keySet()) {
String propertyValue = properties.get(key);
... | [
"private",
"static",
"JSONObject",
"parseProperties",
"(",
"HashMap",
"<",
"String",
",",
"String",
">",
"properties",
")",
"throws",
"JSONException",
"{",
"if",
"(",
"properties",
"!=",
"null",
")",
"{",
"JSONObject",
"propertiesObject",
"=",
"new",
"JSONObject... | Delivers the correct JSON Object for properties
@param properties
@throws org.json.JSONException | [
"Delivers",
"the",
"correct",
"JSON",
"Object",
"for",
"properties"
] | 97b048d06f083a1f831c971c2e9fdfd0952d2b0b | https://github.com/kiegroup/jbpm-designer/blob/97b048d06f083a1f831c971c2e9fdfd0952d2b0b/jbpm-designer-backend/src/main/java/org/jbpm/designer/server/diagram/JSONBuilder.java#L190-L222 | train |
kiegroup/jbpm-designer | jbpm-designer-backend/src/main/java/org/jbpm/designer/server/diagram/JSONBuilder.java | JSONBuilder.parseStencilSetExtensions | private static JSONArray parseStencilSetExtensions(ArrayList<String> extensions) {
if (extensions != null) {
JSONArray extensionsArray = new JSONArray();
for (String extension : extensions) {
extensionsArray.put(extension.toString());
}
return ex... | java | private static JSONArray parseStencilSetExtensions(ArrayList<String> extensions) {
if (extensions != null) {
JSONArray extensionsArray = new JSONArray();
for (String extension : extensions) {
extensionsArray.put(extension.toString());
}
return ex... | [
"private",
"static",
"JSONArray",
"parseStencilSetExtensions",
"(",
"ArrayList",
"<",
"String",
">",
"extensions",
")",
"{",
"if",
"(",
"extensions",
"!=",
"null",
")",
"{",
"JSONArray",
"extensionsArray",
"=",
"new",
"JSONArray",
"(",
")",
";",
"for",
"(",
... | Delivers the correct JSON Object for the Stencilset Extensions
@param extensions | [
"Delivers",
"the",
"correct",
"JSON",
"Object",
"for",
"the",
"Stencilset",
"Extensions"
] | 97b048d06f083a1f831c971c2e9fdfd0952d2b0b | https://github.com/kiegroup/jbpm-designer/blob/97b048d06f083a1f831c971c2e9fdfd0952d2b0b/jbpm-designer-backend/src/main/java/org/jbpm/designer/server/diagram/JSONBuilder.java#L229-L241 | train |
kiegroup/jbpm-designer | jbpm-designer-backend/src/main/java/org/jbpm/designer/server/diagram/JSONBuilder.java | JSONBuilder.parseStencilSet | private static JSONObject parseStencilSet(StencilSet stencilSet) throws JSONException {
if (stencilSet != null) {
JSONObject stencilSetObject = new JSONObject();
stencilSetObject.put("url",
stencilSet.getUrl().toString());
stencilSetObject.pu... | java | private static JSONObject parseStencilSet(StencilSet stencilSet) throws JSONException {
if (stencilSet != null) {
JSONObject stencilSetObject = new JSONObject();
stencilSetObject.put("url",
stencilSet.getUrl().toString());
stencilSetObject.pu... | [
"private",
"static",
"JSONObject",
"parseStencilSet",
"(",
"StencilSet",
"stencilSet",
")",
"throws",
"JSONException",
"{",
"if",
"(",
"stencilSet",
"!=",
"null",
")",
"{",
"JSONObject",
"stencilSetObject",
"=",
"new",
"JSONObject",
"(",
")",
";",
"stencilSetObjec... | Delivers the correct JSON Object for the Stencilset
@param stencilSet
@throws org.json.JSONException | [
"Delivers",
"the",
"correct",
"JSON",
"Object",
"for",
"the",
"Stencilset"
] | 97b048d06f083a1f831c971c2e9fdfd0952d2b0b | https://github.com/kiegroup/jbpm-designer/blob/97b048d06f083a1f831c971c2e9fdfd0952d2b0b/jbpm-designer-backend/src/main/java/org/jbpm/designer/server/diagram/JSONBuilder.java#L249-L262 | train |
kiegroup/jbpm-designer | jbpm-designer-backend/src/main/java/org/jbpm/designer/server/diagram/JSONBuilder.java | JSONBuilder.parseBounds | private static JSONObject parseBounds(Bounds bounds) throws JSONException {
if (bounds != null) {
JSONObject boundsObject = new JSONObject();
JSONObject lowerRight = new JSONObject();
JSONObject upperLeft = new JSONObject();
lowerRight.put("x",
... | java | private static JSONObject parseBounds(Bounds bounds) throws JSONException {
if (bounds != null) {
JSONObject boundsObject = new JSONObject();
JSONObject lowerRight = new JSONObject();
JSONObject upperLeft = new JSONObject();
lowerRight.put("x",
... | [
"private",
"static",
"JSONObject",
"parseBounds",
"(",
"Bounds",
"bounds",
")",
"throws",
"JSONException",
"{",
"if",
"(",
"bounds",
"!=",
"null",
")",
"{",
"JSONObject",
"boundsObject",
"=",
"new",
"JSONObject",
"(",
")",
";",
"JSONObject",
"lowerRight",
"=",... | Delivers the correct JSON Object for the Bounds
@param bounds
@throws org.json.JSONException | [
"Delivers",
"the",
"correct",
"JSON",
"Object",
"for",
"the",
"Bounds"
] | 97b048d06f083a1f831c971c2e9fdfd0952d2b0b | https://github.com/kiegroup/jbpm-designer/blob/97b048d06f083a1f831c971c2e9fdfd0952d2b0b/jbpm-designer-backend/src/main/java/org/jbpm/designer/server/diagram/JSONBuilder.java#L270-L295 | train |
kiegroup/jbpm-designer | jbpm-designer-client/src/main/java/org/jbpm/designer/client/shared/util/StringUtils.java | StringUtils.createQuotedConstant | public static String createQuotedConstant(String str) {
if (str == null || str.isEmpty()) {
return str;
}
try {
Double.parseDouble(str);
} catch (NumberFormatException nfe) {
return "\"" + str + "\"";
}
return str;
} | java | public static String createQuotedConstant(String str) {
if (str == null || str.isEmpty()) {
return str;
}
try {
Double.parseDouble(str);
} catch (NumberFormatException nfe) {
return "\"" + str + "\"";
}
return str;
} | [
"public",
"static",
"String",
"createQuotedConstant",
"(",
"String",
"str",
")",
"{",
"if",
"(",
"str",
"==",
"null",
"||",
"str",
".",
"isEmpty",
"(",
")",
")",
"{",
"return",
"str",
";",
"}",
"try",
"{",
"Double",
".",
"parseDouble",
"(",
"str",
")... | Puts strings inside quotes and numerics are left as they are.
@param str
@return | [
"Puts",
"strings",
"inside",
"quotes",
"and",
"numerics",
"are",
"left",
"as",
"they",
"are",
"."
] | 97b048d06f083a1f831c971c2e9fdfd0952d2b0b | https://github.com/kiegroup/jbpm-designer/blob/97b048d06f083a1f831c971c2e9fdfd0952d2b0b/jbpm-designer-client/src/main/java/org/jbpm/designer/client/shared/util/StringUtils.java#L31-L41 | train |
kiegroup/jbpm-designer | jbpm-designer-client/src/main/java/org/jbpm/designer/client/shared/util/StringUtils.java | StringUtils.createUnquotedConstant | public static String createUnquotedConstant(String str) {
if (str == null || str.isEmpty()) {
return str;
}
if (str.startsWith("\"")) {
str = str.substring(1);
}
if (str.endsWith("\"")) {
str = str.substring(0,
s... | java | public static String createUnquotedConstant(String str) {
if (str == null || str.isEmpty()) {
return str;
}
if (str.startsWith("\"")) {
str = str.substring(1);
}
if (str.endsWith("\"")) {
str = str.substring(0,
s... | [
"public",
"static",
"String",
"createUnquotedConstant",
"(",
"String",
"str",
")",
"{",
"if",
"(",
"str",
"==",
"null",
"||",
"str",
".",
"isEmpty",
"(",
")",
")",
"{",
"return",
"str",
";",
"}",
"if",
"(",
"str",
".",
"startsWith",
"(",
"\"\\\"\"",
... | Removes double-quotes from around a string
@param str
@return | [
"Removes",
"double",
"-",
"quotes",
"from",
"around",
"a",
"string"
] | 97b048d06f083a1f831c971c2e9fdfd0952d2b0b | https://github.com/kiegroup/jbpm-designer/blob/97b048d06f083a1f831c971c2e9fdfd0952d2b0b/jbpm-designer-client/src/main/java/org/jbpm/designer/client/shared/util/StringUtils.java#L48-L60 | train |
kiegroup/jbpm-designer | jbpm-designer-client/src/main/java/org/jbpm/designer/client/shared/util/StringUtils.java | StringUtils.isQuotedConstant | public static boolean isQuotedConstant(String str) {
if (str == null || str.isEmpty()) {
return false;
}
return (str.startsWith("\"") && str.endsWith("\""));
} | java | public static boolean isQuotedConstant(String str) {
if (str == null || str.isEmpty()) {
return false;
}
return (str.startsWith("\"") && str.endsWith("\""));
} | [
"public",
"static",
"boolean",
"isQuotedConstant",
"(",
"String",
"str",
")",
"{",
"if",
"(",
"str",
"==",
"null",
"||",
"str",
".",
"isEmpty",
"(",
")",
")",
"{",
"return",
"false",
";",
"}",
"return",
"(",
"str",
".",
"startsWith",
"(",
"\"\\\"\"",
... | Returns true if string starts and ends with double-quote
@param str
@return | [
"Returns",
"true",
"if",
"string",
"starts",
"and",
"ends",
"with",
"double",
"-",
"quote"
] | 97b048d06f083a1f831c971c2e9fdfd0952d2b0b | https://github.com/kiegroup/jbpm-designer/blob/97b048d06f083a1f831c971c2e9fdfd0952d2b0b/jbpm-designer-client/src/main/java/org/jbpm/designer/client/shared/util/StringUtils.java#L67-L72 | train |
kiegroup/jbpm-designer | jbpm-designer-client/src/main/java/org/jbpm/designer/client/shared/util/StringUtils.java | StringUtils.urlEncode | public String urlEncode(String s) {
if (s == null || s.isEmpty()) {
return s;
}
return URL.encodeQueryString(s);
} | java | public String urlEncode(String s) {
if (s == null || s.isEmpty()) {
return s;
}
return URL.encodeQueryString(s);
} | [
"public",
"String",
"urlEncode",
"(",
"String",
"s",
")",
"{",
"if",
"(",
"s",
"==",
"null",
"||",
"s",
".",
"isEmpty",
"(",
")",
")",
"{",
"return",
"s",
";",
"}",
"return",
"URL",
".",
"encodeQueryString",
"(",
"s",
")",
";",
"}"
] | URLEncode a string
@param s
@return | [
"URLEncode",
"a",
"string"
] | 97b048d06f083a1f831c971c2e9fdfd0952d2b0b | https://github.com/kiegroup/jbpm-designer/blob/97b048d06f083a1f831c971c2e9fdfd0952d2b0b/jbpm-designer-client/src/main/java/org/jbpm/designer/client/shared/util/StringUtils.java#L79-L85 | train |
kiegroup/jbpm-designer | jbpm-designer-client/src/main/java/org/jbpm/designer/client/shared/util/StringUtils.java | StringUtils.urlDecode | public String urlDecode(String s) {
if (s == null || s.isEmpty()) {
return s;
}
return URL.decodeQueryString(s);
} | java | public String urlDecode(String s) {
if (s == null || s.isEmpty()) {
return s;
}
return URL.decodeQueryString(s);
} | [
"public",
"String",
"urlDecode",
"(",
"String",
"s",
")",
"{",
"if",
"(",
"s",
"==",
"null",
"||",
"s",
".",
"isEmpty",
"(",
")",
")",
"{",
"return",
"s",
";",
"}",
"return",
"URL",
".",
"decodeQueryString",
"(",
"s",
")",
";",
"}"
] | URLDecode a string
@param s
@return | [
"URLDecode",
"a",
"string"
] | 97b048d06f083a1f831c971c2e9fdfd0952d2b0b | https://github.com/kiegroup/jbpm-designer/blob/97b048d06f083a1f831c971c2e9fdfd0952d2b0b/jbpm-designer-client/src/main/java/org/jbpm/designer/client/shared/util/StringUtils.java#L92-L97 | train |
kiegroup/jbpm-designer | jbpm-designer-backend/src/main/java/org/jbpm/designer/bpmn2/impl/Bpmn2JsonUnmarshaller.java | Bpmn2JsonUnmarshaller.unmarshall | private Bpmn2Resource unmarshall(JsonParser parser,
String preProcessingData) throws IOException {
try {
parser.nextToken(); // open the object
ResourceSet rSet = new ResourceSetImpl();
rSet.getResourceFactoryRegistry().getExtensionToFacto... | java | private Bpmn2Resource unmarshall(JsonParser parser,
String preProcessingData) throws IOException {
try {
parser.nextToken(); // open the object
ResourceSet rSet = new ResourceSetImpl();
rSet.getResourceFactoryRegistry().getExtensionToFacto... | [
"private",
"Bpmn2Resource",
"unmarshall",
"(",
"JsonParser",
"parser",
",",
"String",
"preProcessingData",
")",
"throws",
"IOException",
"{",
"try",
"{",
"parser",
".",
"nextToken",
"(",
")",
";",
"// open the object",
"ResourceSet",
"rSet",
"=",
"new",
"ResourceS... | Start unmarshalling using the parser.
@param parser
@param preProcessingData
@return the root element of a bpmn2 document.
@throws java.io.IOException | [
"Start",
"unmarshalling",
"using",
"the",
"parser",
"."
] | 97b048d06f083a1f831c971c2e9fdfd0952d2b0b | https://github.com/kiegroup/jbpm-designer/blob/97b048d06f083a1f831c971c2e9fdfd0952d2b0b/jbpm-designer-backend/src/main/java/org/jbpm/designer/bpmn2/impl/Bpmn2JsonUnmarshaller.java#L274-L338 | train |
kiegroup/jbpm-designer | jbpm-designer-backend/src/main/java/org/jbpm/designer/bpmn2/impl/Bpmn2JsonUnmarshaller.java | Bpmn2JsonUnmarshaller.revisitThrowEvents | public void revisitThrowEvents(Definitions def) {
List<RootElement> rootElements = def.getRootElements();
List<Signal> toAddSignals = new ArrayList<Signal>();
Set<Error> toAddErrors = new HashSet<Error>();
Set<Escalation> toAddEscalations = new HashSet<Escalation>();
Set<Message>... | java | public void revisitThrowEvents(Definitions def) {
List<RootElement> rootElements = def.getRootElements();
List<Signal> toAddSignals = new ArrayList<Signal>();
Set<Error> toAddErrors = new HashSet<Error>();
Set<Escalation> toAddEscalations = new HashSet<Escalation>();
Set<Message>... | [
"public",
"void",
"revisitThrowEvents",
"(",
"Definitions",
"def",
")",
"{",
"List",
"<",
"RootElement",
">",
"rootElements",
"=",
"def",
".",
"getRootElements",
"(",
")",
";",
"List",
"<",
"Signal",
">",
"toAddSignals",
"=",
"new",
"ArrayList",
"<",
"Signal... | Updates event definitions for all throwing events.
@param def Definitions | [
"Updates",
"event",
"definitions",
"for",
"all",
"throwing",
"events",
"."
] | 97b048d06f083a1f831c971c2e9fdfd0952d2b0b | https://github.com/kiegroup/jbpm-designer/blob/97b048d06f083a1f831c971c2e9fdfd0952d2b0b/jbpm-designer-backend/src/main/java/org/jbpm/designer/bpmn2/impl/Bpmn2JsonUnmarshaller.java#L1704-L1748 | train |
kiegroup/jbpm-designer | jbpm-designer-backend/src/main/java/org/jbpm/designer/bpmn2/impl/Bpmn2JsonUnmarshaller.java | Bpmn2JsonUnmarshaller.revisitGateways | private void revisitGateways(Definitions def) {
List<RootElement> rootElements = def.getRootElements();
for (RootElement root : rootElements) {
if (root instanceof Process) {
setGatewayInfo((Process) root);
}
}
} | java | private void revisitGateways(Definitions def) {
List<RootElement> rootElements = def.getRootElements();
for (RootElement root : rootElements) {
if (root instanceof Process) {
setGatewayInfo((Process) root);
}
}
} | [
"private",
"void",
"revisitGateways",
"(",
"Definitions",
"def",
")",
"{",
"List",
"<",
"RootElement",
">",
"rootElements",
"=",
"def",
".",
"getRootElements",
"(",
")",
";",
"for",
"(",
"RootElement",
"root",
":",
"rootElements",
")",
"{",
"if",
"(",
"roo... | Updates the gatewayDirection attributes of all gateways.
@param def | [
"Updates",
"the",
"gatewayDirection",
"attributes",
"of",
"all",
"gateways",
"."
] | 97b048d06f083a1f831c971c2e9fdfd0952d2b0b | https://github.com/kiegroup/jbpm-designer/blob/97b048d06f083a1f831c971c2e9fdfd0952d2b0b/jbpm-designer-backend/src/main/java/org/jbpm/designer/bpmn2/impl/Bpmn2JsonUnmarshaller.java#L2613-L2620 | train |
kiegroup/jbpm-designer | jbpm-designer-backend/src/main/java/org/jbpm/designer/bpmn2/impl/Bpmn2JsonUnmarshaller.java | Bpmn2JsonUnmarshaller.revisitMessages | private void revisitMessages(Definitions def) {
List<RootElement> rootElements = def.getRootElements();
List<ItemDefinition> toAddDefinitions = new ArrayList<ItemDefinition>();
for (RootElement root : rootElements) {
if (root instanceof Message) {
if (!existsMessageIt... | java | private void revisitMessages(Definitions def) {
List<RootElement> rootElements = def.getRootElements();
List<ItemDefinition> toAddDefinitions = new ArrayList<ItemDefinition>();
for (RootElement root : rootElements) {
if (root instanceof Message) {
if (!existsMessageIt... | [
"private",
"void",
"revisitMessages",
"(",
"Definitions",
"def",
")",
"{",
"List",
"<",
"RootElement",
">",
"rootElements",
"=",
"def",
".",
"getRootElements",
"(",
")",
";",
"List",
"<",
"ItemDefinition",
">",
"toAddDefinitions",
"=",
"new",
"ArrayList",
"<",... | Revisit message to set their item ref to a item definition
@param def Definitions | [
"Revisit",
"message",
"to",
"set",
"their",
"item",
"ref",
"to",
"a",
"item",
"definition"
] | 97b048d06f083a1f831c971c2e9fdfd0952d2b0b | https://github.com/kiegroup/jbpm-designer/blob/97b048d06f083a1f831c971c2e9fdfd0952d2b0b/jbpm-designer-backend/src/main/java/org/jbpm/designer/bpmn2/impl/Bpmn2JsonUnmarshaller.java#L3032-L3049 | train |
kiegroup/jbpm-designer | jbpm-designer-backend/src/main/java/org/jbpm/designer/bpmn2/impl/Bpmn2JsonUnmarshaller.java | Bpmn2JsonUnmarshaller.reconnectFlows | private void reconnectFlows() {
// create the reverse id map:
for (Entry<Object, List<String>> entry : _outgoingFlows.entrySet()) {
for (String flowId : entry.getValue()) {
if (entry.getKey() instanceof SequenceFlow) { // if it is a sequence flow, we can tell its targets
... | java | private void reconnectFlows() {
// create the reverse id map:
for (Entry<Object, List<String>> entry : _outgoingFlows.entrySet()) {
for (String flowId : entry.getValue()) {
if (entry.getKey() instanceof SequenceFlow) { // if it is a sequence flow, we can tell its targets
... | [
"private",
"void",
"reconnectFlows",
"(",
")",
"{",
"// create the reverse id map:",
"for",
"(",
"Entry",
"<",
"Object",
",",
"List",
"<",
"String",
">",
">",
"entry",
":",
"_outgoingFlows",
".",
"entrySet",
"(",
")",
")",
"{",
"for",
"(",
"String",
"flowI... | Reconnect the sequence flows and the flow nodes.
Done after the initial pass so that we have all the target information. | [
"Reconnect",
"the",
"sequence",
"flows",
"and",
"the",
"flow",
"nodes",
".",
"Done",
"after",
"the",
"initial",
"pass",
"so",
"that",
"we",
"have",
"all",
"the",
"target",
"information",
"."
] | 97b048d06f083a1f831c971c2e9fdfd0952d2b0b | https://github.com/kiegroup/jbpm-designer/blob/97b048d06f083a1f831c971c2e9fdfd0952d2b0b/jbpm-designer-backend/src/main/java/org/jbpm/designer/bpmn2/impl/Bpmn2JsonUnmarshaller.java#L3076-L3098 | train |
kiegroup/jbpm-designer | jbpm-designer-backend/src/main/java/org/jbpm/designer/web/server/menu/connector/AbstractConnectorServlet.java | AbstractConnectorServlet.parseRequest | protected void parseRequest(HttpServletRequest request,
HttpServletResponse response) {
requestParams = new HashMap<String, Object>();
listFiles = new ArrayList<FileItemStream>();
listFileStreams = new ArrayList<ByteArrayOutputStream>();
// Parse the requ... | java | protected void parseRequest(HttpServletRequest request,
HttpServletResponse response) {
requestParams = new HashMap<String, Object>();
listFiles = new ArrayList<FileItemStream>();
listFileStreams = new ArrayList<ByteArrayOutputStream>();
// Parse the requ... | [
"protected",
"void",
"parseRequest",
"(",
"HttpServletRequest",
"request",
",",
"HttpServletResponse",
"response",
")",
"{",
"requestParams",
"=",
"new",
"HashMap",
"<",
"String",
",",
"Object",
">",
"(",
")",
";",
"listFiles",
"=",
"new",
"ArrayList",
"<",
"F... | Parse request parameters and files.
@param request
@param response | [
"Parse",
"request",
"parameters",
"and",
"files",
"."
] | 97b048d06f083a1f831c971c2e9fdfd0952d2b0b | https://github.com/kiegroup/jbpm-designer/blob/97b048d06f083a1f831c971c2e9fdfd0952d2b0b/jbpm-designer-backend/src/main/java/org/jbpm/designer/web/server/menu/connector/AbstractConnectorServlet.java#L295-L352 | train |
kiegroup/jbpm-designer | jbpm-designer-backend/src/main/java/org/jbpm/designer/web/server/menu/connector/AbstractConnectorServlet.java | AbstractConnectorServlet.putResponse | protected void putResponse(JSONObject json,
String param,
Object value) {
try {
json.put(param,
value);
} catch (JSONException e) {
logger.error("json write error",
e);
... | java | protected void putResponse(JSONObject json,
String param,
Object value) {
try {
json.put(param,
value);
} catch (JSONException e) {
logger.error("json write error",
e);
... | [
"protected",
"void",
"putResponse",
"(",
"JSONObject",
"json",
",",
"String",
"param",
",",
"Object",
"value",
")",
"{",
"try",
"{",
"json",
".",
"put",
"(",
"param",
",",
"value",
")",
";",
"}",
"catch",
"(",
"JSONException",
"e",
")",
"{",
"logger",
... | Append data to JSON response.
@param param
@param value | [
"Append",
"data",
"to",
"JSON",
"response",
"."
] | 97b048d06f083a1f831c971c2e9fdfd0952d2b0b | https://github.com/kiegroup/jbpm-designer/blob/97b048d06f083a1f831c971c2e9fdfd0952d2b0b/jbpm-designer-backend/src/main/java/org/jbpm/designer/web/server/menu/connector/AbstractConnectorServlet.java#L359-L369 | train |
kiegroup/jbpm-designer | jbpm-designer-client/src/main/java/org/jbpm/designer/client/shared/Variable.java | Variable.deserialize | public static Variable deserialize(String s,
VariableType variableType,
List<String> dataTypes) {
Variable var = new Variable(variableType);
String[] varParts = s.split(":");
if (varParts.length > 0) {
Stri... | java | public static Variable deserialize(String s,
VariableType variableType,
List<String> dataTypes) {
Variable var = new Variable(variableType);
String[] varParts = s.split(":");
if (varParts.length > 0) {
Stri... | [
"public",
"static",
"Variable",
"deserialize",
"(",
"String",
"s",
",",
"VariableType",
"variableType",
",",
"List",
"<",
"String",
">",
"dataTypes",
")",
"{",
"Variable",
"var",
"=",
"new",
"Variable",
"(",
"variableType",
")",
";",
"String",
"[",
"]",
"v... | Deserializes a variable, checking whether the datatype is custom or not
@param s
@param variableType
@param dataTypes
@return | [
"Deserializes",
"a",
"variable",
"checking",
"whether",
"the",
"datatype",
"is",
"custom",
"or",
"not"
] | 97b048d06f083a1f831c971c2e9fdfd0952d2b0b | https://github.com/kiegroup/jbpm-designer/blob/97b048d06f083a1f831c971c2e9fdfd0952d2b0b/jbpm-designer-client/src/main/java/org/jbpm/designer/client/shared/Variable.java#L109-L131 | train |
kiegroup/jbpm-designer | jbpm-designer-client/src/main/java/org/jbpm/designer/client/shared/Variable.java | Variable.deserialize | public static Variable deserialize(String s,
VariableType variableType) {
return deserialize(s,
variableType,
null);
} | java | public static Variable deserialize(String s,
VariableType variableType) {
return deserialize(s,
variableType,
null);
} | [
"public",
"static",
"Variable",
"deserialize",
"(",
"String",
"s",
",",
"VariableType",
"variableType",
")",
"{",
"return",
"deserialize",
"(",
"s",
",",
"variableType",
",",
"null",
")",
";",
"}"
] | Deserializes a variable, NOT checking whether the datatype is custom
@param s
@param variableType
@return | [
"Deserializes",
"a",
"variable",
"NOT",
"checking",
"whether",
"the",
"datatype",
"is",
"custom"
] | 97b048d06f083a1f831c971c2e9fdfd0952d2b0b | https://github.com/kiegroup/jbpm-designer/blob/97b048d06f083a1f831c971c2e9fdfd0952d2b0b/jbpm-designer-client/src/main/java/org/jbpm/designer/client/shared/Variable.java#L139-L144 | train |
kiegroup/jbpm-designer | jbpm-designer-utilities/src/main/java/org/jbpm/designer/utilities/svginline/SvgInline.java | SvgInline.processStencilSet | public void processStencilSet() throws IOException {
StringBuilder stencilSetFileContents = new StringBuilder();
Scanner scanner = null;
try {
scanner = new Scanner(new File(ssInFile),
"UTF-8");
String currentLine = "";
Strin... | java | public void processStencilSet() throws IOException {
StringBuilder stencilSetFileContents = new StringBuilder();
Scanner scanner = null;
try {
scanner = new Scanner(new File(ssInFile),
"UTF-8");
String currentLine = "";
Strin... | [
"public",
"void",
"processStencilSet",
"(",
")",
"throws",
"IOException",
"{",
"StringBuilder",
"stencilSetFileContents",
"=",
"new",
"StringBuilder",
"(",
")",
";",
"Scanner",
"scanner",
"=",
"null",
";",
"try",
"{",
"scanner",
"=",
"new",
"Scanner",
"(",
"ne... | Processes a stencilset template file
@throws IOException | [
"Processes",
"a",
"stencilset",
"template",
"file"
] | 97b048d06f083a1f831c971c2e9fdfd0952d2b0b | https://github.com/kiegroup/jbpm-designer/blob/97b048d06f083a1f831c971c2e9fdfd0952d2b0b/jbpm-designer-utilities/src/main/java/org/jbpm/designer/utilities/svginline/SvgInline.java#L77-L138 | train |
kiegroup/jbpm-designer | jbpm-designer-backend/src/main/java/org/jbpm/designer/web/profile/impl/ProfileServiceImpl.java | ProfileServiceImpl.init | public void init(ServletContext context) {
if (profiles != null) {
for (IDiagramProfile profile : profiles) {
profile.init(context);
_registry.put(profile.getName(),
profile);
}
}
} | java | public void init(ServletContext context) {
if (profiles != null) {
for (IDiagramProfile profile : profiles) {
profile.init(context);
_registry.put(profile.getName(),
profile);
}
}
} | [
"public",
"void",
"init",
"(",
"ServletContext",
"context",
")",
"{",
"if",
"(",
"profiles",
"!=",
"null",
")",
"{",
"for",
"(",
"IDiagramProfile",
"profile",
":",
"profiles",
")",
"{",
"profile",
".",
"init",
"(",
"context",
")",
";",
"_registry",
".",
... | Initialize the service with a context
@param context the servlet context to initialize the profile. | [
"Initialize",
"the",
"service",
"with",
"a",
"context"
] | 97b048d06f083a1f831c971c2e9fdfd0952d2b0b | https://github.com/kiegroup/jbpm-designer/blob/97b048d06f083a1f831c971c2e9fdfd0952d2b0b/jbpm-designer-backend/src/main/java/org/jbpm/designer/web/profile/impl/ProfileServiceImpl.java#L66-L74 | train |
voldemort/voldemort | src/java/voldemort/utils/ReflectUtils.java | ReflectUtils.getPropertyName | public static String getPropertyName(String name) {
if(name != null && (name.startsWith("get") || name.startsWith("set"))) {
StringBuilder b = new StringBuilder(name);
b.delete(0, 3);
b.setCharAt(0, Character.toLowerCase(b.charAt(0)));
return b.toString();
... | java | public static String getPropertyName(String name) {
if(name != null && (name.startsWith("get") || name.startsWith("set"))) {
StringBuilder b = new StringBuilder(name);
b.delete(0, 3);
b.setCharAt(0, Character.toLowerCase(b.charAt(0)));
return b.toString();
... | [
"public",
"static",
"String",
"getPropertyName",
"(",
"String",
"name",
")",
"{",
"if",
"(",
"name",
"!=",
"null",
"&&",
"(",
"name",
".",
"startsWith",
"(",
"\"get\"",
")",
"||",
"name",
".",
"startsWith",
"(",
"\"set\"",
")",
")",
")",
"{",
"StringBu... | Get the property name of a method name. For example the property name of
setSomeValue would be someValue. Names not beginning with set or get are
not changed.
@param name The name to process
@return The property name | [
"Get",
"the",
"property",
"name",
"of",
"a",
"method",
"name",
".",
"For",
"example",
"the",
"property",
"name",
"of",
"setSomeValue",
"would",
"be",
"someValue",
".",
"Names",
"not",
"beginning",
"with",
"set",
"or",
"get",
"are",
"not",
"changed",
"."
] | a7dbdea58032021361680faacf2782cf981c5332 | https://github.com/voldemort/voldemort/blob/a7dbdea58032021361680faacf2782cf981c5332/src/java/voldemort/utils/ReflectUtils.java#L38-L47 | train |
voldemort/voldemort | src/java/voldemort/utils/ReflectUtils.java | ReflectUtils.loadClass | public static Class<?> loadClass(String className) {
try {
return Class.forName(className);
} catch(ClassNotFoundException e) {
throw new IllegalArgumentException(e);
}
} | java | public static Class<?> loadClass(String className) {
try {
return Class.forName(className);
} catch(ClassNotFoundException e) {
throw new IllegalArgumentException(e);
}
} | [
"public",
"static",
"Class",
"<",
"?",
">",
"loadClass",
"(",
"String",
"className",
")",
"{",
"try",
"{",
"return",
"Class",
".",
"forName",
"(",
"className",
")",
";",
"}",
"catch",
"(",
"ClassNotFoundException",
"e",
")",
"{",
"throw",
"new",
"Illegal... | Load the given class using the default constructor
@param className The name of the class
@return The class object | [
"Load",
"the",
"given",
"class",
"using",
"the",
"default",
"constructor"
] | a7dbdea58032021361680faacf2782cf981c5332 | https://github.com/voldemort/voldemort/blob/a7dbdea58032021361680faacf2782cf981c5332/src/java/voldemort/utils/ReflectUtils.java#L55-L61 | train |
voldemort/voldemort | src/java/voldemort/utils/ReflectUtils.java | ReflectUtils.loadClass | public static Class<?> loadClass(String className, ClassLoader cl) {
try {
return Class.forName(className, false, cl);
} catch(ClassNotFoundException e) {
throw new IllegalArgumentException(e);
}
} | java | public static Class<?> loadClass(String className, ClassLoader cl) {
try {
return Class.forName(className, false, cl);
} catch(ClassNotFoundException e) {
throw new IllegalArgumentException(e);
}
} | [
"public",
"static",
"Class",
"<",
"?",
">",
"loadClass",
"(",
"String",
"className",
",",
"ClassLoader",
"cl",
")",
"{",
"try",
"{",
"return",
"Class",
".",
"forName",
"(",
"className",
",",
"false",
",",
"cl",
")",
";",
"}",
"catch",
"(",
"ClassNotFou... | Load the given class using a specific class loader.
@param className The name of the class
@param cl The Class Loader to be used for finding the class.
@return The class object | [
"Load",
"the",
"given",
"class",
"using",
"a",
"specific",
"class",
"loader",
"."
] | a7dbdea58032021361680faacf2782cf981c5332 | https://github.com/voldemort/voldemort/blob/a7dbdea58032021361680faacf2782cf981c5332/src/java/voldemort/utils/ReflectUtils.java#L70-L76 | train |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.