id
stringlengths
24
24
repo
stringlengths
7
59
path
stringlengths
11
234
func_name
stringlengths
3
140
url
stringlengths
102
339
split
stringclasses
3 values
language
stringclasses
1 value
docstring
stringlengths
1
34k
code
stringlengths
63
466k
text
stringlengths
101
467k
token_count
int32
22
125k
doc_chars
int32
1
34k
code_chars
int32
63
466k
license_basis
stringclasses
1 value
source
stringclasses
1 value
added
stringdate
2026-12-05 00:00:00
2026-12-05 00:00:00
record_sha256
stringlengths
64
64
license
stringclasses
18 values
license_class
stringclasses
4 values
license_source
stringlengths
45
101
bca61d14f5ddb8f3c783fc02
firepick1/firerest-client
src/main/java/org/firepick/FireREST.java
FireREST.errorImage
https://github.com/firepick1/firerest-client/blob/f43c85ca093b1f9f62f0375f905adae9351de1e6/src/main/java/org/firepick/FireREST.java#L56-L87
test
java
Return an red image with the given text auto-sized to fit the current imageWidthximageHeight @param lines one or more lines of text @return image
public BufferedImage errorImage(String... lines) { if (imageBuffer == null || imageBuffer.getWidth() != imageWidth || imageBuffer.getHeight() != imageHeight) { imageBuffer = new BufferedImage(imageWidth, imageHeight, BufferedImage.TYPE_INT_RGB); } Graphics2D g = (Graphics2D) imageBuffer.getGraphics();...
Return an red image with the given text auto-sized to fit the current imageWidthximageHeight @param lines one or more lines of text @return image public BufferedImage errorImage(String... lines) { if (imageBuffer == null || imageBuffer.getWidth() != imageWidth || imageBuffer.getHeight() != imageHeight) { im...
358
146
1,261
CodeSearchNet permissive-repo filter (dataset-level; per-row license absent)
code_search_net
2026-12-05
dca6de4734fad8d41a75e63e77d45e2e9659030332153580bbd5b8abebba4ff6
MIT
permissive
https://github.com/firepick1/firerest-client/blob/master/LICENSE
a7da46a95eed68d708f53019
firepick1/firerest-client
src/main/java/org/firepick/FireREST.java
FireREST.getImage
https://github.com/firepick1/firerest-client/blob/f43c85ca093b1f9f62f0375f905adae9351de1e6/src/main/java/org/firepick/FireREST.java#L94-L119
test
java
Return image from given URL. @return image from url or image with error text
public BufferedImage getImage(URL url) { String now = new Date().toString(); if (url == null) { return errorImage(now, "(No image url)"); } try { HttpURLConnection urlconn = (HttpURLConnection) url.openConnection(); urlconn.setReadTimeout(msTimeout); urlconn.setConnectTimeout(msT...
Return image from given URL. @return image from url or image with error text public BufferedImage getImage(URL url) { String now = new Date().toString(); if (url == null) { return errorImage(now, "(No image url)"); } try { HttpURLConnection urlconn = (HttpURLConnection) url.openConnection(...
244
77
1,050
CodeSearchNet permissive-repo filter (dataset-level; per-row license absent)
code_search_net
2026-12-05
fe149e211a2d83d5f1773aefa95e5f8fc404ce09ee97184ec2618508b135246d
MIT
permissive
https://github.com/firepick1/firerest-client/blob/master/LICENSE
4e8441a7d5dcf9dc0926f60a
firepick1/firerest-client
src/main/java/org/firepick/FireREST.java
FireREST.getJSON
https://github.com/firepick1/firerest-client/blob/f43c85ca093b1f9f62f0375f905adae9351de1e6/src/main/java/org/firepick/FireREST.java#L127-L135
test
java
Load json from given file resource. This is a convenient equivalent to getJSON() with a file URL. @return JSONResult
public JSONResult getJSON(File file) { try { String json = new Scanner(file).useDelimiter("\\Z").next(); return new JSONResult(json); } catch (Throwable e) { throw new FireRESTException(file.toString(), e); } }
Load json from given file resource. This is a convenient equivalent to getJSON() with a file URL. @return JSONResult public JSONResult getJSON(File file) { try { String json = new Scanner(file).useDelimiter("\\Z").next(); return new JSONResult(json); } catch (Throwable e) { throw new Fir...
83
117
246
CodeSearchNet permissive-repo filter (dataset-level; per-row license absent)
code_search_net
2026-12-05
0aab6f744d264af58442bd96d8ac128a7738961644d0d42414da928512fde3c1
MIT
permissive
https://github.com/firepick1/firerest-client/blob/master/LICENSE
bdf58c7b424f4aec96fea944
firepick1/firerest-client
src/main/java/org/firepick/FireREST.java
FireREST.getJSON
https://github.com/firepick1/firerest-client/blob/f43c85ca093b1f9f62f0375f905adae9351de1e6/src/main/java/org/firepick/FireREST.java#L142-L162
test
java
HTTP GET json from given URL resource. @return JSONResult
public JSONResult getJSON(URL url) { try { logger.debug("Requesting {}", url); StringBuilder text = new StringBuilder(); String line; HttpURLConnection urlconn = (HttpURLConnection) url.openConnection(); urlconn.setReadTimeout(msTimeout); urlconn.setConnectTimeout(msTimeout); ...
HTTP GET json from given URL resource. @return JSONResult public JSONResult getJSON(URL url) { try { logger.debug("Requesting {}", url); StringBuilder text = new StringBuilder(); String line; HttpURLConnection urlconn = (HttpURLConnection) url.openConnection(); urlconn.setReadTimeou...
150
58
700
CodeSearchNet permissive-repo filter (dataset-level; per-row license absent)
code_search_net
2026-12-05
99823b95f35702e8ccf083a18f72e133c45805a78483db4660e7546bf711f1e2
MIT
permissive
https://github.com/firepick1/firerest-client/blob/master/LICENSE
62bbbceca26ec727c0c86e78
workplacesystems/utilsj
src/main/java/com/workplacesystems/utilsj/collections/helpers/CollectionUtilities.java
CollectionUtilities.reverse
https://github.com/workplacesystems/utilsj/blob/1b638be51997eafac4d368c14f62a16624a08d3e/src/main/java/com/workplacesystems/utilsj/collections/helpers/CollectionUtilities.java#L41-L50
test
java
Take key and value pairs from source and create map from value to key in target.
public static <K,V> void reverse(Map<K,V> source, Map<V,K> target) { Iterator<K> i = source.keySet().iterator(); while (i.hasNext()) { K key = i.next(); V value = source.get(key); target.put(value, key); } }
Take key and value pairs from source and create map from value to key in target. public static <K,V> void reverse(Map<K,V> source, Map<V,K> target) { Iterator<K> i = source.keySet().iterator(); while (i.hasNext()) { K key = i.next(); V value = source.get(key); ...
84
80
292
CodeSearchNet permissive-repo filter (dataset-level; per-row license absent)
code_search_net
2026-12-05
985c6788f63110d28b4d992a3a5912a68a8c42266f60a7c923599205e5803141
Apache-2.0
permissive
https://github.com/workplacesystems/utilsj/blob/master/LICENSE
130b273c53db5085e1f6e519
workplacesystems/utilsj
src/main/java/com/workplacesystems/utilsj/collections/helpers/CollectionUtilities.java
CollectionUtilities.like
https://github.com/workplacesystems/utilsj/blob/1b638be51997eafac4d368c14f62a16624a08d3e/src/main/java/com/workplacesystems/utilsj/collections/helpers/CollectionUtilities.java#L65-L98
test
java
New empty collection with similar type to source. The known concrete types replicated exactly are {@link ArrayList}, {@link LinkedList}, {@link TreeSet}, {@link HashSet}, {@link Stack}, {@link Stack}, {@link PriorityQueue}, {@link LinkedHashSet}, {@link Vector}. <p> Otherwise, the method only guarantees common conform...
public static<T> Collection<T> like(Collection<T> source) { // known concrete types if (source instanceof FilterableArrayList) return new FilterableArrayList(); if (source instanceof ArrayList) return new ArrayList(); if (source instanceof LinkedList) ...
New empty collection with similar type to source. The known concrete types replicated exactly are {@link ArrayList}, {@link LinkedList}, {@link TreeSet}, {@link HashSet}, {@link Stack}, {@link Stack}, {@link PriorityQueue}, {@link LinkedHashSet}, {@link Vector}. <p> Otherwise, the method only guarantees common conform...
329
412
1,396
CodeSearchNet permissive-repo filter (dataset-level; per-row license absent)
code_search_net
2026-12-05
0a27cbe64930b612497c38c12e7327c6ec8954615ba2d0895d78776f79876d80
Apache-2.0
permissive
https://github.com/workplacesystems/utilsj/blob/master/LICENSE
fa2522c65245bf99207e34b4
gvlasov/collections-utils
src/main/java/org/tenidwa/collections/utils/CartesianProduct.java
CartesianProduct.multiplication
https://github.com/gvlasov/collections-utils/blob/82f20efc8e53ea876896b779e35ed33633ec2e23/src/main/java/org/tenidwa/collections/utils/CartesianProduct.java#L66-L85
test
java
Creates Cartesian product of two lists.
private Set<R> multiplication() { final Set<R> answer = new LinkedHashSet<>( this.one.size() * this.two.size() ); for (final A left : this.one) { for (final B right : this.two) { final R element = this.function.apply(left, right); if (answe...
Creates Cartesian product of two lists. private Set<R> multiplication() { final Set<R> answer = new LinkedHashSet<>( this.one.size() * this.two.size() ); for (final A left : this.one) { for (final B right : this.two) { final R element = this.function.appl...
128
39
735
CodeSearchNet permissive-repo filter (dataset-level; per-row license absent)
code_search_net
2026-12-05
6af4f07f68f07d46c4838c248f6dac793e7129b3d057cb378d4f5f159c7da174
MIT
permissive
https://github.com/gvlasov/collections-utils/blob/master/LICENSE.txt
5bbade5d55e3d7e96cdc07a7
workplacesystems/utilsj
src/main/java/com/workplacesystems/utilsj/threadpool/WorkerThread.java
WorkerThread.start
https://github.com/workplacesystems/utilsj/blob/1b638be51997eafac4d368c14f62a16624a08d3e/src/main/java/com/workplacesystems/utilsj/threadpool/WorkerThread.java#L83-L91
test
java
Sets the thread running
@Override public synchronized void start() { if (!running && !used) { this.running = true; this.used = true; this.setDaemon(true); super.start(); } }
Sets the thread running @Override public synchronized void start() { if (!running && !used) { this.running = true; this.used = true; this.setDaemon(true); super.start(); } }
48
23
208
CodeSearchNet permissive-repo filter (dataset-level; per-row license absent)
code_search_net
2026-12-05
c10b428a80eb28837b6d619fcb0607e4b1b726dc61cf2c0c29eba53f944f2e90
Apache-2.0
permissive
https://github.com/workplacesystems/utilsj/blob/master/LICENSE
e5a4fc5397402cefb65d3779
workplacesystems/utilsj
src/main/java/com/workplacesystems/utilsj/threadpool/WorkerThread.java
WorkerThread.execute
https://github.com/workplacesystems/utilsj/blob/1b638be51997eafac4d368c14f62a16624a08d3e/src/main/java/com/workplacesystems/utilsj/threadpool/WorkerThread.java#L118-L127
test
java
execute @param clsName @param methName @param params @param synObj
public synchronized void execute(Runnable runnable, Object synObj) { this.runnable = runnable; this.syncObject = synObj; if (!running) { //If this is the first time, then kick off the thread. start(); } else { // we already have a thread running so wakeup the waiting thread. ...
execute @param clsName @param methName @param params @param synObj public synchronized void execute(Runnable runnable, Object synObj) { this.runnable = runnable; this.syncObject = synObj; if (!running) { //If this is the first time, then kick off the thread. start(); } else { //...
94
66
358
CodeSearchNet permissive-repo filter (dataset-level; per-row license absent)
code_search_net
2026-12-05
f11d087492ac66e8d5f8dad067ffe54414b583572ae1bab683a12ef2003b490d
Apache-2.0
permissive
https://github.com/workplacesystems/utilsj/blob/master/LICENSE
99f09e4d68ec1a636663a88c
workplacesystems/utilsj
src/main/java/com/workplacesystems/utilsj/threadpool/WorkerThread.java
WorkerThread.run
https://github.com/workplacesystems/utilsj/blob/1b638be51997eafac4d368c14f62a16624a08d3e/src/main/java/com/workplacesystems/utilsj/threadpool/WorkerThread.java#L132-L163
test
java
/* (non-Javadoc) @see java.lang.Runnable#run()
@Override public void run() { while (running) { Runnable _runnable = null; synchronized (this) { while (running && runnable == null) { try { this.wait(); } catch (InterruptedException e) {} // Ignore, as interrupts are not used ...
/* (non-Javadoc) @see java.lang.Runnable#run() @Override public void run() { while (running) { Runnable _runnable = null; synchronized (this) { while (running && runnable == null) { try { this.wait(); } catch (InterruptedExcept...
175
46
931
CodeSearchNet permissive-repo filter (dataset-level; per-row license absent)
code_search_net
2026-12-05
503d1e66a8c3d19664b3795dbf89876b98e342ced6179b0d5458f067f30f7035
Apache-2.0
permissive
https://github.com/workplacesystems/utilsj/blob/master/LICENSE
8b3df774b91e28d8cfb04c0c
workplacesystems/utilsj
src/main/java/com/workplacesystems/utilsj/threadpool/WorkerThread.java
WorkerThread.returnToPool
https://github.com/workplacesystems/utilsj/blob/1b638be51997eafac4d368c14f62a16624a08d3e/src/main/java/com/workplacesystems/utilsj/threadpool/WorkerThread.java#L168-L177
test
java
Returns the thread to the pool.
private void returnToPool() { if(pool != null) { try { pool.returnObject(this); } catch (Exception e1) { log.error("Exception :", e1); } this.pool = null; } }
Returns the thread to the pool. private void returnToPool() { if(pool != null) { try { pool.returnObject(this); } catch (Exception e1) { log.error("Exception :", e1); } this.pool = null; } }
60
31
242
CodeSearchNet permissive-repo filter (dataset-level; per-row license absent)
code_search_net
2026-12-05
295a1aeba622172099842fa4043c242ed5ac31399d727e73ec7919487c06dca6
Apache-2.0
permissive
https://github.com/workplacesystems/utilsj/blob/master/LICENSE
a73a4b3f5910368f01bb99dd
workplacesystems/utilsj
src/main/java/com/workplacesystems/utilsj/collections/decorators/SynchronizedBidiMap.java
SynchronizedBidiMap.decorate
https://github.com/workplacesystems/utilsj/blob/1b638be51997eafac4d368c14f62a16624a08d3e/src/main/java/com/workplacesystems/utilsj/collections/decorators/SynchronizedBidiMap.java#L38-L40
test
java
Factory method to create a synchronized map. @param map the map to decorate, must not be null @throws IllegalArgumentException if map is null
public static <K,V> BidiMap<K,V> decorate(BidiMap<K,V> map) { return new SynchronizedBidiMap<K,V>(map); }
Factory method to create a synchronized map. @param map the map to decorate, must not be null @throws IllegalArgumentException if map is null public static <K,V> BidiMap<K,V> decorate(BidiMap<K,V> map) { return new SynchronizedBidiMap<K,V>(map); }
66
143
119
CodeSearchNet permissive-repo filter (dataset-level; per-row license absent)
code_search_net
2026-12-05
3031cd143693f27e8fb5e15c7f96bcce84bc0c6f0ec36e456f296ec5030e144b
Apache-2.0
permissive
https://github.com/workplacesystems/utilsj/blob/master/LICENSE
9838301dc405eb31ce53434b
abmargb/jamppa
src/main/java/org/jivesoftware/smack/util/Base64.java
Base64.decode4to3
https://github.com/abmargb/jamppa/blob/76f253239923df40904c462e3b88e7278b36b282/src/main/java/org/jivesoftware/smack/util/Base64.java#L741-L807
test
java
Decodes four bytes from array <var>source</var> and writes the resulting bytes (up to three of them) to <var>destination</var>. The source and destination arrays can be manipulated anywhere along their length by specifying <var>srcOffset</var> and <var>destOffset</var>. This method does not check to make sure your arra...
private static int decode4to3(byte[] source, int srcOffset, byte[] destination, int destOffset, int options) { byte[] DECODABET = getDecodabet(options); // Example: Dk== if (source[srcOffset + 2] == EQUALS_SIGN) { // Two ways to do the same thing. Don't know which way I ...
Decodes four bytes from array <var>source</var> and writes the resulting bytes (up to three of them) to <var>destination</var>. The source and destination arrays can be manipulated anywhere along their length by specifying <var>srcOffset</var> and <var>destOffset</var>. This method does not check to make sure your arra...
1,135
987
3,209
CodeSearchNet permissive-repo filter (dataset-level; per-row license absent)
code_search_net
2026-12-05
8988f79095684d60616835a19ccc11b34e030a31dde69bce25f350e4532d1fa3
Apache-2.0
permissive
https://github.com/abmargb/jamppa/blob/master/LICENSE
bc459e9e1979c583727afa09
abmargb/jamppa
src/main/java/org/jivesoftware/whack/util/StringUtils.java
StringUtils.parseName
https://github.com/abmargb/jamppa/blob/76f253239923df40904c462e3b88e7278b36b282/src/main/java/org/jivesoftware/whack/util/StringUtils.java#L60-L70
test
java
Returns the name portion of a XMPP address. For example, for the address "matt@jivesoftware.com/Smack", "matt" would be returned. If no username is present in the address, the empty string will be returned. @param XMPPAddress the XMPP address. @return the name portion of the XMPP address.
public static String parseName(String XMPPAddress) { if (XMPPAddress == null) { return null; } int atIndex = XMPPAddress.indexOf("@"); if (atIndex <= 0) { return ""; } else { return XMPPAddress.substring(0, atIndex); } }
Returns the name portion of a XMPP address. For example, for the address "matt@jivesoftware.com/Smack", "matt" would be returned. If no username is present in the address, the empty string will be returned. @param XMPPAddress the XMPP address. @return the name portion of the XMPP address. public static String parseNa...
143
290
308
CodeSearchNet permissive-repo filter (dataset-level; per-row license absent)
code_search_net
2026-12-05
925f1272ea6aaf0ab96f72d1fbe8fdffdcdb394a212b7bb05adf0d6d2b7d4f51
Apache-2.0
permissive
https://github.com/abmargb/jamppa/blob/master/LICENSE
ceebcb7768de8469e135ef02
abmargb/jamppa
src/main/java/org/jivesoftware/whack/util/StringUtils.java
StringUtils.escapeForXML
https://github.com/abmargb/jamppa/blob/76f253239923df40904c462e3b88e7278b36b282/src/main/java/org/jivesoftware/whack/util/StringUtils.java#L151-L207
test
java
Escapes all necessary characters in the String so that it can be used in an XML doc. @param string the string to escape. @return the string with appropriate characters escaped.
public static final String escapeForXML(String string) { if (string == null) { return null; } char ch; int i = 0; int last = 0; char[] input = string.toCharArray(); int len = input.length; StringBuffer out = new StringBuffer((int) (len * 1.3));...
Escapes all necessary characters in the String so that it can be used in an XML doc. @param string the string to escape. @return the string with appropriate characters escaped. public static final String escapeForXML(String string) { if (string == null) { return null; } char ch; ...
456
177
1,881
CodeSearchNet permissive-repo filter (dataset-level; per-row license absent)
code_search_net
2026-12-05
c4497f29f4450363150d3746e2ef589621f7577f2967960cd1b39bd23256fd09
Apache-2.0
permissive
https://github.com/abmargb/jamppa/blob/master/LICENSE
78c96399a945d8a911415a68
abmargb/jamppa
src/main/java/org/jivesoftware/whack/util/StringUtils.java
StringUtils.hash
https://github.com/abmargb/jamppa/blob/76f253239923df40904c462e3b88e7278b36b282/src/main/java/org/jivesoftware/whack/util/StringUtils.java#L231-L247
test
java
Hashes a String using the SHA-1 algorithm and returns the result as a String of hexadecimal numbers. This method is synchronized to avoid excessive MessageDigest object creation. If calling this method becomes a bottleneck in your code, you may wish to maintain a pool of MessageDigest objects instead of using this meth...
public synchronized static final String hash(String data) { if (digest == null) { try { digest = MessageDigest.getInstance("SHA-1"); } catch (NoSuchAlgorithmException nsae) { System.err.println("Failed to load the SHA-1 MessageDigest. " ...
Hashes a String using the SHA-1 algorithm and returns the result as a String of hexadecimal numbers. This method is synchronized to avoid excessive MessageDigest object creation. If calling this method becomes a bottleneck in your code, you may wish to maintain a pool of MessageDigest objects instead of using this meth...
279
718
636
CodeSearchNet permissive-repo filter (dataset-level; per-row license absent)
code_search_net
2026-12-05
970c48da9cfce9d192795cf7f533f2b0bc5badbe7a7b87c0267639ce7d3d4a59
Apache-2.0
permissive
https://github.com/abmargb/jamppa/blob/master/LICENSE
8fb5dbf7205e90d4de76f4ca
abmargb/jamppa
src/main/java/org/jivesoftware/whack/util/StringUtils.java
StringUtils.encodeHex
https://github.com/abmargb/jamppa/blob/76f253239923df40904c462e3b88e7278b36b282/src/main/java/org/jivesoftware/whack/util/StringUtils.java#L261-L272
test
java
Turns an array of bytes into a String representing each byte as an unsigned hex number. <p> Method by Santeri Paavolainen, Helsinki Finland 1996<br> (c) Santeri Paavolainen, Helsinki Finland 1996<br> Distributed under LGPL. @param bytes an array of bytes to convert to a hex-string @return generated hex string
public static final String encodeHex(byte[] bytes) { StringBuffer buf = new StringBuffer(bytes.length * 2); int i; for (i = 0; i < bytes.length; i++) { if (((int) bytes[i] & 0xff) < 0x10) { buf.append("0"); } buf.append(Long.toString((int) byt...
Turns an array of bytes into a String representing each byte as an unsigned hex number. <p> Method by Santeri Paavolainen, Helsinki Finland 1996<br> (c) Santeri Paavolainen, Helsinki Finland 1996<br> Distributed under LGPL. @param bytes an array of bytes to convert to a hex-string @return generated hex string public ...
178
311
386
CodeSearchNet permissive-repo filter (dataset-level; per-row license absent)
code_search_net
2026-12-05
6a22fcf6ea16f6a72e88a653e1b26af30b82c35b726a15d4b24277d424814a23
Apache-2.0
permissive
https://github.com/abmargb/jamppa/blob/master/LICENSE
e69e330a97232d0a600768f4
abmargb/jamppa
src/main/java/org/jivesoftware/smack/sasl/SASLMechanism.java
SASLMechanism.authenticate
https://github.com/abmargb/jamppa/blob/76f253239923df40904c462e3b88e7278b36b282/src/main/java/org/jivesoftware/smack/sasl/SASLMechanism.java#L144-L161
test
java
Builds and sends the <tt>auth</tt> stanza to the server. Note that this method of authentication is not recommended, since it is very inflexable. Use {@link #authenticate(String, String, CallbackHandler)} whenever possible. Explanation of auth stanza: The client authentication stanza needs to include the digest-uri o...
public void authenticate(String username, String host, String serviceName, String password) throws IOException, XMPPException { // Since we were not provided with a CallbackHandler, we will use our // own with the given // information // Set the authenticationID as the usern...
Builds and sends the <tt>auth</tt> stanza to the server. Note that this method of authentication is not recommended, since it is very inflexable. Use {@link #authenticate(String, String, CallbackHandler)} whenever possible. Explanation of auth stanza: The client authentication stanza needs to include the digest-uri o...
709
2,442
734
CodeSearchNet permissive-repo filter (dataset-level; per-row license absent)
code_search_net
2026-12-05
aa71e562abf57bd272ef5a53c32aec3aa3245b611fe1b7e0c410e377b28ab348
Apache-2.0
permissive
https://github.com/abmargb/jamppa/blob/master/LICENSE
563f30852ce806002a78c9c6
abmargb/jamppa
src/main/java/org/jivesoftware/smack/sasl/SASLMechanism.java
SASLMechanism.authenticate
https://github.com/abmargb/jamppa/blob/76f253239923df40904c462e3b88e7278b36b282/src/main/java/org/jivesoftware/smack/sasl/SASLMechanism.java#L183-L186
test
java
Same as {@link #authenticate(String, String, String, String)}, but with the hostname used as the serviceName. <p> Kept for backward compatibility only. @param username the username of the user being authenticated. @param host the hostname where the user account resides. @param password the password for this account. @...
public void authenticate(String username, String host, String password) throws IOException, XMPPException { authenticate(username, host, host, password); }
Same as {@link #authenticate(String, String, String, String)}, but with the hostname used as the serviceName. <p> Kept for backward compatibility only. @param username the username of the user being authenticated. @param host the hostname where the user account resides. @param password the password for this account. @...
146
555
179
CodeSearchNet permissive-repo filter (dataset-level; per-row license absent)
code_search_net
2026-12-05
0e142d6751dc58cdf6f5fd0e0d4553c558d6a1c0dcee0ff564a595fcca1a9e4f
Apache-2.0
permissive
https://github.com/abmargb/jamppa/blob/master/LICENSE
daafd8cc46508e879af89fda
abmargb/jamppa
src/main/java/org/jivesoftware/smack/sasl/SASLMechanism.java
SASLMechanism.authenticate
https://github.com/abmargb/jamppa/blob/76f253239923df40904c462e3b88e7278b36b282/src/main/java/org/jivesoftware/smack/sasl/SASLMechanism.java#L204-L211
test
java
Builds and sends the <tt>auth</tt> stanza to the server. The callback handler will handle any additional information, such as the authentication ID or realm, if it is needed. @param username the username of the user being authenticated. @param host the hostname where the user account resides. @param cbh the CallbackHa...
public void authenticate(String username, String host, CallbackHandler cbh) throws IOException, XMPPException { String[] mechanisms = { getName() }; Map<String, String> props = new HashMap<String, String>(); sc = Sasl.createSaslClient(mechanisms, username, "xmpp", host, props, ...
Builds and sends the <tt>auth</tt> stanza to the server. The callback handler will handle any additional information, such as the authentication ID or realm, if it is needed. @param username the username of the user being authenticated. @param host the hostname where the user account resides. @param cbh the CallbackHa...
185
505
365
CodeSearchNet permissive-repo filter (dataset-level; per-row license absent)
code_search_net
2026-12-05
4704cad3c13098e83d8b314f448c3490678ecfddb89aef1cf69d0f1104b30941
Apache-2.0
permissive
https://github.com/abmargb/jamppa/blob/master/LICENSE
940955ca5d082a0d597a7fb2
abmargb/jamppa
src/main/java/org/jivesoftware/smack/sasl/SASLMechanism.java
SASLMechanism.challengeReceived
https://github.com/abmargb/jamppa/blob/76f253239923df40904c462e3b88e7278b36b282/src/main/java/org/jivesoftware/smack/sasl/SASLMechanism.java#L238-L257
test
java
The server is challenging the SASL mechanism for the stanza he just sent. Send a response to the server's challenge. @param challenge a base64 encoded string representing the challenge. @throws IOException if an exception sending the response occurs.
public void challengeReceived(String challenge) throws IOException { byte response[]; if (challenge != null) { response = sc .evaluateChallenge(StringUtils.decodeBase64(challenge)); } else { response = sc.evaluateChallenge(new byte[0]); } ...
The server is challenging the SASL mechanism for the stanza he just sent. Send a response to the server's challenge. @param challenge a base64 encoded string representing the challenge. @throws IOException if an exception sending the response occurs. public void challengeReceived(String challenge) throws IOException ...
169
251
666
CodeSearchNet permissive-repo filter (dataset-level; per-row license absent)
code_search_net
2026-12-05
487d647185fc048421f1226c2d4291f50694b270fb4f6e40cda2e0bc75c5cce7
Apache-2.0
permissive
https://github.com/abmargb/jamppa/blob/master/LICENSE
244b7e95bc10aeb0e9f62a9c
abmargb/jamppa
src/main/java/org/jamppa/XMPPBase.java
XMPPBase.process
https://github.com/abmargb/jamppa/blob/76f253239923df40904c462e3b88e7278b36b282/src/main/java/org/jamppa/XMPPBase.java#L21-L39
test
java
@throws ComponentException
public void process(boolean block) { Runnable componentRunnable = new Runnable() { @Override public void run() { try { mutex.acquire(); } catch (InterruptedException e) { LOGGER.fatal("Main loop.", e); ...
@throws ComponentException public void process(boolean block) { Runnable componentRunnable = new Runnable() { @Override public void run() { try { mutex.acquire(); } catch (InterruptedException e) { LOGGER.fatal("Mai...
101
26
522
CodeSearchNet permissive-repo filter (dataset-level; per-row license absent)
code_search_net
2026-12-05
e410430bc29b0d0be348500890f0275127be57642113a981b2e2a442397c5c0f
Apache-2.0
permissive
https://github.com/abmargb/jamppa/blob/master/LICENSE
48f6fe79d50f66716750d515
abmargb/jamppa
src/main/java/org/jivesoftware/smack/debugger/LiteDebugger.java
LiteDebugger.rootWindowClosing
https://github.com/abmargb/jamppa/blob/76f253239923df40904c462e3b88e7278b36b282/src/main/java/org/jivesoftware/smack/debugger/LiteDebugger.java#L293-L297
test
java
Notification that the root window is closing. Stop listening for received and transmitted packets. @param evt the event that indicates that the root window is closing
public void rootWindowClosing(WindowEvent evt) { connection.removePacketListener(listener); ((ObservableReader) reader).removeReaderListener(readerListener); ((ObservableWriter) writer).removeWriterListener(writerListener); }
Notification that the root window is closing. Stop listening for received and transmitted packets. @param evt the event that indicates that the root window is closing public void rootWindowClosing(WindowEvent evt) { connection.removePacketListener(listener); ((ObservableReader) reader).removeReaderLis...
76
167
253
CodeSearchNet permissive-repo filter (dataset-level; per-row license absent)
code_search_net
2026-12-05
655bcc2de08edf18ed5e998d7e41195b143da20e44defb1f62fcdea8c2c7f485
Apache-2.0
permissive
https://github.com/abmargb/jamppa/blob/master/LICENSE
1737bfa8d78002fc97b756bd
workplacesystems/utilsj
src/main/java/com/workplacesystems/utilsj/collections/decorators/SynchronizedFilterableMap.java
SynchronizedFilterableMap.decorate
https://github.com/workplacesystems/utilsj/blob/1b638be51997eafac4d368c14f62a16624a08d3e/src/main/java/com/workplacesystems/utilsj/collections/decorators/SynchronizedFilterableMap.java#L35-L37
test
java
Factory method to create a synchronized map. @param map the map to decorate, must not be null @throws IllegalArgumentException if map is null
public static <K,V> FilterableMap<K,V> decorate(FilterableMap<K,V> map) { return new SynchronizedFilterableMap<K,V>(map); }
Factory method to create a synchronized map. @param map the map to decorate, must not be null @throws IllegalArgumentException if map is null public static <K,V> FilterableMap<K,V> decorate(FilterableMap<K,V> map) { return new SynchronizedFilterableMap<K,V>(map); }
66
143
137
CodeSearchNet permissive-repo filter (dataset-level; per-row license absent)
code_search_net
2026-12-05
6f67160dc431942fcde4e8bc4a722630d565db90abe50d97c2c273567dd763bb
Apache-2.0
permissive
https://github.com/workplacesystems/utilsj/blob/master/LICENSE
cdd0a9e36f647a74ee382153
DDTH/ddth-cql-utils
src/main/java/com/github/ddth/cql/internal/SessionIdentifier.java
SessionIdentifier.getInstance
https://github.com/DDTH/ddth-cql-utils/blob/debd5d86f64fe06e43d6f0f58cb2f7f0f6a84489/src/main/java/com/github/ddth/cql/internal/SessionIdentifier.java#L44-L47
test
java
Helper method to get an instance of {@link SessionIdentifier}. @param hostsAndPorts example {@code "localhost:9042,host2,host3:19042"} @param username username to authenticate against Cassandra cluster @param password password to authenticate against Cassandra cluster @param keyspace keyspace to connect to @return
public static SessionIdentifier getInstance(String hostsAndPorts, String username, String password, String keyspace) { return getInstance(hostsAndPorts, username, password, null, keyspace); }
Helper method to get an instance of {@link SessionIdentifier}. @param hostsAndPorts example {@code "localhost:9042,host2,host3:19042"} @param username username to authenticate against Cassandra cluster @param password password to authenticate against Cassandra cluster @param keyspace keyspace to connect to @return pu...
109
316
215
CodeSearchNet permissive-repo filter (dataset-level; per-row license absent)
code_search_net
2026-12-05
58f3060dfd79ac73c85eec7182856c12b93185271a9bbe400125f3cfc516fd5d
MIT
permissive
https://github.com/DDTH/ddth-cql-utils/blob/master/LICENSE.txt
5fa7d3c95277c1a818a0e6f4
abmargb/jamppa
src/main/java/org/jamppa/component/XMPPComponent.java
XMPPComponent.handleIQResult
https://github.com/abmargb/jamppa/blob/76f253239923df40904c462e3b88e7278b36b282/src/main/java/org/jamppa/component/XMPPComponent.java#L234-L243
test
java
/* (non-Javadoc) @see org.xmpp.component.AbstractComponent#handleIQResult(org.xmpp.packet.IQ)
@Override protected void handleIQResult(IQ iq) { String packetCallbackId = iq.getID() + "@" + iq.getFrom().toBareJID(); PacketCallback callback = packetCallbacks.get(packetCallbackId); if (callback != null) { callback.handle(iq); packetCallbacks.remove(packetCa...
/* (non-Javadoc) @see org.xmpp.component.AbstractComponent#handleIQResult(org.xmpp.packet.IQ) @Override protected void handleIQResult(IQ iq) { String packetCallbackId = iq.getID() + "@" + iq.getFrom().toBareJID(); PacketCallback callback = packetCallbacks.get(packetCallbackId); if (...
100
94
346
CodeSearchNet permissive-repo filter (dataset-level; per-row license absent)
code_search_net
2026-12-05
904901d1589fd1b6d71fc512f9c49ca30fd3edc64234cac32e9e247279af0987
Apache-2.0
permissive
https://github.com/abmargb/jamppa/blob/master/LICENSE
422eff4f54c7bdb7ff75629f
abmargb/jamppa
src/main/java/org/jamppa/component/XMPPComponent.java
XMPPComponent.syncSendPacket
https://github.com/abmargb/jamppa/blob/76f253239923df40904c462e3b88e7278b36b282/src/main/java/org/jamppa/component/XMPPComponent.java#L256-L274
test
java
/* (non-Javadoc) @see org.jamppa.component.PacketSender#syncSendPacket(org.xmpp.packet.Packet)
@Override public Packet syncSendPacket(Packet packet) { final BlockingQueue<Packet> queue = new ArrayBlockingQueue<Packet>(1); packetCallbacks.put(packet.getID() + "@" + packet.getTo().toBareJID(), new PacketCallback() { @Override public void h...
/* (non-Javadoc) @see org.jamppa.component.PacketSender#syncSendPacket(org.xmpp.packet.Packet) @Override public Packet syncSendPacket(Packet packet) { final BlockingQueue<Packet> queue = new ArrayBlockingQueue<Packet>(1); packetCallbacks.put(packet.getID() + "@" + packet.getTo().toBareJID(), ...
150
95
712
CodeSearchNet permissive-repo filter (dataset-level; per-row license absent)
code_search_net
2026-12-05
52182507e2230a15e570f02b8dba2c71e63c4251a9c7fb703ea3542a41b5ee4e
Apache-2.0
permissive
https://github.com/abmargb/jamppa/blob/master/LICENSE
734df100826beab31ead0d15
abmargb/jamppa
src/main/java/org/jivesoftware/smack/RosterGroup.java
RosterGroup.setName
https://github.com/abmargb/jamppa/blob/76f253239923df40904c462e3b88e7278b36b282/src/main/java/org/jivesoftware/smack/RosterGroup.java#L79-L93
test
java
Sets the name of the group. Changing the group's name is like moving all the group entries of the group to a new group specified by the new name. Since this group won't have entries it will be removed from the roster. This means that all the references to this object will be invalid and will need to be updated to the n...
public void setName(String name) { synchronized (entries) { for (RosterEntry entry : entries) { Roster packet = new Roster(); packet.setType(IQ.Type.set); List<String> groupNames = new LinkedList<String>( entry.getGroupNames());...
Sets the name of the group. Changing the group's name is like moving all the group entries of the group to a new group specified by the new name. Since this group won't have entries it will be removed from the roster. This means that all the references to this object will be invalid and will need to be updated to the n...
193
391
633
CodeSearchNet permissive-repo filter (dataset-level; per-row license absent)
code_search_net
2026-12-05
ce2953f8d01d5d6bb14e2c33a85864954700331b4f5a81a2ccc2312888e3032b
Apache-2.0
permissive
https://github.com/abmargb/jamppa/blob/master/LICENSE
e847559ab2437bc4475ec25e
abmargb/jamppa
src/main/java/org/jivesoftware/smack/RosterGroup.java
RosterGroup.getEntry
https://github.com/abmargb/jamppa/blob/76f253239923df40904c462e3b88e7278b36b282/src/main/java/org/jivesoftware/smack/RosterGroup.java#L127-L143
test
java
Returns the roster entry associated with the given XMPP address or <tt>null</tt> if the user is not an entry in the group. @param user the XMPP address of the user (eg "jsmith@example.com"). @return the roster entry or <tt>null</tt> if it does not exist in the group.
public RosterEntry getEntry(String user) { if (user == null) { return null; } // Roster entries never include a resource so remove the resource // if it's a part of the XMPP address. user = StringUtils.parseBareAddress(user); String userLowerCase = user.toLowe...
Returns the roster entry associated with the given XMPP address or <tt>null</tt> if the user is not an entry in the group. @param user the XMPP address of the user (eg "jsmith@example.com"). @return the roster entry or <tt>null</tt> if it does not exist in the group. public RosterEntry getEntry(String user) { ...
182
268
573
CodeSearchNet permissive-repo filter (dataset-level; per-row license absent)
code_search_net
2026-12-05
3ed4f7e4b1313b88d8064fdaa93327cfb7515f88058c3acec2cc893fd577dff2
Apache-2.0
permissive
https://github.com/abmargb/jamppa/blob/master/LICENSE
48326d820727df1313e30d3e
abmargb/jamppa
src/main/java/org/jivesoftware/smack/RosterGroup.java
RosterGroup.addEntry
https://github.com/abmargb/jamppa/blob/76f253239923df40904c462e3b88e7278b36b282/src/main/java/org/jivesoftware/smack/RosterGroup.java#L181-L213
test
java
Adds a roster entry to this group. If the entry was unfiled then it will be removed from the unfiled list and will be added to this group. Note that this is an asynchronous call -- Smack must wait for the server to receive the updated roster. @param entry a roster entry. @throws XMPPException if an error occured while...
public void addEntry(RosterEntry entry) throws XMPPException { PacketCollector collector = null; // Only add the entry if it isn't already in the list. synchronized (entries) { if (!entries.contains(entry)) { Roster packet = new Roster(); packet.setTyp...
Adds a roster entry to this group. If the entry was unfiled then it will be removed from the unfiled list and will be added to this group. Note that this is an asynchronous call -- Smack must wait for the server to receive the updated roster. @param entry a roster entry. @throws XMPPException if an error occured while...
350
358
1,507
CodeSearchNet permissive-repo filter (dataset-level; per-row license absent)
code_search_net
2026-12-05
68d3773a2c918f01b02315af7a134f9f836349e3663e0150cd257b5b3974504a
Apache-2.0
permissive
https://github.com/abmargb/jamppa/blob/master/LICENSE
4d78d989f61b8e76449148ac
abmargb/jamppa
src/main/java/org/jivesoftware/smack/util/collections/AbstractHashedMap.java
AbstractHashedMap.get
https://github.com/abmargb/jamppa/blob/76f253239923df40904c462e3b88e7278b36b282/src/main/java/org/jivesoftware/smack/util/collections/AbstractHashedMap.java#L207-L221
test
java
Gets the value mapped to the key specified. @param key the key @return the mapped value, null if no match
public V get(Object key) { int hashCode = hash((key == null) ? NULL : key); HashEntry<K, V> entry = data[hashIndex(hashCode, data.length)]; // no // local // fo...
Gets the value mapped to the key specified. @param key the key @return the mapped value, null if no match public V get(Object key) { int hashCode = hash((key == null) ? NULL : key); HashEntry<K, V> entry = data[hashIndex(hashCode, data.length)]; // no ...
129
106
714
CodeSearchNet permissive-repo filter (dataset-level; per-row license absent)
code_search_net
2026-12-05
721b10aa5315a77772a9875a529efdc31214889545f1c6e45a827ebdba3bb5ff
Apache-2.0
permissive
https://github.com/abmargb/jamppa/blob/master/LICENSE
8e291c24cef357e3bc929bfc
abmargb/jamppa
src/main/java/org/jivesoftware/smack/util/collections/AbstractHashedMap.java
AbstractHashedMap.containsKey
https://github.com/abmargb/jamppa/blob/76f253239923df40904c462e3b88e7278b36b282/src/main/java/org/jivesoftware/smack/util/collections/AbstractHashedMap.java#L249-L261
test
java
Checks whether the map contains the specified key. @param key the key to search for @return true if the map contains the key
public boolean containsKey(Object key) { int hashCode = hash((key == null) ? NULL : key); HashEntry entry = data[hashIndex(hashCode, data.length)]; // no local // for hash ...
Checks whether the map contains the specified key. @param key the key to search for @return true if the map contains the key public boolean containsKey(Object key) { int hashCode = hash((key == null) ? NULL : key); HashEntry entry = data[hashIndex(hashCode, data.length)]; // no local ...
121
125
554
CodeSearchNet permissive-repo filter (dataset-level; per-row license absent)
code_search_net
2026-12-05
cbad7a0b34f033c7d325ccf04bf6b34cab553f21a1343ea516df15685f21b388
Apache-2.0
permissive
https://github.com/abmargb/jamppa/blob/master/LICENSE
7be87c704078bfecde7fcd28
abmargb/jamppa
src/main/java/org/jivesoftware/smack/util/collections/AbstractHashedMap.java
AbstractHashedMap.containsValue
https://github.com/abmargb/jamppa/blob/76f253239923df40904c462e3b88e7278b36b282/src/main/java/org/jivesoftware/smack/util/collections/AbstractHashedMap.java#L270-L293
test
java
Checks whether the map contains the specified value. @param value the value to search for @return true if the map contains the value
public boolean containsValue(Object value) { if (value == null) { for (int i = 0, isize = data.length; i < isize; i++) { HashEntry entry = data[i]; while (entry != null) { if (entry.getValue() == null) { return true; ...
Checks whether the map contains the specified value. @param value the value to search for @return true if the map contains the value public boolean containsValue(Object value) { if (value == null) { for (int i = 0, isize = data.length; i < isize; i++) { HashEntry entry = data[i]; ...
182
133
807
CodeSearchNet permissive-repo filter (dataset-level; per-row license absent)
code_search_net
2026-12-05
4ce2b6a7accb45fcb81c578ea04407810ed7137e266267c494f6b4e91bfc4106
Apache-2.0
permissive
https://github.com/abmargb/jamppa/blob/master/LICENSE
ad7a6c0d16296deb521cadc9
abmargb/jamppa
src/main/java/org/jivesoftware/smack/util/collections/AbstractHashedMap.java
AbstractHashedMap.put
https://github.com/abmargb/jamppa/blob/76f253239923df40904c462e3b88e7278b36b282/src/main/java/org/jivesoftware/smack/util/collections/AbstractHashedMap.java#L305-L319
test
java
Puts a key-value mapping into this map. @param key the key to add @param value the value to add @return the value previously mapped to this key, null if none
public V put(K key, V value) { int hashCode = hash((key == null) ? NULL : key); int index = hashIndex(hashCode, data.length); HashEntry<K, V> entry = data[index]; while (entry != null) { if (entry.hashCode == hashCode && isEqualKey(key, entry.getKey())) { V ol...
Puts a key-value mapping into this map. @param key the key to add @param value the value to add @return the value previously mapped to this key, null if none public V put(K key, V value) { int hashCode = hash((key == null) ? NULL : key); int index = hashIndex(hashCode, data.length); HashEntry<...
157
158
554
CodeSearchNet permissive-repo filter (dataset-level; per-row license absent)
code_search_net
2026-12-05
f01fb50bf5082ad2ce1eaf7396aaf601ad1f896dce18d7ca05281eb436e26764
Apache-2.0
permissive
https://github.com/abmargb/jamppa/blob/master/LICENSE
dbc7acaa1e825248bae5028d
abmargb/jamppa
src/main/java/org/jivesoftware/smack/util/collections/AbstractHashedMap.java
AbstractHashedMap.putAll
https://github.com/abmargb/jamppa/blob/76f253239923df40904c462e3b88e7278b36b282/src/main/java/org/jivesoftware/smack/util/collections/AbstractHashedMap.java#L332-L345
test
java
Puts all the values from the specified map into this map. <p/> This implementation iterates around the specified map and uses {@link #put(Object, Object)}. @param map the map to add @throws NullPointerException if the map is null
public void putAll(Map<? extends K, ? extends V> map) { int mapSize = map.size(); if (mapSize == 0) { return; } int newSize = (int) ((size + mapSize) / loadFactor + 1); ensureCapacity(calculateNewCapacity(newSize)); // Have to cast here because of compiler inf...
Puts all the values from the specified map into this map. <p/> This implementation iterates around the specified map and uses {@link #put(Object, Object)}. @param map the map to add @throws NullPointerException if the map is null public void putAll(Map<? extends K, ? extends V> map) { int mapSize = map.size()...
191
230
600
CodeSearchNet permissive-repo filter (dataset-level; per-row license absent)
code_search_net
2026-12-05
7b25b2a6e532ac8ab80a42d7773bde752f60ed614d795901d7cc3e8a4e946d29
Apache-2.0
permissive
https://github.com/abmargb/jamppa/blob/master/LICENSE
d30c3d10675995fdc912c1ad
abmargb/jamppa
src/main/java/org/jivesoftware/smack/util/collections/AbstractHashedMap.java
AbstractHashedMap.remove
https://github.com/abmargb/jamppa/blob/76f253239923df40904c462e3b88e7278b36b282/src/main/java/org/jivesoftware/smack/util/collections/AbstractHashedMap.java#L354-L369
test
java
Removes the specified mapping from this map. @param key the mapping to remove @return the value mapped to the removed key, null if key not in map
public V remove(Object key) { int hashCode = hash((key == null) ? NULL : key); int index = hashIndex(hashCode, data.length); HashEntry<K, V> entry = data[index]; HashEntry<K, V> previous = null; while (entry != null) { if (entry.hashCode == hashCode && isEqualKey(key,...
Removes the specified mapping from this map. @param key the mapping to remove @return the value mapped to the removed key, null if key not in map public V remove(Object key) { int hashCode = hash((key == null) ? NULL : key); int index = hashIndex(hashCode, data.length); HashEntry<K, V> entry =...
155
146
587
CodeSearchNet permissive-repo filter (dataset-level; per-row license absent)
code_search_net
2026-12-05
413ee484b5d9cc515697b7e91eda460decb9876791d3a633a41dbbed6845f483
Apache-2.0
permissive
https://github.com/abmargb/jamppa/blob/master/LICENSE
b1bd789a450e3ce1eb24d938
abmargb/jamppa
src/main/java/org/jivesoftware/smack/util/collections/AbstractHashedMap.java
AbstractHashedMap.clear
https://github.com/abmargb/jamppa/blob/76f253239923df40904c462e3b88e7278b36b282/src/main/java/org/jivesoftware/smack/util/collections/AbstractHashedMap.java#L375-L382
test
java
Clears the map, resetting the size to zero and nullifying references to avoid garbage collection issues.
public void clear() { modCount++; HashEntry[] data = this.data; for (int i = data.length - 1; i >= 0; i--) { data[i] = null; } size = 0; }
Clears the map, resetting the size to zero and nullifying references to avoid garbage collection issues. public void clear() { modCount++; HashEntry[] data = this.data; for (int i = data.length - 1; i >= 0; i--) { data[i] = null; } size = 0; }
76
104
194
CodeSearchNet permissive-repo filter (dataset-level; per-row license absent)
code_search_net
2026-12-05
c7b19d8e0b1804e13bc56290e0adc4ab8df3a5273b3a9abb44b27fee5034fa28
Apache-2.0
permissive
https://github.com/abmargb/jamppa/blob/master/LICENSE
2a86a1f52d3c66b122d41b8d
abmargb/jamppa
src/main/java/org/jivesoftware/smack/util/collections/AbstractHashedMap.java
AbstractHashedMap.hash
https://github.com/abmargb/jamppa/blob/76f253239923df40904c462e3b88e7278b36b282/src/main/java/org/jivesoftware/smack/util/collections/AbstractHashedMap.java#L393-L401
test
java
Gets the hash code for the key specified. This implementation uses the additional hashing routine from JDK1.4. Subclasses can override this to return alternate hash codes. @param key the key to get a hash code for @return the hash code
protected int hash(Object key) { // same as JDK 1.4 int h = key.hashCode(); h += ~(h << 9); h ^= (h >>> 14); h += (h << 4); h ^= (h >>> 10); return h; }
Gets the hash code for the key specified. This implementation uses the additional hashing routine from JDK1.4. Subclasses can override this to return alternate hash codes. @param key the key to get a hash code for @return the hash code protected int hash(Object key) { // same as JDK 1.4 int h = key.ha...
118
236
212
CodeSearchNet permissive-repo filter (dataset-level; per-row license absent)
code_search_net
2026-12-05
559f1161e47b6f685b950a53d781781430fa6569899cb247e2ebc6161345a47b
Apache-2.0
permissive
https://github.com/abmargb/jamppa/blob/master/LICENSE
28c3350a8b3899e018830101
abmargb/jamppa
src/main/java/org/jivesoftware/smack/util/collections/AbstractHashedMap.java
AbstractHashedMap.isEqualKey
https://github.com/abmargb/jamppa/blob/76f253239923df40904c462e3b88e7278b36b282/src/main/java/org/jivesoftware/smack/util/collections/AbstractHashedMap.java#L415-L417
test
java
Compares two keys, in internal converted form, to see if they are equal. This implementation uses the equals method. Subclasses can override this to match differently. @param key1 the first key to compare passed in from outside @param key2 the second key extracted from the entry via <code>entry.key</code> @return true...
protected boolean isEqualKey(Object key1, Object key2) { return (key1 == key2 || ((key1 != null) && key1.equals(key2))); }
Compares two keys, in internal converted form, to see if they are equal. This implementation uses the equals method. Subclasses can override this to match differently. @param key1 the first key to compare passed in from outside @param key2 the second key extracted from the entry via <code>entry.key</code> @return true...
111
329
134
CodeSearchNet permissive-repo filter (dataset-level; per-row license absent)
code_search_net
2026-12-05
414da20b66df72d4bc51b753283bdcb1661b8bac41b7f4e223bf8cef00702aee
Apache-2.0
permissive
https://github.com/abmargb/jamppa/blob/master/LICENSE
158b252ba5feae61c5a2c4f6
abmargb/jamppa
src/main/java/org/jivesoftware/smack/util/collections/AbstractHashedMap.java
AbstractHashedMap.isEqualValue
https://github.com/abmargb/jamppa/blob/76f253239923df40904c462e3b88e7278b36b282/src/main/java/org/jivesoftware/smack/util/collections/AbstractHashedMap.java#L431-L433
test
java
Compares two values, in external form, to see if they are equal. This implementation uses the equals method and assumes neither value is null. Subclasses can override this to match differently. @param value1 the first value to compare passed in from outside @param value2 the second value extracted from the entry via <...
protected boolean isEqualValue(Object value1, Object value2) { return (value1 == value2 || value1.equals(value2)); }
Compares two values, in external form, to see if they are equal. This implementation uses the equals method and assumes neither value is null. Subclasses can override this to match differently. @param value1 the first value to compare passed in from outside @param value2 the second value extracted from the entry via <...
108
364
128
CodeSearchNet permissive-repo filter (dataset-level; per-row license absent)
code_search_net
2026-12-05
b351e811a0e20bd65a7861b8a54811d1515d483329a6b440ce2cdf61a7675a5d
Apache-2.0
permissive
https://github.com/abmargb/jamppa/blob/master/LICENSE
97f2c9252ce876803c43a7d3
abmargb/jamppa
src/main/java/org/jivesoftware/smack/util/collections/AbstractHashedMap.java
AbstractHashedMap.getEntry
https://github.com/abmargb/jamppa/blob/76f253239923df40904c462e3b88e7278b36b282/src/main/java/org/jivesoftware/smack/util/collections/AbstractHashedMap.java#L462-L476
test
java
Gets the entry mapped to the key specified. <p/> This method exists for subclasses that may need to perform a multi-step process accessing the entry. The public methods in this class don't use this method to gain a small performance boost. @param key the key @return the entry, null if no match
protected HashEntry<K, V> getEntry(Object key) { int hashCode = hash((key == null) ? NULL : key); HashEntry<K, V> entry = data[hashIndex(hashCode, data.length)]; // no // local ...
Gets the entry mapped to the key specified. <p/> This method exists for subclasses that may need to perform a multi-step process accessing the entry. The public methods in this class don't use this method to gain a small performance boost. @param key the key @return the entry, null if no match protected HashEntry<K, ...
173
295
730
CodeSearchNet permissive-repo filter (dataset-level; per-row license absent)
code_search_net
2026-12-05
e5d02c64474382ce4b4cc60b0b4c86007a4c13af797ceba4acba524db3388359
Apache-2.0
permissive
https://github.com/abmargb/jamppa/blob/master/LICENSE
d757fc01d1c8931e027ec2b6
abmargb/jamppa
src/main/java/org/jivesoftware/smack/util/collections/AbstractHashedMap.java
AbstractHashedMap.updateEntry
https://github.com/abmargb/jamppa/blob/76f253239923df40904c462e3b88e7278b36b282/src/main/java/org/jivesoftware/smack/util/collections/AbstractHashedMap.java#L490-L492
test
java
Updates an existing key-value mapping to change the value. <p/> This implementation calls <code>setValue()</code> on the entry. Subclasses could override to handle changes to the map. @param entry the entry to update @param newValue the new value to store
protected void updateEntry(HashEntry<K, V> entry, V newValue) { entry.setValue(newValue); }
Updates an existing key-value mapping to change the value. <p/> This implementation calls <code>setValue()</code> on the entry. Subclasses could override to handle changes to the map. @param entry the entry to update @param newValue the new value to store protected void updateEntry(HashEntry<K, V> entry, V newValue) ...
79
256
103
CodeSearchNet permissive-repo filter (dataset-level; per-row license absent)
code_search_net
2026-12-05
a385208d91a277b0557dc9f2f5f91821a78e80c1f5fd67f2eef982ddf5235e9a
Apache-2.0
permissive
https://github.com/abmargb/jamppa/blob/master/LICENSE
7603f7befab75072d5f03ac5
abmargb/jamppa
src/main/java/org/jivesoftware/smack/util/collections/AbstractHashedMap.java
AbstractHashedMap.reuseEntry
https://github.com/abmargb/jamppa/blob/76f253239923df40904c462e3b88e7278b36b282/src/main/java/org/jivesoftware/smack/util/collections/AbstractHashedMap.java#L511-L517
test
java
Reuses an existing key-value mapping, storing completely new data. <p/> This implementation sets all the data fields on the entry. Subclasses could populate additional entry fields. @param entry the entry to update, not null @param hashIndex the index in the data array @param hashCode the hash code of the key to add @...
protected void reuseEntry(HashEntry<K, V> entry, int hashIndex, int hashCode, K key, V value) { entry.next = data[hashIndex]; entry.hashCode = hashCode; entry.key = key; entry.value = value; }
Reuses an existing key-value mapping, storing completely new data. <p/> This implementation sets all the data fields on the entry. Subclasses could populate additional entry fields. @param entry the entry to update, not null @param hashIndex the index in the data array @param hashCode the hash code of the key to add @...
141
374
240
CodeSearchNet permissive-repo filter (dataset-level; per-row license absent)
code_search_net
2026-12-05
81957aa4b58341af7e8abdacaf6a185b088ceb484863acc42f3077b134cf0c5f
Apache-2.0
permissive
https://github.com/abmargb/jamppa/blob/master/LICENSE
2327aab377790c3a9e32ff80
abmargb/jamppa
src/main/java/org/jivesoftware/smack/util/collections/AbstractHashedMap.java
AbstractHashedMap.addMapping
https://github.com/abmargb/jamppa/blob/76f253239923df40904c462e3b88e7278b36b282/src/main/java/org/jivesoftware/smack/util/collections/AbstractHashedMap.java#L537-L544
test
java
Adds a new key-value mapping into this map. <p/> This implementation calls <code>createEntry()</code>, <code>addEntry()</code> and <code>checkCapacity()</code>. It also handles changes to <code>modCount</code> and <code>size</code>. Subclasses could override to fully control adds to the map. @param hashIndex the index...
protected void addMapping(int hashIndex, int hashCode, K key, V value) { modCount++; HashEntry<K, V> entry = createEntry(data[hashIndex], hashCode, key, value); addEntry(entry, hashIndex); size++; checkCapacity(); }
Adds a new key-value mapping into this map. <p/> This implementation calls <code>createEntry()</code>, <code>addEntry()</code> and <code>checkCapacity()</code>. It also handles changes to <code>modCount</code> and <code>size</code>. Subclasses could override to fully control adds to the map. @param hashIndex the index...
178
456
275
CodeSearchNet permissive-repo filter (dataset-level; per-row license absent)
code_search_net
2026-12-05
8197b652bfe896322061096520d482c17fee258958335dd1910090f7b3fe0945
Apache-2.0
permissive
https://github.com/abmargb/jamppa/blob/master/LICENSE
c4af2e56dc0822eb6587b305
abmargb/jamppa
src/main/java/org/jivesoftware/smack/util/collections/AbstractHashedMap.java
AbstractHashedMap.removeMapping
https://github.com/abmargb/jamppa/blob/76f253239923df40904c462e3b88e7278b36b282/src/main/java/org/jivesoftware/smack/util/collections/AbstractHashedMap.java#L598-L604
test
java
Removes a mapping from the map. <p/> This implementation calls <code>removeEntry()</code> and <code>destroyEntry()</code>. It also handles changes to <code>modCount</code> and <code>size</code>. Subclasses could override to fully control removals from the map. @param entry the entry to remove @param hashIndex the inde...
protected void removeMapping(HashEntry<K, V> entry, int hashIndex, HashEntry<K, V> previous) { modCount++; removeEntry(entry, hashIndex, previous); size--; destroyEntry(entry); }
Removes a mapping from the map. <p/> This implementation calls <code>removeEntry()</code> and <code>destroyEntry()</code>. It also handles changes to <code>modCount</code> and <code>size</code>. Subclasses could override to fully control removals from the map. @param entry the entry to remove @param hashIndex the inde...
147
393
226
CodeSearchNet permissive-repo filter (dataset-level; per-row license absent)
code_search_net
2026-12-05
4ed3d27413bdac13c6f844b531e8117f13bee09969d4174ede22f49ca314e25c
Apache-2.0
permissive
https://github.com/abmargb/jamppa/blob/master/LICENSE
58d55afe4960ceb885c35f2b
abmargb/jamppa
src/main/java/org/jivesoftware/smack/util/collections/AbstractHashedMap.java
AbstractHashedMap.removeEntry
https://github.com/abmargb/jamppa/blob/76f253239923df40904c462e3b88e7278b36b282/src/main/java/org/jivesoftware/smack/util/collections/AbstractHashedMap.java#L620-L627
test
java
Removes an entry from the chain stored in a particular index. <p/> This implementation removes the entry from the data storage table. The size is not updated. Subclasses could override to handle changes to the map. @param entry the entry to remove @param hashIndex the index into the data structure @param previous the ...
protected void removeEntry(HashEntry<K, V> entry, int hashIndex, HashEntry<K, V> previous) { if (previous == null) { data[hashIndex] = entry.next; } else { previous.next = entry.next; } }
Removes an entry from the chain stored in a particular index. <p/> This implementation removes the entry from the data storage table. The size is not updated. Subclasses could override to handle changes to the map. @param entry the entry to remove @param hashIndex the index into the data structure @param previous the ...
133
347
251
CodeSearchNet permissive-repo filter (dataset-level; per-row license absent)
code_search_net
2026-12-05
916359954105671093aa2946ae714a6fedfd6cd479de883699168f1f2fd15bae
Apache-2.0
permissive
https://github.com/abmargb/jamppa/blob/master/LICENSE
599fa8d5d0bfe4be0804fc69
abmargb/jamppa
src/main/java/org/jivesoftware/smack/util/collections/AbstractHashedMap.java
AbstractHashedMap.destroyEntry
https://github.com/abmargb/jamppa/blob/76f253239923df40904c462e3b88e7278b36b282/src/main/java/org/jivesoftware/smack/util/collections/AbstractHashedMap.java#L639-L643
test
java
Kills an entry ready for the garbage collector. <p/> This implementation prepares the HashEntry for garbage collection. Subclasses can override this to implement caching (override clear as well). @param entry the entry to destroy
protected void destroyEntry(HashEntry<K, V> entry) { entry.next = null; entry.key = null; entry.value = null; }
Kills an entry ready for the garbage collector. <p/> This implementation prepares the HashEntry for garbage collection. Subclasses can override this to implement caching (override clear as well). @param entry the entry to destroy protected void destroyEntry(HashEntry<K, V> entry) { entry.next = null; ...
79
230
139
CodeSearchNet permissive-repo filter (dataset-level; per-row license absent)
code_search_net
2026-12-05
a560941607ed17c3cabfa94ef53bfff931ccd03465498bcd177ac8ff9be60591
Apache-2.0
permissive
https://github.com/abmargb/jamppa/blob/master/LICENSE
ce694f4d53ade3e86b1c9b44
abmargb/jamppa
src/main/java/org/jivesoftware/smack/util/collections/AbstractHashedMap.java
AbstractHashedMap.checkCapacity
https://github.com/abmargb/jamppa/blob/76f253239923df40904c462e3b88e7278b36b282/src/main/java/org/jivesoftware/smack/util/collections/AbstractHashedMap.java#L652-L659
test
java
Checks the capacity of the map and enlarges it if necessary. <p/> This implementation uses the threshold to check if the map needs enlarging
protected void checkCapacity() { if (size >= threshold) { int newCapacity = data.length * 2; if (newCapacity <= MAXIMUM_CAPACITY) { ensureCapacity(newCapacity); } } }
Checks the capacity of the map and enlarges it if necessary. <p/> This implementation uses the threshold to check if the map needs enlarging protected void checkCapacity() { if (size >= threshold) { int newCapacity = data.length * 2; if (newCapacity <= MAXIMUM_CAPACITY) { ...
79
140
238
CodeSearchNet permissive-repo filter (dataset-level; per-row license absent)
code_search_net
2026-12-05
9400c5ef6f4fe9f4bd2e7a4c4cb86c90dcb6374d1cad15f9e7fe0583e12ced00
Apache-2.0
permissive
https://github.com/abmargb/jamppa/blob/master/LICENSE
5f04dfd3deffb0772fa0c607
abmargb/jamppa
src/main/java/org/jivesoftware/smack/util/collections/AbstractHashedMap.java
AbstractHashedMap.ensureCapacity
https://github.com/abmargb/jamppa/blob/76f253239923df40904c462e3b88e7278b36b282/src/main/java/org/jivesoftware/smack/util/collections/AbstractHashedMap.java#L668-L697
test
java
Changes the size of the data structure to the capacity proposed. @param newCapacity the new capacity of the array (a power of two, less or equal to max)
protected void ensureCapacity(int newCapacity) { int oldCapacity = data.length; if (newCapacity <= oldCapacity) { return; } if (size == 0) { threshold = calculateThreshold(newCapacity, loadFactor); data = new HashEntry[newCapacity]; } else { ...
Changes the size of the data structure to the capacity proposed. @param newCapacity the new capacity of the array (a power of two, less or equal to max) protected void ensureCapacity(int newCapacity) { int oldCapacity = data.length; if (newCapacity <= oldCapacity) { return; } ...
267
153
1,157
CodeSearchNet permissive-repo filter (dataset-level; per-row license absent)
code_search_net
2026-12-05
68a681e6e46a8eb02db3f6d8826e027c64b793fbe3d896f5394a6b70455908fc
Apache-2.0
permissive
https://github.com/abmargb/jamppa/blob/master/LICENSE
0c81b1e094631c11bda2bba6
abmargb/jamppa
src/main/java/org/jivesoftware/smack/util/collections/AbstractHashedMap.java
AbstractHashedMap.calculateNewCapacity
https://github.com/abmargb/jamppa/blob/76f253239923df40904c462e3b88e7278b36b282/src/main/java/org/jivesoftware/smack/util/collections/AbstractHashedMap.java#L707-L720
test
java
Calculates the new capacity of the map. This implementation normalizes the capacity to a power of two. @param proposedCapacity the proposed capacity @return the normalized new capacity
protected int calculateNewCapacity(int proposedCapacity) { int newCapacity = 1; if (proposedCapacity > MAXIMUM_CAPACITY) { newCapacity = MAXIMUM_CAPACITY; } else { while (newCapacity < proposedCapacity) { newCapacity <<= 1; // multiply by two }...
Calculates the new capacity of the map. This implementation normalizes the capacity to a power of two. @param proposedCapacity the proposed capacity @return the normalized new capacity protected int calculateNewCapacity(int proposedCapacity) { int newCapacity = 1; if (proposedCapacity > MAXIMUM_CAPACI...
132
185
476
CodeSearchNet permissive-repo filter (dataset-level; per-row license absent)
code_search_net
2026-12-05
a2224b82899a847247ccc2108fc932f7231b871a164dfe6cfc8df3ad6fea236b
Apache-2.0
permissive
https://github.com/abmargb/jamppa/blob/master/LICENSE
dbb19b4d5615e25a6e7e91e4
abmargb/jamppa
src/main/java/org/jivesoftware/smack/util/collections/AbstractHashedMap.java
AbstractHashedMap.entryNext
https://github.com/abmargb/jamppa/blob/76f253239923df40904c462e3b88e7278b36b282/src/main/java/org/jivesoftware/smack/util/collections/AbstractHashedMap.java#L748-L750
test
java
Gets the <code>next</code> field from a <code>HashEntry</code>. Used in subclasses that have no visibility of the field. @param entry the entry to query, must not be null @return the <code>next</code> field of the entry @throws NullPointerException if the entry is null @since Commons Collections 3.1
protected HashEntry<K, V> entryNext(HashEntry<K, V> entry) { return entry.next; }
Gets the <code>next</code> field from a <code>HashEntry</code>. Used in subclasses that have no visibility of the field. @param entry the entry to query, must not be null @return the <code>next</code> field of the entry @throws NullPointerException if the entry is null @since Commons Collections 3.1 protected HashEnt...
105
301
93
CodeSearchNet permissive-repo filter (dataset-level; per-row license absent)
code_search_net
2026-12-05
b9c3b2402664e3f7023fe486a994e7ad14dfb14148c5d1b752dcfcbea2be6bce
Apache-2.0
permissive
https://github.com/abmargb/jamppa/blob/master/LICENSE
488a82dfc4d9c679795c60d2
abmargb/jamppa
src/main/java/org/jivesoftware/smack/util/collections/AbstractHashedMap.java
AbstractHashedMap.mapIterator
https://github.com/abmargb/jamppa/blob/76f253239923df40904c462e3b88e7278b36b282/src/main/java/org/jivesoftware/smack/util/collections/AbstractHashedMap.java#L809-L814
test
java
Gets an iterator over the map. Changes made to the iterator affect this map. <p/> A MapIterator returns the keys in the map. It also provides convenient methods to get the key and value, and set the value. It avoids the need to create an entrySet/keySet/values object. It also avoids creating the Map.Entry object. @ret...
public MapIterator<K, V> mapIterator() { if (size == 0) { return EmptyMapIterator.INSTANCE; } return new HashMapIterator<K, V>(this); }
Gets an iterator over the map. Changes made to the iterator affect this map. <p/> A MapIterator returns the keys in the map. It also provides convenient methods to get the key and value, and set the value. It avoids the need to create an entrySet/keySet/values object. It also avoids creating the Map.Entry object. @ret...
119
340
175
CodeSearchNet permissive-repo filter (dataset-level; per-row license absent)
code_search_net
2026-12-05
bb3f0e01c50d0ac6e5446bb6eb0008f4f0feca78d70b747c79af02fbe20c272a
Apache-2.0
permissive
https://github.com/abmargb/jamppa/blob/master/LICENSE
47764c4a0d74ea4f7c5c234f
abmargb/jamppa
src/main/java/org/jivesoftware/smack/util/collections/AbstractHashedMap.java
AbstractHashedMap.createEntrySetIterator
https://github.com/abmargb/jamppa/blob/76f253239923df40904c462e3b88e7278b36b282/src/main/java/org/jivesoftware/smack/util/collections/AbstractHashedMap.java#L878-L883
test
java
Creates an entry set iterator. Subclasses can override this to return iterators with different properties. @return the entrySet iterator
protected Iterator<Map.Entry<K, V>> createEntrySetIterator() { if (size() == 0) { return EmptyIterator.INSTANCE; } return new EntrySetIterator<K, V>(this); }
Creates an entry set iterator. Subclasses can override this to return iterators with different properties. @return the entrySet iterator protected Iterator<Map.Entry<K, V>> createEntrySetIterator() { if (size() == 0) { return EmptyIterator.INSTANCE; } return new EntrySetIterator<K,...
72
137
197
CodeSearchNet permissive-repo filter (dataset-level; per-row license absent)
code_search_net
2026-12-05
81b96ccee73607c0322f810ca45ba767279fadfce00791d68bcaf94094985ab5
Apache-2.0
permissive
https://github.com/abmargb/jamppa/blob/master/LICENSE
132b33a2befc42de8d9a81d9
abmargb/jamppa
src/main/java/org/jivesoftware/smack/util/collections/AbstractHashedMap.java
AbstractHashedMap.keySet
https://github.com/abmargb/jamppa/blob/76f253239923df40904c462e3b88e7278b36b282/src/main/java/org/jivesoftware/smack/util/collections/AbstractHashedMap.java#L953-L958
test
java
Gets the keySet view of the map. Changes made to the view affect this map. To simply iterate through the keys, use {@link #mapIterator()}. @return the keySet view
public Set<K> keySet() { if (keySet == null) { keySet = new KeySet<K, V>(this); } return keySet; }
Gets the keySet view of the map. Changes made to the view affect this map. To simply iterate through the keys, use {@link #mapIterator()}. @return the keySet view public Set<K> keySet() { if (keySet == null) { keySet = new KeySet<K, V>(this); } return keySet; }
79
163
138
CodeSearchNet permissive-repo filter (dataset-level; per-row license absent)
code_search_net
2026-12-05
abe3317576447dbe00011be3d412ef56e1093a23445401eee014b33ca58cde59
Apache-2.0
permissive
https://github.com/abmargb/jamppa/blob/master/LICENSE
ba87239899f0ce71f86e4ccd
abmargb/jamppa
src/main/java/org/jivesoftware/smack/util/collections/AbstractHashedMap.java
AbstractHashedMap.doWriteObject
https://github.com/abmargb/jamppa/blob/76f253239923df40904c462e3b88e7278b36b282/src/main/java/org/jivesoftware/smack/util/collections/AbstractHashedMap.java#L1290-L1298
test
java
Writes the map data to the stream. This method must be overridden if a subclass must be setup before <code>put()</code> is used. <p/> Serialization is not one of the JDK's nicest topics. Normal serialization will initialise the superclass before the subclass. Sometimes however, this isn't what you want, as in this case...
protected void doWriteObject(ObjectOutputStream out) throws IOException { out.writeFloat(loadFactor); out.writeInt(data.length); out.writeInt(size); for (MapIterator it = mapIterator(); it.hasNext();) { out.writeObject(it.next()); out.writeObject(it.getValue()); ...
Writes the map data to the stream. This method must be overridden if a subclass must be setup before <code>put()</code> is used. <p/> Serialization is not one of the JDK's nicest topics. Normal serialization will initialise the superclass before the subclass. Sometimes however, this isn't what you want, as in this case...
242
822
334
CodeSearchNet permissive-repo filter (dataset-level; per-row license absent)
code_search_net
2026-12-05
eb1e859f06892d275e56f1880813d74f71218cade7db8b0e0f8d0d6087c27e12
Apache-2.0
permissive
https://github.com/abmargb/jamppa/blob/master/LICENSE
d1521d3aa9b8f449e47c089a
abmargb/jamppa
src/main/java/org/jivesoftware/smack/util/collections/AbstractHashedMap.java
AbstractHashedMap.doReadObject
https://github.com/abmargb/jamppa/blob/76f253239923df40904c462e3b88e7278b36b282/src/main/java/org/jivesoftware/smack/util/collections/AbstractHashedMap.java#L1320-L1333
test
java
Reads the map data from the stream. This method must be overridden if a subclass must be setup before <code>put()</code> is used. <p/> Serialization is not one of the JDK's nicest topics. Normal serialization will initialise the superclass before the subclass. Sometimes however, this isn't what you want, as in this cas...
protected void doReadObject(ObjectInputStream in) throws IOException, ClassNotFoundException { loadFactor = in.readFloat(); int capacity = in.readInt(); int size = in.readInt(); init(); data = new HashEntry[capacity]; for (int i = 0; i < size; i++) { ...
Reads the map data from the stream. This method must be overridden if a subclass must be setup before <code>put()</code> is used. <p/> Serialization is not one of the JDK's nicest topics. Normal serialization will initialise the superclass before the subclass. Sometimes however, this isn't what you want, as in this cas...
288
793
504
CodeSearchNet permissive-repo filter (dataset-level; per-row license absent)
code_search_net
2026-12-05
31aed60e7f1c521071aa44cadc3cd019a22255bc8645600d67fc978e8576cd99
Apache-2.0
permissive
https://github.com/abmargb/jamppa/blob/master/LICENSE
8ec0cf01802c5af1fff213be
abmargb/jamppa
src/main/java/org/jivesoftware/smack/ReconnectionManager.java
ReconnectionManager.reconnect
https://github.com/abmargb/jamppa/blob/76f253239923df40904c462e3b88e7278b36b282/src/main/java/org/jivesoftware/smack/ReconnectionManager.java#L93-L179
test
java
Starts a reconnection mechanism if it was configured to do that. The algorithm is been executed when the first connection error is detected. <p/> The reconnection mechanism will try to reconnect periodically in this way: <ol> <li>First it will try 6 times every 10 seconds. <li>Then it will try 10 times every 1 minute. ...
synchronized protected void reconnect() { if (this.isReconnectionAllowed()) { // Since there is no thread running, creates a new one to attempt // the reconnection. // avoid to run duplicated reconnectionThread -- fd: 16/09/2010 if (reconnectionThread != null && r...
Starts a reconnection mechanism if it was configured to do that. The algorithm is been executed when the first connection error is detected. <p/> The reconnection mechanism will try to reconnect periodically in this way: <ol> <li>First it will try 6 times every 10 seconds. <li>Then it will try 10 times every 1 minute. ...
694
379
4,005
CodeSearchNet permissive-repo filter (dataset-level; per-row license absent)
code_search_net
2026-12-05
3d37c1af44c75fe2904cf5245229280314b03b7a1b6d11b0ec129e5a2588b298
Apache-2.0
permissive
https://github.com/abmargb/jamppa/blob/master/LICENSE
7a668271cacd2f39b0d784ba
abmargb/jamppa
src/main/java/org/jivesoftware/smack/ReconnectionManager.java
ReconnectionManager.notifyReconnectionFailed
https://github.com/abmargb/jamppa/blob/76f253239923df40904c462e3b88e7278b36b282/src/main/java/org/jivesoftware/smack/ReconnectionManager.java#L187-L193
test
java
Fires listeners when a reconnection attempt has failed. @param exception the exception that occured.
protected void notifyReconnectionFailed(Exception exception) { if (isReconnectionAllowed()) { for (ConnectionListener listener : connection.connectionListeners) { listener.reconnectionFailed(exception); } } }
Fires listeners when a reconnection attempt has failed. @param exception the exception that occured. protected void notifyReconnectionFailed(Exception exception) { if (isReconnectionAllowed()) { for (ConnectionListener listener : connection.connectionListeners) { listener.reconnect...
63
101
268
CodeSearchNet permissive-repo filter (dataset-level; per-row license absent)
code_search_net
2026-12-05
a5820814135be0bf5aeff929493684e6e2f3f278bb003f4b2d0d57f23217b813
Apache-2.0
permissive
https://github.com/abmargb/jamppa/blob/master/LICENSE
77747b6cda4d73a58cff1311
abmargb/jamppa
src/main/java/org/jivesoftware/smack/ReconnectionManager.java
ReconnectionManager.notifyAttemptToReconnectIn
https://github.com/abmargb/jamppa/blob/76f253239923df40904c462e3b88e7278b36b282/src/main/java/org/jivesoftware/smack/ReconnectionManager.java#L203-L209
test
java
Fires listeners when The Connection will retry a reconnection. Expressed in seconds. @param seconds the number of seconds that a reconnection will be attempted in.
protected void notifyAttemptToReconnectIn(int seconds) { if (isReconnectionAllowed()) { for (ConnectionListener listener : connection.connectionListeners) { listener.reconnectingIn(seconds); } } }
Fires listeners when The Connection will retry a reconnection. Expressed in seconds. @param seconds the number of seconds that a reconnection will be attempted in. protected void notifyAttemptToReconnectIn(int seconds) { if (isReconnectionAllowed()) { for (ConnectionListener listener : connection....
81
164
256
CodeSearchNet permissive-repo filter (dataset-level; per-row license absent)
code_search_net
2026-12-05
b7db24c1028dac4a33948fbe5c1783b548b5ad01f827a12f46f6dacfe896a9b8
Apache-2.0
permissive
https://github.com/abmargb/jamppa/blob/master/LICENSE