id
int32
0
165k
repo
stringlengths
7
58
path
stringlengths
12
218
func_name
stringlengths
3
140
original_string
stringlengths
73
34.1k
language
stringclasses
1 value
code
stringlengths
73
34.1k
code_tokens
list
docstring
stringlengths
3
16k
docstring_tokens
list
sha
stringlengths
40
40
url
stringlengths
105
339
129,700
zaproxy/zaproxy
src/org/zaproxy/zap/extension/ascan/ScanProgressDialog.java
ScanProgressDialog.getMainPanel
private JTable getMainPanel() { if (table == null) { model = new ScanProgressTableModel(); table = new JTable(); table.setModel(model); table.setRowSelectionAllowed(false); table.setColumnSelectionAllowed(false); ta...
java
private JTable getMainPanel() { if (table == null) { model = new ScanProgressTableModel(); table = new JTable(); table.setModel(model); table.setRowSelectionAllowed(false); table.setColumnSelectionAllowed(false); ta...
[ "private", "JTable", "getMainPanel", "(", ")", "{", "if", "(", "table", "==", "null", ")", "{", "model", "=", "new", "ScanProgressTableModel", "(", ")", ";", "table", "=", "new", "JTable", "(", ")", ";", "table", ".", "setModel", "(", "model", ")", "...
Get the main content panel of the dialog @return the main panel
[ "Get", "the", "main", "content", "panel", "of", "the", "dialog" ]
0cbe5121f2ae1ecca222513d182759210c569bec
https://github.com/zaproxy/zaproxy/blob/0cbe5121f2ae1ecca222513d182759210c569bec/src/org/zaproxy/zap/extension/ascan/ScanProgressDialog.java#L311-L354
129,701
zaproxy/zaproxy
src/org/zaproxy/zap/extension/ascan/ScanProgressDialog.java
ScanProgressDialog.setActiveScan
public void setActiveScan(ActiveScan scan) { this.scan = scan; if (scan == null) { return; } getHostSelect().removeAll(); for (HostProcess hp : scan.getHostProcesses()) { getHostSelect().addItem(hp.getHostAndPort()); } Thread thread = new Th...
java
public void setActiveScan(ActiveScan scan) { this.scan = scan; if (scan == null) { return; } getHostSelect().removeAll(); for (HostProcess hp : scan.getHostProcesses()) { getHostSelect().addItem(hp.getHostAndPort()); } Thread thread = new Th...
[ "public", "void", "setActiveScan", "(", "ActiveScan", "scan", ")", "{", "this", ".", "scan", "=", "scan", ";", "if", "(", "scan", "==", "null", ")", "{", "return", ";", "}", "getHostSelect", "(", ")", ".", "removeAll", "(", ")", ";", "for", "(", "H...
Set the scan that will be shown in this dialog. @param scan the active scan, might be {@code null}.
[ "Set", "the", "scan", "that", "will", "be", "shown", "in", "this", "dialog", "." ]
0cbe5121f2ae1ecca222513d182759210c569bec
https://github.com/zaproxy/zaproxy/blob/0cbe5121f2ae1ecca222513d182759210c569bec/src/org/zaproxy/zap/extension/ascan/ScanProgressDialog.java#L446-L478
129,702
zaproxy/zaproxy
src/org/zaproxy/zap/extension/help/ExtensionHelp.java
ExtensionHelp.removeHelpProperties
private void removeHelpProperties(JComponent component) { component.putClientProperty(HELP_ID_PROPERTY, null); component.putClientProperty(HELP_SET_PROPERTY, null); }
java
private void removeHelpProperties(JComponent component) { component.putClientProperty(HELP_ID_PROPERTY, null); component.putClientProperty(HELP_SET_PROPERTY, null); }
[ "private", "void", "removeHelpProperties", "(", "JComponent", "component", ")", "{", "component", ".", "putClientProperty", "(", "HELP_ID_PROPERTY", ",", "null", ")", ";", "component", ".", "putClientProperty", "(", "HELP_SET_PROPERTY", ",", "null", ")", ";", "}" ...
Removes the help properties from the given component. @param component the component whose help properties will be removed, must not be {@code null} @see #HELP_ID_PROPERTY @see #HELP_SET_PROPERTY
[ "Removes", "the", "help", "properties", "from", "the", "given", "component", "." ]
0cbe5121f2ae1ecca222513d182759210c569bec
https://github.com/zaproxy/zaproxy/blob/0cbe5121f2ae1ecca222513d182759210c569bec/src/org/zaproxy/zap/extension/help/ExtensionHelp.java#L331-L334
129,703
zaproxy/zaproxy
src/org/zaproxy/zap/extension/help/ExtensionHelp.java
ExtensionHelp.showHelp
public static void showHelp(String helpindex) { if (getHelpBroker() == null) { return; } try { getHelpBroker().showID(helpindex, "javax.help.SecondaryWindow", null); } catch (Exception e) { logger.error("error loading help with index: " + helpindex, e); } }
java
public static void showHelp(String helpindex) { if (getHelpBroker() == null) { return; } try { getHelpBroker().showID(helpindex, "javax.help.SecondaryWindow", null); } catch (Exception e) { logger.error("error loading help with index: " + helpindex, e); } }
[ "public", "static", "void", "showHelp", "(", "String", "helpindex", ")", "{", "if", "(", "getHelpBroker", "(", ")", "==", "null", ")", "{", "return", ";", "}", "try", "{", "getHelpBroker", "(", ")", ".", "showID", "(", "helpindex", ",", "\"javax.help.Sec...
Shows a specific help topic @param helpindex
[ "Shows", "a", "specific", "help", "topic" ]
0cbe5121f2ae1ecca222513d182759210c569bec
https://github.com/zaproxy/zaproxy/blob/0cbe5121f2ae1ecca222513d182759210c569bec/src/org/zaproxy/zap/extension/help/ExtensionHelp.java#L420-L430
129,704
zaproxy/zaproxy
src/org/parosproxy/paros/network/GenericMethod.java
GenericMethod.setParameter
public void setParameter(String parameterName, String parameterValue) { log.trace("enter PostMethod.setParameter(String, String)"); removeParameter(parameterName); addParameter(parameterName, parameterValue); }
java
public void setParameter(String parameterName, String parameterValue) { log.trace("enter PostMethod.setParameter(String, String)"); removeParameter(parameterName); addParameter(parameterName, parameterValue); }
[ "public", "void", "setParameter", "(", "String", "parameterName", ",", "String", "parameterValue", ")", "{", "log", ".", "trace", "(", "\"enter PostMethod.setParameter(String, String)\"", ")", ";", "removeParameter", "(", "parameterName", ")", ";", "addParameter", "("...
Sets the value of parameter with parameterName to parameterValue. This method does not preserve the initial insertion order. @param parameterName name of the parameter @param parameterValue value of the parameter @since 2.0
[ "Sets", "the", "value", "of", "parameter", "with", "parameterName", "to", "parameterValue", ".", "This", "method", "does", "not", "preserve", "the", "initial", "insertion", "order", "." ]
0cbe5121f2ae1ecca222513d182759210c569bec
https://github.com/zaproxy/zaproxy/blob/0cbe5121f2ae1ecca222513d182759210c569bec/src/org/parosproxy/paros/network/GenericMethod.java#L151-L156
129,705
zaproxy/zaproxy
src/org/parosproxy/paros/network/GenericMethod.java
GenericMethod.getParameter
public NameValuePair getParameter(String paramName) { log.trace("enter PostMethod.getParameter(String)"); if (paramName == null) { return null; } Iterator<NameValuePair> iter = this.params.iterator(); while (iter.hasNext()) { NameValuePair par...
java
public NameValuePair getParameter(String paramName) { log.trace("enter PostMethod.getParameter(String)"); if (paramName == null) { return null; } Iterator<NameValuePair> iter = this.params.iterator(); while (iter.hasNext()) { NameValuePair par...
[ "public", "NameValuePair", "getParameter", "(", "String", "paramName", ")", "{", "log", ".", "trace", "(", "\"enter PostMethod.getParameter(String)\"", ")", ";", "if", "(", "paramName", "==", "null", ")", "{", "return", "null", ";", "}", "Iterator", "<", "Name...
Gets the parameter of the specified name. If there exists more than one parameter with the name paramName, then only the first one is returned. @param paramName name of the parameter @return If a parameter exists with the name argument, the coresponding NameValuePair is returned. Otherwise null. @since 2.0
[ "Gets", "the", "parameter", "of", "the", "specified", "name", ".", "If", "there", "exists", "more", "than", "one", "parameter", "with", "the", "name", "paramName", "then", "only", "the", "first", "one", "is", "returned", "." ]
0cbe5121f2ae1ecca222513d182759210c569bec
https://github.com/zaproxy/zaproxy/blob/0cbe5121f2ae1ecca222513d182759210c569bec/src/org/parosproxy/paros/network/GenericMethod.java#L170-L187
129,706
zaproxy/zaproxy
src/org/parosproxy/paros/network/GenericMethod.java
GenericMethod.getParameters
public NameValuePair[] getParameters() { log.trace("enter PostMethod.getParameters()"); int numPairs = this.params.size(); Object[] objectArr = this.params.toArray(); NameValuePair[] nvPairArr = new NameValuePair[numPairs]; for (int i = 0; i < numPairs; i++) { ...
java
public NameValuePair[] getParameters() { log.trace("enter PostMethod.getParameters()"); int numPairs = this.params.size(); Object[] objectArr = this.params.toArray(); NameValuePair[] nvPairArr = new NameValuePair[numPairs]; for (int i = 0; i < numPairs; i++) { ...
[ "public", "NameValuePair", "[", "]", "getParameters", "(", ")", "{", "log", ".", "trace", "(", "\"enter PostMethod.getParameters()\"", ")", ";", "int", "numPairs", "=", "this", ".", "params", ".", "size", "(", ")", ";", "Object", "[", "]", "objectArr", "="...
Gets the parameters currently added to the PostMethod. If there are no parameters, a valid array is returned with zero elements. The returned array object contains an array of pointers to the internal data members. @return An array of the current parameters @since 2.0
[ "Gets", "the", "parameters", "currently", "added", "to", "the", "PostMethod", ".", "If", "there", "are", "no", "parameters", "a", "valid", "array", "is", "returned", "with", "zero", "elements", ".", "The", "returned", "array", "object", "contains", "an", "ar...
0cbe5121f2ae1ecca222513d182759210c569bec
https://github.com/zaproxy/zaproxy/blob/0cbe5121f2ae1ecca222513d182759210c569bec/src/org/parosproxy/paros/network/GenericMethod.java#L200-L212
129,707
zaproxy/zaproxy
src/org/parosproxy/paros/network/GenericMethod.java
GenericMethod.addParameters
public void addParameters(NameValuePair[] parameters) { log.trace("enter PostMethod.addParameters(NameValuePair[])"); if (parameters == null) { log.warn("Attempt to addParameters(null) ignored"); } else { super.clearRequestBody(); for (int i = 0; i < p...
java
public void addParameters(NameValuePair[] parameters) { log.trace("enter PostMethod.addParameters(NameValuePair[])"); if (parameters == null) { log.warn("Attempt to addParameters(null) ignored"); } else { super.clearRequestBody(); for (int i = 0; i < p...
[ "public", "void", "addParameters", "(", "NameValuePair", "[", "]", "parameters", ")", "{", "log", ".", "trace", "(", "\"enter PostMethod.addParameters(NameValuePair[])\"", ")", ";", "if", "(", "parameters", "==", "null", ")", "{", "log", ".", "warn", "(", "\"A...
Adds an array of parameters to be used in the POST request body. Logs a warning if the parameters argument is null. @param parameters The array of parameters to add. @since 2.0
[ "Adds", "an", "array", "of", "parameters", "to", "be", "used", "in", "the", "POST", "request", "body", ".", "Logs", "a", "warning", "if", "the", "parameters", "argument", "is", "null", "." ]
0cbe5121f2ae1ecca222513d182759210c569bec
https://github.com/zaproxy/zaproxy/blob/0cbe5121f2ae1ecca222513d182759210c569bec/src/org/parosproxy/paros/network/GenericMethod.java#L264-L275
129,708
zaproxy/zaproxy
src/org/parosproxy/paros/network/GenericMethod.java
GenericMethod.removeParameter
public boolean removeParameter(String paramName) throws IllegalArgumentException { log.trace("enter PostMethod.removeParameter(String)"); if (paramName == null) { throw new IllegalArgumentException( "Argument passed to removeParameter(String) cannot be null"); ...
java
public boolean removeParameter(String paramName) throws IllegalArgumentException { log.trace("enter PostMethod.removeParameter(String)"); if (paramName == null) { throw new IllegalArgumentException( "Argument passed to removeParameter(String) cannot be null"); ...
[ "public", "boolean", "removeParameter", "(", "String", "paramName", ")", "throws", "IllegalArgumentException", "{", "log", ".", "trace", "(", "\"enter PostMethod.removeParameter(String)\"", ")", ";", "if", "(", "paramName", "==", "null", ")", "{", "throw", "new", ...
Removes all parameters with the given paramName. If there is more than one parameter with the given paramName, all of them are removed. If there is just one, it is removed. If there are none, then the request is ignored. @param paramName The parameter name to remove. @return true if at least one parameter was remov...
[ "Removes", "all", "parameters", "with", "the", "given", "paramName", ".", "If", "there", "is", "more", "than", "one", "parameter", "with", "the", "given", "paramName", "all", "of", "them", "are", "removed", ".", "If", "there", "is", "just", "one", "it", ...
0cbe5121f2ae1ecca222513d182759210c569bec
https://github.com/zaproxy/zaproxy/blob/0cbe5121f2ae1ecca222513d182759210c569bec/src/org/parosproxy/paros/network/GenericMethod.java#L291-L311
129,709
zaproxy/zaproxy
src/org/parosproxy/paros/network/GenericMethod.java
GenericMethod.setRequestBody
public void setRequestBody(NameValuePair[] parametersBody) throws IllegalArgumentException { log.trace("enter PostMethod.setRequestBody(NameValuePair[])"); if (parametersBody == null) { throw new IllegalArgumentException("Array of parameters may not be null"); } c...
java
public void setRequestBody(NameValuePair[] parametersBody) throws IllegalArgumentException { log.trace("enter PostMethod.setRequestBody(NameValuePair[])"); if (parametersBody == null) { throw new IllegalArgumentException("Array of parameters may not be null"); } c...
[ "public", "void", "setRequestBody", "(", "NameValuePair", "[", "]", "parametersBody", ")", "throws", "IllegalArgumentException", "{", "log", ".", "trace", "(", "\"enter PostMethod.setRequestBody(NameValuePair[])\"", ")", ";", "if", "(", "parametersBody", "==", "null", ...
Sets an array of parameters to be used in the POST request body @param parametersBody The array of parameters to add. @throws IllegalArgumentException when param parameters are null @since 2.0beta1
[ "Sets", "an", "array", "of", "parameters", "to", "be", "used", "in", "the", "POST", "request", "body" ]
0cbe5121f2ae1ecca222513d182759210c569bec
https://github.com/zaproxy/zaproxy/blob/0cbe5121f2ae1ecca222513d182759210c569bec/src/org/parosproxy/paros/network/GenericMethod.java#L362-L371
129,710
zaproxy/zaproxy
src/org/zaproxy/zap/network/HttpRequestBody.java
HttpRequestBody.setFormParams
public void setFormParams(TreeSet<HtmlParameter> postParams) { if (postParams.isEmpty()) { this.setBody(""); return; } StringBuilder postData = new StringBuilder(); for(HtmlParameter parameter: postParams) { if (parameter.getType() != HtmlParameter.Type.form) { continue; } ...
java
public void setFormParams(TreeSet<HtmlParameter> postParams) { if (postParams.isEmpty()) { this.setBody(""); return; } StringBuilder postData = new StringBuilder(); for(HtmlParameter parameter: postParams) { if (parameter.getType() != HtmlParameter.Type.form) { continue; } ...
[ "public", "void", "setFormParams", "(", "TreeSet", "<", "HtmlParameter", ">", "postParams", ")", "{", "if", "(", "postParams", ".", "isEmpty", "(", ")", ")", "{", "this", ".", "setBody", "(", "\"\"", ")", ";", "return", ";", "}", "StringBuilder", "postDa...
Construct a HTTP POST Body from the variables in postParams
[ "Construct", "a", "HTTP", "POST", "Body", "from", "the", "variables", "in", "postParams" ]
0cbe5121f2ae1ecca222513d182759210c569bec
https://github.com/zaproxy/zaproxy/blob/0cbe5121f2ae1ecca222513d182759210c569bec/src/org/zaproxy/zap/network/HttpRequestBody.java#L41-L66
129,711
zaproxy/zaproxy
src/org/parosproxy/paros/view/WorkbenchPanel.java
WorkbenchPanel.setWorkbenchLayout
void setWorkbenchLayout(Layout layout) { validateNotNull(layout, "layout"); if (this.layout == layout) { return; } requestTabIndex = getCurrentRequestTabIndex(); Layout previousLayout = this.layout; this.layout = layout; componentMaximiser.unmaximiseComponent(); removeAll(); Lis...
java
void setWorkbenchLayout(Layout layout) { validateNotNull(layout, "layout"); if (this.layout == layout) { return; } requestTabIndex = getCurrentRequestTabIndex(); Layout previousLayout = this.layout; this.layout = layout; componentMaximiser.unmaximiseComponent(); removeAll(); Lis...
[ "void", "setWorkbenchLayout", "(", "Layout", "layout", ")", "{", "validateNotNull", "(", "layout", ",", "\"layout\"", ")", ";", "if", "(", "this", ".", "layout", "==", "layout", ")", "{", "return", ";", "}", "requestTabIndex", "=", "getCurrentRequestTabIndex",...
Sets the layout of the workbench panel. @param layout the layout to set @throws IllegalArgumentException if the given parameter is {@code null}. @since 2.5.0
[ "Sets", "the", "layout", "of", "the", "workbench", "panel", "." ]
0cbe5121f2ae1ecca222513d182759210c569bec
https://github.com/zaproxy/zaproxy/blob/0cbe5121f2ae1ecca222513d182759210c569bec/src/org/parosproxy/paros/view/WorkbenchPanel.java#L476-L523
129,712
zaproxy/zaproxy
src/org/parosproxy/paros/view/WorkbenchPanel.java
WorkbenchPanel.getPaneStatus
private JPanel getPaneStatus() { if (paneStatus == null) { paneStatus = new JPanel(); paneStatus.setLayout(new BorderLayout(0,0)); paneStatus.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 0)); paneStatus.add(getTabbedStatus()); } return paneStatus; }
java
private JPanel getPaneStatus() { if (paneStatus == null) { paneStatus = new JPanel(); paneStatus.setLayout(new BorderLayout(0,0)); paneStatus.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 0)); paneStatus.add(getTabbedStatus()); } return paneStatus; }
[ "private", "JPanel", "getPaneStatus", "(", ")", "{", "if", "(", "paneStatus", "==", "null", ")", "{", "paneStatus", "=", "new", "JPanel", "(", ")", ";", "paneStatus", ".", "setLayout", "(", "new", "BorderLayout", "(", "0", ",", "0", ")", ")", ";", "p...
This method initializes paneStatus @return JPanel
[ "This", "method", "initializes", "paneStatus" ]
0cbe5121f2ae1ecca222513d182759210c569bec
https://github.com/zaproxy/zaproxy/blob/0cbe5121f2ae1ecca222513d182759210c569bec/src/org/parosproxy/paros/view/WorkbenchPanel.java#L623-L631
129,713
zaproxy/zaproxy
src/org/parosproxy/paros/view/WorkbenchPanel.java
WorkbenchPanel.getPaneSelect
private JPanel getPaneSelect() { if (paneSelect == null) { paneSelect = new JPanel(); paneSelect.setLayout(new BorderLayout(0,0)); paneSelect.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 0)); paneSelect.add(getTabbedSelect()); } return paneSelect; }
java
private JPanel getPaneSelect() { if (paneSelect == null) { paneSelect = new JPanel(); paneSelect.setLayout(new BorderLayout(0,0)); paneSelect.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 0)); paneSelect.add(getTabbedSelect()); } return paneSelect; }
[ "private", "JPanel", "getPaneSelect", "(", ")", "{", "if", "(", "paneSelect", "==", "null", ")", "{", "paneSelect", "=", "new", "JPanel", "(", ")", ";", "paneSelect", ".", "setLayout", "(", "new", "BorderLayout", "(", "0", ",", "0", ")", ")", ";", "p...
This method initializes paneSelect @return JPanel
[ "This", "method", "initializes", "paneSelect" ]
0cbe5121f2ae1ecca222513d182759210c569bec
https://github.com/zaproxy/zaproxy/blob/0cbe5121f2ae1ecca222513d182759210c569bec/src/org/parosproxy/paros/view/WorkbenchPanel.java#L638-L646
129,714
zaproxy/zaproxy
src/org/parosproxy/paros/view/WorkbenchPanel.java
WorkbenchPanel.addPanels
public void addPanels(List<AbstractPanel> panels, PanelType panelType) { validateNotNull(panels, "panels"); validateNotNull(panelType, "panelType"); boolean fullLayout = layout == Layout.FULL; addPanels(getTabbedFull(), panels, fullLayout); switch (panelType) { case SELECT: addPanels(getTabb...
java
public void addPanels(List<AbstractPanel> panels, PanelType panelType) { validateNotNull(panels, "panels"); validateNotNull(panelType, "panelType"); boolean fullLayout = layout == Layout.FULL; addPanels(getTabbedFull(), panels, fullLayout); switch (panelType) { case SELECT: addPanels(getTabb...
[ "public", "void", "addPanels", "(", "List", "<", "AbstractPanel", ">", "panels", ",", "PanelType", "panelType", ")", "{", "validateNotNull", "(", "panels", ",", "\"panels\"", ")", ";", "validateNotNull", "(", "panelType", ",", "\"panelType\"", ")", ";", "boole...
Adds the given panels to the workbench, hinting with the given panel type. @param panels the panels to add to the workbench @param panelType the type of the panels @throws IllegalArgumentException if any of the parameters is {@code null}. @since 2.5.0 @see #removePanels(List, PanelType) @see #addPanel(AbstractPanel, P...
[ "Adds", "the", "given", "panels", "to", "the", "workbench", "hinting", "with", "the", "given", "panel", "type", "." ]
0cbe5121f2ae1ecca222513d182759210c569bec
https://github.com/zaproxy/zaproxy/blob/0cbe5121f2ae1ecca222513d182759210c569bec/src/org/parosproxy/paros/view/WorkbenchPanel.java#L844-L865
129,715
zaproxy/zaproxy
src/org/parosproxy/paros/view/WorkbenchPanel.java
WorkbenchPanel.addPanel
public void addPanel(AbstractPanel panel, PanelType panelType) { validateNotNull(panel, "panel"); validateNotNull(panelType, "panelType"); boolean fullLayout = layout == Layout.FULL; addPanel(getTabbedFull(), panel, fullLayout); switch (panelType) { case SELECT: addPanel(getTabbedSelect(), p...
java
public void addPanel(AbstractPanel panel, PanelType panelType) { validateNotNull(panel, "panel"); validateNotNull(panelType, "panelType"); boolean fullLayout = layout == Layout.FULL; addPanel(getTabbedFull(), panel, fullLayout); switch (panelType) { case SELECT: addPanel(getTabbedSelect(), p...
[ "public", "void", "addPanel", "(", "AbstractPanel", "panel", ",", "PanelType", "panelType", ")", "{", "validateNotNull", "(", "panel", ",", "\"panel\"", ")", ";", "validateNotNull", "(", "panelType", ",", "\"panelType\"", ")", ";", "boolean", "fullLayout", "=", ...
Adds the given panel to the workbench, hinting with the given panel type. @param panel the panel to add to the workbench @param panelType the type of the panel @throws IllegalArgumentException if any of the parameters is {@code null}. @since 2.5.0 @see #removePanel(AbstractPanel, PanelType) @see #addPanels(List, Panel...
[ "Adds", "the", "given", "panel", "to", "the", "workbench", "hinting", "with", "the", "given", "panel", "type", "." ]
0cbe5121f2ae1ecca222513d182759210c569bec
https://github.com/zaproxy/zaproxy/blob/0cbe5121f2ae1ecca222513d182759210c569bec/src/org/parosproxy/paros/view/WorkbenchPanel.java#L911-L935
129,716
zaproxy/zaproxy
src/org/parosproxy/paros/view/WorkbenchPanel.java
WorkbenchPanel.removePanels
public void removePanels(List<AbstractPanel> panels, PanelType panelType) { validateNotNull(panels, "panels"); validateNotNull(panelType, "panelType"); removePanels(getTabbedFull(), panels); switch (panelType) { case SELECT: removePanels(getTabbedSelect(), panels); break; case STATUS: ...
java
public void removePanels(List<AbstractPanel> panels, PanelType panelType) { validateNotNull(panels, "panels"); validateNotNull(panelType, "panelType"); removePanels(getTabbedFull(), panels); switch (panelType) { case SELECT: removePanels(getTabbedSelect(), panels); break; case STATUS: ...
[ "public", "void", "removePanels", "(", "List", "<", "AbstractPanel", ">", "panels", ",", "PanelType", "panelType", ")", "{", "validateNotNull", "(", "panels", ",", "\"panels\"", ")", ";", "validateNotNull", "(", "panelType", ",", "\"panelType\"", ")", ";", "re...
Removes the given panels of given panel type from the workbench panel. @param panels the panels to remove from the workbench panel @param panelType the type of the panels @throws IllegalArgumentException if any of the parameters is {@code null}. @since 2.5.0 @see #addPanels(List, PanelType) @see #removePanel(AbstractP...
[ "Removes", "the", "given", "panels", "of", "given", "panel", "type", "from", "the", "workbench", "panel", "." ]
0cbe5121f2ae1ecca222513d182759210c569bec
https://github.com/zaproxy/zaproxy/blob/0cbe5121f2ae1ecca222513d182759210c569bec/src/org/parosproxy/paros/view/WorkbenchPanel.java#L947-L966
129,717
zaproxy/zaproxy
src/org/parosproxy/paros/view/WorkbenchPanel.java
WorkbenchPanel.removePanel
public void removePanel(AbstractPanel panel, PanelType panelType) { validateNotNull(panel, "panel"); validateNotNull(panelType, "panelType"); removeTabPanel(getTabbedFull(), panel); getTabbedFull().revalidate(); switch (panelType) { case SELECT: removeTabPanel(getTabbedSelect(), panel); ge...
java
public void removePanel(AbstractPanel panel, PanelType panelType) { validateNotNull(panel, "panel"); validateNotNull(panelType, "panelType"); removeTabPanel(getTabbedFull(), panel); getTabbedFull().revalidate(); switch (panelType) { case SELECT: removeTabPanel(getTabbedSelect(), panel); ge...
[ "public", "void", "removePanel", "(", "AbstractPanel", "panel", ",", "PanelType", "panelType", ")", "{", "validateNotNull", "(", "panel", ",", "\"panel\"", ")", ";", "validateNotNull", "(", "panelType", ",", "\"panelType\"", ")", ";", "removeTabPanel", "(", "get...
Removes the given panel of given panel type from the workbench panel. @param panel the panel to remove from the workbench panel @param panelType the type of the panel @throws IllegalArgumentException if any of the parameters is {@code null}. @since 2.5.0 @see #addPanel(AbstractPanel, PanelType) @see #removePanels(List...
[ "Removes", "the", "given", "panel", "of", "given", "panel", "type", "from", "the", "workbench", "panel", "." ]
0cbe5121f2ae1ecca222513d182759210c569bec
https://github.com/zaproxy/zaproxy/blob/0cbe5121f2ae1ecca222513d182759210c569bec/src/org/parosproxy/paros/view/WorkbenchPanel.java#L1006-L1029
129,718
zaproxy/zaproxy
src/org/parosproxy/paros/view/WorkbenchPanel.java
WorkbenchPanel.getPanels
public List<AbstractPanel> getPanels(PanelType panelType) { validateNotNull(panelType, "panelType"); List<AbstractPanel> panels = new ArrayList<>(); switch (panelType) { case SELECT: panels.addAll(getTabbedSelect().getPanels()); break; case STATUS: panels.addAll(getTabbedStatus().getPanels(...
java
public List<AbstractPanel> getPanels(PanelType panelType) { validateNotNull(panelType, "panelType"); List<AbstractPanel> panels = new ArrayList<>(); switch (panelType) { case SELECT: panels.addAll(getTabbedSelect().getPanels()); break; case STATUS: panels.addAll(getTabbedStatus().getPanels(...
[ "public", "List", "<", "AbstractPanel", ">", "getPanels", "(", "PanelType", "panelType", ")", "{", "validateNotNull", "(", "panelType", ",", "\"panelType\"", ")", ";", "List", "<", "AbstractPanel", ">", "panels", "=", "new", "ArrayList", "<>", "(", ")", ";",...
Gets the panels that were added to the workbench with the given panel type. @param panelType the type of the panel @return a {@code List} with the panels of the given type @throws IllegalArgumentException if the given parameter is {@code null}. @since 2.5.0
[ "Gets", "the", "panels", "that", "were", "added", "to", "the", "workbench", "with", "the", "given", "panel", "type", "." ]
0cbe5121f2ae1ecca222513d182759210c569bec
https://github.com/zaproxy/zaproxy/blob/0cbe5121f2ae1ecca222513d182759210c569bec/src/org/parosproxy/paros/view/WorkbenchPanel.java#L1039-L1057
129,719
zaproxy/zaproxy
src/org/parosproxy/paros/view/WorkbenchPanel.java
WorkbenchPanel.getSortedPanels
public SortedSet<AbstractPanel> getSortedPanels(PanelType panelType) { validateNotNull(panelType, "panelType"); List<AbstractPanel> panels = getPanels(panelType); SortedSet<AbstractPanel> sortedPanels = new TreeSet<>(new Comparator<AbstractPanel>() { @Override public int compare(AbstractPanel abstr...
java
public SortedSet<AbstractPanel> getSortedPanels(PanelType panelType) { validateNotNull(panelType, "panelType"); List<AbstractPanel> panels = getPanels(panelType); SortedSet<AbstractPanel> sortedPanels = new TreeSet<>(new Comparator<AbstractPanel>() { @Override public int compare(AbstractPanel abstr...
[ "public", "SortedSet", "<", "AbstractPanel", ">", "getSortedPanels", "(", "PanelType", "panelType", ")", "{", "validateNotNull", "(", "panelType", ",", "\"panelType\"", ")", ";", "List", "<", "AbstractPanel", ">", "panels", "=", "getPanels", "(", "panelType", ")...
Gets the panels, sorted by name, that were added to the workbench with the given panel type. @param panelType the type of the panel @return a {@code List} with the sorted panels of the given type @throws IllegalArgumentException if the given parameter is {@code null}. @since 2.5.0
[ "Gets", "the", "panels", "sorted", "by", "name", "that", "were", "added", "to", "the", "workbench", "with", "the", "given", "panel", "type", "." ]
0cbe5121f2ae1ecca222513d182759210c569bec
https://github.com/zaproxy/zaproxy/blob/0cbe5121f2ae1ecca222513d182759210c569bec/src/org/parosproxy/paros/view/WorkbenchPanel.java#L1067-L1090
129,720
zaproxy/zaproxy
src/org/parosproxy/paros/view/WorkbenchPanel.java
WorkbenchPanel.pinVisiblePanels
public void pinVisiblePanels() { if (layout == Layout.FULL) { getTabbedFull().pinVisibleTabs(); } else { getTabbedSelect().pinVisibleTabs(); getTabbedWork().pinVisibleTabs(); getTabbedStatus().pinVisibleTabs(); } }
java
public void pinVisiblePanels() { if (layout == Layout.FULL) { getTabbedFull().pinVisibleTabs(); } else { getTabbedSelect().pinVisibleTabs(); getTabbedWork().pinVisibleTabs(); getTabbedStatus().pinVisibleTabs(); } }
[ "public", "void", "pinVisiblePanels", "(", ")", "{", "if", "(", "layout", "==", "Layout", ".", "FULL", ")", "{", "getTabbedFull", "(", ")", ".", "pinVisibleTabs", "(", ")", ";", "}", "else", "{", "getTabbedSelect", "(", ")", ".", "pinVisibleTabs", "(", ...
Pins all visible panels. @since 2.5.0 @see #unpinVisiblePanels() @see AbstractPanel#setPinned(boolean)
[ "Pins", "all", "visible", "panels", "." ]
0cbe5121f2ae1ecca222513d182759210c569bec
https://github.com/zaproxy/zaproxy/blob/0cbe5121f2ae1ecca222513d182759210c569bec/src/org/parosproxy/paros/view/WorkbenchPanel.java#L1118-L1126
129,721
zaproxy/zaproxy
src/org/parosproxy/paros/view/WorkbenchPanel.java
WorkbenchPanel.unpinVisiblePanels
public void unpinVisiblePanels() { if (layout == Layout.FULL) { getTabbedFull().unpinTabs(); } else { getTabbedSelect().unpinTabs(); getTabbedWork().unpinTabs(); getTabbedStatus().unpinTabs(); } }
java
public void unpinVisiblePanels() { if (layout == Layout.FULL) { getTabbedFull().unpinTabs(); } else { getTabbedSelect().unpinTabs(); getTabbedWork().unpinTabs(); getTabbedStatus().unpinTabs(); } }
[ "public", "void", "unpinVisiblePanels", "(", ")", "{", "if", "(", "layout", "==", "Layout", ".", "FULL", ")", "{", "getTabbedFull", "(", ")", ".", "unpinTabs", "(", ")", ";", "}", "else", "{", "getTabbedSelect", "(", ")", ".", "unpinTabs", "(", ")", ...
Unpins all visible panels. @since 2.5.0 @see #pinVisiblePanels() @see AbstractPanel#setPinned(boolean)
[ "Unpins", "all", "visible", "panels", "." ]
0cbe5121f2ae1ecca222513d182759210c569bec
https://github.com/zaproxy/zaproxy/blob/0cbe5121f2ae1ecca222513d182759210c569bec/src/org/parosproxy/paros/view/WorkbenchPanel.java#L1135-L1143
129,722
zaproxy/zaproxy
src/org/parosproxy/paros/view/WorkbenchPanel.java
WorkbenchPanel.setResponsePanelPosition
void setResponsePanelPosition(ResponsePanelPosition position) { validateNotNull(position, "position"); requestTabIndex = getCurrentRequestTabIndex(); responsePanelPosition = position; if (layout == Layout.FULL) { updateFullLayout(); return; } Component currentTabbedPanel = componentMaxim...
java
void setResponsePanelPosition(ResponsePanelPosition position) { validateNotNull(position, "position"); requestTabIndex = getCurrentRequestTabIndex(); responsePanelPosition = position; if (layout == Layout.FULL) { updateFullLayout(); return; } Component currentTabbedPanel = componentMaxim...
[ "void", "setResponsePanelPosition", "(", "ResponsePanelPosition", "position", ")", "{", "validateNotNull", "(", "position", ",", "\"position\"", ")", ";", "requestTabIndex", "=", "getCurrentRequestTabIndex", "(", ")", ";", "responsePanelPosition", "=", "position", ";", ...
Sets the position of the response panel. @param position the position of the response panel @throws IllegalArgumentException if the given parameter is {@code null}. @since 2.5.0
[ "Sets", "the", "position", "of", "the", "response", "panel", "." ]
0cbe5121f2ae1ecca222513d182759210c569bec
https://github.com/zaproxy/zaproxy/blob/0cbe5121f2ae1ecca222513d182759210c569bec/src/org/parosproxy/paros/view/WorkbenchPanel.java#L1175-L1229
129,723
zaproxy/zaproxy
src/org/parosproxy/paros/core/scanner/Analyser.java
Analyser.analyse
private void analyse(StructuralNode node) throws Exception { // if analysed already, return; // move to host part if (node.getHistoryReference() == null) { return; } if (!parent.nodeInScope(node.getName())) { return; } // ZAP: Removed...
java
private void analyse(StructuralNode node) throws Exception { // if analysed already, return; // move to host part if (node.getHistoryReference() == null) { return; } if (!parent.nodeInScope(node.getName())) { return; } // ZAP: Removed...
[ "private", "void", "analyse", "(", "StructuralNode", "node", ")", "throws", "Exception", "{", "// if analysed already, return;\r", "// move to host part\r", "if", "(", "node", ".", "getHistoryReference", "(", ")", "==", "null", ")", "{", "return", ";", "}", "if", ...
Analyse a single folder entity. Results are stored into mAnalysedEntityTable. @param node the node that will be analysed @throws Exception if an error occurred while analysing the node (for example, failed to send the message)
[ "Analyse", "a", "single", "folder", "entity", ".", "Results", "are", "stored", "into", "mAnalysedEntityTable", "." ]
0cbe5121f2ae1ecca222513d182759210c569bec
https://github.com/zaproxy/zaproxy/blob/0cbe5121f2ae1ecca222513d182759210c569bec/src/org/parosproxy/paros/core/scanner/Analyser.java#L145-L225
129,724
zaproxy/zaproxy
src/org/parosproxy/paros/core/scanner/Analyser.java
Analyser.getChildSuffix
private String getChildSuffix(StructuralNode node, boolean performRecursiveCheck) { String resultSuffix = ""; String suffix = null; StructuralNode child = null; try { for (int i = 0; i < staticSuffixList.length; i++) { suffix = staticSuffixList[i]; ...
java
private String getChildSuffix(StructuralNode node, boolean performRecursiveCheck) { String resultSuffix = ""; String suffix = null; StructuralNode child = null; try { for (int i = 0; i < staticSuffixList.length; i++) { suffix = staticSuffixList[i]; ...
[ "private", "String", "getChildSuffix", "(", "StructuralNode", "node", ",", "boolean", "performRecursiveCheck", ")", "{", "String", "resultSuffix", "=", "\"\"", ";", "String", "suffix", "=", "null", ";", "StructuralNode", "child", "=", "null", ";", "try", "{", ...
Get a suffix from the children which exists in staticSuffixList. An option is provided to check recursively. Note that the immediate children are always checked first before further recursive check is done. @param node the node used to obtain the suffix @param performRecursiveCheck True = get recursively the suffix fr...
[ "Get", "a", "suffix", "from", "the", "children", "which", "exists", "in", "staticSuffixList", ".", "An", "option", "is", "provided", "to", "check", "recursively", ".", "Note", "that", "the", "immediate", "children", "are", "always", "checked", "first", "before...
0cbe5121f2ae1ecca222513d182759210c569bec
https://github.com/zaproxy/zaproxy/blob/0cbe5121f2ae1ecca222513d182759210c569bec/src/org/parosproxy/paros/core/scanner/Analyser.java#L238-L274
129,725
zaproxy/zaproxy
src/org/parosproxy/paros/core/scanner/Analyser.java
Analyser.getRandomPathSuffix
private String getRandomPathSuffix(StructuralNode node, URI uri) throws URIException { String resultSuffix = getChildSuffix(node, true); String path = ""; path = (uri.getPath() == null) ? "" : uri.getPath(); path = path + (path.endsWith("/") ? "" : "/") + Long.toString(getRndPositi...
java
private String getRandomPathSuffix(StructuralNode node, URI uri) throws URIException { String resultSuffix = getChildSuffix(node, true); String path = ""; path = (uri.getPath() == null) ? "" : uri.getPath(); path = path + (path.endsWith("/") ? "" : "/") + Long.toString(getRndPositi...
[ "private", "String", "getRandomPathSuffix", "(", "StructuralNode", "node", ",", "URI", "uri", ")", "throws", "URIException", "{", "String", "resultSuffix", "=", "getChildSuffix", "(", "node", ",", "true", ")", ";", "String", "path", "=", "\"\"", ";", "path", ...
Get a random path relative to the current entity. Whenever possible, use a suffix exist in the children according to a priority of staticSuffixList. @param node the node used to construct the random path @param uri The uri of the current entity. @return A random path (eg /folder1/folder2/1234567.chm) relative the enti...
[ "Get", "a", "random", "path", "relative", "to", "the", "current", "entity", ".", "Whenever", "possible", "use", "a", "suffix", "exist", "in", "the", "children", "according", "to", "a", "priority", "of", "staticSuffixList", "." ]
0cbe5121f2ae1ecca222513d182759210c569bec
https://github.com/zaproxy/zaproxy/blob/0cbe5121f2ae1ecca222513d182759210c569bec/src/org/parosproxy/paros/core/scanner/Analyser.java#L313-L323
129,726
zaproxy/zaproxy
src/org/zaproxy/zap/extension/autoupdate/OptionsParamCheckForUpdates.java
OptionsParamCheckForUpdates.setCheckOnStart
public void setCheckOnStart(boolean checkOnStart) { this.checkOnStart = checkOnStart; getConfig().setProperty(CHECK_ON_START, checkOnStart); if (dayLastChecked.length() == 0) { dayLastChecked = "Never"; getConfig().setProperty(DAY_LAST_CHECKED, dayLastChecked); } }
java
public void setCheckOnStart(boolean checkOnStart) { this.checkOnStart = checkOnStart; getConfig().setProperty(CHECK_ON_START, checkOnStart); if (dayLastChecked.length() == 0) { dayLastChecked = "Never"; getConfig().setProperty(DAY_LAST_CHECKED, dayLastChecked); } }
[ "public", "void", "setCheckOnStart", "(", "boolean", "checkOnStart", ")", "{", "this", ".", "checkOnStart", "=", "checkOnStart", ";", "getConfig", "(", ")", ".", "setProperty", "(", "CHECK_ON_START", ",", "checkOnStart", ")", ";", "if", "(", "dayLastChecked", ...
Sets whether or not the "check for updates on start up" is enabled. @param checkOnStart {@code true} if the "check for updates on start up" should be enabled, {@code false} otherwise.
[ "Sets", "whether", "or", "not", "the", "check", "for", "updates", "on", "start", "up", "is", "enabled", "." ]
0cbe5121f2ae1ecca222513d182759210c569bec
https://github.com/zaproxy/zaproxy/blob/0cbe5121f2ae1ecca222513d182759210c569bec/src/org/zaproxy/zap/extension/autoupdate/OptionsParamCheckForUpdates.java#L108-L115
129,727
zaproxy/zaproxy
src/org/parosproxy/paros/extension/manualrequest/http/impl/ManualHttpRequestEditorDialog.java
ManualHttpRequestEditorDialog.getFooterStatusBar
protected JToolBar getFooterStatusBar() { if (footerToolbar == null) { footerToolbar = new JToolBar(); footerToolbar.setEnabled(true); footerToolbar.setFloatable(false); footerToolbar.setRollover(true); footerToolbar.setName("Footer Toolbar Left"); footerToolbar.setBorder(BorderFactory.createEtchedB...
java
protected JToolBar getFooterStatusBar() { if (footerToolbar == null) { footerToolbar = new JToolBar(); footerToolbar.setEnabled(true); footerToolbar.setFloatable(false); footerToolbar.setRollover(true); footerToolbar.setName("Footer Toolbar Left"); footerToolbar.setBorder(BorderFactory.createEtchedB...
[ "protected", "JToolBar", "getFooterStatusBar", "(", ")", "{", "if", "(", "footerToolbar", "==", "null", ")", "{", "footerToolbar", "=", "new", "JToolBar", "(", ")", ";", "footerToolbar", ".", "setEnabled", "(", "true", ")", ";", "footerToolbar", ".", "setFlo...
Return the footer status bar object @return
[ "Return", "the", "footer", "status", "bar", "object" ]
0cbe5121f2ae1ecca222513d182759210c569bec
https://github.com/zaproxy/zaproxy/blob/0cbe5121f2ae1ecca222513d182759210c569bec/src/org/parosproxy/paros/extension/manualrequest/http/impl/ManualHttpRequestEditorDialog.java#L217-L227
129,728
zaproxy/zaproxy
src/org/parosproxy/paros/network/SSLConnector.java
SSLConnector.createSocket
@Override public Socket createSocket(final String host, final int port, final InetAddress localAddress, final int localPort, final HttpConnectionParams params) throws IOException, UnknownHostException, ConnectTimeoutException { if (params == null) { throw new IllegalArgumentException("Parameters ma...
java
@Override public Socket createSocket(final String host, final int port, final InetAddress localAddress, final int localPort, final HttpConnectionParams params) throws IOException, UnknownHostException, ConnectTimeoutException { if (params == null) { throw new IllegalArgumentException("Parameters ma...
[ "@", "Override", "public", "Socket", "createSocket", "(", "final", "String", "host", ",", "final", "int", "port", ",", "final", "InetAddress", "localAddress", ",", "final", "int", "localPort", ",", "final", "HttpConnectionParams", "params", ")", "throws", "IOExc...
Attempts to get a new socket connection to the given host within the given time limit. @param host the host name/IP @param port the port on the host @param localAddress the local host name/IP to bind the socket to @param localPort the port on the local machine @param params {@link HttpConnectionParams Http connection ...
[ "Attempts", "to", "get", "a", "new", "socket", "connection", "to", "the", "given", "host", "within", "the", "given", "time", "limit", "." ]
0cbe5121f2ae1ecca222513d182759210c569bec
https://github.com/zaproxy/zaproxy/blob/0cbe5121f2ae1ecca222513d182759210c569bec/src/org/parosproxy/paros/network/SSLConnector.java#L409-L445
129,729
zaproxy/zaproxy
src/org/zaproxy/zap/spider/SpiderParam.java
SpiderParam.getScopeText
@Deprecated public String getScopeText() { StringBuilder scopeTextStringBuilder = new StringBuilder(""); for (DomainAlwaysInScopeMatcher domainInScope : domainsAlwaysInScope) { if (!domainInScope.isRegex()) { scopeTextStringBuilder.append(domainInScope.getValue()).append(';'); } } return scopeTextStr...
java
@Deprecated public String getScopeText() { StringBuilder scopeTextStringBuilder = new StringBuilder(""); for (DomainAlwaysInScopeMatcher domainInScope : domainsAlwaysInScope) { if (!domainInScope.isRegex()) { scopeTextStringBuilder.append(domainInScope.getValue()).append(';'); } } return scopeTextStr...
[ "@", "Deprecated", "public", "String", "getScopeText", "(", ")", "{", "StringBuilder", "scopeTextStringBuilder", "=", "new", "StringBuilder", "(", "\"\"", ")", ";", "for", "(", "DomainAlwaysInScopeMatcher", "domainInScope", ":", "domainsAlwaysInScope", ")", "{", "if...
Gets the text describing the text. @return returns the scope. @deprecated (2.3.0) Replaced by {@link #getDomainsAlwaysInScope()} and {@link #getDomainsAlwaysInScopeEnabled()}. <strong>Note:</strong> Newer regular expression excluded domains will not be returned by this method.
[ "Gets", "the", "text", "describing", "the", "text", "." ]
0cbe5121f2ae1ecca222513d182759210c569bec
https://github.com/zaproxy/zaproxy/blob/0cbe5121f2ae1ecca222513d182759210c569bec/src/org/zaproxy/zap/spider/SpiderParam.java#L372-L381
129,730
zaproxy/zaproxy
src/org/zaproxy/zap/spider/SpiderParam.java
SpiderParam.getScope
@Deprecated public String getScope() { StringBuilder scopeTextStringBuilder = new StringBuilder(); for (DomainAlwaysInScopeMatcher domainInScope : domainsAlwaysInScope) { if (domainInScope.isRegex()) { scopeTextStringBuilder.append("\\Q").append(domainInScope.getValue()).app...
java
@Deprecated public String getScope() { StringBuilder scopeTextStringBuilder = new StringBuilder(); for (DomainAlwaysInScopeMatcher domainInScope : domainsAlwaysInScope) { if (domainInScope.isRegex()) { scopeTextStringBuilder.append("\\Q").append(domainInScope.getValue()).app...
[ "@", "Deprecated", "public", "String", "getScope", "(", ")", "{", "StringBuilder", "scopeTextStringBuilder", "=", "new", "StringBuilder", "(", ")", ";", "for", "(", "DomainAlwaysInScopeMatcher", "domainInScope", ":", "domainsAlwaysInScope", ")", "{", "if", "(", "d...
Gets the scope's regex. @return returns the scope. @deprecated (2.3.0) Replaced by {@link #getDomainsAlwaysInScope()} and {@link #getDomainsAlwaysInScopeEnabled()}.
[ "Gets", "the", "scope", "s", "regex", "." ]
0cbe5121f2ae1ecca222513d182759210c569bec
https://github.com/zaproxy/zaproxy/blob/0cbe5121f2ae1ecca222513d182759210c569bec/src/org/zaproxy/zap/spider/SpiderParam.java#L389-L407
129,731
zaproxy/zaproxy
src/org/zaproxy/zap/spider/SpiderParam.java
SpiderParam.setThreadCount
public void setThreadCount(int thread) { this.threadCount = thread; getConfig().setProperty(SPIDER_THREAD, Integer.toString(this.threadCount)); }
java
public void setThreadCount(int thread) { this.threadCount = thread; getConfig().setProperty(SPIDER_THREAD, Integer.toString(this.threadCount)); }
[ "public", "void", "setThreadCount", "(", "int", "thread", ")", "{", "this", ".", "threadCount", "=", "thread", ";", "getConfig", "(", ")", ".", "setProperty", "(", "SPIDER_THREAD", ",", "Integer", ".", "toString", "(", "this", ".", "threadCount", ")", ")",...
Sets the thread count. @param thread The thread count to set.
[ "Sets", "the", "thread", "count", "." ]
0cbe5121f2ae1ecca222513d182759210c569bec
https://github.com/zaproxy/zaproxy/blob/0cbe5121f2ae1ecca222513d182759210c569bec/src/org/zaproxy/zap/spider/SpiderParam.java#L434-L437
129,732
zaproxy/zaproxy
src/org/zaproxy/zap/spider/SpiderParam.java
SpiderParam.setProcessForm
public void setProcessForm(boolean processForm) { this.processForm = processForm; getConfig().setProperty(SPIDER_PROCESS_FORM, Boolean.toString(processForm)); }
java
public void setProcessForm(boolean processForm) { this.processForm = processForm; getConfig().setProperty(SPIDER_PROCESS_FORM, Boolean.toString(processForm)); }
[ "public", "void", "setProcessForm", "(", "boolean", "processForm", ")", "{", "this", ".", "processForm", "=", "processForm", ";", "getConfig", "(", ")", ".", "setProperty", "(", "SPIDER_PROCESS_FORM", ",", "Boolean", ".", "toString", "(", "processForm", ")", "...
Sets if the forms should be processed. @param processForm the new process form status
[ "Sets", "if", "the", "forms", "should", "be", "processed", "." ]
0cbe5121f2ae1ecca222513d182759210c569bec
https://github.com/zaproxy/zaproxy/blob/0cbe5121f2ae1ecca222513d182759210c569bec/src/org/zaproxy/zap/spider/SpiderParam.java#L475-L478
129,733
zaproxy/zaproxy
src/org/zaproxy/zap/spider/SpiderParam.java
SpiderParam.setSkipURLString
public void setSkipURLString(String skipURL) { this.skipURL = skipURL; getConfig().setProperty(SPIDER_SKIP_URL, this.skipURL); parseSkipURL(this.skipURL); }
java
public void setSkipURLString(String skipURL) { this.skipURL = skipURL; getConfig().setProperty(SPIDER_SKIP_URL, this.skipURL); parseSkipURL(this.skipURL); }
[ "public", "void", "setSkipURLString", "(", "String", "skipURL", ")", "{", "this", ".", "skipURL", "=", "skipURL", ";", "getConfig", "(", ")", ".", "setProperty", "(", "SPIDER_SKIP_URL", ",", "this", ".", "skipURL", ")", ";", "parseSkipURL", "(", "this", "....
Sets the skip url string. This string is being parsed into a pattern which is used to check if a url should be skipped while crawling. @param skipURL the new skip url string
[ "Sets", "the", "skip", "url", "string", ".", "This", "string", "is", "being", "parsed", "into", "a", "pattern", "which", "is", "used", "to", "check", "if", "a", "url", "should", "be", "skipped", "while", "crawling", "." ]
0cbe5121f2ae1ecca222513d182759210c569bec
https://github.com/zaproxy/zaproxy/blob/0cbe5121f2ae1ecca222513d182759210c569bec/src/org/zaproxy/zap/spider/SpiderParam.java#L486-L490
129,734
zaproxy/zaproxy
src/org/zaproxy/zap/spider/SpiderParam.java
SpiderParam.isSkipURL
public boolean isSkipURL(URI uri) { if (patternSkipURL == null || uri == null) { return false; } String sURI = uri.toString(); return patternSkipURL.matcher(sURI).find(); }
java
public boolean isSkipURL(URI uri) { if (patternSkipURL == null || uri == null) { return false; } String sURI = uri.toString(); return patternSkipURL.matcher(sURI).find(); }
[ "public", "boolean", "isSkipURL", "(", "URI", "uri", ")", "{", "if", "(", "patternSkipURL", "==", "null", "||", "uri", "==", "null", ")", "{", "return", "false", ";", "}", "String", "sURI", "=", "uri", ".", "toString", "(", ")", ";", "return", "patte...
Checks if is this url should be skipped. @param uri the uri @return true, if the url should be skipped
[ "Checks", "if", "is", "this", "url", "should", "be", "skipped", "." ]
0cbe5121f2ae1ecca222513d182759210c569bec
https://github.com/zaproxy/zaproxy/blob/0cbe5121f2ae1ecca222513d182759210c569bec/src/org/zaproxy/zap/spider/SpiderParam.java#L507-L513
129,735
zaproxy/zaproxy
src/org/zaproxy/zap/spider/SpiderParam.java
SpiderParam.parseSkipURL
private void parseSkipURL(String skipURL) { patternSkipURL = null; if (skipURL == null || skipURL.equals("")) { return; } skipURL = skipURL.replaceAll("\\.", "\\\\."); skipURL = skipURL.replaceAll("\\*", ".*?").replaceAll("(\\s+$)|(^\\s+)", ""); skipURL = "\\A(" + skipURL.replaceAll("\\s+", "|") + ")";...
java
private void parseSkipURL(String skipURL) { patternSkipURL = null; if (skipURL == null || skipURL.equals("")) { return; } skipURL = skipURL.replaceAll("\\.", "\\\\."); skipURL = skipURL.replaceAll("\\*", ".*?").replaceAll("(\\s+$)|(^\\s+)", ""); skipURL = "\\A(" + skipURL.replaceAll("\\s+", "|") + ")";...
[ "private", "void", "parseSkipURL", "(", "String", "skipURL", ")", "{", "patternSkipURL", "=", "null", ";", "if", "(", "skipURL", "==", "null", "||", "skipURL", ".", "equals", "(", "\"\"", ")", ")", "{", "return", ";", "}", "skipURL", "=", "skipURL", "....
Parses the skip url string. @param skipURL the skip url string
[ "Parses", "the", "skip", "url", "string", "." ]
0cbe5121f2ae1ecca222513d182759210c569bec
https://github.com/zaproxy/zaproxy/blob/0cbe5121f2ae1ecca222513d182759210c569bec/src/org/zaproxy/zap/spider/SpiderParam.java#L520-L531
129,736
zaproxy/zaproxy
src/org/zaproxy/zap/spider/SpiderParam.java
SpiderParam.setRequestWaitTime
public void setRequestWaitTime(int requestWait) { this.requestWait = requestWait; this.getConfig().setProperty(SPIDER_REQUEST_WAIT, Integer.toString(requestWait)); }
java
public void setRequestWaitTime(int requestWait) { this.requestWait = requestWait; this.getConfig().setProperty(SPIDER_REQUEST_WAIT, Integer.toString(requestWait)); }
[ "public", "void", "setRequestWaitTime", "(", "int", "requestWait", ")", "{", "this", ".", "requestWait", "=", "requestWait", ";", "this", ".", "getConfig", "(", ")", ".", "setProperty", "(", "SPIDER_REQUEST_WAIT", ",", "Integer", ".", "toString", "(", "request...
Sets the time between the requests sent to a server. @param requestWait the new request wait time
[ "Sets", "the", "time", "between", "the", "requests", "sent", "to", "a", "server", "." ]
0cbe5121f2ae1ecca222513d182759210c569bec
https://github.com/zaproxy/zaproxy/blob/0cbe5121f2ae1ecca222513d182759210c569bec/src/org/zaproxy/zap/spider/SpiderParam.java#L547-L550
129,737
zaproxy/zaproxy
src/org/zaproxy/zap/spider/SpiderParam.java
SpiderParam.setParseComments
public void setParseComments(boolean parseComments) { this.parseComments = parseComments; getConfig().setProperty(SPIDER_PARSE_COMMENTS, Boolean.toString(parseComments)); }
java
public void setParseComments(boolean parseComments) { this.parseComments = parseComments; getConfig().setProperty(SPIDER_PARSE_COMMENTS, Boolean.toString(parseComments)); }
[ "public", "void", "setParseComments", "(", "boolean", "parseComments", ")", "{", "this", ".", "parseComments", "=", "parseComments", ";", "getConfig", "(", ")", ".", "setProperty", "(", "SPIDER_PARSE_COMMENTS", ",", "Boolean", ".", "toString", "(", "parseComments"...
Sets the whether the spider parses the comments. @param parseComments the new parses the comments value
[ "Sets", "the", "whether", "the", "spider", "parses", "the", "comments", "." ]
0cbe5121f2ae1ecca222513d182759210c569bec
https://github.com/zaproxy/zaproxy/blob/0cbe5121f2ae1ecca222513d182759210c569bec/src/org/zaproxy/zap/spider/SpiderParam.java#L584-L587
129,738
zaproxy/zaproxy
src/org/zaproxy/zap/spider/SpiderParam.java
SpiderParam.setParseSitemapXml
public void setParseSitemapXml(boolean parseSitemapXml) { this.parseSitemapXml = parseSitemapXml; getConfig().setProperty(SPIDER_PARSE_SITEMAP_XML, Boolean.toString(parseSitemapXml)); }
java
public void setParseSitemapXml(boolean parseSitemapXml) { this.parseSitemapXml = parseSitemapXml; getConfig().setProperty(SPIDER_PARSE_SITEMAP_XML, Boolean.toString(parseSitemapXml)); }
[ "public", "void", "setParseSitemapXml", "(", "boolean", "parseSitemapXml", ")", "{", "this", ".", "parseSitemapXml", "=", "parseSitemapXml", ";", "getConfig", "(", ")", ".", "setProperty", "(", "SPIDER_PARSE_SITEMAP_XML", ",", "Boolean", ".", "toString", "(", "par...
Sets the whether the spider parses the sitemap.xml for URIs. @param parseSitemapXml the new value for parseSitemapXml
[ "Sets", "the", "whether", "the", "spider", "parses", "the", "sitemap", ".", "xml", "for", "URIs", "." ]
0cbe5121f2ae1ecca222513d182759210c569bec
https://github.com/zaproxy/zaproxy/blob/0cbe5121f2ae1ecca222513d182759210c569bec/src/org/zaproxy/zap/spider/SpiderParam.java#L640-L643
129,739
zaproxy/zaproxy
src/org/zaproxy/zap/spider/SpiderParam.java
SpiderParam.setParseGit
public void setParseGit(boolean parseGit) { this.parseGit = parseGit; getConfig().setProperty(SPIDER_PARSE_GIT, Boolean.toString(parseGit)); }
java
public void setParseGit(boolean parseGit) { this.parseGit = parseGit; getConfig().setProperty(SPIDER_PARSE_GIT, Boolean.toString(parseGit)); }
[ "public", "void", "setParseGit", "(", "boolean", "parseGit", ")", "{", "this", ".", "parseGit", "=", "parseGit", ";", "getConfig", "(", ")", ".", "setProperty", "(", "SPIDER_PARSE_GIT", ",", "Boolean", ".", "toString", "(", "parseGit", ")", ")", ";", "}" ]
Sets the whether the spider parses Git files for URIs @param parseGit the new value for parseGit
[ "Sets", "the", "whether", "the", "spider", "parses", "Git", "files", "for", "URIs" ]
0cbe5121f2ae1ecca222513d182759210c569bec
https://github.com/zaproxy/zaproxy/blob/0cbe5121f2ae1ecca222513d182759210c569bec/src/org/zaproxy/zap/spider/SpiderParam.java#L660-L663
129,740
zaproxy/zaproxy
src/org/zaproxy/zap/spider/SpiderParam.java
SpiderParam.setDomainsAlwaysInScope
public void setDomainsAlwaysInScope(List<DomainAlwaysInScopeMatcher> domainsAlwaysInScope) { if (domainsAlwaysInScope == null || domainsAlwaysInScope.isEmpty()) { ((HierarchicalConfiguration) getConfig()).clearTree(ALL_DOMAINS_ALWAYS_IN_SCOPE_KEY); this.domainsAlwaysInScope = Collection...
java
public void setDomainsAlwaysInScope(List<DomainAlwaysInScopeMatcher> domainsAlwaysInScope) { if (domainsAlwaysInScope == null || domainsAlwaysInScope.isEmpty()) { ((HierarchicalConfiguration) getConfig()).clearTree(ALL_DOMAINS_ALWAYS_IN_SCOPE_KEY); this.domainsAlwaysInScope = Collection...
[ "public", "void", "setDomainsAlwaysInScope", "(", "List", "<", "DomainAlwaysInScopeMatcher", ">", "domainsAlwaysInScope", ")", "{", "if", "(", "domainsAlwaysInScope", "==", "null", "||", "domainsAlwaysInScope", ".", "isEmpty", "(", ")", ")", "{", "(", "(", "Hierar...
Sets the domains that will be always in scope. @param domainsAlwaysInScope the domains that will be excluded. @since 2.3.0
[ "Sets", "the", "domains", "that", "will", "be", "always", "in", "scope", "." ]
0cbe5121f2ae1ecca222513d182759210c569bec
https://github.com/zaproxy/zaproxy/blob/0cbe5121f2ae1ecca222513d182759210c569bec/src/org/zaproxy/zap/spider/SpiderParam.java#L750-L780
129,741
zaproxy/zaproxy
src/org/zaproxy/zap/spider/SpiderParam.java
SpiderParam.setSendRefererHeader
public void setSendRefererHeader(boolean send) { if (send == sendRefererHeader) { return; } this.sendRefererHeader = send; getConfig().setProperty(SPIDER_SENDER_REFERER_HEADER, this.sendRefererHeader); }
java
public void setSendRefererHeader(boolean send) { if (send == sendRefererHeader) { return; } this.sendRefererHeader = send; getConfig().setProperty(SPIDER_SENDER_REFERER_HEADER, this.sendRefererHeader); }
[ "public", "void", "setSendRefererHeader", "(", "boolean", "send", ")", "{", "if", "(", "send", "==", "sendRefererHeader", ")", "{", "return", ";", "}", "this", ".", "sendRefererHeader", "=", "send", ";", "getConfig", "(", ")", ".", "setProperty", "(", "SPI...
Sets whether or not the "Referer" header should be sent in spider requests. @param send {@code true} if the "Referer" header should be sent in spider requests, {@code false} otherwise @since 2.4.0
[ "Sets", "whether", "or", "not", "the", "Referer", "header", "should", "be", "sent", "in", "spider", "requests", "." ]
0cbe5121f2ae1ecca222513d182759210c569bec
https://github.com/zaproxy/zaproxy/blob/0cbe5121f2ae1ecca222513d182759210c569bec/src/org/zaproxy/zap/spider/SpiderParam.java#L877-L884
129,742
zaproxy/zaproxy
src/org/zaproxy/zap/scan/BaseScannerThread.java
BaseScannerThread.setPaused
public void setPaused(boolean paused) { // Make use of a lock when modifying the paused variable to avoid any race conditions pauseLock.lock(); this.paused = paused; // Wake up all threads that are currently paused if (!this.paused) pausedCondition.signalAll(); pauseLock.unlock(); }
java
public void setPaused(boolean paused) { // Make use of a lock when modifying the paused variable to avoid any race conditions pauseLock.lock(); this.paused = paused; // Wake up all threads that are currently paused if (!this.paused) pausedCondition.signalAll(); pauseLock.unlock(); }
[ "public", "void", "setPaused", "(", "boolean", "paused", ")", "{", "// Make use of a lock when modifying the paused variable to avoid any race conditions", "pauseLock", ".", "lock", "(", ")", ";", "this", ".", "paused", "=", "paused", ";", "// Wake up all threads that are c...
Sets the paused state of the thread and, if the thread needs to be resumed and was paused and sleeping, it gets signaled. @param paused whether the thread should be paused or not @see #checkPausedAndWait()
[ "Sets", "the", "paused", "state", "of", "the", "thread", "and", "if", "the", "thread", "needs", "to", "be", "resumed", "and", "was", "paused", "and", "sleeping", "it", "gets", "signaled", "." ]
0cbe5121f2ae1ecca222513d182759210c569bec
https://github.com/zaproxy/zaproxy/blob/0cbe5121f2ae1ecca222513d182759210c569bec/src/org/zaproxy/zap/scan/BaseScannerThread.java#L145-L153
129,743
zaproxy/zaproxy
src/org/zaproxy/zap/extension/keyboard/DialogEditShortcut.java
DialogEditShortcut.checkDuplicate
private void checkDuplicate() { KeyboardShortcut ks = this.getDuplicate(); if (ks != null) { this.setFieldValue(FIELD_INFO, Constant.messages.getString("keyboard.dialog.warning.dup", ks.getName())); } else { this.setFieldValue(FIELD_INFO, ""); } }
java
private void checkDuplicate() { KeyboardShortcut ks = this.getDuplicate(); if (ks != null) { this.setFieldValue(FIELD_INFO, Constant.messages.getString("keyboard.dialog.warning.dup", ks.getName())); } else { this.setFieldValue(FIELD_INFO, ""); } }
[ "private", "void", "checkDuplicate", "(", ")", "{", "KeyboardShortcut", "ks", "=", "this", ".", "getDuplicate", "(", ")", ";", "if", "(", "ks", "!=", "null", ")", "{", "this", ".", "setFieldValue", "(", "FIELD_INFO", ",", "Constant", ".", "messages", "."...
Checks to see if the chosen shortcut is already being used and if so shows a message warning the user
[ "Checks", "to", "see", "if", "the", "chosen", "shortcut", "is", "already", "being", "used", "and", "if", "so", "shows", "a", "message", "warning", "the", "user" ]
0cbe5121f2ae1ecca222513d182759210c569bec
https://github.com/zaproxy/zaproxy/blob/0cbe5121f2ae1ecca222513d182759210c569bec/src/org/zaproxy/zap/extension/keyboard/DialogEditShortcut.java#L98-L105
129,744
scala/scala
src/library/scala/collection/concurrent/MainNode.java
MainNode.READ_PREV
@Deprecated @SuppressWarnings("unchecked") public MainNode<K, V> READ_PREV() { return (MainNode<K, V>) updater.get(this); }
java
@Deprecated @SuppressWarnings("unchecked") public MainNode<K, V> READ_PREV() { return (MainNode<K, V>) updater.get(this); }
[ "@", "Deprecated", "@", "SuppressWarnings", "(", "\"unchecked\"", ")", "public", "MainNode", "<", "K", ",", "V", ">", "READ_PREV", "(", ")", "{", "return", "(", "MainNode", "<", "K", ",", "V", ">", ")", "updater", ".", "get", "(", "this", ")", ";", ...
irregardless of whether there are concurrent ARFU updates
[ "irregardless", "of", "whether", "there", "are", "concurrent", "ARFU", "updates" ]
bec2441a24cbf3159a1118049b857a5ae7c452eb
https://github.com/scala/scala/blob/bec2441a24cbf3159a1118049b857a5ae7c452eb/src/library/scala/collection/concurrent/MainNode.java#L40-L43
129,745
scala/scala
src/library/scala/runtime/Statics.java
Statics.avalanche
public static int avalanche(int h) { h ^= h >>> 16; h *= 0x85ebca6b; h ^= h >>> 13; h *= 0xc2b2ae35; h ^= h >>> 16; return h; }
java
public static int avalanche(int h) { h ^= h >>> 16; h *= 0x85ebca6b; h ^= h >>> 13; h *= 0xc2b2ae35; h ^= h >>> 16; return h; }
[ "public", "static", "int", "avalanche", "(", "int", "h", ")", "{", "h", "^=", "h", ">>>", "16", ";", "h", "*=", "0x85ebca6b", ";", "h", "^=", "h", ">>>", "13", ";", "h", "*=", "0xc2b2ae35", ";", "h", "^=", "h", ">>>", "16", ";", "return", "h", ...
Force all bits of the hash to avalanche. Used for finalizing the hash.
[ "Force", "all", "bits", "of", "the", "hash", "to", "avalanche", ".", "Used", "for", "finalizing", "the", "hash", "." ]
bec2441a24cbf3159a1118049b857a5ae7c452eb
https://github.com/scala/scala/blob/bec2441a24cbf3159a1118049b857a5ae7c452eb/src/library/scala/runtime/Statics.java#L45-L53
129,746
scala/scala
src/library/scala/runtime/BoxesRunTime.java
BoxesRunTime.typeCode
private static int typeCode(Object a) { if (a instanceof java.lang.Integer) return INT; if (a instanceof java.lang.Double) return DOUBLE; if (a instanceof java.lang.Long) return LONG; if (a instanceof java.lang.Character) return CHAR; if (a instanceof java.lang.Float) return FLOA...
java
private static int typeCode(Object a) { if (a instanceof java.lang.Integer) return INT; if (a instanceof java.lang.Double) return DOUBLE; if (a instanceof java.lang.Long) return LONG; if (a instanceof java.lang.Character) return CHAR; if (a instanceof java.lang.Float) return FLOA...
[ "private", "static", "int", "typeCode", "(", "Object", "a", ")", "{", "if", "(", "a", "instanceof", "java", ".", "lang", ".", "Integer", ")", "return", "INT", ";", "if", "(", "a", "instanceof", "java", ".", "lang", ".", "Double", ")", "return", "DOUB...
We don't need to return BYTE and SHORT, as everything which might care widens to INT.
[ "We", "don", "t", "need", "to", "return", "BYTE", "and", "SHORT", "as", "everything", "which", "might", "care", "widens", "to", "INT", "." ]
bec2441a24cbf3159a1118049b857a5ae7c452eb
https://github.com/scala/scala/blob/bec2441a24cbf3159a1118049b857a5ae7c452eb/src/library/scala/runtime/BoxesRunTime.java#L35-L43
129,747
scala/scala
src/library/scala/runtime/BoxesRunTime.java
BoxesRunTime.equals2
public static boolean equals2(Object x, Object y) { if (x instanceof java.lang.Number) return equalsNumObject((java.lang.Number)x, y); if (x instanceof java.lang.Character) return equalsCharObject((java.lang.Character)x, y); if (x == null) return y == null; ...
java
public static boolean equals2(Object x, Object y) { if (x instanceof java.lang.Number) return equalsNumObject((java.lang.Number)x, y); if (x instanceof java.lang.Character) return equalsCharObject((java.lang.Character)x, y); if (x == null) return y == null; ...
[ "public", "static", "boolean", "equals2", "(", "Object", "x", ",", "Object", "y", ")", "{", "if", "(", "x", "instanceof", "java", ".", "lang", ".", "Number", ")", "return", "equalsNumObject", "(", "(", "java", ".", "lang", ".", "Number", ")", "x", ",...
Since all applicable logic has to be present in the equals method of a ScalaNumber in any case, we dispatch to it as soon as we spot one on either side.
[ "Since", "all", "applicable", "logic", "has", "to", "be", "present", "in", "the", "equals", "method", "of", "a", "ScalaNumber", "in", "any", "case", "we", "dispatch", "to", "it", "as", "soon", "as", "we", "spot", "one", "on", "either", "side", "." ]
bec2441a24cbf3159a1118049b857a5ae7c452eb
https://github.com/scala/scala/blob/bec2441a24cbf3159a1118049b857a5ae7c452eb/src/library/scala/runtime/BoxesRunTime.java#L126-L135
129,748
scala/scala
src/library/scala/runtime/BoxesRunTime.java
BoxesRunTime.add
public static Object add(Object arg1, Object arg2) throws NoSuchMethodException { int code1 = typeCode(arg1); int code2 = typeCode(arg2); int maxcode = (code1 < code2) ? code2 : code1; if (maxcode <= INT) { return boxToInteger(unboxCharOrInt(arg1, code1) + unboxCharOrInt(arg2...
java
public static Object add(Object arg1, Object arg2) throws NoSuchMethodException { int code1 = typeCode(arg1); int code2 = typeCode(arg2); int maxcode = (code1 < code2) ? code2 : code1; if (maxcode <= INT) { return boxToInteger(unboxCharOrInt(arg1, code1) + unboxCharOrInt(arg2...
[ "public", "static", "Object", "add", "(", "Object", "arg1", ",", "Object", "arg2", ")", "throws", "NoSuchMethodException", "{", "int", "code1", "=", "typeCode", "(", "arg1", ")", ";", "int", "code2", "=", "typeCode", "(", "arg2", ")", ";", "int", "maxcod...
arg1 + arg2
[ "arg1", "+", "arg2" ]
bec2441a24cbf3159a1118049b857a5ae7c452eb
https://github.com/scala/scala/blob/bec2441a24cbf3159a1118049b857a5ae7c452eb/src/library/scala/runtime/BoxesRunTime.java#L228-L245
129,749
scala/scala
src/library/scala/runtime/BoxesRunTime.java
BoxesRunTime.shiftSignedRight
public static Object shiftSignedRight(Object arg1, Object arg2) throws NoSuchMethodException { int code1 = typeCode(arg1); int code2 = typeCode(arg2); if (code1 <= INT) { int val1 = unboxCharOrInt(arg1, code1); if (code2 <= INT) { int val2 = unboxCharOrInt...
java
public static Object shiftSignedRight(Object arg1, Object arg2) throws NoSuchMethodException { int code1 = typeCode(arg1); int code2 = typeCode(arg2); if (code1 <= INT) { int val1 = unboxCharOrInt(arg1, code1); if (code2 <= INT) { int val2 = unboxCharOrInt...
[ "public", "static", "Object", "shiftSignedRight", "(", "Object", "arg1", ",", "Object", "arg2", ")", "throws", "NoSuchMethodException", "{", "int", "code1", "=", "typeCode", "(", "arg1", ")", ";", "int", "code2", "=", "typeCode", "(", "arg2", ")", ";", "if...
arg1 >> arg2
[ "arg1", ">>", "arg2" ]
bec2441a24cbf3159a1118049b857a5ae7c452eb
https://github.com/scala/scala/blob/bec2441a24cbf3159a1118049b857a5ae7c452eb/src/library/scala/runtime/BoxesRunTime.java#L324-L350
129,750
scala/scala
src/library/scala/runtime/BoxesRunTime.java
BoxesRunTime.takeAnd
public static Object takeAnd(Object arg1, Object arg2) throws NoSuchMethodException { if ((arg1 instanceof Boolean) || (arg2 instanceof Boolean)) { if ((arg1 instanceof Boolean) && (arg2 instanceof Boolean)) return boxToBoolean(((java.lang.Boolean) arg1).booleanValue() & ((java.lang....
java
public static Object takeAnd(Object arg1, Object arg2) throws NoSuchMethodException { if ((arg1 instanceof Boolean) || (arg2 instanceof Boolean)) { if ((arg1 instanceof Boolean) && (arg2 instanceof Boolean)) return boxToBoolean(((java.lang.Boolean) arg1).booleanValue() & ((java.lang....
[ "public", "static", "Object", "takeAnd", "(", "Object", "arg1", ",", "Object", "arg2", ")", "throws", "NoSuchMethodException", "{", "if", "(", "(", "arg1", "instanceof", "Boolean", ")", "||", "(", "arg2", "instanceof", "Boolean", ")", ")", "{", "if", "(", ...
arg1 & arg2
[ "arg1", "&", "arg2" ]
bec2441a24cbf3159a1118049b857a5ae7c452eb
https://github.com/scala/scala/blob/bec2441a24cbf3159a1118049b857a5ae7c452eb/src/library/scala/runtime/BoxesRunTime.java#L451-L468
129,751
scala/scala
src/library/scala/runtime/BoxesRunTime.java
BoxesRunTime.takeConditionalAnd
public static Object takeConditionalAnd(Object arg1, Object arg2) throws NoSuchMethodException { if ((arg1 instanceof Boolean) && (arg2 instanceof Boolean)) { return boxToBoolean(((java.lang.Boolean) arg1).booleanValue() && ((java.lang.Boolean) arg2).booleanValue()); } throw new NoSu...
java
public static Object takeConditionalAnd(Object arg1, Object arg2) throws NoSuchMethodException { if ((arg1 instanceof Boolean) && (arg2 instanceof Boolean)) { return boxToBoolean(((java.lang.Boolean) arg1).booleanValue() && ((java.lang.Boolean) arg2).booleanValue()); } throw new NoSu...
[ "public", "static", "Object", "takeConditionalAnd", "(", "Object", "arg1", ",", "Object", "arg2", ")", "throws", "NoSuchMethodException", "{", "if", "(", "(", "arg1", "instanceof", "Boolean", ")", "&&", "(", "arg2", "instanceof", "Boolean", ")", ")", "{", "r...
arg1 && arg2
[ "arg1", "&&", "arg2" ]
bec2441a24cbf3159a1118049b857a5ae7c452eb
https://github.com/scala/scala/blob/bec2441a24cbf3159a1118049b857a5ae7c452eb/src/library/scala/runtime/BoxesRunTime.java#L511-L516
129,752
scala/scala
src/library/scala/runtime/BoxesRunTime.java
BoxesRunTime.toCharacter
public static java.lang.Character toCharacter(Object arg) throws NoSuchMethodException { if (arg instanceof java.lang.Integer) return boxToCharacter((char)unboxToInt(arg)); if (arg instanceof java.lang.Short) return boxToCharacter((char)unboxToShort(arg)); if (arg instanceof java.lang.Character)...
java
public static java.lang.Character toCharacter(Object arg) throws NoSuchMethodException { if (arg instanceof java.lang.Integer) return boxToCharacter((char)unboxToInt(arg)); if (arg instanceof java.lang.Short) return boxToCharacter((char)unboxToShort(arg)); if (arg instanceof java.lang.Character)...
[ "public", "static", "java", ".", "lang", ".", "Character", "toCharacter", "(", "Object", "arg", ")", "throws", "NoSuchMethodException", "{", "if", "(", "arg", "instanceof", "java", ".", "lang", ".", "Integer", ")", "return", "boxToCharacter", "(", "(", "char...
arg.toChar
[ "arg", ".", "toChar" ]
bec2441a24cbf3159a1118049b857a5ae7c452eb
https://github.com/scala/scala/blob/bec2441a24cbf3159a1118049b857a5ae7c452eb/src/library/scala/runtime/BoxesRunTime.java#L678-L687
129,753
scala/scala
src/library/scala/runtime/BoxesRunTime.java
BoxesRunTime.toByte
public static java.lang.Byte toByte(Object arg) throws NoSuchMethodException { if (arg instanceof java.lang.Integer) return boxToByte((byte)unboxToInt(arg)); if (arg instanceof java.lang.Character) return boxToByte((byte)unboxToChar(arg)); if (arg instanceof java.lang.Byte) return (java.lang.Byt...
java
public static java.lang.Byte toByte(Object arg) throws NoSuchMethodException { if (arg instanceof java.lang.Integer) return boxToByte((byte)unboxToInt(arg)); if (arg instanceof java.lang.Character) return boxToByte((byte)unboxToChar(arg)); if (arg instanceof java.lang.Byte) return (java.lang.Byt...
[ "public", "static", "java", ".", "lang", ".", "Byte", "toByte", "(", "Object", "arg", ")", "throws", "NoSuchMethodException", "{", "if", "(", "arg", "instanceof", "java", ".", "lang", ".", "Integer", ")", "return", "boxToByte", "(", "(", "byte", ")", "un...
arg.toByte
[ "arg", ".", "toByte" ]
bec2441a24cbf3159a1118049b857a5ae7c452eb
https://github.com/scala/scala/blob/bec2441a24cbf3159a1118049b857a5ae7c452eb/src/library/scala/runtime/BoxesRunTime.java#L690-L699
129,754
scala/scala
src/library/scala/runtime/BoxesRunTime.java
BoxesRunTime.toShort
public static java.lang.Short toShort(Object arg) throws NoSuchMethodException { if (arg instanceof java.lang.Integer) return boxToShort((short)unboxToInt(arg)); if (arg instanceof java.lang.Long) return boxToShort((short)unboxToLong(arg)); if (arg instanceof java.lang.Character) return boxToSho...
java
public static java.lang.Short toShort(Object arg) throws NoSuchMethodException { if (arg instanceof java.lang.Integer) return boxToShort((short)unboxToInt(arg)); if (arg instanceof java.lang.Long) return boxToShort((short)unboxToLong(arg)); if (arg instanceof java.lang.Character) return boxToSho...
[ "public", "static", "java", ".", "lang", ".", "Short", "toShort", "(", "Object", "arg", ")", "throws", "NoSuchMethodException", "{", "if", "(", "arg", "instanceof", "java", ".", "lang", ".", "Integer", ")", "return", "boxToShort", "(", "(", "short", ")", ...
arg.toShort
[ "arg", ".", "toShort" ]
bec2441a24cbf3159a1118049b857a5ae7c452eb
https://github.com/scala/scala/blob/bec2441a24cbf3159a1118049b857a5ae7c452eb/src/library/scala/runtime/BoxesRunTime.java#L702-L711
129,755
scala/scala
src/library/scala/runtime/BoxesRunTime.java
BoxesRunTime.toInteger
public static java.lang.Integer toInteger(Object arg) throws NoSuchMethodException { if (arg instanceof java.lang.Integer) return (java.lang.Integer)arg; if (arg instanceof java.lang.Long) return boxToInteger((int)unboxToLong(arg)); if (arg instanceof java.lang.Double) return boxToInteger((int)u...
java
public static java.lang.Integer toInteger(Object arg) throws NoSuchMethodException { if (arg instanceof java.lang.Integer) return (java.lang.Integer)arg; if (arg instanceof java.lang.Long) return boxToInteger((int)unboxToLong(arg)); if (arg instanceof java.lang.Double) return boxToInteger((int)u...
[ "public", "static", "java", ".", "lang", ".", "Integer", "toInteger", "(", "Object", "arg", ")", "throws", "NoSuchMethodException", "{", "if", "(", "arg", "instanceof", "java", ".", "lang", ".", "Integer", ")", "return", "(", "java", ".", "lang", ".", "I...
arg.toInt
[ "arg", ".", "toInt" ]
bec2441a24cbf3159a1118049b857a5ae7c452eb
https://github.com/scala/scala/blob/bec2441a24cbf3159a1118049b857a5ae7c452eb/src/library/scala/runtime/BoxesRunTime.java#L714-L723
129,756
scala/scala
src/library/scala/runtime/BoxesRunTime.java
BoxesRunTime.toLong
public static java.lang.Long toLong(Object arg) throws NoSuchMethodException { if (arg instanceof java.lang.Integer) return boxToLong((long)unboxToInt(arg)); if (arg instanceof java.lang.Double) return boxToLong((long)unboxToDouble(arg)); if (arg instanceof java.lang.Float) return boxToLong((lon...
java
public static java.lang.Long toLong(Object arg) throws NoSuchMethodException { if (arg instanceof java.lang.Integer) return boxToLong((long)unboxToInt(arg)); if (arg instanceof java.lang.Double) return boxToLong((long)unboxToDouble(arg)); if (arg instanceof java.lang.Float) return boxToLong((lon...
[ "public", "static", "java", ".", "lang", ".", "Long", "toLong", "(", "Object", "arg", ")", "throws", "NoSuchMethodException", "{", "if", "(", "arg", "instanceof", "java", ".", "lang", ".", "Integer", ")", "return", "boxToLong", "(", "(", "long", ")", "un...
arg.toLong
[ "arg", ".", "toLong" ]
bec2441a24cbf3159a1118049b857a5ae7c452eb
https://github.com/scala/scala/blob/bec2441a24cbf3159a1118049b857a5ae7c452eb/src/library/scala/runtime/BoxesRunTime.java#L726-L735
129,757
scala/scala
src/library/scala/runtime/BoxesRunTime.java
BoxesRunTime.toFloat
public static java.lang.Float toFloat(Object arg) throws NoSuchMethodException { if (arg instanceof java.lang.Integer) return boxToFloat((float)unboxToInt(arg)); if (arg instanceof java.lang.Long) return boxToFloat((float)unboxToLong(arg)); if (arg instanceof java.lang.Float) return (java.lang.F...
java
public static java.lang.Float toFloat(Object arg) throws NoSuchMethodException { if (arg instanceof java.lang.Integer) return boxToFloat((float)unboxToInt(arg)); if (arg instanceof java.lang.Long) return boxToFloat((float)unboxToLong(arg)); if (arg instanceof java.lang.Float) return (java.lang.F...
[ "public", "static", "java", ".", "lang", ".", "Float", "toFloat", "(", "Object", "arg", ")", "throws", "NoSuchMethodException", "{", "if", "(", "arg", "instanceof", "java", ".", "lang", ".", "Integer", ")", "return", "boxToFloat", "(", "(", "float", ")", ...
arg.toFloat
[ "arg", ".", "toFloat" ]
bec2441a24cbf3159a1118049b857a5ae7c452eb
https://github.com/scala/scala/blob/bec2441a24cbf3159a1118049b857a5ae7c452eb/src/library/scala/runtime/BoxesRunTime.java#L738-L747
129,758
scala/scala
src/library/scala/runtime/BoxesRunTime.java
BoxesRunTime.toDouble
public static java.lang.Double toDouble(Object arg) throws NoSuchMethodException { if (arg instanceof java.lang.Integer) return boxToDouble((double)unboxToInt(arg)); if (arg instanceof java.lang.Float) return boxToDouble((double)unboxToFloat(arg)); if (arg instanceof java.lang.Double) return (ja...
java
public static java.lang.Double toDouble(Object arg) throws NoSuchMethodException { if (arg instanceof java.lang.Integer) return boxToDouble((double)unboxToInt(arg)); if (arg instanceof java.lang.Float) return boxToDouble((double)unboxToFloat(arg)); if (arg instanceof java.lang.Double) return (ja...
[ "public", "static", "java", ".", "lang", ".", "Double", "toDouble", "(", "Object", "arg", ")", "throws", "NoSuchMethodException", "{", "if", "(", "arg", "instanceof", "java", ".", "lang", ".", "Integer", ")", "return", "boxToDouble", "(", "(", "double", ")...
arg.toDouble
[ "arg", ".", "toDouble" ]
bec2441a24cbf3159a1118049b857a5ae7c452eb
https://github.com/scala/scala/blob/bec2441a24cbf3159a1118049b857a5ae7c452eb/src/library/scala/runtime/BoxesRunTime.java#L750-L759
129,759
mockito/mockito
src/main/java/org/mockito/internal/invocation/UnusedStubsFinder.java
UnusedStubsFinder.find
public List<Invocation> find(List<?> mocks) { List<Invocation> unused = new LinkedList<Invocation>(); for (Object mock : mocks) { List<Stubbing> fromSingleMock = MockUtil.getInvocationContainer(mock).getStubbingsDescending(); for(Stubbing s : fromSingleMock) { if ...
java
public List<Invocation> find(List<?> mocks) { List<Invocation> unused = new LinkedList<Invocation>(); for (Object mock : mocks) { List<Stubbing> fromSingleMock = MockUtil.getInvocationContainer(mock).getStubbingsDescending(); for(Stubbing s : fromSingleMock) { if ...
[ "public", "List", "<", "Invocation", ">", "find", "(", "List", "<", "?", ">", "mocks", ")", "{", "List", "<", "Invocation", ">", "unused", "=", "new", "LinkedList", "<", "Invocation", ">", "(", ")", ";", "for", "(", "Object", "mock", ":", "mocks", ...
Finds all unused stubs for given mocks @param mocks full list of mocks
[ "Finds", "all", "unused", "stubs", "for", "given", "mocks" ]
c5e2b80af76e3192cae7c9550b70c4d1ab312034
https://github.com/mockito/mockito/blob/c5e2b80af76e3192cae7c9550b70c4d1ab312034/src/main/java/org/mockito/internal/invocation/UnusedStubsFinder.java#L23-L34
129,760
mockito/mockito
src/main/java/org/mockito/internal/debugging/LocationImpl.java
LocationImpl.computeStackTraceInformation
private void computeStackTraceInformation( StackTraceFilter stackTraceFilter, Throwable stackTraceHolder, boolean isInline) { StackTraceElement filtered = stackTraceFilter.filterFirst(stackTraceHolder, isInline); // there are corner cases where exception can have a null or empty stack trace ...
java
private void computeStackTraceInformation( StackTraceFilter stackTraceFilter, Throwable stackTraceHolder, boolean isInline) { StackTraceElement filtered = stackTraceFilter.filterFirst(stackTraceHolder, isInline); // there are corner cases where exception can have a null or empty stack trace ...
[ "private", "void", "computeStackTraceInformation", "(", "StackTraceFilter", "stackTraceFilter", ",", "Throwable", "stackTraceHolder", ",", "boolean", "isInline", ")", "{", "StackTraceElement", "filtered", "=", "stackTraceFilter", ".", "filterFirst", "(", "stackTraceHolder",...
Eagerly compute the stacktrace line from the stackTraceHolder. Storing the Throwable is memory-intensive for tests that have large stacktraces and have a lot of invocations on mocks.
[ "Eagerly", "compute", "the", "stacktrace", "line", "from", "the", "stackTraceHolder", ".", "Storing", "the", "Throwable", "is", "memory", "-", "intensive", "for", "tests", "that", "have", "large", "stacktraces", "and", "have", "a", "lot", "of", "invocations", ...
c5e2b80af76e3192cae7c9550b70c4d1ab312034
https://github.com/mockito/mockito/blob/c5e2b80af76e3192cae7c9550b70c4d1ab312034/src/main/java/org/mockito/internal/debugging/LocationImpl.java#L46-L59
129,761
mockito/mockito
src/main/java/org/mockito/internal/configuration/injection/MockInjectionStrategy.java
MockInjectionStrategy.nop
public static MockInjectionStrategy nop() { return new MockInjectionStrategy() { protected boolean processInjection(Field field, Object fieldOwner, Set<Object> mockCandidates) { return false; } }; }
java
public static MockInjectionStrategy nop() { return new MockInjectionStrategy() { protected boolean processInjection(Field field, Object fieldOwner, Set<Object> mockCandidates) { return false; } }; }
[ "public", "static", "MockInjectionStrategy", "nop", "(", ")", "{", "return", "new", "MockInjectionStrategy", "(", ")", "{", "protected", "boolean", "processInjection", "(", "Field", "field", ",", "Object", "fieldOwner", ",", "Set", "<", "Object", ">", "mockCandi...
NOP Strategy that will always try the next strategy.
[ "NOP", "Strategy", "that", "will", "always", "try", "the", "next", "strategy", "." ]
c5e2b80af76e3192cae7c9550b70c4d1ab312034
https://github.com/mockito/mockito/blob/c5e2b80af76e3192cae7c9550b70c4d1ab312034/src/main/java/org/mockito/internal/configuration/injection/MockInjectionStrategy.java#L19-L25
129,762
mockito/mockito
src/main/java/org/mockito/internal/configuration/injection/MockInjectionStrategy.java
MockInjectionStrategy.thenTry
public MockInjectionStrategy thenTry(MockInjectionStrategy strategy) { if(nextStrategy != null) { nextStrategy.thenTry(strategy); } else { nextStrategy = strategy; } return strategy; }
java
public MockInjectionStrategy thenTry(MockInjectionStrategy strategy) { if(nextStrategy != null) { nextStrategy.thenTry(strategy); } else { nextStrategy = strategy; } return strategy; }
[ "public", "MockInjectionStrategy", "thenTry", "(", "MockInjectionStrategy", "strategy", ")", "{", "if", "(", "nextStrategy", "!=", "null", ")", "{", "nextStrategy", ".", "thenTry", "(", "strategy", ")", ";", "}", "else", "{", "nextStrategy", "=", "strategy", "...
Enqueue next injection strategy. <p> The implementation should take care of the actual calling if required. </p> @param strategy Queued strategy. @return The passed strategy instance to allow chaining.
[ "Enqueue", "next", "injection", "strategy", "." ]
c5e2b80af76e3192cae7c9550b70c4d1ab312034
https://github.com/mockito/mockito/blob/c5e2b80af76e3192cae7c9550b70c4d1ab312034/src/main/java/org/mockito/internal/configuration/injection/MockInjectionStrategy.java#L40-L47
129,763
mockito/mockito
src/main/java/org/mockito/internal/configuration/injection/MockInjectionStrategy.java
MockInjectionStrategy.process
public boolean process(Field onField, Object fieldOwnedBy, Set<Object> mockCandidates) { if(processInjection(onField, fieldOwnedBy, mockCandidates)) { return true; } return relayProcessToNextStrategy(onField, fieldOwnedBy, mockCandidates); }
java
public boolean process(Field onField, Object fieldOwnedBy, Set<Object> mockCandidates) { if(processInjection(onField, fieldOwnedBy, mockCandidates)) { return true; } return relayProcessToNextStrategy(onField, fieldOwnedBy, mockCandidates); }
[ "public", "boolean", "process", "(", "Field", "onField", ",", "Object", "fieldOwnedBy", ",", "Set", "<", "Object", ">", "mockCandidates", ")", "{", "if", "(", "processInjection", "(", "onField", ",", "fieldOwnedBy", ",", "mockCandidates", ")", ")", "{", "ret...
Actually inject mockCandidates on field. <p> Actual algorithm is defined in the implementations of {@link #processInjection(Field, Object, Set)}. However if injection occurred successfully, the process should return <code>true</code>, and <code>false</code> otherwise. </p> <p> The code takes care of calling the next ...
[ "Actually", "inject", "mockCandidates", "on", "field", "." ]
c5e2b80af76e3192cae7c9550b70c4d1ab312034
https://github.com/mockito/mockito/blob/c5e2b80af76e3192cae7c9550b70c4d1ab312034/src/main/java/org/mockito/internal/configuration/injection/MockInjectionStrategy.java#L67-L72
129,764
mockito/mockito
src/main/java/org/mockito/internal/stubbing/defaultanswers/ReturnsDeepStubs.java
ReturnsDeepStubs.newDeepStubMock
private Object newDeepStubMock(GenericMetadataSupport returnTypeGenericMetadata, Object parentMock) { MockCreationSettings parentMockSettings = MockUtil.getMockSettings(parentMock); return mockitoCore().mock( returnTypeGenericMetadata.rawType(), withSettingsUsing(returnTypeGeneri...
java
private Object newDeepStubMock(GenericMetadataSupport returnTypeGenericMetadata, Object parentMock) { MockCreationSettings parentMockSettings = MockUtil.getMockSettings(parentMock); return mockitoCore().mock( returnTypeGenericMetadata.rawType(), withSettingsUsing(returnTypeGeneri...
[ "private", "Object", "newDeepStubMock", "(", "GenericMetadataSupport", "returnTypeGenericMetadata", ",", "Object", "parentMock", ")", "{", "MockCreationSettings", "parentMockSettings", "=", "MockUtil", ".", "getMockSettings", "(", "parentMock", ")", ";", "return", "mockit...
Creates a mock using the Generics Metadata. <li>Finally as we want to mock the actual type, but we want to pass along the contextual generics meta-data that was resolved for the current return type, for this to happen we associate to the mock an new instance of {@link ReturnsDeepStubs} answer in which we will store th...
[ "Creates", "a", "mock", "using", "the", "Generics", "Metadata", "." ]
c5e2b80af76e3192cae7c9550b70c4d1ab312034
https://github.com/mockito/mockito/blob/c5e2b80af76e3192cae7c9550b70c4d1ab312034/src/main/java/org/mockito/internal/stubbing/defaultanswers/ReturnsDeepStubs.java#L105-L111
129,765
mockito/mockito
src/main/java/org/mockito/internal/exceptions/stacktrace/StackTraceFilter.java
StackTraceFilter.findSourceFile
public String findSourceFile(StackTraceElement[] target, String defaultValue) { for (StackTraceElement e : target) { if (CLEANER.isIn(e)) { return e.getFileName(); } } return defaultValue; }
java
public String findSourceFile(StackTraceElement[] target, String defaultValue) { for (StackTraceElement e : target) { if (CLEANER.isIn(e)) { return e.getFileName(); } } return defaultValue; }
[ "public", "String", "findSourceFile", "(", "StackTraceElement", "[", "]", "target", ",", "String", "defaultValue", ")", "{", "for", "(", "StackTraceElement", "e", ":", "target", ")", "{", "if", "(", "CLEANER", ".", "isIn", "(", "e", ")", ")", "{", "retur...
Finds the source file of the target stack trace. Returns the default value if source file cannot be found.
[ "Finds", "the", "source", "file", "of", "the", "target", "stack", "trace", ".", "Returns", "the", "default", "value", "if", "source", "file", "cannot", "be", "found", "." ]
c5e2b80af76e3192cae7c9550b70c4d1ab312034
https://github.com/mockito/mockito/blob/c5e2b80af76e3192cae7c9550b70c4d1ab312034/src/main/java/org/mockito/internal/exceptions/stacktrace/StackTraceFilter.java#L125-L132
129,766
mockito/mockito
src/main/java/org/mockito/internal/util/io/IOUtil.java
IOUtil.writeText
public static void writeText(String text, File output) { PrintWriter pw = null; try { pw = new PrintWriter(new FileWriter(output)); pw.write(text); } catch (Exception e) { throw new MockitoException("Problems writing text to file: " + output, e); } fin...
java
public static void writeText(String text, File output) { PrintWriter pw = null; try { pw = new PrintWriter(new FileWriter(output)); pw.write(text); } catch (Exception e) { throw new MockitoException("Problems writing text to file: " + output, e); } fin...
[ "public", "static", "void", "writeText", "(", "String", "text", ",", "File", "output", ")", "{", "PrintWriter", "pw", "=", "null", ";", "try", "{", "pw", "=", "new", "PrintWriter", "(", "new", "FileWriter", "(", "output", ")", ")", ";", "pw", ".", "w...
Writes text to file
[ "Writes", "text", "to", "file" ]
c5e2b80af76e3192cae7c9550b70c4d1ab312034
https://github.com/mockito/mockito/blob/c5e2b80af76e3192cae7c9550b70c4d1ab312034/src/main/java/org/mockito/internal/util/io/IOUtil.java#L22-L32
129,767
mockito/mockito
src/main/java/org/mockito/internal/stubbing/answers/AnswerFunctionalInterfaces.java
AnswerFunctionalInterfaces.toAnswer
public static <A, B, C, D, E> Answer<Void> toAnswer(final VoidAnswer5<A, B, C, D, E> answer) { return new Answer<Void>() { @SuppressWarnings("unchecked") public Void answer(InvocationOnMock invocation) throws Throwable { answer.answer( (A)invocatio...
java
public static <A, B, C, D, E> Answer<Void> toAnswer(final VoidAnswer5<A, B, C, D, E> answer) { return new Answer<Void>() { @SuppressWarnings("unchecked") public Void answer(InvocationOnMock invocation) throws Throwable { answer.answer( (A)invocatio...
[ "public", "static", "<", "A", ",", "B", ",", "C", ",", "D", ",", "E", ">", "Answer", "<", "Void", ">", "toAnswer", "(", "final", "VoidAnswer5", "<", "A", ",", "B", ",", "C", ",", "D", ",", "E", ">", "answer", ")", "{", "return", "new", "Answe...
Construct an answer from a five parameter answer interface @param answer answer interface @param <A> input parameter 1 type @param <B> input parameter 2 type @param <C> input parameter 3 type @param <D> input parameter 4 type @param <E> input parameter 5 type @return a new answer object
[ "Construct", "an", "answer", "from", "a", "five", "parameter", "answer", "interface" ]
c5e2b80af76e3192cae7c9550b70c4d1ab312034
https://github.com/mockito/mockito/blob/c5e2b80af76e3192cae7c9550b70c4d1ab312034/src/main/java/org/mockito/internal/stubbing/answers/AnswerFunctionalInterfaces.java#L227-L240
129,768
mockito/mockito
src/main/java/org/mockito/internal/stubbing/answers/AnswerFunctionalInterfaces.java
AnswerFunctionalInterfaces.toAnswer
public static <T, A, B, C, D, E, F> Answer<T> toAnswer(final Answer6<T, A, B, C, D, E, F> answer) { return new Answer<T>() { @SuppressWarnings("unchecked") public T answer(InvocationOnMock invocation) throws Throwable { return answer.answer( (A)inv...
java
public static <T, A, B, C, D, E, F> Answer<T> toAnswer(final Answer6<T, A, B, C, D, E, F> answer) { return new Answer<T>() { @SuppressWarnings("unchecked") public T answer(InvocationOnMock invocation) throws Throwable { return answer.answer( (A)inv...
[ "public", "static", "<", "T", ",", "A", ",", "B", ",", "C", ",", "D", ",", "E", ",", "F", ">", "Answer", "<", "T", ">", "toAnswer", "(", "final", "Answer6", "<", "T", ",", "A", ",", "B", ",", "C", ",", "D", ",", "E", ",", "F", ">", "ans...
Construct an answer from a six parameter answer interface @param answer answer interface @param <T> return type @param <A> input parameter 1 type @param <B> input parameter 2 type @param <C> input parameter 3 type @param <D> input parameter 4 type @param <E> input parameter 5 type @param <F> input parameter 6 type @re...
[ "Construct", "an", "answer", "from", "a", "six", "parameter", "answer", "interface" ]
c5e2b80af76e3192cae7c9550b70c4d1ab312034
https://github.com/mockito/mockito/blob/c5e2b80af76e3192cae7c9550b70c4d1ab312034/src/main/java/org/mockito/internal/stubbing/answers/AnswerFunctionalInterfaces.java#L255-L268
129,769
mockito/mockito
src/main/java/org/mockito/internal/util/reflection/FieldInitializer.java
FieldInitializer.initialize
public FieldInitializationReport initialize() { final AccessibilityChanger changer = new AccessibilityChanger(); changer.enableAccess(field); try { return acquireFieldInstance(); } catch(IllegalAccessException e) { throw new MockitoException("Problems initializin...
java
public FieldInitializationReport initialize() { final AccessibilityChanger changer = new AccessibilityChanger(); changer.enableAccess(field); try { return acquireFieldInstance(); } catch(IllegalAccessException e) { throw new MockitoException("Problems initializin...
[ "public", "FieldInitializationReport", "initialize", "(", ")", "{", "final", "AccessibilityChanger", "changer", "=", "new", "AccessibilityChanger", "(", ")", ";", "changer", ".", "enableAccess", "(", "field", ")", ";", "try", "{", "return", "acquireFieldInstance", ...
Initialize field if not initialized and return the actual instance. @return Actual field instance.
[ "Initialize", "field", "if", "not", "initialized", "and", "return", "the", "actual", "instance", "." ]
c5e2b80af76e3192cae7c9550b70c4d1ab312034
https://github.com/mockito/mockito/blob/c5e2b80af76e3192cae7c9550b70c4d1ab312034/src/main/java/org/mockito/internal/util/reflection/FieldInitializer.java#L86-L97
129,770
mockito/mockito
src/main/java/org/mockito/AdditionalAnswers.java
AdditionalAnswers.answersWithDelay
@Incubating public static <T> Answer<T> answersWithDelay(long sleepyTime, Answer<T> answer) { return (Answer<T>) new AnswersWithDelay(sleepyTime, (Answer<Object>) answer); }
java
@Incubating public static <T> Answer<T> answersWithDelay(long sleepyTime, Answer<T> answer) { return (Answer<T>) new AnswersWithDelay(sleepyTime, (Answer<Object>) answer); }
[ "@", "Incubating", "public", "static", "<", "T", ">", "Answer", "<", "T", ">", "answersWithDelay", "(", "long", "sleepyTime", ",", "Answer", "<", "T", ">", "answer", ")", "{", "return", "(", "Answer", "<", "T", ">", ")", "new", "AnswersWithDelay", "(",...
Returns an answer after a delay with a defined length. @param <T> return type @param sleepyTime the delay in milliseconds @param answer interface to the answer which provides the intended return value. @return the answer object to use @since 2.8.44
[ "Returns", "an", "answer", "after", "a", "delay", "with", "a", "defined", "length", "." ]
c5e2b80af76e3192cae7c9550b70c4d1ab312034
https://github.com/mockito/mockito/blob/c5e2b80af76e3192cae7c9550b70c4d1ab312034/src/main/java/org/mockito/AdditionalAnswers.java#L333-L336
129,771
mockito/mockito
src/main/java/org/mockito/ArgumentMatchers.java
ArgumentMatchers.any
public static <T> T any(Class<T> type) { reportMatcher(new InstanceOf.VarArgAware(type, "<any " + type.getCanonicalName() + ">")); return defaultValue(type); }
java
public static <T> T any(Class<T> type) { reportMatcher(new InstanceOf.VarArgAware(type, "<any " + type.getCanonicalName() + ">")); return defaultValue(type); }
[ "public", "static", "<", "T", ">", "T", "any", "(", "Class", "<", "T", ">", "type", ")", "{", "reportMatcher", "(", "new", "InstanceOf", ".", "VarArgAware", "(", "type", ",", "\"<any \"", "+", "type", ".", "getCanonicalName", "(", ")", "+", "\">\"", ...
Matches any object of given type, excluding nulls. <p> This matcher will perform a type check with the given type, thus excluding values. See examples in javadoc for {@link ArgumentMatchers} class. This is an alias of: {@link #isA(Class)}} </p> <p> Since Mockito 2.1.0, only allow non-null instance of <code></code>, ...
[ "Matches", "any", "object", "of", "given", "type", "excluding", "nulls", "." ]
c5e2b80af76e3192cae7c9550b70c4d1ab312034
https://github.com/mockito/mockito/blob/c5e2b80af76e3192cae7c9550b70c4d1ab312034/src/main/java/org/mockito/ArgumentMatchers.java#L206-L209
129,772
mockito/mockito
src/main/java/org/mockito/ArgumentMatchers.java
ArgumentMatchers.eq
public static <T> T eq(T value) { reportMatcher(new Equals(value)); if (value == null) return null; return (T) Primitives.defaultValue(value.getClass()); }
java
public static <T> T eq(T value) { reportMatcher(new Equals(value)); if (value == null) return null; return (T) Primitives.defaultValue(value.getClass()); }
[ "public", "static", "<", "T", ">", "T", "eq", "(", "T", "value", ")", "{", "reportMatcher", "(", "new", "Equals", "(", "value", ")", ")", ";", "if", "(", "value", "==", "null", ")", "return", "null", ";", "return", "(", "T", ")", "Primitives", "....
Object argument that is equal to the given value. <p> See examples in javadoc for {@link ArgumentMatchers} class </p> @param value the given value. @return <code>null</code>.
[ "Object", "argument", "that", "is", "equal", "to", "the", "given", "value", "." ]
c5e2b80af76e3192cae7c9550b70c4d1ab312034
https://github.com/mockito/mockito/blob/c5e2b80af76e3192cae7c9550b70c4d1ab312034/src/main/java/org/mockito/ArgumentMatchers.java#L906-L911
129,773
mockito/mockito
src/main/java/org/mockito/ArgumentMatchers.java
ArgumentMatchers.refEq
public static <T> T refEq(T value, String... excludeFields) { reportMatcher(new ReflectionEquals(value, excludeFields)); return null; }
java
public static <T> T refEq(T value, String... excludeFields) { reportMatcher(new ReflectionEquals(value, excludeFields)); return null; }
[ "public", "static", "<", "T", ">", "T", "refEq", "(", "T", "value", ",", "String", "...", "excludeFields", ")", "{", "reportMatcher", "(", "new", "ReflectionEquals", "(", "value", ",", "excludeFields", ")", ")", ";", "return", "null", ";", "}" ]
Object argument that is reflection-equal to the given value with support for excluding selected fields from a class. <p> This matcher can be used when equals() is not implemented on compared objects. Matcher uses java reflection API to compare fields of wanted and actual object. </p> <p> Works similarly to <code>Equa...
[ "Object", "argument", "that", "is", "reflection", "-", "equal", "to", "the", "given", "value", "with", "support", "for", "excluding", "selected", "fields", "from", "a", "class", "." ]
c5e2b80af76e3192cae7c9550b70c4d1ab312034
https://github.com/mockito/mockito/blob/c5e2b80af76e3192cae7c9550b70c4d1ab312034/src/main/java/org/mockito/ArgumentMatchers.java#L937-L940
129,774
mockito/mockito
src/main/java/org/mockito/ArgumentMatchers.java
ArgumentMatchers.same
public static <T> T same(T value) { reportMatcher(new Same(value)); if (value == null) return null; return (T) Primitives.defaultValue(value.getClass()); }
java
public static <T> T same(T value) { reportMatcher(new Same(value)); if (value == null) return null; return (T) Primitives.defaultValue(value.getClass()); }
[ "public", "static", "<", "T", ">", "T", "same", "(", "T", "value", ")", "{", "reportMatcher", "(", "new", "Same", "(", "value", ")", ")", ";", "if", "(", "value", "==", "null", ")", "return", "null", ";", "return", "(", "T", ")", "Primitives", "....
Object argument that is the same as the given value. <p> See examples in javadoc for {@link ArgumentMatchers} class </p> @param <T> the type of the object, it is passed through to prevent casts. @param value the given value. @return <code>null</code>.
[ "Object", "argument", "that", "is", "the", "same", "as", "the", "given", "value", "." ]
c5e2b80af76e3192cae7c9550b70c4d1ab312034
https://github.com/mockito/mockito/blob/c5e2b80af76e3192cae7c9550b70c4d1ab312034/src/main/java/org/mockito/ArgumentMatchers.java#L953-L958
129,775
mockito/mockito
src/main/java/org/mockito/internal/MockitoCore.java
MockitoCore.getLastInvocation
public Invocation getLastInvocation() { OngoingStubbingImpl ongoingStubbing = ((OngoingStubbingImpl) mockingProgress().pullOngoingStubbing()); List<Invocation> allInvocations = ongoingStubbing.getRegisteredInvocations(); return allInvocations.get(allInvocations.size() - 1); }
java
public Invocation getLastInvocation() { OngoingStubbingImpl ongoingStubbing = ((OngoingStubbingImpl) mockingProgress().pullOngoingStubbing()); List<Invocation> allInvocations = ongoingStubbing.getRegisteredInvocations(); return allInvocations.get(allInvocations.size() - 1); }
[ "public", "Invocation", "getLastInvocation", "(", ")", "{", "OngoingStubbingImpl", "ongoingStubbing", "=", "(", "(", "OngoingStubbingImpl", ")", "mockingProgress", "(", ")", ".", "pullOngoingStubbing", "(", ")", ")", ";", "List", "<", "Invocation", ">", "allInvoca...
For testing purposes only. Is not the part of main API. @return last invocation
[ "For", "testing", "purposes", "only", ".", "Is", "not", "the", "part", "of", "main", "API", "." ]
c5e2b80af76e3192cae7c9550b70c4d1ab312034
https://github.com/mockito/mockito/blob/c5e2b80af76e3192cae7c9550b70c4d1ab312034/src/main/java/org/mockito/internal/MockitoCore.java#L192-L196
129,776
mockito/mockito
src/main/java/org/mockito/internal/util/reflection/InstanceField.java
InstanceField.annotation
public <A extends Annotation> A annotation(Class<A> annotationClass) { return field.getAnnotation(annotationClass); }
java
public <A extends Annotation> A annotation(Class<A> annotationClass) { return field.getAnnotation(annotationClass); }
[ "public", "<", "A", "extends", "Annotation", ">", "A", "annotation", "(", "Class", "<", "A", ">", "annotationClass", ")", "{", "return", "field", ".", "getAnnotation", "(", "annotationClass", ")", ";", "}" ]
Returns the annotation instance for the given annotation type. @param annotationClass Tha annotation type to retrieve. @param <A> Type of the annotation. @return The annotation instance.
[ "Returns", "the", "annotation", "instance", "for", "the", "given", "annotation", "type", "." ]
c5e2b80af76e3192cae7c9550b70c4d1ab312034
https://github.com/mockito/mockito/blob/c5e2b80af76e3192cae7c9550b70c4d1ab312034/src/main/java/org/mockito/internal/util/reflection/InstanceField.java#L91-L93
129,777
mockito/mockito
src/main/java/org/mockito/internal/util/reflection/AccessibilityChanger.java
AccessibilityChanger.safelyDisableAccess
public void safelyDisableAccess(AccessibleObject accessibleObject) { assert wasAccessible != null : "accessibility info shall not be null"; try { accessibleObject.setAccessible(wasAccessible); } catch (Throwable t) { //ignore } }
java
public void safelyDisableAccess(AccessibleObject accessibleObject) { assert wasAccessible != null : "accessibility info shall not be null"; try { accessibleObject.setAccessible(wasAccessible); } catch (Throwable t) { //ignore } }
[ "public", "void", "safelyDisableAccess", "(", "AccessibleObject", "accessibleObject", ")", "{", "assert", "wasAccessible", "!=", "null", ":", "\"accessibility info shall not be null\"", ";", "try", "{", "accessibleObject", ".", "setAccessible", "(", "wasAccessible", ")", ...
safely disables access
[ "safely", "disables", "access" ]
c5e2b80af76e3192cae7c9550b70c4d1ab312034
https://github.com/mockito/mockito/blob/c5e2b80af76e3192cae7c9550b70c4d1ab312034/src/main/java/org/mockito/internal/util/reflection/AccessibilityChanger.java#L16-L23
129,778
mockito/mockito
src/main/java/org/mockito/internal/invocation/finder/AllInvocationsFinder.java
AllInvocationsFinder.find
public static List<Invocation> find(Iterable<?> mocks) { Set<Invocation> invocationsInOrder = new TreeSet<Invocation>(new InvocationComparator()); for (Object mock : mocks) { Collection<Invocation> fromSingleMock = new DefaultMockingDetails(mock).getInvocations(); invocationsInOr...
java
public static List<Invocation> find(Iterable<?> mocks) { Set<Invocation> invocationsInOrder = new TreeSet<Invocation>(new InvocationComparator()); for (Object mock : mocks) { Collection<Invocation> fromSingleMock = new DefaultMockingDetails(mock).getInvocations(); invocationsInOr...
[ "public", "static", "List", "<", "Invocation", ">", "find", "(", "Iterable", "<", "?", ">", "mocks", ")", "{", "Set", "<", "Invocation", ">", "invocationsInOrder", "=", "new", "TreeSet", "<", "Invocation", ">", "(", "new", "InvocationComparator", "(", ")",...
gets all invocations from mocks. Invocations are ordered earlier first. @param mocks mocks @return invocations
[ "gets", "all", "invocations", "from", "mocks", ".", "Invocations", "are", "ordered", "earlier", "first", "." ]
c5e2b80af76e3192cae7c9550b70c4d1ab312034
https://github.com/mockito/mockito/blob/c5e2b80af76e3192cae7c9550b70c4d1ab312034/src/main/java/org/mockito/internal/invocation/finder/AllInvocationsFinder.java#L26-L34
129,779
mockito/mockito
src/main/java/org/mockito/internal/invocation/finder/AllInvocationsFinder.java
AllInvocationsFinder.findStubbings
public static Set<Stubbing> findStubbings(Iterable<?> mocks) { Set<Stubbing> stubbings = new TreeSet<Stubbing>(new StubbingComparator()); for (Object mock : mocks) { Collection<? extends Stubbing> fromSingleMock = new DefaultMockingDetails(mock).getStubbings(); stubbings.addAll(f...
java
public static Set<Stubbing> findStubbings(Iterable<?> mocks) { Set<Stubbing> stubbings = new TreeSet<Stubbing>(new StubbingComparator()); for (Object mock : mocks) { Collection<? extends Stubbing> fromSingleMock = new DefaultMockingDetails(mock).getStubbings(); stubbings.addAll(f...
[ "public", "static", "Set", "<", "Stubbing", ">", "findStubbings", "(", "Iterable", "<", "?", ">", "mocks", ")", "{", "Set", "<", "Stubbing", ">", "stubbings", "=", "new", "TreeSet", "<", "Stubbing", ">", "(", "new", "StubbingComparator", "(", ")", ")", ...
Gets all stubbings from mocks. Invocations are ordered earlier first. @param mocks mocks @return stubbings
[ "Gets", "all", "stubbings", "from", "mocks", ".", "Invocations", "are", "ordered", "earlier", "first", "." ]
c5e2b80af76e3192cae7c9550b70c4d1ab312034
https://github.com/mockito/mockito/blob/c5e2b80af76e3192cae7c9550b70c4d1ab312034/src/main/java/org/mockito/internal/invocation/finder/AllInvocationsFinder.java#L42-L50
129,780
mockito/mockito
src/main/java/org/mockito/internal/verification/VerificationOverTimeImpl.java
VerificationOverTimeImpl.verify
public void verify(VerificationData data) { AssertionError error = null; timer.start(); while (timer.isCounting()) { try { delegate.verify(data); if (returnOnSuccess) { return; } else { error = ...
java
public void verify(VerificationData data) { AssertionError error = null; timer.start(); while (timer.isCounting()) { try { delegate.verify(data); if (returnOnSuccess) { return; } else { error = ...
[ "public", "void", "verify", "(", "VerificationData", "data", ")", "{", "AssertionError", "error", "=", "null", ";", "timer", ".", "start", "(", ")", ";", "while", "(", "timer", ".", "isCounting", "(", ")", ")", "{", "try", "{", "delegate", ".", "verify...
Verify the given ongoing verification data, and confirm that it satisfies the delegate verification mode before the full duration has passed. In practice, this polls the delegate verification mode until it is satisfied. If it is not satisfied once the full duration has passed, the last error returned by the delegate v...
[ "Verify", "the", "given", "ongoing", "verification", "data", "and", "confirm", "that", "it", "satisfies", "the", "delegate", "verification", "mode", "before", "the", "full", "duration", "has", "passed", "." ]
c5e2b80af76e3192cae7c9550b70c4d1ab312034
https://github.com/mockito/mockito/blob/c5e2b80af76e3192cae7c9550b70c4d1ab312034/src/main/java/org/mockito/internal/verification/VerificationOverTimeImpl.java#L72-L96
129,781
mockito/mockito
src/main/java/org/mockito/internal/verification/Description.java
Description.verify
@Override public void verify(VerificationData data) { try { verification.verify(data); } catch (MockitoAssertionError e) { throw new MockitoAssertionError(e, description); } }
java
@Override public void verify(VerificationData data) { try { verification.verify(data); } catch (MockitoAssertionError e) { throw new MockitoAssertionError(e, description); } }
[ "@", "Override", "public", "void", "verify", "(", "VerificationData", "data", ")", "{", "try", "{", "verification", ".", "verify", "(", "data", ")", ";", "}", "catch", "(", "MockitoAssertionError", "e", ")", "{", "throw", "new", "MockitoAssertionError", "(",...
Performs verification using the wrapped verification mode implementation. Prepends the custom failure message if verification fails. @param data the data to be verified
[ "Performs", "verification", "using", "the", "wrapped", "verification", "mode", "implementation", ".", "Prepends", "the", "custom", "failure", "message", "if", "verification", "fails", "." ]
c5e2b80af76e3192cae7c9550b70c4d1ab312034
https://github.com/mockito/mockito/blob/c5e2b80af76e3192cae7c9550b70c4d1ab312034/src/main/java/org/mockito/internal/verification/Description.java#L37-L45
129,782
mockito/mockito
src/main/java/org/mockito/internal/runners/RunnerFactory.java
RunnerFactory.create
public InternalRunner create(Class<?> klass) throws InvocationTargetException { return create(klass, new Supplier<MockitoTestListener>() { public MockitoTestListener get() { return new NoOpTestListener(); } }); }
java
public InternalRunner create(Class<?> klass) throws InvocationTargetException { return create(klass, new Supplier<MockitoTestListener>() { public MockitoTestListener get() { return new NoOpTestListener(); } }); }
[ "public", "InternalRunner", "create", "(", "Class", "<", "?", ">", "klass", ")", "throws", "InvocationTargetException", "{", "return", "create", "(", "klass", ",", "new", "Supplier", "<", "MockitoTestListener", ">", "(", ")", "{", "public", "MockitoTestListener"...
Creates silent runner implementation
[ "Creates", "silent", "runner", "implementation" ]
c5e2b80af76e3192cae7c9550b70c4d1ab312034
https://github.com/mockito/mockito/blob/c5e2b80af76e3192cae7c9550b70c4d1ab312034/src/main/java/org/mockito/internal/runners/RunnerFactory.java#L28-L34
129,783
mockito/mockito
src/main/java/org/mockito/internal/runners/RunnerFactory.java
RunnerFactory.createStrict
public InternalRunner createStrict(Class<?> klass) throws InvocationTargetException { return create(klass, new Supplier<MockitoTestListener>() { public MockitoTestListener get() { return new MismatchReportingTestListener(Plugins.getMockitoLogger()); } }); }
java
public InternalRunner createStrict(Class<?> klass) throws InvocationTargetException { return create(klass, new Supplier<MockitoTestListener>() { public MockitoTestListener get() { return new MismatchReportingTestListener(Plugins.getMockitoLogger()); } }); }
[ "public", "InternalRunner", "createStrict", "(", "Class", "<", "?", ">", "klass", ")", "throws", "InvocationTargetException", "{", "return", "create", "(", "klass", ",", "new", "Supplier", "<", "MockitoTestListener", ">", "(", ")", "{", "public", "MockitoTestLis...
Creates strict runner implementation
[ "Creates", "strict", "runner", "implementation" ]
c5e2b80af76e3192cae7c9550b70c4d1ab312034
https://github.com/mockito/mockito/blob/c5e2b80af76e3192cae7c9550b70c4d1ab312034/src/main/java/org/mockito/internal/runners/RunnerFactory.java#L39-L45
129,784
mockito/mockito
src/main/java/org/mockito/internal/runners/RunnerFactory.java
RunnerFactory.createStrictStubs
public InternalRunner createStrictStubs(Class<?> klass) throws InvocationTargetException { return create(klass, new Supplier<MockitoTestListener>() { public MockitoTestListener get() { return new StrictStubsRunnerTestListener(); } }); }
java
public InternalRunner createStrictStubs(Class<?> klass) throws InvocationTargetException { return create(klass, new Supplier<MockitoTestListener>() { public MockitoTestListener get() { return new StrictStubsRunnerTestListener(); } }); }
[ "public", "InternalRunner", "createStrictStubs", "(", "Class", "<", "?", ">", "klass", ")", "throws", "InvocationTargetException", "{", "return", "create", "(", "klass", ",", "new", "Supplier", "<", "MockitoTestListener", ">", "(", ")", "{", "public", "MockitoTe...
Creates strict stubs runner implementation TODO, let's try to apply Brice suggestion and use switch + Strictness
[ "Creates", "strict", "stubs", "runner", "implementation" ]
c5e2b80af76e3192cae7c9550b70c4d1ab312034
https://github.com/mockito/mockito/blob/c5e2b80af76e3192cae7c9550b70c4d1ab312034/src/main/java/org/mockito/internal/runners/RunnerFactory.java#L52-L58
129,785
mockito/mockito
src/main/java/org/mockito/internal/runners/RunnerFactory.java
RunnerFactory.create
public InternalRunner create(Class<?> klass, Supplier<MockitoTestListener> listenerSupplier) throws InvocationTargetException { try { String runnerClassName = "org.mockito.internal.runners.DefaultInternalRunner"; //Warning: I'm using String literal on purpose! //When JUnit is...
java
public InternalRunner create(Class<?> klass, Supplier<MockitoTestListener> listenerSupplier) throws InvocationTargetException { try { String runnerClassName = "org.mockito.internal.runners.DefaultInternalRunner"; //Warning: I'm using String literal on purpose! //When JUnit is...
[ "public", "InternalRunner", "create", "(", "Class", "<", "?", ">", "klass", ",", "Supplier", "<", "MockitoTestListener", ">", "listenerSupplier", ")", "throws", "InvocationTargetException", "{", "try", "{", "String", "runnerClassName", "=", "\"org.mockito.internal.run...
Creates runner implementation with provided listener supplier
[ "Creates", "runner", "implementation", "with", "provided", "listener", "supplier" ]
c5e2b80af76e3192cae7c9550b70c4d1ab312034
https://github.com/mockito/mockito/blob/c5e2b80af76e3192cae7c9550b70c4d1ab312034/src/main/java/org/mockito/internal/runners/RunnerFactory.java#L63-L91
129,786
mockito/mockito
src/main/java/org/mockito/internal/util/JavaEightUtil.java
JavaEightUtil.invokeNullaryFactoryMethod
private static Object invokeNullaryFactoryMethod(final String fqcn, final String methodName) { try { final Class<?> type = Class.forName(fqcn); final Method method = type.getMethod(methodName); return method.invoke(null); // any exception is really unexpected sin...
java
private static Object invokeNullaryFactoryMethod(final String fqcn, final String methodName) { try { final Class<?> type = Class.forName(fqcn); final Method method = type.getMethod(methodName); return method.invoke(null); // any exception is really unexpected sin...
[ "private", "static", "Object", "invokeNullaryFactoryMethod", "(", "final", "String", "fqcn", ",", "final", "String", "methodName", ")", "{", "try", "{", "final", "Class", "<", "?", ">", "type", "=", "Class", ".", "forName", "(", "fqcn", ")", ";", "final", ...
Invokes a nullary static factory method using reflection to stay backwards-compatible with older JDKs. @param fqcn The fully qualified class name of the type to be produced. @param methodName The name of the factory method. @return the object produced.
[ "Invokes", "a", "nullary", "static", "factory", "method", "using", "reflection", "to", "stay", "backwards", "-", "compatible", "with", "older", "JDKs", "." ]
c5e2b80af76e3192cae7c9550b70c4d1ab312034
https://github.com/mockito/mockito/blob/c5e2b80af76e3192cae7c9550b70c4d1ab312034/src/main/java/org/mockito/internal/util/JavaEightUtil.java#L131-L143
129,787
mockito/mockito
src/main/java/org/mockito/internal/util/reflection/BeanPropertySetter.java
BeanPropertySetter.setterName
private String setterName(String fieldName) { return new StringBuilder(SET_PREFIX) .append(fieldName.substring(0, 1).toUpperCase(Locale.ENGLISH)) .append(fieldName.substring(1)) .toString(); }
java
private String setterName(String fieldName) { return new StringBuilder(SET_PREFIX) .append(fieldName.substring(0, 1).toUpperCase(Locale.ENGLISH)) .append(fieldName.substring(1)) .toString(); }
[ "private", "String", "setterName", "(", "String", "fieldName", ")", "{", "return", "new", "StringBuilder", "(", "SET_PREFIX", ")", ".", "append", "(", "fieldName", ".", "substring", "(", "0", ",", "1", ")", ".", "toUpperCase", "(", "Locale", ".", "ENGLISH"...
Retrieve the setter name from the field name. <p>Implementation is based on the code of {@link java.beans.Introspector}.</p> @param fieldName the Field name @return Setter name.
[ "Retrieve", "the", "setter", "name", "from", "the", "field", "name", "." ]
c5e2b80af76e3192cae7c9550b70c4d1ab312034
https://github.com/mockito/mockito/blob/c5e2b80af76e3192cae7c9550b70c4d1ab312034/src/main/java/org/mockito/internal/util/reflection/BeanPropertySetter.java#L85-L90
129,788
mockito/mockito
src/main/java/org/mockito/internal/invocation/ArgumentsProcessor.java
ArgumentsProcessor.expandArgs
public static Object[] expandArgs(MockitoMethod method, Object[] args) { int nParams = method.getParameterTypes().length; if (args != null && args.length > nParams) args = Arrays.copyOf(args, nParams); // drop extra args (currently -- Kotlin continuation synthetic arg) return expandV...
java
public static Object[] expandArgs(MockitoMethod method, Object[] args) { int nParams = method.getParameterTypes().length; if (args != null && args.length > nParams) args = Arrays.copyOf(args, nParams); // drop extra args (currently -- Kotlin continuation synthetic arg) return expandV...
[ "public", "static", "Object", "[", "]", "expandArgs", "(", "MockitoMethod", "method", ",", "Object", "[", "]", "args", ")", "{", "int", "nParams", "=", "method", ".", "getParameterTypes", "(", ")", ".", "length", ";", "if", "(", "args", "!=", "null", "...
and expands varargs
[ "and", "expands", "varargs" ]
c5e2b80af76e3192cae7c9550b70c4d1ab312034
https://github.com/mockito/mockito/blob/c5e2b80af76e3192cae7c9550b70c4d1ab312034/src/main/java/org/mockito/internal/invocation/ArgumentsProcessor.java#L21-L26
129,789
mockito/mockito
src/main/java/org/mockito/internal/util/reflection/GenericMetadataSupport.java
GenericMetadataSupport.registerAllTypeVariables
protected void registerAllTypeVariables(Type classType) { Queue<Type> typesToRegister = new LinkedList<Type>(); Set<Type> registeredTypes = new HashSet<Type>(); typesToRegister.add(classType); while (!typesToRegister.isEmpty()) { Type typeToRegister = typesToRegister.poll();...
java
protected void registerAllTypeVariables(Type classType) { Queue<Type> typesToRegister = new LinkedList<Type>(); Set<Type> registeredTypes = new HashSet<Type>(); typesToRegister.add(classType); while (!typesToRegister.isEmpty()) { Type typeToRegister = typesToRegister.poll();...
[ "protected", "void", "registerAllTypeVariables", "(", "Type", "classType", ")", "{", "Queue", "<", "Type", ">", "typesToRegister", "=", "new", "LinkedList", "<", "Type", ">", "(", ")", ";", "Set", "<", "Type", ">", "registeredTypes", "=", "new", "HashSet", ...
Registers the type variables for the given type and all of its superclasses and superinterfaces.
[ "Registers", "the", "type", "variables", "for", "the", "given", "type", "and", "all", "of", "its", "superclasses", "and", "superinterfaces", "." ]
c5e2b80af76e3192cae7c9550b70c4d1ab312034
https://github.com/mockito/mockito/blob/c5e2b80af76e3192cae7c9550b70c4d1ab312034/src/main/java/org/mockito/internal/util/reflection/GenericMetadataSupport.java#L83-L101
129,790
mockito/mockito
src/main/java/org/mockito/internal/util/Primitives.java
Primitives.defaultValue
public static <T> T defaultValue(Class<T> primitiveOrWrapperType) { return (T) PRIMITIVE_OR_WRAPPER_DEFAULT_VALUES.get(primitiveOrWrapperType); }
java
public static <T> T defaultValue(Class<T> primitiveOrWrapperType) { return (T) PRIMITIVE_OR_WRAPPER_DEFAULT_VALUES.get(primitiveOrWrapperType); }
[ "public", "static", "<", "T", ">", "T", "defaultValue", "(", "Class", "<", "T", ">", "primitiveOrWrapperType", ")", "{", "return", "(", "T", ")", "PRIMITIVE_OR_WRAPPER_DEFAULT_VALUES", ".", "get", "(", "primitiveOrWrapperType", ")", ";", "}" ]
Returns the boxed default value for a primitive or a primitive wrapper. @param primitiveOrWrapperType The type to lookup the default value @return The boxed default values as defined in Java Language Specification, <code>null</code> if the type is neither a primitive nor a wrapper
[ "Returns", "the", "boxed", "default", "value", "for", "a", "primitive", "or", "a", "primitive", "wrapper", "." ]
c5e2b80af76e3192cae7c9550b70c4d1ab312034
https://github.com/mockito/mockito/blob/c5e2b80af76e3192cae7c9550b70c4d1ab312034/src/main/java/org/mockito/internal/util/Primitives.java#L59-L61
129,791
mockito/mockito
src/main/java/org/mockito/internal/configuration/plugins/DefaultMockitoPlugins.java
DefaultMockitoPlugins.create
private <T> T create(Class<T> pluginType, String className) { if (className == null) { throw new IllegalStateException( "No default implementation for requested Mockito plugin type: " + pluginType.getName() + "\n" + "Is this a valid Mockito plugin type? If yes, pl...
java
private <T> T create(Class<T> pluginType, String className) { if (className == null) { throw new IllegalStateException( "No default implementation for requested Mockito plugin type: " + pluginType.getName() + "\n" + "Is this a valid Mockito plugin type? If yes, pl...
[ "private", "<", "T", ">", "T", "create", "(", "Class", "<", "T", ">", "pluginType", ",", "String", "className", ")", "{", "if", "(", "className", "==", "null", ")", "{", "throw", "new", "IllegalStateException", "(", "\"No default implementation for requested M...
Creates an instance of given plugin type, using specific implementation class.
[ "Creates", "an", "instance", "of", "given", "plugin", "type", "using", "specific", "implementation", "class", "." ]
c5e2b80af76e3192cae7c9550b70c4d1ab312034
https://github.com/mockito/mockito/blob/c5e2b80af76e3192cae7c9550b70c4d1ab312034/src/main/java/org/mockito/internal/configuration/plugins/DefaultMockitoPlugins.java#L56-L74
129,792
mockito/mockito
src/main/java/org/mockito/internal/junit/UnusedStubbingsFinder.java
UnusedStubbingsFinder.getUnusedStubbings
public UnusedStubbings getUnusedStubbings(Iterable<Object> mocks) { Set<Stubbing> stubbings = AllInvocationsFinder.findStubbings(mocks); List<Stubbing> unused = filter(stubbings, new Filter<Stubbing>() { public boolean isOut(Stubbing s) { return !UnusedStubbingReporting.shou...
java
public UnusedStubbings getUnusedStubbings(Iterable<Object> mocks) { Set<Stubbing> stubbings = AllInvocationsFinder.findStubbings(mocks); List<Stubbing> unused = filter(stubbings, new Filter<Stubbing>() { public boolean isOut(Stubbing s) { return !UnusedStubbingReporting.shou...
[ "public", "UnusedStubbings", "getUnusedStubbings", "(", "Iterable", "<", "Object", ">", "mocks", ")", "{", "Set", "<", "Stubbing", ">", "stubbings", "=", "AllInvocationsFinder", ".", "findStubbings", "(", "mocks", ")", ";", "List", "<", "Stubbing", ">", "unuse...
Gets all unused stubbings for given set of mock objects, in order. Stubbings explicitily marked as LENIENT are not included.
[ "Gets", "all", "unused", "stubbings", "for", "given", "set", "of", "mock", "objects", "in", "order", ".", "Stubbings", "explicitily", "marked", "as", "LENIENT", "are", "not", "included", "." ]
c5e2b80af76e3192cae7c9550b70c4d1ab312034
https://github.com/mockito/mockito/blob/c5e2b80af76e3192cae7c9550b70c4d1ab312034/src/main/java/org/mockito/internal/junit/UnusedStubbingsFinder.java#L31-L41
129,793
mockito/mockito
src/main/java/org/mockito/internal/stubbing/InvocationContainerImpl.java
InvocationContainerImpl.addAnswer
public StubbedInvocationMatcher addAnswer(Answer answer, boolean isConsecutive, Strictness stubbingStrictness) { Invocation invocation = invocationForStubbing.getInvocation(); mockingProgress().stubbingCompleted(); if (answer instanceof ValidableAnswer) { ((ValidableAnswer) answer).v...
java
public StubbedInvocationMatcher addAnswer(Answer answer, boolean isConsecutive, Strictness stubbingStrictness) { Invocation invocation = invocationForStubbing.getInvocation(); mockingProgress().stubbingCompleted(); if (answer instanceof ValidableAnswer) { ((ValidableAnswer) answer).v...
[ "public", "StubbedInvocationMatcher", "addAnswer", "(", "Answer", "answer", ",", "boolean", "isConsecutive", ",", "Strictness", "stubbingStrictness", ")", "{", "Invocation", "invocation", "=", "invocationForStubbing", ".", "getInvocation", "(", ")", ";", "mockingProgres...
Adds new stubbed answer and returns the invocation matcher the answer was added to.
[ "Adds", "new", "stubbed", "answer", "and", "returns", "the", "invocation", "matcher", "the", "answer", "was", "added", "to", "." ]
c5e2b80af76e3192cae7c9550b70c4d1ab312034
https://github.com/mockito/mockito/blob/c5e2b80af76e3192cae7c9550b70c4d1ab312034/src/main/java/org/mockito/internal/stubbing/InvocationContainerImpl.java#L66-L82
129,794
mockito/mockito
src/main/java/org/mockito/internal/stubbing/InvocationContainerImpl.java
InvocationContainerImpl.setAnswersForStubbing
public void setAnswersForStubbing(List<Answer<?>> answers, Strictness strictness) { doAnswerStyleStubbing.setAnswers(answers, strictness); }
java
public void setAnswersForStubbing(List<Answer<?>> answers, Strictness strictness) { doAnswerStyleStubbing.setAnswers(answers, strictness); }
[ "public", "void", "setAnswersForStubbing", "(", "List", "<", "Answer", "<", "?", ">", ">", "answers", ",", "Strictness", "strictness", ")", "{", "doAnswerStyleStubbing", ".", "setAnswers", "(", "answers", ",", "strictness", ")", ";", "}" ]
Sets the answers declared with 'doAnswer' style.
[ "Sets", "the", "answers", "declared", "with", "doAnswer", "style", "." ]
c5e2b80af76e3192cae7c9550b70c4d1ab312034
https://github.com/mockito/mockito/blob/c5e2b80af76e3192cae7c9550b70c4d1ab312034/src/main/java/org/mockito/internal/stubbing/InvocationContainerImpl.java#L106-L108
129,795
mockito/mockito
src/main/java/org/mockito/internal/stubbing/InvocationContainerImpl.java
InvocationContainerImpl.getStubbingsAscending
public Collection<Stubbing> getStubbingsAscending() { List<Stubbing> result = new LinkedList<Stubbing>(stubbed); Collections.reverse(result); return result; }
java
public Collection<Stubbing> getStubbingsAscending() { List<Stubbing> result = new LinkedList<Stubbing>(stubbed); Collections.reverse(result); return result; }
[ "public", "Collection", "<", "Stubbing", ">", "getStubbingsAscending", "(", ")", "{", "List", "<", "Stubbing", ">", "result", "=", "new", "LinkedList", "<", "Stubbing", ">", "(", "stubbed", ")", ";", "Collections", ".", "reverse", "(", "result", ")", ";", ...
Stubbings in ascending order, most recent last
[ "Stubbings", "in", "ascending", "order", "most", "recent", "last" ]
c5e2b80af76e3192cae7c9550b70c4d1ab312034
https://github.com/mockito/mockito/blob/c5e2b80af76e3192cae7c9550b70c4d1ab312034/src/main/java/org/mockito/internal/stubbing/InvocationContainerImpl.java#L150-L154
129,796
mockito/mockito
src/main/java/org/mockito/internal/util/reflection/SuperTypesLastSorter.java
SuperTypesLastSorter.sortSuperTypesLast
public static List<Field> sortSuperTypesLast(Collection<? extends Field> unsortedFields) { List<Field> fields = new ArrayList<Field>(unsortedFields); Collections.sort(fields, compareFieldsByName); int i = 0; while (i < fields.size() - 1) { Field f = fields.get(i); ...
java
public static List<Field> sortSuperTypesLast(Collection<? extends Field> unsortedFields) { List<Field> fields = new ArrayList<Field>(unsortedFields); Collections.sort(fields, compareFieldsByName); int i = 0; while (i < fields.size() - 1) { Field f = fields.get(i); ...
[ "public", "static", "List", "<", "Field", ">", "sortSuperTypesLast", "(", "Collection", "<", "?", "extends", "Field", ">", "unsortedFields", ")", "{", "List", "<", "Field", ">", "fields", "=", "new", "ArrayList", "<", "Field", ">", "(", "unsortedFields", "...
Return a new collection with the fields sorted first by name, then with any fields moved after their supertypes.
[ "Return", "a", "new", "collection", "with", "the", "fields", "sorted", "first", "by", "name", "then", "with", "any", "fields", "moved", "after", "their", "supertypes", "." ]
c5e2b80af76e3192cae7c9550b70c4d1ab312034
https://github.com/mockito/mockito/blob/c5e2b80af76e3192cae7c9550b70c4d1ab312034/src/main/java/org/mockito/internal/util/reflection/SuperTypesLastSorter.java#L28-L56
129,797
mockito/mockito
src/main/java/org/mockito/internal/util/collections/Iterables.java
Iterables.toIterable
public static <T> Iterable<T> toIterable(Enumeration<T> in) { List<T> out = new LinkedList<T>(); while(in.hasMoreElements()) { out.add(in.nextElement()); } return out; }
java
public static <T> Iterable<T> toIterable(Enumeration<T> in) { List<T> out = new LinkedList<T>(); while(in.hasMoreElements()) { out.add(in.nextElement()); } return out; }
[ "public", "static", "<", "T", ">", "Iterable", "<", "T", ">", "toIterable", "(", "Enumeration", "<", "T", ">", "in", ")", "{", "List", "<", "T", ">", "out", "=", "new", "LinkedList", "<", "T", ">", "(", ")", ";", "while", "(", "in", ".", "hasMo...
Converts enumeration into iterable
[ "Converts", "enumeration", "into", "iterable" ]
c5e2b80af76e3192cae7c9550b70c4d1ab312034
https://github.com/mockito/mockito/blob/c5e2b80af76e3192cae7c9550b70c4d1ab312034/src/main/java/org/mockito/internal/util/collections/Iterables.java#L20-L26
129,798
mockito/mockito
src/main/java/org/mockito/internal/util/StringUtil.java
StringUtil.join
public static String join(String start, String linePrefix, Collection<?> lines) { if (lines.isEmpty()) { return ""; } StringBuilder out = new StringBuilder(start); for (Object line : lines) { out.append(linePrefix).append(line).append("\n"); } retu...
java
public static String join(String start, String linePrefix, Collection<?> lines) { if (lines.isEmpty()) { return ""; } StringBuilder out = new StringBuilder(start); for (Object line : lines) { out.append(linePrefix).append(line).append("\n"); } retu...
[ "public", "static", "String", "join", "(", "String", "start", ",", "String", "linePrefix", ",", "Collection", "<", "?", ">", "lines", ")", "{", "if", "(", "lines", ".", "isEmpty", "(", ")", ")", "{", "return", "\"\"", ";", "}", "StringBuilder", "out", ...
Joins Strings with EOL character @param start the starting String @param linePrefix the prefix for each line to be joined @param lines collection to join
[ "Joins", "Strings", "with", "EOL", "character" ]
c5e2b80af76e3192cae7c9550b70c4d1ab312034
https://github.com/mockito/mockito/blob/c5e2b80af76e3192cae7c9550b70c4d1ab312034/src/main/java/org/mockito/internal/util/StringUtil.java#L52-L61
129,799
mockito/mockito
src/main/java/org/mockito/internal/configuration/plugins/PluginLoader.java
PluginLoader.loadPlugin
@SuppressWarnings("unchecked") <T> T loadPlugin(final Class<T> pluginType) { return (T) loadPlugin(pluginType, null); }
java
@SuppressWarnings("unchecked") <T> T loadPlugin(final Class<T> pluginType) { return (T) loadPlugin(pluginType, null); }
[ "@", "SuppressWarnings", "(", "\"unchecked\"", ")", "<", "T", ">", "T", "loadPlugin", "(", "final", "Class", "<", "T", ">", "pluginType", ")", "{", "return", "(", "T", ")", "loadPlugin", "(", "pluginType", ",", "null", ")", ";", "}" ]
Scans the classpath for given pluginType. If not found, default class is used.
[ "Scans", "the", "classpath", "for", "given", "pluginType", ".", "If", "not", "found", "default", "class", "is", "used", "." ]
c5e2b80af76e3192cae7c9550b70c4d1ab312034
https://github.com/mockito/mockito/blob/c5e2b80af76e3192cae7c9550b70c4d1ab312034/src/main/java/org/mockito/internal/configuration/plugins/PluginLoader.java#L42-L45