id int32 0 165k | 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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
163,200 | puniverse/capsule | capsule-util/src/main/java/co/paralleluniverse/capsule/CapsuleLauncher.java | CapsuleLauncher.enableJMX | public static List<String> enableJMX(List<String> jvmArgs) {
final String arg = "-D" + OPT_JMX_REMOTE;
if (jvmArgs.contains(arg))
return jvmArgs;
final List<String> cmdLine2 = new ArrayList<>(jvmArgs);
cmdLine2.add(arg);
return cmdLine2;
} | java | public static List<String> enableJMX(List<String> jvmArgs) {
final String arg = "-D" + OPT_JMX_REMOTE;
if (jvmArgs.contains(arg))
return jvmArgs;
final List<String> cmdLine2 = new ArrayList<>(jvmArgs);
cmdLine2.add(arg);
return cmdLine2;
} | [
"public",
"static",
"List",
"<",
"String",
">",
"enableJMX",
"(",
"List",
"<",
"String",
">",
"jvmArgs",
")",
"{",
"final",
"String",
"arg",
"=",
"\"-D\"",
"+",
"OPT_JMX_REMOTE",
";",
"if",
"(",
"jvmArgs",
".",
"contains",
"(",
"arg",
")",
")",
"return... | Adds an option to the JVM arguments to enable JMX connection
@param jvmArgs the JVM args
@return a new list of JVM args | [
"Adds",
"an",
"option",
"to",
"the",
"JVM",
"arguments",
"to",
"enable",
"JMX",
"connection"
] | 291a54e501a32aaf0284707b8c1fbff6a566822b | https://github.com/puniverse/capsule/blob/291a54e501a32aaf0284707b8c1fbff6a566822b/capsule-util/src/main/java/co/paralleluniverse/capsule/CapsuleLauncher.java#L272-L279 |
163,201 | vitalidze/chromecast-java-api-v2 | src/main/java/su/litvak/chromecast/api/v2/ChromeCast.java | ChromeCast.setVolumeByIncrement | public final void setVolumeByIncrement(float level) throws IOException {
Volume volume = this.getStatus().volume;
float total = volume.level;
if (volume.increment <= 0f) {
throw new ChromeCastException("Volume.increment is <= 0");
}
// With floating points we always... | java | public final void setVolumeByIncrement(float level) throws IOException {
Volume volume = this.getStatus().volume;
float total = volume.level;
if (volume.increment <= 0f) {
throw new ChromeCastException("Volume.increment is <= 0");
}
// With floating points we always... | [
"public",
"final",
"void",
"setVolumeByIncrement",
"(",
"float",
"level",
")",
"throws",
"IOException",
"{",
"Volume",
"volume",
"=",
"this",
".",
"getStatus",
"(",
")",
".",
"volume",
";",
"float",
"total",
"=",
"volume",
".",
"level",
";",
"if",
"(",
"... | ChromeCast does not allow you to jump levels too quickly to avoid blowing speakers.
Setting by increment allows us to easily get the level we want
@param level volume level from 0 to 1 to set
@throws IOException
@see <a href="https://developers.google.com/cast/docs/design_checklist/sender#sender-control-volume">sender... | [
"ChromeCast",
"does",
"not",
"allow",
"you",
"to",
"jump",
"levels",
"too",
"quickly",
"to",
"avoid",
"blowing",
"speakers",
".",
"Setting",
"by",
"increment",
"allows",
"us",
"to",
"easily",
"get",
"the",
"level",
"we",
"want"
] | 3d8c0d7e735464f1cb64c5aa349e486d18a3b2ad | https://github.com/vitalidze/chromecast-java-api-v2/blob/3d8c0d7e735464f1cb64c5aa349e486d18a3b2ad/src/main/java/su/litvak/chromecast/api/v2/ChromeCast.java#L300-L323 |
163,202 | vitalidze/chromecast-java-api-v2 | src/main/java/su/litvak/chromecast/api/v2/Channel.java | Channel.connect | private void connect() throws IOException, GeneralSecurityException {
synchronized (closedSync) {
if (socket == null || socket.isClosed()) {
SSLContext sc = SSLContext.getInstance("SSL");
sc.init(null, new TrustManager[] { new X509TrustAllManager() }, new SecureRandom... | java | private void connect() throws IOException, GeneralSecurityException {
synchronized (closedSync) {
if (socket == null || socket.isClosed()) {
SSLContext sc = SSLContext.getInstance("SSL");
sc.init(null, new TrustManager[] { new X509TrustAllManager() }, new SecureRandom... | [
"private",
"void",
"connect",
"(",
")",
"throws",
"IOException",
",",
"GeneralSecurityException",
"{",
"synchronized",
"(",
"closedSync",
")",
"{",
"if",
"(",
"socket",
"==",
"null",
"||",
"socket",
".",
"isClosed",
"(",
")",
")",
"{",
"SSLContext",
"sc",
... | Establish connection to the ChromeCast device | [
"Establish",
"connection",
"to",
"the",
"ChromeCast",
"device"
] | 3d8c0d7e735464f1cb64c5aa349e486d18a3b2ad | https://github.com/vitalidze/chromecast-java-api-v2/blob/3d8c0d7e735464f1cb64c5aa349e486d18a3b2ad/src/main/java/su/litvak/chromecast/api/v2/Channel.java#L288-L344 |
163,203 | komamitsu/fluency | fluency-core/src/main/java/org/komamitsu/fluency/util/ExecutorServiceUtils.java | ExecutorServiceUtils.newSingleThreadDaemonExecutor | public static ExecutorService newSingleThreadDaemonExecutor() {
return Executors.newSingleThreadExecutor(r -> {
Thread t = Executors.defaultThreadFactory().newThread(r);
t.setDaemon(true);
return t;
});
} | java | public static ExecutorService newSingleThreadDaemonExecutor() {
return Executors.newSingleThreadExecutor(r -> {
Thread t = Executors.defaultThreadFactory().newThread(r);
t.setDaemon(true);
return t;
});
} | [
"public",
"static",
"ExecutorService",
"newSingleThreadDaemonExecutor",
"(",
")",
"{",
"return",
"Executors",
".",
"newSingleThreadExecutor",
"(",
"r",
"->",
"{",
"Thread",
"t",
"=",
"Executors",
".",
"defaultThreadFactory",
"(",
")",
".",
"newThread",
"(",
"r",
... | Creates an Executor that is based on daemon threads.
This allows the program to quit without explicitly
calling shutdown on the pool
@return the newly created single-threaded Executor | [
"Creates",
"an",
"Executor",
"that",
"is",
"based",
"on",
"daemon",
"threads",
".",
"This",
"allows",
"the",
"program",
"to",
"quit",
"without",
"explicitly",
"calling",
"shutdown",
"on",
"the",
"pool"
] | 76d07ba292d2666d143eaaedb28be97deb928a38 | https://github.com/komamitsu/fluency/blob/76d07ba292d2666d143eaaedb28be97deb928a38/fluency-core/src/main/java/org/komamitsu/fluency/util/ExecutorServiceUtils.java#L38-L44 |
163,204 | komamitsu/fluency | fluency-core/src/main/java/org/komamitsu/fluency/util/ExecutorServiceUtils.java | ExecutorServiceUtils.newScheduledDaemonThreadPool | public static ScheduledExecutorService newScheduledDaemonThreadPool(int corePoolSize) {
return Executors.newScheduledThreadPool(corePoolSize, r -> {
Thread t = Executors.defaultThreadFactory().newThread(r);
t.setDaemon(true);
return t;
});
} | java | public static ScheduledExecutorService newScheduledDaemonThreadPool(int corePoolSize) {
return Executors.newScheduledThreadPool(corePoolSize, r -> {
Thread t = Executors.defaultThreadFactory().newThread(r);
t.setDaemon(true);
return t;
});
} | [
"public",
"static",
"ScheduledExecutorService",
"newScheduledDaemonThreadPool",
"(",
"int",
"corePoolSize",
")",
"{",
"return",
"Executors",
".",
"newScheduledThreadPool",
"(",
"corePoolSize",
",",
"r",
"->",
"{",
"Thread",
"t",
"=",
"Executors",
".",
"defaultThreadFa... | Creates a scheduled thread pool where each thread has the daemon
property set to true. This allows the program to quit without
explicitly calling shutdown on the pool
@param corePoolSize the number of threads to keep in the pool,
even if they are idle
@return a newly created scheduled thread pool | [
"Creates",
"a",
"scheduled",
"thread",
"pool",
"where",
"each",
"thread",
"has",
"the",
"daemon",
"property",
"set",
"to",
"true",
".",
"This",
"allows",
"the",
"program",
"to",
"quit",
"without",
"explicitly",
"calling",
"shutdown",
"on",
"the",
"pool"
] | 76d07ba292d2666d143eaaedb28be97deb928a38 | https://github.com/komamitsu/fluency/blob/76d07ba292d2666d143eaaedb28be97deb928a38/fluency-core/src/main/java/org/komamitsu/fluency/util/ExecutorServiceUtils.java#L56-L62 |
163,205 | SimonVT/android-menudrawer | menudrawer/src/net/simonvt/menudrawer/MenuDrawer.java | MenuDrawer.createMenuDrawer | private static MenuDrawer createMenuDrawer(Activity activity, int dragMode, Position position, Type type) {
MenuDrawer drawer;
if (type == Type.STATIC) {
drawer = new StaticDrawer(activity);
} else if (type == Type.OVERLAY) {
drawer = new OverlayDrawer(activity, dragMod... | java | private static MenuDrawer createMenuDrawer(Activity activity, int dragMode, Position position, Type type) {
MenuDrawer drawer;
if (type == Type.STATIC) {
drawer = new StaticDrawer(activity);
} else if (type == Type.OVERLAY) {
drawer = new OverlayDrawer(activity, dragMod... | [
"private",
"static",
"MenuDrawer",
"createMenuDrawer",
"(",
"Activity",
"activity",
",",
"int",
"dragMode",
",",
"Position",
"position",
",",
"Type",
"type",
")",
"{",
"MenuDrawer",
"drawer",
";",
"if",
"(",
"type",
"==",
"Type",
".",
"STATIC",
")",
"{",
"... | Constructs the appropriate MenuDrawer based on the position. | [
"Constructs",
"the",
"appropriate",
"MenuDrawer",
"based",
"on",
"the",
"position",
"."
] | 59e8d18e109c77d911b8b63232d66d5f0551cf6a | https://github.com/SimonVT/android-menudrawer/blob/59e8d18e109c77d911b8b63232d66d5f0551cf6a/menudrawer/src/net/simonvt/menudrawer/MenuDrawer.java#L478-L501 |
163,206 | SimonVT/android-menudrawer | menudrawer/src/net/simonvt/menudrawer/MenuDrawer.java | MenuDrawer.attachToContent | private static void attachToContent(Activity activity, MenuDrawer menuDrawer) {
/**
* Do not call mActivity#setContentView.
* E.g. if using with a ListActivity, Activity#setContentView is overridden and dispatched to
* MenuDrawer#setContentView, which then again would call Activity#se... | java | private static void attachToContent(Activity activity, MenuDrawer menuDrawer) {
/**
* Do not call mActivity#setContentView.
* E.g. if using with a ListActivity, Activity#setContentView is overridden and dispatched to
* MenuDrawer#setContentView, which then again would call Activity#se... | [
"private",
"static",
"void",
"attachToContent",
"(",
"Activity",
"activity",
",",
"MenuDrawer",
"menuDrawer",
")",
"{",
"/**\n * Do not call mActivity#setContentView.\n * E.g. if using with a ListActivity, Activity#setContentView is overridden and dispatched to\n * Me... | Attaches the menu drawer to the content view. | [
"Attaches",
"the",
"menu",
"drawer",
"to",
"the",
"content",
"view",
"."
] | 59e8d18e109c77d911b8b63232d66d5f0551cf6a | https://github.com/SimonVT/android-menudrawer/blob/59e8d18e109c77d911b8b63232d66d5f0551cf6a/menudrawer/src/net/simonvt/menudrawer/MenuDrawer.java#L506-L515 |
163,207 | SimonVT/android-menudrawer | menudrawer/src/net/simonvt/menudrawer/MenuDrawer.java | MenuDrawer.attachToDecor | private static void attachToDecor(Activity activity, MenuDrawer menuDrawer) {
ViewGroup decorView = (ViewGroup) activity.getWindow().getDecorView();
ViewGroup decorChild = (ViewGroup) decorView.getChildAt(0);
decorView.removeAllViews();
decorView.addView(menuDrawer, LayoutParams.MATCH_P... | java | private static void attachToDecor(Activity activity, MenuDrawer menuDrawer) {
ViewGroup decorView = (ViewGroup) activity.getWindow().getDecorView();
ViewGroup decorChild = (ViewGroup) decorView.getChildAt(0);
decorView.removeAllViews();
decorView.addView(menuDrawer, LayoutParams.MATCH_P... | [
"private",
"static",
"void",
"attachToDecor",
"(",
"Activity",
"activity",
",",
"MenuDrawer",
"menuDrawer",
")",
"{",
"ViewGroup",
"decorView",
"=",
"(",
"ViewGroup",
")",
"activity",
".",
"getWindow",
"(",
")",
".",
"getDecorView",
"(",
")",
";",
"ViewGroup",... | Attaches the menu drawer to the window. | [
"Attaches",
"the",
"menu",
"drawer",
"to",
"the",
"window",
"."
] | 59e8d18e109c77d911b8b63232d66d5f0551cf6a | https://github.com/SimonVT/android-menudrawer/blob/59e8d18e109c77d911b8b63232d66d5f0551cf6a/menudrawer/src/net/simonvt/menudrawer/MenuDrawer.java#L520-L528 |
163,208 | SimonVT/android-menudrawer | menudrawer/src/net/simonvt/menudrawer/MenuDrawer.java | MenuDrawer.setActiveView | public void setActiveView(View v, int position) {
final View oldView = mActiveView;
mActiveView = v;
mActivePosition = position;
if (mAllowIndicatorAnimation && oldView != null) {
startAnimatingIndicator();
}
invalidate();
} | java | public void setActiveView(View v, int position) {
final View oldView = mActiveView;
mActiveView = v;
mActivePosition = position;
if (mAllowIndicatorAnimation && oldView != null) {
startAnimatingIndicator();
}
invalidate();
} | [
"public",
"void",
"setActiveView",
"(",
"View",
"v",
",",
"int",
"position",
")",
"{",
"final",
"View",
"oldView",
"=",
"mActiveView",
";",
"mActiveView",
"=",
"v",
";",
"mActivePosition",
"=",
"position",
";",
"if",
"(",
"mAllowIndicatorAnimation",
"&&",
"o... | Set the active view.
If the mdActiveIndicator attribute is set, this View will have the indicator drawn next to it.
@param v The active view.
@param position Optional position, usually used with ListView. v.setTag(R.id.mdActiveViewPosition, position)
must be called first. | [
"Set",
"the",
"active",
"view",
".",
"If",
"the",
"mdActiveIndicator",
"attribute",
"is",
"set",
"this",
"View",
"will",
"have",
"the",
"indicator",
"drawn",
"next",
"to",
"it",
"."
] | 59e8d18e109c77d911b8b63232d66d5f0551cf6a | https://github.com/SimonVT/android-menudrawer/blob/59e8d18e109c77d911b8b63232d66d5f0551cf6a/menudrawer/src/net/simonvt/menudrawer/MenuDrawer.java#L1005-L1015 |
163,209 | SimonVT/android-menudrawer | menudrawer/src/net/simonvt/menudrawer/MenuDrawer.java | MenuDrawer.getIndicatorStartPos | private int getIndicatorStartPos() {
switch (getPosition()) {
case TOP:
return mIndicatorClipRect.left;
case RIGHT:
return mIndicatorClipRect.top;
case BOTTOM:
return mIndicatorClipRect.left;
default:
... | java | private int getIndicatorStartPos() {
switch (getPosition()) {
case TOP:
return mIndicatorClipRect.left;
case RIGHT:
return mIndicatorClipRect.top;
case BOTTOM:
return mIndicatorClipRect.left;
default:
... | [
"private",
"int",
"getIndicatorStartPos",
"(",
")",
"{",
"switch",
"(",
"getPosition",
"(",
")",
")",
"{",
"case",
"TOP",
":",
"return",
"mIndicatorClipRect",
".",
"left",
";",
"case",
"RIGHT",
":",
"return",
"mIndicatorClipRect",
".",
"top",
";",
"case",
... | Returns the start position of the indicator.
@return The start position of the indicator. | [
"Returns",
"the",
"start",
"position",
"of",
"the",
"indicator",
"."
] | 59e8d18e109c77d911b8b63232d66d5f0551cf6a | https://github.com/SimonVT/android-menudrawer/blob/59e8d18e109c77d911b8b63232d66d5f0551cf6a/menudrawer/src/net/simonvt/menudrawer/MenuDrawer.java#L1071-L1082 |
163,210 | SimonVT/android-menudrawer | menudrawer/src/net/simonvt/menudrawer/MenuDrawer.java | MenuDrawer.animateIndicatorInvalidate | private void animateIndicatorInvalidate() {
if (mIndicatorScroller.computeScrollOffset()) {
mIndicatorOffset = mIndicatorScroller.getCurr();
invalidate();
if (!mIndicatorScroller.isFinished()) {
postOnAnimation(mIndicatorRunnable);
return;
... | java | private void animateIndicatorInvalidate() {
if (mIndicatorScroller.computeScrollOffset()) {
mIndicatorOffset = mIndicatorScroller.getCurr();
invalidate();
if (!mIndicatorScroller.isFinished()) {
postOnAnimation(mIndicatorRunnable);
return;
... | [
"private",
"void",
"animateIndicatorInvalidate",
"(",
")",
"{",
"if",
"(",
"mIndicatorScroller",
".",
"computeScrollOffset",
"(",
")",
")",
"{",
"mIndicatorOffset",
"=",
"mIndicatorScroller",
".",
"getCurr",
"(",
")",
";",
"invalidate",
"(",
")",
";",
"if",
"(... | Callback when each frame in the indicator animation should be drawn. | [
"Callback",
"when",
"each",
"frame",
"in",
"the",
"indicator",
"animation",
"should",
"be",
"drawn",
"."
] | 59e8d18e109c77d911b8b63232d66d5f0551cf6a | https://github.com/SimonVT/android-menudrawer/blob/59e8d18e109c77d911b8b63232d66d5f0551cf6a/menudrawer/src/net/simonvt/menudrawer/MenuDrawer.java#L1100-L1112 |
163,211 | SimonVT/android-menudrawer | menudrawer/src/net/simonvt/menudrawer/MenuDrawer.java | MenuDrawer.setDropShadowColor | public void setDropShadowColor(int color) {
GradientDrawable.Orientation orientation = getDropShadowOrientation();
final int endColor = color & 0x00FFFFFF;
mDropShadowDrawable = new GradientDrawable(orientation,
new int[] {
color,
... | java | public void setDropShadowColor(int color) {
GradientDrawable.Orientation orientation = getDropShadowOrientation();
final int endColor = color & 0x00FFFFFF;
mDropShadowDrawable = new GradientDrawable(orientation,
new int[] {
color,
... | [
"public",
"void",
"setDropShadowColor",
"(",
"int",
"color",
")",
"{",
"GradientDrawable",
".",
"Orientation",
"orientation",
"=",
"getDropShadowOrientation",
"(",
")",
";",
"final",
"int",
"endColor",
"=",
"color",
"&",
"0x00FFFFFF",
";",
"mDropShadowDrawable",
"... | Sets the color of the drop shadow.
@param color The color of the drop shadow. | [
"Sets",
"the",
"color",
"of",
"the",
"drop",
"shadow",
"."
] | 59e8d18e109c77d911b8b63232d66d5f0551cf6a | https://github.com/SimonVT/android-menudrawer/blob/59e8d18e109c77d911b8b63232d66d5f0551cf6a/menudrawer/src/net/simonvt/menudrawer/MenuDrawer.java#L1196-L1206 |
163,212 | SimonVT/android-menudrawer | menudrawer/src/net/simonvt/menudrawer/MenuDrawer.java | MenuDrawer.setSlideDrawable | public void setSlideDrawable(Drawable drawable) {
mSlideDrawable = new SlideDrawable(drawable);
mSlideDrawable.setIsRtl(ViewHelper.getLayoutDirection(this) == LAYOUT_DIRECTION_RTL);
if (mActionBarHelper != null) {
mActionBarHelper.setDisplayShowHomeAsUpEnabled(true);
if... | java | public void setSlideDrawable(Drawable drawable) {
mSlideDrawable = new SlideDrawable(drawable);
mSlideDrawable.setIsRtl(ViewHelper.getLayoutDirection(this) == LAYOUT_DIRECTION_RTL);
if (mActionBarHelper != null) {
mActionBarHelper.setDisplayShowHomeAsUpEnabled(true);
if... | [
"public",
"void",
"setSlideDrawable",
"(",
"Drawable",
"drawable",
")",
"{",
"mSlideDrawable",
"=",
"new",
"SlideDrawable",
"(",
"drawable",
")",
";",
"mSlideDrawable",
".",
"setIsRtl",
"(",
"ViewHelper",
".",
"getLayoutDirection",
"(",
"this",
")",
"==",
"LAYOU... | Sets the drawable used as the drawer indicator.
@param drawable The drawable used as the drawer indicator. | [
"Sets",
"the",
"drawable",
"used",
"as",
"the",
"drawer",
"indicator",
"."
] | 59e8d18e109c77d911b8b63232d66d5f0551cf6a | https://github.com/SimonVT/android-menudrawer/blob/59e8d18e109c77d911b8b63232d66d5f0551cf6a/menudrawer/src/net/simonvt/menudrawer/MenuDrawer.java#L1323-L1335 |
163,213 | SimonVT/android-menudrawer | menudrawer/src/net/simonvt/menudrawer/MenuDrawer.java | MenuDrawer.getContentContainer | public ViewGroup getContentContainer() {
if (mDragMode == MENU_DRAG_CONTENT) {
return mContentContainer;
} else {
return (ViewGroup) findViewById(android.R.id.content);
}
} | java | public ViewGroup getContentContainer() {
if (mDragMode == MENU_DRAG_CONTENT) {
return mContentContainer;
} else {
return (ViewGroup) findViewById(android.R.id.content);
}
} | [
"public",
"ViewGroup",
"getContentContainer",
"(",
")",
"{",
"if",
"(",
"mDragMode",
"==",
"MENU_DRAG_CONTENT",
")",
"{",
"return",
"mContentContainer",
";",
"}",
"else",
"{",
"return",
"(",
"ViewGroup",
")",
"findViewById",
"(",
"android",
".",
"R",
".",
"i... | Returns the ViewGroup used as a parent for the content view.
@return The content view's parent. | [
"Returns",
"the",
"ViewGroup",
"used",
"as",
"a",
"parent",
"for",
"the",
"content",
"view",
"."
] | 59e8d18e109c77d911b8b63232d66d5f0551cf6a | https://github.com/SimonVT/android-menudrawer/blob/59e8d18e109c77d911b8b63232d66d5f0551cf6a/menudrawer/src/net/simonvt/menudrawer/MenuDrawer.java#L1397-L1403 |
163,214 | SimonVT/android-menudrawer | menudrawer/src/net/simonvt/menudrawer/MenuDrawer.java | MenuDrawer.setMenuView | public void setMenuView(int layoutResId) {
mMenuContainer.removeAllViews();
mMenuView = LayoutInflater.from(getContext()).inflate(layoutResId, mMenuContainer, false);
mMenuContainer.addView(mMenuView);
} | java | public void setMenuView(int layoutResId) {
mMenuContainer.removeAllViews();
mMenuView = LayoutInflater.from(getContext()).inflate(layoutResId, mMenuContainer, false);
mMenuContainer.addView(mMenuView);
} | [
"public",
"void",
"setMenuView",
"(",
"int",
"layoutResId",
")",
"{",
"mMenuContainer",
".",
"removeAllViews",
"(",
")",
";",
"mMenuView",
"=",
"LayoutInflater",
".",
"from",
"(",
"getContext",
"(",
")",
")",
".",
"inflate",
"(",
"layoutResId",
",",
"mMenuCo... | Set the menu view from a layout resource.
@param layoutResId Resource ID to be inflated. | [
"Set",
"the",
"menu",
"view",
"from",
"a",
"layout",
"resource",
"."
] | 59e8d18e109c77d911b8b63232d66d5f0551cf6a | https://github.com/SimonVT/android-menudrawer/blob/59e8d18e109c77d911b8b63232d66d5f0551cf6a/menudrawer/src/net/simonvt/menudrawer/MenuDrawer.java#L1410-L1414 |
163,215 | SimonVT/android-menudrawer | menudrawer-samples/src/net/simonvt/menudrawer/samples/BottomDrawerSample.java | BottomDrawerSample.onClick | @Override
public void onClick(View v) {
String tag = (String) v.getTag();
mContentTextView.setText(String.format("%s clicked.", tag));
mMenuDrawer.setActiveView(v);
} | java | @Override
public void onClick(View v) {
String tag = (String) v.getTag();
mContentTextView.setText(String.format("%s clicked.", tag));
mMenuDrawer.setActiveView(v);
} | [
"@",
"Override",
"public",
"void",
"onClick",
"(",
"View",
"v",
")",
"{",
"String",
"tag",
"=",
"(",
"String",
")",
"v",
".",
"getTag",
"(",
")",
";",
"mContentTextView",
".",
"setText",
"(",
"String",
".",
"format",
"(",
"\"%s clicked.\"",
",",
"tag",... | Click handler for bottom drawer items. | [
"Click",
"handler",
"for",
"bottom",
"drawer",
"items",
"."
] | 59e8d18e109c77d911b8b63232d66d5f0551cf6a | https://github.com/SimonVT/android-menudrawer/blob/59e8d18e109c77d911b8b63232d66d5f0551cf6a/menudrawer-samples/src/net/simonvt/menudrawer/samples/BottomDrawerSample.java#L37-L42 |
163,216 | SimonVT/android-menudrawer | menudrawer/src/net/simonvt/menudrawer/DraggableDrawer.java | DraggableDrawer.animateOffsetTo | protected void animateOffsetTo(int position, int velocity, boolean animate) {
endDrag();
endPeek();
final int startX = (int) mOffsetPixels;
final int dx = position - startX;
if (dx == 0 || !animate) {
setOffsetPixels(position);
setDrawerState(position == ... | java | protected void animateOffsetTo(int position, int velocity, boolean animate) {
endDrag();
endPeek();
final int startX = (int) mOffsetPixels;
final int dx = position - startX;
if (dx == 0 || !animate) {
setOffsetPixels(position);
setDrawerState(position == ... | [
"protected",
"void",
"animateOffsetTo",
"(",
"int",
"position",
",",
"int",
"velocity",
",",
"boolean",
"animate",
")",
"{",
"endDrag",
"(",
")",
";",
"endPeek",
"(",
")",
";",
"final",
"int",
"startX",
"=",
"(",
"int",
")",
"mOffsetPixels",
";",
"final"... | Moves the drawer to the position passed.
@param position The position the content is moved to.
@param velocity Optional velocity if called by releasing a drag event.
@param animate Whether the move is animated. | [
"Moves",
"the",
"drawer",
"to",
"the",
"position",
"passed",
"."
] | 59e8d18e109c77d911b8b63232d66d5f0551cf6a | https://github.com/SimonVT/android-menudrawer/blob/59e8d18e109c77d911b8b63232d66d5f0551cf6a/menudrawer/src/net/simonvt/menudrawer/DraggableDrawer.java#L351-L375 |
163,217 | aeshell/aesh | aesh/src/main/java/org/aesh/parser/ParsedLineIterator.java | ParsedLineIterator.pollParsedWord | public ParsedWord pollParsedWord() {
if(hasNextWord()) {
//set correct next char
if(parsedLine.words().size() > (word+1))
character = parsedLine.words().get(word+1).lineIndex();
else
character = -1;
return parsedLine.words().get(wor... | java | public ParsedWord pollParsedWord() {
if(hasNextWord()) {
//set correct next char
if(parsedLine.words().size() > (word+1))
character = parsedLine.words().get(word+1).lineIndex();
else
character = -1;
return parsedLine.words().get(wor... | [
"public",
"ParsedWord",
"pollParsedWord",
"(",
")",
"{",
"if",
"(",
"hasNextWord",
"(",
")",
")",
"{",
"//set correct next char",
"if",
"(",
"parsedLine",
".",
"words",
"(",
")",
".",
"size",
"(",
")",
">",
"(",
"word",
"+",
"1",
")",
")",
"character",... | Polls the next ParsedWord from the stack.
@return next ParsedWord | [
"Polls",
"the",
"next",
"ParsedWord",
"from",
"the",
"stack",
"."
] | fd7d38d333c5dbf116a9778523a4d1df61f027a3 | https://github.com/aeshell/aesh/blob/fd7d38d333c5dbf116a9778523a4d1df61f027a3/aesh/src/main/java/org/aesh/parser/ParsedLineIterator.java#L63-L74 |
163,218 | aeshell/aesh | aesh/src/main/java/org/aesh/parser/ParsedLineIterator.java | ParsedLineIterator.pollChar | public char pollChar() {
if(hasNextChar()) {
if(hasNextWord() &&
character+1 >= parsedLine.words().get(word).lineIndex()+
parsedLine.words().get(word).word().length())
word++;
return parsedLine.line().charAt(character++);
... | java | public char pollChar() {
if(hasNextChar()) {
if(hasNextWord() &&
character+1 >= parsedLine.words().get(word).lineIndex()+
parsedLine.words().get(word).word().length())
word++;
return parsedLine.line().charAt(character++);
... | [
"public",
"char",
"pollChar",
"(",
")",
"{",
"if",
"(",
"hasNextChar",
"(",
")",
")",
"{",
"if",
"(",
"hasNextWord",
"(",
")",
"&&",
"character",
"+",
"1",
">=",
"parsedLine",
".",
"words",
"(",
")",
".",
"get",
"(",
"word",
")",
".",
"lineIndex",
... | Polls the next char from the stack
@return next char | [
"Polls",
"the",
"next",
"char",
"from",
"the",
"stack"
] | fd7d38d333c5dbf116a9778523a4d1df61f027a3 | https://github.com/aeshell/aesh/blob/fd7d38d333c5dbf116a9778523a4d1df61f027a3/aesh/src/main/java/org/aesh/parser/ParsedLineIterator.java#L111-L120 |
163,219 | aeshell/aesh | aesh/src/main/java/org/aesh/parser/ParsedLineIterator.java | ParsedLineIterator.updateIteratorPosition | public void updateIteratorPosition(int length) {
if(length > 0) {
//make sure we dont go OB
if((length + character) > parsedLine.line().length())
length = parsedLine.line().length() - character;
//move word counter to the correct word
while(hasNex... | java | public void updateIteratorPosition(int length) {
if(length > 0) {
//make sure we dont go OB
if((length + character) > parsedLine.line().length())
length = parsedLine.line().length() - character;
//move word counter to the correct word
while(hasNex... | [
"public",
"void",
"updateIteratorPosition",
"(",
"int",
"length",
")",
"{",
"if",
"(",
"length",
">",
"0",
")",
"{",
"//make sure we dont go OB",
"if",
"(",
"(",
"length",
"+",
"character",
")",
">",
"parsedLine",
".",
"line",
"(",
")",
".",
"length",
"(... | Update the current position with specified length.
The input will append to the current position of the iterator.
@param length update length | [
"Update",
"the",
"current",
"position",
"with",
"specified",
"length",
".",
"The",
"input",
"will",
"append",
"to",
"the",
"current",
"position",
"of",
"the",
"iterator",
"."
] | fd7d38d333c5dbf116a9778523a4d1df61f027a3 | https://github.com/aeshell/aesh/blob/fd7d38d333c5dbf116a9778523a4d1df61f027a3/aesh/src/main/java/org/aesh/parser/ParsedLineIterator.java#L162-L178 |
163,220 | aeshell/aesh | aesh/src/main/java/org/aesh/command/impl/parser/AeshCommandLineParser.java | AeshCommandLineParser.printHelp | @Override
public String printHelp() {
List<CommandLineParser<CI>> parsers = getChildParsers();
if (parsers != null && parsers.size() > 0) {
StringBuilder sb = new StringBuilder();
sb.append(processedCommand.printHelp(helpNames()))
.append(Config.getLineSep... | java | @Override
public String printHelp() {
List<CommandLineParser<CI>> parsers = getChildParsers();
if (parsers != null && parsers.size() > 0) {
StringBuilder sb = new StringBuilder();
sb.append(processedCommand.printHelp(helpNames()))
.append(Config.getLineSep... | [
"@",
"Override",
"public",
"String",
"printHelp",
"(",
")",
"{",
"List",
"<",
"CommandLineParser",
"<",
"CI",
">>",
"parsers",
"=",
"getChildParsers",
"(",
")",
";",
"if",
"(",
"parsers",
"!=",
"null",
"&&",
"parsers",
".",
"size",
"(",
")",
">",
"0",
... | Returns a usage String based on the defined command and options.
Useful when printing "help" info etc. | [
"Returns",
"a",
"usage",
"String",
"based",
"on",
"the",
"defined",
"command",
"and",
"options",
".",
"Useful",
"when",
"printing",
"help",
"info",
"etc",
"."
] | fd7d38d333c5dbf116a9778523a4d1df61f027a3 | https://github.com/aeshell/aesh/blob/fd7d38d333c5dbf116a9778523a4d1df61f027a3/aesh/src/main/java/org/aesh/command/impl/parser/AeshCommandLineParser.java#L215-L244 |
163,221 | aeshell/aesh | aesh/src/main/java/org/aesh/command/impl/parser/AeshCommandLineParser.java | AeshCommandLineParser.parse | @Override
public void parse(String line, Mode mode) {
parse(lineParser.parseLine(line, line.length()).iterator(), mode);
} | java | @Override
public void parse(String line, Mode mode) {
parse(lineParser.parseLine(line, line.length()).iterator(), mode);
} | [
"@",
"Override",
"public",
"void",
"parse",
"(",
"String",
"line",
",",
"Mode",
"mode",
")",
"{",
"parse",
"(",
"lineParser",
".",
"parseLine",
"(",
"line",
",",
"line",
".",
"length",
"(",
")",
")",
".",
"iterator",
"(",
")",
",",
"mode",
")",
";"... | Parse a command line with the defined command as base of the rules.
If any options are found, but not defined in the command object an
CommandLineParserException will be thrown.
Also, if a required option is not found or options specified with value,
but is not given any value an CommandLineParserException will be thro... | [
"Parse",
"a",
"command",
"line",
"with",
"the",
"defined",
"command",
"as",
"base",
"of",
"the",
"rules",
".",
"If",
"any",
"options",
"are",
"found",
"but",
"not",
"defined",
"in",
"the",
"command",
"object",
"an",
"CommandLineParserException",
"will",
"be"... | fd7d38d333c5dbf116a9778523a4d1df61f027a3 | https://github.com/aeshell/aesh/blob/fd7d38d333c5dbf116a9778523a4d1df61f027a3/aesh/src/main/java/org/aesh/command/impl/parser/AeshCommandLineParser.java#L559-L562 |
163,222 | aeshell/aesh | aesh/src/main/java/org/aesh/command/impl/populator/AeshCommandPopulator.java | AeshCommandPopulator.populateObject | @Override
public void populateObject(ProcessedCommand<Command<CI>, CI> processedCommand, InvocationProviders invocationProviders,
AeshContext aeshContext, CommandLineParser.Mode mode)
throws CommandLineParserException, OptionValidatorException {
if(processedCommand... | java | @Override
public void populateObject(ProcessedCommand<Command<CI>, CI> processedCommand, InvocationProviders invocationProviders,
AeshContext aeshContext, CommandLineParser.Mode mode)
throws CommandLineParserException, OptionValidatorException {
if(processedCommand... | [
"@",
"Override",
"public",
"void",
"populateObject",
"(",
"ProcessedCommand",
"<",
"Command",
"<",
"CI",
">",
",",
"CI",
">",
"processedCommand",
",",
"InvocationProviders",
"invocationProviders",
",",
"AeshContext",
"aeshContext",
",",
"CommandLineParser",
".",
"Mo... | Populate a Command instance with the values parsed from a command line
If any parser errors are detected it will throw an exception
@param processedCommand command line
@param mode do validation or not
@throws CommandLineParserException any incorrectness in the parser will abort the populate | [
"Populate",
"a",
"Command",
"instance",
"with",
"the",
"values",
"parsed",
"from",
"a",
"command",
"line",
"If",
"any",
"parser",
"errors",
"are",
"detected",
"it",
"will",
"throw",
"an",
"exception"
] | fd7d38d333c5dbf116a9778523a4d1df61f027a3 | https://github.com/aeshell/aesh/blob/fd7d38d333c5dbf116a9778523a4d1df61f027a3/aesh/src/main/java/org/aesh/command/impl/populator/AeshCommandPopulator.java#L55-L89 |
163,223 | aeshell/aesh | aesh/src/main/java/org/aesh/command/impl/internal/ProcessedCommand.java | ProcessedCommand.getOptionLongNamesWithDash | public List<TerminalString> getOptionLongNamesWithDash() {
List<ProcessedOption> opts = getOptions();
List<TerminalString> names = new ArrayList<>(opts.size());
for (ProcessedOption o : opts) {
if(o.getValues().size() == 0 &&
o.activator().isActivated(new ParsedCo... | java | public List<TerminalString> getOptionLongNamesWithDash() {
List<ProcessedOption> opts = getOptions();
List<TerminalString> names = new ArrayList<>(opts.size());
for (ProcessedOption o : opts) {
if(o.getValues().size() == 0 &&
o.activator().isActivated(new ParsedCo... | [
"public",
"List",
"<",
"TerminalString",
">",
"getOptionLongNamesWithDash",
"(",
")",
"{",
"List",
"<",
"ProcessedOption",
">",
"opts",
"=",
"getOptions",
"(",
")",
";",
"List",
"<",
"TerminalString",
">",
"names",
"=",
"new",
"ArrayList",
"<>",
"(",
"opts",... | Return all option names that not already have a value
and is enabled | [
"Return",
"all",
"option",
"names",
"that",
"not",
"already",
"have",
"a",
"value",
"and",
"is",
"enabled"
] | fd7d38d333c5dbf116a9778523a4d1df61f027a3 | https://github.com/aeshell/aesh/blob/fd7d38d333c5dbf116a9778523a4d1df61f027a3/aesh/src/main/java/org/aesh/command/impl/internal/ProcessedCommand.java#L319-L329 |
163,224 | aeshell/aesh | aesh/src/main/java/org/aesh/command/impl/internal/ProcessedCommand.java | ProcessedCommand.printHelp | public String printHelp(String commandName) {
int maxLength = 0;
int width = 80;
List<ProcessedOption> opts = getOptions();
for (ProcessedOption o : opts) {
if(o.getFormattedLength() > maxLength)
maxLength = o.getFormattedLength();
}
StringBui... | java | public String printHelp(String commandName) {
int maxLength = 0;
int width = 80;
List<ProcessedOption> opts = getOptions();
for (ProcessedOption o : opts) {
if(o.getFormattedLength() > maxLength)
maxLength = o.getFormattedLength();
}
StringBui... | [
"public",
"String",
"printHelp",
"(",
"String",
"commandName",
")",
"{",
"int",
"maxLength",
"=",
"0",
";",
"int",
"width",
"=",
"80",
";",
"List",
"<",
"ProcessedOption",
">",
"opts",
"=",
"getOptions",
"(",
")",
";",
"for",
"(",
"ProcessedOption",
"o",... | Returns a description String based on the defined command and options.
Useful when printing "help" info etc. | [
"Returns",
"a",
"description",
"String",
"based",
"on",
"the",
"defined",
"command",
"and",
"options",
".",
"Useful",
"when",
"printing",
"help",
"info",
"etc",
"."
] | fd7d38d333c5dbf116a9778523a4d1df61f027a3 | https://github.com/aeshell/aesh/blob/fd7d38d333c5dbf116a9778523a4d1df61f027a3/aesh/src/main/java/org/aesh/command/impl/internal/ProcessedCommand.java#L390-L440 |
163,225 | aeshell/aesh | aesh/src/main/java/org/aesh/command/impl/internal/ProcessedCommand.java | ProcessedCommand.hasUniqueLongOption | public boolean hasUniqueLongOption(String optionName) {
if(hasLongOption(optionName)) {
for(ProcessedOption o : getOptions()) {
if(o.name().startsWith(optionName) && !o.name().equals(optionName))
return false;
}
return true;
}
... | java | public boolean hasUniqueLongOption(String optionName) {
if(hasLongOption(optionName)) {
for(ProcessedOption o : getOptions()) {
if(o.name().startsWith(optionName) && !o.name().equals(optionName))
return false;
}
return true;
}
... | [
"public",
"boolean",
"hasUniqueLongOption",
"(",
"String",
"optionName",
")",
"{",
"if",
"(",
"hasLongOption",
"(",
"optionName",
")",
")",
"{",
"for",
"(",
"ProcessedOption",
"o",
":",
"getOptions",
"(",
")",
")",
"{",
"if",
"(",
"o",
".",
"name",
"(",
... | not start with another option name | [
"not",
"start",
"with",
"another",
"option",
"name"
] | fd7d38d333c5dbf116a9778523a4d1df61f027a3 | https://github.com/aeshell/aesh/blob/fd7d38d333c5dbf116a9778523a4d1df61f027a3/aesh/src/main/java/org/aesh/command/impl/internal/ProcessedCommand.java#L486-L495 |
163,226 | aeshell/aesh | aesh/src/main/java/org/aesh/io/scanner/ClassFileBuffer.java | ClassFileBuffer.seek | public void seek(final int position) throws IOException {
if (position < 0) {
throw new IllegalArgumentException("position < 0: " + position);
}
if (position > size) {
throw new EOFException();
}
this.pointer = position;
} | java | public void seek(final int position) throws IOException {
if (position < 0) {
throw new IllegalArgumentException("position < 0: " + position);
}
if (position > size) {
throw new EOFException();
}
this.pointer = position;
} | [
"public",
"void",
"seek",
"(",
"final",
"int",
"position",
")",
"throws",
"IOException",
"{",
"if",
"(",
"position",
"<",
"0",
")",
"{",
"throw",
"new",
"IllegalArgumentException",
"(",
"\"position < 0: \"",
"+",
"position",
")",
";",
"}",
"if",
"(",
"posi... | Sets the file-pointer offset, measured from the beginning of this file,
at which the next read or write occurs. | [
"Sets",
"the",
"file",
"-",
"pointer",
"offset",
"measured",
"from",
"the",
"beginning",
"of",
"this",
"file",
"at",
"which",
"the",
"next",
"read",
"or",
"write",
"occurs",
"."
] | fd7d38d333c5dbf116a9778523a4d1df61f027a3 | https://github.com/aeshell/aesh/blob/fd7d38d333c5dbf116a9778523a4d1df61f027a3/aesh/src/main/java/org/aesh/io/scanner/ClassFileBuffer.java#L87-L95 |
163,227 | aeshell/aesh | aesh/src/main/java/org/aesh/command/settings/SettingsImpl.java | SettingsImpl.editMode | @Override
public EditMode editMode() {
if(readInputrc) {
try {
return EditModeBuilder.builder().parseInputrc(new FileInputStream(inputrc())).create();
}
catch(FileNotFoundException e) {
return EditModeBuilder.builder(mode()).create();
... | java | @Override
public EditMode editMode() {
if(readInputrc) {
try {
return EditModeBuilder.builder().parseInputrc(new FileInputStream(inputrc())).create();
}
catch(FileNotFoundException e) {
return EditModeBuilder.builder(mode()).create();
... | [
"@",
"Override",
"public",
"EditMode",
"editMode",
"(",
")",
"{",
"if",
"(",
"readInputrc",
")",
"{",
"try",
"{",
"return",
"EditModeBuilder",
".",
"builder",
"(",
")",
".",
"parseInputrc",
"(",
"new",
"FileInputStream",
"(",
"inputrc",
"(",
")",
")",
")... | Get EditMode based on os and mode
@return edit mode | [
"Get",
"EditMode",
"based",
"on",
"os",
"and",
"mode"
] | fd7d38d333c5dbf116a9778523a4d1df61f027a3 | https://github.com/aeshell/aesh/blob/fd7d38d333c5dbf116a9778523a4d1df61f027a3/aesh/src/main/java/org/aesh/command/settings/SettingsImpl.java#L205-L217 |
163,228 | aeshell/aesh | aesh/src/main/java/org/aesh/command/settings/SettingsImpl.java | SettingsImpl.logFile | @Override
public String logFile() {
if(logFile == null) {
logFile = Config.getTmpDir()+Config.getPathSeparator()+"aesh.log";
}
return logFile;
} | java | @Override
public String logFile() {
if(logFile == null) {
logFile = Config.getTmpDir()+Config.getPathSeparator()+"aesh.log";
}
return logFile;
} | [
"@",
"Override",
"public",
"String",
"logFile",
"(",
")",
"{",
"if",
"(",
"logFile",
"==",
"null",
")",
"{",
"logFile",
"=",
"Config",
".",
"getTmpDir",
"(",
")",
"+",
"Config",
".",
"getPathSeparator",
"(",
")",
"+",
"\"aesh.log\"",
";",
"}",
"return"... | Get log file
@return log file | [
"Get",
"log",
"file"
] | fd7d38d333c5dbf116a9778523a4d1df61f027a3 | https://github.com/aeshell/aesh/blob/fd7d38d333c5dbf116a9778523a4d1df61f027a3/aesh/src/main/java/org/aesh/command/settings/SettingsImpl.java#L414-L420 |
163,229 | aeshell/aesh | aesh/src/main/java/org/aesh/io/scanner/AnnotationDetector.java | AnnotationDetector.detect | public void detect(final String... packageNames) throws IOException {
final String[] pkgNameFilter = new String[packageNames.length];
for (int i = 0; i < pkgNameFilter.length; ++i) {
pkgNameFilter[i] = packageNames[i].replace('.', '/');
if (!pkgNameFilter[i].endsWith("/")) {
... | java | public void detect(final String... packageNames) throws IOException {
final String[] pkgNameFilter = new String[packageNames.length];
for (int i = 0; i < pkgNameFilter.length; ++i) {
pkgNameFilter[i] = packageNames[i].replace('.', '/');
if (!pkgNameFilter[i].endsWith("/")) {
... | [
"public",
"void",
"detect",
"(",
"final",
"String",
"...",
"packageNames",
")",
"throws",
"IOException",
"{",
"final",
"String",
"[",
"]",
"pkgNameFilter",
"=",
"new",
"String",
"[",
"packageNames",
".",
"length",
"]",
";",
"for",
"(",
"int",
"i",
"=",
"... | Report all Java ClassFile files available on the class path within
the specified packages and sub packages.
@see #detect(File...) | [
"Report",
"all",
"Java",
"ClassFile",
"files",
"available",
"on",
"the",
"class",
"path",
"within",
"the",
"specified",
"packages",
"and",
"sub",
"packages",
"."
] | fd7d38d333c5dbf116a9778523a4d1df61f027a3 | https://github.com/aeshell/aesh/blob/fd7d38d333c5dbf116a9778523a4d1df61f027a3/aesh/src/main/java/org/aesh/io/scanner/AnnotationDetector.java#L243-L281 |
163,230 | aeshell/aesh | aesh/src/main/java/org/aesh/io/scanner/FileIterator.java | FileIterator.addReverse | private void addReverse(final File[] files) {
for (int i = files.length - 1; i >= 0; --i) {
stack.add(files[i]);
}
} | java | private void addReverse(final File[] files) {
for (int i = files.length - 1; i >= 0; --i) {
stack.add(files[i]);
}
} | [
"private",
"void",
"addReverse",
"(",
"final",
"File",
"[",
"]",
"files",
")",
"{",
"for",
"(",
"int",
"i",
"=",
"files",
".",
"length",
"-",
"1",
";",
"i",
">=",
"0",
";",
"--",
"i",
")",
"{",
"stack",
".",
"add",
"(",
"files",
"[",
"i",
"]"... | Add the specified files in reverse order. | [
"Add",
"the",
"specified",
"files",
"in",
"reverse",
"order",
"."
] | fd7d38d333c5dbf116a9778523a4d1df61f027a3 | https://github.com/aeshell/aesh/blob/fd7d38d333c5dbf116a9778523a4d1df61f027a3/aesh/src/main/java/org/aesh/io/scanner/FileIterator.java#L113-L117 |
163,231 | weld/core | impl/src/main/java/org/jboss/weld/serialization/ContextualStoreImpl.java | ContextualStoreImpl.getContextual | public <C extends Contextual<I>, I> C getContextual(String id) {
return this.<C, I>getContextual(new StringBeanIdentifier(id));
} | java | public <C extends Contextual<I>, I> C getContextual(String id) {
return this.<C, I>getContextual(new StringBeanIdentifier(id));
} | [
"public",
"<",
"C",
"extends",
"Contextual",
"<",
"I",
">",
",",
"I",
">",
"C",
"getContextual",
"(",
"String",
"id",
")",
"{",
"return",
"this",
".",
"<",
"C",
",",
"I",
">",
"getContextual",
"(",
"new",
"StringBeanIdentifier",
"(",
"id",
")",
")",
... | Given a particular id, return the correct contextual. For contextuals
which aren't passivation capable, the contextual can't be found in another
container, and null will be returned.
@param id An identifier for the contextual
@return the contextual | [
"Given",
"a",
"particular",
"id",
"return",
"the",
"correct",
"contextual",
".",
"For",
"contextuals",
"which",
"aren",
"t",
"passivation",
"capable",
"the",
"contextual",
"can",
"t",
"be",
"found",
"in",
"another",
"container",
"and",
"null",
"will",
"be",
... | 567a2eaf95b168597d23a56be89bf05a7834b2aa | https://github.com/weld/core/blob/567a2eaf95b168597d23a56be89bf05a7834b2aa/impl/src/main/java/org/jboss/weld/serialization/ContextualStoreImpl.java#L83-L85 |
163,232 | weld/core | modules/web/src/main/java/org/jboss/weld/module/web/servlet/ConversationContextActivator.java | ConversationContextActivator.processDestructionQueue | private void processDestructionQueue(HttpServletRequest request) {
Object contextsAttribute = request.getAttribute(DESTRUCTION_QUEUE_ATTRIBUTE_NAME);
if (contextsAttribute instanceof Map) {
Map<String, List<ContextualInstance<?>>> contexts = cast(contextsAttribute);
synchronized ... | java | private void processDestructionQueue(HttpServletRequest request) {
Object contextsAttribute = request.getAttribute(DESTRUCTION_QUEUE_ATTRIBUTE_NAME);
if (contextsAttribute instanceof Map) {
Map<String, List<ContextualInstance<?>>> contexts = cast(contextsAttribute);
synchronized ... | [
"private",
"void",
"processDestructionQueue",
"(",
"HttpServletRequest",
"request",
")",
"{",
"Object",
"contextsAttribute",
"=",
"request",
".",
"getAttribute",
"(",
"DESTRUCTION_QUEUE_ATTRIBUTE_NAME",
")",
";",
"if",
"(",
"contextsAttribute",
"instanceof",
"Map",
")",... | If needed, destroy the remaining conversation contexts after an HTTP session was invalidated within the current request.
@param request | [
"If",
"needed",
"destroy",
"the",
"remaining",
"conversation",
"contexts",
"after",
"an",
"HTTP",
"session",
"was",
"invalidated",
"within",
"the",
"current",
"request",
"."
] | 567a2eaf95b168597d23a56be89bf05a7834b2aa | https://github.com/weld/core/blob/567a2eaf95b168597d23a56be89bf05a7834b2aa/modules/web/src/main/java/org/jboss/weld/module/web/servlet/ConversationContextActivator.java#L193-L212 |
163,233 | weld/core | modules/ejb/src/main/java/org/jboss/weld/module/ejb/SessionBeanAwareInjectionPointBean.java | SessionBeanAwareInjectionPointBean.unregisterContextualInstance | public static void unregisterContextualInstance(EjbDescriptor<?> descriptor) {
Set<Class<?>> classes = CONTEXTUAL_SESSION_BEANS.get();
classes.remove(descriptor.getBeanClass());
if (classes.isEmpty()) {
CONTEXTUAL_SESSION_BEANS.remove();
}
} | java | public static void unregisterContextualInstance(EjbDescriptor<?> descriptor) {
Set<Class<?>> classes = CONTEXTUAL_SESSION_BEANS.get();
classes.remove(descriptor.getBeanClass());
if (classes.isEmpty()) {
CONTEXTUAL_SESSION_BEANS.remove();
}
} | [
"public",
"static",
"void",
"unregisterContextualInstance",
"(",
"EjbDescriptor",
"<",
"?",
">",
"descriptor",
")",
"{",
"Set",
"<",
"Class",
"<",
"?",
">",
">",
"classes",
"=",
"CONTEXTUAL_SESSION_BEANS",
".",
"get",
"(",
")",
";",
"classes",
".",
"remove",... | Indicates that contextual session bean instance has been constructed. | [
"Indicates",
"that",
"contextual",
"session",
"bean",
"instance",
"has",
"been",
"constructed",
"."
] | 567a2eaf95b168597d23a56be89bf05a7834b2aa | https://github.com/weld/core/blob/567a2eaf95b168597d23a56be89bf05a7834b2aa/modules/ejb/src/main/java/org/jboss/weld/module/ejb/SessionBeanAwareInjectionPointBean.java#L99-L105 |
163,234 | weld/core | impl/src/main/java/org/jboss/weld/injection/StaticMethodInjectionPoint.java | StaticMethodInjectionPoint.getParameterValues | protected Object[] getParameterValues(Object specialVal, BeanManagerImpl manager, CreationalContext<?> ctx, CreationalContext<?> transientReferenceContext) {
if (getInjectionPoints().isEmpty()) {
if (specialInjectionPointIndex == -1) {
return Arrays2.EMPTY_ARRAY;
} else {... | java | protected Object[] getParameterValues(Object specialVal, BeanManagerImpl manager, CreationalContext<?> ctx, CreationalContext<?> transientReferenceContext) {
if (getInjectionPoints().isEmpty()) {
if (specialInjectionPointIndex == -1) {
return Arrays2.EMPTY_ARRAY;
} else {... | [
"protected",
"Object",
"[",
"]",
"getParameterValues",
"(",
"Object",
"specialVal",
",",
"BeanManagerImpl",
"manager",
",",
"CreationalContext",
"<",
"?",
">",
"ctx",
",",
"CreationalContext",
"<",
"?",
">",
"transientReferenceContext",
")",
"{",
"if",
"(",
"get... | Helper method for getting the current parameter values from a list of annotated parameters.
@param parameters The list of annotated parameter to look up
@param manager The Bean manager
@return The object array of looked up values | [
"Helper",
"method",
"for",
"getting",
"the",
"current",
"parameter",
"values",
"from",
"a",
"list",
"of",
"annotated",
"parameters",
"."
] | 567a2eaf95b168597d23a56be89bf05a7834b2aa | https://github.com/weld/core/blob/567a2eaf95b168597d23a56be89bf05a7834b2aa/impl/src/main/java/org/jboss/weld/injection/StaticMethodInjectionPoint.java#L117-L138 |
163,235 | weld/core | impl/src/main/java/org/jboss/weld/bootstrap/SpecializationAndEnablementRegistry.java | SpecializationAndEnablementRegistry.resolveSpecializedBeans | public Set<? extends AbstractBean<?, ?>> resolveSpecializedBeans(Bean<?> specializingBean) {
if (specializingBean instanceof AbstractClassBean<?>) {
AbstractClassBean<?> abstractClassBean = (AbstractClassBean<?>) specializingBean;
if (abstractClassBean.isSpecializing()) {
... | java | public Set<? extends AbstractBean<?, ?>> resolveSpecializedBeans(Bean<?> specializingBean) {
if (specializingBean instanceof AbstractClassBean<?>) {
AbstractClassBean<?> abstractClassBean = (AbstractClassBean<?>) specializingBean;
if (abstractClassBean.isSpecializing()) {
... | [
"public",
"Set",
"<",
"?",
"extends",
"AbstractBean",
"<",
"?",
",",
"?",
">",
">",
"resolveSpecializedBeans",
"(",
"Bean",
"<",
"?",
">",
"specializingBean",
")",
"{",
"if",
"(",
"specializingBean",
"instanceof",
"AbstractClassBean",
"<",
"?",
">",
")",
"... | Returns a set of beans specialized by this bean. An empty set is returned if this bean does not specialize another beans. | [
"Returns",
"a",
"set",
"of",
"beans",
"specialized",
"by",
"this",
"bean",
".",
"An",
"empty",
"set",
"is",
"returned",
"if",
"this",
"bean",
"does",
"not",
"specialize",
"another",
"beans",
"."
] | 567a2eaf95b168597d23a56be89bf05a7834b2aa | https://github.com/weld/core/blob/567a2eaf95b168597d23a56be89bf05a7834b2aa/impl/src/main/java/org/jboss/weld/bootstrap/SpecializationAndEnablementRegistry.java#L129-L143 |
163,236 | weld/core | impl/src/main/java/org/jboss/weld/bean/proxy/DecoratorProxyFactory.java | DecoratorProxyFactory.addHandlerInitializerMethod | private void addHandlerInitializerMethod(ClassFile proxyClassType, ClassMethod staticConstructor) throws Exception {
ClassMethod classMethod = proxyClassType.addMethod(AccessFlag.PRIVATE, INIT_MH_METHOD_NAME, BytecodeUtils.VOID_CLASS_DESCRIPTOR, LJAVA_LANG_OBJECT);
final CodeAttribute b = classMethod.ge... | java | private void addHandlerInitializerMethod(ClassFile proxyClassType, ClassMethod staticConstructor) throws Exception {
ClassMethod classMethod = proxyClassType.addMethod(AccessFlag.PRIVATE, INIT_MH_METHOD_NAME, BytecodeUtils.VOID_CLASS_DESCRIPTOR, LJAVA_LANG_OBJECT);
final CodeAttribute b = classMethod.ge... | [
"private",
"void",
"addHandlerInitializerMethod",
"(",
"ClassFile",
"proxyClassType",
",",
"ClassMethod",
"staticConstructor",
")",
"throws",
"Exception",
"{",
"ClassMethod",
"classMethod",
"=",
"proxyClassType",
".",
"addMethod",
"(",
"AccessFlag",
".",
"PRIVATE",
",",... | calls _initMH on the method handler and then stores the result in the
methodHandler field as then new methodHandler | [
"calls",
"_initMH",
"on",
"the",
"method",
"handler",
"and",
"then",
"stores",
"the",
"result",
"in",
"the",
"methodHandler",
"field",
"as",
"then",
"new",
"methodHandler"
] | 567a2eaf95b168597d23a56be89bf05a7834b2aa | https://github.com/weld/core/blob/567a2eaf95b168597d23a56be89bf05a7834b2aa/impl/src/main/java/org/jboss/weld/bean/proxy/DecoratorProxyFactory.java#L81-L93 |
163,237 | weld/core | impl/src/main/java/org/jboss/weld/bean/proxy/DecoratorProxyFactory.java | DecoratorProxyFactory.isEqual | private static boolean isEqual(Method m, Method a) {
if (m.getName().equals(a.getName()) && m.getParameterTypes().length == a.getParameterTypes().length && m.getReturnType().isAssignableFrom(a.getReturnType())) {
for (int i = 0; i < m.getParameterTypes().length; i++) {
if (!(m.getPar... | java | private static boolean isEqual(Method m, Method a) {
if (m.getName().equals(a.getName()) && m.getParameterTypes().length == a.getParameterTypes().length && m.getReturnType().isAssignableFrom(a.getReturnType())) {
for (int i = 0; i < m.getParameterTypes().length; i++) {
if (!(m.getPar... | [
"private",
"static",
"boolean",
"isEqual",
"(",
"Method",
"m",
",",
"Method",
"a",
")",
"{",
"if",
"(",
"m",
".",
"getName",
"(",
")",
".",
"equals",
"(",
"a",
".",
"getName",
"(",
")",
")",
"&&",
"m",
".",
"getParameterTypes",
"(",
")",
".",
"le... | m is more generic than a | [
"m",
"is",
"more",
"generic",
"than",
"a"
] | 567a2eaf95b168597d23a56be89bf05a7834b2aa | https://github.com/weld/core/blob/567a2eaf95b168597d23a56be89bf05a7834b2aa/impl/src/main/java/org/jboss/weld/bean/proxy/DecoratorProxyFactory.java#L163-L173 |
163,238 | weld/core | environments/servlet/core/src/main/java/org/jboss/weld/environment/servlet/WeldServletLifecycle.java | WeldServletLifecycle.createDeployment | protected CDI11Deployment createDeployment(ServletContext context, CDI11Bootstrap bootstrap) {
ImmutableSet.Builder<Metadata<Extension>> extensionsBuilder = ImmutableSet.builder();
extensionsBuilder.addAll(bootstrap.loadExtensions(WeldResourceLoader.getClassLoader()));
if (isDevModeEnabled) {
... | java | protected CDI11Deployment createDeployment(ServletContext context, CDI11Bootstrap bootstrap) {
ImmutableSet.Builder<Metadata<Extension>> extensionsBuilder = ImmutableSet.builder();
extensionsBuilder.addAll(bootstrap.loadExtensions(WeldResourceLoader.getClassLoader()));
if (isDevModeEnabled) {
... | [
"protected",
"CDI11Deployment",
"createDeployment",
"(",
"ServletContext",
"context",
",",
"CDI11Bootstrap",
"bootstrap",
")",
"{",
"ImmutableSet",
".",
"Builder",
"<",
"Metadata",
"<",
"Extension",
">>",
"extensionsBuilder",
"=",
"ImmutableSet",
".",
"builder",
"(",
... | Create servlet deployment.
Can be overridden with custom servlet deployment. e.g. exact resources listing in restricted env like GAE
@param context the servlet context
@param bootstrap the bootstrap
@return new servlet deployment | [
"Create",
"servlet",
"deployment",
"."
] | 567a2eaf95b168597d23a56be89bf05a7834b2aa | https://github.com/weld/core/blob/567a2eaf95b168597d23a56be89bf05a7834b2aa/environments/servlet/core/src/main/java/org/jboss/weld/environment/servlet/WeldServletLifecycle.java#L276-L332 |
163,239 | weld/core | environments/servlet/core/src/main/java/org/jboss/weld/environment/servlet/WeldServletLifecycle.java | WeldServletLifecycle.findContainer | protected Container findContainer(ContainerContext ctx, StringBuilder dump) {
Container container = null;
// 1. Custom container class
String containerClassName = ctx.getServletContext().getInitParameter(Container.CONTEXT_PARAM_CONTAINER_CLASS);
if (containerClassName != null) {
... | java | protected Container findContainer(ContainerContext ctx, StringBuilder dump) {
Container container = null;
// 1. Custom container class
String containerClassName = ctx.getServletContext().getInitParameter(Container.CONTEXT_PARAM_CONTAINER_CLASS);
if (containerClassName != null) {
... | [
"protected",
"Container",
"findContainer",
"(",
"ContainerContext",
"ctx",
",",
"StringBuilder",
"dump",
")",
"{",
"Container",
"container",
"=",
"null",
";",
"// 1. Custom container class",
"String",
"containerClassName",
"=",
"ctx",
".",
"getServletContext",
"(",
")... | Find container env.
@param ctx the container context
@param dump the exception dump
@return valid container or null | [
"Find",
"container",
"env",
"."
] | 567a2eaf95b168597d23a56be89bf05a7834b2aa | https://github.com/weld/core/blob/567a2eaf95b168597d23a56be89bf05a7834b2aa/environments/servlet/core/src/main/java/org/jboss/weld/environment/servlet/WeldServletLifecycle.java#L341-L366 |
163,240 | weld/core | impl/src/main/java/org/jboss/weld/resolution/ResolvableBuilder.java | ResolvableBuilder.createMetadataProvider | private Resolvable createMetadataProvider(Class<?> rawType) {
Set<Type> types = Collections.<Type>singleton(rawType);
return new ResolvableImpl(rawType, types, declaringBean, qualifierInstances, delegate);
} | java | private Resolvable createMetadataProvider(Class<?> rawType) {
Set<Type> types = Collections.<Type>singleton(rawType);
return new ResolvableImpl(rawType, types, declaringBean, qualifierInstances, delegate);
} | [
"private",
"Resolvable",
"createMetadataProvider",
"(",
"Class",
"<",
"?",
">",
"rawType",
")",
"{",
"Set",
"<",
"Type",
">",
"types",
"=",
"Collections",
".",
"<",
"Type",
">",
"singleton",
"(",
"rawType",
")",
";",
"return",
"new",
"ResolvableImpl",
"(",... | just as facade but we keep the qualifiers so that we can recognize Bean from @Intercepted Bean. | [
"just",
"as",
"facade",
"but",
"we",
"keep",
"the",
"qualifiers",
"so",
"that",
"we",
"can",
"recognize",
"Bean",
"from"
] | 567a2eaf95b168597d23a56be89bf05a7834b2aa | https://github.com/weld/core/blob/567a2eaf95b168597d23a56be89bf05a7834b2aa/impl/src/main/java/org/jboss/weld/resolution/ResolvableBuilder.java#L143-L146 |
163,241 | weld/core | impl/src/main/java/org/jboss/weld/bean/proxy/InterceptedSubclassFactory.java | InterceptedSubclassFactory.hasAbstractPackagePrivateSuperClassWithImplementation | private boolean hasAbstractPackagePrivateSuperClassWithImplementation(Class<?> clazz, BridgeMethod bridgeMethod) {
Class<?> superClass = clazz.getSuperclass();
while (superClass != null) {
if (Modifier.isAbstract(superClass.getModifiers()) && Reflections.isPackagePrivate(superClass.getModifi... | java | private boolean hasAbstractPackagePrivateSuperClassWithImplementation(Class<?> clazz, BridgeMethod bridgeMethod) {
Class<?> superClass = clazz.getSuperclass();
while (superClass != null) {
if (Modifier.isAbstract(superClass.getModifiers()) && Reflections.isPackagePrivate(superClass.getModifi... | [
"private",
"boolean",
"hasAbstractPackagePrivateSuperClassWithImplementation",
"(",
"Class",
"<",
"?",
">",
"clazz",
",",
"BridgeMethod",
"bridgeMethod",
")",
"{",
"Class",
"<",
"?",
">",
"superClass",
"=",
"clazz",
".",
"getSuperclass",
"(",
")",
";",
"while",
... | Returns true if super class of the parameter exists and is abstract and package private. In such case we want to omit such method.
See WELD-2507 and Oracle issue - https://bugs.java.com/view_bug.do?bug_id=6342411
@return true if the super class exists and is abstract and package private | [
"Returns",
"true",
"if",
"super",
"class",
"of",
"the",
"parameter",
"exists",
"and",
"is",
"abstract",
"and",
"package",
"private",
".",
"In",
"such",
"case",
"we",
"want",
"to",
"omit",
"such",
"method",
"."
] | 567a2eaf95b168597d23a56be89bf05a7834b2aa | https://github.com/weld/core/blob/567a2eaf95b168597d23a56be89bf05a7834b2aa/impl/src/main/java/org/jboss/weld/bean/proxy/InterceptedSubclassFactory.java#L273-L289 |
163,242 | weld/core | impl/src/main/java/org/jboss/weld/bean/proxy/InterceptedSubclassFactory.java | InterceptedSubclassFactory.addSpecialMethods | protected void addSpecialMethods(ClassFile proxyClassType, ClassMethod staticConstructor) {
try {
// Add special methods for interceptors
for (Method method : LifecycleMixin.class.getMethods()) {
BeanLogger.LOG.addingMethodToProxy(method);
MethodInformatio... | java | protected void addSpecialMethods(ClassFile proxyClassType, ClassMethod staticConstructor) {
try {
// Add special methods for interceptors
for (Method method : LifecycleMixin.class.getMethods()) {
BeanLogger.LOG.addingMethodToProxy(method);
MethodInformatio... | [
"protected",
"void",
"addSpecialMethods",
"(",
"ClassFile",
"proxyClassType",
",",
"ClassMethod",
"staticConstructor",
")",
"{",
"try",
"{",
"// Add special methods for interceptors",
"for",
"(",
"Method",
"method",
":",
"LifecycleMixin",
".",
"class",
".",
"getMethods"... | Adds methods requiring special implementations rather than just
delegation.
@param proxyClassType the Javassist class description for the proxy type | [
"Adds",
"methods",
"requiring",
"special",
"implementations",
"rather",
"than",
"just",
"delegation",
"."
] | 567a2eaf95b168597d23a56be89bf05a7834b2aa | https://github.com/weld/core/blob/567a2eaf95b168597d23a56be89bf05a7834b2aa/impl/src/main/java/org/jboss/weld/bean/proxy/InterceptedSubclassFactory.java#L472-L493 |
163,243 | weld/core | impl/src/main/java/org/jboss/weld/util/Decorators.java | Decorators.checkDelegateType | public static void checkDelegateType(Decorator<?> decorator) {
Set<Type> types = new HierarchyDiscovery(decorator.getDelegateType()).getTypeClosure();
for (Type decoratedType : decorator.getDecoratedTypes()) {
if(!types.contains(decoratedType)) {
throw BeanLogger.LOG.delega... | java | public static void checkDelegateType(Decorator<?> decorator) {
Set<Type> types = new HierarchyDiscovery(decorator.getDelegateType()).getTypeClosure();
for (Type decoratedType : decorator.getDecoratedTypes()) {
if(!types.contains(decoratedType)) {
throw BeanLogger.LOG.delega... | [
"public",
"static",
"void",
"checkDelegateType",
"(",
"Decorator",
"<",
"?",
">",
"decorator",
")",
"{",
"Set",
"<",
"Type",
">",
"types",
"=",
"new",
"HierarchyDiscovery",
"(",
"decorator",
".",
"getDelegateType",
"(",
")",
")",
".",
"getTypeClosure",
"(",
... | Check whether the delegate type implements or extends all decorated types.
@param decorator
@throws DefinitionException If the delegate type doesn't implement or extend all decorated types | [
"Check",
"whether",
"the",
"delegate",
"type",
"implements",
"or",
"extends",
"all",
"decorated",
"types",
"."
] | 567a2eaf95b168597d23a56be89bf05a7834b2aa | https://github.com/weld/core/blob/567a2eaf95b168597d23a56be89bf05a7834b2aa/impl/src/main/java/org/jboss/weld/util/Decorators.java#L134-L143 |
163,244 | weld/core | impl/src/main/java/org/jboss/weld/util/Decorators.java | Decorators.checkAbstractMethods | public static <T> void checkAbstractMethods(Set<Type> decoratedTypes, EnhancedAnnotatedType<T> type, BeanManagerImpl beanManager) {
if (decoratedTypes == null) {
decoratedTypes = new HashSet<Type>(type.getInterfaceClosure());
decoratedTypes.remove(Serializable.class);
}
... | java | public static <T> void checkAbstractMethods(Set<Type> decoratedTypes, EnhancedAnnotatedType<T> type, BeanManagerImpl beanManager) {
if (decoratedTypes == null) {
decoratedTypes = new HashSet<Type>(type.getInterfaceClosure());
decoratedTypes.remove(Serializable.class);
}
... | [
"public",
"static",
"<",
"T",
">",
"void",
"checkAbstractMethods",
"(",
"Set",
"<",
"Type",
">",
"decoratedTypes",
",",
"EnhancedAnnotatedType",
"<",
"T",
">",
"type",
",",
"BeanManagerImpl",
"beanManager",
")",
"{",
"if",
"(",
"decoratedTypes",
"==",
"null",
... | Check all abstract methods are declared by the decorated types.
@param type
@param beanManager
@param delegateType
@throws DefinitionException If any of the abstract methods is not declared by the decorated types | [
"Check",
"all",
"abstract",
"methods",
"are",
"declared",
"by",
"the",
"decorated",
"types",
"."
] | 567a2eaf95b168597d23a56be89bf05a7834b2aa | https://github.com/weld/core/blob/567a2eaf95b168597d23a56be89bf05a7834b2aa/impl/src/main/java/org/jboss/weld/util/Decorators.java#L153-L177 |
163,245 | weld/core | impl/src/main/java/org/jboss/weld/bean/AbstractBean.java | AbstractBean.checkSpecialization | public void checkSpecialization() {
if (isSpecializing()) {
boolean isNameDefined = getAnnotated().isAnnotationPresent(Named.class);
String previousSpecializedBeanName = null;
for (AbstractBean<?, ?> specializedBean : getSpecializedBeans()) {
String name = spe... | java | public void checkSpecialization() {
if (isSpecializing()) {
boolean isNameDefined = getAnnotated().isAnnotationPresent(Named.class);
String previousSpecializedBeanName = null;
for (AbstractBean<?, ?> specializedBean : getSpecializedBeans()) {
String name = spe... | [
"public",
"void",
"checkSpecialization",
"(",
")",
"{",
"if",
"(",
"isSpecializing",
"(",
")",
")",
"{",
"boolean",
"isNameDefined",
"=",
"getAnnotated",
"(",
")",
".",
"isAnnotationPresent",
"(",
"Named",
".",
"class",
")",
";",
"String",
"previousSpecialized... | Validates specialization if this bean specializes another bean. | [
"Validates",
"specialization",
"if",
"this",
"bean",
"specializes",
"another",
"bean",
"."
] | 567a2eaf95b168597d23a56be89bf05a7834b2aa | https://github.com/weld/core/blob/567a2eaf95b168597d23a56be89bf05a7834b2aa/impl/src/main/java/org/jboss/weld/bean/AbstractBean.java#L116-L158 |
163,246 | weld/core | impl/src/main/java/org/jboss/weld/bootstrap/BeanDeploymentModule.java | BeanDeploymentModule.fireEvent | public void fireEvent(Type eventType, Object event, Annotation... qualifiers) {
final EventMetadata metadata = new EventMetadataImpl(eventType, null, qualifiers);
notifier.fireEvent(eventType, event, metadata, qualifiers);
} | java | public void fireEvent(Type eventType, Object event, Annotation... qualifiers) {
final EventMetadata metadata = new EventMetadataImpl(eventType, null, qualifiers);
notifier.fireEvent(eventType, event, metadata, qualifiers);
} | [
"public",
"void",
"fireEvent",
"(",
"Type",
"eventType",
",",
"Object",
"event",
",",
"Annotation",
"...",
"qualifiers",
")",
"{",
"final",
"EventMetadata",
"metadata",
"=",
"new",
"EventMetadataImpl",
"(",
"eventType",
",",
"null",
",",
"qualifiers",
")",
";"... | Fire an event and notify observers that belong to this module.
@param eventType
@param event
@param qualifiers | [
"Fire",
"an",
"event",
"and",
"notify",
"observers",
"that",
"belong",
"to",
"this",
"module",
"."
] | 567a2eaf95b168597d23a56be89bf05a7834b2aa | https://github.com/weld/core/blob/567a2eaf95b168597d23a56be89bf05a7834b2aa/impl/src/main/java/org/jboss/weld/bootstrap/BeanDeploymentModule.java#L91-L94 |
163,247 | weld/core | impl/src/main/java/org/jboss/weld/util/Defaults.java | Defaults.getJlsDefaultValue | @SuppressWarnings("unchecked")
public static <T> T getJlsDefaultValue(Class<T> type) {
if(!type.isPrimitive()) {
return null;
}
return (T) JLS_PRIMITIVE_DEFAULT_VALUES.get(type);
} | java | @SuppressWarnings("unchecked")
public static <T> T getJlsDefaultValue(Class<T> type) {
if(!type.isPrimitive()) {
return null;
}
return (T) JLS_PRIMITIVE_DEFAULT_VALUES.get(type);
} | [
"@",
"SuppressWarnings",
"(",
"\"unchecked\"",
")",
"public",
"static",
"<",
"T",
">",
"T",
"getJlsDefaultValue",
"(",
"Class",
"<",
"T",
">",
"type",
")",
"{",
"if",
"(",
"!",
"type",
".",
"isPrimitive",
"(",
")",
")",
"{",
"return",
"null",
";",
"}... | See also JLS8, 4.12.5 Initial Values of Variables.
@param type
@return the default value for the given type as defined by JLS | [
"See",
"also",
"JLS8",
"4",
".",
"12",
".",
"5",
"Initial",
"Values",
"of",
"Variables",
"."
] | 567a2eaf95b168597d23a56be89bf05a7834b2aa | https://github.com/weld/core/blob/567a2eaf95b168597d23a56be89bf05a7834b2aa/impl/src/main/java/org/jboss/weld/util/Defaults.java#L53-L59 |
163,248 | weld/core | probe/core/src/main/java/org/jboss/weld/probe/ProbeExtension.java | ProbeExtension.afterDeploymentValidation | public void afterDeploymentValidation(@Observes @Priority(1) AfterDeploymentValidation event, BeanManager beanManager) {
BeanManagerImpl manager = BeanManagerProxy.unwrap(beanManager);
probe.init(manager);
if (isJMXSupportEnabled(manager)) {
try {
MBeanServer mbs = Ma... | java | public void afterDeploymentValidation(@Observes @Priority(1) AfterDeploymentValidation event, BeanManager beanManager) {
BeanManagerImpl manager = BeanManagerProxy.unwrap(beanManager);
probe.init(manager);
if (isJMXSupportEnabled(manager)) {
try {
MBeanServer mbs = Ma... | [
"public",
"void",
"afterDeploymentValidation",
"(",
"@",
"Observes",
"@",
"Priority",
"(",
"1",
")",
"AfterDeploymentValidation",
"event",
",",
"BeanManager",
"beanManager",
")",
"{",
"BeanManagerImpl",
"manager",
"=",
"BeanManagerProxy",
".",
"unwrap",
"(",
"beanMa... | any possible bean invocations from other ADV observers | [
"any",
"possible",
"bean",
"invocations",
"from",
"other",
"ADV",
"observers"
] | 567a2eaf95b168597d23a56be89bf05a7834b2aa | https://github.com/weld/core/blob/567a2eaf95b168597d23a56be89bf05a7834b2aa/probe/core/src/main/java/org/jboss/weld/probe/ProbeExtension.java#L165-L178 |
163,249 | weld/core | impl/src/main/java/org/jboss/weld/metadata/Selectors.java | Selectors.matchPath | static boolean matchPath(String[] tokenizedPattern, String[] strDirs, boolean isCaseSensitive) {
int patIdxStart = 0;
int patIdxEnd = tokenizedPattern.length - 1;
int strIdxStart = 0;
int strIdxEnd = strDirs.length - 1;
// up to first '**'
while (patIdxStart <= patIdxEnd... | java | static boolean matchPath(String[] tokenizedPattern, String[] strDirs, boolean isCaseSensitive) {
int patIdxStart = 0;
int patIdxEnd = tokenizedPattern.length - 1;
int strIdxStart = 0;
int strIdxEnd = strDirs.length - 1;
// up to first '**'
while (patIdxStart <= patIdxEnd... | [
"static",
"boolean",
"matchPath",
"(",
"String",
"[",
"]",
"tokenizedPattern",
",",
"String",
"[",
"]",
"strDirs",
",",
"boolean",
"isCaseSensitive",
")",
"{",
"int",
"patIdxStart",
"=",
"0",
";",
"int",
"patIdxEnd",
"=",
"tokenizedPattern",
".",
"length",
"... | Core implementation of matchPath. It is isolated so that it can be called
from TokenizedPattern. | [
"Core",
"implementation",
"of",
"matchPath",
".",
"It",
"is",
"isolated",
"so",
"that",
"it",
"can",
"be",
"called",
"from",
"TokenizedPattern",
"."
] | 567a2eaf95b168597d23a56be89bf05a7834b2aa | https://github.com/weld/core/blob/567a2eaf95b168597d23a56be89bf05a7834b2aa/impl/src/main/java/org/jboss/weld/metadata/Selectors.java#L81-L183 |
163,250 | weld/core | impl/src/main/java/org/jboss/weld/metadata/Selectors.java | Selectors.tokenize | static String[] tokenize(String str) {
char sep = '.';
int start = 0;
int len = str.length();
int count = 0;
for (int pos = 0; pos < len; pos++) {
if (str.charAt(pos) == sep) {
if (pos != start) {
count++;
}
... | java | static String[] tokenize(String str) {
char sep = '.';
int start = 0;
int len = str.length();
int count = 0;
for (int pos = 0; pos < len; pos++) {
if (str.charAt(pos) == sep) {
if (pos != start) {
count++;
}
... | [
"static",
"String",
"[",
"]",
"tokenize",
"(",
"String",
"str",
")",
"{",
"char",
"sep",
"=",
"'",
"'",
";",
"int",
"start",
"=",
"0",
";",
"int",
"len",
"=",
"str",
".",
"length",
"(",
")",
";",
"int",
"count",
"=",
"0",
";",
"for",
"(",
"in... | Tokenize the the string as a package hierarchy
@param str
@return | [
"Tokenize",
"the",
"the",
"string",
"as",
"a",
"package",
"hierarchy"
] | 567a2eaf95b168597d23a56be89bf05a7834b2aa | https://github.com/weld/core/blob/567a2eaf95b168597d23a56be89bf05a7834b2aa/impl/src/main/java/org/jboss/weld/metadata/Selectors.java#L347-L381 |
163,251 | weld/core | impl/src/main/java/org/jboss/weld/bean/proxy/RunWithinInterceptionDecorationContextGenerator.java | RunWithinInterceptionDecorationContextGenerator.endIfStarted | void endIfStarted(CodeAttribute b, ClassMethod method) {
b.aload(getLocalVariableIndex(0));
b.dup();
final BranchEnd ifnotnull = b.ifnull();
b.checkcast(Stack.class);
b.invokevirtual(Stack.class.getName(), END_INTERCEPTOR_CONTEXT_METHOD_NAME, EMPTY_PARENTHESES + VOID_CLASS_DESCRI... | java | void endIfStarted(CodeAttribute b, ClassMethod method) {
b.aload(getLocalVariableIndex(0));
b.dup();
final BranchEnd ifnotnull = b.ifnull();
b.checkcast(Stack.class);
b.invokevirtual(Stack.class.getName(), END_INTERCEPTOR_CONTEXT_METHOD_NAME, EMPTY_PARENTHESES + VOID_CLASS_DESCRI... | [
"void",
"endIfStarted",
"(",
"CodeAttribute",
"b",
",",
"ClassMethod",
"method",
")",
"{",
"b",
".",
"aload",
"(",
"getLocalVariableIndex",
"(",
"0",
")",
")",
";",
"b",
".",
"dup",
"(",
")",
";",
"final",
"BranchEnd",
"ifnotnull",
"=",
"b",
".",
"ifnu... | Ends interception context if it was previously stated. This is indicated by a local variable with index 0. | [
"Ends",
"interception",
"context",
"if",
"it",
"was",
"previously",
"stated",
".",
"This",
"is",
"indicated",
"by",
"a",
"local",
"variable",
"with",
"index",
"0",
"."
] | 567a2eaf95b168597d23a56be89bf05a7834b2aa | https://github.com/weld/core/blob/567a2eaf95b168597d23a56be89bf05a7834b2aa/impl/src/main/java/org/jboss/weld/bean/proxy/RunWithinInterceptionDecorationContextGenerator.java#L117-L127 |
163,252 | weld/core | impl/src/main/java/org/jboss/weld/contexts/AbstractContext.java | AbstractContext.get | @Override
@SuppressFBWarnings(value = "UL_UNRELEASED_LOCK", justification = "False positive from FindBugs")
public <T> T get(Contextual<T> contextual, CreationalContext<T> creationalContext) {
if (!isActive()) {
throw new ContextNotActiveException();
}
checkContextInitialized... | java | @Override
@SuppressFBWarnings(value = "UL_UNRELEASED_LOCK", justification = "False positive from FindBugs")
public <T> T get(Contextual<T> contextual, CreationalContext<T> creationalContext) {
if (!isActive()) {
throw new ContextNotActiveException();
}
checkContextInitialized... | [
"@",
"Override",
"@",
"SuppressFBWarnings",
"(",
"value",
"=",
"\"UL_UNRELEASED_LOCK\"",
",",
"justification",
"=",
"\"False positive from FindBugs\"",
")",
"public",
"<",
"T",
">",
"T",
"get",
"(",
"Contextual",
"<",
"T",
">",
"contextual",
",",
"CreationalContex... | Get the bean if it exists in the contexts.
@return An instance of the bean
@throws ContextNotActiveException if the context is not active
@see javax.enterprise.context.spi.Context#get(BaseBean, boolean) | [
"Get",
"the",
"bean",
"if",
"it",
"exists",
"in",
"the",
"contexts",
"."
] | 567a2eaf95b168597d23a56be89bf05a7834b2aa | https://github.com/weld/core/blob/567a2eaf95b168597d23a56be89bf05a7834b2aa/impl/src/main/java/org/jboss/weld/contexts/AbstractContext.java#L68-L110 |
163,253 | weld/core | impl/src/main/java/org/jboss/weld/contexts/AbstractContext.java | AbstractContext.destroy | protected void destroy() {
ContextLogger.LOG.contextCleared(this);
final BeanStore beanStore = getBeanStore();
if (beanStore == null) {
throw ContextLogger.LOG.noBeanStoreAvailable(this);
}
for (BeanIdentifier id : beanStore) {
destroyContextualInstance(be... | java | protected void destroy() {
ContextLogger.LOG.contextCleared(this);
final BeanStore beanStore = getBeanStore();
if (beanStore == null) {
throw ContextLogger.LOG.noBeanStoreAvailable(this);
}
for (BeanIdentifier id : beanStore) {
destroyContextualInstance(be... | [
"protected",
"void",
"destroy",
"(",
")",
"{",
"ContextLogger",
".",
"LOG",
".",
"contextCleared",
"(",
"this",
")",
";",
"final",
"BeanStore",
"beanStore",
"=",
"getBeanStore",
"(",
")",
";",
"if",
"(",
"beanStore",
"==",
"null",
")",
"{",
"throw",
"Con... | Destroys the context | [
"Destroys",
"the",
"context"
] | 567a2eaf95b168597d23a56be89bf05a7834b2aa | https://github.com/weld/core/blob/567a2eaf95b168597d23a56be89bf05a7834b2aa/impl/src/main/java/org/jboss/weld/contexts/AbstractContext.java#L146-L156 |
163,254 | weld/core | impl/src/main/java/org/jboss/weld/util/collections/Iterables.java | Iterables.addAll | public static <T> boolean addAll(Collection<T> target, Iterable<? extends T> iterable) {
if (iterable instanceof Collection) {
return target.addAll((Collection<? extends T>) iterable);
}
return Iterators.addAll(target, iterable.iterator());
} | java | public static <T> boolean addAll(Collection<T> target, Iterable<? extends T> iterable) {
if (iterable instanceof Collection) {
return target.addAll((Collection<? extends T>) iterable);
}
return Iterators.addAll(target, iterable.iterator());
} | [
"public",
"static",
"<",
"T",
">",
"boolean",
"addAll",
"(",
"Collection",
"<",
"T",
">",
"target",
",",
"Iterable",
"<",
"?",
"extends",
"T",
">",
"iterable",
")",
"{",
"if",
"(",
"iterable",
"instanceof",
"Collection",
")",
"{",
"return",
"target",
"... | Add all elements in the iterable to the collection.
@param target
@param iterable
@return true if the target was modified, false otherwise | [
"Add",
"all",
"elements",
"in",
"the",
"iterable",
"to",
"the",
"collection",
"."
] | 567a2eaf95b168597d23a56be89bf05a7834b2aa | https://github.com/weld/core/blob/567a2eaf95b168597d23a56be89bf05a7834b2aa/impl/src/main/java/org/jboss/weld/util/collections/Iterables.java#L41-L46 |
163,255 | weld/core | impl/src/main/java/org/jboss/weld/manager/FieldProducerFactory.java | FieldProducerFactory.createProducer | @Override
public <T> Producer<T> createProducer(final Bean<X> declaringBean, final Bean<T> bean, DisposalMethod<X, T> disposalMethod) {
EnhancedAnnotatedField<T, X> enhancedField = getManager().getServices().get(MemberTransformer.class).loadEnhancedMember(field, getManager().getId());
return new Pro... | java | @Override
public <T> Producer<T> createProducer(final Bean<X> declaringBean, final Bean<T> bean, DisposalMethod<X, T> disposalMethod) {
EnhancedAnnotatedField<T, X> enhancedField = getManager().getServices().get(MemberTransformer.class).loadEnhancedMember(field, getManager().getId());
return new Pro... | [
"@",
"Override",
"public",
"<",
"T",
">",
"Producer",
"<",
"T",
">",
"createProducer",
"(",
"final",
"Bean",
"<",
"X",
">",
"declaringBean",
",",
"final",
"Bean",
"<",
"T",
">",
"bean",
",",
"DisposalMethod",
"<",
"X",
",",
"T",
">",
"disposalMethod",
... | Producers returned from this method are not validated. Internal use only. | [
"Producers",
"returned",
"from",
"this",
"method",
"are",
"not",
"validated",
".",
"Internal",
"use",
"only",
"."
] | 567a2eaf95b168597d23a56be89bf05a7834b2aa | https://github.com/weld/core/blob/567a2eaf95b168597d23a56be89bf05a7834b2aa/impl/src/main/java/org/jboss/weld/manager/FieldProducerFactory.java#L43-L68 |
163,256 | weld/core | environments/common/src/main/java/org/jboss/weld/environment/deployment/WeldDeployment.java | WeldDeployment.createAdditionalBeanDeploymentArchive | protected WeldBeanDeploymentArchive createAdditionalBeanDeploymentArchive() {
WeldBeanDeploymentArchive additionalBda = new WeldBeanDeploymentArchive(ADDITIONAL_BDA_ID, Collections.synchronizedSet(new HashSet<String>()), null);
additionalBda.getServices().addAll(getServices().entrySet());
beanDe... | java | protected WeldBeanDeploymentArchive createAdditionalBeanDeploymentArchive() {
WeldBeanDeploymentArchive additionalBda = new WeldBeanDeploymentArchive(ADDITIONAL_BDA_ID, Collections.synchronizedSet(new HashSet<String>()), null);
additionalBda.getServices().addAll(getServices().entrySet());
beanDe... | [
"protected",
"WeldBeanDeploymentArchive",
"createAdditionalBeanDeploymentArchive",
"(",
")",
"{",
"WeldBeanDeploymentArchive",
"additionalBda",
"=",
"new",
"WeldBeanDeploymentArchive",
"(",
"ADDITIONAL_BDA_ID",
",",
"Collections",
".",
"synchronizedSet",
"(",
"new",
"HashSet",
... | Additional bean deployment archives are used for extentions, synthetic annotated types and beans which do not come from a bean archive.
@param beanClass
@return the additional bean deployment archive | [
"Additional",
"bean",
"deployment",
"archives",
"are",
"used",
"for",
"extentions",
"synthetic",
"annotated",
"types",
"and",
"beans",
"which",
"do",
"not",
"come",
"from",
"a",
"bean",
"archive",
"."
] | 567a2eaf95b168597d23a56be89bf05a7834b2aa | https://github.com/weld/core/blob/567a2eaf95b168597d23a56be89bf05a7834b2aa/environments/common/src/main/java/org/jboss/weld/environment/deployment/WeldDeployment.java#L104-L110 |
163,257 | weld/core | environments/common/src/main/java/org/jboss/weld/environment/deployment/WeldDeployment.java | WeldDeployment.setBeanDeploymentArchivesAccessibility | protected void setBeanDeploymentArchivesAccessibility() {
for (WeldBeanDeploymentArchive beanDeploymentArchive : beanDeploymentArchives) {
Set<WeldBeanDeploymentArchive> accessibleArchives = new HashSet<>();
for (WeldBeanDeploymentArchive candidate : beanDeploymentArchives) {
... | java | protected void setBeanDeploymentArchivesAccessibility() {
for (WeldBeanDeploymentArchive beanDeploymentArchive : beanDeploymentArchives) {
Set<WeldBeanDeploymentArchive> accessibleArchives = new HashSet<>();
for (WeldBeanDeploymentArchive candidate : beanDeploymentArchives) {
... | [
"protected",
"void",
"setBeanDeploymentArchivesAccessibility",
"(",
")",
"{",
"for",
"(",
"WeldBeanDeploymentArchive",
"beanDeploymentArchive",
":",
"beanDeploymentArchives",
")",
"{",
"Set",
"<",
"WeldBeanDeploymentArchive",
">",
"accessibleArchives",
"=",
"new",
"HashSet"... | By default all bean archives see each other. | [
"By",
"default",
"all",
"bean",
"archives",
"see",
"each",
"other",
"."
] | 567a2eaf95b168597d23a56be89bf05a7834b2aa | https://github.com/weld/core/blob/567a2eaf95b168597d23a56be89bf05a7834b2aa/environments/common/src/main/java/org/jboss/weld/environment/deployment/WeldDeployment.java#L115-L126 |
163,258 | weld/core | probe/core/src/main/java/org/jboss/weld/probe/Parsers.java | Parsers.parseType | static Type parseType(String value, ResourceLoader resourceLoader) {
value = value.trim();
// Wildcards
if (value.equals(WILDCARD)) {
return WildcardTypeImpl.defaultInstance();
}
if (value.startsWith(WILDCARD_EXTENDS)) {
Type upperBound = parseType(value.s... | java | static Type parseType(String value, ResourceLoader resourceLoader) {
value = value.trim();
// Wildcards
if (value.equals(WILDCARD)) {
return WildcardTypeImpl.defaultInstance();
}
if (value.startsWith(WILDCARD_EXTENDS)) {
Type upperBound = parseType(value.s... | [
"static",
"Type",
"parseType",
"(",
"String",
"value",
",",
"ResourceLoader",
"resourceLoader",
")",
"{",
"value",
"=",
"value",
".",
"trim",
"(",
")",
";",
"// Wildcards",
"if",
"(",
"value",
".",
"equals",
"(",
"WILDCARD",
")",
")",
"{",
"return",
"Wil... | Type variables are not supported.
@param value
@return the type | [
"Type",
"variables",
"are",
"not",
"supported",
"."
] | 567a2eaf95b168597d23a56be89bf05a7834b2aa | https://github.com/weld/core/blob/567a2eaf95b168597d23a56be89bf05a7834b2aa/probe/core/src/main/java/org/jboss/weld/probe/Parsers.java#L70-L122 |
163,259 | weld/core | environments/servlet/core/src/main/java/org/jboss/weld/environment/servlet/portlet/PortletSupport.java | PortletSupport.isPortletEnvSupported | public static boolean isPortletEnvSupported() {
if (enabled == null) {
synchronized (PortletSupport.class) {
if (enabled == null) {
try {
PortletSupport.class.getClassLoader().loadClass("javax.portlet.PortletContext");
... | java | public static boolean isPortletEnvSupported() {
if (enabled == null) {
synchronized (PortletSupport.class) {
if (enabled == null) {
try {
PortletSupport.class.getClassLoader().loadClass("javax.portlet.PortletContext");
... | [
"public",
"static",
"boolean",
"isPortletEnvSupported",
"(",
")",
"{",
"if",
"(",
"enabled",
"==",
"null",
")",
"{",
"synchronized",
"(",
"PortletSupport",
".",
"class",
")",
"{",
"if",
"(",
"enabled",
"==",
"null",
")",
"{",
"try",
"{",
"PortletSupport",
... | Is portlet env supported.
@return true if portlet env is supported, false otherwise | [
"Is",
"portlet",
"env",
"supported",
"."
] | 567a2eaf95b168597d23a56be89bf05a7834b2aa | https://github.com/weld/core/blob/567a2eaf95b168597d23a56be89bf05a7834b2aa/environments/servlet/core/src/main/java/org/jboss/weld/environment/servlet/portlet/PortletSupport.java#L40-L54 |
163,260 | weld/core | environments/servlet/core/src/main/java/org/jboss/weld/environment/servlet/portlet/PortletSupport.java | PortletSupport.getBeanManager | public static BeanManager getBeanManager(Object ctx) {
return (BeanManager) javax.portlet.PortletContext.class.cast(ctx).getAttribute(WeldServletLifecycle.BEAN_MANAGER_ATTRIBUTE_NAME);
} | java | public static BeanManager getBeanManager(Object ctx) {
return (BeanManager) javax.portlet.PortletContext.class.cast(ctx).getAttribute(WeldServletLifecycle.BEAN_MANAGER_ATTRIBUTE_NAME);
} | [
"public",
"static",
"BeanManager",
"getBeanManager",
"(",
"Object",
"ctx",
")",
"{",
"return",
"(",
"BeanManager",
")",
"javax",
".",
"portlet",
".",
"PortletContext",
".",
"class",
".",
"cast",
"(",
"ctx",
")",
".",
"getAttribute",
"(",
"WeldServletLifecycle"... | Get bean manager from portlet context.
@param ctx the portlet context
@return bean manager if found | [
"Get",
"bean",
"manager",
"from",
"portlet",
"context",
"."
] | 567a2eaf95b168597d23a56be89bf05a7834b2aa | https://github.com/weld/core/blob/567a2eaf95b168597d23a56be89bf05a7834b2aa/environments/servlet/core/src/main/java/org/jboss/weld/environment/servlet/portlet/PortletSupport.java#L72-L74 |
163,261 | weld/core | impl/src/main/java/org/jboss/weld/bootstrap/enablement/GlobalEnablementBuilder.java | GlobalEnablementBuilder.filter | private <T> List<Class<?>> filter(List<Class<?>> enabledClasses, List<Class<?>> globallyEnabledClasses, LogMessageCallback logMessageCallback,
BeanDeployment deployment) {
for (Iterator<Class<?>> iterator = enabledClasses.iterator(); iterator.hasNext(); ) {
Class<?> enabledClass = iterat... | java | private <T> List<Class<?>> filter(List<Class<?>> enabledClasses, List<Class<?>> globallyEnabledClasses, LogMessageCallback logMessageCallback,
BeanDeployment deployment) {
for (Iterator<Class<?>> iterator = enabledClasses.iterator(); iterator.hasNext(); ) {
Class<?> enabledClass = iterat... | [
"private",
"<",
"T",
">",
"List",
"<",
"Class",
"<",
"?",
">",
">",
"filter",
"(",
"List",
"<",
"Class",
"<",
"?",
">",
">",
"enabledClasses",
",",
"List",
"<",
"Class",
"<",
"?",
">",
">",
"globallyEnabledClasses",
",",
"LogMessageCallback",
"logMessa... | Filter out interceptors and decorators which are also enabled globally.
@param enabledClasses
@param globallyEnabledClasses
@param logMessageCallback
@param deployment
@return the filtered list | [
"Filter",
"out",
"interceptors",
"and",
"decorators",
"which",
"are",
"also",
"enabled",
"globally",
"."
] | 567a2eaf95b168597d23a56be89bf05a7834b2aa | https://github.com/weld/core/blob/567a2eaf95b168597d23a56be89bf05a7834b2aa/impl/src/main/java/org/jboss/weld/bootstrap/enablement/GlobalEnablementBuilder.java#L270-L280 |
163,262 | weld/core | impl/src/main/java/org/jboss/weld/resolution/TypeSafeResolver.java | TypeSafeResolver.resolve | public F resolve(R resolvable, boolean cache) {
R wrappedResolvable = wrap(resolvable);
if (cache) {
return resolved.getValue(wrappedResolvable);
} else {
return resolverFunction.apply(wrappedResolvable);
}
} | java | public F resolve(R resolvable, boolean cache) {
R wrappedResolvable = wrap(resolvable);
if (cache) {
return resolved.getValue(wrappedResolvable);
} else {
return resolverFunction.apply(wrappedResolvable);
}
} | [
"public",
"F",
"resolve",
"(",
"R",
"resolvable",
",",
"boolean",
"cache",
")",
"{",
"R",
"wrappedResolvable",
"=",
"wrap",
"(",
"resolvable",
")",
";",
"if",
"(",
"cache",
")",
"{",
"return",
"resolved",
".",
"getValue",
"(",
"wrappedResolvable",
")",
"... | Get the possible beans for the given element
@param resolvable The resolving criteria
@return An unmodifiable set of matching beans | [
"Get",
"the",
"possible",
"beans",
"for",
"the",
"given",
"element"
] | 567a2eaf95b168597d23a56be89bf05a7834b2aa | https://github.com/weld/core/blob/567a2eaf95b168597d23a56be89bf05a7834b2aa/impl/src/main/java/org/jboss/weld/resolution/TypeSafeResolver.java#L85-L92 |
163,263 | weld/core | impl/src/main/java/org/jboss/weld/resolution/TypeSafeResolver.java | TypeSafeResolver.findMatching | private Set<T> findMatching(R resolvable) {
Set<T> result = new HashSet<T>();
for (T bean : getAllBeans(resolvable)) {
if (matches(resolvable, bean)) {
result.add(bean);
}
}
return result;
} | java | private Set<T> findMatching(R resolvable) {
Set<T> result = new HashSet<T>();
for (T bean : getAllBeans(resolvable)) {
if (matches(resolvable, bean)) {
result.add(bean);
}
}
return result;
} | [
"private",
"Set",
"<",
"T",
">",
"findMatching",
"(",
"R",
"resolvable",
")",
"{",
"Set",
"<",
"T",
">",
"result",
"=",
"new",
"HashSet",
"<",
"T",
">",
"(",
")",
";",
"for",
"(",
"T",
"bean",
":",
"getAllBeans",
"(",
"resolvable",
")",
")",
"{",... | Gets the matching beans for binding criteria from a list of beans
@param resolvable the resolvable
@return A set of filtered beans | [
"Gets",
"the",
"matching",
"beans",
"for",
"binding",
"criteria",
"from",
"a",
"list",
"of",
"beans"
] | 567a2eaf95b168597d23a56be89bf05a7834b2aa | https://github.com/weld/core/blob/567a2eaf95b168597d23a56be89bf05a7834b2aa/impl/src/main/java/org/jboss/weld/resolution/TypeSafeResolver.java#L100-L108 |
163,264 | weld/core | impl/src/main/java/org/jboss/weld/bootstrap/BeanDeployerEnvironment.java | BeanDeployerEnvironment.resolveDisposalBeans | public <X> Set<DisposalMethod<X, ?>> resolveDisposalBeans(Set<Type> types, Set<Annotation> qualifiers, AbstractClassBean<X> declaringBean) {
// We can always cache as this is only ever called by Weld where we avoid non-static inner classes for annotation literals
Set<DisposalMethod<X, ?>> beans = cast(d... | java | public <X> Set<DisposalMethod<X, ?>> resolveDisposalBeans(Set<Type> types, Set<Annotation> qualifiers, AbstractClassBean<X> declaringBean) {
// We can always cache as this is only ever called by Weld where we avoid non-static inner classes for annotation literals
Set<DisposalMethod<X, ?>> beans = cast(d... | [
"public",
"<",
"X",
">",
"Set",
"<",
"DisposalMethod",
"<",
"X",
",",
"?",
">",
">",
"resolveDisposalBeans",
"(",
"Set",
"<",
"Type",
">",
"types",
",",
"Set",
"<",
"Annotation",
">",
"qualifiers",
",",
"AbstractClassBean",
"<",
"X",
">",
"declaringBean"... | Resolve the disposal method for the given producer method. Any resolved
beans will be marked as such for the purpose of validating that all
disposal methods are used. For internal use.
@param types the types
@param qualifiers The binding types to match
@param declaringBean declaring bean
@return The set of matching di... | [
"Resolve",
"the",
"disposal",
"method",
"for",
"the",
"given",
"producer",
"method",
".",
"Any",
"resolved",
"beans",
"will",
"be",
"marked",
"as",
"such",
"for",
"the",
"purpose",
"of",
"validating",
"that",
"all",
"disposal",
"methods",
"are",
"used",
".",... | 567a2eaf95b168597d23a56be89bf05a7834b2aa | https://github.com/weld/core/blob/567a2eaf95b168597d23a56be89bf05a7834b2aa/impl/src/main/java/org/jboss/weld/bootstrap/BeanDeployerEnvironment.java#L297-L302 |
163,265 | weld/core | modules/ejb/src/main/java/org/jboss/weld/module/ejb/SessionBeans.java | SessionBeans.getSessionBeanTypes | private static <T> Set<Type> getSessionBeanTypes(EnhancedAnnotated<T, ?> annotated, EjbDescriptor<T> ejbDescriptor) {
ImmutableSet.Builder<Type> types = ImmutableSet.builder();
// session beans
Map<Class<?>, Type> typeMap = new LinkedHashMap<Class<?>, Type>();
HierarchyDiscovery beanClas... | java | private static <T> Set<Type> getSessionBeanTypes(EnhancedAnnotated<T, ?> annotated, EjbDescriptor<T> ejbDescriptor) {
ImmutableSet.Builder<Type> types = ImmutableSet.builder();
// session beans
Map<Class<?>, Type> typeMap = new LinkedHashMap<Class<?>, Type>();
HierarchyDiscovery beanClas... | [
"private",
"static",
"<",
"T",
">",
"Set",
"<",
"Type",
">",
"getSessionBeanTypes",
"(",
"EnhancedAnnotated",
"<",
"T",
",",
"?",
">",
"annotated",
",",
"EjbDescriptor",
"<",
"T",
">",
"ejbDescriptor",
")",
"{",
"ImmutableSet",
".",
"Builder",
"<",
"Type",... | Bean types of a session bean. | [
"Bean",
"types",
"of",
"a",
"session",
"bean",
"."
] | 567a2eaf95b168597d23a56be89bf05a7834b2aa | https://github.com/weld/core/blob/567a2eaf95b168597d23a56be89bf05a7834b2aa/modules/ejb/src/main/java/org/jboss/weld/module/ejb/SessionBeans.java#L125-L153 |
163,266 | weld/core | modules/ejb/src/main/java/org/jboss/weld/module/ejb/SessionBeanImpl.java | SessionBeanImpl.of | public static <T> SessionBean<T> of(BeanAttributes<T> attributes, InternalEjbDescriptor<T> ejbDescriptor, BeanManagerImpl beanManager, EnhancedAnnotatedType<T> type) {
return new SessionBeanImpl<T>(attributes, type, ejbDescriptor, new StringBeanIdentifier(SessionBeans.createIdentifier(type, ejbDescriptor)), bea... | java | public static <T> SessionBean<T> of(BeanAttributes<T> attributes, InternalEjbDescriptor<T> ejbDescriptor, BeanManagerImpl beanManager, EnhancedAnnotatedType<T> type) {
return new SessionBeanImpl<T>(attributes, type, ejbDescriptor, new StringBeanIdentifier(SessionBeans.createIdentifier(type, ejbDescriptor)), bea... | [
"public",
"static",
"<",
"T",
">",
"SessionBean",
"<",
"T",
">",
"of",
"(",
"BeanAttributes",
"<",
"T",
">",
"attributes",
",",
"InternalEjbDescriptor",
"<",
"T",
">",
"ejbDescriptor",
",",
"BeanManagerImpl",
"beanManager",
",",
"EnhancedAnnotatedType",
"<",
"... | Creates a simple, annotation defined Enterprise Web Bean using the annotations specified on type
@param <T> The type
@param beanManager the current manager
@param type the AnnotatedType to use
@return An Enterprise Web Bean | [
"Creates",
"a",
"simple",
"annotation",
"defined",
"Enterprise",
"Web",
"Bean",
"using",
"the",
"annotations",
"specified",
"on",
"type"
] | 567a2eaf95b168597d23a56be89bf05a7834b2aa | https://github.com/weld/core/blob/567a2eaf95b168597d23a56be89bf05a7834b2aa/modules/ejb/src/main/java/org/jboss/weld/module/ejb/SessionBeanImpl.java#L76-L78 |
163,267 | weld/core | modules/ejb/src/main/java/org/jboss/weld/module/ejb/SessionBeanImpl.java | SessionBeanImpl.checkConflictingRoles | protected void checkConflictingRoles() {
if (getType().isAnnotationPresent(Interceptor.class)) {
throw BeanLogger.LOG.ejbCannotBeInterceptor(getType());
}
if (getType().isAnnotationPresent(Decorator.class)) {
throw BeanLogger.LOG.ejbCannotBeDecorator(getType());
}... | java | protected void checkConflictingRoles() {
if (getType().isAnnotationPresent(Interceptor.class)) {
throw BeanLogger.LOG.ejbCannotBeInterceptor(getType());
}
if (getType().isAnnotationPresent(Decorator.class)) {
throw BeanLogger.LOG.ejbCannotBeDecorator(getType());
}... | [
"protected",
"void",
"checkConflictingRoles",
"(",
")",
"{",
"if",
"(",
"getType",
"(",
")",
".",
"isAnnotationPresent",
"(",
"Interceptor",
".",
"class",
")",
")",
"{",
"throw",
"BeanLogger",
".",
"LOG",
".",
"ejbCannotBeInterceptor",
"(",
"getType",
"(",
"... | Validates for non-conflicting roles | [
"Validates",
"for",
"non",
"-",
"conflicting",
"roles"
] | 567a2eaf95b168597d23a56be89bf05a7834b2aa | https://github.com/weld/core/blob/567a2eaf95b168597d23a56be89bf05a7834b2aa/modules/ejb/src/main/java/org/jboss/weld/module/ejb/SessionBeanImpl.java#L107-L114 |
163,268 | weld/core | modules/ejb/src/main/java/org/jboss/weld/module/ejb/SessionBeanImpl.java | SessionBeanImpl.checkScopeAllowed | protected void checkScopeAllowed() {
if (ejbDescriptor.isStateless() && !isDependent()) {
throw BeanLogger.LOG.scopeNotAllowedOnStatelessSessionBean(getScope(), getType());
}
if (ejbDescriptor.isSingleton() && !(isDependent() || getScope().equals(ApplicationScoped.class))) {
... | java | protected void checkScopeAllowed() {
if (ejbDescriptor.isStateless() && !isDependent()) {
throw BeanLogger.LOG.scopeNotAllowedOnStatelessSessionBean(getScope(), getType());
}
if (ejbDescriptor.isSingleton() && !(isDependent() || getScope().equals(ApplicationScoped.class))) {
... | [
"protected",
"void",
"checkScopeAllowed",
"(",
")",
"{",
"if",
"(",
"ejbDescriptor",
".",
"isStateless",
"(",
")",
"&&",
"!",
"isDependent",
"(",
")",
")",
"{",
"throw",
"BeanLogger",
".",
"LOG",
".",
"scopeNotAllowedOnStatelessSessionBean",
"(",
"getScope",
"... | Check that the scope type is allowed by the stereotypes on the bean and
the bean type | [
"Check",
"that",
"the",
"scope",
"type",
"is",
"allowed",
"by",
"the",
"stereotypes",
"on",
"the",
"bean",
"and",
"the",
"bean",
"type"
] | 567a2eaf95b168597d23a56be89bf05a7834b2aa | https://github.com/weld/core/blob/567a2eaf95b168597d23a56be89bf05a7834b2aa/modules/ejb/src/main/java/org/jboss/weld/module/ejb/SessionBeanImpl.java#L120-L127 |
163,269 | weld/core | modules/ejb/src/main/java/org/jboss/weld/module/ejb/SessionBeanImpl.java | SessionBeanImpl.checkObserverMethods | protected void checkObserverMethods() {
Collection<EnhancedAnnotatedMethod<?, ? super T>> observerMethods = BeanMethods.getObserverMethods(this.getEnhancedAnnotated());
Collection<EnhancedAnnotatedMethod<?, ? super T>> asyncObserverMethods = BeanMethods.getAsyncObserverMethods(this.getEnhancedAnnotated(... | java | protected void checkObserverMethods() {
Collection<EnhancedAnnotatedMethod<?, ? super T>> observerMethods = BeanMethods.getObserverMethods(this.getEnhancedAnnotated());
Collection<EnhancedAnnotatedMethod<?, ? super T>> asyncObserverMethods = BeanMethods.getAsyncObserverMethods(this.getEnhancedAnnotated(... | [
"protected",
"void",
"checkObserverMethods",
"(",
")",
"{",
"Collection",
"<",
"EnhancedAnnotatedMethod",
"<",
"?",
",",
"?",
"super",
"T",
">",
">",
"observerMethods",
"=",
"BeanMethods",
".",
"getObserverMethods",
"(",
"this",
".",
"getEnhancedAnnotated",
"(",
... | If there are any observer methods, they must be static or business
methods. | [
"If",
"there",
"are",
"any",
"observer",
"methods",
"they",
"must",
"be",
"static",
"or",
"business",
"methods",
"."
] | 567a2eaf95b168597d23a56be89bf05a7834b2aa | https://github.com/weld/core/blob/567a2eaf95b168597d23a56be89bf05a7834b2aa/modules/ejb/src/main/java/org/jboss/weld/module/ejb/SessionBeanImpl.java#L203-L208 |
163,270 | weld/core | impl/src/main/java/org/jboss/weld/bean/NewManagedBean.java | NewManagedBean.of | public static <T> NewManagedBean<T> of(BeanAttributes<T> attributes, EnhancedAnnotatedType<T> clazz, BeanManagerImpl beanManager) {
return new NewManagedBean<T>(attributes, clazz, new StringBeanIdentifier(BeanIdentifiers.forNewManagedBean(clazz)), beanManager);
} | java | public static <T> NewManagedBean<T> of(BeanAttributes<T> attributes, EnhancedAnnotatedType<T> clazz, BeanManagerImpl beanManager) {
return new NewManagedBean<T>(attributes, clazz, new StringBeanIdentifier(BeanIdentifiers.forNewManagedBean(clazz)), beanManager);
} | [
"public",
"static",
"<",
"T",
">",
"NewManagedBean",
"<",
"T",
">",
"of",
"(",
"BeanAttributes",
"<",
"T",
">",
"attributes",
",",
"EnhancedAnnotatedType",
"<",
"T",
">",
"clazz",
",",
"BeanManagerImpl",
"beanManager",
")",
"{",
"return",
"new",
"NewManagedB... | Creates an instance of a NewSimpleBean from an annotated class
@param clazz The annotated class
@param beanManager The Bean manager
@return a new NewSimpleBean instance | [
"Creates",
"an",
"instance",
"of",
"a",
"NewSimpleBean",
"from",
"an",
"annotated",
"class"
] | 567a2eaf95b168597d23a56be89bf05a7834b2aa | https://github.com/weld/core/blob/567a2eaf95b168597d23a56be89bf05a7834b2aa/impl/src/main/java/org/jboss/weld/bean/NewManagedBean.java#L39-L41 |
163,271 | weld/core | modules/ejb/src/main/java/org/jboss/weld/module/ejb/EnterpriseBeanProxyMethodHandler.java | EnterpriseBeanProxyMethodHandler.invoke | @Override
public Object invoke(Object self, Method method, Method proceed, Object[] args) throws Throwable {
if ("destroy".equals(method.getName()) && Marker.isMarker(0, method, args)) {
if (bean.getEjbDescriptor().isStateful()) {
if (!reference.isRemoved()) {
... | java | @Override
public Object invoke(Object self, Method method, Method proceed, Object[] args) throws Throwable {
if ("destroy".equals(method.getName()) && Marker.isMarker(0, method, args)) {
if (bean.getEjbDescriptor().isStateful()) {
if (!reference.isRemoved()) {
... | [
"@",
"Override",
"public",
"Object",
"invoke",
"(",
"Object",
"self",
",",
"Method",
"method",
",",
"Method",
"proceed",
",",
"Object",
"[",
"]",
"args",
")",
"throws",
"Throwable",
"{",
"if",
"(",
"\"destroy\"",
".",
"equals",
"(",
"method",
".",
"getNa... | Looks up the EJB in the container and executes the method on it
@param self the proxy instance.
@param method the overridden method declared in the super class or
interface.
@param proceed the forwarder method for invoking the overridden method. It
is null if the overridden method is abstract or declared in the
in... | [
"Looks",
"up",
"the",
"EJB",
"in",
"the",
"container",
"and",
"executes",
"the",
"method",
"on",
"it"
] | 567a2eaf95b168597d23a56be89bf05a7834b2aa | https://github.com/weld/core/blob/567a2eaf95b168597d23a56be89bf05a7834b2aa/modules/ejb/src/main/java/org/jboss/weld/module/ejb/EnterpriseBeanProxyMethodHandler.java#L111-L137 |
163,272 | weld/core | modules/jta/src/main/java/org/jboss/weld/module/jta/TransactionalObserverNotifier.java | TransactionalObserverNotifier.deferNotification | private <T> void deferNotification(T event, final EventMetadata metadata, final ObserverMethod<? super T> observer,
final List<DeferredEventNotification<?>> notifications) {
TransactionPhase transactionPhase = observer.getTransactionPhase();
boolean before = transactionPhase.equals(Transacti... | java | private <T> void deferNotification(T event, final EventMetadata metadata, final ObserverMethod<? super T> observer,
final List<DeferredEventNotification<?>> notifications) {
TransactionPhase transactionPhase = observer.getTransactionPhase();
boolean before = transactionPhase.equals(Transacti... | [
"private",
"<",
"T",
">",
"void",
"deferNotification",
"(",
"T",
"event",
",",
"final",
"EventMetadata",
"metadata",
",",
"final",
"ObserverMethod",
"<",
"?",
"super",
"T",
">",
"observer",
",",
"final",
"List",
"<",
"DeferredEventNotification",
"<",
"?",
">... | Defers an event for processing in a later phase of the current
transaction.
@param metadata The event object | [
"Defers",
"an",
"event",
"for",
"processing",
"in",
"a",
"later",
"phase",
"of",
"the",
"current",
"transaction",
"."
] | 567a2eaf95b168597d23a56be89bf05a7834b2aa | https://github.com/weld/core/blob/567a2eaf95b168597d23a56be89bf05a7834b2aa/modules/jta/src/main/java/org/jboss/weld/module/jta/TransactionalObserverNotifier.java#L63-L69 |
163,273 | weld/core | impl/src/main/java/org/jboss/weld/serialization/BeanIdentifierIndex.java | BeanIdentifierIndex.build | public void build(Set<Bean<?>> beans) {
if (isBuilt()) {
throw new IllegalStateException("BeanIdentifier index is already built!");
}
if (beans.isEmpty()) {
index = new BeanIdentifier[0];
reverseIndex = Collections.emptyMap();
indexHash = 0;
... | java | public void build(Set<Bean<?>> beans) {
if (isBuilt()) {
throw new IllegalStateException("BeanIdentifier index is already built!");
}
if (beans.isEmpty()) {
index = new BeanIdentifier[0];
reverseIndex = Collections.emptyMap();
indexHash = 0;
... | [
"public",
"void",
"build",
"(",
"Set",
"<",
"Bean",
"<",
"?",
">",
">",
"beans",
")",
"{",
"if",
"(",
"isBuilt",
"(",
")",
")",
"{",
"throw",
"new",
"IllegalStateException",
"(",
"\"BeanIdentifier index is already built!\"",
")",
";",
"}",
"if",
"(",
"be... | Note that the index can only be built once.
@param beans The set of beans the index should be built from, only instances of {@link CommonBean} and implementations of {@link PassivationCapable} are
included
@throws IllegalStateException If the index is built already | [
"Note",
"that",
"the",
"index",
"can",
"only",
"be",
"built",
"once",
"."
] | 567a2eaf95b168597d23a56be89bf05a7834b2aa | https://github.com/weld/core/blob/567a2eaf95b168597d23a56be89bf05a7834b2aa/impl/src/main/java/org/jboss/weld/serialization/BeanIdentifierIndex.java#L100-L145 |
163,274 | weld/core | impl/src/main/java/org/jboss/weld/event/FastEvent.java | FastEvent.of | public static <T> FastEvent<T> of(Class<T> type, BeanManagerImpl manager, ObserverNotifier notifier, Annotation... qualifiers) {
ResolvedObservers<T> resolvedObserverMethods = notifier.<T> resolveObserverMethods(type, qualifiers);
if (resolvedObserverMethods.isMetadataRequired()) {
EventMeta... | java | public static <T> FastEvent<T> of(Class<T> type, BeanManagerImpl manager, ObserverNotifier notifier, Annotation... qualifiers) {
ResolvedObservers<T> resolvedObserverMethods = notifier.<T> resolveObserverMethods(type, qualifiers);
if (resolvedObserverMethods.isMetadataRequired()) {
EventMeta... | [
"public",
"static",
"<",
"T",
">",
"FastEvent",
"<",
"T",
">",
"of",
"(",
"Class",
"<",
"T",
">",
"type",
",",
"BeanManagerImpl",
"manager",
",",
"ObserverNotifier",
"notifier",
",",
"Annotation",
"...",
"qualifiers",
")",
"{",
"ResolvedObservers",
"<",
"T... | Constructs a new FastEvent instance
@param type the event type
@param manager the bean manager
@param notifier the notifier to be used for observer method resolution
@param qualifiers the event qualifiers
@return | [
"Constructs",
"a",
"new",
"FastEvent",
"instance"
] | 567a2eaf95b168597d23a56be89bf05a7834b2aa | https://github.com/weld/core/blob/567a2eaf95b168597d23a56be89bf05a7834b2aa/impl/src/main/java/org/jboss/weld/event/FastEvent.java#L75-L84 |
163,275 | weld/core | impl/src/main/java/org/jboss/weld/util/collections/ImmutableList.java | ImmutableList.copyOf | public static <T> List<T> copyOf(T[] elements) {
Preconditions.checkNotNull(elements);
return ofInternal(elements.clone());
} | java | public static <T> List<T> copyOf(T[] elements) {
Preconditions.checkNotNull(elements);
return ofInternal(elements.clone());
} | [
"public",
"static",
"<",
"T",
">",
"List",
"<",
"T",
">",
"copyOf",
"(",
"T",
"[",
"]",
"elements",
")",
"{",
"Preconditions",
".",
"checkNotNull",
"(",
"elements",
")",
";",
"return",
"ofInternal",
"(",
"elements",
".",
"clone",
"(",
")",
")",
";",
... | Creates an immutable list that consists of the elements in the given array. A copy of the given array is used which means
that any modifications to the given array will not affect the immutable list.
@param elements the given array of elements
@return an immutable list | [
"Creates",
"an",
"immutable",
"list",
"that",
"consists",
"of",
"the",
"elements",
"in",
"the",
"given",
"array",
".",
"A",
"copy",
"of",
"the",
"given",
"array",
"is",
"used",
"which",
"means",
"that",
"any",
"modifications",
"to",
"the",
"given",
"array"... | 567a2eaf95b168597d23a56be89bf05a7834b2aa | https://github.com/weld/core/blob/567a2eaf95b168597d23a56be89bf05a7834b2aa/impl/src/main/java/org/jboss/weld/util/collections/ImmutableList.java#L66-L69 |
163,276 | weld/core | impl/src/main/java/org/jboss/weld/util/collections/ImmutableList.java | ImmutableList.copyOf | public static <T> List<T> copyOf(Collection<T> source) {
Preconditions.checkNotNull(source);
if (source instanceof ImmutableList<?>) {
return (ImmutableList<T>) source;
}
if (source.isEmpty()) {
return Collections.emptyList();
}
return ofInternal(s... | java | public static <T> List<T> copyOf(Collection<T> source) {
Preconditions.checkNotNull(source);
if (source instanceof ImmutableList<?>) {
return (ImmutableList<T>) source;
}
if (source.isEmpty()) {
return Collections.emptyList();
}
return ofInternal(s... | [
"public",
"static",
"<",
"T",
">",
"List",
"<",
"T",
">",
"copyOf",
"(",
"Collection",
"<",
"T",
">",
"source",
")",
"{",
"Preconditions",
".",
"checkNotNull",
"(",
"source",
")",
";",
"if",
"(",
"source",
"instanceof",
"ImmutableList",
"<",
"?",
">",
... | Creates an immutable list that consists of the elements in the given collection. If the given collection is already an immutable list,
it is returned directly.
@param source the given collection
@return an immutable list | [
"Creates",
"an",
"immutable",
"list",
"that",
"consists",
"of",
"the",
"elements",
"in",
"the",
"given",
"collection",
".",
"If",
"the",
"given",
"collection",
"is",
"already",
"an",
"immutable",
"list",
"it",
"is",
"returned",
"directly",
"."
] | 567a2eaf95b168597d23a56be89bf05a7834b2aa | https://github.com/weld/core/blob/567a2eaf95b168597d23a56be89bf05a7834b2aa/impl/src/main/java/org/jboss/weld/util/collections/ImmutableList.java#L78-L87 |
163,277 | weld/core | impl/src/main/java/org/jboss/weld/util/Interceptors.java | Interceptors.filterInterceptorBindings | public static Set<Annotation> filterInterceptorBindings(BeanManagerImpl beanManager, Collection<Annotation> annotations) {
Set<Annotation> interceptorBindings = new InterceptorBindingSet(beanManager);
for (Annotation annotation : annotations) {
if (beanManager.isInterceptorBinding(annotation... | java | public static Set<Annotation> filterInterceptorBindings(BeanManagerImpl beanManager, Collection<Annotation> annotations) {
Set<Annotation> interceptorBindings = new InterceptorBindingSet(beanManager);
for (Annotation annotation : annotations) {
if (beanManager.isInterceptorBinding(annotation... | [
"public",
"static",
"Set",
"<",
"Annotation",
">",
"filterInterceptorBindings",
"(",
"BeanManagerImpl",
"beanManager",
",",
"Collection",
"<",
"Annotation",
">",
"annotations",
")",
"{",
"Set",
"<",
"Annotation",
">",
"interceptorBindings",
"=",
"new",
"InterceptorB... | Extracts a set of interceptor bindings from a collection of annotations.
@param beanManager
@param annotations
@return | [
"Extracts",
"a",
"set",
"of",
"interceptor",
"bindings",
"from",
"a",
"collection",
"of",
"annotations",
"."
] | 567a2eaf95b168597d23a56be89bf05a7834b2aa | https://github.com/weld/core/blob/567a2eaf95b168597d23a56be89bf05a7834b2aa/impl/src/main/java/org/jboss/weld/util/Interceptors.java#L54-L62 |
163,278 | weld/core | impl/src/main/java/org/jboss/weld/util/Interceptors.java | Interceptors.flattenInterceptorBindings | public static Set<Annotation> flattenInterceptorBindings(EnhancedAnnotatedType<?> clazz, BeanManagerImpl beanManager, Collection<Annotation> annotations, boolean addTopLevelInterceptorBindings,
boolean addInheritedInterceptorBindings) {
Set<Annotation> flattenInterceptorBindings = new InterceptorBin... | java | public static Set<Annotation> flattenInterceptorBindings(EnhancedAnnotatedType<?> clazz, BeanManagerImpl beanManager, Collection<Annotation> annotations, boolean addTopLevelInterceptorBindings,
boolean addInheritedInterceptorBindings) {
Set<Annotation> flattenInterceptorBindings = new InterceptorBin... | [
"public",
"static",
"Set",
"<",
"Annotation",
">",
"flattenInterceptorBindings",
"(",
"EnhancedAnnotatedType",
"<",
"?",
">",
"clazz",
",",
"BeanManagerImpl",
"beanManager",
",",
"Collection",
"<",
"Annotation",
">",
"annotations",
",",
"boolean",
"addTopLevelIntercep... | Extracts a flat set of interception bindings from a given set of interceptor bindings.
@param addTopLevelInterceptorBindings add top level interceptor bindings to the result set.
@param addInheritedInterceptorBindings add inherited level interceptor bindings to the result set.
@return | [
"Extracts",
"a",
"flat",
"set",
"of",
"interception",
"bindings",
"from",
"a",
"given",
"set",
"of",
"interceptor",
"bindings",
"."
] | 567a2eaf95b168597d23a56be89bf05a7834b2aa | https://github.com/weld/core/blob/567a2eaf95b168597d23a56be89bf05a7834b2aa/impl/src/main/java/org/jboss/weld/util/Interceptors.java#L71-L85 |
163,279 | weld/core | impl/src/main/java/org/jboss/weld/bootstrap/Validator.java | Validator.validateRIBean | protected void validateRIBean(CommonBean<?> bean, BeanManagerImpl beanManager, Collection<CommonBean<?>> specializedBeans) {
validateGeneralBean(bean, beanManager);
if (bean instanceof NewBean) {
return;
}
if (bean instanceof DecorableBean) {
validateDecorators(be... | java | protected void validateRIBean(CommonBean<?> bean, BeanManagerImpl beanManager, Collection<CommonBean<?>> specializedBeans) {
validateGeneralBean(bean, beanManager);
if (bean instanceof NewBean) {
return;
}
if (bean instanceof DecorableBean) {
validateDecorators(be... | [
"protected",
"void",
"validateRIBean",
"(",
"CommonBean",
"<",
"?",
">",
"bean",
",",
"BeanManagerImpl",
"beanManager",
",",
"Collection",
"<",
"CommonBean",
"<",
"?",
">",
">",
"specializedBeans",
")",
"{",
"validateGeneralBean",
"(",
"bean",
",",
"beanManager"... | Validate an RIBean. This includes validating whether two beans specialize
the same bean
@param bean the bean to validate
@param beanManager the current manager
@param specializedBeans the existing specialized beans | [
"Validate",
"an",
"RIBean",
".",
"This",
"includes",
"validating",
"whether",
"two",
"beans",
"specialize",
"the",
"same",
"bean"
] | 567a2eaf95b168597d23a56be89bf05a7834b2aa | https://github.com/weld/core/blob/567a2eaf95b168597d23a56be89bf05a7834b2aa/impl/src/main/java/org/jboss/weld/bootstrap/Validator.java#L163-L195 |
163,280 | weld/core | impl/src/main/java/org/jboss/weld/bootstrap/Validator.java | Validator.validateInjectionPoint | public void validateInjectionPoint(InjectionPoint ij, BeanManagerImpl beanManager) {
validateInjectionPointForDefinitionErrors(ij, ij.getBean(), beanManager);
validateMetadataInjectionPoint(ij, ij.getBean(), ValidatorLogger.INJECTION_INTO_NON_BEAN);
validateEventMetadataInjectionPoint(ij);
... | java | public void validateInjectionPoint(InjectionPoint ij, BeanManagerImpl beanManager) {
validateInjectionPointForDefinitionErrors(ij, ij.getBean(), beanManager);
validateMetadataInjectionPoint(ij, ij.getBean(), ValidatorLogger.INJECTION_INTO_NON_BEAN);
validateEventMetadataInjectionPoint(ij);
... | [
"public",
"void",
"validateInjectionPoint",
"(",
"InjectionPoint",
"ij",
",",
"BeanManagerImpl",
"beanManager",
")",
"{",
"validateInjectionPointForDefinitionErrors",
"(",
"ij",
",",
"ij",
".",
"getBean",
"(",
")",
",",
"beanManager",
")",
";",
"validateMetadataInject... | Validate an injection point
@param ij the injection point to validate
@param beanManager the bean manager | [
"Validate",
"an",
"injection",
"point"
] | 567a2eaf95b168597d23a56be89bf05a7834b2aa | https://github.com/weld/core/blob/567a2eaf95b168597d23a56be89bf05a7834b2aa/impl/src/main/java/org/jboss/weld/bootstrap/Validator.java#L286-L291 |
163,281 | weld/core | impl/src/main/java/org/jboss/weld/bootstrap/Validator.java | Validator.validatePseudoScopedBean | private static void validatePseudoScopedBean(Bean<?> bean, BeanManagerImpl beanManager) {
if (bean.getInjectionPoints().isEmpty()) {
// Skip validation if there are no injection points (e.g. for classes which are not intended to be used as beans)
return;
}
reallyValidateP... | java | private static void validatePseudoScopedBean(Bean<?> bean, BeanManagerImpl beanManager) {
if (bean.getInjectionPoints().isEmpty()) {
// Skip validation if there are no injection points (e.g. for classes which are not intended to be used as beans)
return;
}
reallyValidateP... | [
"private",
"static",
"void",
"validatePseudoScopedBean",
"(",
"Bean",
"<",
"?",
">",
"bean",
",",
"BeanManagerImpl",
"beanManager",
")",
"{",
"if",
"(",
"bean",
".",
"getInjectionPoints",
"(",
")",
".",
"isEmpty",
"(",
")",
")",
"{",
"// Skip validation if the... | Checks to make sure that pseudo scoped beans (i.e. @Dependent scoped beans) have no circular dependencies. | [
"Checks",
"to",
"make",
"sure",
"that",
"pseudo",
"scoped",
"beans",
"(",
"i",
".",
"e",
"."
] | 567a2eaf95b168597d23a56be89bf05a7834b2aa | https://github.com/weld/core/blob/567a2eaf95b168597d23a56be89bf05a7834b2aa/impl/src/main/java/org/jboss/weld/bootstrap/Validator.java#L923-L929 |
163,282 | weld/core | impl/src/main/java/org/jboss/weld/bootstrap/Validator.java | Validator.reallyValidatePseudoScopedBean | private static void reallyValidatePseudoScopedBean(Bean<?> bean, BeanManagerImpl beanManager, Set<Object> dependencyPath, Set<Bean<?>> validatedBeans) {
// see if we have already seen this bean in the dependency path
if (dependencyPath.contains(bean)) {
// create a list that shows the path t... | java | private static void reallyValidatePseudoScopedBean(Bean<?> bean, BeanManagerImpl beanManager, Set<Object> dependencyPath, Set<Bean<?>> validatedBeans) {
// see if we have already seen this bean in the dependency path
if (dependencyPath.contains(bean)) {
// create a list that shows the path t... | [
"private",
"static",
"void",
"reallyValidatePseudoScopedBean",
"(",
"Bean",
"<",
"?",
">",
"bean",
",",
"BeanManagerImpl",
"beanManager",
",",
"Set",
"<",
"Object",
">",
"dependencyPath",
",",
"Set",
"<",
"Bean",
"<",
"?",
">",
">",
"validatedBeans",
")",
"{... | checks if a bean has been seen before in the dependencyPath. If not, it
resolves the InjectionPoints and adds the resolved beans to the set of
beans to be validated | [
"checks",
"if",
"a",
"bean",
"has",
"been",
"seen",
"before",
"in",
"the",
"dependencyPath",
".",
"If",
"not",
"it",
"resolves",
"the",
"InjectionPoints",
"and",
"adds",
"the",
"resolved",
"beans",
"to",
"the",
"set",
"of",
"beans",
"to",
"be",
"validated"... | 567a2eaf95b168597d23a56be89bf05a7834b2aa | https://github.com/weld/core/blob/567a2eaf95b168597d23a56be89bf05a7834b2aa/impl/src/main/java/org/jboss/weld/bootstrap/Validator.java#L936-L971 |
163,283 | weld/core | impl/src/main/java/org/jboss/weld/interceptor/proxy/InterceptionContext.java | InterceptionContext.forConstructorInterception | public static InterceptionContext forConstructorInterception(InterceptionModel interceptionModel, CreationalContext<?> ctx, BeanManagerImpl manager, SlimAnnotatedType<?> type) {
return of(interceptionModel, ctx, manager, null, type);
} | java | public static InterceptionContext forConstructorInterception(InterceptionModel interceptionModel, CreationalContext<?> ctx, BeanManagerImpl manager, SlimAnnotatedType<?> type) {
return of(interceptionModel, ctx, manager, null, type);
} | [
"public",
"static",
"InterceptionContext",
"forConstructorInterception",
"(",
"InterceptionModel",
"interceptionModel",
",",
"CreationalContext",
"<",
"?",
">",
"ctx",
",",
"BeanManagerImpl",
"manager",
",",
"SlimAnnotatedType",
"<",
"?",
">",
"type",
")",
"{",
"retur... | The context returned by this method may be later reused for other interception types.
@param interceptionModel
@param ctx
@param manager
@param type
@return the interception context to be used for the AroundConstruct chain | [
"The",
"context",
"returned",
"by",
"this",
"method",
"may",
"be",
"later",
"reused",
"for",
"other",
"interception",
"types",
"."
] | 567a2eaf95b168597d23a56be89bf05a7834b2aa | https://github.com/weld/core/blob/567a2eaf95b168597d23a56be89bf05a7834b2aa/impl/src/main/java/org/jboss/weld/interceptor/proxy/InterceptionContext.java#L68-L70 |
163,284 | weld/core | impl/src/main/java/org/jboss/weld/bean/DisposalMethod.java | DisposalMethod.getRequiredQualifiers | private Set<QualifierInstance> getRequiredQualifiers(EnhancedAnnotatedParameter<?, ? super X> enhancedDisposedParameter) {
Set<Annotation> disposedParameterQualifiers = enhancedDisposedParameter.getMetaAnnotations(Qualifier.class);
if (disposedParameterQualifiers.isEmpty()) {
disposedParamet... | java | private Set<QualifierInstance> getRequiredQualifiers(EnhancedAnnotatedParameter<?, ? super X> enhancedDisposedParameter) {
Set<Annotation> disposedParameterQualifiers = enhancedDisposedParameter.getMetaAnnotations(Qualifier.class);
if (disposedParameterQualifiers.isEmpty()) {
disposedParamet... | [
"private",
"Set",
"<",
"QualifierInstance",
">",
"getRequiredQualifiers",
"(",
"EnhancedAnnotatedParameter",
"<",
"?",
",",
"?",
"super",
"X",
">",
"enhancedDisposedParameter",
")",
"{",
"Set",
"<",
"Annotation",
">",
"disposedParameterQualifiers",
"=",
"enhancedDispo... | A disposer method is bound to a producer if the producer is assignable to the disposed parameter.
@param enhancedDisposedParameter
@return the set of required qualifiers for the given disposed parameter | [
"A",
"disposer",
"method",
"is",
"bound",
"to",
"a",
"producer",
"if",
"the",
"producer",
"is",
"assignable",
"to",
"the",
"disposed",
"parameter",
"."
] | 567a2eaf95b168597d23a56be89bf05a7834b2aa | https://github.com/weld/core/blob/567a2eaf95b168597d23a56be89bf05a7834b2aa/impl/src/main/java/org/jboss/weld/bean/DisposalMethod.java#L169-L175 |
163,285 | weld/core | impl/src/main/java/org/jboss/weld/util/reflection/Reflections.java | Reflections.getActualTypeArguments | public static Type[] getActualTypeArguments(Class<?> clazz) {
Type type = Types.getCanonicalType(clazz);
if (type instanceof ParameterizedType) {
return ((ParameterizedType) type).getActualTypeArguments();
} else {
return EMPTY_TYPES;
}
} | java | public static Type[] getActualTypeArguments(Class<?> clazz) {
Type type = Types.getCanonicalType(clazz);
if (type instanceof ParameterizedType) {
return ((ParameterizedType) type).getActualTypeArguments();
} else {
return EMPTY_TYPES;
}
} | [
"public",
"static",
"Type",
"[",
"]",
"getActualTypeArguments",
"(",
"Class",
"<",
"?",
">",
"clazz",
")",
"{",
"Type",
"type",
"=",
"Types",
".",
"getCanonicalType",
"(",
"clazz",
")",
";",
"if",
"(",
"type",
"instanceof",
"ParameterizedType",
")",
"{",
... | Gets the actual type arguments of a class
@param clazz The class to examine
@return The type arguments | [
"Gets",
"the",
"actual",
"type",
"arguments",
"of",
"a",
"class"
] | 567a2eaf95b168597d23a56be89bf05a7834b2aa | https://github.com/weld/core/blob/567a2eaf95b168597d23a56be89bf05a7834b2aa/impl/src/main/java/org/jboss/weld/util/reflection/Reflections.java#L229-L236 |
163,286 | weld/core | impl/src/main/java/org/jboss/weld/util/reflection/Reflections.java | Reflections.getActualTypeArguments | public static Type[] getActualTypeArguments(Type type) {
Type resolvedType = Types.getCanonicalType(type);
if (resolvedType instanceof ParameterizedType) {
return ((ParameterizedType) resolvedType).getActualTypeArguments();
} else {
return EMPTY_TYPES;
}
} | java | public static Type[] getActualTypeArguments(Type type) {
Type resolvedType = Types.getCanonicalType(type);
if (resolvedType instanceof ParameterizedType) {
return ((ParameterizedType) resolvedType).getActualTypeArguments();
} else {
return EMPTY_TYPES;
}
} | [
"public",
"static",
"Type",
"[",
"]",
"getActualTypeArguments",
"(",
"Type",
"type",
")",
"{",
"Type",
"resolvedType",
"=",
"Types",
".",
"getCanonicalType",
"(",
"type",
")",
";",
"if",
"(",
"resolvedType",
"instanceof",
"ParameterizedType",
")",
"{",
"return... | Gets the actual type arguments of a Type
@param type The type to examine
@return The type arguments | [
"Gets",
"the",
"actual",
"type",
"arguments",
"of",
"a",
"Type"
] | 567a2eaf95b168597d23a56be89bf05a7834b2aa | https://github.com/weld/core/blob/567a2eaf95b168597d23a56be89bf05a7834b2aa/impl/src/main/java/org/jboss/weld/util/reflection/Reflections.java#L244-L251 |
163,287 | weld/core | impl/src/main/java/org/jboss/weld/util/reflection/Reflections.java | Reflections.loadClass | public static <T> Class<T> loadClass(String className, ResourceLoader resourceLoader) {
try {
return cast(resourceLoader.classForName(className));
} catch (ResourceLoadingException e) {
return null;
} catch (SecurityException e) {
return null;
}
} | java | public static <T> Class<T> loadClass(String className, ResourceLoader resourceLoader) {
try {
return cast(resourceLoader.classForName(className));
} catch (ResourceLoadingException e) {
return null;
} catch (SecurityException e) {
return null;
}
} | [
"public",
"static",
"<",
"T",
">",
"Class",
"<",
"T",
">",
"loadClass",
"(",
"String",
"className",
",",
"ResourceLoader",
"resourceLoader",
")",
"{",
"try",
"{",
"return",
"cast",
"(",
"resourceLoader",
".",
"classForName",
"(",
"className",
")",
")",
";"... | Tries to load a class using the specified ResourceLoader. Returns null if the class is not found.
@param className
@param resourceLoader
@return the loaded class or null if the given class cannot be loaded | [
"Tries",
"to",
"load",
"a",
"class",
"using",
"the",
"specified",
"ResourceLoader",
".",
"Returns",
"null",
"if",
"the",
"class",
"is",
"not",
"found",
"."
] | 567a2eaf95b168597d23a56be89bf05a7834b2aa | https://github.com/weld/core/blob/567a2eaf95b168597d23a56be89bf05a7834b2aa/impl/src/main/java/org/jboss/weld/util/reflection/Reflections.java#L343-L351 |
163,288 | weld/core | impl/src/main/java/org/jboss/weld/util/reflection/Reflections.java | Reflections.findDeclaredMethodByName | public static Method findDeclaredMethodByName(Class<?> clazz, String methodName) {
for (Method method : AccessController.doPrivileged(new GetDeclaredMethodsAction(clazz))) {
if (methodName.equals(method.getName())) {
return method;
}
}
return null;
} | java | public static Method findDeclaredMethodByName(Class<?> clazz, String methodName) {
for (Method method : AccessController.doPrivileged(new GetDeclaredMethodsAction(clazz))) {
if (methodName.equals(method.getName())) {
return method;
}
}
return null;
} | [
"public",
"static",
"Method",
"findDeclaredMethodByName",
"(",
"Class",
"<",
"?",
">",
"clazz",
",",
"String",
"methodName",
")",
"{",
"for",
"(",
"Method",
"method",
":",
"AccessController",
".",
"doPrivileged",
"(",
"new",
"GetDeclaredMethodsAction",
"(",
"cla... | Searches for a declared method with a given name. If the class declares multiple methods with the given name,
there is no guarantee as of which methods is returned. Null is returned if the class does not declare a method
with the given name.
@param clazz the given class
@param methodName the given method name
@return m... | [
"Searches",
"for",
"a",
"declared",
"method",
"with",
"a",
"given",
"name",
".",
"If",
"the",
"class",
"declares",
"multiple",
"methods",
"with",
"the",
"given",
"name",
"there",
"is",
"no",
"guarantee",
"as",
"of",
"which",
"methods",
"is",
"returned",
".... | 567a2eaf95b168597d23a56be89bf05a7834b2aa | https://github.com/weld/core/blob/567a2eaf95b168597d23a56be89bf05a7834b2aa/impl/src/main/java/org/jboss/weld/util/reflection/Reflections.java#L440-L447 |
163,289 | weld/core | environments/se/core/src/main/java/org/jboss/weld/environment/se/StartMain.java | StartMain.main | public static void main(String[] args) {
try {
new StartMain(args).go();
} catch(Throwable t) {
WeldSELogger.LOG.error("Application exited with an exception", t);
System.exit(1);
}
} | java | public static void main(String[] args) {
try {
new StartMain(args).go();
} catch(Throwable t) {
WeldSELogger.LOG.error("Application exited with an exception", t);
System.exit(1);
}
} | [
"public",
"static",
"void",
"main",
"(",
"String",
"[",
"]",
"args",
")",
"{",
"try",
"{",
"new",
"StartMain",
"(",
"args",
")",
".",
"go",
"(",
")",
";",
"}",
"catch",
"(",
"Throwable",
"t",
")",
"{",
"WeldSELogger",
".",
"LOG",
".",
"error",
"(... | The main method called from the command line.
@param args the command line arguments | [
"The",
"main",
"method",
"called",
"from",
"the",
"command",
"line",
"."
] | 567a2eaf95b168597d23a56be89bf05a7834b2aa | https://github.com/weld/core/blob/567a2eaf95b168597d23a56be89bf05a7834b2aa/environments/se/core/src/main/java/org/jboss/weld/environment/se/StartMain.java#L55-L62 |
163,290 | weld/core | impl/src/main/java/org/jboss/weld/contexts/CreationalContextImpl.java | CreationalContextImpl.release | public void release(Contextual<T> contextual, T instance) {
synchronized (dependentInstances) {
for (ContextualInstance<?> dependentInstance : dependentInstances) {
// do not destroy contextual again, since it's just being destroyed
if (contextual == null || !(depende... | java | public void release(Contextual<T> contextual, T instance) {
synchronized (dependentInstances) {
for (ContextualInstance<?> dependentInstance : dependentInstances) {
// do not destroy contextual again, since it's just being destroyed
if (contextual == null || !(depende... | [
"public",
"void",
"release",
"(",
"Contextual",
"<",
"T",
">",
"contextual",
",",
"T",
"instance",
")",
"{",
"synchronized",
"(",
"dependentInstances",
")",
"{",
"for",
"(",
"ContextualInstance",
"<",
"?",
">",
"dependentInstance",
":",
"dependentInstances",
"... | should not be public | [
"should",
"not",
"be",
"public"
] | 567a2eaf95b168597d23a56be89bf05a7834b2aa | https://github.com/weld/core/blob/567a2eaf95b168597d23a56be89bf05a7834b2aa/impl/src/main/java/org/jboss/weld/contexts/CreationalContextImpl.java#L126-L140 |
163,291 | weld/core | impl/src/main/java/org/jboss/weld/contexts/CreationalContextImpl.java | CreationalContextImpl.destroyDependentInstance | public boolean destroyDependentInstance(T instance) {
synchronized (dependentInstances) {
for (Iterator<ContextualInstance<?>> iterator = dependentInstances.iterator(); iterator.hasNext();) {
ContextualInstance<?> contextualInstance = iterator.next();
if (contextualIn... | java | public boolean destroyDependentInstance(T instance) {
synchronized (dependentInstances) {
for (Iterator<ContextualInstance<?>> iterator = dependentInstances.iterator(); iterator.hasNext();) {
ContextualInstance<?> contextualInstance = iterator.next();
if (contextualIn... | [
"public",
"boolean",
"destroyDependentInstance",
"(",
"T",
"instance",
")",
"{",
"synchronized",
"(",
"dependentInstances",
")",
"{",
"for",
"(",
"Iterator",
"<",
"ContextualInstance",
"<",
"?",
">",
">",
"iterator",
"=",
"dependentInstances",
".",
"iterator",
"... | Destroys dependent instance
@param instance
@return true if the instance was destroyed, false otherwise | [
"Destroys",
"dependent",
"instance"
] | 567a2eaf95b168597d23a56be89bf05a7834b2aa | https://github.com/weld/core/blob/567a2eaf95b168597d23a56be89bf05a7834b2aa/impl/src/main/java/org/jboss/weld/contexts/CreationalContextImpl.java#L212-L224 |
163,292 | weld/core | impl/src/main/java/org/jboss/weld/bean/AbstractProducerBean.java | AbstractProducerBean.checkReturnValue | protected T checkReturnValue(T instance) {
if (instance == null && !isDependent()) {
throw BeanLogger.LOG.nullNotAllowedFromProducer(getProducer(), Formats.formatAsStackTraceElement(getAnnotated().getJavaMember()));
}
if (instance == null) {
InjectionPoint injectionPoint ... | java | protected T checkReturnValue(T instance) {
if (instance == null && !isDependent()) {
throw BeanLogger.LOG.nullNotAllowedFromProducer(getProducer(), Formats.formatAsStackTraceElement(getAnnotated().getJavaMember()));
}
if (instance == null) {
InjectionPoint injectionPoint ... | [
"protected",
"T",
"checkReturnValue",
"(",
"T",
"instance",
")",
"{",
"if",
"(",
"instance",
"==",
"null",
"&&",
"!",
"isDependent",
"(",
")",
")",
"{",
"throw",
"BeanLogger",
".",
"LOG",
".",
"nullNotAllowedFromProducer",
"(",
"getProducer",
"(",
")",
","... | Validates the return value
@param instance The instance to validate | [
"Validates",
"the",
"return",
"value"
] | 567a2eaf95b168597d23a56be89bf05a7834b2aa | https://github.com/weld/core/blob/567a2eaf95b168597d23a56be89bf05a7834b2aa/impl/src/main/java/org/jboss/weld/bean/AbstractProducerBean.java#L134-L161 |
163,293 | weld/core | impl/src/main/java/org/jboss/weld/util/collections/ImmutableMap.java | ImmutableMap.copyOf | public static <K, V> Map<K, V> copyOf(Map<K, V> map) {
Preconditions.checkNotNull(map);
return ImmutableMap.<K, V> builder().putAll(map).build();
} | java | public static <K, V> Map<K, V> copyOf(Map<K, V> map) {
Preconditions.checkNotNull(map);
return ImmutableMap.<K, V> builder().putAll(map).build();
} | [
"public",
"static",
"<",
"K",
",",
"V",
">",
"Map",
"<",
"K",
",",
"V",
">",
"copyOf",
"(",
"Map",
"<",
"K",
",",
"V",
">",
"map",
")",
"{",
"Preconditions",
".",
"checkNotNull",
"(",
"map",
")",
";",
"return",
"ImmutableMap",
".",
"<",
"K",
",... | Creates an immutable map. A copy of the given map is used. As a result, it is safe to modify the source map afterwards.
@param map the given map
@return an immutable map | [
"Creates",
"an",
"immutable",
"map",
".",
"A",
"copy",
"of",
"the",
"given",
"map",
"is",
"used",
".",
"As",
"a",
"result",
"it",
"is",
"safe",
"to",
"modify",
"the",
"source",
"map",
"afterwards",
"."
] | 567a2eaf95b168597d23a56be89bf05a7834b2aa | https://github.com/weld/core/blob/567a2eaf95b168597d23a56be89bf05a7834b2aa/impl/src/main/java/org/jboss/weld/util/collections/ImmutableMap.java#L48-L51 |
163,294 | weld/core | impl/src/main/java/org/jboss/weld/util/collections/ImmutableMap.java | ImmutableMap.of | public static <K, V> Map<K, V> of(K key, V value) {
return new ImmutableMapEntry<K, V>(key, value);
} | java | public static <K, V> Map<K, V> of(K key, V value) {
return new ImmutableMapEntry<K, V>(key, value);
} | [
"public",
"static",
"<",
"K",
",",
"V",
">",
"Map",
"<",
"K",
",",
"V",
">",
"of",
"(",
"K",
"key",
",",
"V",
"value",
")",
"{",
"return",
"new",
"ImmutableMapEntry",
"<",
"K",
",",
"V",
">",
"(",
"key",
",",
"value",
")",
";",
"}"
] | Creates an immutable singleton instance.
@param key
@param value
@return | [
"Creates",
"an",
"immutable",
"singleton",
"instance",
"."
] | 567a2eaf95b168597d23a56be89bf05a7834b2aa | https://github.com/weld/core/blob/567a2eaf95b168597d23a56be89bf05a7834b2aa/impl/src/main/java/org/jboss/weld/util/collections/ImmutableMap.java#L60-L62 |
163,295 | weld/core | impl/src/main/java/org/jboss/weld/util/reflection/Formats.java | Formats.formatAsStackTraceElement | public static String formatAsStackTraceElement(InjectionPoint ij) {
Member member;
if (ij.getAnnotated() instanceof AnnotatedField) {
AnnotatedField<?> annotatedField = (AnnotatedField<?>) ij.getAnnotated();
member = annotatedField.getJavaMember();
} else if (ij.getAnnota... | java | public static String formatAsStackTraceElement(InjectionPoint ij) {
Member member;
if (ij.getAnnotated() instanceof AnnotatedField) {
AnnotatedField<?> annotatedField = (AnnotatedField<?>) ij.getAnnotated();
member = annotatedField.getJavaMember();
} else if (ij.getAnnota... | [
"public",
"static",
"String",
"formatAsStackTraceElement",
"(",
"InjectionPoint",
"ij",
")",
"{",
"Member",
"member",
";",
"if",
"(",
"ij",
".",
"getAnnotated",
"(",
")",
"instanceof",
"AnnotatedField",
")",
"{",
"AnnotatedField",
"<",
"?",
">",
"annotatedField"... | See also WELD-1454.
@param ij
@return the formatted string | [
"See",
"also",
"WELD",
"-",
"1454",
"."
] | 567a2eaf95b168597d23a56be89bf05a7834b2aa | https://github.com/weld/core/blob/567a2eaf95b168597d23a56be89bf05a7834b2aa/impl/src/main/java/org/jboss/weld/util/reflection/Formats.java#L93-L107 |
163,296 | weld/core | impl/src/main/java/org/jboss/weld/util/reflection/Formats.java | Formats.getLineNumber | public static int getLineNumber(Member member) {
if (!(member instanceof Method || member instanceof Constructor)) {
// We are not able to get this info for fields
return 0;
}
// BCEL is an optional dependency, if we cannot load it, simply return 0
if (!Reflecti... | java | public static int getLineNumber(Member member) {
if (!(member instanceof Method || member instanceof Constructor)) {
// We are not able to get this info for fields
return 0;
}
// BCEL is an optional dependency, if we cannot load it, simply return 0
if (!Reflecti... | [
"public",
"static",
"int",
"getLineNumber",
"(",
"Member",
"member",
")",
"{",
"if",
"(",
"!",
"(",
"member",
"instanceof",
"Method",
"||",
"member",
"instanceof",
"Constructor",
")",
")",
"{",
"// We are not able to get this info for fields",
"return",
"0",
";",
... | Try to get the line number associated with the given member.
The reflection API does not expose such an info and so we need to analyse the bytecode. Unfortunately, it seems there is no way to get this kind of
information for fields. Moreover, the <code>LineNumberTable</code> attribute is just optional, i.e. the compil... | [
"Try",
"to",
"get",
"the",
"line",
"number",
"associated",
"with",
"the",
"given",
"member",
"."
] | 567a2eaf95b168597d23a56be89bf05a7834b2aa | https://github.com/weld/core/blob/567a2eaf95b168597d23a56be89bf05a7834b2aa/impl/src/main/java/org/jboss/weld/util/reflection/Formats.java#L129-L204 |
163,297 | weld/core | impl/src/main/java/org/jboss/weld/util/reflection/Formats.java | Formats.parseModifiers | private static List<String> parseModifiers(int modifiers) {
List<String> result = new ArrayList<String>();
if (Modifier.isPrivate(modifiers)) {
result.add("private");
}
if (Modifier.isProtected(modifiers)) {
result.add("protected");
}
if (Modifier.... | java | private static List<String> parseModifiers(int modifiers) {
List<String> result = new ArrayList<String>();
if (Modifier.isPrivate(modifiers)) {
result.add("private");
}
if (Modifier.isProtected(modifiers)) {
result.add("protected");
}
if (Modifier.... | [
"private",
"static",
"List",
"<",
"String",
">",
"parseModifiers",
"(",
"int",
"modifiers",
")",
"{",
"List",
"<",
"String",
">",
"result",
"=",
"new",
"ArrayList",
"<",
"String",
">",
"(",
")",
";",
"if",
"(",
"Modifier",
".",
"isPrivate",
"(",
"modif... | Parses a reflection modifier to a list of string
@param modifiers The modifier to parse
@return The resulting string list | [
"Parses",
"a",
"reflection",
"modifier",
"to",
"a",
"list",
"of",
"string"
] | 567a2eaf95b168597d23a56be89bf05a7834b2aa | https://github.com/weld/core/blob/567a2eaf95b168597d23a56be89bf05a7834b2aa/impl/src/main/java/org/jboss/weld/util/reflection/Formats.java#L406-L445 |
163,298 | weld/core | impl/src/main/java/org/jboss/weld/bootstrap/FastAnnotatedTypeLoader.java | FastAnnotatedTypeLoader.initCheckTypeModifiers | private boolean initCheckTypeModifiers() {
Class<?> classInfoclass = Reflections.loadClass(CLASSINFO_CLASS_NAME, new ClassLoaderResourceLoader(classFileServices.getClass().getClassLoader()));
if (classInfoclass != null) {
try {
Method setFlags = AccessController.doPrivileged... | java | private boolean initCheckTypeModifiers() {
Class<?> classInfoclass = Reflections.loadClass(CLASSINFO_CLASS_NAME, new ClassLoaderResourceLoader(classFileServices.getClass().getClassLoader()));
if (classInfoclass != null) {
try {
Method setFlags = AccessController.doPrivileged... | [
"private",
"boolean",
"initCheckTypeModifiers",
"(",
")",
"{",
"Class",
"<",
"?",
">",
"classInfoclass",
"=",
"Reflections",
".",
"loadClass",
"(",
"CLASSINFO_CLASS_NAME",
",",
"new",
"ClassLoaderResourceLoader",
"(",
"classFileServices",
".",
"getClass",
"(",
")",
... | checking availability of ClassInfo.setFlags method is just workaround for JANDEX-37 | [
"checking",
"availability",
"of",
"ClassInfo",
".",
"setFlags",
"method",
"is",
"just",
"workaround",
"for",
"JANDEX",
"-",
"37"
] | 567a2eaf95b168597d23a56be89bf05a7834b2aa | https://github.com/weld/core/blob/567a2eaf95b168597d23a56be89bf05a7834b2aa/impl/src/main/java/org/jboss/weld/bootstrap/FastAnnotatedTypeLoader.java#L132-L146 |
163,299 | weld/core | impl/src/main/java/org/jboss/weld/bean/ProducerMethod.java | ProducerMethod.of | public static <X, T> ProducerMethod<X, T> of(BeanAttributes<T> attributes, EnhancedAnnotatedMethod<T, ? super X> method, AbstractClassBean<X> declaringBean, DisposalMethod<X, ?> disposalMethod, BeanManagerImpl beanManager, ServiceRegistry services) {
return new ProducerMethod<X, T>(createId(attributes, method, ... | java | public static <X, T> ProducerMethod<X, T> of(BeanAttributes<T> attributes, EnhancedAnnotatedMethod<T, ? super X> method, AbstractClassBean<X> declaringBean, DisposalMethod<X, ?> disposalMethod, BeanManagerImpl beanManager, ServiceRegistry services) {
return new ProducerMethod<X, T>(createId(attributes, method, ... | [
"public",
"static",
"<",
"X",
",",
"T",
">",
"ProducerMethod",
"<",
"X",
",",
"T",
">",
"of",
"(",
"BeanAttributes",
"<",
"T",
">",
"attributes",
",",
"EnhancedAnnotatedMethod",
"<",
"T",
",",
"?",
"super",
"X",
">",
"method",
",",
"AbstractClassBean",
... | Creates a producer method Web Bean
@param method The underlying method abstraction
@param declaringBean The declaring bean abstraction
@param beanManager the current manager
@return A producer Web Bean | [
"Creates",
"a",
"producer",
"method",
"Web",
"Bean"
] | 567a2eaf95b168597d23a56be89bf05a7834b2aa | https://github.com/weld/core/blob/567a2eaf95b168597d23a56be89bf05a7834b2aa/impl/src/main/java/org/jboss/weld/bean/ProducerMethod.java#L59-L61 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.