repository_name
stringlengths
7
58
func_path_in_repository
stringlengths
11
218
func_name
stringlengths
4
140
whole_func_string
stringlengths
153
5.32k
language
stringclasses
1 value
func_code_string
stringlengths
72
4k
func_code_tokens
listlengths
20
832
func_documentation_string
stringlengths
61
2k
func_documentation_tokens
listlengths
1
647
split_name
stringclasses
1 value
func_code_url
stringlengths
102
339
sirensolutions/siren-join
src/main/java/solutions/siren/join/action/coordinate/execution/FilterJoinVisitor.java
FilterJoinVisitor.executeAsyncOperation
protected void executeAsyncOperation(final FilterJoinNode node) { """ Executes the pipeline of async actions to compute the terms for this node. """ logger.debug("Executing async actions"); node.setState(FilterJoinNode.State.RUNNING); // set state before execution to avoid race conditions with listener NodePipelineManager pipeline = new NodePipelineManager(); pipeline.addListener(new NodePipelineListener() { @Override public void onSuccess() { node.setState(FilterJoinNode.State.COMPLETED); // set state before unblocking the queue to avoid race conditions FilterJoinVisitor.this.unblock(); } @Override public void onFailure(Throwable e) { node.setFailure(e); node.setState(FilterJoinNode.State.COMPLETED); // set state before unblocking the queue to avoid race conditions FilterJoinVisitor.this.unblock(); } }); // Adds the list of tasks to be executed pipeline.addTask(new IndicesVersionTask()); pipeline.addTask(new CacheLookupTask()); pipeline.addTask(new CardinalityEstimationTask()); pipeline.addTask(new TermsByQueryTask()); // Starts the execution of the pipeline pipeline.execute(new NodeTaskContext(client, node, this)); }
java
protected void executeAsyncOperation(final FilterJoinNode node) { logger.debug("Executing async actions"); node.setState(FilterJoinNode.State.RUNNING); // set state before execution to avoid race conditions with listener NodePipelineManager pipeline = new NodePipelineManager(); pipeline.addListener(new NodePipelineListener() { @Override public void onSuccess() { node.setState(FilterJoinNode.State.COMPLETED); // set state before unblocking the queue to avoid race conditions FilterJoinVisitor.this.unblock(); } @Override public void onFailure(Throwable e) { node.setFailure(e); node.setState(FilterJoinNode.State.COMPLETED); // set state before unblocking the queue to avoid race conditions FilterJoinVisitor.this.unblock(); } }); // Adds the list of tasks to be executed pipeline.addTask(new IndicesVersionTask()); pipeline.addTask(new CacheLookupTask()); pipeline.addTask(new CardinalityEstimationTask()); pipeline.addTask(new TermsByQueryTask()); // Starts the execution of the pipeline pipeline.execute(new NodeTaskContext(client, node, this)); }
[ "protected", "void", "executeAsyncOperation", "(", "final", "FilterJoinNode", "node", ")", "{", "logger", ".", "debug", "(", "\"Executing async actions\"", ")", ";", "node", ".", "setState", "(", "FilterJoinNode", ".", "State", ".", "RUNNING", ")", ";", "// set ...
Executes the pipeline of async actions to compute the terms for this node.
[ "Executes", "the", "pipeline", "of", "async", "actions", "to", "compute", "the", "terms", "for", "this", "node", "." ]
train
https://github.com/sirensolutions/siren-join/blob/cba1111b209ce6f72ab7750d5488a573a6c77fe5/src/main/java/solutions/siren/join/action/coordinate/execution/FilterJoinVisitor.java#L193-L223
lessthanoptimal/BoofCV
main/boofcv-calibration/src/main/java/boofcv/alg/geo/selfcalib/SelfCalibrationLinearRotationSingle.java
SelfCalibrationLinearRotationSingle.extractCalibration
private boolean extractCalibration(DMatrixRMaj x , CameraPinhole calibration) { """ Extracts camera parameters from the solution. Checks for errors """ double s = x.data[5]; double cx = calibration.cx = x.data[2]/s; double cy = calibration.cy = x.data[4]/s; double fy = calibration.fy = Math.sqrt(x.data[3]/s-cy*cy); double sk = calibration.skew = (x.data[1]/s-cx*cy)/fy; calibration.fx = Math.sqrt(x.data[0]/s - sk*sk - cx*cx); if( calibration.fx < 0 || calibration.fy < 0 ) return false; if(UtilEjml.isUncountable(fy) || UtilEjml.isUncountable(calibration.fx)) return false; if(UtilEjml.isUncountable(sk)) return false; return true; }
java
private boolean extractCalibration(DMatrixRMaj x , CameraPinhole calibration) { double s = x.data[5]; double cx = calibration.cx = x.data[2]/s; double cy = calibration.cy = x.data[4]/s; double fy = calibration.fy = Math.sqrt(x.data[3]/s-cy*cy); double sk = calibration.skew = (x.data[1]/s-cx*cy)/fy; calibration.fx = Math.sqrt(x.data[0]/s - sk*sk - cx*cx); if( calibration.fx < 0 || calibration.fy < 0 ) return false; if(UtilEjml.isUncountable(fy) || UtilEjml.isUncountable(calibration.fx)) return false; if(UtilEjml.isUncountable(sk)) return false; return true; }
[ "private", "boolean", "extractCalibration", "(", "DMatrixRMaj", "x", ",", "CameraPinhole", "calibration", ")", "{", "double", "s", "=", "x", ".", "data", "[", "5", "]", ";", "double", "cx", "=", "calibration", ".", "cx", "=", "x", ".", "data", "[", "2"...
Extracts camera parameters from the solution. Checks for errors
[ "Extracts", "camera", "parameters", "from", "the", "solution", ".", "Checks", "for", "errors" ]
train
https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-calibration/src/main/java/boofcv/alg/geo/selfcalib/SelfCalibrationLinearRotationSingle.java#L123-L139
lightblueseas/swing-components
src/main/java/de/alpharogroup/swing/menu/MenuExtensions.java
MenuExtensions.setAccelerator
public static void setAccelerator(final JMenuItem jmi, final int keyCode, final int modifiers) { """ Sets the accelerator for the given menuitem and the given key code and the given modifiers. @param jmi The JMenuItem. @param keyCode the key code @param modifiers the modifiers """ jmi.setAccelerator(KeyStroke.getKeyStroke(keyCode, modifiers)); }
java
public static void setAccelerator(final JMenuItem jmi, final int keyCode, final int modifiers) { jmi.setAccelerator(KeyStroke.getKeyStroke(keyCode, modifiers)); }
[ "public", "static", "void", "setAccelerator", "(", "final", "JMenuItem", "jmi", ",", "final", "int", "keyCode", ",", "final", "int", "modifiers", ")", "{", "jmi", ".", "setAccelerator", "(", "KeyStroke", ".", "getKeyStroke", "(", "keyCode", ",", "modifiers", ...
Sets the accelerator for the given menuitem and the given key code and the given modifiers. @param jmi The JMenuItem. @param keyCode the key code @param modifiers the modifiers
[ "Sets", "the", "accelerator", "for", "the", "given", "menuitem", "and", "the", "given", "key", "code", "and", "the", "given", "modifiers", "." ]
train
https://github.com/lightblueseas/swing-components/blob/4045e85cabd8f0ce985cbfff134c3c9873930c79/src/main/java/de/alpharogroup/swing/menu/MenuExtensions.java#L77-L80
google/j2objc
jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/util/Calendar.java
Calendar.prepareGetActual
protected void prepareGetActual(int field, boolean isMinimum) { """ Prepare this calendar for computing the actual minimum or maximum. This method modifies this calendar's fields; it is called on a temporary calendar. <p>Rationale: The semantics of getActualXxx() is to return the maximum or minimum value that the given field can take, taking into account other relevant fields. In general these other fields are larger fields. For example, when computing the actual maximum DAY_OF_MONTH, the current value of DAY_OF_MONTH itself is ignored, as is the value of any field smaller. <p>The time fields all have fixed minima and maxima, so we don't need to worry about them. This also lets us set the MILLISECONDS_IN_DAY to zero to erase any effects the time fields might have when computing date fields. <p>DAY_OF_WEEK is adjusted specially for the WEEK_OF_MONTH and WEEK_OF_YEAR fields to ensure that they are computed correctly. """ set(MILLISECONDS_IN_DAY, 0); switch (field) { case YEAR: case EXTENDED_YEAR: set(DAY_OF_YEAR, getGreatestMinimum(DAY_OF_YEAR)); break; case YEAR_WOY: set(WEEK_OF_YEAR, getGreatestMinimum(WEEK_OF_YEAR)); break; case MONTH: set(DAY_OF_MONTH, getGreatestMinimum(DAY_OF_MONTH)); break; case DAY_OF_WEEK_IN_MONTH: // For dowim, the maximum occurs for the DOW of the first of the // month. set(DAY_OF_MONTH, 1); set(DAY_OF_WEEK, get(DAY_OF_WEEK)); // Make this user set break; case WEEK_OF_MONTH: case WEEK_OF_YEAR: // If we're counting weeks, set the day of the week to either the // first or last localized DOW. We know the last week of a month // or year will contain the first day of the week, and that the // first week will contain the last DOW. { int dow = firstDayOfWeek; if (isMinimum) { dow = (dow + 6) % 7; // set to last DOW if (dow < SUNDAY) { dow += 7; } } set(DAY_OF_WEEK, dow); } break; } // Do this last to give it the newest time stamp set(field, getGreatestMinimum(field)); }
java
protected void prepareGetActual(int field, boolean isMinimum) { set(MILLISECONDS_IN_DAY, 0); switch (field) { case YEAR: case EXTENDED_YEAR: set(DAY_OF_YEAR, getGreatestMinimum(DAY_OF_YEAR)); break; case YEAR_WOY: set(WEEK_OF_YEAR, getGreatestMinimum(WEEK_OF_YEAR)); break; case MONTH: set(DAY_OF_MONTH, getGreatestMinimum(DAY_OF_MONTH)); break; case DAY_OF_WEEK_IN_MONTH: // For dowim, the maximum occurs for the DOW of the first of the // month. set(DAY_OF_MONTH, 1); set(DAY_OF_WEEK, get(DAY_OF_WEEK)); // Make this user set break; case WEEK_OF_MONTH: case WEEK_OF_YEAR: // If we're counting weeks, set the day of the week to either the // first or last localized DOW. We know the last week of a month // or year will contain the first day of the week, and that the // first week will contain the last DOW. { int dow = firstDayOfWeek; if (isMinimum) { dow = (dow + 6) % 7; // set to last DOW if (dow < SUNDAY) { dow += 7; } } set(DAY_OF_WEEK, dow); } break; } // Do this last to give it the newest time stamp set(field, getGreatestMinimum(field)); }
[ "protected", "void", "prepareGetActual", "(", "int", "field", ",", "boolean", "isMinimum", ")", "{", "set", "(", "MILLISECONDS_IN_DAY", ",", "0", ")", ";", "switch", "(", "field", ")", "{", "case", "YEAR", ":", "case", "EXTENDED_YEAR", ":", "set", "(", "...
Prepare this calendar for computing the actual minimum or maximum. This method modifies this calendar's fields; it is called on a temporary calendar. <p>Rationale: The semantics of getActualXxx() is to return the maximum or minimum value that the given field can take, taking into account other relevant fields. In general these other fields are larger fields. For example, when computing the actual maximum DAY_OF_MONTH, the current value of DAY_OF_MONTH itself is ignored, as is the value of any field smaller. <p>The time fields all have fixed minima and maxima, so we don't need to worry about them. This also lets us set the MILLISECONDS_IN_DAY to zero to erase any effects the time fields might have when computing date fields. <p>DAY_OF_WEEK is adjusted specially for the WEEK_OF_MONTH and WEEK_OF_YEAR fields to ensure that they are computed correctly.
[ "Prepare", "this", "calendar", "for", "computing", "the", "actual", "minimum", "or", "maximum", ".", "This", "method", "modifies", "this", "calendar", "s", "fields", ";", "it", "is", "called", "on", "a", "temporary", "calendar", "." ]
train
https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/util/Calendar.java#L2510-L2555
pippo-java/pippo
pippo-core/src/main/java/ro/pippo/core/ContentTypeEngines.java
ContentTypeEngines.registerContentTypeEngine
public ContentTypeEngine registerContentTypeEngine(Class<? extends ContentTypeEngine> engineClass) { """ Registers a content type engine if no other engine has been registered for the content type. @param engineClass @return the engine instance, if it is registered """ ContentTypeEngine engine; try { engine = engineClass.newInstance(); } catch (Exception e) { throw new PippoRuntimeException(e, "Failed to instantiate '{}'", engineClass.getName()); } if (!engines.containsKey(engine.getContentType())) { setContentTypeEngine(engine); return engine; } else { log.debug("'{}' content engine already registered, ignoring '{}'", engine.getContentType(), engineClass.getName()); return null; } }
java
public ContentTypeEngine registerContentTypeEngine(Class<? extends ContentTypeEngine> engineClass) { ContentTypeEngine engine; try { engine = engineClass.newInstance(); } catch (Exception e) { throw new PippoRuntimeException(e, "Failed to instantiate '{}'", engineClass.getName()); } if (!engines.containsKey(engine.getContentType())) { setContentTypeEngine(engine); return engine; } else { log.debug("'{}' content engine already registered, ignoring '{}'", engine.getContentType(), engineClass.getName()); return null; } }
[ "public", "ContentTypeEngine", "registerContentTypeEngine", "(", "Class", "<", "?", "extends", "ContentTypeEngine", ">", "engineClass", ")", "{", "ContentTypeEngine", "engine", ";", "try", "{", "engine", "=", "engineClass", ".", "newInstance", "(", ")", ";", "}", ...
Registers a content type engine if no other engine has been registered for the content type. @param engineClass @return the engine instance, if it is registered
[ "Registers", "a", "content", "type", "engine", "if", "no", "other", "engine", "has", "been", "registered", "for", "the", "content", "type", "." ]
train
https://github.com/pippo-java/pippo/blob/cb5ccb453bffcc3cf386adc660674812d10b9726/pippo-core/src/main/java/ro/pippo/core/ContentTypeEngines.java#L91-L106
m-m-m/util
text/src/main/java/net/sf/mmm/util/text/base/DefaultLineWrapper.java
DefaultLineWrapper.appendWithAlignment
protected void appendWithAlignment(Appendable appendable, ColumnState state, boolean doIndentThisLine, CellBuffer cellBuffer) throws IOException { """ This method actually appends the text for a single line of a single column according to {@link TextColumnInfo#getAlignment() alignment}. @param appendable is where to append to. @param state is the current {@link ColumnState}. @param doIndentThisLine - {@code true} if the current cell should be {@link TextColumnInfo#getIndent() indented}, {@code false} otherwise. @param cellBuffer is the text to align and append. @throws IOException if throw by the {@link Appendable}. """ int space = cellBuffer.getRest(); assert (space >= 0); TextColumnInfo columnInfo = state.getColumnInfo(); switch (columnInfo.getAlignment()) { case LEFT: if (doIndentThisLine) { appendable.append(columnInfo.getIndent()); } appendable.append(cellBuffer.buffer); fill(appendable, columnInfo.getFiller(), space); break; case RIGHT: fill(appendable, columnInfo.getFiller(), space); appendable.append(cellBuffer.buffer); if (doIndentThisLine) { appendable.append(columnInfo.getIndent()); } break; case CENTER: int leftSpace = space / 2; int rightSpace = space - leftSpace; fill(appendable, columnInfo.getFiller(), leftSpace); String rightIndent = ""; if (doIndentThisLine) { String indent = columnInfo.getIndent(); int indentLength = indent.length(); int rightIndex = indentLength - (indentLength / 2); String leftIndent = indent.substring(0, rightIndex); rightIndent = indent.substring(rightIndex); appendable.append(leftIndent); } appendable.append(cellBuffer.buffer); if (doIndentThisLine) { appendable.append(rightIndent); } fill(appendable, columnInfo.getFiller(), rightSpace); break; default : throw new IllegalStateException("" + columnInfo.getAlignment()); } }
java
protected void appendWithAlignment(Appendable appendable, ColumnState state, boolean doIndentThisLine, CellBuffer cellBuffer) throws IOException { int space = cellBuffer.getRest(); assert (space >= 0); TextColumnInfo columnInfo = state.getColumnInfo(); switch (columnInfo.getAlignment()) { case LEFT: if (doIndentThisLine) { appendable.append(columnInfo.getIndent()); } appendable.append(cellBuffer.buffer); fill(appendable, columnInfo.getFiller(), space); break; case RIGHT: fill(appendable, columnInfo.getFiller(), space); appendable.append(cellBuffer.buffer); if (doIndentThisLine) { appendable.append(columnInfo.getIndent()); } break; case CENTER: int leftSpace = space / 2; int rightSpace = space - leftSpace; fill(appendable, columnInfo.getFiller(), leftSpace); String rightIndent = ""; if (doIndentThisLine) { String indent = columnInfo.getIndent(); int indentLength = indent.length(); int rightIndex = indentLength - (indentLength / 2); String leftIndent = indent.substring(0, rightIndex); rightIndent = indent.substring(rightIndex); appendable.append(leftIndent); } appendable.append(cellBuffer.buffer); if (doIndentThisLine) { appendable.append(rightIndent); } fill(appendable, columnInfo.getFiller(), rightSpace); break; default : throw new IllegalStateException("" + columnInfo.getAlignment()); } }
[ "protected", "void", "appendWithAlignment", "(", "Appendable", "appendable", ",", "ColumnState", "state", ",", "boolean", "doIndentThisLine", ",", "CellBuffer", "cellBuffer", ")", "throws", "IOException", "{", "int", "space", "=", "cellBuffer", ".", "getRest", "(", ...
This method actually appends the text for a single line of a single column according to {@link TextColumnInfo#getAlignment() alignment}. @param appendable is where to append to. @param state is the current {@link ColumnState}. @param doIndentThisLine - {@code true} if the current cell should be {@link TextColumnInfo#getIndent() indented}, {@code false} otherwise. @param cellBuffer is the text to align and append. @throws IOException if throw by the {@link Appendable}.
[ "This", "method", "actually", "appends", "the", "text", "for", "a", "single", "line", "of", "a", "single", "column", "according", "to", "{", "@link", "TextColumnInfo#getAlignment", "()", "alignment", "}", "." ]
train
https://github.com/m-m-m/util/blob/f0e4e084448f8dfc83ca682a9e1618034a094ce6/text/src/main/java/net/sf/mmm/util/text/base/DefaultLineWrapper.java#L473-L515
mikepenz/MaterialDrawer
library/src/main/java/com/mikepenz/materialdrawer/DrawerBuilder.java
DrawerBuilder.buildView
public Drawer buildView() { """ build the drawers content only. This will still return a Result object, but only with the content set. No inflating of a DrawerLayout. @return Result object with only the content set """ // get the slider view mSliderLayout = (ScrimInsetsRelativeLayout) mActivity.getLayoutInflater().inflate(R.layout.material_drawer_slider, mDrawerLayout, false); mSliderLayout.setBackgroundColor(UIUtils.getThemeColorFromAttrOrRes(mActivity, R.attr.material_drawer_background, R.color.material_drawer_background)); // get the layout params DrawerLayout.LayoutParams params = (DrawerLayout.LayoutParams) mSliderLayout.getLayoutParams(); if (params != null) { // if we've set a custom gravity set it params.gravity = mDrawerGravity; // if this is a drawer from the right, change the margins :D params = DrawerUtils.processDrawerLayoutParams(this, params); // set the new layout params mSliderLayout.setLayoutParams(params); } //create the content createContent(); //create the result object Drawer result = new Drawer(this); //set the drawer for the accountHeader if set if (mAccountHeader != null) { mAccountHeader.setDrawer(result); } //toggle selection list if we were previously on the account list if (mSavedInstance != null && mSavedInstance.getBoolean(Drawer.BUNDLE_DRAWER_CONTENT_SWITCHED, false)) { mAccountHeader.toggleSelectionList(mActivity); } //handle if the drawer should be shown on launch handleShowOnLaunch(); //we only want to hook a Drawer to the MiniDrawer if it is the main drawer, not the appended one if (!mAppended && mGenerateMiniDrawer) { // if we should create a MiniDrawer we have to do this now mMiniDrawer = new MiniDrawer().withDrawer(result).withAccountHeader(mAccountHeader); } //forget the reference to the activity mActivity = null; return result; }
java
public Drawer buildView() { // get the slider view mSliderLayout = (ScrimInsetsRelativeLayout) mActivity.getLayoutInflater().inflate(R.layout.material_drawer_slider, mDrawerLayout, false); mSliderLayout.setBackgroundColor(UIUtils.getThemeColorFromAttrOrRes(mActivity, R.attr.material_drawer_background, R.color.material_drawer_background)); // get the layout params DrawerLayout.LayoutParams params = (DrawerLayout.LayoutParams) mSliderLayout.getLayoutParams(); if (params != null) { // if we've set a custom gravity set it params.gravity = mDrawerGravity; // if this is a drawer from the right, change the margins :D params = DrawerUtils.processDrawerLayoutParams(this, params); // set the new layout params mSliderLayout.setLayoutParams(params); } //create the content createContent(); //create the result object Drawer result = new Drawer(this); //set the drawer for the accountHeader if set if (mAccountHeader != null) { mAccountHeader.setDrawer(result); } //toggle selection list if we were previously on the account list if (mSavedInstance != null && mSavedInstance.getBoolean(Drawer.BUNDLE_DRAWER_CONTENT_SWITCHED, false)) { mAccountHeader.toggleSelectionList(mActivity); } //handle if the drawer should be shown on launch handleShowOnLaunch(); //we only want to hook a Drawer to the MiniDrawer if it is the main drawer, not the appended one if (!mAppended && mGenerateMiniDrawer) { // if we should create a MiniDrawer we have to do this now mMiniDrawer = new MiniDrawer().withDrawer(result).withAccountHeader(mAccountHeader); } //forget the reference to the activity mActivity = null; return result; }
[ "public", "Drawer", "buildView", "(", ")", "{", "// get the slider view", "mSliderLayout", "=", "(", "ScrimInsetsRelativeLayout", ")", "mActivity", ".", "getLayoutInflater", "(", ")", ".", "inflate", "(", "R", ".", "layout", ".", "material_drawer_slider", ",", "mD...
build the drawers content only. This will still return a Result object, but only with the content set. No inflating of a DrawerLayout. @return Result object with only the content set
[ "build", "the", "drawers", "content", "only", ".", "This", "will", "still", "return", "a", "Result", "object", "but", "only", "with", "the", "content", "set", ".", "No", "inflating", "of", "a", "DrawerLayout", "." ]
train
https://github.com/mikepenz/MaterialDrawer/blob/f4fb31635767edead0a01cee7b7588942b89d8d9/library/src/main/java/com/mikepenz/materialdrawer/DrawerBuilder.java#L1537-L1580
Ordinastie/MalisisCore
src/main/java/net/malisis/core/MalisisCommand.java
MalisisCommand.configCommand
public void configCommand(ICommandSender sender, String[] params) { """ Handles the config command.<br> Opens the configuration GUI for the {@link IMalisisMod} with the id specified as parameter, if the mod as {@link Settings} available. @param sender the sender @param params the params """ if (FMLCommonHandler.instance().getEffectiveSide() == Side.SERVER) { MalisisCore.log.warn("Can't open configuration GUI on a dedicated server."); return; } IMalisisMod mod = params.length == 1 ? MalisisCore.instance : MalisisCore.getMod(params[1]); if (mod == null) { MalisisCore.message("malisiscore.commands.modnotfound", params[1]); return; } if (!MalisisCore.openConfigurationGui(mod)) MalisisCore.message("malisiscore.commands.noconfiguration", mod.getName()); }
java
public void configCommand(ICommandSender sender, String[] params) { if (FMLCommonHandler.instance().getEffectiveSide() == Side.SERVER) { MalisisCore.log.warn("Can't open configuration GUI on a dedicated server."); return; } IMalisisMod mod = params.length == 1 ? MalisisCore.instance : MalisisCore.getMod(params[1]); if (mod == null) { MalisisCore.message("malisiscore.commands.modnotfound", params[1]); return; } if (!MalisisCore.openConfigurationGui(mod)) MalisisCore.message("malisiscore.commands.noconfiguration", mod.getName()); }
[ "public", "void", "configCommand", "(", "ICommandSender", "sender", ",", "String", "[", "]", "params", ")", "{", "if", "(", "FMLCommonHandler", ".", "instance", "(", ")", ".", "getEffectiveSide", "(", ")", "==", "Side", ".", "SERVER", ")", "{", "MalisisCor...
Handles the config command.<br> Opens the configuration GUI for the {@link IMalisisMod} with the id specified as parameter, if the mod as {@link Settings} available. @param sender the sender @param params the params
[ "Handles", "the", "config", "command", ".", "<br", ">", "Opens", "the", "configuration", "GUI", "for", "the", "{", "@link", "IMalisisMod", "}", "with", "the", "id", "specified", "as", "parameter", "if", "the", "mod", "as", "{", "@link", "Settings", "}", ...
train
https://github.com/Ordinastie/MalisisCore/blob/4f8e1fa462d5c372fc23414482ba9f429881cc54/src/main/java/net/malisis/core/MalisisCommand.java#L176-L193
AgNO3/jcifs-ng
src/main/java/jcifs/ntlmssp/Type3Message.java
Type3Message.getDefaultFlags
public static int getDefaultFlags ( CIFSContext tc, Type2Message type2 ) { """ Returns the default flags for a Type-3 message created in response to the given Type-2 message in the current environment. @param tc context to use @param type2 The Type-2 message. @return An <code>int</code> containing the default flags. """ if ( type2 == null ) return getDefaultFlags(tc); int flags = NTLMSSP_NEGOTIATE_NTLM | NTLMSSP_NEGOTIATE_VERSION; flags |= type2.getFlag(NTLMSSP_NEGOTIATE_UNICODE) ? NTLMSSP_NEGOTIATE_UNICODE : NTLMSSP_NEGOTIATE_OEM; return flags; }
java
public static int getDefaultFlags ( CIFSContext tc, Type2Message type2 ) { if ( type2 == null ) return getDefaultFlags(tc); int flags = NTLMSSP_NEGOTIATE_NTLM | NTLMSSP_NEGOTIATE_VERSION; flags |= type2.getFlag(NTLMSSP_NEGOTIATE_UNICODE) ? NTLMSSP_NEGOTIATE_UNICODE : NTLMSSP_NEGOTIATE_OEM; return flags; }
[ "public", "static", "int", "getDefaultFlags", "(", "CIFSContext", "tc", ",", "Type2Message", "type2", ")", "{", "if", "(", "type2", "==", "null", ")", "return", "getDefaultFlags", "(", "tc", ")", ";", "int", "flags", "=", "NTLMSSP_NEGOTIATE_NTLM", "|", "NTLM...
Returns the default flags for a Type-3 message created in response to the given Type-2 message in the current environment. @param tc context to use @param type2 The Type-2 message. @return An <code>int</code> containing the default flags.
[ "Returns", "the", "default", "flags", "for", "a", "Type", "-", "3", "message", "created", "in", "response", "to", "the", "given", "Type", "-", "2", "message", "in", "the", "current", "environment", "." ]
train
https://github.com/AgNO3/jcifs-ng/blob/0311107a077ea372527ae74839eec8042197332f/src/main/java/jcifs/ntlmssp/Type3Message.java#L375-L381
google/error-prone-javac
src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/builders/PackageSummaryBuilder.java
PackageSummaryBuilder.buildExceptionSummary
public void buildExceptionSummary(XMLNode node, Content summaryContentTree) { """ Build the summary for the exceptions in this package. @param node the XML element that specifies which components to document @param summaryContentTree the summary tree to which the exception summary will be added """ String exceptionTableSummary = configuration.getText("doclet.Member_Table_Summary", configuration.getText("doclet.Exception_Summary"), configuration.getText("doclet.exceptions")); List<String> exceptionTableHeader = Arrays.asList(configuration.getText("doclet.Exception"), configuration.getText("doclet.Description")); Set<TypeElement> iexceptions = utils.isSpecified(packageElement) ? utils.getTypeElementsAsSortedSet(utils.getExceptions(packageElement)) : configuration.typeElementCatalog.exceptions(packageElement); SortedSet<TypeElement> exceptions = utils.filterOutPrivateClasses(iexceptions, configuration.javafx); if (!exceptions.isEmpty()) { packageWriter.addClassesSummary(exceptions, configuration.getText("doclet.Exception_Summary"), exceptionTableSummary, exceptionTableHeader, summaryContentTree); } }
java
public void buildExceptionSummary(XMLNode node, Content summaryContentTree) { String exceptionTableSummary = configuration.getText("doclet.Member_Table_Summary", configuration.getText("doclet.Exception_Summary"), configuration.getText("doclet.exceptions")); List<String> exceptionTableHeader = Arrays.asList(configuration.getText("doclet.Exception"), configuration.getText("doclet.Description")); Set<TypeElement> iexceptions = utils.isSpecified(packageElement) ? utils.getTypeElementsAsSortedSet(utils.getExceptions(packageElement)) : configuration.typeElementCatalog.exceptions(packageElement); SortedSet<TypeElement> exceptions = utils.filterOutPrivateClasses(iexceptions, configuration.javafx); if (!exceptions.isEmpty()) { packageWriter.addClassesSummary(exceptions, configuration.getText("doclet.Exception_Summary"), exceptionTableSummary, exceptionTableHeader, summaryContentTree); } }
[ "public", "void", "buildExceptionSummary", "(", "XMLNode", "node", ",", "Content", "summaryContentTree", ")", "{", "String", "exceptionTableSummary", "=", "configuration", ".", "getText", "(", "\"doclet.Member_Table_Summary\"", ",", "configuration", ".", "getText", "(",...
Build the summary for the exceptions in this package. @param node the XML element that specifies which components to document @param summaryContentTree the summary tree to which the exception summary will be added
[ "Build", "the", "summary", "for", "the", "exceptions", "in", "this", "package", "." ]
train
https://github.com/google/error-prone-javac/blob/a53d069bbdb2c60232ed3811c19b65e41c3e60e0/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/builders/PackageSummaryBuilder.java#L252-L270
leancloud/java-sdk-all
android-sdk/huawei-hmsagent/src/main/java/com/huawei/android/hms/agent/pay/PaySignUtil.java
PaySignUtil.doCheck
public static boolean doCheck(String noSignStr, String sign, String publicKey) { """ 校验签名信息 @param noSignStr 待校验未字符串 @param sign 签名字符串 @param publicKey 公钥 @return 是否校验通过 """ if (sign == null || noSignStr == null || publicKey == null) { return false; } try { KeyFactory keyFactory = KeyFactory.getInstance("RSA"); byte[] encodedKey = Base64.decode(publicKey, Base64.DEFAULT); PublicKey pubKey = keyFactory.generatePublic(new X509EncodedKeySpec(encodedKey)); java.security.Signature signature = java.security.Signature.getInstance(SIGN_ALGORITHMS); signature.initVerify(pubKey); signature.update(noSignStr.getBytes(CHARSET)); return signature.verify(Base64.decode(sign, Base64.DEFAULT)); } catch (Exception e) { // 这里是安全算法,为避免出现异常时泄露加密信息,这里不打印具体日志 HMSAgentLog.e("doCheck error"); } return false; }
java
public static boolean doCheck(String noSignStr, String sign, String publicKey) { if (sign == null || noSignStr == null || publicKey == null) { return false; } try { KeyFactory keyFactory = KeyFactory.getInstance("RSA"); byte[] encodedKey = Base64.decode(publicKey, Base64.DEFAULT); PublicKey pubKey = keyFactory.generatePublic(new X509EncodedKeySpec(encodedKey)); java.security.Signature signature = java.security.Signature.getInstance(SIGN_ALGORITHMS); signature.initVerify(pubKey); signature.update(noSignStr.getBytes(CHARSET)); return signature.verify(Base64.decode(sign, Base64.DEFAULT)); } catch (Exception e) { // 这里是安全算法,为避免出现异常时泄露加密信息,这里不打印具体日志 HMSAgentLog.e("doCheck error"); } return false; }
[ "public", "static", "boolean", "doCheck", "(", "String", "noSignStr", ",", "String", "sign", ",", "String", "publicKey", ")", "{", "if", "(", "sign", "==", "null", "||", "noSignStr", "==", "null", "||", "publicKey", "==", "null", ")", "{", "return", "fal...
校验签名信息 @param noSignStr 待校验未字符串 @param sign 签名字符串 @param publicKey 公钥 @return 是否校验通过
[ "校验签名信息" ]
train
https://github.com/leancloud/java-sdk-all/blob/323f8e7ee38051b1350790e5192304768c5c9f5f/android-sdk/huawei-hmsagent/src/main/java/com/huawei/android/hms/agent/pay/PaySignUtil.java#L403-L425
googleapis/google-cloud-java
google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/deprecated/AttachedDisk.java
AttachedDisk.of
public static AttachedDisk of(String deviceName, AttachedDiskConfiguration configuration) { """ Returns an {@code AttachedDisk} object given the device name and its configuration. """ return newBuilder(configuration).setDeviceName(deviceName).build(); }
java
public static AttachedDisk of(String deviceName, AttachedDiskConfiguration configuration) { return newBuilder(configuration).setDeviceName(deviceName).build(); }
[ "public", "static", "AttachedDisk", "of", "(", "String", "deviceName", ",", "AttachedDiskConfiguration", "configuration", ")", "{", "return", "newBuilder", "(", "configuration", ")", ".", "setDeviceName", "(", "deviceName", ")", ".", "build", "(", ")", ";", "}" ...
Returns an {@code AttachedDisk} object given the device name and its configuration.
[ "Returns", "an", "{" ]
train
https://github.com/googleapis/google-cloud-java/blob/d2f0bc64a53049040fe9c9d338b12fab3dd1ad6a/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/deprecated/AttachedDisk.java#L845-L847
google/j2objc
xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xpath/NodeSet.java
NodeSet.addNodes
public void addNodes(NodeSet ns) { """ <p>Copy NodeList members into this nodelist, adding in document order. Only genuine node references will be copied; nulls appearing in the source NodeSet will not be added to this one. </p> <p> In case you're wondering why this function is needed: NodeSet implements both NodeIterator and NodeList. If this method isn't provided, Java can't decide which of those to use when addNodes() is invoked. Providing the more-explicit match avoids that ambiguity.)</p> @param ns NodeSet whose members should be merged into this NodeSet. @throws RuntimeException thrown if this NodeSet is not of a mutable type. """ if (!m_mutable) throw new RuntimeException(XSLMessages.createXPATHMessage(XPATHErrorResources.ER_NODESET_NOT_MUTABLE, null)); //"This NodeSet is not mutable!"); addNodes((NodeIterator) ns); }
java
public void addNodes(NodeSet ns) { if (!m_mutable) throw new RuntimeException(XSLMessages.createXPATHMessage(XPATHErrorResources.ER_NODESET_NOT_MUTABLE, null)); //"This NodeSet is not mutable!"); addNodes((NodeIterator) ns); }
[ "public", "void", "addNodes", "(", "NodeSet", "ns", ")", "{", "if", "(", "!", "m_mutable", ")", "throw", "new", "RuntimeException", "(", "XSLMessages", ".", "createXPATHMessage", "(", "XPATHErrorResources", ".", "ER_NODESET_NOT_MUTABLE", ",", "null", ")", ")", ...
<p>Copy NodeList members into this nodelist, adding in document order. Only genuine node references will be copied; nulls appearing in the source NodeSet will not be added to this one. </p> <p> In case you're wondering why this function is needed: NodeSet implements both NodeIterator and NodeList. If this method isn't provided, Java can't decide which of those to use when addNodes() is invoked. Providing the more-explicit match avoids that ambiguity.)</p> @param ns NodeSet whose members should be merged into this NodeSet. @throws RuntimeException thrown if this NodeSet is not of a mutable type.
[ "<p", ">", "Copy", "NodeList", "members", "into", "this", "nodelist", "adding", "in", "document", "order", ".", "Only", "genuine", "node", "references", "will", "be", "copied", ";", "nulls", "appearing", "in", "the", "source", "NodeSet", "will", "not", "be",...
train
https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xpath/NodeSet.java#L471-L478
goldmansachs/reladomo
reladomo/src/main/java/com/gs/fw/common/mithra/cacheloader/DependentLoadingTaskSpawner.java
DependentLoadingTaskSpawner.createDependentKeyIndex
public DependentKeyIndex createDependentKeyIndex(CacheLoaderEngine cacheLoaderEngine, Extractor[] keyExtractors, Operation ownerObjectFilter) { """ executed from a single thread during the cacheloader startup. """ DependentKeyIndex dependentKeyIndex = null; for (DependentKeyIndex each : this.dependentKeyIndexes) { if (Arrays.equals(each.getKeyExtractors(), keyExtractors)) { dependentKeyIndex = each; break; } } if (dependentKeyIndex == null) { dependentKeyIndex = (keyExtractors.length > 1) ? new DependentTupleKeyIndex(cacheLoaderEngine, this, keyExtractors) : new DependentSingleKeyIndex(cacheLoaderEngine, this, keyExtractors); dependentKeyIndex.setOwnerObjectFilter(ownerObjectFilter); final LoadingTaskThreadPoolHolder threadPoolHolder = cacheLoaderEngine.getOrCreateThreadPool(this.getThreadPoolName()); dependentKeyIndex.setLoadingTaskThreadPoolHolder(threadPoolHolder); threadPoolHolder.addDependentKeyIndex(dependentKeyIndex); this.dependentKeyIndexes.add(dependentKeyIndex); } else { dependentKeyIndex.orOwnerObjectFilter(ownerObjectFilter); } return dependentKeyIndex; }
java
public DependentKeyIndex createDependentKeyIndex(CacheLoaderEngine cacheLoaderEngine, Extractor[] keyExtractors, Operation ownerObjectFilter) { DependentKeyIndex dependentKeyIndex = null; for (DependentKeyIndex each : this.dependentKeyIndexes) { if (Arrays.equals(each.getKeyExtractors(), keyExtractors)) { dependentKeyIndex = each; break; } } if (dependentKeyIndex == null) { dependentKeyIndex = (keyExtractors.length > 1) ? new DependentTupleKeyIndex(cacheLoaderEngine, this, keyExtractors) : new DependentSingleKeyIndex(cacheLoaderEngine, this, keyExtractors); dependentKeyIndex.setOwnerObjectFilter(ownerObjectFilter); final LoadingTaskThreadPoolHolder threadPoolHolder = cacheLoaderEngine.getOrCreateThreadPool(this.getThreadPoolName()); dependentKeyIndex.setLoadingTaskThreadPoolHolder(threadPoolHolder); threadPoolHolder.addDependentKeyIndex(dependentKeyIndex); this.dependentKeyIndexes.add(dependentKeyIndex); } else { dependentKeyIndex.orOwnerObjectFilter(ownerObjectFilter); } return dependentKeyIndex; }
[ "public", "DependentKeyIndex", "createDependentKeyIndex", "(", "CacheLoaderEngine", "cacheLoaderEngine", ",", "Extractor", "[", "]", "keyExtractors", ",", "Operation", "ownerObjectFilter", ")", "{", "DependentKeyIndex", "dependentKeyIndex", "=", "null", ";", "for", "(", ...
executed from a single thread during the cacheloader startup.
[ "executed", "from", "a", "single", "thread", "during", "the", "cacheloader", "startup", "." ]
train
https://github.com/goldmansachs/reladomo/blob/e9a069452eece7a6ef9551caf81a69d3d9a3d990/reladomo/src/main/java/com/gs/fw/common/mithra/cacheloader/DependentLoadingTaskSpawner.java#L163-L194
OpenLiberty/open-liberty
dev/com.ibm.ws.webcontainer.security/src/com/ibm/ws/webcontainer/security/WebAppSecurityCollaboratorImpl.java
WebAppSecurityCollaboratorImpl.determineWebReply
public WebReply determineWebReply(Subject receivedSubject, String uriName, WebRequest webRequest) { """ This method does: 1. pre-authentication checks 2. Authentication 3. Authorization @param receivedSubject @param uriName @param webRequest @return Non-null WebReply """ WebReply webReply = performInitialChecks(webRequest, uriName); if (webReply != null) { logAuditEntriesBeforeAuthn(webReply, receivedSubject, uriName, webRequest); return webReply; } AuthenticationResult authResult = authenticateRequest(webRequest); return determineWebReply(receivedSubject, uriName, webRequest, authResult); }
java
public WebReply determineWebReply(Subject receivedSubject, String uriName, WebRequest webRequest) { WebReply webReply = performInitialChecks(webRequest, uriName); if (webReply != null) { logAuditEntriesBeforeAuthn(webReply, receivedSubject, uriName, webRequest); return webReply; } AuthenticationResult authResult = authenticateRequest(webRequest); return determineWebReply(receivedSubject, uriName, webRequest, authResult); }
[ "public", "WebReply", "determineWebReply", "(", "Subject", "receivedSubject", ",", "String", "uriName", ",", "WebRequest", "webRequest", ")", "{", "WebReply", "webReply", "=", "performInitialChecks", "(", "webRequest", ",", "uriName", ")", ";", "if", "(", "webRepl...
This method does: 1. pre-authentication checks 2. Authentication 3. Authorization @param receivedSubject @param uriName @param webRequest @return Non-null WebReply
[ "This", "method", "does", ":", "1", ".", "pre", "-", "authentication", "checks", "2", ".", "Authentication", "3", ".", "Authorization" ]
train
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.webcontainer.security/src/com/ibm/ws/webcontainer/security/WebAppSecurityCollaboratorImpl.java#L955-L964
Netflix/denominator
core/src/main/java/denominator/Providers.java
Providers.withUrl
public static Provider withUrl(Provider provider, String url) { """ Overrides the {@link Provider#url()} of a given provider via reflectively calling its url constructor. ex. <pre> provider = withUrl(getByName(providerName), overrideUrl); module = getByName(provider); ultraDns = ObjectGraph.create(provide(provider), module, credentials(username, password)).get(DNSApiManager.class); </pre> @param url corresponds to {@link Provider#url()}. ex {@code http://apiendpoint} @throws IllegalArgumentException if the there's no constructor that accepts a string argument. """ checkNotNull(provider, "provider"); checkNotNull(url, "url"); try { Constructor<?> ctor = provider.getClass().getDeclaredConstructor(String.class); // allow private or package protected ctors ctor.setAccessible(true); return Provider.class.cast(ctor.newInstance(url)); } catch (NoSuchMethodException e) { throw new IllegalArgumentException( provider.getClass() + " does not have a String parameter constructor", e); } catch (Exception e) { throw new IllegalArgumentException( "exception attempting to instantiate " + provider.getClass() + " for provider " + provider, e); } }
java
public static Provider withUrl(Provider provider, String url) { checkNotNull(provider, "provider"); checkNotNull(url, "url"); try { Constructor<?> ctor = provider.getClass().getDeclaredConstructor(String.class); // allow private or package protected ctors ctor.setAccessible(true); return Provider.class.cast(ctor.newInstance(url)); } catch (NoSuchMethodException e) { throw new IllegalArgumentException( provider.getClass() + " does not have a String parameter constructor", e); } catch (Exception e) { throw new IllegalArgumentException( "exception attempting to instantiate " + provider.getClass() + " for provider " + provider, e); } }
[ "public", "static", "Provider", "withUrl", "(", "Provider", "provider", ",", "String", "url", ")", "{", "checkNotNull", "(", "provider", ",", "\"provider\"", ")", ";", "checkNotNull", "(", "url", ",", "\"url\"", ")", ";", "try", "{", "Constructor", "<", "?...
Overrides the {@link Provider#url()} of a given provider via reflectively calling its url constructor. ex. <pre> provider = withUrl(getByName(providerName), overrideUrl); module = getByName(provider); ultraDns = ObjectGraph.create(provide(provider), module, credentials(username, password)).get(DNSApiManager.class); </pre> @param url corresponds to {@link Provider#url()}. ex {@code http://apiendpoint} @throws IllegalArgumentException if the there's no constructor that accepts a string argument.
[ "Overrides", "the", "{", "@link", "Provider#url", "()", "}", "of", "a", "given", "provider", "via", "reflectively", "calling", "its", "url", "constructor", "." ]
train
https://github.com/Netflix/denominator/blob/c565e3b8c6043051252e0947029511f9ac5d306f/core/src/main/java/denominator/Providers.java#L75-L91
alkacon/opencms-core
src/org/opencms/xml/containerpage/CmsXmlContainerPage.java
CmsXmlContainerPage.saveContainerPage
protected void saveContainerPage(CmsObject cms, Element parent, CmsContainerPageBean cntPage) throws CmsException { """ Adds the given container page to the given element.<p> @param cms the current CMS object @param parent the element to add it @param cntPage the container page to add @throws CmsException if something goes wrong """ parent.clearContent(); // save containers in a defined order List<String> containerNames = new ArrayList<String>(cntPage.getNames()); Collections.sort(containerNames); for (String containerName : containerNames) { CmsContainerBean container = cntPage.getContainers().get(containerName); // the container Element cntElement = parent.addElement(XmlNode.Containers.name()); cntElement.addElement(XmlNode.Name.name()).addCDATA(container.getName()); cntElement.addElement(XmlNode.Type.name()).addCDATA(container.getType()); if (container.isNestedContainer()) { cntElement.addElement(XmlNode.ParentInstanceId.name()).addCDATA(container.getParentInstanceId()); } if (container.isRootContainer()) { cntElement.addElement(XmlNode.IsRootContainer.name()).addText(Boolean.TRUE.toString()); } // the elements for (CmsContainerElementBean element : container.getElements()) { Element elemElement = cntElement.addElement(XmlNode.Elements.name()); // the element Element uriElem = elemElement.addElement(XmlNode.Uri.name()); CmsResource uriRes = fillResource(cms, uriElem, element.getId()); Element formatterElem = elemElement.addElement(XmlNode.Formatter.name()); fillResource(cms, formatterElem, element.getFormatterId()); if (element.isCreateNew()) { Element createNewElem = elemElement.addElement(XmlNode.CreateNew.name()); createNewElem.addText(Boolean.TRUE.toString()); } // the properties Map<String, String> properties = element.getIndividualSettings(); Map<String, CmsXmlContentProperty> propertiesConf = OpenCms.getADEManager().getElementSettings( cms, uriRes); CmsXmlContentPropertyHelper.saveProperties(cms, elemElement, properties, propertiesConf); } } }
java
protected void saveContainerPage(CmsObject cms, Element parent, CmsContainerPageBean cntPage) throws CmsException { parent.clearContent(); // save containers in a defined order List<String> containerNames = new ArrayList<String>(cntPage.getNames()); Collections.sort(containerNames); for (String containerName : containerNames) { CmsContainerBean container = cntPage.getContainers().get(containerName); // the container Element cntElement = parent.addElement(XmlNode.Containers.name()); cntElement.addElement(XmlNode.Name.name()).addCDATA(container.getName()); cntElement.addElement(XmlNode.Type.name()).addCDATA(container.getType()); if (container.isNestedContainer()) { cntElement.addElement(XmlNode.ParentInstanceId.name()).addCDATA(container.getParentInstanceId()); } if (container.isRootContainer()) { cntElement.addElement(XmlNode.IsRootContainer.name()).addText(Boolean.TRUE.toString()); } // the elements for (CmsContainerElementBean element : container.getElements()) { Element elemElement = cntElement.addElement(XmlNode.Elements.name()); // the element Element uriElem = elemElement.addElement(XmlNode.Uri.name()); CmsResource uriRes = fillResource(cms, uriElem, element.getId()); Element formatterElem = elemElement.addElement(XmlNode.Formatter.name()); fillResource(cms, formatterElem, element.getFormatterId()); if (element.isCreateNew()) { Element createNewElem = elemElement.addElement(XmlNode.CreateNew.name()); createNewElem.addText(Boolean.TRUE.toString()); } // the properties Map<String, String> properties = element.getIndividualSettings(); Map<String, CmsXmlContentProperty> propertiesConf = OpenCms.getADEManager().getElementSettings( cms, uriRes); CmsXmlContentPropertyHelper.saveProperties(cms, elemElement, properties, propertiesConf); } } }
[ "protected", "void", "saveContainerPage", "(", "CmsObject", "cms", ",", "Element", "parent", ",", "CmsContainerPageBean", "cntPage", ")", "throws", "CmsException", "{", "parent", ".", "clearContent", "(", ")", ";", "// save containers in a defined order", "List", "<",...
Adds the given container page to the given element.<p> @param cms the current CMS object @param parent the element to add it @param cntPage the container page to add @throws CmsException if something goes wrong
[ "Adds", "the", "given", "container", "page", "to", "the", "given", "element", ".", "<p", ">" ]
train
https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/xml/containerpage/CmsXmlContainerPage.java#L641-L685
micrometer-metrics/micrometer
micrometer-core/src/main/java/io/micrometer/core/instrument/binder/jvm/ExecutorServiceMetrics.java
ExecutorServiceMetrics.unwrapThreadPoolExecutor
@Nullable private ThreadPoolExecutor unwrapThreadPoolExecutor(ExecutorService executor, Class<?> wrapper) { """ Every ScheduledThreadPoolExecutor created by {@link Executors} is wrapped. Also, {@link Executors#newSingleThreadExecutor()} wrap a regular {@link ThreadPoolExecutor}. """ try { Field e = wrapper.getDeclaredField("e"); e.setAccessible(true); return (ThreadPoolExecutor) e.get(executorService); } catch (NoSuchFieldException | IllegalAccessException e) { // Do nothing. We simply can't get to the underlying ThreadPoolExecutor. } return null; }
java
@Nullable private ThreadPoolExecutor unwrapThreadPoolExecutor(ExecutorService executor, Class<?> wrapper) { try { Field e = wrapper.getDeclaredField("e"); e.setAccessible(true); return (ThreadPoolExecutor) e.get(executorService); } catch (NoSuchFieldException | IllegalAccessException e) { // Do nothing. We simply can't get to the underlying ThreadPoolExecutor. } return null; }
[ "@", "Nullable", "private", "ThreadPoolExecutor", "unwrapThreadPoolExecutor", "(", "ExecutorService", "executor", ",", "Class", "<", "?", ">", "wrapper", ")", "{", "try", "{", "Field", "e", "=", "wrapper", ".", "getDeclaredField", "(", "\"e\"", ")", ";", "e", ...
Every ScheduledThreadPoolExecutor created by {@link Executors} is wrapped. Also, {@link Executors#newSingleThreadExecutor()} wrap a regular {@link ThreadPoolExecutor}.
[ "Every", "ScheduledThreadPoolExecutor", "created", "by", "{" ]
train
https://github.com/micrometer-metrics/micrometer/blob/127fa3265325cc894f368312ed8890b76a055d88/micrometer-core/src/main/java/io/micrometer/core/instrument/binder/jvm/ExecutorServiceMetrics.java#L132-L142
OpenLiberty/open-liberty
dev/com.ibm.ws.javaee.ddmodel/src.gen/com/ibm/ws/javaee/ddmodel/webext/WebExtAdapter.java
WebExtAdapter.markError
private static boolean markError(OverlayContainer overlay, String errorTag) { """ Mark an error condition to an overlay container. The tag is used as both the overlay key and the overlay value. Each mark is not placed relative to particular data. Each mark may be placed at most once. @param overlay The overlay in which to place the mark. @param errorTag The tag used as the mark. @return True or false telling if this is the first placement of the tag to the overlay. """ if ( overlay.getFromNonPersistentCache(errorTag, WebExtAdapter.class) == null ) { overlay.addToNonPersistentCache(errorTag, WebExtAdapter.class, errorTag); return true; } else { return false; } }
java
private static boolean markError(OverlayContainer overlay, String errorTag) { if ( overlay.getFromNonPersistentCache(errorTag, WebExtAdapter.class) == null ) { overlay.addToNonPersistentCache(errorTag, WebExtAdapter.class, errorTag); return true; } else { return false; } }
[ "private", "static", "boolean", "markError", "(", "OverlayContainer", "overlay", ",", "String", "errorTag", ")", "{", "if", "(", "overlay", ".", "getFromNonPersistentCache", "(", "errorTag", ",", "WebExtAdapter", ".", "class", ")", "==", "null", ")", "{", "ove...
Mark an error condition to an overlay container. The tag is used as both the overlay key and the overlay value. Each mark is not placed relative to particular data. Each mark may be placed at most once. @param overlay The overlay in which to place the mark. @param errorTag The tag used as the mark. @return True or false telling if this is the first placement of the tag to the overlay.
[ "Mark", "an", "error", "condition", "to", "an", "overlay", "container", "." ]
train
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.javaee.ddmodel/src.gen/com/ibm/ws/javaee/ddmodel/webext/WebExtAdapter.java#L69-L76
xm-online/xm-commons
xm-commons-config/src/main/java/com/icthh/xm/commons/config/client/api/AbstractConfigService.java
AbstractConfigService.updateConfigurations
@Override public void updateConfigurations(String commit, Collection<String> paths) { """ Update configuration from config service @param commit commit hash, will be empty if configuration deleted @param paths collection of paths updated """ Map<String, Configuration> configurationsMap = getConfigurationMap(commit, paths); paths.forEach(path -> notifyUpdated(configurationsMap .getOrDefault(path, new Configuration(path, null)))); }
java
@Override public void updateConfigurations(String commit, Collection<String> paths) { Map<String, Configuration> configurationsMap = getConfigurationMap(commit, paths); paths.forEach(path -> notifyUpdated(configurationsMap .getOrDefault(path, new Configuration(path, null)))); }
[ "@", "Override", "public", "void", "updateConfigurations", "(", "String", "commit", ",", "Collection", "<", "String", ">", "paths", ")", "{", "Map", "<", "String", ",", "Configuration", ">", "configurationsMap", "=", "getConfigurationMap", "(", "commit", ",", ...
Update configuration from config service @param commit commit hash, will be empty if configuration deleted @param paths collection of paths updated
[ "Update", "configuration", "from", "config", "service" ]
train
https://github.com/xm-online/xm-commons/blob/43eb2273adb96f40830d7b905ee3a767b8715caf/xm-commons-config/src/main/java/com/icthh/xm/commons/config/client/api/AbstractConfigService.java#L28-L33
craftercms/commons
utilities/src/main/java/org/craftercms/commons/lang/RegexUtils.java
RegexUtils.matchesAny
public static boolean matchesAny(String str, String... regexes) { """ Returns true if the string matches any of the specified regexes. @param str the string to match @param regexes the regexes used for matching @return true if the string matches one or more of the regexes """ if (ArrayUtils.isNotEmpty(regexes)) { return matchesAny(str, Arrays.asList(regexes)); } else { return false; } }
java
public static boolean matchesAny(String str, String... regexes) { if (ArrayUtils.isNotEmpty(regexes)) { return matchesAny(str, Arrays.asList(regexes)); } else { return false; } }
[ "public", "static", "boolean", "matchesAny", "(", "String", "str", ",", "String", "...", "regexes", ")", "{", "if", "(", "ArrayUtils", ".", "isNotEmpty", "(", "regexes", ")", ")", "{", "return", "matchesAny", "(", "str", ",", "Arrays", ".", "asList", "("...
Returns true if the string matches any of the specified regexes. @param str the string to match @param regexes the regexes used for matching @return true if the string matches one or more of the regexes
[ "Returns", "true", "if", "the", "string", "matches", "any", "of", "the", "specified", "regexes", "." ]
train
https://github.com/craftercms/commons/blob/3074fe49e56c2a4aae0832f40b17ae563335dc83/utilities/src/main/java/org/craftercms/commons/lang/RegexUtils.java#L45-L51
lievendoclo/Valkyrie-RCP
valkyrie-rcp-core/src/main/java/org/valkyriercp/layout/GridBagLayoutBuilder.java
GridBagLayoutBuilder.appendLabeledField
public GridBagLayoutBuilder appendLabeledField(String propertyName, final JComponent field, LabelOrientation labelOrientation, int colSpan, int rowSpan, boolean expandX, boolean expandY) { """ Appends a label and field to the end of the current line.<p /> The label will be to the left of the field, and be right-justified.<br /> The field will "grow" horizontally as space allows.<p /> @param propertyName the name of the property to create the controls for @param colSpan the number of columns the field should span @return "this" to make it easier to string together append calls """ JLabel label = createLabel(propertyName); return appendLabeledField(label, field, labelOrientation, colSpan, rowSpan, expandX, expandY); }
java
public GridBagLayoutBuilder appendLabeledField(String propertyName, final JComponent field, LabelOrientation labelOrientation, int colSpan, int rowSpan, boolean expandX, boolean expandY) { JLabel label = createLabel(propertyName); return appendLabeledField(label, field, labelOrientation, colSpan, rowSpan, expandX, expandY); }
[ "public", "GridBagLayoutBuilder", "appendLabeledField", "(", "String", "propertyName", ",", "final", "JComponent", "field", ",", "LabelOrientation", "labelOrientation", ",", "int", "colSpan", ",", "int", "rowSpan", ",", "boolean", "expandX", ",", "boolean", "expandY",...
Appends a label and field to the end of the current line.<p /> The label will be to the left of the field, and be right-justified.<br /> The field will "grow" horizontally as space allows.<p /> @param propertyName the name of the property to create the controls for @param colSpan the number of columns the field should span @return "this" to make it easier to string together append calls
[ "Appends", "a", "label", "and", "field", "to", "the", "end", "of", "the", "current", "line", ".", "<p", "/", ">" ]
train
https://github.com/lievendoclo/Valkyrie-RCP/blob/6aad6e640b348cda8f3b0841f6e42025233f1eb8/valkyrie-rcp-core/src/main/java/org/valkyriercp/layout/GridBagLayoutBuilder.java#L302-L306
nmorel/gwt-jackson
gwt-jackson/src/main/java/com/github/nmorel/gwtjackson/client/JsonDeserializer.java
JsonDeserializer.deserializeNullValue
protected T deserializeNullValue( JsonReader reader, JsonDeserializationContext ctx, JsonDeserializerParameters params ) { """ Deserialize the null value. This method allows children to override the default behaviour. @param reader {@link JsonReader} used to read the JSON input @param ctx Context for the full deserialization process @param params Parameters for this deserialization @return the deserialized object """ reader.skipValue(); return null; }
java
protected T deserializeNullValue( JsonReader reader, JsonDeserializationContext ctx, JsonDeserializerParameters params ) { reader.skipValue(); return null; }
[ "protected", "T", "deserializeNullValue", "(", "JsonReader", "reader", ",", "JsonDeserializationContext", "ctx", ",", "JsonDeserializerParameters", "params", ")", "{", "reader", ".", "skipValue", "(", ")", ";", "return", "null", ";", "}" ]
Deserialize the null value. This method allows children to override the default behaviour. @param reader {@link JsonReader} used to read the JSON input @param ctx Context for the full deserialization process @param params Parameters for this deserialization @return the deserialized object
[ "Deserialize", "the", "null", "value", ".", "This", "method", "allows", "children", "to", "override", "the", "default", "behaviour", "." ]
train
https://github.com/nmorel/gwt-jackson/blob/3fdc4350a27a9b64fc437d5fe516bf9191b74824/gwt-jackson/src/main/java/com/github/nmorel/gwtjackson/client/JsonDeserializer.java#L68-L71
imsweb/naaccr-xml
src/main/java/com/imsweb/naaccrxml/runtime/NaaccrStreamConfiguration.java
NaaccrStreamConfiguration.registerNamespace
public void registerNamespace(String namespacePrefix, String namespaceUri) { """ Registers a namespace for a given namespace prefix. This method must be called before registering any tags or attributes for that namespace. Note that extensions require namespaces to work properly. @param namespacePrefix the namespace prefix, cannot be null @param namespaceUri the namespace URI, cannot be null """ if (_namespaces.containsKey(namespacePrefix)) throw new RuntimeException("Namespace prefix '" + namespacePrefix + "' has already been registered"); _namespaces.put(namespacePrefix, namespaceUri); }
java
public void registerNamespace(String namespacePrefix, String namespaceUri) { if (_namespaces.containsKey(namespacePrefix)) throw new RuntimeException("Namespace prefix '" + namespacePrefix + "' has already been registered"); _namespaces.put(namespacePrefix, namespaceUri); }
[ "public", "void", "registerNamespace", "(", "String", "namespacePrefix", ",", "String", "namespaceUri", ")", "{", "if", "(", "_namespaces", ".", "containsKey", "(", "namespacePrefix", ")", ")", "throw", "new", "RuntimeException", "(", "\"Namespace prefix '\"", "+", ...
Registers a namespace for a given namespace prefix. This method must be called before registering any tags or attributes for that namespace. Note that extensions require namespaces to work properly. @param namespacePrefix the namespace prefix, cannot be null @param namespaceUri the namespace URI, cannot be null
[ "Registers", "a", "namespace", "for", "a", "given", "namespace", "prefix", ".", "This", "method", "must", "be", "called", "before", "registering", "any", "tags", "or", "attributes", "for", "that", "namespace", ".", "Note", "that", "extensions", "require", "nam...
train
https://github.com/imsweb/naaccr-xml/blob/a3a501faa2a0c3411dd5248b2c1379f279131696/src/main/java/com/imsweb/naaccrxml/runtime/NaaccrStreamConfiguration.java#L236-L240
notnoop/java-apns
src/main/java/com/notnoop/apns/ApnsServiceBuilder.java
ApnsServiceBuilder.withCert
public ApnsServiceBuilder withCert(InputStream stream, String password) throws InvalidSSLConfig { """ Specify the certificate used to connect to Apple APNS servers. This relies on the stream of keystore (*.p12) containing the certificate, along with the given password. The keystore needs to be of PKCS12 and the keystore needs to be encrypted using the SunX509 algorithm. Both of these settings are the default. This library does not support password-less p12 certificates, due to a Oracle Java library <a href="http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6415637"> Bug 6415637</a>. There are three workarounds: use a password-protected certificate, use a different boot Java SDK implementation, or constract the `SSLContext` yourself! Needless to say, the password-protected certificate is most recommended option. @param stream the keystore represented as input stream @param password the password of the keystore @return this @throws InvalidSSLConfig if stream is invalid Keystore or the password is invalid """ assertPasswordNotEmpty(password); return withSSLContext(new SSLContextBuilder() .withAlgorithm(KEY_ALGORITHM) .withCertificateKeyStore(stream, password, KEYSTORE_TYPE) .withDefaultTrustKeyStore() .build()); }
java
public ApnsServiceBuilder withCert(InputStream stream, String password) throws InvalidSSLConfig { assertPasswordNotEmpty(password); return withSSLContext(new SSLContextBuilder() .withAlgorithm(KEY_ALGORITHM) .withCertificateKeyStore(stream, password, KEYSTORE_TYPE) .withDefaultTrustKeyStore() .build()); }
[ "public", "ApnsServiceBuilder", "withCert", "(", "InputStream", "stream", ",", "String", "password", ")", "throws", "InvalidSSLConfig", "{", "assertPasswordNotEmpty", "(", "password", ")", ";", "return", "withSSLContext", "(", "new", "SSLContextBuilder", "(", ")", "...
Specify the certificate used to connect to Apple APNS servers. This relies on the stream of keystore (*.p12) containing the certificate, along with the given password. The keystore needs to be of PKCS12 and the keystore needs to be encrypted using the SunX509 algorithm. Both of these settings are the default. This library does not support password-less p12 certificates, due to a Oracle Java library <a href="http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6415637"> Bug 6415637</a>. There are three workarounds: use a password-protected certificate, use a different boot Java SDK implementation, or constract the `SSLContext` yourself! Needless to say, the password-protected certificate is most recommended option. @param stream the keystore represented as input stream @param password the password of the keystore @return this @throws InvalidSSLConfig if stream is invalid Keystore or the password is invalid
[ "Specify", "the", "certificate", "used", "to", "connect", "to", "Apple", "APNS", "servers", ".", "This", "relies", "on", "the", "stream", "of", "keystore", "(", "*", ".", "p12", ")", "containing", "the", "certificate", "along", "with", "the", "given", "pas...
train
https://github.com/notnoop/java-apns/blob/180a190d4cb49458441596ca7c69d50ec7f1dba5/src/main/java/com/notnoop/apns/ApnsServiceBuilder.java#L187-L195
liferay/com-liferay-commerce
commerce-service/src/main/java/com/liferay/commerce/service/persistence/impl/CommerceRegionPersistenceImpl.java
CommerceRegionPersistenceImpl.findAll
@Override public List<CommerceRegion> findAll() { """ Returns all the commerce regions. @return the commerce regions """ return findAll(QueryUtil.ALL_POS, QueryUtil.ALL_POS, null); }
java
@Override public List<CommerceRegion> findAll() { return findAll(QueryUtil.ALL_POS, QueryUtil.ALL_POS, null); }
[ "@", "Override", "public", "List", "<", "CommerceRegion", ">", "findAll", "(", ")", "{", "return", "findAll", "(", "QueryUtil", ".", "ALL_POS", ",", "QueryUtil", ".", "ALL_POS", ",", "null", ")", ";", "}" ]
Returns all the commerce regions. @return the commerce regions
[ "Returns", "all", "the", "commerce", "regions", "." ]
train
https://github.com/liferay/com-liferay-commerce/blob/9e54362d7f59531fc684016ba49ee7cdc3a2f22b/commerce-service/src/main/java/com/liferay/commerce/service/persistence/impl/CommerceRegionPersistenceImpl.java#L3490-L3493
spotify/async-google-pubsub-client
src/main/java/com/spotify/google/cloud/pubsub/client/Pubsub.java
Pubsub.createTopic
private PubsubFuture<Topic> createTopic(final String canonicalTopic) { """ Create a Pub/Sub topic. @param canonicalTopic The canonical (including project) name of the topic to create. @return A future that is completed when this request is completed. """ validateCanonicalTopic(canonicalTopic); return put("create topic", canonicalTopic, NO_PAYLOAD, readJson(Topic.class)); }
java
private PubsubFuture<Topic> createTopic(final String canonicalTopic) { validateCanonicalTopic(canonicalTopic); return put("create topic", canonicalTopic, NO_PAYLOAD, readJson(Topic.class)); }
[ "private", "PubsubFuture", "<", "Topic", ">", "createTopic", "(", "final", "String", "canonicalTopic", ")", "{", "validateCanonicalTopic", "(", "canonicalTopic", ")", ";", "return", "put", "(", "\"create topic\"", ",", "canonicalTopic", ",", "NO_PAYLOAD", ",", "re...
Create a Pub/Sub topic. @param canonicalTopic The canonical (including project) name of the topic to create. @return A future that is completed when this request is completed.
[ "Create", "a", "Pub", "/", "Sub", "topic", "." ]
train
https://github.com/spotify/async-google-pubsub-client/blob/7d021528fa5bc29be458e6f210fa62f59b71d004/src/main/java/com/spotify/google/cloud/pubsub/client/Pubsub.java#L293-L296
ManfredTremmel/gwt-commons-lang3
src/main/java/org/apache/commons/lang3/time/DateUtils.java
DateUtils.getFragmentInSeconds
@GwtIncompatible("incompatible method") public static long getFragmentInSeconds(final Calendar calendar, final int fragment) { """ <p>Returns the number of seconds within the fragment. All datefields greater than the fragment will be ignored.</p> <p>Asking the seconds of any date will only return the number of seconds of the current minute (resulting in a number between 0 and 59). This method will retrieve the number of seconds for any fragment. For example, if you want to calculate the number of seconds past today, your fragment is Calendar.DATE or Calendar.DAY_OF_YEAR. The result will be all seconds of the past hour(s) and minutes(s).</p> <p>Valid fragments are: Calendar.YEAR, Calendar.MONTH, both Calendar.DAY_OF_YEAR and Calendar.DATE, Calendar.HOUR_OF_DAY, Calendar.MINUTE, Calendar.SECOND and Calendar.MILLISECOND A fragment less than or equal to a SECOND field will return 0.</p> <ul> <li>January 1, 2008 7:15:10.538 with Calendar.MINUTE as fragment will return 10 (equivalent to calendar.get(Calendar.SECOND))</li> <li>January 6, 2008 7:15:10.538 with Calendar.MINUTE as fragment will return 10 (equivalent to calendar.get(Calendar.SECOND))</li> <li>January 6, 2008 7:15:10.538 with Calendar.DAY_OF_YEAR as fragment will return 26110 (7*3600 + 15*60 + 10)</li> <li>January 16, 2008 7:15:10.538 with Calendar.MILLISECOND as fragment will return 0 (a millisecond cannot be split in seconds)</li> </ul> @param calendar the calendar to work with, not null @param fragment the {@code Calendar} field part of calendar to calculate @return number of seconds within the fragment of date @throws IllegalArgumentException if the date is <code>null</code> or fragment is not supported @since 2.4 """ return getFragment(calendar, fragment, TimeUnit.SECONDS); }
java
@GwtIncompatible("incompatible method") public static long getFragmentInSeconds(final Calendar calendar, final int fragment) { return getFragment(calendar, fragment, TimeUnit.SECONDS); }
[ "@", "GwtIncompatible", "(", "\"incompatible method\"", ")", "public", "static", "long", "getFragmentInSeconds", "(", "final", "Calendar", "calendar", ",", "final", "int", "fragment", ")", "{", "return", "getFragment", "(", "calendar", ",", "fragment", ",", "TimeU...
<p>Returns the number of seconds within the fragment. All datefields greater than the fragment will be ignored.</p> <p>Asking the seconds of any date will only return the number of seconds of the current minute (resulting in a number between 0 and 59). This method will retrieve the number of seconds for any fragment. For example, if you want to calculate the number of seconds past today, your fragment is Calendar.DATE or Calendar.DAY_OF_YEAR. The result will be all seconds of the past hour(s) and minutes(s).</p> <p>Valid fragments are: Calendar.YEAR, Calendar.MONTH, both Calendar.DAY_OF_YEAR and Calendar.DATE, Calendar.HOUR_OF_DAY, Calendar.MINUTE, Calendar.SECOND and Calendar.MILLISECOND A fragment less than or equal to a SECOND field will return 0.</p> <ul> <li>January 1, 2008 7:15:10.538 with Calendar.MINUTE as fragment will return 10 (equivalent to calendar.get(Calendar.SECOND))</li> <li>January 6, 2008 7:15:10.538 with Calendar.MINUTE as fragment will return 10 (equivalent to calendar.get(Calendar.SECOND))</li> <li>January 6, 2008 7:15:10.538 with Calendar.DAY_OF_YEAR as fragment will return 26110 (7*3600 + 15*60 + 10)</li> <li>January 16, 2008 7:15:10.538 with Calendar.MILLISECOND as fragment will return 0 (a millisecond cannot be split in seconds)</li> </ul> @param calendar the calendar to work with, not null @param fragment the {@code Calendar} field part of calendar to calculate @return number of seconds within the fragment of date @throws IllegalArgumentException if the date is <code>null</code> or fragment is not supported @since 2.4
[ "<p", ">", "Returns", "the", "number", "of", "seconds", "within", "the", "fragment", ".", "All", "datefields", "greater", "than", "the", "fragment", "will", "be", "ignored", ".", "<", "/", "p", ">" ]
train
https://github.com/ManfredTremmel/gwt-commons-lang3/blob/9e2dfbbda3668cfa5d935fe76479d1426c294504/src/main/java/org/apache/commons/lang3/time/DateUtils.java#L1529-L1532
Azure/azure-sdk-for-java
network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/NetworkInterfacesInner.java
NetworkInterfacesInner.listVirtualMachineScaleSetIpConfigurationsAsync
public Observable<Page<NetworkInterfaceIPConfigurationInner>> listVirtualMachineScaleSetIpConfigurationsAsync(final String resourceGroupName, final String virtualMachineScaleSetName, final String virtualmachineIndex, final String networkInterfaceName) { """ Get the specified network interface ip configuration in a virtual machine scale set. @param resourceGroupName The name of the resource group. @param virtualMachineScaleSetName The name of the virtual machine scale set. @param virtualmachineIndex The virtual machine index. @param networkInterfaceName The name of the network interface. @throws IllegalArgumentException thrown if parameters fail the validation @return the observable to the PagedList&lt;NetworkInterfaceIPConfigurationInner&gt; object """ return listVirtualMachineScaleSetIpConfigurationsWithServiceResponseAsync(resourceGroupName, virtualMachineScaleSetName, virtualmachineIndex, networkInterfaceName) .map(new Func1<ServiceResponse<Page<NetworkInterfaceIPConfigurationInner>>, Page<NetworkInterfaceIPConfigurationInner>>() { @Override public Page<NetworkInterfaceIPConfigurationInner> call(ServiceResponse<Page<NetworkInterfaceIPConfigurationInner>> response) { return response.body(); } }); }
java
public Observable<Page<NetworkInterfaceIPConfigurationInner>> listVirtualMachineScaleSetIpConfigurationsAsync(final String resourceGroupName, final String virtualMachineScaleSetName, final String virtualmachineIndex, final String networkInterfaceName) { return listVirtualMachineScaleSetIpConfigurationsWithServiceResponseAsync(resourceGroupName, virtualMachineScaleSetName, virtualmachineIndex, networkInterfaceName) .map(new Func1<ServiceResponse<Page<NetworkInterfaceIPConfigurationInner>>, Page<NetworkInterfaceIPConfigurationInner>>() { @Override public Page<NetworkInterfaceIPConfigurationInner> call(ServiceResponse<Page<NetworkInterfaceIPConfigurationInner>> response) { return response.body(); } }); }
[ "public", "Observable", "<", "Page", "<", "NetworkInterfaceIPConfigurationInner", ">", ">", "listVirtualMachineScaleSetIpConfigurationsAsync", "(", "final", "String", "resourceGroupName", ",", "final", "String", "virtualMachineScaleSetName", ",", "final", "String", "virtualma...
Get the specified network interface ip configuration in a virtual machine scale set. @param resourceGroupName The name of the resource group. @param virtualMachineScaleSetName The name of the virtual machine scale set. @param virtualmachineIndex The virtual machine index. @param networkInterfaceName The name of the network interface. @throws IllegalArgumentException thrown if parameters fail the validation @return the observable to the PagedList&lt;NetworkInterfaceIPConfigurationInner&gt; object
[ "Get", "the", "specified", "network", "interface", "ip", "configuration", "in", "a", "virtual", "machine", "scale", "set", "." ]
train
https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/NetworkInterfacesInner.java#L1985-L1993
liyiorg/weixin-popular
src/main/java/weixin/popular/api/ScanAPI.java
ScanAPI.productModstatus
public static BaseResult productModstatus(String accessToken, ProductStatus productStatus) { """ 商品发布 @param accessToken accessToken @param productStatus productStatus @return BaseResult """ return productModstatus(accessToken, JsonUtil.toJSONString(productStatus)); }
java
public static BaseResult productModstatus(String accessToken, ProductStatus productStatus) { return productModstatus(accessToken, JsonUtil.toJSONString(productStatus)); }
[ "public", "static", "BaseResult", "productModstatus", "(", "String", "accessToken", ",", "ProductStatus", "productStatus", ")", "{", "return", "productModstatus", "(", "accessToken", ",", "JsonUtil", ".", "toJSONString", "(", "productStatus", ")", ")", ";", "}" ]
商品发布 @param accessToken accessToken @param productStatus productStatus @return BaseResult
[ "商品发布" ]
train
https://github.com/liyiorg/weixin-popular/blob/c64255292d41463bdb671938feaabf42a335d82c/src/main/java/weixin/popular/api/ScanAPI.java#L75-L77
UrielCh/ovh-java-sdk
ovh-java-sdk-ip/src/main/java/net/minidev/ovh/api/ApiOvhIp.java
ApiOvhIp.ip_delegation_POST
public OvhReverseDelegation ip_delegation_POST(String ip, String target) throws IOException { """ Add target for reverse delegation on IPv6 subnet REST: POST /ip/{ip}/delegation @param target [required] Target for reverse delegation on IPv6 @param ip [required] """ String qPath = "/ip/{ip}/delegation"; StringBuilder sb = path(qPath, ip); HashMap<String, Object>o = new HashMap<String, Object>(); addBody(o, "target", target); String resp = exec(qPath, "POST", sb.toString(), o); return convertTo(resp, OvhReverseDelegation.class); }
java
public OvhReverseDelegation ip_delegation_POST(String ip, String target) throws IOException { String qPath = "/ip/{ip}/delegation"; StringBuilder sb = path(qPath, ip); HashMap<String, Object>o = new HashMap<String, Object>(); addBody(o, "target", target); String resp = exec(qPath, "POST", sb.toString(), o); return convertTo(resp, OvhReverseDelegation.class); }
[ "public", "OvhReverseDelegation", "ip_delegation_POST", "(", "String", "ip", ",", "String", "target", ")", "throws", "IOException", "{", "String", "qPath", "=", "\"/ip/{ip}/delegation\"", ";", "StringBuilder", "sb", "=", "path", "(", "qPath", ",", "ip", ")", ";"...
Add target for reverse delegation on IPv6 subnet REST: POST /ip/{ip}/delegation @param target [required] Target for reverse delegation on IPv6 @param ip [required]
[ "Add", "target", "for", "reverse", "delegation", "on", "IPv6", "subnet" ]
train
https://github.com/UrielCh/ovh-java-sdk/blob/6d531a40e56e09701943e334c25f90f640c55701/ovh-java-sdk-ip/src/main/java/net/minidev/ovh/api/ApiOvhIp.java#L153-L160
aws/aws-sdk-java
aws-java-sdk-dynamodb/src/main/java/com/amazonaws/services/dynamodbv2/document/TableWriteItems.java
TableWriteItems.addHashOnlyPrimaryKeyToDelete
public TableWriteItems addHashOnlyPrimaryKeyToDelete( String hashKeyName, Object hashKeyValue) { """ Adds a hash-only primary key to be deleted in a batch write operation. @param hashKeyName name of the hash key attribute name @param hashKeyValue name of the hash key value @return the current instance for method chaining purposes """ this.addPrimaryKeyToDelete(new PrimaryKey(hashKeyName, hashKeyValue)); return this; }
java
public TableWriteItems addHashOnlyPrimaryKeyToDelete( String hashKeyName, Object hashKeyValue) { this.addPrimaryKeyToDelete(new PrimaryKey(hashKeyName, hashKeyValue)); return this; }
[ "public", "TableWriteItems", "addHashOnlyPrimaryKeyToDelete", "(", "String", "hashKeyName", ",", "Object", "hashKeyValue", ")", "{", "this", ".", "addPrimaryKeyToDelete", "(", "new", "PrimaryKey", "(", "hashKeyName", ",", "hashKeyValue", ")", ")", ";", "return", "th...
Adds a hash-only primary key to be deleted in a batch write operation. @param hashKeyName name of the hash key attribute name @param hashKeyValue name of the hash key value @return the current instance for method chaining purposes
[ "Adds", "a", "hash", "-", "only", "primary", "key", "to", "be", "deleted", "in", "a", "batch", "write", "operation", "." ]
train
https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-dynamodb/src/main/java/com/amazonaws/services/dynamodbv2/document/TableWriteItems.java#L156-L160
Samsung/GearVRf
GVRf/Framework/framework/src/main/java/org/gearvrf/animation/GVRPose.java
GVRPose.setWorldMatrix
public void setWorldMatrix(int boneindex, Matrix4f mtx) { """ Set the world matrix for this bone (relative to skeleton root). <p> Sets the world matrix for the designated bone. All bones in the skeleton start out at the origin oriented along the bone axis (usually 0,0,1). The pose orients and positions each bone in the skeleton with respect to this initial state. The world bone matrix expresses the orientation and position of the bone relative to the root of the skeleton. @param boneindex zero based index of bone to set matrix for. @param mtx new bone matrix. @see #getWorldRotation @see #setLocalRotation @see #getWorldMatrix @see #getWorldPositions @see GVRSkeleton#setBoneAxis """ Bone bone = mBones[boneindex]; bone.WorldMatrix.set(mtx); if (mSkeleton.getParentBoneIndex(boneindex) >= 0) { calcLocal(bone, mSkeleton.getParentBoneIndex(boneindex)); } else { bone.LocalMatrix.set(mtx); } mNeedSync = true; bone.Changed = Bone.WORLD_POS | Bone.WORLD_ROT; if (sDebug) { Log.d("BONE", "setWorldMatrix: %s %s", mSkeleton.getBoneName(boneindex), bone.toString()); } }
java
public void setWorldMatrix(int boneindex, Matrix4f mtx) { Bone bone = mBones[boneindex]; bone.WorldMatrix.set(mtx); if (mSkeleton.getParentBoneIndex(boneindex) >= 0) { calcLocal(bone, mSkeleton.getParentBoneIndex(boneindex)); } else { bone.LocalMatrix.set(mtx); } mNeedSync = true; bone.Changed = Bone.WORLD_POS | Bone.WORLD_ROT; if (sDebug) { Log.d("BONE", "setWorldMatrix: %s %s", mSkeleton.getBoneName(boneindex), bone.toString()); } }
[ "public", "void", "setWorldMatrix", "(", "int", "boneindex", ",", "Matrix4f", "mtx", ")", "{", "Bone", "bone", "=", "mBones", "[", "boneindex", "]", ";", "bone", ".", "WorldMatrix", ".", "set", "(", "mtx", ")", ";", "if", "(", "mSkeleton", ".", "getPar...
Set the world matrix for this bone (relative to skeleton root). <p> Sets the world matrix for the designated bone. All bones in the skeleton start out at the origin oriented along the bone axis (usually 0,0,1). The pose orients and positions each bone in the skeleton with respect to this initial state. The world bone matrix expresses the orientation and position of the bone relative to the root of the skeleton. @param boneindex zero based index of bone to set matrix for. @param mtx new bone matrix. @see #getWorldRotation @see #setLocalRotation @see #getWorldMatrix @see #getWorldPositions @see GVRSkeleton#setBoneAxis
[ "Set", "the", "world", "matrix", "for", "this", "bone", "(", "relative", "to", "skeleton", "root", ")", ".", "<p", ">", "Sets", "the", "world", "matrix", "for", "the", "designated", "bone", ".", "All", "bones", "in", "the", "skeleton", "start", "out", ...
train
https://github.com/Samsung/GearVRf/blob/05034d465a7b0a494fabb9e9f2971ac19392f32d/GVRf/Framework/framework/src/main/java/org/gearvrf/animation/GVRPose.java#L356-L375
wildfly/wildfly-core
controller/src/main/java/org/jboss/as/controller/AbstractAddStepHandler.java
AbstractAddStepHandler.createResource
protected Resource createResource(final OperationContext context, final ModelNode operation) { """ Create the {@link Resource} that the {@link AbstractAddStepHandler#execute(OperationContext, ModelNode)} method operates on. This method is invoked during {@link org.jboss.as.controller.OperationContext.Stage#MODEL}. <p> This default implementation uses the {@link org.jboss.as.controller.OperationContext#createResource(PathAddress) default resource creation facility exposed by the context}. Subclasses wishing to create a custom resource type can override this method. @param context the operation context @param operation the operation """ ImmutableManagementResourceRegistration registration = context.getResourceRegistration(); if (registration != null) { Set<String> orderedChildTypes = registration.getOrderedChildTypes(); boolean orderedChildResource = registration.isOrderedChildResource(); if (orderedChildResource || orderedChildTypes.size() > 0) { return new OrderedResourceCreator(orderedChildResource, orderedChildTypes).createResource(context, operation); } } return createResource(context); }
java
protected Resource createResource(final OperationContext context, final ModelNode operation) { ImmutableManagementResourceRegistration registration = context.getResourceRegistration(); if (registration != null) { Set<String> orderedChildTypes = registration.getOrderedChildTypes(); boolean orderedChildResource = registration.isOrderedChildResource(); if (orderedChildResource || orderedChildTypes.size() > 0) { return new OrderedResourceCreator(orderedChildResource, orderedChildTypes).createResource(context, operation); } } return createResource(context); }
[ "protected", "Resource", "createResource", "(", "final", "OperationContext", "context", ",", "final", "ModelNode", "operation", ")", "{", "ImmutableManagementResourceRegistration", "registration", "=", "context", ".", "getResourceRegistration", "(", ")", ";", "if", "(",...
Create the {@link Resource} that the {@link AbstractAddStepHandler#execute(OperationContext, ModelNode)} method operates on. This method is invoked during {@link org.jboss.as.controller.OperationContext.Stage#MODEL}. <p> This default implementation uses the {@link org.jboss.as.controller.OperationContext#createResource(PathAddress) default resource creation facility exposed by the context}. Subclasses wishing to create a custom resource type can override this method. @param context the operation context @param operation the operation
[ "Create", "the", "{", "@link", "Resource", "}", "that", "the", "{", "@link", "AbstractAddStepHandler#execute", "(", "OperationContext", "ModelNode", ")", "}", "method", "operates", "on", ".", "This", "method", "is", "invoked", "during", "{", "@link", "org", "....
train
https://github.com/wildfly/wildfly-core/blob/cfaf0479dcbb2d320a44c5374b93b944ec39fade/controller/src/main/java/org/jboss/as/controller/AbstractAddStepHandler.java#L183-L193
HolmesNL/kafka-spout
src/main/java/nl/minvenj/nfi/storm/kafka/util/ConfigUtils.java
ConfigUtils.configFromPrefix
public static Properties configFromPrefix(final Map<String, Object> base, final String prefix) { """ Reads a configuration subset from storm's configuration, stripping {@code prefix} from keys using it. @param base Storm's configuration mapping. @param prefix The prefix to match and strip from the beginning. @return A {@link Properties} object created from storm's configuration. """ final Properties config = new Properties(); // load configuration from base, stripping prefix for (Map.Entry<String, Object> entry : base.entrySet()) { if (entry.getKey().startsWith(prefix)) { config.setProperty(entry.getKey().substring(prefix.length()), String.valueOf(entry.getValue())); } } return config; }
java
public static Properties configFromPrefix(final Map<String, Object> base, final String prefix) { final Properties config = new Properties(); // load configuration from base, stripping prefix for (Map.Entry<String, Object> entry : base.entrySet()) { if (entry.getKey().startsWith(prefix)) { config.setProperty(entry.getKey().substring(prefix.length()), String.valueOf(entry.getValue())); } } return config; }
[ "public", "static", "Properties", "configFromPrefix", "(", "final", "Map", "<", "String", ",", "Object", ">", "base", ",", "final", "String", "prefix", ")", "{", "final", "Properties", "config", "=", "new", "Properties", "(", ")", ";", "// load configuration f...
Reads a configuration subset from storm's configuration, stripping {@code prefix} from keys using it. @param base Storm's configuration mapping. @param prefix The prefix to match and strip from the beginning. @return A {@link Properties} object created from storm's configuration.
[ "Reads", "a", "configuration", "subset", "from", "storm", "s", "configuration", "stripping", "{", "@code", "prefix", "}", "from", "keys", "using", "it", "." ]
train
https://github.com/HolmesNL/kafka-spout/blob/bef626b9fab6946a7e0d3c85979ec36ae0870233/src/main/java/nl/minvenj/nfi/storm/kafka/util/ConfigUtils.java#L175-L185
fabric8io/docker-maven-plugin
src/main/java/io/fabric8/maven/docker/assembly/DockerAssemblyManager.java
DockerAssemblyManager.createBuildTarBall
private File createBuildTarBall(BuildDirs buildDirs, List<ArchiverCustomizer> archiverCustomizers, AssemblyConfiguration assemblyConfig, ArchiveCompression compression) throws MojoExecutionException { """ Create final tar-ball to be used for building the archive to send to the Docker daemon """ File archive = new File(buildDirs.getTemporaryRootDirectory(), "docker-build." + compression.getFileSuffix()); try { TarArchiver archiver = createBuildArchiver(buildDirs.getOutputDirectory(), archive, assemblyConfig); for (ArchiverCustomizer customizer : archiverCustomizers) { if (customizer != null) { archiver = customizer.customize(archiver); } } archiver.setCompression(compression.getTarCompressionMethod()); archiver.createArchive(); return archive; } catch (NoSuchArchiverException e) { throw new MojoExecutionException("No archiver for type 'tar' found", e); } catch (IOException e) { throw new MojoExecutionException("Cannot create archive " + archive, e); } }
java
private File createBuildTarBall(BuildDirs buildDirs, List<ArchiverCustomizer> archiverCustomizers, AssemblyConfiguration assemblyConfig, ArchiveCompression compression) throws MojoExecutionException { File archive = new File(buildDirs.getTemporaryRootDirectory(), "docker-build." + compression.getFileSuffix()); try { TarArchiver archiver = createBuildArchiver(buildDirs.getOutputDirectory(), archive, assemblyConfig); for (ArchiverCustomizer customizer : archiverCustomizers) { if (customizer != null) { archiver = customizer.customize(archiver); } } archiver.setCompression(compression.getTarCompressionMethod()); archiver.createArchive(); return archive; } catch (NoSuchArchiverException e) { throw new MojoExecutionException("No archiver for type 'tar' found", e); } catch (IOException e) { throw new MojoExecutionException("Cannot create archive " + archive, e); } }
[ "private", "File", "createBuildTarBall", "(", "BuildDirs", "buildDirs", ",", "List", "<", "ArchiverCustomizer", ">", "archiverCustomizers", ",", "AssemblyConfiguration", "assemblyConfig", ",", "ArchiveCompression", "compression", ")", "throws", "MojoExecutionException", "{"...
Create final tar-ball to be used for building the archive to send to the Docker daemon
[ "Create", "final", "tar", "-", "ball", "to", "be", "used", "for", "building", "the", "archive", "to", "send", "to", "the", "Docker", "daemon" ]
train
https://github.com/fabric8io/docker-maven-plugin/blob/70ce4f56125d8efb8ddcf2ad4dbb5d6e2c7642b3/src/main/java/io/fabric8/maven/docker/assembly/DockerAssemblyManager.java#L305-L323
jboss/jboss-jacc-api_spec
src/main/java/javax/security/jacc/PolicyContext.java
PolicyContext.registerHandler
public static void registerHandler(String key, PolicyContextHandler handler, boolean replace) throws PolicyContextException { """ <p> Authorization protected method used to register a container specific {@code PolicyContext} handler. A handler may be registered to handle multiple keys, but at any time, at most one handler may be registered for a key. </p> @param key - a (case-sensitive) {@code String} that identifies the context object handled by the handler. The value of this parameter must not be null. @param handler - an object that implements the {@code PolicyContextHandler} interface. The value of this parameter must not be null. @param replace - this boolean value defines the behavior of this method if, when it is called, a {@code PolicyContextHandler} has already been registered to handle the same key. In that case, and if the value of this argument is {@code true}, the existing handler is replaced with the argument handler. If the value of this parameter is false the existing registration is preserved and an exception is thrown. @throws IllegalArgumentException - if the value of either of the handler or key arguments is null, or the value of the replace argument is false and a handler with the same key as the argument handler is already registered. @throws SecurityException - if the calling {@code AccessControlContext} is not authorized by the container to call this method. @throws PolicyContextException - if an operation by this method on the argument {@code PolicyContextHandler} causes it to throw a checked exception that is not accounted for in the signature of this method. """ if (key == null) throw new IllegalArgumentException("The key may not be null"); if (handler == null) throw new IllegalArgumentException("The handler may not be null"); SecurityManager sm = System.getSecurityManager(); if (sm != null) sm.checkPermission(setPolicy); if (replace == false && handlerMap.containsKey(key) == true) { String msg = "Handler for key=" + key + ", exists, handler: " + handlerMap.get(key); throw new IllegalArgumentException(msg); } handlerMap.put(key, handler); }
java
public static void registerHandler(String key, PolicyContextHandler handler, boolean replace) throws PolicyContextException { if (key == null) throw new IllegalArgumentException("The key may not be null"); if (handler == null) throw new IllegalArgumentException("The handler may not be null"); SecurityManager sm = System.getSecurityManager(); if (sm != null) sm.checkPermission(setPolicy); if (replace == false && handlerMap.containsKey(key) == true) { String msg = "Handler for key=" + key + ", exists, handler: " + handlerMap.get(key); throw new IllegalArgumentException(msg); } handlerMap.put(key, handler); }
[ "public", "static", "void", "registerHandler", "(", "String", "key", ",", "PolicyContextHandler", "handler", ",", "boolean", "replace", ")", "throws", "PolicyContextException", "{", "if", "(", "key", "==", "null", ")", "throw", "new", "IllegalArgumentException", "...
<p> Authorization protected method used to register a container specific {@code PolicyContext} handler. A handler may be registered to handle multiple keys, but at any time, at most one handler may be registered for a key. </p> @param key - a (case-sensitive) {@code String} that identifies the context object handled by the handler. The value of this parameter must not be null. @param handler - an object that implements the {@code PolicyContextHandler} interface. The value of this parameter must not be null. @param replace - this boolean value defines the behavior of this method if, when it is called, a {@code PolicyContextHandler} has already been registered to handle the same key. In that case, and if the value of this argument is {@code true}, the existing handler is replaced with the argument handler. If the value of this parameter is false the existing registration is preserved and an exception is thrown. @throws IllegalArgumentException - if the value of either of the handler or key arguments is null, or the value of the replace argument is false and a handler with the same key as the argument handler is already registered. @throws SecurityException - if the calling {@code AccessControlContext} is not authorized by the container to call this method. @throws PolicyContextException - if an operation by this method on the argument {@code PolicyContextHandler} causes it to throw a checked exception that is not accounted for in the signature of this method.
[ "<p", ">", "Authorization", "protected", "method", "used", "to", "register", "a", "container", "specific", "{", "@code", "PolicyContext", "}", "handler", ".", "A", "handler", "may", "be", "registered", "to", "handle", "multiple", "keys", "but", "at", "any", ...
train
https://github.com/jboss/jboss-jacc-api_spec/blob/cc97802b6d368cd98a1d30f075689a7fef225582/src/main/java/javax/security/jacc/PolicyContext.java#L172-L188
logic-ng/LogicNG
src/main/java/org/logicng/bdds/BDDFactory.java
BDDFactory.toLngBdd
public BDDNode toLngBdd(final int bdd) { """ Returns a LogicNG internal BDD data structure of a given BDD. @param bdd the BDD @return the BDD as LogicNG data structure """ final BDDConstant falseNode = BDDConstant.getFalsumNode(this.f); final BDDConstant trueNode = BDDConstant.getVerumNode(this.f); if (bdd == BDDKernel.BDD_FALSE) return falseNode; if (bdd == BDDKernel.BDD_TRUE) return trueNode; final List<int[]> nodes = this.kernel.allNodes(bdd); final Map<Integer, BDDInnerNode> innerNodes = new HashMap<>(); for (final int[] node : nodes) { final int nodenum = node[0]; final Variable variable = this.idx2var.get(node[1]); final BDDNode lowNode = getInnerNode(node[2], falseNode, trueNode, innerNodes); final BDDNode highNode = getInnerNode(node[3], falseNode, trueNode, innerNodes); if (innerNodes.get(nodenum) == null) innerNodes.put(nodenum, new BDDInnerNode(variable, lowNode, highNode)); } return innerNodes.get(bdd); }
java
public BDDNode toLngBdd(final int bdd) { final BDDConstant falseNode = BDDConstant.getFalsumNode(this.f); final BDDConstant trueNode = BDDConstant.getVerumNode(this.f); if (bdd == BDDKernel.BDD_FALSE) return falseNode; if (bdd == BDDKernel.BDD_TRUE) return trueNode; final List<int[]> nodes = this.kernel.allNodes(bdd); final Map<Integer, BDDInnerNode> innerNodes = new HashMap<>(); for (final int[] node : nodes) { final int nodenum = node[0]; final Variable variable = this.idx2var.get(node[1]); final BDDNode lowNode = getInnerNode(node[2], falseNode, trueNode, innerNodes); final BDDNode highNode = getInnerNode(node[3], falseNode, trueNode, innerNodes); if (innerNodes.get(nodenum) == null) innerNodes.put(nodenum, new BDDInnerNode(variable, lowNode, highNode)); } return innerNodes.get(bdd); }
[ "public", "BDDNode", "toLngBdd", "(", "final", "int", "bdd", ")", "{", "final", "BDDConstant", "falseNode", "=", "BDDConstant", ".", "getFalsumNode", "(", "this", ".", "f", ")", ";", "final", "BDDConstant", "trueNode", "=", "BDDConstant", ".", "getVerumNode", ...
Returns a LogicNG internal BDD data structure of a given BDD. @param bdd the BDD @return the BDD as LogicNG data structure
[ "Returns", "a", "LogicNG", "internal", "BDD", "data", "structure", "of", "a", "given", "BDD", "." ]
train
https://github.com/logic-ng/LogicNG/blob/bb9eb88a768be4be8e02a76cfc4a59e6c3fb7f2e/src/main/java/org/logicng/bdds/BDDFactory.java#L443-L461
orbisgis/h2gis
h2gis-functions/src/main/java/org/h2gis/functions/spatial/earth/ST_GeometryShadow.java
ST_GeometryShadow.computeShadow
public static Geometry computeShadow(Geometry geometry, double azimuth, double altitude, double height) { """ Compute the shadow footprint based on @param geometry input geometry @param azimuth of the sun in radians @param altitude of the sun in radians @param height of the geometry @return """ return computeShadow(geometry, azimuth, altitude, height, true); }
java
public static Geometry computeShadow(Geometry geometry, double azimuth, double altitude, double height) { return computeShadow(geometry, azimuth, altitude, height, true); }
[ "public", "static", "Geometry", "computeShadow", "(", "Geometry", "geometry", ",", "double", "azimuth", ",", "double", "altitude", ",", "double", "height", ")", "{", "return", "computeShadow", "(", "geometry", ",", "azimuth", ",", "altitude", ",", "height", ",...
Compute the shadow footprint based on @param geometry input geometry @param azimuth of the sun in radians @param altitude of the sun in radians @param height of the geometry @return
[ "Compute", "the", "shadow", "footprint", "based", "on" ]
train
https://github.com/orbisgis/h2gis/blob/9cd70b447e6469cecbc2fc64b16774b59491df3b/h2gis-functions/src/main/java/org/h2gis/functions/spatial/earth/ST_GeometryShadow.java#L91-L93
alkacon/opencms-core
src/org/opencms/widgets/serialdate/CmsSerialDateValue.java
CmsSerialDateValue.readOptionalArray
private JSONArray readOptionalArray(JSONObject json, String key) { """ Read an optional JSON array. @param json the JSON Object that has the array as element @param key the key for the array in the provided JSON object @return the array or null if reading the array fails. """ try { return json.getJSONArray(key); } catch (JSONException e) { LOG.debug("Reading optional JSON array failed. Default to provided default value.", e); } return null; }
java
private JSONArray readOptionalArray(JSONObject json, String key) { try { return json.getJSONArray(key); } catch (JSONException e) { LOG.debug("Reading optional JSON array failed. Default to provided default value.", e); } return null; }
[ "private", "JSONArray", "readOptionalArray", "(", "JSONObject", "json", ",", "String", "key", ")", "{", "try", "{", "return", "json", ".", "getJSONArray", "(", "key", ")", ";", "}", "catch", "(", "JSONException", "e", ")", "{", "LOG", ".", "debug", "(", ...
Read an optional JSON array. @param json the JSON Object that has the array as element @param key the key for the array in the provided JSON object @return the array or null if reading the array fails.
[ "Read", "an", "optional", "JSON", "array", "." ]
train
https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/widgets/serialdate/CmsSerialDateValue.java#L301-L309
iipc/openwayback
wayback-core/src/main/java/org/archive/wayback/replay/PreservingHttpHeaderProcessor.java
PreservingHttpHeaderProcessor.preserve
protected void preserve(Map<String, String> output, String name, String value) { """ add a header {@code prefix + name} with value {@code value} to {@code output}. if {@code prefix} is either null or empty, this method is no-op. @param output headers Map @param name header name @param value header value """ if (prefix != null) { output.put(prefix + name, value); } }
java
protected void preserve(Map<String, String> output, String name, String value) { if (prefix != null) { output.put(prefix + name, value); } }
[ "protected", "void", "preserve", "(", "Map", "<", "String", ",", "String", ">", "output", ",", "String", "name", ",", "String", "value", ")", "{", "if", "(", "prefix", "!=", "null", ")", "{", "output", ".", "put", "(", "prefix", "+", "name", ",", "...
add a header {@code prefix + name} with value {@code value} to {@code output}. if {@code prefix} is either null or empty, this method is no-op. @param output headers Map @param name header name @param value header value
[ "add", "a", "header", "{" ]
train
https://github.com/iipc/openwayback/blob/da74c3a59a5b5a5c365bd4702dcb45d263535794/wayback-core/src/main/java/org/archive/wayback/replay/PreservingHttpHeaderProcessor.java#L45-L49
exoplatform/jcr
exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/dataflow/persistent/LinkedWorkspaceStorageCacheImpl.java
LinkedWorkspaceStorageCacheImpl.removeChildNode
protected NodeData removeChildNode(final String parentIdentifier, final String childIdentifier) { """ Remove child node by id if parent child nodes are cached in CN. @param parentIdentifier - parebt if @param childIdentifier - node id @return removed node or null if node not cached or parent child nodes are not cached """ final List<NodeData> childNodes = nodesCache.get(parentIdentifier); if (childNodes != null) { synchronized (childNodes) { // [PN] 17.01.07 for (Iterator<NodeData> i = childNodes.iterator(); i.hasNext();) { NodeData cn = i.next(); if (cn.getIdentifier().equals(childIdentifier)) { i.remove(); return cn; } } } } return null; }
java
protected NodeData removeChildNode(final String parentIdentifier, final String childIdentifier) { final List<NodeData> childNodes = nodesCache.get(parentIdentifier); if (childNodes != null) { synchronized (childNodes) { // [PN] 17.01.07 for (Iterator<NodeData> i = childNodes.iterator(); i.hasNext();) { NodeData cn = i.next(); if (cn.getIdentifier().equals(childIdentifier)) { i.remove(); return cn; } } } } return null; }
[ "protected", "NodeData", "removeChildNode", "(", "final", "String", "parentIdentifier", ",", "final", "String", "childIdentifier", ")", "{", "final", "List", "<", "NodeData", ">", "childNodes", "=", "nodesCache", ".", "get", "(", "parentIdentifier", ")", ";", "i...
Remove child node by id if parent child nodes are cached in CN. @param parentIdentifier - parebt if @param childIdentifier - node id @return removed node or null if node not cached or parent child nodes are not cached
[ "Remove", "child", "node", "by", "id", "if", "parent", "child", "nodes", "are", "cached", "in", "CN", "." ]
train
https://github.com/exoplatform/jcr/blob/3e7f9ee1b5683640d73a4316fb4b0ad5eac5b8a2/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/dataflow/persistent/LinkedWorkspaceStorageCacheImpl.java#L2099-L2118
looly/hutool
hutool-crypto/src/main/java/cn/hutool/crypto/KeyUtil.java
KeyUtil.getCertificate
public static Certificate getCertificate(KeyStore keyStore, String alias) { """ 获得 Certification @param keyStore {@link KeyStore} @param alias 别名 @return {@link Certificate} """ try { return keyStore.getCertificate(alias); } catch (Exception e) { throw new CryptoException(e); } }
java
public static Certificate getCertificate(KeyStore keyStore, String alias) { try { return keyStore.getCertificate(alias); } catch (Exception e) { throw new CryptoException(e); } }
[ "public", "static", "Certificate", "getCertificate", "(", "KeyStore", "keyStore", ",", "String", "alias", ")", "{", "try", "{", "return", "keyStore", ".", "getCertificate", "(", "alias", ")", ";", "}", "catch", "(", "Exception", "e", ")", "{", "throw", "ne...
获得 Certification @param keyStore {@link KeyStore} @param alias 别名 @return {@link Certificate}
[ "获得", "Certification" ]
train
https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-crypto/src/main/java/cn/hutool/crypto/KeyUtil.java#L708-L714
aws/aws-sdk-java
aws-java-sdk-glue/src/main/java/com/amazonaws/services/glue/model/ListTriggersRequest.java
ListTriggersRequest.withTags
public ListTriggersRequest withTags(java.util.Map<String, String> tags) { """ <p> Specifies to return only these tagged resources. </p> @param tags Specifies to return only these tagged resources. @return Returns a reference to this object so that method calls can be chained together. """ setTags(tags); return this; }
java
public ListTriggersRequest withTags(java.util.Map<String, String> tags) { setTags(tags); return this; }
[ "public", "ListTriggersRequest", "withTags", "(", "java", ".", "util", ".", "Map", "<", "String", ",", "String", ">", "tags", ")", "{", "setTags", "(", "tags", ")", ";", "return", "this", ";", "}" ]
<p> Specifies to return only these tagged resources. </p> @param tags Specifies to return only these tagged resources. @return Returns a reference to this object so that method calls can be chained together.
[ "<p", ">", "Specifies", "to", "return", "only", "these", "tagged", "resources", ".", "<", "/", "p", ">" ]
train
https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-glue/src/main/java/com/amazonaws/services/glue/model/ListTriggersRequest.java#L215-L218
Axway/Grapes
server/src/main/java/org/axway/grapes/server/core/ArtifactHandler.java
ArtifactHandler.addLicense
public void addLicense(final String gavc, final String licenseId) { """ Adds a license to an artifact if the license exist into the database @param gavc String @param licenseId String """ final DbArtifact dbArtifact = getArtifact(gavc); // Try to find an existing license that match the new one final LicenseHandler licenseHandler = new LicenseHandler(repositoryHandler); final DbLicense license = licenseHandler.resolve(licenseId); // If there is no existing license that match this one let's use the provided value but // only if the artifact has no license yet. Otherwise it could mean that users has already // identify the license manually. if(license == null){ if(dbArtifact.getLicenses().isEmpty()){ LOG.warn("Add reference to a non existing license called " + licenseId + " in artifact " + dbArtifact.getGavc()); repositoryHandler.addLicenseToArtifact(dbArtifact, licenseId); } } // Add only if the license is not already referenced else if(!dbArtifact.getLicenses().contains(license.getName())){ repositoryHandler.addLicenseToArtifact(dbArtifact, license.getName()); } }
java
public void addLicense(final String gavc, final String licenseId) { final DbArtifact dbArtifact = getArtifact(gavc); // Try to find an existing license that match the new one final LicenseHandler licenseHandler = new LicenseHandler(repositoryHandler); final DbLicense license = licenseHandler.resolve(licenseId); // If there is no existing license that match this one let's use the provided value but // only if the artifact has no license yet. Otherwise it could mean that users has already // identify the license manually. if(license == null){ if(dbArtifact.getLicenses().isEmpty()){ LOG.warn("Add reference to a non existing license called " + licenseId + " in artifact " + dbArtifact.getGavc()); repositoryHandler.addLicenseToArtifact(dbArtifact, licenseId); } } // Add only if the license is not already referenced else if(!dbArtifact.getLicenses().contains(license.getName())){ repositoryHandler.addLicenseToArtifact(dbArtifact, license.getName()); } }
[ "public", "void", "addLicense", "(", "final", "String", "gavc", ",", "final", "String", "licenseId", ")", "{", "final", "DbArtifact", "dbArtifact", "=", "getArtifact", "(", "gavc", ")", ";", "// Try to find an existing license that match the new one", "final", "Licens...
Adds a license to an artifact if the license exist into the database @param gavc String @param licenseId String
[ "Adds", "a", "license", "to", "an", "artifact", "if", "the", "license", "exist", "into", "the", "database" ]
train
https://github.com/Axway/Grapes/blob/ce9cc73d85f83eaa5fbc991abb593915a8c8374e/server/src/main/java/org/axway/grapes/server/core/ArtifactHandler.java#L74-L94
keyboardsurfer/Crouton
library/src/main/java/de/keyboardsurfer/android/widget/crouton/Manager.java
Manager.sendMessage
private void sendMessage(Crouton crouton, final int messageId) { """ Sends a {@link Crouton} within a {@link Message}. @param crouton The {@link Crouton} that should be sent. @param messageId The {@link Message} id. """ final Message message = obtainMessage(messageId); message.obj = crouton; sendMessage(message); }
java
private void sendMessage(Crouton crouton, final int messageId) { final Message message = obtainMessage(messageId); message.obj = crouton; sendMessage(message); }
[ "private", "void", "sendMessage", "(", "Crouton", "crouton", ",", "final", "int", "messageId", ")", "{", "final", "Message", "message", "=", "obtainMessage", "(", "messageId", ")", ";", "message", ".", "obj", "=", "crouton", ";", "sendMessage", "(", "message...
Sends a {@link Crouton} within a {@link Message}. @param crouton The {@link Crouton} that should be sent. @param messageId The {@link Message} id.
[ "Sends", "a", "{", "@link", "Crouton", "}", "within", "a", "{", "@link", "Message", "}", "." ]
train
https://github.com/keyboardsurfer/Crouton/blob/7806b15e4d52793e1f5aeaa4a55b1e220289e619/library/src/main/java/de/keyboardsurfer/android/widget/crouton/Manager.java#L126-L130
alibaba/jstorm
jstorm-core/src/main/java/com/alibaba/jstorm/daemon/nimbus/StatusTransition.java
StatusTransition.transitionLock
public <T> void transitionLock(String topologyId, boolean errorOnNoTransition, StatusType changeStatus, T... args) throws Exception { """ Changing status @param args -- will be used in the status changing callback """ // get ZK's topology node's data, which is StormBase StormBase stormbase = data.getStormClusterState().storm_base(topologyId, null); if (stormbase == null) { LOG.error("Cannot apply event: changing status " + topologyId + " -> " + changeStatus.getStatus() + ", cause: failed to get StormBase from ZK"); return; } StormStatus currentStatus = stormbase.getStatus(); if (currentStatus == null) { LOG.error("Cannot apply event: changing status " + topologyId + " -> " + changeStatus.getStatus() + ", cause: topologyStatus is null in ZK"); return; } // <currentStatus, Map<changingStatus, callback>> Map<StatusType, Map<StatusType, Callback>> callbackMap = stateTransitions(topologyId, currentStatus); // get current changingCallbacks Map<StatusType, Callback> changingCallbacks = callbackMap.get(currentStatus.getStatusType()); if (changingCallbacks == null || !changingCallbacks.containsKey(changeStatus) || changingCallbacks.get(changeStatus) == null) { String msg = "No transition for event: changing status:" + changeStatus.getStatus() + ", current status: " + currentStatus.getStatusType() + ", topology-id: " + topologyId; LOG.info(msg); if (errorOnNoTransition) { throw new RuntimeException(msg); } return; } Callback callback = changingCallbacks.get(changeStatus); Object obj = callback.execute(args); if (obj != null && obj instanceof StormStatus) { StormStatus newStatus = (StormStatus) obj; // update status to ZK data.getStormClusterState().update_storm(topologyId, newStatus); LOG.info("Successfully updated " + topologyId + " to status " + newStatus); } LOG.info("Successfully apply event: changing status " + topologyId + " -> " + changeStatus.getStatus()); }
java
public <T> void transitionLock(String topologyId, boolean errorOnNoTransition, StatusType changeStatus, T... args) throws Exception { // get ZK's topology node's data, which is StormBase StormBase stormbase = data.getStormClusterState().storm_base(topologyId, null); if (stormbase == null) { LOG.error("Cannot apply event: changing status " + topologyId + " -> " + changeStatus.getStatus() + ", cause: failed to get StormBase from ZK"); return; } StormStatus currentStatus = stormbase.getStatus(); if (currentStatus == null) { LOG.error("Cannot apply event: changing status " + topologyId + " -> " + changeStatus.getStatus() + ", cause: topologyStatus is null in ZK"); return; } // <currentStatus, Map<changingStatus, callback>> Map<StatusType, Map<StatusType, Callback>> callbackMap = stateTransitions(topologyId, currentStatus); // get current changingCallbacks Map<StatusType, Callback> changingCallbacks = callbackMap.get(currentStatus.getStatusType()); if (changingCallbacks == null || !changingCallbacks.containsKey(changeStatus) || changingCallbacks.get(changeStatus) == null) { String msg = "No transition for event: changing status:" + changeStatus.getStatus() + ", current status: " + currentStatus.getStatusType() + ", topology-id: " + topologyId; LOG.info(msg); if (errorOnNoTransition) { throw new RuntimeException(msg); } return; } Callback callback = changingCallbacks.get(changeStatus); Object obj = callback.execute(args); if (obj != null && obj instanceof StormStatus) { StormStatus newStatus = (StormStatus) obj; // update status to ZK data.getStormClusterState().update_storm(topologyId, newStatus); LOG.info("Successfully updated " + topologyId + " to status " + newStatus); } LOG.info("Successfully apply event: changing status " + topologyId + " -> " + changeStatus.getStatus()); }
[ "public", "<", "T", ">", "void", "transitionLock", "(", "String", "topologyId", ",", "boolean", "errorOnNoTransition", ",", "StatusType", "changeStatus", ",", "T", "...", "args", ")", "throws", "Exception", "{", "// get ZK's topology node's data, which is StormBase", ...
Changing status @param args -- will be used in the status changing callback
[ "Changing", "status" ]
train
https://github.com/alibaba/jstorm/blob/5d6cde22dbca7df3d6e6830bf94f98a6639ab559/jstorm-core/src/main/java/com/alibaba/jstorm/daemon/nimbus/StatusTransition.java#L72-L117
JodaOrg/joda-money
src/main/java/org/joda/money/format/MoneyFormatterBuilder.java
MoneyFormatterBuilder.toFormatter
@SuppressWarnings("cast") public MoneyFormatter toFormatter(Locale locale) { """ Builds the formatter from the builder setting the locale. <p> Once the builder is in the correct state it must be converted to a {@code MoneyFormatter} to be used. Calling this method does not change the state of this instance, so it can still be used. <p> This method uses the specified locale within the returned formatter. It can be changed by calling {@link MoneyFormatter#withLocale(Locale)}. @param locale the initial locale for the formatter, not null @return the formatter built from this builder, never null """ MoneyFormatter.checkNotNull(locale, "Locale must not be null"); MoneyPrinter[] printersCopy = (MoneyPrinter[]) printers.toArray(new MoneyPrinter[printers.size()]); MoneyParser[] parsersCopy = (MoneyParser[]) parsers.toArray(new MoneyParser[parsers.size()]); return new MoneyFormatter(locale, printersCopy, parsersCopy); }
java
@SuppressWarnings("cast") public MoneyFormatter toFormatter(Locale locale) { MoneyFormatter.checkNotNull(locale, "Locale must not be null"); MoneyPrinter[] printersCopy = (MoneyPrinter[]) printers.toArray(new MoneyPrinter[printers.size()]); MoneyParser[] parsersCopy = (MoneyParser[]) parsers.toArray(new MoneyParser[parsers.size()]); return new MoneyFormatter(locale, printersCopy, parsersCopy); }
[ "@", "SuppressWarnings", "(", "\"cast\"", ")", "public", "MoneyFormatter", "toFormatter", "(", "Locale", "locale", ")", "{", "MoneyFormatter", ".", "checkNotNull", "(", "locale", ",", "\"Locale must not be null\"", ")", ";", "MoneyPrinter", "[", "]", "printersCopy",...
Builds the formatter from the builder setting the locale. <p> Once the builder is in the correct state it must be converted to a {@code MoneyFormatter} to be used. Calling this method does not change the state of this instance, so it can still be used. <p> This method uses the specified locale within the returned formatter. It can be changed by calling {@link MoneyFormatter#withLocale(Locale)}. @param locale the initial locale for the formatter, not null @return the formatter built from this builder, never null
[ "Builds", "the", "formatter", "from", "the", "builder", "setting", "the", "locale", ".", "<p", ">", "Once", "the", "builder", "is", "in", "the", "correct", "state", "it", "must", "be", "converted", "to", "a", "{", "@code", "MoneyFormatter", "}", "to", "b...
train
https://github.com/JodaOrg/joda-money/blob/e1f2de75aa36610a695358696c8a88a18ca66cde/src/main/java/org/joda/money/format/MoneyFormatterBuilder.java#L299-L305
google/j2objc
jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/text/BidiWriter.java
BidiWriter.doWriteForward
private static String doWriteForward(String src, int options) { """ /* When we have OUTPUT_REVERSE set on writeReordered(), then we semantically write RTL runs in reverse and later reverse them again. Instead, we actually write them in forward order to begin with. However, if the RTL run was to be mirrored, we need to mirror here now since the implicit second reversal must not do it. It looks strange to do mirroring in LTR output, but it is only because we are writing RTL output in reverse. """ /* optimize for several combinations of options */ switch(options&(Bidi.REMOVE_BIDI_CONTROLS|Bidi.DO_MIRRORING)) { case 0: { /* simply return the LTR run */ return src; } case Bidi.DO_MIRRORING: { StringBuffer dest = new StringBuffer(src.length()); /* do mirroring */ int i=0; int c; do { c = UTF16.charAt(src, i); i += UTF16.getCharCount(c); UTF16.append(dest, UCharacter.getMirror(c)); } while(i < src.length()); return dest.toString(); } case Bidi.REMOVE_BIDI_CONTROLS: { StringBuilder dest = new StringBuilder(src.length()); /* copy the LTR run and remove any Bidi control characters */ int i = 0; char c; do { c = src.charAt(i++); if(!Bidi.IsBidiControlChar(c)) { dest.append(c); } } while(i < src.length()); return dest.toString(); } default: { StringBuffer dest = new StringBuffer(src.length()); /* remove Bidi control characters and do mirroring */ int i = 0; int c; do { c = UTF16.charAt(src, i); i += UTF16.getCharCount(c); if(!Bidi.IsBidiControlChar(c)) { UTF16.append(dest, UCharacter.getMirror(c)); } } while(i < src.length()); return dest.toString(); } } /* end of switch */ }
java
private static String doWriteForward(String src, int options) { /* optimize for several combinations of options */ switch(options&(Bidi.REMOVE_BIDI_CONTROLS|Bidi.DO_MIRRORING)) { case 0: { /* simply return the LTR run */ return src; } case Bidi.DO_MIRRORING: { StringBuffer dest = new StringBuffer(src.length()); /* do mirroring */ int i=0; int c; do { c = UTF16.charAt(src, i); i += UTF16.getCharCount(c); UTF16.append(dest, UCharacter.getMirror(c)); } while(i < src.length()); return dest.toString(); } case Bidi.REMOVE_BIDI_CONTROLS: { StringBuilder dest = new StringBuilder(src.length()); /* copy the LTR run and remove any Bidi control characters */ int i = 0; char c; do { c = src.charAt(i++); if(!Bidi.IsBidiControlChar(c)) { dest.append(c); } } while(i < src.length()); return dest.toString(); } default: { StringBuffer dest = new StringBuffer(src.length()); /* remove Bidi control characters and do mirroring */ int i = 0; int c; do { c = UTF16.charAt(src, i); i += UTF16.getCharCount(c); if(!Bidi.IsBidiControlChar(c)) { UTF16.append(dest, UCharacter.getMirror(c)); } } while(i < src.length()); return dest.toString(); } } /* end of switch */ }
[ "private", "static", "String", "doWriteForward", "(", "String", "src", ",", "int", "options", ")", "{", "/* optimize for several combinations of options */", "switch", "(", "options", "&", "(", "Bidi", ".", "REMOVE_BIDI_CONTROLS", "|", "Bidi", ".", "DO_MIRRORING", "...
/* When we have OUTPUT_REVERSE set on writeReordered(), then we semantically write RTL runs in reverse and later reverse them again. Instead, we actually write them in forward order to begin with. However, if the RTL run was to be mirrored, we need to mirror here now since the implicit second reversal must not do it. It looks strange to do mirroring in LTR output, but it is only because we are writing RTL output in reverse.
[ "/", "*", "When", "we", "have", "OUTPUT_REVERSE", "set", "on", "writeReordered", "()", "then", "we", "semantically", "write", "RTL", "runs", "in", "reverse", "and", "later", "reverse", "them", "again", ".", "Instead", "we", "actually", "write", "them", "in",...
train
https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/text/BidiWriter.java#L43-L94
OpenLiberty/open-liberty
dev/com.ibm.ws.security.audit.file/src/com/ibm/ws/security/audit/logutils/FileLogUtils.java
FileLogUtils.createNewFile
static File createNewFile(final FileLogSet fileLogSet) { """ This method will create a new file with the specified name and extension in the specified directory. If a unique file is required then it will add a timestamp to the file and if necessary a unqiue identifier to the file name. @return The file or <code>null</code> if an error occurs @see #getUniqueFile(File, String, String) """ final File directory = fileLogSet.getDirectory(); final String fileName = fileLogSet.getFileName(); final String fileExtension = fileLogSet.getFileExtension(); File f = null; try { f = AccessController.doPrivileged(new java.security.PrivilegedExceptionAction<File>() { @Override public File run() throws Exception { return fileLogSet.createNewFile(); } }); } catch (PrivilegedActionException e) { File exf = new File(directory, fileName + fileExtension); Tr.error(tc, "UNABLE_TO_DELETE_RESOURCE", new Object[] { exf.getAbsolutePath(), e }); } return f; }
java
static File createNewFile(final FileLogSet fileLogSet) { final File directory = fileLogSet.getDirectory(); final String fileName = fileLogSet.getFileName(); final String fileExtension = fileLogSet.getFileExtension(); File f = null; try { f = AccessController.doPrivileged(new java.security.PrivilegedExceptionAction<File>() { @Override public File run() throws Exception { return fileLogSet.createNewFile(); } }); } catch (PrivilegedActionException e) { File exf = new File(directory, fileName + fileExtension); Tr.error(tc, "UNABLE_TO_DELETE_RESOURCE", new Object[] { exf.getAbsolutePath(), e }); } return f; }
[ "static", "File", "createNewFile", "(", "final", "FileLogSet", "fileLogSet", ")", "{", "final", "File", "directory", "=", "fileLogSet", ".", "getDirectory", "(", ")", ";", "final", "String", "fileName", "=", "fileLogSet", ".", "getFileName", "(", ")", ";", "...
This method will create a new file with the specified name and extension in the specified directory. If a unique file is required then it will add a timestamp to the file and if necessary a unqiue identifier to the file name. @return The file or <code>null</code> if an error occurs @see #getUniqueFile(File, String, String)
[ "This", "method", "will", "create", "a", "new", "file", "with", "the", "specified", "name", "and", "extension", "in", "the", "specified", "directory", ".", "If", "a", "unique", "file", "is", "required", "then", "it", "will", "add", "a", "timestamp", "to", ...
train
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.security.audit.file/src/com/ibm/ws/security/audit/logutils/FileLogUtils.java#L122-L141
offbynull/coroutines
instrumenter/src/main/java/com/offbynull/coroutines/instrumenter/generators/GenericGenerators.java
GenericGenerators.cloneInsnList
public static InsnList cloneInsnList(InsnList insnList, Set<LabelNode> globalLabels) { """ Clones an instruction list. All labels are remapped unless otherwise specified in {@code globalLabels}. @param insnList instruction list to clone @param globalLabels set of labels that should not be remapped @throws NullPointerException if any argument is {@code null} @return instruction list with cloned instructions """ Validate.notNull(insnList); // remap all labelnodes Map<LabelNode, LabelNode> labelNodeMapping = new HashMap<>(); ListIterator<AbstractInsnNode> it = insnList.iterator(); while (it.hasNext()) { AbstractInsnNode abstractInsnNode = it.next(); if (abstractInsnNode instanceof LabelNode) { LabelNode existingLabelNode = (LabelNode) abstractInsnNode; labelNodeMapping.put(existingLabelNode, new LabelNode()); } } // override remapping such that global labels stay the same for (LabelNode globalLabel : globalLabels) { labelNodeMapping.put(globalLabel, globalLabel); } // clone InsnList ret = new InsnList(); it = insnList.iterator(); while (it.hasNext()) { AbstractInsnNode abstractInsnNode = it.next(); ret.add(abstractInsnNode.clone(labelNodeMapping)); } return ret; }
java
public static InsnList cloneInsnList(InsnList insnList, Set<LabelNode> globalLabels) { Validate.notNull(insnList); // remap all labelnodes Map<LabelNode, LabelNode> labelNodeMapping = new HashMap<>(); ListIterator<AbstractInsnNode> it = insnList.iterator(); while (it.hasNext()) { AbstractInsnNode abstractInsnNode = it.next(); if (abstractInsnNode instanceof LabelNode) { LabelNode existingLabelNode = (LabelNode) abstractInsnNode; labelNodeMapping.put(existingLabelNode, new LabelNode()); } } // override remapping such that global labels stay the same for (LabelNode globalLabel : globalLabels) { labelNodeMapping.put(globalLabel, globalLabel); } // clone InsnList ret = new InsnList(); it = insnList.iterator(); while (it.hasNext()) { AbstractInsnNode abstractInsnNode = it.next(); ret.add(abstractInsnNode.clone(labelNodeMapping)); } return ret; }
[ "public", "static", "InsnList", "cloneInsnList", "(", "InsnList", "insnList", ",", "Set", "<", "LabelNode", ">", "globalLabels", ")", "{", "Validate", ".", "notNull", "(", "insnList", ")", ";", "// remap all labelnodes", "Map", "<", "LabelNode", ",", "LabelNode"...
Clones an instruction list. All labels are remapped unless otherwise specified in {@code globalLabels}. @param insnList instruction list to clone @param globalLabels set of labels that should not be remapped @throws NullPointerException if any argument is {@code null} @return instruction list with cloned instructions
[ "Clones", "an", "instruction", "list", ".", "All", "labels", "are", "remapped", "unless", "otherwise", "specified", "in", "{" ]
train
https://github.com/offbynull/coroutines/blob/b1b83c293945f53a2f63fca8f15a53e88b796bf5/instrumenter/src/main/java/com/offbynull/coroutines/instrumenter/generators/GenericGenerators.java#L127-L155
zeroturnaround/zt-zip
src/main/java/org/zeroturnaround/zip/ZipUtil.java
ZipUtil.addEntry
public static void addEntry(File zip, String path, File file, File destZip) { """ Copies an existing ZIP file and appends it with one new entry. @param zip an existing ZIP file (only read). @param path new ZIP entry path. @param file new entry to be added. @param destZip new ZIP file created. """ addEntry(zip, new FileSource(path, file), destZip); }
java
public static void addEntry(File zip, String path, File file, File destZip) { addEntry(zip, new FileSource(path, file), destZip); }
[ "public", "static", "void", "addEntry", "(", "File", "zip", ",", "String", "path", ",", "File", "file", ",", "File", "destZip", ")", "{", "addEntry", "(", "zip", ",", "new", "FileSource", "(", "path", ",", "file", ")", ",", "destZip", ")", ";", "}" ]
Copies an existing ZIP file and appends it with one new entry. @param zip an existing ZIP file (only read). @param path new ZIP entry path. @param file new entry to be added. @param destZip new ZIP file created.
[ "Copies", "an", "existing", "ZIP", "file", "and", "appends", "it", "with", "one", "new", "entry", "." ]
train
https://github.com/zeroturnaround/zt-zip/blob/abb4dc43583e4d19339c0c021035019798970a13/src/main/java/org/zeroturnaround/zip/ZipUtil.java#L2026-L2028
alkacon/opencms-core
src-gwt/org/opencms/acacia/client/CmsAttributeHandler.java
CmsAttributeHandler.changeValue
public void changeValue(String value, int valueIndex) { """ Applies a value change to the entity data as well as to the value view widget.<p> @param value the value @param valueIndex the value index """ m_attributeValueViews.get(valueIndex).getValueWidget().setValue(value, false); changeEntityValue(value, valueIndex); }
java
public void changeValue(String value, int valueIndex) { m_attributeValueViews.get(valueIndex).getValueWidget().setValue(value, false); changeEntityValue(value, valueIndex); }
[ "public", "void", "changeValue", "(", "String", "value", ",", "int", "valueIndex", ")", "{", "m_attributeValueViews", ".", "get", "(", "valueIndex", ")", ".", "getValueWidget", "(", ")", ".", "setValue", "(", "value", ",", "false", ")", ";", "changeEntityVal...
Applies a value change to the entity data as well as to the value view widget.<p> @param value the value @param valueIndex the value index
[ "Applies", "a", "value", "change", "to", "the", "entity", "data", "as", "well", "as", "to", "the", "value", "view", "widget", ".", "<p", ">" ]
train
https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src-gwt/org/opencms/acacia/client/CmsAttributeHandler.java#L391-L395
infinispan/infinispan
client/hotrod-client/src/main/java/org/infinispan/client/hotrod/impl/transaction/TransactionContext.java
TransactionContext.prepareContext
int prepareContext(Xid xid, boolean onePhaseCommit, long timeout) { """ Prepares the {@link Transaction} in the server and returns the {@link XAResource} code. <p> A special value {@link Integer#MIN_VALUE} is used to signal an error before contacting the server (for example, it wasn't able to marshall the key/value) """ PrepareTransactionOperation operation; Collection<Modification> modifications; try { modifications = toModification(); if (trace) { log.tracef("Preparing transaction xid=%s, remote-cache=%s, modification-size=%d", xid, cacheName, modifications.size()); } if (modifications.isEmpty()) { return XAResource.XA_RDONLY; } } catch (Exception e) { return Integer.MIN_VALUE; } try { int xaReturnCode; do { operation = operationsFactory .newPrepareTransactionOperation(xid, onePhaseCommit, modifications, recoverable, timeout); xaReturnCode = operation.execute().get(); } while (operation.shouldRetry()); return xaReturnCode; } catch (Exception e) { log.exceptionDuringPrepare(xid, e); return XAException.XA_RBROLLBACK; } }
java
int prepareContext(Xid xid, boolean onePhaseCommit, long timeout) { PrepareTransactionOperation operation; Collection<Modification> modifications; try { modifications = toModification(); if (trace) { log.tracef("Preparing transaction xid=%s, remote-cache=%s, modification-size=%d", xid, cacheName, modifications.size()); } if (modifications.isEmpty()) { return XAResource.XA_RDONLY; } } catch (Exception e) { return Integer.MIN_VALUE; } try { int xaReturnCode; do { operation = operationsFactory .newPrepareTransactionOperation(xid, onePhaseCommit, modifications, recoverable, timeout); xaReturnCode = operation.execute().get(); } while (operation.shouldRetry()); return xaReturnCode; } catch (Exception e) { log.exceptionDuringPrepare(xid, e); return XAException.XA_RBROLLBACK; } }
[ "int", "prepareContext", "(", "Xid", "xid", ",", "boolean", "onePhaseCommit", ",", "long", "timeout", ")", "{", "PrepareTransactionOperation", "operation", ";", "Collection", "<", "Modification", ">", "modifications", ";", "try", "{", "modifications", "=", "toModi...
Prepares the {@link Transaction} in the server and returns the {@link XAResource} code. <p> A special value {@link Integer#MIN_VALUE} is used to signal an error before contacting the server (for example, it wasn't able to marshall the key/value)
[ "Prepares", "the", "{" ]
train
https://github.com/infinispan/infinispan/blob/7c62b94886c3febb4774ae8376acf2baa0265ab5/client/hotrod-client/src/main/java/org/infinispan/client/hotrod/impl/transaction/TransactionContext.java#L176-L203
phax/ph-commons
ph-commons/src/main/java/com/helger/commons/io/file/PathOperations.java
PathOperations.deleteDir
@Nonnull public static FileIOError deleteDir (@Nonnull final Path aDir) { """ Delete an existing directory. The directory needs to be empty before it can be deleted. @param aDir The directory to be deleted. May not be <code>null</code>. @return A non-<code>null</code> error code. """ ValueEnforcer.notNull (aDir, "Directory"); final Path aRealDir = _getUnifiedPath (aDir); // Does the directory not exist? if (!aRealDir.toFile ().isDirectory ()) return EFileIOErrorCode.SOURCE_DOES_NOT_EXIST.getAsIOError (EFileIOOperation.DELETE_DIR, aRealDir); if (isExceptionOnDeleteRoot ()) { // Check that we're not deleting the complete hard drive... if (aRealDir.getParent () == null || aRealDir.getNameCount () == 0) throw new IllegalArgumentException ("Aren't we deleting the full drive: '" + aRealDir + "'"); } // Is the parent directory writable? final Path aParentDir = aRealDir.getParent (); if (aParentDir != null && !Files.isWritable (aParentDir)) return EFileIOErrorCode.SOURCE_PARENT_NOT_WRITABLE.getAsIOError (EFileIOOperation.DELETE_DIR, aRealDir); return _perform (EFileIOOperation.DELETE_DIR, Files::delete, aRealDir); }
java
@Nonnull public static FileIOError deleteDir (@Nonnull final Path aDir) { ValueEnforcer.notNull (aDir, "Directory"); final Path aRealDir = _getUnifiedPath (aDir); // Does the directory not exist? if (!aRealDir.toFile ().isDirectory ()) return EFileIOErrorCode.SOURCE_DOES_NOT_EXIST.getAsIOError (EFileIOOperation.DELETE_DIR, aRealDir); if (isExceptionOnDeleteRoot ()) { // Check that we're not deleting the complete hard drive... if (aRealDir.getParent () == null || aRealDir.getNameCount () == 0) throw new IllegalArgumentException ("Aren't we deleting the full drive: '" + aRealDir + "'"); } // Is the parent directory writable? final Path aParentDir = aRealDir.getParent (); if (aParentDir != null && !Files.isWritable (aParentDir)) return EFileIOErrorCode.SOURCE_PARENT_NOT_WRITABLE.getAsIOError (EFileIOOperation.DELETE_DIR, aRealDir); return _perform (EFileIOOperation.DELETE_DIR, Files::delete, aRealDir); }
[ "@", "Nonnull", "public", "static", "FileIOError", "deleteDir", "(", "@", "Nonnull", "final", "Path", "aDir", ")", "{", "ValueEnforcer", ".", "notNull", "(", "aDir", ",", "\"Directory\"", ")", ";", "final", "Path", "aRealDir", "=", "_getUnifiedPath", "(", "a...
Delete an existing directory. The directory needs to be empty before it can be deleted. @param aDir The directory to be deleted. May not be <code>null</code>. @return A non-<code>null</code> error code.
[ "Delete", "an", "existing", "directory", ".", "The", "directory", "needs", "to", "be", "empty", "before", "it", "can", "be", "deleted", "." ]
train
https://github.com/phax/ph-commons/blob/d28c03565f44a0b804d96028d0969f9bb38c4313/ph-commons/src/main/java/com/helger/commons/io/file/PathOperations.java#L249-L273
googleapis/google-cloud-java
google-cloud-clients/google-cloud-container/src/main/java/com/google/cloud/container/v1/ClusterManagerClient.java
ClusterManagerClient.listOperations
public final ListOperationsResponse listOperations(String projectId, String zone) { """ Lists all operations in a project in a specific zone or all zones. <p>Sample code: <pre><code> try (ClusterManagerClient clusterManagerClient = ClusterManagerClient.create()) { String projectId = ""; String zone = ""; ListOperationsResponse response = clusterManagerClient.listOperations(projectId, zone); } </code></pre> @param projectId Deprecated. The Google Developers Console [project ID or project number](https://support.google.com/cloud/answer/6158840). This field has been deprecated and replaced by the parent field. @param zone Deprecated. The name of the Google Compute Engine [zone](/compute/docs/zones#available) to return operations for, or `-` for all zones. This field has been deprecated and replaced by the parent field. @throws com.google.api.gax.rpc.ApiException if the remote call fails """ ListOperationsRequest request = ListOperationsRequest.newBuilder().setProjectId(projectId).setZone(zone).build(); return listOperations(request); }
java
public final ListOperationsResponse listOperations(String projectId, String zone) { ListOperationsRequest request = ListOperationsRequest.newBuilder().setProjectId(projectId).setZone(zone).build(); return listOperations(request); }
[ "public", "final", "ListOperationsResponse", "listOperations", "(", "String", "projectId", ",", "String", "zone", ")", "{", "ListOperationsRequest", "request", "=", "ListOperationsRequest", ".", "newBuilder", "(", ")", ".", "setProjectId", "(", "projectId", ")", "."...
Lists all operations in a project in a specific zone or all zones. <p>Sample code: <pre><code> try (ClusterManagerClient clusterManagerClient = ClusterManagerClient.create()) { String projectId = ""; String zone = ""; ListOperationsResponse response = clusterManagerClient.listOperations(projectId, zone); } </code></pre> @param projectId Deprecated. The Google Developers Console [project ID or project number](https://support.google.com/cloud/answer/6158840). This field has been deprecated and replaced by the parent field. @param zone Deprecated. The name of the Google Compute Engine [zone](/compute/docs/zones#available) to return operations for, or `-` for all zones. This field has been deprecated and replaced by the parent field. @throws com.google.api.gax.rpc.ApiException if the remote call fails
[ "Lists", "all", "operations", "in", "a", "project", "in", "a", "specific", "zone", "or", "all", "zones", "." ]
train
https://github.com/googleapis/google-cloud-java/blob/d2f0bc64a53049040fe9c9d338b12fab3dd1ad6a/google-cloud-clients/google-cloud-container/src/main/java/com/google/cloud/container/v1/ClusterManagerClient.java#L1396-L1401
transloadit/java-sdk
src/main/java/com/transloadit/sdk/Assembly.java
Assembly.processTusFile
protected void processTusFile(File file, String fieldName, String assemblyUrl) throws IOException { """ Prepares a file for tus upload. @param file {@link File} @param fieldName the form field name assigned to the file. @param assemblyUrl the assembly url affiliated with the tus upload. @throws IOException when there's a failure with file retrieval. """ TusUpload upload = getTusUploadInstance(file); Map<String, String> metadata = new HashMap<String, String>(); metadata.put("filename", file.getName()); metadata.put("assembly_url", assemblyUrl); metadata.put("fieldname", fieldName); upload.setMetadata(metadata); uploads.add(upload); }
java
protected void processTusFile(File file, String fieldName, String assemblyUrl) throws IOException { TusUpload upload = getTusUploadInstance(file); Map<String, String> metadata = new HashMap<String, String>(); metadata.put("filename", file.getName()); metadata.put("assembly_url", assemblyUrl); metadata.put("fieldname", fieldName); upload.setMetadata(metadata); uploads.add(upload); }
[ "protected", "void", "processTusFile", "(", "File", "file", ",", "String", "fieldName", ",", "String", "assemblyUrl", ")", "throws", "IOException", "{", "TusUpload", "upload", "=", "getTusUploadInstance", "(", "file", ")", ";", "Map", "<", "String", ",", "Stri...
Prepares a file for tus upload. @param file {@link File} @param fieldName the form field name assigned to the file. @param assemblyUrl the assembly url affiliated with the tus upload. @throws IOException when there's a failure with file retrieval.
[ "Prepares", "a", "file", "for", "tus", "upload", "." ]
train
https://github.com/transloadit/java-sdk/blob/9326c540a66f77b3d907d0b2c05bff1145ca14f7/src/main/java/com/transloadit/sdk/Assembly.java#L251-L262
rterp/GMapsFX
GMapsFX/src/main/java/com/lynden/gmapsfx/javascript/JavascriptObject.java
JavascriptObject.getProperty
protected <T> T getProperty(String key, Class<T> type) { """ Gets the property and casts to the appropriate type @param <T> @param key The property name @param type The property type @return The value of the property """ Object returnValue = getProperty(key); if (returnValue != null) { return (T) returnValue; } else { return null; } }
java
protected <T> T getProperty(String key, Class<T> type) { Object returnValue = getProperty(key); if (returnValue != null) { return (T) returnValue; } else { return null; } }
[ "protected", "<", "T", ">", "T", "getProperty", "(", "String", "key", ",", "Class", "<", "T", ">", "type", ")", "{", "Object", "returnValue", "=", "getProperty", "(", "key", ")", ";", "if", "(", "returnValue", "!=", "null", ")", "{", "return", "(", ...
Gets the property and casts to the appropriate type @param <T> @param key The property name @param type The property type @return The value of the property
[ "Gets", "the", "property", "and", "casts", "to", "the", "appropriate", "type" ]
train
https://github.com/rterp/GMapsFX/blob/4623d3f768e8ad78fc50ee32dd204d236e01059f/GMapsFX/src/main/java/com/lynden/gmapsfx/javascript/JavascriptObject.java#L192-L199
wcm-io/wcm-io-handler
link/src/main/java/io/wcm/handler/link/LinkArgs.java
LinkArgs.getProperties
public ValueMap getProperties() { """ Custom properties that my be used by application-specific markup builders or processors. @return Value map """ if (this.properties == null) { this.properties = new ValueMapDecorator(new HashMap<String, Object>()); } return this.properties; }
java
public ValueMap getProperties() { if (this.properties == null) { this.properties = new ValueMapDecorator(new HashMap<String, Object>()); } return this.properties; }
[ "public", "ValueMap", "getProperties", "(", ")", "{", "if", "(", "this", ".", "properties", "==", "null", ")", "{", "this", ".", "properties", "=", "new", "ValueMapDecorator", "(", "new", "HashMap", "<", "String", ",", "Object", ">", "(", ")", ")", ";"...
Custom properties that my be used by application-specific markup builders or processors. @return Value map
[ "Custom", "properties", "that", "my", "be", "used", "by", "application", "-", "specific", "markup", "builders", "or", "processors", "." ]
train
https://github.com/wcm-io/wcm-io-handler/blob/b0fc1c11a3ceb89efb73826dcfd480d6a00c19af/link/src/main/java/io/wcm/handler/link/LinkArgs.java#L211-L216
meraki-analytics/datapipelines-java
src/main/java/com/merakianalytics/datapipelines/SourceHandler.java
SourceHandler.getMany
public CloseableIterator<P> getMany(final Map<String, Object> query, final PipelineContext context) { """ Gets multiple data elements from the underlying {@link com.merakianalytics.datapipelines.sources.DataSource}, provides them to the appropriate {@link com.merakianalytics.datapipelines.SinkHandler}s, converts them and returns them @param query a query specifying the details of what data should fulfill this request @param context information about the context of the request such as what {@link com.merakianalytics.datapipelines.DataPipeline} called this method @return a {@link com.merakianalytics.datapipelines.iterators.CloseableIterator} of the request type if the query had a result, or null """ return getMany(query, context, false); }
java
public CloseableIterator<P> getMany(final Map<String, Object> query, final PipelineContext context) { return getMany(query, context, false); }
[ "public", "CloseableIterator", "<", "P", ">", "getMany", "(", "final", "Map", "<", "String", ",", "Object", ">", "query", ",", "final", "PipelineContext", "context", ")", "{", "return", "getMany", "(", "query", ",", "context", ",", "false", ")", ";", "}"...
Gets multiple data elements from the underlying {@link com.merakianalytics.datapipelines.sources.DataSource}, provides them to the appropriate {@link com.merakianalytics.datapipelines.SinkHandler}s, converts them and returns them @param query a query specifying the details of what data should fulfill this request @param context information about the context of the request such as what {@link com.merakianalytics.datapipelines.DataPipeline} called this method @return a {@link com.merakianalytics.datapipelines.iterators.CloseableIterator} of the request type if the query had a result, or null
[ "Gets", "multiple", "data", "elements", "from", "the", "underlying", "{", "@link", "com", ".", "merakianalytics", ".", "datapipelines", ".", "sources", ".", "DataSource", "}", "provides", "them", "to", "the", "appropriate", "{", "@link", "com", ".", "merakiana...
train
https://github.com/meraki-analytics/datapipelines-java/blob/376ff1e8e1f7c67f2f2a5521d2a66e91467e56b0/src/main/java/com/merakianalytics/datapipelines/SourceHandler.java#L147-L149
OpenLiberty/open-liberty
dev/com.ibm.ws.recoverylog/src/com/ibm/ws/recoverylog/spi/RecoveryDirectorImpl.java
RecoveryDirectorImpl.addTerminationRecord
private void addTerminationRecord(RecoveryAgent recoveryAgent, FailureScope failureScope) { """ <p> Internal method to record a termination request for the supplied RecoveryAgent and FailureScope combination. </p> <p> Just prior to requesting a RecoveryAgent to "terminateRecovery" of a FailureScope, this method is driven to record the request. When the client service is ready and invokes RecoveryDirector.terminateComplete, the removeTerminationRecord method is called to remove this record. </p> @param recoveryAgent The RecoveryAgent that is about to be directed to terminate recovery of a FailureScope. @param failureScope The FailureScope. """ if (tc.isEntryEnabled()) Tr.entry(tc, "addTerminationRecord", new Object[] { recoveryAgent, failureScope, this }); synchronized (_outstandingTerminationRecords) { // Extract the set of failure scopes that the corrisponding client service is currently // processing HashSet<FailureScope> failureScopeSet = _outstandingTerminationRecords.get(recoveryAgent); // If its not handled yet any then create an empty set to hold both this and future // failure scopes. if (failureScopeSet == null) { failureScopeSet = new HashSet<FailureScope>(); _outstandingTerminationRecords.put(recoveryAgent, failureScopeSet); } // Add this new failure scope to the set of those currently being processed by the // client service. failureScopeSet.add(failureScope); } if (tc.isEntryEnabled()) Tr.exit(tc, "addTerminationRecord"); }
java
private void addTerminationRecord(RecoveryAgent recoveryAgent, FailureScope failureScope) { if (tc.isEntryEnabled()) Tr.entry(tc, "addTerminationRecord", new Object[] { recoveryAgent, failureScope, this }); synchronized (_outstandingTerminationRecords) { // Extract the set of failure scopes that the corrisponding client service is currently // processing HashSet<FailureScope> failureScopeSet = _outstandingTerminationRecords.get(recoveryAgent); // If its not handled yet any then create an empty set to hold both this and future // failure scopes. if (failureScopeSet == null) { failureScopeSet = new HashSet<FailureScope>(); _outstandingTerminationRecords.put(recoveryAgent, failureScopeSet); } // Add this new failure scope to the set of those currently being processed by the // client service. failureScopeSet.add(failureScope); } if (tc.isEntryEnabled()) Tr.exit(tc, "addTerminationRecord"); }
[ "private", "void", "addTerminationRecord", "(", "RecoveryAgent", "recoveryAgent", ",", "FailureScope", "failureScope", ")", "{", "if", "(", "tc", ".", "isEntryEnabled", "(", ")", ")", "Tr", ".", "entry", "(", "tc", ",", "\"addTerminationRecord\"", ",", "new", ...
<p> Internal method to record a termination request for the supplied RecoveryAgent and FailureScope combination. </p> <p> Just prior to requesting a RecoveryAgent to "terminateRecovery" of a FailureScope, this method is driven to record the request. When the client service is ready and invokes RecoveryDirector.terminateComplete, the removeTerminationRecord method is called to remove this record. </p> @param recoveryAgent The RecoveryAgent that is about to be directed to terminate recovery of a FailureScope. @param failureScope The FailureScope.
[ "<p", ">", "Internal", "method", "to", "record", "a", "termination", "request", "for", "the", "supplied", "RecoveryAgent", "and", "FailureScope", "combination", ".", "<", "/", "p", ">" ]
train
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.recoverylog/src/com/ibm/ws/recoverylog/spi/RecoveryDirectorImpl.java#L881-L904
actorapp/actor-platform
actor-sdk/sdk-core-android/android-sdk/src/main/java/im/actor/sdk/util/images/ops/ImageScaling.java
ImageScaling.scaleFill
public static void scaleFill(Bitmap src, Bitmap dest, int clearColor) { """ Scaling src bitmap to fill dest bitmap with centering. Method keep aspect ratio. @param src source bitmap @param dest destination bitmap @param clearColor color for clearing dest before drawing """ float ratio = Math.max(dest.getWidth() / (float) src.getWidth(), dest.getHeight() / (float) src.getHeight()); int newW = (int) (src.getWidth() * ratio); int newH = (int) (src.getHeight() * ratio); int paddingTop = (dest.getHeight() - (int) (src.getHeight() * ratio)) / 2; int paddingLeft = (dest.getWidth() - (int) (src.getWidth() * ratio)) / 2; scale(src, dest, clearColor, 0, 0, src.getWidth(), src.getHeight(), paddingLeft, paddingTop, newW + paddingLeft, newH + paddingTop); }
java
public static void scaleFill(Bitmap src, Bitmap dest, int clearColor) { float ratio = Math.max(dest.getWidth() / (float) src.getWidth(), dest.getHeight() / (float) src.getHeight()); int newW = (int) (src.getWidth() * ratio); int newH = (int) (src.getHeight() * ratio); int paddingTop = (dest.getHeight() - (int) (src.getHeight() * ratio)) / 2; int paddingLeft = (dest.getWidth() - (int) (src.getWidth() * ratio)) / 2; scale(src, dest, clearColor, 0, 0, src.getWidth(), src.getHeight(), paddingLeft, paddingTop, newW + paddingLeft, newH + paddingTop); }
[ "public", "static", "void", "scaleFill", "(", "Bitmap", "src", ",", "Bitmap", "dest", ",", "int", "clearColor", ")", "{", "float", "ratio", "=", "Math", ".", "max", "(", "dest", ".", "getWidth", "(", ")", "/", "(", "float", ")", "src", ".", "getWidth...
Scaling src bitmap to fill dest bitmap with centering. Method keep aspect ratio. @param src source bitmap @param dest destination bitmap @param clearColor color for clearing dest before drawing
[ "Scaling", "src", "bitmap", "to", "fill", "dest", "bitmap", "with", "centering", ".", "Method", "keep", "aspect", "ratio", "." ]
train
https://github.com/actorapp/actor-platform/blob/5123c1584757c6eeea0ed2a0e7e043629871a0c6/actor-sdk/sdk-core-android/android-sdk/src/main/java/im/actor/sdk/util/images/ops/ImageScaling.java#L46-L56
protostuff/protostuff
protostuff-msgpack/src/main/java/io/protostuff/MsgpackIOUtil.java
MsgpackIOUtil.writeTo
public static <T> void writeTo(MessageBufferOutput out, T message, Schema<T> schema, boolean numeric) throws IOException { """ Serializes the {@code message} into an {@link MessageBufferOutput} using the given {@code schema}. """ MessagePacker packer = MessagePack.newDefaultPacker(out); try { writeTo(packer, message, schema, numeric); } finally { packer.flush(); } }
java
public static <T> void writeTo(MessageBufferOutput out, T message, Schema<T> schema, boolean numeric) throws IOException { MessagePacker packer = MessagePack.newDefaultPacker(out); try { writeTo(packer, message, schema, numeric); } finally { packer.flush(); } }
[ "public", "static", "<", "T", ">", "void", "writeTo", "(", "MessageBufferOutput", "out", ",", "T", "message", ",", "Schema", "<", "T", ">", "schema", ",", "boolean", "numeric", ")", "throws", "IOException", "{", "MessagePacker", "packer", "=", "MessagePack",...
Serializes the {@code message} into an {@link MessageBufferOutput} using the given {@code schema}.
[ "Serializes", "the", "{" ]
train
https://github.com/protostuff/protostuff/blob/af669cf089057d0ec83220266131ce411854af7b/protostuff-msgpack/src/main/java/io/protostuff/MsgpackIOUtil.java#L208-L222
googleads/googleads-java-lib
examples/adwords_axis/src/main/java/adwords/axis/v201809/advancedoperations/AddDynamicSearchAdsCampaign.java
AddDynamicSearchAdsCampaign.runExample
public static void runExample(AdWordsServicesInterface adWordsServices, AdWordsSession session) throws RemoteException { """ Runs the example. @param adWordsServices the services factory. @param session the session. @throws ApiException if the API request failed with one or more service errors. @throws RemoteException if the API request failed due to other errors. """ Budget budget = createBudget(adWordsServices, session); Campaign campaign = createCampaign(adWordsServices, session, budget); AdGroup adGroup = createAdGroup(adWordsServices, session, campaign); createExpandedDSA(adWordsServices, session, adGroup); addWebPageCriteria(adWordsServices, session, adGroup); }
java
public static void runExample(AdWordsServicesInterface adWordsServices, AdWordsSession session) throws RemoteException { Budget budget = createBudget(adWordsServices, session); Campaign campaign = createCampaign(adWordsServices, session, budget); AdGroup adGroup = createAdGroup(adWordsServices, session, campaign); createExpandedDSA(adWordsServices, session, adGroup); addWebPageCriteria(adWordsServices, session, adGroup); }
[ "public", "static", "void", "runExample", "(", "AdWordsServicesInterface", "adWordsServices", ",", "AdWordsSession", "session", ")", "throws", "RemoteException", "{", "Budget", "budget", "=", "createBudget", "(", "adWordsServices", ",", "session", ")", ";", "Campaign"...
Runs the example. @param adWordsServices the services factory. @param session the session. @throws ApiException if the API request failed with one or more service errors. @throws RemoteException if the API request failed due to other errors.
[ "Runs", "the", "example", "." ]
train
https://github.com/googleads/googleads-java-lib/blob/967957cc4f6076514e3a7926fe653e4f1f7cc9c9/examples/adwords_axis/src/main/java/adwords/axis/v201809/advancedoperations/AddDynamicSearchAdsCampaign.java#L142-L150
bwkimmel/java-util
src/main/java/ca/eandb/util/sql/DbUtil.java
DbUtil.getTypeName
public static String getTypeName(int type, int length, Connection con) throws SQLException { """ Gets the <code>String</code> denoting the specified SQL data type. @param type The data type to get the name of. Valid type values consist of the static fields of {@link java.sql.Types}. @param length The length to assign to data types for those types that require a length (e.g., <code>VARCHAR(n)</code>), or zero to indicate that no length is required. @param con The <code>Connection</code> for which to get the type name. @return The name of the type, or <code>null</code> if no such type exists. @throws SQLException If an error occurs while communicating with the database. @see java.sql.Types """ return getTypeName(type, length, con.getMetaData()); }
java
public static String getTypeName(int type, int length, Connection con) throws SQLException { return getTypeName(type, length, con.getMetaData()); }
[ "public", "static", "String", "getTypeName", "(", "int", "type", ",", "int", "length", ",", "Connection", "con", ")", "throws", "SQLException", "{", "return", "getTypeName", "(", "type", ",", "length", ",", "con", ".", "getMetaData", "(", ")", ")", ";", ...
Gets the <code>String</code> denoting the specified SQL data type. @param type The data type to get the name of. Valid type values consist of the static fields of {@link java.sql.Types}. @param length The length to assign to data types for those types that require a length (e.g., <code>VARCHAR(n)</code>), or zero to indicate that no length is required. @param con The <code>Connection</code> for which to get the type name. @return The name of the type, or <code>null</code> if no such type exists. @throws SQLException If an error occurs while communicating with the database. @see java.sql.Types
[ "Gets", "the", "<code", ">", "String<", "/", "code", ">", "denoting", "the", "specified", "SQL", "data", "type", "." ]
train
https://github.com/bwkimmel/java-util/blob/0c03664d42f0e6b111f64447f222aa73c2819e5c/src/main/java/ca/eandb/util/sql/DbUtil.java#L459-L461
lievendoclo/Valkyrie-RCP
valkyrie-rcp-core/src/main/java/org/valkyriercp/wizard/AbstractWizard.java
AbstractWizard.addPage
protected void addPage(String wizardConfigurationKey, WizardPage page) { """ Adds a new page to this wizard. The page is inserted at the end of the page list. @param wizardConfigurationKey the parent configuration key of the page, used for configuration, by default this wizard's id * @param page the new page """ pages.add(page); page.setWizard(this); if (autoConfigureChildPages) { String key = ((wizardConfigurationKey != null) ? wizardConfigurationKey + "." : "") + page.getId(); ValkyrieRepository.getInstance().getApplicationConfig().applicationObjectConfigurer().configure(page, key); } }
java
protected void addPage(String wizardConfigurationKey, WizardPage page) { pages.add(page); page.setWizard(this); if (autoConfigureChildPages) { String key = ((wizardConfigurationKey != null) ? wizardConfigurationKey + "." : "") + page.getId(); ValkyrieRepository.getInstance().getApplicationConfig().applicationObjectConfigurer().configure(page, key); } }
[ "protected", "void", "addPage", "(", "String", "wizardConfigurationKey", ",", "WizardPage", "page", ")", "{", "pages", ".", "add", "(", "page", ")", ";", "page", ".", "setWizard", "(", "this", ")", ";", "if", "(", "autoConfigureChildPages", ")", "{", "Stri...
Adds a new page to this wizard. The page is inserted at the end of the page list. @param wizardConfigurationKey the parent configuration key of the page, used for configuration, by default this wizard's id * @param page the new page
[ "Adds", "a", "new", "page", "to", "this", "wizard", ".", "The", "page", "is", "inserted", "at", "the", "end", "of", "the", "page", "list", "." ]
train
https://github.com/lievendoclo/Valkyrie-RCP/blob/6aad6e640b348cda8f3b0841f6e42025233f1eb8/valkyrie-rcp-core/src/main/java/org/valkyriercp/wizard/AbstractWizard.java#L176-L183
khuxtable/seaglass
src/main/java/com/seaglasslookandfeel/painter/TitlePaneMenuButtonPainter.java
TitlePaneMenuButtonPainter.paintEnabled
private void paintEnabled(Graphics2D g, JComponent c, int width, int height) { """ Paint the background enabled state. @param g the Graphics2D context to paint with. @param c the component. @param width the width of the component. @param height the height of the component. """ paintMenu(g, c, width, height, enabled); }
java
private void paintEnabled(Graphics2D g, JComponent c, int width, int height) { paintMenu(g, c, width, height, enabled); }
[ "private", "void", "paintEnabled", "(", "Graphics2D", "g", ",", "JComponent", "c", ",", "int", "width", ",", "int", "height", ")", "{", "paintMenu", "(", "g", ",", "c", ",", "width", ",", "height", ",", "enabled", ")", ";", "}" ]
Paint the background enabled state. @param g the Graphics2D context to paint with. @param c the component. @param width the width of the component. @param height the height of the component.
[ "Paint", "the", "background", "enabled", "state", "." ]
train
https://github.com/khuxtable/seaglass/blob/f25ecba622923d7b29b64cb7d6068dd8005989b3/src/main/java/com/seaglasslookandfeel/painter/TitlePaneMenuButtonPainter.java#L110-L112
eclipse/hawkbit
hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/utils/HawkbitCommonUtil.java
HawkbitCommonUtil.concatStrings
public static String concatStrings(final String delimiter, final String... texts) { """ Concatenate the given text all the string arguments with the given delimiter. @param delimiter the delimiter text to be used while concatenation. @param texts all these string values will be concatenated with the given delimiter. @return null in case no text arguments to be compared. just concatenation of all texts arguments if "delimiter" is null or empty. concatenation of all texts arguments with "delimiter" if it not null. """ final String delim = delimiter == null ? "" : delimiter; final StringBuilder conCatStrBldr = new StringBuilder(); if (null != texts) { for (final String text : texts) { conCatStrBldr.append(delim); conCatStrBldr.append(text); } } final String conCatedStr = conCatStrBldr.toString(); return delim.length() > 0 && conCatedStr.startsWith(delim) ? conCatedStr.substring(1) : conCatedStr; }
java
public static String concatStrings(final String delimiter, final String... texts) { final String delim = delimiter == null ? "" : delimiter; final StringBuilder conCatStrBldr = new StringBuilder(); if (null != texts) { for (final String text : texts) { conCatStrBldr.append(delim); conCatStrBldr.append(text); } } final String conCatedStr = conCatStrBldr.toString(); return delim.length() > 0 && conCatedStr.startsWith(delim) ? conCatedStr.substring(1) : conCatedStr; }
[ "public", "static", "String", "concatStrings", "(", "final", "String", "delimiter", ",", "final", "String", "...", "texts", ")", "{", "final", "String", "delim", "=", "delimiter", "==", "null", "?", "\"\"", ":", "delimiter", ";", "final", "StringBuilder", "c...
Concatenate the given text all the string arguments with the given delimiter. @param delimiter the delimiter text to be used while concatenation. @param texts all these string values will be concatenated with the given delimiter. @return null in case no text arguments to be compared. just concatenation of all texts arguments if "delimiter" is null or empty. concatenation of all texts arguments with "delimiter" if it not null.
[ "Concatenate", "the", "given", "text", "all", "the", "string", "arguments", "with", "the", "given", "delimiter", "." ]
train
https://github.com/eclipse/hawkbit/blob/9884452ad42f3b4827461606d8a9215c8625a7fe/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/utils/HawkbitCommonUtil.java#L111-L122
alkacon/opencms-core
src/org/opencms/file/CmsObject.java
CmsObject.hasPermissions
public boolean hasPermissions(CmsResource resource, CmsPermissionSet requiredPermissions) throws CmsException { """ Checks if the current user has required permissions to access a given resource.<p> @param resource the resource to check the permissions for @param requiredPermissions the set of permissions to check for @return <code>true</code> if the required permissions are satisfied @throws CmsException if something goes wrong """ return m_securityManager.hasPermissions( m_context, resource, requiredPermissions, true, CmsResourceFilter.ALL).isAllowed(); }
java
public boolean hasPermissions(CmsResource resource, CmsPermissionSet requiredPermissions) throws CmsException { return m_securityManager.hasPermissions( m_context, resource, requiredPermissions, true, CmsResourceFilter.ALL).isAllowed(); }
[ "public", "boolean", "hasPermissions", "(", "CmsResource", "resource", ",", "CmsPermissionSet", "requiredPermissions", ")", "throws", "CmsException", "{", "return", "m_securityManager", ".", "hasPermissions", "(", "m_context", ",", "resource", ",", "requiredPermissions", ...
Checks if the current user has required permissions to access a given resource.<p> @param resource the resource to check the permissions for @param requiredPermissions the set of permissions to check for @return <code>true</code> if the required permissions are satisfied @throws CmsException if something goes wrong
[ "Checks", "if", "the", "current", "user", "has", "required", "permissions", "to", "access", "a", "given", "resource", ".", "<p", ">" ]
train
https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/file/CmsObject.java#L1915-L1923
moparisthebest/beehive
beehive-netui-core/src/main/java/org/apache/beehive/netui/util/xml/DomUtils.java
DomUtils.getChildElementByName
public static Element getChildElementByName(Element parent, String name) { """ <p>Returns the first child element with the given name. Returns <code>null</code> if not found.</p> @param parent parent element @param name name of the child element @return child element """ NodeList children = parent.getChildNodes(); for(int i = 0; i < children.getLength(); i++) { Node node = children.item(i); if(node.getNodeType() == Node.ELEMENT_NODE) { Element element = (Element) node; if(element.getTagName().equals(name)) { return element; } } } return null; }
java
public static Element getChildElementByName(Element parent, String name) { NodeList children = parent.getChildNodes(); for(int i = 0; i < children.getLength(); i++) { Node node = children.item(i); if(node.getNodeType() == Node.ELEMENT_NODE) { Element element = (Element) node; if(element.getTagName().equals(name)) { return element; } } } return null; }
[ "public", "static", "Element", "getChildElementByName", "(", "Element", "parent", ",", "String", "name", ")", "{", "NodeList", "children", "=", "parent", ".", "getChildNodes", "(", ")", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<", "children", "....
<p>Returns the first child element with the given name. Returns <code>null</code> if not found.</p> @param parent parent element @param name name of the child element @return child element
[ "<p", ">", "Returns", "the", "first", "child", "element", "with", "the", "given", "name", ".", "Returns", "<code", ">", "null<", "/", "code", ">", "if", "not", "found", ".", "<", "/", "p", ">" ]
train
https://github.com/moparisthebest/beehive/blob/4246a0cc40ce3c05f1a02c2da2653ac622703d77/beehive-netui-core/src/main/java/org/apache/beehive/netui/util/xml/DomUtils.java#L46-L61
samskivert/samskivert
src/main/java/com/samskivert/util/Calendars.java
Calendars.in
public static Builder in (TimeZone zone, Locale locale) { """ Returns a fluent wrapper around a calendar for the specifed time zone and locale. """ return with(Calendar.getInstance(zone, locale)); }
java
public static Builder in (TimeZone zone, Locale locale) { return with(Calendar.getInstance(zone, locale)); }
[ "public", "static", "Builder", "in", "(", "TimeZone", "zone", ",", "Locale", "locale", ")", "{", "return", "with", "(", "Calendar", ".", "getInstance", "(", "zone", ",", "locale", ")", ")", ";", "}" ]
Returns a fluent wrapper around a calendar for the specifed time zone and locale.
[ "Returns", "a", "fluent", "wrapper", "around", "a", "calendar", "for", "the", "specifed", "time", "zone", "and", "locale", "." ]
train
https://github.com/samskivert/samskivert/blob/a64d9ef42b69819bdb2c66bddac6a64caef928b6/src/main/java/com/samskivert/util/Calendars.java#L233-L236
pressgang-ccms/PressGangCCMSBuilder
src/main/java/org/jboss/pressgang/ccms/contentspec/builder/structures/TopicErrorDatabase.java
TopicErrorDatabase.addTocError
public void addTocError(final BaseTopicWrapper<?> topic, final ErrorType errorType, final String error) { """ Add a error for a topic that was included in the TOC @param topic @param error """ addItem(topic, error, ErrorLevel.ERROR, errorType); }
java
public void addTocError(final BaseTopicWrapper<?> topic, final ErrorType errorType, final String error) { addItem(topic, error, ErrorLevel.ERROR, errorType); }
[ "public", "void", "addTocError", "(", "final", "BaseTopicWrapper", "<", "?", ">", "topic", ",", "final", "ErrorType", "errorType", ",", "final", "String", "error", ")", "{", "addItem", "(", "topic", ",", "error", ",", "ErrorLevel", ".", "ERROR", ",", "erro...
Add a error for a topic that was included in the TOC @param topic @param error
[ "Add", "a", "error", "for", "a", "topic", "that", "was", "included", "in", "the", "TOC" ]
train
https://github.com/pressgang-ccms/PressGangCCMSBuilder/blob/5436d36ba1b3c5baa246b270e5fc350e6778bce8/src/main/java/org/jboss/pressgang/ccms/contentspec/builder/structures/TopicErrorDatabase.java#L85-L87
alkacon/opencms-core
src/org/opencms/site/CmsSite.java
CmsSite.getServerPrefix
public String getServerPrefix(CmsObject cms, CmsResource resource) { """ Returns the server prefix for the given resource in this site, used to distinguish between secure (https) and non-secure (http) sites.<p> This is required since a resource may have an individual "secure" setting using the property {@link org.opencms.file.CmsPropertyDefinition#PROPERTY_SECURE}, which means this resource must be delivered only using a secure protocol.<p> The result will look like <code>http://site.enterprise.com:8080/</code> or <code>https://site.enterprise.com/</code>.<p> @param cms the current users OpenCms context @param resource the resource to use @return the server prefix for the given resource in this site @see #getServerPrefix(CmsObject, String) """ return getServerPrefix(cms, resource.getRootPath()); }
java
public String getServerPrefix(CmsObject cms, CmsResource resource) { return getServerPrefix(cms, resource.getRootPath()); }
[ "public", "String", "getServerPrefix", "(", "CmsObject", "cms", ",", "CmsResource", "resource", ")", "{", "return", "getServerPrefix", "(", "cms", ",", "resource", ".", "getRootPath", "(", ")", ")", ";", "}" ]
Returns the server prefix for the given resource in this site, used to distinguish between secure (https) and non-secure (http) sites.<p> This is required since a resource may have an individual "secure" setting using the property {@link org.opencms.file.CmsPropertyDefinition#PROPERTY_SECURE}, which means this resource must be delivered only using a secure protocol.<p> The result will look like <code>http://site.enterprise.com:8080/</code> or <code>https://site.enterprise.com/</code>.<p> @param cms the current users OpenCms context @param resource the resource to use @return the server prefix for the given resource in this site @see #getServerPrefix(CmsObject, String)
[ "Returns", "the", "server", "prefix", "for", "the", "given", "resource", "in", "this", "site", "used", "to", "distinguish", "between", "secure", "(", "https", ")", "and", "non", "-", "secure", "(", "http", ")", "sites", ".", "<p", ">" ]
train
https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/site/CmsSite.java#L491-L494
Azure/azure-sdk-for-java
policyinsights/resource-manager/v2018_04_04/src/main/java/com/microsoft/azure/management/policyinsights/v2018_04_04/implementation/PolicyEventsInner.java
PolicyEventsInner.listQueryResultsForSubscription
public PolicyEventsQueryResultsInner listQueryResultsForSubscription(String subscriptionId, QueryOptions queryOptions) { """ Queries policy events for the resources under the subscription. @param subscriptionId Microsoft Azure subscription ID. @param queryOptions Additional parameters for the operation @throws IllegalArgumentException thrown if parameters fail the validation @throws QueryFailureException thrown if the request is rejected by server @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent @return the PolicyEventsQueryResultsInner object if successful. """ return listQueryResultsForSubscriptionWithServiceResponseAsync(subscriptionId, queryOptions).toBlocking().single().body(); }
java
public PolicyEventsQueryResultsInner listQueryResultsForSubscription(String subscriptionId, QueryOptions queryOptions) { return listQueryResultsForSubscriptionWithServiceResponseAsync(subscriptionId, queryOptions).toBlocking().single().body(); }
[ "public", "PolicyEventsQueryResultsInner", "listQueryResultsForSubscription", "(", "String", "subscriptionId", ",", "QueryOptions", "queryOptions", ")", "{", "return", "listQueryResultsForSubscriptionWithServiceResponseAsync", "(", "subscriptionId", ",", "queryOptions", ")", ".",...
Queries policy events for the resources under the subscription. @param subscriptionId Microsoft Azure subscription ID. @param queryOptions Additional parameters for the operation @throws IllegalArgumentException thrown if parameters fail the validation @throws QueryFailureException thrown if the request is rejected by server @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent @return the PolicyEventsQueryResultsInner object if successful.
[ "Queries", "policy", "events", "for", "the", "resources", "under", "the", "subscription", "." ]
train
https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/policyinsights/resource-manager/v2018_04_04/src/main/java/com/microsoft/azure/management/policyinsights/v2018_04_04/implementation/PolicyEventsInner.java#L374-L376
sebastiangraf/perfidix
src/main/java/org/perfidix/element/BenchmarkExecutor.java
BenchmarkExecutor.invokeMethod
public static PerfidixMethodInvocationException invokeMethod(final Object obj, final Class<? extends Annotation> relatedAnno, final Method meth, final Object... args) { """ Method to invoke a reflective invokable method. @param obj on which the execution takes place @param relatedAnno related annotation for the execution @param meth to be executed @param args args for that method @return {@link PerfidixMethodInvocationException} if invocation fails, null otherwise. """ try { meth.invoke(obj, args); return null; } catch (final IllegalArgumentException e) { return new PerfidixMethodInvocationException(e, meth, relatedAnno); } catch (final IllegalAccessException e) { return new PerfidixMethodInvocationException(e, meth, relatedAnno); } catch (final InvocationTargetException e) { return new PerfidixMethodInvocationException(e.getCause(), meth, relatedAnno); } }
java
public static PerfidixMethodInvocationException invokeMethod(final Object obj, final Class<? extends Annotation> relatedAnno, final Method meth, final Object... args) { try { meth.invoke(obj, args); return null; } catch (final IllegalArgumentException e) { return new PerfidixMethodInvocationException(e, meth, relatedAnno); } catch (final IllegalAccessException e) { return new PerfidixMethodInvocationException(e, meth, relatedAnno); } catch (final InvocationTargetException e) { return new PerfidixMethodInvocationException(e.getCause(), meth, relatedAnno); } }
[ "public", "static", "PerfidixMethodInvocationException", "invokeMethod", "(", "final", "Object", "obj", ",", "final", "Class", "<", "?", "extends", "Annotation", ">", "relatedAnno", ",", "final", "Method", "meth", ",", "final", "Object", "...", "args", ")", "{",...
Method to invoke a reflective invokable method. @param obj on which the execution takes place @param relatedAnno related annotation for the execution @param meth to be executed @param args args for that method @return {@link PerfidixMethodInvocationException} if invocation fails, null otherwise.
[ "Method", "to", "invoke", "a", "reflective", "invokable", "method", "." ]
train
https://github.com/sebastiangraf/perfidix/blob/f13aa793b6a3055215ed4edbb946c1bb5d564886/src/main/java/org/perfidix/element/BenchmarkExecutor.java#L140-L151
zandero/settings
src/main/java/com/zandero/settings/Settings.java
Settings.getBool
public boolean getBool(String name) { """ Returns boolean flag @param name of flag @return true or false @throws IllegalArgumentException in case setting is not a boolean setting """ Object value = super.get(name); if (value instanceof Boolean) { return (Boolean) value; } if (value instanceof String) { String txt = (String)value; txt = txt.trim().toLowerCase(); if ("yes".equals(txt) || "y".equals(txt) || "1".equals(txt) || "true".equals(txt) || "t".equals(txt)) { return true; } if ("no".equals(txt) || "n".equals(txt) || "0".equals(txt) || "false".equals(txt) || "f".equals(txt)) { return false; } } if (value == null) { throw new IllegalArgumentException("Setting: '" + name + "', not found!"); } throw new IllegalArgumentException("Setting: '" + name + "', can't be converted to boolean: '" + value + "'!"); }
java
public boolean getBool(String name) { Object value = super.get(name); if (value instanceof Boolean) { return (Boolean) value; } if (value instanceof String) { String txt = (String)value; txt = txt.trim().toLowerCase(); if ("yes".equals(txt) || "y".equals(txt) || "1".equals(txt) || "true".equals(txt) || "t".equals(txt)) { return true; } if ("no".equals(txt) || "n".equals(txt) || "0".equals(txt) || "false".equals(txt) || "f".equals(txt)) { return false; } } if (value == null) { throw new IllegalArgumentException("Setting: '" + name + "', not found!"); } throw new IllegalArgumentException("Setting: '" + name + "', can't be converted to boolean: '" + value + "'!"); }
[ "public", "boolean", "getBool", "(", "String", "name", ")", "{", "Object", "value", "=", "super", ".", "get", "(", "name", ")", ";", "if", "(", "value", "instanceof", "Boolean", ")", "{", "return", "(", "Boolean", ")", "value", ";", "}", "if", "(", ...
Returns boolean flag @param name of flag @return true or false @throws IllegalArgumentException in case setting is not a boolean setting
[ "Returns", "boolean", "flag" ]
train
https://github.com/zandero/settings/blob/802b44f41bc75e7eb2761028db8c73b7e59620c7/src/main/java/com/zandero/settings/Settings.java#L126-L152
killme2008/Metamorphosis
metamorphosis-commons/src/main/java/com/taobao/metamorphosis/utils/ResourceUtils.java
ResourceUtils.getResourceAsFile
public static File getResourceAsFile(ClassLoader loader, String resource) throws IOException { """ Returns a resource on the classpath as a File object @param loader The classloader used to load the resource @param resource The resource to find @throws IOException If the resource cannot be found or read @return The resource """ return new File(getResourceURL(loader, resource).getFile()); }
java
public static File getResourceAsFile(ClassLoader loader, String resource) throws IOException { return new File(getResourceURL(loader, resource).getFile()); }
[ "public", "static", "File", "getResourceAsFile", "(", "ClassLoader", "loader", ",", "String", "resource", ")", "throws", "IOException", "{", "return", "new", "File", "(", "getResourceURL", "(", "loader", ",", "resource", ")", ".", "getFile", "(", ")", ")", "...
Returns a resource on the classpath as a File object @param loader The classloader used to load the resource @param resource The resource to find @throws IOException If the resource cannot be found or read @return The resource
[ "Returns", "a", "resource", "on", "the", "classpath", "as", "a", "File", "object" ]
train
https://github.com/killme2008/Metamorphosis/blob/1884b10620dbd640aaf85102243ca295703fbb4a/metamorphosis-commons/src/main/java/com/taobao/metamorphosis/utils/ResourceUtils.java#L245-L247
mikepenz/FastAdapter
library-core/src/main/java/com/mikepenz/fastadapter/items/AbstractItem.java
AbstractItem.bindView
@Override @CallSuper public void bindView(final VH holder, List<Object> payloads) { """ Binds the data of this item to the given holder @param holder @param payloads """ //set the selected state of this item. force this otherwise it may is missed when implementing an item holder.itemView.setSelected(isSelected()); }
java
@Override @CallSuper public void bindView(final VH holder, List<Object> payloads) { //set the selected state of this item. force this otherwise it may is missed when implementing an item holder.itemView.setSelected(isSelected()); }
[ "@", "Override", "@", "CallSuper", "public", "void", "bindView", "(", "final", "VH", "holder", ",", "List", "<", "Object", ">", "payloads", ")", "{", "//set the selected state of this item. force this otherwise it may is missed when implementing an item", "holder", ".", "...
Binds the data of this item to the given holder @param holder @param payloads
[ "Binds", "the", "data", "of", "this", "item", "to", "the", "given", "holder" ]
train
https://github.com/mikepenz/FastAdapter/blob/3b2412abe001ba58422e0125846b704d4dba4ae9/library-core/src/main/java/com/mikepenz/fastadapter/items/AbstractItem.java#L189-L194
VoltDB/voltdb
third_party/java/src/org/apache/commons_voltpatches/cli/HelpFormatter.java
HelpFormatter.printUsage
public void printUsage(PrintWriter pw, int width, String cmdLineSyntax) { """ Print the cmdLineSyntax to the specified writer, using the specified width. @param pw The printWriter to write the help to @param width The number of characters per line for the usage statement. @param cmdLineSyntax The usage statement. """ int argPos = cmdLineSyntax.indexOf(' ') + 1; printWrapped(pw, width, getSyntaxPrefix().length() + argPos, getSyntaxPrefix() + cmdLineSyntax); }
java
public void printUsage(PrintWriter pw, int width, String cmdLineSyntax) { int argPos = cmdLineSyntax.indexOf(' ') + 1; printWrapped(pw, width, getSyntaxPrefix().length() + argPos, getSyntaxPrefix() + cmdLineSyntax); }
[ "public", "void", "printUsage", "(", "PrintWriter", "pw", ",", "int", "width", ",", "String", "cmdLineSyntax", ")", "{", "int", "argPos", "=", "cmdLineSyntax", ".", "indexOf", "(", "'", "'", ")", "+", "1", ";", "printWrapped", "(", "pw", ",", "width", ...
Print the cmdLineSyntax to the specified writer, using the specified width. @param pw The printWriter to write the help to @param width The number of characters per line for the usage statement. @param cmdLineSyntax The usage statement.
[ "Print", "the", "cmdLineSyntax", "to", "the", "specified", "writer", "using", "the", "specified", "width", "." ]
train
https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/third_party/java/src/org/apache/commons_voltpatches/cli/HelpFormatter.java#L719-L724
kuali/ojb-1.0.4
src/java/org/apache/ojb/broker/accesslayer/StatementManager.java
StatementManager.bindProcedure
private void bindProcedure(PreparedStatement stmt, ClassDescriptor cld, Object obj, ProcedureDescriptor proc) throws SQLException { """ Bind a prepared statment that represents a call to a procedure or user-defined function. @param stmt the statement to bind. @param cld the class descriptor of the object that triggered the invocation of the procedure or user-defined function. @param obj the object that triggered the invocation of the procedure or user-defined function. @param proc the procedure descriptor that provides information about the arguments that shoudl be passed to the procedure or user-defined function """ int valueSub = 0; // Figure out if we are using a callable statement. If we are, then we // will need to register one or more output parameters. CallableStatement callable = null; try { callable = (CallableStatement) stmt; } catch(Exception e) { m_log.error("Error while bind values for class '" + (cld != null ? cld.getClassNameOfObject() : null) + "', using stored procedure: "+ proc, e); if(e instanceof SQLException) { throw (SQLException) e; } else { throw new PersistenceBrokerException("Unexpected error while bind values for class '" + (cld != null ? cld.getClassNameOfObject() : null) + "', using stored procedure: "+ proc); } } // If we have a return value, then register it. if ((proc.hasReturnValue()) && (callable != null)) { int jdbcType = proc.getReturnValueFieldRef().getJdbcType().getType(); m_platform.setNullForStatement(stmt, valueSub + 1, jdbcType); callable.registerOutParameter(valueSub + 1, jdbcType); valueSub++; } // Process all of the arguments. Iterator iterator = proc.getArguments().iterator(); while (iterator.hasNext()) { ArgumentDescriptor arg = (ArgumentDescriptor) iterator.next(); Object val = arg.getValue(obj); int jdbcType = arg.getJdbcType(); setObjectForStatement(stmt, valueSub + 1, val, jdbcType); if ((arg.getIsReturnedByProcedure()) && (callable != null)) { callable.registerOutParameter(valueSub + 1, jdbcType); } valueSub++; } }
java
private void bindProcedure(PreparedStatement stmt, ClassDescriptor cld, Object obj, ProcedureDescriptor proc) throws SQLException { int valueSub = 0; // Figure out if we are using a callable statement. If we are, then we // will need to register one or more output parameters. CallableStatement callable = null; try { callable = (CallableStatement) stmt; } catch(Exception e) { m_log.error("Error while bind values for class '" + (cld != null ? cld.getClassNameOfObject() : null) + "', using stored procedure: "+ proc, e); if(e instanceof SQLException) { throw (SQLException) e; } else { throw new PersistenceBrokerException("Unexpected error while bind values for class '" + (cld != null ? cld.getClassNameOfObject() : null) + "', using stored procedure: "+ proc); } } // If we have a return value, then register it. if ((proc.hasReturnValue()) && (callable != null)) { int jdbcType = proc.getReturnValueFieldRef().getJdbcType().getType(); m_platform.setNullForStatement(stmt, valueSub + 1, jdbcType); callable.registerOutParameter(valueSub + 1, jdbcType); valueSub++; } // Process all of the arguments. Iterator iterator = proc.getArguments().iterator(); while (iterator.hasNext()) { ArgumentDescriptor arg = (ArgumentDescriptor) iterator.next(); Object val = arg.getValue(obj); int jdbcType = arg.getJdbcType(); setObjectForStatement(stmt, valueSub + 1, val, jdbcType); if ((arg.getIsReturnedByProcedure()) && (callable != null)) { callable.registerOutParameter(valueSub + 1, jdbcType); } valueSub++; } }
[ "private", "void", "bindProcedure", "(", "PreparedStatement", "stmt", ",", "ClassDescriptor", "cld", ",", "Object", "obj", ",", "ProcedureDescriptor", "proc", ")", "throws", "SQLException", "{", "int", "valueSub", "=", "0", ";", "// Figure out if we are using a callab...
Bind a prepared statment that represents a call to a procedure or user-defined function. @param stmt the statement to bind. @param cld the class descriptor of the object that triggered the invocation of the procedure or user-defined function. @param obj the object that triggered the invocation of the procedure or user-defined function. @param proc the procedure descriptor that provides information about the arguments that shoudl be passed to the procedure or user-defined function
[ "Bind", "a", "prepared", "statment", "that", "represents", "a", "call", "to", "a", "procedure", "or", "user", "-", "defined", "function", "." ]
train
https://github.com/kuali/ojb-1.0.4/blob/9a544372f67ce965f662cdc71609dd03683c8f04/src/java/org/apache/ojb/broker/accesslayer/StatementManager.java#L704-L754
undertow-io/undertow
core/src/main/java/io/undertow/websockets/core/WebSockets.java
WebSockets.sendPong
public static void sendPong(final PooledByteBuffer pooledData, final WebSocketChannel wsChannel, final WebSocketCallback<Void> callback) { """ Sends a complete pong message, invoking the callback when complete Automatically frees the pooled byte buffer when done. @param pooledData The data to send, it will be freed when done @param wsChannel The web socket channel @param callback The callback to invoke on completion """ sendInternal(pooledData, WebSocketFrameType.PONG, wsChannel, callback, null, -1); }
java
public static void sendPong(final PooledByteBuffer pooledData, final WebSocketChannel wsChannel, final WebSocketCallback<Void> callback) { sendInternal(pooledData, WebSocketFrameType.PONG, wsChannel, callback, null, -1); }
[ "public", "static", "void", "sendPong", "(", "final", "PooledByteBuffer", "pooledData", ",", "final", "WebSocketChannel", "wsChannel", ",", "final", "WebSocketCallback", "<", "Void", ">", "callback", ")", "{", "sendInternal", "(", "pooledData", ",", "WebSocketFrameT...
Sends a complete pong message, invoking the callback when complete Automatically frees the pooled byte buffer when done. @param pooledData The data to send, it will be freed when done @param wsChannel The web socket channel @param callback The callback to invoke on completion
[ "Sends", "a", "complete", "pong", "message", "invoking", "the", "callback", "when", "complete", "Automatically", "frees", "the", "pooled", "byte", "buffer", "when", "done", "." ]
train
https://github.com/undertow-io/undertow/blob/87de0b856a7a4ba8faf5b659537b9af07b763263/core/src/main/java/io/undertow/websockets/core/WebSockets.java#L507-L509
OpenLiberty/open-liberty
dev/com.ibm.ws.repository.liberty/src/com/ibm/ws/repository/connections/liberty/MainRepository.java
MainRepository.checkHttpResponseCodeValid
private static void checkHttpResponseCodeValid(URLConnection connection) throws RepositoryHttpException, IOException { """ Checks for a valid response code and throws and exception with the response code if an error @param connection @throws RepositoryHttpException @throws IOException """ // if HTTP URL not File URL if (connection instanceof HttpURLConnection) { HttpURLConnection conn = (HttpURLConnection) connection; conn.setRequestMethod("GET"); int respCode = conn.getResponseCode(); if (respCode < 200 || respCode >= 300) { throw new RepositoryHttpException("HTTP connection returned error code " + respCode, respCode, null); } } }
java
private static void checkHttpResponseCodeValid(URLConnection connection) throws RepositoryHttpException, IOException { // if HTTP URL not File URL if (connection instanceof HttpURLConnection) { HttpURLConnection conn = (HttpURLConnection) connection; conn.setRequestMethod("GET"); int respCode = conn.getResponseCode(); if (respCode < 200 || respCode >= 300) { throw new RepositoryHttpException("HTTP connection returned error code " + respCode, respCode, null); } } }
[ "private", "static", "void", "checkHttpResponseCodeValid", "(", "URLConnection", "connection", ")", "throws", "RepositoryHttpException", ",", "IOException", "{", "// if HTTP URL not File URL", "if", "(", "connection", "instanceof", "HttpURLConnection", ")", "{", "HttpURLCon...
Checks for a valid response code and throws and exception with the response code if an error @param connection @throws RepositoryHttpException @throws IOException
[ "Checks", "for", "a", "valid", "response", "code", "and", "throws", "and", "exception", "with", "the", "response", "code", "if", "an", "error" ]
train
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.repository.liberty/src/com/ibm/ws/repository/connections/liberty/MainRepository.java#L263-L273
landawn/AbacusUtil
src/com/landawn/abacus/util/Fn.java
Fn.sc
@Beta public static <T, U> BiConsumer<T, U> sc(final Object mutex, final BiConsumer<T, U> biConsumer) { """ Synchronized {@code BiConsumer} @param mutex to synchronized on @param biConsumer @return """ N.checkArgNotNull(mutex, "mutex"); N.checkArgNotNull(biConsumer, "biConsumer"); return new BiConsumer<T, U>() { @Override public void accept(T t, U u) { synchronized (mutex) { biConsumer.accept(t, u); } } }; }
java
@Beta public static <T, U> BiConsumer<T, U> sc(final Object mutex, final BiConsumer<T, U> biConsumer) { N.checkArgNotNull(mutex, "mutex"); N.checkArgNotNull(biConsumer, "biConsumer"); return new BiConsumer<T, U>() { @Override public void accept(T t, U u) { synchronized (mutex) { biConsumer.accept(t, u); } } }; }
[ "@", "Beta", "public", "static", "<", "T", ",", "U", ">", "BiConsumer", "<", "T", ",", "U", ">", "sc", "(", "final", "Object", "mutex", ",", "final", "BiConsumer", "<", "T", ",", "U", ">", "biConsumer", ")", "{", "N", ".", "checkArgNotNull", "(", ...
Synchronized {@code BiConsumer} @param mutex to synchronized on @param biConsumer @return
[ "Synchronized", "{", "@code", "BiConsumer", "}" ]
train
https://github.com/landawn/AbacusUtil/blob/544b7720175d15e9329f83dd22a8cc5fa4515e12/src/com/landawn/abacus/util/Fn.java#L2886-L2899
OpenLiberty/open-liberty
dev/com.ibm.ws.transaction.cdi/src/com/ibm/tx/jta/cdi/interceptors/RequiresNew.java
RequiresNew.requiresNew
@AroundInvoke public Object requiresNew(final InvocationContext context) throws Exception { """ <p>If called outside a transaction context, the interceptor must begin a new JTA transaction, the managed bean method execution must then continue inside this transaction context, and the transaction must be completed by the interceptor.</p> <p>If called inside a transaction context, the current transaction context must be suspended, a new JTA transaction will begin, the managed bean method execution must then continue inside this transaction context, the transaction must be completed, and the previously suspended transaction must be resumed.</p> """ return runUnderUOWManagingEnablement(UOWSynchronizationRegistry.UOW_TYPE_GLOBAL_TRANSACTION, false, context, "REQUIRES_NEW"); }
java
@AroundInvoke public Object requiresNew(final InvocationContext context) throws Exception { return runUnderUOWManagingEnablement(UOWSynchronizationRegistry.UOW_TYPE_GLOBAL_TRANSACTION, false, context, "REQUIRES_NEW"); }
[ "@", "AroundInvoke", "public", "Object", "requiresNew", "(", "final", "InvocationContext", "context", ")", "throws", "Exception", "{", "return", "runUnderUOWManagingEnablement", "(", "UOWSynchronizationRegistry", ".", "UOW_TYPE_GLOBAL_TRANSACTION", ",", "false", ",", "con...
<p>If called outside a transaction context, the interceptor must begin a new JTA transaction, the managed bean method execution must then continue inside this transaction context, and the transaction must be completed by the interceptor.</p> <p>If called inside a transaction context, the current transaction context must be suspended, a new JTA transaction will begin, the managed bean method execution must then continue inside this transaction context, the transaction must be completed, and the previously suspended transaction must be resumed.</p>
[ "<p", ">", "If", "called", "outside", "a", "transaction", "context", "the", "interceptor", "must", "begin", "a", "new", "JTA", "transaction", "the", "managed", "bean", "method", "execution", "must", "then", "continue", "inside", "this", "transaction", "context",...
train
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.transaction.cdi/src/com/ibm/tx/jta/cdi/interceptors/RequiresNew.java#L39-L44
google/j2objc
xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xalan/templates/ElemLiteralResult.java
ElemLiteralResult.getLiteralResultAttributeNS
public AVT getLiteralResultAttributeNS(String namespaceURI, String localName) { """ Get a literal result attribute by name. @param namespaceURI Namespace URI of attribute node to get @param localName Local part of qualified name of attribute node to get @return literal result attribute (AVT) """ if (null != m_avts) { int nAttrs = m_avts.size(); for (int i = (nAttrs - 1); i >= 0; i--) { AVT avt = (AVT) m_avts.get(i); if (avt.getName().equals(localName) && avt.getURI().equals(namespaceURI)) { return avt; } } // end for } return null; }
java
public AVT getLiteralResultAttributeNS(String namespaceURI, String localName) { if (null != m_avts) { int nAttrs = m_avts.size(); for (int i = (nAttrs - 1); i >= 0; i--) { AVT avt = (AVT) m_avts.get(i); if (avt.getName().equals(localName) && avt.getURI().equals(namespaceURI)) { return avt; } } // end for } return null; }
[ "public", "AVT", "getLiteralResultAttributeNS", "(", "String", "namespaceURI", ",", "String", "localName", ")", "{", "if", "(", "null", "!=", "m_avts", ")", "{", "int", "nAttrs", "=", "m_avts", ".", "size", "(", ")", ";", "for", "(", "int", "i", "=", "...
Get a literal result attribute by name. @param namespaceURI Namespace URI of attribute node to get @param localName Local part of qualified name of attribute node to get @return literal result attribute (AVT)
[ "Get", "a", "literal", "result", "attribute", "by", "name", "." ]
train
https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xalan/templates/ElemLiteralResult.java#L190-L210
wcm-io/wcm-io-sling
commons/src/main/java/io/wcm/sling/commons/request/RequestParam.java
RequestParam.getFloat
public static float getFloat(@NotNull ServletRequest request, @NotNull String param, float defaultValue) { """ Returns a request parameter as float. @param request Request. @param param Parameter name. @param defaultValue Default value. @return Parameter value or default value if it does not exist or is not a number. """ String value = request.getParameter(param); return NumberUtils.toFloat(value, defaultValue); }
java
public static float getFloat(@NotNull ServletRequest request, @NotNull String param, float defaultValue) { String value = request.getParameter(param); return NumberUtils.toFloat(value, defaultValue); }
[ "public", "static", "float", "getFloat", "(", "@", "NotNull", "ServletRequest", "request", ",", "@", "NotNull", "String", "param", ",", "float", "defaultValue", ")", "{", "String", "value", "=", "request", ".", "getParameter", "(", "param", ")", ";", "return...
Returns a request parameter as float. @param request Request. @param param Parameter name. @param defaultValue Default value. @return Parameter value or default value if it does not exist or is not a number.
[ "Returns", "a", "request", "parameter", "as", "float", "." ]
train
https://github.com/wcm-io/wcm-io-sling/blob/90adbe432469378794b5695c72e9cdfa2b7d36f1/commons/src/main/java/io/wcm/sling/commons/request/RequestParam.java#L200-L203
UrielCh/ovh-java-sdk
ovh-java-sdk-emailmxplan/src/main/java/net/minidev/ovh/api/ApiOvhEmailmxplan.java
ApiOvhEmailmxplan.service_externalContact_externalEmailAddress_DELETE
public OvhTask service_externalContact_externalEmailAddress_DELETE(String service, String externalEmailAddress) throws IOException { """ delete external contact REST: DELETE /email/mxplan/{service}/externalContact/{externalEmailAddress} @param service [required] The internal name of your mxplan organization @param externalEmailAddress [required] Contact email API beta """ String qPath = "/email/mxplan/{service}/externalContact/{externalEmailAddress}"; StringBuilder sb = path(qPath, service, externalEmailAddress); String resp = exec(qPath, "DELETE", sb.toString(), null); return convertTo(resp, OvhTask.class); }
java
public OvhTask service_externalContact_externalEmailAddress_DELETE(String service, String externalEmailAddress) throws IOException { String qPath = "/email/mxplan/{service}/externalContact/{externalEmailAddress}"; StringBuilder sb = path(qPath, service, externalEmailAddress); String resp = exec(qPath, "DELETE", sb.toString(), null); return convertTo(resp, OvhTask.class); }
[ "public", "OvhTask", "service_externalContact_externalEmailAddress_DELETE", "(", "String", "service", ",", "String", "externalEmailAddress", ")", "throws", "IOException", "{", "String", "qPath", "=", "\"/email/mxplan/{service}/externalContact/{externalEmailAddress}\"", ";", "Stri...
delete external contact REST: DELETE /email/mxplan/{service}/externalContact/{externalEmailAddress} @param service [required] The internal name of your mxplan organization @param externalEmailAddress [required] Contact email API beta
[ "delete", "external", "contact" ]
train
https://github.com/UrielCh/ovh-java-sdk/blob/6d531a40e56e09701943e334c25f90f640c55701/ovh-java-sdk-emailmxplan/src/main/java/net/minidev/ovh/api/ApiOvhEmailmxplan.java#L550-L555
tvesalainen/util
util/src/main/java/org/vesalainen/util/CollectionHelp.java
CollectionHelp.setFormat
public static final void setFormat(String format, Locale locale) { """ Set Format string and locale for calling thread. List items are formatted using these. It is good practice to call removeFormat after use. @param locale @see #removeFormat() @see java.lang.String#format(java.util.Locale, java.lang.String, java.lang.Object...) """ threadFormat.set(format); threadLocale.set(locale); }
java
public static final void setFormat(String format, Locale locale) { threadFormat.set(format); threadLocale.set(locale); }
[ "public", "static", "final", "void", "setFormat", "(", "String", "format", ",", "Locale", "locale", ")", "{", "threadFormat", ".", "set", "(", "format", ")", ";", "threadLocale", ".", "set", "(", "locale", ")", ";", "}" ]
Set Format string and locale for calling thread. List items are formatted using these. It is good practice to call removeFormat after use. @param locale @see #removeFormat() @see java.lang.String#format(java.util.Locale, java.lang.String, java.lang.Object...)
[ "Set", "Format", "string", "and", "locale", "for", "calling", "thread", ".", "List", "items", "are", "formatted", "using", "these", ".", "It", "is", "good", "practice", "to", "call", "removeFormat", "after", "use", "." ]
train
https://github.com/tvesalainen/util/blob/bba7a44689f638ffabc8be40a75bdc9a33676433/util/src/main/java/org/vesalainen/util/CollectionHelp.java#L98-L102
lessthanoptimal/BoofCV
main/boofcv-ip/src/main/java/boofcv/alg/enhance/EnhanceImageOps.java
EnhanceImageOps.sharpen4
public static void sharpen4(GrayU8 input , GrayU8 output ) { """ Applies a Laplacian-4 based sharpen filter to the image. @param input Input image. @param output Output image. """ InputSanityCheck.checkSameShape(input, output); if( BoofConcurrency.USE_CONCURRENT ) { ImplEnhanceFilter_MT.sharpenInner4(input,output,0,255); ImplEnhanceFilter_MT.sharpenBorder4(input,output,0,255); } else { ImplEnhanceFilter.sharpenInner4(input,output,0,255); ImplEnhanceFilter.sharpenBorder4(input,output,0,255); } }
java
public static void sharpen4(GrayU8 input , GrayU8 output ) { InputSanityCheck.checkSameShape(input, output); if( BoofConcurrency.USE_CONCURRENT ) { ImplEnhanceFilter_MT.sharpenInner4(input,output,0,255); ImplEnhanceFilter_MT.sharpenBorder4(input,output,0,255); } else { ImplEnhanceFilter.sharpenInner4(input,output,0,255); ImplEnhanceFilter.sharpenBorder4(input,output,0,255); } }
[ "public", "static", "void", "sharpen4", "(", "GrayU8", "input", ",", "GrayU8", "output", ")", "{", "InputSanityCheck", ".", "checkSameShape", "(", "input", ",", "output", ")", ";", "if", "(", "BoofConcurrency", ".", "USE_CONCURRENT", ")", "{", "ImplEnhanceFilt...
Applies a Laplacian-4 based sharpen filter to the image. @param input Input image. @param output Output image.
[ "Applies", "a", "Laplacian", "-", "4", "based", "sharpen", "filter", "to", "the", "image", "." ]
train
https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-ip/src/main/java/boofcv/alg/enhance/EnhanceImageOps.java#L307-L317
structurizr/java
structurizr-core/src/com/structurizr/model/Person.java
Person.interactsWith
public Relationship interactsWith(Person destination, String description, String technology, InteractionStyle interactionStyle) { """ Adds an interaction between this person and another. @param destination the Person being interacted with @param description a description of the interaction @param technology the technology of the interaction (e.g. Telephone) @param interactionStyle the interaction style (e.g. Synchronous or Asynchronous) @return the resulting Relatioship """ return getModel().addRelationship(this, destination, description, technology, interactionStyle); }
java
public Relationship interactsWith(Person destination, String description, String technology, InteractionStyle interactionStyle) { return getModel().addRelationship(this, destination, description, technology, interactionStyle); }
[ "public", "Relationship", "interactsWith", "(", "Person", "destination", ",", "String", "description", ",", "String", "technology", ",", "InteractionStyle", "interactionStyle", ")", "{", "return", "getModel", "(", ")", ".", "addRelationship", "(", "this", ",", "de...
Adds an interaction between this person and another. @param destination the Person being interacted with @param description a description of the interaction @param technology the technology of the interaction (e.g. Telephone) @param interactionStyle the interaction style (e.g. Synchronous or Asynchronous) @return the resulting Relatioship
[ "Adds", "an", "interaction", "between", "this", "person", "and", "another", "." ]
train
https://github.com/structurizr/java/blob/4b204f077877a24bcac363f5ecf0e129a0f9f4c5/structurizr-core/src/com/structurizr/model/Person.java#L100-L102
taimos/dvalin
interconnect/model/src/main/java/de/taimos/dvalin/interconnect/model/InterconnectMapper.java
InterconnectMapper.fromJson
public static <T extends InterconnectObject> T fromJson(String data, Class<T> clazz) throws IOException { """ Creates an object from the given JSON data. @param data the JSON data @param clazz the class object for the content of the JSON data @param <T> the type of the class object extending {@link InterconnectObject} @return the object contained in the given JSON data @throws JsonParseException if a the JSON data could not be parsed @throws JsonMappingException if the mapping of the JSON data to the IVO failed @throws IOException if an I/O related problem occurred """ return InterconnectMapper.mapper.readValue(data, clazz); }
java
public static <T extends InterconnectObject> T fromJson(String data, Class<T> clazz) throws IOException { return InterconnectMapper.mapper.readValue(data, clazz); }
[ "public", "static", "<", "T", "extends", "InterconnectObject", ">", "T", "fromJson", "(", "String", "data", ",", "Class", "<", "T", ">", "clazz", ")", "throws", "IOException", "{", "return", "InterconnectMapper", ".", "mapper", ".", "readValue", "(", "data",...
Creates an object from the given JSON data. @param data the JSON data @param clazz the class object for the content of the JSON data @param <T> the type of the class object extending {@link InterconnectObject} @return the object contained in the given JSON data @throws JsonParseException if a the JSON data could not be parsed @throws JsonMappingException if the mapping of the JSON data to the IVO failed @throws IOException if an I/O related problem occurred
[ "Creates", "an", "object", "from", "the", "given", "JSON", "data", "." ]
train
https://github.com/taimos/dvalin/blob/ff8f1bf594e43d7e8ca8de0b4da9f923b66a1a47/interconnect/model/src/main/java/de/taimos/dvalin/interconnect/model/InterconnectMapper.java#L77-L79
pushbit/sprockets
src/main/java/net/sf/sprockets/sql/Statements.java
Statements.setInts
public static PreparedStatement setInts(int index, PreparedStatement stmt, int... params) throws SQLException { """ Set the statement parameters, starting at the index, in the order of the params. @since 3.0.0 """ return set(index, stmt, params, null, null); }
java
public static PreparedStatement setInts(int index, PreparedStatement stmt, int... params) throws SQLException { return set(index, stmt, params, null, null); }
[ "public", "static", "PreparedStatement", "setInts", "(", "int", "index", ",", "PreparedStatement", "stmt", ",", "int", "...", "params", ")", "throws", "SQLException", "{", "return", "set", "(", "index", ",", "stmt", ",", "params", ",", "null", ",", "null", ...
Set the statement parameters, starting at the index, in the order of the params. @since 3.0.0
[ "Set", "the", "statement", "parameters", "starting", "at", "the", "index", "in", "the", "order", "of", "the", "params", "." ]
train
https://github.com/pushbit/sprockets/blob/5d967317cbb2374c69d33271d3c7b7311e1ea4ac/src/main/java/net/sf/sprockets/sql/Statements.java#L60-L63
gocd/gocd
server/src/main/java/com/thoughtworks/go/server/service/ScheduleService.java
ScheduleService.isStageActive
private boolean isStageActive(Pipeline pipeline, StageConfig nextStage) { """ this method checks if specified stage is active in all pipelines """ return stageDao.isStageActive(pipeline.getName(), CaseInsensitiveString.str(nextStage.name())); }
java
private boolean isStageActive(Pipeline pipeline, StageConfig nextStage) { return stageDao.isStageActive(pipeline.getName(), CaseInsensitiveString.str(nextStage.name())); }
[ "private", "boolean", "isStageActive", "(", "Pipeline", "pipeline", ",", "StageConfig", "nextStage", ")", "{", "return", "stageDao", ".", "isStageActive", "(", "pipeline", ".", "getName", "(", ")", ",", "CaseInsensitiveString", ".", "str", "(", "nextStage", ".",...
this method checks if specified stage is active in all pipelines
[ "this", "method", "checks", "if", "specified", "stage", "is", "active", "in", "all", "pipelines" ]
train
https://github.com/gocd/gocd/blob/59a8480e23d6c06de39127635108dff57603cb71/server/src/main/java/com/thoughtworks/go/server/service/ScheduleService.java#L403-L405
wildfly/wildfly-core
controller/src/main/java/org/jboss/as/controller/ModelControllerImpl.java
ModelControllerImpl.executeReadOnlyOperation
@SuppressWarnings("deprecation") protected ModelNode executeReadOnlyOperation(final ModelNode operation, final OperationMessageHandler handler, final OperationTransactionControl control, final OperationStepHandler prepareStep, final int operationId) { """ Executes an operation on the controller latching onto an existing transaction @param operation the operation @param handler the handler @param control the transaction control @param prepareStep the prepare step to be executed before any other steps @param operationId the id of the current transaction @return the result of the operation """ final AbstractOperationContext delegateContext = getDelegateContext(operationId); CurrentOperationIdHolder.setCurrentOperationID(operationId); try { return executeReadOnlyOperation(operation, delegateContext.getManagementModel(), control, prepareStep, delegateContext); } finally { CurrentOperationIdHolder.setCurrentOperationID(null); } }
java
@SuppressWarnings("deprecation") protected ModelNode executeReadOnlyOperation(final ModelNode operation, final OperationMessageHandler handler, final OperationTransactionControl control, final OperationStepHandler prepareStep, final int operationId) { final AbstractOperationContext delegateContext = getDelegateContext(operationId); CurrentOperationIdHolder.setCurrentOperationID(operationId); try { return executeReadOnlyOperation(operation, delegateContext.getManagementModel(), control, prepareStep, delegateContext); } finally { CurrentOperationIdHolder.setCurrentOperationID(null); } }
[ "@", "SuppressWarnings", "(", "\"deprecation\"", ")", "protected", "ModelNode", "executeReadOnlyOperation", "(", "final", "ModelNode", "operation", ",", "final", "OperationMessageHandler", "handler", ",", "final", "OperationTransactionControl", "control", ",", "final", "O...
Executes an operation on the controller latching onto an existing transaction @param operation the operation @param handler the handler @param control the transaction control @param prepareStep the prepare step to be executed before any other steps @param operationId the id of the current transaction @return the result of the operation
[ "Executes", "an", "operation", "on", "the", "controller", "latching", "onto", "an", "existing", "transaction" ]
train
https://github.com/wildfly/wildfly-core/blob/cfaf0479dcbb2d320a44c5374b93b944ec39fade/controller/src/main/java/org/jboss/as/controller/ModelControllerImpl.java#L271-L280
h2oai/h2o-3
h2o-core/src/main/java/water/H2O.java
H2O.startLocalNode
private static void startLocalNode() { """ Initializes the local node and the local cloud with itself as the only member. """ // Figure self out; this is surprisingly hard NetworkInit.initializeNetworkSockets(); // Do not forget to put SELF into the static configuration (to simulate proper multicast behavior) if ( !ARGS.client && H2O.isFlatfileEnabled() && !H2O.isNodeInFlatfile(SELF)) { Log.warn("Flatfile configuration does not include self: " + SELF + ", but contains " + H2O.getFlatfile()); H2O.addNodeToFlatfile(SELF); } Log.info("H2O cloud name: '" + ARGS.name + "' on " + SELF + (H2O.isFlatfileEnabled() ? (", discovery address " + CLOUD_MULTICAST_GROUP + ":" + CLOUD_MULTICAST_PORT) : ", static configuration based on -flatfile " + ARGS.flatfile)); if (!H2O.ARGS.disable_web) { Log.info("If you have trouble connecting, try SSH tunneling from your local machine (e.g., via port 55555):\n" + " 1. Open a terminal and run 'ssh -L 55555:localhost:" + API_PORT + " " + System.getProperty("user.name") + "@" + SELF_ADDRESS.getHostAddress() + "'\n" + " 2. Point your browser to " + NetworkInit.h2oHttpView.getScheme() + "://localhost:55555"); } // Create the starter Cloud with 1 member SELF._heartbeat._jar_md5 = JarHash.JARHASH; SELF._heartbeat._client = ARGS.client; SELF._heartbeat._cloud_name_hash = ARGS.name.hashCode(); }
java
private static void startLocalNode() { // Figure self out; this is surprisingly hard NetworkInit.initializeNetworkSockets(); // Do not forget to put SELF into the static configuration (to simulate proper multicast behavior) if ( !ARGS.client && H2O.isFlatfileEnabled() && !H2O.isNodeInFlatfile(SELF)) { Log.warn("Flatfile configuration does not include self: " + SELF + ", but contains " + H2O.getFlatfile()); H2O.addNodeToFlatfile(SELF); } Log.info("H2O cloud name: '" + ARGS.name + "' on " + SELF + (H2O.isFlatfileEnabled() ? (", discovery address " + CLOUD_MULTICAST_GROUP + ":" + CLOUD_MULTICAST_PORT) : ", static configuration based on -flatfile " + ARGS.flatfile)); if (!H2O.ARGS.disable_web) { Log.info("If you have trouble connecting, try SSH tunneling from your local machine (e.g., via port 55555):\n" + " 1. Open a terminal and run 'ssh -L 55555:localhost:" + API_PORT + " " + System.getProperty("user.name") + "@" + SELF_ADDRESS.getHostAddress() + "'\n" + " 2. Point your browser to " + NetworkInit.h2oHttpView.getScheme() + "://localhost:55555"); } // Create the starter Cloud with 1 member SELF._heartbeat._jar_md5 = JarHash.JARHASH; SELF._heartbeat._client = ARGS.client; SELF._heartbeat._cloud_name_hash = ARGS.name.hashCode(); }
[ "private", "static", "void", "startLocalNode", "(", ")", "{", "// Figure self out; this is surprisingly hard", "NetworkInit", ".", "initializeNetworkSockets", "(", ")", ";", "// Do not forget to put SELF into the static configuration (to simulate proper multicast behavior)", "if", "(...
Initializes the local node and the local cloud with itself as the only member.
[ "Initializes", "the", "local", "node", "and", "the", "local", "cloud", "with", "itself", "as", "the", "only", "member", "." ]
train
https://github.com/h2oai/h2o-3/blob/845eb49dfeaadf638b6e2f779d82fac996391fad/h2o-core/src/main/java/water/H2O.java#L1622-L1648
lessthanoptimal/BoofCV
examples/src/main/java/boofcv/examples/sfm/ExamplePnP.java
ExamplePnP.createObservations
public List<Point2D3D> createObservations( Se3_F64 worldToCamera , int total ) { """ Generates synthetic observations randomly in front of the camera. Observations are in normalized image coordinates and not pixels! See {@link PerspectiveOps#convertPixelToNorm} for how to go from pixels to normalized image coordinates. """ Se3_F64 cameraToWorld = worldToCamera.invert(null); // transform from pixel coordinates to normalized pixel coordinates, which removes lens distortion Point2Transform2_F64 pixelToNorm = LensDistortionFactory.narrow(intrinsic).undistort_F64(true,false); List<Point2D3D> observations = new ArrayList<>(); Point2D_F64 norm = new Point2D_F64(); for (int i = 0; i < total; i++) { // randomly pixel a point inside the image double x = rand.nextDouble()*intrinsic.width; double y = rand.nextDouble()*intrinsic.height; // Convert to normalized image coordinates because that's what PNP needs. // it can't process pixel coordinates pixelToNorm.compute(x,y,norm); // Randomly pick a depth and compute 3D coordinate double Z = rand.nextDouble()+4; double X = norm.x*Z; double Y = norm.y*Z; // Change the point's reference frame from camera to world Point3D_F64 cameraPt = new Point3D_F64(X,Y,Z); Point3D_F64 worldPt = new Point3D_F64(); SePointOps_F64.transform(cameraToWorld,cameraPt,worldPt); // Save the perfect noise free observation Point2D3D o = new Point2D3D(); o.getLocation().set(worldPt); o.getObservation().set(norm.x,norm.y); observations.add(o); } return observations; }
java
public List<Point2D3D> createObservations( Se3_F64 worldToCamera , int total ) { Se3_F64 cameraToWorld = worldToCamera.invert(null); // transform from pixel coordinates to normalized pixel coordinates, which removes lens distortion Point2Transform2_F64 pixelToNorm = LensDistortionFactory.narrow(intrinsic).undistort_F64(true,false); List<Point2D3D> observations = new ArrayList<>(); Point2D_F64 norm = new Point2D_F64(); for (int i = 0; i < total; i++) { // randomly pixel a point inside the image double x = rand.nextDouble()*intrinsic.width; double y = rand.nextDouble()*intrinsic.height; // Convert to normalized image coordinates because that's what PNP needs. // it can't process pixel coordinates pixelToNorm.compute(x,y,norm); // Randomly pick a depth and compute 3D coordinate double Z = rand.nextDouble()+4; double X = norm.x*Z; double Y = norm.y*Z; // Change the point's reference frame from camera to world Point3D_F64 cameraPt = new Point3D_F64(X,Y,Z); Point3D_F64 worldPt = new Point3D_F64(); SePointOps_F64.transform(cameraToWorld,cameraPt,worldPt); // Save the perfect noise free observation Point2D3D o = new Point2D3D(); o.getLocation().set(worldPt); o.getObservation().set(norm.x,norm.y); observations.add(o); } return observations; }
[ "public", "List", "<", "Point2D3D", ">", "createObservations", "(", "Se3_F64", "worldToCamera", ",", "int", "total", ")", "{", "Se3_F64", "cameraToWorld", "=", "worldToCamera", ".", "invert", "(", "null", ")", ";", "// transform from pixel coordinates to normalized pi...
Generates synthetic observations randomly in front of the camera. Observations are in normalized image coordinates and not pixels! See {@link PerspectiveOps#convertPixelToNorm} for how to go from pixels to normalized image coordinates.
[ "Generates", "synthetic", "observations", "randomly", "in", "front", "of", "the", "camera", ".", "Observations", "are", "in", "normalized", "image", "coordinates", "and", "not", "pixels!", "See", "{" ]
train
https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/examples/src/main/java/boofcv/examples/sfm/ExamplePnP.java#L148-L187
xhsun/gw2wrapper
src/main/java/me/xhsun/guildwars2wrapper/AsynchronousRequest.java
AsynchronousRequest.getGeneralGuildInfo
public void getGeneralGuildInfo(String id, Callback<Guild> callback) throws GuildWars2Exception, NullPointerException { """ For more info on guild upgrades API go <a href="https://wiki.guildwars2.com/wiki/API:2/guild/upgrades">here</a><br/> Give user the access to {@link Callback#onResponse(Call, Response)} and {@link Callback#onFailure(Call, Throwable)} methods for custom interactions @param id guild id @param callback callback that is going to be used for {@link Call#enqueue(Callback)} @throws NullPointerException if given {@link Callback} is empty @see Guild guild info """ isParamValid(new ParamChecker(ParamType.GUILD, id)); gw2API.getGeneralGuildInfo(id).enqueue(callback); }
java
public void getGeneralGuildInfo(String id, Callback<Guild> callback) throws GuildWars2Exception, NullPointerException { isParamValid(new ParamChecker(ParamType.GUILD, id)); gw2API.getGeneralGuildInfo(id).enqueue(callback); }
[ "public", "void", "getGeneralGuildInfo", "(", "String", "id", ",", "Callback", "<", "Guild", ">", "callback", ")", "throws", "GuildWars2Exception", ",", "NullPointerException", "{", "isParamValid", "(", "new", "ParamChecker", "(", "ParamType", ".", "GUILD", ",", ...
For more info on guild upgrades API go <a href="https://wiki.guildwars2.com/wiki/API:2/guild/upgrades">here</a><br/> Give user the access to {@link Callback#onResponse(Call, Response)} and {@link Callback#onFailure(Call, Throwable)} methods for custom interactions @param id guild id @param callback callback that is going to be used for {@link Call#enqueue(Callback)} @throws NullPointerException if given {@link Callback} is empty @see Guild guild info
[ "For", "more", "info", "on", "guild", "upgrades", "API", "go", "<a", "href", "=", "https", ":", "//", "wiki", ".", "guildwars2", ".", "com", "/", "wiki", "/", "API", ":", "2", "/", "guild", "/", "upgrades", ">", "here<", "/", "a", ">", "<br", "/"...
train
https://github.com/xhsun/gw2wrapper/blob/c8a43b51f363b032074fb152ee6efe657e33e525/src/main/java/me/xhsun/guildwars2wrapper/AsynchronousRequest.java#L1435-L1438
BorderTech/wcomponents
wcomponents-core/src/main/java/com/github/bordertech/wcomponents/servlet/ServletUtil.java
ServletUtil.getRequestFileItemValue
public static FileItem getRequestFileItemValue(final HttpServletRequest request, final String key) { """ Get a file item value from the request allowing for multi part form fields. @param request the request being processed @param key the file parameter key to return @return the file item value """ FileItem[] values = getRequestFileItemValues(request, key); return values == null || values.length == 0 ? null : values[0]; }
java
public static FileItem getRequestFileItemValue(final HttpServletRequest request, final String key) { FileItem[] values = getRequestFileItemValues(request, key); return values == null || values.length == 0 ? null : values[0]; }
[ "public", "static", "FileItem", "getRequestFileItemValue", "(", "final", "HttpServletRequest", "request", ",", "final", "String", "key", ")", "{", "FileItem", "[", "]", "values", "=", "getRequestFileItemValues", "(", "request", ",", "key", ")", ";", "return", "v...
Get a file item value from the request allowing for multi part form fields. @param request the request being processed @param key the file parameter key to return @return the file item value
[ "Get", "a", "file", "item", "value", "from", "the", "request", "allowing", "for", "multi", "part", "form", "fields", "." ]
train
https://github.com/BorderTech/wcomponents/blob/d1a2b2243270067db030feb36ca74255aaa94436/wcomponents-core/src/main/java/com/github/bordertech/wcomponents/servlet/ServletUtil.java#L581-L584
fuinorg/utils4j
src/main/java/org/fuin/utils4j/Utils4J.java
Utils4J.concatPathAndFilename
public static String concatPathAndFilename(final String path, final String filename, final String separator) { """ Concatenate a path and a filename taking <code>null</code> and empty string values into account. @param path Path - Can be <code>null</code> or an empty string. @param filename Filename - Cannot be <code>null</code>. @param separator Separator for directories - Can be <code>null</code> or an empty string. @return Path and filename divided by the separator. """ checkNotNull("filename", filename); checkNotNull("separator", separator); checkNotEmpty("separator", separator); if (path == null) { return filename; } final String trimmedPath = path.trim(); if (trimmedPath.length() == 0) { return filename; } final String trimmedFilename = filename.trim(); if (trimmedPath.endsWith(separator)) { return trimmedPath + trimmedFilename; } return trimmedPath + separator + trimmedFilename; }
java
public static String concatPathAndFilename(final String path, final String filename, final String separator) { checkNotNull("filename", filename); checkNotNull("separator", separator); checkNotEmpty("separator", separator); if (path == null) { return filename; } final String trimmedPath = path.trim(); if (trimmedPath.length() == 0) { return filename; } final String trimmedFilename = filename.trim(); if (trimmedPath.endsWith(separator)) { return trimmedPath + trimmedFilename; } return trimmedPath + separator + trimmedFilename; }
[ "public", "static", "String", "concatPathAndFilename", "(", "final", "String", "path", ",", "final", "String", "filename", ",", "final", "String", "separator", ")", "{", "checkNotNull", "(", "\"filename\"", ",", "filename", ")", ";", "checkNotNull", "(", "\"sepa...
Concatenate a path and a filename taking <code>null</code> and empty string values into account. @param path Path - Can be <code>null</code> or an empty string. @param filename Filename - Cannot be <code>null</code>. @param separator Separator for directories - Can be <code>null</code> or an empty string. @return Path and filename divided by the separator.
[ "Concatenate", "a", "path", "and", "a", "filename", "taking", "<code", ">", "null<", "/", "code", ">", "and", "empty", "string", "values", "into", "account", "." ]
train
https://github.com/fuinorg/utils4j/blob/71cf88e0a8d8ed67bbac513bf3cab165cd7e3280/src/main/java/org/fuin/utils4j/Utils4J.java#L1126-L1145
undera/jmeter-plugins
infra/common/src/main/java/kg/apc/jmeter/graphs/GraphPanel.java
GraphPanel.replaceRowTab
public void replaceRowTab(String tabLabel, Component object, String toolTipText) { """ Method used only for change row selector tab in Composite Chart @param tabLabel the new tab label @param object the new Panel to add in the tab @param toolTipText the new tooltip text """ int index = indexOfComponent(rowsTab); remove(index); ImageIcon rowsIcon = createImageIcon("/kg/apc/jmeter/img/checks.png"); insertTab(tabLabel, rowsIcon, object, toolTipText, index); }
java
public void replaceRowTab(String tabLabel, Component object, String toolTipText) { int index = indexOfComponent(rowsTab); remove(index); ImageIcon rowsIcon = createImageIcon("/kg/apc/jmeter/img/checks.png"); insertTab(tabLabel, rowsIcon, object, toolTipText, index); }
[ "public", "void", "replaceRowTab", "(", "String", "tabLabel", ",", "Component", "object", ",", "String", "toolTipText", ")", "{", "int", "index", "=", "indexOfComponent", "(", "rowsTab", ")", ";", "remove", "(", "index", ")", ";", "ImageIcon", "rowsIcon", "=...
Method used only for change row selector tab in Composite Chart @param tabLabel the new tab label @param object the new Panel to add in the tab @param toolTipText the new tooltip text
[ "Method", "used", "only", "for", "change", "row", "selector", "tab", "in", "Composite", "Chart" ]
train
https://github.com/undera/jmeter-plugins/blob/416d2a77249ab921c7e4134c3e6a9639901ef7e8/infra/common/src/main/java/kg/apc/jmeter/graphs/GraphPanel.java#L55-L60