Unnamed: 0 int64 0 9.45k | cwe_id stringclasses 1
value | source stringlengths 37 2.53k | target stringlengths 19 2.4k |
|---|---|---|---|
400 | private synchronized void loadQueue(){
if (!isQueueLoaderActive()) {
queueFuture = schedExecutor.submit(new Callable<List<FeedItem>>() {
@Override
public List<FeedItem> call() throws Exception {
return DBReader.getQueue();
}
});
}
} | private synchronized void loadQueue(){
if (!isQueueLoaderActive()) {
queueFuture = schedExecutor.submit(DBReader::getQueue);
}
} | |
401 | public void editInformation(){
String newName = txtFullName.getText();
String newPassword = txtPassword.getText();
String newEmail = txtEmail.getText();
String newBirthDate = txtDOB.getText();
if (!RegController.validFullNamePattern(txtFullName.getText())) {
updateStatus.setText("Inval... | public void editInformation(){
String newName = txtFullName.getText();
String newPassword = txtPassword.getText();
String newEmail = txtEmail.getText();
String newBirthDate = txtDOB.getText();
if (validFullNamePattern(txtFullName.getText())) {
updateStatus.setText("Invalid name input!"... | |
402 | public void onTimer(String timerId, BoundedWindow window, Instant timestamp, TimeDomain timeDomain){
Preconditions.checkNotNull(currentTimerKey, "Key for timer needs to be set before calling onTimer");
Preconditions.checkNotNull(remoteBundle, "Call to onTimer outside of a bundle");
LOG.debug("timer callb... | public void onTimer(String timerId, BoundedWindow window, Instant timestamp, TimeDomain timeDomain){
Object timerKey = keyForTimer.get();
Preconditions.checkNotNull(timerKey, "Key for timer needs to be set before calling onTimer");
Preconditions.checkNotNull(remoteBundle, "Call to onTimer outside of a bu... | |
403 | public void getDefinitions_CachedNotCachedWordsGiven_OriginalCall() throws Exception{
String words = "home,car";
Set<String> validWords = new HashSet<>();
validWords.add("home");
validWords.add("car");
Set<String> cachedWord = new HashSet<>();
cachedWord.add("home");
String word = "ca... | public void getDefinitions_CachedNotCachedWordsGiven_OriginalCall() throws Exception{
Set<String> validWords = new HashSet<>();
validWords.add("home");
validWords.add("car");
validWords.add("drive");
DefinitionsResource resource = new DefinitionResourceBuilder().words(validWords).build();
... | |
404 | public static void storeUserCookie(HttpServletResponse response, UserAccount user){
System.out.println("Store user cookie");
Cookie cookieUserName = new Cookie(ATT_NAME_USER_NAME, user.getNickName());
cookieUserName.setMaxAge(24 * 60 * 60);
response.addCookie(cookieUserName);
} | public static void storeUserCookie(HttpServletResponse response, UserAccount user){
Cookie cookieUserName = new Cookie(ATT_NAME_USER_NAME, user.getNickName());
cookieUserName.setMaxAge(24 * 60 * 60);
response.addCookie(cookieUserName);
} | |
405 | public void runBreadthFirstSearch(int startingIndex){
MyQueue paths = new MyQueue();
int[] initialPath = { startingIndex };
paths.enqueue(initialPath);
int[] nextPath;
while (!paths.empty()) {
nextPath = paths.dequeue();
if (nextPath.length == vertices.length) {
S... | public void runBreadthFirstSearch(int startingIndex){
MyQueue paths = new MyQueue();
int[] initialPath = { startingIndex };
paths.enqueue(initialPath);
int[] nextPath;
while (!paths.empty()) {
nextPath = paths.dequeue();
if (nextPath.length == vertices.length) {
w... | |
406 | public Result authedDatasource(@ApiIgnore @RequestAttribute(value = Constants.SESSION_USER) User loginUser, @RequestParam("userId") Integer userId){
logger.info("authorized data source, login user:{}, authorized useId:{}", loginUser.getUserName(), userId);
Map<String, Object> result = dataSourceService.authed... | public Result<List<DataSource>> authedDatasource(@ApiIgnore @RequestAttribute(value = Constants.SESSION_USER) User loginUser, @RequestParam("userId") Integer userId){
logger.info("authorized data source, login user:{}, authorized useId:{}", loginUser.getUserName(), userId);
return dataSourceService.authedData... | |
407 | public void testInsert(){
GeneratedAlwaysRecord record = new GeneratedAlwaysRecord();
record.setId(100);
record.setFirstName("Bob");
record.setLastName("Jones");
InsertStatementProvider<GeneratedAlwaysRecord> insertStatement = insert(record).into(generatedAlways).map(id).toProperty("id").map(fi... | public void testInsert(){
GeneratedAlwaysRecord record = new GeneratedAlwaysRecord();
record.setId(100);
record.setFirstName("Bob");
record.setLastName("Jones");
InsertStatementProvider<GeneratedAlwaysRecord> insertStatement = insert(record).into(generatedAlways).map(id).toProperty("id").map(fi... | |
408 | public void testFindLatestDumpFileException() throws FileNotFoundException{
File dumpFolder = Mockito.mock(File.class);
File[] files = new File[0];
Mockito.when(dumpFolder.listFiles(Mockito.any(FilenameFilter.class))).thenReturn(files);
DumpFinder dumpFinder = new DumpFinder();
dumpFinder.setDu... | public void testFindLatestDumpFileException() throws FileNotFoundException{
File dumpFolder = Mockito.mock(File.class);
File[] files = new File[0];
Mockito.when(dumpFolder.listFiles(Mockito.any(FilenameFilter.class))).thenReturn(files);
DumpFinder dumpFinder = new DumpFinder();
dumpFinder.findL... | |
409 | public String deleteCaseTask(InforContext context, String caseTaskID) throws InforException{
MP3657_DeleteCaseManagementTask_001 deleteCaseTask = new MP3657_DeleteCaseManagementTask_001();
CASEMANAGEMENTTASKID_Type caseManagementTaskIdType = new CASEMANAGEMENTTASKID_Type();
caseManagementTaskIdType.setCA... | public String deleteCaseTask(InforContext context, String caseTaskID) throws InforException{
MP3657_DeleteCaseManagementTask_001 deleteCaseTask = new MP3657_DeleteCaseManagementTask_001();
CASEMANAGEMENTTASKID_Type caseManagementTaskIdType = new CASEMANAGEMENTTASKID_Type();
caseManagementTaskIdType.setCA... | |
410 | protected static Material getFirstMaterialItemWillTouchOnUse(Entity user, World world, Set<Material> materials, double itemReach, @Nullable EnumFacing facing, @Nullable BlockPos targetPos){
final Vec3d posVec = user.getPositionEyes(1.0F);
final Vec3d lookVec = user.getLook(1.0F);
final byte scanSensitivi... | protected static Material getFirstMaterialItemWillTouchOnUse(Entity user, World world, Set<Material> materials, double itemReach, @Nullable EnumFacing facing, @Nullable BlockPos targetPos){
final Vec3d posVec = user.getPositionEyes(1.0F);
final Vec3d lookVec = user.getLook(1.0F);
final byte scanSensitivi... | |
411 | void initializeInstantiationMetric(final boolean instantiated){
helixClusterManagerInstantiationFailed = new Gauge<Long>() {
@Override
public Long getValue() {
return instantiated ? 0L : 1L;
}
};
registry.register(MetricRegistry.name(HelixClusterManager.class, "... | void initializeInstantiationMetric(final boolean instantiated){
helixClusterManagerInstantiationFailed = () -> instantiated ? 0L : 1L;
registry.register(MetricRegistry.name(HelixClusterManager.class, "instantiationFailed"), helixClusterManagerInstantiationFailed);
} | |
412 | void should_return_P2_car_when_parking_boy_fetch_car_given_parking_boy_P2_ticket_parking_lot(){
ParkingBoy parkingBoy = new ParkingBoy();
ParkingTicket parkingTicket = new ParkingTicket("P2");
ParkingLot parkingLot = new ParkingLot();
Car carInParkingLot = new Car("P2");
parkingLot.parkingCar(... | void should_return_P2_car_when_parking_boy_fetch_car_given_parking_boy_P2_ticket_parking_lot(){
ParkingBoy parkingBoy = new ParkingBoy();
Car carInParkingLot = new Car("P2");
ParkingTicket parkingTicket = parkingBoy.parkingBoyParkingCar(carInParkingLot);
Car correctCar = parkingBoy.parkingBoyFetchC... | |
413 | private RoleConfig buildRoleConfig(ServiceProvider application){
RoleConfig roleConfig = new RoleConfig();
if (application.getClaimConfig() != null) {
String roleClaimId = application.getClaimConfig().getRoleClaimURI();
if (StringUtils.isBlank(roleClaimId) && application.getClaimConfig().isL... | private RoleConfig buildRoleConfig(ServiceProvider application){
RoleConfig roleConfig = new RoleConfig();
if (application.getClaimConfig() != null) {
String roleClaimId = application.getClaimConfig().getRoleClaimURI();
if (StringUtils.isBlank(roleClaimId) && application.getClaimConfig().isL... | |
414 | public Color getColor(){
if (this.color == null) {
return null;
}
return this.color;
} | public Color getColor(){
if (this.color == null)
return null;
return this.color;
} | |
415 | private synchronized void generateDeviceID(){
String generatedDeviceID;
if (googleAdID != null) {
synchronized (adIDLock) {
generatedDeviceID = Constants.GUID_PREFIX_GOOGLE_AD_ID + googleAdID;
}
} else {
synchronized (deviceIDLock) {
generatedDeviceID ... | private synchronized void generateDeviceID(){
String generatedDeviceID;
if (googleAdID != null) {
synchronized (adIDLock) {
generatedDeviceID = Constants.GUID_PREFIX_GOOGLE_AD_ID + googleAdID;
}
} else {
synchronized (deviceIDLock) {
generatedDeviceID ... | |
416 | public static void addRecipe(Recipe recipe){
String recipeJSON = gson.toJson(recipe);
try {
java.util.Properties config = new java.util.Properties();
config.put("StrictHostKeyChecking", "no");
JSch jsch = new JSch();
jsch.addIdentity(DBUtils.ENV_SSH_KEY);
ssh = nul... | public static void addRecipe(Recipe recipe){
String recipeJSON = gson.toJson(recipe);
try {
java.util.Properties config = new java.util.Properties();
config.put("StrictHostKeyChecking", "no");
JSch jsch = new JSch();
jsch.addIdentity(DBUtils.ENV_SSH_KEY);
ssh = jsc... | |
417 | public String search(){
Session session = model.Util.sessionFactory.openSession();
Criteria c = session.createCriteria(Repertory.class);
if (sDevice.equals("")) {
} else {
c.add(Restrictions.eq("rtDevice", this.sDevice));
if (sDevice.equals("主要设备")) {
if (sMainDevice.e... | public String search() throws Exception{
Session session = model.Util.sessionFactory.openSession();
Criteria c = session.createCriteria(Repertory.class);
if (sDevice.equals("")) {
} else {
c.add(Restrictions.eq("rtDevice", this.sDevice));
if (sDevice.equals("主要设备")) {
... | |
418 | public Map<String, Object> queryWorker(User loginUser){
Map<String, Object> result = new HashMap<>();
List<WorkerServerModel> workerServers = getServerListFromZK(false).stream().map((Server server) -> {
WorkerServerModel model = new WorkerServerModel();
model.setId(server.getId());
... | public Result<Collection<WorkerServerModel>> queryWorker(User loginUser){
List<WorkerServerModel> workerServers = getServerListFromZK(false).stream().map((Server server) -> {
WorkerServerModel model = new WorkerServerModel();
model.setId(server.getId());
model.setHost(server.getHost());
... | |
419 | public void takePicture(View view){
Intent takePictureIntent = new Intent(MediaStore.ACTION_IMAGE_CAPTURE);
if (takePictureIntent.resolveActivity(getPackageManager()) != null) {
File photoFile = null;
try {
photoFile = createImageFile();
} catch (IOException e) {
... | public void takePicture(View view){
Intent takePictureIntent = new Intent(MediaStore.ACTION_IMAGE_CAPTURE);
if (takePictureIntent.resolveActivity(getPackageManager()) != null) {
try {
mCurrentImageFile = ImageUtils.createImageFile(this);
} catch (IOException e) {
e.... | |
420 | void getAndSetCantidadStock(){
Producto tester = new Producto();
final int cantidadStock = 2562;
tester.setCantidadStock(cantidadStock);
final int getCantidadStock = tester.getCantidadStock();
assertEquals(cantidadStock, getCantidadStock, "setCantidadStock must be 2562");
} | void getAndSetCantidadStock(){
final int cantidadStock = 2562;
tester.setCantidadStock(cantidadStock);
final int getCantidadStock = tester.getCantidadStock();
assertEquals(cantidadStock, getCantidadStock, "setCantidadStock must be 2562");
} | |
421 | public Result queryDataSource(@ApiIgnore @RequestAttribute(value = Constants.SESSION_USER) User loginUser, @RequestParam("id") int id){
logger.info("login user {}, query datasource: {}", loginUser.getUserName(), id);
Map<String, Object> result = dataSourceService.queryDataSource(id);
return returnDataLis... | public Result queryDataSource(@ApiIgnore @RequestAttribute(value = Constants.SESSION_USER) User loginUser, @RequestParam("id") int id){
logger.info("login user {}, query datasource: {}", loginUser.getUserName(), id);
return dataSourceService.queryDataSource(id);
} | |
422 | public void actionPerformed(ActionEvent arg0){
EspeakNg espeakNg = new EspeakNg(mainW);
espeakNg.makeAction("translate");
} | public void actionPerformed(ActionEvent arg0){
espeakNg.makeAction("translate");
} | |
423 | public static void filterByIncludedString(boolean isNewFilter, String[] includedStrings, int printLimit){
if (isNewFilter) {
filteredWords.clear();
addTagsToFilteredList(FilterType.INCLUDING_STRING, includedStrings);
} else {
ArrayList<Words> wordsToRemove = new ArrayList<>();
... | public static void filterByIncludedString(boolean isNewFilter, String[] includedStrings){
if (isNewFilter) {
filteredWords.clear();
addTagsToFilteredList(FilterType.INCLUDING_STRING, includedStrings);
} else {
ArrayList<Words> wordsToRemove = new ArrayList<>();
generateList... | |
424 | public void onInitialize(){
try {
MyItems.registerItems();
MyBlocks.registerBlocks();
MyFeatures.registerFeatures();
MyEntityType.class.getDeclaredConstructor().newInstance();
MyEntityType.registerEntities();
MyRecipeSerializer.registerRecipeSerializers();
... | public void onInitialize(){
try {
MyItems.registerItems();
MyBlocks.registerBlocks();
MyFeatures.registerFeatures();
MyEntityType.class.getDeclaredConstructor().newInstance();
MyEntityType.registerEntities();
MyRecipeSerializer.registerRecipeSerializers();
... | |
425 | public void createMessageUsingMessageBuilder(){
final Message<String> theMessage;
theMessage = MessageBuilder.withPayload(GREETING_STRING).setHeader(MESSAGE_HEADER_NAME, MESSAGE_HEADER_VALUE).build();
Assert.assertTrue("Message should be a GenericMessage", theMessage instanceof GenericMessage);
Asse... | public void createMessageUsingMessageBuilder(){
final Message<String> theMessage;
theMessage = MessageBuilder.withPayload(GREETING_STRING).setHeader(MESSAGE_HEADER_NAME, MESSAGE_HEADER_VALUE).build();
Assert.assertTrue("Message should be a GenericMessage", theMessage instanceof GenericMessage);
Asse... | |
426 | public List<MealView> getAll(@RequestParam(value = "page", defaultValue = "0") int page, @RequestParam(value = "limit", defaultValue = "25") int limit){
if (page > 0)
page = page - 1;
return mealService.getAll(page, limit);
} | public List<MealView> getAll(@RequestParam(value = "page", defaultValue = "0") int page, @RequestParam(value = "limit", defaultValue = "25") int limit){
return mealService.getAll(page, limit);
} | |
427 | public void removeConsumerApplication(String consumerKey) throws IdentityOAuthAdminException{
Connection connection = null;
PreparedStatement prepStmt = null;
try {
connection = JDBCPersistenceManager.getInstance().getDBConnection();
prepStmt = connection.prepareStatement(SQLQueries.OAu... | public void removeConsumerApplication(String consumerKey) throws IdentityOAuthAdminException{
Connection connection = null;
PreparedStatement prepStmt = null;
try {
connection = JDBCPersistenceManager.getInstance().getDBConnection();
prepStmt = connection.prepareStatement(SQLQueries.OAu... | |
428 | private void closeSocket(long socket){
connections.remove(Long.valueOf(socket));
Poller poller = this.poller;
if (poller != null) {
poller.close(socket);
}
} | private void closeSocket(long socket){
SocketWrapperBase<Long> wrapper = connections.remove(Long.valueOf(socket));
if (wrapper != null) {
((AprSocketWrapper) wrapper).close();
}
} | |
429 | public Player apply(Score aScore){
requireNonNull(aScore);
if (aScore.player1TennisPoints() == WIN) {
return PLAYER1;
} else if (aScore.player2TennisPoints() == WIN) {
return PLAYER2;
} else {
throw new RuntimeException("there can't be a winner with this score: " + aScore)... | public Player apply(Score aScore){
requireNonNull(aScore);
checkArgument(hasAWinner.test(aScore), "there is no winner with a such score %s", aScore);
if (aScore.player1Points() > aScore.player2Points()) {
return PLAYER1;
} else {
return PLAYER2;
}
} | |
430 | void listFiles(String uri){
try {
Log.v(TAG, "listFiles(" + uri + ")");
AssetManager assetManager = this.getAssets();
String[] fileList = assetManager.list(uri);
Log.v(TAG, "listFiles(" + uri + ") - " + fileList.length + " files found");
for (int i = 0; i < fileList.le... | void listFiles(String uri){
try {
AssetManager assetManager = this.getAssets();
String[] fileList = assetManager.list(uri);
} catch (Exception ioe) {
Log.v(TAG, "Error Listing Files - Error = " + ioe.toString());
}
} | |
431 | protected void onEnsureDebugId(String baseID){
super.onEnsureDebugId(baseID);
toolsMenuButton.ensureDebugId(baseID + ToolsModule.ToolIds.MENU_TOOLS);
addTool.ensureDebugId(baseID + ToolsModule.ToolIds.MENU_ITEM_ADD_TOOLS);
edit.ensureDebugId(baseID + ToolsModule.ToolIds.MENU_ITEM_EDIT);
request... | protected void onEnsureDebugId(String baseID){
super.onEnsureDebugId(baseID);
toolsMenuButton.ensureDebugId(baseID + ToolsModule.ToolIds.MENU_TOOLS);
addTool.ensureDebugId(baseID + ToolsModule.ToolIds.MENU_ITEM_ADD_TOOLS);
edit.ensureDebugId(baseID + ToolsModule.ToolIds.MENU_ITEM_EDIT);
request... | |
432 | public static ArrayList<String> extractPreRequisites(ArrayList<String> commandFlags){
ArrayList<String> preRequisites = new ArrayList<>();
for (int i = 0; i < commandFlags.size(); i++) {
if (commandFlags.get(i).equals("-p")) {
String trimmedCommandFlag = commandFlags.get(i + 1).trim();
... | public static ArrayList<String> extractPreRequisites(ArrayList<String> commandFlags){
ArrayList<String> preRequisites = new ArrayList<>();
int index = commandFlags.indexOf("-p");
if (index >= 0) {
String trimmedCommandFlag = commandFlags.get(index + 1).trim();
ArrayList<String> moduleCo... | |
433 | public Connection getConnection() throws SQLException, ClassNotFoundException{
try {
Class.forName("org.postgresql.Driver");
} catch (ClassNotFoundException e) {
throw e;
}
if (connection == null) {
connection = DriverManager.getConnection("jdbc:postgresql://localhost:5432... | public Connection getConnection() throws SQLException, ClassNotFoundException{
Class.forName("org.postgresql.Driver");
if (connection == null) {
connection = DriverManager.getConnection("jdbc:postgresql://localhost:5432/" + databaseName, login, password);
}
return connection;
} | |
434 | public static String getJsonDataAsString() throws Exception{
String filePath = "src/main/java/Persistence/weatherForecast.json";
String result = readJSONFileAsString(filePath);
return result;
} | public static String getJsonDataAsString() throws Exception{
String filePath = "src/main/java/Persistence/weatherForecast.json";
return readJSONFileAsString(filePath);
} | |
435 | private void exit() throws Exception{
System.out.println();
System.out.print("\tExit after 10 seconds");
Thread.sleep(5000);
System.exit(0);
} | private void exit() throws Exception{
System.out.println();
System.exit(0);
} | |
436 | public static com.vaadin.ui.TextArea createTextArea(String name){
com.vaadin.ui.TextArea textArea = new com.vaadin.ui.TextArea(name);
return textArea;
} | public static TextArea createTextArea(String name){
return new TextArea(name);
} | |
437 | private void initSpinner(){
String[] array = { STYLE_NO, STYLE_BIG_TEXT, STYLE_BIG_PICTURE, STYLE_INBOX, STYLE_MEDIA, STYLE_MESSAGING };
ArrayAdapter<String> adapter = new ArrayAdapter<>(this, R.layout.spinner_item_style);
adapter.addAll(array);
binding.spinner.setAdapter(adapter);
} | private void initSpinner(){
ArrayAdapter<String> adapter = new ArrayAdapter<>(this, R.layout.spinner_item_style);
adapter.addAll(NotificationStyle.createStyleNameList());
binding.spinner.setAdapter(adapter);
} | |
438 | public void start(Stage primaryStage){
try {
Configuration configuration = getConfigurationFromCommandLineArgs();
SidPlay2Section section = configuration.getSidplay2Section();
IWhatsSidSection whatsSidSection = configuration.getWhatsSidSection();
String url = whatsSidSection.get... | public void start(Stage primaryStage){
try {
Configuration configuration = getConfigurationFromCommandLineArgs();
SidPlay2Section sidplay2Section = configuration.getSidplay2Section();
WhatsSidSection whatsSidSection = configuration.getWhatsSidSection();
String url = whatsSidSect... | |
439 | public Response getBridges(@DefaultValue(PAGE_DEFAULT) @Min(PAGE_MIN) @QueryParam(PAGE) int page, @DefaultValue(SIZE_DEFAULT) @Min(SIZE_MIN) @Max(SIZE_MAX) @QueryParam(PAGE_SIZE) int pageSize){
ListResult<Bridge> bridges = bridgesService.getBridges(customerIdResolver.resolveCustomerId(identity.getPrincipal()), pag... | public Response getBridges(@Valid @BeanParam QueryInfo queryInfo){
return Response.ok(ListResponse.fill(bridgesService.getBridges(customerIdResolver.resolveCustomerId(identity.getPrincipal()), queryInfo), new BridgeListResponse(), bridgesService::toResponse)).build();
} | |
440 | public void process1Test(){
String locale_ = "en";
String folder_ = "messages";
String relative_ = "sample/file";
String content_ = "one=Description one\ntwo=Description two\nthree=desc <{0}>";
String html_ = "<html><body><c:for className=\"$int\" var=\"k\" from=\"0\" to=\"2\" eq=\"true\"... | public void process1Test(){
String locale_ = "en";
String folder_ = "messages";
String relative_ = "sample/file";
String content_ = "one=Description one\ntwo=Description two\nthree=desc <{0}>";
String html_ = "<html><body><c:for className=\"$int\" var=\"k\" from=\"0\" to=\"2\" eq=\"true\"... | |
441 | public static void checkLength(final int lengthArray){
CheckerBoundNumber.isInRange(lengthArray, LOWER_BOUND_LENGTH, UPPER_BOUND_LENGTH);
if (lengthArray < LOWER_BOUND_LENGTH || lengthArray > UPPER_BOUND_LENGTH) {
throw new LengthOutOfRangeException("Length value out of range(" + LOWER_BOUND_LENGTH +... | public static void checkLength(final int lengthArray){
if (lengthArray < LOWER_BOUND_LENGTH || lengthArray > UPPER_BOUND_LENGTH) {
throw new LengthOutOfRangeException("Length value out of range(" + LOWER_BOUND_LENGTH + "-" + UPPER_BOUND_LENGTH + ").");
}
} | |
442 | public void encodeThreeElementsFlux() throws InterruptedException{
JsonObjectEncoder encoder = new JsonObjectEncoder();
Flux<ByteBuffer> source = Flux.just(Buffer.wrap("{\"foo\": \"foofoo\", \"bar\": \"barbar\"}").byteBuffer(), Buffer.wrap("{\"foo\": \"foofoofoo\", \"bar\": \"barbarbar\"}").byteBuffer(), Buff... | public void encodeThreeElementsFlux() throws InterruptedException{
Flux<DataBuffer> source = Flux.just(stringBuffer("{\"foo\": \"foofoo\", \"bar\": \"barbar\"}"), stringBuffer("{\"foo\": \"foofoofoo\", \"bar\": \"barbarbar\"}"), stringBuffer("{\"foo\": \"foofoofoofoo\", \"bar\": \"barbarbarbar\"}"));
Iterable... | |
443 | public void onClick(View v){
String currentSetting = satelitebtn.getText().toString();
if (currentSetting.equalsIgnoreCase("Satellite View")) {
Point initialView = new Point(-76.927, 38.996, SpatialReferences.getWebMercator());
mMapView = findViewById(R.id.mapView);
satelitebtn.setT... | public void onClick(View v){
String currentSetting = satelitebtn.getText().toString();
if (currentSetting.equals(getString(R.string.satellite_view))) {
mMapView.getMap().setBasemap(Basemap.createImagery());
satelitebtn.setText(R.string.normal_view);
} else {
mMapView.getMap().s... | |
444 | private void baseCheckUpdate(boolean toastResult){
MergeAppUpdateChecker auc = MergeAppUpdateChecker.getSingleton(this);
if (mOnCheckUpdateResultListener == null) {
mOnCheckUpdateResultListener = new MergeAppUpdateChecker.OnResultListener() {
@Override
public void onResult... | private void baseCheckUpdate(boolean toastResult){
MergeAppUpdateChecker auc = MergeAppUpdateChecker.getSingleton(this);
if (mOnCheckUpdateResultListener == null) {
mOnCheckUpdateResultListener = findNewVersion -> {
mCheckUpdateResultText = findNewVersion ? mFindNewVersion : mIsTheLatest... | |
445 | public List<ExchangeRate> readAllExchangeRates(){
ObjectMapper mapper = new ObjectMapper();
List<ExchangeRate> rates = new ArrayList<>();
try {
for (BankName bankName : BankName.values()) {
String path = new JsonExchangeRatesPathFactory().getExchangeRatesPath(String.valueOf(bankName... | public List<ExchangeRate> readAllExchangeRates(){
List<ExchangeRate> rates = new ArrayList<>();
for (BankName bankName : BankName.values()) {
rates.addAll(readExchangeRatesByBankName(String.valueOf(bankName)));
}
return rates;
} | |
446 | protected void onCreate(Bundle savedInstanceState){
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_home);
((MyApplication) getApplication()).getAppComponent().inject(this);
listView = findViewById(R.id.listView);
projectApi.getAllProjects().observeOn(AndroidSchedulers.main... | protected void onCreate(Bundle savedInstanceState){
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_home);
((MyApplication) getApplication()).getAppComponent().inject(this);
listView = findViewById(R.id.listView);
projectApi.getAllProjects().observeOn(AndroidSchedulers.main... | |
447 | int findEntry(PackageGroup group, int typeIndex, String name, Ref<Integer> outTypeSpecFlags){
List<Type> typeList = group.types.get(typeIndex);
for (Type type : typeList) {
int ei = type._package_.keyStrings.indexOfString(name);
if (ei < 0) {
continue;
}
for (... | int findEntry(PackageGroup group, int typeIndex, String name, Ref<Integer> outTypeSpecFlags){
List<Type> typeList = group.types.get(typeIndex);
for (Type type : typeList) {
int ei = type._package_.keyStrings.indexOfString(name);
if (ei < 0) {
continue;
}
for (... | |
448 | private Map<String, Object> countStateByProject(User loginUser, int projectId, String startDate, String endDate, TriFunction<Date, Date, Integer[], List<ExecuteStatusCount>> instanceStateCounter){
Map<String, Object> result = new HashMap<>();
boolean checkProject = checkProject(loginUser, projectId, result);
... | private Result<TaskCountDto> countStateByProject(User loginUser, int projectId, String startDate, String endDate, TriFunction<Date, Date, Integer[], List<ExecuteStatusCount>> instanceStateCounter){
CheckParamResult checkResult = checkProject(loginUser, projectId);
if (!Status.SUCCESS.equals(checkResult.getSta... | |
449 | public void checkForceIncrement(){
int k = 100;
ReservoirLongsSketch rls = ReservoirLongsSketch.getInstance(k);
for (int i = 0; i < 2 * k; ++i) {
rls.update(i);
}
assertEquals(rls.getN(), 2 * k);
rls.forceIncrementItemsSeen(k);
assertEquals(rls.getN(), 3 * k);
try {
... | public void checkForceIncrement(){
int k = 100;
ReservoirLongsSketch rls = ReservoirLongsSketch.getInstance(k);
for (int i = 0; i < 2 * k; ++i) {
rls.update(i);
}
assertEquals(rls.getN(), 2 * k);
rls.forceIncrementItemsSeen(k);
assertEquals(rls.getN(), 3 * k);
try {
... | |
450 | public void mouseClicked(MouseEvent e){
Set<String> vertices = graph.vertexSet();
Object cell = graphComponent.getCellAt(e.getX(), e.getY());
if (cell != null && cell instanceof mxCell) {
String v = ((mxCell) cell).getValue().toString();
if (vertices.contains(((mxCell) cell).getValue().... | public void mouseClicked(MouseEvent e){
Set<String> vertices = graph.vertexSet();
Object cell = graphComponent.getCellAt(e.getX(), e.getY());
if (cell != null && cell instanceof mxCell) {
if (vertices.contains(((mxCell) cell).getValue().toString())) {
System.out.println(((mxCell) ce... | |
451 | public User loadByPrimaryKey(Integer key){
User user = userRepository.findOne(key);
if (user == null) {
String message = String.format(this.getClass() + " with primary key '%d' not found");
throw new DataNotFoundException(message, String.valueOf(key));
}
return user;
} | public User loadByPrimaryKey(Integer key){
User user = userRepository.findOne(key);
if (user == null)
throw new DataNotFoundException(String.format(this.getClass() + " with primary key '%d' not found"), String.valueOf(key));
return user;
} | |
452 | public void processTasks(){
if (pool.isShuttingDown()) {
return;
}
synchronized (waitingSystemTasks) {
DBBroker broker = null;
Subject oldUser = null;
try {
broker = pool.get(null);
oldUser = broker.getSubject();
broker.setSubject... | public void processTasks(){
if (pool.isShuttingDown()) {
return;
}
synchronized (waitingSystemTasks) {
try (final DBBroker broker = pool.get(Optional.of(pool.getSecurityManager().getSystemSubject()))) {
while (!waitingSystemTasks.isEmpty()) {
final SystemTa... | |
453 | private void sendChannelVerificationRequest(TextChannel targetChannel, Message originChannelMessage, User tunnelInstantiator){
String targetChannelID = targetChannel.getId();
String originChannelID = originChannelMessage.getChannel().getId();
addToMap(targetChannel, originChannelMessage);
targetChan... | private void sendChannelVerificationRequest(TextChannel targetChannel, Message originChannelMessage, User tunnelInstantiator){
String targetChannelID = targetChannel.getId();
String originChannelID = originChannelMessage.getChannel().getId();
addToMap(targetChannel, originChannelMessage);
targetChan... | |
454 | void Draw(Canvas canvas){
if (skin != null) {
width = (int) (skin.getWidth() * scale);
height = (int) (skin.getHeight() * scale);
dst.set((int) pos_x, (int) pos_y, (int) pos_x + width, (int) pos_y + height);
canvas.drawBitmap(skin, null, dst, null);
}
} | void Draw(Canvas canvas){
if (skin != null) {
dst.set((int) pos_x, (int) pos_y, (int) pos_x + width - 1, (int) pos_y + height - 1);
canvas.drawBitmap(skin, null, dst, null);
}
} | |
455 | public void equals(){
Friend aliceCopy = new FriendBuilder(ALICE).build();
assertTrue(ALICE.equals(aliceCopy));
assertTrue(ALICE.equals(ALICE));
assertFalse(ALICE.equals(null));
assertFalse(ALICE.equals(5));
assertFalse(ALICE.equals(BOB));
Friend editedAlice = new FriendBuilder(ALICE)... | public void equals(){
Friend aliceCopy = new FriendBuilder(ALICE).build();
assertTrue(ALICE.equals(aliceCopy));
assertTrue(ALICE.equals(ALICE));
assertFalse(ALICE.equals(null));
assertFalse(ALICE.equals(5));
assertFalse(ALICE.equals(BOB));
Friend editedAlice = new FriendBuilder(ALICE)... | |
456 | public Reply replyToMessage(){
Consumer<Update> action = upd -> {
try {
responseHandler.replyToMessage(upd);
} catch (URISyntaxException e) {
e.printStackTrace();
}
};
return Reply.of(action, Flag.MESSAGE);
} | public Reply replyToMessage(){
Consumer<Update> action = upd -> responseHandler.replyToMessage(upd);
return Reply.of(action, Flag.MESSAGE);
} | |
457 | public Result deleteAlertPluginInstance(@ApiIgnore @RequestAttribute(value = Constants.SESSION_USER) User loginUser, @RequestParam(value = "id") int id){
logger.info("login user {},delete alert plugin instance id {}", RegexUtils.escapeNRT(loginUser.getUserName()), id);
Map<String, Object> result = alertPlugin... | public Result<Void> deleteAlertPluginInstance(@ApiIgnore @RequestAttribute(value = Constants.SESSION_USER) User loginUser, @RequestParam(value = "id") int id){
logger.info("login user {},delete alert plugin instance id {}", RegexUtils.escapeNRT(loginUser.getUserName()), id);
return alertPluginInstanceService.... | |
458 | public void onBackPressed(){
if (mIsPresentingImmersive) {
queueRunnable(() -> exitImmersiveNative());
return;
}
if (mBackHandlers.size() > 0) {
mBackHandlers.getLast().run();
return;
}
if (SessionStore.get().canGoBack()) {
SessionStore.get().goBack(... | public void onBackPressed(){
if (mIsPresentingImmersive) {
queueRunnable(() -> exitImmersiveNative());
return;
}
if (mBackHandlers.size() > 0) {
mBackHandlers.getLast().run();
return;
}
SessionStore activeStore = SessionManager.get().getActiveStore();
if... | |
459 | public Vector<String> toGo(){
StringBuilder out = new StringBuilder();
out.append("map[");
out.append(keyType.toGo());
out.append("]");
out.append(valueType.toGo());
out.append("{");
boolean first = true;
for (Map.Entry<Expression, Expression> pair : pairs.entrySet()) {
... | public List<String> toGo(){
StringBuilder out = new StringBuilder();
out.append("map[");
out.append(keyType.toGo());
out.append("]");
out.append(valueType.toGo());
out.append("{");
boolean first = true;
for (Map.Entry<Expression, Expression> pair : pairs.entrySet()) {
if... | |
460 | public double GetExchangeRate(Currency currency) throws IOException{
double rate = 0;
CloseableHttpResponse response = null;
try {
response = this.httpclient.execute(httpget);
switch(response.getStatusLine().getStatusCode()) {
case 200:
HttpEntity entity = ... | public double GetExchangeRate(Currency currency){
double rate = 0;
try (CloseableHttpResponse response = this.httpclient.execute(httpget)) {
switch(response.getStatusLine().getStatusCode()) {
case 200:
HttpEntity entity = response.getEntity();
InputStrea... | |
461 | public void testBatchCopyProcessDefinition() throws Exception{
String projectName = "test";
int targetProjectId = 2;
String id = "1";
Map<String, Object> result = new HashMap<>();
putMsg(result, Status.SUCCESS);
Mockito.when(processDefinitionService.batchCopyProcessDefinition(user, project... | public void testBatchCopyProcessDefinition() throws Exception{
String projectName = "test";
int targetProjectId = 2;
String id = "1";
Result<Void> result = Result.success(null);
Mockito.when(processDefinitionService.batchCopyProcessDefinition(user, projectName, id, targetProjectId)).thenReturn(... | |
462 | public Collection<AuthorDTO> getAuthorsOffBook(Integer bookId){
Collection<AuthorEntity> authorDTOS = dao.getAllAuthorOfBook(bookId);
try {
return authorDTOS.stream().peek(author -> author.getBooks().size()).map(toDTOFunc).collect(Collectors.toList());
} catch (Exception ex) {
ex.printS... | public Collection<AuthorDTO> getAuthorsOffBook(Integer bookId){
Collection<AuthorEntity> authorDTOS = dao.getAllAuthorOfBook(bookId);
return authorDTOS.stream().peek(author -> author.getBooks().size()).map(toDTOFunc).collect(Collectors.toList());
} | |
463 | protected void onResume(){
super.onResume();
final Intent intent = getIntent();
final String locName;
if (intent != null) {
locName = intent.getStringExtra("name");
if (intent.hasExtra("longitude") && intent.hasExtra("latitude")) {
final double longitude = intent.getDo... | protected void onResume(){
super.onResume();
final Intent intent = getIntent();
if (intent != null) {
if (intent.hasExtra("longitude") && intent.hasExtra("latitude")) {
final double longitude = intent.getDoubleExtra("longitude", 0);
final double latitude = intent.getDou... | |
464 | protected IParticleData makeParticle(){
Color tint = getTint(GeneralUtilities.getRandomNumber(0, 2));
double diameter = getDiameter(GeneralUtilities.getRandomNumber(1.0d, 5.5d));
SmokeBombParticleData smokeBombParticleData = new SmokeBombParticleData(tint, diameter);
return smokeBombParticleData;
} | protected IParticleData makeParticle(){
Color tint = getTint(GeneralUtilities.getRandomNumber(0, 2));
double diameter = getDiameter(GeneralUtilities.getRandomNumber(1.0d, 5.5d));
return new SmokeBombParticleData(tint, diameter);
} | |
465 | public SendSmsResponse sendSms(String templateId, String phoneNumber, HashMap<String, String> personalisation, String reference) throws NotificationClientException{
HttpsURLConnection conn = null;
try {
JSONObject body = createBodyForSmsRequest(templateId, phoneNumber, personalisation, reference);
... | public SendSmsResponse sendSms(String templateId, String phoneNumber, HashMap<String, String> personalisation, String reference) throws NotificationClientException{
JSONObject body = createBodyForSmsRequest(templateId, phoneNumber, personalisation, reference);
HttpsURLConnection conn = createConnectionAndSetH... | |
466 | private List<StorageItem> getAllFromCache(T store, Boolean onlyFiles){
StorageItem storageItem = null;
List<StorageItem> storageItems = null;
String storagePath = getStoragePath(store);
if (storagePath != null) {
Set<Entry<String, T>> entrySet = FILE_PATH_IMAGE_MAP.entrySet();
for ... | private List<StorageItem> getAllFromCache(T store, Boolean onlyFiles){
StorageItem storageItem = null;
List<StorageItem> storageItems = null;
String storagePath = getStoragePath(store);
if (storagePath != null) {
Set<Entry<String, T>> entrySet = FILE_PATH_IMAGE_MAP.entrySet();
for ... | |
467 | public void activate(boolean redo){
if (SageConstants.ENFORCE_EMBEDDED_RESTRICTIONS && Sage.EMBEDDED && (!System.getProperty("java.version").startsWith("phoneme_advanced") || System.getProperty("os.name").indexOf("Linux") == -1 || System.getProperty("os.version").indexOf("sigma") == -1) && Math.random() < 0.05)
... | public void activate(boolean redo){
active = true;
if (!comp.hasFreshlyLoadedContext() && !redo)
comp.reloadAttributeContext();
Catbert.processUISpecificHook("BeforeMenuLoad", new Object[] { Boolean.valueOf(redo) }, uiMgr, false);
if (!active) {
comp.unfreshAttributeContext();
... | |
468 | public void testMissingLowerCorner() throws CswException{
HierarchicalStreamReader reader = mock(HierarchicalStreamReader.class);
Stack<String> boundingBoxNodes = new Stack<String>();
boundingBoxNodes.push("-2.228 51.126");
boundingBoxNodes.push("UpperCorner");
boundingBoxNodes.push("-6.171 44.... | public void testMissingLowerCorner() throws CswException{
HierarchicalStreamReader reader = mock(HierarchicalStreamReader.class);
Stack<String> boundingBoxNodes = new Stack<>();
boundingBoxNodes.push("-2.228 51.126");
boundingBoxNodes.push("UpperCorner");
boundingBoxNodes.push("-6.171 44.792");... | |
469 | public void onDataChange(@NonNull DataSnapshot snapshot){
if (snapshot.hasChild(Database.CHILD_DISCOVERED_PEAKS))
syncGetDiscoveredPeaksFromProfile(snapshot.child(Database.CHILD_DISCOVERED_PEAKS));
else
discoveredPeaks = new HashSet<>();
if (snapshot.hasChild(Database.CHILD_USERNAME))
... | public void onDataChange(@NonNull DataSnapshot snapshot){
if (snapshot.hasChild(Database.CHILD_DISCOVERED_PEAKS))
syncGetDiscoveredPeaksFromProfile(snapshot.child(Database.CHILD_DISCOVERED_PEAKS));
else
discoveredPeaks = new HashSet<>();
if (snapshot.hasChild(Database.CHILD_USERNAME))
... | |
470 | public Value visit(Division value){
Value left = value.getLeft().accept(this);
Value right = value.getRight().accept(this);
if (debug) {
System.out.println("Division");
}
return left.division(right);
} | public Value visit(Division value){
Value left = value.getLeft().accept(this);
Value right = value.getRight().accept(this);
return left.division(right);
} | |
471 | public Car fetching(Ticket ticket){
Car car = null;
if (ticket == null) {
FailMsg.FAIL_MSG.setMsg("Please provide your parking ticket.");
notifyObserver("Please provide your parking ticket.", this);
return car;
}
if (!ticket.isValid() || ticket.getState() == TicketState.us... | public Car fetching(Ticket ticket){
Car car = null;
if (ticket == null) {
FailMsg.FAIL_MSG.setMsg("Please provide your parking ticket.");
notifyObserver("Please provide your parking ticket.", this);
return car;
}
if (!ticket.isValid() || ticket.getState() == TicketState.us... | |
472 | protected UUID execute(){
return null;
} | protected void execute(){
} | |
473 | public void delete(String topic, boolean force, boolean deleteSchema) throws PulsarAdminException{
try {
deleteAsync(topic, force, deleteSchema).get(this.readTimeoutMs, TimeUnit.MILLISECONDS);
} catch (ExecutionException e) {
throw (PulsarAdminException) e.getCause();
} catch (Interrupt... | public void delete(String topic, boolean force, boolean deleteSchema) throws PulsarAdminException{
sync(() -> deleteAsync(topic, force, deleteSchema));
} | |
474 | private void saveScreenshotAndToast(Consumer<Uri> finisher){
mScreenshotHandler.post(() -> {
switch(mAudioManager.getRingerMode()) {
case AudioManager.RINGER_MODE_SILENT:
break;
case AudioManager.RINGER_MODE_VIBRATE:
if (mVibrator != null && mVib... | private void saveScreenshotAndToast(Consumer<Uri> finisher){
mScreenshotHandler.post(() -> {
playShutterSound();
});
saveScreenshotInWorkerThread(finisher, new ActionsReadyListener() {
@Override
void onActionsReady(SavedImageData imageData) {
finisher.accept(imag... | |
475 | private SourceResponse createSourceResponse(GetRecordsType request, int resultCount){
int first = 1;
int last = 2;
int max = 0;
if (request != null) {
first = request.getStartPosition().intValue();
max = request.getMaxRecords().intValue();
int next = request.getMaxRecords(... | private SourceResponse createSourceResponse(GetRecordsType request, int resultCount){
int first = 1;
int last = 2;
int max = 0;
if (request != null) {
first = request.getStartPosition().intValue();
max = request.getMaxRecords().intValue();
int next = request.getMaxRecords(... | |
476 | public Response get(){
EntityManager entityManager1 = EntityManagerListener.createEntityManager();
EntityManager entityManager2 = EntityManagerListener.createEntityManager();
EntityTransaction transaction = null;
try {
StatelessSession session = entityManager1.unwrap(Session.class).getSessi... | public Response get(){
EntityManager entityManager = EntityManagerListener.createEntityManager();
EntityTransaction transaction = null;
try {
StatelessSession session = entityManager.unwrap(Session.class).getSessionFactory().openStatelessSession();
transaction = session.beginTransaction... | |
477 | public boolean equals(Object obj){
if (this == obj) {
return true;
}
if (obj == null) {
return false;
}
if (getClass() != obj.getClass()) {
return false;
}
final OAuth2AllowDomain other = (OAuth2AllowDomain) obj;
if (!Objects.equals(this.id, other.id)) ... | public boolean equals(Object obj){
return ObjectEquals.of(this).equals(obj, (origin, other) -> {
return Objects.equals(origin.getId(), other.getId());
});
} | |
478 | public PowerShellResponse executeScript(String scriptPath, String params){
BufferedReader srcReader = null;
File scriptToExecute = new File(scriptPath);
if (!scriptToExecute.exists()) {
return new PowerShellResponse(true, "Wrong script path: " + scriptToExecute, false);
}
try {
... | public PowerShellResponse executeScript(String scriptPath, String params){
BufferedReader srcReader = null;
File scriptToExecute = new File(scriptPath);
if (!scriptToExecute.exists()) {
return new PowerShellResponse(true, "Wrong script path: " + scriptToExecute, false);
}
try {
... | |
479 | protected void onCreate(Bundle savedInstanceState){
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_restaurant);
setupToolbar();
setupViewPager();
FloatingActionButton fab = (FloatingActionButton) findViewById(R.id.fab);
fab.setOnClickListener(new View.OnClickListener(... | protected void onCreate(Bundle savedInstanceState){
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_restaurant);
setupToolbar();
setupViewPager();
} | |
480 | boolean isSink(Board board, Computer computer){
int shipCoordinatesHit = 0;
int isShipHit = 1;
for (int xPositionOfShip = shipLocation[0]; xPositionOfShip <= shipLocation[2]; xPositionOfShip++) {
for (int yPositionOfShip = shipLocation[1]; yPositionOfShip <= shipLocation[3]; yPositionOfShip++) ... | boolean isSink(Board board, Computer computer){
int shipCoordinatesHit = 0;
int isShipHit = 1;
for (int xPositionOfShip = shipLocation[0]; xPositionOfShip <= shipLocation[2]; xPositionOfShip++) {
for (int yPositionOfShip = shipLocation[1]; yPositionOfShip <= shipLocation[3]; yPositionOfShip++) ... | |
481 | public void transactions(ThreadState state) throws IOException{
ClassLoader classLoader = getClass().getClassLoader();
BufferedReader reader = TestUtil.getExportedTransactionFile(classLoader, "insynSample1.csv");
Stream<Transaction> transactions = state.registry.parseTransactionResponse(reader);
lon... | public void transactions(ThreadState state) throws IOException{
ClassLoader classLoader = getClass().getClassLoader();
BufferedReader reader = TestUtil.getExportedTransactionFile(classLoader, "insynSample1.csv");
Stream<Transaction> transactions = state.registry.parseTransactionResponse(reader);
lon... | |
482 | private int inflate(byte[] b, int off, int len) throws DataFormatException, ZipException{
checkState(inflater != null, "inflater is null");
try {
int inflaterTotalIn = inflater.getTotalIn();
int n = inflater.inflate(b, off, len);
int bytesConsumedDelta = inflater.getTotalIn() - infl... | private int inflate(byte[] b, int off, int len) throws DataFormatException, ZipException{
checkState(inflater != null, "inflater is null");
try {
int inflaterTotalIn = inflater.getTotalIn();
int n = inflater.inflate(b, off, len);
int bytesConsumedDelta = inflater.getTotalIn() - infl... | |
483 | public double calculateFare(double distance, int time){
double totalFare = distance * MIN_COST_PER_KM + time * COST_PER_MIN;
if (totalFare < MINIMUM_FARE)
return MINIMUM_FARE;
else
return totalFare;
} | public double calculateFare(double distance, int time){
double totalFare = distance * MIN_COST_PER_KM + time * COST_PER_MIN;
return Math.max(totalFare, MINIMUM_FARE);
} | |
484 | public void values(){
assertEquals(map.values(), mapOrig.values());
} | public void values(){
} | |
485 | private static void sendFile(InputStream file, OutputStream out){
System.out.println("Starting file sending");
try {
byte[] buffer = new byte[1024 * 1024];
int i = 0;
while (file.available() > 0) {
out.write(buffer, 0, file.read(buffer));
System.out.println... | private static void sendFile(InputStream file, OutputStream out){
System.out.println("Starting file sending");
try {
byte[] buffer = new byte[1024 * 1024];
int i = 0;
while (file.available() > 0) {
out.write(buffer, 0, file.read(buffer));
System.out.println... | |
486 | public static int getNeuronCount(){
int count = -1;
final OkHttpClient client = new OkHttpClient();
final MediaType mediaType = MediaType.parse("application/json");
final RequestBody body = RequestBody.create(mediaType, "{\"query\":\"{systemSettings{neuronCount}}\"}");
final Request request = n... | public static int getNeuronCount(){
int count = -1;
final OkHttpClient client = new OkHttpClient();
final RequestBody body = RequestBody.create("{\"query\":\"{systemSettings{neuronCount}}\"}", MEDIA_TYPE);
final Request request = new Request.Builder().url("https://ml-neuronbrowser.janelia.org/graphq... | |
487 | private LibrisDatabase buildTestDatabase(File testDatabaseFileCopy) throws IOException{
rootDb = null;
ui = null;
try {
rootDb = Libris.buildAndOpenDatabase(testDatabaseFileCopy);
ui = rootDb.getUi();
} catch (Throwable e) {
e.printStackTrace();
fail("Cannot open ... | private LibrisDatabase buildTestDatabase(File testDatabaseFileCopy) throws IOException{
rootDb = null;
try {
rootDb = Libris.buildAndOpenDatabase(testDatabaseFileCopy);
rootDb.getUi();
} catch (Throwable e) {
e.printStackTrace();
fail("Cannot open database");
}
... | |
488 | protected Boolean doInBackground(AuthParams... authParamses){
AuthParams authParams = authParamses[0];
if (authParams == null) {
return false;
}
int slotNumber = authParams.getSlotNumber();
final NFCReader reader = authParams.getReader();
LoadAuthentication load = new LoadAuthenti... | protected Boolean doInBackground(AuthParams... authParamses){
AuthParams authParams = authParamses[0];
if (authParams == null) {
return false;
}
LoadAuthentication load = new LoadAuthentication(authParams);
if (authParams.getKeyA() != null && !"".equals(authParams.getKeyA())) {
... | |
489 | private boolean checkForUpdates(boolean force){
if (force || (Math.abs(System.currentTimeMillis() - prefs.getLong(PREF_LAST_CHECK_ATTEMPT_TIME_NAME, PREF_LAST_CHECK_ATTEMPT_TIME_DEFAULT)) > CHECK_THRESHOLD_MS)) {
if (onWantUpdateCheckListener != null) {
if (onWantUpdateCheckListener.onWantUpd... | private void checkForUpdates(boolean force){
if (force || (Math.abs(System.currentTimeMillis() - prefs.getLong(PREF_LAST_CHECK_ATTEMPT_TIME_NAME, PREF_LAST_CHECK_ATTEMPT_TIME_DEFAULT)) > CHECK_THRESHOLD_MS)) {
if (onWantUpdateCheckListener != null) {
if (onWantUpdateCheckListener.onWantUpdate... | |
490 | public void shouldBeAbleToDisplayUserHistoryForDefaulters(){
Book book = new Book("Raj", "Comics", 2000);
HashMap<String, Book> bookUserHistory = new HashMap<String, Book>();
bookUserHistory.put("user333", book);
Movie movie = new Movie("Art Of living", 1945, "Director", 4);
HashMap<String, Mov... | public void shouldBeAbleToDisplayUserHistoryForDefaulters(){
Book book = new Book("Raj", "Comics", 2000);
HashMap<String, Book> bookUserHistory = new HashMap<String, Book>();
bookUserHistory.put("user333", book);
Movie movie = new Movie("Art Of living", 1945, "Director", 4);
HashMap<String, Mov... | |
491 | public static MaterialShowcaseView.Builder createSequenceItem(final Activity mainAct, int idTargetView, String tooltipText, String title, CharSequence content, IShowcaseListener showcaseListener){
ShowcaseTooltip tooltip = ShowcaseTooltip.build(mainAct).arrowHeight(30).corner(30).textColor(Color.parseColor("#00768... | public static MaterialShowcaseView.Builder createSequenceItem(final Activity mainAct, int idTargetView, String tooltipText, String title, CharSequence content, IShowcaseListener showcaseListener){
ShowcaseTooltip tooltip = ShowcaseTooltip.build(mainAct).arrowHeight(30).corner(30).textColor(Color.parseColor("#00768... | |
492 | private void convertChildRelation(SubProcess subProcess, TSubProcess tSubProcess, Hashtable context){
if (subProcess.getSequenceFlows() != null && subProcess.getSequenceFlows().size() > 0) {
for (SequenceFlow subProcessSequenceFlow : subProcess.getSequenceFlows()) {
SequenceFlowAdapter sequen... | private void convertChildRelation(SubProcess subProcess, TSubProcess tSubProcess, Hashtable context){
if (subProcess.getSequenceFlows() != null && subProcess.getSequenceFlows().size() > 0) {
for (SequenceFlow subProcessSequenceFlow : subProcess.getSequenceFlows()) {
context.put("childActiviti... | |
493 | public Key max(){
if (isEmpty())
throw new NoSuchElementException("calls max() with empty symbol table");
return st.lastKey();
} | public Key max(){
noSuchElement(isEmpty(), "calls max() with empty symbol table");
return st.lastKey();
} | |
494 | Label updateCurrentBlockForJumpInstruction(int opcode, @Nonnull Label label){
Label nextInsn = null;
if (currentBlock != null) {
if (computeFrames) {
currentBlock.frame.executeJUMP(opcode);
label.getFirst().markAsTarget();
addSuccessor(Edge.NORMAL, label);
... | Label updateCurrentBlockForJumpInstruction(int opcode, @Nonnull Label label){
Label nextInsn = null;
if (currentBlock != null) {
if (computeFrames) {
currentBlock.frame.executeJUMP(opcode);
label.getFirst().markAsTarget();
addSuccessor(Edge.NORMAL, label);
... | |
495 | public int onStartCommand(Intent intent, int flags, int startId){
Log_OC.d(TAG, "Starting command " + intent);
if (intent == null || ACTION_START_OBSERVE.equals(intent.getAction())) {
startObservation();
return Service.START_STICKY;
} else if (ACTION_ADD_OBSERVED_FILE.equals(intent.getA... | public int onStartCommand(Intent intent, int flags, int startId){
Log_OC.d(TAG, "Starting command " + intent);
if (intent == null || ACTION_START_OBSERVE.equals(intent.getAction())) {
startObservation();
return Service.START_STICKY;
} else if (ACTION_ADD_OBSERVED_FILE.equals(intent.getA... | |
496 | public static boolean copyImage(Bitmap bitmap, String path, String fileName){
File file = new File(path, fileName);
boolean isSucceed = false;
FileOutputStream out = null;
try {
out = new FileOutputStream(file);
isSucceed = bitmap.compress(Bitmap.CompressFormat.PNG, 100, out);
... | public static boolean copyImage(Bitmap bitmap, String path, String fileName){
File file = new File(path, fileName);
boolean isSucceed = false;
FileOutputStream out = null;
try {
out = new FileOutputStream(file);
isSucceed = bitmap.compress(Bitmap.CompressFormat.PNG, 100, out);
... | |
497 | private void dynamicWaiting(WebDriver driver){
String[] keyExtentions = { "crdownload" };
try {
do {
Thread.sleep(100);
} while (!org.apache.commons.io.FileUtils.listFiles(new File(downloadFilePath), keyExtentions, false).isEmpty());
} catch (InterruptedException e) {
... | private void dynamicWaiting(){
String[] keyExtentions = { "crdownload" };
try {
do {
Thread.sleep(100);
} while (!org.apache.commons.io.FileUtils.listFiles(new File(downloadFilePath), keyExtentions, false).isEmpty());
} catch (InterruptedException e) {
}
} | |
498 | public int loadIndiaCensusData(String csvFilePath) throws CensusAnalyserException{
this.checkValidCSVFile(csvFilePath);
try (Reader reader = Files.newBufferedReader(Paths.get(csvFilePath))) {
IcsvBuilder csvBuilder = CSVBuilderFactory.createCSVBuilder();
csvFileMap = new HashMap<String, Indi... | public int loadIndiaCensusData(String csvFilePath) throws CensusAnalyserException{
this.checkValidCSVFile(csvFilePath);
try (Reader reader = Files.newBufferedReader(Paths.get(csvFilePath))) {
IcsvBuilder csvBuilder = CSVBuilderFactory.createCSVBuilder();
csvFileMap = new HashMap<String, Indi... | |
499 | public final boolean equals(final Object o){
if (Arez.areNativeComponentsEnabled()) {
if (this == o) {
return true;
} else if (null == o || !(o instanceof Arez_NameVariationsModel)) {
return false;
} else {
final Arez_NameVariationsModel that = (Are... | public final boolean equals(final Object o){
if (Arez.areNativeComponentsEnabled()) {
if (o instanceof Arez_NameVariationsModel) {
final Arez_NameVariationsModel that = (Arez_NameVariationsModel) o;
return this.$$arezi$$_id() == that.$$arezi$$_id();
} else {
... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.