id
stringlengths
7
14
text
stringlengths
1
106k
4237245_9
public synchronized E set(int index, E element) { if (index >= elementCount) throw new ArrayIndexOutOfBoundsException(index); E oldValue = (E) elementData[index]; elementData[index] = element; oldValue.getPool().releasePoolObject(oldValue); return oldValue; }
4238016_0
@Override public boolean isValid(String value, ConstraintValidatorContext context) { if (StringUtils.isBlank(value)) { return true; } return Pattern.matches("^" + DocumentrConstants.BRANCH_NAME_PATTERN + "$", value); //$NON-NLS-1$ //$NON-NLS-2$ }
4238016_1
@Override public boolean isValid(String value, ConstraintValidatorContext context) { if (StringUtils.isBlank(value)) { return true; } return Pattern.matches("^" + DocumentrConstants.PROJECT_NAME_PATTERN + "$", value); //$NON-NLS-1$ //$NON-NLS-2$ }
4238016_2
@Override public boolean isValid(String value, ConstraintValidatorContext context) { if (StringUtils.isBlank(value)) { return true; } try { return userStore.getRole(value) != null; } catch (IOException e) { throw new ValidationException(e); } }
4238016_3
@Override public boolean isValid(String value, ConstraintValidatorContext context) { if (StringUtils.isBlank(value)) { return true; } return Pattern.matches("^" + DocumentrConstants.USER_LOGIN_NAME_PATTERN + "$", value); //$NON-NLS-1$ //$NON-NLS-2$ }
4238016_4
@Override public boolean isValid(String value, ConstraintValidatorContext context) { if (StringUtils.isBlank(value)) { return true; } return !globalRepositoryManager.listProjects().contains(value); }
4238016_5
@Override public boolean isValid(String value, ConstraintValidatorContext context) { if (StringUtils.isBlank(value)) { return true; } return !Pattern.matches("^" + DocumentrConstants.BRANCH_NAMES_BLACKLIST_PATTERN + "$", value); //$NON-NLS-1$ //$NON-NLS-2$ }
4238016_6
@Override public boolean isValid(String value, ConstraintValidatorContext context) { if (StringUtils.isBlank(value)) { return true; } return Pattern.matches("^" + DocumentrConstants.ROLE_NAME_PATTERN + "$", value); //$NON-NLS-1$ //$NON-NLS-2$ }
4238016_7
@Override public boolean isValid(String value, ConstraintValidatorContext context) { if (StringUtils.isBlank(value)) { return true; } return Pattern.matches("^" + DocumentrConstants.PAGE_PATH_PATTERN + "$", value); //$NON-NLS-1$ //$NON-NLS-2$ }
4238016_8
@Override public boolean isValid(String value, ConstraintValidatorContext context) { if (StringUtils.isBlank(value)) { return true; } return Pattern.matches("^" + DocumentrConstants.MACRO_NAME_PATTERN + "$", value); //$NON-NLS-1$ //$NON-NLS-2$ }
4238016_9
@Override public boolean isValid(String value, ConstraintValidatorContext context) { if (StringUtils.isBlank(value)) { return true; } return globalRepositoryManager.listProjects().contains(value); }
4242485_0
@Override public int compareTo(@Nullable final ReadableVersionNumber other) { int result = 0; if (other == null) { result = -1; } else { Check.notNull(other.getGroups(), "other.getGroups()"); final int length = groups.size() < other.getGroups().size() ? groups.size() : other.getGroups().size(); final Natural...
4242485_1
@Override public int compareTo(@Nullable final ReadableVersionNumber other) { int result = 0; if (other == null) { result = -1; } else { Check.notNull(other.getGroups(), "other.getGroups()"); final int length = groups.size() < other.getGroups().size() ? groups.size() : other.getGroups().size(); final Natural...
4242485_2
@Override public int compareTo(@Nullable final ReadableVersionNumber other) { int result = 0; if (other == null) { result = -1; } else { Check.notNull(other.getGroups(), "other.getGroups()"); final int length = groups.size() < other.getGroups().size() ? groups.size() : other.getGroups().size(); final Natural...
4242485_3
@Override public int compareTo(@Nullable final ReadableVersionNumber other) { int result = 0; if (other == null) { result = -1; } else { Check.notNull(other.getGroups(), "other.getGroups()"); final int length = groups.size() < other.getGroups().size() ? groups.size() : other.getGroups().size(); final Natural...
4242485_4
@Override public int compareTo(@Nullable final ReadableVersionNumber other) { int result = 0; if (other == null) { result = -1; } else { Check.notNull(other.getGroups(), "other.getGroups()"); final int length = groups.size() < other.getGroups().size() ? groups.size() : other.getGroups().size(); final Natural...
4242485_5
@Override public boolean equals(final Object obj) { if (this == obj) { return true; } if (obj == null) { return false; } if (getClass() != obj.getClass()) { return false; } final VersionNumber other = (VersionNumber) obj; if (!groups.equals(other.groups)) { return false; } if (!extension.equals(other....
4242485_6
private static String toVersionString(@Nonnull final List<String> groups) { final StringBuilder builder = new StringBuilder(6); int count = 0; for (final String segment : groups) { if (EMPTY_GROUP.equals(segment)) { break; } else { if (count > 0) { builder.append(SEPARATOR); } builder.append(segm...
4242485_7
@Override public boolean equals(final Object obj) { if (this == obj) { return true; } if (obj == null) { return false; } if (getClass() != obj.getClass()) { return false; } final VersionNumber other = (VersionNumber) obj; if (!groups.equals(other.groups)) { return false; } if (!extension.equals(other....
4242485_8
@Override public boolean equals(final Object obj) { if (this == obj) { return true; } if (obj == null) { return false; } if (getClass() != obj.getClass()) { return false; } final VersionNumber other = (VersionNumber) obj; if (!groups.equals(other.groups)) { return false; } if (!extension.equals(other....
4242485_9
@Override public boolean equals(final Object obj) { if (this == obj) { return true; } if (obj == null) { return false; } if (getClass() != obj.getClass()) { return false; } final VersionNumber other = (VersionNumber) obj; if (!groups.equals(other.groups)) { return false; } if (!extension.equals(other....
4256066_0
@Override public Void convert(final HttpClientResponse response, final InputStream inputStream) throws IOException { switch(response.getStatusCode()) { case 201: case 204: LOG.debug("Return code is %d, finishing.", response.getStatusCode()); return null; case 200: try (fi...
4265123_0
String getGuiceModuleName(String transformerClazzName) { String guiceModuleClazzName = StringUtils.replace(transformerClazzName, "Transformer", "Module"); return guiceModuleClazzName; }
4265123_1
public Level getLevel(String level) { if (level.equals("INFO")) { return Level.INFO; } else if (level.equals("FINE")) { return Level.FINE; } else if (level.equals("FINER")) { return Level.FINER; } else if (level.equals("FINEST")) { return Level.FINEST; } else if (level.equals("WARNING")) { return Level.W...
4265123_2
@SuppressWarnings("unchecked") public TypeDeclaration generateClass(Classifier clazz, AST ast, CompilationUnit cu) { String className = getClassName(clazz); TypeDeclaration td = ast.newTypeDeclaration(); td.setInterface(false); td.modifiers().add( ast.newModifier(Modifier.ModifierKeyword.PUBLIC_KEYWORD)); td....
4265123_3
@SuppressWarnings("unchecked") public TypeDeclaration generateClass(Classifier clazz, AST ast, CompilationUnit cu) { String className = getClassName(clazz); TypeDeclaration td = ast.newTypeDeclaration(); td.setInterface(false); td.modifiers().add( ast.newModifier(Modifier.ModifierKeyword.PUBLIC_KEYWORD)); td....
4265123_4
@SuppressWarnings("unchecked") public TypeDeclaration generateClass(Classifier clazz, AST ast, CompilationUnit cu) { String className = getClassName(clazz); TypeDeclaration td = ast.newTypeDeclaration(); td.setInterface(false); td.modifiers().add( ast.newModifier(Modifier.ModifierKeyword.PUBLIC_KEYWORD)); td....
4265123_5
@SuppressWarnings("unchecked") public void generateSerialVersionUID(Classifier clazz, AST ast, TypeDeclaration td) { VariableDeclarationFragment fragment = ast .newVariableDeclarationFragment(); SimpleName variableName = ast.newSimpleName("serialVersionUID"); fragment.setName(variableName); NumberLiteral initi...
4265123_6
public void generateConstructors(Classifier clazz, AST ast, TypeDeclaration td) { // Default constructor generateConstructorDefault(clazz, ast, td); // Param: Throwable exception generateConstructorWithParams(clazz, ast, td, new String[] { "Throwable" }, new String[] { "cause" }); // Param: String message ge...
4265123_7
@SuppressWarnings("unchecked") public void generateConstructorWithParams(Classifier clazz, AST ast, TypeDeclaration td, String[] varTypes, String[] varNames) { MethodDeclaration constructor = ast.newMethodDeclaration(); constructor.setConstructor(true); constructor.setName(ast.newSimpleName(clazz.getName())); con...
4265123_8
public void generatePackage(Classifier clazz, AST ast, CompilationUnit cu) { PackageDeclaration pd = ast.newPackageDeclaration(); String fullPackageName = getFullPackageName(clazz); pd.setName(ast.newName(fullPackageName)); Date now = new Date(); String commentDate = "Generation date: " + now.toString() + "."; in...
4265123_9
public CompilationUnit generateEnum(Classifier clazz, String sourceDirectoryPackageName) { this.sourceDirectoryPackageName = sourceDirectoryPackageName; AST ast = AST.newAST(AST.JLS3); CompilationUnit cu = ast.newCompilationUnit(); generatePackage(clazz, ast, cu); EnumDeclaration ed = generateEnum(clazz, ast, cu...
4265955_0
public long[] getData() { return data; }
4265955_1
public long[] getData() { return data; }
4265955_2
public long[] getData() { return data; }
4265955_3
public Map<String,long[]> getData() { Map<String,long[]> result = new HashMap(); for (Map.Entry e : data.entrySet()) { result.put((String)e.getKey(), ((TimeAggregator)e.getValue()).getData()); } return result; }
4265955_4
@Override public FileDataStore createDataStore(Map<String, Serializable> params) throws IOException { File file = fileFromParams(params); URI namespace = (URI) NAMESPACEP.lookUp(params); return createDataStoreFromFile(file, namespace); }
4265955_5
@Override public FileDataStore createDataStore(Map<String, Serializable> params) throws IOException { File file = fileFromParams(params); URI namespace = (URI) NAMESPACEP.lookUp(params); return createDataStoreFromFile(file, namespace); }
4265955_6
@Override public FileDataStore createDataStore(Map<String, Serializable> params) throws IOException { File file = fileFromParams(params); URI namespace = (URI) NAMESPACEP.lookUp(params); return createDataStoreFromFile(file, namespace); }
4265955_7
@Override public String getTypeName(URL url) throws IOException { DataStore ds = createDataStore(url); String[] names = ds.getTypeNames(); assert names.length == 1 : "Invalid number of type names for csv file store"; ds.dispose(); return names[0]; }
4265955_8
@Override public boolean canProcess(Map<String, Serializable> params) { try { File file = fileFromParams(params); if (file != null) { return canProcessExtension(file.getPath()); } } catch (IOException e) { } return false; }
4265955_9
@Override public boolean canProcess(Map<String, Serializable> params) { try { File file = fileFromParams(params); if (file != null) { return canProcessExtension(file.getPath()); } } catch (IOException e) { } return false; }
4276349_0
public ServiceURI(final String uri) throws URISyntaxException { this(new URI(uri)); }
4276349_1
@Override public void startServer() { super.startServer(); try { LOG.info("Creating discovery root nodes (%s)", discoveryConfig.getRoot()); final Future<ZookeeperJob> jobFuture = jobProcessor.submitJob(new BuildPathJob(discoveryConfig.getRoot()), 5, 1, TimeUnit.MINUTES); if (jobFuture ==...
4276349_2
@Provides @Singleton AnnouncementConfig getAnnouncementConfig(final Config config) { final AnnouncementConfig baseConfig = config.getBean(AnnouncementConfig.class); return new AnnouncementConfig(baseConfig) { @Override public String getServiceName() { return ObjectUtils.toString(supe...
4276349_3
@Provides @Singleton AnnouncementConfig getAnnouncementConfig(final Config config) { final AnnouncementConfig baseConfig = config.getBean(AnnouncementConfig.class); return new AnnouncementConfig(baseConfig) { @Override public String getServiceName() { return ObjectUtils.toString(supe...
4276349_4
@Provides @Singleton AnnouncementConfig getAnnouncementConfig(final Config config) { final AnnouncementConfig baseConfig = config.getBean(AnnouncementConfig.class); return new AnnouncementConfig(baseConfig) { @Override public String getServiceName() { return ObjectUtils.toString(supe...
4276349_5
@Provides @Singleton AnnouncementConfig getAnnouncementConfig(final Config config) { final AnnouncementConfig baseConfig = config.getBean(AnnouncementConfig.class); return new AnnouncementConfig(baseConfig) { @Override public String getServiceName() { return ObjectUtils.toString(supe...
4276349_6
@Provides @Singleton AnnouncementConfig getAnnouncementConfig(final Config config) { final AnnouncementConfig baseConfig = config.getBean(AnnouncementConfig.class); return new AnnouncementConfig(baseConfig) { @Override public String getServiceName() { return ObjectUtils.toString(supe...
4276349_7
@Provides @Singleton AnnouncementConfig getAnnouncementConfig(final Config config) { final AnnouncementConfig baseConfig = config.getBean(AnnouncementConfig.class); return new AnnouncementConfig(baseConfig) { @Override public String getServiceName() { return ObjectUtils.toString(supe...
4276357_0
@VisibleForTesting static boolean canBypassScan( List<String> includedFiles, List<String> excludedFiles) { // The directory scan can be bypassed, IFF // 1) There are no excludes // 2) There is at least one include string // 3) In the include strings, the following apply // a) No *...
4276357_1
@VisibleForTesting static boolean canBypassScan( List<String> includedFiles, List<String> excludedFiles) { // The directory scan can be bypassed, IFF // 1) There are no excludes // 2) There is at least one include string // 3) In the include strings, the following apply // a) No *...
4276357_2
public void parse(Iterable<URI> inputs) throws Exception { Preconditions.checkArgument( inputs != null && inputs.iterator().hasNext(), "No input files!"); LOG.info("Parsing Thrift IDL from %s...", inputs); final Map<String, SwiftDocumentContext> contexts = Maps.newHashMap(); for ...
4276357_3
public static String[] extractParameterNames(AccessibleObject methodOrConstructor) { String[] names = PARANAMER.lookupParameterNames(methodOrConstructor); return names; }
4276357_4
public static String[] extractParameterNames(AccessibleObject methodOrConstructor) { String[] names = PARANAMER.lookupParameterNames(methodOrConstructor); return names; }
4276357_5
@Override public ThriftStructMetadata build() { // this code assumes that metadata is clean metadataErrors.throwIfHasErrors(); // builder constructor injection ThriftMethodInjection builderMethodInjection = buildBuilderConstructorInjections(); // constructor injection (or factory method for builder)...
4276357_6
@Override public ThriftStructMetadata build() { // this code assumes that metadata is clean metadataErrors.throwIfHasErrors(); // builder constructor injection ThriftMethodInjection builderMethodInjection = buildBuilderConstructorInjections(); // constructor injection (or factory method for builder)...
4276357_7
@Override public ThriftStructMetadata build() { // this code assumes that metadata is clean metadataErrors.throwIfHasErrors(); // builder constructor injection ThriftMethodInjection builderMethodInjection = buildBuilderConstructorInjections(); // constructor injection (or factory method for builder)...
4276357_8
@Override public ThriftStructMetadata build() { // this code assumes that metadata is clean metadataErrors.throwIfHasErrors(); // builder constructor injection ThriftMethodInjection builderMethodInjection = buildBuilderConstructorInjections(); // constructor injection (or factory method for builder)...
4276357_9
@Override public ThriftStructMetadata build() { // this code assumes that metadata is clean metadataErrors.throwIfHasErrors(); // builder constructor injection ThriftMethodInjection builderMethodInjection = buildBuilderConstructorInjections(); // constructor injection (or factory method for builder)...
4288215_0
@POST @Produces(MediaType.TEXT_PLAIN) @Consumes(MediaType.APPLICATION_JSON) public String registerPatient(Patient patient) { PatientAccount patientAccount = new PatientAccount(patient); return patientInformationService.registerPatient(patientAccount); }
4288215_1
@Path("{guid}") @POST @Consumes(MediaType.APPLICATION_JSON) public void uploadPatientData(@PathParam("guid") String guid, PatientData patientData) { patientDataService.addPatientData(guid, patientData); }
4288215_2
@RolesAllowed({OAuthToken.PLC_ROLE }) @POST @Path("qualification_request") @Produces(MediaType.TEXT_PLAIN) @Consumes(MediaType.APPLICATION_JSON) public String qualificationRequest(ResearchEntity re) { OAuthParameters params = new OAuthParameters(); params.readRequest(new OAuthServerRequest(httpContext.getReques...
4288215_3
@RolesAllowed({OAuthToken.RESEARCHER_ROLE }) @POST @Path("shared/summary") @Produces(MediaType.APPLICATION_JSON) @Consumes(MediaType.APPLICATION_JSON) public Summary dataSummary(Filter filter) { return patientDataService.getSummary(filter); }
4288215_4
@RolesAllowed({OAuthToken.RESEARCHER_ROLE }) @POST @Path("shared") @Produces(MediaType.APPLICATION_JSON) @Consumes(MediaType.APPLICATION_JSON) public DownloadDetails requestData(Filter filter) { return patientDataService.getDownloadDetails(filter); }
4288215_5
@Path("shared/download/{fileName}") @RolesAllowed({OAuthToken.RESEARCHER_ROLE }) @GET public Response downloadPatientData(@PathParam("fileName") final String fileName) { final String filePath = appResources.getStringResource(FILE_LOCATION_KEY); StreamingOutput output = new StreamingOutput() { @Override ...
4288215_6
@Override public void destroy() { //Do nothing }
4288215_7
@Override public void init(FilterConfig config) { //Do nothing }
4288215_8
@SuppressWarnings("PMD.SignatureDeclareThrowsException") @Override public String intercept(ActionInvocation invocation) throws Exception { Object actionObject = invocation.getAction(); if (checkSkipValidation(actionObject, invocation.getProxy().getMethod())) { return invocation.invoke(); } Valid...
4288215_9
public void setExcludeMethods(String excludeMethods) { excludedMethodsSet.clear(); if (StringUtils.isNotBlank(excludeMethods)) { String[] excludedMethodsList = excludeMethods.split(","); for (String excludedMethod : excludedMethodsList) { if (StringUtils.isNotBlank(excludedMethod)) {...
4291387_0
synchronized void setZkProperty(String key, String value) throws Exception { final String path = configRootPath + "/" + key; byte[] data = value.getBytes(charset); try { // attempt to create (intentionally doing this instead of checkExists()) client.create().creatingParentsIfNeeded()....
4291387_1
synchronized void setZkProperty(String key, String value) throws Exception { final String path = configRootPath + "/" + key; byte[] data = value.getBytes(charset); try { // attempt to create (intentionally doing this instead of checkExists()) client.create().creatingParentsIfNeeded()....
4291387_2
synchronized void setZkProperty(String key, String value) throws Exception { final String path = configRootPath + "/" + key; byte[] data = value.getBytes(charset); try { // attempt to create (intentionally doing this instead of checkExists()) client.create().creatingParentsIfNeeded()....
4291387_3
@Override public PollResult poll(boolean initial, Object checkPoint) throws IOException, AmazonServiceException { GetObjectRequest s3request = new GetObjectRequest(bucketName, key); InputStream is = null; try { S3Object result = client.getObject(s3request); is = result.getObjectContent(); ...
4291387_4
@Override public PollResult poll(boolean initial, Object checkPoint) throws IOException, AmazonServiceException { GetObjectRequest s3request = new GetObjectRequest(bucketName, key); InputStream is = null; try { S3Object result = client.getObject(s3request); is = result.getObjectContent(); ...
4291387_5
@Override public PollResult poll(boolean initial, Object checkPoint) throws Exception { Map<String, Object> map = new HashMap<String, Object>(); for(PropertyWithDeploymentContext prop: tableCache.getProperties()){ if(prop.getContextKey() == contextKey && prop.getContextValue() == null){ map....
4291387_6
@Override public PollResult poll(boolean initial, Object checkPoint) throws Exception { String table = tableName.get(); Map<String, Object> map = loadPropertiesFromTable(table); log.info("Successfully polled Dynamo for a new configuration based on table:" + table); return PollResult.createFull(map); }
4291387_7
@Override public PollResult poll(boolean initial, Object checkPoint) throws Exception { String table = tableName.get(); Map<String, Object> map = loadPropertiesFromTable(table); log.info("Successfully polled Dynamo for a new configuration based on table:" + table); return PollResult.createFull(map); }
4291387_8
public Collection<PropertyWithDeploymentContext> getProperties() { return cachedTable.values(); }
4291387_9
}
4298283_0
public static void initializeRGBChannels(Jp2_channels channels) throws KduException { final int numColours = 3; channels.Init(numColours); // channels.Set_colour_mapping(0, 0, 0); // channels.Set_colour_mapping(1, 0, 1); // channels.Set_colour_mapping(2, 0, 2); Method setColourMapping; Objec...
4298283_1
public static void initializeRGBChannels(Jp2_channels channels) throws KduException { final int numColours = 3; channels.Init(numColours); // channels.Set_colour_mapping(0, 0, 0); // channels.Set_colour_mapping(1, 0, 1); // channels.Set_colour_mapping(2, 0, 2); Method setColourMapping; Objec...
4298401_0
public static <T> T baseEquals(T object, Object other) { if (object == other || (other != null && object.getClass() == other.getClass())) { return (T) other; } return null; }
4298401_1
public static Date newDateFromString(String value) { return new Date(newInstantFromString(value).getMillis()); }
4298401_2
public static void checkOffsetAndLimit(int offset, int limit) { Preconditions.checkArgument(offset >= 0, "Offset should be greater or equal 0."); Preconditions.checkArgument(limit > 0, "Limit should be greater than 0."); }
4298401_3
public static void checkOffsetAndLimit(int offset, int limit) { Preconditions.checkArgument(offset >= 0, "Offset should be greater or equal 0."); Preconditions.checkArgument(limit > 0, "Limit should be greater than 0."); }
4298401_4
public static void clearCachedResources() { clientStaticResources.invalidateAll(); }
4298676_0
@Override @Transactional(readOnly = true) public List<Customer> findAll() { SQLQuery allCustomersQuery = qdslTemplate.newSqlQuery().from(qCustomer) .leftJoin(qCustomer._addressCustomerRef, qAddress); return qdslTemplate.query(allCustomersQuery, new CustomerListExtractor(), customerAddressProjection); }
4298676_1
@Override @Transactional(readOnly = true) public Customer findById(Long id) { if (id == null) { return null; } return findOne(qCustomer.id.eq(id)); }
4298676_2
@Override @Transactional(readOnly = true) public Customer findByEmailAddress(EmailAddress emailAddress) { if (emailAddress == null) { return null; } return findOne(qCustomer.emailAddress.eq(emailAddress.toString())); }
4298676_3
@Override public void save(final Customer customer) { if (customer.getId() == null) { Long generatedKey = qdslTemplate.insertWithKey(qCustomer, new SqlInsertWithKeyCallback<Long>() { @Override public Long doInSqlInsertWithKeyClause(SQLInsertClause insert) throws SQLException { return insert .columns(...
4298816_0
protected Metadata getMetadata() { return metadata; }
4298816_1
@VisibleForTesting static List<FileLinkerLine> getFileInfo(Reader reader) { return getFileInfo(reader, '\t'); }
4298816_2
@VisibleForTesting static List<FileLinkerLine> getFileInfo(Reader reader) { return getFileInfo(reader, '\t'); }
4298816_3
@VisibleForTesting static List<FileLinkerLine> getFileInfo(Reader reader) { return getFileInfo(reader, '\t'); }
4298816_4
private void bulkInsert() { Map<String, Map<String, Map<String, String>>> bulkMap = new HashMap<>(); if (this.parseFile(bulkMap)) { for (Map.Entry<String, Map<String, Map<String, String>>> entry : bulkMap.entrySet()) { if (entry.getKey().equals("w") || entry.getKey().equals("workflow-accesio...
4298816_5
public static void main(String[] args) { new Runner().run(args); }
4298816_6
public static boolean isOozie(final String engine) { return engine != null && engine.startsWith("oozie"); }
4298816_7
public static boolean isWhiteStar(final String engine) { return engine != null && engine.startsWith("whitestar"); }
4298816_8
public static boolean isWhiteStarParallel(final String engine) { return engine != null && engine.startsWith(TYPES.whitestar_parallel.getCliString()); }