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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
wuman/orientdb-android | core/src/main/java/com/orientechnologies/orient/core/cache/OAbstractRecordCache.java | OAbstractRecordCache.startup | public void startup() {
underlying.startup();
OProfiler.getInstance().registerHookValue(profilerPrefix + "enabled", new OProfilerHookValue() {
public Object getValue() {
return isEnabled();
}
});
OProfiler.getInstance().registerHookValue(profilerPrefix + "current", new OPr... | java | public void startup() {
underlying.startup();
OProfiler.getInstance().registerHookValue(profilerPrefix + "enabled", new OProfilerHookValue() {
public Object getValue() {
return isEnabled();
}
});
OProfiler.getInstance().registerHookValue(profilerPrefix + "current", new OPr... | [
"public",
"void",
"startup",
"(",
")",
"{",
"underlying",
".",
"startup",
"(",
")",
";",
"OProfiler",
".",
"getInstance",
"(",
")",
".",
"registerHookValue",
"(",
"profilerPrefix",
"+",
"\"enabled\"",
",",
"new",
"OProfilerHookValue",
"(",
")",
"{",
"public"... | All operations running at cache initialization stage | [
"All",
"operations",
"running",
"at",
"cache",
"initialization",
"stage"
] | ff9b17e4349f26168b2d0c4facb1a18cbfbe8cf0 | https://github.com/wuman/orientdb-android/blob/ff9b17e4349f26168b2d0c4facb1a18cbfbe8cf0/core/src/main/java/com/orientechnologies/orient/core/cache/OAbstractRecordCache.java#L136-L156 | train |
loldevs/riotapi | spectator/src/main/java/net/boreeas/riotapi/spectator/GameEncryptionData.java | GameEncryptionData.getCipher | public Cipher getCipher() throws GeneralSecurityException {
Cipher cipher = Cipher.getInstance("Blowfish/ECB/PKCS5Padding");
cipher.init(Cipher.DECRYPT_MODE, new SecretKeySpec(key, "Blowfish"));
return cipher;
} | java | public Cipher getCipher() throws GeneralSecurityException {
Cipher cipher = Cipher.getInstance("Blowfish/ECB/PKCS5Padding");
cipher.init(Cipher.DECRYPT_MODE, new SecretKeySpec(key, "Blowfish"));
return cipher;
} | [
"public",
"Cipher",
"getCipher",
"(",
")",
"throws",
"GeneralSecurityException",
"{",
"Cipher",
"cipher",
"=",
"Cipher",
".",
"getInstance",
"(",
"\"Blowfish/ECB/PKCS5Padding\"",
")",
";",
"cipher",
".",
"init",
"(",
"Cipher",
".",
"DECRYPT_MODE",
",",
"new",
"S... | Creates a cipher for decrypting data with the specified key.
@return A Blowfish/ECB/PKCS5Padding cipher in decryption mode.
@throws GeneralSecurityException | [
"Creates",
"a",
"cipher",
"for",
"decrypting",
"data",
"with",
"the",
"specified",
"key",
"."
] | 0b8aac407aa5289845f249024f9732332855544f | https://github.com/loldevs/riotapi/blob/0b8aac407aa5289845f249024f9732332855544f/spectator/src/main/java/net/boreeas/riotapi/spectator/GameEncryptionData.java#L41-L46 | train |
loldevs/riotapi | spectator/src/main/java/net/boreeas/riotapi/spectator/GameEncryptionData.java | GameEncryptionData.getEncryptionCipher | public Cipher getEncryptionCipher() throws GeneralSecurityException {
Cipher cipher = Cipher.getInstance("Blowfish/ECB/PKCS5Padding");
cipher.init(Cipher.ENCRYPT_MODE, new SecretKeySpec(key, "Blowfish"));
return cipher;
} | java | public Cipher getEncryptionCipher() throws GeneralSecurityException {
Cipher cipher = Cipher.getInstance("Blowfish/ECB/PKCS5Padding");
cipher.init(Cipher.ENCRYPT_MODE, new SecretKeySpec(key, "Blowfish"));
return cipher;
} | [
"public",
"Cipher",
"getEncryptionCipher",
"(",
")",
"throws",
"GeneralSecurityException",
"{",
"Cipher",
"cipher",
"=",
"Cipher",
".",
"getInstance",
"(",
"\"Blowfish/ECB/PKCS5Padding\"",
")",
";",
"cipher",
".",
"init",
"(",
"Cipher",
".",
"ENCRYPT_MODE",
",",
"... | Creates a cipher for encrypting data with the specified key.
@return A Blowfish/ECB/PKCS5Padding cipher in encryption mode.
@throws GeneralSecurityException | [
"Creates",
"a",
"cipher",
"for",
"encrypting",
"data",
"with",
"the",
"specified",
"key",
"."
] | 0b8aac407aa5289845f249024f9732332855544f | https://github.com/loldevs/riotapi/blob/0b8aac407aa5289845f249024f9732332855544f/spectator/src/main/java/net/boreeas/riotapi/spectator/GameEncryptionData.java#L53-L58 | train |
wuman/orientdb-android | core/src/main/java/com/orientechnologies/orient/core/sql/OCommandExecutorSQLDropClass.java | OCommandExecutorSQLDropClass.execute | public Object execute(final Map<Object, Object> iArgs) {
if (className == null)
throw new OCommandExecutionException("Cannot execute the command because it has not been parsed yet");
final ODatabaseRecord database = getDatabase();
final OClass oClass = database.getMetadata().getSchema().getClass... | java | public Object execute(final Map<Object, Object> iArgs) {
if (className == null)
throw new OCommandExecutionException("Cannot execute the command because it has not been parsed yet");
final ODatabaseRecord database = getDatabase();
final OClass oClass = database.getMetadata().getSchema().getClass... | [
"public",
"Object",
"execute",
"(",
"final",
"Map",
"<",
"Object",
",",
"Object",
">",
"iArgs",
")",
"{",
"if",
"(",
"className",
"==",
"null",
")",
"throw",
"new",
"OCommandExecutionException",
"(",
"\"Cannot execute the command because it has not been parsed yet\"",... | Execute the DROP CLASS. | [
"Execute",
"the",
"DROP",
"CLASS",
"."
] | ff9b17e4349f26168b2d0c4facb1a18cbfbe8cf0 | https://github.com/wuman/orientdb-android/blob/ff9b17e4349f26168b2d0c4facb1a18cbfbe8cf0/core/src/main/java/com/orientechnologies/orient/core/sql/OCommandExecutorSQLDropClass.java#L77-L118 | train |
wuman/orientdb-android | commons/src/main/java/com/orientechnologies/common/collection/OCompositeKey.java | OCompositeKey.compareTo | public int compareTo(final OCompositeKey otherKey) {
final Iterator<Object> inIter = keys.iterator();
final Iterator<Object> outIter = otherKey.keys.iterator();
while (inIter.hasNext() && outIter.hasNext()) {
final Object inKey = inIter.next();
final Object outKey = outIter.next();
... | java | public int compareTo(final OCompositeKey otherKey) {
final Iterator<Object> inIter = keys.iterator();
final Iterator<Object> outIter = otherKey.keys.iterator();
while (inIter.hasNext() && outIter.hasNext()) {
final Object inKey = inIter.next();
final Object outKey = outIter.next();
... | [
"public",
"int",
"compareTo",
"(",
"final",
"OCompositeKey",
"otherKey",
")",
"{",
"final",
"Iterator",
"<",
"Object",
">",
"inIter",
"=",
"keys",
".",
"iterator",
"(",
")",
";",
"final",
"Iterator",
"<",
"Object",
">",
"outIter",
"=",
"otherKey",
".",
"... | Performs partial comparison of two composite keys.
Two objects will be equal if the common subset of their keys is equal. For example if first object contains two keys and second
contains four keys then only first two keys will be compared.
@param otherKey
Key to compare.
@return a negative integer, zero, or a posit... | [
"Performs",
"partial",
"comparison",
"of",
"two",
"composite",
"keys",
"."
] | ff9b17e4349f26168b2d0c4facb1a18cbfbe8cf0 | https://github.com/wuman/orientdb-android/blob/ff9b17e4349f26168b2d0c4facb1a18cbfbe8cf0/commons/src/main/java/com/orientechnologies/common/collection/OCompositeKey.java#L104-L124 | train |
wuman/orientdb-android | core/src/main/java/com/orientechnologies/orient/core/command/OBasicCommandContext.java | OBasicCommandContext.getVariables | public Map<String, Object> getVariables() {
final HashMap<String, Object> map = new HashMap<String, Object>();
if (inherited != null)
map.putAll(inherited.getVariables());
if (variables != null)
map.putAll(variables);
return map;
} | java | public Map<String, Object> getVariables() {
final HashMap<String, Object> map = new HashMap<String, Object>();
if (inherited != null)
map.putAll(inherited.getVariables());
if (variables != null)
map.putAll(variables);
return map;
} | [
"public",
"Map",
"<",
"String",
",",
"Object",
">",
"getVariables",
"(",
")",
"{",
"final",
"HashMap",
"<",
"String",
",",
"Object",
">",
"map",
"=",
"new",
"HashMap",
"<",
"String",
",",
"Object",
">",
"(",
")",
";",
"if",
"(",
"inherited",
"!=",
... | Returns a read-only map with all the variables. | [
"Returns",
"a",
"read",
"-",
"only",
"map",
"with",
"all",
"the",
"variables",
"."
] | ff9b17e4349f26168b2d0c4facb1a18cbfbe8cf0 | https://github.com/wuman/orientdb-android/blob/ff9b17e4349f26168b2d0c4facb1a18cbfbe8cf0/core/src/main/java/com/orientechnologies/orient/core/command/OBasicCommandContext.java#L46-L53 | train |
dmfs/jdav | src/org/dmfs/dav/rfc4918/PropStat.java | PropStat.getPropertyValue | @SuppressWarnings("unchecked")
public <T> T getPropertyValue(ElementDescriptor<T> property)
{
if (mProperties == null)
{
return null;
}
return (T) mProperties.get(property);
} | java | @SuppressWarnings("unchecked")
public <T> T getPropertyValue(ElementDescriptor<T> property)
{
if (mProperties == null)
{
return null;
}
return (T) mProperties.get(property);
} | [
"@",
"SuppressWarnings",
"(",
"\"unchecked\"",
")",
"public",
"<",
"T",
">",
"T",
"getPropertyValue",
"(",
"ElementDescriptor",
"<",
"T",
">",
"property",
")",
"{",
"if",
"(",
"mProperties",
"==",
"null",
")",
"{",
"return",
"null",
";",
"}",
"return",
"... | Returns the value of a property in this propstat element.
@param property
the {@link XmlElementDescriptor} of the property to return.
@return the value of the property or <code>null</code> if there is no property of this name. | [
"Returns",
"the",
"value",
"of",
"a",
"property",
"in",
"this",
"propstat",
"element",
"."
] | a619d85423210a283b3eb1fba9abda4fdc894969 | https://github.com/dmfs/jdav/blob/a619d85423210a283b3eb1fba9abda4fdc894969/src/org/dmfs/dav/rfc4918/PropStat.java#L185-L193 | train |
dmfs/jdav | src/org/dmfs/dav/rfc4791/MkCalendar.java | MkCalendar.clear | public <T> void clear(ElementDescriptor<T> property)
{
if (mSet != null)
{
mSet.remove(property);
}
} | java | public <T> void clear(ElementDescriptor<T> property)
{
if (mSet != null)
{
mSet.remove(property);
}
} | [
"public",
"<",
"T",
">",
"void",
"clear",
"(",
"ElementDescriptor",
"<",
"T",
">",
"property",
")",
"{",
"if",
"(",
"mSet",
"!=",
"null",
")",
"{",
"mSet",
".",
"remove",
"(",
"property",
")",
";",
"}",
"}"
] | Remove a property from the initial values.
@param property
The {@link ElementDescriptor} of the property. | [
"Remove",
"a",
"property",
"from",
"the",
"initial",
"values",
"."
] | a619d85423210a283b3eb1fba9abda4fdc894969 | https://github.com/dmfs/jdav/blob/a619d85423210a283b3eb1fba9abda4fdc894969/src/org/dmfs/dav/rfc4791/MkCalendar.java#L146-L152 | train |
wuman/orientdb-android | core/src/main/java/com/orientechnologies/orient/core/db/document/ODatabaseDocumentTx.java | ODatabaseDocumentTx.countClass | public long countClass(final String iClassName) {
final OClass cls = getMetadata().getSchema().getClass(iClassName);
if (cls == null)
throw new IllegalArgumentException("Class '" + iClassName + "' not found in database");
return cls.count();
} | java | public long countClass(final String iClassName) {
final OClass cls = getMetadata().getSchema().getClass(iClassName);
if (cls == null)
throw new IllegalArgumentException("Class '" + iClassName + "' not found in database");
return cls.count();
} | [
"public",
"long",
"countClass",
"(",
"final",
"String",
"iClassName",
")",
"{",
"final",
"OClass",
"cls",
"=",
"getMetadata",
"(",
")",
".",
"getSchema",
"(",
")",
".",
"getClass",
"(",
"iClassName",
")",
";",
"if",
"(",
"cls",
"==",
"null",
")",
"thro... | Returns the number of the records of the class iClassName. | [
"Returns",
"the",
"number",
"of",
"the",
"records",
"of",
"the",
"class",
"iClassName",
"."
] | ff9b17e4349f26168b2d0c4facb1a18cbfbe8cf0 | https://github.com/wuman/orientdb-android/blob/ff9b17e4349f26168b2d0c4facb1a18cbfbe8cf0/core/src/main/java/com/orientechnologies/orient/core/db/document/ODatabaseDocumentTx.java#L417-L424 | train |
wuman/orientdb-android | core/src/main/java/com/orientechnologies/orient/core/serialization/serializer/binary/OBinarySerializerFactory.java | OBinarySerializerFactory.getObjectSerializer | public OBinarySerializer<?> getObjectSerializer(final byte identifier) {
OBinarySerializer<?> impl = serializerIdMap.get(identifier);
if (impl == null) {
final Class<? extends OBinarySerializer<?>> cls = serializerClassesIdMap.get(identifier);
if (cls != null)
try {
impl = cl... | java | public OBinarySerializer<?> getObjectSerializer(final byte identifier) {
OBinarySerializer<?> impl = serializerIdMap.get(identifier);
if (impl == null) {
final Class<? extends OBinarySerializer<?>> cls = serializerClassesIdMap.get(identifier);
if (cls != null)
try {
impl = cl... | [
"public",
"OBinarySerializer",
"<",
"?",
">",
"getObjectSerializer",
"(",
"final",
"byte",
"identifier",
")",
"{",
"OBinarySerializer",
"<",
"?",
">",
"impl",
"=",
"serializerIdMap",
".",
"get",
"(",
"identifier",
")",
";",
"if",
"(",
"impl",
"==",
"null",
... | Obtain OBinarySerializer instance by it's id.
@param identifier
is serializes identifier.
@return OBinarySerializer instance. | [
"Obtain",
"OBinarySerializer",
"instance",
"by",
"it",
"s",
"id",
"."
] | ff9b17e4349f26168b2d0c4facb1a18cbfbe8cf0 | https://github.com/wuman/orientdb-android/blob/ff9b17e4349f26168b2d0c4facb1a18cbfbe8cf0/core/src/main/java/com/orientechnologies/orient/core/serialization/serializer/binary/OBinarySerializerFactory.java#L108-L120 | train |
wuman/orientdb-android | core/src/main/java/com/orientechnologies/orient/core/storage/impl/local/ODataLocal.java | ODataLocal.addRecord | public long addRecord(final ORecordId iRid, final byte[] iContent) throws IOException {
if (iContent.length == 0)
// AVOID UNUSEFUL CREATION OF EMPTY RECORD: IT WILL BE CREATED AT FIRST UPDATE
return -1;
final int recordSize = iContent.length + RECORD_FIX_SIZE;
acquireExclusiveLock();... | java | public long addRecord(final ORecordId iRid, final byte[] iContent) throws IOException {
if (iContent.length == 0)
// AVOID UNUSEFUL CREATION OF EMPTY RECORD: IT WILL BE CREATED AT FIRST UPDATE
return -1;
final int recordSize = iContent.length + RECORD_FIX_SIZE;
acquireExclusiveLock();... | [
"public",
"long",
"addRecord",
"(",
"final",
"ORecordId",
"iRid",
",",
"final",
"byte",
"[",
"]",
"iContent",
")",
"throws",
"IOException",
"{",
"if",
"(",
"iContent",
".",
"length",
"==",
"0",
")",
"// AVOID UNUSEFUL CREATION OF EMPTY RECORD: IT WILL BE CREATED AT ... | Add the record content in file.
@param iContent
The content to write
@return The record offset.
@throws IOException | [
"Add",
"the",
"record",
"content",
"in",
"file",
"."
] | ff9b17e4349f26168b2d0c4facb1a18cbfbe8cf0 | https://github.com/wuman/orientdb-android/blob/ff9b17e4349f26168b2d0c4facb1a18cbfbe8cf0/core/src/main/java/com/orientechnologies/orient/core/storage/impl/local/ODataLocal.java#L187-L205 | train |
wuman/orientdb-android | core/src/main/java/com/orientechnologies/orient/core/storage/impl/local/ODataLocal.java | ODataLocal.getRecord | public byte[] getRecord(final long iPosition) throws IOException {
if (iPosition == -1)
return null;
acquireSharedLock();
try {
final long[] pos = getRelativePosition(iPosition);
final OFile file = files[(int) pos[0]];
final int recordSize = file.readInt(pos[1]);
... | java | public byte[] getRecord(final long iPosition) throws IOException {
if (iPosition == -1)
return null;
acquireSharedLock();
try {
final long[] pos = getRelativePosition(iPosition);
final OFile file = files[(int) pos[0]];
final int recordSize = file.readInt(pos[1]);
... | [
"public",
"byte",
"[",
"]",
"getRecord",
"(",
"final",
"long",
"iPosition",
")",
"throws",
"IOException",
"{",
"if",
"(",
"iPosition",
"==",
"-",
"1",
")",
"return",
"null",
";",
"acquireSharedLock",
"(",
")",
";",
"try",
"{",
"final",
"long",
"[",
"]"... | Returns the record content from file.
@throws IOException | [
"Returns",
"the",
"record",
"content",
"from",
"file",
"."
] | ff9b17e4349f26168b2d0c4facb1a18cbfbe8cf0 | https://github.com/wuman/orientdb-android/blob/ff9b17e4349f26168b2d0c4facb1a18cbfbe8cf0/core/src/main/java/com/orientechnologies/orient/core/storage/impl/local/ODataLocal.java#L212-L246 | train |
wuman/orientdb-android | core/src/main/java/com/orientechnologies/orient/core/storage/impl/local/ODataLocal.java | ODataLocal.getRecordSize | public int getRecordSize(final long iPosition) throws IOException {
acquireSharedLock();
try {
final long[] pos = getRelativePosition(iPosition);
final OFile file = files[(int) pos[0]];
return file.readInt(pos[1]);
} finally {
releaseSharedLock();
}
} | java | public int getRecordSize(final long iPosition) throws IOException {
acquireSharedLock();
try {
final long[] pos = getRelativePosition(iPosition);
final OFile file = files[(int) pos[0]];
return file.readInt(pos[1]);
} finally {
releaseSharedLock();
}
} | [
"public",
"int",
"getRecordSize",
"(",
"final",
"long",
"iPosition",
")",
"throws",
"IOException",
"{",
"acquireSharedLock",
"(",
")",
";",
"try",
"{",
"final",
"long",
"[",
"]",
"pos",
"=",
"getRelativePosition",
"(",
"iPosition",
")",
";",
"final",
"OFile"... | Returns the record size.
@throws IOException | [
"Returns",
"the",
"record",
"size",
"."
] | ff9b17e4349f26168b2d0c4facb1a18cbfbe8cf0 | https://github.com/wuman/orientdb-android/blob/ff9b17e4349f26168b2d0c4facb1a18cbfbe8cf0/core/src/main/java/com/orientechnologies/orient/core/storage/impl/local/ODataLocal.java#L253-L265 | train |
wuman/orientdb-android | core/src/main/java/com/orientechnologies/orient/core/storage/impl/local/ODataLocal.java | ODataLocal.setRecord | public long setRecord(final long iPosition, final ORecordId iRid, final byte[] iContent) throws IOException {
acquireExclusiveLock();
try {
long[] pos = getRelativePosition(iPosition);
final OFile file = files[(int) pos[0]];
final int recordSize = file.readInt(pos[1]);
final in... | java | public long setRecord(final long iPosition, final ORecordId iRid, final byte[] iContent) throws IOException {
acquireExclusiveLock();
try {
long[] pos = getRelativePosition(iPosition);
final OFile file = files[(int) pos[0]];
final int recordSize = file.readInt(pos[1]);
final in... | [
"public",
"long",
"setRecord",
"(",
"final",
"long",
"iPosition",
",",
"final",
"ORecordId",
"iRid",
",",
"final",
"byte",
"[",
"]",
"iContent",
")",
"throws",
"IOException",
"{",
"acquireExclusiveLock",
"(",
")",
";",
"try",
"{",
"long",
"[",
"]",
"pos",
... | Set the record content in file.
@param iPosition
The previous record's offset
@param iContent
The content to write
@return The new record offset or the same received as parameter is the old space was reused.
@throws IOException | [
"Set",
"the",
"record",
"content",
"in",
"file",
"."
] | ff9b17e4349f26168b2d0c4facb1a18cbfbe8cf0 | https://github.com/wuman/orientdb-android/blob/ff9b17e4349f26168b2d0c4facb1a18cbfbe8cf0/core/src/main/java/com/orientechnologies/orient/core/storage/impl/local/ODataLocal.java#L292-L333 | train |
wuman/orientdb-android | core/src/main/java/com/orientechnologies/orient/core/storage/impl/local/ODataLocal.java | ODataLocal.getHolesList | public List<ODataHoleInfo> getHolesList() {
acquireSharedLock();
try {
final List<ODataHoleInfo> holes = new ArrayList<ODataHoleInfo>();
final int tot = holeSegment.getHoles();
for (int i = 0; i < tot; ++i) {
final ODataHoleInfo h = holeSegment.getHole(i);
if (h != n... | java | public List<ODataHoleInfo> getHolesList() {
acquireSharedLock();
try {
final List<ODataHoleInfo> holes = new ArrayList<ODataHoleInfo>();
final int tot = holeSegment.getHoles();
for (int i = 0; i < tot; ++i) {
final ODataHoleInfo h = holeSegment.getHole(i);
if (h != n... | [
"public",
"List",
"<",
"ODataHoleInfo",
">",
"getHolesList",
"(",
")",
"{",
"acquireSharedLock",
"(",
")",
";",
"try",
"{",
"final",
"List",
"<",
"ODataHoleInfo",
">",
"holes",
"=",
"new",
"ArrayList",
"<",
"ODataHoleInfo",
">",
"(",
")",
";",
"final",
"... | Returns the list of holes as pair of position & ppos
@throws IOException | [
"Returns",
"the",
"list",
"of",
"holes",
"as",
"pair",
"of",
"position",
"&",
"ppos"
] | ff9b17e4349f26168b2d0c4facb1a18cbfbe8cf0 | https://github.com/wuman/orientdb-android/blob/ff9b17e4349f26168b2d0c4facb1a18cbfbe8cf0/core/src/main/java/com/orientechnologies/orient/core/storage/impl/local/ODataLocal.java#L375-L393 | train |
amsa-code/risky | geo-analyzer/src/main/java/au/gov/amsa/geo/model/Bounds.java | Bounds.betweenLongitudes | private static boolean betweenLongitudes(double topLeftLon, double bottomRightLon, double lon) {
if (topLeftLon <= bottomRightLon)
return lon >= topLeftLon && lon <= bottomRightLon;
else
return lon >= topLeftLon || lon <= bottomRightLon;
} | java | private static boolean betweenLongitudes(double topLeftLon, double bottomRightLon, double lon) {
if (topLeftLon <= bottomRightLon)
return lon >= topLeftLon && lon <= bottomRightLon;
else
return lon >= topLeftLon || lon <= bottomRightLon;
} | [
"private",
"static",
"boolean",
"betweenLongitudes",
"(",
"double",
"topLeftLon",
",",
"double",
"bottomRightLon",
",",
"double",
"lon",
")",
"{",
"if",
"(",
"topLeftLon",
"<=",
"bottomRightLon",
")",
"return",
"lon",
">=",
"topLeftLon",
"&&",
"lon",
"<=",
"bo... | Returns true if and only if lon is between the longitudes topLeftLon and
bottomRightLon.
@param topLeftLon
must be between -180 and 180
@param bottomRightLon
must be between -180 and 180
@param lon
must be between -180 and 180
@return | [
"Returns",
"true",
"if",
"and",
"only",
"if",
"lon",
"is",
"between",
"the",
"longitudes",
"topLeftLon",
"and",
"bottomRightLon",
"."
] | 13649942aeddfdb9210eec072c605bc5d7a6daf3 | https://github.com/amsa-code/risky/blob/13649942aeddfdb9210eec072c605bc5d7a6daf3/geo-analyzer/src/main/java/au/gov/amsa/geo/model/Bounds.java#L68-L73 | train |
dmfs/jdav | src/org/dmfs/dav/rfc4918/Response.java | Response.getPropertyStatus | public int getPropertyStatus(ElementDescriptor<?> descriptor)
{
PropStat propStat = mPropStatByProperty.get(descriptor);
if (propStat == null)
{
return STATUS_NONE;
}
return propStat.getStatusCode();
} | java | public int getPropertyStatus(ElementDescriptor<?> descriptor)
{
PropStat propStat = mPropStatByProperty.get(descriptor);
if (propStat == null)
{
return STATUS_NONE;
}
return propStat.getStatusCode();
} | [
"public",
"int",
"getPropertyStatus",
"(",
"ElementDescriptor",
"<",
"?",
">",
"descriptor",
")",
"{",
"PropStat",
"propStat",
"=",
"mPropStatByProperty",
".",
"get",
"(",
"descriptor",
")",
";",
"if",
"(",
"propStat",
"==",
"null",
")",
"{",
"return",
"STAT... | Return the status of a specific property.
@param descriptor
The {@link XmlElementDescriptor} of the property.
@return The status of the property or {@link #STATUS_NONE} if the property was not found. | [
"Return",
"the",
"status",
"of",
"a",
"specific",
"property",
"."
] | a619d85423210a283b3eb1fba9abda4fdc894969 | https://github.com/dmfs/jdav/blob/a619d85423210a283b3eb1fba9abda4fdc894969/src/org/dmfs/dav/rfc4918/Response.java#L335-L344 | train |
dmfs/jdav | src/org/dmfs/dav/rfc4918/Response.java | Response.getPropertyValue | public <T> T getPropertyValue(ElementDescriptor<T> descriptor)
{
PropStat propStat = mPropStatByProperty.get(descriptor);
if (propStat == null)
{
return null;
}
return propStat.getPropertyValue(descriptor);
} | java | public <T> T getPropertyValue(ElementDescriptor<T> descriptor)
{
PropStat propStat = mPropStatByProperty.get(descriptor);
if (propStat == null)
{
return null;
}
return propStat.getPropertyValue(descriptor);
} | [
"public",
"<",
"T",
">",
"T",
"getPropertyValue",
"(",
"ElementDescriptor",
"<",
"T",
">",
"descriptor",
")",
"{",
"PropStat",
"propStat",
"=",
"mPropStatByProperty",
".",
"get",
"(",
"descriptor",
")",
";",
"if",
"(",
"propStat",
"==",
"null",
")",
"{",
... | Get the value of a specific property.
@param descriptor
The {@link XmlElementDescriptor} of the property to return.
@return The property value, may be <code>null</code> if the property was not present or didn't contain any value (because it had a non-
{@link HttpStatus#OK} status). | [
"Get",
"the",
"value",
"of",
"a",
"specific",
"property",
"."
] | a619d85423210a283b3eb1fba9abda4fdc894969 | https://github.com/dmfs/jdav/blob/a619d85423210a283b3eb1fba9abda4fdc894969/src/org/dmfs/dav/rfc4918/Response.java#L355-L364 | train |
wuman/orientdb-android | core/src/main/java/com/orientechnologies/orient/core/index/OIndexes.java | OIndexes.getFactories | private static synchronized Set<OIndexFactory> getFactories() {
if (FACTORIES == null) {
final Iterator<OIndexFactory> ite = lookupProviderWithOrientClassLoader(OIndexFactory.class,orientClassLoader);
final Set<OIndexFactory> factories = new HashSet<OIndexFactory>();
while (ite.hasNext()) {
factories.a... | java | private static synchronized Set<OIndexFactory> getFactories() {
if (FACTORIES == null) {
final Iterator<OIndexFactory> ite = lookupProviderWithOrientClassLoader(OIndexFactory.class,orientClassLoader);
final Set<OIndexFactory> factories = new HashSet<OIndexFactory>();
while (ite.hasNext()) {
factories.a... | [
"private",
"static",
"synchronized",
"Set",
"<",
"OIndexFactory",
">",
"getFactories",
"(",
")",
"{",
"if",
"(",
"FACTORIES",
"==",
"null",
")",
"{",
"final",
"Iterator",
"<",
"OIndexFactory",
">",
"ite",
"=",
"lookupProviderWithOrientClassLoader",
"(",
"OIndexF... | Cache a set of all factories. we do not use the service loader directly
since it is not concurrent.
@return Set<OIndexFactory> | [
"Cache",
"a",
"set",
"of",
"all",
"factories",
".",
"we",
"do",
"not",
"use",
"the",
"service",
"loader",
"directly",
"since",
"it",
"is",
"not",
"concurrent",
"."
] | ff9b17e4349f26168b2d0c4facb1a18cbfbe8cf0 | https://github.com/wuman/orientdb-android/blob/ff9b17e4349f26168b2d0c4facb1a18cbfbe8cf0/core/src/main/java/com/orientechnologies/orient/core/index/OIndexes.java#L69-L81 | train |
wuman/orientdb-android | core/src/main/java/com/orientechnologies/orient/core/record/ORecordAbstract.java | ORecordAbstract.addListener | public void addListener(final ORecordListener iListener) {
if (_listeners == null)
_listeners = Collections.newSetFromMap(new WeakHashMap<ORecordListener, Boolean>());
_listeners.add(iListener);
} | java | public void addListener(final ORecordListener iListener) {
if (_listeners == null)
_listeners = Collections.newSetFromMap(new WeakHashMap<ORecordListener, Boolean>());
_listeners.add(iListener);
} | [
"public",
"void",
"addListener",
"(",
"final",
"ORecordListener",
"iListener",
")",
"{",
"if",
"(",
"_listeners",
"==",
"null",
")",
"_listeners",
"=",
"Collections",
".",
"newSetFromMap",
"(",
"new",
"WeakHashMap",
"<",
"ORecordListener",
",",
"Boolean",
">",
... | Add a listener to the current document to catch all the supported events.
@see ORecordListener
@param iListener
ODocumentListener implementation | [
"Add",
"a",
"listener",
"to",
"the",
"current",
"document",
"to",
"catch",
"all",
"the",
"supported",
"events",
"."
] | ff9b17e4349f26168b2d0c4facb1a18cbfbe8cf0 | https://github.com/wuman/orientdb-android/blob/ff9b17e4349f26168b2d0c4facb1a18cbfbe8cf0/core/src/main/java/com/orientechnologies/orient/core/record/ORecordAbstract.java#L357-L362 | train |
soi-toolkit/soi-toolkit-mule | tools/soitoolkit-generator/soitoolkit-generator-eclipse-plugin/soitoolkit-generator-plugin/src/org/soitoolkit/tools/generator/plugin/createcomponent/CreateComponentUtil.java | CreateComponentUtil.getComponentProjectName | public static String getComponentProjectName(int componentType, String groupId, String artifactId) {
IModel m = ModelFactory.newModel(groupId, artifactId, null, null, MuleVersionEnum.MAIN_MULE_VERSION, null, null);
String projectFolderName = null;
ComponentEnum compEnum = ComponentEnum.get(componentType);
switc... | java | public static String getComponentProjectName(int componentType, String groupId, String artifactId) {
IModel m = ModelFactory.newModel(groupId, artifactId, null, null, MuleVersionEnum.MAIN_MULE_VERSION, null, null);
String projectFolderName = null;
ComponentEnum compEnum = ComponentEnum.get(componentType);
switc... | [
"public",
"static",
"String",
"getComponentProjectName",
"(",
"int",
"componentType",
",",
"String",
"groupId",
",",
"String",
"artifactId",
")",
"{",
"IModel",
"m",
"=",
"ModelFactory",
".",
"newModel",
"(",
"groupId",
",",
"artifactId",
",",
"null",
",",
"nu... | public static final int IM_SCHEMA_COMPONENT = 3; | [
"public",
"static",
"final",
"int",
"IM_SCHEMA_COMPONENT",
"=",
"3",
";"
] | e891350dbf55e6307be94d193d056bdb785b37d3 | https://github.com/soi-toolkit/soi-toolkit-mule/blob/e891350dbf55e6307be94d193d056bdb785b37d3/tools/soitoolkit-generator/soitoolkit-generator-eclipse-plugin/soitoolkit-generator-plugin/src/org/soitoolkit/tools/generator/plugin/createcomponent/CreateComponentUtil.java#L31-L47 | train |
lightblue-platform/lightblue-migrator | facade/src/main/java/com/redhat/lightblue/migrator/facade/ConsistencyChecker.java | ConsistencyChecker.checkConsistency | protected boolean checkConsistency(Object o1, Object o2) {
return checkConsistency(o1, o2, null, null);
} | java | protected boolean checkConsistency(Object o1, Object o2) {
return checkConsistency(o1, o2, null, null);
} | [
"protected",
"boolean",
"checkConsistency",
"(",
"Object",
"o1",
",",
"Object",
"o2",
")",
"{",
"return",
"checkConsistency",
"(",
"o1",
",",
"o2",
",",
"null",
",",
"null",
")",
";",
"}"
] | convenience method for unit testing | [
"convenience",
"method",
"for",
"unit",
"testing"
] | ec20748557b40d1f7851e1816d1b76dae48d2027 | https://github.com/lightblue-platform/lightblue-migrator/blob/ec20748557b40d1f7851e1816d1b76dae48d2027/facade/src/main/java/com/redhat/lightblue/migrator/facade/ConsistencyChecker.java#L189-L191 | train |
lightblue-platform/lightblue-migrator | facade/src/main/java/com/redhat/lightblue/migrator/facade/ConsistencyChecker.java | ConsistencyChecker.checkConsistency | public boolean checkConsistency(final Object legacyEntity, final Object lightblueEntity, final String methodName, MethodCallStringifier callToLogInCaseOfInconsistency) {
if (legacyEntity == null && lightblueEntity == null) {
return true;
}
if (callToLogInCaseOfInconsistency == null... | java | public boolean checkConsistency(final Object legacyEntity, final Object lightblueEntity, final String methodName, MethodCallStringifier callToLogInCaseOfInconsistency) {
if (legacyEntity == null && lightblueEntity == null) {
return true;
}
if (callToLogInCaseOfInconsistency == null... | [
"public",
"boolean",
"checkConsistency",
"(",
"final",
"Object",
"legacyEntity",
",",
"final",
"Object",
"lightblueEntity",
",",
"final",
"String",
"methodName",
",",
"MethodCallStringifier",
"callToLogInCaseOfInconsistency",
")",
"{",
"if",
"(",
"legacyEntity",
"==",
... | Check that objects are equal using org.skyscreamer.jsonassert library.
@param legacyEntity object returned from legacy call
@param lightblueEntity object returned from lightblue call
@param methodName the method name
@param callToLogInCaseOfInconsistency the call including parameters
@return | [
"Check",
"that",
"objects",
"are",
"equal",
"using",
"org",
".",
"skyscreamer",
".",
"jsonassert",
"library",
"."
] | ec20748557b40d1f7851e1816d1b76dae48d2027 | https://github.com/lightblue-platform/lightblue-migrator/blob/ec20748557b40d1f7851e1816d1b76dae48d2027/facade/src/main/java/com/redhat/lightblue/migrator/facade/ConsistencyChecker.java#L202-L271 | train |
wuman/orientdb-android | core/src/main/java/com/orientechnologies/orient/core/sql/OCommandExecutorSQLInsert.java | OCommandExecutorSQLInsert.execute | public Object execute(final Map<Object, Object> iArgs) {
if (newRecords == null)
throw new OCommandExecutionException("Cannot execute the command because it has not been parsed yet");
final OCommandParameters commandParameters = new OCommandParameters(iArgs);
if (indexName != null) {
fina... | java | public Object execute(final Map<Object, Object> iArgs) {
if (newRecords == null)
throw new OCommandExecutionException("Cannot execute the command because it has not been parsed yet");
final OCommandParameters commandParameters = new OCommandParameters(iArgs);
if (indexName != null) {
fina... | [
"public",
"Object",
"execute",
"(",
"final",
"Map",
"<",
"Object",
",",
"Object",
">",
"iArgs",
")",
"{",
"if",
"(",
"newRecords",
"==",
"null",
")",
"throw",
"new",
"OCommandExecutionException",
"(",
"\"Cannot execute the command because it has not been parsed yet\""... | Execute the INSERT and return the ODocument object created. | [
"Execute",
"the",
"INSERT",
"and",
"return",
"the",
"ODocument",
"object",
"created",
"."
] | ff9b17e4349f26168b2d0c4facb1a18cbfbe8cf0 | https://github.com/wuman/orientdb-android/blob/ff9b17e4349f26168b2d0c4facb1a18cbfbe8cf0/core/src/main/java/com/orientechnologies/orient/core/sql/OCommandExecutorSQLInsert.java#L176-L218 | train |
wuman/orientdb-android | object/src/main/java/com/orientechnologies/orient/object/db/graph/OGraphVertex.java | OGraphVertex.link | @SuppressWarnings("unchecked")
public OGraphEdge link(final OGraphVertex iTargetVertex, final String iClassName) {
if (iTargetVertex == null)
throw new IllegalArgumentException("Missed the target vertex");
// CREATE THE EDGE BETWEEN ME AND THE TARGET
final OGraphEdge edge = new OGraphEdge(database, iCl... | java | @SuppressWarnings("unchecked")
public OGraphEdge link(final OGraphVertex iTargetVertex, final String iClassName) {
if (iTargetVertex == null)
throw new IllegalArgumentException("Missed the target vertex");
// CREATE THE EDGE BETWEEN ME AND THE TARGET
final OGraphEdge edge = new OGraphEdge(database, iCl... | [
"@",
"SuppressWarnings",
"(",
"\"unchecked\"",
")",
"public",
"OGraphEdge",
"link",
"(",
"final",
"OGraphVertex",
"iTargetVertex",
",",
"final",
"String",
"iClassName",
")",
"{",
"if",
"(",
"iTargetVertex",
"==",
"null",
")",
"throw",
"new",
"IllegalArgumentExcept... | Create a link between the current vertex and the target one. The link is of type iClassName.
@param iTargetVertex
Target vertex where to create the connection
@param iClassName
The name of the class to use for the Edge
@return The new edge created | [
"Create",
"a",
"link",
"between",
"the",
"current",
"vertex",
"and",
"the",
"target",
"one",
".",
"The",
"link",
"is",
"of",
"type",
"iClassName",
"."
] | ff9b17e4349f26168b2d0c4facb1a18cbfbe8cf0 | https://github.com/wuman/orientdb-android/blob/ff9b17e4349f26168b2d0c4facb1a18cbfbe8cf0/object/src/main/java/com/orientechnologies/orient/object/db/graph/OGraphVertex.java#L90-L120 | train |
wuman/orientdb-android | object/src/main/java/com/orientechnologies/orient/object/db/graph/OGraphVertex.java | OGraphVertex.unlink | public OGraphVertex unlink(final OGraphVertex iTargetVertex) {
if (iTargetVertex == null)
throw new IllegalArgumentException("Missed the target vertex");
unlink(database, document, iTargetVertex.getDocument());
return this;
} | java | public OGraphVertex unlink(final OGraphVertex iTargetVertex) {
if (iTargetVertex == null)
throw new IllegalArgumentException("Missed the target vertex");
unlink(database, document, iTargetVertex.getDocument());
return this;
} | [
"public",
"OGraphVertex",
"unlink",
"(",
"final",
"OGraphVertex",
"iTargetVertex",
")",
"{",
"if",
"(",
"iTargetVertex",
"==",
"null",
")",
"throw",
"new",
"IllegalArgumentException",
"(",
"\"Missed the target vertex\"",
")",
";",
"unlink",
"(",
"database",
",",
"... | Remove the link between the current vertex and the target one.
@param iTargetVertex
Target vertex where to remove the connection
@return Current vertex (useful for fluent calls) | [
"Remove",
"the",
"link",
"between",
"the",
"current",
"vertex",
"and",
"the",
"target",
"one",
"."
] | ff9b17e4349f26168b2d0c4facb1a18cbfbe8cf0 | https://github.com/wuman/orientdb-android/blob/ff9b17e4349f26168b2d0c4facb1a18cbfbe8cf0/object/src/main/java/com/orientechnologies/orient/object/db/graph/OGraphVertex.java#L140-L147 | train |
wuman/orientdb-android | object/src/main/java/com/orientechnologies/orient/object/db/graph/OGraphVertex.java | OGraphVertex.hasInEdges | public boolean hasInEdges() {
final Set<ODocument> docs = document.field(OGraphDatabase.VERTEX_FIELD_IN);
return docs != null && !docs.isEmpty();
} | java | public boolean hasInEdges() {
final Set<ODocument> docs = document.field(OGraphDatabase.VERTEX_FIELD_IN);
return docs != null && !docs.isEmpty();
} | [
"public",
"boolean",
"hasInEdges",
"(",
")",
"{",
"final",
"Set",
"<",
"ODocument",
">",
"docs",
"=",
"document",
".",
"field",
"(",
"OGraphDatabase",
".",
"VERTEX_FIELD_IN",
")",
";",
"return",
"docs",
"!=",
"null",
"&&",
"!",
"docs",
".",
"isEmpty",
"(... | Returns true if the vertex has at least one incoming edge, otherwise false. | [
"Returns",
"true",
"if",
"the",
"vertex",
"has",
"at",
"least",
"one",
"incoming",
"edge",
"otherwise",
"false",
"."
] | ff9b17e4349f26168b2d0c4facb1a18cbfbe8cf0 | https://github.com/wuman/orientdb-android/blob/ff9b17e4349f26168b2d0c4facb1a18cbfbe8cf0/object/src/main/java/com/orientechnologies/orient/object/db/graph/OGraphVertex.java#L152-L155 | train |
wuman/orientdb-android | object/src/main/java/com/orientechnologies/orient/object/db/graph/OGraphVertex.java | OGraphVertex.hasOutEdges | public boolean hasOutEdges() {
final Set<ODocument> docs = document.field(OGraphDatabase.VERTEX_FIELD_OUT);
return docs != null && !docs.isEmpty();
} | java | public boolean hasOutEdges() {
final Set<ODocument> docs = document.field(OGraphDatabase.VERTEX_FIELD_OUT);
return docs != null && !docs.isEmpty();
} | [
"public",
"boolean",
"hasOutEdges",
"(",
")",
"{",
"final",
"Set",
"<",
"ODocument",
">",
"docs",
"=",
"document",
".",
"field",
"(",
"OGraphDatabase",
".",
"VERTEX_FIELD_OUT",
")",
";",
"return",
"docs",
"!=",
"null",
"&&",
"!",
"docs",
".",
"isEmpty",
... | Returns true if the vertex has at least one outgoing edge, otherwise false. | [
"Returns",
"true",
"if",
"the",
"vertex",
"has",
"at",
"least",
"one",
"outgoing",
"edge",
"otherwise",
"false",
"."
] | ff9b17e4349f26168b2d0c4facb1a18cbfbe8cf0 | https://github.com/wuman/orientdb-android/blob/ff9b17e4349f26168b2d0c4facb1a18cbfbe8cf0/object/src/main/java/com/orientechnologies/orient/object/db/graph/OGraphVertex.java#L160-L163 | train |
wuman/orientdb-android | object/src/main/java/com/orientechnologies/orient/object/db/graph/OGraphVertex.java | OGraphVertex.getInEdges | public Set<OGraphEdge> getInEdges(final String iEdgeLabel) {
Set<OGraphEdge> temp = in != null ? in.get() : null;
if (temp == null) {
if (iEdgeLabel == null)
temp = new HashSet<OGraphEdge>();
in = new SoftReference<Set<OGraphEdge>>(temp);
final Set<Object> docs = document.field(OGraphDatabase... | java | public Set<OGraphEdge> getInEdges(final String iEdgeLabel) {
Set<OGraphEdge> temp = in != null ? in.get() : null;
if (temp == null) {
if (iEdgeLabel == null)
temp = new HashSet<OGraphEdge>();
in = new SoftReference<Set<OGraphEdge>>(temp);
final Set<Object> docs = document.field(OGraphDatabase... | [
"public",
"Set",
"<",
"OGraphEdge",
">",
"getInEdges",
"(",
"final",
"String",
"iEdgeLabel",
")",
"{",
"Set",
"<",
"OGraphEdge",
">",
"temp",
"=",
"in",
"!=",
"null",
"?",
"in",
".",
"get",
"(",
")",
":",
"null",
";",
"if",
"(",
"temp",
"==",
"null... | Returns the incoming edges of current node having the requested label. If there are no edged, then an empty set is returned. | [
"Returns",
"the",
"incoming",
"edges",
"of",
"current",
"node",
"having",
"the",
"requested",
"label",
".",
"If",
"there",
"are",
"no",
"edged",
"then",
"an",
"empty",
"set",
"is",
"returned",
"."
] | ff9b17e4349f26168b2d0c4facb1a18cbfbe8cf0 | https://github.com/wuman/orientdb-android/blob/ff9b17e4349f26168b2d0c4facb1a18cbfbe8cf0/object/src/main/java/com/orientechnologies/orient/object/db/graph/OGraphVertex.java#L175-L206 | train |
wuman/orientdb-android | object/src/main/java/com/orientechnologies/orient/object/db/graph/OGraphVertex.java | OGraphVertex.browseOutEdgesVertexes | @SuppressWarnings("unchecked")
public Set<OGraphVertex> browseOutEdgesVertexes() {
final Set<OGraphVertex> resultset = new HashSet<OGraphVertex>();
Set<OGraphEdge> temp = out != null ? out.get() : null;
if (temp == null) {
final Set<OIdentifiable> docEdges = (Set<OIdentifiable>) document.field(OGraph... | java | @SuppressWarnings("unchecked")
public Set<OGraphVertex> browseOutEdgesVertexes() {
final Set<OGraphVertex> resultset = new HashSet<OGraphVertex>();
Set<OGraphEdge> temp = out != null ? out.get() : null;
if (temp == null) {
final Set<OIdentifiable> docEdges = (Set<OIdentifiable>) document.field(OGraph... | [
"@",
"SuppressWarnings",
"(",
"\"unchecked\"",
")",
"public",
"Set",
"<",
"OGraphVertex",
">",
"browseOutEdgesVertexes",
"(",
")",
"{",
"final",
"Set",
"<",
"OGraphVertex",
">",
"resultset",
"=",
"new",
"HashSet",
"<",
"OGraphVertex",
">",
"(",
")",
";",
"Se... | Returns the set of Vertexes from the outgoing edges. It avoids to unmarshall edges. | [
"Returns",
"the",
"set",
"of",
"Vertexes",
"from",
"the",
"outgoing",
"edges",
".",
"It",
"avoids",
"to",
"unmarshall",
"edges",
"."
] | ff9b17e4349f26168b2d0c4facb1a18cbfbe8cf0 | https://github.com/wuman/orientdb-android/blob/ff9b17e4349f26168b2d0c4facb1a18cbfbe8cf0/object/src/main/java/com/orientechnologies/orient/object/db/graph/OGraphVertex.java#L254-L276 | train |
wuman/orientdb-android | object/src/main/java/com/orientechnologies/orient/object/db/graph/OGraphVertex.java | OGraphVertex.browseInEdgesVertexes | @SuppressWarnings("unchecked")
public Set<OGraphVertex> browseInEdgesVertexes() {
final Set<OGraphVertex> resultset = new HashSet<OGraphVertex>();
Set<OGraphEdge> temp = in != null ? in.get() : null;
if (temp == null) {
final Set<ODocument> docEdges = (Set<ODocument>) document.field(OGraphDatabase.VE... | java | @SuppressWarnings("unchecked")
public Set<OGraphVertex> browseInEdgesVertexes() {
final Set<OGraphVertex> resultset = new HashSet<OGraphVertex>();
Set<OGraphEdge> temp = in != null ? in.get() : null;
if (temp == null) {
final Set<ODocument> docEdges = (Set<ODocument>) document.field(OGraphDatabase.VE... | [
"@",
"SuppressWarnings",
"(",
"\"unchecked\"",
")",
"public",
"Set",
"<",
"OGraphVertex",
">",
"browseInEdgesVertexes",
"(",
")",
"{",
"final",
"Set",
"<",
"OGraphVertex",
">",
"resultset",
"=",
"new",
"HashSet",
"<",
"OGraphVertex",
">",
"(",
")",
";",
"Set... | Returns the set of Vertexes from the incoming edges. It avoids to unmarshall edges. | [
"Returns",
"the",
"set",
"of",
"Vertexes",
"from",
"the",
"incoming",
"edges",
".",
"It",
"avoids",
"to",
"unmarshall",
"edges",
"."
] | ff9b17e4349f26168b2d0c4facb1a18cbfbe8cf0 | https://github.com/wuman/orientdb-android/blob/ff9b17e4349f26168b2d0c4facb1a18cbfbe8cf0/object/src/main/java/com/orientechnologies/orient/object/db/graph/OGraphVertex.java#L281-L302 | train |
wuman/orientdb-android | object/src/main/java/com/orientechnologies/orient/object/db/graph/OGraphVertex.java | OGraphVertex.unlink | public static void unlink(final ODatabaseGraphTx iDatabase, final ODocument iSourceVertex, final ODocument iTargetVertex) {
if (iTargetVertex == null)
throw new IllegalArgumentException("Missed the target vertex");
if (iDatabase.existsUserObjectByRID(iSourceVertex.getIdentity())) {
// WORK ALSO WITH IN ... | java | public static void unlink(final ODatabaseGraphTx iDatabase, final ODocument iSourceVertex, final ODocument iTargetVertex) {
if (iTargetVertex == null)
throw new IllegalArgumentException("Missed the target vertex");
if (iDatabase.existsUserObjectByRID(iSourceVertex.getIdentity())) {
// WORK ALSO WITH IN ... | [
"public",
"static",
"void",
"unlink",
"(",
"final",
"ODatabaseGraphTx",
"iDatabase",
",",
"final",
"ODocument",
"iSourceVertex",
",",
"final",
"ODocument",
"iTargetVertex",
")",
"{",
"if",
"(",
"iTargetVertex",
"==",
"null",
")",
"throw",
"new",
"IllegalArgumentEx... | Unlinks all the edges between iSourceVertex and iTargetVertex
@param iDatabase
@param iSourceVertex
@param iTargetVertex | [
"Unlinks",
"all",
"the",
"edges",
"between",
"iSourceVertex",
"and",
"iTargetVertex"
] | ff9b17e4349f26168b2d0c4facb1a18cbfbe8cf0 | https://github.com/wuman/orientdb-android/blob/ff9b17e4349f26168b2d0c4facb1a18cbfbe8cf0/object/src/main/java/com/orientechnologies/orient/object/db/graph/OGraphVertex.java#L395-L472 | train |
dmfs/jdav | src/org/dmfs/dav/rfc6578/SyncCollection.java | SyncCollection.limitNumberOfResults | public SyncCollection limitNumberOfResults(int limit)
{
if (limit > 0)
{
addLimit(WebDavSearch.NRESULTS, limit);
}
else
{
removeLimit(WebDavSearch.NRESULTS);
}
return this;
} | java | public SyncCollection limitNumberOfResults(int limit)
{
if (limit > 0)
{
addLimit(WebDavSearch.NRESULTS, limit);
}
else
{
removeLimit(WebDavSearch.NRESULTS);
}
return this;
} | [
"public",
"SyncCollection",
"limitNumberOfResults",
"(",
"int",
"limit",
")",
"{",
"if",
"(",
"limit",
">",
"0",
")",
"{",
"addLimit",
"(",
"WebDavSearch",
".",
"NRESULTS",
",",
"limit",
")",
";",
"}",
"else",
"{",
"removeLimit",
"(",
"WebDavSearch",
".",
... | Limit the number of results in the response, if supported by the server. A non-positive value will remove the limit.
<p>
<strong>Note:</strong> At present it's recommended to not use this feature. There are only a few servers that support it and some of them are broken and
may return wrong results.
</p>
@param limit
... | [
"Limit",
"the",
"number",
"of",
"results",
"in",
"the",
"response",
"if",
"supported",
"by",
"the",
"server",
".",
"A",
"non",
"-",
"positive",
"value",
"will",
"remove",
"the",
"limit",
"."
] | a619d85423210a283b3eb1fba9abda4fdc894969 | https://github.com/dmfs/jdav/blob/a619d85423210a283b3eb1fba9abda4fdc894969/src/org/dmfs/dav/rfc6578/SyncCollection.java#L183-L194 | train |
dmfs/jdav | src/org/dmfs/dav/rfc6578/SyncCollection.java | SyncCollection.getNumberOfResultsLimit | public int getNumberOfResultsLimit()
{
if (mLimit == null)
{
return 0;
}
Integer limit = (Integer) mLimit.get(WebDavSearch.NRESULTS);
return limit == null ? 0 : limit;
} | java | public int getNumberOfResultsLimit()
{
if (mLimit == null)
{
return 0;
}
Integer limit = (Integer) mLimit.get(WebDavSearch.NRESULTS);
return limit == null ? 0 : limit;
} | [
"public",
"int",
"getNumberOfResultsLimit",
"(",
")",
"{",
"if",
"(",
"mLimit",
"==",
"null",
")",
"{",
"return",
"0",
";",
"}",
"Integer",
"limit",
"=",
"(",
"Integer",
")",
"mLimit",
".",
"get",
"(",
"WebDavSearch",
".",
"NRESULTS",
")",
";",
"return... | Returns the limit for the number of results in this request.
@return The limit or 0 if there is no limit. | [
"Returns",
"the",
"limit",
"for",
"the",
"number",
"of",
"results",
"in",
"this",
"request",
"."
] | a619d85423210a283b3eb1fba9abda4fdc894969 | https://github.com/dmfs/jdav/blob/a619d85423210a283b3eb1fba9abda4fdc894969/src/org/dmfs/dav/rfc6578/SyncCollection.java#L202-L210 | train |
dmfs/jdav | src/org/dmfs/dav/rfc6578/SyncCollection.java | SyncCollection.addLimit | private <T> void addLimit(ElementDescriptor<T> descriptor, T limit)
{
if (mLimit == null)
{
mLimit = new HashMap<ElementDescriptor<?>, Object>(6);
}
mLimit.put(descriptor, limit);
} | java | private <T> void addLimit(ElementDescriptor<T> descriptor, T limit)
{
if (mLimit == null)
{
mLimit = new HashMap<ElementDescriptor<?>, Object>(6);
}
mLimit.put(descriptor, limit);
} | [
"private",
"<",
"T",
">",
"void",
"addLimit",
"(",
"ElementDescriptor",
"<",
"T",
">",
"descriptor",
",",
"T",
"limit",
")",
"{",
"if",
"(",
"mLimit",
"==",
"null",
")",
"{",
"mLimit",
"=",
"new",
"HashMap",
"<",
"ElementDescriptor",
"<",
"?",
">",
"... | Add a limit to the request.
@param descriptor
The {@link ElementDescriptor} of the limit element.
@param limit
The limit value. | [
"Add",
"a",
"limit",
"to",
"the",
"request",
"."
] | a619d85423210a283b3eb1fba9abda4fdc894969 | https://github.com/dmfs/jdav/blob/a619d85423210a283b3eb1fba9abda4fdc894969/src/org/dmfs/dav/rfc6578/SyncCollection.java#L221-L228 | train |
loldevs/riotapi | spectator/src/main/java/net/boreeas/riotapi/spectator/MappedDataCache.java | MappedDataCache.put | public void put(K k, V v) {
cache.put(k, v);
acquireLock(k).countDown();
} | java | public void put(K k, V v) {
cache.put(k, v);
acquireLock(k).countDown();
} | [
"public",
"void",
"put",
"(",
"K",
"k",
",",
"V",
"v",
")",
"{",
"cache",
".",
"put",
"(",
"k",
",",
"v",
")",
";",
"acquireLock",
"(",
"k",
")",
".",
"countDown",
"(",
")",
";",
"}"
] | Caches the given mapping and releases all waiting locks.
@param k The key to store.
@param v The value to store. | [
"Caches",
"the",
"given",
"mapping",
"and",
"releases",
"all",
"waiting",
"locks",
"."
] | 0b8aac407aa5289845f249024f9732332855544f | https://github.com/loldevs/riotapi/blob/0b8aac407aa5289845f249024f9732332855544f/spectator/src/main/java/net/boreeas/riotapi/spectator/MappedDataCache.java#L56-L59 | train |
loldevs/riotapi | spectator/src/main/java/net/boreeas/riotapi/spectator/MappedDataCache.java | MappedDataCache.get | public V get(K k) throws InterruptedException {
await(k);
return cache.get(k);
} | java | public V get(K k) throws InterruptedException {
await(k);
return cache.get(k);
} | [
"public",
"V",
"get",
"(",
"K",
"k",
")",
"throws",
"InterruptedException",
"{",
"await",
"(",
"k",
")",
";",
"return",
"cache",
".",
"get",
"(",
"k",
")",
";",
"}"
] | Retrieve the value associated with the given key, blocking as long as necessary.
@param k The key.
@return The value associated with the key.
@throws InterruptedException | [
"Retrieve",
"the",
"value",
"associated",
"with",
"the",
"given",
"key",
"blocking",
"as",
"long",
"as",
"necessary",
"."
] | 0b8aac407aa5289845f249024f9732332855544f | https://github.com/loldevs/riotapi/blob/0b8aac407aa5289845f249024f9732332855544f/spectator/src/main/java/net/boreeas/riotapi/spectator/MappedDataCache.java#L67-L70 | train |
loldevs/riotapi | spectator/src/main/java/net/boreeas/riotapi/spectator/MappedDataCache.java | MappedDataCache.get | public V get(K k, long timeout, TimeUnit unit) throws InterruptedException, TimeoutException {
await(k, timeout, unit);
return cache.get(k);
} | java | public V get(K k, long timeout, TimeUnit unit) throws InterruptedException, TimeoutException {
await(k, timeout, unit);
return cache.get(k);
} | [
"public",
"V",
"get",
"(",
"K",
"k",
",",
"long",
"timeout",
",",
"TimeUnit",
"unit",
")",
"throws",
"InterruptedException",
",",
"TimeoutException",
"{",
"await",
"(",
"k",
",",
"timeout",
",",
"unit",
")",
";",
"return",
"cache",
".",
"get",
"(",
"k"... | Retrieve the value associated with the given key, blocking as long as necessary up to the specified maximum.
@param k The key.
@param timeout The length of the timeout.
@param unit The time unit of the timeout.
@return The value associated with the key.
@throws InterruptedException
@throws TimeoutException | [
"Retrieve",
"the",
"value",
"associated",
"with",
"the",
"given",
"key",
"blocking",
"as",
"long",
"as",
"necessary",
"up",
"to",
"the",
"specified",
"maximum",
"."
] | 0b8aac407aa5289845f249024f9732332855544f | https://github.com/loldevs/riotapi/blob/0b8aac407aa5289845f249024f9732332855544f/spectator/src/main/java/net/boreeas/riotapi/spectator/MappedDataCache.java#L81-L85 | train |
loldevs/riotapi | spectator/src/main/java/net/boreeas/riotapi/spectator/MappedDataCache.java | MappedDataCache.await | public void await(K k, long timeout, TimeUnit unit) throws InterruptedException, TimeoutException {
if (!acquireLock(k).await(timeout, unit)) {
throw new TimeoutException("Wait time for retrieving value for key " + k + " exceeded " + timeout + " " + unit);
}
} | java | public void await(K k, long timeout, TimeUnit unit) throws InterruptedException, TimeoutException {
if (!acquireLock(k).await(timeout, unit)) {
throw new TimeoutException("Wait time for retrieving value for key " + k + " exceeded " + timeout + " " + unit);
}
} | [
"public",
"void",
"await",
"(",
"K",
"k",
",",
"long",
"timeout",
",",
"TimeUnit",
"unit",
")",
"throws",
"InterruptedException",
",",
"TimeoutException",
"{",
"if",
"(",
"!",
"acquireLock",
"(",
"k",
")",
".",
"await",
"(",
"timeout",
",",
"unit",
")",
... | Waits until the key has been assigned a value, up to the specified maximum.
@param k THe key to wait for.
@param timeout The maximum time to wait.
@param unit The time unit of the timeout.
@throws InterruptedException
@throws TimeoutException | [
"Waits",
"until",
"the",
"key",
"has",
"been",
"assigned",
"a",
"value",
"up",
"to",
"the",
"specified",
"maximum",
"."
] | 0b8aac407aa5289845f249024f9732332855544f | https://github.com/loldevs/riotapi/blob/0b8aac407aa5289845f249024f9732332855544f/spectator/src/main/java/net/boreeas/riotapi/spectator/MappedDataCache.java#L104-L108 | train |
soi-toolkit/soi-toolkit-mule | commons/components/commons-mule/src/main/java/org/soitoolkit/commons/mule/sftp/SftpUtil.java | SftpUtil.initEndpointDirectories | public static void initEndpointDirectories(MuleContext muleContext, String[] serviceNames, String[] endpointNames) throws Exception {
// Stop all named services (either Flows or services
List<Lifecycle> services = new ArrayList<Lifecycle>();
for (String serviceName : serviceNames) {
try {
Lifecycle servic... | java | public static void initEndpointDirectories(MuleContext muleContext, String[] serviceNames, String[] endpointNames) throws Exception {
// Stop all named services (either Flows or services
List<Lifecycle> services = new ArrayList<Lifecycle>();
for (String serviceName : serviceNames) {
try {
Lifecycle servic... | [
"public",
"static",
"void",
"initEndpointDirectories",
"(",
"MuleContext",
"muleContext",
",",
"String",
"[",
"]",
"serviceNames",
",",
"String",
"[",
"]",
"endpointNames",
")",
"throws",
"Exception",
"{",
"// Stop all named services (either Flows or services",
"List",
... | Initiates a list of sftp-endpoint-directories. Ensures that affected
services are stopped during the initiation.
@param serviceNames
@param endpointNames
@param muleContext
@throws Exception | [
"Initiates",
"a",
"list",
"of",
"sftp",
"-",
"endpoint",
"-",
"directories",
".",
"Ensures",
"that",
"affected",
"services",
"are",
"stopped",
"during",
"the",
"initiation",
"."
] | e891350dbf55e6307be94d193d056bdb785b37d3 | https://github.com/soi-toolkit/soi-toolkit-mule/blob/e891350dbf55e6307be94d193d056bdb785b37d3/commons/components/commons-mule/src/main/java/org/soitoolkit/commons/mule/sftp/SftpUtil.java#L69-L99 | train |
soi-toolkit/soi-toolkit-mule | commons/components/commons-mule/src/main/java/org/soitoolkit/commons/mule/sftp/SftpUtil.java | SftpUtil.getSftpClient | static protected SftpClient getSftpClient(MuleContext muleContext,
String endpointName) throws IOException {
ImmutableEndpoint endpoint = getImmutableEndpoint(muleContext,
endpointName);
try {
SftpClient sftpClient = SftpConnectionFactory.createClient(endpoint);
return sftpClient;
} catch (Excepti... | java | static protected SftpClient getSftpClient(MuleContext muleContext,
String endpointName) throws IOException {
ImmutableEndpoint endpoint = getImmutableEndpoint(muleContext,
endpointName);
try {
SftpClient sftpClient = SftpConnectionFactory.createClient(endpoint);
return sftpClient;
} catch (Excepti... | [
"static",
"protected",
"SftpClient",
"getSftpClient",
"(",
"MuleContext",
"muleContext",
",",
"String",
"endpointName",
")",
"throws",
"IOException",
"{",
"ImmutableEndpoint",
"endpoint",
"=",
"getImmutableEndpoint",
"(",
"muleContext",
",",
"endpointName",
")",
";",
... | Returns a SftpClient that is logged in to the sftp server that the
endpoint is configured against.
@param muleContext
@param endpointName
@return
@throws IOException | [
"Returns",
"a",
"SftpClient",
"that",
"is",
"logged",
"in",
"to",
"the",
"sftp",
"server",
"that",
"the",
"endpoint",
"is",
"configured",
"against",
"."
] | e891350dbf55e6307be94d193d056bdb785b37d3 | https://github.com/soi-toolkit/soi-toolkit-mule/blob/e891350dbf55e6307be94d193d056bdb785b37d3/commons/components/commons-mule/src/main/java/org/soitoolkit/commons/mule/sftp/SftpUtil.java#L208-L244 | train |
soi-toolkit/soi-toolkit-mule | commons/components/commons-mule/src/main/java/org/soitoolkit/commons/mule/sftp/SftpUtil.java | SftpUtil.recursiveDelete | static protected void recursiveDelete(MuleContext muleContext, SftpClient sftpClient, String endpointName, String relativePath) throws IOException {
EndpointURI endpointURI = getImmutableEndpoint(muleContext, endpointName).getEndpointURI();
String path = endpointURI.getPath() + relativePath;
try {
// Ensure t... | java | static protected void recursiveDelete(MuleContext muleContext, SftpClient sftpClient, String endpointName, String relativePath) throws IOException {
EndpointURI endpointURI = getImmutableEndpoint(muleContext, endpointName).getEndpointURI();
String path = endpointURI.getPath() + relativePath;
try {
// Ensure t... | [
"static",
"protected",
"void",
"recursiveDelete",
"(",
"MuleContext",
"muleContext",
",",
"SftpClient",
"sftpClient",
",",
"String",
"endpointName",
",",
"String",
"relativePath",
")",
"throws",
"IOException",
"{",
"EndpointURI",
"endpointURI",
"=",
"getImmutableEndpoin... | Deletes a directory with all its files and sub-directories. The reason it
do a "chmod 700" before the delete is that some tests changes the
permission, and thus we have to restore the right to delete it...
@param muleClient
@param endpointName
@param relativePath
@throws IOException | [
"Deletes",
"a",
"directory",
"with",
"all",
"its",
"files",
"and",
"sub",
"-",
"directories",
".",
"The",
"reason",
"it",
"do",
"a",
"chmod",
"700",
"before",
"the",
"delete",
"is",
"that",
"some",
"tests",
"changes",
"the",
"permission",
"and",
"thus",
... | e891350dbf55e6307be94d193d056bdb785b37d3 | https://github.com/soi-toolkit/soi-toolkit-mule/blob/e891350dbf55e6307be94d193d056bdb785b37d3/commons/components/commons-mule/src/main/java/org/soitoolkit/commons/mule/sftp/SftpUtil.java#L263-L302 | train |
wuman/orientdb-android | core/src/main/java/com/orientechnologies/orient/core/type/tree/OMVRBTreeEntryPersistent.java | OMVRBTreeEntryPersistent.save | public OMVRBTreeEntryPersistent<K, V> save() throws OSerializationException {
if (!dataProvider.isEntryDirty())
return this;
final boolean isNew = dataProvider.getIdentity().isNew();
// FOR EACH NEW LINK, SAVE BEFORE
if (left != null && left.dataProvider.getIdentity().isNew()) {
if... | java | public OMVRBTreeEntryPersistent<K, V> save() throws OSerializationException {
if (!dataProvider.isEntryDirty())
return this;
final boolean isNew = dataProvider.getIdentity().isNew();
// FOR EACH NEW LINK, SAVE BEFORE
if (left != null && left.dataProvider.getIdentity().isNew()) {
if... | [
"public",
"OMVRBTreeEntryPersistent",
"<",
"K",
",",
"V",
">",
"save",
"(",
")",
"throws",
"OSerializationException",
"{",
"if",
"(",
"!",
"dataProvider",
".",
"isEntryDirty",
"(",
")",
")",
"return",
"this",
";",
"final",
"boolean",
"isNew",
"=",
"dataProvi... | Assures that all the links versus parent, left and right are consistent. | [
"Assures",
"that",
"all",
"the",
"links",
"versus",
"parent",
"left",
"and",
"right",
"are",
"consistent",
"."
] | ff9b17e4349f26168b2d0c4facb1a18cbfbe8cf0 | https://github.com/wuman/orientdb-android/blob/ff9b17e4349f26168b2d0c4facb1a18cbfbe8cf0/core/src/main/java/com/orientechnologies/orient/core/type/tree/OMVRBTreeEntryPersistent.java#L156-L201 | train |
wuman/orientdb-android | core/src/main/java/com/orientechnologies/orient/core/type/tree/OMVRBTreeEntryPersistent.java | OMVRBTreeEntryPersistent.delete | public OMVRBTreeEntryPersistent<K, V> delete() throws IOException {
if (dataProvider != null) {
pTree.removeNodeFromMemory(this);
pTree.removeEntry(dataProvider.getIdentity());
// EARLY LOAD LEFT AND DELETE IT RECURSIVELY
if (getLeft() != null)
((OMVRBTreeEntryPersistent<K, V... | java | public OMVRBTreeEntryPersistent<K, V> delete() throws IOException {
if (dataProvider != null) {
pTree.removeNodeFromMemory(this);
pTree.removeEntry(dataProvider.getIdentity());
// EARLY LOAD LEFT AND DELETE IT RECURSIVELY
if (getLeft() != null)
((OMVRBTreeEntryPersistent<K, V... | [
"public",
"OMVRBTreeEntryPersistent",
"<",
"K",
",",
"V",
">",
"delete",
"(",
")",
"throws",
"IOException",
"{",
"if",
"(",
"dataProvider",
"!=",
"null",
")",
"{",
"pTree",
".",
"removeNodeFromMemory",
"(",
"this",
")",
";",
"pTree",
".",
"removeEntry",
"(... | Delete all the nodes recursively. IF they are not loaded in memory, load all the tree.
@throws IOException | [
"Delete",
"all",
"the",
"nodes",
"recursively",
".",
"IF",
"they",
"are",
"not",
"loaded",
"in",
"memory",
"load",
"all",
"the",
"tree",
"."
] | ff9b17e4349f26168b2d0c4facb1a18cbfbe8cf0 | https://github.com/wuman/orientdb-android/blob/ff9b17e4349f26168b2d0c4facb1a18cbfbe8cf0/core/src/main/java/com/orientechnologies/orient/core/type/tree/OMVRBTreeEntryPersistent.java#L208-L228 | train |
wuman/orientdb-android | core/src/main/java/com/orientechnologies/orient/core/type/tree/OMVRBTreeEntryPersistent.java | OMVRBTreeEntryPersistent.disconnect | protected int disconnect(final boolean iForceDirty, final int iLevel) {
if (dataProvider == null)
// DIRTY NODE, JUST REMOVE IT
return 1;
int totalDisconnected = 0;
final ORID rid = dataProvider.getIdentity();
boolean disconnectedFromParent = false;
if (parent != null) {
... | java | protected int disconnect(final boolean iForceDirty, final int iLevel) {
if (dataProvider == null)
// DIRTY NODE, JUST REMOVE IT
return 1;
int totalDisconnected = 0;
final ORID rid = dataProvider.getIdentity();
boolean disconnectedFromParent = false;
if (parent != null) {
... | [
"protected",
"int",
"disconnect",
"(",
"final",
"boolean",
"iForceDirty",
",",
"final",
"int",
"iLevel",
")",
"{",
"if",
"(",
"dataProvider",
"==",
"null",
")",
"// DIRTY NODE, JUST REMOVE IT\r",
"return",
"1",
";",
"int",
"totalDisconnected",
"=",
"0",
";",
"... | Disconnect the current node from others.
@param iForceDirty
Force disconnection also if the record it's dirty
@param iLevel
@return count of nodes that has been disconnected | [
"Disconnect",
"the",
"current",
"node",
"from",
"others",
"."
] | ff9b17e4349f26168b2d0c4facb1a18cbfbe8cf0 | https://github.com/wuman/orientdb-android/blob/ff9b17e4349f26168b2d0c4facb1a18cbfbe8cf0/core/src/main/java/com/orientechnologies/orient/core/type/tree/OMVRBTreeEntryPersistent.java#L238-L312 | train |
wuman/orientdb-android | core/src/main/java/com/orientechnologies/orient/core/type/tree/OMVRBTreeEntryPersistent.java | OMVRBTreeEntryPersistent.setValue | public V setValue(final V iValue) {
V oldValue = getValue();
int index = tree.getPageIndex();
if (dataProvider.setValueAt(index, iValue))
markDirty();
return oldValue;
} | java | public V setValue(final V iValue) {
V oldValue = getValue();
int index = tree.getPageIndex();
if (dataProvider.setValueAt(index, iValue))
markDirty();
return oldValue;
} | [
"public",
"V",
"setValue",
"(",
"final",
"V",
"iValue",
")",
"{",
"V",
"oldValue",
"=",
"getValue",
"(",
")",
";",
"int",
"index",
"=",
"tree",
".",
"getPageIndex",
"(",
")",
";",
"if",
"(",
"dataProvider",
".",
"setValueAt",
"(",
"index",
",",
"iVal... | Invalidate serialized Value associated in order to be re-marshalled on the next node storing. | [
"Invalidate",
"serialized",
"Value",
"associated",
"in",
"order",
"to",
"be",
"re",
"-",
"marshalled",
"on",
"the",
"next",
"node",
"storing",
"."
] | ff9b17e4349f26168b2d0c4facb1a18cbfbe8cf0 | https://github.com/wuman/orientdb-android/blob/ff9b17e4349f26168b2d0c4facb1a18cbfbe8cf0/core/src/main/java/com/orientechnologies/orient/core/type/tree/OMVRBTreeEntryPersistent.java#L551-L559 | train |
wuman/orientdb-android | enterprise/src/main/java/com/orientechnologies/orient/enterprise/channel/binary/OChannelBinaryProtocol.java | OChannelBinaryProtocol.readIdentifiable | public static OIdentifiable readIdentifiable(final OChannelBinaryClient network) throws IOException {
final int classId = network.readShort();
if (classId == RECORD_NULL)
return null;
if (classId == RECORD_RID) {
return network.readRID();
} else {
final ORecordInternal<?> reco... | java | public static OIdentifiable readIdentifiable(final OChannelBinaryClient network) throws IOException {
final int classId = network.readShort();
if (classId == RECORD_NULL)
return null;
if (classId == RECORD_RID) {
return network.readRID();
} else {
final ORecordInternal<?> reco... | [
"public",
"static",
"OIdentifiable",
"readIdentifiable",
"(",
"final",
"OChannelBinaryClient",
"network",
")",
"throws",
"IOException",
"{",
"final",
"int",
"classId",
"=",
"network",
".",
"readShort",
"(",
")",
";",
"if",
"(",
"classId",
"==",
"RECORD_NULL",
")... | SENT AS SHORT AS FIRST PACKET AFTER SOCKET CONNECTION | [
"SENT",
"AS",
"SHORT",
"AS",
"FIRST",
"PACKET",
"AFTER",
"SOCKET",
"CONNECTION"
] | ff9b17e4349f26168b2d0c4facb1a18cbfbe8cf0 | https://github.com/wuman/orientdb-android/blob/ff9b17e4349f26168b2d0c4facb1a18cbfbe8cf0/enterprise/src/main/java/com/orientechnologies/orient/enterprise/channel/binary/OChannelBinaryProtocol.java#L93-L111 | train |
lightblue-platform/lightblue-migrator | migrator/src/main/java/com/redhat/lightblue/migrator/Utils.java | Utils.getDocumentIdMap | public static Map<Identity, JsonNode> getDocumentIdMap(List<JsonNode> list, List<String> identityFields) {
Map<Identity, JsonNode> map = new HashMap<>();
if (list != null) {
LOGGER.debug("Getting doc IDs for {} docs, fields={}", list.size(), identityFields);
for (JsonNode node : ... | java | public static Map<Identity, JsonNode> getDocumentIdMap(List<JsonNode> list, List<String> identityFields) {
Map<Identity, JsonNode> map = new HashMap<>();
if (list != null) {
LOGGER.debug("Getting doc IDs for {} docs, fields={}", list.size(), identityFields);
for (JsonNode node : ... | [
"public",
"static",
"Map",
"<",
"Identity",
",",
"JsonNode",
">",
"getDocumentIdMap",
"(",
"List",
"<",
"JsonNode",
">",
"list",
",",
"List",
"<",
"String",
">",
"identityFields",
")",
"{",
"Map",
"<",
"Identity",
",",
"JsonNode",
">",
"map",
"=",
"new",... | Build an id-doc map from a list of docs | [
"Build",
"an",
"id",
"-",
"doc",
"map",
"from",
"a",
"list",
"of",
"docs"
] | ec20748557b40d1f7851e1816d1b76dae48d2027 | https://github.com/lightblue-platform/lightblue-migrator/blob/ec20748557b40d1f7851e1816d1b76dae48d2027/migrator/src/main/java/com/redhat/lightblue/migrator/Utils.java#L76-L87 | train |
lightblue-platform/lightblue-migrator | migrator/src/main/java/com/redhat/lightblue/migrator/Utils.java | Utils.fastCompareDocs | public static boolean fastCompareDocs(JsonNode sourceDocument, JsonNode destinationDocument, List<String> exclusionPaths, boolean ignoreTimestampMSDiffs) {
try {
JsonDiff diff = new JsonDiff();
diff.setOption(JsonDiff.Option.ARRAY_ORDER_INSIGNIFICANT);
diff.setOption(JsonDiff... | java | public static boolean fastCompareDocs(JsonNode sourceDocument, JsonNode destinationDocument, List<String> exclusionPaths, boolean ignoreTimestampMSDiffs) {
try {
JsonDiff diff = new JsonDiff();
diff.setOption(JsonDiff.Option.ARRAY_ORDER_INSIGNIFICANT);
diff.setOption(JsonDiff... | [
"public",
"static",
"boolean",
"fastCompareDocs",
"(",
"JsonNode",
"sourceDocument",
",",
"JsonNode",
"destinationDocument",
",",
"List",
"<",
"String",
">",
"exclusionPaths",
",",
"boolean",
"ignoreTimestampMSDiffs",
")",
"{",
"try",
"{",
"JsonDiff",
"diff",
"=",
... | Compare two docs fast if they are the same, excluding exclusions
@return true if documents are different | [
"Compare",
"two",
"docs",
"fast",
"if",
"they",
"are",
"the",
"same",
"excluding",
"exclusions"
] | ec20748557b40d1f7851e1816d1b76dae48d2027 | https://github.com/lightblue-platform/lightblue-migrator/blob/ec20748557b40d1f7851e1816d1b76dae48d2027/migrator/src/main/java/com/redhat/lightblue/migrator/Utils.java#L132-L155 | train |
wuman/orientdb-android | core/src/main/java/com/orientechnologies/orient/core/storage/impl/local/ODataLocalHole.java | ODataLocalHole.createHole | public synchronized void createHole(final long iRecordOffset, final int iRecordSize) throws IOException {
final long timer = OProfiler.getInstance().startChrono();
// IN MEMORY
final int recycledPosition;
final ODataHoleInfo hole;
if (!freeHoles.isEmpty()) {
// RECYCLE THE FIRST FREE H... | java | public synchronized void createHole(final long iRecordOffset, final int iRecordSize) throws IOException {
final long timer = OProfiler.getInstance().startChrono();
// IN MEMORY
final int recycledPosition;
final ODataHoleInfo hole;
if (!freeHoles.isEmpty()) {
// RECYCLE THE FIRST FREE H... | [
"public",
"synchronized",
"void",
"createHole",
"(",
"final",
"long",
"iRecordOffset",
",",
"final",
"int",
"iRecordSize",
")",
"throws",
"IOException",
"{",
"final",
"long",
"timer",
"=",
"OProfiler",
".",
"getInstance",
"(",
")",
".",
"startChrono",
"(",
")"... | Appends the hole to the end of the segment.
@throws IOException | [
"Appends",
"the",
"hole",
"to",
"the",
"end",
"of",
"the",
"segment",
"."
] | ff9b17e4349f26168b2d0c4facb1a18cbfbe8cf0 | https://github.com/wuman/orientdb-android/blob/ff9b17e4349f26168b2d0c4facb1a18cbfbe8cf0/core/src/main/java/com/orientechnologies/orient/core/storage/impl/local/ODataLocalHole.java#L98-L130 | train |
wuman/orientdb-android | core/src/main/java/com/orientechnologies/orient/core/storage/impl/local/ODataLocalHole.java | ODataLocalHole.getHole | public synchronized ODataHoleInfo getHole(final int iPosition) {
final ODataHoleInfo hole = availableHolesList.get(iPosition);
if (hole.dataOffset == -1)
return null;
return hole;
} | java | public synchronized ODataHoleInfo getHole(final int iPosition) {
final ODataHoleInfo hole = availableHolesList.get(iPosition);
if (hole.dataOffset == -1)
return null;
return hole;
} | [
"public",
"synchronized",
"ODataHoleInfo",
"getHole",
"(",
"final",
"int",
"iPosition",
")",
"{",
"final",
"ODataHoleInfo",
"hole",
"=",
"availableHolesList",
".",
"get",
"(",
"iPosition",
")",
";",
"if",
"(",
"hole",
".",
"dataOffset",
"==",
"-",
"1",
")",
... | Fills the holes information into OPhysicalPosition object given as parameter.
@return true, if it's a valid hole, otherwise false
@throws IOException | [
"Fills",
"the",
"holes",
"information",
"into",
"OPhysicalPosition",
"object",
"given",
"as",
"parameter",
"."
] | ff9b17e4349f26168b2d0c4facb1a18cbfbe8cf0 | https://github.com/wuman/orientdb-android/blob/ff9b17e4349f26168b2d0c4facb1a18cbfbe8cf0/core/src/main/java/com/orientechnologies/orient/core/storage/impl/local/ODataLocalHole.java#L216-L221 | train |
wuman/orientdb-android | core/src/main/java/com/orientechnologies/orient/core/storage/impl/local/ODataLocalHole.java | ODataLocalHole.updateHole | public synchronized void updateHole(final ODataHoleInfo iHole, final long iNewDataOffset, final int iNewRecordSize)
throws IOException {
final long timer = OProfiler.getInstance().startChrono();
final boolean offsetChanged = iNewDataOffset != iHole.dataOffset;
final boolean sizeChanged = iNewRec... | java | public synchronized void updateHole(final ODataHoleInfo iHole, final long iNewDataOffset, final int iNewRecordSize)
throws IOException {
final long timer = OProfiler.getInstance().startChrono();
final boolean offsetChanged = iNewDataOffset != iHole.dataOffset;
final boolean sizeChanged = iNewRec... | [
"public",
"synchronized",
"void",
"updateHole",
"(",
"final",
"ODataHoleInfo",
"iHole",
",",
"final",
"long",
"iNewDataOffset",
",",
"final",
"int",
"iNewRecordSize",
")",
"throws",
"IOException",
"{",
"final",
"long",
"timer",
"=",
"OProfiler",
".",
"getInstance"... | Update hole data
@param iUpdateFromMemory
@throws IOException | [
"Update",
"hole",
"data"
] | ff9b17e4349f26168b2d0c4facb1a18cbfbe8cf0 | https://github.com/wuman/orientdb-android/blob/ff9b17e4349f26168b2d0c4facb1a18cbfbe8cf0/core/src/main/java/com/orientechnologies/orient/core/storage/impl/local/ODataLocalHole.java#L230-L264 | train |
wuman/orientdb-android | core/src/main/java/com/orientechnologies/orient/core/storage/impl/local/ODataLocalHole.java | ODataLocalHole.deleteHole | public synchronized void deleteHole(int iHolePosition) throws IOException {
// IN MEMORY
final ODataHoleInfo hole = availableHolesList.get(iHolePosition);
availableHolesBySize.remove(hole);
availableHolesByPosition.remove(hole);
hole.dataOffset = -1;
freeHoles.add(iHolePosition);
... | java | public synchronized void deleteHole(int iHolePosition) throws IOException {
// IN MEMORY
final ODataHoleInfo hole = availableHolesList.get(iHolePosition);
availableHolesBySize.remove(hole);
availableHolesByPosition.remove(hole);
hole.dataOffset = -1;
freeHoles.add(iHolePosition);
... | [
"public",
"synchronized",
"void",
"deleteHole",
"(",
"int",
"iHolePosition",
")",
"throws",
"IOException",
"{",
"// IN MEMORY\r",
"final",
"ODataHoleInfo",
"hole",
"=",
"availableHolesList",
".",
"get",
"(",
"iHolePosition",
")",
";",
"availableHolesBySize",
".",
"r... | Delete the hole
@param iRemoveAlsoFromMemory
@throws IOException | [
"Delete",
"the",
"hole"
] | ff9b17e4349f26168b2d0c4facb1a18cbfbe8cf0 | https://github.com/wuman/orientdb-android/blob/ff9b17e4349f26168b2d0c4facb1a18cbfbe8cf0/core/src/main/java/com/orientechnologies/orient/core/storage/impl/local/ODataLocalHole.java#L273-L285 | train |
wuman/orientdb-android | object/src/main/java/com/orientechnologies/orient/object/iterator/graph/OGraphElementIterator.java | OGraphElementIterator.getObject | protected T getObject() {
final T object;
if (reusedObject != null) {
// REUSE THE SAME RECORD AFTER HAVING RESETTED IT
object = reusedObject;
object.reset();
} else
// CREATE A NEW ONE
object = (T) database.newInstance(className);
return object;
} | java | protected T getObject() {
final T object;
if (reusedObject != null) {
// REUSE THE SAME RECORD AFTER HAVING RESETTED IT
object = reusedObject;
object.reset();
} else
// CREATE A NEW ONE
object = (T) database.newInstance(className);
return object;
} | [
"protected",
"T",
"getObject",
"(",
")",
"{",
"final",
"T",
"object",
";",
"if",
"(",
"reusedObject",
"!=",
"null",
")",
"{",
"// REUSE THE SAME RECORD AFTER HAVING RESETTED IT\r",
"object",
"=",
"reusedObject",
";",
"object",
".",
"reset",
"(",
")",
";",
"}",... | Returns the object to use for the operation.
@return | [
"Returns",
"the",
"object",
"to",
"use",
"for",
"the",
"operation",
"."
] | ff9b17e4349f26168b2d0c4facb1a18cbfbe8cf0 | https://github.com/wuman/orientdb-android/blob/ff9b17e4349f26168b2d0c4facb1a18cbfbe8cf0/object/src/main/java/com/orientechnologies/orient/object/iterator/graph/OGraphElementIterator.java#L111-L121 | train |
loldevs/riotapi | xmpp/src/main/java/net/boreeas/xmpp/XmppClient.java | XmppClient.sha1 | @SneakyThrows(IOException.class)
public static String sha1(String input) throws NoSuchAlgorithmException {
MessageDigest mDigest = MessageDigest.getInstance("SHA1");
byte[] result = mDigest.digest(input.getBytes("UTF-8"));
String resultString = String.format("%040x", new BigInteger(1, result));
return resultSt... | java | @SneakyThrows(IOException.class)
public static String sha1(String input) throws NoSuchAlgorithmException {
MessageDigest mDigest = MessageDigest.getInstance("SHA1");
byte[] result = mDigest.digest(input.getBytes("UTF-8"));
String resultString = String.format("%040x", new BigInteger(1, result));
return resultSt... | [
"@",
"SneakyThrows",
"(",
"IOException",
".",
"class",
")",
"public",
"static",
"String",
"sha1",
"(",
"String",
"input",
")",
"throws",
"NoSuchAlgorithmException",
"{",
"MessageDigest",
"mDigest",
"=",
"MessageDigest",
".",
"getInstance",
"(",
"\"SHA1\"",
")",
... | Calculates the SHA1 Digest of a given input.
@param input the input
@return the string
@throws NoSuchAlgorithmException the no such algorithm exception | [
"Calculates",
"the",
"SHA1",
"Digest",
"of",
"a",
"given",
"input",
"."
] | 0b8aac407aa5289845f249024f9732332855544f | https://github.com/loldevs/riotapi/blob/0b8aac407aa5289845f249024f9732332855544f/xmpp/src/main/java/net/boreeas/xmpp/XmppClient.java#L151-L157 | train |
wuman/orientdb-android | core/src/main/java/com/orientechnologies/orient/core/tx/OTransactionNoTx.java | OTransactionNoTx.saveRecord | public void saveRecord(final ORecordInternal<?> iRecord, final String iClusterName, final OPERATION_MODE iMode,
final ORecordCallback<? extends Number> iCallback) {
try {
database.executeSaveRecord(iRecord, iClusterName, iRecord.getVersion(), iRecord.getRecordType(), true, iMode, iCallback);
} c... | java | public void saveRecord(final ORecordInternal<?> iRecord, final String iClusterName, final OPERATION_MODE iMode,
final ORecordCallback<? extends Number> iCallback) {
try {
database.executeSaveRecord(iRecord, iClusterName, iRecord.getVersion(), iRecord.getRecordType(), true, iMode, iCallback);
} c... | [
"public",
"void",
"saveRecord",
"(",
"final",
"ORecordInternal",
"<",
"?",
">",
"iRecord",
",",
"final",
"String",
"iClusterName",
",",
"final",
"OPERATION_MODE",
"iMode",
",",
"final",
"ORecordCallback",
"<",
"?",
"extends",
"Number",
">",
"iCallback",
")",
"... | Update the record.
@param iCallback | [
"Update",
"the",
"record",
"."
] | ff9b17e4349f26168b2d0c4facb1a18cbfbe8cf0 | https://github.com/wuman/orientdb-android/blob/ff9b17e4349f26168b2d0c4facb1a18cbfbe8cf0/core/src/main/java/com/orientechnologies/orient/core/tx/OTransactionNoTx.java#L69-L83 | train |
wuman/orientdb-android | core/src/main/java/com/orientechnologies/orient/core/tx/OTransactionNoTx.java | OTransactionNoTx.deleteRecord | public void deleteRecord(final ORecordInternal<?> iRecord, final OPERATION_MODE iMode) {
if (!iRecord.getIdentity().isPersistent())
return;
try {
database.executeDeleteRecord(iRecord, iRecord.getVersion(), true, true, iMode);
} catch (Exception e) {
// REMOVE IT FROM THE CACHE TO A... | java | public void deleteRecord(final ORecordInternal<?> iRecord, final OPERATION_MODE iMode) {
if (!iRecord.getIdentity().isPersistent())
return;
try {
database.executeDeleteRecord(iRecord, iRecord.getVersion(), true, true, iMode);
} catch (Exception e) {
// REMOVE IT FROM THE CACHE TO A... | [
"public",
"void",
"deleteRecord",
"(",
"final",
"ORecordInternal",
"<",
"?",
">",
"iRecord",
",",
"final",
"OPERATION_MODE",
"iMode",
")",
"{",
"if",
"(",
"!",
"iRecord",
".",
"getIdentity",
"(",
")",
".",
"isPersistent",
"(",
")",
")",
"return",
";",
"t... | Deletes the record. | [
"Deletes",
"the",
"record",
"."
] | ff9b17e4349f26168b2d0c4facb1a18cbfbe8cf0 | https://github.com/wuman/orientdb-android/blob/ff9b17e4349f26168b2d0c4facb1a18cbfbe8cf0/core/src/main/java/com/orientechnologies/orient/core/tx/OTransactionNoTx.java#L88-L104 | train |
wuman/orientdb-android | core/src/main/java/com/orientechnologies/orient/core/command/OCommandRequestTextAbstract.java | OCommandRequestTextAbstract.execute | @SuppressWarnings("unchecked")
public <RET> RET execute(final Object... iArgs) {
setParameters(iArgs);
return (RET) ODatabaseRecordThreadLocal.INSTANCE.get().getStorage().command(this);
} | java | @SuppressWarnings("unchecked")
public <RET> RET execute(final Object... iArgs) {
setParameters(iArgs);
return (RET) ODatabaseRecordThreadLocal.INSTANCE.get().getStorage().command(this);
} | [
"@",
"SuppressWarnings",
"(",
"\"unchecked\"",
")",
"public",
"<",
"RET",
">",
"RET",
"execute",
"(",
"final",
"Object",
"...",
"iArgs",
")",
"{",
"setParameters",
"(",
"iArgs",
")",
";",
"return",
"(",
"RET",
")",
"ODatabaseRecordThreadLocal",
".",
"INSTANC... | Delegates the execution to the configured command executor. | [
"Delegates",
"the",
"execution",
"to",
"the",
"configured",
"command",
"executor",
"."
] | ff9b17e4349f26168b2d0c4facb1a18cbfbe8cf0 | https://github.com/wuman/orientdb-android/blob/ff9b17e4349f26168b2d0c4facb1a18cbfbe8cf0/core/src/main/java/com/orientechnologies/orient/core/command/OCommandRequestTextAbstract.java#L57-L61 | train |
wuman/orientdb-android | core/src/main/java/com/orientechnologies/orient/core/index/OIndexMVRBTreeAbstract.java | OIndexMVRBTreeAbstract.getEntriesBetween | public Collection<ODocument> getEntriesBetween(final Object iRangeFrom, final Object iRangeTo) {
return getEntriesBetween(iRangeFrom, iRangeTo, true);
} | java | public Collection<ODocument> getEntriesBetween(final Object iRangeFrom, final Object iRangeTo) {
return getEntriesBetween(iRangeFrom, iRangeTo, true);
} | [
"public",
"Collection",
"<",
"ODocument",
">",
"getEntriesBetween",
"(",
"final",
"Object",
"iRangeFrom",
",",
"final",
"Object",
"iRangeTo",
")",
"{",
"return",
"getEntriesBetween",
"(",
"iRangeFrom",
",",
"iRangeTo",
",",
"true",
")",
";",
"}"
] | Returns a set of documents with key between the range passed as parameter. Range bounds are included.
@param iRangeFrom
Starting range
@param iRangeTo
Ending range
@see #getEntriesBetween(Object, Object, boolean)
@return | [
"Returns",
"a",
"set",
"of",
"documents",
"with",
"key",
"between",
"the",
"range",
"passed",
"as",
"parameter",
".",
"Range",
"bounds",
"are",
"included",
"."
] | ff9b17e4349f26168b2d0c4facb1a18cbfbe8cf0 | https://github.com/wuman/orientdb-android/blob/ff9b17e4349f26168b2d0c4facb1a18cbfbe8cf0/core/src/main/java/com/orientechnologies/orient/core/index/OIndexMVRBTreeAbstract.java#L287-L289 | train |
wuman/orientdb-android | core/src/main/java/com/orientechnologies/orient/core/index/OIndexMVRBTreeAbstract.java | OIndexMVRBTreeAbstract.rebuild | public long rebuild(final OProgressListener iProgressListener) {
long documentIndexed = 0;
final boolean intentInstalled = getDatabase().declareIntent(new OIntentMassiveInsert());
acquireExclusiveLock();
try {
try {
map.clear();
} catch (Exception e) {
// IGNORE E... | java | public long rebuild(final OProgressListener iProgressListener) {
long documentIndexed = 0;
final boolean intentInstalled = getDatabase().declareIntent(new OIntentMassiveInsert());
acquireExclusiveLock();
try {
try {
map.clear();
} catch (Exception e) {
// IGNORE E... | [
"public",
"long",
"rebuild",
"(",
"final",
"OProgressListener",
"iProgressListener",
")",
"{",
"long",
"documentIndexed",
"=",
"0",
";",
"final",
"boolean",
"intentInstalled",
"=",
"getDatabase",
"(",
")",
".",
"declareIntent",
"(",
"new",
"OIntentMassiveInsert",
... | Populates the index with all the existent records. Uses the massive insert intent to speed up and keep the consumed memory low. | [
"Populates",
"the",
"index",
"with",
"all",
"the",
"existent",
"records",
".",
"Uses",
"the",
"massive",
"insert",
"intent",
"to",
"speed",
"up",
"and",
"keep",
"the",
"consumed",
"memory",
"low",
"."
] | ff9b17e4349f26168b2d0c4facb1a18cbfbe8cf0 | https://github.com/wuman/orientdb-android/blob/ff9b17e4349f26168b2d0c4facb1a18cbfbe8cf0/core/src/main/java/com/orientechnologies/orient/core/index/OIndexMVRBTreeAbstract.java#L351-L430 | train |
wuman/orientdb-android | enterprise/src/main/java/com/orientechnologies/orient/enterprise/channel/binary/OChannelBinaryClient.java | OChannelBinaryClient.isConnected | public boolean isConnected() {
if (socket != null && socket.isConnected() && !socket.isInputShutdown() && !socket.isOutputShutdown())
return true;
return false;
} | java | public boolean isConnected() {
if (socket != null && socket.isConnected() && !socket.isInputShutdown() && !socket.isOutputShutdown())
return true;
return false;
} | [
"public",
"boolean",
"isConnected",
"(",
")",
"{",
"if",
"(",
"socket",
"!=",
"null",
"&&",
"socket",
".",
"isConnected",
"(",
")",
"&&",
"!",
"socket",
".",
"isInputShutdown",
"(",
")",
"&&",
"!",
"socket",
".",
"isOutputShutdown",
"(",
")",
")",
"ret... | Tells if the channel is connected.
@return true if it's connected, otherwise false. | [
"Tells",
"if",
"the",
"channel",
"is",
"connected",
"."
] | ff9b17e4349f26168b2d0c4facb1a18cbfbe8cf0 | https://github.com/wuman/orientdb-android/blob/ff9b17e4349f26168b2d0c4facb1a18cbfbe8cf0/enterprise/src/main/java/com/orientechnologies/orient/enterprise/channel/binary/OChannelBinaryClient.java#L88-L92 | train |
wuman/orientdb-android | object/src/main/java/com/orientechnologies/orient/object/enhancement/OObjectProxyMethodHandler.java | OObjectProxyMethodHandler.detach | public void detach(Object self) throws NoSuchMethodException, IllegalAccessException, InvocationTargetException {
for (String fieldName : doc.fieldNames()) {
Object value = getValue(self, fieldName, false, null);
if (value instanceof OLazyObjectMultivalueElement)
((OLazyObjectMultivalueElement) value).detac... | java | public void detach(Object self) throws NoSuchMethodException, IllegalAccessException, InvocationTargetException {
for (String fieldName : doc.fieldNames()) {
Object value = getValue(self, fieldName, false, null);
if (value instanceof OLazyObjectMultivalueElement)
((OLazyObjectMultivalueElement) value).detac... | [
"public",
"void",
"detach",
"(",
"Object",
"self",
")",
"throws",
"NoSuchMethodException",
",",
"IllegalAccessException",
",",
"InvocationTargetException",
"{",
"for",
"(",
"String",
"fieldName",
":",
"doc",
".",
"fieldNames",
"(",
")",
")",
"{",
"Object",
"valu... | Method that detaches all fields contained in the document to the given object
@param self
:- The object containing this handler instance
@throws InvocationTargetException
@throws IllegalAccessException
@throws NoSuchMethodException | [
"Method",
"that",
"detaches",
"all",
"fields",
"contained",
"in",
"the",
"document",
"to",
"the",
"given",
"object"
] | ff9b17e4349f26168b2d0c4facb1a18cbfbe8cf0 | https://github.com/wuman/orientdb-android/blob/ff9b17e4349f26168b2d0c4facb1a18cbfbe8cf0/object/src/main/java/com/orientechnologies/orient/object/enhancement/OObjectProxyMethodHandler.java#L110-L119 | train |
wuman/orientdb-android | object/src/main/java/com/orientechnologies/orient/object/enhancement/OObjectProxyMethodHandler.java | OObjectProxyMethodHandler.attach | public void attach(Object self) throws IllegalArgumentException, IllegalAccessException, NoSuchMethodException,
InvocationTargetException {
for (Class<?> currentClass = self.getClass(); currentClass != Object.class;) {
if (Proxy.class.isAssignableFrom(currentClass)) {
currentClass = currentClass.getSupercla... | java | public void attach(Object self) throws IllegalArgumentException, IllegalAccessException, NoSuchMethodException,
InvocationTargetException {
for (Class<?> currentClass = self.getClass(); currentClass != Object.class;) {
if (Proxy.class.isAssignableFrom(currentClass)) {
currentClass = currentClass.getSupercla... | [
"public",
"void",
"attach",
"(",
"Object",
"self",
")",
"throws",
"IllegalArgumentException",
",",
"IllegalAccessException",
",",
"NoSuchMethodException",
",",
"InvocationTargetException",
"{",
"for",
"(",
"Class",
"<",
"?",
">",
"currentClass",
"=",
"self",
".",
... | Method that attaches all data contained in the object to the associated document
@param self
:- The object containing this handler instance
@throws IllegalAccessException
@throws IllegalArgumentException
@throws InvocationTargetException
@throws NoSuchMethodException | [
"Method",
"that",
"attaches",
"all",
"data",
"contained",
"in",
"the",
"object",
"to",
"the",
"associated",
"document"
] | ff9b17e4349f26168b2d0c4facb1a18cbfbe8cf0 | https://github.com/wuman/orientdb-android/blob/ff9b17e4349f26168b2d0c4facb1a18cbfbe8cf0/object/src/main/java/com/orientechnologies/orient/object/enhancement/OObjectProxyMethodHandler.java#L132-L151 | train |
Putnami/putnami-web-toolkit | core/src/main/java/fr/putnami/pwt/core/theme/client/DefaultIE8ThemeController.java | DefaultIE8ThemeController.ensureRespondJsScriptElement | private void ensureRespondJsScriptElement() {
if (this.respondJsScript == null) {
this.respondJsScript = Document.get().createScriptElement();
this.respondJsScript.setSrc(GWT.getModuleBaseForStaticFiles() + DefaultIE8ThemeController.RESPOND_JS_LOCATION);
this.respondJsScript.setType("text/javascript");
}
... | java | private void ensureRespondJsScriptElement() {
if (this.respondJsScript == null) {
this.respondJsScript = Document.get().createScriptElement();
this.respondJsScript.setSrc(GWT.getModuleBaseForStaticFiles() + DefaultIE8ThemeController.RESPOND_JS_LOCATION);
this.respondJsScript.setType("text/javascript");
}
... | [
"private",
"void",
"ensureRespondJsScriptElement",
"(",
")",
"{",
"if",
"(",
"this",
".",
"respondJsScript",
"==",
"null",
")",
"{",
"this",
".",
"respondJsScript",
"=",
"Document",
".",
"get",
"(",
")",
".",
"createScriptElement",
"(",
")",
";",
"this",
"... | Ensure respond js script element. | [
"Ensure",
"respond",
"js",
"script",
"element",
"."
] | 129aa781d1bda508e579d194693ca3034b4d470b | https://github.com/Putnami/putnami-web-toolkit/blob/129aa781d1bda508e579d194693ca3034b4d470b/core/src/main/java/fr/putnami/pwt/core/theme/client/DefaultIE8ThemeController.java#L50-L56 | train |
NetsOSS/embedded-jetty | src/main/java/eu/nets/oss/jetty/EmbeddedSpringWsBuilder.java | EmbeddedSpringWsBuilder.createMessageDispatcherServlet | public static MessageDispatcherServlet createMessageDispatcherServlet(Class... contextConfigLocation) {
StringBuilder items = new StringBuilder();
for (Class aClass : contextConfigLocation) {
items.append( aClass.getName());
items.append(",");
}
MessageDispatcherS... | java | public static MessageDispatcherServlet createMessageDispatcherServlet(Class... contextConfigLocation) {
StringBuilder items = new StringBuilder();
for (Class aClass : contextConfigLocation) {
items.append( aClass.getName());
items.append(",");
}
MessageDispatcherS... | [
"public",
"static",
"MessageDispatcherServlet",
"createMessageDispatcherServlet",
"(",
"Class",
"...",
"contextConfigLocation",
")",
"{",
"StringBuilder",
"items",
"=",
"new",
"StringBuilder",
"(",
")",
";",
"for",
"(",
"Class",
"aClass",
":",
"contextConfigLocation",
... | Creates a spring-ws message dispatcher servlet
@param contextConfigLocation The spring configuration classes
@return A message dispatcher servlet based on the supplied configuration | [
"Creates",
"a",
"spring",
"-",
"ws",
"message",
"dispatcher",
"servlet"
] | c2535867ad4887c4a43a8aa7f95b711ff54c8542 | https://github.com/NetsOSS/embedded-jetty/blob/c2535867ad4887c4a43a8aa7f95b711ff54c8542/src/main/java/eu/nets/oss/jetty/EmbeddedSpringWsBuilder.java#L20-L31 | train |
amsa-code/risky | ais/src/main/java/au/gov/amsa/ais/Communications.java | Communications.getReceivedStations | @VisibleForTesting
static Integer getReceivedStations(AisExtractor extractor, int slotTimeout,
int startIndex) {
if (slotTimeout == 3 || slotTimeout == 5 || slotTimeout == 7)
return extractor.getValue(startIndex + 5, startIndex + 19);
else
return null;
} | java | @VisibleForTesting
static Integer getReceivedStations(AisExtractor extractor, int slotTimeout,
int startIndex) {
if (slotTimeout == 3 || slotTimeout == 5 || slotTimeout == 7)
return extractor.getValue(startIndex + 5, startIndex + 19);
else
return null;
} | [
"@",
"VisibleForTesting",
"static",
"Integer",
"getReceivedStations",
"(",
"AisExtractor",
"extractor",
",",
"int",
"slotTimeout",
",",
"int",
"startIndex",
")",
"{",
"if",
"(",
"slotTimeout",
"==",
"3",
"||",
"slotTimeout",
"==",
"5",
"||",
"slotTimeout",
"==",... | Returns received stations as per 1371-4.pdf.
@param extractor
@param slotTimeout
@param startIndex
@return | [
"Returns",
"received",
"stations",
"as",
"per",
"1371",
"-",
"4",
".",
"pdf",
"."
] | 13649942aeddfdb9210eec072c605bc5d7a6daf3 | https://github.com/amsa-code/risky/blob/13649942aeddfdb9210eec072c605bc5d7a6daf3/ais/src/main/java/au/gov/amsa/ais/Communications.java#L48-L55 | train |
amsa-code/risky | ais/src/main/java/au/gov/amsa/ais/Communications.java | Communications.getHourUtc | private static Integer getHourUtc(AisExtractor extractor, int slotTimeout,
int startIndex) {
if (slotTimeout == 1) {
// skip the msb bit
int hours = extractor.getValue(startIndex + 5, startIndex + 10);
return hours;
} else
return null;
} | java | private static Integer getHourUtc(AisExtractor extractor, int slotTimeout,
int startIndex) {
if (slotTimeout == 1) {
// skip the msb bit
int hours = extractor.getValue(startIndex + 5, startIndex + 10);
return hours;
} else
return null;
} | [
"private",
"static",
"Integer",
"getHourUtc",
"(",
"AisExtractor",
"extractor",
",",
"int",
"slotTimeout",
",",
"int",
"startIndex",
")",
"{",
"if",
"(",
"slotTimeout",
"==",
"1",
")",
"{",
"// skip the msb bit",
"int",
"hours",
"=",
"extractor",
".",
"getValu... | Returns hour UTC as per 1371-4.pdf.
@param extractor
@param slotTimeout
@param startIndex
@return | [
"Returns",
"hour",
"UTC",
"as",
"per",
"1371",
"-",
"4",
".",
"pdf",
"."
] | 13649942aeddfdb9210eec072c605bc5d7a6daf3 | https://github.com/amsa-code/risky/blob/13649942aeddfdb9210eec072c605bc5d7a6daf3/ais/src/main/java/au/gov/amsa/ais/Communications.java#L82-L90 | train |
amsa-code/risky | ais/src/main/java/au/gov/amsa/ais/Communications.java | Communications.getMinuteUtc | private static Integer getMinuteUtc(AisExtractor extractor,
int slotTimeout, int startIndex) {
if (slotTimeout == 1) {
// skip the msb bit
int minutes = extractor.getValue(startIndex + 10, startIndex + 17);
return minutes;
} else
return null;
} | java | private static Integer getMinuteUtc(AisExtractor extractor,
int slotTimeout, int startIndex) {
if (slotTimeout == 1) {
// skip the msb bit
int minutes = extractor.getValue(startIndex + 10, startIndex + 17);
return minutes;
} else
return null;
} | [
"private",
"static",
"Integer",
"getMinuteUtc",
"(",
"AisExtractor",
"extractor",
",",
"int",
"slotTimeout",
",",
"int",
"startIndex",
")",
"{",
"if",
"(",
"slotTimeout",
"==",
"1",
")",
"{",
"// skip the msb bit",
"int",
"minutes",
"=",
"extractor",
".",
"get... | Returns minute UTC as per 1371-4.pdf.
@param extractor
@param slotTimeout
@param startIndex
@return | [
"Returns",
"minute",
"UTC",
"as",
"per",
"1371",
"-",
"4",
".",
"pdf",
"."
] | 13649942aeddfdb9210eec072c605bc5d7a6daf3 | https://github.com/amsa-code/risky/blob/13649942aeddfdb9210eec072c605bc5d7a6daf3/ais/src/main/java/au/gov/amsa/ais/Communications.java#L100-L108 | train |
amsa-code/risky | ais/src/main/java/au/gov/amsa/ais/Communications.java | Communications.getSlotOffset | private static Integer getSlotOffset(AisExtractor extractor,
int slotTimeout, int startIndex) {
if (slotTimeout == 0)
return extractor.getValue(startIndex + 5, startIndex + 19);
else
return null;
} | java | private static Integer getSlotOffset(AisExtractor extractor,
int slotTimeout, int startIndex) {
if (slotTimeout == 0)
return extractor.getValue(startIndex + 5, startIndex + 19);
else
return null;
} | [
"private",
"static",
"Integer",
"getSlotOffset",
"(",
"AisExtractor",
"extractor",
",",
"int",
"slotTimeout",
",",
"int",
"startIndex",
")",
"{",
"if",
"(",
"slotTimeout",
"==",
"0",
")",
"return",
"extractor",
".",
"getValue",
"(",
"startIndex",
"+",
"5",
"... | Returns slot offset as per 1371-4.pdf.
@param extractor
@param slotTimeout
@param startIndex
@return | [
"Returns",
"slot",
"offset",
"as",
"per",
"1371",
"-",
"4",
".",
"pdf",
"."
] | 13649942aeddfdb9210eec072c605bc5d7a6daf3 | https://github.com/amsa-code/risky/blob/13649942aeddfdb9210eec072c605bc5d7a6daf3/ais/src/main/java/au/gov/amsa/ais/Communications.java#L118-L124 | train |
amsa-code/risky | ais/src/main/java/au/gov/amsa/ais/AisExtractor.java | AisExtractor.getValue | public synchronized int getValue(int from, int to) {
try {
// is synchronized so that values of bitSet and calculated can be
// lazily
// calculated and safely published (thread safe).
SixBit.convertSixBitToBits(message, padBits, bitSet, calculated, from, to);
... | java | public synchronized int getValue(int from, int to) {
try {
// is synchronized so that values of bitSet and calculated can be
// lazily
// calculated and safely published (thread safe).
SixBit.convertSixBitToBits(message, padBits, bitSet, calculated, from, to);
... | [
"public",
"synchronized",
"int",
"getValue",
"(",
"int",
"from",
",",
"int",
"to",
")",
"{",
"try",
"{",
"// is synchronized so that values of bitSet and calculated can be",
"// lazily",
"// calculated and safely published (thread safe).",
"SixBit",
".",
"convertSixBitToBits",
... | Returns an unsigned integer value using the bits from character position
start to position stop in the decoded message.
@param from
@param to
@return | [
"Returns",
"an",
"unsigned",
"integer",
"value",
"using",
"the",
"bits",
"from",
"character",
"position",
"start",
"to",
"position",
"stop",
"in",
"the",
"decoded",
"message",
"."
] | 13649942aeddfdb9210eec072c605bc5d7a6daf3 | https://github.com/amsa-code/risky/blob/13649942aeddfdb9210eec072c605bc5d7a6daf3/ais/src/main/java/au/gov/amsa/ais/AisExtractor.java#L62-L72 | train |
amsa-code/risky | ais/src/main/java/au/gov/amsa/ais/AisExtractor.java | AisExtractor.getSignedValue | public synchronized int getSignedValue(int from, int to) {
try {
// is synchronized so that values of bitSet and calculated can be
// lazily
// calculated and safely published (thread safe).
SixBit.convertSixBitToBits(message, padBits, bitSet, calculated, from, to... | java | public synchronized int getSignedValue(int from, int to) {
try {
// is synchronized so that values of bitSet and calculated can be
// lazily
// calculated and safely published (thread safe).
SixBit.convertSixBitToBits(message, padBits, bitSet, calculated, from, to... | [
"public",
"synchronized",
"int",
"getSignedValue",
"(",
"int",
"from",
",",
"int",
"to",
")",
"{",
"try",
"{",
"// is synchronized so that values of bitSet and calculated can be",
"// lazily",
"// calculated and safely published (thread safe).",
"SixBit",
".",
"convertSixBitToB... | Returns a signed integer value using the bits from character position
start to position stop in the decoded message.
@param from
@param to
@return | [
"Returns",
"a",
"signed",
"integer",
"value",
"using",
"the",
"bits",
"from",
"character",
"position",
"start",
"to",
"position",
"stop",
"in",
"the",
"decoded",
"message",
"."
] | 13649942aeddfdb9210eec072c605bc5d7a6daf3 | https://github.com/amsa-code/risky/blob/13649942aeddfdb9210eec072c605bc5d7a6daf3/ais/src/main/java/au/gov/amsa/ais/AisExtractor.java#L82-L92 | train |
wealthfront/kawala | kawala-common/src/main/java/com/kaching/platform/common/reflect/ReflectUtils.java | ReflectUtils.getField | public static Object getField(Object obj, String name) {
try {
Class<? extends Object> klass = obj.getClass();
do {
try {
Field field = klass.getDeclaredField(name);
field.setAccessible(true);
return field.get(obj);
} catch (NoSuchFieldException e) {
... | java | public static Object getField(Object obj, String name) {
try {
Class<? extends Object> klass = obj.getClass();
do {
try {
Field field = klass.getDeclaredField(name);
field.setAccessible(true);
return field.get(obj);
} catch (NoSuchFieldException e) {
... | [
"public",
"static",
"Object",
"getField",
"(",
"Object",
"obj",
",",
"String",
"name",
")",
"{",
"try",
"{",
"Class",
"<",
"?",
"extends",
"Object",
">",
"klass",
"=",
"obj",
".",
"getClass",
"(",
")",
";",
"do",
"{",
"try",
"{",
"Field",
"field",
... | Gets a field from an object.
@param obj object from which to read the field
@param name the field name to read | [
"Gets",
"a",
"field",
"from",
"an",
"object",
"."
] | acf24b7a9ef6e2f0fc1e862d44cfa4dcc4da8f6e | https://github.com/wealthfront/kawala/blob/acf24b7a9ef6e2f0fc1e862d44cfa4dcc4da8f6e/kawala-common/src/main/java/com/kaching/platform/common/reflect/ReflectUtils.java#L30-L50 | train |
amsa-code/risky | geo-analyzer/src/main/java/au/gov/amsa/util/navigation/Position.java | Position.getDistanceToKm | public final double getDistanceToKm(Position position) {
double lat1 = toRadians(lat);
double lat2 = toRadians(position.lat);
double lon1 = toRadians(lon);
double lon2 = toRadians(position.lon);
double deltaLon = lon2 - lon1;
double cosLat2 = cos(lat2);
double cosLat1 = cos(lat1);
double sinLat1 = sin(l... | java | public final double getDistanceToKm(Position position) {
double lat1 = toRadians(lat);
double lat2 = toRadians(position.lat);
double lon1 = toRadians(lon);
double lon2 = toRadians(position.lon);
double deltaLon = lon2 - lon1;
double cosLat2 = cos(lat2);
double cosLat1 = cos(lat1);
double sinLat1 = sin(l... | [
"public",
"final",
"double",
"getDistanceToKm",
"(",
"Position",
"position",
")",
"{",
"double",
"lat1",
"=",
"toRadians",
"(",
"lat",
")",
";",
"double",
"lat2",
"=",
"toRadians",
"(",
"position",
".",
"lat",
")",
";",
"double",
"lon1",
"=",
"toRadians",
... | returns distance between two WGS84 positions according to Vincenty's
formula from Wikipedia
@param position
@return | [
"returns",
"distance",
"between",
"two",
"WGS84",
"positions",
"according",
"to",
"Vincenty",
"s",
"formula",
"from",
"Wikipedia"
] | 13649942aeddfdb9210eec072c605bc5d7a6daf3 | https://github.com/amsa-code/risky/blob/13649942aeddfdb9210eec072c605bc5d7a6daf3/geo-analyzer/src/main/java/au/gov/amsa/util/navigation/Position.java#L270-L286 | train |
amsa-code/risky | geo-analyzer/src/main/java/au/gov/amsa/util/navigation/Position.java | Position.getDistanceKmToPath | public final double getDistanceKmToPath(Position p1, Position p2) {
double d = radiusEarthKm
* asin(sin(getDistanceToKm(p1) / radiusEarthKm)
* sin(toRadians(getBearingDegrees(p1)
- p1.getBearingDegrees(p2))));
return abs(d);
} | java | public final double getDistanceKmToPath(Position p1, Position p2) {
double d = radiusEarthKm
* asin(sin(getDistanceToKm(p1) / radiusEarthKm)
* sin(toRadians(getBearingDegrees(p1)
- p1.getBearingDegrees(p2))));
return abs(d);
} | [
"public",
"final",
"double",
"getDistanceKmToPath",
"(",
"Position",
"p1",
",",
"Position",
"p2",
")",
"{",
"double",
"d",
"=",
"radiusEarthKm",
"*",
"asin",
"(",
"sin",
"(",
"getDistanceToKm",
"(",
"p1",
")",
"/",
"radiusEarthKm",
")",
"*",
"sin",
"(",
... | calculates the distance of a point to the great circle path between p1
and p2.
Formula from: http://www.movable-type.co.uk/scripts/latlong.html
@param p1
@param p2
@return | [
"calculates",
"the",
"distance",
"of",
"a",
"point",
"to",
"the",
"great",
"circle",
"path",
"between",
"p1",
"and",
"p2",
"."
] | 13649942aeddfdb9210eec072c605bc5d7a6daf3 | https://github.com/amsa-code/risky/blob/13649942aeddfdb9210eec072c605bc5d7a6daf3/geo-analyzer/src/main/java/au/gov/amsa/util/navigation/Position.java#L341-L347 | train |
soi-toolkit/soi-toolkit-mule | tools/soitoolkit-generator/soitoolkit-generator/src/main/java/org/soitoolkit/tools/generator/model/ModelFactory.java | ModelFactory.setModelClass | @SuppressWarnings("unchecked")
public static void setModelClass(Class<?> modelClass) throws IllegalArgumentException {
if (!DefaultModelImpl.class.isAssignableFrom(modelClass)) {
throw new IllegalArgumentException("Modelclass, " + modelClass.getName() + ", is not a subtype of " + DefaultModelImpl.class.getN... | java | @SuppressWarnings("unchecked")
public static void setModelClass(Class<?> modelClass) throws IllegalArgumentException {
if (!DefaultModelImpl.class.isAssignableFrom(modelClass)) {
throw new IllegalArgumentException("Modelclass, " + modelClass.getName() + ", is not a subtype of " + DefaultModelImpl.class.getN... | [
"@",
"SuppressWarnings",
"(",
"\"unchecked\"",
")",
"public",
"static",
"void",
"setModelClass",
"(",
"Class",
"<",
"?",
">",
"modelClass",
")",
"throws",
"IllegalArgumentException",
"{",
"if",
"(",
"!",
"DefaultModelImpl",
".",
"class",
".",
"isAssignableFrom",
... | Register a custom model class, must be a subclass to DefaultModelImpl.
@param modelClass
@throws IllegalArgumentException if supplied class is not a subclass of DefaultModelImpl | [
"Register",
"a",
"custom",
"model",
"class",
"must",
"be",
"a",
"subclass",
"to",
"DefaultModelImpl",
"."
] | e891350dbf55e6307be94d193d056bdb785b37d3 | https://github.com/soi-toolkit/soi-toolkit-mule/blob/e891350dbf55e6307be94d193d056bdb785b37d3/tools/soitoolkit-generator/soitoolkit-generator/src/main/java/org/soitoolkit/tools/generator/model/ModelFactory.java#L49-L55 | train |
soi-toolkit/soi-toolkit-mule | tools/soitoolkit-generator/soitoolkit-generator/src/main/java/org/soitoolkit/tools/generator/model/ModelFactory.java | ModelFactory.resetModelClass | public static void resetModelClass() {
ModelFactory.modelClass = DefaultModelImpl.class;
System.err.println("[INFO] Reset model-class: " + ModelFactory.modelClass.getName());
} | java | public static void resetModelClass() {
ModelFactory.modelClass = DefaultModelImpl.class;
System.err.println("[INFO] Reset model-class: " + ModelFactory.modelClass.getName());
} | [
"public",
"static",
"void",
"resetModelClass",
"(",
")",
"{",
"ModelFactory",
".",
"modelClass",
"=",
"DefaultModelImpl",
".",
"class",
";",
"System",
".",
"err",
".",
"println",
"(",
"\"[INFO] Reset model-class: \"",
"+",
"ModelFactory",
".",
"modelClass",
".",
... | Reset model class to the default class.
@param modelClass
@throws IllegalArgumentException if supplied class is not a subclass of DefaultModelImpl | [
"Reset",
"model",
"class",
"to",
"the",
"default",
"class",
"."
] | e891350dbf55e6307be94d193d056bdb785b37d3 | https://github.com/soi-toolkit/soi-toolkit-mule/blob/e891350dbf55e6307be94d193d056bdb785b37d3/tools/soitoolkit-generator/soitoolkit-generator/src/main/java/org/soitoolkit/tools/generator/model/ModelFactory.java#L81-L84 | train |
soi-toolkit/soi-toolkit-mule | tools/soitoolkit-generator/soitoolkit-generator/src/main/java/org/soitoolkit/tools/generator/model/ModelFactory.java | ModelFactory.newModel | public static IModel newModel(String groupId, String artifactId, String version, String service, MuleVersionEnum muleVersion, TransportEnum inboundTransport, TransportEnum outboundTransport, TransformerEnum transformerType) {
return doCreateNewModel(groupId, artifactId, version, service, muleVersion, null, null, inbo... | java | public static IModel newModel(String groupId, String artifactId, String version, String service, MuleVersionEnum muleVersion, TransportEnum inboundTransport, TransportEnum outboundTransport, TransformerEnum transformerType) {
return doCreateNewModel(groupId, artifactId, version, service, muleVersion, null, null, inbo... | [
"public",
"static",
"IModel",
"newModel",
"(",
"String",
"groupId",
",",
"String",
"artifactId",
",",
"String",
"version",
",",
"String",
"service",
",",
"MuleVersionEnum",
"muleVersion",
",",
"TransportEnum",
"inboundTransport",
",",
"TransportEnum",
"outboundTranspo... | Constructor-method to use when services with inbound and outbound services
@param groupId
@param artifactId
@param version
@param service
@return the new model instance | [
"Constructor",
"-",
"method",
"to",
"use",
"when",
"services",
"with",
"inbound",
"and",
"outbound",
"services"
] | e891350dbf55e6307be94d193d056bdb785b37d3 | https://github.com/soi-toolkit/soi-toolkit-mule/blob/e891350dbf55e6307be94d193d056bdb785b37d3/tools/soitoolkit-generator/soitoolkit-generator/src/main/java/org/soitoolkit/tools/generator/model/ModelFactory.java#L95-L97 | train |
wuman/orientdb-android | nativeos/src/main/java/com/orientechnologies/nio/MemoryLocker.java | MemoryLocker.lockMemory | public static void lockMemory(boolean useSystemJNADisabled) {
if (useSystemJNADisabled)
disableUsingSystemJNA();
try {
int errorCode = MemoryLockerLinux.INSTANCE.mlockall(MemoryLockerLinux.LOCK_CURRENT_MEMORY);
if (errorCode != 0) {
final String errorMessage;
int lastE... | java | public static void lockMemory(boolean useSystemJNADisabled) {
if (useSystemJNADisabled)
disableUsingSystemJNA();
try {
int errorCode = MemoryLockerLinux.INSTANCE.mlockall(MemoryLockerLinux.LOCK_CURRENT_MEMORY);
if (errorCode != 0) {
final String errorMessage;
int lastE... | [
"public",
"static",
"void",
"lockMemory",
"(",
"boolean",
"useSystemJNADisabled",
")",
"{",
"if",
"(",
"useSystemJNADisabled",
")",
"disableUsingSystemJNA",
"(",
")",
";",
"try",
"{",
"int",
"errorCode",
"=",
"MemoryLockerLinux",
".",
"INSTANCE",
".",
"mlockall",
... | This method locks memory to prevent swapping. This method provide information about success or problems with locking memory.
You can reed console output to know if memory locked successfully or not. If system error occurred such as permission any
specific exception will be thrown.
@param useSystemJNADisabled
if this p... | [
"This",
"method",
"locks",
"memory",
"to",
"prevent",
"swapping",
".",
"This",
"method",
"provide",
"information",
"about",
"success",
"or",
"problems",
"with",
"locking",
"memory",
".",
"You",
"can",
"reed",
"console",
"output",
"to",
"know",
"if",
"memory",
... | ff9b17e4349f26168b2d0c4facb1a18cbfbe8cf0 | https://github.com/wuman/orientdb-android/blob/ff9b17e4349f26168b2d0c4facb1a18cbfbe8cf0/nativeos/src/main/java/com/orientechnologies/nio/MemoryLocker.java#L61-L101 | train |
wuman/orientdb-android | commons/src/main/java/com/orientechnologies/common/collection/OMVRBTreeEntry.java | OMVRBTreeEntry.getFirstInMemory | public OMVRBTreeEntry<K, V> getFirstInMemory() {
OMVRBTreeEntry<K, V> node = this;
OMVRBTreeEntry<K, V> prev = this;
while (node != null) {
prev = node;
node = node.getPreviousInMemory();
}
return prev;
} | java | public OMVRBTreeEntry<K, V> getFirstInMemory() {
OMVRBTreeEntry<K, V> node = this;
OMVRBTreeEntry<K, V> prev = this;
while (node != null) {
prev = node;
node = node.getPreviousInMemory();
}
return prev;
} | [
"public",
"OMVRBTreeEntry",
"<",
"K",
",",
"V",
">",
"getFirstInMemory",
"(",
")",
"{",
"OMVRBTreeEntry",
"<",
"K",
",",
"V",
">",
"node",
"=",
"this",
";",
"OMVRBTreeEntry",
"<",
"K",
",",
"V",
">",
"prev",
"=",
"this",
";",
"while",
"(",
"node",
... | Returns the first Entry only by traversing the memory, or null if no such. | [
"Returns",
"the",
"first",
"Entry",
"only",
"by",
"traversing",
"the",
"memory",
"or",
"null",
"if",
"no",
"such",
"."
] | ff9b17e4349f26168b2d0c4facb1a18cbfbe8cf0 | https://github.com/wuman/orientdb-android/blob/ff9b17e4349f26168b2d0c4facb1a18cbfbe8cf0/commons/src/main/java/com/orientechnologies/common/collection/OMVRBTreeEntry.java#L59-L69 | train |
wuman/orientdb-android | commons/src/main/java/com/orientechnologies/common/collection/OMVRBTreeEntry.java | OMVRBTreeEntry.getPreviousInMemory | public OMVRBTreeEntry<K, V> getPreviousInMemory() {
OMVRBTreeEntry<K, V> t = this;
OMVRBTreeEntry<K, V> p = null;
if (t.getLeftInMemory() != null) {
p = t.getLeftInMemory();
while (p.getRightInMemory() != null)
p = p.getRightInMemory();
} else {
p = t.getParentInMemor... | java | public OMVRBTreeEntry<K, V> getPreviousInMemory() {
OMVRBTreeEntry<K, V> t = this;
OMVRBTreeEntry<K, V> p = null;
if (t.getLeftInMemory() != null) {
p = t.getLeftInMemory();
while (p.getRightInMemory() != null)
p = p.getRightInMemory();
} else {
p = t.getParentInMemor... | [
"public",
"OMVRBTreeEntry",
"<",
"K",
",",
"V",
">",
"getPreviousInMemory",
"(",
")",
"{",
"OMVRBTreeEntry",
"<",
"K",
",",
"V",
">",
"t",
"=",
"this",
";",
"OMVRBTreeEntry",
"<",
"K",
",",
"V",
">",
"p",
"=",
"null",
";",
"if",
"(",
"t",
".",
"g... | Returns the previous of the current Entry only by traversing the memory, or null if no such. | [
"Returns",
"the",
"previous",
"of",
"the",
"current",
"Entry",
"only",
"by",
"traversing",
"the",
"memory",
"or",
"null",
"if",
"no",
"such",
"."
] | ff9b17e4349f26168b2d0c4facb1a18cbfbe8cf0 | https://github.com/wuman/orientdb-android/blob/ff9b17e4349f26168b2d0c4facb1a18cbfbe8cf0/commons/src/main/java/com/orientechnologies/common/collection/OMVRBTreeEntry.java#L74-L91 | train |
wuman/orientdb-android | commons/src/main/java/com/orientechnologies/common/collection/OMVRBTreeEntry.java | OMVRBTreeEntry.linearSearch | private V linearSearch(final K iKey) {
V value = null;
int i = 0;
tree.pageItemComparator = -1;
for (int s = getSize(); i < s; ++i) {
if (tree.comparator != null)
tree.pageItemComparator = tree.comparator.compare(getKeyAt(i), iKey);
else
tree.pageItemComparator = ((Co... | java | private V linearSearch(final K iKey) {
V value = null;
int i = 0;
tree.pageItemComparator = -1;
for (int s = getSize(); i < s; ++i) {
if (tree.comparator != null)
tree.pageItemComparator = tree.comparator.compare(getKeyAt(i), iKey);
else
tree.pageItemComparator = ((Co... | [
"private",
"V",
"linearSearch",
"(",
"final",
"K",
"iKey",
")",
"{",
"V",
"value",
"=",
"null",
";",
"int",
"i",
"=",
"0",
";",
"tree",
".",
"pageItemComparator",
"=",
"-",
"1",
";",
"for",
"(",
"int",
"s",
"=",
"getSize",
"(",
")",
";",
"i",
"... | Linear search inside the node
@param iKey
Key to search
@return Value if found, otherwise null and the tree.pageIndex updated with the closest-after-first position valid for further
inserts. | [
"Linear",
"search",
"inside",
"the",
"node"
] | ff9b17e4349f26168b2d0c4facb1a18cbfbe8cf0 | https://github.com/wuman/orientdb-android/blob/ff9b17e4349f26168b2d0c4facb1a18cbfbe8cf0/commons/src/main/java/com/orientechnologies/common/collection/OMVRBTreeEntry.java#L208-L230 | train |
wuman/orientdb-android | commons/src/main/java/com/orientechnologies/common/collection/OMVRBTreeEntry.java | OMVRBTreeEntry.binarySearch | private V binarySearch(final K iKey) {
int low = 0;
int high = getSize() - 1;
int mid = 0;
while (low <= high) {
mid = (low + high) >>> 1;
Object midVal = getKeyAt(mid);
if (tree.comparator != null)
tree.pageItemComparator = tree.comparator.compare((K) midVal, iKey)... | java | private V binarySearch(final K iKey) {
int low = 0;
int high = getSize() - 1;
int mid = 0;
while (low <= high) {
mid = (low + high) >>> 1;
Object midVal = getKeyAt(mid);
if (tree.comparator != null)
tree.pageItemComparator = tree.comparator.compare((K) midVal, iKey)... | [
"private",
"V",
"binarySearch",
"(",
"final",
"K",
"iKey",
")",
"{",
"int",
"low",
"=",
"0",
";",
"int",
"high",
"=",
"getSize",
"(",
")",
"-",
"1",
";",
"int",
"mid",
"=",
"0",
";",
"while",
"(",
"low",
"<=",
"high",
")",
"{",
"mid",
"=",
"(... | Binary search inside the node
@param iKey
Key to search
@return Value if found, otherwise null and the tree.pageIndex updated with the closest-after-first position valid for further
inserts. | [
"Binary",
"search",
"inside",
"the",
"node"
] | ff9b17e4349f26168b2d0c4facb1a18cbfbe8cf0 | https://github.com/wuman/orientdb-android/blob/ff9b17e4349f26168b2d0c4facb1a18cbfbe8cf0/commons/src/main/java/com/orientechnologies/common/collection/OMVRBTreeEntry.java#L240-L272 | train |
wuman/orientdb-android | commons/src/main/java/com/orientechnologies/common/collection/OMVRBTreeEntry.java | OMVRBTreeEntry.compareTo | public int compareTo(final OMVRBTreeEntry<K, V> o) {
if (o == null)
return 1;
if (o == this)
return 0;
if (getSize() == 0)
return -1;
if (o.getSize() == 0)
return 1;
if (tree.comparator != null)
return tree.comparator.compare(getFirstKey(), o.getFirstKey());
... | java | public int compareTo(final OMVRBTreeEntry<K, V> o) {
if (o == null)
return 1;
if (o == this)
return 0;
if (getSize() == 0)
return -1;
if (o.getSize() == 0)
return 1;
if (tree.comparator != null)
return tree.comparator.compare(getFirstKey(), o.getFirstKey());
... | [
"public",
"int",
"compareTo",
"(",
"final",
"OMVRBTreeEntry",
"<",
"K",
",",
"V",
">",
"o",
")",
"{",
"if",
"(",
"o",
"==",
"null",
")",
"return",
"1",
";",
"if",
"(",
"o",
"==",
"this",
")",
"return",
"0",
";",
"if",
"(",
"getSize",
"(",
")",
... | Compares two nodes by their first keys. | [
"Compares",
"two",
"nodes",
"by",
"their",
"first",
"keys",
"."
] | ff9b17e4349f26168b2d0c4facb1a18cbfbe8cf0 | https://github.com/wuman/orientdb-android/blob/ff9b17e4349f26168b2d0c4facb1a18cbfbe8cf0/commons/src/main/java/com/orientechnologies/common/collection/OMVRBTreeEntry.java#L307-L320 | train |
lightblue-platform/lightblue-migrator | migrator/src/main/java/com/redhat/lightblue/migrator/ConsistencyCheckerController.java | ConsistencyCheckerController.parsePeriod | public static long parsePeriod(String periodStr) {
PeriodFormatter fmt = PeriodFormat.getDefault();
Period p = fmt.parsePeriod(periodStr);
return p.toStandardDuration().getMillis();
} | java | public static long parsePeriod(String periodStr) {
PeriodFormatter fmt = PeriodFormat.getDefault();
Period p = fmt.parsePeriod(periodStr);
return p.toStandardDuration().getMillis();
} | [
"public",
"static",
"long",
"parsePeriod",
"(",
"String",
"periodStr",
")",
"{",
"PeriodFormatter",
"fmt",
"=",
"PeriodFormat",
".",
"getDefault",
"(",
")",
";",
"Period",
"p",
"=",
"fmt",
".",
"parsePeriod",
"(",
"periodStr",
")",
";",
"return",
"p",
".",... | Returns the period in msecs | [
"Returns",
"the",
"period",
"in",
"msecs"
] | ec20748557b40d1f7851e1816d1b76dae48d2027 | https://github.com/lightblue-platform/lightblue-migrator/blob/ec20748557b40d1f7851e1816d1b76dae48d2027/migrator/src/main/java/com/redhat/lightblue/migrator/ConsistencyCheckerController.java#L55-L59 | train |
lightblue-platform/lightblue-migrator | migrator/src/main/java/com/redhat/lightblue/migrator/ConsistencyCheckerController.java | ConsistencyCheckerController.getEndDate | public Date getEndDate(Date startDate, long period) {
long now = getNow().getTime();
long endDate = startDate.getTime() + period;
if (now - period > endDate) {
return new Date(endDate);
} else {
return null;
}
} | java | public Date getEndDate(Date startDate, long period) {
long now = getNow().getTime();
long endDate = startDate.getTime() + period;
if (now - period > endDate) {
return new Date(endDate);
} else {
return null;
}
} | [
"public",
"Date",
"getEndDate",
"(",
"Date",
"startDate",
",",
"long",
"period",
")",
"{",
"long",
"now",
"=",
"getNow",
"(",
")",
".",
"getTime",
"(",
")",
";",
"long",
"endDate",
"=",
"startDate",
".",
"getTime",
"(",
")",
"+",
"period",
";",
"if",... | Returns the end date given the start date end the period. The end date is
startDate+period, but only if endDate is at least one period ago. That
is, we always leave the last incomplete period unprocessed.
Override this to control the job generation algorithm | [
"Returns",
"the",
"end",
"date",
"given",
"the",
"start",
"date",
"end",
"the",
"period",
".",
"The",
"end",
"date",
"is",
"startDate",
"+",
"period",
"but",
"only",
"if",
"endDate",
"is",
"at",
"least",
"one",
"period",
"ago",
".",
"That",
"is",
"we",... | ec20748557b40d1f7851e1816d1b76dae48d2027 | https://github.com/lightblue-platform/lightblue-migrator/blob/ec20748557b40d1f7851e1816d1b76dae48d2027/migrator/src/main/java/com/redhat/lightblue/migrator/ConsistencyCheckerController.java#L68-L76 | train |
lightblue-platform/lightblue-migrator | migrator/src/main/java/com/redhat/lightblue/migrator/ConsistencyCheckerController.java | ConsistencyCheckerController.createJobs | protected List<MigrationJob> createJobs(Date startDate, Date endDate, ActiveExecution ae) throws Exception {
List<MigrationJob> ret = new ArrayList<MigrationJob>();
LOGGER.debug("Creating the migrator to setup new jobs");
// We setup a new migration job
MigrationJob mj = new MigrationJob... | java | protected List<MigrationJob> createJobs(Date startDate, Date endDate, ActiveExecution ae) throws Exception {
List<MigrationJob> ret = new ArrayList<MigrationJob>();
LOGGER.debug("Creating the migrator to setup new jobs");
// We setup a new migration job
MigrationJob mj = new MigrationJob... | [
"protected",
"List",
"<",
"MigrationJob",
">",
"createJobs",
"(",
"Date",
"startDate",
",",
"Date",
"endDate",
",",
"ActiveExecution",
"ae",
")",
"throws",
"Exception",
"{",
"List",
"<",
"MigrationJob",
">",
"ret",
"=",
"new",
"ArrayList",
"<",
"MigrationJob",... | Create a migration job or jobs to process records created between the
given dates. startDate is inclusive, end date is exclusive | [
"Create",
"a",
"migration",
"job",
"or",
"jobs",
"to",
"process",
"records",
"created",
"between",
"the",
"given",
"dates",
".",
"startDate",
"is",
"inclusive",
"end",
"date",
"is",
"exclusive"
] | ec20748557b40d1f7851e1816d1b76dae48d2027 | https://github.com/lightblue-platform/lightblue-migrator/blob/ec20748557b40d1f7851e1816d1b76dae48d2027/migrator/src/main/java/com/redhat/lightblue/migrator/ConsistencyCheckerController.java#L90-L109 | train |
wuman/orientdb-android | core/src/main/java/com/orientechnologies/orient/core/storage/fs/OMMapManagerNew.java | OMMapManagerNew.searchAmongExisting | private OMMapBufferEntry[] searchAmongExisting(OFileMMap file, final OMMapBufferEntry[] fileEntries, final long beginOffset,
final int size) {
if (fileEntries.length == 0) {
return EMPTY_BUFFER_ENTRIES;
}
final OMMapBufferEntry lastEntry = fileEntries[fileEntries.length - 1];
if (las... | java | private OMMapBufferEntry[] searchAmongExisting(OFileMMap file, final OMMapBufferEntry[] fileEntries, final long beginOffset,
final int size) {
if (fileEntries.length == 0) {
return EMPTY_BUFFER_ENTRIES;
}
final OMMapBufferEntry lastEntry = fileEntries[fileEntries.length - 1];
if (las... | [
"private",
"OMMapBufferEntry",
"[",
"]",
"searchAmongExisting",
"(",
"OFileMMap",
"file",
",",
"final",
"OMMapBufferEntry",
"[",
"]",
"fileEntries",
",",
"final",
"long",
"beginOffset",
",",
"final",
"int",
"size",
")",
"{",
"if",
"(",
"fileEntries",
".",
"len... | This method search in already mapped entries to find if necessary entry is already mapped and can be returned.
@param file
to search mapped entry for it.
@param fileEntries
already mapped entries.
@param beginOffset
position in file that should be mmaped.
@param size
size that should be mmaped.
@return {@code EMPTY_BU... | [
"This",
"method",
"search",
"in",
"already",
"mapped",
"entries",
"to",
"find",
"if",
"necessary",
"entry",
"is",
"already",
"mapped",
"and",
"can",
"be",
"returned",
"."
] | ff9b17e4349f26168b2d0c4facb1a18cbfbe8cf0 | https://github.com/wuman/orientdb-android/blob/ff9b17e4349f26168b2d0c4facb1a18cbfbe8cf0/core/src/main/java/com/orientechnologies/orient/core/storage/fs/OMMapManagerNew.java#L188-L245 | train |
wuman/orientdb-android | core/src/main/java/com/orientechnologies/orient/core/storage/fs/OMMapManagerNew.java | OMMapManagerNew.mapNew | private OMMapBufferEntry mapNew(final OFileMMap file, final long beginOffset) throws IOException {
return new OMMapBufferEntry(file, file.map(beginOffset, file.getFileSize() - (int) beginOffset), beginOffset,
file.getFileSize() - (int) beginOffset);
} | java | private OMMapBufferEntry mapNew(final OFileMMap file, final long beginOffset) throws IOException {
return new OMMapBufferEntry(file, file.map(beginOffset, file.getFileSize() - (int) beginOffset), beginOffset,
file.getFileSize() - (int) beginOffset);
} | [
"private",
"OMMapBufferEntry",
"mapNew",
"(",
"final",
"OFileMMap",
"file",
",",
"final",
"long",
"beginOffset",
")",
"throws",
"IOException",
"{",
"return",
"new",
"OMMapBufferEntry",
"(",
"file",
",",
"file",
".",
"map",
"(",
"beginOffset",
",",
"file",
".",... | This method maps new part of file if not all file content is mapped.
@param file
that will be mapped.
@param beginOffset
position in file from what mapping should be applied.
@return mapped entry.
@throws IOException
is thrown if mapping is unsuccessfully. | [
"This",
"method",
"maps",
"new",
"part",
"of",
"file",
"if",
"not",
"all",
"file",
"content",
"is",
"mapped",
"."
] | ff9b17e4349f26168b2d0c4facb1a18cbfbe8cf0 | https://github.com/wuman/orientdb-android/blob/ff9b17e4349f26168b2d0c4facb1a18cbfbe8cf0/core/src/main/java/com/orientechnologies/orient/core/storage/fs/OMMapManagerNew.java#L328-L331 | train |
wuman/orientdb-android | core/src/main/java/com/orientechnologies/orient/core/storage/fs/OMMapManagerNew.java | OMMapManagerNew.acquireLocksOnEntries | private void acquireLocksOnEntries(final OMMapBufferEntry[] entries, OPERATION_TYPE operationType) {
if (operationType == OPERATION_TYPE.WRITE)
for (OMMapBufferEntry entry : entries) {
entry.acquireWriteLock();
entry.setDirty();
}
else
for (OMMapBufferEntry entry : entri... | java | private void acquireLocksOnEntries(final OMMapBufferEntry[] entries, OPERATION_TYPE operationType) {
if (operationType == OPERATION_TYPE.WRITE)
for (OMMapBufferEntry entry : entries) {
entry.acquireWriteLock();
entry.setDirty();
}
else
for (OMMapBufferEntry entry : entri... | [
"private",
"void",
"acquireLocksOnEntries",
"(",
"final",
"OMMapBufferEntry",
"[",
"]",
"entries",
",",
"OPERATION_TYPE",
"operationType",
")",
"{",
"if",
"(",
"operationType",
"==",
"OPERATION_TYPE",
".",
"WRITE",
")",
"for",
"(",
"OMMapBufferEntry",
"entry",
":"... | Locks all entries.
@param entries
that will be locked.
@param operationType
determine read or write lock will be performed. | [
"Locks",
"all",
"entries",
"."
] | ff9b17e4349f26168b2d0c4facb1a18cbfbe8cf0 | https://github.com/wuman/orientdb-android/blob/ff9b17e4349f26168b2d0c4facb1a18cbfbe8cf0/core/src/main/java/com/orientechnologies/orient/core/storage/fs/OMMapManagerNew.java#L348-L357 | train |
wuman/orientdb-android | core/src/main/java/com/orientechnologies/orient/core/storage/fs/OMMapManagerNew.java | OMMapManagerNew.removeFileEntries | private void removeFileEntries(OMMapBufferEntry[] fileEntries) {
if (fileEntries != null) {
for (OMMapBufferEntry entry : fileEntries) {
removeEntry(entry);
}
}
} | java | private void removeFileEntries(OMMapBufferEntry[] fileEntries) {
if (fileEntries != null) {
for (OMMapBufferEntry entry : fileEntries) {
removeEntry(entry);
}
}
} | [
"private",
"void",
"removeFileEntries",
"(",
"OMMapBufferEntry",
"[",
"]",
"fileEntries",
")",
"{",
"if",
"(",
"fileEntries",
"!=",
"null",
")",
"{",
"for",
"(",
"OMMapBufferEntry",
"entry",
":",
"fileEntries",
")",
"{",
"removeEntry",
"(",
"entry",
")",
";"... | Removes all files entries. Flush will be performed before removing.
@param fileEntries
that will be removed. | [
"Removes",
"all",
"files",
"entries",
".",
"Flush",
"will",
"be",
"performed",
"before",
"removing",
"."
] | ff9b17e4349f26168b2d0c4facb1a18cbfbe8cf0 | https://github.com/wuman/orientdb-android/blob/ff9b17e4349f26168b2d0c4facb1a18cbfbe8cf0/core/src/main/java/com/orientechnologies/orient/core/storage/fs/OMMapManagerNew.java#L394-L400 | train |
soi-toolkit/soi-toolkit-mule | tools/soitoolkit-generator/soitoolkit-generator/src/main/java/org/soitoolkit/tools/generator/util/FileUtil.java | FileUtil.getRelativePath | public static String getRelativePath(File file, File srcDir) {
String base = srcDir.getPath();
String filePath = file.getPath();
String relativePath = new File(base).toURI()
.relativize(new File(filePath).toURI()).getPath();
return relativePath;
} | java | public static String getRelativePath(File file, File srcDir) {
String base = srcDir.getPath();
String filePath = file.getPath();
String relativePath = new File(base).toURI()
.relativize(new File(filePath).toURI()).getPath();
return relativePath;
} | [
"public",
"static",
"String",
"getRelativePath",
"(",
"File",
"file",
",",
"File",
"srcDir",
")",
"{",
"String",
"base",
"=",
"srcDir",
".",
"getPath",
"(",
")",
";",
"String",
"filePath",
"=",
"file",
".",
"getPath",
"(",
")",
";",
"String",
"relativePa... | Returns the relative path.
@param file
@param srcDir
@return the relative path | [
"Returns",
"the",
"relative",
"path",
"."
] | e891350dbf55e6307be94d193d056bdb785b37d3 | https://github.com/soi-toolkit/soi-toolkit-mule/blob/e891350dbf55e6307be94d193d056bdb785b37d3/tools/soitoolkit-generator/soitoolkit-generator/src/main/java/org/soitoolkit/tools/generator/util/FileUtil.java#L63-L71 | train |
soi-toolkit/soi-toolkit-mule | tools/soitoolkit-generator/soitoolkit-generator/src/main/java/org/soitoolkit/tools/generator/util/FileUtil.java | FileUtil.copyFile | public static void copyFile(File srcFile, File destFile) {
OutputStream out = null;
InputStream in = null;
try {
if (!destFile.getParentFile().exists())
destFile.getParentFile().mkdirs();
in = new FileInputStream(srcFile);
out = new FileOutputStream(destFile);
// Transfer bytes from in to out
... | java | public static void copyFile(File srcFile, File destFile) {
OutputStream out = null;
InputStream in = null;
try {
if (!destFile.getParentFile().exists())
destFile.getParentFile().mkdirs();
in = new FileInputStream(srcFile);
out = new FileOutputStream(destFile);
// Transfer bytes from in to out
... | [
"public",
"static",
"void",
"copyFile",
"(",
"File",
"srcFile",
",",
"File",
"destFile",
")",
"{",
"OutputStream",
"out",
"=",
"null",
";",
"InputStream",
"in",
"=",
"null",
";",
"try",
"{",
"if",
"(",
"!",
"destFile",
".",
"getParentFile",
"(",
")",
"... | Copy a file to new destination.
@param srcFile
@param destFile | [
"Copy",
"a",
"file",
"to",
"new",
"destination",
"."
] | e891350dbf55e6307be94d193d056bdb785b37d3 | https://github.com/soi-toolkit/soi-toolkit-mule/blob/e891350dbf55e6307be94d193d056bdb785b37d3/tools/soitoolkit-generator/soitoolkit-generator/src/main/java/org/soitoolkit/tools/generator/util/FileUtil.java#L79-L100 | train |
NetsOSS/embedded-jetty | src/main/java/eu/nets/oss/jetty/EmbeddedSpringBuilder.java | EmbeddedSpringBuilder.createSpringContextLoader | public static ContextLoaderListener createSpringContextLoader(final WebApplicationContext webApplicationContext) {
return new ContextLoaderListener() {
@SuppressWarnings("unchecked")
@Override
protected WebApplicationContext createWebApplicationContext(ServletContext sc) {
... | java | public static ContextLoaderListener createSpringContextLoader(final WebApplicationContext webApplicationContext) {
return new ContextLoaderListener() {
@SuppressWarnings("unchecked")
@Override
protected WebApplicationContext createWebApplicationContext(ServletContext sc) {
... | [
"public",
"static",
"ContextLoaderListener",
"createSpringContextLoader",
"(",
"final",
"WebApplicationContext",
"webApplicationContext",
")",
"{",
"return",
"new",
"ContextLoaderListener",
"(",
")",
"{",
"@",
"SuppressWarnings",
"(",
"\"unchecked\"",
")",
"@",
"Override"... | Creates a spring context loader listener
@param webApplicationContext The web application context to use
@return A context loader listener that can be used when starting jetty | [
"Creates",
"a",
"spring",
"context",
"loader",
"listener"
] | c2535867ad4887c4a43a8aa7f95b711ff54c8542 | https://github.com/NetsOSS/embedded-jetty/blob/c2535867ad4887c4a43a8aa7f95b711ff54c8542/src/main/java/eu/nets/oss/jetty/EmbeddedSpringBuilder.java#L25-L33 | train |
lightblue-platform/lightblue-migrator | migrator/src/main/java/com/redhat/lightblue/migrator/Identity.java | Identity.getFieldValue | public static JsonNode getFieldValue(JsonNode doc, String field) {
StringTokenizer tkz = new StringTokenizer(field, ". ");
JsonNode trc = doc;
while (tkz.hasMoreTokens() && trc != null) {
String tok = tkz.nextToken();
trc = trc.get(tok);
}
return trc;
... | java | public static JsonNode getFieldValue(JsonNode doc, String field) {
StringTokenizer tkz = new StringTokenizer(field, ". ");
JsonNode trc = doc;
while (tkz.hasMoreTokens() && trc != null) {
String tok = tkz.nextToken();
trc = trc.get(tok);
}
return trc;
... | [
"public",
"static",
"JsonNode",
"getFieldValue",
"(",
"JsonNode",
"doc",
",",
"String",
"field",
")",
"{",
"StringTokenizer",
"tkz",
"=",
"new",
"StringTokenizer",
"(",
"field",
",",
"\". \"",
")",
";",
"JsonNode",
"trc",
"=",
"doc",
";",
"while",
"(",
"tk... | Ooes not do array index lookup! | [
"Ooes",
"not",
"do",
"array",
"index",
"lookup!"
] | ec20748557b40d1f7851e1816d1b76dae48d2027 | https://github.com/lightblue-platform/lightblue-migrator/blob/ec20748557b40d1f7851e1816d1b76dae48d2027/migrator/src/main/java/com/redhat/lightblue/migrator/Identity.java#L75-L83 | train |
wuman/orientdb-android | core/src/main/java/com/orientechnologies/orient/core/storage/impl/local/OClusterLocal.java | OClusterLocal.getPhysicalPosition | public OPhysicalPosition getPhysicalPosition(final OPhysicalPosition iPPosition) throws IOException {
final long filePosition = iPPosition.clusterPosition * RECORD_SIZE;
acquireSharedLock();
try {
final long[] pos = fileSegment.getRelativePosition(filePosition);
final OFile f = fileSe... | java | public OPhysicalPosition getPhysicalPosition(final OPhysicalPosition iPPosition) throws IOException {
final long filePosition = iPPosition.clusterPosition * RECORD_SIZE;
acquireSharedLock();
try {
final long[] pos = fileSegment.getRelativePosition(filePosition);
final OFile f = fileSe... | [
"public",
"OPhysicalPosition",
"getPhysicalPosition",
"(",
"final",
"OPhysicalPosition",
"iPPosition",
")",
"throws",
"IOException",
"{",
"final",
"long",
"filePosition",
"=",
"iPPosition",
".",
"clusterPosition",
"*",
"RECORD_SIZE",
";",
"acquireSharedLock",
"(",
")",
... | Fills and return the PhysicalPosition object received as parameter with the physical position of logical record iPosition
@throws IOException | [
"Fills",
"and",
"return",
"the",
"PhysicalPosition",
"object",
"received",
"as",
"parameter",
"with",
"the",
"physical",
"position",
"of",
"logical",
"record",
"iPosition"
] | ff9b17e4349f26168b2d0c4facb1a18cbfbe8cf0 | https://github.com/wuman/orientdb-android/blob/ff9b17e4349f26168b2d0c4facb1a18cbfbe8cf0/core/src/main/java/com/orientechnologies/orient/core/storage/impl/local/OClusterLocal.java#L200-L220 | train |
wuman/orientdb-android | core/src/main/java/com/orientechnologies/orient/core/storage/impl/local/OClusterLocal.java | OClusterLocal.removePhysicalPosition | public void removePhysicalPosition(final long iPosition) throws IOException {
final long position = iPosition * RECORD_SIZE;
acquireExclusiveLock();
try {
final long[] pos = fileSegment.getRelativePosition(position);
final OFile file = fileSegment.files[(int) pos[0]];
final long ... | java | public void removePhysicalPosition(final long iPosition) throws IOException {
final long position = iPosition * RECORD_SIZE;
acquireExclusiveLock();
try {
final long[] pos = fileSegment.getRelativePosition(position);
final OFile file = fileSegment.files[(int) pos[0]];
final long ... | [
"public",
"void",
"removePhysicalPosition",
"(",
"final",
"long",
"iPosition",
")",
"throws",
"IOException",
"{",
"final",
"long",
"position",
"=",
"iPosition",
"*",
"RECORD_SIZE",
";",
"acquireExclusiveLock",
"(",
")",
";",
"try",
"{",
"final",
"long",
"[",
"... | Removes the Logical position entry. Add to the hole segment and add the minus to the version.
@throws IOException | [
"Removes",
"the",
"Logical",
"position",
"entry",
".",
"Add",
"to",
"the",
"hole",
"segment",
"and",
"add",
"the",
"minus",
"to",
"the",
"version",
"."
] | ff9b17e4349f26168b2d0c4facb1a18cbfbe8cf0 | https://github.com/wuman/orientdb-android/blob/ff9b17e4349f26168b2d0c4facb1a18cbfbe8cf0/core/src/main/java/com/orientechnologies/orient/core/storage/impl/local/OClusterLocal.java#L283-L304 | train |
wuman/orientdb-android | core/src/main/java/com/orientechnologies/orient/core/storage/impl/local/OClusterLocal.java | OClusterLocal.addPhysicalPosition | public void addPhysicalPosition(final OPhysicalPosition iPPosition) throws IOException {
final long[] pos;
final boolean recycled;
long offset;
acquireExclusiveLock();
try {
offset = holeSegment.popLastEntryPosition();
if (offset > -1) {
// REUSE THE HOLE
pos... | java | public void addPhysicalPosition(final OPhysicalPosition iPPosition) throws IOException {
final long[] pos;
final boolean recycled;
long offset;
acquireExclusiveLock();
try {
offset = holeSegment.popLastEntryPosition();
if (offset > -1) {
// REUSE THE HOLE
pos... | [
"public",
"void",
"addPhysicalPosition",
"(",
"final",
"OPhysicalPosition",
"iPPosition",
")",
"throws",
"IOException",
"{",
"final",
"long",
"[",
"]",
"pos",
";",
"final",
"boolean",
"recycled",
";",
"long",
"offset",
";",
"acquireExclusiveLock",
"(",
")",
";",... | Adds a new entry.
@throws IOException | [
"Adds",
"a",
"new",
"entry",
"."
] | ff9b17e4349f26168b2d0c4facb1a18cbfbe8cf0 | https://github.com/wuman/orientdb-android/blob/ff9b17e4349f26168b2d0c4facb1a18cbfbe8cf0/core/src/main/java/com/orientechnologies/orient/core/storage/impl/local/OClusterLocal.java#L333-L375 | train |
wuman/orientdb-android | core/src/main/java/com/orientechnologies/orient/core/storage/impl/local/OClusterLocal.java | OClusterLocal.setDataSegmentInternal | private void setDataSegmentInternal(final String iName) {
final int dataId = storage.getDataSegmentIdByName(iName);
config.setDataSegmentId(dataId);
storage.getConfiguration().update();
} | java | private void setDataSegmentInternal(final String iName) {
final int dataId = storage.getDataSegmentIdByName(iName);
config.setDataSegmentId(dataId);
storage.getConfiguration().update();
} | [
"private",
"void",
"setDataSegmentInternal",
"(",
"final",
"String",
"iName",
")",
"{",
"final",
"int",
"dataId",
"=",
"storage",
".",
"getDataSegmentIdByName",
"(",
"iName",
")",
";",
"config",
".",
"setDataSegmentId",
"(",
"dataId",
")",
";",
"storage",
".",... | Assigns a different data-segment id.
@param iName
Data-segment's name | [
"Assigns",
"a",
"different",
"data",
"-",
"segment",
"id",
"."
] | ff9b17e4349f26168b2d0c4facb1a18cbfbe8cf0 | https://github.com/wuman/orientdb-android/blob/ff9b17e4349f26168b2d0c4facb1a18cbfbe8cf0/core/src/main/java/com/orientechnologies/orient/core/storage/impl/local/OClusterLocal.java#L562-L566 | train |
soi-toolkit/soi-toolkit-mule | commons/components/commons-mule/src/main/java/org/soitoolkit/commons/mule/log/EventLoggerFactory.java | EventLoggerFactory.getCustomEventLoggerFromRegistry | protected Object getCustomEventLoggerFromRegistry(MuleContext muleContext) {
Object obj = muleContext.getRegistry().lookupObject(
CUSTOM_EVENT_LOGGER_BEAN_NAME);
return obj;
} | java | protected Object getCustomEventLoggerFromRegistry(MuleContext muleContext) {
Object obj = muleContext.getRegistry().lookupObject(
CUSTOM_EVENT_LOGGER_BEAN_NAME);
return obj;
} | [
"protected",
"Object",
"getCustomEventLoggerFromRegistry",
"(",
"MuleContext",
"muleContext",
")",
"{",
"Object",
"obj",
"=",
"muleContext",
".",
"getRegistry",
"(",
")",
".",
"lookupObject",
"(",
"CUSTOM_EVENT_LOGGER_BEAN_NAME",
")",
";",
"return",
"obj",
";",
"}"
... | open up for testing without a live MuleContext | [
"open",
"up",
"for",
"testing",
"without",
"a",
"live",
"MuleContext"
] | e891350dbf55e6307be94d193d056bdb785b37d3 | https://github.com/soi-toolkit/soi-toolkit-mule/blob/e891350dbf55e6307be94d193d056bdb785b37d3/commons/components/commons-mule/src/main/java/org/soitoolkit/commons/mule/log/EventLoggerFactory.java#L120-L124 | train |
wuman/orientdb-android | core/src/main/java/com/orientechnologies/orient/core/index/OCompositeIndexDefinition.java | OCompositeIndexDefinition.addIndex | public void addIndex(final OIndexDefinition indexDefinition) {
indexDefinitions.add(indexDefinition);
if (indexDefinition instanceof OIndexDefinitionMultiValue) {
if (multiValueDefinitionIndex == -1)
multiValueDefinitionIndex = indexDefinitions.size() - 1;
else
throw new OIndex... | java | public void addIndex(final OIndexDefinition indexDefinition) {
indexDefinitions.add(indexDefinition);
if (indexDefinition instanceof OIndexDefinitionMultiValue) {
if (multiValueDefinitionIndex == -1)
multiValueDefinitionIndex = indexDefinitions.size() - 1;
else
throw new OIndex... | [
"public",
"void",
"addIndex",
"(",
"final",
"OIndexDefinition",
"indexDefinition",
")",
"{",
"indexDefinitions",
".",
"add",
"(",
"indexDefinition",
")",
";",
"if",
"(",
"indexDefinition",
"instanceof",
"OIndexDefinitionMultiValue",
")",
"{",
"if",
"(",
"multiValueD... | Add new indexDefinition in current composite.
@param indexDefinition
Index to add. | [
"Add",
"new",
"indexDefinition",
"in",
"current",
"composite",
"."
] | ff9b17e4349f26168b2d0c4facb1a18cbfbe8cf0 | https://github.com/wuman/orientdb-android/blob/ff9b17e4349f26168b2d0c4facb1a18cbfbe8cf0/core/src/main/java/com/orientechnologies/orient/core/index/OCompositeIndexDefinition.java#L100-L109 | train |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.