id stringlengths 7 14 | text stringlengths 1 106k |
|---|---|
663418_0 | public String get(String key) {
Map<String, String> namedConfig = getNamedConfig();
return namedConfig.get(key);
} |
663418_1 | public String get(String key) {
Map<String, String> namedConfig = getNamedConfig();
return namedConfig.get(key);
} |
663418_2 | public String get(String key) {
Map<String, String> namedConfig = getNamedConfig();
return namedConfig.get(key);
} |
663418_3 | String getPictureName() {
return pictureName;
} |
663418_4 | @Override
public void doCells(Parse parse) {
cells = parse;
processArguments();
boolean state = validateState();
notifyInvalidState(state);
configFixture();
restClient = buildRestClient();
configRestClient();
try {
Method method1 = getClass().getMethod(parse.text());
method1.invoke(this);
} catch (Exceptio... |
663418_5 | @Override
public void doCells(Parse parse) {
cells = parse;
processArguments();
boolean state = validateState();
notifyInvalidState(state);
configFixture();
restClient = buildRestClient();
configRestClient();
try {
Method method1 = getClass().getMethod(parse.text());
method1.invoke(this);
} catch (Exceptio... |
663418_6 | @Override
public void doCells(Parse parse) {
cells = parse;
processArguments();
boolean state = validateState();
notifyInvalidState(state);
configFixture();
restClient = buildRestClient();
configRestClient();
try {
Method method1 = getClass().getMethod(parse.text());
method1.invoke(this);
} catch (Exceptio... |
663418_7 | @Override
public void doCells(Parse parse) {
cells = parse;
processArguments();
boolean state = validateState();
notifyInvalidState(state);
configFixture();
restClient = buildRestClient();
configRestClient();
try {
Method method1 = getClass().getMethod(parse.text());
method1.invoke(this);
} catch (Exceptio... |
663418_8 | @Override
public void doCells(Parse parse) {
cells = parse;
processArguments();
boolean state = validateState();
notifyInvalidState(state);
configFixture();
restClient = buildRestClient();
configRestClient();
try {
Method method1 = getClass().getMethod(parse.text());
method1.invoke(this);
} catch (Exceptio... |
663418_9 | @Override
public void doCells(Parse parse) {
cells = parse;
processArguments();
boolean state = validateState();
notifyInvalidState(state);
configFixture();
restClient = buildRestClient();
configRestClient();
try {
Method method1 = getClass().getMethod(parse.text());
method1.invoke(this);
} catch (Exceptio... |
666662_0 | public void append(char c) {
if (isFull()) {
removeFirst();
}
insertLast(c);
} |
666662_1 | public void append(char c) {
if (isFull()) {
removeFirst();
}
insertLast(c);
} |
667236_0 | protected AndroidSdk getAndroidSdk() throws MojoExecutionException {
File chosenSdkPath;
String chosenSdkPlatform;
if (sdk != null) {
// An <sdk> tag exists in the pom.
if (sdk.getPath() != null) {
// An <sdk><path> tag is set in the pom.
chosenSdkPath = sdk.getPath()... |
667236_1 | protected String extractPackageNameFromAndroidManifest(File androidManifestFile) throws MojoExecutionException {
final URL xmlURL;
try {
xmlURL = androidManifestFile.toURI().toURL();
} catch (MalformedURLException e) {
throw new MojoExecutionException("Error while trying to figure out packag... |
667236_2 | protected String extractInstrumentationRunnerFromAndroidManifest(File androidManifestFile) throws MojoExecutionException {
final URL xmlURL;
try {
xmlURL = androidManifestFile.toURI().toURL();
} catch (MalformedURLException e) {
throw new MojoExecutionException("Error while trying to figure ... |
667236_3 | protected String extractInstrumentationRunnerFromAndroidManifest(File androidManifestFile) throws MojoExecutionException {
final URL xmlURL;
try {
xmlURL = androidManifestFile.toURI().toURL();
} catch (MalformedURLException e) {
throw new MojoExecutionException("Error while trying to figure ... |
667236_4 | protected String extractPackageNameFromAndroidManifestXmlTree(String aaptDumpXmlTree) {
final Scanner scanner = new Scanner(aaptDumpXmlTree);
// Finds the root element named "manifest".
scanner.findWithinHorizon("^E: manifest", 0);
// Finds the manifest element's attribute named "package".
scanner.f... |
667236_5 | protected String extractPackageNameFromApk(File apkFile) throws MojoExecutionException {
CommandExecutor executor = CommandExecutor.Factory.createDefaultCommmandExecutor();
executor.setLogger(this.getLog());
List<String> commands = new ArrayList<String>();
commands.add("dump");
commands.add("xmltree... |
667236_6 | protected String extractPackageNameFromApk(File apkFile) throws MojoExecutionException {
CommandExecutor executor = CommandExecutor.Factory.createDefaultCommmandExecutor();
executor.setLogger(this.getLog());
List<String> commands = new ArrayList<String>();
commands.add("dump");
commands.add("xmltree... |
667236_7 | public String getPathForTool(String tool) {
if (getLayout() == Layout.LAYOUT_1_1) {
return sdkPath + "/tools/" + tool;
}
if (getLayout() == Layout.LAYOUT_1_5) {
if (commonToolsIn11And15.contains(tool)) {
return sdkPath + "/tools/" + tool;
} else {
return getPl... |
667236_8 | public String getPathForTool(String tool) {
if (getLayout() == Layout.LAYOUT_1_1) {
return sdkPath + "/tools/" + tool;
}
if (getLayout() == Layout.LAYOUT_1_5) {
if (commonToolsIn11And15.contains(tool)) {
return sdkPath + "/tools/" + tool;
} else {
return getPl... |
667236_9 | public String getPathForTool(String tool) {
if (getLayout() == Layout.LAYOUT_1_1) {
return sdkPath + "/tools/" + tool;
}
if (getLayout() == Layout.LAYOUT_1_5) {
if (commonToolsIn11And15.contains(tool)) {
return sdkPath + "/tools/" + tool;
} else {
return getPl... |
678267_0 | @Override
public String getBaseUrl() {
return fedoraBaseUrl;
} |
678267_1 | @Override
public Date getDate() {
return date;
} |
678267_2 | @Override
public String getMethodName() {
return methodName;
} |
678267_3 | @Override
public String getPID() {
return pid;
} |
678267_4 | public String getAuthor() {
return author;
} |
678267_5 | @Override
public String getFormat() {
return format;
} |
678267_6 | @Override
public String getServerVersion() {
return serverVersion;
} |
678267_7 | @Override
public String getReturnVal() {
return returnVal;
} |
678267_8 | @Override
public String getMethodParamVal(String paramName) {
return getCategoryTerm(String.format(parameterScheme, paramName));
} |
678267_9 | public static DateTime parseXSDDateTime(String input) {
Matcher m = XSD_DATETIME.matcher(input);
if (!m.find()) {
throw new IllegalArgumentException(input +
" is not a valid XML Schema 1.1 dateTime.");
}
int year = Integer.parseInt(m.group(1));
int month = Integer.parseInt(m.... |
684382_0 | public byte[] encodeHeader() {
byte[] prevTagSize = encodePreviousTagSize(0);
byte[] header = new byte[flvHeader.length + prevTagSize.length];
System.arraycopy(flvHeader, 0, header, 0, flvHeader.length);
System.arraycopy(prevTagSize, 0, header, flvHeader.length, prevTagSize.length);
return header;
} |
684382_1 | public static boolean validateMinJREVersion(String runtimeVersion, String minVersion){
String[] requestedVersioning = minVersion.split("\\.");
String[] clientVersioning = runtimeVersion.split("\\.");
if (requestedVersioning.length < 3 || clientVersioning.length < 3)
return false;
// First major update
if (Intege... |
684382_2 | public static boolean validateMinJREVersion(String runtimeVersion, String minVersion){
String[] requestedVersioning = minVersion.split("\\.");
String[] clientVersioning = runtimeVersion.split("\\.");
if (requestedVersioning.length < 3 || clientVersioning.length < 3)
return false;
// First major update
if (Intege... |
684382_3 | public static boolean validateMinJREVersion(String runtimeVersion, String minVersion){
String[] requestedVersioning = minVersion.split("\\.");
String[] clientVersioning = runtimeVersion.split("\\.");
if (requestedVersioning.length < 3 || clientVersioning.length < 3)
return false;
// First major update
if (Intege... |
684382_4 | public boolean hasPadding() {
if (packetLength >= HEADER_LENGTH)
/* 0x20 = 0010 0000 */
return ((packet[0] & 0x20) >> 5) == 1;
else return false; // broken packet
} |
684382_5 | public boolean hasExtension() {
if (packetLength >= HEADER_LENGTH)
/* 0x10 = 0001 0000 */
return ((packet[0] & 0x10) >> 4) == 1;
else return false; // broken packet
} |
684382_6 | public boolean hasMarker() {
if (packetLength >= HEADER_LENGTH) {
return ((packet[1] & 0x80) >> 7) == 1;
} else return false; // broken packet
} |
688360_0 | public static SimpleImmutableEntry<String, Object> validateStrictConfigFilePermissions(Path path, LinkOption... options)
throws IOException {
if ((path == null) || (!Files.exists(path, options))) {
return null;
}
Collection<PosixFilePermission> perms = IoUtils.getPermissions(path, options);
... |
688360_1 | public Collection<Path> scan() throws IOException, IllegalStateException {
return scan(LinkedList::new);
} |
688360_2 | public Collection<Path> scan() throws IOException, IllegalStateException {
return scan(LinkedList::new);
} |
688360_3 | @Override
public void close() throws IOException {
// ignored
} |
688360_4 | @Override
public void close() throws IOException {
// ignored
} |
688360_5 | public EmptyInputStream() {
super();
} |
688360_6 | @Override
public void close() throws IOException {
// ignored
} |
688360_7 | @Override
public int read() throws IOException {
if (!isOpen()) {
throw new EOFException("Stream is closed for reading one value");
}
return -1;
} |
688360_8 | @Override
public int read() throws IOException {
if (!isOpen()) {
throw new EOFException("Stream is closed for reading one value");
}
return -1;
} |
688360_9 | @Override
public int read() throws IOException {
if (!isOpen()) {
throw new EOFException("Stream is closed for reading one value");
}
return -1;
} |
690050_0 | @Override
@Transactional
public void restoreFromHistory(OtherPageHistorized historized) {
otherPageHistorizer.restore(historized);
} |
690050_1 | @Override
@Transactional
public void save(OtherPage entity) {
Action action = entity.isTransient() ? Action.CREATED : Action.MODIFIED;
otherPageRepository.save(entity);
otherPageHistorizer.historize(entity, action);
} |
690050_2 | @Override
@Transactional
public void delete(OtherPage entity) {
otherPageHistorizer.deleteHistory(entity);
otherPageRepository.delete(entity);
mountService.delete(entity.getId().toString(), OtherPageConstants.HANDLER_KEY);
} |
690050_3 | @Override
@Transactional(readOnly = true)
public OtherPage findById(Integer id) {
return otherPageRepository.findById(id);
} |
690050_4 | @Override
@Transactional(readOnly = true)
public OtherPage newOtherPageEntity() {
OtherPage otherPage = new OtherPage();
otherPage.setAllRights(otherPageRepository.findLastSelectedRights());
return otherPage;
} |
690050_5 | @Override
public void historize(OtherPage otherPage, Action action) {
historize(otherPage, action, null);
} |
690050_6 | @Override
public OtherPage restore(OtherPageHistorized historized) {
OtherPage otherPage = historized.getOtherPage();
otherPage.copyFrom(historized);
otherPage.setAllRights(rightService.findWhitespaceSeparatedRights(historized.getRights()));
otherPage.setUpdateModificationData(false);
historize(othe... |
690050_7 | @Override
public void deleteHistory(OtherPage otherPage) {
otherPageHistorizedRepository.deleteHistoryForOtherPage(otherPage);
} |
690050_8 | @Override
@Transactional(readOnly = true)
public IRequestTarget getRequestTarget(String requestedUrl, MountPoint mountPoint) {
String relatedContentId = mountPoint.getRelatedContentId();
PageParameters pageParameters = new PageParameters("0=" + relatedContentId);
return new BookmarkablePageRequestTarget(Oth... |
690050_9 | @Override
@Transactional(readOnly = true)
public boolean canHandlePageClass(Class<? extends Page> pageClazz, PageParameters pageParameters) {
if(OtherPageViewPage.class.equals(pageClazz)) {
String relatedContentId = pageParameters.getString("0");
if(StringUtils.isNumeric(relatedContentId)) {
... |
692484_5 | @Override
public void reduce(Gram ngram,
Iterator<Gram> values,
OutputCollector<Text,DoubleWritable> output,
Reporter reporter) throws IOException {
int[] gramFreq = new int[2];
gramFreq[0] = gramFreq[1] = -1;
if (ngram.getType() == Gram.Type.UNIGRAM ... |
692484_7 | @Override
public int getPartition(GramKey key, Gram value, int numPartitions) {
// see: http://svn.apache.org/viewvc/hadoop/mapreduce/trunk/src/java/org/apache/hadoop/mapreduce/lib/partition/BinaryPartitioner.java?revision=816664&view=markup
int length = key.getLength()-1;
int right = (offset + length) % length... |
697210_0 | public static XStream initXStreamForDeserialization(final String allowTypes) {
XStream xstream = new XStream();
XStream.setupDefaultSecurity(xstream); // to be removed with XStream 1.5 and later
xstream.allowTypesByWildcard(new String[]{allowTypes});
return xstream;
} |
697210_1 | public static XStream initXStreamForDeserialization(final String allowTypes) {
XStream xstream = new XStream();
XStream.setupDefaultSecurity(xstream); // to be removed with XStream 1.5 and later
xstream.allowTypesByWildcard(new String[]{allowTypes});
return xstream;
} |
697210_2 | public String[] readNext() throws IOException {
while (recordsQueue.isEmpty() && !eof) {
char[] data = new char[CHUNK_SIZE];
int size = r.read(data);
if (size == -1) {
break;
}
processChunk(data, size);
}
if (recordsQueue.isEmpty()) {
if (wasEscape... |
697210_3 | public String[] readNext() throws IOException {
while (recordsQueue.isEmpty() && !eof) {
char[] data = new char[CHUNK_SIZE];
int size = r.read(data);
if (size == -1) {
break;
}
processChunk(data, size);
}
if (recordsQueue.isEmpty()) {
if (wasEscape... |
697210_4 | public String[] readNext() throws IOException {
while (recordsQueue.isEmpty() && !eof) {
char[] data = new char[CHUNK_SIZE];
int size = r.read(data);
if (size == -1) {
break;
}
processChunk(data, size);
}
if (recordsQueue.isEmpty()) {
if (wasEscape... |
697210_5 | public String[] readNext() throws IOException {
while (recordsQueue.isEmpty() && !eof) {
char[] data = new char[CHUNK_SIZE];
int size = r.read(data);
if (size == -1) {
break;
}
processChunk(data, size);
}
if (recordsQueue.isEmpty()) {
if (wasEscape... |
697210_6 | public String[] readNext() throws IOException {
while (recordsQueue.isEmpty() && !eof) {
char[] data = new char[CHUNK_SIZE];
int size = r.read(data);
if (size == -1) {
break;
}
processChunk(data, size);
}
if (recordsQueue.isEmpty()) {
if (wasEscape... |
697210_7 | public String[] readNext() throws IOException {
while (recordsQueue.isEmpty() && !eof) {
char[] data = new char[CHUNK_SIZE];
int size = r.read(data);
if (size == -1) {
break;
}
processChunk(data, size);
}
if (recordsQueue.isEmpty()) {
if (wasEscape... |
697210_8 | @Override
public String toString() {
return "CsvConfiguration [hasHeader=" + hasHeader + ", separator=" + separator + ", quotechar=" + quotechar + ", escape=" + escape + ", skipSpaces=" + skipSpaces + "]";
} |
697210_9 | public String generateMaqlCreate() {
String script = "# This is MAQL script that generates project logical model.\n# See the MAQL documentation " +
"at http://developer.gooddata.com/reference/maql/maql-ddl for more details.\n\n";
script += "# Create dataset. Dataset groups all following logical mode... |
702991_0 | public synchronized ValidationResult validate(DataSource source)
throws ValidationException {
DocumentHandler handler = createDocumentHandler(source);
try {
// syntax (javacc) validation
try {
PDFParser parser = new PDFParser(source.getInputStream());
parser.PDF();
handler.setParser(parser);
} catch (I... |
702991_1 | public List<ValidationError> validateMetadataSynchronization(PDDocument document, XMPMetadata metadata)
throws ValidationException {
List<ValidationError> ve = new ArrayList<ValidationError>();
if (document == null) {
throw new ValidationException("Document provided is null");
} else {
PDDocumentInformat... |
702991_2 | public List<ValidationError> validateMetadataSynchronization(PDDocument document, XMPMetadata metadata)
throws ValidationException {
List<ValidationError> ve = new ArrayList<ValidationError>();
if (document == null) {
throw new ValidationException("Document provided is null");
} else {
PDDocumentInformat... |
702991_3 | public List<ValidationError> validateMetadataSynchronization(PDDocument document, XMPMetadata metadata)
throws ValidationException {
List<ValidationError> ve = new ArrayList<ValidationError>();
if (document == null) {
throw new ValidationException("Document provided is null");
} else {
PDDocumentInformat... |
702991_4 | public List<ValidationError> validateMetadataSynchronization(PDDocument document, XMPMetadata metadata)
throws ValidationException {
List<ValidationError> ve = new ArrayList<ValidationError>();
if (document == null) {
throw new ValidationException("Document provided is null");
} else {
PDDocumentInformat... |
702991_5 | public List<ValidationError> validateMetadataSynchronization(PDDocument document, XMPMetadata metadata)
throws ValidationException {
List<ValidationError> ve = new ArrayList<ValidationError>();
if (document == null) {
throw new ValidationException("Document provided is null");
} else {
PDDocumentInformat... |
702991_6 | public List<ValidationError> validateMetadataSynchronization(PDDocument document, XMPMetadata metadata)
throws ValidationException {
List<ValidationError> ve = new ArrayList<ValidationError>();
if (document == null) {
throw new ValidationException("Document provided is null");
} else {
PDDocumentInformat... |
702991_7 | public List<ValidationError> validateMetadataSynchronization(PDDocument document, XMPMetadata metadata)
throws ValidationException {
List<ValidationError> ve = new ArrayList<ValidationError>();
if (document == null) {
throw new ValidationException("Document provided is null");
} else {
PDDocumentInformat... |
702991_8 | public List<ValidationError> validateMetadataSynchronization(PDDocument document, XMPMetadata metadata)
throws ValidationException {
List<ValidationError> ve = new ArrayList<ValidationError>();
if (document == null) {
throw new ValidationException("Document provided is null");
} else {
PDDocumentInformat... |
702991_9 | public List<ValidationError> validateMetadataSynchronization(PDDocument document, XMPMetadata metadata)
throws ValidationException {
List<ValidationError> ve = new ArrayList<ValidationError>();
if (document == null) {
throw new ValidationException("Document provided is null");
} else {
PDDocumentInformat... |
710733_0 | @Override
public Iterable<Row<T, K>> scan(K startRow, K stopRow) throws AvroBaseException {
BasicDBObject b = b();
if (startRow != null) {
if (stopRow == null) {
b.put("id", b("$gte", startRow));
} else {
BasicDBObject query = b("$gte", startRow);
query.put("$lt", stopRow);
b = b("id... |
710733_1 | @Override
public byte[] create(T value) throws AvroBaseException {
switch (createType) {
case CUSTOM: {
// loop until we don't get an ID collision
byte[] row;
do {
row = keygen.get();
} while (!put(row, value, 0));
return row;
}
case RANDOM: {
// loop until we d... |
710733_2 | @Override
public Iterable<Row<T, byte[]>> scan(byte[] startRow, byte[] stopRow) throws AvroBaseException {
Scan scan = new Scan();
scan.addFamily(family);
if (startRow != null) {
scan.setStartRow(startRow);
}
if (stopRow != null) {
scan.setStopRow(stopRow);
}
HTableInterface table = pool.getTable(... |
710733_3 | @Override
public Row<T, byte[]> get(byte[] row) throws AvroBaseException {
HTableInterface table = getTable();
try {
Result result = getHBaseRow(table, row, family);
// TODO: This is working around a bug in HBASE 0.89
if (row.length == 0 && !Bytes.equals(row, result.getRow())) {
return null;
}... |
710733_4 | public static <T extends SpecificRecord, K, Q> AvroBase<T, K> createAvroBase(Module module, Class<? extends AvroBase> clazz, final AvroFormat format) throws AvroBaseException {
Injector injector = Guice.createInjector(module);
return injector.createChildInjector(new Module() {
@Override
public void configur... |
710733_5 | public Row<T, K> clone() {
Schema schema = value.getSchema();
T newvalue;
try {
newvalue = (T) Class.forName(schema.getFullName()).newInstance();
} catch (Exception e) {
throw new AvroBaseException("Could not clone row", e);
}
for (Schema.Field field : schema.getFields()) {
int pos = field.pos()... |
710733_6 | @Override
public void delete(final String row) throws AvroBaseException {
try {
boolean returned = false;
Jedis j = pool.getResource();
try {
j.select(db);
List<Object> results;
do {
results = j.multi(new TransactionBlock() {
@Override
public void execute() th... |
710733_7 | @Override
public String create(T value) throws AvroBaseException {
String row;
do {
row = kg.get();
} while(!put(row, value, 0));
return row;
} |
710733_8 | @Override
public Row<T, K> get(byte[] row) throws AvroBaseException {
try {
ResultSet rs = session.find(new String[]{new String(row)});
if (rs.next()) {
int schema_id = rs.getInt(1);
long version = rs.getLong(2);
AvroFormat format = AvroFormat.values()[rs.getByte(3)];
byte[] avro = rs.... |
710733_9 | @Override
public Row<T, K> get(byte[] row) throws AvroBaseException {
try {
ResultSet rs = session.find(new String[]{new String(row)});
if (rs.next()) {
int schema_id = rs.getInt(1);
long version = rs.getLong(2);
AvroFormat format = AvroFormat.values()[rs.getByte(3)];
byte[] avro = rs.... |
711931_0 | public void fetchAlbums(StatusUpdate su, boolean async) {
throw new RuntimeException("This method is not available on this protocol");
} |
711931_1 | public void fetchAlbums(StatusUpdate su, boolean async) {
throw new RuntimeException("This method is not available on this protocol");
} |
711931_2 | public boolean checkAuth() {
throw new RuntimeException("This method is not available on this protocol");
} |
711931_3 | public boolean checkAuth() {
throw new RuntimeException("This method is not available on this protocol");
} |
711931_4 | public boolean checkAuth() {
throw new RuntimeException("This method is not available on this protocol");
} |
711931_5 | public void uploadFiles(StatusUpdate su, boolean async) {
throw new RuntimeException("This method is not available on this protocol");
} |
711931_6 | public void uploadFiles(StatusUpdate su, boolean async) {
throw new RuntimeException("This method is not available on this protocol");
} |
711931_7 | public void newAlbum(StatusUpdate su, Album album, boolean async) {
throw new RuntimeException("This method is not available on this protocol");
} |
726694_0 | public Boolean valid()
{
return max.getX() >= min.getX() && max.getY() >= min.getY();
} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.