id stringlengths 7 14 | text stringlengths 1 106k |
|---|---|
1381874_5 | public <T> T get(String path, ResponseCallback<T> callback) {
HttpResponse hr = client.get(path);
return handleResponse(callback, hr);
} |
1381874_6 | public <T> T get(String path, ResponseCallback<T> callback) {
HttpResponse hr = client.get(path);
return handleResponse(callback, hr);
} |
1381874_7 | public <T> T get(String path, ResponseCallback<T> callback) {
HttpResponse hr = client.get(path);
return handleResponse(callback, hr);
} |
1381874_8 | public <T> T get(String path, ResponseCallback<T> callback) {
HttpResponse hr = client.get(path);
return handleResponse(callback, hr);
} |
1381874_9 | public void put(String path) {
handleVoidResponse(client.put(path));
} |
1382471_0 | public static boolean isProductized() {
return productized;
} |
1382471_1 | public List<String> getAllExtensions() {
final List<String> extensions = new LinkedList<>();
extensions.add(defaultExtension);
extensions.addAll(Arrays.asList(otherExtensions));
return Collections.unmodifiableList(extensions);
} |
1387581_0 | public static String getElementJavaType(QName element, String location, ResourceLocator locator) {
String ret=null;
try {
java.net.URI uri=locator.getResourceURI(location);
DocumentBuilderFactory fact=DocumentBuilderFactory.newInstance();
fact.setNamespaceAware(true);
DocumentBuilder builder=fact.newD... |
1387581_1 | public static String getElementJavaType(QName element, String location, ResourceLocator locator) {
String ret=null;
try {
java.net.URI uri=locator.getResourceURI(location);
DocumentBuilderFactory fact=DocumentBuilderFactory.newInstance();
fact.setNamespaceAware(true);
DocumentBuilder builder=fact.newD... |
1387581_2 | public void createServiceInterfaceFromWSDL(String wsdlPath, String wsdlLocation, String srcFolder) throws Exception {
String filePath=getXJCBindingFilePath();
String[] cxfargs=new String[]{
"-d", srcFolder,
"-wsdlLocation", wsdlLocation,
"-b", filePath,
wsdlPath
};
org.apache.cxf.tools.wsdlto.WSDLT... |
1387581_3 | public java.io.Serializable create(ProtocolId pid, ConversationId cid, Serializable session) {
if (pid == null) {
throw new IllegalArgumentException("Protocol id not specified");
} else if (cid == null) {
throw new IllegalArgumentException("Conversation instance id not specified");
}
addSession(pid, cid, sess... |
1387581_4 | public java.io.Serializable create(ProtocolId pid, ConversationId cid, Serializable session) {
if (pid == null) {
throw new IllegalArgumentException("Protocol id not specified");
} else if (cid == null) {
throw new IllegalArgumentException("Conversation instance id not specified");
}
addSession(pid, cid, sess... |
1387581_5 | public java.io.Serializable create(ProtocolId pid, ConversationId cid, Serializable session) {
if (pid == null) {
throw new IllegalArgumentException("Protocol id not specified");
} else if (cid == null) {
throw new IllegalArgumentException("Conversation instance id not specified");
}
addSession(pid, cid, sess... |
1387581_6 | public java.io.Serializable create(ProtocolId pid, ConversationId cid, Serializable session) {
if (pid == null) {
throw new IllegalArgumentException("Protocol id not specified");
} else if (cid == null) {
throw new IllegalArgumentException("Conversation instance id not specified");
}
addSession(pid, cid, sess... |
1387581_7 | public static void localizeRoleIntroductions(ProtocolModel pm) {
final java.util.List<Role> unused=new java.util.ArrayList<Role>();
pm.visit(new DefaultVisitor() {
public boolean start(Protocol p) {
java.util.Iterator<Activity> iter=p.getBlock().getContents().iterator();
while (iter.hasNext()) {
... |
1387581_8 | protected void mergePaths(java.util.List<Block> sourcePaths, Block targetPath,
FeedbackHandler handler) {
if (sourcePaths.size() == 0) {
return;
} else if (sourcePaths.size() == 1) {
targetPath.getContents().addAll(sourcePaths.get(0).getContents());
return;
}
while (transferCommonComponent(targetPath,... |
1387581_9 | protected void mergePaths(java.util.List<Block> sourcePaths, Block targetPath,
FeedbackHandler handler) {
if (sourcePaths.size() == 0) {
return;
} else if (sourcePaths.size() == 1) {
targetPath.getContents().addAll(sourcePaths.get(0).getContents());
return;
}
while (transferCommonComponent(targetPath,... |
1390520_0 | public void registerObserver(Context context, Object instance, Method method, Class event) {
if (!isEnabled()) return;
if( context instanceof Application )
throw new RuntimeException("You may not register event handlers on the Application context");
Map<Class<?>, Set<ObserverReference<?>>> methods =... |
1390800_0 | public Boolean transform(File pomFile) throws IOException {
this.pomFile = pomFile;
if (!pomFile.exists()) {
throw new IllegalArgumentException("Couldn't find pom file: " + pomFile);
}
SAXBuilder saxBuilder = createSaxBuilder();
Document document;
EolDetectingInputStream eolDetectingStre... |
1390800_1 | public Boolean transform(File pomFile) throws IOException {
this.pomFile = pomFile;
if (!pomFile.exists()) {
throw new IllegalArgumentException("Couldn't find pom file: " + pomFile);
}
SAXBuilder saxBuilder = createSaxBuilder();
Document document;
EolDetectingInputStream eolDetectingStre... |
1390800_2 | public Boolean transform(File pomFile) throws IOException {
this.pomFile = pomFile;
if (!pomFile.exists()) {
throw new IllegalArgumentException("Couldn't find pom file: " + pomFile);
}
SAXBuilder saxBuilder = createSaxBuilder();
Document document;
EolDetectingInputStream eolDetectingStre... |
1390800_3 | public Boolean transform(File pomFile) throws IOException {
this.pomFile = pomFile;
if (!pomFile.exists()) {
throw new IllegalArgumentException("Couldn't find pom file: " + pomFile);
}
SAXBuilder saxBuilder = createSaxBuilder();
Document document;
EolDetectingInputStream eolDetectingStre... |
1390800_4 | public Boolean transform(File pomFile) throws IOException {
this.pomFile = pomFile;
if (!pomFile.exists()) {
throw new IllegalArgumentException("Couldn't find pom file: " + pomFile);
}
SAXBuilder saxBuilder = createSaxBuilder();
Document document;
EolDetectingInputStream eolDetectingStre... |
1390800_5 | public Boolean transform(File pomFile) throws IOException {
this.pomFile = pomFile;
if (!pomFile.exists()) {
throw new IllegalArgumentException("Couldn't find pom file: " + pomFile);
}
SAXBuilder saxBuilder = createSaxBuilder();
Document document;
EolDetectingInputStream eolDetectingStre... |
1390800_6 | public Boolean transform(File pomFile) throws IOException {
this.pomFile = pomFile;
if (!pomFile.exists()) {
throw new IllegalArgumentException("Couldn't find pom file: " + pomFile);
}
SAXBuilder saxBuilder = createSaxBuilder();
Document document;
EolDetectingInputStream eolDetectingStre... |
1390800_7 | static Map<String, String> parse(String installationLog, Log logger) {
Map<String, String> downloadedDependencies = new HashMap<>();
String[] lines = installationLog.split("\\R");
MutableBoolean expectingPackageFilePath = new MutableBoolean(false);
String packageName = "";
for (String line : lines) ... |
1390800_8 | static String extractPackageName(Map<String, String> downloadedDependencies, Matcher matcher, String packageName, MutableBoolean expectingPackageFilePath, Log logger) {
if (expectingPackageFilePath.isTrue()) {
// This may occur when a package-installation file is saved in pip-cache-dir, thus not being downl... |
1390800_9 | static void extractDownloadedFileName(Map<String, String> downloadedDependencies, Matcher matcher, String packageName, MutableBoolean expectingPackageFilePath, Log logger) {
// If this pattern matched before package-name was found, do not collect this path.
if (expectingPackageFilePath.isFalse()) {
logg... |
1391650_0 | public static void nonNull(Object... values) {
int i = 0;
for (Object value : values) {
++i;
if (value == null) {
String message = String.format("%s Value %d/%d is null.", PREFIX, i, values.length);
throw new IllegalArgumentException(message);
}
}
} |
1391650_1 | public static void nonNull(Object... values) {
int i = 0;
for (Object value : values) {
++i;
if (value == null) {
String message = String.format("%s Value %d/%d is null.", PREFIX, i, values.length);
throw new IllegalArgumentException(message);
}
}
} |
1391650_2 | public static void check(boolean... values) {
int i = 0;
for (boolean value : values) {
++i;
if (!value) {
String msg = String.format("%s Check %d/%d failed!", PREFIX, i, values.length);
throw new IllegalArgumentException(msg);
}
}
} |
1391650_3 | public static void check(boolean... values) {
int i = 0;
for (boolean value : values) {
++i;
if (!value) {
String msg = String.format("%s Check %d/%d failed!", PREFIX, i, values.length);
throw new IllegalArgumentException(msg);
}
}
} |
1391650_4 | public static void unreachable() {
String message = String.format("%s Code should be unreachable!\n", PREFIX);
throw new IllegalStateException(message);
} |
1391650_5 | public static void unreachable() {
String message = String.format("%s Code should be unreachable!\n", PREFIX);
throw new IllegalStateException(message);
} |
1391650_6 | public static String maybeConsume(final InputStream stream, final Charset encoding, final int limit)
throws IOException {
Assert.nonNull(stream, encoding);
return consume(new InputStreamReader(stream, encoding), limit);
} |
1391650_7 | public static String consume(final InputStream stream, final Charset encoding)
throws IOException {
return maybeConsume(stream, encoding, 0);
} |
1397974_0 | public static int[] mergesort(int start, int length, IntBinaryOperator comparator) {
final int[] src = createOrderArray(start, length);
if (length > 1) {
final int[] dst = (int[]) src.clone();
topDownMergeSort(src, dst, 0, length, comparator);
return dst;
}
return src;
} |
1397974_1 | public static int[] mergesort(int start, int length, IntBinaryOperator comparator) {
final int[] src = createOrderArray(start, length);
if (length > 1) {
final int[] dst = (int[]) src.clone();
topDownMergeSort(src, dst, 0, length, comparator);
return dst;
}
return src;
} |
1397974_2 | public static int[] mergesort(int start, int length, IntBinaryOperator comparator) {
final int[] src = createOrderArray(start, length);
if (length > 1) {
final int[] dst = (int[]) src.clone();
topDownMergeSort(src, dst, 0, length, comparator);
return dst;
}
return src;
} |
1397974_3 | public static int[] mergesort(int start, int length, IntBinaryOperator comparator) {
final int[] src = createOrderArray(start, length);
if (length > 1) {
final int[] dst = (int[]) src.clone();
topDownMergeSort(src, dst, 0, length, comparator);
return dst;
}
return src;
} |
1397974_4 | public static int[] mergesort(int start, int length, IntBinaryOperator comparator) {
final int[] src = createOrderArray(start, length);
if (length > 1) {
final int[] dst = (int[]) src.clone();
topDownMergeSort(src, dst, 0, length, comparator);
return dst;
}
return src;
} |
1397974_5 | @SuppressForbidden
public static long randomSeed64() {
if (testsSeedProperty == null) {
try {
testsSeedProperty =
java.security.AccessController.doPrivileged(
new PrivilegedAction<String>() {
@Override
public String run() {
return Sys... |
1397974_6 | @SuppressForbidden
public static long randomSeed64() {
if (testsSeedProperty == null) {
try {
testsSeedProperty =
java.security.AccessController.doPrivileged(
new PrivilegedAction<String>() {
@Override
public String run() {
return Sys... |
1397974_7 | public int grow(int currentBufferLength, int elementsCount, int expectedAdditions) {
long growBy = (long) ((long) currentBufferLength * growRatio);
growBy = Math.max(growBy, minGrowCount);
growBy = Math.min(growBy, maxGrowCount);
long growTo = Math.min(MAX_ARRAY_LENGTH, growBy + currentBufferLength);
long new... |
1397974_8 | public int grow(int currentBufferLength, int elementsCount, int expectedAdditions) {
long growBy = (long) ((long) currentBufferLength * growRatio);
growBy = Math.max(growBy, minGrowCount);
growBy = Math.min(growBy, maxGrowCount);
long growTo = Math.min(MAX_ARRAY_LENGTH, growBy + currentBufferLength);
long new... |
1397974_9 | @Override
public String toString() {
long bit = nextSetBit(0);
if (bit < 0) {
return "{}";
}
final StringBuilder builder = new StringBuilder();
builder.append("{");
builder.append(Long.toString(bit));
while ((bit = nextSetBit(bit + 1)) >= 0) {
builder.append(", ");
builder.append(Long.toString... |
1404216_0 | @Override
public Path createDaemonDir(Path jumiHome) {
try {
return UniqueDirectories.createUniqueDir(jumiHome.resolve(DAEMONS_DIR), System.currentTimeMillis());
} catch (IOException e) {
throw new RuntimeException("Unable to create daemon directory", e);
}
} |
1404216_1 | @Override
public Path createDaemonDir(Path jumiHome) {
try {
return UniqueDirectories.createUniqueDir(jumiHome.resolve(DAEMONS_DIR), System.currentTimeMillis());
} catch (IOException e) {
throw new RuntimeException("Unable to create daemon directory", e);
}
} |
1404216_2 | @Override
public Path createDaemonDir(Path jumiHome) {
try {
return UniqueDirectories.createUniqueDir(jumiHome.resolve(DAEMONS_DIR), System.currentTimeMillis());
} catch (IOException e) {
throw new RuntimeException("Unable to create daemon directory", e);
}
} |
1404216_3 | @Override
public Path getDaemonJar(Path jumiHome) {
Path extractedJar = jumiHome.resolve("lib/" + daemonJar.getDaemonJarName());
createIfDoesNotExist(extractedJar);
return extractedJar;
} |
1404216_4 | @Override
public Path getDaemonJar(Path jumiHome) {
Path extractedJar = jumiHome.resolve("lib/" + daemonJar.getDaemonJarName());
createIfDoesNotExist(extractedJar);
return extractedJar;
} |
1404216_5 | @Override
public Path getDaemonJar(Path jumiHome) {
Path extractedJar = jumiHome.resolve("lib/" + daemonJar.getDaemonJarName());
createIfDoesNotExist(extractedJar);
return extractedJar;
} |
1404216_6 | public static List<Path> getClasspathElements(String classpath, String pathSeparator) {
List<Path> results = new ArrayList<>();
for (String path : classpath.split(Pattern.quote(pathSeparator))) {
results.add(new File(path).toPath());
}
return results;
} |
1404216_7 | public static List<Path> getClasspathElements(String classpath, String pathSeparator) {
List<Path> results = new ArrayList<>();
for (String path : classpath.split(Pattern.quote(pathSeparator))) {
results.add(new File(path).toPath());
}
return results;
} |
1404216_8 | public static List<Path> getClasspathElements(String classpath, String pathSeparator) {
List<Path> results = new ArrayList<>();
for (String path : classpath.split(Pattern.quote(pathSeparator))) {
results.add(new File(path).toPath());
}
return results;
} |
1404216_9 | @Override
public void close() throws IOException {
externalResources.close();
} |
1404666_0 | public void coveredByUnitTest()
{
System.out.println("Hello, world.");
} |
1404666_1 | public void coveredByUnitTest()
{
System.out.println("Hello, world.");
} |
1404666_3 | public List getExtensions() {
return ImmutableList.of(FileDescriptorLeakDetector.class);
} |
1404666_4 | public double evaluate(Token... tokens) {
this.pos = -1;
this.stream = tokens;
return expression().getValue();
} |
1404666_5 | public double evaluate(Token... tokens) {
this.pos = -1;
this.stream = tokens;
return expression().getValue();
} |
1404666_6 | public double evaluate(Token... tokens) {
this.pos = -1;
this.stream = tokens;
return expression().getValue();
} |
1404666_7 | public double evaluate(Token... tokens) {
this.pos = -1;
this.stream = tokens;
return expression().getValue();
} |
1404666_8 | public double evaluate(Token... tokens) {
this.pos = -1;
this.stream = tokens;
return expression().getValue();
} |
1404666_9 | public double evaluate(Token... tokens) {
this.pos = -1;
this.stream = tokens;
return expression().getValue();
} |
1406218_0 | public String generateUniqueId(String text)
{
// Note: We always use a prefix (and a prefix with alpha characters) so that the generated id is a valid HTML id
// (since HTML id must start with an alpha prefix).
return generateUniqueId("I", text);
} |
1406218_1 | public String generateUniqueId(String text)
{
// Note: We always use a prefix (and a prefix with alpha characters) so that the generated id is a valid HTML id
// (since HTML id must start with an alpha prefix).
return generateUniqueId("I", text);
} |
1406218_2 | public String generateUniqueId(String text)
{
// Note: We always use a prefix (and a prefix with alpha characters) so that the generated id is a valid HTML id
// (since HTML id must start with an alpha prefix).
return generateUniqueId("I", text);
} |
1406218_3 | public String generateUniqueId(String text)
{
// Note: We always use a prefix (and a prefix with alpha characters) so that the generated id is a valid HTML id
// (since HTML id must start with an alpha prefix).
return generateUniqueId("I", text);
} |
1406218_4 | public String generateUniqueId(String text)
{
// Note: We always use a prefix (and a prefix with alpha characters) so that the generated id is a valid HTML id
// (since HTML id must start with an alpha prefix).
return generateUniqueId("I", text);
} |
1406218_5 | public SyntaxType getType()
{
return this.type;
} |
1406218_6 | @Override
public boolean equals(Object object)
{
if (object == this) {
return true;
}
if (!(object instanceof Syntax)) {
return false;
}
Syntax rhs = (Syntax) object;
return new EqualsBuilder().append(getType(), rhs.getType()).append(getVersion(), rhs.getVersion())
.appen... |
1406218_7 | @Override
public int compareTo(Syntax syntax)
{
return new CompareToBuilder().append(getType(), syntax.getType())
// TODO: Add a real version parser to compare the versions
.append(getVersion(), syntax.getVersion()).toComparison();
} |
1406218_8 | public static Syntax valueOf(String syntaxIdAsString) throws ParseException
{
if (syntaxIdAsString == null) {
throw new ParseException("The passed Syntax cannot be NULL");
}
Matcher matcher = SYNTAX_PATTERN.matcher(syntaxIdAsString);
if (!matcher.matches()) {
throw new ParseException(Str... |
1406218_9 | public static Syntax valueOf(String syntaxIdAsString) throws ParseException
{
if (syntaxIdAsString == null) {
throw new ParseException("The passed Syntax cannot be NULL");
}
Matcher matcher = SYNTAX_PATTERN.matcher(syntaxIdAsString);
if (!matcher.matches()) {
throw new ParseException(Str... |
1407946_0 | public String getAlign() {
EnumAlign enumAlign = (EnumAlign) comboBoxAlign.getSelectedItem();
return enumAlign.getXmlValue();
} |
1407946_1 | public void setAlign(EnumAlign enumAlign) {
comboBoxAlign.setSelectedItem(enumAlign);
} |
1407946_2 | public String getThickness() {
return textFieldSize.getText().trim();
} |
1407946_3 | public void setThickness(String thickness) {
textFieldSize.setText(thickness);
} |
1407946_4 | public String getCustomWidth() {
String value = textFieldWidth.getText().trim();
if (value == null || value.length() == 0) {
return null;
}
return value;
} |
1407946_5 | public String getCustomWidth() {
String value = textFieldWidth.getText().trim();
if (value == null || value.length() == 0) {
return null;
}
return value;
} |
1407946_6 | public void setCustomWidth(String width) {
textFieldWidth.setText(width);
} |
1407946_7 | public String getCustomWidthUnit() {
EnumWidthUnit enumWidthUnit = (EnumWidthUnit) comboBoxWidthUnit.getSelectedItem();
return enumWidthUnit.getXmlValue();
} |
1407946_8 | public void setCustomWidthUnit(EnumWidthUnit enumWidthUnit) {
comboBoxWidthUnit.setSelectedItem(enumWidthUnit);
} |
1407946_9 | public String getColor() {
Color color = colorChooser.getColor();
String red = Integer.toHexString(color.getRed());
if(red.length()==1)red="0"+red;
String green = Integer.toHexString(color.getGreen());
if(green.length()==1)green="0"+green;
String blue = Integer.toHexString(color.getBlue());
if(blue.length()==1)b... |
1415645_0 | public Statement read() throws Exception, UnexpectedInputException,
ParseException {
Customer customer = customerReader.read();
if(customer == null) {
return null;
} else {
Statement statement = new Statement();
statement.setCustomer(customer);
stat... |
1415645_1 | public Statement read() throws Exception, UnexpectedInputException,
ParseException {
Customer customer = customerReader.read();
if(customer == null) {
return null;
} else {
Statement statement = new Statement();
statement.setCustomer(customer);
stat... |
1421658_0 | public String buildOAuthUrl(ConnectionFactory<?> connectionFactory, NativeWebRequest request) {
return buildOAuthUrl(connectionFactory, request, null);
} |
1421658_1 | public String buildOAuthUrl(ConnectionFactory<?> connectionFactory, NativeWebRequest request) {
return buildOAuthUrl(connectionFactory, request, null);
} |
1421658_2 | public String buildOAuthUrl(ConnectionFactory<?> connectionFactory, NativeWebRequest request) {
return buildOAuthUrl(connectionFactory, request, null);
} |
1421658_3 | public String buildOAuthUrl(ConnectionFactory<?> connectionFactory, NativeWebRequest request) {
return buildOAuthUrl(connectionFactory, request, null);
} |
1421658_4 | public String buildOAuthUrl(ConnectionFactory<?> connectionFactory, NativeWebRequest request) {
return buildOAuthUrl(connectionFactory, request, null);
} |
1421658_5 | public String buildOAuthUrl(ConnectionFactory<?> connectionFactory, NativeWebRequest request) {
return buildOAuthUrl(connectionFactory, request, null);
} |
1421658_6 | public String buildOAuthUrl(ConnectionFactory<?> connectionFactory, NativeWebRequest request) {
return buildOAuthUrl(connectionFactory, request, null);
} |
1421658_7 | public String buildOAuthUrl(ConnectionFactory<?> connectionFactory, NativeWebRequest request) {
return buildOAuthUrl(connectionFactory, request, null);
} |
1421658_8 | public String buildOAuthUrl(ConnectionFactory<?> connectionFactory, NativeWebRequest request) {
return buildOAuthUrl(connectionFactory, request, null);
} |
1421658_9 | public Connection<?> completeConnection(OAuth1ConnectionFactory<?> connectionFactory, NativeWebRequest request) {
String verifier = request.getParameter("oauth_verifier");
AuthorizedRequestToken requestToken = new AuthorizedRequestToken(extractCachedRequestToken(request), verifier);
OAuthToken accessToken = connect... |
1421692_0 | public static String underlined(String str) {
int strLen;
if (str == null || (strLen = str.length()) == 0) {
return str;
}
StringBuilder ret = new StringBuilder();
int last = 0;
for (int i = 0; i < strLen; i++) {
char ch = str.charAt(i);
if (ch == '_') {
ret.append(Character.toLowerCase(ch));
last = -... |
1421692_1 | public void snapshot() {
for (Counter counter : counterMap.values()) {
counter.snapshot();
}
} |
1421692_2 | public static Class<?>[] getClasses(String packageName) throws ClassNotFoundException, IOException {
ClassLoader classLoader = Thread.currentThread().getContextClassLoader();
assert classLoader != null;
String path = packageName.replace('.', '/');
Enumeration<URL> resources = classLoader.getResources(path);
List<F... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.