method
stringlengths
13
441k
clean_method
stringlengths
7
313k
doc
stringlengths
17
17.3k
comment
stringlengths
3
1.42k
method_name
stringlengths
1
273
extra
dict
imports
sequence
imports_info
stringlengths
19
34.8k
cluster_imports_info
stringlengths
15
3.66k
libraries
sequence
libraries_info
stringlengths
6
661
id
int64
0
2.92M
private boolean setStatus(HttpServletResponse response, int status) throws IOException { if (status >= HttpServletResponse.SC_BAD_REQUEST) { response.sendError(status); return true; } else { response.setStatus(status); return false; } } protected class CGIEnvironment { private ServletContext context = null; private String contextPath = null; private String servletPath = null; private String pathInfo = null; private String webAppRootDir = null; private File tmpDir = null; private Hashtable<String, String> env = null; private String command = null; private final File workingDirectory; private final ArrayList<String> cmdLineParameters = new ArrayList<>(); private final boolean valid; protected CGIEnvironment(HttpServletRequest req, ServletContext context) throws IOException { setupFromContext(context); setupFromRequest(req); this.valid = setCGIEnvironment(req); if (this.valid) { workingDirectory = new File(command.substring(0, command.lastIndexOf(File.separator))); } else { workingDirectory = null; } }
boolean function(HttpServletResponse response, int status) throws IOException { if (status >= HttpServletResponse.SC_BAD_REQUEST) { response.sendError(status); return true; } else { response.setStatus(status); return false; } } protected class CGIEnvironment { private ServletContext context = null; private String contextPath = null; private String servletPath = null; private String pathInfo = null; private String webAppRootDir = null; private File tmpDir = null; private Hashtable<String, String> env = null; private String command = null; private final File workingDirectory; private final ArrayList<String> cmdLineParameters = new ArrayList<>(); private final boolean valid; protected CGIEnvironment(HttpServletRequest req, ServletContext context) throws IOException { setupFromContext(context); setupFromRequest(req); this.valid = setCGIEnvironment(req); if (this.valid) { workingDirectory = new File(command.substring(0, command.lastIndexOf(File.separator))); } else { workingDirectory = null; } }
/** * Behaviour depends on the status code. * * Status < 400 - Calls setStatus. Returns false. CGI servlet will provide * the response body. * Status >= 400 - Calls sendError(status), returns true. Standard error * page mechanism will provide the response body. */
Behaviour depends on the status code. Status = 400 - Calls sendError(status), returns true. Standard error page mechanism will provide the response body
setStatus
{ "repo_name": "IAMTJW/Tomcat-8.5.20", "path": "tomcat-8.5.20/java/org/apache/catalina/servlets/CGIServlet.java", "license": "apache-2.0", "size": 70877 }
[ "java.io.File", "java.io.IOException", "java.util.ArrayList", "java.util.Hashtable", "javax.servlet.ServletContext", "javax.servlet.http.HttpServletRequest", "javax.servlet.http.HttpServletResponse" ]
import java.io.File; import java.io.IOException; import java.util.ArrayList; import java.util.Hashtable; import javax.servlet.ServletContext; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse;
import java.io.*; import java.util.*; import javax.servlet.*; import javax.servlet.http.*;
[ "java.io", "java.util", "javax.servlet" ]
java.io; java.util; javax.servlet;
356,082
public void setUploadedFileSaveDirectory(String uploadedFileSaveDirectory) { if (StrKit.isBlank(uploadedFileSaveDirectory)) throw new IllegalArgumentException("uploadedFileSaveDirectory can not be blank"); if (uploadedFileSaveDirectory.endsWith("/") || uploadedFileSaveDirectory.endsWith("\\")) this.uploadedFileSaveDirectory = uploadedFileSaveDirectory; else this.uploadedFileSaveDirectory = uploadedFileSaveDirectory + File.separator; }
void function(String uploadedFileSaveDirectory) { if (StrKit.isBlank(uploadedFileSaveDirectory)) throw new IllegalArgumentException(STR); if (uploadedFileSaveDirectory.endsWith("/") uploadedFileSaveDirectory.endsWith("\\")) this.uploadedFileSaveDirectory = uploadedFileSaveDirectory; else this.uploadedFileSaveDirectory = uploadedFileSaveDirectory + File.separator; }
/** * Set the save directory for upload file. You can use PathUtil.getWebRootPath() * to get the web root path of this application, then create a path based on * web root path conveniently. */
Set the save directory for upload file. You can use PathUtil.getWebRootPath() to get the web root path of this application, then create a path based on web root path conveniently
setUploadedFileSaveDirectory
{ "repo_name": "zhengjiabin/domeke", "path": "core/src/main/java/com/jfinal/config/Constants.java", "license": "apache-2.0", "size": 9963 }
[ "com.jfinal.kit.StrKit", "java.io.File" ]
import com.jfinal.kit.StrKit; import java.io.File;
import com.jfinal.kit.*; import java.io.*;
[ "com.jfinal.kit", "java.io" ]
com.jfinal.kit; java.io;
891,352
public void removeHomepage(Document value) { Base.remove(this.model, this.getResource(), HOMEPAGE, value); }
void function(Document value) { Base.remove(this.model, this.getResource(), HOMEPAGE, value); }
/** * Removes a value of property Homepage given as an instance of Document * * @param value the value to be removed [Generated from RDFReactor template * rule #remove4dynamic] */
Removes a value of property Homepage given as an instance of Document
removeHomepage
{ "repo_name": "m0ep/master-thesis", "path": "source/apis/rdf2go/rdf2go-foaf/src/main/java/com/xmlns/foaf/Thing.java", "license": "mit", "size": 274766 }
[ "org.ontoware.rdfreactor.runtime.Base" ]
import org.ontoware.rdfreactor.runtime.Base;
import org.ontoware.rdfreactor.runtime.*;
[ "org.ontoware.rdfreactor" ]
org.ontoware.rdfreactor;
2,809,904
private void testShorterSchemaDeserialization(Random r) throws Throwable { StructObjectInspector rowOI1 = (StructObjectInspector) ObjectInspectorFactory .getReflectionObjectInspector(MyTestClassBigger.class, ObjectInspectorOptions.JAVA); String fieldNames1 = ObjectInspectorUtils.getFieldNames(rowOI1); String fieldTypes1 = ObjectInspectorUtils.getFieldTypes(rowOI1); AbstractSerDe serde1 = getSerDe(fieldNames1, fieldTypes1); serde1.getObjectInspector(); StructObjectInspector rowOI2 = (StructObjectInspector) ObjectInspectorFactory .getReflectionObjectInspector(MyTestClass.class, ObjectInspectorOptions.JAVA); String fieldNames2 = ObjectInspectorUtils.getFieldNames(rowOI2); String fieldTypes2 = ObjectInspectorUtils.getFieldTypes(rowOI2); AbstractSerDe serde2 = getSerDe(fieldNames2, fieldTypes2); ObjectInspector serdeOI2 = serde2.getObjectInspector(); int num = 100; for (int itest = 0; itest < num; itest++) { MyTestClassBigger t = new MyTestClassBigger(); ExtraTypeInfo extraTypeInfo = new ExtraTypeInfo(); t.randomFill(r, extraTypeInfo); BytesWritable bw = (BytesWritable) serde1.serialize(t, rowOI1); Object output = serde2.deserialize(bw); if (0 != compareDiffSizedStructs(t, rowOI1, output, serdeOI2)) { System.out.println("structs = " + SerDeUtils.getJSONString(t, rowOI1)); System.out.println("deserialized = " + SerDeUtils.getJSONString(output, serdeOI2)); System.out.println("serialized = " + TestBinarySortableSerDe.hexString(bw)); assertEquals(t, output); } } }
void function(Random r) throws Throwable { StructObjectInspector rowOI1 = (StructObjectInspector) ObjectInspectorFactory .getReflectionObjectInspector(MyTestClassBigger.class, ObjectInspectorOptions.JAVA); String fieldNames1 = ObjectInspectorUtils.getFieldNames(rowOI1); String fieldTypes1 = ObjectInspectorUtils.getFieldTypes(rowOI1); AbstractSerDe serde1 = getSerDe(fieldNames1, fieldTypes1); serde1.getObjectInspector(); StructObjectInspector rowOI2 = (StructObjectInspector) ObjectInspectorFactory .getReflectionObjectInspector(MyTestClass.class, ObjectInspectorOptions.JAVA); String fieldNames2 = ObjectInspectorUtils.getFieldNames(rowOI2); String fieldTypes2 = ObjectInspectorUtils.getFieldTypes(rowOI2); AbstractSerDe serde2 = getSerDe(fieldNames2, fieldTypes2); ObjectInspector serdeOI2 = serde2.getObjectInspector(); int num = 100; for (int itest = 0; itest < num; itest++) { MyTestClassBigger t = new MyTestClassBigger(); ExtraTypeInfo extraTypeInfo = new ExtraTypeInfo(); t.randomFill(r, extraTypeInfo); BytesWritable bw = (BytesWritable) serde1.serialize(t, rowOI1); Object output = serde2.deserialize(bw); if (0 != compareDiffSizedStructs(t, rowOI1, output, serdeOI2)) { System.out.println(STR + SerDeUtils.getJSONString(t, rowOI1)); System.out.println(STR + SerDeUtils.getJSONString(output, serdeOI2)); System.out.println(STR + TestBinarySortableSerDe.hexString(bw)); assertEquals(t, output); } } }
/** * Test shorter schema deserialization where a bigger struct is serialized and * it is then deserialized with a smaller struct. Here the serialized struct * has 10 fields and we deserialized to a struct of 9 fields. */
Test shorter schema deserialization where a bigger struct is serialized and it is then deserialized with a smaller struct. Here the serialized struct has 10 fields and we deserialized to a struct of 9 fields
testShorterSchemaDeserialization
{ "repo_name": "nishantmonu51/hive", "path": "serde/src/test/org/apache/hadoop/hive/serde2/lazybinary/TestLazyBinarySerDe.java", "license": "apache-2.0", "size": 22032 }
[ "java.util.Random", "org.apache.hadoop.hive.serde2.AbstractSerDe", "org.apache.hadoop.hive.serde2.SerDeUtils", "org.apache.hadoop.hive.serde2.binarysortable.MyTestClass", "org.apache.hadoop.hive.serde2.binarysortable.MyTestPrimitiveClass", "org.apache.hadoop.hive.serde2.binarysortable.TestBinarySortableSerDe", "org.apache.hadoop.hive.serde2.objectinspector.ObjectInspector", "org.apache.hadoop.hive.serde2.objectinspector.ObjectInspectorFactory", "org.apache.hadoop.hive.serde2.objectinspector.ObjectInspectorUtils", "org.apache.hadoop.hive.serde2.objectinspector.StructObjectInspector", "org.apache.hadoop.io.BytesWritable", "org.junit.Assert" ]
import java.util.Random; import org.apache.hadoop.hive.serde2.AbstractSerDe; import org.apache.hadoop.hive.serde2.SerDeUtils; import org.apache.hadoop.hive.serde2.binarysortable.MyTestClass; import org.apache.hadoop.hive.serde2.binarysortable.MyTestPrimitiveClass; import org.apache.hadoop.hive.serde2.binarysortable.TestBinarySortableSerDe; import org.apache.hadoop.hive.serde2.objectinspector.ObjectInspector; import org.apache.hadoop.hive.serde2.objectinspector.ObjectInspectorFactory; import org.apache.hadoop.hive.serde2.objectinspector.ObjectInspectorUtils; import org.apache.hadoop.hive.serde2.objectinspector.StructObjectInspector; import org.apache.hadoop.io.BytesWritable; import org.junit.Assert;
import java.util.*; import org.apache.hadoop.hive.serde2.*; import org.apache.hadoop.hive.serde2.binarysortable.*; import org.apache.hadoop.hive.serde2.objectinspector.*; import org.apache.hadoop.io.*; import org.junit.*;
[ "java.util", "org.apache.hadoop", "org.junit" ]
java.util; org.apache.hadoop; org.junit;
167,571
private static void applySafeCompilationOptions(CompilerOptions options) { // ReplaceIdGenerators is on by default, but should run in simple mode. options.replaceIdGenerators = false; // Does not call applyBasicCompilationOptions(options) because the call to // skipAllCompilerPasses() cannot be easily undone. options.dependencyOptions.setDependencySorting(true); options.closurePass = true; options.setRenamingPolicy( VariableRenamingPolicy.LOCAL, PropertyRenamingPolicy.OFF); options.shadowVariables = true; options.setInlineVariables(Reach.LOCAL_ONLY); options.flowSensitiveInlineVariables = true; options.setInlineFunctions(Reach.LOCAL_ONLY); options.setAssumeClosuresOnlyCaptureReferences(true); options.checkGlobalThisLevel = CheckLevel.OFF; options.foldConstants = true; options.coalesceVariableNames = true; options.deadAssignmentElimination = true; options.collapseVariableDeclarations = true; options.convertToDottedProperties = true; options.labelRenaming = true; options.removeDeadCode = true; options.optimizeArgumentsArray = true; options.setRemoveUnusedVariables(Reach.LOCAL_ONLY); options.collapseObjectLiterals = true; options.protectHiddenSideEffects = true; // Allows annotations that are not standard. options.setWarningLevel(DiagnosticGroups.NON_STANDARD_JSDOC, CheckLevel.OFF); }
static void function(CompilerOptions options) { options.replaceIdGenerators = false; options.dependencyOptions.setDependencySorting(true); options.closurePass = true; options.setRenamingPolicy( VariableRenamingPolicy.LOCAL, PropertyRenamingPolicy.OFF); options.shadowVariables = true; options.setInlineVariables(Reach.LOCAL_ONLY); options.flowSensitiveInlineVariables = true; options.setInlineFunctions(Reach.LOCAL_ONLY); options.setAssumeClosuresOnlyCaptureReferences(true); options.checkGlobalThisLevel = CheckLevel.OFF; options.foldConstants = true; options.coalesceVariableNames = true; options.deadAssignmentElimination = true; options.collapseVariableDeclarations = true; options.convertToDottedProperties = true; options.labelRenaming = true; options.removeDeadCode = true; options.optimizeArgumentsArray = true; options.setRemoveUnusedVariables(Reach.LOCAL_ONLY); options.collapseObjectLiterals = true; options.protectHiddenSideEffects = true; options.setWarningLevel(DiagnosticGroups.NON_STANDARD_JSDOC, CheckLevel.OFF); }
/** * Add options that are safe. Safe means options that won't break the * JavaScript code even if no symbols are exported and no coding convention * is used. * @param options The CompilerOptions object to set the options on. */
Add options that are safe. Safe means options that won't break the JavaScript code even if no symbols are exported and no coding convention is used
applySafeCompilationOptions
{ "repo_name": "dound/google-closure-compiler", "path": "src/com/google/javascript/jscomp/CompilationLevel.java", "license": "apache-2.0", "size": 7971 }
[ "com.google.javascript.jscomp.CompilerOptions" ]
import com.google.javascript.jscomp.CompilerOptions;
import com.google.javascript.jscomp.*;
[ "com.google.javascript" ]
com.google.javascript;
310,590
protected void depopulateManager(IContributionManager manager, Collection<? extends IAction> actions) { if (actions != null) { IContributionItem[] items = manager.getItems(); for (int i = 0; i < items.length; i++) { // Look into SubContributionItems // IContributionItem contributionItem = items[i]; while (contributionItem instanceof SubContributionItem) { contributionItem = ((SubContributionItem)contributionItem).getInnerItem(); } // Delete the ActionContributionItems with matching action. // if (contributionItem instanceof ActionContributionItem) { IAction action = ((ActionContributionItem)contributionItem).getAction(); if (actions.contains(action)) { manager.remove(contributionItem); } } } } }
void function(IContributionManager manager, Collection<? extends IAction> actions) { if (actions != null) { IContributionItem[] items = manager.getItems(); for (int i = 0; i < items.length; i++) { IContributionItem contributionItem = items[i]; while (contributionItem instanceof SubContributionItem) { contributionItem = ((SubContributionItem)contributionItem).getInnerItem(); } if (contributionItem instanceof ActionContributionItem) { IAction action = ((ActionContributionItem)contributionItem).getAction(); if (actions.contains(action)) { manager.remove(contributionItem); } } } } }
/** * This removes from the specified <code>manager</code> all {@link org.eclipse.jface.action.ActionContributionItem}s * based on the {@link org.eclipse.jface.action.IAction}s contained in the <code>actions</code> collection. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */
This removes from the specified <code>manager</code> all <code>org.eclipse.jface.action.ActionContributionItem</code>s based on the <code>org.eclipse.jface.action.IAction</code>s contained in the <code>actions</code> collection.
depopulateManager
{ "repo_name": "SOM-Research/odata-generator", "path": "metamodel/som.odata.metamodel.editor/src/edm/presentation/EdmActionBarContributor.java", "license": "epl-1.0", "size": 14316 }
[ "java.util.Collection", "org.eclipse.jface.action.ActionContributionItem", "org.eclipse.jface.action.IAction", "org.eclipse.jface.action.IContributionItem", "org.eclipse.jface.action.IContributionManager", "org.eclipse.jface.action.SubContributionItem" ]
import java.util.Collection; import org.eclipse.jface.action.ActionContributionItem; import org.eclipse.jface.action.IAction; import org.eclipse.jface.action.IContributionItem; import org.eclipse.jface.action.IContributionManager; import org.eclipse.jface.action.SubContributionItem;
import java.util.*; import org.eclipse.jface.action.*;
[ "java.util", "org.eclipse.jface" ]
java.util; org.eclipse.jface;
336,155
public void setLinkLocalService(LinkLocalService linkLocalService) { this.linkLocalService = linkLocalService; }
void function(LinkLocalService linkLocalService) { this.linkLocalService = linkLocalService; }
/** * Sets the link local service. * * @param linkLocalService the link local service */
Sets the link local service
setLinkLocalService
{ "repo_name": "fraunhoferfokus/govapps", "path": "data-portlet/src/main/java/de/fraunhofer/fokus/movepla/service/base/EntitlementServiceBaseImpl.java", "license": "bsd-3-clause", "size": 32782 }
[ "de.fraunhofer.fokus.movepla.service.LinkLocalService" ]
import de.fraunhofer.fokus.movepla.service.LinkLocalService;
import de.fraunhofer.fokus.movepla.service.*;
[ "de.fraunhofer.fokus" ]
de.fraunhofer.fokus;
882,126
void setGraphIds(GradoopIdList graphIds);
void setGraphIds(GradoopIdList graphIds);
/** * Adds the given graph set to the element. * * @param graphIds the graphIds to be added */
Adds the given graph set to the element
setGraphIds
{ "repo_name": "p3et/gradoop", "path": "gradoop-common/src/main/java/org/gradoop/common/model/api/entities/EPGMGraphElement.java", "license": "apache-2.0", "size": 1756 }
[ "org.gradoop.common.model.impl.id.GradoopIdList" ]
import org.gradoop.common.model.impl.id.GradoopIdList;
import org.gradoop.common.model.impl.id.*;
[ "org.gradoop.common" ]
org.gradoop.common;
1,312,159
public ResolvedPropertyModelImpl buildResolved() { return build().resolve(); }
ResolvedPropertyModelImpl function() { return build().resolve(); }
/** * Builds a {@link ResolvedPropertyModel} with the properties defined by this builder. * * @return the built model */
Builds a <code>ResolvedPropertyModel</code> with the properties defined by this builder
buildResolved
{ "repo_name": "scana/ok-gradle", "path": "plugin/src/main/java/me/scana/okgradle/internal/dsl/model/ext/GradlePropertyModelBuilder.java", "license": "apache-2.0", "size": 7836 }
[ "me.scana.okgradle.internal.dsl.model.ext.ResolvedPropertyModelImpl" ]
import me.scana.okgradle.internal.dsl.model.ext.ResolvedPropertyModelImpl;
import me.scana.okgradle.internal.dsl.model.ext.*;
[ "me.scana.okgradle" ]
me.scana.okgradle;
90,628
public void actionPerformed(ActionEvent e) { JButton button = (JButton) e.getSource(); String buttonText = button.getText(); int day = new Integer(buttonText).intValue(); setDay(day); }
void function(ActionEvent e) { JButton button = (JButton) e.getSource(); String buttonText = button.getText(); int day = new Integer(buttonText).intValue(); setDay(day); }
/** * JDayChooser is the ActionListener for all day buttons. * * @param e the ActionEvent */
JDayChooser is the ActionListener for all day buttons
actionPerformed
{ "repo_name": "FOC-framework/framework", "path": "foc/src/com/foc/gui/dateChooser/JDayChooser.java", "license": "apache-2.0", "size": 22437 }
[ "java.awt.event.ActionEvent", "javax.swing.JButton" ]
import java.awt.event.ActionEvent; import javax.swing.JButton;
import java.awt.event.*; import javax.swing.*;
[ "java.awt", "javax.swing" ]
java.awt; javax.swing;
647,425
@Nonnull public java.util.concurrent.CompletableFuture<DeviceComplianceUserStatus> putAsync(@Nonnull final DeviceComplianceUserStatus newDeviceComplianceUserStatus) { return sendAsync(HttpMethod.PUT, newDeviceComplianceUserStatus); }
java.util.concurrent.CompletableFuture<DeviceComplianceUserStatus> function(@Nonnull final DeviceComplianceUserStatus newDeviceComplianceUserStatus) { return sendAsync(HttpMethod.PUT, newDeviceComplianceUserStatus); }
/** * Creates a DeviceComplianceUserStatus with a new object * * @param newDeviceComplianceUserStatus the object to create/update * @return a future with the result */
Creates a DeviceComplianceUserStatus with a new object
putAsync
{ "repo_name": "microsoftgraph/msgraph-sdk-java", "path": "src/main/java/com/microsoft/graph/requests/DeviceComplianceUserStatusRequest.java", "license": "mit", "size": 6544 }
[ "com.microsoft.graph.http.HttpMethod", "com.microsoft.graph.models.DeviceComplianceUserStatus", "javax.annotation.Nonnull" ]
import com.microsoft.graph.http.HttpMethod; import com.microsoft.graph.models.DeviceComplianceUserStatus; import javax.annotation.Nonnull;
import com.microsoft.graph.http.*; import com.microsoft.graph.models.*; import javax.annotation.*;
[ "com.microsoft.graph", "javax.annotation" ]
com.microsoft.graph; javax.annotation;
1,771,392
public void updatePolicy(Policy policy, Date from, Date to);
void function(Policy policy, Date from, Date to);
/** * Update the policy valid dates * * @param policy * @param from * @param to */
Update the policy valid dates
updatePolicy
{ "repo_name": "RLDevOps/Demo", "path": "src/main/java/org/olat/basesecurity/BaseSecurity.java", "license": "apache-2.0", "size": 15856 }
[ "java.util.Date" ]
import java.util.Date;
import java.util.*;
[ "java.util" ]
java.util;
1,289,619
public void moveToCurrentRow() throws SQLException { throw new NotUpdatable(); }
void function() throws SQLException { throw new NotUpdatable(); }
/** * JDBC 2.0 Move the cursor to the remembered cursor position, usually the * current row. Has no effect unless the cursor is on the insert row. * * @exception SQLException * if a database-access error occurs, or the result set is * not updatable * @throws NotUpdatable */
JDBC 2.0 Move the cursor to the remembered cursor position, usually the current row. Has no effect unless the cursor is on the insert row
moveToCurrentRow
{ "repo_name": "mwaylabs/mysql-connector-j", "path": "src/com/mysql/jdbc/ResultSetImpl.java", "license": "gpl-2.0", "size": 288724 }
[ "java.sql.SQLException" ]
import java.sql.SQLException;
import java.sql.*;
[ "java.sql" ]
java.sql;
1,180,228
public void display(float offsetX, float offsetY, float offsetZ, float speed, int amount, Location center, List<Player> players) throws ParticleVersionException, ParticleDataException, IllegalArgumentException { if (!isSupported()) { throw new ParticleVersionException("This particle effect is not supported by your server version"); } if (hasProperty(ParticleProperty.REQUIRES_DATA)) { throw new ParticleDataException("This particle effect requires additional data"); } if (hasProperty(ParticleProperty.REQUIRES_WATER) && !isWater(center)) { throw new IllegalArgumentException("There is no water at the center location"); } new ParticlePacket(this, offsetX, offsetY, offsetZ, speed, amount, isLongDistance(center, players), null).sendTo(center, players); }
void function(float offsetX, float offsetY, float offsetZ, float speed, int amount, Location center, List<Player> players) throws ParticleVersionException, ParticleDataException, IllegalArgumentException { if (!isSupported()) { throw new ParticleVersionException(STR); } if (hasProperty(ParticleProperty.REQUIRES_DATA)) { throw new ParticleDataException(STR); } if (hasProperty(ParticleProperty.REQUIRES_WATER) && !isWater(center)) { throw new IllegalArgumentException(STR); } new ParticlePacket(this, offsetX, offsetY, offsetZ, speed, amount, isLongDistance(center, players), null).sendTo(center, players); }
/** * Displays a particle effect which is only visible for the specified players * * @param offsetX Maximum distance particles can fly away from the center on the x-axis * @param offsetY Maximum distance particles can fly away from the center on the y-axis * @param offsetZ Maximum distance particles can fly away from the center on the z-axis * @param speed Display speed of the particles * @param amount Amount of particles * @param center Center location of the effect * @param players Receivers of the effect * @throws ParticleVersionException If the particle effect is not supported by the server version * @throws ParticleDataException If the particle effect requires additional data * @throws IllegalArgumentException If the particle effect requires water and none is at the center location * @see ParticlePacket * @see ParticlePacket#sendTo(Location, List) */
Displays a particle effect which is only visible for the specified players
display
{ "repo_name": "NavidK0/PSCiv", "path": "src/main/java/com/lastabyss/psciv/util/ParticleEffect.java", "license": "mit", "size": 96450 }
[ "java.util.List", "org.bukkit.Location", "org.bukkit.entity.Player" ]
import java.util.List; import org.bukkit.Location; import org.bukkit.entity.Player;
import java.util.*; import org.bukkit.*; import org.bukkit.entity.*;
[ "java.util", "org.bukkit", "org.bukkit.entity" ]
java.util; org.bukkit; org.bukkit.entity;
2,105,500
checkArgument(task); checkArgument(mode); checkArgument(isolation); checkNotTransaction(); checkNotShutdown(); Transaction<T> transaction = new SimpleTransaction<T>(mode, isolation, this, task); try { return new SyncTransactionFuture<T>(transaction.call(), null); } catch (Exception e) { return new SyncTransactionFuture<T>(null, e); } }
checkArgument(task); checkArgument(mode); checkArgument(isolation); checkNotTransaction(); checkNotShutdown(); Transaction<T> transaction = new SimpleTransaction<T>(mode, isolation, this, task); try { return new SyncTransactionFuture<T>(transaction.call(), null); } catch (Exception e) { return new SyncTransactionFuture<T>(null, e); } }
/** * Executes the transaction synchronously, with the given access mode * and isolation level. */
Executes the transaction synchronously, with the given access mode and isolation level
submit
{ "repo_name": "git-afsantos/undo4j", "path": "src/main/java/org/bitbucket/jtransaction/transactions/SynchronousTransactionManager.java", "license": "mit", "size": 3320 }
[ "org.bitbucket.jtransaction.common.Check" ]
import org.bitbucket.jtransaction.common.Check;
import org.bitbucket.jtransaction.common.*;
[ "org.bitbucket.jtransaction" ]
org.bitbucket.jtransaction;
1,282,241
public Map<String, String> getFullNameOfFilteredUsers(Set<String> commonNamesOfAllUsers);
Map<String, String> function(Set<String> commonNamesOfAllUsers);
/** * Gets the full name of all the users provided in the set. * * @param commonNamesOfAllUsers {@link Set}<{@link String}> Common names of filtered users. * @return {@link Map}<{@link String}, {@link String}> */
Gets the full name of all the users provided in the set
getFullNameOfFilteredUsers
{ "repo_name": "ungerik/ephesoft", "path": "Ephesoft_Community_Release_4.0.2.0/source/gxt/gxt-core/src/main/java/com/ephesoft/gxt/core/client/DCMARemoteService.java", "license": "agpl-3.0", "size": 9812 }
[ "java.util.Map", "java.util.Set" ]
import java.util.Map; import java.util.Set;
import java.util.*;
[ "java.util" ]
java.util;
2,019,451
public DataSheet getStructs(String schemaName, String structName) { Connection con = getConnection(DbAccessType.READ_ONLY, schemaName); try { return getMetaSheet(con, schemaName, structName, STRUCT_IDX); } finally { closeConnection(con, DbAccessType.READ_ONLY, true); } }
DataSheet function(String schemaName, String structName) { Connection con = getConnection(DbAccessType.READ_ONLY, schemaName); try { return getMetaSheet(con, schemaName, structName, STRUCT_IDX); } finally { closeConnection(con, DbAccessType.READ_ONLY, true); } }
/** * get structures/user defined types * * @param schemaName * null, pattern, or name * @param structName * null or pattern. * @return data sheet containing attributes of structures. Null of no output */
get structures/user defined types
getStructs
{ "repo_name": "raghu-bhandi/simplity-kernel", "path": "java/org/simplity/kernel/db/DbDriver.java", "license": "mit", "size": 52656 }
[ "java.sql.Connection", "org.simplity.kernel.data.DataSheet" ]
import java.sql.Connection; import org.simplity.kernel.data.DataSheet;
import java.sql.*; import org.simplity.kernel.data.*;
[ "java.sql", "org.simplity.kernel" ]
java.sql; org.simplity.kernel;
1,574,593
public void setRatio (BigDecimal Ratio) { set_Value (COLUMNNAME_Ratio, Ratio); }
void function (BigDecimal Ratio) { set_Value (COLUMNNAME_Ratio, Ratio); }
/** Set Ratio. @param Ratio Relative Ratio for Distributions */
Set Ratio
setRatio
{ "repo_name": "erpcya/adempierePOS", "path": "base/src/org/compiere/model/X_T_DistributionRunDetail.java", "license": "gpl-2.0", "size": 10887 }
[ "java.math.BigDecimal" ]
import java.math.BigDecimal;
import java.math.*;
[ "java.math" ]
java.math;
2,823,419
public void testFollowerCheckerDetectsUnresponsiveNodeAfterMasterReelection() throws Exception { testFollowerCheckerAfterMasterReelection(NetworkDisruption.UNRESPONSIVE, Settings.builder() .put(LeaderChecker.LEADER_CHECK_TIMEOUT_SETTING.getKey(), "1s") .put(LeaderChecker.LEADER_CHECK_RETRY_COUNT_SETTING.getKey(), "4") .put(FollowersChecker.FOLLOWER_CHECK_TIMEOUT_SETTING.getKey(), "1s") .put(FollowersChecker.FOLLOWER_CHECK_RETRY_COUNT_SETTING.getKey(), 1).build()); }
void function() throws Exception { testFollowerCheckerAfterMasterReelection(NetworkDisruption.UNRESPONSIVE, Settings.builder() .put(LeaderChecker.LEADER_CHECK_TIMEOUT_SETTING.getKey(), "1s") .put(LeaderChecker.LEADER_CHECK_RETRY_COUNT_SETTING.getKey(), "4") .put(FollowersChecker.FOLLOWER_CHECK_TIMEOUT_SETTING.getKey(), "1s") .put(FollowersChecker.FOLLOWER_CHECK_RETRY_COUNT_SETTING.getKey(), 1).build()); }
/** * Verify that nodes fault detection detects an unresponsive node after master reelection */
Verify that nodes fault detection detects an unresponsive node after master reelection
testFollowerCheckerDetectsUnresponsiveNodeAfterMasterReelection
{ "repo_name": "gingerwizard/elasticsearch", "path": "server/src/internalClusterTest/java/org/elasticsearch/discovery/StableMasterDisruptionIT.java", "license": "apache-2.0", "size": 12908 }
[ "org.elasticsearch.cluster.coordination.FollowersChecker", "org.elasticsearch.cluster.coordination.LeaderChecker", "org.elasticsearch.common.settings.Settings", "org.elasticsearch.test.disruption.NetworkDisruption" ]
import org.elasticsearch.cluster.coordination.FollowersChecker; import org.elasticsearch.cluster.coordination.LeaderChecker; import org.elasticsearch.common.settings.Settings; import org.elasticsearch.test.disruption.NetworkDisruption;
import org.elasticsearch.cluster.coordination.*; import org.elasticsearch.common.settings.*; import org.elasticsearch.test.disruption.*;
[ "org.elasticsearch.cluster", "org.elasticsearch.common", "org.elasticsearch.test" ]
org.elasticsearch.cluster; org.elasticsearch.common; org.elasticsearch.test;
1,435,557
public Environment updateEnvironment(Environment environment) throws APIManagementException { try (Connection connection = APIMgtDBUtil.getConnection()) { connection.setAutoCommit(false); try (PreparedStatement prepStmt = connection.prepareStatement(SQLConstants.UPDATE_ENVIRONMENT_SQL)) { prepStmt.setString(1, environment.getDisplayName()); prepStmt.setString(2, environment.getDescription()); prepStmt.setString(3, environment.getUuid()); prepStmt.executeUpdate(); deleteGatewayVhosts(connection, environment.getId()); addGatewayVhosts(connection, environment.getId(), environment.getVhosts()); connection.commit(); } catch (SQLException e) { connection.rollback(); handleException("Failed to update Environment", e); } } catch (SQLException e) { handleException("Failed to update Environment", e); } return environment; }
Environment function(Environment environment) throws APIManagementException { try (Connection connection = APIMgtDBUtil.getConnection()) { connection.setAutoCommit(false); try (PreparedStatement prepStmt = connection.prepareStatement(SQLConstants.UPDATE_ENVIRONMENT_SQL)) { prepStmt.setString(1, environment.getDisplayName()); prepStmt.setString(2, environment.getDescription()); prepStmt.setString(3, environment.getUuid()); prepStmt.executeUpdate(); deleteGatewayVhosts(connection, environment.getId()); addGatewayVhosts(connection, environment.getId(), environment.getVhosts()); connection.commit(); } catch (SQLException e) { connection.rollback(); handleException(STR, e); } } catch (SQLException e) { handleException(STR, e); } return environment; }
/** * Update Gateway Environment * * @param environment Environment to be updated * @return Updated Environment * @throws APIManagementException if failed to updated Environment */
Update Gateway Environment
updateEnvironment
{ "repo_name": "tharikaGitHub/carbon-apimgt", "path": "components/apimgt/org.wso2.carbon.apimgt.impl/src/main/java/org/wso2/carbon/apimgt/impl/dao/ApiMgtDAO.java", "license": "apache-2.0", "size": 805423 }
[ "java.sql.Connection", "java.sql.PreparedStatement", "java.sql.SQLException", "org.wso2.carbon.apimgt.api.APIManagementException", "org.wso2.carbon.apimgt.api.model.Environment", "org.wso2.carbon.apimgt.impl.dao.constants.SQLConstants", "org.wso2.carbon.apimgt.impl.utils.APIMgtDBUtil" ]
import java.sql.Connection; import java.sql.PreparedStatement; import java.sql.SQLException; import org.wso2.carbon.apimgt.api.APIManagementException; import org.wso2.carbon.apimgt.api.model.Environment; import org.wso2.carbon.apimgt.impl.dao.constants.SQLConstants; import org.wso2.carbon.apimgt.impl.utils.APIMgtDBUtil;
import java.sql.*; import org.wso2.carbon.apimgt.api.*; import org.wso2.carbon.apimgt.api.model.*; import org.wso2.carbon.apimgt.impl.dao.constants.*; import org.wso2.carbon.apimgt.impl.utils.*;
[ "java.sql", "org.wso2.carbon" ]
java.sql; org.wso2.carbon;
1,410,356
public void updateTranscoding(Transcoding transcoding) { transcodingDao.updateTranscoding(transcoding); }
void function(Transcoding transcoding) { transcodingDao.updateTranscoding(transcoding); }
/** * Updates the given transcoding. * * @param transcoding The transcoding to update. */
Updates the given transcoding
updateTranscoding
{ "repo_name": "subrobotnik/subrobotnik", "path": "subsonic-main/src/main/java/net/sourceforge/subsonic/service/TranscodingService.java", "license": "gpl-3.0", "size": 21526 }
[ "net.sourceforge.subsonic.domain.Transcoding" ]
import net.sourceforge.subsonic.domain.Transcoding;
import net.sourceforge.subsonic.domain.*;
[ "net.sourceforge.subsonic" ]
net.sourceforge.subsonic;
2,483,755
protected TransitionableState getStartState(final Flow flow) { final TransitionableState currentStartState = TransitionableState.class.cast(flow.getStartState()); return currentStartState; }
TransitionableState function(final Flow flow) { final TransitionableState currentStartState = TransitionableState.class.cast(flow.getStartState()); return currentStartState; }
/** * Gets start state. * * @param flow the flow * @return the start state */
Gets start state
getStartState
{ "repo_name": "moghaddam/cas", "path": "cas-server-core-webflow/src/main/java/org/jasig/cas/web/flow/AbstractCasWebflowConfigurer.java", "license": "apache-2.0", "size": 21836 }
[ "org.springframework.webflow.engine.Flow", "org.springframework.webflow.engine.TransitionableState" ]
import org.springframework.webflow.engine.Flow; import org.springframework.webflow.engine.TransitionableState;
import org.springframework.webflow.engine.*;
[ "org.springframework.webflow" ]
org.springframework.webflow;
1,130,464
public Duration getControlKeepAliveTimeoutDuration() { return controlKeepAliveTimeout; } /** * Obtain the currently active listener. * * @return the listener, may be {@code null}
Duration function() { return controlKeepAliveTimeout; } /** * Obtain the currently active listener. * * @return the listener, may be {@code null}
/** * Gets the time to wait between sending control connection keepalive messages * when processing file upload or download. * <p> * See the class Javadoc section "Control channel keep-alive feature" * </p> * * @return the duration between keepalive messages. * @since 3.9.0 */
Gets the time to wait between sending control connection keepalive messages when processing file upload or download. See the class Javadoc section "Control channel keep-alive feature"
getControlKeepAliveTimeoutDuration
{ "repo_name": "apache/commons-net", "path": "src/main/java/org/apache/commons/net/ftp/FTPClient.java", "license": "apache-2.0", "size": 179016 }
[ "java.time.Duration" ]
import java.time.Duration;
import java.time.*;
[ "java.time" ]
java.time;
1,177,654
public static <K, T extends Diffable<T>> MapDiff<K, T, Map<K, T>> diff(Map<K, T> before, Map<K, T> after, KeySerializer<K> keySerializer) { assert after != null && before != null; return new JdkMapDiff<>(before, after, keySerializer, DiffableValueSerializer.getWriteOnlyInstance()); }
static <K, T extends Diffable<T>> MapDiff<K, T, Map<K, T>> function(Map<K, T> before, Map<K, T> after, KeySerializer<K> keySerializer) { assert after != null && before != null; return new JdkMapDiff<>(before, after, keySerializer, DiffableValueSerializer.getWriteOnlyInstance()); }
/** * Calculates diff between two Maps of Diffable objects. */
Calculates diff between two Maps of Diffable objects
diff
{ "repo_name": "robin13/elasticsearch", "path": "server/src/main/java/org/elasticsearch/cluster/DiffableUtils.java", "license": "apache-2.0", "size": 27712 }
[ "java.util.Map" ]
import java.util.Map;
import java.util.*;
[ "java.util" ]
java.util;
1,008,426
private void initialize() { this.setDefaultCloseOperation(javax.swing.JFrame.EXIT_ON_CLOSE); // Generated this.setSize(800, 900); this.setLocation(600, 10); this.setContentPane(getJContentPane()); this.setTitle("JFrame"); }
void function() { this.setDefaultCloseOperation(javax.swing.JFrame.EXIT_ON_CLOSE); this.setSize(800, 900); this.setLocation(600, 10); this.setContentPane(getJContentPane()); this.setTitle(STR); }
/** * This method initializes controls */
This method initializes controls
initialize
{ "repo_name": "sigram/pcl-parser", "path": "src/gui/GUIRasterizer.java", "license": "apache-2.0", "size": 19527 }
[ "javax.swing.JFrame" ]
import javax.swing.JFrame;
import javax.swing.*;
[ "javax.swing" ]
javax.swing;
2,693,167
public static AppendableIndexSpec parseIndexType(String indexType) throws JsonProcessingException { return JSON_MAPPER.readValue( StringUtils.format("{\"type\": \"%s\"}", indexType), AppendableIndexSpec.class ); }
static AppendableIndexSpec function(String indexType) throws JsonProcessingException { return JSON_MAPPER.readValue( StringUtils.format("{\"type\STR%s\"}", indexType), AppendableIndexSpec.class ); }
/** * Generate an AppendableIndexSpec from index type. * * @param indexType an index type * @return AppendableIndexSpec instance of this type * @throws JsonProcessingException if failed to to parse the index */
Generate an AppendableIndexSpec from index type
parseIndexType
{ "repo_name": "nishantmonu51/druid", "path": "processing/src/test/java/org/apache/druid/segment/incremental/IncrementalIndexCreator.java", "license": "apache-2.0", "size": 8409 }
[ "com.fasterxml.jackson.core.JsonProcessingException", "org.apache.druid.java.util.common.StringUtils" ]
import com.fasterxml.jackson.core.JsonProcessingException; import org.apache.druid.java.util.common.StringUtils;
import com.fasterxml.jackson.core.*; import org.apache.druid.java.util.common.*;
[ "com.fasterxml.jackson", "org.apache.druid" ]
com.fasterxml.jackson; org.apache.druid;
2,027,444
public List<Partition> listPartitionsByFilter(String db_name, String tbl_name, String filter, short max_parts) throws MetaException, NoSuchObjectException, TException { return deepCopyPartitions( client.get_partitions_by_filter(db_name, tbl_name, filter, max_parts)); }
List<Partition> function(String db_name, String tbl_name, String filter, short max_parts) throws MetaException, NoSuchObjectException, TException { return deepCopyPartitions( client.get_partitions_by_filter(db_name, tbl_name, filter, max_parts)); }
/** * Get list of partitions matching specified filter * @param db_name the database name * @param tbl_name the table name * @param filter the filter string, * for example "part1 = \"p1_abc\" and part2 <= "\p2_test\"". Filtering can * be done only on string partition keys. * @param max_parts the maximum number of partitions to return, * all partitions are returned if -1 is passed * @return list of partitions * @throws MetaException * @throws NoSuchObjectException * @throws TException */
Get list of partitions matching specified filter
listPartitionsByFilter
{ "repo_name": "mapr/impala", "path": "thirdparty/hive-0.12.0-cdh5.1.2/src/metastore/src/java/org/apache/hadoop/hive/metastore/HiveMetaStoreClient.java", "license": "apache-2.0", "size": 52327 }
[ "java.util.List", "org.apache.hadoop.hive.metastore.api.MetaException", "org.apache.hadoop.hive.metastore.api.NoSuchObjectException", "org.apache.hadoop.hive.metastore.api.Partition", "org.apache.thrift.TException" ]
import java.util.List; import org.apache.hadoop.hive.metastore.api.MetaException; import org.apache.hadoop.hive.metastore.api.NoSuchObjectException; import org.apache.hadoop.hive.metastore.api.Partition; import org.apache.thrift.TException;
import java.util.*; import org.apache.hadoop.hive.metastore.api.*; import org.apache.thrift.*;
[ "java.util", "org.apache.hadoop", "org.apache.thrift" ]
java.util; org.apache.hadoop; org.apache.thrift;
2,364,791
public Event getEvent(String eventID) { Session session = HibernateUtil.getFactory().openSession(); Event event = session.get(Event.class, eventID); return event; }
Event function(String eventID) { Session session = HibernateUtil.getFactory().openSession(); Event event = session.get(Event.class, eventID); return event; }
/** * Gets an Event-object from the database * @param eventID of the event * @return Event, if the event corresponding to eventID exists. Else null will be returned. */
Gets an Event-object from the database
getEvent
{ "repo_name": "JohannesCox/GOApp_Server", "path": "src/main/java/Database/DataHandler.java", "license": "mit", "size": 1390 }
[ "org.hibernate.Session" ]
import org.hibernate.Session;
import org.hibernate.*;
[ "org.hibernate" ]
org.hibernate;
1,703,511
void addSubscriber(String project, Subscriber subscriber) throws ValidationException;
void addSubscriber(String project, Subscriber subscriber) throws ValidationException;
/** * Add subscriber. * * @param subscriber the subscriber to add * @throws ValidationException subscriber data are not valid */
Add subscriber
addSubscriber
{ "repo_name": "clebi/subscriber", "path": "src/main/java/org/clebi/subscribers/daos/SubscriberDao.java", "license": "apache-2.0", "size": 1743 }
[ "org.clebi.subscribers.daos.exceptions.ValidationException", "org.clebi.subscribers.model.Subscriber" ]
import org.clebi.subscribers.daos.exceptions.ValidationException; import org.clebi.subscribers.model.Subscriber;
import org.clebi.subscribers.daos.exceptions.*; import org.clebi.subscribers.model.*;
[ "org.clebi.subscribers" ]
org.clebi.subscribers;
2,150,138
private boolean expand_to_room_doors(MazeListElement p_list_element) { // Complete the neigbour rooms to make shure, that the // doors of this room will not change later on. int layer_no = p_list_element.next_room.get_layer(); boolean layer_active = ctrl.layer_active[layer_no]; if (!layer_active) { if (autoroute_engine.board.layer_structure.arr[layer_no].is_signal) { return true; } } double half_width = ctrl.compensated_trace_half_width[layer_no]; boolean curr_door_is_small = false; if (p_list_element.door instanceof ExpansionDoor) { double half_width_add = half_width + AutorouteEngine.TRACE_WIDTH_TOLERANCE; ExpansionDoor curr_door = (ExpansionDoor) p_list_element.door; if (this.ctrl.with_neckdown) { // try evtl. neckdown at a destination pin double neck_down_half_width = check_neck_down_at_dest_pin(p_list_element.next_room); if (neck_down_half_width > 0) { half_width_add = Math.min(half_width_add, neck_down_half_width); half_width = half_width_add; } } curr_door_is_small = door_is_small(curr_door, 2 * half_width_add); } this.autoroute_engine.complete_neigbour_rooms(p_list_element.next_room); FloatPoint shape_entry_middle = p_list_element.shape_entry.a.middle_point(p_list_element.shape_entry.b); if (this.ctrl.with_neckdown && p_list_element.door instanceof TargetItemExpansionDoor) { // try evtl. neckdown at a start pin Item start_item = ((TargetItemExpansionDoor) p_list_element.door).item; if (start_item instanceof app.freerouting.board.Pin) { double neckdown_half_width = ((app.freerouting.board.Pin) start_item).get_trace_neckdown_halfwidth(layer_no); if (neckdown_half_width > 0) { half_width = Math.min(half_width, neckdown_half_width); } } } boolean next_room_is_thick = true; if (p_list_element.next_room instanceof ObstacleExpansionRoom) { next_room_is_thick = room_shape_is_thick((ObstacleExpansionRoom) p_list_element.next_room); } else { TileShape next_room_shape = p_list_element.next_room.get_shape(); if (next_room_shape.min_width() < 2 * half_width) { next_room_is_thick = false; // to prevent probles with the opposite side } else if (!p_list_element.already_checked && p_list_element.door.get_dimension() == 1 && !curr_door_is_small) { // The algorithm below works only, if p_location is on the border of p_room_shape. // That is only the case for 1 dimensional doors. // For small doors the check is done in check_leaving_via below. FloatPoint[] nearest_points = next_room_shape.nearest_border_points_approx(shape_entry_middle, 2); if (nearest_points.length < 2) { FRLogger.warn("MazeSearchAlgo.expand_to_room_doors: nearest_points.length == 2 expected"); next_room_is_thick = false; } else { double curr_dist = nearest_points[1].distance(shape_entry_middle); next_room_is_thick = (curr_dist > half_width + 1); } } } if (!layer_active && p_list_element.door instanceof ExpansionDrill) { // check for drill to a foreign conduction area on split plane. Point drill_location = ((ExpansionDrill) p_list_element.door).location; ItemSelectionFilter filter = new ItemSelectionFilter(ItemSelectionFilter.SelectableChoices.CONDUCTION); Set<Item> picked_items = autoroute_engine.board.pick_items(drill_location, layer_no, filter); for (Item curr_item : picked_items) { if (!curr_item.contains_net(ctrl.net_no)) { return true; } } } boolean something_expanded = false; if (expand_to_target_doors(p_list_element, next_room_is_thick, curr_door_is_small, shape_entry_middle)) { something_expanded = true; } if (!layer_active) { return true; } int ripup_costs = 0; if (p_list_element.next_room instanceof FreeSpaceExpansionRoom) { if (!p_list_element.already_checked) { if (curr_door_is_small) { boolean enter_through_small_door = false; if (next_room_is_thick) { // check to enter the thick room from a ripped item through a small door (after ripup) enter_through_small_door = check_leaving_ripped_item(p_list_element); } if (!enter_through_small_door) { return something_expanded; } } } } else if (p_list_element.next_room instanceof ObstacleExpansionRoom) { ObstacleExpansionRoom obstacle_room = (ObstacleExpansionRoom) p_list_element.next_room; if (!p_list_element.already_checked) { boolean room_rippable = false; if (this.ctrl.ripup_allowed) { ripup_costs = check_ripup(p_list_element, obstacle_room.get_item(), curr_door_is_small); room_rippable = (ripup_costs >= 0); } if (ripup_costs != ALREADY_RIPPED_COSTS && next_room_is_thick) { Item obstacle_item = obstacle_room.get_item(); if (!curr_door_is_small && this.ctrl.max_shove_trace_recursion_depth > 0 && obstacle_item instanceof app.freerouting.board.PolylineTrace) { if (!shove_trace_room(p_list_element, obstacle_room)) { if (ripup_costs > 0) { // delay the occupation by ripup to allow shoving the room by another door sections. MazeListElement new_element = new MazeListElement(p_list_element.door, p_list_element.section_no_of_door, p_list_element.backtrack_door, p_list_element.section_no_of_backtrack_door, p_list_element.expansion_value + ripup_costs, p_list_element.sorting_value + ripup_costs, p_list_element.next_room, p_list_element.shape_entry, true, p_list_element.adjustment, true); this.maze_expansion_list.add(new_element); } return something_expanded; } } } if (!room_rippable) { return true; } } } for (ExpansionDoor to_door : p_list_element.next_room.get_doors()) { if (to_door == p_list_element.door) { continue; } if (expand_to_door(to_door, p_list_element, ripup_costs, next_room_is_thick, MazeSearchElement.Adjustment.NONE)) { something_expanded = true; } } // Expand also the drill pages intersecting the room. if (ctrl.vias_allowed && !(p_list_element.door instanceof ExpansionDrill)) { if ((something_expanded || next_room_is_thick) && p_list_element.next_room instanceof CompleteFreeSpaceExpansionRoom) { // avoid setting something_expanded to true when next_room is thin to allow occupying by different sections of the door Collection<DrillPage> overlapping_drill_pages = this.autoroute_engine.drill_page_array.overlapping_pages(p_list_element.next_room.get_shape()); { for (DrillPage to_drill_page : overlapping_drill_pages) { expand_to_drill_page(to_drill_page, p_list_element); something_expanded = true; } } } else if (p_list_element.next_room instanceof ObstacleExpansionRoom) { Item curr_obstacle_item = ((ObstacleExpansionRoom) p_list_element.next_room).get_item(); if (curr_obstacle_item instanceof app.freerouting.board.Via) { app.freerouting.board.Via curr_via = (app.freerouting.board.Via) curr_obstacle_item; ExpansionDrill via_drill_info = curr_via.get_autoroute_drill_info(this.autoroute_engine.autoroute_search_tree); expand_to_drill(via_drill_info, p_list_element, ripup_costs); } } } return something_expanded; }
boolean function(MazeListElement p_list_element) { int layer_no = p_list_element.next_room.get_layer(); boolean layer_active = ctrl.layer_active[layer_no]; if (!layer_active) { if (autoroute_engine.board.layer_structure.arr[layer_no].is_signal) { return true; } } double half_width = ctrl.compensated_trace_half_width[layer_no]; boolean curr_door_is_small = false; if (p_list_element.door instanceof ExpansionDoor) { double half_width_add = half_width + AutorouteEngine.TRACE_WIDTH_TOLERANCE; ExpansionDoor curr_door = (ExpansionDoor) p_list_element.door; if (this.ctrl.with_neckdown) { double neck_down_half_width = check_neck_down_at_dest_pin(p_list_element.next_room); if (neck_down_half_width > 0) { half_width_add = Math.min(half_width_add, neck_down_half_width); half_width = half_width_add; } } curr_door_is_small = door_is_small(curr_door, 2 * half_width_add); } this.autoroute_engine.complete_neigbour_rooms(p_list_element.next_room); FloatPoint shape_entry_middle = p_list_element.shape_entry.a.middle_point(p_list_element.shape_entry.b); if (this.ctrl.with_neckdown && p_list_element.door instanceof TargetItemExpansionDoor) { Item start_item = ((TargetItemExpansionDoor) p_list_element.door).item; if (start_item instanceof app.freerouting.board.Pin) { double neckdown_half_width = ((app.freerouting.board.Pin) start_item).get_trace_neckdown_halfwidth(layer_no); if (neckdown_half_width > 0) { half_width = Math.min(half_width, neckdown_half_width); } } } boolean next_room_is_thick = true; if (p_list_element.next_room instanceof ObstacleExpansionRoom) { next_room_is_thick = room_shape_is_thick((ObstacleExpansionRoom) p_list_element.next_room); } else { TileShape next_room_shape = p_list_element.next_room.get_shape(); if (next_room_shape.min_width() < 2 * half_width) { next_room_is_thick = false; } else if (!p_list_element.already_checked && p_list_element.door.get_dimension() == 1 && !curr_door_is_small) { FloatPoint[] nearest_points = next_room_shape.nearest_border_points_approx(shape_entry_middle, 2); if (nearest_points.length < 2) { FRLogger.warn(STR); next_room_is_thick = false; } else { double curr_dist = nearest_points[1].distance(shape_entry_middle); next_room_is_thick = (curr_dist > half_width + 1); } } } if (!layer_active && p_list_element.door instanceof ExpansionDrill) { Point drill_location = ((ExpansionDrill) p_list_element.door).location; ItemSelectionFilter filter = new ItemSelectionFilter(ItemSelectionFilter.SelectableChoices.CONDUCTION); Set<Item> picked_items = autoroute_engine.board.pick_items(drill_location, layer_no, filter); for (Item curr_item : picked_items) { if (!curr_item.contains_net(ctrl.net_no)) { return true; } } } boolean something_expanded = false; if (expand_to_target_doors(p_list_element, next_room_is_thick, curr_door_is_small, shape_entry_middle)) { something_expanded = true; } if (!layer_active) { return true; } int ripup_costs = 0; if (p_list_element.next_room instanceof FreeSpaceExpansionRoom) { if (!p_list_element.already_checked) { if (curr_door_is_small) { boolean enter_through_small_door = false; if (next_room_is_thick) { enter_through_small_door = check_leaving_ripped_item(p_list_element); } if (!enter_through_small_door) { return something_expanded; } } } } else if (p_list_element.next_room instanceof ObstacleExpansionRoom) { ObstacleExpansionRoom obstacle_room = (ObstacleExpansionRoom) p_list_element.next_room; if (!p_list_element.already_checked) { boolean room_rippable = false; if (this.ctrl.ripup_allowed) { ripup_costs = check_ripup(p_list_element, obstacle_room.get_item(), curr_door_is_small); room_rippable = (ripup_costs >= 0); } if (ripup_costs != ALREADY_RIPPED_COSTS && next_room_is_thick) { Item obstacle_item = obstacle_room.get_item(); if (!curr_door_is_small && this.ctrl.max_shove_trace_recursion_depth > 0 && obstacle_item instanceof app.freerouting.board.PolylineTrace) { if (!shove_trace_room(p_list_element, obstacle_room)) { if (ripup_costs > 0) { MazeListElement new_element = new MazeListElement(p_list_element.door, p_list_element.section_no_of_door, p_list_element.backtrack_door, p_list_element.section_no_of_backtrack_door, p_list_element.expansion_value + ripup_costs, p_list_element.sorting_value + ripup_costs, p_list_element.next_room, p_list_element.shape_entry, true, p_list_element.adjustment, true); this.maze_expansion_list.add(new_element); } return something_expanded; } } } if (!room_rippable) { return true; } } } for (ExpansionDoor to_door : p_list_element.next_room.get_doors()) { if (to_door == p_list_element.door) { continue; } if (expand_to_door(to_door, p_list_element, ripup_costs, next_room_is_thick, MazeSearchElement.Adjustment.NONE)) { something_expanded = true; } } if (ctrl.vias_allowed && !(p_list_element.door instanceof ExpansionDrill)) { if ((something_expanded next_room_is_thick) && p_list_element.next_room instanceof CompleteFreeSpaceExpansionRoom) { Collection<DrillPage> overlapping_drill_pages = this.autoroute_engine.drill_page_array.overlapping_pages(p_list_element.next_room.get_shape()); { for (DrillPage to_drill_page : overlapping_drill_pages) { expand_to_drill_page(to_drill_page, p_list_element); something_expanded = true; } } } else if (p_list_element.next_room instanceof ObstacleExpansionRoom) { Item curr_obstacle_item = ((ObstacleExpansionRoom) p_list_element.next_room).get_item(); if (curr_obstacle_item instanceof app.freerouting.board.Via) { app.freerouting.board.Via curr_via = (app.freerouting.board.Via) curr_obstacle_item; ExpansionDrill via_drill_info = curr_via.get_autoroute_drill_info(this.autoroute_engine.autoroute_search_tree); expand_to_drill(via_drill_info, p_list_element, ripup_costs); } } } return something_expanded; }
/** * Expands the other door section of the room. * Returns true, if the from door section has to be occupied, * and false, if the occupation for is delayed. */
Expands the other door section of the room. Returns true, if the from door section has to be occupied, and false, if the occupation for is delayed
expand_to_room_doors
{ "repo_name": "freerouting/freerouting", "path": "src/main/java/app/freerouting/autoroute/MazeSearchAlgo.java", "license": "gpl-3.0", "size": 64619 }
[ "app.freerouting.board.Item", "app.freerouting.board.ItemSelectionFilter", "app.freerouting.board.PolylineTrace", "app.freerouting.geometry.planar.FloatPoint", "app.freerouting.geometry.planar.Point", "app.freerouting.geometry.planar.TileShape", "app.freerouting.logger.FRLogger", "java.util.Collection", "java.util.Set" ]
import app.freerouting.board.Item; import app.freerouting.board.ItemSelectionFilter; import app.freerouting.board.PolylineTrace; import app.freerouting.geometry.planar.FloatPoint; import app.freerouting.geometry.planar.Point; import app.freerouting.geometry.planar.TileShape; import app.freerouting.logger.FRLogger; import java.util.Collection; import java.util.Set;
import app.freerouting.board.*; import app.freerouting.geometry.planar.*; import app.freerouting.logger.*; import java.util.*;
[ "app.freerouting.board", "app.freerouting.geometry", "app.freerouting.logger", "java.util" ]
app.freerouting.board; app.freerouting.geometry; app.freerouting.logger; java.util;
1,095,910
public Level getLevelByName(Level level, String name) { return BoInfo.getLevelByName(level, name); }
Level function(Level level, String name) { return BoInfo.getLevelByName(level, name); }
/** * It tries to get a 'direct' sublevel of the desired level by name. * * @param level The parent level. * @param name * Name of the desired sublevel. * @return Sublevel with the desired name. * @see BoInfo#getLevelByName(Level, String) */
It tries to get a 'direct' sublevel of the desired level by name
getLevelByName
{ "repo_name": "th-schwarz/bacoma", "path": "bacoma-rest/src/main/java/codes/thischwa/bacoma/rest/render/context/object/SiteObjectTool.java", "license": "mit", "size": 7020 }
[ "codes.thischwa.bacoma.model.BoInfo", "codes.thischwa.bacoma.model.pojo.site.Level" ]
import codes.thischwa.bacoma.model.BoInfo; import codes.thischwa.bacoma.model.pojo.site.Level;
import codes.thischwa.bacoma.model.*; import codes.thischwa.bacoma.model.pojo.site.*;
[ "codes.thischwa.bacoma" ]
codes.thischwa.bacoma;
2,626,836
protected void dispatchDraw(Canvas canvas) { if (mHoverCell != null) { mHoverCell.draw(canvas); } }
void function(Canvas canvas) { if (mHoverCell != null) { mHoverCell.draw(canvas); } }
/** * dispatchDraw gets invoked when all the child views are about to be drawn. * By overriding this method, the hover cell (BitmapDrawable) can be drawn * over the listview's items whenever the listview is redrawn. */
dispatchDraw gets invoked when all the child views are about to be drawn. By overriding this method, the hover cell (BitmapDrawable) can be drawn over the listview's items whenever the listview is redrawn
dispatchDraw
{ "repo_name": "appnativa/rare", "path": "source/rare/android/com/appnativa/rare/platform/android/ui/view/ListViewEx.java", "license": "gpl-3.0", "size": 85627 }
[ "android.graphics.Canvas" ]
import android.graphics.Canvas;
import android.graphics.*;
[ "android.graphics" ]
android.graphics;
2,278,048
@Test public void detectBroadphase() { List<BroadphasePair<CollidableTest>> pairs; // create some collidables CollidableTest ct1 = new CollidableTest(rect); CollidableTest ct2 = new CollidableTest(seg); this.sapI.add(ct1); this.sapI.add(ct2); this.sapBF.add(ct1); this.sapBF.add(ct2); this.sapT.add(ct1); this.sapT.add(ct2); this.dynT.add(ct1); this.dynT.add(ct2); // test containment pairs = this.sapI.detect(); TestCase.assertEquals(1, pairs.size()); pairs = this.sapBF.detect(); TestCase.assertEquals(1, pairs.size()); pairs = this.sapT.detect(); TestCase.assertEquals(1, pairs.size()); pairs = this.dynT.detect(); TestCase.assertEquals(1, pairs.size()); // test overlap ct1.translate(-0.5, 0.0); this.sapI.update(ct1); this.sapBF.update(ct1); this.sapT.update(ct1); this.dynT.update(ct1); pairs = this.sapI.detect(); TestCase.assertEquals(1, pairs.size()); pairs = this.sapBF.detect(); TestCase.assertEquals(1, pairs.size()); pairs = this.sapT.detect(); TestCase.assertEquals(1, pairs.size()); pairs = this.dynT.detect(); TestCase.assertEquals(1, pairs.size()); // test only AABB overlap ct2.translate(-0.3, -0.7); this.sapI.update(ct2); this.sapBF.update(ct2); this.sapT.update(ct2); this.dynT.update(ct2); pairs = this.sapI.detect(); TestCase.assertEquals(1, pairs.size()); pairs = this.sapBF.detect(); TestCase.assertEquals(1, pairs.size()); pairs = this.sapT.detect(); TestCase.assertEquals(1, pairs.size()); pairs = this.dynT.detect(); TestCase.assertEquals(1, pairs.size()); // test no overlap ct1.translate(0.0, 0.5); this.sapI.update(ct1); this.sapBF.update(ct1); this.sapT.update(ct1); this.dynT.update(ct1); pairs = this.sapI.detect(); TestCase.assertEquals(0, pairs.size()); pairs = this.sapBF.detect(); TestCase.assertEquals(0, pairs.size()); pairs = this.sapT.detect(); TestCase.assertEquals(0, pairs.size()); pairs = this.dynT.detect(); TestCase.assertEquals(0, pairs.size()); }
void function() { List<BroadphasePair<CollidableTest>> pairs; CollidableTest ct1 = new CollidableTest(rect); CollidableTest ct2 = new CollidableTest(seg); this.sapI.add(ct1); this.sapI.add(ct2); this.sapBF.add(ct1); this.sapBF.add(ct2); this.sapT.add(ct1); this.sapT.add(ct2); this.dynT.add(ct1); this.dynT.add(ct2); pairs = this.sapI.detect(); TestCase.assertEquals(1, pairs.size()); pairs = this.sapBF.detect(); TestCase.assertEquals(1, pairs.size()); pairs = this.sapT.detect(); TestCase.assertEquals(1, pairs.size()); pairs = this.dynT.detect(); TestCase.assertEquals(1, pairs.size()); ct1.translate(-0.5, 0.0); this.sapI.update(ct1); this.sapBF.update(ct1); this.sapT.update(ct1); this.dynT.update(ct1); pairs = this.sapI.detect(); TestCase.assertEquals(1, pairs.size()); pairs = this.sapBF.detect(); TestCase.assertEquals(1, pairs.size()); pairs = this.sapT.detect(); TestCase.assertEquals(1, pairs.size()); pairs = this.dynT.detect(); TestCase.assertEquals(1, pairs.size()); ct2.translate(-0.3, -0.7); this.sapI.update(ct2); this.sapBF.update(ct2); this.sapT.update(ct2); this.dynT.update(ct2); pairs = this.sapI.detect(); TestCase.assertEquals(1, pairs.size()); pairs = this.sapBF.detect(); TestCase.assertEquals(1, pairs.size()); pairs = this.sapT.detect(); TestCase.assertEquals(1, pairs.size()); pairs = this.dynT.detect(); TestCase.assertEquals(1, pairs.size()); ct1.translate(0.0, 0.5); this.sapI.update(ct1); this.sapBF.update(ct1); this.sapT.update(ct1); this.dynT.update(ct1); pairs = this.sapI.detect(); TestCase.assertEquals(0, pairs.size()); pairs = this.sapBF.detect(); TestCase.assertEquals(0, pairs.size()); pairs = this.sapT.detect(); TestCase.assertEquals(0, pairs.size()); pairs = this.dynT.detect(); TestCase.assertEquals(0, pairs.size()); }
/** * Tests the broadphase detectors. */
Tests the broadphase detectors
detectBroadphase
{ "repo_name": "jipalgol/dyn4j", "path": "junit/org/dyn4j/collision/RectangleSegmentTest.java", "license": "bsd-3-clause", "size": 17393 }
[ "java.util.List", "junit.framework.TestCase", "org.dyn4j.collision.broadphase.BroadphasePair" ]
import java.util.List; import junit.framework.TestCase; import org.dyn4j.collision.broadphase.BroadphasePair;
import java.util.*; import junit.framework.*; import org.dyn4j.collision.broadphase.*;
[ "java.util", "junit.framework", "org.dyn4j.collision" ]
java.util; junit.framework; org.dyn4j.collision;
2,406,070
public CSSEngine createCSSEngine(AbstractStylableDocument doc, CSSContext ctx) { String pn = XMLResourceDescriptor.getCSSParserClassName(); Parser p; try { p = (Parser)Class.forName(pn).newInstance(); } catch (ClassNotFoundException e) { throw new DOMException(DOMException.INVALID_ACCESS_ERR, formatMessage("css.parser.class", new Object[] { pn })); } catch (InstantiationException e) { throw new DOMException(DOMException.INVALID_ACCESS_ERR, formatMessage("css.parser.creation", new Object[] { pn })); } catch (IllegalAccessException e) { throw new DOMException(DOMException.INVALID_ACCESS_ERR, formatMessage("css.parser.access", new Object[] { pn })); } ExtendedParser ep = ExtendedParserWrapper.wrap(p); ValueManager[] vms; if (customValueManagers == null) { vms = new ValueManager[0]; } else { vms = new ValueManager[customValueManagers.size()]; Iterator it = customValueManagers.iterator(); int i = 0; while (it.hasNext()) { vms[i++] = (ValueManager)it.next(); } } ShorthandManager[] sms; if (customShorthandManagers == null) { sms = new ShorthandManager[0]; } else { sms = new ShorthandManager[customShorthandManagers.size()]; Iterator it = customShorthandManagers.iterator(); int i = 0; while (it.hasNext()) { sms[i++] = (ShorthandManager)it.next(); } } CSSEngine result = createCSSEngine(doc, ctx, ep, vms, sms); doc.setCSSEngine(result); return result; }
CSSEngine function(AbstractStylableDocument doc, CSSContext ctx) { String pn = XMLResourceDescriptor.getCSSParserClassName(); Parser p; try { p = (Parser)Class.forName(pn).newInstance(); } catch (ClassNotFoundException e) { throw new DOMException(DOMException.INVALID_ACCESS_ERR, formatMessage(STR, new Object[] { pn })); } catch (InstantiationException e) { throw new DOMException(DOMException.INVALID_ACCESS_ERR, formatMessage(STR, new Object[] { pn })); } catch (IllegalAccessException e) { throw new DOMException(DOMException.INVALID_ACCESS_ERR, formatMessage(STR, new Object[] { pn })); } ExtendedParser ep = ExtendedParserWrapper.wrap(p); ValueManager[] vms; if (customValueManagers == null) { vms = new ValueManager[0]; } else { vms = new ValueManager[customValueManagers.size()]; Iterator it = customValueManagers.iterator(); int i = 0; while (it.hasNext()) { vms[i++] = (ValueManager)it.next(); } } ShorthandManager[] sms; if (customShorthandManagers == null) { sms = new ShorthandManager[0]; } else { sms = new ShorthandManager[customShorthandManagers.size()]; Iterator it = customShorthandManagers.iterator(); int i = 0; while (it.hasNext()) { sms[i++] = (ShorthandManager)it.next(); } } CSSEngine result = createCSSEngine(doc, ctx, ep, vms, sms); doc.setCSSEngine(result); return result; }
/** * Creates new CSSEngine and attach it to the document. */
Creates new CSSEngine and attach it to the document
createCSSEngine
{ "repo_name": "Squeegee/batik", "path": "sources/org/apache/batik/dom/ExtensibleDOMImplementation.java", "license": "apache-2.0", "size": 9943 }
[ "java.util.Iterator", "org.apache.batik.css.engine.CSSContext", "org.apache.batik.css.engine.CSSEngine", "org.apache.batik.css.engine.value.ShorthandManager", "org.apache.batik.css.engine.value.ValueManager", "org.apache.batik.css.parser.ExtendedParser", "org.apache.batik.css.parser.ExtendedParserWrapper", "org.apache.batik.util.XMLResourceDescriptor", "org.w3c.css.sac.Parser", "org.w3c.dom.DOMException" ]
import java.util.Iterator; import org.apache.batik.css.engine.CSSContext; import org.apache.batik.css.engine.CSSEngine; import org.apache.batik.css.engine.value.ShorthandManager; import org.apache.batik.css.engine.value.ValueManager; import org.apache.batik.css.parser.ExtendedParser; import org.apache.batik.css.parser.ExtendedParserWrapper; import org.apache.batik.util.XMLResourceDescriptor; import org.w3c.css.sac.Parser; import org.w3c.dom.DOMException;
import java.util.*; import org.apache.batik.css.engine.*; import org.apache.batik.css.engine.value.*; import org.apache.batik.css.parser.*; import org.apache.batik.util.*; import org.w3c.css.sac.*; import org.w3c.dom.*;
[ "java.util", "org.apache.batik", "org.w3c.css", "org.w3c.dom" ]
java.util; org.apache.batik; org.w3c.css; org.w3c.dom;
771,633
private List<org.geomajas.layer.tile.RasterTile> calculateTilesForBounds(Bbox bounds) { List<org.geomajas.layer.tile.RasterTile> tiles = new ArrayList<org.geomajas.layer.tile.RasterTile>(); if (bounds.getHeight() == 0 || bounds.getWidth() == 0) { return tiles; } return tiles; }
List<org.geomajas.layer.tile.RasterTile> function(Bbox bounds) { List<org.geomajas.layer.tile.RasterTile> tiles = new ArrayList<org.geomajas.layer.tile.RasterTile>(); if (bounds.getHeight() == 0 bounds.getWidth() == 0) { return tiles; } return tiles; }
/** * Method based on WmsTileServiceImpl in GWT2 client. * */
Method based on WmsTileServiceImpl in GWT2 client
calculateTilesForBounds
{ "repo_name": "geomajas/geomajas-project-client-gwt", "path": "client/src/main/java/org/geomajas/gwt/client/map/store/ClientWmsRasterLayerStore.java", "license": "agpl-3.0", "size": 5987 }
[ "java.util.ArrayList", "java.util.List", "org.geomajas.gwt.client.map.cache.tile.RasterTile", "org.geomajas.gwt.client.spatial.Bbox" ]
import java.util.ArrayList; import java.util.List; import org.geomajas.gwt.client.map.cache.tile.RasterTile; import org.geomajas.gwt.client.spatial.Bbox;
import java.util.*; import org.geomajas.gwt.client.map.cache.tile.*; import org.geomajas.gwt.client.spatial.*;
[ "java.util", "org.geomajas.gwt" ]
java.util; org.geomajas.gwt;
1,451,766
public SourceColumn[] guessCsvSchema(CSVReader cr) throws IOException { return guessCsvSchema(cr, -1); }
SourceColumn[] function(CSVReader cr) throws IOException { return guessCsvSchema(cr, -1); }
/** * Guesses the CSV schema * * @param cr CSV reader * @return the String[] with the CSV column types * @throws IOException in case of IO issue */
Guesses the CSV schema
guessCsvSchema
{ "repo_name": "gooddata/GoodData-CL", "path": "connector/src/main/java/com/gooddata/csv/DataTypeGuess.java", "license": "bsd-3-clause", "size": 9024 }
[ "com.gooddata.modeling.model.SourceColumn", "com.gooddata.util.CSVReader", "java.io.IOException" ]
import com.gooddata.modeling.model.SourceColumn; import com.gooddata.util.CSVReader; import java.io.IOException;
import com.gooddata.modeling.model.*; import com.gooddata.util.*; import java.io.*;
[ "com.gooddata.modeling", "com.gooddata.util", "java.io" ]
com.gooddata.modeling; com.gooddata.util; java.io;
2,206,258
void scan(Class<?> aListenerClass, Class<?> eventType) { Method[] methods = aListenerClass.getDeclaredMethods(); if ( methods.length > 0 ) { for ( Method method : methods) { EventMethod eventMethod = ClassUtil.getAnnotation(EventMethod.class, aListenerClass, method); if ( eventMethod != null ) { Class<?>[] paramTypes = method.getParameterTypes(); if ( paramTypes.length == 1 && paramTypes[0].equals(eventType) ) { //ClassUtil.inheritsFrom(paramTypes[0], eventType) ) { method.setAccessible(true); this.invokables.put(eventType, method); break; } } } } }
void scan(Class<?> aListenerClass, Class<?> eventType) { Method[] methods = aListenerClass.getDeclaredMethods(); if ( methods.length > 0 ) { for ( Method method : methods) { EventMethod eventMethod = ClassUtil.getAnnotation(EventMethod.class, aListenerClass, method); if ( eventMethod != null ) { Class<?>[] paramTypes = method.getParameterTypes(); if ( paramTypes.length == 1 && paramTypes[0].equals(eventType) ) { method.setAccessible(true); this.invokables.put(eventType, method); break; } } } } }
/** * Scan the listener class for EventMethods. * * @param aListenerClass */
Scan the listener class for EventMethods
scan
{ "repo_name": "tonysparks/leola-web", "path": "src/main/java/leola/web/event/EventDispatcher.java", "license": "mit", "size": 7804 }
[ "java.lang.reflect.Method" ]
import java.lang.reflect.Method;
import java.lang.reflect.*;
[ "java.lang" ]
java.lang;
1,001,821
public static String getOAuth2IntrospectionEPUrl() { return buildUrl(OAUTH2_INTROSPECT_EP_URL, OAuthServerConfiguration.getInstance()::getOauth2IntrospectionEPUrl); }
static String function() { return buildUrl(OAUTH2_INTROSPECT_EP_URL, OAuthServerConfiguration.getInstance()::getOauth2IntrospectionEPUrl); }
/** * Get oauth2 introspection endpoint URL. * * @return Introspection Endpoint URL. */
Get oauth2 introspection endpoint URL
getOAuth2IntrospectionEPUrl
{ "repo_name": "darshanasbg/identity-inbound-auth-oauth", "path": "components/org.wso2.carbon.identity.oauth/src/main/java/org/wso2/carbon/identity/oauth2/util/OAuth2Util.java", "license": "apache-2.0", "size": 193919 }
[ "org.wso2.carbon.identity.oauth.config.OAuthServerConfiguration" ]
import org.wso2.carbon.identity.oauth.config.OAuthServerConfiguration;
import org.wso2.carbon.identity.oauth.config.*;
[ "org.wso2.carbon" ]
org.wso2.carbon;
2,717,982
void addSemanticProperty(SemanticPropertyInterface semanticProperty);
void addSemanticProperty(SemanticPropertyInterface semanticProperty);
/** * This method adds a SemanticProperty to the AbstractMetadata. * @param semanticPropertyInterface A SemanticProperty to be added. */
This method adds a SemanticProperty to the AbstractMetadata
addSemanticProperty
{ "repo_name": "NCIP/cab2b", "path": "software/dependencies/dynamicextensions/caB2B_2009_JUN_02/src/edu/common/dynamicextensions/domain/SemanticAnnotatableInterface.java", "license": "bsd-3-clause", "size": 1635 }
[ "edu.common.dynamicextensions.domaininterface.SemanticPropertyInterface" ]
import edu.common.dynamicextensions.domaininterface.SemanticPropertyInterface;
import edu.common.dynamicextensions.domaininterface.*;
[ "edu.common.dynamicextensions" ]
edu.common.dynamicextensions;
2,338,921
static boolean tryMergeBlock(Node block) { Preconditions.checkState(block.getType() == Token.BLOCK); Node parent = block.getParent(); // Try to remove the block if its parent is a block/script or if its // parent is label and it has exactly one child. if (isStatementBlock(parent)) { Node previous = block; while (block.hasChildren()) { Node child = block.removeFirstChild(); parent.addChildAfter(child, previous); previous = child; } parent.removeChild(block); return true; } else { return false; } }
static boolean tryMergeBlock(Node block) { Preconditions.checkState(block.getType() == Token.BLOCK); Node parent = block.getParent(); if (isStatementBlock(parent)) { Node previous = block; while (block.hasChildren()) { Node child = block.removeFirstChild(); parent.addChildAfter(child, previous); previous = child; } parent.removeChild(block); return true; } else { return false; } }
/** * Merge a block with its parent block. * @return Whether the block was removed. */
Merge a block with its parent block
tryMergeBlock
{ "repo_name": "johan/closure-compiler", "path": "src/com/google/javascript/jscomp/NodeUtil.java", "license": "apache-2.0", "size": 59336 }
[ "com.google.common.base.Preconditions", "com.google.javascript.rhino.Node", "com.google.javascript.rhino.Token" ]
import com.google.common.base.Preconditions; import com.google.javascript.rhino.Node; import com.google.javascript.rhino.Token;
import com.google.common.base.*; import com.google.javascript.rhino.*;
[ "com.google.common", "com.google.javascript" ]
com.google.common; com.google.javascript;
1,353,643
final void updateTransformData(){ int i, k=0, numTotal=0; double width = 0, height = 0; Vector3f location = new Vector3f(this.position); Rectangle2D bounds; //Reset bounds data lower.set(location); upper.set(location); charTransforms = new Transform3D[numChars]; for (i=0; i<numChars; i++) { charTransforms[i] = new Transform3D(); } if (numChars != 0) { charTransforms[0].set(location); // Set loop counters based on path type if (path == Text3D.PATH_RIGHT || path == Text3D.PATH_UP) { k = 0; numTotal = numChars + 1; } else if (path == Text3D.PATH_LEFT || path == Text3D.PATH_DOWN) { k = 1; numTotal = numChars; // Reset bounds to bounding box if first character bounds = glyphVecs[0].getVisualBounds(); upper.x += bounds.getWidth(); upper.y += bounds.getHeight(); } for (i=1; i<numTotal; i++, k++) { width = glyphVecs[k].getLogicalBounds().getWidth(); bounds = glyphVecs[k].getVisualBounds(); // 'switch' could be outside loop with little hacking, width += charSpacing; height = bounds.getHeight(); switch (this.path) { case Text3D.PATH_RIGHT: location.x += width; upper.x += (width); if (upper.y < (height + location.y)) { upper.y = location.y + height; } break; case Text3D.PATH_LEFT: location.x -= width; lower.x -= (width); if (upper.y < ( height + location.y)) { upper.y = location.y + height; } break; case Text3D.PATH_UP: location.y += height; upper.y += height; if (upper.x < (bounds.getWidth() + location.x)) { upper.x = location.x + bounds.getWidth(); } break; case Text3D.PATH_DOWN: location.y -= height; lower.y -= height; if (upper.x < (bounds.getWidth() + location.x)) { upper.x = location.x + bounds.getWidth(); } break; } if (i < numChars) { charTransforms[i].set(location); } } // Handle string alignment. ALIGN_FIRST is handled by default if (alignment != Text3D.ALIGN_FIRST) { double cx = (upper.x - lower.x); double cy = (upper.y - lower.y); if (alignment == Text3D.ALIGN_CENTER) { cx *= .5; cy *= .5; } switch (path) { case Text3D.PATH_RIGHT: for (i=0;i < numChars;i++) { charTransforms[i].mat[3] -= cx; } lower.x -= cx; upper.x -= cx; break; case Text3D.PATH_LEFT: for (i=0;i < numChars;i++) { charTransforms[i].mat[3] += cx; } lower.x += cx; upper.x += cx; break; case Text3D.PATH_UP: for (i=0;i < numChars;i++) { charTransforms[i].mat[7] -=cy; } lower.y -= cy; upper.y -= cy; break; case Text3D.PATH_DOWN: for (i=0;i < numChars;i++) { charTransforms[i].mat[7] +=cy; } lower.y += cy; upper.y += cy; break; } } } lower.z = 0.0f; if ((font3D == null) || (font3D.fontExtrusion == null)) { upper.z = lower.z; } else { upper.z = lower.z + font3D.fontExtrusion.length; } // update geoBounds getBoundingBox(geoBounds); }
final void updateTransformData(){ int i, k=0, numTotal=0; double width = 0, height = 0; Vector3f location = new Vector3f(this.position); Rectangle2D bounds; lower.set(location); upper.set(location); charTransforms = new Transform3D[numChars]; for (i=0; i<numChars; i++) { charTransforms[i] = new Transform3D(); } if (numChars != 0) { charTransforms[0].set(location); if (path == Text3D.PATH_RIGHT path == Text3D.PATH_UP) { k = 0; numTotal = numChars + 1; } else if (path == Text3D.PATH_LEFT path == Text3D.PATH_DOWN) { k = 1; numTotal = numChars; bounds = glyphVecs[0].getVisualBounds(); upper.x += bounds.getWidth(); upper.y += bounds.getHeight(); } for (i=1; i<numTotal; i++, k++) { width = glyphVecs[k].getLogicalBounds().getWidth(); bounds = glyphVecs[k].getVisualBounds(); width += charSpacing; height = bounds.getHeight(); switch (this.path) { case Text3D.PATH_RIGHT: location.x += width; upper.x += (width); if (upper.y < (height + location.y)) { upper.y = location.y + height; } break; case Text3D.PATH_LEFT: location.x -= width; lower.x -= (width); if (upper.y < ( height + location.y)) { upper.y = location.y + height; } break; case Text3D.PATH_UP: location.y += height; upper.y += height; if (upper.x < (bounds.getWidth() + location.x)) { upper.x = location.x + bounds.getWidth(); } break; case Text3D.PATH_DOWN: location.y -= height; lower.y -= height; if (upper.x < (bounds.getWidth() + location.x)) { upper.x = location.x + bounds.getWidth(); } break; } if (i < numChars) { charTransforms[i].set(location); } } if (alignment != Text3D.ALIGN_FIRST) { double cx = (upper.x - lower.x); double cy = (upper.y - lower.y); if (alignment == Text3D.ALIGN_CENTER) { cx *= .5; cy *= .5; } switch (path) { case Text3D.PATH_RIGHT: for (i=0;i < numChars;i++) { charTransforms[i].mat[3] -= cx; } lower.x -= cx; upper.x -= cx; break; case Text3D.PATH_LEFT: for (i=0;i < numChars;i++) { charTransforms[i].mat[3] += cx; } lower.x += cx; upper.x += cx; break; case Text3D.PATH_UP: for (i=0;i < numChars;i++) { charTransforms[i].mat[7] -=cy; } lower.y -= cy; upper.y -= cy; break; case Text3D.PATH_DOWN: for (i=0;i < numChars;i++) { charTransforms[i].mat[7] +=cy; } lower.y += cy; upper.y += cy; break; } } } lower.z = 0.0f; if ((font3D == null) (font3D.fontExtrusion == null)) { upper.z = lower.z; } else { upper.z = lower.z + font3D.fontExtrusion.length; } getBoundingBox(geoBounds); }
/** * Update per character transform based on Text3D location, * per character size and path. * * WARNING: Caller of this method must make sure SceneGraph is live, * else exceptions may be thrown. */
Update per character transform based on Text3D location, per character size and path. else exceptions may be thrown
updateTransformData
{ "repo_name": "gouessej/java3d-core", "path": "src/main/java/org/jogamp/java3d/Text3DRetained.java", "license": "gpl-2.0", "size": 28981 }
[ "java.awt.geom.Rectangle2D", "org.jogamp.vecmath.Vector3f" ]
import java.awt.geom.Rectangle2D; import org.jogamp.vecmath.Vector3f;
import java.awt.geom.*; import org.jogamp.vecmath.*;
[ "java.awt", "org.jogamp.vecmath" ]
java.awt; org.jogamp.vecmath;
1,159,683
@Override public MessageToUser sendStringMessage(MessageToUser message, String messageBody) throws SynapseException { message.setFileHandleId(uploadStringToS3(messageBody)); return sendMessage(message); }
MessageToUser function(MessageToUser message, String messageBody) throws SynapseException { message.setFileHandleId(uploadStringToS3(messageBody)); return sendMessage(message); }
/** * Convenience function to upload a simple string message body, then send * message using resultant fileHandleId * * @param message * @param messageBody * @return the created message * @throws SynapseException */
Convenience function to upload a simple string message body, then send message using resultant fileHandleId
sendStringMessage
{ "repo_name": "hhu94/Synapse-Repository-Services", "path": "client/synapseJavaClient/src/main/java/org/sagebionetworks/client/SynapseClientImpl.java", "license": "apache-2.0", "size": 187988 }
[ "org.sagebionetworks.client.exceptions.SynapseException", "org.sagebionetworks.repo.model.message.MessageToUser" ]
import org.sagebionetworks.client.exceptions.SynapseException; import org.sagebionetworks.repo.model.message.MessageToUser;
import org.sagebionetworks.client.exceptions.*; import org.sagebionetworks.repo.model.message.*;
[ "org.sagebionetworks.client", "org.sagebionetworks.repo" ]
org.sagebionetworks.client; org.sagebionetworks.repo;
2,608,164
protected Map<String, String> queryToMap(final String query) { Map<String, String> result = new HashMap<>(); if (query != null) { for (String param : query.split("&")) { String pair[] = param.split("="); if (pair.length > 1) { result.put(pair[0], pair[1]); } else { result.put(pair[0], ""); } } } return result; }
Map<String, String> function(final String query) { Map<String, String> result = new HashMap<>(); if (query != null) { for (String param : query.split("&")) { String pair[] = param.split("="); if (pair.length > 1) { result.put(pair[0], pair[1]); } else { result.put(pair[0], ""); } } } return result; }
/** * returns the url parameters in a map * * @param query * @return map */
returns the url parameters in a map
queryToMap
{ "repo_name": "RasPelikan/IrrigationManagement", "path": "src/main/java/com/pelikanit/im/admin/CGIHttpHandler.java", "license": "apache-2.0", "size": 1837 }
[ "java.util.HashMap", "java.util.Map" ]
import java.util.HashMap; import java.util.Map;
import java.util.*;
[ "java.util" ]
java.util;
820,528
private float getHeadroomWeighting(SubClusterId targetId, AllocationBookkeeper allocationBookkeeper) { // baseline weight for all RMs float headroomWeighting = 1 / (float) allocationBookkeeper.getActiveAndEnabledSC().size(); // if we have headroom infomration for this sub-cluster (and we are safe // from /0 issues) if (headroom.containsKey(targetId) && allocationBookkeeper.totHeadroomMemory > 0) { // compute which portion of the RMs that are active/enabled have reported // their headroom (needed as adjustment factor) // (note: getActiveAndEnabledSC should never be null/zero) float ratioHeadroomKnown = allocationBookkeeper.totHeadRoomEnabledRMs / (float) allocationBookkeeper.getActiveAndEnabledSC().size(); // headroomWeighting is the ratio of headroom memory in the targetId // cluster / total memory. The ratioHeadroomKnown factor is applied to // adjust for missing information and ensure sum of allocated containers // closely approximate what the user asked (small excess). headroomWeighting = (headroom.get(targetId).getMemorySize() / allocationBookkeeper.totHeadroomMemory) * (ratioHeadroomKnown); } return headroomWeighting; } protected final class AllocationBookkeeper { // the answer being accumulated private Map<SubClusterId, List<ResourceRequest>> answer = new TreeMap<>(); private Map<SubClusterId, Set<Long>> maskForRackDeletion = new HashMap<>(); // stores how many containers we have allocated in each RM for localized // asks, used to correctly "spread" the corresponding ANY private Map<Long, Map<SubClusterId, AtomicLong>> countContainersPerRM = new HashMap<>(); private Map<Long, AtomicLong> totNumLocalizedContainers = new HashMap<>(); // Store the randomly selected subClusterId for unresolved resource requests // keyed by requestId private Map<Long, SubClusterId> unResolvedRequestLocation = new HashMap<>(); private Set<SubClusterId> activeAndEnabledSC = new HashSet<>(); private float totHeadroomMemory = 0; private int totHeadRoomEnabledRMs = 0; private Map<SubClusterId, Float> policyWeights; private float totPolicyWeight = 0;
float function(SubClusterId targetId, AllocationBookkeeper allocationBookkeeper) { float headroomWeighting = 1 / (float) allocationBookkeeper.getActiveAndEnabledSC().size(); if (headroom.containsKey(targetId) && allocationBookkeeper.totHeadroomMemory > 0) { float ratioHeadroomKnown = allocationBookkeeper.totHeadRoomEnabledRMs / (float) allocationBookkeeper.getActiveAndEnabledSC().size(); headroomWeighting = (headroom.get(targetId).getMemorySize() / allocationBookkeeper.totHeadroomMemory) * (ratioHeadroomKnown); } return headroomWeighting; } protected final class AllocationBookkeeper { private Map<SubClusterId, List<ResourceRequest>> answer = new TreeMap<>(); private Map<SubClusterId, Set<Long>> maskForRackDeletion = new HashMap<>(); private Map<Long, Map<SubClusterId, AtomicLong>> countContainersPerRM = new HashMap<>(); private Map<Long, AtomicLong> totNumLocalizedContainers = new HashMap<>(); private Map<Long, SubClusterId> unResolvedRequestLocation = new HashMap<>(); private Set<SubClusterId> activeAndEnabledSC = new HashSet<>(); private float totHeadroomMemory = 0; private int totHeadRoomEnabledRMs = 0; private Map<SubClusterId, Float> policyWeights; private float totPolicyWeight = 0;
/** * Compute the weighting based on available headroom. This is proportional to * the available headroom memory announced by RM, or to 1/N for RMs we have * not seen yet. If all RMs report zero headroom, we fallback to 1/N again. */
Compute the weighting based on available headroom. This is proportional to the available headroom memory announced by RM, or to 1/N for RMs we have not seen yet. If all RMs report zero headroom, we fallback to 1/N again
getHeadroomWeighting
{ "repo_name": "littlezhou/hadoop", "path": "hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-common/src/main/java/org/apache/hadoop/yarn/server/federation/policies/amrmproxy/LocalityMulticastAMRMProxyPolicy.java", "license": "apache-2.0", "size": 28410 }
[ "java.util.HashMap", "java.util.HashSet", "java.util.List", "java.util.Map", "java.util.Set", "java.util.TreeMap", "java.util.concurrent.atomic.AtomicLong", "org.apache.hadoop.yarn.api.records.ResourceRequest", "org.apache.hadoop.yarn.server.federation.store.records.SubClusterId" ]
import java.util.HashMap; import java.util.HashSet; import java.util.List; import java.util.Map; import java.util.Set; import java.util.TreeMap; import java.util.concurrent.atomic.AtomicLong; import org.apache.hadoop.yarn.api.records.ResourceRequest; import org.apache.hadoop.yarn.server.federation.store.records.SubClusterId;
import java.util.*; import java.util.concurrent.atomic.*; import org.apache.hadoop.yarn.api.records.*; import org.apache.hadoop.yarn.server.federation.store.records.*;
[ "java.util", "org.apache.hadoop" ]
java.util; org.apache.hadoop;
2,715,568
public static String findTableColNameOf(Operator<?> start, String internalColName) { // Look for internalCoName alias in current OR Parent RowSchemas Stack<Operator<?>> parentOps = new Stack<>(); ColumnInfo keyColInfo = null; parentOps.add(start); while (!parentOps.isEmpty()) { Operator<?> currentOp = parentOps.pop(); if (currentOp instanceof ReduceSinkOperator) { // Dont want to follow that parent path continue; } // If columnName is the output of a ColumnExpr get the original columnName from the Expr Map if (currentOp.getColumnExprMap() != null && currentOp.getColumnExprMap().containsKey(internalColName) && currentOp.getColumnExprMap().get(internalColName) instanceof ExprNodeColumnDesc) { internalColName = ((ExprNodeColumnDesc) currentOp.getColumnExprMap().get(internalColName)).getColumn(); } keyColInfo = currentOp.getSchema().getColumnInfo(internalColName); if (keyColInfo != null) { // Get original colName alias (or fallback to internal colName) return keyColInfo.getAlias() != null ? keyColInfo.getAlias() : keyColInfo.getInternalName(); } parentOps.addAll(currentOp.getParentOperators()); } return null; }
static String function(Operator<?> start, String internalColName) { Stack<Operator<?>> parentOps = new Stack<>(); ColumnInfo keyColInfo = null; parentOps.add(start); while (!parentOps.isEmpty()) { Operator<?> currentOp = parentOps.pop(); if (currentOp instanceof ReduceSinkOperator) { continue; } if (currentOp.getColumnExprMap() != null && currentOp.getColumnExprMap().containsKey(internalColName) && currentOp.getColumnExprMap().get(internalColName) instanceof ExprNodeColumnDesc) { internalColName = ((ExprNodeColumnDesc) currentOp.getColumnExprMap().get(internalColName)).getColumn(); } keyColInfo = currentOp.getSchema().getColumnInfo(internalColName); if (keyColInfo != null) { return keyColInfo.getAlias() != null ? keyColInfo.getAlias() : keyColInfo.getInternalName(); } parentOps.addAll(currentOp.getParentOperators()); } return null; }
/** * Given an operator and an internalColName look for the original Table columnName * that this internal column maps to. This method finds the original columnName * by checking column Expr mappings and schemas of the start operator and its parents. * * @param start * @param internalColName * @return the original column name or null if not found */
Given an operator and an internalColName look for the original Table columnName that this internal column maps to. This method finds the original columnName by checking column Expr mappings and schemas of the start operator and its parents
findTableColNameOf
{ "repo_name": "nishantmonu51/hive", "path": "ql/src/java/org/apache/hadoop/hive/ql/exec/OperatorUtils.java", "license": "apache-2.0", "size": 26621 }
[ "java.util.Stack", "org.apache.hadoop.hive.ql.plan.ExprNodeColumnDesc" ]
import java.util.Stack; import org.apache.hadoop.hive.ql.plan.ExprNodeColumnDesc;
import java.util.*; import org.apache.hadoop.hive.ql.plan.*;
[ "java.util", "org.apache.hadoop" ]
java.util; org.apache.hadoop;
1,397,917
public void setAggregationStrategy(AggregationStrategy aggregationStrategy) { this.aggregationStrategy = aggregationStrategy; }
void function(AggregationStrategy aggregationStrategy) { this.aggregationStrategy = aggregationStrategy; }
/** * Sets the AggregationStrategy to be used to assemble the replies from the splitted messages, into a single outgoing message from the Splitter. * By default Camel will use the original incoming message to the splitter (leave it unchanged). You can also use a POJO as the AggregationStrategy */
Sets the AggregationStrategy to be used to assemble the replies from the splitted messages, into a single outgoing message from the Splitter. By default Camel will use the original incoming message to the splitter (leave it unchanged). You can also use a POJO as the AggregationStrategy
setAggregationStrategy
{ "repo_name": "manuelh9r/camel", "path": "camel-core/src/main/java/org/apache/camel/model/SplitDefinition.java", "license": "apache-2.0", "size": 19221 }
[ "org.apache.camel.processor.aggregate.AggregationStrategy" ]
import org.apache.camel.processor.aggregate.AggregationStrategy;
import org.apache.camel.processor.aggregate.*;
[ "org.apache.camel" ]
org.apache.camel;
1,967,280
public void testAcPackageUpgradeOnEmpty() { List<Integer> upgradePackages = new ArrayList<Integer>(); try { this.ach.addPackageUpgrade(this.admin, this.server.getId().intValue(), upgradePackages, CHAIN_LABEL); fail("Expected exception: " + InvalidParameterException.class.getCanonicalName()); } catch (InvalidParameterException ex) { assertEquals(0, actionChain.getEntries().size()); } }
void function() { List<Integer> upgradePackages = new ArrayList<Integer>(); try { this.ach.addPackageUpgrade(this.admin, this.server.getId().intValue(), upgradePackages, CHAIN_LABEL); fail(STR + InvalidParameterException.class.getCanonicalName()); } catch (InvalidParameterException ex) { assertEquals(0, actionChain.getEntries().size()); } }
/** * Test package upgrade with an empty list. */
Test package upgrade with an empty list
testAcPackageUpgradeOnEmpty
{ "repo_name": "xkollar/spacewalk", "path": "java/code/src/com/redhat/rhn/frontend/xmlrpc/chain/test/ActionChainHandlerTest.java", "license": "gpl-2.0", "size": 26780 }
[ "com.redhat.rhn.frontend.xmlrpc.InvalidParameterException", "java.util.ArrayList", "java.util.List" ]
import com.redhat.rhn.frontend.xmlrpc.InvalidParameterException; import java.util.ArrayList; import java.util.List;
import com.redhat.rhn.frontend.xmlrpc.*; import java.util.*;
[ "com.redhat.rhn", "java.util" ]
com.redhat.rhn; java.util;
113,130
protected void printDocumentation(StringBuffer sb, CMNode node) { CMNodeList nodeList = (CMNodeList) node.getProperty("documentation"); //$NON-NLS-1$ if ((nodeList != null) && (nodeList.getLength() > 0)) { for (int i = 0; i < nodeList.getLength(); i++) { CMDocumentation documentation = (CMDocumentation) nodeList.item(i); String doc = documentation.getValue(); if (doc != null) { sb.append(PARAGRAPH_START + doc.trim() + PARAGRAPH_END); } } sb.append(NEW_LINE); } }
void function(StringBuffer sb, CMNode node) { CMNodeList nodeList = (CMNodeList) node.getProperty(STR); if ((nodeList != null) && (nodeList.getLength() > 0)) { for (int i = 0; i < nodeList.getLength(); i++) { CMDocumentation documentation = (CMDocumentation) nodeList.item(i); String doc = documentation.getValue(); if (doc != null) { sb.append(PARAGRAPH_START + doc.trim() + PARAGRAPH_END); } } sb.append(NEW_LINE); } }
/** * Adds the tag documentation property of the CMNode to the string buffer, * sb * */
Adds the tag documentation property of the CMNode to the string buffer, sb
printDocumentation
{ "repo_name": "ttimbul/eclipse.wst", "path": "bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/taginfo/MarkupTagInfoProvider.java", "license": "epl-1.0", "size": 6767 }
[ "org.eclipse.wst.xml.core.internal.contentmodel.CMDocumentation", "org.eclipse.wst.xml.core.internal.contentmodel.CMNode", "org.eclipse.wst.xml.core.internal.contentmodel.CMNodeList" ]
import org.eclipse.wst.xml.core.internal.contentmodel.CMDocumentation; import org.eclipse.wst.xml.core.internal.contentmodel.CMNode; import org.eclipse.wst.xml.core.internal.contentmodel.CMNodeList;
import org.eclipse.wst.xml.core.internal.contentmodel.*;
[ "org.eclipse.wst" ]
org.eclipse.wst;
1,343,656
public void initializePackageContents() { if (isInitialized) return; isInitialized = true; // Initialize package setName(eNAME); setNsPrefix(eNS_PREFIX); setNsURI(eNS_URI); // Add supertypes to classes orParserEClass.getESuperTypes().add(this.getAbstractParser()); sequenceParserEClass.getESuperTypes().add(this.getAbstractParser()); terminalParserEClass.getESuperTypes().add(this.getAbstractParser()); refParserEClass.getESuperTypes().add(this.getAbstractParser()); literalParserEClass.getESuperTypes().add(this.getAbstractParser()); identifierParserEClass.getESuperTypes().add(this.getLiteralParser()); stringParserEClass.getESuperTypes().add(this.getLiteralParser()); ecoreMappingEClass.getESuperTypes().add(this.getComposableMapping()); asQNameEClass.getESuperTypes().add(this.getMapping()); identityParserEClass.getESuperTypes().add(this.getAbstractParser()); numberParserEClass.getESuperTypes().add(this.getLiteralParser()); intParserEClass.getESuperTypes().add(this.getNumberParser()); doubleParserEClass.getESuperTypes().add(this.getNumberParser()); floatParserEClass.getESuperTypes().add(this.getNumberParser()); referenceMappingEClass.getESuperTypes().add(this.getComposableMapping()); operatorTableParserEClass.getESuperTypes().add(this.getAbstractParser()); infixOperatorEClass.getESuperTypes().add(this.getPrecedenceOperator()); unaryOperatorEClass.getESuperTypes().add(this.getPrecedenceOperator()); prefixOperatorEClass.getESuperTypes().add(this.getUnaryOperator()); postfixOperatorEClass.getESuperTypes().add(this.getUnaryOperator()); unitEClass.getESuperTypes().add(this.getOperatorTableEntry()); leftAssociativeOperatorEClass.getESuperTypes().add(this.getInfixOperator()); rightAssociativeOperatorEClass.getESuperTypes().add(this.getInfixOperator()); nonAssociativeOperatorEClass.getESuperTypes().add(this.getInfixOperator()); stringValueMappingEClass.getESuperTypes().add(this.getComposableMapping()); composableMappingEClass.getESuperTypes().add(this.getMapping()); precedenceOperatorEClass.getESuperTypes().add(this.getOperatorTableEntry()); longParserEClass.getESuperTypes().add(this.getNumberParser()); boolParserEClass.getESuperTypes().add(this.getLiteralParser()); importParserEClass.getESuperTypes().add(this.getAbstractParser()); // Initialize classes and features; add operations and parameters initEClass(abstractParserEClass, AbstractParser.class, "AbstractParser", IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); initEAttribute(getAbstractParser_Multiplicity(), ecorePackage.getEString(), "multiplicity", null, 0, 1, AbstractParser.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); initEAttribute(getAbstractParser_Label(), ecorePackage.getEString(), "label", null, 0, 1, AbstractParser.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); initEReference(getAbstractParser_Mapping(), this.getMapping(), null, "mapping", null, 0, 1, AbstractParser.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); initEClass(orParserEClass, OrParser.class, "OrParser", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); initEReference(getOrParser_Parsers(), this.getAbstractParser(), null, "parsers", null, 1, -1, OrParser.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); initEClass(sequenceParserEClass, SequenceParser.class, "SequenceParser", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); initEReference(getSequenceParser_Parsers(), this.getAbstractParser(), null, "parsers", null, 1, -1, SequenceParser.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); initEClass(concreteSyntaxEClass, ConcreteSyntax.class, "ConcreteSyntax", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); initEReference(getConcreteSyntax_Startwith(), this.getParserDefinition(), null, "startwith", null, 1, 1, ConcreteSyntax.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); initEReference(getConcreteSyntax_Operators(), this.getTerminal(), null, "operators", null, 0, -1, ConcreteSyntax.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); initEReference(getConcreteSyntax_Keywords(), this.getTerminal(), null, "keywords", null, 0, -1, ConcreteSyntax.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); initEReference(getConcreteSyntax_Parsers(), this.getParserDefinition(), null, "parsers", null, 0, -1, ConcreteSyntax.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); initEReference(getConcreteSyntax_Metamodels(), this.getMetaModel(), null, "metamodels", null, 1, -1, ConcreteSyntax.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); initEReference(getConcreteSyntax_Regex(), this.getRegularExpression(), null, "regex", null, 0, -1, ConcreteSyntax.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); initEAttribute(getConcreteSyntax_MultiLineCommentIndicationStart(), ecorePackage.getEString(), "multiLineCommentIndicationStart", null, 0, 1, ConcreteSyntax.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); initEAttribute(getConcreteSyntax_MultiLineCommentIndicationEnd(), ecorePackage.getEString(), "multiLineCommentIndicationEnd", null, 0, 1, ConcreteSyntax.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); initEAttribute(getConcreteSyntax_SingleLineCommentIndicationStart(), ecorePackage.getEString(), "singleLineCommentIndicationStart", null, 0, 1, ConcreteSyntax.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); initEAttribute(getConcreteSyntax_Id(), ecorePackage.getEString(), "id", null, 0, 1, ConcreteSyntax.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); initEClass(terminalParserEClass, TerminalParser.class, "TerminalParser", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); initEReference(getTerminalParser_Terminal(), this.getTerminal(), null, "terminal", null, 1, 1, TerminalParser.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); initEClass(terminalEClass, Terminal.class, "Terminal", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); initEAttribute(getTerminal_Terminal(), ecorePackage.getEString(), "terminal", null, 1, 1, Terminal.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); initEClass(refParserEClass, RefParser.class, "RefParser", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); initEReference(getRefParser_Ref(), this.getParserDefinition(), null, "ref", null, 1, 1, RefParser.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); initEClass(literalParserEClass, LiteralParser.class, "LiteralParser", IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); initEReference(getLiteralParser_Regex(), this.getRegularExpression(), null, "regex", null, 0, 1, LiteralParser.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); initEClass(parserDefinitionEClass, ParserDefinition.class, "ParserDefinition", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); initEAttribute(getParserDefinition_Name(), ecorePackage.getEString(), "name", null, 1, 1, ParserDefinition.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); initEReference(getParserDefinition_Rule(), this.getAbstractParser(), null, "rule", null, 1, 1, ParserDefinition.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); initEClass(identifierParserEClass, IdentifierParser.class, "IdentifierParser", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); initEClass(stringParserEClass, StringParser.class, "StringParser", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); initEClass(ecoreMappingEClass, EcoreMapping.class, "EcoreMapping", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); initEReference(getEcoreMapping_Assignments(), this.getAssignment(), null, "assignments", null, 0, -1, EcoreMapping.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); initEReference(getEcoreMapping_Metamodel(), this.getMetaModel(), null, "metamodel", null, 1, 1, EcoreMapping.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); initEReference(getEcoreMapping_EClass(), this.getQualifiedName(), null, "eClass", null, 1, 1, EcoreMapping.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); initEClass(assignmentEClass, Assignment.class, "Assignment", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); initEAttribute(getAssignment_To(), ecorePackage.getEString(), "to", null, 1, 1, Assignment.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); initEReference(getAssignment_From(), this.getComposableMapping(), null, "from", null, 1, 1, Assignment.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); initEClass(asQNameEClass, AsQName.class, "AsQName", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); initEAttribute(getAsQName_Delim(), ecorePackage.getEString(), "delim", null, 0, 1, AsQName.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); initEClass(identityParserEClass, IdentityParser.class, "IdentityParser", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); initEReference(getIdentityParser_Parser(), this.getAbstractParser(), null, "parser", null, 1, 1, IdentityParser.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); initEClass(numberParserEClass, NumberParser.class, "NumberParser", IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); initEClass(intParserEClass, IntParser.class, "IntParser", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); initEClass(doubleParserEClass, DoubleParser.class, "DoubleParser", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); initEClass(floatParserEClass, FloatParser.class, "FloatParser", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); initEClass(mappingEClass, Mapping.class, "Mapping", IS_ABSTRACT, IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); initEClass(referenceMappingEClass, ReferenceMapping.class, "ReferenceMapping", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); initEReference(getReferenceMapping_QName(), this.getQualifiedName(), null, "qName", null, 1, 1, ReferenceMapping.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); initEClass(operatorTableParserEClass, OperatorTableParser.class, "OperatorTableParser", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); initEReference(getOperatorTableParser_Entries(), this.getOperatorTableEntry(), null, "entries", null, 0, -1, OperatorTableParser.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); initEClass(operatorTableEntryEClass, OperatorTableEntry.class, "OperatorTableEntry", IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); initEReference(getOperatorTableEntry_Parser(), this.getAbstractParser(), null, "parser", null, 1, 1, OperatorTableEntry.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); initEClass(infixOperatorEClass, InfixOperator.class, "InfixOperator", IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); initEClass(unaryOperatorEClass, UnaryOperator.class, "UnaryOperator", IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); initEClass(prefixOperatorEClass, PrefixOperator.class, "PrefixOperator", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); initEClass(postfixOperatorEClass, PostfixOperator.class, "PostfixOperator", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); initEClass(unitEClass, Unit.class, "Unit", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); initEClass(leftAssociativeOperatorEClass, LeftAssociativeOperator.class, "LeftAssociativeOperator", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); initEClass(rightAssociativeOperatorEClass, RightAssociativeOperator.class, "RightAssociativeOperator", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); initEClass(nonAssociativeOperatorEClass, NonAssociativeOperator.class, "NonAssociativeOperator", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); initEClass(metaModelEClass, MetaModel.class, "MetaModel", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); initEAttribute(getMetaModel_ModelURI(), ecorePackage.getEString(), "modelURI", null, 0, 1, MetaModel.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); initEAttribute(getMetaModel_Prefix(), ecorePackage.getEString(), "prefix", "default", 0, 1, MetaModel.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); initEClass(stringValueMappingEClass, StringValueMapping.class, "StringValueMapping", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); initEAttribute(getStringValueMapping_Value(), ecorePackage.getEString(), "value", null, 1, 1, StringValueMapping.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); initEClass(composableMappingEClass, ComposableMapping.class, "ComposableMapping", IS_ABSTRACT, IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); initEClass(precedenceOperatorEClass, PrecedenceOperator.class, "PrecedenceOperator", IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); initEAttribute(getPrecedenceOperator_Precedence(), ecorePackage.getEInt(), "precedence", null, 1, 1, PrecedenceOperator.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); initEReference(getPrecedenceOperator_Mapping(), this.getMapping(), null, "mapping", null, 0, 1, PrecedenceOperator.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); initEClass(regularExpressionEClass, RegularExpression.class, "RegularExpression", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); initEAttribute(getRegularExpression_Regex(), ecorePackage.getEString(), "regex", null, 1, 1, RegularExpression.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); initEAttribute(getRegularExpression_Name(), ecorePackage.getEString(), "name", null, 1, 1, RegularExpression.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); initEClass(qualifiedNameEClass, QualifiedName.class, "QualifiedName", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); initEAttribute(getQualifiedName_Sections(), ecorePackage.getEString(), "sections", null, 1, -1, QualifiedName.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, !IS_UNIQUE, !IS_DERIVED, IS_ORDERED); initEClass(longParserEClass, LongParser.class, "LongParser", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); initEClass(boolParserEClass, BoolParser.class, "BoolParser", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); initEAttribute(getBoolParser_TrueLit(), ecorePackage.getEString(), "trueLit", "true", 0, 1, BoolParser.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); initEAttribute(getBoolParser_FalseLit(), ecorePackage.getEString(), "falseLit", "false", 0, 1, BoolParser.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); initEClass(importParserEClass, ImportParser.class, "ImportParser", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); initEReference(getImportParser_Parser(), this.getAbstractParser(), null, "parser", null, 1, 1, ImportParser.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); // Create resource createResource(eNS_URI); }
void function() { if (isInitialized) return; isInitialized = true; setName(eNAME); setNsPrefix(eNS_PREFIX); setNsURI(eNS_URI); orParserEClass.getESuperTypes().add(this.getAbstractParser()); sequenceParserEClass.getESuperTypes().add(this.getAbstractParser()); terminalParserEClass.getESuperTypes().add(this.getAbstractParser()); refParserEClass.getESuperTypes().add(this.getAbstractParser()); literalParserEClass.getESuperTypes().add(this.getAbstractParser()); identifierParserEClass.getESuperTypes().add(this.getLiteralParser()); stringParserEClass.getESuperTypes().add(this.getLiteralParser()); ecoreMappingEClass.getESuperTypes().add(this.getComposableMapping()); asQNameEClass.getESuperTypes().add(this.getMapping()); identityParserEClass.getESuperTypes().add(this.getAbstractParser()); numberParserEClass.getESuperTypes().add(this.getLiteralParser()); intParserEClass.getESuperTypes().add(this.getNumberParser()); doubleParserEClass.getESuperTypes().add(this.getNumberParser()); floatParserEClass.getESuperTypes().add(this.getNumberParser()); referenceMappingEClass.getESuperTypes().add(this.getComposableMapping()); operatorTableParserEClass.getESuperTypes().add(this.getAbstractParser()); infixOperatorEClass.getESuperTypes().add(this.getPrecedenceOperator()); unaryOperatorEClass.getESuperTypes().add(this.getPrecedenceOperator()); prefixOperatorEClass.getESuperTypes().add(this.getUnaryOperator()); postfixOperatorEClass.getESuperTypes().add(this.getUnaryOperator()); unitEClass.getESuperTypes().add(this.getOperatorTableEntry()); leftAssociativeOperatorEClass.getESuperTypes().add(this.getInfixOperator()); rightAssociativeOperatorEClass.getESuperTypes().add(this.getInfixOperator()); nonAssociativeOperatorEClass.getESuperTypes().add(this.getInfixOperator()); stringValueMappingEClass.getESuperTypes().add(this.getComposableMapping()); composableMappingEClass.getESuperTypes().add(this.getMapping()); precedenceOperatorEClass.getESuperTypes().add(this.getOperatorTableEntry()); longParserEClass.getESuperTypes().add(this.getNumberParser()); boolParserEClass.getESuperTypes().add(this.getLiteralParser()); importParserEClass.getESuperTypes().add(this.getAbstractParser()); initEClass(abstractParserEClass, AbstractParser.class, STR, IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); initEAttribute(getAbstractParser_Multiplicity(), ecorePackage.getEString(), STR, null, 0, 1, AbstractParser.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); initEAttribute(getAbstractParser_Label(), ecorePackage.getEString(), "label", null, 0, 1, AbstractParser.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); initEReference(getAbstractParser_Mapping(), this.getMapping(), null, STR, null, 0, 1, AbstractParser.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); initEClass(orParserEClass, OrParser.class, STR, !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); initEReference(getOrParser_Parsers(), this.getAbstractParser(), null, STR, null, 1, -1, OrParser.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); initEClass(sequenceParserEClass, SequenceParser.class, STR, !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); initEReference(getSequenceParser_Parsers(), this.getAbstractParser(), null, STR, null, 1, -1, SequenceParser.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); initEClass(concreteSyntaxEClass, ConcreteSyntax.class, STR, !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); initEReference(getConcreteSyntax_Startwith(), this.getParserDefinition(), null, STR, null, 1, 1, ConcreteSyntax.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); initEReference(getConcreteSyntax_Operators(), this.getTerminal(), null, STR, null, 0, -1, ConcreteSyntax.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); initEReference(getConcreteSyntax_Keywords(), this.getTerminal(), null, STR, null, 0, -1, ConcreteSyntax.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); initEReference(getConcreteSyntax_Parsers(), this.getParserDefinition(), null, STR, null, 0, -1, ConcreteSyntax.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); initEReference(getConcreteSyntax_Metamodels(), this.getMetaModel(), null, STR, null, 1, -1, ConcreteSyntax.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); initEReference(getConcreteSyntax_Regex(), this.getRegularExpression(), null, "regex", null, 0, -1, ConcreteSyntax.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); initEAttribute(getConcreteSyntax_MultiLineCommentIndicationStart(), ecorePackage.getEString(), STR, null, 0, 1, ConcreteSyntax.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); initEAttribute(getConcreteSyntax_MultiLineCommentIndicationEnd(), ecorePackage.getEString(), STR, null, 0, 1, ConcreteSyntax.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); initEAttribute(getConcreteSyntax_SingleLineCommentIndicationStart(), ecorePackage.getEString(), STR, null, 0, 1, ConcreteSyntax.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); initEAttribute(getConcreteSyntax_Id(), ecorePackage.getEString(), "id", null, 0, 1, ConcreteSyntax.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); initEClass(terminalParserEClass, TerminalParser.class, STR, !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); initEReference(getTerminalParser_Terminal(), this.getTerminal(), null, STR, null, 1, 1, TerminalParser.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); initEClass(terminalEClass, Terminal.class, STR, !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); initEAttribute(getTerminal_Terminal(), ecorePackage.getEString(), STR, null, 1, 1, Terminal.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); initEClass(refParserEClass, RefParser.class, STR, !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); initEReference(getRefParser_Ref(), this.getParserDefinition(), null, "ref", null, 1, 1, RefParser.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); initEClass(literalParserEClass, LiteralParser.class, STR, IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); initEReference(getLiteralParser_Regex(), this.getRegularExpression(), null, "regex", null, 0, 1, LiteralParser.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); initEClass(parserDefinitionEClass, ParserDefinition.class, STR, !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); initEAttribute(getParserDefinition_Name(), ecorePackage.getEString(), "name", null, 1, 1, ParserDefinition.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); initEReference(getParserDefinition_Rule(), this.getAbstractParser(), null, "rule", null, 1, 1, ParserDefinition.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); initEClass(identifierParserEClass, IdentifierParser.class, STR, !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); initEClass(stringParserEClass, StringParser.class, STR, !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); initEClass(ecoreMappingEClass, EcoreMapping.class, STR, !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); initEReference(getEcoreMapping_Assignments(), this.getAssignment(), null, STR, null, 0, -1, EcoreMapping.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); initEReference(getEcoreMapping_Metamodel(), this.getMetaModel(), null, STR, null, 1, 1, EcoreMapping.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); initEReference(getEcoreMapping_EClass(), this.getQualifiedName(), null, STR, null, 1, 1, EcoreMapping.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); initEClass(assignmentEClass, Assignment.class, STR, !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); initEAttribute(getAssignment_To(), ecorePackage.getEString(), "to", null, 1, 1, Assignment.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); initEReference(getAssignment_From(), this.getComposableMapping(), null, "from", null, 1, 1, Assignment.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); initEClass(asQNameEClass, AsQName.class, STR, !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); initEAttribute(getAsQName_Delim(), ecorePackage.getEString(), "delim", null, 0, 1, AsQName.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); initEClass(identityParserEClass, IdentityParser.class, STR, !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); initEReference(getIdentityParser_Parser(), this.getAbstractParser(), null, STR, null, 1, 1, IdentityParser.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); initEClass(numberParserEClass, NumberParser.class, STR, IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); initEClass(intParserEClass, IntParser.class, STR, !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); initEClass(doubleParserEClass, DoubleParser.class, STR, !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); initEClass(floatParserEClass, FloatParser.class, STR, !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); initEClass(mappingEClass, Mapping.class, STR, IS_ABSTRACT, IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); initEClass(referenceMappingEClass, ReferenceMapping.class, STR, !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); initEReference(getReferenceMapping_QName(), this.getQualifiedName(), null, "qName", null, 1, 1, ReferenceMapping.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); initEClass(operatorTableParserEClass, OperatorTableParser.class, STR, !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); initEReference(getOperatorTableParser_Entries(), this.getOperatorTableEntry(), null, STR, null, 0, -1, OperatorTableParser.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); initEClass(operatorTableEntryEClass, OperatorTableEntry.class, STR, IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); initEReference(getOperatorTableEntry_Parser(), this.getAbstractParser(), null, STR, null, 1, 1, OperatorTableEntry.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); initEClass(infixOperatorEClass, InfixOperator.class, STR, IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); initEClass(unaryOperatorEClass, UnaryOperator.class, STR, IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); initEClass(prefixOperatorEClass, PrefixOperator.class, STR, !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); initEClass(postfixOperatorEClass, PostfixOperator.class, STR, !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); initEClass(unitEClass, Unit.class, "Unit", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); initEClass(leftAssociativeOperatorEClass, LeftAssociativeOperator.class, STR, !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); initEClass(rightAssociativeOperatorEClass, RightAssociativeOperator.class, STR, !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); initEClass(nonAssociativeOperatorEClass, NonAssociativeOperator.class, STR, !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); initEClass(metaModelEClass, MetaModel.class, STR, !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); initEAttribute(getMetaModel_ModelURI(), ecorePackage.getEString(), STR, null, 0, 1, MetaModel.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); initEAttribute(getMetaModel_Prefix(), ecorePackage.getEString(), STR, STR, 0, 1, MetaModel.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); initEClass(stringValueMappingEClass, StringValueMapping.class, STR, !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); initEAttribute(getStringValueMapping_Value(), ecorePackage.getEString(), "value", null, 1, 1, StringValueMapping.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); initEClass(composableMappingEClass, ComposableMapping.class, STR, IS_ABSTRACT, IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); initEClass(precedenceOperatorEClass, PrecedenceOperator.class, STR, IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); initEAttribute(getPrecedenceOperator_Precedence(), ecorePackage.getEInt(), STR, null, 1, 1, PrecedenceOperator.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); initEReference(getPrecedenceOperator_Mapping(), this.getMapping(), null, STR, null, 0, 1, PrecedenceOperator.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); initEClass(regularExpressionEClass, RegularExpression.class, STR, !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); initEAttribute(getRegularExpression_Regex(), ecorePackage.getEString(), "regex", null, 1, 1, RegularExpression.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); initEAttribute(getRegularExpression_Name(), ecorePackage.getEString(), "name", null, 1, 1, RegularExpression.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); initEClass(qualifiedNameEClass, QualifiedName.class, STR, !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); initEAttribute(getQualifiedName_Sections(), ecorePackage.getEString(), STR, null, 1, -1, QualifiedName.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, !IS_UNIQUE, !IS_DERIVED, IS_ORDERED); initEClass(longParserEClass, LongParser.class, STR, !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); initEClass(boolParserEClass, BoolParser.class, STR, !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); initEAttribute(getBoolParser_TrueLit(), ecorePackage.getEString(), STR, "true", 0, 1, BoolParser.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); initEAttribute(getBoolParser_FalseLit(), ecorePackage.getEString(), STR, "false", 0, 1, BoolParser.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); initEClass(importParserEClass, ImportParser.class, STR, !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); initEReference(getImportParser_Parser(), this.getAbstractParser(), null, STR, null, 1, 1, ImportParser.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); createResource(eNS_URI); }
/** * Complete the initialization of the package and its meta-model. This * method is guarded to have no affect on any invocation but its first. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */
Complete the initialization of the package and its meta-model. This method is guarded to have no affect on any invocation but its first.
initializePackageContents
{ "repo_name": "paetti1988/qmate", "path": "PCCS/org.tud.inf.st.pceditor/src-gen/org/tud/inf/st/pccs/impl/PccsPackageImpl.java", "license": "apache-2.0", "size": 48014 }
[ "org.eclipse.emf.ecore.EClass", "org.tud.inf.st.pccs.AbstractParser", "org.tud.inf.st.pccs.AsQName", "org.tud.inf.st.pccs.Assignment", "org.tud.inf.st.pccs.BoolParser", "org.tud.inf.st.pccs.ComposableMapping", "org.tud.inf.st.pccs.ConcreteSyntax", "org.tud.inf.st.pccs.DoubleParser", "org.tud.inf.st.pccs.EcoreMapping", "org.tud.inf.st.pccs.FloatParser", "org.tud.inf.st.pccs.IdentifierParser", "org.tud.inf.st.pccs.IdentityParser", "org.tud.inf.st.pccs.ImportParser", "org.tud.inf.st.pccs.InfixOperator", "org.tud.inf.st.pccs.IntParser", "org.tud.inf.st.pccs.LeftAssociativeOperator", "org.tud.inf.st.pccs.LiteralParser", "org.tud.inf.st.pccs.LongParser", "org.tud.inf.st.pccs.Mapping", "org.tud.inf.st.pccs.MetaModel", "org.tud.inf.st.pccs.NonAssociativeOperator", "org.tud.inf.st.pccs.NumberParser", "org.tud.inf.st.pccs.OperatorTableEntry", "org.tud.inf.st.pccs.OperatorTableParser", "org.tud.inf.st.pccs.OrParser", "org.tud.inf.st.pccs.ParserDefinition", "org.tud.inf.st.pccs.PostfixOperator", "org.tud.inf.st.pccs.PrecedenceOperator", "org.tud.inf.st.pccs.PrefixOperator", "org.tud.inf.st.pccs.QualifiedName", "org.tud.inf.st.pccs.RefParser", "org.tud.inf.st.pccs.ReferenceMapping", "org.tud.inf.st.pccs.RegularExpression", "org.tud.inf.st.pccs.RightAssociativeOperator", "org.tud.inf.st.pccs.SequenceParser", "org.tud.inf.st.pccs.StringParser", "org.tud.inf.st.pccs.StringValueMapping", "org.tud.inf.st.pccs.Terminal", "org.tud.inf.st.pccs.TerminalParser", "org.tud.inf.st.pccs.UnaryOperator", "org.tud.inf.st.pccs.Unit" ]
import org.eclipse.emf.ecore.EClass; import org.tud.inf.st.pccs.AbstractParser; import org.tud.inf.st.pccs.AsQName; import org.tud.inf.st.pccs.Assignment; import org.tud.inf.st.pccs.BoolParser; import org.tud.inf.st.pccs.ComposableMapping; import org.tud.inf.st.pccs.ConcreteSyntax; import org.tud.inf.st.pccs.DoubleParser; import org.tud.inf.st.pccs.EcoreMapping; import org.tud.inf.st.pccs.FloatParser; import org.tud.inf.st.pccs.IdentifierParser; import org.tud.inf.st.pccs.IdentityParser; import org.tud.inf.st.pccs.ImportParser; import org.tud.inf.st.pccs.InfixOperator; import org.tud.inf.st.pccs.IntParser; import org.tud.inf.st.pccs.LeftAssociativeOperator; import org.tud.inf.st.pccs.LiteralParser; import org.tud.inf.st.pccs.LongParser; import org.tud.inf.st.pccs.Mapping; import org.tud.inf.st.pccs.MetaModel; import org.tud.inf.st.pccs.NonAssociativeOperator; import org.tud.inf.st.pccs.NumberParser; import org.tud.inf.st.pccs.OperatorTableEntry; import org.tud.inf.st.pccs.OperatorTableParser; import org.tud.inf.st.pccs.OrParser; import org.tud.inf.st.pccs.ParserDefinition; import org.tud.inf.st.pccs.PostfixOperator; import org.tud.inf.st.pccs.PrecedenceOperator; import org.tud.inf.st.pccs.PrefixOperator; import org.tud.inf.st.pccs.QualifiedName; import org.tud.inf.st.pccs.RefParser; import org.tud.inf.st.pccs.ReferenceMapping; import org.tud.inf.st.pccs.RegularExpression; import org.tud.inf.st.pccs.RightAssociativeOperator; import org.tud.inf.st.pccs.SequenceParser; import org.tud.inf.st.pccs.StringParser; import org.tud.inf.st.pccs.StringValueMapping; import org.tud.inf.st.pccs.Terminal; import org.tud.inf.st.pccs.TerminalParser; import org.tud.inf.st.pccs.UnaryOperator; import org.tud.inf.st.pccs.Unit;
import org.eclipse.emf.ecore.*; import org.tud.inf.st.pccs.*;
[ "org.eclipse.emf", "org.tud.inf" ]
org.eclipse.emf; org.tud.inf;
2,389,121
protected void forwardToLoginPage(Request request, Response response, LoginConfig config) { RequestDispatcher disp = context.getServletContext().getRequestDispatcher (config.getLoginPage()); try { disp.forward(request.getRequest(), response.getResponse()); response.finishResponse(); } catch (Throwable t) { log.warn("Unexpected error forwarding to login page", t); } }
void function(Request request, Response response, LoginConfig config) { RequestDispatcher disp = context.getServletContext().getRequestDispatcher (config.getLoginPage()); try { disp.forward(request.getRequest(), response.getResponse()); response.finishResponse(); } catch (Throwable t) { log.warn(STR, t); } }
/** * Called to forward to the login page * * @param request Request we are processing * @param response Response we are creating * @param config Login configuration describing how authentication * should be performed */
Called to forward to the login page
forwardToLoginPage
{ "repo_name": "NCIP/common-security-module", "path": "software/cgmmweb/src/gov/nih/nci/security/cgmm/authenticators/CaGridFormAuthenticator.java", "license": "bsd-3-clause", "size": 24878 }
[ "javax.servlet.RequestDispatcher", "org.apache.catalina.connector.Request", "org.apache.catalina.connector.Response", "org.apache.catalina.deploy.LoginConfig" ]
import javax.servlet.RequestDispatcher; import org.apache.catalina.connector.Request; import org.apache.catalina.connector.Response; import org.apache.catalina.deploy.LoginConfig;
import javax.servlet.*; import org.apache.catalina.connector.*; import org.apache.catalina.deploy.*;
[ "javax.servlet", "org.apache.catalina" ]
javax.servlet; org.apache.catalina;
77,884
//------------------------------------------------------------------------- public void addExternalId(final ExternalId externalId) { ArgumentChecker.notNull(externalId, "externalId"); setExternalId(getExternalId().withExternalId(externalId)); }
void function(final ExternalId externalId) { ArgumentChecker.notNull(externalId, STR); setExternalId(getExternalId().withExternalId(externalId)); }
/** * Adds an external identifier to the bundle. * * @param externalId the identifier to add, not null */
Adds an external identifier to the bundle
addExternalId
{ "repo_name": "McLeodMoores/starling", "path": "projects/core/src/main/java/com/opengamma/core/AbstractLink.java", "license": "apache-2.0", "size": 12631 }
[ "com.opengamma.id.ExternalId", "com.opengamma.util.ArgumentChecker" ]
import com.opengamma.id.ExternalId; import com.opengamma.util.ArgumentChecker;
import com.opengamma.id.*; import com.opengamma.util.*;
[ "com.opengamma.id", "com.opengamma.util" ]
com.opengamma.id; com.opengamma.util;
291,160
void disableRestartAllButton(AsyncCallback<Void> callback);
void disableRestartAllButton(AsyncCallback<Void> callback);
/** * API to disable the restart all button for current session. * * @return */
API to disable the restart all button for current session
disableRestartAllButton
{ "repo_name": "ungerik/ephesoft", "path": "Ephesoft_Community_Release_4.0.2.0/source/dcma-gwt/dcma-gwt-core/src/main/java/com/ephesoft/dcma/gwt/core/client/DCMARemoteServiceAsync.java", "license": "agpl-3.0", "size": 10548 }
[ "com.google.gwt.user.client.rpc.AsyncCallback" ]
import com.google.gwt.user.client.rpc.AsyncCallback;
import com.google.gwt.user.client.rpc.*;
[ "com.google.gwt" ]
com.google.gwt;
1,561,679
public UpdateRequest upsert(byte[] source, XContentType xContentType) { safeUpsertRequest().source(source, xContentType); return this; }
UpdateRequest function(byte[] source, XContentType xContentType) { safeUpsertRequest().source(source, xContentType); return this; }
/** * Sets the doc source of the update request to be used when the document does not exists. */
Sets the doc source of the update request to be used when the document does not exists
upsert
{ "repo_name": "strapdata/elassandra", "path": "server/src/main/java/org/elasticsearch/action/update/UpdateRequest.java", "license": "apache-2.0", "size": 36076 }
[ "org.elasticsearch.common.xcontent.XContentType" ]
import org.elasticsearch.common.xcontent.XContentType;
import org.elasticsearch.common.xcontent.*;
[ "org.elasticsearch.common" ]
org.elasticsearch.common;
2,346,579
public int[] diagonalDir2D(Coordinate c1, Coordinate c2) { return diagonalDir(c1, c2, 2, 0); }
int[] function(Coordinate c1, Coordinate c2) { return diagonalDir(c1, c2, 2, 0); }
/** * Convenience method. */
Convenience method
diagonalDir2D
{ "repo_name": "schildbach/de.schildbach.game", "path": "src/de/schildbach/game/common/ChessBoardLikeGeometry.java", "license": "agpl-3.0", "size": 10495 }
[ "de.schildbach.game.Coordinate" ]
import de.schildbach.game.Coordinate;
import de.schildbach.game.*;
[ "de.schildbach.game" ]
de.schildbach.game;
1,829,648
public static void sendDatabasePuntos(Context context) { String url = AppTrackAPI.url + "/open/sdk/point/addmulti" + AppTrackAPI.queryParams; PointList pointList = new PointList(); String json = "{ \"puntos\": [ "; Cursor cursor = context.getContentResolver().query( PuntosContentProvider.CONTENT_URI, DatabasePuntos.PROJECTION_ALL_FIELDS, null, null, null); if(cursor!=null && cursor.getCount()>0){ if (cursor.moveToFirst() && cursor.getCount() > 1) { do { json = json + "{\"latitud\": \"" + cursor.getString(1) + "\", "; json = json + "\"longitud\": \"" + cursor.getString(0) + "\", "; // json = json + "\"fecha\": \"" + cursor.getString(2) + "\" },"; json = json + "\"fecha\": \"" + cursor.getString(2) + "\", "; json = json + "\"provider\": \"" + cursor.getString(3) + " \" },"; Point point = new Point(); point.setLatitude(Double.parseDouble(cursor.getString(1))); point.setLongitude(Double.parseDouble(cursor.getString(0))); point.setDate(cursor.getString(2)); point.setMode(cursor.getString(3)); pointList.addPoints(point); } while (cursor.moveToNext()); json = json.substring(0, json.length()-1); json = json + "] }"; Log.e("json sendDatabasePuntos", json); String result = Utils.callPOSTService(json, url); Log.e("result sendDatabasePuntos", result); int numero; if (!result.equalsIgnoreCase("")){ numero = Integer.parseInt(result); } else{ numero = -1; } if (numero != -1) { Iterator<Point> itr = pointList.getPoints().iterator(); while(numero > 0) { Point punto = itr.next(); context.getContentResolver().delete(PuntosContentProvider.CONTENT_URI, "fecha='" + punto.getDate() + "'", null); numero--; } } cursor.close(); } } }
static void function(Context context) { String url = AppTrackAPI.url + STR + AppTrackAPI.queryParams; PointList pointList = new PointList(); String json = STRpuntos\STR; Cursor cursor = context.getContentResolver().query( PuntosContentProvider.CONTENT_URI, DatabasePuntos.PROJECTION_ALL_FIELDS, null, null, null); if(cursor!=null && cursor.getCount()>0){ if (cursor.moveToFirst() && cursor.getCount() > 1) { do { json = json + "{\"latitud\STRSTR\STR; json = json + "\"longitud\STRSTR\STR; json = json + "\"fecha\STRSTR\STR; json = json + "\"provider\STRSTR \STR; Point point = new Point(); point.setLatitude(Double.parseDouble(cursor.getString(1))); point.setLongitude(Double.parseDouble(cursor.getString(0))); point.setDate(cursor.getString(2)); point.setMode(cursor.getString(3)); pointList.addPoints(point); } while (cursor.moveToNext()); json = json.substring(0, json.length()-1); json = json + STR; Log.e(STR, json); String result = Utils.callPOSTService(json, url); Log.e(STR, result); int numero; if (!result.equalsIgnoreCase(STRfecha='STR'", null); numero--; } } cursor.close(); } } }
/** * Metodo que vuelca todos los puntos almacenados localmente a la base de datos del servidor * * @param context Contexto de la aplicacion */
Metodo que vuelca todos los puntos almacenados localmente a la base de datos del servidor
sendDatabasePuntos
{ "repo_name": "cictourgune/apptrack-sdk-android", "path": "AppTrack/src/org/tourgune/apptrack/utils/Utils.java", "license": "apache-2.0", "size": 12662 }
[ "android.content.Context", "android.database.Cursor", "android.util.Log", "org.tourgune.apptrack.DatabasePuntos", "org.tourgune.apptrack.PuntosContentProvider", "org.tourgune.apptrack.api.AppTrackAPI", "org.tourgune.apptrack.bean.Point", "org.tourgune.apptrack.bean.PointList" ]
import android.content.Context; import android.database.Cursor; import android.util.Log; import org.tourgune.apptrack.DatabasePuntos; import org.tourgune.apptrack.PuntosContentProvider; import org.tourgune.apptrack.api.AppTrackAPI; import org.tourgune.apptrack.bean.Point; import org.tourgune.apptrack.bean.PointList;
import android.content.*; import android.database.*; import android.util.*; import org.tourgune.apptrack.*; import org.tourgune.apptrack.api.*; import org.tourgune.apptrack.bean.*;
[ "android.content", "android.database", "android.util", "org.tourgune.apptrack" ]
android.content; android.database; android.util; org.tourgune.apptrack;
1,337,404
Observable<AutoApprovedPrivateLinkService> listAutoApprovedPrivateLinkServicesAsync(final String location);
Observable<AutoApprovedPrivateLinkService> listAutoApprovedPrivateLinkServicesAsync(final String location);
/** * Returns all of the private link service ids that can be linked to a Private Endpoint with auto approved in this subscription in this region. * * @param location The location of the domain name. * @throws IllegalArgumentException thrown if parameters fail the validation * @return the observable for the request */
Returns all of the private link service ids that can be linked to a Private Endpoint with auto approved in this subscription in this region
listAutoApprovedPrivateLinkServicesAsync
{ "repo_name": "selvasingh/azure-sdk-for-java", "path": "sdk/network/mgmt-v2019_09_01/src/main/java/com/microsoft/azure/management/network/v2019_09_01/PrivateLinkServices.java", "license": "mit", "size": 5131 }
[ "com.microsoft.azure.management.network.v2019_09_01.AutoApprovedPrivateLinkService" ]
import com.microsoft.azure.management.network.v2019_09_01.AutoApprovedPrivateLinkService;
import com.microsoft.azure.management.network.v2019_09_01.*;
[ "com.microsoft.azure" ]
com.microsoft.azure;
2,359,889
private void buildDocumentsPane() { if (role.isAdmin() || role.isDocuments()) { ContentPanel cp = new ContentPanel(); cp.setAnimCollapse(true); cp.setHeading(M.menu.documentsPanel()); cp.setIcon(AbstractImagePrototype.create(Images.menu .documentsPanel())); cp.setLayout(new FitLayout()); VerticalPanel documentspanel = new VerticalPanel(); Set<String> items = StructureFactory .getMenuItemsFor(UserRole.ROLE_DOCUMENTS); for (String item : items) { String itemname = StructureFactory.getDescription(item) .getName() .getName(LocaleInfo.getCurrentLocale().getLocaleName()); documentspanel.add(getMenuItem(itemname, item, StructureFactory.getMenuIcon(item))); } cp.add(documentspanel); panel.add(cp); } }
void function() { if (role.isAdmin() role.isDocuments()) { ContentPanel cp = new ContentPanel(); cp.setAnimCollapse(true); cp.setHeading(M.menu.documentsPanel()); cp.setIcon(AbstractImagePrototype.create(Images.menu .documentsPanel())); cp.setLayout(new FitLayout()); VerticalPanel documentspanel = new VerticalPanel(); Set<String> items = StructureFactory .getMenuItemsFor(UserRole.ROLE_DOCUMENTS); for (String item : items) { String itemname = StructureFactory.getDescription(item) .getName() .getName(LocaleInfo.getCurrentLocale().getLocaleName()); documentspanel.add(getMenuItem(itemname, item, StructureFactory.getMenuIcon(item))); } cp.add(documentspanel); panel.add(cp); } }
/** * Builds the documents pane. */
Builds the documents pane
buildDocumentsPane
{ "repo_name": "alexript/balas", "path": "src/net/autosauler/ballance/client/gui/LeftMenu.java", "license": "apache-2.0", "size": 7645 }
[ "com.extjs.gxt.ui.client.widget.ContentPanel", "com.extjs.gxt.ui.client.widget.layout.FitLayout", "com.google.gwt.i18n.client.LocaleInfo", "com.google.gwt.user.client.ui.AbstractImagePrototype", "com.google.gwt.user.client.ui.VerticalPanel", "java.util.Set", "net.autosauler.ballance.client.databases.StructureFactory", "net.autosauler.ballance.client.gui.images.Images", "net.autosauler.ballance.shared.UserRole" ]
import com.extjs.gxt.ui.client.widget.ContentPanel; import com.extjs.gxt.ui.client.widget.layout.FitLayout; import com.google.gwt.i18n.client.LocaleInfo; import com.google.gwt.user.client.ui.AbstractImagePrototype; import com.google.gwt.user.client.ui.VerticalPanel; import java.util.Set; import net.autosauler.ballance.client.databases.StructureFactory; import net.autosauler.ballance.client.gui.images.Images; import net.autosauler.ballance.shared.UserRole;
import com.extjs.gxt.ui.client.widget.*; import com.extjs.gxt.ui.client.widget.layout.*; import com.google.gwt.i18n.client.*; import com.google.gwt.user.client.ui.*; import java.util.*; import net.autosauler.ballance.client.databases.*; import net.autosauler.ballance.client.gui.images.*; import net.autosauler.ballance.shared.*;
[ "com.extjs.gxt", "com.google.gwt", "java.util", "net.autosauler.ballance" ]
com.extjs.gxt; com.google.gwt; java.util; net.autosauler.ballance;
2,560,085
protected void doImportTable(String schemaName, String tableName, String fileName, String colDel, String charDel , String codeset, int replace) throws SQLException { String impsql = "call SYSCS_UTIL.IMPORT_TABLE (?, ?, ?, ?, ?, ?, ?)"; PreparedStatement ps = prepareStatement(impsql); ps.setString(1 , schemaName); ps.setString(2, tableName); ps.setString(3, fileName); ps.setString(4 , colDel); ps.setString(5 , charDel); ps.setString(6 , codeset); ps.setInt(7, replace); ps.execute(); ps.close(); }
void function(String schemaName, String tableName, String fileName, String colDel, String charDel , String codeset, int replace) throws SQLException { String impsql = STR; PreparedStatement ps = prepareStatement(impsql); ps.setString(1 , schemaName); ps.setString(2, tableName); ps.setString(3, fileName); ps.setString(4 , colDel); ps.setString(5 , charDel); ps.setString(6 , codeset); ps.setInt(7, replace); ps.execute(); ps.close(); }
/** * Perform import using SYSCS_UTIL.IMPORT_TABLE procedure. */
Perform import using SYSCS_UTIL.IMPORT_TABLE procedure
doImportTable
{ "repo_name": "papicella/snappy-store", "path": "gemfirexd/tools/src/testing/java/org/apache/derbyTesting/functionTests/tests/tools/ImportExportBaseTest.java", "license": "apache-2.0", "size": 9293 }
[ "java.sql.PreparedStatement", "java.sql.SQLException" ]
import java.sql.PreparedStatement; import java.sql.SQLException;
import java.sql.*;
[ "java.sql" ]
java.sql;
2,362,773
protected void writeCommonAttributes(TagWriter tagWriter) throws JspException { }
void function(TagWriter tagWriter) throws JspException { }
/** * Writes default attributes configured to the supplied {@link TagWriter}. */
Writes default attributes configured to the supplied <code>TagWriter</code>
writeCommonAttributes
{ "repo_name": "mattxia/spring-2.5-analysis", "path": "src/org/springframework/web/servlet/tags/form/OptionWriter.java", "license": "apache-2.0", "size": 9538 }
[ "javax.servlet.jsp.JspException" ]
import javax.servlet.jsp.JspException;
import javax.servlet.jsp.*;
[ "javax.servlet" ]
javax.servlet;
891,187
static private Iterator<Object[]> filterParameters(Iterator<Object[]> parameters, List<Integer> list) { if (list.isEmpty()) { return parameters; } else { List<Object[]> result = Lists.newArrayList(); int i = 0; while (parameters.hasNext()) { Object[] next = parameters.next(); if (list.contains(i)) { result.add(next); } i++; } return new ArrayIterator(result.toArray(new Object[list.size()][])); } }
static Iterator<Object[]> function(Iterator<Object[]> parameters, List<Integer> list) { if (list.isEmpty()) { return parameters; } else { List<Object[]> result = Lists.newArrayList(); int i = 0; while (parameters.hasNext()) { Object[] next = parameters.next(); if (list.contains(i)) { result.add(next); } i++; } return new ArrayIterator(result.toArray(new Object[list.size()][])); } }
/** * If numbers is empty, return parameters, otherwise, return a subset of parameters * whose ordinal number match these found in numbers. */
If numbers is empty, return parameters, otherwise, return a subset of parameters whose ordinal number match these found in numbers
filterParameters
{ "repo_name": "JeshRJ/myRepRJ", "path": "src/main/java/org/testng/internal/Parameters.java", "license": "apache-2.0", "size": 18215 }
[ "java.util.Iterator", "java.util.List", "org.testng.collections.Lists" ]
import java.util.Iterator; import java.util.List; import org.testng.collections.Lists;
import java.util.*; import org.testng.collections.*;
[ "java.util", "org.testng.collections" ]
java.util; org.testng.collections;
2,276,611
public void setLifecycleInjector(JpaEntityLifecycleInjector lifecycleInjector) { this.lifecycleInjector = lifecycleInjector; }
void function(JpaEntityLifecycleInjector lifecycleInjector) { this.lifecycleInjector = lifecycleInjector; }
/** * If the {@link #setLifecycleInjector(org.compass.gps.device.jpa.lifecycle.JpaEntityLifecycleInjector)} is * set to <code>true</code>, the global lifecycle injector that will be used to inject global lifecycle * event listerens to the underlying implementation of the <code>EntityManagerFactory</code>. If not set, * the {@link org.compass.gps.device.jpa.entities.JpaEntitiesLocatorDetector} will be used to auto-detect it. */
If the <code>#setLifecycleInjector(org.compass.gps.device.jpa.lifecycle.JpaEntityLifecycleInjector)</code> is set to <code>true</code>, the global lifecycle injector that will be used to inject global lifecycle event listerens to the underlying implementation of the <code>EntityManagerFactory</code>. If not set, the <code>org.compass.gps.device.jpa.entities.JpaEntitiesLocatorDetector</code> will be used to auto-detect it
setLifecycleInjector
{ "repo_name": "unkascrack/compass-fork", "path": "compass-gps/src/main/java/org/compass/gps/device/jpa/JpaGpsDevice.java", "license": "apache-2.0", "size": 19301 }
[ "org.compass.gps.device.jpa.lifecycle.JpaEntityLifecycleInjector" ]
import org.compass.gps.device.jpa.lifecycle.JpaEntityLifecycleInjector;
import org.compass.gps.device.jpa.lifecycle.*;
[ "org.compass.gps" ]
org.compass.gps;
2,653,486
private String getLocalizedMessage(final Locale locale) { final String pattern = getMessagePattern(locale, this.code); if ((this.code == null) || KuraErrorCode.INTERNAL_ERROR.equals(this.code)) { if ((this.arguments != null) && (this.arguments.length > 1)) { // append all arguments into a single one final StringBuilder sbAllArgs = new StringBuilder(); for (final Object arg : this.arguments) { sbAllArgs.append(" - "); sbAllArgs.append(arg); } this.arguments = new Object[] { sbAllArgs.toString() }; } } return MessageFormat.format(pattern, this.arguments); }
String function(final Locale locale) { final String pattern = getMessagePattern(locale, this.code); if ((this.code == null) KuraErrorCode.INTERNAL_ERROR.equals(this.code)) { if ((this.arguments != null) && (this.arguments.length > 1)) { final StringBuilder sbAllArgs = new StringBuilder(); for (final Object arg : this.arguments) { sbAllArgs.append(STR); sbAllArgs.append(arg); } this.arguments = new Object[] { sbAllArgs.toString() }; } } return MessageFormat.format(pattern, this.arguments); }
/** * Gets the localized message. * * @param locale * the locale * @return the localized message */
Gets the localized message
getLocalizedMessage
{ "repo_name": "rohitdubey12/kura", "path": "kura/org.eclipse.kura.api/src/main/java/org/eclipse/kura/KuraException.java", "license": "epl-1.0", "size": 8518 }
[ "java.text.MessageFormat", "java.util.Locale" ]
import java.text.MessageFormat; import java.util.Locale;
import java.text.*; import java.util.*;
[ "java.text", "java.util" ]
java.text; java.util;
2,073,441
private void authenticate(final Authenticated authenticated) { final JsonArray online = this.server.storage().build() .getJsonArray("authenticated"); final JsonArrayBuilder users = Json.createArrayBuilder(); for(final JsonValue user: online) { users.add(user); } users.add(Json.createObjectBuilder().add( this.username, authenticated.json()) ); this.server.storage().add("authenticated", users.build()); }
void function(final Authenticated authenticated) { final JsonArray online = this.server.storage().build() .getJsonArray(STR); final JsonArrayBuilder users = Json.createArrayBuilder(); for(final JsonValue user: online) { users.add(user); } users.add(Json.createObjectBuilder().add( this.username, authenticated.json()) ); this.server.storage().add(STR, users.build()); }
/** * Add authenticated user to the MkServer. * @param authenticated The user to authenticate. */
Add authenticated user to the MkServer
authenticate
{ "repo_name": "decorators-squad/versioneye-api", "path": "src/main/java/com/amihaiemil/versioneye/MkVersionEye.java", "license": "bsd-3-clause", "size": 4422 }
[ "javax.json.Json", "javax.json.JsonArray", "javax.json.JsonArrayBuilder", "javax.json.JsonValue" ]
import javax.json.Json; import javax.json.JsonArray; import javax.json.JsonArrayBuilder; import javax.json.JsonValue;
import javax.json.*;
[ "javax.json" ]
javax.json;
337,310
public List<Person> getChildren() { final List<Person> children = new ArrayList<>(); for (final FamilyNavigator nav : familySNavigators) { children.addAll(nav.getChildren()); } return children; }
List<Person> function() { final List<Person> children = new ArrayList<>(); for (final FamilyNavigator nav : familySNavigators) { children.addAll(nav.getChildren()); } return children; }
/** * Get the list of all of children of this person. * * @return the list of children */
Get the list of all of children of this person
getChildren
{ "repo_name": "dickschoeller/gedbrowser", "path": "gedbrowser-datamodel/src/main/java/org/schoellerfamily/gedbrowser/datamodel/visitor/PersonVisitor.java", "license": "apache-2.0", "size": 5668 }
[ "java.util.ArrayList", "java.util.List", "org.schoellerfamily.gedbrowser.datamodel.Person", "org.schoellerfamily.gedbrowser.datamodel.navigator.FamilyNavigator" ]
import java.util.ArrayList; import java.util.List; import org.schoellerfamily.gedbrowser.datamodel.Person; import org.schoellerfamily.gedbrowser.datamodel.navigator.FamilyNavigator;
import java.util.*; import org.schoellerfamily.gedbrowser.datamodel.*; import org.schoellerfamily.gedbrowser.datamodel.navigator.*;
[ "java.util", "org.schoellerfamily.gedbrowser" ]
java.util; org.schoellerfamily.gedbrowser;
2,636,175
public static IgniteUuid bytesToIgniteUuid(byte[] in, int off) { long most = bytesToLong(in, off); long least = bytesToLong(in, off + 8); long locId = bytesToLong(in, off + 16); return new IgniteUuid(IgniteUuidCache.onIgniteUuidRead(new UUID(most, least)), locId); }
static IgniteUuid function(byte[] in, int off) { long most = bytesToLong(in, off); long least = bytesToLong(in, off + 8); long locId = bytesToLong(in, off + 16); return new IgniteUuid(IgniteUuidCache.onIgniteUuidRead(new UUID(most, least)), locId); }
/** * Converts bytes to {@link IgniteUuid}. * * @param in Input byte array. * @param off Offset from which start reading. * @return {@link IgniteUuid} instance. */
Converts bytes to <code>IgniteUuid</code>
bytesToIgniteUuid
{ "repo_name": "ascherbakoff/ignite", "path": "modules/core/src/main/java/org/apache/ignite/internal/util/IgniteUtils.java", "license": "apache-2.0", "size": 385578 }
[ "org.apache.ignite.lang.IgniteUuid" ]
import org.apache.ignite.lang.IgniteUuid;
import org.apache.ignite.lang.*;
[ "org.apache.ignite" ]
org.apache.ignite;
2,273,593
public ManagedClusterApiServerAccessProfile withAuthorizedIpRanges(List<String> authorizedIpRanges) { this.authorizedIpRanges = authorizedIpRanges; return this; }
ManagedClusterApiServerAccessProfile function(List<String> authorizedIpRanges) { this.authorizedIpRanges = authorizedIpRanges; return this; }
/** * Set the authorizedIpRanges property: Authorized IP Ranges to kubernetes API server. * * @param authorizedIpRanges the authorizedIpRanges value to set. * @return the ManagedClusterApiServerAccessProfile object itself. */
Set the authorizedIpRanges property: Authorized IP Ranges to kubernetes API server
withAuthorizedIpRanges
{ "repo_name": "Azure/azure-sdk-for-java", "path": "sdk/resourcemanagerhybrid/azure-resourcemanager-containerservice/src/main/java/com/azure/resourcemanager/containerservice/models/ManagedClusterApiServerAccessProfile.java", "license": "mit", "size": 3382 }
[ "java.util.List" ]
import java.util.List;
import java.util.*;
[ "java.util" ]
java.util;
1,910,046
public Object peek(int n) throws EmptyStackException { int m = (size() - n) - 1; if (m < 0) { throw new EmptyStackException(); } else { return get(m); } }
Object function(int n) throws EmptyStackException { int m = (size() - n) - 1; if (m < 0) { throw new EmptyStackException(); } else { return get(m); } }
/** * Returns the n'th item down (zero-relative) from the top of this * stack without removing it. * * @param n the number of items down to go * @return the n'th item on the stack, zero relative * @throws EmptyStackException if there are not enough items on the * stack to satisfy this request */
Returns the n'th item down (zero-relative) from the top of this stack without removing it
peek
{ "repo_name": "plumer/codana", "path": "tomcat_files/6.0.0/ArrayStack.java", "license": "mit", "size": 5519 }
[ "java.util.EmptyStackException" ]
import java.util.EmptyStackException;
import java.util.*;
[ "java.util" ]
java.util;
205,935
public int getMetaFromState(IBlockState state) { return ((Integer)state.getValue(POWER)).intValue(); }
int function(IBlockState state) { return ((Integer)state.getValue(POWER)).intValue(); }
/** * Convert the BlockState into the correct metadata value */
Convert the BlockState into the correct metadata value
getMetaFromState
{ "repo_name": "TorchPowered/CraftBloom", "path": "src/net/minecraft/block/BlockPressurePlateWeighted.java", "license": "mit", "size": 2560 }
[ "net.minecraft.block.state.IBlockState" ]
import net.minecraft.block.state.IBlockState;
import net.minecraft.block.state.*;
[ "net.minecraft.block" ]
net.minecraft.block;
767,647
@Test(expected = AssertionFailedError.class) public void testAssertReflectionEquals_notEqualsDifferentValues() { assertReflectionEquals(testObjectAString, testObjectDifferentValueString); }
@Test(expected = AssertionFailedError.class) void function() { assertReflectionEquals(testObjectAString, testObjectDifferentValueString); }
/** * Test for two objects that contain different values. */
Test for two objects that contain different values
testAssertReflectionEquals_notEqualsDifferentValues
{ "repo_name": "arteam/unitils", "path": "unitils-test/src/test/java/org/unitils/reflectionassert/ReflectionAssertTest.java", "license": "apache-2.0", "size": 8180 }
[ "junit.framework.AssertionFailedError", "org.junit.Test", "org.unitils.reflectionassert.ReflectionAssert" ]
import junit.framework.AssertionFailedError; import org.junit.Test; import org.unitils.reflectionassert.ReflectionAssert;
import junit.framework.*; import org.junit.*; import org.unitils.reflectionassert.*;
[ "junit.framework", "org.junit", "org.unitils.reflectionassert" ]
junit.framework; org.junit; org.unitils.reflectionassert;
1,847,395
String data; try { data = RequestBase.getPageContent(URL_BASE + "search?q=" + query + "&format=json"); } catch (IOException exception) { return null; } return jsonToLatLon(data); }
String data; try { data = RequestBase.getPageContent(URL_BASE + STR + query + STR); } catch (IOException exception) { return null; } return jsonToLatLon(data); }
/** * Request the latitude and longitude for the given query string. * * @param query The query to perform. * @return A string with the latitude and longitude separated by a * semicolon, an empty string if there have been errors. */
Request the latitude and longitude for the given query string
requestLatLonForQuery
{ "repo_name": "FriedrichFroebel/oc_car-gui", "path": "src/main/java/com/github/friedrichfroebel/occar/network/OpenstreetmapOrg.java", "license": "mit", "size": 1792 }
[ "java.io.IOException" ]
import java.io.IOException;
import java.io.*;
[ "java.io" ]
java.io;
3,121
public void setCollectLogs(boolean logData) { mLogData = logData; } class InstrumentationParser extends MultiLineReceiver { private DeqpTestRunner mDeqpTests; private Map<String, String> mValues; private String mCurrentName; private String mCurrentValue; public InstrumentationParser(DeqpTestRunner tests) { mDeqpTests = tests; } /** * {@inheritDoc}
void function(boolean logData) { mLogData = logData; } class InstrumentationParser extends MultiLineReceiver { private DeqpTestRunner mDeqpTests; private Map<String, String> mValues; private String mCurrentName; private String mCurrentValue; public InstrumentationParser(DeqpTestRunner tests) { mDeqpTests = tests; } /** * {@inheritDoc}
/** * Enable or disable raw dEQP test log collection. */
Enable or disable raw dEQP test log collection
setCollectLogs
{ "repo_name": "s20121035/rk3288_android5.1_repo", "path": "cts/tools/tradefed-host/src/com/android/cts/tradefed/testtype/DeqpTestRunner.java", "license": "gpl-3.0", "size": 18183 }
[ "com.android.ddmlib.MultiLineReceiver", "java.util.Map" ]
import com.android.ddmlib.MultiLineReceiver; import java.util.Map;
import com.android.ddmlib.*; import java.util.*;
[ "com.android.ddmlib", "java.util" ]
com.android.ddmlib; java.util;
1,246,073
@Override public Object visit(final ForStatement node) { try { final Set vars = (Set) node.getProperty(NodeProperties.VARIABLES); this.context.enterScope(vars); // Interpret the initialization expressions if (node.getInitialization() != null) { final Iterator it = node.getInitialization().iterator(); while (it.hasNext()) { ((Node) it.next()).acceptVisitor(this); } } // Interpret the loop try { final Expression cond = node.getCondition(); final List update = node.getUpdate(); while (cond == null || ((Boolean) cond.acceptVisitor(this)).booleanValue()) { try { node.getBody().acceptVisitor(this); } catch (final ContinueException e) { // 'continue' statement management if (e.isLabeled() && !node.hasLabel(e.getLabel())) { throw e; } } // Interpret the update statements if (update != null) { final Iterator it = update.iterator(); while (it.hasNext()) { ((Node) it.next()).acceptVisitor(this); } } } } catch (final BreakException e) { // 'break' statement management if (e.isLabeled() && !node.hasLabel(e.getLabel())) { throw e; } } } finally { // Always leave the current scope this.context.leaveScope(); } return null; }
Object function(final ForStatement node) { try { final Set vars = (Set) node.getProperty(NodeProperties.VARIABLES); this.context.enterScope(vars); if (node.getInitialization() != null) { final Iterator it = node.getInitialization().iterator(); while (it.hasNext()) { ((Node) it.next()).acceptVisitor(this); } } try { final Expression cond = node.getCondition(); final List update = node.getUpdate(); while (cond == null ((Boolean) cond.acceptVisitor(this)).booleanValue()) { try { node.getBody().acceptVisitor(this); } catch (final ContinueException e) { if (e.isLabeled() && !node.hasLabel(e.getLabel())) { throw e; } } if (update != null) { final Iterator it = update.iterator(); while (it.hasNext()) { ((Node) it.next()).acceptVisitor(this); } } } } catch (final BreakException e) { if (e.isLabeled() && !node.hasLabel(e.getLabel())) { throw e; } } } finally { this.context.leaveScope(); } return null; }
/** * Visits a ForStatement * * @param node the node to visit */
Visits a ForStatement
visit
{ "repo_name": "mbshopM/openconcerto", "path": "OpenConcerto/src/koala/dynamicjava/interpreter/EvaluationVisitor.java", "license": "gpl-3.0", "size": 61632 }
[ "java.util.Iterator", "java.util.List", "java.util.Set" ]
import java.util.Iterator; import java.util.List; import java.util.Set;
import java.util.*;
[ "java.util" ]
java.util;
1,747,314
@Test public void testAutoRange2() { DefaultCategoryDataset dataset = new DefaultCategoryDataset(); dataset.setValue(100.0, "Row 1", "Column 1"); dataset.setValue(200.0, "Row 1", "Column 2"); JFreeChart chart = ChartFactory.createLineChart("Test", "Categories", "Value", dataset, PlotOrientation.VERTICAL, false, false, false); CategoryPlot plot = (CategoryPlot) chart.getPlot(); NumberAxis axis = (NumberAxis) plot.getRangeAxis(); axis.setAutoRangeIncludesZero(false); assertEquals(axis.getLowerBound(), 95.0, EPSILON); assertEquals(axis.getUpperBound(), 205.0, EPSILON); }
void function() { DefaultCategoryDataset dataset = new DefaultCategoryDataset(); dataset.setValue(100.0, STR, STR); dataset.setValue(200.0, STR, STR); JFreeChart chart = ChartFactory.createLineChart("Test", STR, "Value", dataset, PlotOrientation.VERTICAL, false, false, false); CategoryPlot plot = (CategoryPlot) chart.getPlot(); NumberAxis axis = (NumberAxis) plot.getRangeAxis(); axis.setAutoRangeIncludesZero(false); assertEquals(axis.getLowerBound(), 95.0, EPSILON); assertEquals(axis.getUpperBound(), 205.0, EPSILON); }
/** * A simple test for the auto-range calculation looking at a * NumberAxis used as the range axis for a CategoryPlot. In this * case, the 'autoRangeIncludesZero' flag is set to false. */
A simple test for the auto-range calculation looking at a NumberAxis used as the range axis for a CategoryPlot. In this case, the 'autoRangeIncludesZero' flag is set to false
testAutoRange2
{ "repo_name": "raincs13/phd", "path": "tests/org/jfree/chart/axis/NumberAxisTest.java", "license": "lgpl-2.1", "size": 15277 }
[ "org.jfree.chart.ChartFactory", "org.jfree.chart.JFreeChart", "org.jfree.chart.plot.CategoryPlot", "org.jfree.chart.plot.PlotOrientation", "org.jfree.data.category.DefaultCategoryDataset", "org.junit.Assert", "org.junit.Test" ]
import org.jfree.chart.ChartFactory; import org.jfree.chart.JFreeChart; import org.jfree.chart.plot.CategoryPlot; import org.jfree.chart.plot.PlotOrientation; import org.jfree.data.category.DefaultCategoryDataset; import org.junit.Assert; import org.junit.Test;
import org.jfree.chart.*; import org.jfree.chart.plot.*; import org.jfree.data.category.*; import org.junit.*;
[ "org.jfree.chart", "org.jfree.data", "org.junit" ]
org.jfree.chart; org.jfree.data; org.junit;
2,032,214
private void addToQuadSpace(Shape shape) { int segments = quadSpace.length; for (int x=0;x<segments;x++) { for (int y=0;y<segments;y++) { if (collides(shape, quadSpaceShapes[x][y])) { quadSpace[x][y].add(shape); } } } }
void function(Shape shape) { int segments = quadSpace.length; for (int x=0;x<segments;x++) { for (int y=0;y<segments;y++) { if (collides(shape, quadSpaceShapes[x][y])) { quadSpace[x][y].add(shape); } } } }
/** * Add a particular shape to quad space * * @param shape The shape to be added */
Add a particular shape to quad space
addToQuadSpace
{ "repo_name": "dbank-so/fadableUnicodeFont", "path": "src/org/newdawn/slick/tests/GeomUtilTileTest.java", "license": "bsd-3-clause", "size": 11328 }
[ "org.newdawn.slick.geom.Shape" ]
import org.newdawn.slick.geom.Shape;
import org.newdawn.slick.geom.*;
[ "org.newdawn.slick" ]
org.newdawn.slick;
1,161,903
protected void addBaseTableSchemaNamePropertyDescriptor(Object object) { itemPropertyDescriptors.add (createItemPropertyDescriptor (((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(), getResourceLocator(), getString("_UI_DropAllForeignKeyConstraintsType_baseTableSchemaName_feature"), getString("_UI_PropertyDescriptor_description", "_UI_DropAllForeignKeyConstraintsType_baseTableSchemaName_feature", "_UI_DropAllForeignKeyConstraintsType_type"), DbchangelogPackage.eINSTANCE.getDropAllForeignKeyConstraintsType_BaseTableSchemaName(), true, false, false, ItemPropertyDescriptor.GENERIC_VALUE_IMAGE, null, null)); }
void function(Object object) { itemPropertyDescriptors.add (createItemPropertyDescriptor (((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(), getResourceLocator(), getString(STR), getString(STR, STR, STR), DbchangelogPackage.eINSTANCE.getDropAllForeignKeyConstraintsType_BaseTableSchemaName(), true, false, false, ItemPropertyDescriptor.GENERIC_VALUE_IMAGE, null, null)); }
/** * This adds a property descriptor for the Base Table Schema Name feature. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */
This adds a property descriptor for the Base Table Schema Name feature.
addBaseTableSchemaNamePropertyDescriptor
{ "repo_name": "dzonekl/LiquibaseEditor", "path": "plugins/org.liquidbase.model.edit/src/org/liquibase/xml/ns/dbchangelog/provider/DropAllForeignKeyConstraintsTypeItemProvider.java", "license": "mit", "size": 7024 }
[ "org.eclipse.emf.edit.provider.ComposeableAdapterFactory", "org.eclipse.emf.edit.provider.ItemPropertyDescriptor", "org.liquibase.xml.ns.dbchangelog.DbchangelogPackage" ]
import org.eclipse.emf.edit.provider.ComposeableAdapterFactory; import org.eclipse.emf.edit.provider.ItemPropertyDescriptor; import org.liquibase.xml.ns.dbchangelog.DbchangelogPackage;
import org.eclipse.emf.edit.provider.*; import org.liquibase.xml.ns.dbchangelog.*;
[ "org.eclipse.emf", "org.liquibase.xml" ]
org.eclipse.emf; org.liquibase.xml;
196,943
void onEntered(ActiveEntity entity, StendhalRPZone zone, int newX, int newY);
void onEntered(ActiveEntity entity, StendhalRPZone zone, int newX, int newY);
/** * Invoked when an entity enters the object area. * * @param entity * The entity that moved. * @param zone * The new zone. * @param newX * The new X coordinate. * @param newY * The new Y coordinate. */
Invoked when an entity enters the object area
onEntered
{ "repo_name": "AntumDeluge/arianne-stendhal", "path": "src/games/stendhal/server/core/events/MovementListener.java", "license": "gpl-2.0", "size": 3072 }
[ "games.stendhal.server.core.engine.StendhalRPZone", "games.stendhal.server.entity.ActiveEntity" ]
import games.stendhal.server.core.engine.StendhalRPZone; import games.stendhal.server.entity.ActiveEntity;
import games.stendhal.server.core.engine.*; import games.stendhal.server.entity.*;
[ "games.stendhal.server" ]
games.stendhal.server;
2,513,063
public ParameterBlock set(Object obj, String paramName) { setParameter0(paramName, obj); return this; } // [De]serialization methods.
ParameterBlock function(Object obj, String paramName) { setParameter0(paramName, obj); return this; }
/** * Sets a named parameter to an Object value. * * @param paramName a <code>String</code> naming a parameter. * @param obj an Object value for the parameter. * * @throws IllegalArgumentException if obj is null, or if the class * type of obj does not match the class type of parameter * pointed to by the paramName. * @throws IllegalArgumentException if paramName is null. * @throws IllegalArgumentException if there is no parameter with the * specified name. * * @deprecated as of JAI 1.1 - use <code>setParameter</code> instead. * * @see #setParameter(String, Object) */
Sets a named parameter to an Object value
set
{ "repo_name": "RoProducts/rastertheque", "path": "JAILibrary/src/javax/media/jai/ParameterBlockJAI.java", "license": "gpl-2.0", "size": 43925 }
[ "java.awt.image.renderable.ParameterBlock" ]
import java.awt.image.renderable.ParameterBlock;
import java.awt.image.renderable.*;
[ "java.awt" ]
java.awt;
493,733
public Tuple getNext() throws IOException { if (!verifyStream()) { return null; } Pattern pattern = getPattern(); Matcher matcher = pattern.matcher(""); Object lineObj; String line; Tuple t = null; // Read lines until a match is found, making sure there's no reading past the // end of the assigned byte range. try { while (is_.nextKeyValue()) { lineObj = is_.getCurrentValue(); if (lineObj == null) { break; } line = lineObj.toString(); matcher = matcher.reset(line); // Increment counters for the number of matched and unmatched lines. if (matcher.find()) { incrCounter(LzoBaseRegexLoaderCounters.MatchedRegexLines, 1L); t = tupleFactory_.newTuple(matcher.groupCount()); for (int i = 1; i <= matcher.groupCount(); i++) { if(matcher.group(i) != null) { t.set(i - 1, matcher.group(i)); } else { t.set(i - 1, ""); } } break; } else { incrCounter(LzoBaseRegexLoaderCounters.UnmatchedRegexLines, 1L); // TODO: stop doing this, as it can slow down the job. LOG.debug("No match for line " + line); } // If the read has walked beyond the end of the split, move on. } } catch (InterruptedException e) { int errCode = 6018; String errMsg = "Error while reading input"; throw new ExecException(errMsg, errCode, PigException.REMOTE_ENVIRONMENT, e); } return t; }
Tuple function() throws IOException { if (!verifyStream()) { return null; } Pattern pattern = getPattern(); Matcher matcher = pattern.matcher(STRSTRNo match for line STRError while reading input"; throw new ExecException(errMsg, errCode, PigException.REMOTE_ENVIRONMENT, e); } return t; }
/** * Read the file line by line, returning lines the match the regex in Tuples * based on the regex match groups. */
Read the file line by line, returning lines the match the regex in Tuples based on the regex match groups
getNext
{ "repo_name": "hirohanin/elephant-birdpig7hadoop21", "path": "src/java/com/twitter/elephantbird/pig/load/LzoBaseRegexLoader.java", "license": "apache-2.0", "size": 3960 }
[ "java.io.IOException", "java.util.regex.Matcher", "java.util.regex.Pattern", "org.apache.pig.PigException", "org.apache.pig.backend.executionengine.ExecException", "org.apache.pig.data.Tuple" ]
import java.io.IOException; import java.util.regex.Matcher; import java.util.regex.Pattern; import org.apache.pig.PigException; import org.apache.pig.backend.executionengine.ExecException; import org.apache.pig.data.Tuple;
import java.io.*; import java.util.regex.*; import org.apache.pig.*; import org.apache.pig.backend.executionengine.*; import org.apache.pig.data.*;
[ "java.io", "java.util", "org.apache.pig" ]
java.io; java.util; org.apache.pig;
1,344,929
public Cancellable mountSnapshotAsync( final MountSnapshotRequest request, final RequestOptions options, final ActionListener<RestoreSnapshotResponse> listener) { return restHighLevelClient.performRequestAsyncAndParseEntity( request, SearchableSnapshotsRequestConverters::mountSnapshot, options, RestoreSnapshotResponse::fromXContent, listener, Collections.emptySet() ); }
Cancellable function( final MountSnapshotRequest request, final RequestOptions options, final ActionListener<RestoreSnapshotResponse> listener) { return restHighLevelClient.performRequestAsyncAndParseEntity( request, SearchableSnapshotsRequestConverters::mountSnapshot, options, RestoreSnapshotResponse::fromXContent, listener, Collections.emptySet() ); }
/** * Asynchronously executes the mount snapshot API, which mounts a snapshot as a searchable snapshot. * * @param request the request * @param options the request options * @param listener the listener to be notified upon request completion * @return cancellable that may be used to cancel the request */
Asynchronously executes the mount snapshot API, which mounts a snapshot as a searchable snapshot
mountSnapshotAsync
{ "repo_name": "robin13/elasticsearch", "path": "client/rest-high-level/src/main/java/org/elasticsearch/client/SearchableSnapshotsClient.java", "license": "apache-2.0", "size": 4926 }
[ "java.util.Collections", "org.elasticsearch.action.ActionListener", "org.elasticsearch.action.admin.cluster.snapshots.restore.RestoreSnapshotResponse", "org.elasticsearch.client.searchable_snapshots.MountSnapshotRequest" ]
import java.util.Collections; import org.elasticsearch.action.ActionListener; import org.elasticsearch.action.admin.cluster.snapshots.restore.RestoreSnapshotResponse; import org.elasticsearch.client.searchable_snapshots.MountSnapshotRequest;
import java.util.*; import org.elasticsearch.action.*; import org.elasticsearch.action.admin.cluster.snapshots.restore.*; import org.elasticsearch.client.searchable_snapshots.*;
[ "java.util", "org.elasticsearch.action", "org.elasticsearch.client" ]
java.util; org.elasticsearch.action; org.elasticsearch.client;
2,709,641
@ReactMethod public void findSubviewIn( final int reactTag, final ReadableArray point, final Callback callback) { mUIImplementation.findSubviewIn( reactTag, Math.round(PixelUtil.toPixelFromDIP(point.getDouble(0))), Math.round(PixelUtil.toPixelFromDIP(point.getDouble(1))), callback); }
void function( final int reactTag, final ReadableArray point, final Callback callback) { mUIImplementation.findSubviewIn( reactTag, Math.round(PixelUtil.toPixelFromDIP(point.getDouble(0))), Math.round(PixelUtil.toPixelFromDIP(point.getDouble(1))), callback); }
/** * Find the touch target child native view in the supplied root view hierarchy, given a react * target location. * * This method is currently used only by Element Inspector DevTool. * * @param reactTag the tag of the root view to traverse * @param point an array containing both X and Y target location * @param callback will be called if with the identified child view react ID, and measurement * info. If no view was found, callback will be invoked with no data. */
Find the touch target child native view in the supplied root view hierarchy, given a react target location. This method is currently used only by Element Inspector DevTool
findSubviewIn
{ "repo_name": "gunaangs/Feedonymous", "path": "node_modules/react-native/ReactAndroid/src/main/java/com/facebook/react/uimanager/UIManagerModule.java", "license": "mit", "size": 22505 }
[ "com.facebook.react.bridge.Callback", "com.facebook.react.bridge.ReadableArray" ]
import com.facebook.react.bridge.Callback; import com.facebook.react.bridge.ReadableArray;
import com.facebook.react.bridge.*;
[ "com.facebook.react" ]
com.facebook.react;
556,210
protected static CmsDirectEditParams getDirectEditProviderParams(PageContext context) { // get the current request ServletRequest req = context.getRequest(); // get the direct edit params from the request attributes CmsDirectEditParams result = (CmsDirectEditParams)req.getAttribute(I_CmsDirectEditProvider.ATTRIBUTE_DIRECT_EDIT_PROVIDER_PARAMS); if (result != null) { req.removeAttribute(I_CmsDirectEditProvider.ATTRIBUTE_DIRECT_EDIT_PROVIDER_PARAMS); } return result; }
static CmsDirectEditParams function(PageContext context) { ServletRequest req = context.getRequest(); CmsDirectEditParams result = (CmsDirectEditParams)req.getAttribute(I_CmsDirectEditProvider.ATTRIBUTE_DIRECT_EDIT_PROVIDER_PARAMS); if (result != null) { req.removeAttribute(I_CmsDirectEditProvider.ATTRIBUTE_DIRECT_EDIT_PROVIDER_PARAMS); } return result; }
/** * Returns the current initialized instance of the direct edit provider parameters from the given page context.<p> * * Also removes the parameters from the given page context.<p> * * @param context the current JSP page context * * @return the current initialized instance of the direct edit provider parameters */
Returns the current initialized instance of the direct edit provider parameters from the given page context. Also removes the parameters from the given page context
getDirectEditProviderParams
{ "repo_name": "it-tavis/opencms-core", "path": "src/org/opencms/jsp/CmsJspTagEditable.java", "license": "lgpl-2.1", "size": 21156 }
[ "javax.servlet.ServletRequest", "javax.servlet.jsp.PageContext", "org.opencms.workplace.editors.directedit.CmsDirectEditParams" ]
import javax.servlet.ServletRequest; import javax.servlet.jsp.PageContext; import org.opencms.workplace.editors.directedit.CmsDirectEditParams;
import javax.servlet.*; import javax.servlet.jsp.*; import org.opencms.workplace.editors.directedit.*;
[ "javax.servlet", "org.opencms.workplace" ]
javax.servlet; org.opencms.workplace;
1,398,477
private void patternFilter( PatternDescrBuilder< ? > pattern ) throws RecognitionException { // if ( input.LA( 1 ) == DRLLexer.PIPE ) { // while ( input.LA( 1 ) == DRLLexer.PIPE ) { // match( input, // DRLLexer.PIPE, // null, // null, // DroolsEditorType.SYMBOL ); // if ( state.failed ) return; // // filterDef( pattern ); // if ( state.failed ) return; // } // } else { match( input, DRLLexer.ID, DroolsSoftKeywords.OVER, null, DroolsEditorType.KEYWORD ); if ( state.failed ) return; filterDef( pattern ); if ( state.failed ) return; // } }
void function( PatternDescrBuilder< ? > pattern ) throws RecognitionException { match( input, DRLLexer.ID, DroolsSoftKeywords.OVER, null, DroolsEditorType.KEYWORD ); if ( state.failed ) return; filterDef( pattern ); if ( state.failed ) return; }
/** * patternFilter := OVER filterDef * DISALLOWED: | ( PIPE filterDef )+ * * @param pattern * @throws RecognitionException */
patternFilter := OVER filterDef
patternFilter
{ "repo_name": "mswiderski/drools", "path": "drools-compiler/src/main/java/org/drools/lang/DRLParser.java", "license": "apache-2.0", "size": 161879 }
[ "org.antlr.runtime.RecognitionException", "org.drools.lang.api.PatternDescrBuilder" ]
import org.antlr.runtime.RecognitionException; import org.drools.lang.api.PatternDescrBuilder;
import org.antlr.runtime.*; import org.drools.lang.api.*;
[ "org.antlr.runtime", "org.drools.lang" ]
org.antlr.runtime; org.drools.lang;
680,350
public static void showSavedXform(final Activity caller) { // This has to be at the start of anything that uses the ODK file system. Collect.getInstance().createODKDirs(); final String selection = InstanceProviderAPI.InstanceColumns.STATUS + " != ?"; final String[] selectionArgs = {InstanceProviderAPI.STATUS_SUBMITTED}; final String sortOrder = InstanceProviderAPI.InstanceColumns.STATUS + " DESC, " + InstanceProviderAPI.InstanceColumns.DISPLAY_NAME + " ASC"; final Uri instanceUri; final String instancePath; final String jrFormId; Cursor instanceCursor = null; try { instanceCursor = caller.getContentResolver().query( CONTENT_URI, new String[]{_ID, INSTANCE_FILE_PATH, JR_FORM_ID}, selection, selectionArgs, sortOrder); if (instanceCursor.getCount() == 0) { return; } instanceCursor.moveToFirst(); // The URI code mostly copied from InstanceChooserList.onListItemClicked() instanceUri = ContentUris.withAppendedId(CONTENT_URI, instanceCursor.getLong(instanceCursor.getColumnIndex(_ID))); instancePath = instanceCursor.getString(instanceCursor.getColumnIndex(INSTANCE_FILE_PATH)); jrFormId = instanceCursor.getString(instanceCursor.getColumnIndex(JR_FORM_ID)); } finally { if (instanceCursor != null) { instanceCursor.close(); } } // It looks like we need to load the form as well. Which is odd, because // the main menu doesn't seem to do this, but without the FormLoaderTask run // there is no form manager for the HierarchyActivity. FormLoaderTask loaderTask = new FormLoaderTask(instancePath, null, null); final String formPath; Cursor formCursor = null; try { formCursor = caller.getContentResolver().query( FormsProviderAPI.FormsColumns.CONTENT_URI, new String[]{FormsProviderAPI.FormsColumns.FORM_FILE_PATH}, FormsProviderAPI.FormsColumns.JR_FORM_ID + " = ?", new String[]{jrFormId}, null); if (formCursor.getCount() == 0) { LOG.e("Loading forms for displaying " + jrFormId + " and got no forms,"); return; } if (formCursor.getCount() != 1) { LOG.e("Loading forms for displaying instance, expected only 1. " + "Got multiple so using first."); } formCursor.moveToFirst(); formPath = formCursor.getString( formCursor.getColumnIndex(FormsProviderAPI.FormsColumns.FORM_FILE_PATH)); } finally { if (formCursor != null) { formCursor.close(); } }
static void function(final Activity caller) { Collect.getInstance().createODKDirs(); final String selection = InstanceProviderAPI.InstanceColumns.STATUS + STR; final String[] selectionArgs = {InstanceProviderAPI.STATUS_SUBMITTED}; final String sortOrder = InstanceProviderAPI.InstanceColumns.STATUS + STR + InstanceProviderAPI.InstanceColumns.DISPLAY_NAME + STR; final Uri instanceUri; final String instancePath; final String jrFormId; Cursor instanceCursor = null; try { instanceCursor = caller.getContentResolver().query( CONTENT_URI, new String[]{_ID, INSTANCE_FILE_PATH, JR_FORM_ID}, selection, selectionArgs, sortOrder); if (instanceCursor.getCount() == 0) { return; } instanceCursor.moveToFirst(); instanceUri = ContentUris.withAppendedId(CONTENT_URI, instanceCursor.getLong(instanceCursor.getColumnIndex(_ID))); instancePath = instanceCursor.getString(instanceCursor.getColumnIndex(INSTANCE_FILE_PATH)); jrFormId = instanceCursor.getString(instanceCursor.getColumnIndex(JR_FORM_ID)); } finally { if (instanceCursor != null) { instanceCursor.close(); } } FormLoaderTask loaderTask = new FormLoaderTask(instancePath, null, null); final String formPath; Cursor formCursor = null; try { formCursor = caller.getContentResolver().query( FormsProviderAPI.FormsColumns.CONTENT_URI, new String[]{FormsProviderAPI.FormsColumns.FORM_FILE_PATH}, FormsProviderAPI.FormsColumns.JR_FORM_ID + STR, new String[]{jrFormId}, null); if (formCursor.getCount() == 0) { LOG.e(STR + jrFormId + STR); return; } if (formCursor.getCount() != 1) { LOG.e(STR + STR); } formCursor.moveToFirst(); formPath = formCursor.getString( formCursor.getColumnIndex(FormsProviderAPI.FormsColumns.FORM_FILE_PATH)); } finally { if (formCursor != null) { formCursor.close(); } }
/** * Show the ODK activity for viewing a saved form. * * @param caller the calling activity. */
Show the ODK activity for viewing a saved form
showSavedXform
{ "repo_name": "jvanz/client", "path": "app/src/main/java/org/projectbuendia/client/ui/OdkActivityLauncher.java", "license": "apache-2.0", "size": 28100 }
[ "android.app.Activity", "android.content.ContentUris", "android.database.Cursor", "android.net.Uri", "org.odk.collect.android.application.Collect", "org.odk.collect.android.provider.FormsProviderAPI", "org.odk.collect.android.provider.InstanceProviderAPI", "org.odk.collect.android.tasks.FormLoaderTask" ]
import android.app.Activity; import android.content.ContentUris; import android.database.Cursor; import android.net.Uri; import org.odk.collect.android.application.Collect; import org.odk.collect.android.provider.FormsProviderAPI; import org.odk.collect.android.provider.InstanceProviderAPI; import org.odk.collect.android.tasks.FormLoaderTask;
import android.app.*; import android.content.*; import android.database.*; import android.net.*; import org.odk.collect.android.application.*; import org.odk.collect.android.provider.*; import org.odk.collect.android.tasks.*;
[ "android.app", "android.content", "android.database", "android.net", "org.odk.collect" ]
android.app; android.content; android.database; android.net; org.odk.collect;
328,276
public synchronized void enableEvents(int[] types) { assert types != null; ctx.security().authorize(null, SecurityPermission.EVENTS_ENABLE, null); boolean[] userRecordableEvts0 = userRecordableEvts; boolean[] recordableEvts0 = recordableEvts; int[] inclEvtTypes0 = inclEvtTypes; int[] userTypes = new int[types.length]; int userTypesLen = 0; for (int type : types) { if (type < len) { userRecordableEvts0[type] = true; recordableEvts0[type] = true; } else userTypes[userTypesLen++] = type; } if (userTypesLen > 0) { Arrays.sort(userTypes, 0, userTypesLen); userTypes = compact(userTypes, userTypesLen); inclEvtTypes0 = U.unique(inclEvtTypes0, inclEvtTypes0.length, userTypes, userTypesLen); } // Volatile write. // The below line is intentional to ensure a volatile write is // made to the array, since it is exist access via unsynchronized blocks. userRecordableEvts = userRecordableEvts0; recordableEvts = recordableEvts0; inclEvtTypes = inclEvtTypes0; }
synchronized void function(int[] types) { assert types != null; ctx.security().authorize(null, SecurityPermission.EVENTS_ENABLE, null); boolean[] userRecordableEvts0 = userRecordableEvts; boolean[] recordableEvts0 = recordableEvts; int[] inclEvtTypes0 = inclEvtTypes; int[] userTypes = new int[types.length]; int userTypesLen = 0; for (int type : types) { if (type < len) { userRecordableEvts0[type] = true; recordableEvts0[type] = true; } else userTypes[userTypesLen++] = type; } if (userTypesLen > 0) { Arrays.sort(userTypes, 0, userTypesLen); userTypes = compact(userTypes, userTypesLen); inclEvtTypes0 = U.unique(inclEvtTypes0, inclEvtTypes0.length, userTypes, userTypesLen); } userRecordableEvts = userRecordableEvts0; recordableEvts = recordableEvts0; inclEvtTypes = inclEvtTypes0; }
/** * Enables provided events. * * @param types Events to enable. */
Enables provided events
enableEvents
{ "repo_name": "nivanov/ignite", "path": "modules/core/src/main/java/org/apache/ignite/internal/managers/eventstorage/GridEventStorageManager.java", "license": "apache-2.0", "size": 44991 }
[ "java.util.Arrays", "org.apache.ignite.internal.util.typedef.internal.U", "org.apache.ignite.plugin.security.SecurityPermission" ]
import java.util.Arrays; import org.apache.ignite.internal.util.typedef.internal.U; import org.apache.ignite.plugin.security.SecurityPermission;
import java.util.*; import org.apache.ignite.internal.util.typedef.internal.*; import org.apache.ignite.plugin.security.*;
[ "java.util", "org.apache.ignite" ]
java.util; org.apache.ignite;
2,623,192
protected static ImageIcon lookupIcon(String name) { return ResourceLoaderWrapper.lookupIconResource(name); }
static ImageIcon function(String name) { return ResourceLoaderWrapper.lookupIconResource(name); }
/** * Look up an icon. * * @param name * the resource name. * @return an ImageIcon corresponding to the given resource name */
Look up an icon
lookupIcon
{ "repo_name": "ckaestne/LEADT", "path": "workspace/argouml_diagrams/argouml-app/src/org/argouml/uml/ui/PropPanel.java", "license": "gpl-3.0", "size": 25034 }
[ "javax.swing.ImageIcon", "org.argouml.application.helpers.ResourceLoaderWrapper" ]
import javax.swing.ImageIcon; import org.argouml.application.helpers.ResourceLoaderWrapper;
import javax.swing.*; import org.argouml.application.helpers.*;
[ "javax.swing", "org.argouml.application" ]
javax.swing; org.argouml.application;
1,440,562
void writeValue(ByteString encodedMessage, JsonGenerator gen) throws IOException { // getParserForTYpe for T returns Parser<T> @SuppressWarnings("unchecked") Parser<T> parser = (Parser<T>) prototype.getParserForType(); writeValue(parser.parseFrom(encodedMessage), gen); } /** * Serialize to JSON the message encoded in binary protobuf format in {@code encodedMessage}
void writeValue(ByteString encodedMessage, JsonGenerator gen) throws IOException { @SuppressWarnings(STR) Parser<T> parser = (Parser<T>) prototype.getParserForType(); writeValue(parser.parseFrom(encodedMessage), gen); } /** * Serialize to JSON the message encoded in binary protobuf format in {@code encodedMessage}
/** * Serialize to JSON the message encoded in binary protobuf format in {@code encodedMessage}. Used * to write the content of type wrappers in {@link com.google.protobuf.Any}. */
Serialize to JSON the message encoded in binary protobuf format in encodedMessage. Used to write the content of type wrappers in <code>com.google.protobuf.Any</code>
writeValue
{ "repo_name": "curioswitch/curiostack", "path": "common/grpc/protobuf-jackson/src/main/java/org/curioswitch/common/protobuf/json/TypeSpecificMarshaller.java", "license": "mit", "size": 12379 }
[ "com.fasterxml.jackson.core.JsonGenerator", "com.google.protobuf.ByteString", "com.google.protobuf.Parser", "java.io.IOException" ]
import com.fasterxml.jackson.core.JsonGenerator; import com.google.protobuf.ByteString; import com.google.protobuf.Parser; import java.io.IOException;
import com.fasterxml.jackson.core.*; import com.google.protobuf.*; import java.io.*;
[ "com.fasterxml.jackson", "com.google.protobuf", "java.io" ]
com.fasterxml.jackson; com.google.protobuf; java.io;
2,909,482
void reset() throws InterruptedIOException; }
void reset() throws InterruptedIOException; }
/** * Reset the inner state. */
Reset the inner state
reset
{ "repo_name": "Eshcar/hbase", "path": "hbase-client/src/main/java/org/apache/hadoop/hbase/client/SimpleRequestController.java", "license": "apache-2.0", "size": 20388 }
[ "java.io.InterruptedIOException" ]
import java.io.InterruptedIOException;
import java.io.*;
[ "java.io" ]
java.io;
2,146,604
protected boolean alreadyLoggedIn(IoSession session, ResourceAddress address) { Collection<String> requiredRoles = asList(address.getOption(HttpResourceAddress.REQUIRED_ROLES)); if (requiredRoles == null || requiredRoles.size() == 0) { return true; } Subject subject = ((IoSessionEx)session).getSubject(); if (subject != null ) { Collection<String> authorizedRoles = getAuthorizedRoles(subject); return authorizedRoles.containsAll(requiredRoles); } return false; }
boolean function(IoSession session, ResourceAddress address) { Collection<String> requiredRoles = asList(address.getOption(HttpResourceAddress.REQUIRED_ROLES)); if (requiredRoles == null requiredRoles.size() == 0) { return true; } Subject subject = ((IoSessionEx)session).getSubject(); if (subject != null ) { Collection<String> authorizedRoles = getAuthorizedRoles(subject); return authorizedRoles.containsAll(requiredRoles); } return false; }
/** * A session is "already logged in" under either of these circumstances: * <ol> * <li>The login module chain has already been run successfully.</li> * <li>The session's subject has all required roles (e.g. none for unprotected services)</li> * </ol> * * @param session the session that may or may not be already logged in * @return true iff the session is "already logged in" as defined above. */
A session is "already logged in" under either of these circumstances: The login module chain has already been run successfully. The session's subject has all required roles (e.g. none for unprotected services)
alreadyLoggedIn
{ "repo_name": "michaelcretzman/gateway", "path": "transport/http/src/main/java/org/kaazing/gateway/transport/http/bridge/filter/HttpLoginSecurityFilter.java", "license": "apache-2.0", "size": 24897 }
[ "java.util.Arrays", "java.util.Collection", "javax.security.auth.Subject", "org.apache.mina.core.session.IoSession", "org.kaazing.gateway.resource.address.ResourceAddress", "org.kaazing.gateway.resource.address.http.HttpResourceAddress", "org.kaazing.mina.core.session.IoSessionEx" ]
import java.util.Arrays; import java.util.Collection; import javax.security.auth.Subject; import org.apache.mina.core.session.IoSession; import org.kaazing.gateway.resource.address.ResourceAddress; import org.kaazing.gateway.resource.address.http.HttpResourceAddress; import org.kaazing.mina.core.session.IoSessionEx;
import java.util.*; import javax.security.auth.*; import org.apache.mina.core.session.*; import org.kaazing.gateway.resource.address.*; import org.kaazing.gateway.resource.address.http.*; import org.kaazing.mina.core.session.*;
[ "java.util", "javax.security", "org.apache.mina", "org.kaazing.gateway", "org.kaazing.mina" ]
java.util; javax.security; org.apache.mina; org.kaazing.gateway; org.kaazing.mina;
913,332
@Override public String doInBackground(String...params) { String str = ""; str = "dinesh"; HttpClient httpclient = new DefaultHttpClient(); HttpPost httppost = new HttpPost(protocol + serverip + ":" + serverport + "/getaccounts"); SharedPreferences settings = getSharedPreferences(MYPREFS2, 0); final String username = settings.getString("EncryptedUsername", null); byte[] usernameBase64Byte = Base64.decode(username, Base64.DEFAULT); try { usernameBase64ByteString = new String(usernameBase64Byte, "UTF-8"); } catch (UnsupportedEncodingException e) { // TODO Auto-generated catch block e.printStackTrace(); } final String password = settings.getString("superSecurePassword", null); try { // Stores the decrypted form of the password from the locally stored shared preference file passNormalized = getNormalizedPassword(password); } catch (InvalidKeyException | UnsupportedEncodingException | NoSuchAlgorithmException | NoSuchPaddingException | InvalidAlgorithmParameterException | IllegalBlockSizeException | BadPaddingException e1) { // TODO Auto-generated catch block e1.printStackTrace(); } // Add your data List < NameValuePair > nameValuePairs = new ArrayList < NameValuePair > (2); nameValuePairs.add(new BasicNameValuePair("username", usernameBase64ByteString)); nameValuePairs.add(new BasicNameValuePair("password", passNormalized)); nameValuePairs.add(new BasicNameValuePair("type", "TL")); try { httppost.setEntity(new UrlEncodedFormEntity(nameValuePairs)); } catch (UnsupportedEncodingException e) { // TODO Auto-generated catch block e.printStackTrace(); } try { // Stores the HTTP response of the get account numbers activity responseBody = httpclient.execute(httppost); } catch (IOException e2) { // TODO Auto-generated catch block e2.printStackTrace(); } try { in = responseBody.getEntity().getContent(); } catch (IllegalStateException | IOException e1) { // TODO Auto-generated catch block e1.printStackTrace(); } try { result = convertStreamToString( in ); } catch (IOException e) { // TODO Auto-generated catch block e.printStackTrace(); } result = result.replace("\n", ""); // Parsing of the result of HTTP request if (result != null) { if (result.indexOf("Correct") != -1) { try { jsonObject = new JSONObject(result); acc1 = jsonObject.getString("account_no"); //acc2 = jsonObject.getString("to"); } catch (JSONException e) { // TODO Auto-generated catch block e.printStackTrace(); } } } runOnUiThread(new Runnable() {
String function(String...params) { String str = STRdineshSTR:STR/getaccountsSTREncryptedUsernameSTRUTF-8STRsuperSecurePasswordSTRusernameSTRpasswordSTRtypeSTRTLSTR\nSTRSTRCorrectSTRaccount_no"); } catch (JSONException e) { e.printStackTrace(); } } } runOnUiThread(new Runnable() {
/** * background operations */
background operations
doInBackground
{ "repo_name": "ahmetcan/AndroidInsecurebankv2", "path": "InsecureBankv2/app/src/main/java/com/android/insecurebankv2/DoTransfer.java", "license": "mit", "size": 14745 }
[ "org.json.JSONException" ]
import org.json.JSONException;
import org.json.*;
[ "org.json" ]
org.json;
2,399,583
protected SOAPEnvelope getSOAPEnvelope() throws Exception { InputStream in = new ByteArrayInputStream(SOAPMSG.getBytes()); Message msg = new Message(in); msg.setMessageContext(msgContext); return msg.getSOAPEnvelope(); }
SOAPEnvelope function() throws Exception { InputStream in = new ByteArrayInputStream(SOAPMSG.getBytes()); Message msg = new Message(in); msg.setMessageContext(msgContext); return msg.getSOAPEnvelope(); }
/** * Constructs a soap envelope * <p/> * * @return soap envelope * @throws java.lang.Exception if there is any problem constructing the soap envelope */
Constructs a soap envelope
getSOAPEnvelope
{ "repo_name": "hpmtissera/wso2-wss4j", "path": "modules/wss4j/test/wssec/TestWSSecurityWSS234.java", "license": "apache-2.0", "size": 6549 }
[ "java.io.ByteArrayInputStream", "java.io.InputStream", "org.apache.axis.Message", "org.apache.axis.message.SOAPEnvelope" ]
import java.io.ByteArrayInputStream; import java.io.InputStream; import org.apache.axis.Message; import org.apache.axis.message.SOAPEnvelope;
import java.io.*; import org.apache.axis.*; import org.apache.axis.message.*;
[ "java.io", "org.apache.axis" ]
java.io; org.apache.axis;
2,337,409
public static final ApiDefinitionNotFoundException apiDefinitionNotFoundException(String apiId, String version) { return new ApiDefinitionNotFoundException(Messages.i18n.format("ApiDefinitionDoesNotExist", apiId, version)); //$NON-NLS-1$ }
static final ApiDefinitionNotFoundException function(String apiId, String version) { return new ApiDefinitionNotFoundException(Messages.i18n.format(STR, apiId, version)); }
/** * Creates an exception from an API id and version. * @param apiId the API id * @param version the API version * @return the exception */
Creates an exception from an API id and version
apiDefinitionNotFoundException
{ "repo_name": "jasonchaffee/apiman", "path": "manager/api/rest-impl/src/main/java/io/apiman/manager/api/rest/impl/util/ExceptionFactory.java", "license": "apache-2.0", "size": 17845 }
[ "io.apiman.manager.api.rest.contract.exceptions.ApiDefinitionNotFoundException", "io.apiman.manager.api.rest.impl.i18n.Messages" ]
import io.apiman.manager.api.rest.contract.exceptions.ApiDefinitionNotFoundException; import io.apiman.manager.api.rest.impl.i18n.Messages;
import io.apiman.manager.api.rest.contract.exceptions.*; import io.apiman.manager.api.rest.impl.i18n.*;
[ "io.apiman.manager" ]
io.apiman.manager;
24,039
List<Axiom<NamedResource>> loadSimpleList(SimpleListDescriptor descriptor) throws OntoDriverException;
List<Axiom<NamedResource>> loadSimpleList(SimpleListDescriptor descriptor) throws OntoDriverException;
/** * Loads simple list specified by the descriptor. * <p> * The returned axioms should be iterable in the same order as they were put into the sequence in the ontology. * * @param descriptor Describes the list's properties as well as the context from which the list should be loaded. * @return Axioms matching the specified list descriptor * @throws OntoDriverException If an ontology access error occurs * @throws IllegalStateException If called on a closed connection */
Loads simple list specified by the descriptor. The returned axioms should be iterable in the same order as they were put into the sequence in the ontology
loadSimpleList
{ "repo_name": "kbss-cvut/jopa", "path": "ontodriver-api/src/main/java/cz/cvut/kbss/ontodriver/Lists.java", "license": "lgpl-3.0", "size": 5057 }
[ "cz.cvut.kbss.ontodriver.descriptor.SimpleListDescriptor", "cz.cvut.kbss.ontodriver.exception.OntoDriverException", "cz.cvut.kbss.ontodriver.model.Axiom", "cz.cvut.kbss.ontodriver.model.NamedResource", "java.util.List" ]
import cz.cvut.kbss.ontodriver.descriptor.SimpleListDescriptor; import cz.cvut.kbss.ontodriver.exception.OntoDriverException; import cz.cvut.kbss.ontodriver.model.Axiom; import cz.cvut.kbss.ontodriver.model.NamedResource; import java.util.List;
import cz.cvut.kbss.ontodriver.descriptor.*; import cz.cvut.kbss.ontodriver.exception.*; import cz.cvut.kbss.ontodriver.model.*; import java.util.*;
[ "cz.cvut.kbss", "java.util" ]
cz.cvut.kbss; java.util;
1,542,843
void addHostedLocators(InternalDistributedMember member, Collection<String> locators, boolean isSharedConfigurationEnabled);
void addHostedLocators(InternalDistributedMember member, Collection<String> locators, boolean isSharedConfigurationEnabled);
/** * Adds the entry in hostedLocators for a member with one or more hosted locators. The value is a * collection of host[port] strings. If a bind-address was used for a locator then the form is * bind-addr[port]. * <p> * This currently only tracks stand-alone/dedicated locators, not embedded locators. * * @param isSharedConfigurationEnabled flag to determine if the locator has enabled shared * configuration * * @since GemFire 6.6.3 */
Adds the entry in hostedLocators for a member with one or more hosted locators. The value is a collection of host[port] strings. If a bind-address was used for a locator then the form is bind-addr[port]. This currently only tracks stand-alone/dedicated locators, not embedded locators
addHostedLocators
{ "repo_name": "davinash/geode", "path": "geode-core/src/main/java/org/apache/geode/distributed/internal/DistributionManager.java", "license": "apache-2.0", "size": 14971 }
[ "java.util.Collection", "org.apache.geode.distributed.internal.membership.InternalDistributedMember" ]
import java.util.Collection; import org.apache.geode.distributed.internal.membership.InternalDistributedMember;
import java.util.*; import org.apache.geode.distributed.internal.membership.*;
[ "java.util", "org.apache.geode" ]
java.util; org.apache.geode;
341,137
void onOpen(AbstractRMQChannel rmqChannel);
void onOpen(AbstractRMQChannel rmqChannel);
/** * Calls when channel is opend. * * @param rmqChannel * the channel. */
Calls when channel is opend
onOpen
{ "repo_name": "meteortwinkle/rabbitmq-consumer-plugin", "path": "src/main/java/org/jenkinsci/plugins/rabbitmqconsumer/listeners/RMQChannelListener.java", "license": "mit", "size": 635 }
[ "org.jenkinsci.plugins.rabbitmqconsumer.channels.AbstractRMQChannel" ]
import org.jenkinsci.plugins.rabbitmqconsumer.channels.AbstractRMQChannel;
import org.jenkinsci.plugins.rabbitmqconsumer.channels.*;
[ "org.jenkinsci.plugins" ]
org.jenkinsci.plugins;
1,359,610
public Project withLastupdatedtime(LocalDateTime lastupdatedtime) { this.setLastupdatedtime(lastupdatedtime); return this; }
Project function(LocalDateTime lastupdatedtime) { this.setLastupdatedtime(lastupdatedtime); return this; }
/** * This method was generated by MyBatis Generator. * This method corresponds to the database table m_prj_project * * @mbg.generated Sat Apr 20 17:20:23 CDT 2019 */
This method was generated by MyBatis Generator. This method corresponds to the database table m_prj_project
withLastupdatedtime
{ "repo_name": "esofthead/mycollab", "path": "mycollab-services/src/main/java/com/mycollab/module/project/domain/Project.java", "license": "agpl-3.0", "size": 39256 }
[ "java.time.LocalDateTime" ]
import java.time.LocalDateTime;
import java.time.*;
[ "java.time" ]
java.time;
823,347
Task<NodeAddress> locateActor(final Addressable actorReference, final boolean forceActivation);
Task<NodeAddress> locateActor(final Addressable actorReference, final boolean forceActivation);
/** * Locates the node address of an actor. * * @param forceActivation a node will be chosen to activate the actor if * it's not currently active. * Actual activation is postponed until the actor receives one message. * @return actor address, null if actor is not active and forceActivation==false */
Locates the node address of an actor
locateActor
{ "repo_name": "azogheb/orbit", "path": "actors/core/src/main/java/com/ea/orbit/actors/runtime/Runtime.java", "license": "bsd-3-clause", "size": 5570 }
[ "com.ea.orbit.actors.Addressable", "com.ea.orbit.actors.cluster.NodeAddress", "com.ea.orbit.concurrent.Task" ]
import com.ea.orbit.actors.Addressable; import com.ea.orbit.actors.cluster.NodeAddress; import com.ea.orbit.concurrent.Task;
import com.ea.orbit.actors.*; import com.ea.orbit.actors.cluster.*; import com.ea.orbit.concurrent.*;
[ "com.ea.orbit" ]
com.ea.orbit;
1,468,717
@Override public void translate(final ITranslationEnvironment environment, final IInstruction instruction, final List<ReilInstruction> instructions) throws InternalTranslationException { TranslationHelpers.checkTranslationArguments(environment, instruction, instructions, "pusha"); if (instruction.getOperands().size() != 0) { throw new InternalTranslationException( "Error: Argument instruction is not a pusha instruction (invalid number of operands)"); } final long baseOffset = instruction.getAddress().toLong() * 0x100; Helpers.generatePushAllRegisters(environment, baseOffset, OperandSize.DWORD, instructions); }
void function(final ITranslationEnvironment environment, final IInstruction instruction, final List<ReilInstruction> instructions) throws InternalTranslationException { TranslationHelpers.checkTranslationArguments(environment, instruction, instructions, "pusha"); if (instruction.getOperands().size() != 0) { throw new InternalTranslationException( STR); } final long baseOffset = instruction.getAddress().toLong() * 0x100; Helpers.generatePushAllRegisters(environment, baseOffset, OperandSize.DWORD, instructions); }
/** * Translates a PUSHA instruction to REIL code. * * @param environment A valid translation environment. * @param instruction The PUSHA instruction to translate. * @param instructions The generated REIL code will be added to this list * * @throws InternalTranslationException if any of the arguments are null the passed instruction is * not an PUSHA instruction */
Translates a PUSHA instruction to REIL code
translate
{ "repo_name": "chubbymaggie/binnavi", "path": "src/main/java/com/google/security/zynamics/reil/translators/x86/PushaTranslator.java", "license": "apache-2.0", "size": 2357 }
[ "com.google.security.zynamics.reil.OperandSize", "com.google.security.zynamics.reil.ReilInstruction", "com.google.security.zynamics.reil.translators.ITranslationEnvironment", "com.google.security.zynamics.reil.translators.InternalTranslationException", "com.google.security.zynamics.reil.translators.TranslationHelpers", "com.google.security.zynamics.zylib.disassembly.IInstruction", "java.util.List" ]
import com.google.security.zynamics.reil.OperandSize; import com.google.security.zynamics.reil.ReilInstruction; import com.google.security.zynamics.reil.translators.ITranslationEnvironment; import com.google.security.zynamics.reil.translators.InternalTranslationException; import com.google.security.zynamics.reil.translators.TranslationHelpers; import com.google.security.zynamics.zylib.disassembly.IInstruction; import java.util.List;
import com.google.security.zynamics.reil.*; import com.google.security.zynamics.reil.translators.*; import com.google.security.zynamics.zylib.disassembly.*; import java.util.*;
[ "com.google.security", "java.util" ]
com.google.security; java.util;
1,177,818
public ServiceFuture<Void> arrayStringPipesValidAsync(final ServiceCallback<Void> serviceCallback) { return ServiceFuture.fromResponse(arrayStringPipesValidWithServiceResponseAsync(), serviceCallback); }
ServiceFuture<Void> function(final ServiceCallback<Void> serviceCallback) { return ServiceFuture.fromResponse(arrayStringPipesValidWithServiceResponseAsync(), serviceCallback); }
/** * Get an array of string ['ArrayQuery1', 'begin!*'();:@ &amp;=+$,/?#[]end' , null, ''] using the pipes-array format. * * @param serviceCallback the async ServiceCallback to handle successful and failed responses. * @return the {@link ServiceFuture} object */
Get an array of string ['ArrayQuery1', 'begin!*'();:@ &amp;=+$,/?#[]end' , null, ''] using the pipes-array format
arrayStringPipesValidAsync
{ "repo_name": "anudeepsharma/autorest", "path": "src/generator/AutoRest.Java.Tests/src/main/java/fixtures/url/implementation/QueriesImpl.java", "license": "mit", "size": 139749 }
[ "com.microsoft.rest.ServiceCallback", "com.microsoft.rest.ServiceFuture" ]
import com.microsoft.rest.ServiceCallback; import com.microsoft.rest.ServiceFuture;
import com.microsoft.rest.*;
[ "com.microsoft.rest" ]
com.microsoft.rest;
2,862,327
public static boolean deleteDeviceAssociations(String secretkey, String devicename) { List<GuardRuleAssociationModel> deviceAssociations = getDeviceAssociations( secretkey, devicename); // List<GuardRuleAssociationDeleteFormat> toDeleteList = new // ArrayList<GuardRuleAssociationDeleteFormat>(); GuardRuleAssociationDeleteFormat todelete = new GuardRuleAssociationDeleteFormat(); todelete.secretkey = secretkey; todelete.devicename = devicename; for (GuardRuleAssociationModel association : deviceAssociations) { if (association.sensorname != null && association.sensorid != null) { todelete.actuatorid = null; todelete.actuatorname = null; todelete.sensorid = association.sensorid; todelete.sensorname = association.sensorname; todelete.rulename = association.rulename; } else if (association.actuatorname != null && association.actuatorid != null) { todelete.actuatorid = association.actuatorid; todelete.actuatorname = association.actuatorname; todelete.sensorid = null; todelete.sensorname = null; todelete.rulename = association.rulename; } if (!deleteAssociation(todelete)) return false; } return true; }
static boolean function(String secretkey, String devicename) { List<GuardRuleAssociationModel> deviceAssociations = getDeviceAssociations( secretkey, devicename); GuardRuleAssociationDeleteFormat todelete = new GuardRuleAssociationDeleteFormat(); todelete.secretkey = secretkey; todelete.devicename = devicename; for (GuardRuleAssociationModel association : deviceAssociations) { if (association.sensorname != null && association.sensorid != null) { todelete.actuatorid = null; todelete.actuatorname = null; todelete.sensorid = association.sensorid; todelete.sensorname = association.sensorname; todelete.rulename = association.rulename; } else if (association.actuatorname != null && association.actuatorid != null) { todelete.actuatorid = association.actuatorid; todelete.actuatorname = association.actuatorname; todelete.sensorid = null; todelete.sensorname = null; todelete.rulename = association.rulename; } if (!deleteAssociation(todelete)) return false; } return true; }
/** * Delete all device associations. * * @author Manaswi Saha * @param devicename * @param secretkey * @return True, if associations deleted */
Delete all device associations
deleteDeviceAssociations
{ "repo_name": "iiitd-ucla-pc3/SensorActVPDS-2.0", "path": "app/edu/pc3/sensoract/vpds/guardrule/GuardRuleManager.java", "license": "bsd-3-clause", "size": 25285 }
[ "edu.pc3.sensoract.vpds.api.request.GuardRuleAssociationDeleteFormat", "edu.pc3.sensoract.vpds.model.GuardRuleAssociationModel", "java.util.List" ]
import edu.pc3.sensoract.vpds.api.request.GuardRuleAssociationDeleteFormat; import edu.pc3.sensoract.vpds.model.GuardRuleAssociationModel; import java.util.List;
import edu.pc3.sensoract.vpds.api.request.*; import edu.pc3.sensoract.vpds.model.*; import java.util.*;
[ "edu.pc3.sensoract", "java.util" ]
edu.pc3.sensoract; java.util;
607,346
private int computeAxisAccessStatistics(List<AccessPublicationVO> accessPublis, List<GlobalSilverContent> gSC) { int nbAxisAccess = 0; for (GlobalSilverContent curGSC : gSC) { String publicationId = curGSC.getId(); String instanceId = curGSC.getInstanceId(); // Compute statistics on read publications for (AccessPublicationVO accessPub : accessPublis) { if (accessPub.getForeignPK().getId().equals(publicationId) && accessPub.getForeignPK().getInstanceId().equals(instanceId)) { nbAxisAccess += accessPub.getNbAccess(); } } } return nbAxisAccess; }
int function(List<AccessPublicationVO> accessPublis, List<GlobalSilverContent> gSC) { int nbAxisAccess = 0; for (GlobalSilverContent curGSC : gSC) { String publicationId = curGSC.getId(); String instanceId = curGSC.getInstanceId(); for (AccessPublicationVO accessPub : accessPublis) { if (accessPub.getForeignPK().getId().equals(publicationId) && accessPub.getForeignPK().getInstanceId().equals(instanceId)) { nbAxisAccess += accessPub.getNbAccess(); } } } return nbAxisAccess; }
/** * Compute the number of axis access * @param accessPublis the list of publications that have been accessed on specific time period * @param gSC the list of publication which are classified on an axis * @return the global number of access on a specific axis */
Compute the number of axis access
computeAxisAccessStatistics
{ "repo_name": "auroreallibe/Silverpeas-Core", "path": "core-war/src/main/java/org/silverpeas/web/silverstatistics/control/SilverStatisticsPeasSessionController.java", "license": "agpl-3.0", "size": 55386 }
[ "java.util.List", "org.silverpeas.core.contribution.contentcontainer.content.GlobalSilverContent", "org.silverpeas.web.silverstatistics.vo.AccessPublicationVO" ]
import java.util.List; import org.silverpeas.core.contribution.contentcontainer.content.GlobalSilverContent; import org.silverpeas.web.silverstatistics.vo.AccessPublicationVO;
import java.util.*; import org.silverpeas.core.contribution.contentcontainer.content.*; import org.silverpeas.web.silverstatistics.vo.*;
[ "java.util", "org.silverpeas.core", "org.silverpeas.web" ]
java.util; org.silverpeas.core; org.silverpeas.web;
480,537