Not logged in.  Login/Logout/Register | List snippets | | Create snippet | Upload image | Upload data

34
LINES

< > BotCompany Repo | #1001101 // "getOpt" function (get field by reflection, return null if not there)

JavaX fragment (include)

java.lang.RuntimeException: java.io.IOException: Snippet #1001101 not found or not public
	at main.rethrow(m1008705.java:173)
	at main.loadSnippet(m1008705.java:342)
	at main.html2(m1008705.java:83)
	at main.html(m1008705.java:67)
	at java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:104)
	at java.base/java.lang.reflect.Method.invoke(Method.java:577)
	at main.invokeMethod(m1008705.java:1601)
	at main.callOpt_withVarargs(m1008705.java:4387)
	at main.callOpt(m1008705.java:3326)
	at main.callHtmlMethod2(m1008705.java:11404)
	at main$MyHTTPD$1.get(m1008705.java:7337)
	at main$MyHTTPD$1.get(m1008705.java:1)
	at java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:104)
	at java.base/java.lang.reflect.Method.invoke(Method.java:577)
	at main.invokeMethod(m1008705.java:1601)
	at main.safeCallF(m1008705.java:642)
	at main.callF(m1008705.java:611)
	at main$MyHTTPD.serve(m1008705.java:7373)
	at main$NanoHTTPD.serve_2(m1008705.java:9572)
	at main$NanoHTTPD.serve(m1008705.java:9553)
	at main$NanoHTTPD$HTTPSession.execute(m1008705.java:8453)
	at main$NanoHTTPD$ClientHandler.run(m1008705.java:7829)
	at java.base/java.lang.Thread.run(Thread.java:833)
Caused by: java.io.IOException: Snippet #1001101 not found or not public
	at main.loadSnippet_noResourceLoader(m1008705.java:395)
	at main.loadSnippet(m1008705.java:365)
	at main.loadSnippet(m1008705.java:341)
	... 21 more

Author comment

Began life as a copy of #1000597

download  show line numbers  debug dex  old transpilations   

Travelled to 16 computer(s): aoiabmzegqzx, bhatertpkbcr, cbybwowwnfue, cfunsshuasjs, ddnzoavkxhuk, gwrvuhgaqvyk, irmadwmeruwu, ishqpsrjomds, lpdgvwnxivlt, mqqgnosmbjvj, onxytkatvevr, pyentgdyhuwx, pzhvpgtvlbxg, tslmcundralx, tvejysmllsmz, vouqrxazstgt

Comments [hide]

ID Author/Program Comment Date
1208 stefan getOpt can be passed a null 1st argument - then it just returns null. Useful for cascaded optionality, e.g.:

static S printableUserName() {
// Custom or Slack name, depending on what's available
ret or((S) callOpt(getBot("#1002355"), "getUserName"), getUserName());
}
2016-01-27 01:28:45

add comment

Snippet ID: #1001101
Snippet name: "getOpt" function (get field by reflection, return null if not there)
Eternal ID of this version: #1001101/9
Text MD5: 91e56345ffd108ce4905ab8367478f85
Author: stefan
Category: javax
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2019-08-31 14:55:44
Source code size: 894 bytes / 34 lines
Pitched / IR pitched: No / No
Views / Downloads: 2622 / 8551
Version history: 8 change(s)
Referenced in: #1000539 - FrameWithImages
#1002427 - Accellerating 629 (SPIKE)
#1003386 - getOptIgnoreCase
#1005273 - getOptDyn - getOpt + get dynamic fields
#1005583 - getOpt_cached (optimized version of getOpt), getOpt_makeCache
#1006654 - Standard functions list 2 (LIVE, continuation of #761)
#3000202 - Answer for stefanreich (>> T conversion bot)
#3000238 - Answer for stefanreich (>> t power bot)
#3000382 - Answer for ferdie (>> t = 1, f = 0)