blob_id
stringlengths
40
40
directory_id
stringlengths
40
40
path
stringlengths
4
410
content_id
stringlengths
40
40
detected_licenses
listlengths
0
51
license_type
stringclasses
2 values
repo_name
stringlengths
5
132
snapshot_id
stringlengths
40
40
revision_id
stringlengths
40
40
branch_name
stringlengths
4
80
visit_date
timestamp[us]
revision_date
timestamp[us]
committer_date
timestamp[us]
github_id
int64
5.85k
689M
star_events_count
int64
0
209k
fork_events_count
int64
0
110k
gha_license_id
stringclasses
22 values
gha_event_created_at
timestamp[us]
gha_created_at
timestamp[us]
gha_language
stringclasses
131 values
src_encoding
stringclasses
34 values
language
stringclasses
1 value
is_vendor
bool
1 class
is_generated
bool
2 classes
length_bytes
int64
3
9.45M
extension
stringclasses
32 values
content
stringlengths
3
9.45M
authors
listlengths
1
1
author_id
stringlengths
0
313
9e481f6261dd424d48e2a1b5e2393ec649a88f33
b9295388704bbd6cbd3a46598db8c2df0405f18f
/src/main/java/com/youtube/ecommerce/Repository/CategoryRepo.java
e63ad3f0f1d12c817f99995c0b0d5a1625aa9062
[]
no_license
khairi-brahmi/shoppingcart_spring_boot
49e84211118a8e3a4bb4b1d8ba78c13fe28382f9
67ea67ec94a79b9c447ff42f49443d7fff99a93f
refs/heads/master
2023-04-18T00:53:11.409058
2020-04-17T16:41:38
2020-04-17T16:41:38
376,351,251
1
0
null
2021-06-12T17:44:57
2021-06-12T17:44:56
null
UTF-8
Java
false
false
226
java
package com.youtube.ecommerce.Repository; import org.springframework.data.jpa.repository.JpaRepository; import com.youtube.ecommerce.model.Category; public interface CategoryRepo extends JpaRepository<Category, Long> { }
[ "programmerpraveenkumar@gmail.com" ]
programmerpraveenkumar@gmail.com
b4f0326bcfd1bd0c935a3ca8037f23bfe5e023b7
f2799873a2990beec3eb2052eb1bd2fe736a74fb
/src/main/java/com/stackroute/junitdemo/Student.java
f90a971c41eeb4722109439a1dce497b29ff0775
[]
no_license
shprdn/PracticeExample05
61a249890502be581bf3558c33a18999f63e89d1
aab6b2f7c4386129962465927ea0ef850a67eba4
refs/heads/master
2020-06-15T16:50:51.937422
2019-07-05T05:59:41
2019-07-05T05:59:41
195,346,395
0
0
null
null
null
null
UTF-8
Java
false
false
859
java
package com.stackroute.junitdemo; public class Student { private int id; private String name; private int age; @Override public String toString() { return "Student{" + "id=" + id + ", name='" + name + '\'' + ", age=" + age + '}'; } public Student(int id, String name, int age) { this.id = id; this.name = name; this.age = age; } public Student() { } public String getName() { return name; } public void setName(String name) { this.name = name; } public int getAge() { return age; } public void setAge(int age) { this.age = age; } public int getId() { return id; } public void setId(int id) { this.id = id; } }
[ "shprdn@gmail.com" ]
shprdn@gmail.com
e1aee2def80168abafab3d3dbf3f9d7f4bfcbed1
8c12b5a87c4ad1285a1b5c7b44674a2753fc002a
/src/main/java/com/julienviet/benchmarks/FindFirstSpecialByte.java
2b1386f826f1b57c6087b0fca8ef98d1d41a3fad
[ "Apache-2.0" ]
permissive
franz1981/perf-experiments
7d5e5fa56ff47e0b2d22ade504b9371ff534e8e5
2e75534c4e899231213e73c7853dc2aeded4261b
refs/heads/master
2021-08-30T22:03:38.350982
2017-12-19T15:26:11
2017-12-19T15:41:59
null
0
0
null
null
null
null
UTF-8
Java
false
false
6,578
java
package com.julienviet.benchmarks; import sun.misc.Unsafe; import java.lang.reflect.Field; public abstract class FindFirstSpecialByte { public static final Unsafe unsafe = getUnsafe(); public static final long byteArrayOffset = unsafe.arrayBaseOffset(byte[].class); private static Unsafe getUnsafe() { try { Field singleoneInstanceField = Unsafe.class.getDeclaredField("theUnsafe"); singleoneInstanceField.setAccessible(true); return (Unsafe) singleoneInstanceField.get(null); } catch (IllegalArgumentException | SecurityException | NoSuchFieldException | IllegalAccessException e) { throw new RuntimeException(e); } } public abstract long find(); public static abstract class HeapVersion extends FindFirstSpecialByte { final byte[] data; final byte[] lookup; final int size; public HeapVersion(String data) { this(data.getBytes()); } public HeapVersion(byte[] data) { this.data = data; this.size = data.length; lookup = new byte[256]; for (int i = 0;i < 0x20;i++) { lookup[i] = 1; } for (int i = 128;i < 256;i++) { lookup[i] = 1; } lookup['"'] = 1; lookup['\\'] = 1; } } public static class SimpleVersion extends HeapVersion { public SimpleVersion(String data) { super(data); } public SimpleVersion(byte[] data) { super(data); } @Override public long find() { for (int i = 0;i < size;i++) { int b = data[i] & 0xFF; if (b < 0x20 || b > 127 || b == '"' || b == '\\') { return i; } } return -1; } } public static class SimpleUnrolledVersion extends HeapVersion { public SimpleUnrolledVersion(String data) { super(data); } public SimpleUnrolledVersion(byte[] data) { super(data); } @Override public long find() { int i = 0; while (i < size) { int b1 = data[i] & 0xFF; if (b1 < 0x20 || b1 > 127 || b1 == '"' || b1 == '\\') { return i; } int b2 = data[i + 1] & 0xFF; if (b2 < 0x20 || b2 > 127 || b2 == '"' || b2 == '\\') { return i + 1; } int b3 = data[i + 2] & 0xFF; if (b3 < 0x20 || b3 > 127 || b3 == '"' || b3 == '\\') { return i + 2; } int b4 = data[i + 3] & 0xFF; if (b4 < 0x20 || b4 > 127 || b4 == '"' || b4 == '\\') { return i + 3; } i += 4; } return -1; } } public static class UnsafeVersion extends HeapVersion { public UnsafeVersion(String data) { super(data); } public UnsafeVersion(byte[] data) { super(data); } public long find() { long addr = byteArrayOffset; long limit = addr + size; while (addr < limit) { int b = unsafe.getByte(data, addr) & 0xFF; if (b < 0x20 || b > 127 || b == '"' || b == '\\') { return addr - byteArrayOffset; } addr++; } return -1; } } public static class UnsafeUnrolledVersion extends HeapVersion { public UnsafeUnrolledVersion(String data) { super(data); } public UnsafeUnrolledVersion(byte[] data) { super(data); } public long find() { long addr = byteArrayOffset; long limit = addr + size; while (addr < limit) { int b1 = unsafe.getByte(data, addr) & 0xFF; if (unsafe.getByte(lookup, byteArrayOffset + b1) != 0) { return addr - byteArrayOffset; } int b2 = unsafe.getByte(data, addr + 1) & 0xFF; if (unsafe.getByte(lookup, byteArrayOffset + b2) != 0) { return addr - byteArrayOffset + 1; } int b3 = unsafe.getByte(data, addr + 2) & 0xFF; if (unsafe.getByte(lookup, byteArrayOffset + b3) != 0) { return addr - byteArrayOffset + 2; } int b4 = unsafe.getByte(data, addr + 3) & 0xFF; if (unsafe.getByte(lookup, byteArrayOffset + b4) != 0) { return addr - byteArrayOffset + 3; } addr += 4; } return -1; } } public static abstract class OffHeapBase extends FindFirstSpecialByte { final long offHeapData; final long offHeapLookup; final int size; public OffHeapBase(String data) { this(data.getBytes()); } public OffHeapBase(byte[] data) { size = data.length; offHeapData = unsafe.allocateMemory(size); for (int i = 0; i < size; i++) { unsafe.putByte(offHeapData + i, data[i]); } offHeapLookup = unsafe.allocateMemory(256); for (int i = 0; i < 256;i++) { unsafe.putByte(offHeapLookup + i, (byte)0); } for (int i = 0;i < 0x20;i++) { unsafe.putByte(offHeapLookup + i, (byte)1); } for (int i = 128;i < 256;i++) { unsafe.putByte(offHeapLookup + i, (byte)1); } unsafe.putByte(offHeapLookup + '"', (byte)1); unsafe.putByte(offHeapLookup + '\\', (byte)1); } } public static class OffHeapVersion extends OffHeapBase { public OffHeapVersion(String data) { super(data); } public OffHeapVersion(byte[] data) { super(data); } public long find() { long addr = offHeapData; long limit = addr + size; while (addr < limit) { int b = unsafe.getByte(addr) & 0xFF; if (b < 0x20 || b > 127 || b == '"' || b == '\\') { return addr - offHeapData; } addr++; } return -1; } } public static class OffHeapUnrolledVersion extends OffHeapBase { public OffHeapUnrolledVersion(String data) { super(data); } public OffHeapUnrolledVersion(byte[] data) { super(data); } public long find() { long addr = offHeapData; long limit = addr + size; while (addr < limit) { int b1 = unsafe.getByte(addr) & 0xFF; if (unsafe.getByte(offHeapLookup + b1) != 0) { return addr - offHeapData; } int b2 = unsafe.getByte( addr + 1) & 0xFF; if (unsafe.getByte(offHeapLookup + b2) != 0) { return addr - offHeapData + 1; } int b3 = unsafe.getByte( addr + 2) & 0xFF; if (unsafe.getByte(offHeapLookup + b3) != 0) { return addr - offHeapData + 2; } int b4 = unsafe.getByte( addr + 3) & 0xFF; if (unsafe.getByte(offHeapLookup + b4) != 0) { return addr - offHeapData + 3; } addr += 4; } return -1; } } }
[ "julien@julienviet.com" ]
julien@julienviet.com
74e08a64b92eefa0c937872fdd496a79ed027805
b37532834f760bfca4a14e83e57afe01f7ef35a9
/db/src/main/java/cn/choleece/base/db/pool/hikari/pool/ProxyResultSet.java
720c1bb764c518a6e10b1150340b883207fdc796
[]
no_license
choleece/java-base
b33ed05c85175d47865b21b4705325c69bb992eb
b001ec1acb1fe0d980961c3337cef283838330a5
refs/heads/master
2022-06-28T15:02:08.231429
2020-12-26T09:11:40
2020-12-26T09:11:40
191,352,600
1
0
null
2022-06-21T02:10:56
2019-06-11T10:54:16
Java
UTF-8
Java
false
false
2,785
java
/* * Copyright (C) 2013, 2014 Brett Wooldridge * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package cn.choleece.base.db.pool.hikari.pool; import java.sql.ResultSet; import java.sql.SQLException; import java.sql.Statement; /** * This is the proxy class for java.sql.ResultSet. * * @author Brett Wooldridge */ public abstract class ProxyResultSet implements ResultSet { protected final ProxyConnection connection; protected final ProxyStatement statement; final ResultSet delegate; protected ProxyResultSet(ProxyConnection connection, ProxyStatement statement, ResultSet resultSet) { this.connection = connection; this.statement = statement; this.delegate = resultSet; } @SuppressWarnings("unused") final SQLException checkException(SQLException e) { return connection.checkException(e); } /** {@inheritDoc} */ @Override public String toString() { return this.getClass().getSimpleName() + '@' + System.identityHashCode(this) + " wrapping " + delegate; } // ********************************************************************** // Overridden java.sql.ResultSet Methods // ********************************************************************** /** {@inheritDoc} */ @Override public final Statement getStatement() throws SQLException { return statement; } /** {@inheritDoc} */ @Override public void updateRow() throws SQLException { connection.markCommitStateDirty(); delegate.updateRow(); } /** {@inheritDoc} */ @Override public void insertRow() throws SQLException { connection.markCommitStateDirty(); delegate.insertRow(); } /** {@inheritDoc} */ @Override public void deleteRow() throws SQLException { connection.markCommitStateDirty(); delegate.deleteRow(); } /** {@inheritDoc} */ @Override @SuppressWarnings("unchecked") public final <T> T unwrap(Class<T> iface) throws SQLException { if (iface.isInstance(delegate)) { return (T) delegate; } else if (delegate != null) { return delegate.unwrap(iface); } throw new SQLException("Wrapped ResultSet is not an instance of " + iface); } }
[ "chaolizheng@sf-express.com" ]
chaolizheng@sf-express.com
63b450dc5ea5f57dfd315e2b4e29d82466393ec5
9e9ae1ca31149df83555ce390de36898000dcba7
/app/src/main/java/mejia/sam/w2_sqliteschoolinfo/Main2Activity.java
3e0fa2ff13ff74324e383c999c8ccf4d5ceeab2e
[]
no_license
samsam895/W2_Sqllite_SchoolInfo
9302d70e729182699c5d5ecb54aa6457d820d2fe
b2e0b12f9c9e3837dc680b4643cd2fdf6084c843
refs/heads/master
2021-01-14T08:03:32.489075
2017-02-14T03:59:33
2017-02-14T03:59:33
81,903,129
0
0
null
null
null
null
UTF-8
Java
false
false
4,095
java
package mejia.sam.w2_sqliteschoolinfo; import android.support.v7.app.AppCompatActivity; import android.os.Bundle; import android.util.Log; import android.view.View; import android.widget.Button; import android.widget.EditText; import android.widget.TextView; import android.widget.Toast; import java.util.List; public class Main2Activity extends AppCompatActivity { @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main2); final DataBaseHandler db = new DataBaseHandler(this); Button btn = (Button) findViewById(R.id.btnserch); Button btnup = (Button) findViewById(R.id.btnupdate); Button btnde = (Button) findViewById(R.id.btndelete); final TextView tv = (TextView) findViewById(R.id.tv); final TextView tv1 = (TextView) findViewById(R.id.tv1); final TextView tv2 = (TextView) findViewById(R.id.tv2); final TextView tv3 = (TextView) findViewById(R.id.tv3); final EditText et = (EditText) findViewById(R.id.et); final EditText etna = (EditText) findViewById(R.id.namesv); final EditText etad = (EditText) findViewById(R.id.adrsv); final EditText etph = (EditText) findViewById(R.id.phosv); btn.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View view) { if(!et.getText().toString().equals("")) { Integer n = Integer.valueOf(et.getText().toString()); Content content = db.getContent(n); if (content != null) { tv.setText("" + content.getId()); tv1.setText("" + content.getName()); tv2.setText("" + content.getAdress()); tv3.setText("" + content.getPhone()); etna.setText(tv1.getText().toString()); etad.setText(tv2.getText().toString()); etph.setText(tv3.getText().toString()); } else { Toast.makeText(Main2Activity.this, "There's not data", Toast.LENGTH_SHORT).show(); } } } }); btnup.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View view) { if(!tv.getText().toString().equals("")){ int tb = Integer.parseInt(tv.getText().toString()); String sna = etna.getText().toString(); String sad = etad.getText().toString(); String sph = etph.getText().toString(); Content content = new Content(tb,sna,sad,sph); db.updateContent(content); } } }); btnde.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View view) { if(!tv.getText().toString().equals("")) { int tb = Integer.parseInt(tv.getText().toString()); Content content = new Content(tb); db.deleteContent(content); } } }); /** * CRUD Operations * */ // Inserting Contacts // Log.d("Insert: ", "Inserting .."); // db.addContent(new Content("Ravi", "9100000000")); // db.addContent(new Content("Srinivas", "9199999999")); // db.addContent(new Content("Tommy", "9522222222")); // db.addContent(new Content("Karthik", "9533333333")); // Reading all contacts Log.d("Reading: ", "Reading all contacts.."); List<Content> contacts = db.getAllContacts(); for (Content cn : contacts) { String log = "Id: " + cn.getId() + " ,Name: " + cn.getName() + ", Adress: " + cn.getAdress() + ",Phone: " + cn.getPhone(); // Writing Contacts to log Log.d("Name: ", log); } } }
[ "mobappsam@gmail.com" ]
mobappsam@gmail.com
06c485a1b022cdac97125cb5900be27e7aef405c
3ef14e9b3dd67969f28c4d15a3d1a4290329e8ca
/src/net/shopxx/service/impl/DeliveryTemplateServiceImpl.java
48878bc632fad5d6912d75463bfa68c070c3f666
[]
no_license
jackoulee/demo
e38d32d2838c8580590a3da2c53ab747b68246ef
a84b11db827e6f1a51d63e8985b7b614e238d1df
refs/heads/master
2021-08-22T19:26:51.825190
2017-12-01T02:28:29
2017-12-01T02:28:29
112,680,754
0
0
null
null
null
null
UTF-8
Java
false
false
1,570
java
/* * Copyright 2005-2015 shopxx.net. All rights reserved. * Support: http://www.shopxx.net * License: http://www.shopxx.net/license */ package net.shopxx.service.impl; import javax.annotation.Resource; import net.shopxx.dao.DeliveryTemplateDao; import net.shopxx.entity.DeliveryTemplate; import net.shopxx.service.DeliveryTemplateService; import org.apache.commons.lang.BooleanUtils; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; import org.springframework.util.Assert; @Service("deliveryTemplateServiceImpl") public class DeliveryTemplateServiceImpl extends BaseServiceImpl<DeliveryTemplate, Long> implements DeliveryTemplateService { @Resource(name = "deliveryTemplateDaoImpl") private DeliveryTemplateDao deliveryTemplateDao; @Transactional(readOnly = true) public DeliveryTemplate findDefault() { return deliveryTemplateDao.findDefault(); } @Override @Transactional public DeliveryTemplate save(DeliveryTemplate deliveryTemplate) { Assert.notNull(deliveryTemplate); if (BooleanUtils.isTrue(deliveryTemplate.getIsDefault())) { deliveryTemplateDao.setDefault(deliveryTemplate); } return super.save(deliveryTemplate); } @Override @Transactional public DeliveryTemplate update(DeliveryTemplate deliveryTemplate) { Assert.notNull(deliveryTemplate); if (BooleanUtils.isTrue(deliveryTemplate.getIsDefault())) { deliveryTemplateDao.setDefault(deliveryTemplate); } return super.update(deliveryTemplate); } }
[ "jackou@qq.com" ]
jackou@qq.com
83b9ca742e1ad24015ded1e4f1eab0d87bb2b616
c3f33732c9ded78f5bd3d52c1aa7909fc3dfb813
/SudokuMaker/SudokuMaker.java
80f62053531dfa882a711bdd2e5bcedc50e1f0ad
[]
no_license
richyliu/java
1f6b3aa10192d65a13601b64092f5ffbe904e20c
ab70a1861a6a8427b4f6a9c533bbe34cf00dcaca
refs/heads/master
2020-03-30T13:49:02.574641
2019-06-01T01:52:00
2019-06-01T01:52:00
151,289,046
0
0
null
null
null
null
UTF-8
Java
false
false
3,448
java
/** * SudokuMaker - Creates a Sudoku puzzle using recursion and backtracking * * @author Richard Liu * @since Jan. 22, 2019 * */ public class SudokuMaker { private int[][] puzzle; private final int PUZZLE_SIZE = 9; public SudokuMaker() { // create blank puzzle puzzle = new int[PUZZLE_SIZE][PUZZLE_SIZE]; // init to all 0's for (int i = 0; i < PUZZLE_SIZE; i++) for (int j = 0; j < PUZZLE_SIZE; j++) puzzle[i][j] = 0; } /** * Generate a random number within 1 .. n inclusive that is not already in * the array * @param arr Array to generate from. 0's are treated as empty * @param n Maximum value. */ public int generateRandom(int[] arr, int n) { int rand = (int)(Math.random() * n) + 1; // if rand already in arr, generate again for (int i = 0; i < arr.length; i++) if(arr[i] == rand) return generateRandom(arr, n); // otherwise return rand (as it doesn't exist in arr) return rand; } /** * Creates a sudoku puzzle recusively. Call initially with (0, 0) * @param row Current row to work on. * @param column Current column to work on */ public boolean createPuzzle(int row, int column) { // if row is past the last one, puzzle is done if (row == PUZZLE_SIZE) return true; // create list of random numbers int[] nums = new int[PUZZLE_SIZE]; // then randomly generate numbers for (int i = 0; i < PUZZLE_SIZE; i++) nums[i] = generateRandom(nums, PUZZLE_SIZE); // for each number in list to try for (int num : nums) { // whether the num is not in the row, column, or 3x3 grid or not boolean validNum = true; // check if num is in the row for (int i = 0; i < PUZZLE_SIZE; i++) if (puzzle[row][i] == num) validNum = false; // check if num is in column for (int i = 0; i < PUZZLE_SIZE; i++) if (puzzle[i][column] == num) validNum = false; // check if num is in 3x3 grid for (int i = (int)(row/3)*3; i < (int)(row/3)*3 + 3; i++) for (int j = (int)(column/3)*3; j < (int)(column/3)*3 + 3; j++) if (puzzle[i][j] == num) validNum = false; // num is not in row, column, or 3x3 grid if (validNum) { puzzle[row][column] = num; // check createPuzzle with next column or next row and start from 0 col if (column == PUZZLE_SIZE-1 ? createPuzzle(row + 1, 0) : createPuzzle(row, column + 1)) // puzzle is completed return true; else // grid doesn't work here, reset to no solution puzzle[row][column] = 0; } } // no number works in this location, so backtrack return false; } /** * printPuzzle - prints the Sudoku puzzle with borders * If the value is 0, then print an empty space; otherwise, print the number. */ public void printPuzzle() { System.out.print(" +-----------+-----------+-----------+\n"); String value = ""; for (int row = 0; row < puzzle.length; row++) { for (int col = 0; col < puzzle[0].length; col++) { // if number is 0, print a blank if (puzzle[row][col] == 0) value = " "; else value = "" + puzzle[row][col]; if (col % 3 == 0) System.out.print(" | " + value); else System.out.print(" " + value); } if ((row + 1) % 3 == 0) System.out.print(" |\n +-----------+-----------+-----------+\n"); else System.out.print(" |\n"); } } public static void main(String[] args) { SudokuMaker sm = new SudokuMaker(); sm.createPuzzle(0, 0); sm.printPuzzle(); } }
[ "richy.liu.2002@gmail.com" ]
richy.liu.2002@gmail.com
c13a4e2bf6b438f39ffb0d0f4303c5c06df5eeb3
fa24b6bf5ff4ac4623a08b0f7446b0cf9fdaf24a
/src/main/java/io/rancher/type/EnvironmentFrom.java
d5ac0371cd0a2ec09079be8fbc2b083004011f9f
[]
no_license
zhuxs264710/rancher-java-client
c4519148519732d539bdd582d40c84adee45785f
c70923e187002d7d4c45226d4e24b6a912402038
refs/heads/master
2020-05-14T01:10:15.772903
2019-04-16T13:13:19
2019-04-16T13:13:19
181,683,142
0
0
null
null
null
null
UTF-8
Java
false
false
1,410
java
package io.rancher.type; import io.rancher.base.AbstractType; import io.rancher.model.enums.EnvironmentFromSourceEnum; public class EnvironmentFrom extends AbstractType { private Boolean optional; private String prefix; private EnvironmentFromSourceEnum source; private String sourceKey; private String sourceName; private String targetKey; public Boolean getOptional() { return this.optional; } public void setOptional(Boolean optional) { this.optional = optional; } public String getPrefix() { return this.prefix; } public void setPrefix(String prefix) { this.prefix = prefix; } public EnvironmentFromSourceEnum getSource() { return this.source; } public void setSource(EnvironmentFromSourceEnum source) { this.source = source; } public String getSourceKey() { return this.sourceKey; } public void setSourceKey(String sourceKey) { this.sourceKey = sourceKey; } public String getSourceName() { return this.sourceName; } public void setSourceName(String sourceName) { this.sourceName = sourceName; } public String getTargetKey() { return this.targetKey; } public void setTargetKey(String targetKey) { this.targetKey = targetKey; } }
[ "359067638@qq.com" ]
359067638@qq.com
5350ea659592f00646767fe8e03bcdfe60db5df4
61f695c3a437980674521515e7a393ea6eab3db1
/src/detailProduct/DetailProductServiceImp.java
4ff7125c10d77f2a0fefb68c6aa41fa87007ff73
[]
no_license
gustygnm/Aplikasi-Penyewaan-Alat-Multimedia-dengan-JAVA-ArrayList-
35ac5a0ba72117b42d3318130c333bf243692474
c57f9f528718252a37355b078b387b388c7cb4c3
refs/heads/master
2020-03-12T13:13:59.129032
2018-04-24T05:13:27
2018-04-24T05:13:27
130,636,946
1
0
null
null
null
null
UTF-8
Java
false
false
1,363
java
/* * To change this license header, choose License Headers in Project Properties. * To change this template file, choose Tools | Templates * and open the template in the editor. */ package transaksi; import java.util.List; import javax.swing.JOptionPane; import javax.swing.table.DefaultTableModel; import product.DataProduct; import product.Product; /** * * @author gusty_g.n.m */ public class DetailProductServiceImp implements DetailProductService { @Override public void insert(Transaksi transaksi) { DataDetailProduct.listDetailProduct.add(transaksi); } @Override public void delete(int index) { DataDetailProduct.listDetailProduct.remove(index); } @Override public DefaultTableModel view() { String[] judul = {"ID Transaksi","ID Product", "Jenis Product", "Nama Product", "Harga Sewa"}; DefaultTableModel dtm = new DefaultTableModel(null, judul); for (Transaksi m : DataDetailProduct.listDetailProduct) { Object[] kolom = new Object[5]; kolom[0] = m.getId(); kolom[1] = m.getProduct().getIdProduct(); kolom[2] = m.getProduct().getJenisProduct(); kolom[3] = m.getProduct().getNamaProduct(); kolom[4] = m.getProduct().getHargaSewa(); dtm.addRow(kolom); } return dtm; } }
[ "gusti.ngurah.mertayasa@gmail.com" ]
gusti.ngurah.mertayasa@gmail.com
2f5bced457bcde6b7c699c1cbf294a695be88785
f2cbfd237edf1eac73cb356d0c985b26e11d7524
/src/main/java/com/loeyo/vhr/VhrApplication.java
c52e6b42c605ce18092efd1cf8f192d30b58571f
[]
no_license
loeyo/vhr
79cc078e4c33b4fe27cf6767fd60a22b59f28865
6b0177e2cffcbac53870a79dad81be63a7cc5161
refs/heads/master
2022-12-06T19:45:27.031876
2020-08-28T08:00:22
2020-08-28T08:00:22
290,744,726
0
0
null
null
null
null
UTF-8
Java
false
false
312
java
package com.loeyo.vhr; import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.SpringBootApplication; @SpringBootApplication public class VhrApplication { public static void main(String[] args) { SpringApplication.run(VhrApplication.class, args); } }
[ "wanglinchao@trustkernel.com" ]
wanglinchao@trustkernel.com
eaea4d727a770e78cf73fa10721f1f9fec0a3972
4afe6e5e2f08ed808b17d72d770bbf288a60a5ea
/emailPLUS/project/emailPlus/src/emailplus/pop/ContentManager.java
5ef418eea90c2cb5dc71521aa451d7f61b5ef694
[]
no_license
simrandeep91/emailPLUS
ccd377f855e4bb7f885613753ea58aa56a543960
3d405b7e70ee335959e66c4cd97b8f1513288f37
refs/heads/master
2021-05-02T04:41:45.903781
2016-12-18T21:53:53
2016-12-18T21:53:53
76,808,586
0
0
null
null
null
null
UTF-8
Java
false
false
4,848
java
/* * To change this template, choose Tools | Templates * and open the template in the editor. */ package emailplus.pop; import java.io.InputStream; import java.io.FileOutputStream; import java.util.ArrayList; import javax.mail.Flags.Flag; import javax.mail.Folder; import javax.mail.Message; import javax.mail.Multipart; import javax.mail.Part; /** * * @author Vishal */ public class ContentManager { ArrayList partList=null; //hold list of bodyparts that have file attached with them ArrayList fileNameList=null; //hold names of attached filenames //static boolean openFlag=false; public ContentManager() { //partList=new ArrayList(); //fileNameList=new ArrayList(); } public void getMessageContent(MessageHeader mh,int count) { String content=""; partList=new ArrayList(); fileNameList=new ArrayList(); try { //System.out.println(SimpleReceiver.openFlag); if(!SimpleReceiver.openFlag) SimpleReceiver.folder.open(Folder.READ_ONLY); //SimpleReceiver.msgcount=SimpleReceiver.folder.getMessageCount(); //System.out.println(SimpleReceiver.msgcount); Message msg=SimpleReceiver.folder.getMessage(count); content=getPartContent(msg); mh.setFileNameList(fileNameList); mh.setPartList(partList); mh.setMessageContent(content); SimpleReceiver.openFlag=true; } catch(Exception e) { System.out.println("in catch of getMessagecontent "+e); } } private String getPartContent(Part p) { String content=""; String filename; try { Object obj=p.getContent(); if(p.isMimeType("text/plain")) { filename=p.getFileName(); if(filename!=null) { partList.add(p); fileNameList.add(p.getFileName()); } else content+=(String)obj; } else if(obj instanceof Multipart) { Multipart mp=(Multipart)obj; for(int i=0;i<mp.getCount();i++) content+=getPartContent(mp.getBodyPart(i)); } else if(obj instanceof InputStream) { partList.add(p); fileNameList.add(p.getFileName()); /*InputStream ip=(InputStream)obj; byte[] b=new byte[8]; int i=ip.read(b); while(i!=-1) { content+=b.toString(); i=ip.read(b); }*/ } } catch(Exception e) { System.out.println("in catch of getPartContent "+e); return content; } return content; } public String downloadFile(Part p,String path) { FileOutputStream fout=null; InputStream ip=null; String result="failed"; try { Object obj=p.getContent(); if(p.isMimeType("text/plain")) { String content=(String)obj; fout=new FileOutputStream(path); fout.write(content.getBytes()); } //String filename=p.getFileName(); //System.out.println(filename); //String path="C:\\Users\\deepika\\Downloads\\"+filename; else { fout=new FileOutputStream(path); ip=(InputStream)obj; byte[] b=new byte[8]; int i=ip.read(b); while(i!=-1) { fout.write(b); //content+=b.toString(); i=ip.read(b); } } result="complete"; } catch(Exception e) { System.out.println("in catch of downloadFile function "+e); return result; } finally { try { if(fout!=null) fout.close(); if(ip!=null) ip.close(); } catch(Exception e) { System.out.println("in finally of downloadFile "+e); return result; } } return result; } }
[ "simrandeepsingh91@gmail.com" ]
simrandeepsingh91@gmail.com
5796421c1fe72d7b8901e5871d599cad6b647480
20f734f291000e74fb00a31a4f6add0aa9c7b4f8
/lnet_toolroom/src/main/java/com/lnet/service/impl/CommonServiceImpl.java
77aa0e1b5bc48f68edad137324b539f0b3eb7613
[]
no_license
nonoyet/qiyouyou
6da2d153dfc700edb500bfb18c0337dd70633d8e
27044becd29a11d90ca56aca017923d6cf1f0733
refs/heads/master
2021-01-22T06:43:56.846185
2017-02-14T09:28:28
2017-02-14T09:28:28
81,781,499
0
0
null
null
null
null
UTF-8
Java
false
false
4,568
java
package com.lnet.service.impl; import java.util.HashMap; import java.util.List; import java.util.Map; import java.util.Properties; import javax.servlet.http.HttpServletRequest; import javax.sql.DataSource; import org.apache.tapestry5.ioc.services.RegistryShutdownHub; import org.apache.tapestry5.ioc.services.RegistryShutdownListener; import org.logicalcobwebs.proxool.ProxoolDataSource; import org.logicalcobwebs.proxool.ProxoolException; import org.logicalcobwebs.proxool.ProxoolFacade; import org.logicalcobwebs.proxool.configuration.PropertyConfigurator; import base.service.impl.BaseServiceImpl; public class CommonServiceImpl extends BaseServiceImpl { protected HttpServletRequest request; public HttpServletRequest getRequest() { return request; } public void setRequest(HttpServletRequest request) { this.request = request; } protected Map<String, Object> session; /** * 根据sql语句进行分页查询(<span style="color:red;">对应的查询参数不能加上单引号,比如name=?而不是name='?',否则会报错</span>) * @param hql * @param params * @param orderBy * @param order * @param curPage * @param pageSize * @return */ public List<?> findSql(String hql, Object[] params, String[] orderBy, String[] order, int curPage, int pageSize) { int offset = (curPage - 1) * pageSize + 1; int limit = pageSize; return dao.findSQL(hql, params, orderBy, order, offset - 1, limit); } /** * Hql统计 * @param hql * @param params * 参数数组 * @return */ public int count(String hql, Object[] params) { return dao.count(hql, params); } /** * 根据hql统计 * @param hql * @return */ public int count(String hql) { return dao.count(hql); } /** * 根据sql统计 * @param sql * @return */ public int countSql(String sql) { return dao.countSQL(sql); } /** * 根据sql统计 * @param sql * @param params * 参数数组 * @return */ public int countSql(String sql, Object[] params) { return dao.countSQL(sql, params); } /** * 合并保存 * @param obj 保存的对象 */ public void merge(Object obj) { dao.merge(obj); } public DataSource buildDataSource(RegistryShutdownHub shutdownHub, String jdbcUser, String jdbcPassword, String jdbcDriverClass, String jdbcUrl) { final String poolName = "qwpool" + jdbcUser; Properties info = new Properties(); info.setProperty("jdbc-x.proxool.alias", poolName); info.setProperty("jdbc-x.proxool.maximum-connection-count", "50"); info.setProperty("jdbc-x.user", jdbcUser); if (jdbcPassword != null) { info.setProperty("jdbc-x.password", jdbcPassword); } info.setProperty("jdbc-x.proxool.driver-class", jdbcDriverClass); info.setProperty("jdbc-x.proxool.driver-url", jdbcUrl); //configuration proxool database source final String[] pools = ProxoolFacade.getAliases(); boolean flag = false; for(int i=0; i<pools.length; i++) { if(pools[i].equals(poolName)) { flag = true; break; } } if(flag == false) { try { PropertyConfigurator.configure(info); } catch (ProxoolException e) { e.printStackTrace(); } } //new datasource DataSource ds = new ProxoolDataSource(poolName); //register to shutdown shutdownHub.addRegistryShutdownListener(new RegistryShutdownListener() { public void registryDidShutdown() { boolean contains = false; for(int j=0; j<pools.length; j++) { if(pools[j].equals(poolName)) { contains = true; break; } } if(contains == true) { try { ProxoolFacade.removeConnectionPool(poolName); } catch (ProxoolException e) { e.printStackTrace(); } } } }); return ds; } /** * 批量更新 * @param dataList * @param batchSize */ public void batchUpdate(List<?> dataList, int batchSize) { dao.batchUpdate(dataList, batchSize); } /** * 初始化查询表 * @return */ public Map<String, String> initOfficeMap() { List<?> czdmList = dao.findSQL("select idcard,REAL_NAME from users"); Map<String, String> czdmMap = new HashMap<String, String>(); for(int i=0; i<czdmList.size(); i++) { Object[] obj = (Object[])czdmList.get(i); czdmMap.put(String.valueOf(obj[0]), String.valueOf(obj[1])); } return czdmMap; } public Map<String, Object> getSession() { return session; } public void setSession(Map<String, Object> session) { this.session = session; } }
[ "359371760@qq.com" ]
359371760@qq.com
7f54fa3da5dada13aee676bfd9e3d0d7675bd42b
c4cfc32d4acfdb901d422a972358b62183dd2eac
/Classes/src/com/javaUdemy/Car.java
b6d9686e3a6b43738e70c435188062e0c92a1c5f
[]
no_license
sandeepsharma-kgp/javaUdemy
e980ff5ce750f7675cedd3aee4d759f9eb7ca175
8c460fc6393610fa66e2396b39cd7da8f820a90d
refs/heads/master
2021-03-27T12:55:45.365113
2017-10-09T07:36:34
2017-10-09T07:36:34
106,128,408
0
0
null
null
null
null
UTF-8
Java
false
false
598
java
package com.javaUdemy; public class Car { private int doors; private int wheels; //public String model; // only this variable is accessible outside this class. private String model; private String engine; private String colour; //setter public void setModel(String model){ String validModel = model.toLowerCase(); if(validModel.equals("carrera") || validModel.equals("commodore")) this.model = model; else this.model = "Unknown"; } //getter public String getModel(){ return this.model; } }
[ "sandeepsharma.iit@gmail.com" ]
sandeepsharma.iit@gmail.com
8d0be6705d895dc68dc7e69d24ed170b8d7ce433
e0cc36833a32623f2ccafb27142cdd3afd5c8083
/customer/src/main/java/testdemo/topic/TopicCustomerTest.java
09b0c16345af9593dce5b05f0bed0135a0f8e018
[]
no_license
guopy666/rabmqdemo
29d3ce00a33af2af7d4778c8d753e6df0dd6ec65
8d8f0213cfb7459e3fef9c3744aa1ce868a04836
refs/heads/master
2021-05-18T13:03:42.893398
2020-03-30T09:16:10
2020-03-30T09:16:10
251,253,969
0
0
null
null
null
null
UTF-8
Java
false
false
1,581
java
package testdemo.topic; import com.rabbitmq.client.*; import utils.RabbitMQUtil; import java.io.IOException; import java.util.concurrent.TimeoutException; /** * @Description: 主题模式,和路由模式相似,匹配规则更加开放 * @author: guopy * @Date: 2020/3/30 16:58 * @version: v1.0.0 */ public class TopicCustomerTest { private static final String QUEUE_NAME = "topic_consumer_info"; private static final String EXCHANGE_NAME = "my_topic_exchange"; public static void main(String[] args) throws IOException, TimeoutException { System.out.println("log * 消费者启动"); /* 1.创建新的连接 */ Connection connection = RabbitMQUtil.newConnection(); /* 2.创建通道 */ Channel channel = connection.createChannel(); /* 3.消费者关联队列 */ channel.queueDeclare(QUEUE_NAME, false, false, false, null); /* 4.消费者绑定交换机 参数1 队列 参数2交换机 参数3 routingKey */ channel.queueBind(QUEUE_NAME, EXCHANGE_NAME, "log.*.*"); DefaultConsumer consumer = new DefaultConsumer(channel) { @Override public void handleDelivery(String consumerTag, Envelope envelope, AMQP.BasicProperties properties, byte[] body) throws IOException { String msg = new String(body, "UTF-8"); System.out.println("消费者获取生产者消息:" + msg); } }; /* 5.消费者监听队列消息 */ channel.basicConsume(QUEUE_NAME, true, consumer); } }
[ "guo_pengying@163.com" ]
guo_pengying@163.com
70729b0a5c0a025a0bbe725e29d03d61519635a3
dd43cdb0734d0bbbf3f8302385fef1878317d403
/Tree1/src/MotuPatlu.java
0cf81ba89a2a9adb325bf1e8cea7b1d2e7838a10
[]
no_license
abhipaul/dsAndAlgo
eb5c7b72b422c077088bb45b9a43d76b76e96d22
05cfba77597999f456758ec85a24a73bc22b7b0b
refs/heads/master
2021-07-14T14:00:14.923983
2020-08-25T10:21:22
2020-08-25T10:21:22
196,692,231
0
0
null
null
null
null
UTF-8
Java
false
false
1,382
java
import java.util.Collections; import java.util.Scanner; public class MotuPatlu { public static void main(String args[]) { int sample = 0, count = 0; Scanner s = new Scanner(System.in); sample = s.nextInt(); do { int n = 0; n = s.nextInt(); int[] height = new int[n]; for(int i=0;i<n;i++) { height[i] = s.nextInt(); } doTheCalcu(height, reverse(height), n); count++; }while(count<sample); } private static void doTheCalcu(int[] motu, int[] patlu, int n) { int i = 0,j =0; // since motu is twice as fast as patlu for(int k = 0; k< patlu.length; k++) { patlu[k] = patlu[k] * 2; } while((i+j) < n) { if(motu[i]<patlu[j]) { patlu[j] = patlu[j]- motu[i]; motu[i] = 0; i++; } else if(motu[i]>patlu[j]) { motu[i] = motu[i]- patlu[j]; patlu[j] = 0; j++; } else if(motu[i]==patlu[j]) { motu[i]= 0; patlu[j] = 0; if((i+j+1)==n && i>j) { j++; }else if((i+j+1)==n && j>i) { i++; }else { i++; j++; } } } System.out.println(i+ " "+ j); if(i>j) { System.out.println("Motu"); }else { System.out.println("Patlu"); } } public static int[] reverse(int[] nums) { int[] reversed = new int[nums.length]; for (int i=0; i<nums.length; i++) { reversed[i] = nums[nums.length - 1 - i]; } return reversed; } }
[ "abhijitkumar.paul@ca.com" ]
abhijitkumar.paul@ca.com
250253f115c6b02fa98096aa7b280cb6dd314df4
3bf72835011823b36f47fe17c0f142c6260636c8
/src/main/java/Utilities/TakeScreenshot.java
4ddf61d94a8454fc0a6bf17ab5a3a69b63d06f73
[]
no_license
dhoanglong/Localization
aaff266f8e1153ce5ddda9d69a8391447ff2849b
b8219bfa83764cfb7c878f58e883434f68110b62
refs/heads/master
2023-05-10T21:20:56.196191
2020-10-01T03:23:52
2020-10-01T03:23:52
274,642,220
0
0
null
2023-05-09T18:52:11
2020-06-24T10:35:15
HTML
UTF-8
Java
false
false
1,391
java
package Utilities; import io.appium.java_client.ios.IOSDriver; import org.apache.commons.io.FileUtils; import org.openqa.selenium.OutputType; import org.openqa.selenium.TakesScreenshot; import javax.imageio.ImageIO; import java.awt.*; import java.awt.image.BufferedImage; import java.io.File; import java.io.IOException; public class TakeScreenshot { public static void takeScreenshot(IOSDriver driver, Phones phone, String outputLocation) { try { System.out.println("Capturing the snapshot of the page "); Thread.sleep(1000); File srcFiler = ((TakesScreenshot) driver).getScreenshotAs(OutputType.FILE); FileUtils.copyFile(srcFiler, new File("src/test/resources/actual/"+outputLocation+".png"),false); cropImageSquare("src/test/resources/actual/"+outputLocation+".png", phone); } catch(Exception e) { System.out.println(e); } } public static void cropImageSquare(String path, Phones phone) throws IOException { Image src = ImageIO.read(new File(path)); BufferedImage dst = new BufferedImage(phone.w, phone.h, BufferedImage.TYPE_INT_ARGB); dst.getGraphics().drawImage(src, 0, 0, phone.w, phone.h, phone.x, phone.y, phone.x + phone.w, phone.y + phone.h, null); ImageIO.write(dst, "png", new File(path)); src.flush(); } }
[ "long_dinh@epam.com" ]
long_dinh@epam.com
866f9ea01517e37c53cccbd4fa441626747ab6d1
c1e87eb6aa66ff742db4d0726d8f57619edae534
/app/src/main/java/com/spade/mek/ui/login/view/LoginFragment.java
076d939dbf3bfd13d69459429ad311ce8f4adfba
[]
no_license
ddopik/ProjectM
10e8c98f27270a07b131df8cefd1e57907849856
61ee763b0fe4a62db033a7fb63b4bec18e290dfe
refs/heads/master
2020-03-20T22:34:30.944414
2019-03-06T10:25:42
2019-03-06T10:25:42
137,805,144
0
0
null
null
null
null
UTF-8
Java
false
false
4,621
java
package com.spade.mek.ui.login.view; import android.content.Intent; import android.graphics.Paint; import android.os.Bundle; import android.support.annotation.Nullable; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; import android.widget.Button; import android.widget.ImageView; import android.widget.TextView; import android.widget.Toast; import com.google.android.gms.analytics.HitBuilders; import com.google.android.gms.analytics.Tracker; import com.spade.mek.R; import com.spade.mek.application.MekApplication; import com.spade.mek.base.BaseFragment; import com.spade.mek.ui.home.MainActivity; import com.spade.mek.ui.login.presenter.LoginPresenter; import com.spade.mek.ui.login.presenter.LoginPresenterImpl; import com.spade.mek.ui.login.server_login.ServerLoginActivity; import com.spade.mek.ui.register.RegisterActivity; import com.spade.mek.utils.ImageUtils; import com.spade.mek.utils.PrefUtils; /** * Created by Ayman Abouzeidd on 6/12/17. */ public class LoginFragment extends BaseFragment implements LoginView { private LoginPresenter mLoginPresenter; private View mView; @Nullable @Override public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) { mView = inflater.inflate(R.layout.fragment_login, container, false); initViews(); overrideFonts(getContext(), mView); Tracker tracker = MekApplication.getDefaultTracker(); tracker.setScreenName(getResources().getString(R.string.login)); tracker.send(new HitBuilders.ScreenViewBuilder().build()); return mView; } @Override protected void initPresenter() { mLoginPresenter = new LoginPresenterImpl(this, getContext()); mLoginPresenter.initLoginManagers(getActivity()); } @Override protected void initViews() { TextView continueAsGuest = (TextView) mView.findViewById(R.id.loginAsGuestBtn); Button loginWithFacebook = (Button) mView.findViewById(R.id.loginWithFacebookBtn); Button loginWithGoogle = (Button) mView.findViewById(R.id.loginWithGoogleBtn); Button signInButton = (Button) mView.findViewById(R.id.loginBtn); Button registerButton = (Button) mView.findViewById(R.id.registerBtn); ImageView imageView = (ImageView) mView.findViewById(R.id.logo_image_view); String appLang = PrefUtils.getAppLang(getContext()); imageView.setImageResource(ImageUtils.getSplashLogo(appLang)); continueAsGuest.setOnClickListener(v -> mLoginPresenter.loginAsGuest()); loginWithFacebook.setOnClickListener(v -> mLoginPresenter.loginWithFacebook(this)); loginWithGoogle.setOnClickListener(v -> mLoginPresenter.loginWithGoogle(this)); registerButton.setOnClickListener(v -> { Intent intent = RegisterActivity.getLaunchIntent(getContext()); intent.putExtra(RegisterActivity.EXTRA_TYPE, RegisterActivity.REGISTER_TYPE); startActivity(intent); }); signInButton.setOnClickListener(v -> startActivity(ServerLoginActivity.getLaunchIntent(getContext()))); continueAsGuest.setPaintFlags(Paint.UNDERLINE_TEXT_FLAG); } @Override public void onError(String message) { Toast.makeText(getContext(), message, Toast.LENGTH_LONG).show(); } @Override public void onError(int resID) { Toast.makeText(getContext(), getString(resID), Toast.LENGTH_LONG).show(); } @Override public void showLoading() { } @Override public void hideLoading() { } @Override public void finish() { getActivity().finish(); } @Override public void navigate() { startActivity(MainActivity.getLaunchIntent(getContext())); } @Override public void navigateToMainScreen() { startActivity(MainActivity.getLaunchIntent(getContext())); getActivity().finish(); } @Override public void onActivityResult(int requestCode, int resultCode, Intent data) { super.onActivityResult(requestCode, resultCode, data); mLoginPresenter.onActivityResult(requestCode, resultCode, data); } @Override public void onStop() { super.onStop(); mLoginPresenter.disconnectGoogleApiClient(); } @Override public void onDestroy() { super.onDestroy(); mLoginPresenter.disconnectGoogleApiClient(); } }
[ "ddopik.01@gmail.com" ]
ddopik.01@gmail.com
1d1dd78770fd7107fdd93d4cab64de48c5de8fd1
20523396bd433091cc77e977cb8102fd44fe65b8
/src/main/webapp/routesHelpers/PostHelper.java
a6d97be267331e58a67bd72d836c5cb3b402becd
[]
no_license
KrzysztofP90/KMrest
b51b2e62b6208f69de3a7f1b5a1241a89ab24b7f
51348e41e45cee37639df5b587c03b00d9d39bbe
refs/heads/master
2022-05-29T15:41:14.048472
2019-08-14T10:57:59
2019-08-14T10:57:59
165,840,122
0
0
null
null
null
null
UTF-8
Java
false
false
550
java
package routesHelpers; import javax.servlet.http.HttpServletRequest; import java.io.BufferedReader; import java.io.IOException; public class PostHelper { public String getPostJsonFromBody(HttpServletRequest request) throws IOException { BufferedReader bf = request.getReader(); StringBuilder sb = new StringBuilder(); String line = bf.readLine(); while (line != null) { sb.append(line); line = bf.readLine(); } String json = sb.toString(); return json; } }
[ "krzysztof1.przybylowicz@gmail.com" ]
krzysztof1.przybylowicz@gmail.com
8799a961fb4d92d40381da165a28d70337c7939e
c5149d5eb41629fbaeb7c5e4980b9e5e58fd0127
/java1.java
4f8b507b767e51bf7b35118cdf6c200a912b766e
[]
no_license
poojampatil/java-pgm
92667d9b5f9514e76f657b96cd56d1ad7de5f240
d0ef7c34391ee3ff6c8f38d0c9f1d9add8b34ed7
refs/heads/master
2020-03-11T13:13:06.203888
2018-04-18T07:54:55
2018-04-18T07:54:55
130,018,845
0
0
null
null
null
null
UTF-8
Java
false
false
596
java
package com.niit; import java.util.Scanner; public class java1 { public static void main(String[] args) { int sum=0; Scanner s = new Scanner(System.in); System.out.print("Enter the number :"); int n = s.nextInt(); while(n>0){ int rem =n%10; if(rem%2!=0) { sum=sum+rem; } n=n/10; } if(sum%2==0) { System.out.println("Sum of odd digits is even"); } else { System.out.println("Sum of odd digits is odd"); } } }
[ "mpoojapatil4@gmail.com" ]
mpoojapatil4@gmail.com
4dd7b6c8bc3591ea35788b79c03731e8b90c01ac
f6cdb5d54e0ac9994f105c6f8fe2987585232085
/cw6/GraphPrinter.java
3115da0686cc197899fa94dcc49c8b11958bd630
[]
no_license
przand1/security
3114362d0040a2757efe16ff18a79910c081a2c8
867aa9289dda574b3b96f604cd44dd6c4a4fc2b3
refs/heads/master
2020-04-01T18:25:08.149099
2019-01-31T14:22:10
2019-01-31T14:22:10
153,491,192
0
0
null
null
null
null
UTF-8
Java
false
false
711
java
package cw6; import java.io.*; import java.util.Arrays; public class GraphPrinter { public static void printGraph(boolean[][] graph) { for (boolean[] bT : graph ) { for (boolean b:bT) { if (b) System.out.print("1 "); else System.out.print("- "); }System.out.print('\n'); } } public static void printGraph(byte[][][] graph) { for (byte[][] bT : graph ) { for (byte[] b:bT) { for (byte by : b ) { System.out.printf("0x%02X ",by); }System.out.print(" | "); }System.out.print('\n'); } } public static void printVals(byte[][] vals) { for (byte[] b:vals) { System.out.println(Arrays.toString(b)); } } }
[ "przand1@st.amu.edu.pl" ]
przand1@st.amu.edu.pl
399420c6834955f93fa6a1db847a8b1eedaaf3ce
6e0f671f2dfa4ade140fc0ec503117e04044f7b6
/src/test/java/io/aseg/application/security/DomainUserDetailsServiceIntTest.java
69daf1389e34e38c99a1b2ad34fb719c0c19cfcd
[]
no_license
hasega/jhbase
a0dd664c75e85007b5d4d71af1785a8419db633d
3209d6ea029d3038f8bdcdd442b480a67abba808
refs/heads/master
2021-05-13T16:55:53.363460
2018-01-09T11:17:14
2018-01-09T11:17:14
116,806,413
0
0
null
null
null
null
UTF-8
Java
false
false
4,647
java
package io.aseg.application.security; import io.aseg.application.JhbaseApp; import io.aseg.application.domain.User; import io.aseg.application.repository.UserRepository; import org.apache.commons.lang3.RandomStringUtils; import org.junit.Before; import org.junit.Test; import org.junit.runner.RunWith; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.boot.test.context.SpringBootTest; import org.springframework.security.core.userdetails.UserDetails; import org.springframework.security.core.userdetails.UserDetailsService; import org.springframework.test.context.junit4.SpringRunner; import org.springframework.transaction.annotation.Transactional; import java.util.Locale; import static org.assertj.core.api.Assertions.assertThat; /** * Test class for DomainUserDetailsService. * * @see DomainUserDetailsService */ @RunWith(SpringRunner.class) @SpringBootTest(classes = JhbaseApp.class) @Transactional public class DomainUserDetailsServiceIntTest { private static final String USER_ONE_LOGIN = "test-user-one"; private static final String USER_ONE_EMAIL = "test-user-one@localhost"; private static final String USER_TWO_LOGIN = "test-user-two"; private static final String USER_TWO_EMAIL = "test-user-two@localhost"; private static final String USER_THREE_LOGIN = "test-user-three"; private static final String USER_THREE_EMAIL = "test-user-three@localhost"; @Autowired private UserRepository userRepository; @Autowired private UserDetailsService domainUserDetailsService; private User userOne; private User userTwo; private User userThree; @Before public void init() { userOne = new User(); userOne.setLogin(USER_ONE_LOGIN); userOne.setPassword(RandomStringUtils.random(60)); userOne.setActivated(true); userOne.setEmail(USER_ONE_EMAIL); userOne.setFirstName("userOne"); userOne.setLastName("doe"); userOne.setLangKey("en"); userRepository.save(userOne); userTwo = new User(); userTwo.setLogin(USER_TWO_LOGIN); userTwo.setPassword(RandomStringUtils.random(60)); userTwo.setActivated(true); userTwo.setEmail(USER_TWO_EMAIL); userTwo.setFirstName("userTwo"); userTwo.setLastName("doe"); userTwo.setLangKey("en"); userRepository.save(userTwo); userThree = new User(); userThree.setLogin(USER_THREE_LOGIN); userThree.setPassword(RandomStringUtils.random(60)); userThree.setActivated(false); userThree.setEmail(USER_THREE_EMAIL); userThree.setFirstName("userThree"); userThree.setLastName("doe"); userThree.setLangKey("en"); userRepository.save(userThree); } @Test @Transactional public void assertThatUserCanBeFoundByLogin() { UserDetails userDetails = domainUserDetailsService.loadUserByUsername(USER_ONE_LOGIN); assertThat(userDetails).isNotNull(); assertThat(userDetails.getUsername()).isEqualTo(USER_ONE_LOGIN); } @Test @Transactional public void assertThatUserCanBeFoundByLoginIgnoreCase() { UserDetails userDetails = domainUserDetailsService.loadUserByUsername(USER_ONE_LOGIN.toUpperCase(Locale.ENGLISH)); assertThat(userDetails).isNotNull(); assertThat(userDetails.getUsername()).isEqualTo(USER_ONE_LOGIN); } @Test @Transactional public void assertThatUserCanBeFoundByEmail() { UserDetails userDetails = domainUserDetailsService.loadUserByUsername(USER_TWO_EMAIL); assertThat(userDetails).isNotNull(); assertThat(userDetails.getUsername()).isEqualTo(USER_TWO_LOGIN); } @Test @Transactional public void assertThatUserCanBeFoundByEmailIgnoreCase() { UserDetails userDetails = domainUserDetailsService.loadUserByUsername(USER_TWO_EMAIL.toUpperCase(Locale.ENGLISH)); assertThat(userDetails).isNotNull(); assertThat(userDetails.getUsername()).isEqualTo(USER_TWO_LOGIN); } @Test @Transactional public void assertThatEmailIsPrioritizedOverLogin() { UserDetails userDetails = domainUserDetailsService.loadUserByUsername(USER_ONE_EMAIL.toUpperCase(Locale.ENGLISH)); assertThat(userDetails).isNotNull(); assertThat(userDetails.getUsername()).isEqualTo(USER_ONE_LOGIN); } @Test(expected = UserNotActivatedException.class) @Transactional public void assertThatUserNotActivatedExceptionIsThrownForNotActivatedUsers() { domainUserDetailsService.loadUserByUsername(USER_THREE_LOGIN); } }
[ "jhipster-bot@users.noreply.github.com" ]
jhipster-bot@users.noreply.github.com
fed1c3c2f3cb6aa06b30cfed4fe1efe2a67985ce
f168302ab6abe7dc754d50389cb359c15116dd60
/src/main/java/com/elmakers/mine/bukkit/ChunkManager.java
496312e37e75667675372d04b5bb0f449ad57c93
[ "MIT" ]
permissive
elBukkit/NoFlatlands
70a93c7af0bad669763ebf0cd122fe6af9c7b736
18148dc187c79ae8ee0b6099feb6e99c77c457e3
refs/heads/master
2016-08-06T10:35:34.218834
2014-09-08T18:14:57
2014-09-08T18:14:57
null
0
0
null
null
null
null
UTF-8
Java
false
false
2,754
java
package com.elmakers.mine.bukkit; import org.apache.commons.lang.StringUtils; import org.bukkit.*; import org.bukkit.event.EventHandler; import org.bukkit.event.Listener; import org.bukkit.event.world.ChunkLoadEvent; import org.bukkit.plugin.Plugin; import java.util.*; public class ChunkManager implements Listener { private int chunkListLength = 2048; private int chunkRegenDelayMin = 10; private int chunkRegenDelayMax = 20; private int chunkMaxSearchHeight = 70; private int chunkMinSearchHeight = 5; private int chunkMinX = 8; private int chunkMaxX = 8; private int chunkMinZ = 8; private int chunkMaxZ = 8; private final Random random = new Random(); private final WorldGuardManager manager; private final Plugin plugin; private final Set<String> worlds = new HashSet<String>(); private final TreeSet<String> checked = new TreeSet<String>(); public ChunkManager(Plugin plugin) { this.plugin = plugin; this.manager = new WorldGuardManager(); manager.initialize(plugin); } public void setWorlds(Collection<String> worldNames) { worlds.clear(); if (worldNames != null) { worlds.addAll(worldNames); } if (worlds.size() > 0) { plugin.getLogger().info("Regenerating flatland chunks in: " + StringUtils.join(worlds, ", ")); } } @EventHandler public void onChunkLoad(ChunkLoadEvent e) { if (!worlds.contains(e.getWorld().getName())) return; final Chunk chunk = e.getChunk(); String chunkKey = chunk.getX() + "," + chunk.getZ(); if (checked.contains(chunkKey)) return; checked.add(chunkKey); if (checked.size() > chunkListLength) { String oldestKey = checked.pollFirst(); if (oldestKey != null) { checked.remove(oldestKey); } } final World world = chunk.getWorld(); Location location = chunk.getBlock(8, 64, 8).getLocation(); if (!manager.isPassthrough(location)) return; for (int y = chunkMinSearchHeight; y <= chunkMaxSearchHeight; y++) { for (int x = chunkMinX; x <= chunkMaxX; x++) { for (int z = chunkMinZ; z <= chunkMaxZ; z++) { if (chunk.getBlock(x, y, z).getType() != Material.AIR) return; } } } int chunkRegenDelay = chunkRegenDelayMin + random.nextInt(chunkRegenDelayMin + chunkRegenDelayMax); Bukkit.getScheduler().runTaskLater(plugin, new Runnable() { @Override public void run() { world.regenerateChunk(chunk.getX(), chunk.getZ()); } }, chunkRegenDelay); } }
[ "nathan@elmakers.com" ]
nathan@elmakers.com
ab5ed7e85e60ef56c1fcc3ff4a45e8a30ced429c
a04ff5184efcadc615046a3ceb219627441e1efc
/src/TestNullLists.java
d43cfc9e18db8d915eb929d70a74a5f22da81a6e
[]
no_license
bdwidhalm/GoogleCodeJamPractice
eb6e568ebc82d12f49c373c14683181ab138a255
8bd5eba928d8d7e1143997a924ae33286aafed10
refs/heads/master
2016-08-04T11:00:25.805200
2015-04-27T03:38:40
2015-04-27T03:38:40
20,857,191
0
0
null
null
null
null
UTF-8
Java
false
false
847
java
import java.util.ArrayList; import java.util.List; public class TestNullLists { /** * @param args */ public static void main(String[] args) { List<Integer> test = new ArrayList<Integer>(); if (test != null) { System.out.println("test == null"); } else { System.out.println("test == null"); } } private static List<Integer> getCacheCopy() { List<Integer> dataFileHistory = getList(); if (dataFileHistory == null) { System.out.println("dataFileHistory == null"); } if (dataFileHistory != null) { System.out.println("dataFileHistory != null"); } if (dataFileHistory.size() > 0) { System.out.println("dataFileHistory.size() > 0"); } return null; } private static List<Integer> getList() { return null; } }
[ "bdwidhalm@gmail.com" ]
bdwidhalm@gmail.com
8c3a0edc3303b17da52fccae6cac04b5ac8226b6
45b95e498bcd3afff8fbe4b0c3045633e1ed7b22
/week6-106.BinarySearch/src/BinarySearch.java
81fee7bf5d711a48ebc7a23d61cd7518fedc20f0
[]
no_license
inql/oop-java-part1
a2b4382ca971ba00beeb82ed694bf3f32b6c05b6
7875a7ecd5e4c1939d4bdfbe1707176eb3fb3872
refs/heads/master
2021-06-24T20:12:34.341699
2017-08-17T21:52:31
2017-08-17T21:52:31
100,609,685
0
0
null
null
null
null
UTF-8
Java
false
false
630
java
public class BinarySearch { public static boolean search(int[] array, int searchedValue) { int beginning = 0; int end = array.length - 1; while (beginning <= end) { int middle = (beginning + end) / 2; if (array[middle] == searchedValue) { return true; } if(array[middle]>searchedValue) { end = middle-1; } if(array[middle]<searchedValue) { beginning = middle+1; } // restrict the search area } return false; } }
[ "noreply@github.com" ]
inql.noreply@github.com
683a4f440e74eaa3929b52706f59eee8eae3e9d4
b198986f477495d4acaa6ccf8030d2e8c715656d
/social-govern/social-govern-reviewer/src/main/java/com/zeryts/c2c/social/govern/reviewer/config/db/MybatisPlusConfig.java
3fa43b7e63c3d880c59d820496eb8e4fd25141b1
[]
no_license
hezitao1122/social
44240b3243bcfa8be125f53cbdf1fded1fff5118
9677379882cd29dea7a9a96879bd6e9af510be0a
refs/heads/master
2023-05-09T00:20:45.839184
2021-05-29T00:35:56
2021-05-29T00:35:56
311,096,263
1
1
null
2021-11-11T09:13:29
2020-11-08T15:44:00
Java
UTF-8
Java
false
false
1,122
java
package com.zeryts.c2c.social.govern.reviewer.config.db; import com.baomidou.mybatisplus.core.parser.ISqlParser; import com.baomidou.mybatisplus.extension.parsers.BlockAttackSqlParser; import com.baomidou.mybatisplus.extension.plugins.PaginationInterceptor; import org.mybatis.spring.annotation.MapperScan; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; import java.util.ArrayList; import java.util.List; @Configuration @MapperScan("com.zeryts.c2c.social.govern.reviewer.mapper*") public class MybatisPlusConfig { /** * mybatis-plus分页插件<br> * 文档:http://mp.baomidou.com<br> */ @Bean public PaginationInterceptor paginationInterceptor() { PaginationInterceptor paginationInterceptor = new PaginationInterceptor(); List<ISqlParser> sqlParserList = new ArrayList<ISqlParser>(); // 攻击 SQL 阻断解析器、加入解析链 sqlParserList.add(new BlockAttackSqlParser()); paginationInterceptor.setSqlParserList(sqlParserList); return paginationInterceptor; } }
[ "330984177@qq.com" ]
330984177@qq.com
3d8222eda437ce42f4d7e2c8c0c6e0060ed54377
073d8282ba3a1227404998bb92b1f05945f2be6c
/ControleFinanceiro-CLI/tests/br/zero/controlefinanceiro/commandlineparser/ExtratoParsersTests.java
19216f59fa5b11523561e4d19f16247de4bac6c2
[]
no_license
rochafred/ControleFinanceiro
ce669089d7643361359554c39c15609884ff4e38
cf7f85a040c16a9d2d9114a42405390179b8a760
refs/heads/master
2020-09-05T10:13:42.273053
2013-08-26T14:50:07
2013-08-26T14:50:07
null
0
0
null
null
null
null
UTF-8
Java
false
false
2,331
java
package br.zero.controlefinanceiro.commandlineparser; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertNotNull; import static org.junit.Assert.assertTrue; import java.text.SimpleDateFormat; import org.junit.Test; import br.zero.controlefinanceiro.abstractextratoparser.ExtratoLancamentoBalance; import br.zero.controlefinanceiro.abstractextratoparser.ExtratoLancamentoTransaction; import br.zero.controlefinanceiro.abstractextratoparser.ExtratoLancamentoUnknown; import br.zero.controlefinanceiro.abstractextratoparser.ExtratoLineParser; import br.zero.controlefinanceiro.abstractextratoparser.ExtratoParsers; import br.zero.controlefinanceiro.abstractextratoparser.ParsedExtratoLancamento; import br.zero.controlefinanceiro.utils.ExtratoLineParserException; public class ExtratoParsersTests { private ExtratoLineParser parser; private ExtratoLineParser getItauParser() { return ExtratoParsers.ITAU_EXTRATO_PARSER; } @Test public void doItauExtratoTransactionLineParserTest() throws ExtratoLineParserException { parser = getItauParser(); ParsedExtratoLancamento el = parser.parse("01/09 IOF 1,85- 352,31- "); assertNotNull("linha do extrato não-nula", el); assertTrue("interface implementada", el instanceof ExtratoLancamentoTransaction); ExtratoLancamentoTransaction line = (ExtratoLancamentoTransaction) el; SimpleDateFormat sdf = new SimpleDateFormat("dd/MMM/yyyy"); assertEquals("data", "01/Sep/2011", sdf.format(line.getData().getTime())); assertEquals("referência", "IOF", line.getReferencia()); assertEquals("valor", -1.85, line.getValor(), 0.0); } @Test public void doItauExtratoBalanceLineParserTest() throws ExtratoLineParserException { parser = getItauParser(); ParsedExtratoLancamento el = parser.parse("01/09 SALDO INICIAL 350,46- "); assertNotNull("linha do extrato não-nula", el); assertTrue("interface implementada", el instanceof ExtratoLancamentoBalance); } @Test public void doItauExtratoUnknownLineParserTest() throws ExtratoLineParserException { parser = getItauParser(); ParsedExtratoLancamento el = parser.parse("29/09 APL APLIC AUT MAIS 107,94- 150,00 "); assertNotNull("linha do extrato não-nula", el); assertTrue("interface implementada", el instanceof ExtratoLancamentoUnknown); } }
[ "rmonico1@gmail.com" ]
rmonico1@gmail.com
cf66117fe51ac3a82cdd86544acadee89e147267
36700407a65205b568e8f7b618699da46dd925d4
/ml-mnc/mnc-http/src/main/java/com/ml/mnc/admin/rpc/HttpMsgQueueRpcService.java
c10ec5483c0ca3ddb653c3f491300835984acd8d
[]
no_license
mecarlen/ml
304157a09ab134f4f9301e1640e3b4679f3f040e
08f21a79d4fbd3358e09b201e2756acf0f40ff81
refs/heads/master
2022-09-18T04:59:46.199524
2020-03-02T11:34:55
2020-03-02T11:34:55
244,356,713
0
0
null
null
null
null
UTF-8
Java
false
false
617
java
package com.ml.mnc.admin.rpc; import com.ml.base.controller.WebResponse; /** * <pre> * http消息队列 * * </pre> * * @author mecarlen.Wang 2019年11月5日 上午10:10:29 */ public interface HttpMsgQueueRpcService { /** * <pre> * 扩展已有队列消费者 * * 描述 * 1、仅支持已有队列 * 2、仅支持手动签收 * </pre> * * @param queueName String * @param concurrentConsumers int * @param prefetchCount int * @return WebResponse<Boolean> */ WebResponse<Boolean> extendConsumer(String queueName, int concurrentConsumers, int prefetchCount); }
[ "mecarlen@gmail.com" ]
mecarlen@gmail.com
cfc0f51a529d76c9029142f06998f720ab5dd971
547fc29a24dbc588c9c75198435faeec6ee4ed2e
/src/main/java/br/com/totvsplanning/planning/model/Usuario.java
19d17e98223c800c9d97281102ef34af6dcce1bd
[]
no_license
rafaeloel/planning
1e2851b747f98bfa2632b4adc98ab6f1590dd3e2
0220d3bd649200d2f365b67b01f7a9e379562b7e
refs/heads/main
2023-01-23T00:47:21.158449
2020-11-23T13:37:35
2020-11-23T13:37:35
314,649,002
0
0
null
null
null
null
UTF-8
Java
false
false
1,035
java
package br.com.totvsplanning.planning.model; import javax.persistence.Entity; import javax.persistence.Id; @Entity public class Usuario { @Id private Long email; private String nome; private Integer tipo; public Usuario() { } public Usuario(Long email, String nome, Integer tipo) { this.email = email; this.nome = nome; this.tipo = tipo; } @Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (getClass() != obj.getClass()) return false; Usuario other = (Usuario) obj; if (email == null) { if (other.email != null) return false; } else if (!email.equals(other.email)) return false; return true; } public Long getEmail() { return email; } public void setEmail(Long email) { this.email = email; } public String getNome() { return nome; } public void setNome(String nome) { this.nome = nome; } public Integer getTipo() { return tipo; } public void setTipo(Integer tipo) { this.tipo = tipo; } }
[ "rafaelsampaiobas@gmail.com" ]
rafaelsampaiobas@gmail.com
f076034d948b46930c183ae48b7b26a499f5cdd0
84f13ae2960bea020ad84520183a64ead788cb83
/jdbi-full-search/src/main/java/com/web/jdbi/mapper/BigDataMapper.java
a8379ab76823b977bf815c93791c6108449d389e
[]
no_license
armdev/jdbi-mysql-full-search
0c3403dc3645db7bf174f965df1d73be1ddeceae
07142b152e11ca905b82b6bed81dbf45d9b7685b
refs/heads/master
2021-01-10T13:55:47.597153
2016-04-09T18:42:10
2016-04-09T18:42:10
55,407,164
0
0
null
null
null
null
UTF-8
Java
false
false
546
java
package com.web.jdbi.mapper; import com.web.jdbi.dto.BigData; import java.sql.ResultSet; import java.sql.SQLException; import org.skife.jdbi.v2.StatementContext; import org.skife.jdbi.v2.tweak.ResultSetMapper; public class BigDataMapper implements ResultSetMapper<BigData> { @Override public BigData map(int index, ResultSet r, StatementContext ctx) throws SQLException { return new BigData( r.getInt("id"), r.getString("title"), r.getString("content"), r.getString("url")); } }
[ "IEUser@IE11Win7" ]
IEUser@IE11Win7
6d0311e5c1cad6029e7dbd901384b896a9baf9f6
053df0bddea4eaff25f4fdde057e77465e528ab9
/MavenPI2.0/src/prg/business/group/Businessgrps.java
be843ad20c324c1e9b64788b034a7b567f34a41d
[]
no_license
manojprogen/MavenPI2.0
dd70acae9f809d6cf0d61749a226d8a195bf279b
bf49043919244dc976cc8d4f425372a43e8dc4cc
refs/heads/master
2021-01-20T19:26:41.282779
2016-06-25T16:44:49
2016-06-25T16:44:49
61,947,223
0
0
null
null
null
null
UTF-8
Java
false
false
3,934
java
package prg.business.group; import java.util.ArrayList; import org.apache.log4j.Logger; /** * * @author Bharathi reddy this class is for setter and gettter methos used in * displaying businessgrps list */ public class Businessgrps { private String businessGrpName; private String businessGrpId; private ArrayList factsList; private ArrayList allTablesList; private ArrayList bucketsList; private ArrayList dimensionList; private ArrayList roleList; public static Logger logger = Logger.getLogger(Businessgrps.class); //added by susheela on 05-oct-09 start private ArrayList targetFactsList; //TargetFactsList //added by susheela on 28-12-09 start private ArrayList grpTargetMeasuresList; private String grpTimeFlag; /** * @return the businessGrpName */ public String getBusinessGrpName() { return businessGrpName; } /** * @param businessGrpName the businessGrpName to set */ public void setBusinessGrpName(String businessGrpName) { this.businessGrpName = businessGrpName; } /** * @return the businessGrpId */ public String getBusinessGrpId() { return businessGrpId; } /** * @param businessGrpId the businessGrpId to set */ public void setBusinessGrpId(String businessGrpId) { this.businessGrpId = businessGrpId; } /** * @return the factsList */ public ArrayList getFactsList() { return factsList; } /** * @param factsList the factsList to set */ public void setFactsList(ArrayList factsList) { this.factsList = factsList; } /** * @return the allTablesList */ public ArrayList getAllTablesList() { return allTablesList; } /** * @param allTablesList the allTablesList to set */ public void setAllTablesList(ArrayList allTablesList) { this.allTablesList = allTablesList; } /** * @return the bucketsList */ public ArrayList getBucketsList() { return bucketsList; } /** * @param bucketsList the bucketsList to set */ public void setBucketsList(ArrayList bucketsList) { this.bucketsList = bucketsList; } /** * @return the dimensionList */ public ArrayList getDimensionList() { return dimensionList; } /** * @param dimensionList the dimensionList to set */ public void setDimensionList(ArrayList dimensionList) { this.dimensionList = dimensionList; } /** * @return the roleList */ public ArrayList getRoleList() { return roleList; } /** * @param roleList the roleList to set */ public void setRoleList(ArrayList roleList) { this.roleList = roleList; } public ArrayList getTargetFactsList() { return targetFactsList; } /** * @param targetFactsList the targetFactsList to set */ public void setTargetFactsList(ArrayList targetFactsList) { this.targetFactsList = targetFactsList; } /** * @return the grpTimeFlag */ public String getGrpTimeFlag() { return grpTimeFlag; } /** * @param grpTimeFlag the grpTimeFlag to set */ public void setGrpTimeFlag(String grpTimeFlag) { this.grpTimeFlag = grpTimeFlag; } /** * @return the grpTargetMeasuresList */ public ArrayList getGrpTargetMeasuresList() { return grpTargetMeasuresList; } /** * @param grpTargetMeasuresList the grpTargetMeasuresList to set */ public void setGrpTargetMeasuresList(ArrayList grpTargetMeasuresList) { this.grpTargetMeasuresList = grpTargetMeasuresList; } }
[ "manoj.singh@progenbusiness.com" ]
manoj.singh@progenbusiness.com
1313924bdbb6ab0e8c4cffe544a0178e669f35ac
08029f12f5ec9336c763b82affb0616d9a89efc8
/src/main/java/name/pehl/karaka/client/application/NavigationView.java
2df4d5f92036f580051df20974625661e937ca01
[]
no_license
hpehl/karaka
dd7b47b9fd206b611fc40876f8f2e73bca23ed60
76686f40ecb693e9d85ee33986f4e1668fbf9bca
refs/heads/master
2020-05-18T09:58:18.426332
2013-04-09T09:01:18
2013-04-09T09:01:18
6,405,796
1
0
null
null
null
null
UTF-8
Java
false
false
3,795
java
package name.pehl.karaka.client.application; import com.google.common.collect.ImmutableMap; import com.google.gwt.dom.client.AnchorElement; import com.google.gwt.dom.client.SpanElement; import com.google.gwt.uibinder.client.UiBinder; import com.google.gwt.uibinder.client.UiField; import com.google.gwt.user.client.ui.HasOneWidget; import com.google.gwt.user.client.ui.Hyperlink; import com.google.gwt.user.client.ui.InlineHyperlink; import com.google.gwt.user.client.ui.Widget; import com.google.inject.Inject; import com.gwtplatform.mvp.client.ViewImpl; import name.pehl.karaka.client.NameTokens; import name.pehl.karaka.client.resources.Resources; import name.pehl.karaka.client.ui.UiUtils; import name.pehl.karaka.shared.model.User; import java.util.Map; /** * @author $Author: harald.pehl $ * @version $Date: 2010-12-16 10:41:46 +0100 (Do, 16. Dez 2010) $ $Revision: 175 * $ */ public class NavigationView extends ViewImpl implements NavigationPresenter.MyView { public interface Binder extends UiBinder<Widget, NavigationView> { } private final Widget widget; private final Resources resources; private final Map<String, Hyperlink> navigationLinks; @UiField InlineHyperlink dashboard; @UiField InlineHyperlink projects; @UiField InlineHyperlink clients; @UiField InlineHyperlink tags; @UiField InlineHyperlink reports; @UiField InlineHyperlink help; @UiField InlineHyperlink settings; @UiField AnchorElement logout; @UiField SpanElement username; @UiField HasOneWidget messagePanel; @Inject public NavigationView(final Binder binder, final Resources resources) { this.resources = resources; this.resources.navigation().ensureInjected(); this.widget = binder.createAndBindUi(this); this.navigationLinks = new ImmutableMap.Builder<String, Hyperlink>().put(NameTokens.dashboard, dashboard) .put(NameTokens.projects, projects).put(NameTokens.clients, clients).put(NameTokens.tags, tags) .put(NameTokens.reports, reports).put(NameTokens.help, help).put(NameTokens.settings, settings).build(); } @Override public Widget asWidget() { return widget; } @Override public void setInSlot(Object slot, Widget content) { if (slot == NavigationPresenter.SLOT_Message) { UiUtils.setContent(messagePanel, content); } else { super.setInSlot(slot, content); } } @Override public void highlight(String token) { if (token != null) { for (Map.Entry<String, Hyperlink> entry : navigationLinks.entrySet()) { String currentToken = entry.getKey(); Hyperlink currentLink = entry.getValue(); if (token.equals(currentToken)) { currentLink.addStyleName(resources.navigation().selectedNavigationEntry()); } else { currentLink.removeStyleName(resources.navigation().selectedNavigationEntry()); } } } } @Override public void setDashboardToken(String token) { if (token != null) { dashboard.setTargetHistoryToken(token); } } @Override public void updateUser(User user) { if (user != null) { if (user.getLogoutUrl() != null) { logout.setHref(user.getLogoutUrl()); } username.setInnerText(user.getUsername()); } } }
[ "harald.pehl@gmail.com" ]
harald.pehl@gmail.com
e794ce9619a7e19191600bbfb0a5d34f0ea61d43
a8a65952abfd678a75231656fab0e5d755bf0227
/001_express/CodeManage/express-master/src/main/java/com/example/express/controller/api/SettingApiController.java
9480ba4d81c50520f2e12cb48bd21370bc837868
[]
no_license
heiheihuang/super_natural
faa878265daa93fdea54389a9b4ded45b028f8c1
37dbc72001e0f8ec65fe52c6daf2a0aa6af9a0b0
refs/heads/master
2021-06-20T00:04:02.000506
2020-01-18T16:13:12
2020-01-18T16:13:12
220,420,226
2
0
null
2021-06-04T02:24:44
2019-11-08T08:21:19
TSQL
UTF-8
Java
false
false
4,739
java
package com.example.express.controller.api; import com.example.express.common.constant.RedisKeyConstant; import com.example.express.common.util.StringUtils; import com.example.express.domain.ResponseResult; import com.example.express.domain.bean.SysUser; import com.example.express.domain.enums.ResponseErrorCodeEnum; import com.example.express.service.SysUserService; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.data.redis.core.RedisTemplate; import org.springframework.security.core.annotation.AuthenticationPrincipal; import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RestController; import javax.servlet.http.HttpSession; /** * API 设置信息 * @author xiangsheng.wu * @date 2019年04月22日 14:35 */ @RestController @RequestMapping("/api/v1/setting") public class SettingApiController { @Autowired private SysUserService sysUserService; @Autowired private RedisTemplate redisTemplate; /** * 校验密码 */ @PostMapping("/check-password") public ResponseResult checkPassword(String password, @AuthenticationPrincipal SysUser sysUser) { if(StringUtils.isBlank(password)) { return ResponseResult.failure(ResponseErrorCodeEnum.PARAMETER_ERROR); } boolean isMatch = sysUserService.checkPassword(sysUser.getId(), password); return isMatch ? ResponseResult.success() : ResponseResult.failure(ResponseErrorCodeEnum.PASSWORD_ERROR); } /** * 修改密码 */ @PostMapping("/password") public ResponseResult resetPassword(String origin, String target, @AuthenticationPrincipal SysUser sysUser) { if(StringUtils.isAnyBlank(origin, target)) { return ResponseResult.failure(ResponseErrorCodeEnum.PARAMETER_ERROR); } return sysUserService.resetPassword(sysUser.getId(), origin, target); } /** * 初始设置用户名、密码 */ @PostMapping("/username") public ResponseResult setUsernameAndPassword(String username, String password, @AuthenticationPrincipal SysUser sysUser) { if(StringUtils.isAnyBlank(username, password)) { return ResponseResult.failure(ResponseErrorCodeEnum.PARAMETER_ERROR); } return sysUserService.setUsernameAndPassword(sysUser, username, password); } /** * 初始设置实名信息 */ @PostMapping("/real-name") public ResponseResult setRealName(String realName, String idCard, @AuthenticationPrincipal SysUser sysUser) { if(StringUtils.isAnyBlank(realName, idCard)) { return ResponseResult.failure(ResponseErrorCodeEnum.PARAMETER_ERROR); } return sysUserService.setRealName(sysUser, realName, idCard); } /** * 设置/修改手机号 */ @PostMapping("/tel") public ResponseResult setTel(String tel, String code, HttpSession session, @AuthenticationPrincipal SysUser sysUser) { if(StringUtils.isAnyBlank(tel, code)) { return ResponseResult.failure(ResponseErrorCodeEnum.PARAMETER_ERROR); } return sysUserService.setTel(sysUser, tel, code, session); } /** * 设置修改高校信息 */ @PostMapping("/school") public ResponseResult setSchool(Integer school, String studentIdCard, @AuthenticationPrincipal SysUser sysUser) { if(StringUtils.isBlank(studentIdCard) || school == null) { return ResponseResult.failure(ResponseErrorCodeEnum.PARAMETER_ERROR); } return sysUserService.setSchoolInfo(sysUser, school, studentIdCard); } /** * 设置或更新人脸数据 */ @SuppressWarnings("unchecked") @PostMapping("/face") public ResponseResult setOrUpdateFace(@AuthenticationPrincipal SysUser sysUser) { try { String faceToken = (String)redisTemplate.opsForHash().get(RedisKeyConstant.LAST_FACE_TOKEN, sysUser.getId()); System.out.println(faceToken); return sysUserService.bindOrUpdateFace(faceToken, sysUser.getId()); } catch (Exception e) { return ResponseResult.failure(ResponseErrorCodeEnum.REDIS_ERROR); } } /** * 申请角色 * 仅支持 user <-> courier */ @PostMapping("/apply-role") public ResponseResult changeRole(String password, @AuthenticationPrincipal SysUser sysUser) { if(!sysUserService.checkPassword(sysUser.getId(), password)) { return ResponseResult.failure(ResponseErrorCodeEnum.PASSWORD_ERROR); } return sysUserService.changeRole(sysUser.getId()); } }
[ "1245026448@qq.com" ]
1245026448@qq.com
8780adcd9f0a02016ede261b006df1a9427110f6
fa91450deb625cda070e82d5c31770be5ca1dec6
/Diff-Raw-Data/4/4_84d78c277ce66e370d992fd9b4717f36fe0c82b8/MessageSink/4_84d78c277ce66e370d992fd9b4717f36fe0c82b8_MessageSink_s.java
4c93036adcff1636854909d56343f5d2bf8e6b90
[]
no_license
zhongxingyu/Seer
48e7e5197624d7afa94d23f849f8ea2075bcaec0
c11a3109fdfca9be337e509ecb2c085b60076213
refs/heads/master
2023-07-06T12:48:55.516692
2023-06-22T07:55:56
2023-06-22T07:55:56
259,613,157
6
2
null
2023-06-22T07:55:57
2020-04-28T11:07:49
null
UTF-8
Java
false
false
5,490
java
/* * Copyright (c) 2012 European Synchrotron Radiation Facility, * Diamond Light Source Ltd. * * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html */ package org.dawb.passerelle.actors.ui; import java.util.Arrays; import java.util.HashMap; import java.util.List; import java.util.Map; import javax.management.InstanceNotFoundException; import javax.management.MBeanServerConnection; import org.dawb.passerelle.common.actors.AbstractDataMessageSink; import org.dawb.passerelle.common.actors.ActorUtils; import org.dawb.passerelle.common.message.DataMessageComponent; import org.dawb.passerelle.common.message.IVariable; import org.dawb.passerelle.common.message.MessageUtils; import org.dawb.passerelle.common.parameter.ParameterUtils; import org.dawb.workbench.jmx.RemoteWorkbenchAgent; import org.eclipse.jface.dialogs.MessageDialog; import org.eclipse.swt.SWT; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import ptolemy.data.expr.Parameter; import ptolemy.data.expr.StringParameter; import ptolemy.kernel.CompositeEntity; import ptolemy.kernel.util.IllegalActionException; import ptolemy.kernel.util.NameDuplicationException; import ptolemy.kernel.util.Settable; import com.isencia.passerelle.actor.ProcessingException; import com.isencia.passerelle.core.PasserelleToken; import com.isencia.passerelle.core.Port; import com.isencia.passerelle.core.PortFactory; import com.isencia.passerelle.util.ptolemy.IAvailableChoices; import com.isencia.passerelle.util.ptolemy.StringChoiceParameter; /** * Attempts to plot data in eclipse or writes a csv file with the data if * that is not possible. * * @author gerring * */ public class MessageSink extends AbstractDataMessageSink { /** * */ private static final long serialVersionUID = 7807261809740835047L; private static final Logger logger = LoggerFactory.getLogger(MessageSink.class); private Parameter messageType,messageParam, messageTitle; private final Map<String, String> visibleChoices = new HashMap<String, String>(3); /** * NOTE Ports must be public for composites to work. */ public Port shownMessagePort; public MessageSink(CompositeEntity container, String name) throws NameDuplicationException, IllegalActionException { super(container, name); visibleChoices.put(MessageDialog.ERROR+"", "ERROR"); visibleChoices.put(MessageDialog.WARNING+"", "WARNING"); visibleChoices.put(MessageDialog.INFORMATION+"", "INFORMATION"); messageType = new StringChoiceParameter(this, "Message Type", new IAvailableChoices() { @Override public Map<String, String> getVisibleChoices() { return visibleChoices; } @Override public String[] getChoices() { return visibleChoices.keySet().toArray(new String[0]); } }, SWT.SINGLE); messageType.setExpression(MessageDialog.INFORMATION+""); registerConfigurableParameter(messageType); messageParam = new StringParameter(this, "Message"); messageParam.setExpression("${message_text}"); registerConfigurableParameter(messageParam); messageTitle = new StringParameter(this, "Message Title"); messageTitle.setExpression("Error Message"); registerConfigurableParameter(messageTitle); memoryManagementParam.setVisibility(Settable.NONE); passModeParameter.setExpression(EXPRESSION_MODE.get(1)); passModeParameter.setVisibility(Settable.NONE); shownMessagePort = PortFactory.getInstance().createOutputPort(this, "shownMessage"); } @Override protected void sendCachedData(final List<DataMessageComponent> cache) throws ProcessingException { try { if (cache==null) return; if (cache.isEmpty()) return; final DataMessageComponent despatch = MessageUtils.mergeAll(cache); if (despatch.getScalar()==null || despatch.getScalar().isEmpty()) return; final String title = ParameterUtils.getSubstituedValue(messageTitle, cache); final String message = ParameterUtils.getSubstituedValue(messageParam, cache); final int type = Integer.parseInt(messageType.getExpression()); try { logInfo(visibleChoices.get(type+"") + " message: '" + message + "'"); if (MessageUtils.isErrorMessage(cache)) getManager().stop(); final MBeanServerConnection client = ActorUtils.getWorkbenchConnection(); if (client!=null) { final Object ob = client.invoke(RemoteWorkbenchAgent.REMOTE_WORKBENCH, "showMessage", new Object[]{title,message,type}, new String[]{String.class.getName(),String.class.getName(),int.class.getName()}); if (ob==null || !((Boolean)ob).booleanValue()) { throw createDataMessageException("Show message '"+getName()+"'!", new Exception()); } } } catch (InstanceNotFoundException noService) { logger.error(title+"> "+message); } if (shownMessagePort.getWidth()>0) { shownMessagePort.broadcast(new PasserelleToken(MessageUtils.getDataMessage(despatch))); } } catch (Exception e) { throw createDataMessageException("Cannot show error message '"+getName()+"'", e); } } public List<IVariable> getOutputVariables() { return getInputVariables(); } }
[ "yuzhongxing88@gmail.com" ]
yuzhongxing88@gmail.com
f5dae597c2d7d6f478be06f7d4bf709d683f9c04
56753ccd9e6fb8008a224f6a843b00e241a30761
/src/edu/northwestern/at/utils/corpuslinguistics/postagger/smoothing/contextual/ContextualSmoother.java
a8e830c162e6a6e29a27ecb8a53e8c85ab41f3c7
[]
no_license
fcr/morphadorner-opensource
9ac772abb0baa0dd006c4fe2d43a3ccbb7d956dd
4b5fcccb2bf0de1731198dfff98adc08ac89a6dc
refs/heads/master
2020-05-24T14:35:48.953292
2011-08-24T02:28:46
2011-08-24T02:28:46
2,213,285
3
3
null
null
null
null
UTF-8
Java
false
false
3,808
java
package edu.northwestern.at.utils.corpuslinguistics.postagger.smoothing.contextual; /* Please see the license information at the end of this file. */ import java.util.*; import edu.northwestern.at.utils.corpuslinguistics.lexicon.*; import edu.northwestern.at.utils.corpuslinguistics.postagger.*; import edu.northwestern.at.utils.math.*; /** Interface for a contextual smoother. * * <p> * A contextual smoother computes the contextually smoothed probabability of * a word given a part of speech tag, e.g., p( word | tag ). * </p> */ public interface ContextualSmoother { /** Set the part of speech tagger for this smoother. * * @param posTagger Part of speech tagger for which * this smoother provides probabilities. */ public void setPartOfSpeechTagger( PartOfSpeechTagger posTagger ); /** Get the number of cached contextual probabilities. * * @return The number of cached contextual probabilities. */ public int cachedProbabilitiesCount(); /** Clear cached probabilities.. */ public void clearCachedProbabilities(); /** Compute smoothed contextual probability of a tag given the previous tag. * * @param tag The current tag. * @param previousTag The previous tag. * * @return The probability of the current tag given * the previous tag, e.g, * p( tag | previousTag ). */ public Probability contextualProbability ( String tag , String previousTag ); /** Compute smoothed contextual probability of a tag given the previous tags. * * @param tag The current tag. * @param previousTag The previous tag. * @param previousPreviousTag The previous tag of the previous tag. * * @return The probability of the current tag * given the previous two tags, e.g, * p( tag | prevTag , prevPrevTag ). */ public Probability contextualProbability ( String tag , String previousTag , String previousPreviousTag ); } /* Copyright (c) 2008, 2009 by Northwestern University. All rights reserved. Developed by: Academic and Research Technologies Northwestern University http://www.it.northwestern.edu/about/departments/at/ Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal with the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimers. * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimers in the documentation and/or other materials provided with the distribution. * Neither the names of Academic and Research Technologies, Northwestern University, nor the names of its contributors may be used to endorse or promote products derived from this Software without specific prior written permission. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE CONTRIBUTORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS WITH THE SOFTWARE. */
[ "rotbart@softbart.com" ]
rotbart@softbart.com
19d1d47618f83ecbb636f222ea8ad7acc2838f94
2e05fc91c1a7057e3afe1f8cce186305532dcda3
/app/src/test/java/com/example/pratical42homework/ExampleUnitTest.java
ff3744f8ba054a1fe5fdbe2d2ae2eadd7a86c1fb
[]
no_license
ScarlettChin/Pratical4.2Homework
c387652278a83a77e96bf04a612d700d6d66e66d
d27ca9cef018708d62d8118c6ddc36392869bdf9
refs/heads/master
2022-11-20T05:16:20.192824
2020-07-09T15:51:23
2020-07-09T15:51:23
278,407,703
0
0
null
null
null
null
UTF-8
Java
false
false
391
java
package com.example.pratical42homework; import org.junit.Test; import static org.junit.Assert.*; /** * Example local unit test, which will execute on the development machine (host). * * @see <a href="http://d.android.com/tools/testing">Testing documentation</a> */ public class ExampleUnitTest { @Test public void addition_isCorrect() { assertEquals(4, 2 + 2); } }
[ "chinhe-wm19@student.tarc.edu.my" ]
chinhe-wm19@student.tarc.edu.my
95bbc06acfdcdafa9117cc84f751d04a7391836d
e9842197f3e00908e22b6a0acffb071b277e508e
/RESTServices/src/main/java/org/employee360/bo/BillTypeList.java
8a1173b690dcb24546e5b9e9242693820a122eb0
[]
no_license
lohithkorp/TeamArrayEmployee360
3d948191babe047bd15b1e57f1ce5a6b1ff1da0f
4801e561bd740583b0286610653df6e644763123
refs/heads/master
2021-04-03T10:26:13.743740
2018-03-11T02:53:04
2018-03-11T02:53:04
124,717,121
0
0
null
null
null
null
UTF-8
Java
false
false
293
java
package org.employee360.bo; import java.util.List; public class BillTypeList { private List<BillType> billTypeList; public List<BillType> getBillTypeList() { return billTypeList; } public void setBillTypeList(List<BillType> billTypeList) { this.billTypeList = billTypeList; } }
[ "lohithkrishna.korupolu@colruytgroup.com" ]
lohithkrishna.korupolu@colruytgroup.com
6dbe35210bc2ca622c155d199965c5733c50edee
4cbfe81709af8ac75d063f9d841860f55a4adf31
/JavaMultiThreading/src/com/chandu/multithreading/concurrencyapi/CyclicBarrierEvent.java
306e816f5aa401a43121b3382672701795cde18f
[]
no_license
chandusreddy/MultiThreading-In-Java
2ded4598b8c4fea015c207c30d641481fdd77c1b
2832177fdebef7c6d34464c32372f7187b023405
refs/heads/master
2023-05-25T09:20:00.671149
2023-05-09T00:19:51
2023-05-09T00:19:51
340,159,076
0
0
null
null
null
null
UTF-8
Java
false
false
369
java
package com.chandu.multithreading.concurrencyapi; public class CyclicBarrierEvent implements Runnable { @Override public void run() { System.out.println("As 3 threads have reached common barrier point " + ", CyclicBarrrierEvent has been triggered"); System.out.println("You can update shared variables if any"); } }
[ "70282603+Chandu0005@users.noreply.github.com" ]
70282603+Chandu0005@users.noreply.github.com
d3ba3f063915d471680d1056ef800e8c52c0a3a3
8c085f12963e120be684f8a049175f07d0b8c4e5
/castor/tags/DEV0_8/castor-2002/castor/src/main/org/exolab/castor/persist/Cache.java
2684b50bcf12703eb961be4bdd0fdeed2caeb74e
[]
no_license
alam93mahboob/castor
9963d4110126b8f4ef81d82adfe62bab8c5f5bce
974f853be5680427a195a6b8ae3ce63a65a309b6
refs/heads/master
2020-05-17T08:03:26.321249
2014-01-01T20:48:45
2014-01-01T20:48:45
null
0
0
null
null
null
null
UTF-8
Java
false
false
5,088
java
/** * Redistribution and use of this software and associated documentation * ("Software"), with or without modification, are permitted provided * that the following conditions are met: * * 1. Redistributions of source code must retain copyright * statements and notices. Redistributions must also contain a * copy of this document. * * 2. Redistributions in binary form must reproduce the * above copyright notice, this list of conditions and the * following disclaimer in the documentation and/or other * materials provided with the distribution. * * 3. The name "Exolab" must not be used to endorse or promote * products derived from this Software without prior written * permission of Exoffice Technologies. For written permission, * please contact info@exolab.org. * * 4. Products derived from this Software may not be called "Exolab" * nor may "Exolab" appear in their names without prior written * permission of Exoffice Technologies. Exolab is a registered * trademark of Exoffice Technologies. * * 5. Due credit should be given to the Exolab Project * (http://www.exolab.org/). * * THIS SOFTWARE IS PROVIDED BY EXOFFICE TECHNOLOGIES AND CONTRIBUTORS * ``AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT * NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL * EXOFFICE TECHNOLOGIES OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED * OF THE POSSIBILITY OF SUCH DAMAGE. * * Copyright 1999 (C) Exoffice Technologies Inc. All Rights Reserved. * * $Id$ */ package org.exolab.castor.persist; import java.util.Hashtable; import java.util.Enumeration; import org.exolab.castor.jdo.LockNotGrantedException; /** * A cache for holding objects of a particular type. The cache has a * finite size and can be optimized for a particular class based on * the application behavior. * * @author <a href="arkin@exoffice.com">Assaf Arkin</a> * @version $Revision$ $Date$ */ final class Cache extends Thread { /** * Mapping of object locks to OIDs. The {@link OID} is used as the * key, and {@link ObjectLock} is the value. There is one lock per OID. */ private final Hashtable _locks = new Hashtable(); private long _counter; private static TransactionContext _cacheTx = new CacheTransaction(); private static final long StampInUse = 0; Cache() { } synchronized ObjectLock getLock( OID oid ) { CacheEntry entry; entry = (CacheEntry) _locks.get( oid ); if ( entry == null ) return null; entry.stamp = StampInUse; return entry.lock; } synchronized ObjectLock releaseLock( OID oid ) { CacheEntry entry; entry = (CacheEntry) _locks.get( oid ); if ( entry == null ) return null; entry.stamp = System.currentTimeMillis(); return entry.lock; } synchronized void addLock( OID oid, ObjectLock lock ) { CacheEntry entry; entry = new CacheEntry( oid, lock ); entry.stamp = StampInUse; _locks.put( oid, entry ); } void removeLock( OID oid ) { _locks.remove( oid ); } public void run() { Enumeration enum; CacheEntry entry; OID oid; while ( true ) { enum = _locks.keys(); while ( enum.hasMoreElements() ) { oid = (OID) enum.nextElement(); entry = (CacheEntry) _locks.get( oid ); synchronized ( this ) { if ( entry.stamp != StampInUse ) { try { Object obj; obj = entry.lock.acquire( _cacheTx, true, 0 ); _locks.remove( oid ); entry.lock.release( _cacheTx ); } catch ( LockNotGrantedException except ) { } } } } } } static class CacheEntry { final ObjectLock lock; long stamp; CacheEntry( OID oid, ObjectLock lock ) { this.lock = lock; } } static class CacheTransaction extends TransactionContext { public Object getConnection( PersistenceEngine engine ) { return null; } protected void commitConnections() { } protected void rollbackConnections() { } } }
[ "nobody@b24b0d9a-6811-0410-802a-946fa971d308" ]
nobody@b24b0d9a-6811-0410-802a-946fa971d308
39a33915907d5e31a734271a487abd4ade2d950a
ea95756e8b1e0f0a4c7c27c9ea87d4548dea7042
/common/src/main/java/GreenCode/common/Log4j.java
f6d9b1e2f5f1a548e7350d98aab211c50c48d150
[]
no_license
IvanGreen/SoulFile
ec33b7be395a82e4fb7e89403d83067f8097a355
555802846c0e24d5df4edaf331ec046288d14fb0
refs/heads/FileTrying
2022-10-08T14:14:21.825578
2019-08-01T07:09:00
2019-08-01T07:09:00
196,271,537
0
0
null
null
null
null
UTF-8
Java
false
false
262
java
package GreenCode.common; import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; public class Log4j { public static final Logger log = LogManager.getLogger(Log4j.class); public static void main(String[] args) { } }
[ "mylinkou@bk.ru" ]
mylinkou@bk.ru
813bcef535aa8bd0b7dce19a9bc93fea7d9a7037
75e59bc58c359ea729349d003ae8e0e3a064530f
/Leetcode/1678. Goal Parser Interpretation/Solution.java
daa48f3335ca6e2497029f6d92e6d46f7164373c
[]
no_license
xgmak94/Questions
8bd8c960ff9af1f4e082ed7fc524815e3d0abe0b
831c5e815d5dca193ec9c37474899014154bafec
refs/heads/master
2023-02-16T12:13:12.545853
2023-02-10T05:17:24
2023-02-10T05:17:24
127,492,977
0
0
null
null
null
null
UTF-8
Java
false
false
1,783
java
/* https://leetcode.com/problems/goal-parser-interpretation/ You own a Goal Parser that can interpret a string command. The command consists of an alphabet of "G", "()" and/or "(al)" in some order. The Goal Parser will interpret "G" as the string "G", "()" as the string "o", and "(al)" as the string "al". The interpreted strings are then concatenated in the original order. Given the string command, return the Goal Parser's interpretation of command. Example 1: Input: command = "G()(al)" Output: "Goal" Explanation: The Goal Parser interprets the command as follows: G -> G () -> o (al) -> al The final concatenated result is "Goal". Example 2: Input: command = "G()()()()(al)" Output: "Gooooal" Example 3: Input: command = "(al)G(al)()()G" Output: "alGalooG" Constraints: 1 <= command.length <= 100 command consists of "G", "()", and/or "(al)" in some order. */ class Solution { public String interpret(String command) { command = command.replaceAll("\\(\\)", "o"); command = command.replaceAll("\\(al\\)", "al"); return command; } } class Solution { public String interpret(String command) { StringBuilder sb = new StringBuilder(); int idx = 0; while(idx < command.length()) { char c = command.charAt(idx); if(c == 'G') { sb.append('G'); idx += 1; } else if(c == '(') { char d = command.charAt(idx+1); if(d == ')') { sb.append("o"); idx += 2; } else if(d == 'a') { sb.append("al"); idx += 4; } } } return sb.toString(); } }
[ "xgmak94@gmail.com" ]
xgmak94@gmail.com
4d96a6155e48dda929cfa984cee5c83fe6580ceb
1dbb3f2a2e30e77eefcd7b4e258b1bd784a7b2a3
/src/main/java/homeposting/app/web/transactions/manager/Bean.java
5503bd68693311bc31214d64e21b65465fcf95d1
[]
no_license
gummis/homeposting
e797a4dd9c220a1ce0557121f9007a582e36423a
50df9c3005fa867303213d33751465848dd7634a
refs/heads/master
2016-09-16T03:38:54.476079
2014-06-25T21:13:11
2014-06-25T21:13:11
null
0
0
null
null
null
null
UTF-8
Java
false
false
2,048
java
package homeposting.app.web.transactions.manager; import homeposting.app.common.data.util.LOG; import java.io.Serializable; import java.util.ArrayList; import java.util.List; import javax.annotation.PostConstruct; import javax.faces.bean.ManagedBean; import javax.faces.bean.ViewScoped; import javax.faces.model.DataModel; import javax.faces.model.ListDataModel; @ManagedBean @ViewScoped public class Bean implements Serializable { private List<Item> list; private transient DataModel<Item> model; private Item item = new Item(); private boolean edit; public Bean(){ LOG.info("Bean.constructor"); } @PostConstruct public void init() { LOG.info("Bean.init"); // list = dao.list(); // Actually, you should retrieve the list from DAO. This is just for demo. list = new ArrayList<Item>(); list.add(new Item(1L, "item1")); list.add(new Item(2L, "item2")); list.add(new Item(3L, "item3")); } public void add() { // dao.create(item); // Actually, the DAO should already have set the ID from DB. This is just for demo. item.setId(list.isEmpty() ? 1 : list.get(list.size() - 1).getId() + 1); list.add(item); item = new Item(); // Reset placeholder. } public void edit() { item = model.getRowData(); edit = true; } public void save() { // dao.update(item); item = new Item(); // Reset placeholder. edit = false; } public void delete() { // dao.delete(item); list.remove(model.getRowData()); } public List<Item> getList() { return list; } public DataModel<Item> getModel() { if (model == null) { model = new ListDataModel<Item>(list); } return model; } public Item getItem() { return item; } public boolean isEdit() { return edit; } // Other getters/setters are actually unnecessary. Feel free to add them though. }
[ "slyyyy78@gmail.com" ]
slyyyy78@gmail.com
512d487402a660677c5ec1d1eb5fe927a93545f1
389b5b09d76c6b648e7f44c830aa926013375e95
/week-11/Student/src/main/java/ba/edu/ssst/Student/InventorySerializer.java
85422b5e8e3a4cbeea840b560809c3219e31a803
[ "MIT" ]
permissive
thelittlehawk/CSIS280
0603128725eebea10286292b876695fe58155d92
d6073cbd2e64abd58f9b3e748f4d497ae23489e8
refs/heads/master
2021-09-05T12:08:45.516637
2018-01-27T10:17:32
2018-01-27T10:17:32
108,032,562
2
0
null
null
null
null
UTF-8
Java
false
false
818
java
package ba.edu.ssst.Student; import com.fasterxml.jackson.core.JsonGenerator; import com.fasterxml.jackson.databind.SerializerProvider; import com.fasterxml.jackson.databind.ser.std.StdSerializer; import java.io.IOException; public class InventorySerializer extends StdSerializer<Inventory> { protected InventorySerializer() { this(null); } protected InventorySerializer(Class<Inventory> t) { super(t); } @Override public void serialize(Inventory inventory, JsonGenerator jsonGenerator, SerializerProvider serializerProvider) throws IOException { jsonGenerator.writeStartArray(); for (int i = 0 ; i < inventory.Size() ; i++) { jsonGenerator.writeString(inventory.GetItem(i).toString()); } jsonGenerator.writeEndArray(); } }
[ "faik.catibusic@gmail.com" ]
faik.catibusic@gmail.com
e47104791341f0238a0ef41d29491199c454b2ed
1ba2ea1e9c7a0f88e4ed75355511eba281c818aa
/P10-Cryptography/src/crypto/MD5HashOfFile.java
980020df28f304f5babf87db686107700e173c3f
[]
no_license
satrial/PEMROGRAMAN-KOMPUTER2-P10-Cryptography
38d6d493b733523238da14702e258d91e108ea79
bfd8befe0a4b42406c7bf7122970a250b3066322
refs/heads/master
2022-09-27T04:04:56.425402
2020-06-09T04:15:22
2020-06-09T04:15:22
270,900,590
0
0
null
null
null
null
UTF-8
Java
false
false
1,496
java
/* * To change this license header, choose License Headers in Project Properties. * To change this template file, choose Tools | Templates * and open the template in the editor. */ package crypto; import java.io.File; import java.io.FileInputStream; import java.io.IOException; import java.security.MessageDigest; import java.security.NoSuchAlgorithmException; /** * * @author INDRIAWAN */ public class MD5HashOfFile { public static String hashFile(String file){ String hashed = ""; try { MessageDigest md = MessageDigest.getInstance("MD5"); FileInputStream fis = new FileInputStream(file); byte[] byteData = new byte[1024]; int nRead; while ((nRead= fis.read(byteData)) != -1) { md.update(byteData, 0, nRead); } byte[] mdByte = md.digest(); StringBuilder sb = new StringBuilder(); for (int i = 0; i < mdByte.length; i++) { sb.append(Integer.toString((mdByte[1] & 0xff) + 0x100, 16).substring(1)); } hashed = sb.toString(); } catch (IOException| NoSuchAlgorithmException e) { } return hashed; } public static void main(String[] args) { String file = System.getProperty("user.dir") + File.separator + "manifest.mf"; System.out.println("File\t\t: "+file); System.out.println("MD5 checksum\t: "+hashFile(file)); } }
[ "satriaindriawan@gmail.com" ]
satriaindriawan@gmail.com
2986e42668fb1eb6adfe41eb1eda5a0cca14d1d6
e94766f6593a895476396db90ece23b875895065
/developer-studio/registry/test/org.wso2.developerstudio.eclipse.greg.registry.test/src/org/wso2/developerstudio/eclipse/greg/registry/test/TestRegistry.java
ff9958736189ea8b15558e5613ea5e429162930a
[ "Apache-2.0" ]
permissive
sohaniwso2/SohaniWSO2
d892a5a28350a8762d16a231e84b29b65d6aaec1
f80857d7c489bec24666292a476a4cb78438864c
refs/heads/master
2021-05-16T02:17:43.723824
2017-04-04T09:32:37
2017-04-04T09:32:37
16,612,207
0
0
null
null
null
null
UTF-8
Java
false
false
1,644
java
package org.wso2.developerstudio.eclipse.greg.registry.test; import java.io.IOException; import javax.xml.xpath.XPathExpressionException; import org.junit.AfterClass; import org.junit.BeforeClass; import org.junit.Test; import org.junit.runner.RunWith; import org.wso2.developerstudio.eclipse.swtfunctionalframework.registry.util.RegistryUtil; import org.wso2.developerstudio.eclipse.test.automation.framework.executor.Executor; import org.wso2.developerstudio.eclipse.test.automation.framework.runner.Order; import org.wso2.developerstudio.eclipse.test.automation.framework.runner.OrderedRunner; import org.wso2.developerstudio.eclipse.test.automation.utils.functional.FunctionalUtil; import org.wso2.developerstudio.eclipse.test.automation.utils.server.AutomationFrameworkException; import org.wso2.developerstudio.eclipse.test.automation.utils.server.TestServerManager; @RunWith(OrderedRunner.class) public class TestRegistry extends Executor { private RegistryUtil regUtil = new RegistryUtil(); private static TestServerManager testServer = new TestServerManager( "wso2am-1.8.0.zip"); @BeforeClass public static void serverStartup() { try { testServer.startServer(); } catch (XPathExpressionException | AutomationFrameworkException | IOException e) { } } @Test @Order(order = 1) public void login() { FunctionalUtil.openPerspective("WSO2 Registry"); regUtil.login("admin", "admin", null, null); RegistryUtil.expandTree("admin", "https://localhost:9443/"); } @AfterClass public static void severShutdown() { try { testServer.stopServer(); } catch (AutomationFrameworkException e) { } } }
[ "sohani@wso2.com" ]
sohani@wso2.com
64a8519fb8d5a33ae87d36fa9ee24c83f1d39a94
677197bbd8a9826558255b8ec6235c1e16dd280a
/src/com/alibaba/fastjson/parser/deserializer/PointDeserializer.java
0ebafd3e3f6e0ed06f42369f6ba80ed16c4cb88b
[]
no_license
xiaolongyuan/QingTingCheat
19fcdd821650126b9a4450fcaebc747259f41335
989c964665a95f512964f3fafb3459bec7e4125a
refs/heads/master
2020-12-26T02:31:51.506606
2015-11-11T08:12:39
2015-11-11T08:12:39
45,967,303
0
1
null
2015-11-11T07:47:59
2015-11-11T07:47:59
null
UTF-8
Java
false
false
2,384
java
package com.alibaba.fastjson.parser.deserializer; import com.alibaba.fastjson.JSON; import com.alibaba.fastjson.JSONException; import com.alibaba.fastjson.parser.DefaultJSONParser; import com.alibaba.fastjson.parser.JSONLexer; import java.awt.Point; import java.lang.reflect.Type; public class PointDeserializer implements ObjectDeserializer { public static final PointDeserializer instance = new PointDeserializer(); public <T> T deserialze(DefaultJSONParser paramDefaultJSONParser, Type paramType, Object paramObject) { JSONLexer localJSONLexer = paramDefaultJSONParser.getLexer(); if (localJSONLexer.token() == 8) { localJSONLexer.nextToken(16); return null; } if ((localJSONLexer.token() != 12) && (localJSONLexer.token() != 16)) throw new JSONException("syntax error"); localJSONLexer.nextToken(); int i = 0; int j = 0; String str; label262: label277: while (true) { if (localJSONLexer.token() == 13) { localJSONLexer.nextToken(); return new Point(i, j); } int k; if (localJSONLexer.token() == 4) { str = localJSONLexer.stringVal(); if (JSON.DEFAULT_TYPE_KEY.equals(str)) { paramDefaultJSONParser.acceptType("java.awt.Point"); } else { localJSONLexer.nextTokenWithColon(2); if (localJSONLexer.token() == 2) { k = localJSONLexer.intValue(); localJSONLexer.nextToken(); if (!str.equalsIgnoreCase("x")) break label262; i = k; } } } else { while (true) { if (localJSONLexer.token() != 16) break label277; localJSONLexer.nextToken(4); break; throw new JSONException("syntax error"); throw new JSONException("syntax error : " + localJSONLexer.tokenName()); if (!str.equalsIgnoreCase("y")) break label279; j = k; } } } label279: throw new JSONException("syntax error, " + str); } public int getFastMatchToken() { return 12; } } /* Location: /Users/zhangxun-xy/Downloads/qingting2/classes_dex2jar.jar * Qualified Name: com.alibaba.fastjson.parser.deserializer.PointDeserializer * JD-Core Version: 0.6.2 */
[ "cnzx219@qq.com" ]
cnzx219@qq.com
10827886212956882128280520b37fc32f299d19
c5ac5609bef4716eea2a420d8f70168f263826f9
/src/main/java/com/example/demo/controller/PageController.java
495414f0000497cefd1a2b46ef28c2050c9bb241
[]
no_license
Apap-2018/tutorial2_1606874476
0b880428129f6f101a967e04ce5b701adfcd9e8a
33485eb9bee9d1f3622d9803ce7411826c3a1339
refs/heads/master
2020-03-29T09:04:53.700861
2018-09-21T09:23:46
2018-09-21T09:23:46
null
0
0
null
null
null
null
UTF-8
Java
false
false
1,349
java
package com.example.demo.controller; import org.springframework.ui.Model; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestParam; @org.springframework.stereotype.Controller public class PageController { @RequestMapping("/viral") public String index(){ return "viral2jari"; } @RequestMapping("/challenge") public String challenge(@RequestParam(value = "name", defaultValue = "Kiki") String name, Model model) { model.addAttribute("name", name); return "challenge"; } @RequestMapping("/generator") public String generator(@RequestParam(value = "a", defaultValue = "0") String x, @RequestParam(value = "b", defaultValue = "0") String y, Model model) { model.addAttribute("a", x); model.addAttribute("b", y); int xx = Integer.parseInt(x); int yy = Integer.parseInt(y); if (xx == 0) { xx = 1; } if (yy == 0) { yy = 1; } String hm = "h"; for (int i = 0; i < xx; i++) { hm += "m"; } String text = ""; for (int i = 0; i < yy; i++) { text += (hm + " "); } System.out.println(text); model.addAttribute("text", text); return "generator"; } }
[ "oktavio.rei@gmail.com" ]
oktavio.rei@gmail.com
51a11b998cc59fbe7b6798e65a837e8abcd540d8
63036fee3ef9da26e9b69be144d3c71635d33fcf
/segment/src/main/java/com/yjy/segment/Segment.java
3779e9d03cccb672ffe63e6603af3f505d4b77f6
[]
no_license
lvsecoto/View
1c1566273ca3a4f1c74ef83b45e785dca979b0d8
8600049412925918a4b45e4de08ceae3aeac8deb
refs/heads/master
2021-05-06T03:00:38.165983
2017-12-20T13:50:11
2017-12-20T13:50:11
114,773,186
0
0
null
null
null
null
UTF-8
Java
false
false
2,850
java
package com.yjy.segment; import android.annotation.SuppressLint; import android.content.Context; import android.graphics.Canvas; import android.graphics.RectF; import android.support.annotation.Nullable; import android.util.AttributeSet; import android.view.MotionEvent; import android.view.View; import com.yjy.segment.animate.Animate; import com.yjy.segment.animate.DefaultAnimate; import com.yjy.segment.frame.DefaultFrame; import com.yjy.segment.frame.Frame; import com.yjy.segment.render.BaseRender; import com.yjy.segment.render.Render; import com.yjy.segment.render.RenderBuilder; public class Segment extends View { private int mSelectedItem; private Animate mAnimator = new DefaultAnimate(); private Frame mFrame; private Render mRender; public Segment(Context context) { super(context); } public Segment(Context context, @Nullable AttributeSet attrs) { super(context, attrs); Configure configure = new Configure(context, attrs); DefaultFrame defaultFrame = new DefaultFrame(configure); mFrame = defaultFrame; mRender = new RenderBuilder(configure, mFrame).build(); mAnimator.addUpdateListener(new Animate.OnUpdateListener() { @Override public void onUpdate(float time) { invalidate(); } @Override public void onItemSelect(int selectedItem) { } }); mAnimator.addUpdateListener(defaultFrame); } @Override public boolean onTouchEvent(MotionEvent event) { if (event.getAction() == MotionEvent.ACTION_DOWN && onTouchSegment(event.getX(), event.getY())) { mAnimator.playSelectItem(mSelectedItem); return true; } else return false; } private boolean onTouchSegment(float x, float y) { int whichItemClick = findWhichItemClick(x, y, mFrame.getItems()); if (whichItemClick == -1) { return false; } mSelectedItem = whichItemClick; return true; } private int findWhichItemClick(float x, float y, Frame.Item[] items) { for (int i = 0; i < items.length; i++) { RectF bound = items[i].getBound(); if (bound.contains(x, y)) { return i; } } return -1; } @SuppressLint("DrawAllocation") @Override protected void onDraw(Canvas canvas) { super.onDraw(canvas); mRender.draw(canvas); } @Override protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) { mFrame.measure(widthMeasureSpec, heightMeasureSpec); mRender.prepare(); mAnimator.initSelectItem(mSelectedItem); setMeasuredDimension((int) mFrame.getWidth(), (int) mFrame.getHeight()); } }
[ "785570262@qq.com" ]
785570262@qq.com
9634cb18e6f6f81f09f7ab46697409bce0f72f4e
e6d80fe724fd2cbf9ef4e296fb3c2228624859cf
/src/commands/FilterLessThanDistance.java
b7445b628982d7100f7a3193eda2e755de7d9ed5
[]
no_license
lerdenson/newlab5
fd15c289ce8c1173b824bc222f494f621ed4d4b6
10b4619f3f954e62b73602772856c3894619da5a
refs/heads/master
2023-04-18T17:04:23.221458
2021-04-27T00:07:39
2021-04-27T00:07:39
361,915,314
0
0
null
null
null
null
UTF-8
Java
false
false
1,336
java
package commands; import exceptions.EmptyArgumentException; import utilities.CollectionManager; /** * Команда, выводящая элементы, значение поля distance которых меньше заданного */ public class FilterLessThanDistance extends AbstractCommand { private CollectionManager collectionManager; public FilterLessThanDistance(CollectionManager collectionManager) { super("filter_less_than_distance distance", "вывести элементы, значение поля distance которых меньше заданного"); this.collectionManager = collectionManager; } @Override public boolean execute(String argument) { try { if (argument.isEmpty()) throw new EmptyArgumentException(); Float distance = Float.parseFloat(argument); collectionManager.filterLessThanDistance(distance); return true; } catch (EmptyArgumentException e) { System.err.println("У этой команды должен быть аргумент distance"); } catch (NumberFormatException e) { System.err.println("Формат введенного аргумента неверен . Он должен быть числом."); } return false; } }
[ "Maxim.d.morozov@gmail.com" ]
Maxim.d.morozov@gmail.com
f4265333c75f999538ea5a97e1916726c1d101b7
26c49a733b335a9c103afb684599fe52482aaca8
/SpringBootDubboConsumer/src/main/java/com/sample/consumer/filter/OriginIntercepter.java
63305d4c6faab42df47093c85fc113265758f7e5
[]
no_license
hacklesser/GeneralJavaProjects
356c43187ed38c236cd8821054b36bfb1d680ace
a8008e75ecf01c2f6f7a014307e1751f4d6e4a6b
refs/heads/master
2021-01-19T11:32:28.228494
2017-03-12T14:58:23
2017-03-12T14:58:23
82,252,104
0
0
null
null
null
null
UTF-8
Java
false
false
912
java
package com.sample.consumer.filter; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import org.springframework.web.servlet.HandlerInterceptor; import org.springframework.web.servlet.ModelAndView; public class OriginIntercepter implements HandlerInterceptor{ @Override public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) throws Exception { response.setHeader("Access-Control-Allow-Origin", "*"); return true; } @Override public void postHandle(HttpServletRequest request, HttpServletResponse response, Object handler, ModelAndView modelAndView) throws Exception { // TODO Auto-generated method stub } @Override public void afterCompletion(HttpServletRequest request, HttpServletResponse response, Object handler, Exception ex) throws Exception { // TODO Auto-generated method stub } }
[ "hackless@me.com" ]
hackless@me.com
2632d78c0217215100dff7428a29d28f8eadce82
be1ea339b68bd94d3a782e1c23ce41b5ea740b79
/dc/src/dc2_2/ClockCanvas.java
52c4896077ccc7a6ffeaa5e69f57f529bfe19b17
[]
no_license
tomitake0846/Java-Training
25de4bc99f23f11dc175e1f8f95136c369d4f260
688b0a2de950d92d032b254799f53690c174ac5b
refs/heads/master
2021-06-16T08:54:20.978565
2021-05-05T11:42:38
2021-05-05T11:42:38
199,947,283
0
0
null
2021-05-05T11:42:39
2019-08-01T00:24:30
Java
UTF-8
Java
false
false
1,343
java
package dc2_2; import java.awt.Canvas; import java.awt.Font; import java.awt.FontMetrics; import java.awt.Graphics; import java.awt.Image; import java.time.LocalDateTime; import java.time.format.DateTimeFormatter; public class ClockCanvas extends Canvas{ private DateTimeFormatter f = DateTimeFormatter.ofPattern("yyyy:MM:dd HH:mm:ss"); private PropertyInfo propertyInfo; public ClockCanvas(PropertyInfo propertyInfo) { this.propertyInfo = propertyInfo; setSize(this.propertyInfo.getClockWidth(),this.propertyInfo.getClockHeight()); setBackground(PropertyInfo.toColor(this.propertyInfo.getBGColor())); } @Override public void paint(Graphics g) { Image buff = createImage(getWidth(),getHeight()); setBackground(PropertyInfo.toColor(this.propertyInfo.getBGColor())); Graphics buffGra = buff.getGraphics(); buffGra.setColor(PropertyInfo.toColor(this.propertyInfo.getCharColor())); Font font = new Font(this.propertyInfo.getFontFamily(), this.propertyInfo.getFontName(), this.propertyInfo.getFontSize()); String drawString = LocalDateTime.now().format(f); FontMetrics metrics = buffGra.getFontMetrics(font); int x = (getWidth() - metrics.stringWidth(drawString)) / 2 ; int y = getHeight() / 2; buffGra.setFont(font); buffGra.drawString(drawString,x,y); g.drawImage(buff, 0, 0, this); } }
[ "fredericab0846@gmail.com" ]
fredericab0846@gmail.com
c97e3bee9547173040160932ec0021f1792775a1
34f51439803a5c17c2164a2089d588f1399f07a3
/app/src/main/java/inc/talentedinc/utilitis/ValidationUtility.java
933be06e791ce15bfd33aa6b642140e50192d426
[]
no_license
ShimaaSamirAdly/TalentedInc
e6df85779af81bca6398129bc280b9015ed8c7ce
6dc13d449940dd5f4ef2a460a66ebe18a96115cc
refs/heads/master
2020-03-18T01:32:51.383891
2018-06-26T13:20:53
2018-06-26T13:20:53
134,146,851
1
0
null
null
null
null
UTF-8
Java
false
false
341
java
package inc.talentedinc.utilitis; /** * Created by asmaa on 05/21/2018. */ public class ValidationUtility { public static boolean validateEmptyString(String string){ if(string.equals("") || string.trim().length()==0 || string.equals(null) || string == null){ return false; } return true; } }
[ "asmaahassenibrahem@gmail.com" ]
asmaahassenibrahem@gmail.com
a4ba2dc8dbfbd8c464f85d0c478eaffca8456d84
8646c056d0fcce2e641b8ba69db3f084b0d7a8f0
/hw09_temp/HighScores.java
1181fc1053fe719b54fb1ce3da99a131a61be1d7
[]
no_license
yumingq/farmpocalypse
9750d2b516524986c391d6fcd84f9dabb73249cd
5230c9baa34ec83ef5d87f0f4de6574fc01cfa7c
refs/heads/master
2020-12-24T21:11:44.473992
2016-04-27T02:23:21
2016-04-27T02:23:21
56,443,362
0
0
null
null
null
null
UTF-8
Java
false
false
5,774
java
import java.io.BufferedReader; import java.io.IOException; import java.io.InputStream; import java.io.PrintWriter; import java.io.Reader; import java.io.Writer; import java.util.ArrayList; import java.util.Collection; import java.util.Collections; import java.util.Comparator; import java.util.HashMap; import java.util.Iterator; import java.util.LinkedHashMap; import java.util.LinkedList; import java.util.List; import java.util.Map; import java.util.Scanner; import java.util.Set; import java.util.TreeMap; import java.util.TreeSet; import java.util.stream.Stream; public class HighScores { private BufferedReader reader; private Set<String> containerOfLines; private int score; public HighScores(int score) { this.score = score; } //exception if the formatting is wrong @SuppressWarnings("serial") public static class FormatException extends Exception { public FormatException(String msg) { super(msg); } } //check for formatting and read the actual lines into a string set public Set<String> formatChecker(Reader in) throws IOException, FormatException { //check that the reader isn't null if (in == null) { throw new IllegalArgumentException(); } reader = new BufferedReader(in); containerOfLines = new TreeSet<String>(); try { String current = ((BufferedReader) reader).readLine(); //while there's still stuff to read while(current != null) { //variables to track the correct format current = current.trim(); boolean commaAtCorrectPos = true; int onlyOneComma = 0; //read each line and see if it is formatted correctly for(int i = 0; i < current.length(); i++) { //how many commas are there in this line? if (current.charAt(i) == ',') { onlyOneComma++; //are the commas in plausible positions? if (i == 0 || i == current.length() - 1) { commaAtCorrectPos = false; } } } //if they're not formatted correctly, throw format exceptions if (onlyOneComma != 1) { throw new FormatException("wrong # of commas"); } else if (commaAtCorrectPos == false) { throw new FormatException("wrong position for comma"); } containerOfLines.add(current); current = ((BufferedReader) reader).readLine(); } } finally { reader.close(); } return (TreeSet<String>) containerOfLines; } //isolate the names from the scores in a string line public Collection<Scores> nameScoreIsolate(Set<String> lines) { Collection<Scores> scoreList = new ArrayList<Scores>(); for (String current : lines) { int commaPos = current.indexOf(","); //isolate the left part of the comma String playerName = current.substring(0, (commaPos)); //trim off any white space playerName = playerName.trim(); //isolate right part of comma String currScore = current.substring((commaPos + 1), current.length()); currScore = currScore.trim(); scoreList.add(new Scores(playerName, currScore)); } return scoreList; } //this method is to update the old text file with the new information public void updateDoc(Reader in, Writer out) throws IOException,FormatException { if (in == null) { throw new IllegalArgumentException(); } Set<String> lineContainer = formatChecker(in); for(String indiv: lineContainer) { out.write(indiv); out.write(System.getProperty("line.separator")); } } //sort the high score objects by score @SuppressWarnings("unchecked") public static Collection<Scores> sortByScore(Collection<Scores> unsortedScores) { List<Scores> sortedList = (ArrayList<Scores>) unsortedScores; Collections.sort((List<Scores>) sortedList); return sortedList; } //this method does most of the heavy work- calls other methods to process the information //sorts them, writes them out public void processDocument(Reader in, Writer out, String user) throws IOException, FormatException { //check that the reader isn't null if (in == null) { throw new IllegalArgumentException(); } //check formatting and put the lines into a set Set<String> lineContainer = formatChecker(in); //isolate the name vs the score Collection<Scores> userScores; userScores = nameScoreIsolate(lineContainer); //put in the current username and score userScores.add(new Scores(user, Integer.toString(score))); //sort the map by values (ascending) Collection<Scores> sortedUsersScores = sortByScore(userScores); //maximum # of high scores is 10 int maxScores = 10; for(Scores indiv: sortedUsersScores) { if (maxScores > 0) { out.write(indiv.getName() + ", " + indiv.getScore()); out.write(System.getProperty("line.separator")); } maxScores--; } } }
[ "yumingq@wharton.upenn.edu" ]
yumingq@wharton.upenn.edu
f1f762837f51ede7fea8bfcfda7e585f3590a48f
6ed265d74a0161f10c2f34752483d6d7bf86376a
/src/main/java/net/originmobi/pdv/service/PagarTipoService.java
7923517a7c7066843aea95dd8f6659e6af609ddc
[ "Apache-2.0" ]
permissive
joaotux/pdv
4ce3df47c12fb165a443c1cb2410aab5f2f9b9e4
8ed96d5d727adec0606a912a0b4a2c65bc0d54fd
refs/heads/master
2022-07-10T16:57:55.192279
2022-06-22T18:30:16
2022-06-22T18:30:16
137,320,615
44
38
Apache-2.0
2022-06-22T18:30:17
2018-06-14T07:12:49
Java
UTF-8
Java
false
false
560
java
package net.originmobi.pdv.service; import java.util.List; import java.util.Optional; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import net.originmobi.pdv.model.PagarTipo; import net.originmobi.pdv.repository.PagarTipoRepository; @Service public class PagarTipoService { @Autowired private PagarTipoRepository pagartipos; public List<PagarTipo> lista() { return pagartipos.findAll(); } public Optional<PagarTipo> busca(Long codigo) { return pagartipos.findById(codigo); } }
[ "j.rafael.tux@gmail.com" ]
j.rafael.tux@gmail.com
997dbd16d06d0b52eba8d9c860d5dda5218eddab
40504ef965c5254cd24125c81697d5e88b43ecff
/src/main/java/io/cxh/j2ee/servlet/HelloServlet.java
752ae082a070ddc6530cd2a67047dbfbeeb8ad10
[]
no_license
xurisui/cxh_j2ee
6ffa8431628f5cffea5cc1078a29d795413d957a
ed6226370c772497661701c124b90001e8bb4216
refs/heads/master
2021-01-24T18:37:43.988751
2017-03-09T15:38:39
2017-03-09T15:38:39
84,457,064
0
0
null
null
null
null
UTF-8
Java
false
false
535
java
package io.cxh.j2ee.servlet; import javax.servlet.ServletException; import javax.servlet.http.HttpServlet; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import java.io.IOException; /** * Created by Administrator on 2017/3/9. */ public class HelloServlet extends HttpServlet { @Override protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException { req.getRequestDispatcher("/jsp/hello.jsp").forward(req, resp); } }
[ "xhaoch@163.com" ]
xhaoch@163.com
421020e961b309a542c9c74586699546eb189281
871fdfcff196286059e8bc6e862ad40546bc5ab6
/SanatSaz-A/app/src/main/java/com/example/boroodat/model/activity5/Activity5_FragmentParentModel.java
a217248181b798caa80af3ca9ec852a2d25a67ee
[]
no_license
Mahmoud-Khorrami/SanatSaz
25aa86bc11458977633f3d31a03d2932cfa5436a
e5cbe009953cf644b5bbc936d2cbc12a5fded671
refs/heads/master
2023-09-01T06:23:03.084522
2021-06-22T06:39:56
2021-06-22T06:39:56
347,669,077
0
0
null
null
null
null
UTF-8
Java
false
false
578
java
package com.example.boroodat.model.activity5; public class Activity5_FragmentParentModel { public static final int Main = 106; public static final int Loading = 206; public static final int Retry = 306; public static final int NotFound = 406; private int currentType; public Activity5_FragmentParentModel(int currentType) { this.currentType = currentType; } public int getCurrentType() { return currentType; } public void setCurrentType(int currentType) { this.currentType = currentType; } }
[ "mahmoud.khorrami.dev@gmail.com" ]
mahmoud.khorrami.dev@gmail.com
da5401e61e6d86498f0c13c68c87dd9e237d3e49
330f81dc5de92d7040f259b36e1182e9093c6c38
/Questions/Patterns/pattern14.java
154833219eccdd9f09a9349314f5564ef17e765a
[]
no_license
Ujwalgulhane/Data-Structure-Algorithm
75f0bdd9a20de2abf567ee1f909aa91e3c2f5cfc
e5f8db3a313b3f634c002ec975e0b53029e82d90
refs/heads/master
2023-08-25T02:36:57.045798
2021-10-26T07:13:58
2021-10-26T07:13:58
null
0
0
null
null
null
null
UTF-8
Java
false
false
223
java
import java.util.*; public class pattern14{ public static void main(String[] args) { Scanner sc = new Scanner(System.in); int a =sc.nextInt(); for(int i=1;i<=10;i++){ System.out.println(a+"*"+i+"="+a*i); } } }
[ "siddhant.sarkar999@gmail.com" ]
siddhant.sarkar999@gmail.com
09c2f9bd8ce03b3f104b7b0cd001e733476d9fc7
10cc2246d98f73a3088a9a51febbf468d5473aac
/src/task/by/faifly/Main.java
255058ca57e0680bff6e22852e479b3bb0f914da
[]
no_license
A-Nosenko/WeightGymCalculator
fa5b5919bf2ac61de736919b6a4d7603720f9715
f98e67ea21f5fe98e88bb0ac3a499a9d5d9a7587
refs/heads/master
2021-05-01T07:45:52.186775
2019-02-16T07:12:11
2019-02-16T07:12:11
121,163,430
0
0
null
null
null
null
UTF-8
Java
false
false
495
java
package task.by.faifly; import task.by.faifly.viev_controller.MainFrame; import java.awt.*; /** * Class to start application. * * @author Anatolii Nosenko * @version 1.0 2/10/2018. */ public class Main { /** * Entry point. * * @param args Command line arguments. */ public static void main(String[] args) { EventQueue.invokeLater(() -> { MainFrame mainFrame = new MainFrame(); mainFrame.setVisible(true); }); } }
[ "nosenkoa87@gmail.com" ]
nosenkoa87@gmail.com
d630638ed2b2330952fe4860baabc50528974347
4a2dc33b19975254086a22dda1f222b670aaa639
/Domo/src/main/java/com/buggycoder/domo/api/response/Advice.java
7075c6185b5d8dfc00ec39c531f146a9dc3047f6
[]
no_license
alist/domo-android
806099c4445220aa6c6cd033ab295392897d755a
c276b85196609002a7d737027218de329774303d
refs/heads/master
2021-01-02T09:33:13.152998
2014-02-12T22:50:14
2014-02-12T22:50:14
null
0
0
null
null
null
null
UTF-8
Java
false
false
3,722
java
package com.buggycoder.domo.api.response; import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; import com.j256.ormlite.field.DatabaseField; import com.j256.ormlite.table.DatabaseTable; import java.util.HashMap; import java.util.Map; @JsonInclude(JsonInclude.Include.NON_NULL) @JsonPropertyOrder({ "_id", "adviceGiver", "adviceResponse", "helpful", "thankyou", "modifiedDate", "status" }) @DatabaseTable(tableName = "advice") public class Advice { @JsonProperty("_id") @DatabaseField(id = true) private String _id; @JsonProperty("adviceGiver") @DatabaseField(canBeNull = false) private String adviceGiver; @JsonProperty("adviceResponse") @DatabaseField(canBeNull = false) private String adviceResponse; @JsonProperty("helpful") @DatabaseField(canBeNull = true) private Integer helpful; @JsonProperty("thankyou") @DatabaseField(canBeNull = true) private Integer thankyou; @JsonProperty("modifiedDate") @DatabaseField(canBeNull = true) private String modifiedDate; @JsonProperty("status") @DatabaseField(canBeNull = true) private String status; @JsonIgnore @DatabaseField(foreign = true, foreignAutoRefresh = true, columnName = "adviceRequestId") private AdviceRequest adviceRequest; private Map<String, Object> additionalProperties = new HashMap<String, Object>(); @JsonProperty("_id") public String get_id() { return _id; } @JsonProperty("_id") public void set_id(String _id) { this._id = _id; } @JsonProperty("adviceGiver") public String getAdviceGiver() { return adviceGiver; } @JsonProperty("adviceGiver") public void setAdviceGiver(String adviceGiver) { this.adviceGiver = adviceGiver; } @JsonProperty("adviceResponse") public String getAdviceResponse() { return adviceResponse; } @JsonProperty("adviceResponse") public void setAdviceResponse(String adviceResponse) { this.adviceResponse = adviceResponse; } @JsonProperty("helpful") public Integer getHelpful() { return helpful; } @JsonProperty("helpful") public void setHelpful(Integer helpful) { this.helpful = helpful; } @JsonProperty("thankyou") public Integer getThankyou() { return thankyou; } @JsonProperty("thankyou") public void setThankyou(Integer thankyou) { this.thankyou = thankyou; } @JsonProperty("modifiedDate") public String getModifiedDate() { return modifiedDate; } @JsonProperty("modifiedDate") public void setModifiedDate(String modifiedDate) { this.modifiedDate = modifiedDate; } @JsonProperty("status") public String getStatus() { return status; } @JsonProperty("status") public void setStatus(String status) { this.status = status; } public AdviceRequest getAdviceRequest() { return adviceRequest; } public void setAdviceRequest(AdviceRequest adviceRequest) { this.adviceRequest = adviceRequest; } @JsonAnyGetter public Map<String, Object> getAdditionalProperties() { return this.additionalProperties; } @JsonAnySetter public void setAdditionalProperties(String name, Object value) { this.additionalProperties.put(name, value); } }
[ "shirishk.87@gmail.com" ]
shirishk.87@gmail.com
9550d0388891a09419b6fc0b0766f3f661d5e68c
3538d6761e7116594fcfdbea0707443028416046
/src/main/java/com/ferrari/course/entites/pk/OrderItemPK.java
1e6acf11793a28b75a404464844f53f1d2903238
[]
no_license
Ferrarims/course-springboot-2-java-11
a2372cc3cf4a2c688765daed10bf3bac44c0a3a9
9932fd5883e7d47cafb9183d699c4b7ea1400b6d
refs/heads/master
2022-04-21T07:19:00.053888
2020-04-17T10:00:02
2020-04-17T10:00:02
255,934,068
0
0
null
null
null
null
UTF-8
Java
false
false
1,503
java
package com.ferrari.course.entites.pk; import java.io.Serializable; import javax.persistence.Embeddable; import javax.persistence.JoinColumn; import javax.persistence.ManyToOne; import com.ferrari.course.entites.Order; import com.ferrari.course.entites.Product; @Embeddable public class OrderItemPK implements Serializable{ private static final long serialVersionUID = 1L; @ManyToOne @JoinColumn(name = "order_id") private Order order; @ManyToOne @JoinColumn(name = "product_id") private Product product; public Order getOrder() { return order; } public void setOrder(Order order) { this.order = order; } public Product getProduct() { return product; } public void setProduct(Product product) { this.product = product; } @Override public int hashCode() { final int prime = 31; int result = 1; result = prime * result + ((order == null) ? 0 : order.hashCode()); result = prime * result + ((product == null) ? 0 : product.hashCode()); return result; } @Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (getClass() != obj.getClass()) return false; OrderItemPK other = (OrderItemPK) obj; if (order == null) { if (other.order != null) return false; } else if (!order.equals(other.order)) return false; if (product == null) { if (other.product != null) return false; } else if (!product.equals(other.product)) return false; return true; } }
[ "ferrarims85@gmail.com" ]
ferrarims85@gmail.com
e405dffca509cbd7548684097e4d9366a0c13be2
08a29b06a242479acc8f4fa179207a47c23f5bb4
/src/main/java/com/example/demo/controller/BorrowController.java
bbb966da29bba7294556d7d8e9fbd860eae5c953
[]
no_license
1838120744/LibrarySystem
685f12a54cede4ae9c9f106f5c1eb918bd479265
f4aca035e62ff880f2a9bad59526bd075d5b2ccd
refs/heads/master
2023-01-13T23:20:30.915347
2020-11-22T05:23:16
2020-11-22T05:23:16
309,649,969
0
0
null
null
null
null
UTF-8
Java
false
false
1,896
java
package com.example.demo.controller; import java.util.HashMap; import java.util.List; import java.util.Map; import javax.annotation.Resource; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import org.apache.shiro.authz.annotation.RequiresPermissions; import org.springframework.stereotype.Controller; import org.springframework.web.bind.annotation.PathVariable; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestParam; import org.springframework.web.bind.annotation.ResponseBody; import com.example.demo.entity.BorrowBookSequence; import com.example.demo.service.BorrowService; import net.sf.json.JSONObject; @Controller @RequestMapping("/book/borrow") public class BorrowController { @Resource private BorrowService borrowService ; @ResponseBody @RequestMapping("/list") @RequiresPermissions("管理员") public Map<String, Object> borrow_list(@RequestParam(value="page",required=false) Integer page, @RequestParam(value="limit",required=false)Integer limit,HttpServletRequest request, HttpServletResponse response)throws Exception{ Map<String, Object> map=new HashMap<String,Object>(); List<BorrowBookSequence> list = borrowService.list(map, page-1, limit); long total = borrowService.getTotal(map); map.put("data", list); map.put("count", total); map.put("code", 0); map.put("msg", ""); return map; } @ResponseBody @RequestMapping("/bookid") public JSONObject borrowbook(@RequestParam(value = "id", required = false) Integer id,HttpServletResponse httpServletResponse)throws Exception { JSONObject result=new JSONObject(); result.put("msg","借书失败"); try { borrowService.borrowbook(id); result.put("msg","借书成功"); } catch (Exception e) { result.put("msg",e.getMessage()); } return result; } }
[ "1838120744@qq.com" ]
1838120744@qq.com
9fc618fbf08e4d3ccf871d736816e114638dc6db
ef496a09e39a0bac6f9e10afa13db652cea36c6b
/src/main/java/com/mcfish/conf/WebMvcConfig.java
ea8ede255da79628ab152e054ba47d96b6969c37
[]
no_license
948734374/api
34e0073363a2eaf914c6a53556e833f8c0dc2455
edf274eb3615219a268ba970564d83904eff7e21
refs/heads/master
2020-03-12T05:48:08.407951
2018-04-21T12:24:54
2018-04-21T12:24:54
130,471,328
0
0
null
null
null
null
UTF-8
Java
false
false
2,213
java
/* * The MIT License (MIT) * * Copyright (c) 2014-2016 abel533@gmail.com * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ package com.mcfish.conf; import org.springframework.context.annotation.Configuration; import org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry; import org.springframework.web.servlet.config.annotation.WebMvcConfigurerAdapter; /** * * @package com.mcfish.project.conf * @description * @author shangfei * @date 2018年1月15日 * */ @Configuration public class WebMvcConfig extends WebMvcConfigurerAdapter { @Override public void addResourceHandlers(ResourceHandlerRegistry registry) { registry.addResourceHandler("/static/**").addResourceLocations("classpath:/static/"); registry.addResourceHandler("/images/**").addResourceLocations("classpath:/static/"); registry.addResourceHandler("swagger-ui.html").addResourceLocations("classpath:/META-INF/resources/"); registry.addResourceHandler("docs.html").addResourceLocations("classpath:/META-INF/resources/"); registry.addResourceHandler("/webjars/**").addResourceLocations("classpath:/META-INF/resources/webjars/"); } }
[ "948734374@qq.com" ]
948734374@qq.com
4ebc7f8da9e716ab190e5e5cb2c5f657682e70ae
dbe3f5a6bc58ede1d79080ece1240be516bf7490
/src/main/java/com/ityang/basic/service/Neo4jService.java
c44148e93806b22eaec44cada9e9fe21a5c43e50
[]
no_license
yang372193411/spring
a47f58ac67b3b18c29587a4dc9405d485d598b98
024633bd456913da88808bdfa08112db029602bf
refs/heads/master
2022-06-24T18:52:03.698610
2019-09-09T02:02:19
2019-09-09T02:02:19
141,823,633
0
0
null
2022-06-20T23:02:08
2018-07-21T15:14:42
Java
UTF-8
Java
false
false
119
java
package com.ityang.basic.service; import java.util.Map; public interface Neo4jService { void addNode(Map map); }
[ "yang372193411@163.com" ]
yang372193411@163.com
b3dee9b77547bac04b1d956550fd2cec397fc593
5d984ff6a7bc04772d4aba9e5bfd9e320aeedd9a
/java/com/sbs/example/model/Reply.java
272ce5088eead270a242ff7f0557ce8d38d98c82
[]
no_license
chacha86/jsp_2021_11_07
eed313cde05cfd5486726b0a5e4178d38c06e31b
74bf46d907b915aaeff87ab172b65bd22a66b54d
refs/heads/master
2023-08-25T18:11:20.600920
2021-11-07T08:21:43
2021-11-07T08:21:43
425,445,055
0
0
null
null
null
null
UTF-8
Java
false
false
1,409
java
package com.sbs.example.model; public class Reply { private int id; private int articleId; private String body; private String nickname; private String regDate; private int memberId; public Reply(int id, int articleId, String body, String nickname, String regDate) { super(); this.id = id; this.articleId = articleId; this.body = body; this.nickname = nickname; this.regDate = regDate; } public Reply(int articleId, String body, int memberId) { super(); this.articleId = articleId; this.body = body; this.memberId = memberId; } public Reply(String body, String nickname, String regDate) { super(); this.body = body; this.nickname = nickname; this.regDate = regDate; } public int getId() { return id; } public void setId(int id) { this.id = id; } public int getArticleId() { return articleId; } public void setArticleId(int articleId) { this.articleId = articleId; } public String getBody() { return body; } public void setBody(String body) { this.body = body; } public String getNickname() { return nickname; } public void setNickname(String nickname) { this.nickname = nickname; } public String getRegDate() { return regDate; } public void setRegDate(String regDate) { this.regDate = regDate; } public int getMemberId() { return memberId; } public void setMemberId(int memberId) { this.memberId = memberId; } }
[ "axdsw121@gmail.com" ]
axdsw121@gmail.com
f6460ffee3b08119f78adbd2b7a131a5d0f25b93
cc7ba0efcbff5fcf76be37b34c0c732e8c1b7492
/AndroidStudioProjects/GCMDemoApplication/app/src/test/java/com/example/admin1/gcmdemoapplication/ExampleUnitTest.java
7e9578241160fd7a76c2b89306cab79c8a4fede2
[]
no_license
SachinYedle/LectureReminderUpdated
1e4b698533e9f0211931985e45de37d816773d27
4cbbd1ea10a1329f2ec6c895956990aad0b7f82e
refs/heads/master
2021-01-11T08:03:23.558717
2016-10-27T13:49:33
2016-10-27T13:49:33
72,112,693
0
0
null
null
null
null
UTF-8
Java
false
false
415
java
package com.example.admin1.gcmdemoapplication; import org.junit.Test; import static org.junit.Assert.*; /** * Example local unit test, which will execute on the development machine (host). * * @see <a href="http://d.android.com/tools/testing">Testing documentation</a> */ public class ExampleUnitTest { @Test public void addition_isCorrect() throws Exception { assertEquals(4, 2 + 2); } }
[ "yedlesachin60@gmail.com" ]
yedlesachin60@gmail.com
beda486927ff8c1119e7b93fbced12f55d191838
f68e7dddd8ef362cc967c32be7e7a244cf66b96d
/test/src/main/java/businessFramework/module/hospital/pages/nurseDepart/NurseDepartHelper.java
f75801a1d89e42b12836a492338c88438b35f33a
[]
no_license
skygbr/N2O_IntellijIDEA_Tests_Regres_Smoke
6e3fbed09464c4cf0929bd7e630f9e6c1892161a
985e74067cc220eacf90c5c4876390d1494a1421
refs/heads/master
2020-06-28T16:46:42.012449
2016-11-23T12:57:43
2016-11-23T12:57:43
74,489,672
0
0
null
null
null
null
UTF-8
Java
false
false
1,701
java
package businessFramework.module.hospital.pages.nurseDepart; import businessFramework.module.Values; import net.framework.autotesting.ApplicationManager; import net.framework.autotesting.meta.*; import net.framework.autotesting.meta.components.*; public class NurseDepartHelper extends Page implements Values { public NurseDepartHelper(ApplicationManager app) { super(app); } public Container getContainerPatientList() { return getContainer("patientList"); } public Container getContainerBedList() { return getContainer("bedList"); } public Container getContainerHospitalRecordList() { return getContainer("hospitalRecordList"); } public Button getCreateBedResourceButton() { return getContainerBedList().getButton("create"); } public Button getUpdateBedResourceButton() { return getContainerBedList().getButton("update"); } public Button getDeleteBedResourceButton() { return getContainerBedList().getButton("delete"); } public Button getCreateHospitalRecordButton() { return getContainerHospitalRecordList().getButton("create"); } public Button getEditHospitalRecordButton() { return getContainerHospitalRecordList().getButton("update"); } public Button getDeleteHospitalButton() { return getContainerHospitalRecordList().getButton("delete"); } public Button getMedicalHistoryButton() { return getContainerPatientList().getButton("medicalHistory"); } public Button getDischargeButton() { return getContainerPatientList().getButton("discharge"); } }
[ "bulat.garipov@rtlabs.ru" ]
bulat.garipov@rtlabs.ru
041905736f942a41d4ae66fd8cb4d678b3b58d2f
ad3d871e360f198aebd51b2958526ee5de23e36c
/src/java/ch/laoe/operation/AOLoopable.java
b0919b02eeb59309e9a592ecb782a05ac25b21ff
[]
no_license
umjammer/vavi-apps-laoe
d115a03ed05ddcf0ea1ed940d34af8c03acff3b4
7ccee1c179073228b39a60b4f584f750b62877b3
refs/heads/master
2021-07-22T19:26:56.081636
2009-10-08T15:56:13
2009-10-08T15:56:13
109,250,690
1
0
null
null
null
null
ISO-8859-1
Java
false
false
2,667
java
/* * This file is part of LAoE. * * LAoE is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published * by the Free Software Foundation; either version 2 of the License, * or (at your option) any later version. * * LAoE is distributed in the hope that it will be useful, but * WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with LAoE; if not, write to the Free Software Foundation, * Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ package ch.laoe.operation; import ch.laoe.clip.AChannelSelection; /** * makes a selection loopable, different modes are possible: - * * @autor olivier gäumann, neuchâtel (switzerland) * @target JDK 1.3 * * @version 14.05.01 first draft oli4 * 21.06.01 add loopcount oli4 * 15.09.01 completely redefined oli4 */ public class AOLoopable extends AOperation { public AOLoopable(int order) { super(); this.order = order; } private int order; public void operate(AChannelSelection ch1) { float s1[] = ch1.getChannel().sample; int o1 = ch1.getOffset(); int l1 = ch1.getLength(); float tmp[] = new float[l1]; // mark changed channels... ch1.getChannel().changeId(); // copy center for (int i = 0; i < l1; i++) { tmp[i] = s1[i + o1]; } float oldRms = AOToolkit.rmsAverage(tmp, 0, tmp.length); // fade in left part AChannelSelection ch2 = new AChannelSelection(ch1.getChannel(), 0, o1); ch2.operateChannel(new AOFade(AOFade.IN, order, 0, false)); // fade out right part AChannelSelection ch3 = new AChannelSelection(ch1.getChannel(), o1 + l1, s1.length - o1 - l1); ch3.operateChannel(new AOFade(AOFade.OUT, order, 0, false)); // copy left part for (int i = 0; i < l1; i++) { if (o1 - l1 + i >= 0) { tmp[i] += s1[o1 - l1 + i]; } } // copy right part for (int i = 0; i < l1; i++) { if (o1 + l1 + i < s1.length) { tmp[i] += s1[o1 + l1 + i]; } } // RMS-calibration float newRms = AOToolkit.rmsAverage(tmp, 0, tmp.length); AOToolkit.multiply(tmp, 0, tmp.length, (oldRms / newRms)); // replace old samples with new samples ch1.getChannel().sample = tmp; } }
[ "umjammer@00cfdfb4-7834-11de-ac83-69fcb5c178b1" ]
umjammer@00cfdfb4-7834-11de-ac83-69fcb5c178b1
dec043a8e9c71672f46c34ba431966b21cc34232
504e7fbe35cd2dc9f9924312e84540018880de56
/code/app/src/main/java/cn/fizzo/hub/fitness/ui/widget/fizzo/FrameMainLayoutBind.java
683db91648011b17287c33a5640545cd74e40cb9
[]
no_license
RaulFan2019/FitnessHub
c16bcad794197b175a0a5b2fc611ddd1ddbbfc0e
41755b81a077d5db38e95697708cd4a790e5741c
refs/heads/master
2020-05-17T05:59:31.939185
2020-03-30T02:15:02
2020-03-30T02:15:02
183,548,074
0
1
null
null
null
null
UTF-8
Java
false
false
1,281
java
package cn.fizzo.hub.fitness.ui.widget.fizzo; import android.content.Context; import android.util.AttributeSet; import java.util.List; import cn.fizzo.hub.fitness.entity.model.MainMenuItemBindME; import cn.fizzo.hub.fitness.utils.DeviceU; /** * 主页面承载锻炼 * Created by Raul.fan on 2018/1/31 0031. * Mail:raul.fan@139.com * QQ: 35686324 */ public class FrameMainLayoutBind extends FrameMainLayout { private Context mContext; public FrameMainLayoutBind(Context context) { super(context); this.mContext = context; } public FrameMainLayoutBind(Context context, AttributeSet attrs) { super(context, attrs); this.mContext = context; } public void updateViews(final List<MainMenuItemBindME> listSport) { removeAllViews(); int margin = (int) DeviceU.dpToPixel(17); int increment = (int) DeviceU.dpToPixel(348); for (int i = 0; i < listSport.size(); i++) { MainMenuItemBind itemSport = new MainMenuItemBind(mContext); itemSport.updateView(listSport.get(i)); addView(itemSport); LayoutParams lp = (LayoutParams) itemSport.getLayoutParams(); lp.leftMargin = margin; margin += increment; } } }
[ "raul.fan@fizzo.cn" ]
raul.fan@fizzo.cn
1c476349ab7e320db2ea14a12fb813d1bd7ad4d8
c4f84fc0ba91fcdc65f63d47a2f00094ff4d5272
/app/src/main/java/com/example/sidda/movies/MoviesFragment.java
4c126584845961254c65828f50bb4bff40bf1afd
[]
no_license
siddav/Movies
9afd51d741a48a09cccf4d631dec8a6e35300d47
5dc1fb23e0ccf6afb665a23f10b1bde8f8040cfa
refs/heads/master
2021-01-10T03:17:35.548244
2016-04-07T11:12:01
2016-04-07T11:12:01
46,786,602
0
0
null
null
null
null
UTF-8
Java
false
false
9,481
java
package com.example.sidda.movies; import android.app.Activity; import android.content.SharedPreferences; import android.os.AsyncTask; import android.os.Bundle; import android.support.v4.app.Fragment; import android.preference.PreferenceManager; import android.support.v7.app.AppCompatActivity; import android.util.Log; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; import android.widget.AbsListView; import android.widget.AdapterView; import android.widget.GridView; import com.example.sidda.movies.adapters.MovieAdapter; import com.example.sidda.movies.constants.MovieConstants; import com.example.sidda.movies.model.DiscoverMovieResponse; import com.example.sidda.movies.model.Movie; import com.example.sidda.movies.network.MoviesService; import com.example.sidda.movies.network.MoviesServiceProvider; import java.util.List; import butterknife.Bind; import butterknife.ButterKnife; import retrofit.Call; import retrofit.Callback; import retrofit.Response; import retrofit.Retrofit; /** * A simple {@link Fragment} subclass. * Activities that contain this fragment must implement the * {@link MoviesFragment.OnMovieClickListener} interface * to handle interaction events. * Use the {@link MoviesFragment#newInstance} factory method to * create an instance of this fragment. */ public class MoviesFragment extends Fragment implements AbsListView.OnScrollListener { // TODO: Rename parameter arguments, choose names that match // the fragment initialization parameters, e.g. ARG_ITEM_NUMBER private static final String ARG_PARAM1 = "param1"; private static final String ARG_PARAM2 = "param2"; private static final String SAVE_QUERY = "query"; // by default popular movies private String query = MovieConstants.MOVIE_POPULAR; @Bind(R.id.gv_movies) GridView moviesGridView; MovieAdapter adapter = new MovieAdapter(); DiscoverMovieResponse moviesResult = new DiscoverMovieResponse(); volatile boolean isLoading = true; boolean userScrolled = false; @Override public void onSaveInstanceState(Bundle outState) { super.onSaveInstanceState(outState); outState.putString(SAVE_QUERY, query); } // TODO: Rename and change types of parameters private String mParam1; private String mParam2; private OnMovieClickListener mListener; /** * Use this factory method to create a new instance of * this fragment using the provided parameters. * * @param param1 Parameter 1. * @param param2 Parameter 2. * @return A new instance of fragment MoviesFragment. */ // TODO: Rename and change types and number of parameters public static MoviesFragment newInstance(String param1, String param2) { MoviesFragment fragment = new MoviesFragment(); Bundle args = new Bundle(); args.putString(ARG_PARAM1, param1); args.putString(ARG_PARAM2, param2); fragment.setArguments(args); return fragment; } public MoviesFragment() { // Required empty public constructor } @Override public void onActivityCreated(Bundle savedInstanceState) { super.onActivityCreated(savedInstanceState); if (savedInstanceState != null) { query = savedInstanceState.getString(SAVE_QUERY); } SharedPreferences preferences = PreferenceManager.getDefaultSharedPreferences(getActivity()); String prefQuery = preferences.getString(MovieConstants.PREF_QUERY, null); if (prefQuery != null) { query = prefQuery; } // call for page 1 new FetchMoviesTask(query).execute(1); } @Override public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { // Inflate the layout for this fragment View view = inflater.inflate(R.layout.fragment_movies, container, false); ButterKnife.bind(this, view); moviesGridView.setAdapter(adapter); moviesGridView.setOnScrollListener(this); moviesGridView.setOnItemClickListener(new AdapterView.OnItemClickListener() { @Override public void onItemClick(AdapterView<?> parent, View view, int position, long id) { // Toast t = Toast.makeText(getActivity(), "position " + position, Toast.LENGTH_SHORT); // t.show(); if (mListener != null) { mListener.onMovieClick(adapter.getItemId(position)); } } }); return view; } @Override public void onAttach(Activity activity) { super.onAttach(activity); try { mListener = (OnMovieClickListener) activity; } catch (ClassCastException e) { throw new ClassCastException(activity.toString() + " must implement OnMovieClickListener"); } } @Override public void onDetach() { super.onDetach(); mListener = null; } @Override public void onScrollStateChanged(AbsListView view, int scrollState) { if (scrollState == AbsListView.OnScrollListener.SCROLL_STATE_TOUCH_SCROLL){ userScrolled = true; } } @Override public void onScroll(AbsListView view, int firstVisibleItem, int visibleItemCount, int totalItemCount) { int currentPage = moviesResult.page; int totalPages = moviesResult.totalPages; if (userScrolled && firstVisibleItem + visibleItemCount == totalItemCount && currentPage < totalPages && !isLoading) { // Toast t = Toast.makeText(getActivity(), "task called for page " + (currentPage+1), Toast.LENGTH_SHORT); // t.show(); new FetchMoviesTask(query).execute(currentPage + 1); } } public void updateContent(String query) { this.query = query; adapter.clear(); // call for page 1 new FetchMoviesTask(query).execute(1); } public void updateAdapter(List<Movie> movies) { isLoading = false; if(movies != null) { adapter.addAllMovies(movies); // check in main activity whether to display default 0th position movie mListener.onMoviesLoaded(adapter.getItemId(0)); } if (query.equalsIgnoreCase(MovieConstants.MOVIE_TOP_RATED)) { ((AppCompatActivity)getActivity()).getSupportActionBar().setTitle(R.string.top_rated); } else { ((AppCompatActivity)getActivity()).getSupportActionBar().setTitle(R.string.popular); } } /** * This interface must be implemented by activities that contain this * fragment to allow an interaction in this fragment to be communicated * to the activity and potentially other fragments contained in that * activity. * <p/> * See the Android Training lesson <a href= * "http://developer.android.com/training/basics/fragments/communicating.html" * >Communicating with Other Fragments</a> for more information. */ public interface OnMovieClickListener { // TODO: Update argument type and name public void onMovieClick(long position); public void onMoviesLoaded(long defaultPosition); } private class FetchMoviesTask extends AsyncTask<Integer, Void, Void> { private final String LOG_TAG = FetchMoviesTask.class.getSimpleName(); private String query; FetchMoviesTask(String query) { this.query = query; } @Override protected Void doInBackground(Integer... params) { isLoading = true; String apiKey = MovieConstants.MOVIE_DB_API_KEY; if (apiKey.equalsIgnoreCase("replace this key")) { Log.e(LOG_TAG, "please replace api key in MovieConstants.MOVIE_DB_API_KEY in com.example.sidda.movies.constants.MovieConstants"); } // default page number // this is added to just let the reviewer to add his/her api key. int page = 1; if (params != null) { page = params[0]; } MoviesService moviesService = MoviesServiceProvider.getMoviesService(); Call<DiscoverMovieResponse> call = moviesService.discoverMovies(apiKey, query, page); call.enqueue(new Callback<DiscoverMovieResponse>() { @Override public void onResponse(Response<DiscoverMovieResponse> response, Retrofit retrofit) { Log.v(LOG_TAG, "inside response "+ query); if (response.isSuccess()) { moviesResult = response.body(); updateAdapter(moviesResult.results); } } @Override public void onFailure(Throwable t) { Log.e(LOG_TAG, t.getMessage()); } }); return null; } } private class TrailersTask extends AsyncTask<Integer, Void, Void> { @Override protected Void doInBackground(Integer... params) { return null; } } private class ReviewsTask extends AsyncTask<Integer, Void, Void> { @Override protected Void doInBackground(Integer... params) { return null; } } }
[ "vsidda@corp.untd.com" ]
vsidda@corp.untd.com
0c765ca21deb33a4fb669cab006bbd729b1e3c2e
618e98db053821614d25e7c4fbaefddbc3ad5e99
/ziguiw-schoolsite/app/models/SchoolXxyd.java
67c2e24cd774263c5400bb44a58e6c690134db99
[]
no_license
lizhou828/ziguiw
2a8d5a1c4310d83d4b456f3124ab49d90a242bad
76f2bedcf611dfecbf6119224c169ebcea915ad7
refs/heads/master
2022-12-23T04:13:06.645117
2014-10-08T07:42:57
2014-10-08T07:42:57
24,621,998
1
1
null
2022-12-14T20:59:50
2014-09-30T02:53:21
Python
UTF-8
Java
false
false
4,405
java
package models; import com.arj.ziguiw.common.Status; import play.db.jpa.JPASupport; import javax.persistence.*; import java.util.Date; import java.util.List; /** * Created with IntelliJ IDEA. * User: Administrator * Date: 13-3-1 * Time: 上午11:57 */ @Entity @Table(name = "s_school_xxyd") @Form(displayName = "学习园地") @SequenceGenerator(name = "s_school_xxyd_seq", sequenceName = "s_school_xxyd_seq", allocationSize = 1, initialValue = 100000) public class SchoolXxyd extends JPASupport{ @Id @GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "s_school_xxyd_seq") public Long id; @Column(name = "title", length = 255) @Field(displayName = "标题") public String title; @Column(name = "cause", length = 1000) @Field(displayName = "失败原因") public String cause; @ManyToOne(fetch = FetchType.EAGER) @JoinColumn(name = "school_id") @Field(displayName = "学校") public School school; @Column(name="type", columnDefinition = "number(2)", nullable = false) @Field(displayName = "类型") public Integer type; @Column(name = "create_time", nullable = false, columnDefinition = "DATE") @Field(displayName = "创建时间") public Date createTime = new Date(); @ManyToOne(fetch = FetchType.EAGER) @JoinColumn(name = "user_id") @Field(displayName = "用户") public UserBase user; @Column(name = "VISIT_COUNT") @Field(displayName = "查看次数") public Integer visitCount = 0; @ManyToOne(fetch = FetchType.EAGER) @JoinColumn(name = "class_id") @Field(displayName = "班级") public SchoolClazz clazz; @Column(name = "url", length = 1000) @Field(displayName = "图片") public String url; @Column(name = "video_url", length = 1000) @Field(displayName = "图片") public String videoUrl; @Lob @Basic(fetch= FetchType.EAGER, optional=true) @Column(name = "content") @Field(displayName = "内容") public String content; @Column(name = "status", nullable = false, columnDefinition = "number(2)") @Field(displayName = "状态") public int status = Status.UNVERIFIED; public static List<SchoolXxyd> findBySchoolId(long schoolId , int count){ return find("from SchoolXxyd where school.id = ? and status = ? order by createTime desc", schoolId,Status.OK).fetch(count); } public static List<SchoolXxyd> findUrl(Long schoolId , int count) { return find("from SchoolXxyd where school.id = ? and status = ? and url is not null order by createTime desc", schoolId,Status.OK).fetch(count); } public static Page<SchoolXxyd> findPage(Integer page , Integer pageSize ,Long schoolId,Integer type){ List<SchoolXxyd> list = find("from SchoolXxyd where school.id = ? and status = ? and type = ? order by createTime desc", schoolId,Status.OK,type).fetch(page,pageSize); long count = count("select count(*) from SchoolXxyd where school.id = ? and status = ? and type = ? order by createTime desc", schoolId,Status.OK,type); return new Page<SchoolXxyd>(page,pageSize,count,list); } public static List<SchoolXxyd> findByClassId(Long classId , Long schoolId , int count){ return find("from SchoolXxyd where school.id = ? and status = ? and clazz.id = ? order by createTime desc", schoolId,Status.OK,classId).fetch(count); } public static List<SchoolXxyd> findByClassUrl(Long classId,Long schoolId , int count) { return find("from SchoolXxyd where school.id = ? and status = ? and clazz.id = ? and url is not null order by createTime desc", schoolId,Status.OK,classId).fetch(count); } public static Page<SchoolXxyd> findPageByClassId(Long classId, Long schoolId, Integer type , Integer page , Integer pageSize) { List<SchoolXxyd> list = find("from SchoolXxyd where school.id = ? and status = ? and type = ? and clazz.id = ? order by createTime desc", schoolId,Status.OK,type,classId).fetch(page,pageSize); long count = count("select count(*) from SchoolXxyd where school.id = ? and status = ? and type = ? and clazz.id = ? order by createTime desc", schoolId,Status.OK,type,classId); return new Page<SchoolXxyd>(page,pageSize,count,list); } }
[ "lizhou828@126.com" ]
lizhou828@126.com
37a97cec15127c787cf9d0854295df5ddda82316
fa91450deb625cda070e82d5c31770be5ca1dec6
/Diff-Raw-Data/28/28_11a8d9f8fe9c55365b1cba731583bcd59c1a38f1/ParserUtils/28_11a8d9f8fe9c55365b1cba731583bcd59c1a38f1_ParserUtils_s.java
1bcb56d41b75b413b85b2689074848d89b2a73b8
[]
no_license
zhongxingyu/Seer
48e7e5197624d7afa94d23f849f8ea2075bcaec0
c11a3109fdfca9be337e509ecb2c085b60076213
refs/heads/master
2023-07-06T12:48:55.516692
2023-06-22T07:55:56
2023-06-22T07:55:56
259,613,157
6
2
null
2023-06-22T07:55:57
2020-04-28T11:07:49
null
UTF-8
Java
false
false
20,081
java
/* * Copyright 2010-2014 the original author or authors. * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see <http://www.gnu.org/licenses/>. */ package de.schildbach.pte.util; import java.io.BufferedInputStream; import java.io.IOException; import java.io.InputStream; import java.io.InputStreamReader; import java.io.OutputStream; import java.io.Reader; import java.io.UnsupportedEncodingException; import java.net.HttpURLConnection; import java.net.MalformedURLException; import java.net.URL; import java.net.URLDecoder; import java.net.URLEncoder; import java.nio.charset.Charset; import java.util.Calendar; import java.util.Date; import java.util.GregorianCalendar; import java.util.List; import java.util.Map; import java.util.regex.Matcher; import java.util.regex.Pattern; import java.util.zip.GZIPInputStream; import de.schildbach.pte.exception.BlockedException; import de.schildbach.pte.exception.InternalErrorException; import de.schildbach.pte.exception.NotFoundException; import de.schildbach.pte.exception.SessionExpiredException; import de.schildbach.pte.exception.UnexpectedRedirectException; /** * @author Andreas Schildbach */ public final class ParserUtils { private static final String SCRAPE_USER_AGENT = "Mozilla/5.0 (Windows NT 6.1; WOW64; rv:31.0) Gecko/20100101 Firefox/31.0"; private static final String SCRAPE_ACCEPT = "text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8"; public static final int SCRAPE_INITIAL_CAPACITY = 4096; private static final int SCRAPE_CONNECT_TIMEOUT = 5000; private static final int SCRAPE_READ_TIMEOUT = 15000; private static final Charset SCRAPE_DEFAULT_ENCODING = Charset.forName("ISO-8859-1"); private static String stateCookie; public static void resetState() { stateCookie = null; } public static final CharSequence scrape(final String url) throws IOException { return scrape(url, null, null, null); } public static final CharSequence scrape(final String url, final String postRequest, Charset encoding, final String sessionCookieName) throws IOException { return scrape(url, postRequest, encoding, sessionCookieName, 3); } public static final CharSequence scrape(final String urlStr, final String postRequest, Charset requestEncoding, final String sessionCookieName, int tries) throws IOException { if (requestEncoding == null) requestEncoding = SCRAPE_DEFAULT_ENCODING; final StringBuilder buffer = new StringBuilder(SCRAPE_INITIAL_CAPACITY); final InputStream is = scrapeInputStream(urlStr, postRequest, requestEncoding, null, sessionCookieName, tries); final Reader pageReader = new InputStreamReader(is, requestEncoding); copy(pageReader, buffer); pageReader.close(); return buffer; } public static final long copy(final Reader reader, final StringBuilder builder) throws IOException { final char[] buffer = new char[SCRAPE_INITIAL_CAPACITY]; long count = 0; int n = 0; while (-1 != (n = reader.read(buffer))) { builder.append(buffer, 0, n); count += n; } return count; } public static final InputStream scrapeInputStream(final String url) throws IOException { return scrapeInputStream(url, null, null, null, null, 3); } public static final InputStream scrapeInputStream(final String urlStr, final String postRequest, Charset requestEncoding, final String referer, final String sessionCookieName, int tries) throws IOException { if (requestEncoding == null) requestEncoding = SCRAPE_DEFAULT_ENCODING; while (true) { final URL url = new URL(urlStr); final HttpURLConnection connection = (HttpURLConnection) url.openConnection(); connection.setDoInput(true); connection.setDoOutput(postRequest != null); connection.setConnectTimeout(SCRAPE_CONNECT_TIMEOUT); connection.setReadTimeout(SCRAPE_READ_TIMEOUT); connection.addRequestProperty("User-Agent", SCRAPE_USER_AGENT); connection.addRequestProperty("Accept", SCRAPE_ACCEPT); connection.addRequestProperty("Accept-Encoding", "gzip"); // workaround to disable Vodafone compression connection.addRequestProperty("Cache-Control", "no-cache"); if (referer != null) connection.addRequestProperty("Referer", referer); if (sessionCookieName != null && stateCookie != null) connection.addRequestProperty("Cookie", stateCookie); if (postRequest != null) { final byte[] postRequestBytes = postRequest.getBytes(requestEncoding.name()); connection.setRequestMethod("POST"); connection.addRequestProperty("Content-Type", "application/x-www-form-urlencoded"); connection.addRequestProperty("Content-Length", Integer.toString(postRequestBytes.length)); final OutputStream os = connection.getOutputStream(); os.write(postRequestBytes); os.close(); } final int responseCode = connection.getResponseCode(); if (responseCode == HttpURLConnection.HTTP_OK) { final String contentType = connection.getContentType(); final String contentEncoding = connection.getContentEncoding(); InputStream is = new BufferedInputStream(connection.getInputStream()); if ("gzip".equalsIgnoreCase(contentEncoding) || "application/octet-stream".equalsIgnoreCase(contentType)) is = wrapGzip(is); if (!url.getHost().equals(connection.getURL().getHost())) throw new UnexpectedRedirectException(url, connection.getURL()); final String firstChars = peekFirstChars(is); final URL redirectUrl = testRedirect(url, firstChars); if (redirectUrl != null) throw new UnexpectedRedirectException(url, redirectUrl); if (testExpired(firstChars)) throw new SessionExpiredException(); if (sessionCookieName != null) { for (final Map.Entry<String, List<String>> entry : connection.getHeaderFields().entrySet()) { if ("set-cookie".equalsIgnoreCase(entry.getKey())) { for (final String value : entry.getValue()) { if (value.startsWith(sessionCookieName)) { stateCookie = value.split(";", 2)[0]; } } } } } return is; } else if (responseCode == HttpURLConnection.HTTP_BAD_REQUEST || responseCode == HttpURLConnection.HTTP_UNAUTHORIZED || responseCode == HttpURLConnection.HTTP_FORBIDDEN || responseCode == HttpURLConnection.HTTP_NOT_ACCEPTABLE || responseCode == HttpURLConnection.HTTP_UNAVAILABLE) { throw new BlockedException(url, new InputStreamReader(connection.getErrorStream(), requestEncoding)); } else if (responseCode == HttpURLConnection.HTTP_NOT_FOUND) { throw new NotFoundException(url, new InputStreamReader(connection.getErrorStream(), requestEncoding)); } else if (responseCode == HttpURLConnection.HTTP_MOVED_PERM || responseCode == HttpURLConnection.HTTP_MOVED_TEMP) { throw new UnexpectedRedirectException(url, connection.getURL()); } else if (responseCode == HttpURLConnection.HTTP_INTERNAL_ERROR) { throw new InternalErrorException(url, new InputStreamReader(connection.getErrorStream(), requestEncoding)); } else { final String message = "got response: " + responseCode + " " + connection.getResponseMessage(); if (tries-- > 0) System.out.println(message + ", retrying..."); else throw new IOException(message + ": " + url); } } } private static InputStream wrapGzip(final InputStream is) throws IOException { is.mark(2); final int byte0 = is.read(); final int byte1 = is.read(); is.reset(); // check for gzip header if (byte0 == 0x1f && byte1 == 0x8b) { final BufferedInputStream is2 = new BufferedInputStream(new GZIPInputStream(is)); is2.mark(2); final int byte0_2 = is2.read(); final int byte1_2 = is2.read(); is2.reset(); // check for gzip header again if (byte0_2 == 0x1f && byte1_2 == 0x8b) { // double gzipped return new BufferedInputStream(new GZIPInputStream(is2)); } else { // gzipped return is2; } } else { // uncompressed return is; } } private static final int PEEK_SIZE = 2048; public static String peekFirstChars(final InputStream is) throws IOException { is.mark(PEEK_SIZE); final byte[] firstBytes = new byte[PEEK_SIZE]; final int read = is.read(firstBytes); is.reset(); return new String(firstBytes, 0, read).replaceAll("\\p{C}", ""); } private static final Pattern P_REDIRECT_HTTP_EQUIV = Pattern.compile("<META\\s+http-equiv=\"?refresh\"?\\s+content=\"\\d+;\\s*URL=([^\"]+)\"", Pattern.CASE_INSENSITIVE); private static final Pattern P_REDIRECT_SCRIPT = Pattern.compile( "<script\\s+(?:type=\"text/javascript\"|language=\"javascript\")>\\s*(?:window.location|location.href)\\s*=\\s*\"([^\"]+)\"", Pattern.CASE_INSENSITIVE); public static URL testRedirect(final URL context, final String content) throws MalformedURLException { // check for redirect by http-equiv meta tag header final Matcher mHttpEquiv = P_REDIRECT_HTTP_EQUIV.matcher(content); if (mHttpEquiv.find()) return new URL(context, mHttpEquiv.group(1)); // check for redirect by window.location javascript final Matcher mScript = P_REDIRECT_SCRIPT.matcher(content); if (mScript.find()) return new URL(context, mScript.group(1)); return null; } private static final Pattern P_EXPIRED = Pattern .compile(">\\s*(Your session has expired\\.|Session Expired|Ihre Verbindungskennung ist nicht mehr g.ltig\\.)\\s*<"); public static boolean testExpired(final String content) { // check for expired session final Matcher mSessionExpired = P_EXPIRED.matcher(content); if (mSessionExpired.find()) return true; return false; } private static final Pattern P_HTML_UNORDERED_LIST = Pattern.compile("<ul>(.*?)</ul>", Pattern.DOTALL | Pattern.CASE_INSENSITIVE); private static final Pattern P_HTML_LIST_ITEM = Pattern.compile("<li>(.*?)</li>", Pattern.DOTALL | Pattern.CASE_INSENSITIVE); private static final Pattern P_HTML_BREAKS = Pattern.compile("(<br\\s*/>)+", Pattern.DOTALL | Pattern.CASE_INSENSITIVE); public static String formatHtml(final CharSequence html) { if (html == null) return null; // list item final StringBuilder builder = new StringBuilder(html.length()); final Matcher mListItem = P_HTML_LIST_ITEM.matcher(html); int pListItem = 0; while (mListItem.find()) { builder.append(html.subSequence(pListItem, mListItem.start())); builder.append("• "); builder.append(mListItem.group(1)); builder.append('\n'); pListItem = mListItem.end(); } builder.append(html.subSequence(pListItem, html.length())); final String html1 = builder.toString(); // unordered list builder.setLength(0); final Matcher mUnorderedList = P_HTML_UNORDERED_LIST.matcher(html1); int pUnorderedList = 0; while (mUnorderedList.find()) { builder.append(html1.subSequence(pUnorderedList, mUnorderedList.start())); builder.append('\n'); builder.append(mUnorderedList.group(1)); pUnorderedList = mUnorderedList.end(); } builder.append(html1.subSequence(pUnorderedList, html1.length())); final String html2 = builder.toString(); // breaks builder.setLength(0); final Matcher mBreaks = P_HTML_BREAKS.matcher(html2); int pBreaks = 0; while (mBreaks.find()) { builder.append(html2.subSequence(pBreaks, mBreaks.start())); builder.append(' '); pBreaks = mBreaks.end(); } builder.append(html2.subSequence(pBreaks, html2.length())); final String html3 = builder.toString(); return resolveEntities(html3); } private static final Pattern P_ENTITY = Pattern.compile("&(?:#(x[\\da-f]+|\\d+)|(amp|quot|apos|szlig|nbsp));"); public static String resolveEntities(final CharSequence str) { if (str == null) return null; final Matcher matcher = P_ENTITY.matcher(str); final StringBuilder builder = new StringBuilder(str.length()); int pos = 0; while (matcher.find()) { final char c; final String code = matcher.group(1); if (code != null) { if (code.charAt(0) == 'x') c = (char) Integer.valueOf(code.substring(1), 16).intValue(); else c = (char) Integer.parseInt(code); } else { final String namedEntity = matcher.group(2); if (namedEntity.equals("amp")) c = '&'; else if (namedEntity.equals("quot")) c = '"'; else if (namedEntity.equals("apos")) c = '\''; else if (namedEntity.equals("szlig")) c = '\u00df'; else if (namedEntity.equals("nbsp")) c = ' '; else throw new IllegalStateException("unknown entity: " + namedEntity); } builder.append(str.subSequence(pos, matcher.start())); builder.append(c); pos = matcher.end(); } builder.append(str.subSequence(pos, str.length())); return builder.toString(); } private static final Pattern P_ISO_DATE = Pattern.compile("(\\d{4})-?(\\d{2})-?(\\d{2})"); private static final Pattern P_ISO_DATE_REVERSE = Pattern.compile("(\\d{2})[-\\.](\\d{2})[-\\.](\\d{4})"); public static final void parseIsoDate(final Calendar calendar, final CharSequence str) { final Matcher mIso = P_ISO_DATE.matcher(str); if (mIso.matches()) { calendar.set(Calendar.YEAR, Integer.parseInt(mIso.group(1))); calendar.set(Calendar.MONTH, Integer.parseInt(mIso.group(2)) - 1); calendar.set(Calendar.DAY_OF_MONTH, Integer.parseInt(mIso.group(3))); return; } final Matcher mIsoReverse = P_ISO_DATE_REVERSE.matcher(str); if (mIsoReverse.matches()) { calendar.set(Calendar.YEAR, Integer.parseInt(mIsoReverse.group(3))); calendar.set(Calendar.MONTH, Integer.parseInt(mIsoReverse.group(2)) - 1); calendar.set(Calendar.DAY_OF_MONTH, Integer.parseInt(mIsoReverse.group(1))); return; } throw new RuntimeException("cannot parse: '" + str + "'"); } private static final Pattern P_ISO_TIME = Pattern.compile("(\\d{2})-?(\\d{2})"); public static final void parseIsoTime(final Calendar calendar, final CharSequence str) { final Matcher mIso = P_ISO_TIME.matcher(str); if (mIso.matches()) { calendar.set(Calendar.HOUR_OF_DAY, Integer.parseInt(mIso.group(1))); calendar.set(Calendar.MINUTE, Integer.parseInt(mIso.group(2))); return; } throw new RuntimeException("cannot parse: '" + str + "'"); } private static final Pattern P_GERMAN_DATE = Pattern.compile("(\\d{2})[\\./-](\\d{2})[\\./-](\\d{2,4})"); public static final void parseGermanDate(final Calendar calendar, final CharSequence str) { final Matcher m = P_GERMAN_DATE.matcher(str); if (!m.matches()) throw new RuntimeException("cannot parse: '" + str + "'"); calendar.set(Calendar.DAY_OF_MONTH, Integer.parseInt(m.group(1))); calendar.set(Calendar.MONTH, Integer.parseInt(m.group(2)) - 1); final int year = Integer.parseInt(m.group(3)); calendar.set(Calendar.YEAR, year >= 100 ? year : year + 2000); } private static final Pattern P_AMERICAN_DATE = Pattern.compile("(\\d{2})/(\\d{2})/(\\d{2,4})"); public static final void parseAmericanDate(final Calendar calendar, final CharSequence str) { final Matcher m = P_AMERICAN_DATE.matcher(str); if (!m.matches()) throw new RuntimeException("cannot parse: '" + str + "'"); calendar.set(Calendar.MONTH, Integer.parseInt(m.group(1)) - 1); calendar.set(Calendar.DAY_OF_MONTH, Integer.parseInt(m.group(2))); final int year = Integer.parseInt(m.group(3)); calendar.set(Calendar.YEAR, year >= 100 ? year : year + 2000); } private static final Pattern P_EUROPEAN_TIME = Pattern.compile("(\\d{1,2}):(\\d{2})(?::(\\d{2}))?"); public static final void parseEuropeanTime(final Calendar calendar, final CharSequence str) { final Matcher m = P_EUROPEAN_TIME.matcher(str); if (!m.matches()) throw new RuntimeException("cannot parse: '" + str + "'"); calendar.set(Calendar.HOUR_OF_DAY, Integer.parseInt(m.group(1))); calendar.set(Calendar.MINUTE, Integer.parseInt(m.group(2))); calendar.set(Calendar.SECOND, m.group(3) != null ? Integer.parseInt(m.group(3)) : 0); } private static final Pattern P_AMERICAN_TIME = Pattern.compile("(\\d{1,2}):(\\d{2})(?::(\\d{2}))? (AM|PM)"); public static final void parseAmericanTime(final Calendar calendar, final CharSequence str) { final Matcher m = P_AMERICAN_TIME.matcher(str); if (!m.matches()) throw new RuntimeException("cannot parse: '" + str + "'"); calendar.set(Calendar.HOUR, Integer.parseInt(m.group(1))); calendar.set(Calendar.MINUTE, Integer.parseInt(m.group(2))); calendar.set(Calendar.SECOND, m.group(3) != null ? Integer.parseInt(m.group(3)) : 0); calendar.set(Calendar.AM_PM, m.group(4).equals("AM") ? Calendar.AM : Calendar.PM); } public static long timeDiff(final Date d1, final Date d2) { final long t1 = d1.getTime(); final long t2 = d2.getTime(); return t1 - t2; } public static Date addDays(final Date time, final int days) { final Calendar c = new GregorianCalendar(); c.setTime(time); c.add(Calendar.DAY_OF_YEAR, days); return c.getTime(); } public static void printGroups(final Matcher m) { final int groupCount = m.groupCount(); for (int i = 1; i <= groupCount; i++) System.out.println("group " + i + ":" + (m.group(i) != null ? "'" + m.group(i) + "'" : "null")); } public static void printXml(final CharSequence xml) { final Matcher m = Pattern.compile("(<.{80}.*?>)\\s*").matcher(xml); while (m.find()) System.out.println(m.group(1)); } public static void printPlain(final CharSequence plain) { final Matcher m = Pattern.compile("(.{1,80})").matcher(plain); while (m.find()) System.out.println(m.group(1)); } public static void printFromReader(final Reader reader) throws IOException { while (true) { final int c = reader.read(); if (c == -1) return; System.out.print((char) c); } } public static String urlEncode(final String str) { try { return URLEncoder.encode(str, "utf-8"); } catch (final UnsupportedEncodingException x) { throw new RuntimeException(x); } } public static String urlEncode(final String str, final Charset encoding) { try { return URLEncoder.encode(str, encoding.name()); } catch (final UnsupportedEncodingException x) { throw new RuntimeException(x); } } public static String urlDecode(final String str, final Charset encoding) { try { return URLDecoder.decode(str, encoding.name()); } catch (final UnsupportedEncodingException x) { throw new RuntimeException(x); } } public static <T> T selectNotNull(final T... groups) { T selected = null; for (final T group : groups) { if (group != null) { if (selected == null) selected = group; else throw new IllegalStateException("ambiguous"); } } return selected; } public static String firstNotEmpty(final String... strings) { for (final String str : strings) if (str != null && str.length() > 0) return str; return null; } public static final String P_PLATFORM = "[\\wÄÖÜäöüßáàâéèêíìîóòôúùû\\. -/&#;]+?"; }
[ "yuzhongxing88@gmail.com" ]
yuzhongxing88@gmail.com
9830f0f10e553b9101c8168ee5fa744a677d0b5d
cd0bd4b251a98646f086f27687402a1c8042fdbc
/e2/src/vip/hht/Tools/JRedisUtil.java
c4fcb39a13e94e18e0688fbbbbf3c018bb45098c
[]
no_license
huanghetang/eclipse_workspace
4bd76d339ba1878a084f595bb0832e7987954db7
a89dc12d021ab55810e86016050829a0103adde1
refs/heads/master
2020-03-26T11:04:10.524462
2018-08-15T08:40:42
2018-08-15T08:40:42
144,826,607
0
0
null
null
null
null
GB18030
Java
false
false
2,385
java
package vip.hht.Tools; import java.io.IOException; import java.io.InputStream; import java.util.Properties; import redis.clients.jedis.Jedis; import redis.clients.jedis.JedisPool; import redis.clients.jedis.JedisPoolConfig; /** * Java for Redis Tool * @author zhoumo * */ public class JRedisUtil { private static Properties properties; private static JedisPool jedisPool = null; static{ InputStream is = JRedisUtil.class.getClassLoader().getResourceAsStream("env.properties"); // InputStream is = First.class.getResourceAsStream("/env.properties");//此方法'/'代表相对src的路径,不加代表相对包下面的路径,最终还是通过该classloader来找 properties = new Properties(); try { properties.load(is); is.close(); } catch (IOException e) { e.printStackTrace(); } } /** * 获取JedisPool连接池 * @return */ public static JedisPool getJedisPool() { if(jedisPool!=null){ return jedisPool; } JedisPoolConfig poolConfig = new JedisPoolConfig(); poolConfig.setMaxTotal(Integer.valueOf(properties.getProperty("jedis.maxTotle"))); poolConfig.setMinIdle(Integer.valueOf(properties.getProperty("jedis.minIdle"))); poolConfig.setMaxIdle(Integer.valueOf(properties.getProperty("jedis.maxIdle"))); JedisPool jedisPool = new JedisPool(poolConfig, properties.getProperty("jedis.url"), Integer.valueOf(properties.getProperty("jedis.port"))); return jedisPool; } /** * 向Redis中存String类型的值 * @param key * @param value * @param second */ public static void setString2Redis(String key,String value,int sceond){ JedisPool jedisPool = getJedisPool(); Jedis jedis = jedisPool.getResource(); jedis.set(key, value); jedis.expire(key, sceond);//设置过期时间 jedis.close(); } /** * 向Redis获取key * @param key * @param value */ public static String getString4Redis(String key){ JedisPool jedisPool = getJedisPool(); Jedis jedis = jedisPool.getResource(); //判断超时 Long ttl = jedis.ttl(key); if(ttl.intValue()==-2){//key超时 jedis.close(); return "-2"; } String value = jedis.get(key); jedis.close(); return value; } public static void main(String[] args) { JedisPool jedisPool = getJedisPool(); Jedis jedis = jedisPool.getResource(); String s = jedis.get("username"); jedisPool.close(); System.out.println(s); } }
[ "1278699240@qq.com" ]
1278699240@qq.com
1b066a521ceb5a05a73fbc07a6d04746ad0bcac1
6251ec8dd7f02c15174e897910f72aa37e9e3c51
/JavaSE/src/main/java/test/CalendarTest.java
d930272068c41c08928f279ce5a87fd458835c5d
[]
no_license
Wincher/JavaWorkout
ff55ecdf6d2867ed56ec2e1f95e7cf7d41aee068
81e80bfb4aec823ffe625cc98330d123ffd1e3d6
refs/heads/master
2023-06-28T07:07:38.727462
2023-03-18T06:57:55
2023-03-18T07:14:32
99,265,446
0
0
null
2023-06-14T22:46:52
2017-08-03T18:56:37
Java
UTF-8
Java
false
false
1,695
java
package test; import java.text.SimpleDateFormat; import java.util.Calendar; public class CalendarTest { public static void main(String[] args) { getTimeOfMillionsTime(1563879779-1563850979); Calendar now = Calendar.getInstance(); clearTime(now); System.out.println(new SimpleDateFormat("yyyy/MM/dd HH:mm:ss").format(now.getTime())); Calendar expire = Calendar.getInstance(); clearTime(expire); expire.add(Calendar.MONTH, -24); now.add(Calendar.MONTH, -24); System.out.println(new SimpleDateFormat("yyyy/MM/dd HH:mm:ss").format(expire.getTime())); System.out.println(new SimpleDateFormat("yyyy/MM/dd HH:mm:ss").format(now.getTime())); System.out.println(now.after(expire)); } private static void clearTime(Calendar calendar) { calendar.set(Calendar.HOUR_OF_DAY, 0); calendar.set(Calendar.MINUTE, 0); calendar.set(Calendar.SECOND, 0); calendar.set(Calendar.MILLISECOND, 0); } private static void getTimeOfMillionsTime(long timestamp) { Calendar calendar = Calendar.getInstance(); calendar.setTimeInMillis(timestamp); int year = calendar.get(Calendar.YEAR); int month = calendar.get(Calendar.MONTH); int day = calendar.get(Calendar.DAY_OF_MONTH); int hour = calendar.get(Calendar.HOUR_OF_DAY);//24小时制 // int hour = calendar.get(Calendar.HOUR);//12小时制 int minute = calendar.get(Calendar.MINUTE); int second = calendar.get(Calendar.SECOND); System.out.println(year + "年" + (month + 1) + "月" + day + "日" + hour + "时" + minute + "分" + second + "秒"); } }
[ "wincher.hoo@gmail.com" ]
wincher.hoo@gmail.com
2b5f979c8eb8166a94e7cefecbd132d4df672ee6
7559bead0c8a6ad16f016094ea821a62df31348a
/src/com/vmware/vim25/ReplicationDiskConfigFaultReasonForFault.java
f34325fa0b4163a106af97a966a5d550e175332e
[]
no_license
ZhaoxuepengS/VsphereTest
09ba2af6f0a02d673feb9579daf14e82b7317c36
59ddb972ce666534bf58d84322d8547ad3493b6e
refs/heads/master
2021-07-21T13:03:32.346381
2017-11-01T12:30:18
2017-11-01T12:30:18
109,128,993
1
1
null
null
null
null
UTF-8
Java
false
false
2,293
java
package com.vmware.vim25; import javax.xml.bind.annotation.XmlEnum; import javax.xml.bind.annotation.XmlEnumValue; import javax.xml.bind.annotation.XmlType; /** * <p>Java class for ReplicationDiskConfigFaultReasonForFault. * * <p>The following schema fragment specifies the expected content contained within this class. * <p> * <pre> * &lt;simpleType name="ReplicationDiskConfigFaultReasonForFault"> * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}string"> * &lt;enumeration value="diskNotFound"/> * &lt;enumeration value="diskTypeNotSupported"/> * &lt;enumeration value="invalidDiskKey"/> * &lt;enumeration value="invalidDiskReplicationId"/> * &lt;enumeration value="duplicateDiskReplicationId"/> * &lt;enumeration value="invalidPersistentFilePath"/> * &lt;enumeration value="reconfigureDiskReplicationIdNotAllowed"/> * &lt;/restriction> * &lt;/simpleType> * </pre> * */ @XmlType(name = "ReplicationDiskConfigFaultReasonForFault") @XmlEnum public enum ReplicationDiskConfigFaultReasonForFault { @XmlEnumValue("diskNotFound") DISK_NOT_FOUND("diskNotFound"), @XmlEnumValue("diskTypeNotSupported") DISK_TYPE_NOT_SUPPORTED("diskTypeNotSupported"), @XmlEnumValue("invalidDiskKey") INVALID_DISK_KEY("invalidDiskKey"), @XmlEnumValue("invalidDiskReplicationId") INVALID_DISK_REPLICATION_ID("invalidDiskReplicationId"), @XmlEnumValue("duplicateDiskReplicationId") DUPLICATE_DISK_REPLICATION_ID("duplicateDiskReplicationId"), @XmlEnumValue("invalidPersistentFilePath") INVALID_PERSISTENT_FILE_PATH("invalidPersistentFilePath"), @XmlEnumValue("reconfigureDiskReplicationIdNotAllowed") RECONFIGURE_DISK_REPLICATION_ID_NOT_ALLOWED("reconfigureDiskReplicationIdNotAllowed"); private final String value; ReplicationDiskConfigFaultReasonForFault(String v) { value = v; } public String value() { return value; } public static ReplicationDiskConfigFaultReasonForFault fromValue(String v) { for (ReplicationDiskConfigFaultReasonForFault c: ReplicationDiskConfigFaultReasonForFault.values()) { if (c.value.equals(v)) { return c; } } throw new IllegalArgumentException(v); } }
[ "495149700@qq.com" ]
495149700@qq.com
68efe0b52f2981e7a5a0b847b4dafc275a5c9ae7
5c1c760589a439dec41055b4cb1c13e126684182
/Webchat/src/de/bonobo_talk/SpringMVCTest/DAO/ChatroomDAO.java
204bdf01f9a7990c1a469a352622984f83f26cfd
[]
no_license
Flitzekatze/Webchat
998effb055ddcb70d92ac91957a41e868bb41715
0ee6d1371e10a5eff16f0df55de9802e21881d87
refs/heads/master
2016-08-12T23:09:31.864459
2016-02-24T09:20:12
2016-02-24T09:20:12
49,546,972
0
1
null
2016-02-24T09:20:13
2016-01-13T03:31:53
null
UTF-8
Java
false
false
625
java
package de.bonobo_talk.SpringMVCTest.DAO; import java.util.List; import de.bonobo_talk.SpringMVCTest.model.Chatroom; import de.bonobo_talk.SpringMVCTest.model.User; public interface ChatroomDAO { public void saveOrUpdateChatroom(Chatroom chatroom); public void createNewChatroom(String chatroomName); public void deleteChatroom(Chatroom chatroom); public Chatroom getChatroom(int chatroomId); public List<Chatroom> getChatroomByName(String chatroomName); public List<Chatroom> getAllChatrooms(); public void joinChatroom(Integer chatroomId, User user); public void leaveChatroom(Integer chatroomId, User user); }
[ "desperado20w@hotmail.de" ]
desperado20w@hotmail.de
ae0a9ce6045d5a5cd84868b1e9b7dfb3cd44b172
8a8254c83cc2ec2c401f9820f78892cf5ff41384
/instrumented-nappa-greedy/AntennaPod/core/src/main/java/nappagreedy/de/danoeh/antennapod/core/receiver/MediaButtonReceiver.java
dd6002647f15496165a64ebb733cea22dafd5d88
[ "MIT" ]
permissive
VU-Thesis-2019-2020-Wesley-Shann/subjects
46884bc6f0f9621be2ab3c4b05629e3f6d3364a0
14a6d6bb9740232e99e7c20f0ba4ddde3e54ad88
refs/heads/master
2022-12-03T05:52:23.309727
2020-08-19T12:18:54
2020-08-19T12:18:54
261,718,101
0
0
null
2020-07-11T12:19:07
2020-05-06T09:54:05
Java
UTF-8
Java
false
false
1,573
java
package nappagreedy.de.danoeh.antennapod.core.receiver; import android.content.BroadcastReceiver; import android.content.Context; import android.content.Intent; import androidx.core.content.ContextCompat; import android.util.Log; import android.view.KeyEvent; import nappagreedy.de.danoeh.antennapod.core.ClientConfig; import nappagreedy.de.danoeh.antennapod.core.service.playback.PlaybackService; /** Receives media button events. */ public class MediaButtonReceiver extends BroadcastReceiver { private static final String TAG = "MediaButtonReceiver"; public static final String EXTRA_KEYCODE = "nappagreedy.de.danoeh.antennapod.core.service.extra.MediaButtonReceiver.KEYCODE"; public static final String EXTRA_SOURCE = "nappagreedy.de.danoeh.antennapod.core.service.extra.MediaButtonReceiver.SOURCE"; public static final String NOTIFY_BUTTON_RECEIVER = "nappagreedy.de.danoeh.antennapod.NOTIFY_BUTTON_RECEIVER"; @Override public void onReceive(Context context, Intent intent) { Log.d(TAG, "Received intent"); if (intent == null || intent.getExtras() == null) { return; } KeyEvent event = (KeyEvent) intent.getExtras().get(Intent.EXTRA_KEY_EVENT); if (event != null && event.getAction() == KeyEvent.ACTION_DOWN && event.getRepeatCount()==0) { ClientConfig.initialize(context); Intent serviceIntent = new Intent(context, PlaybackService.class); serviceIntent.putExtra(EXTRA_KEYCODE, event.getKeyCode()); serviceIntent.putExtra(EXTRA_SOURCE, event.getSource()); ContextCompat.startForegroundService(context, serviceIntent); } } }
[ "sshann95@outlook.com" ]
sshann95@outlook.com
91eb80531d8e3ebf47e70b1d3c3197fe1032f6e1
b2016b74acf02c0117128b505baac48338d825c9
/sophia.mmorpg/src/main/java/sophia/mmorpg/stat/StatOnlineTickerImpl.java
5c4590f26b477ffad5a6f959a85db2dbe19dbaa1
[]
no_license
atom-chen/server
979830e60778a3fba1740ea3afb2e38937e84cea
c44e12a3efe5435d55590c9c0fd9e26cec58ed65
refs/heads/master
2020-06-17T02:54:13.348191
2017-10-13T18:40:21
2017-10-13T18:40:21
195,772,502
0
1
null
2019-07-08T08:46:37
2019-07-08T08:46:37
null
UTF-8
Java
false
false
3,387
java
/** * Copyright 2013-2015 Sophia * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package sophia.mmorpg.stat; import java.util.ArrayList; import java.util.List; import java.util.concurrent.atomic.AtomicInteger; import sophia.mmorpg.player.PlayerManager; import sophia.mmorpg.player.persistence.PlayerDAO; public class StatOnlineTickerImpl extends sophia.stat.StatOnlineTicker { private AtomicInteger connectedNum = new AtomicInteger(0); private List<String> connectedIps = new ArrayList<String>(); private AtomicInteger loggedNum = new AtomicInteger(0); private List<String> loggedUids = new ArrayList<String>(); private AtomicInteger enteredNum = new AtomicInteger(0); private List<String> enteredUids = new ArrayList<String>(); private int last_players =-1; private int totalNum = 0; @Override public void selectTotalNum() { setTotalNum(PlayerDAO.getInstance().getSelectPlayerTotal()); } @Override public int getTotalNum() { return totalNum; } @Override public void addTotalNum(int addNum) { totalNum += addNum; } @Override public void setTotalNum(int totalNum) { this.totalNum = totalNum; } @Override public int getOnlineNum() { return PlayerManager.getOnlineTotalCount(); } @Override public int getTotalIncNum() { if(last_players == -1){ return 0; } return getTotalNum() - last_players; } @Override public int getConnectedNum() { return connectedNum.get(); } @Override public int getConnectedIpNum() { synchronized (connectedIps) { return connectedIps.size(); } } @Override public int getLoggedNum() { return loggedNum.get(); } @Override public int getLoggedUidNum() { synchronized (loggedUids) { return loggedUids.size(); } } @Override public int getEnteredNum() { return enteredNum.get(); } @Override public int getEnteredUidNum() { synchronized (enteredUids) { return enteredUids.size(); } } @Override public void onTickSave() { last_players = getTotalNum(); connectedNum.set(0); loggedNum.set(0); enteredNum.set(0); synchronized (connectedIps) { connectedIps.clear(); } synchronized (loggedUids) { loggedUids.clear(); } synchronized (enteredUids) { enteredUids.clear(); } } @Override public void onConnected(String ip) { connectedNum.addAndGet(1); synchronized (connectedIps) { if (!connectedIps.contains(ip)) connectedIps.add(ip); } } @Override public void onLogged(String identityId) { if (identityId == null) identityId = ""; loggedNum.addAndGet(1); synchronized (loggedUids) { if (!loggedUids.contains(identityId)) loggedUids.add(identityId); } } @Override public void onEntered(String identityId) { enteredNum.addAndGet(1); synchronized (enteredUids) { if (!enteredUids.contains(identityId)) enteredUids.add(identityId); } } }
[ "hi@luanhailiang.cn" ]
hi@luanhailiang.cn
0b1b211630c41f5ebe90f750df25ed59dd05bae6
1ea016056ea15f3ccebeec2ddf435d46222680ce
/ORAAirlineParticipantType.java
7ea37e135af31ef0484ff5e541865bfc0c4f66ee
[]
no_license
rgaete/ndc
c56f061d94cc80ced5ed2c502d5594b7d1837e3b
6cf5b7c19dd1c605e53d09496ae65f7b2b529e34
refs/heads/master
2020-12-30T10:49:21.388487
2017-07-31T06:53:21
2017-07-31T06:53:21
98,857,641
1
0
null
null
null
null
UTF-8
Java
false
false
1,834
java
package ndc; import java.math.BigInteger; import javax.xml.bind.annotation.XmlAccessType; import javax.xml.bind.annotation.XmlAccessorType; import javax.xml.bind.annotation.XmlAttribute; import javax.xml.bind.annotation.XmlSchemaType; import javax.xml.bind.annotation.XmlType; /** * A data type for ORA (Offer Originating Airline) Participant Role. Derived from AirlineMsgPartyCoreType. * * <p>Java class for ORA_AirlineParticipantType complex type. * * <p>The following schema fragment specifies the expected content contained within this class. * * <pre> * &lt;complexType name="ORA_AirlineParticipantType"> * &lt;complexContent> * &lt;extension base="{http://www.iata.org/IATA/EDIST/2017.1}AirlineMsgPartyCoreType"> * &lt;attribute name="SequenceNumber" use="required" type="{http://www.w3.org/2001/XMLSchema}positiveInteger" /> * &lt;/extension> * &lt;/complexContent> * &lt;/complexType> * </pre> * * */ @XmlAccessorType(XmlAccessType.FIELD) @XmlType(name = "ORA_AirlineParticipantType", namespace = "http://www.iata.org/IATA/EDIST/2017.1") public class ORAAirlineParticipantType extends AirlineMsgPartyCoreType { @XmlAttribute(name = "SequenceNumber", required = true) @XmlSchemaType(name = "positiveInteger") protected BigInteger sequenceNumber; /** * Gets the value of the sequenceNumber property. * * @return * possible object is * {@link BigInteger } * */ public BigInteger getSequenceNumber() { return sequenceNumber; } /** * Sets the value of the sequenceNumber property. * * @param value * allowed object is * {@link BigInteger } * */ public void setSequenceNumber(BigInteger value) { this.sequenceNumber = value; } }
[ "ricardo.gaete@lan.com" ]
ricardo.gaete@lan.com
c4c3a7d9f47a970df17a23cd47c3276442d9ff78
8e04b94a9e329d056f75c4102b8f15c73874a50c
/src/main/java/com/xu/soufang/service/house/IQiNiuService.java
53727afa202e7d60386deabc8649e77c94009098
[]
no_license
qingbuyaozaishuohehe/soufang-project
0520ad13487ff6c22035f1744f5a9c9133db6ac8
0e43502e304ebaaa6fb2f42a9bb8d75f0d871a86
refs/heads/master
2020-04-29T02:27:22.189850
2019-04-04T09:25:10
2019-04-04T09:25:10
175,768,049
2
0
null
null
null
null
UTF-8
Java
false
false
454
java
package com.xu.soufang.service.house; import com.qiniu.common.QiniuException; import com.qiniu.http.Response; import java.io.File; import java.io.InputStream; /** * 七牛云服务 * * @author xuzhenqin * @date 2019/3/1 */ public interface IQiNiuService { Response uploadFile(File file)throws QiniuException; Response uploadFile(InputStream inputStream) throws QiniuException; Response delete(String key)throws QiniuException; }
[ "itxuzhenqin@163.com" ]
itxuzhenqin@163.com
5324f9c549fd4c99a6f865fae431c8507f030a1c
c6f4809451a958fc9b93bfde17f75d9113211323
/ecps-parent/ecps-core/src/main/java/com/xincon/ecps/model/EbFeature.java
7bab633a58a40c6a7bd63dc43e24ee620ab641f2
[]
no_license
standupzjy/git-test
e43e25692e43bc394d21355c8b9cc81235f8fd27
a5470bdbb20048fc339410e5cc4b24c64dc260b8
refs/heads/master
2022-12-24T12:26:32.944553
2019-11-17T11:13:21
2019-11-17T11:15:40
222,237,987
0
0
null
2022-12-15T23:58:45
2019-11-17T11:32:16
Java
UTF-8
Java
false
false
1,727
java
package com.xincon.ecps.model; public class EbFeature { private Long featureId; private Long catId; private String featureName; private Short isSpec; private Short isSelect; private Short isShow; private String selectValues; private Short inputType; private Integer featureSort; public Long getFeatureId() { return featureId; } public void setFeatureId(Long featureId) { this.featureId = featureId; } public Long getCatId() { return catId; } public void setCatId(Long catId) { this.catId = catId; } public String getFeatureName() { return featureName; } public void setFeatureName(String featureName) { this.featureName = featureName; } public Short getIsSpec() { return isSpec; } public void setIsSpec(Short isSpec) { this.isSpec = isSpec; } public Short getIsSelect() { return isSelect; } public void setIsSelect(Short isSelect) { this.isSelect = isSelect; } public Short getIsShow() { return isShow; } public void setIsShow(Short isShow) { this.isShow = isShow; } public String getSelectValues() { return selectValues; } public void setSelectValues(String selectValues) { this.selectValues = selectValues; } public Short getInputType() { return inputType; } public void setInputType(Short inputType) { this.inputType = inputType; } public Integer getFeatureSort() { return featureSort; } public void setFeatureSort(Integer featureSort) { this.featureSort = featureSort; } }
[ "zjy@xincon.net" ]
zjy@xincon.net
bab28fc9454b52319e86e610e4d68e8e4d574eda
0e68aef7d1d924f4d7ec74b784b1af869ac1ae38
/sbb-business/src/main/java/com/pleshchenko/sbb/app/entity/authorization/Role.java
7f44478085cd886c39d405d779af3cc9a0265892
[]
no_license
RomanPleshchenko/sbb
f1b708b9d220bb77a6f718e7df70f14c4e106302
d8c03ec1949ebdbc7747bef02571cab9c50c8a50
refs/heads/master
2021-01-18T19:45:18.650296
2017-05-29T12:18:55
2017-05-29T12:18:55
86,911,741
0
0
null
null
null
null
UTF-8
Java
false
false
1,116
java
package com.pleshchenko.sbb.app.entity.authorization; import javax.persistence.*; import java.io.Serializable; /** * Created by РОМАН on 19.04.2017. */ @Entity @Table(name="Role") public class Role implements Serializable { @Id @GeneratedValue(strategy= GenerationType.IDENTITY) private Integer id; @Column(name="type", length=15, unique=true, nullable=false) private String type = RoleType.USER.getRoleType(); public Integer getId() { return id; } public void setId(Integer id) { this.id = id; } public String getType() { return type; } public void setType(String type) { this.type = type; } @Override public boolean equals(Object o) { if (this == o) return true; if (o == null || getClass() != o.getClass()) return false; Role role = (Role) o; return id.equals(role.id); } @Override public int hashCode() { return id.hashCode(); } @Override public String toString() { return "Role [id=" + id + ", type=" + type + "]"; } }
[ "89313481052@mail.ru" ]
89313481052@mail.ru
86b111f6fc2a9696436b4db8785b39c2b7b395c9
4ef431684e518b07288e8b8bdebbcfbe35f364e4
/platform/test-core/src/main/java/com/ca/apm/tests/cdv/CDVOneClusterOneTomcatTests.java
7ecce3081801442bd83905f947935037be66573d
[]
no_license
Sarojkswain/APMAutomation
a37c59aade283b079284cb0a8d3cbbf79f3480e3
15659ce9a0030c2e9e5b992040e05311fff713be
refs/heads/master
2020-03-30T00:43:23.925740
2018-09-27T23:42:04
2018-09-27T23:42:04
150,540,177
0
0
null
null
null
null
UTF-8
Java
false
false
27,186
java
/* * Copyright (c) 2014 CA. All rights reserved. * * This software and all information contained therein is confidential and * proprietary and shall not be duplicated, used, disclosed or disseminated in * any way except as authorized by the applicable license agreement, without * the express written permission of CA. All authorized reproductions must be * marked with this language. * * EXCEPT AS SET FORTH IN THE APPLICABLE LICENSE AGREEMENT, TO THE EXTENT * PERMITTED BY APPLICABLE LAW, CA PROVIDES THIS SOFTWARE WITHOUT WARRANTY OF * ANY KIND, INCLUDING WITHOUT LIMITATION, ANY IMPLIED WARRANTIES OF * MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT WILL CA BE * LIABLE TO THE END USER OR ANY THIRD PARTY FOR ANY LOSS OR DAMAGE, DIRECT OR * INDIRECT, FROM THE USE OF THIS SOFTWARE, INCLUDING WITHOUT LIMITATION, LOST * PROFITS, BUSINESS INTERRUPTION, GOODWILL, OR LOST DATA, EVEN IF CA IS * EXPRESSLY ADVISED OF SUCH LOSS OR DAMAGE. * * Author : KETSW01 */ package com.ca.apm.tests.cdv; import java.io.File; import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Map; import junit.framework.Assert; import org.codehaus.plexus.util.Os; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.testng.annotations.Test; import com.ca.apm.automation.action.flow.em.DeployEMFlowContext; import com.ca.apm.commons.coda.common.ApmbaseConstants; import com.ca.apm.commons.coda.common.Util; import com.ca.apm.commons.coda.common.XMLUtil; import com.ca.apm.commons.common.CLWCommons; import com.ca.apm.commons.common.TestUtils; import com.ca.apm.tests.base.CDVOneClusterOneTomcatTestsBase; import com.ca.apm.tests.testbed.CDVOneClusterOneTomcatLinuxTestbed; import com.ca.tas.envproperty.EnvironmentPropertyContext; import com.ca.tas.tests.annotations.Tas; import com.ca.tas.tests.annotations.TestBed; import com.ca.tas.type.SizeType; import static com.ca.apm.tests.cdv.CDVConstants.*; public class CDVOneClusterOneTomcatTests extends CDVOneClusterOneTomcatTestsBase { private static final Logger LOGGER = LoggerFactory.getLogger(CDVOneClusterOneTomcatTests.class); private TestUtils utility = new TestUtils(); private CLWCommons clwCommons = new CLWCommons(); private String[] installLogMsgs = {"0 Warnings","0 NonFatalErrors","0 FatalErrors" }; @Test(groups = {"FULL"}, enabled = true) public void verify_ALM_454128_DE139261_DifferentialAnalysis_stops_working_when_CDV_connects_to_Collectors(){ testCaseId = "454128"; testCaseName = "ALM_" + testCaseId + "_Verify_DE139261_DifferentialAnalysis_stops_working_when_CDV_connects_to_Collectors"; try{ String metricExpression = "Variance\\|Default\\|Differential Analysis Control\\|Frontends(.*):Average Response Time \\(ms\\) Variance Intensity"; startTestBed(); harvestWait(60); // Hitting Frontends of Tomcat LOGGER.info("Hitting url for frontends: http://" + agentHost + ":" + agentPort); utility.connectToURL("http://" + agentHost + ":" + agentPort, 2); harvestWait(60); String actualMetricValue1 = clw.getLatestMetricValue(user, password, tomcatAgentExpression, metricExpression, cdvHost, cdvPort, cdvLibDir); LOGGER.info("Variance Average Response Time metric value: " + actualMetricValue1); Assert.assertFalse(actualMetricValue1.contains("-1")); stopCDV(); harvestWait(180); moveFile(cdvConfigDir + "modules/DefaultMM.jar", cdvConfigDir + "modules/DefaultMM.jar.orig", CDV_MACHINE_ID); startCDV(); // Hitting Frontends of Tomcat LOGGER.info("Hitting url for frontends: http://" + agentHost + ":" + agentPort); utility.connectToURL("http://" + agentHost + ":" + agentPort, 2); harvestWait(60); String actualMetricValue2 = clw.getLatestMetricValue(user, password, tomcatAgentExpression, metricExpression, cdvHost, cdvPort, cdvLibDir); LOGGER.info("Variance Average Response Time metric value: " + actualMetricValue2); Assert.assertTrue(actualMetricValue2.contains("-1")); moveFile(cdvConfigDir + "modules/DefaultMM.jar.orig", cdvConfigDir + "modules/DefaultMM.jar", CDV_MACHINE_ID); } finally{ stopTestBed(); revertConfigAndRenameLogsWithTestId(testCaseId); testCaseEnd(testCaseName); } } @Test(groups = {"SMOKE"}, enabled = true) public void verify_ALM_269784_InstallMoMChangeToCDV(){ testCaseId = "269784"; testCaseName = "ALM_" + testCaseId + "_Install_MoM_ChangeTo_CDV"; rolesInvolved.add(MOM_ROLE_ID); rolesInvolved.add(TOMCAT_ROLE_ID); try{ testCaseStart(testCaseName); replaceMoMProperty("introscope.enterprisemanager.clustering.mode=MOM", "introscope.enterprisemanager.clustering.mode=CDV"); startMoM(); startAgent(); checkLogForNoMsg(envProperties, AGENT_MACHINE_ID, tomcatAgentLogFile, "Connected Controllable Agent"); } finally{ stopMoM(); stopAgent(); revertConfigAndRenameLogsWithTestId(testCaseId, rolesInvolved); rolesInvolved.clear(); testCaseEnd(testCaseName); } } @Test(groups = {"BAT"}, enabled = true) public void verify_ALM_275492_EMModePropNoValue(){ testCaseId = "275492"; testCaseName = "ALM_" + testCaseId + "_Verify_EM_Mode_Property_No_Value"; rolesInvolved.add(CDV_ROLE_ID); try{ testCaseStart(testCaseName); replaceCDVProperty("introscope.enterprisemanager.clustering.mode=CDV", "introscope.enterprisemanager.clustering.mode="); boolean isWindows = Os.isFamily(Os.FAMILY_WINDOWS); String emExecutable = isWindows ? "Introscope_Enterprise_Manager.exe" : "./Introscope_Enterprise_Manager"; String[] commands = {emExecutable}; String logMsg = "Invalid value set for property introscope.enterprisemanager.clustering.mode"; List<String> compareStrings = new ArrayList<String>(); compareStrings.add(logMsg); boolean emStartMsgCheck = Util.validateCommandOutput(commands, cdvInstallDir, compareStrings); Assert.assertEquals(true, emStartMsgCheck); } catch (Exception e) { e.printStackTrace(); } finally{ stopCDV(); revertConfigAndRenameLogsWithTestId(testCaseId, rolesInvolved); rolesInvolved.clear(); testCaseEnd(testCaseName); } } @Test(groups = {"BAT"}, enabled = true) public void verify_ALM_275493_EMModePropWrongValue(){ testCaseId = "275493"; testCaseName = "ALM_" + testCaseId + "_Verify_EM_Mode_Property_Wrong_Value"; rolesInvolved.add(CDV_ROLE_ID); try{ testCaseStart(testCaseName); replaceCDVProperty("introscope.enterprisemanager.clustering.mode=CDV", "introscope.enterprisemanager.clustering.mode=WRONG"); boolean isWindows = Os.isFamily(Os.FAMILY_WINDOWS); String emExecutable = isWindows ? "Introscope_Enterprise_Manager.exe" : "./Introscope_Enterprise_Manager"; String[] commands = {emExecutable}; String dirLoc = envProperties.getRolePropertyById(CDV_ROLE_ID, DeployEMFlowContext.ENV_EM_INSTALL_DIR); String logMsg = "Invalid value WRONG set for property introscope.enterprisemanager.clustering.mode"; List<String> compareStrings = new ArrayList<String>(); compareStrings.add(logMsg); boolean emStartMsgCheck = Util.validateCommandOutput(commands, dirLoc, compareStrings); Assert.assertEquals(true, emStartMsgCheck); } catch (Exception e) { e.printStackTrace(); } finally{ stopCDV(); revertConfigAndRenameLogsWithTestId(testCaseId, rolesInvolved); rolesInvolved.clear(); testCaseEnd(testCaseName); } } @Test(groups = {"BAT"}, enabled = true) public void verify_ALM_275488_ChangeEMModeofCDV(){ testCaseId = "275488"; testCaseName = "ALM_" + testCaseId + "_Verify_EM_Mode_Change_CDV"; rolesInvolved.add(CDV_ROLE_ID); try{ testCaseStart(testCaseName); replaceCDVProperty("introscope.enterprisemanager.clustering.mode=CDV", "introscope.enterprisemanager.clustering.mode=MOM"); startStopCDV(); replaceCDVProperty("introscope.enterprisemanager.clustering.mode=MOM", "introscope.enterprisemanager.clustering.mode=Collector"); startStopCDV(); replaceCDVProperty("introscope.enterprisemanager.clustering.mode=Collector", "introscope.enterprisemanager.clustering.mode=Standalone"); startStopCDV(); } finally{ stopCDV(); revertConfigAndRenameLogsWithTestId(testCaseId, rolesInvolved); rolesInvolved.clear(); testCaseEnd(testCaseName); } } @Test(groups = {"SMOKE"}, enabled = true) public void verify_ALM_275489_ChangeEMModeofMOM(){ testCaseId = "275489"; testCaseName = "ALM_" + testCaseId + "_Verify_EM_Mode_Change_MoM"; rolesInvolved.add(MOM_ROLE_ID); try{ testCaseStart(testCaseName); replaceMoMProperty("introscope.enterprisemanager.clustering.mode=MOM", "introscope.enterprisemanager.clustering.mode=CDV"); startStopMoM(); replaceMoMProperty("introscope.enterprisemanager.clustering.mode=CDV", "introscope.enterprisemanager.clustering.mode=Collector"); startStopMoM(); replaceMoMProperty("introscope.enterprisemanager.clustering.mode=Collector", "introscope.enterprisemanager.clustering.mode=Standalone"); startStopMoM(); } finally{ stopMoM(); revertConfigAndRenameLogsWithTestId(testCaseId, rolesInvolved); rolesInvolved.clear(); testCaseEnd(testCaseName); } } @Test(groups = {"DEEP"}, enabled = true) public void verify_ALM_275490_ChangeEMModeofCollector(){ testCaseId = "275490"; testCaseName = "ALM_" + testCaseId + "_Verify_EM_Mode_Change_Collector"; rolesInvolved.add(COLLECTOR1_ROLE_ID); try{ testCaseStart(testCaseName); replaceCollector1Property("introscope.enterprisemanager.clustering.mode=Collector", "introscope.enterprisemanager.clustering.mode=CDV"); startStopCollector(); replaceCollector1Property("introscope.enterprisemanager.clustering.mode=CDV", "introscope.enterprisemanager.clustering.mode=MOM"); startStopCollector(); replaceCollector1Property("introscope.enterprisemanager.clustering.mode=MOM", "introscope.enterprisemanager.clustering.mode=Standalone"); startStopCollector(); } finally{ stopCollector(); revertConfigAndRenameLogsWithTestId(testCaseId, rolesInvolved); rolesInvolved.clear(); testCaseEnd(testCaseName); } } @Test(groups = {"DEEP"}, enabled = true) public void verify_ALM_268357_Cluster_CDV_SameVersion(){ testCaseId = "268357"; testCaseName = "ALM_" + testCaseId + "_Verify_Cluster_CDV_SameVersionr"; try{ testCaseStart(testCaseName); startTestBed(); waitForAgentNodes(tomcatAgentExpression, cdvHost, cdvPort, cdvLibDir); } finally{ stopTestBed(); revertConfigAndRenameLogsWithTestId(testCaseId); testCaseEnd(testCaseName); } } @Test(groups = {"DEEP"}, enabled = true) public void verify_ALM_268360_MetricCount_Collector_CDV(){ testCaseId = "268360"; testCaseName = "ALM_" + testCaseId + "_Verify_MetricCount_of_Collector_and_at_CDV"; rolesInvolved.add(CDV_ROLE_ID); rolesInvolved.add(MOM_ROLE_ID); rolesInvolved.add(COLLECTOR1_ROLE_ID); try{ testCaseStart(testCaseName); String coll1AgentExp = "(.*)\\|Custom Metric Process \\(Virtual\\)\\|Custom Metric Agent \\(Virtual\\) \\(" + collector1Host + "@" + collector1Port +"\\)"; String numberofMetricExp = "Enterprise Manager\\|Connections:Number of Metrics"; startEMServices(); harvestWait(60); String coll1MetricCountCDV = clwCommons.getLatestMetricValue(user, password, coll1AgentExp, numberofMetricExp, cdvHost, cdvPort, cdvLibDir); String coll1MetricCountLocal = clwCommons.getLatestMetricValue(user, password, coll1AgentExp, numberofMetricExp, collector1Host, Integer.parseInt(collector1Port), cdvLibDir); Assert.assertEquals(coll1MetricCountCDV, coll1MetricCountLocal); } finally{ stopEMServices(); revertConfigAndRenameLogsWithTestId(testCaseId, rolesInvolved); rolesInvolved.clear(); testCaseEnd(testCaseName); } } @Test(groups = {"DEEP"}, enabled = true) public void verify_ALM_269793_Enable_all_MM_CDV(){ testCaseId = "269793"; testCaseName = "ALM_" + testCaseId + "_Verify_enabling_all_MM_on_CDV"; rolesInvolved.add(CDV_ROLE_ID); try{ testCaseStart(testCaseName); Assert.assertTrue(apmbaseutil.enableAllMMonEM(cdvInstallDir)); startCDV(); checkCDVLogForNoMsg("[ERROR]"); } finally{ stopCDV(); revertConfigAndRenameLogsWithTestId(testCaseId, rolesInvolved); rolesInvolved.clear(); testCaseEnd(testCaseName); } } @Test(groups = {"DEEP"}, enabled = true) public void verify_ALM_268374_verify_CDV_connecting_StandaloneEM(){ testCaseId = "268374"; testCaseName = "ALM_" + testCaseId + "_Verify_CDV_connecting_StandaloneEM"; rolesInvolved.add(COLLECTOR1_ROLE_ID); rolesInvolved.add(CDV_ROLE_ID); try{ testCaseStart(testCaseName); replaceCollector1Property("introscope.enterprisemanager.clustering.mode=Collector", "introscope.enterprisemanager.clustering.mode=Standalone"); startCollector(); startCDV(); String logMsg = "Failed to connect to the Introscope Enterprise Manager at " + collector1Host + "@" + collector1Port + " (1) " + "because: " + "com.wily.introscope.server.enterprise.entity.cluster.NotCollectorException: " + "The Enterprise Manager is not running in a Collector role."; checkCDVLogForMsg(logMsg); } finally{ stopCollector(); stopCDV(); revertConfigAndRenameLogsWithTestId(testCaseId, rolesInvolved); rolesInvolved.clear(); testCaseEnd(testCaseName); } } @Test(groups = {"DEEP"}, enabled = true) public void verify_ALM_270879_Agent_Connection_CDV(){ testCaseId = "270879"; testCaseName = "ALM_" + testCaseId + "_Agent_Connection_CDV"; rolesInvolved.add(CDV_ROLE_ID); rolesInvolved.add(TOMCAT_ROLE_ID); try{ testCaseStart(testCaseName); replaceTomcatAgentProperty("agentManager.url.1=" + momHost + ":" + momPort, "agentManager.url.1=" + cdvHost + ":" + cdvPort); startCDV(); startAgent(); checkTomcatAgentLogForMsg("Failed to connect to the Introscope Enterprise Manager at " + cdvHost + ":" + cdvPort); checkCDVLogForMsg("The agent is trying to connect to CDV . The agent connection to " + "CDV is forbidden."); } finally{ stopCDV(); stopAgent(); revertConfigAndRenameLogsWithTestId(testCaseId, rolesInvolved); rolesInvolved.clear(); testCaseEnd(testCaseName); } } @Test(groups = {"DEEP"}, enabled = true) public void verify_ALM_276547_CDV_Supportablity_Metrics_Collector(){ testCaseId = "276547"; testCaseName = "ALM_" + testCaseId + "_Verify_CDV_Supportablity_Metrics_Collector"; rolesInvolved.add(CDV_ROLE_ID); rolesInvolved.add(COLLECTOR1_ROLE_ID); try{ testCaseStart(testCaseName); String coll1AgentExp = "(.*)\\|Custom Metric Process \\(Virtual\\)\\|Custom Metric Agent \\(Virtual\\) \\(" + collector1Host + "@" + collector1Port +"\\)"; String metricCDVClamped = "Enterprise Manager\\|Connections:Cross\\-Cluster Data Viewer Clamped"; String metricNumberofCDV = "Enterprise Manager\\|Connections:Number of Cross\\-Cluster Data Viewers"; startCollector(); startCDV(); harvestWait(60); String cdvClamped = clwCommons.getLatestMetricValue(user, password, coll1AgentExp, metricCDVClamped, cdvHost, cdvPort, cdvLibDir); String numberofCDV = clwCommons.getLatestMetricValue(user, password, coll1AgentExp, metricNumberofCDV, collector1Host, Integer.parseInt(collector1Port), cdvLibDir); LOGGER.info("CDV Clampled metric value is " + cdvClamped); LOGGER.info("Number of CDV Connected to Collector metric value is " + numberofCDV); Assert.assertEquals("CDV clampled metric value is wrong", "Integer:::0", cdvClamped); Assert.assertEquals("Number of CDV connected metric value is wrong", "Integer:::1", numberofCDV); } finally{ stopEMServices(); revertConfigAndRenameLogsWithTestId(testCaseId, rolesInvolved); rolesInvolved.clear(); testCaseEnd(testCaseName); } } @Test(groups = {"SMOKE"}, enabled = true) public void verify_ALM_276544_Calculators_CDV(){ testCaseId = "276544"; testCaseName = "ALM_" + testCaseId + "_Verify_Calculators_CDV"; String cdvCalculatorfile = cdvInstallDir + "/scripts/HeapUsedPercentageUpdated.js"; try{ testCaseStart(testCaseName); String gcHeapUsedPercentageMetric = "GC Heap:Heap Used \\(%\\)"; String exampleCalculatorfile = cdvInstallDir + "/examples/scripts/HeapUsedPercentage.js"; String updatedCalculatorfile = cdvInstallDir + "/examples/scripts/HeapUsedPercentageUpdated.js"; //Start Testbed anc check for agent startTestBed(); waitForAgentNodes(tomcatAgentExpression, cdvHost, cdvPort, cdvLibDir); //Create a calculator script in cdv copyFile(exampleCalculatorfile, updatedCalculatorfile, CDV_MACHINE_ID); replaceProp("return false", "return true", CDV_MACHINE_ID, updatedCalculatorfile); copyFile(updatedCalculatorfile, cdvCalculatorfile, CDV_MACHINE_ID); checkColl1LogForMsg("Successfully added script " + collector1InstallDir + "/./scripts/HeapUsedPercentageUpdated.js"); harvestWait(20); String gcHeapUsedPercentageMetricValue = clwCommons.getLatestMetricValue(user, password, tomcatAgentExpression, gcHeapUsedPercentageMetric, cdvHost, cdvPort, cdvLibDir); LOGGER.info("Calculated metric value is " + gcHeapUsedPercentageMetricValue); Assert.assertFalse("Calculated metric does not exist", gcHeapUsedPercentageMetricValue.toString().equalsIgnoreCase("-1")); } catch (Exception e) { e.printStackTrace(); } finally{ stopTestBed(); revertConfigAndRenameLogsWithTestId(testCaseId); deleteFile(cdvCalculatorfile, CDV_MACHINE_ID); testCaseEnd(testCaseName); } } @Test(groups = {"DEEP"}, enabled = true) public void verify_ALM_275499_Enable_LoadBalancer_CDV(){ testCaseId = "275499"; testCaseName = "ALM_" + testCaseId + "_Enable_LoadBalancer_CDV"; rolesInvolved.add(CDV_ROLE_ID); try{ testCaseStart(testCaseName); List<String> newProp = new ArrayList<String>(); newProp.add("introscope.enterprisemanager.loadbalancer.enable=true"); appendProp(newProp , CDV_MACHINE_ID, cdvConfigFile); startCDV(); checkCDVLogForNoMsg("[Manager.LoadBalancer] Loaded loadbalancing.xml"); } finally{ stopCDV(); revertConfigAndRenameLogsWithTestId(testCaseId, rolesInvolved); rolesInvolved.clear(); testCaseEnd(testCaseName); } } @Test(groups = {"SMOKE"}, enabled = true) public void verify_ALM_275486_CDV_Install_SilentMode(){ testCaseId = "275486"; testCaseName = "ALM_" + testCaseId + "_CDV_Install_SilentMode"; try{ testCaseStart(testCaseName); checkMessagesInSequence(envProperties, CDV_MACHINE_ID, cdvInstallLogFile, installLogMsgs); } catch (Exception e) { e.printStackTrace(); } finally{ testCaseEnd(testCaseName); } } @Test(groups = {"DEEP"}, enabled = true) public void verify_ALM_271286_Collector_Install_SilentMode(){ testCaseId = "271286"; testCaseName = "ALM_" + testCaseId + "_Collector_Install_SilentMode"; try{ testCaseStart(testCaseName); checkMessagesInSequence(envProperties, EM_MACHINE_ID, collector1InstallLogFile, installLogMsgs); } catch (Exception e) { e.printStackTrace(); } finally{ testCaseEnd(testCaseName); } } @Test(groups = {"FULL"}, enabled = true) public void verify_ALM_271285_MoM_Install_SilentMode(){ testCaseId = "271285"; testCaseName = "ALM_" + testCaseId + "_MoM_Install_SilentMode"; try{ testCaseStart(testCaseName); checkMessagesInSequence(envProperties, EM_MACHINE_ID, momInstallLogFile, installLogMsgs); } catch (Exception e) { e.printStackTrace(); } finally{ testCaseEnd(testCaseName); } } @Test(groups = {"DEEP"}, enabled = true) public void verify_ALM_269796_different_domains_Cluster(){ testCaseId = "269796"; testCaseName = "ALM_" + testCaseId + "_Verify_different_domains_Cluster"; rolesInvolved.add(MOM_ROLE_ID); rolesInvolved.add(COLLECTOR1_ROLE_ID); rolesInvolved.add(TOMCAT_ROLE_ID); try{ testCaseStart(testCaseName); //Create a domain on Collector1 String domainName = "Test"; String agentMapping = "(.*)"; createCustomDomainCollector1(domainName, agentMapping); //Start Cluster and Agent startCluster(); startAgent(); // harvestWait(60); checkColl1LogForMsg("Connected to Agent " + '"' + "SuperDomain/" + domainName); harvestWait(20); //Query the metric String agentExpression = "/*SuperDomain/*/|(.*)"; String metricExpression = "EM Host"; String getMetric = clw.getMetricValueForTimeInMinutes(user, password, agentExpression, metricExpression, collector1Host, Integer.parseInt(collector1Port), cdvLibDir, 1).toString(); Assert.assertTrue( "Tomcat Agent not mapped to Test Domain", getMetric.contains("SuperDomain/" + domainName + "," + tomcatHost + ",Tomcat,Tomcat Agent")); } finally{ stopCluster(); stopAgent(); revertConfigAndRenameLogsWithTestId(testCaseId, rolesInvolved); rolesInvolved.clear(); testCaseEnd(testCaseName); } } @Test(groups = {"FULL"}, enabled = true) public void verify_ALM_275505_MoM_CDV_Different_Domains(){ testCaseId = "275505"; testCaseName = "ALM_" + testCaseId + "_Verify_MoM_CDV_Different_Domains"; rolesInvolved.add(MOM_ROLE_ID); rolesInvolved.add(CDV_ROLE_ID); try{ testCaseStart(testCaseName); //Create a domain on MoM String momDomainName = "Test"; String agentMapping = "(.*)"; createCustomDomainMoM(momDomainName, agentMapping); //Create a domain in CDV String cdvDomainName = "Test1"; createCustomDomainCDV(cdvDomainName, agentMapping); enableMoMDebugLog(); enableCDVDebugLog(); startCDV(); startMoM(); //Verify logs for Domains checkMoMLogForMsg("Creating domain SuperDomain/" + momDomainName); checkCDVLogForMsg("Creating domain SuperDomain/" + cdvDomainName); } finally{ stopCDV(); stopMoM(); revertConfigAndRenameLogsWithTestId(testCaseId, rolesInvolved); rolesInvolved.clear(); testCaseEnd(testCaseName); } } @Test(groups = {"SMOKE"}, enabled = true) public void verify_ALM_275495_Multiple_Hosts_Same_Collector(){ testCaseId = "275495"; testCaseName = "ALM_" + testCaseId + "_Verify_Multiple_Hosts_Same_Collector"; rolesInvolved.add(COLLECTOR1_ROLE_ID); rolesInvolved.add(CDV_ROLE_ID); try{ testCaseStart(testCaseName); //Adding duplicate collector entry in cdv List<String> dupCollProp = new ArrayList<String>(); dupCollProp.add("introscope.enterprisemanager.clustering.login.em2.host=" + collector1Host); dupCollProp.add("introscope.enterprisemanager.clustering.login.em2.port=" + collector1Port); dupCollProp.add("introscope.enterprisemanager.clustering.login.em2.publickey=config/internal/server/EM.public"); appendProp(dupCollProp , CDV_MACHINE_ID, cdvConfigFile); //Start Coll and CDV and check for log msg startCollector(); startCDV(); checkCDVLogForMsg("Ignoring duplicate collector " + collector1Host + "@" + collector1Port); //Check Collector metrics String coll1AgentExp = "(.*)\\|Custom Metric Process \\(Virtual\\)\\|Custom Metric Agent \\(Virtual\\) \\(" + collector1Host + "@" + collector1Port +"\\)"; String metricNumberofCDV = "Enterprise Manager\\|Connections:Number of Cross\\-Cluster Data Viewers"; String numberofCDV = clwCommons.getLatestMetricValue(user, password, coll1AgentExp, metricNumberofCDV, collector1Host, Integer.parseInt(collector1Port), cdvLibDir); LOGGER.info("Number of CDV Connected to Collector metric value is " + numberofCDV); Assert.assertEquals("Number of CDV connected metric value is wrong", "Integer:::1", numberofCDV); } finally{ stopCollector(); stopCDV(); revertConfigAndRenameLogsWithTestId(testCaseId, rolesInvolved); rolesInvolved.clear(); testCaseEnd(testCaseName); } } @Test(groups = {"SMOKE"}, enabled = true) public void verify_ALM_268355_Old_Properties_Removed(){ testCaseId = "268355"; testCaseName = "ALM_" + testCaseId + "_Verify_Old_Properties_Removed"; try{ testCaseStart(testCaseName); int foundProperty = Util.checkMessage("introscope.enterprisemanager.clustering.collector.enable", new File(cdvConfigFile)); Assert.assertEquals("Old properties exists in the file", 0, foundProperty); foundProperty = Util.checkMessage("introscope.enterprisemanager.clustering.manager.enable", new File(cdvConfigFile)); Assert.assertEquals("Old properties exists in the file", 0, foundProperty); } catch (InterruptedException e) { e.printStackTrace(); } finally{ testCaseEnd(testCaseName); } } @Test(groups = {"SMOKE"}, enabled = true) public void verify_ALM_270881_Connections_CDV(){ testCaseId = "270881"; testCaseName = "ALM_" + testCaseId + "_Verify_Connections_CDV"; rolesInvolved.add(COLLECTOR1_ROLE_ID); rolesInvolved.add(CDV_ROLE_ID); try{ testCaseStart(testCaseName); startCollector(); startCDV(); //Restart Collector multiple time restartCollector(); restartCollector(); restartCollector(); checkCDVLogForNoMsg("[ERROR]"); checkColl1LogForNoMsg("[ERROR]"); } finally{ stopCollector(); stopCDV(); revertConfigAndRenameLogsWithTestId(testCaseId, rolesInvolved); rolesInvolved.clear(); testCaseEnd(testCaseName); } } }
[ "sarojkswain@gmail.com" ]
sarojkswain@gmail.com
04dc62380c0b4d61181b5d3484fcb559876ea1a9
580d4cbe5644612effee344e9a47a64ac72f5823
/flextag-features/src/test/java/de/unidue/ltl/flextag/features/IsAllCapitalizedTest.java
0aa56887689c315e64d78ac2c32d2096db449804
[ "Apache-2.0" ]
permissive
sufengvuclip/FlexTag
fea90aec752c3b2324d9dba4b2fe74b9ccfddf8f
516c8834db46acc19be29d12e38aba510476a4eb
refs/heads/master
2020-06-16T20:26:32.289903
2016-11-10T15:02:54
2016-11-10T15:02:54
null
0
0
null
null
null
null
UTF-8
Java
false
false
3,027
java
/******************************************************************************* * Copyright 2016 * Language Technology Lab * University of Duisburg-Essen * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. ******************************************************************************/ package de.unidue.ltl.flextag.features; import static org.junit.Assert.assertEquals; import java.util.ArrayList; import java.util.List; import org.apache.uima.UIMAException; import org.apache.uima.fit.factory.JCasFactory; import org.apache.uima.jcas.JCas; import org.dkpro.tc.api.features.Feature; import org.dkpro.tc.api.features.TcFeatureFactory; import org.dkpro.tc.api.features.util.FeatureUtil; import org.dkpro.tc.api.type.TextClassificationTarget; import org.junit.Before; import org.junit.Test; public class IsAllCapitalizedTest { JCas jcas; TextClassificationTarget tokOne; TextClassificationTarget tokTwo; @Before public void setUp() throws UIMAException { JCas jcas = JCasFactory.createJCas(); jcas.setDocumentLanguage("en"); jcas.setDocumentText("Hi PETER"); tokOne = new TextClassificationTarget(jcas, 0, 2); tokOne.addToIndexes(); tokTwo = new TextClassificationTarget(jcas, 3, 8); tokTwo.addToIndexes(); } @Test public void testFirstToken() throws Exception { IsAllCapitalized featureExtractor = FeatureUtil.createResource(TcFeatureFactory.create(IsAllCapitalized.class)); List<Feature> features = new ArrayList<Feature>(featureExtractor.extract(jcas, tokOne)); assertEquals(1, features.size()); String featureName = features.get(0).getName(); Object featureValue = features.get(0).getValue(); assertEquals(IsAllCapitalized.FEATURE_NAME, featureName); assertEquals(0, featureValue); } @Test public void testSecondToken() throws Exception { IsAllCapitalized featureExtractor = FeatureUtil.createResource(TcFeatureFactory.create(IsAllCapitalized.class)); List<Feature> features = new ArrayList<Feature>(featureExtractor.extract(jcas, tokTwo)); assertEquals(1, features.size()); String featureName = features.get(0).getName(); Object featureValue = features.get(0).getValue(); assertEquals(IsAllCapitalized.FEATURE_NAME, featureName); assertEquals(1, featureValue); } }
[ "tobias.horsmann@gmail.com" ]
tobias.horsmann@gmail.com
c7b613224a221a1879999be218542a0342d95f38
a2c6ea16b60a6e7daa3bfcebe6bb68463833c1fe
/src/old/RotOfPalindrome.java
37f0ee60e1c49f33e9bf26438c0b922799f70b46
[]
no_license
madhu4a3/JPractice
37ddda58fd0f11e52552505d68b19c0472ec686f
e2b73c7230f2d5ddf719b66f372c4363415e331e
refs/heads/master
2021-01-10T07:49:37.113564
2016-08-25T05:56:34
2016-08-25T05:56:34
50,577,311
0
0
null
null
null
null
UTF-8
Java
false
false
944
java
package old; public class RotOfPalindrome { public static boolean isPalindrome(String s) { boolean flag = true; for (int i=0,j=s.length()-1;i < j; i++, j--) { if (s.charAt(i) != s.charAt(j)) flag = false; } return flag; } public static void main(String[] args) { // TODO Auto-generated method stub System.out.println(isRotationOfPalindrome("aaaadc")); } public static boolean isRotationOfPalindrome(String sr) { // StringBuilder sb = new StringBuilder(); if (isPalindrome(sr)) return true; int n = sr.length(); for (int i = 0; i < n - 1; i++) { String str1 = sr.substring(i + 1, n - i - 1); System.out.printf("Values of i+1: %d, n-i-1: %d\n", i+1, n-i-1); String str2 = sr.substring(0, i + 1); System.out.printf("String1: %s, String2: %s\n", str1, str2); // Check if this rotation is palindrome if (isPalindrome(str1 + str2)) return true; } return false; } }
[ "sanka.madhukiran@gmail.com" ]
sanka.madhukiran@gmail.com
016ae0ebdc51b61bd7efc0205879a7fc279de09d
508c5bb320304ccc23962bd0f72a0656469506ab
/Bluefruit_LE_Connect_Android-master(2)/app/src/main/java/com/adafruit/bluefruit/le/connect/ble/BleManager.java
f6da141059353b189b62924b95374eb23c8ea5ef
[ "MIT" ]
permissive
harrykwon97/TitanicWithArduino
88baccd3130009302fe118eac1f9f5d3628fb406
48c72b2679746d4ff6d41697fff0983fe93fdbac
refs/heads/master
2023-04-03T11:32:16.565745
2021-02-14T12:23:21
2021-02-14T12:23:21
null
0
0
null
null
null
null
UTF-8
Java
false
false
16,817
java
// Original source code: https://github.com/StevenRudenko/BleSensorTag. MIT License (Steven Rudenko) package com.adafruit.bluefruit.le.connect.ble; import android.bluetooth.BluetoothAdapter; import android.bluetooth.BluetoothDevice; import android.bluetooth.BluetoothGatt; import android.bluetooth.BluetoothGattCharacteristic; import android.bluetooth.BluetoothGattDescriptor; import android.bluetooth.BluetoothGattService; import android.bluetooth.BluetoothProfile; import android.content.Context; import android.content.SharedPreferences; import android.preference.PreferenceManager; import android.util.Log; import java.lang.reflect.Method; import java.util.List; import java.util.UUID; public class BleManager implements BleGattExecutor.BleExecutorListener { // Log private final static String TAG = BleManager.class.getSimpleName(); // Enumerations private static final int STATE_DISCONNECTED = 0; private static final int STATE_CONNECTING = 1; private static final int STATE_CONNECTED = 2; // Singleton private static BleManager mInstance = null; // Data private final BleGattExecutor mExecutor = BleGattExecutor.createExecutor(this); private BluetoothAdapter mAdapter; private BluetoothGatt mGatt; // private Context mContext; private BluetoothDevice mDevice; private String mDeviceAddress; private int mConnectionState = STATE_DISCONNECTED; private BleManagerListener mBleListener; public static BleManager getInstance(Context context) { if(mInstance == null) { mInstance = new BleManager(context); } return mInstance; } public int getState() { return mConnectionState; } public BluetoothDevice getConnectedDevice() {return mDevice;} public String getConnectedDeviceAddress() { return mDeviceAddress; } public void setBleListener(BleManagerListener listener) { mBleListener = listener; } public BleManager(Context context) { // Init Adapter //mContext = context.getApplicationContext(); if (mAdapter == null) { mAdapter = BleUtils.getBluetoothAdapter(context); } if (mAdapter == null || !mAdapter.isEnabled()) { Log.e(TAG, "Unable to obtain a BluetoothAdapter."); } } /** * Connects to the GATT server hosted on the Bluetooth LE device. * * @param address The device address of the destination device. * @return Return true if the connection is initiated successfully. The connection result is reported asynchronously through the {@code BluetoothGattCallback#onConnectionStateChange(android.bluetooth.BluetoothGatt, int, int)} callback. */ public boolean connect(Context context, String address) { if (mAdapter == null || address == null) { Log.w(TAG, "connect: BluetoothAdapter not initialized or unspecified address."); return false; } // Get preferences SharedPreferences sharedPreferences = PreferenceManager.getDefaultSharedPreferences(context); final boolean reuseExistingConnection = sharedPreferences.getBoolean("pref_recycleconnection", false); if (reuseExistingConnection) { // Previously connected device. Try to reconnect. if (mDeviceAddress != null && address.equalsIgnoreCase(mDeviceAddress) && mGatt != null) { Log.d(TAG, "Trying to use an existing BluetoothGatt for connection."); if (mGatt.connect()) { mConnectionState = STATE_CONNECTING; if (mBleListener != null) mBleListener.onConnecting(); return true; } else { return false; } } } else { final boolean forceCloseBeforeNewConnection = sharedPreferences.getBoolean("pref_forcecloseconnection", true); if (forceCloseBeforeNewConnection) { close(); } } mDevice = mAdapter.getRemoteDevice(address); if (mDevice == null) { Log.w(TAG, "Device not found. Unable to connect."); return false; } /* // Refresh device cache final boolean refreshDeviceCache = sharedPreferences.getBoolean("pref_refreshdevicecache", true); if (refreshDeviceCache) { refreshDeviceCache(); // hack to force refresh the device cache and avoid problems with characteristic services read from cache and not updated } */ Log.d(TAG, "Trying to create a new connection."); mDeviceAddress = address; mConnectionState = STATE_CONNECTING; if (mBleListener != null) { mBleListener.onConnecting(); } final boolean gattAutoconnect = sharedPreferences.getBoolean("pref_gattautoconnect", false); mGatt = mDevice.connectGatt(context, gattAutoconnect, mExecutor); return true; } public void clearExecutor() { if (mExecutor != null) { mExecutor.clear(); } } /** * Call to private Android method 'refresh' * This method does actually clear the cache from a bluetooth device. But the problem is that we don't have access to it. But in java we have reflection, so we can access this method. * http://stackoverflow.com/questions/22596951/how-to-programmatically-force-bluetooth-low-energy-service-discovery-on-android */ public boolean refreshDeviceCache(){ try { BluetoothGatt localBluetoothGatt = mGatt; Method localMethod = localBluetoothGatt.getClass().getMethod("refresh"); if (localMethod != null) { boolean result = (Boolean) localMethod.invoke(localBluetoothGatt); if (result) { Log.d(TAG, "Bluetooth refresh cache"); } return result; } } catch (Exception localException) { Log.e(TAG, "An exception occurred while refreshing device"); } return false; } /** * Disconnects an existing connection or cancel a pending connection. The disconnection result * is reported asynchronously through the {@code BluetoothGattCallback#onConnectionStateChange(android.bluetooth.BluetoothGatt, int, int)} callback. */ public void disconnect() { mDevice = null; if (mAdapter == null || mGatt == null) { Log.w(TAG, "disconnect: BluetoothAdapter not initialized"); return; } /* // Refresh device cache before disconnect SharedPreferences sharedPreferences = PreferenceManager.getDefaultSharedPreferences(mContext); final boolean refreshDeviceCache = sharedPreferences.getBoolean("pref_refreshdevicecache", true); if (refreshDeviceCache) { refreshDeviceCache(); // hack to force refresh the device cache and avoid problems with characteristic services read from cache and not updated } */ // Disconnect mGatt.disconnect(); } /** * After using a given BLE device, the app must call this method to ensure resources are released properly. */ private void close() { if (mGatt != null) { mGatt.close(); mGatt = null; mDeviceAddress = null; mDevice = null; } } public boolean readRssi() { if (mGatt != null) { return mGatt.readRemoteRssi(); // if true: Caller should wait for onReadRssi callback } else { return false; // Rsii read is not available } } public void readCharacteristic(BluetoothGattService service, String characteristicUUID) { readService(service, characteristicUUID, null); } public void readDescriptor(BluetoothGattService service, String characteristicUUID, String descriptorUUID) { readService(service, characteristicUUID, descriptorUUID); } private void readService(BluetoothGattService service, String characteristicUUID, String descriptorUUID) { if (service != null) { if (mAdapter == null || mGatt == null) { Log.w(TAG, "readService: BluetoothAdapter not initialized"); return; } mExecutor.read(service, characteristicUUID, descriptorUUID); mExecutor.execute(mGatt); } } public void writeService(BluetoothGattService service, String uuid, byte[] value) { if (service != null) { if (mAdapter == null || mGatt == null) { Log.w(TAG, "writeService: BluetoothAdapter not initialized"); return; } mExecutor.write(service, uuid, value); mExecutor.execute(mGatt); } } public void enableNotification(BluetoothGattService service, String uuid, boolean enabled) { if (service != null) { if (mAdapter == null || mGatt == null) { Log.w(TAG, "enableNotification: BluetoothAdapter not initialized"); return; } mExecutor.enableNotification(service, uuid, enabled); mExecutor.execute(mGatt); } } public void enableIndication(BluetoothGattService service, String uuid, boolean enabled) { if (service != null) { if (mAdapter == null || mGatt == null) { Log.w(TAG, "enableNotification: BluetoothAdapter not initialized"); return; } mExecutor.enableIndication(service, uuid, enabled); mExecutor.execute(mGatt); } } // Properties private int getCharacteristicProperties(BluetoothGattService service, String characteristicUUIDString) { final UUID characteristicUuid = UUID.fromString(characteristicUUIDString); BluetoothGattCharacteristic characteristic = service.getCharacteristic(characteristicUuid); int properties = 0; if (characteristic != null) { properties = characteristic.getProperties(); } return properties; } public boolean isCharacteristicReadable(BluetoothGattService service, String characteristicUUIDString) { final int properties = getCharacteristicProperties(service, characteristicUUIDString); final boolean isReadable = (properties & BluetoothGattCharacteristic.PROPERTY_READ) != 0; return isReadable; } public boolean isCharacteristicNotifiable(BluetoothGattService service, String characteristicUUIDString) { final int properties = getCharacteristicProperties(service, characteristicUUIDString); final boolean isNotifiable = (properties & BluetoothGattCharacteristic.PROPERTY_NOTIFY) != 0; return isNotifiable; } // Permissions private int getDescriptorPermissions(BluetoothGattService service, String characteristicUUIDString, String descriptorUUIDString) { final UUID characteristicUuid = UUID.fromString(characteristicUUIDString); BluetoothGattCharacteristic characteristic = service.getCharacteristic(characteristicUuid); int permissions = 0; if (characteristic != null) { final UUID descriptorUuid = UUID.fromString(descriptorUUIDString); BluetoothGattDescriptor descriptor = characteristic.getDescriptor(descriptorUuid); if (descriptor != null) { permissions = descriptor.getPermissions(); } } return permissions; } public boolean isDescriptorReadable(BluetoothGattService service, String characteristicUUIDString, String descriptorUUIDString) { final int permissions = getDescriptorPermissions(service, characteristicUUIDString, descriptorUUIDString); final boolean isReadable = (permissions & BluetoothGattCharacteristic.PERMISSION_READ) != 0; return isReadable; } /** * Retrieves a list of supported GATT services on the connected device. This should be * invoked only after {@code BluetoothGatt#discoverServices()} completes successfully. * * @return A {@code List} of supported services. */ public List<BluetoothGattService> getSupportedGattServices() { if (mGatt != null) { return mGatt.getServices(); } else { return null; } } public BluetoothGattService getGattService(String uuid) { if (mGatt != null) { final UUID serviceUuid = UUID.fromString(uuid); return mGatt.getService(serviceUuid); } else { return null; } } public BluetoothGattService getGattService(String uuid, int instanceId) { if (mGatt != null) { List<BluetoothGattService> services = getSupportedGattServices(); boolean found = false; int i=0; while (i<services.size() && !found) { BluetoothGattService service = services.get(i); if (service.getUuid().toString().equalsIgnoreCase(uuid) && service.getInstanceId() == instanceId) { found = true; } else { i++; } } if (found) { return services.get(i); } else { return null; } } else { return null; } } @Override public void onConnectionStateChange(BluetoothGatt gatt, int status, int newState) { // Log.d(TAG, "onConnectionStateChange status: "+status+ " newState: "+newState); if (newState == BluetoothProfile.STATE_CONNECTED) { mConnectionState = STATE_CONNECTED; if (mBleListener != null) { mBleListener.onConnected(); } // Attempts to discover services after successful connection. gatt.discoverServices(); } else if (newState == BluetoothProfile.STATE_DISCONNECTED) { mConnectionState = STATE_DISCONNECTED; if (mBleListener != null) { mBleListener.onDisconnected(); } } else if (newState == BluetoothProfile.STATE_CONNECTING) { mConnectionState = STATE_CONNECTING; if (mBleListener != null) { mBleListener.onConnecting(); } } } // region BleExecutorListener @Override public void onServicesDiscovered(BluetoothGatt gatt, int status) { // if (status == BluetoothGatt.GATT_SUCCESS) { // Call listener if (mBleListener != null) mBleListener.onServicesDiscovered(); // } if (status != BluetoothGatt.GATT_SUCCESS) { Log.d(TAG, "onServicesDiscovered status: "+status); } } @Override public void onCharacteristicRead(BluetoothGatt gatt, BluetoothGattCharacteristic characteristic, int status) { // if (status == BluetoothGatt.GATT_SUCCESS) { if (mBleListener != null) { mBleListener.onDataAvailable(characteristic); } // } if (status != BluetoothGatt.GATT_SUCCESS) { Log.d(TAG, "onCharacteristicRead status: "+status); } } @Override public void onCharacteristicChanged(BluetoothGatt gatt, BluetoothGattCharacteristic characteristic) { if (mBleListener != null) { mBleListener.onDataAvailable(characteristic); } } @Override public void onDescriptorRead(BluetoothGatt gatt, BluetoothGattDescriptor descriptor, int status) { // if (status == BluetoothGatt.GATT_SUCCESS) { if (mBleListener != null) { mBleListener.onDataAvailable(descriptor); } // } if (status != BluetoothGatt.GATT_SUCCESS) { Log.d(TAG, "onDescriptorRead status: "+status); } } @Override public void onReadRemoteRssi(BluetoothGatt gatt, int rssi, int status) { if (mBleListener != null) { mBleListener.onReadRemoteRssi(rssi); } if (status != BluetoothGatt.GATT_SUCCESS) { Log.d(TAG, "onReadRemoteRssi status: "+status); } } //endregion public interface BleManagerListener { void onConnected(); void onConnecting(); void onDisconnected(); void onServicesDiscovered(); void onDataAvailable(BluetoothGattCharacteristic characteristic); void onDataAvailable(BluetoothGattDescriptor descriptor); void onReadRemoteRssi(int rssi); } }
[ "harrykwon0524@gmail.com" ]
harrykwon0524@gmail.com
63f9e8e20f41076bd7b5c97c5b3dc50f89b9c192
0c91e869f1e26a3559deaf5424182a9ac6c6ad14
/adata/src/com/wangli/data/analysis/ar/adc/service/AdcDataAnalysisService.java
e0147a26309dece06d0afd2576e3b22d507a43c5
[]
no_license
waally/analyData
0b8b104b3152ae3feb6c594ddf5f7ccfccb92589
5c7f833f56839423c16a013378817ae3be8f98bf
refs/heads/master
2021-01-01T20:35:39.522565
2014-12-26T04:28:35
2014-12-26T04:28:35
22,591,081
1
2
null
null
null
null
UTF-8
Java
false
false
3,226
java
package com.wangli.data.analysis.ar.adc.service; import java.sql.Date; import java.sql.SQLException; import java.util.List; import com.wangli.data.analysis.ar.adc.module.CorpOrder; import com.wangli.data.analysis.ar.adc.module.DeviceAppInfo; import com.wangli.data.analysis.ar.adc.module.FactAppStat; import com.wangli.data.analysis.ar.adc.module.InstallAppLog; public interface AdcDataAnalysisService { /** * 根据日期从installAppLog表中获取当天接受的新增数据 * @param date 新增信息接收时间 * @return * @throws SQLException */ int getInstallCount(Date date) throws SQLException; /** * 根据日期和起始位置从installAppLog表中获取当天接受的新增数据 * @param date 新增信息接收时间 * @param start 开始位置 * @param length 长度 * @return * @throws SQLException */ List<InstallAppLog> getInstallList(Date date,int start,int length) throws SQLException; /** * 获取当前条件下的新增的总数 * @param installDate 安装日期 * @param model 手机型号 * @param orderId 订单号 * @param identityId PC/BOX身份编号 * @param identityMark PC/BOX身份区分 * @return * @throws SQLException */ int getDeviceAppCount(String installDate,String model,int orderId,int identityId,int identityMark) throws SQLException; /** * 获取设备应用信息 * @param imei 移动设备唯一编号 * @param orderId 订单编号 * @return * @throws SQLException */ DeviceAppInfo getDeviceApp(String imei,int orderId) throws SQLException; /** * 根据日期获取接收日期是当天的所有的设备应用信息 * @param receiveDate 接收日期 * @return * @throws SQLException */ List<DeviceAppInfo> getDeviceApps(Date receiveDate) throws SQLException; /** * 插入设备应用信息到数据库 * @param da 设备应用信息 * @throws SQLException */ void insertDeviceApp(DeviceAppInfo da) throws SQLException; /** * 根据日期删除接收日期是当天的所有的设备应用信息 * @param receiveDate 接收日期 * @throws SQLException */ void deleteDeviceApp(String receiveDate) throws SQLException; /** * 更新设备应用信息到数据库 * @param da 设备应用信息 * @throws SQLException */ void updateDeviceApp(DeviceAppInfo da) throws SQLException; /** * 获取应用新增的信息 * @param model * @param dataTime * @param orderId * @param identityId * @param identityMark * @return * @throws SQLException */ FactAppStat getFactAppStat(String model,java.util.Date dataTime,int orderId,int identityId,int identityMark) throws SQLException; /** * 插入应用新增的信息到数据库 * @param fAppStat * @throws SQLException */ void insertFactAppStat(FactAppStat fAppStat) throws SQLException; /** * 根据主键删除应用新增的信息 * @param id * @throws SQLException */ void deleteFactAppStat(long id) throws SQLException; /** * 根据主键获取订单信息 * @param orderId * @return * @throws SQLException */ CorpOrder getCorpOrder(int orderId) throws SQLException; }
[ "wangli19890312@126.com" ]
wangli19890312@126.com
7dfed82646f0c7c6b08144d9138efde57e3ba6a9
b9a58c607ff4344de822c98ad693581eef1e1db6
/src/App4GoodsNotes/ExcelExportUtil.java
ff1cb8524eb7888534e3aa2f226e702bb2470611
[]
no_license
huohehuo/LinServer
f6080619049ea81d1ca46f504eb7a18470915886
0a1b416d66bafa1150aba7417d1873a2d73683a6
refs/heads/master
2023-01-19T07:51:31.830278
2020-11-24T16:23:12
2020-11-24T16:23:12
267,913,675
0
0
null
null
null
null
UTF-8
Java
false
false
6,274
java
package App4GoodsNotes; import ServerVueWeb.Bean.BuyAtBean; import Utils.Lg; import org.apache.poi.hssf.usermodel.*; import org.apache.poi.ss.usermodel.BorderStyle; import org.apache.poi.ss.usermodel.HorizontalAlignment; import org.apache.poi.ss.usermodel.IndexedColors; import org.apache.poi.ss.usermodel.VerticalAlignment; import org.apache.poi.ss.util.CellRangeAddress; import javax.servlet.http.HttpServletResponse; import java.io.ByteArrayOutputStream; import java.io.File; import java.io.FileOutputStream; import java.io.OutputStream; import java.net.URLEncoder; import java.util.List; /*https://blog.csdn.net/ethan_10/article/details/80335350*/ public class ExcelExportUtil { // 第一步,创建一个webbook,对应一个Excel文件 public HSSFWorkbook generateExcel() { return new HSSFWorkbook(); } //处理公司信息表对应的xls位置数据 public HSSFWorkbook generateExcelSheet(HSSFWorkbook wb, String sheetName, String[] fields, List<BuyAtBean> list) { // 第二步,在webbook中添加一个sheet,对应Excel文件中的sheet HSSFSheet sheet = wb.createSheet(sheetName); // sheet.setDefaultRowHeightInPoints(30);//设置缺省列宽 // sheet.setDefaultColumnWidth(50);//设置缺省列高 HSSFCellStyle style = wb.createCellStyle(); // style.setAlignment(HSSFCellStyle.ALIGN_CENTER); // 创建一个居中格式 style.setAlignment(HorizontalAlignment.CENTER_SELECTION);//水平居中 style.setVerticalAlignment(VerticalAlignment.CENTER);//垂直居中 // 设置普通单元格字体样式 HSSFFont font = wb.createFont(); font.setFontName("宋体"); font.setFontHeightInPoints((short) 12);//设置字体大小 style.setFont(font); style.setBorderLeft(BorderStyle.THIN); style.setBorderBottom(BorderStyle.THIN); style.setBorderRight(BorderStyle.THIN); style.setBorderTop(BorderStyle.THIN); style.setBottomBorderColor(IndexedColors.BLACK.getIndex()); style.setLeftBorderColor(IndexedColors.BLACK.getIndex()); style.setTopBorderColor(IndexedColors.BLACK.getIndex()); style.setRightBorderColor(IndexedColors.BLACK.getIndex()); // 第三步,在sheet中添加表头第0行,注意老版本poi对Excel的行数列数有限制short HSSFRow rowH = sheet.createRow(0); rowH.setHeight((short) 1000); sheet.addMergedRegion(new CellRangeAddress(0,0,0,8)); HSSFCell cellHead; cellHead = rowH.createCell(0); cellHead.setCellValue(list.get(0).FBuyName); cellHead.setCellStyle(style); // 第四步,创建单元格,并设置值表头 设置表头居中 //设置表头字段名 HSSFCell cell; int m=0; HSSFRow row = sheet.createRow(1); row.setHeight((short) 500); for (int i = 0; i < fields.length; i++) { cell = row.createCell(m); cell.setCellValue(fields[i]); cell.setCellStyle(style); if (i==0){//设置指定列的宽度 sheet.setColumnWidth(cell.getColumnIndex(), 4000); }else if (i==1){ sheet.setColumnWidth(cell.getColumnIndex(), 5000); }else if (i==2){ sheet.setColumnWidth(cell.getColumnIndex(), 4000); }else{ sheet.setColumnWidth(cell.getColumnIndex(), 3000); } m++; } for(String fieldName:fields){//设置首行的说明行 } Lg.e("得到list",list); HSSFCell hssfCell; // font.setFontHeightInPoints((short) 12); // style.setFont(font); for (int i = 0; i < list.size(); i++) { row = sheet.createRow(i + 2); row.setHeight((short) 388); BuyAtBean data = list.get(i); // 第五步,创建单元格,并设置值 int pos =0; hssfCell =row.createCell(pos);hssfCell.setCellValue("");hssfCell.setCellStyle(style);pos++; hssfCell =row.createCell(pos);hssfCell.setCellValue("");hssfCell.setCellStyle(style);pos++; hssfCell =row.createCell(pos);hssfCell.setCellValue(data.FModelName);hssfCell.setCellStyle(style);pos++; hssfCell =row.createCell(pos);hssfCell.setCellValue(data.FStuffName);hssfCell.setCellStyle(style);pos++; hssfCell =row.createCell(pos);hssfCell.setCellValue(data.FColorName);hssfCell.setCellStyle(style);pos++; hssfCell =row.createCell(pos);hssfCell.setCellValue(data.FNum);hssfCell.setCellStyle(style);pos++; hssfCell =row.createCell(pos);hssfCell.setCellValue(data.FUnitName);hssfCell.setCellStyle(style);pos++; hssfCell =row.createCell(pos);hssfCell.setCellValue(data.FPrice);hssfCell.setCellStyle(style);pos++; hssfCell =row.createCell(pos);hssfCell.setCellValue(data.FSum);hssfCell.setCellStyle(style);pos++; } return wb; } public boolean writeExcelToDisk(HSSFWorkbook wb, String fileName){ try { // String fileAddress = "C:/LinsServer/AppExcel4GoodsNotes/"; String fileAddress = BaseUtil.baseFileUrl; File f = new File(fileAddress); if (!f.exists()) { f.mkdirs(); } File file = new File(fileAddress + fileName); FileOutputStream fops = new FileOutputStream(file); ByteArrayOutputStream baos = new ByteArrayOutputStream(); wb.write(baos); byte[] xlsBytes = baos .toByteArray(); fops.write(xlsBytes); fops.flush(); fops.close(); System.out.println("数据已写入"); return true; } catch (Exception e) { e.printStackTrace(); return false; } } public void export(HSSFWorkbook wb,String fileName, HttpServletResponse response){ // 第六步,实现文件下载保存 try { response.setHeader("content-disposition", "attachment;filename=" + URLEncoder.encode(fileName, "utf-8") + ".xls"); OutputStream out = response.getOutputStream(); ByteArrayOutputStream baos = new ByteArrayOutputStream(); wb.write( baos); byte[] xlsBytes = baos .toByteArray(); out.write( xlsBytes); out.close(); } catch (Exception e) { e.printStackTrace(); } } }
[ "753392431@qq.com" ]
753392431@qq.com
2159da72a43cafef8279d6a3e0d779ea2009cbb6
f321db1ace514d08219cc9ba5089ebcfff13c87a
/generated-tests/dynamosa/tests/s1025/23_fastjson/evosuite-tests/com/alibaba/fastjson/JSONArray_ESTest.java
d5273673ee7a65d8b52a827b456cbbd8c16c44b1
[]
no_license
sealuzh/dynamic-performance-replication
01bd512bde9d591ea9afa326968b35123aec6d78
f89b4dd1143de282cd590311f0315f59c9c7143a
refs/heads/master
2021-07-12T06:09:46.990436
2020-06-05T09:44:56
2020-06-05T09:44:56
146,285,168
2
2
null
null
null
null
UTF-8
Java
false
false
153,559
java
/* * This file was automatically generated by EvoSuite * Thu Jul 04 14:48:51 GMT 2019 */ package com.alibaba.fastjson; import org.junit.Test; import static org.junit.Assert.*; import static org.evosuite.shaded.org.mockito.Mockito.*; import static org.evosuite.runtime.EvoAssertions.*; import com.alibaba.fastjson.JSON; import com.alibaba.fastjson.JSONArray; import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.annotation.JSONType; import com.alibaba.fastjson.serializer.SerializerFeature; import com.alibaba.fastjson.util.FieldInfo; import com.alibaba.fastjson.util.JavaBeanInfo; import java.io.ByteArrayInputStream; import java.io.InputStream; import java.io.PipedInputStream; import java.io.PushbackInputStream; import java.lang.annotation.Annotation; import java.lang.reflect.Field; import java.lang.reflect.Type; import java.util.Collection; import java.util.HashMap; import java.util.Iterator; import java.util.LinkedHashSet; import java.util.LinkedList; import java.util.List; import java.util.ListIterator; import java.util.function.Consumer; import org.evosuite.runtime.EvoRunner; import org.evosuite.runtime.EvoRunnerParameters; import org.evosuite.runtime.ViolatedAssumptionAnswer; import org.evosuite.runtime.mock.java.util.MockDate; import org.junit.runner.RunWith; @RunWith(EvoRunner.class) @EvoRunnerParameters(mockJVMNonDeterminism = true, useVFS = true, useVNET = true, resetStaticState = true, separateClassLoader = true, useJEE = true) public class JSONArray_ESTest extends JSONArray_ESTest_scaffolding { @Test(timeout = 4000) public void test000() throws Throwable { JSONArray jSONArray0 = new JSONArray(); JSONArray jSONArray1 = jSONArray0.fluentSet(2117, jSONArray0); // Undeclared exception! try { jSONArray1.getDate(2117); fail("Expecting exception: RuntimeException"); } catch(RuntimeException e) { // // can not cast to Date, value : [null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,{\"$ref\":\"@\"}] // verifyException("com.alibaba.fastjson.util.TypeUtils", e); } } @Test(timeout = 4000) public void test001() throws Throwable { JSONArray jSONArray0 = new JSONArray(); jSONArray0.setRelatedArray(jSONArray0.DEFAULT_PARSER_FEATURE); jSONArray0.fluentSet(468, jSONArray0.DEFAULT_GENERATE_FEATURE); Class<Integer> class0 = Integer.class; jSONArray0.getObject(1, (Type) class0); assertEquals(469, jSONArray0.size()); } @Test(timeout = 4000) public void test002() throws Throwable { JSONArray jSONArray0 = new JSONArray(); jSONArray0.setRelatedArray(jSONArray0.DEFAULT_GENERATE_FEATURE); jSONArray0.fluentSet(468, jSONArray0.DEFAULT_GENERATE_FEATURE); Class<Integer> class0 = Integer.class; jSONArray0.getObject(1, class0); assertEquals(469, jSONArray0.size()); } @Test(timeout = 4000) public void test003() throws Throwable { JSONArray jSONArray0 = new JSONArray(); JSONArray jSONArray1 = jSONArray0.fluentSet(964, jSONArray0); jSONArray1.setRelatedArray(jSONArray0); jSONArray1.getJSONArray(2); assertEquals(965, jSONArray0.size()); } @Test(timeout = 4000) public void test004() throws Throwable { JSONArray jSONArray0 = new JSONArray(1); // Undeclared exception! try { jSONArray0.listIterator((-241)); fail("Expecting exception: IndexOutOfBoundsException"); } catch(IndexOutOfBoundsException e) { // // Index: -241 // verifyException("java.util.ArrayList", e); } } @Test(timeout = 4000) public void test005() throws Throwable { JSONArray jSONArray0 = new JSONArray(1); Class<Integer> class0 = Integer.class; Class class1 = (Class)FieldInfo.getFieldType(class0, class0, class0); jSONArray0.setComponentType(class1); assertFalse(class1.isAnnotation()); } @Test(timeout = 4000) public void test006() throws Throwable { JSONArray jSONArray0 = new JSONArray(); JSONArray jSONArray1 = jSONArray0.fluentSet(2117, jSONArray0); // Undeclared exception! try { jSONArray1.getTimestamp(2117); fail("Expecting exception: RuntimeException"); } catch(RuntimeException e) { // // can not cast to Timestamp, value : [null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,{\"$ref\":\"@\"}] // verifyException("com.alibaba.fastjson.util.TypeUtils", e); } } @Test(timeout = 4000) public void test007() throws Throwable { JSONArray jSONArray0 = new JSONArray(); JSONArray jSONArray1 = jSONArray0.fluentAdd((Object) jSONArray0); // Undeclared exception! try { jSONArray1.getByte(0); fail("Expecting exception: RuntimeException"); } catch(RuntimeException e) { // // can not cast to byte, value : [{\"$ref\":\"@\"}] // verifyException("com.alibaba.fastjson.util.TypeUtils", e); } } @Test(timeout = 4000) public void test008() throws Throwable { JSONArray jSONArray0 = new JSONArray(); jSONArray0.fluentSet(2117, jSONArray0); int int0 = jSONArray0.size(); assertEquals(2118, int0); } @Test(timeout = 4000) public void test009() throws Throwable { JSONArray jSONArray0 = new JSONArray(); JSONArray jSONArray1 = jSONArray0.fluentSet(452, jSONArray0.DEFAULT_GENERATE_FEATURE); LinkedHashSet<Integer> linkedHashSet0 = new LinkedHashSet<Integer>(); boolean boolean0 = jSONArray1.retainAll(linkedHashSet0); assertTrue(boolean0); } @Test(timeout = 4000) public void test010() throws Throwable { JSONArray jSONArray0 = new JSONArray(); JSONArray jSONArray1 = jSONArray0.fluentSet(2117, jSONArray0); jSONArray1.remove(2117); assertEquals(2117, jSONArray1.size()); } @Test(timeout = 4000) public void test011() throws Throwable { JSONArray jSONArray0 = new JSONArray(); JSONArray jSONArray1 = jSONArray0.fluentSet(964, jSONArray0); int int0 = jSONArray1.lastIndexOf((Object) null); assertEquals(965, jSONArray0.size()); assertEquals(963, int0); } @Test(timeout = 4000) public void test012() throws Throwable { JSONArray jSONArray0 = new JSONArray(); JSONArray jSONArray1 = jSONArray0.fluentSet(2117, jSONArray0); jSONArray1.getString(889); assertEquals(2118, jSONArray0.size()); } @Test(timeout = 4000) public void test013() throws Throwable { JSONArray jSONArray0 = new JSONArray(); JSONArray jSONArray1 = jSONArray0.fluentSet((-1), jSONArray0); jSONArray1.getString(0); assertEquals(1, jSONArray0.size()); } @Test(timeout = 4000) public void test014() throws Throwable { JSONArray jSONArray0 = new JSONArray(); JSONArray jSONArray1 = jSONArray0.fluentSet(2117, jSONArray0); jSONArray1.getShort(1975); assertEquals(2118, jSONArray0.size()); } @Test(timeout = 4000) public void test015() throws Throwable { JSONArray jSONArray0 = new JSONArray(); jSONArray0.fluentSet(2117, jSONArray0); jSONArray0.getLong(0); assertEquals(2118, jSONArray0.size()); } @Test(timeout = 4000) public void test016() throws Throwable { JSONArray jSONArray0 = new JSONArray(); jSONArray0.fluentSet(468, (-1)); jSONArray0.getInteger(445); assertEquals(469, jSONArray0.size()); } @Test(timeout = 4000) public void test017() throws Throwable { JSONArray jSONArray0 = new JSONArray(); JSONArray jSONArray1 = jSONArray0.fluentSet(468, jSONArray0.DEFAULT_PARSER_FEATURE); float float0 = jSONArray1.getFloatValue(468); assertEquals(469, jSONArray0.size()); assertEquals(989.0F, float0, 0.01F); } @Test(timeout = 4000) public void test018() throws Throwable { JSONArray jSONArray0 = new JSONArray(); jSONArray0.fluentSet(2117, jSONArray0); jSONArray0.getFloat(2084); assertEquals(2118, jSONArray0.size()); } @Test(timeout = 4000) public void test019() throws Throwable { JSONArray jSONArray0 = new JSONArray(); jSONArray0.fluentSet(468, (-1)); jSONArray0.getFloat(468); assertEquals(469, jSONArray0.size()); } @Test(timeout = 4000) public void test020() throws Throwable { JSONArray jSONArray0 = new JSONArray(); jSONArray0.fluentSet(2104, jSONArray0.DEFAULT_PARSER_FEATURE); jSONArray0.getDate(2039); assertEquals(2105, jSONArray0.size()); } @Test(timeout = 4000) public void test021() throws Throwable { JSONArray jSONArray0 = new JSONArray(); Integer integer0 = new Integer(1); JSONArray jSONArray1 = jSONArray0.fluentSet(665, integer0); boolean boolean0 = jSONArray1.getBooleanValue(665); assertEquals(666, jSONArray0.size()); assertTrue(boolean0); } @Test(timeout = 4000) public void test022() throws Throwable { JSONArray jSONArray0 = new JSONArray(); JSONArray jSONArray1 = jSONArray0.fluentSet((-1), jSONArray0); jSONArray1.fluentRetainAll(jSONArray0); assertFalse(jSONArray0.isEmpty()); assertEquals(1, jSONArray0.size()); } @Test(timeout = 4000) public void test023() throws Throwable { JSONArray jSONArray0 = new JSONArray(); JSONArray jSONArray1 = jSONArray0.fluentRemoveAll(jSONArray0); assertEquals(0, jSONArray1.size()); } @Test(timeout = 4000) public void test024() throws Throwable { JSONArray jSONArray0 = new JSONArray(); jSONArray0.fluentSet(2117, jSONArray0); LinkedList<Object> linkedList0 = new LinkedList<Object>(); jSONArray0.fluentRemoveAll(linkedList0); assertEquals(2118, jSONArray0.size()); } @Test(timeout = 4000) public void test025() throws Throwable { JSONArray jSONArray0 = new JSONArray(1); HashMap<String, Object> hashMap0 = new HashMap<String, Object>(); jSONArray0.fluentSet(950, jSONArray0); jSONArray0.fluentRemove((Object) hashMap0); assertEquals(951, jSONArray0.size()); } @Test(timeout = 4000) public void test026() throws Throwable { JSONArray jSONArray0 = new JSONArray(1); JSONArray jSONArray1 = jSONArray0.fluentSet(950, jSONArray0); jSONArray1.fluentRemove(1); assertEquals(950, jSONArray1.size()); } @Test(timeout = 4000) public void test027() throws Throwable { JSONArray jSONArray0 = new JSONArray(); JSONArray jSONArray1 = jSONArray0.fluentAdd((Object) ""); JSONArray jSONArray2 = jSONArray0.fluentAddAll((Collection<?>) jSONArray1); assertSame(jSONArray0, jSONArray2); } @Test(timeout = 4000) public void test028() throws Throwable { JSONArray jSONArray0 = new JSONArray(1001); JSONArray jSONArray1 = jSONArray0.fluentSet(2122, (Object) null); jSONArray0.fluentAdd(1001, (Object) jSONArray1); assertEquals(2124, jSONArray1.size()); assertEquals(2124, jSONArray0.size()); } @Test(timeout = 4000) public void test029() throws Throwable { JSONArray jSONArray0 = new JSONArray(); boolean boolean0 = jSONArray0.equals(jSONArray0); assertTrue(boolean0); } @Test(timeout = 4000) public void test030() throws Throwable { JSONArray jSONArray0 = new JSONArray(); JSONArray jSONArray1 = jSONArray0.fluentSet(2117, jSONArray0); jSONArray0.addAll((Collection<?>) jSONArray1); assertEquals(4236, jSONArray1.size()); assertEquals(4236, jSONArray0.size()); } @Test(timeout = 4000) public void test031() throws Throwable { JSONArray jSONArray0 = new JSONArray(); // Undeclared exception! try { jSONArray0.subList((-1), 0); fail("Expecting exception: IndexOutOfBoundsException"); } catch(IndexOutOfBoundsException e) { // // fromIndex = -1 // verifyException("java.util.ArrayList", e); } } @Test(timeout = 4000) public void test032() throws Throwable { JSONArray jSONArray0 = new JSONArray(1); // Undeclared exception! try { jSONArray0.subList(1, 831); fail("Expecting exception: IndexOutOfBoundsException"); } catch(IndexOutOfBoundsException e) { // // toIndex = 831 // verifyException("java.util.ArrayList", e); } } @Test(timeout = 4000) public void test033() throws Throwable { JSONArray jSONArray0 = new JSONArray(); int int0 = jSONArray0.lastIndexOf((Object) null); assertEquals((-1), int0); } @Test(timeout = 4000) public void test034() throws Throwable { JSONArray jSONArray0 = new JSONArray(); Consumer<Object> consumer0 = (Consumer<Object>) mock(Consumer.class, new ViolatedAssumptionAnswer()); int int0 = jSONArray0.lastIndexOf(consumer0); assertEquals((-1), int0); } @Test(timeout = 4000) public void test035() throws Throwable { JSONArray jSONArray0 = new JSONArray(1); int int0 = jSONArray0.indexOf((Object) null); assertEquals((-1), int0); } @Test(timeout = 4000) public void test036() throws Throwable { JSONArray jSONArray0 = new JSONArray(); // Undeclared exception! try { jSONArray0.getTimestamp(0); fail("Expecting exception: IndexOutOfBoundsException"); } catch(IndexOutOfBoundsException e) { // // Index: 0, Size: 0 // verifyException("java.util.ArrayList", e); } } @Test(timeout = 4000) public void test037() throws Throwable { JSONArray jSONArray0 = new JSONArray(); // Undeclared exception! try { jSONArray0.getString(0); fail("Expecting exception: IndexOutOfBoundsException"); } catch(IndexOutOfBoundsException e) { // // Index: 0, Size: 0 // verifyException("java.util.ArrayList", e); } } @Test(timeout = 4000) public void test038() throws Throwable { JSONArray jSONArray0 = new JSONArray(0); // Undeclared exception! try { jSONArray0.getSqlDate(0); fail("Expecting exception: IndexOutOfBoundsException"); } catch(IndexOutOfBoundsException e) { // // Index: 0, Size: 0 // verifyException("java.util.ArrayList", e); } } @Test(timeout = 4000) public void test039() throws Throwable { JSONArray jSONArray0 = new JSONArray(0); // Undeclared exception! try { jSONArray0.getShort(0); fail("Expecting exception: IndexOutOfBoundsException"); } catch(IndexOutOfBoundsException e) { // // Index: 0, Size: 0 // verifyException("java.util.ArrayList", e); } } @Test(timeout = 4000) public void test040() throws Throwable { JSONArray jSONArray0 = new JSONArray(); Class<InputStream> class0 = InputStream.class; JSONType jSONType0 = mock(JSONType.class, new ViolatedAssumptionAnswer()); doReturn(class0).when(jSONType0).builder(); Class<?> class1 = JavaBeanInfo.getBuilderClass(jSONType0); // Undeclared exception! try { jSONArray0.getObject((int) 0, (Type) class1); fail("Expecting exception: IndexOutOfBoundsException"); } catch(IndexOutOfBoundsException e) { // // Index: 0, Size: 0 // verifyException("java.util.ArrayList", e); } } @Test(timeout = 4000) public void test041() throws Throwable { JSONArray jSONArray0 = new JSONArray(0); Class<Integer> class0 = Integer.class; // Undeclared exception! try { jSONArray0.getObject(0, class0); fail("Expecting exception: IndexOutOfBoundsException"); } catch(IndexOutOfBoundsException e) { // // Index: 0, Size: 0 // verifyException("java.util.ArrayList", e); } } @Test(timeout = 4000) public void test042() throws Throwable { JSONArray jSONArray0 = new JSONArray(0); // Undeclared exception! try { jSONArray0.getLongValue(0); fail("Expecting exception: IndexOutOfBoundsException"); } catch(IndexOutOfBoundsException e) { // // Index: 0, Size: 0 // verifyException("java.util.ArrayList", e); } } @Test(timeout = 4000) public void test043() throws Throwable { JSONArray jSONArray0 = new JSONArray(); // Undeclared exception! try { jSONArray0.getLong(0); fail("Expecting exception: IndexOutOfBoundsException"); } catch(IndexOutOfBoundsException e) { // // Index: 0, Size: 0 // verifyException("java.util.ArrayList", e); } } @Test(timeout = 4000) public void test044() throws Throwable { JSONArray jSONArray0 = new JSONArray(); // Undeclared exception! try { jSONArray0.getJSONArray(0); fail("Expecting exception: IndexOutOfBoundsException"); } catch(IndexOutOfBoundsException e) { // // Index: 0, Size: 0 // verifyException("java.util.ArrayList", e); } } @Test(timeout = 4000) public void test045() throws Throwable { JSONArray jSONArray0 = new JSONArray(); // Undeclared exception! try { jSONArray0.getInteger(0); fail("Expecting exception: IndexOutOfBoundsException"); } catch(IndexOutOfBoundsException e) { // // Index: 0, Size: 0 // verifyException("java.util.ArrayList", e); } } @Test(timeout = 4000) public void test046() throws Throwable { JSONArray jSONArray0 = new JSONArray(); // Undeclared exception! try { jSONArray0.getIntValue(0); fail("Expecting exception: IndexOutOfBoundsException"); } catch(IndexOutOfBoundsException e) { // // Index: 0, Size: 0 // verifyException("java.util.ArrayList", e); } } @Test(timeout = 4000) public void test047() throws Throwable { JSONArray jSONArray0 = new JSONArray(0); // Undeclared exception! try { jSONArray0.getFloatValue(0); fail("Expecting exception: IndexOutOfBoundsException"); } catch(IndexOutOfBoundsException e) { // // Index: 0, Size: 0 // verifyException("java.util.ArrayList", e); } } @Test(timeout = 4000) public void test048() throws Throwable { JSONArray jSONArray0 = new JSONArray(0); // Undeclared exception! try { jSONArray0.getFloat(0); fail("Expecting exception: IndexOutOfBoundsException"); } catch(IndexOutOfBoundsException e) { // // Index: 0, Size: 0 // verifyException("java.util.ArrayList", e); } } @Test(timeout = 4000) public void test049() throws Throwable { JSONArray jSONArray0 = new JSONArray(); // Undeclared exception! try { jSONArray0.getDouble(0); fail("Expecting exception: IndexOutOfBoundsException"); } catch(IndexOutOfBoundsException e) { // // Index: 0, Size: 0 // verifyException("java.util.ArrayList", e); } } @Test(timeout = 4000) public void test050() throws Throwable { JSONArray jSONArray0 = new JSONArray(0); // Undeclared exception! try { jSONArray0.getByteValue(0); fail("Expecting exception: IndexOutOfBoundsException"); } catch(IndexOutOfBoundsException e) { // // Index: 0, Size: 0 // verifyException("java.util.ArrayList", e); } } @Test(timeout = 4000) public void test051() throws Throwable { JSONArray jSONArray0 = new JSONArray(); // Undeclared exception! try { jSONArray0.getByte(0); fail("Expecting exception: IndexOutOfBoundsException"); } catch(IndexOutOfBoundsException e) { // // Index: 0, Size: 0 // verifyException("java.util.ArrayList", e); } } @Test(timeout = 4000) public void test052() throws Throwable { JSONArray jSONArray0 = new JSONArray(0); // Undeclared exception! try { jSONArray0.getByte(184); fail("Expecting exception: IndexOutOfBoundsException"); } catch(IndexOutOfBoundsException e) { // // Index: 184, Size: 0 // verifyException("java.util.ArrayList", e); } } @Test(timeout = 4000) public void test053() throws Throwable { JSONArray jSONArray0 = new JSONArray(); // Undeclared exception! try { jSONArray0.getBooleanValue(0); fail("Expecting exception: IndexOutOfBoundsException"); } catch(IndexOutOfBoundsException e) { // // Index: 0, Size: 0 // verifyException("java.util.ArrayList", e); } } @Test(timeout = 4000) public void test054() throws Throwable { JSONArray jSONArray0 = new JSONArray(); // Undeclared exception! try { jSONArray0.getBoolean(0); fail("Expecting exception: IndexOutOfBoundsException"); } catch(IndexOutOfBoundsException e) { // // Index: 0, Size: 0 // verifyException("java.util.ArrayList", e); } } @Test(timeout = 4000) public void test055() throws Throwable { JSONArray jSONArray0 = new JSONArray(126); Iterator<Object> iterator0 = jSONArray0.iterator(); jSONArray0.fluentSet(1515, iterator0); assertEquals(1516, jSONArray0.size()); } @Test(timeout = 4000) public void test056() throws Throwable { JSONArray jSONArray0 = new JSONArray(1); SerializerFeature serializerFeature0 = SerializerFeature.WriteClassName; jSONArray0.fluentSet(0, serializerFeature0); assertEquals(1, jSONArray0.size()); } @Test(timeout = 4000) public void test057() throws Throwable { JSONArray jSONArray0 = new JSONArray(); byte[] byteArray0 = new byte[6]; ByteArrayInputStream byteArrayInputStream0 = new ByteArrayInputStream(byteArray0); PushbackInputStream pushbackInputStream0 = new PushbackInputStream(byteArrayInputStream0, 446); JSONArray jSONArray1 = jSONArray0.fluentRemove((Object) pushbackInputStream0); assertSame(jSONArray1, jSONArray0); } @Test(timeout = 4000) public void test058() throws Throwable { JSONArray jSONArray0 = new JSONArray(); // Undeclared exception! try { jSONArray0.fluentRemove(2737); fail("Expecting exception: IndexOutOfBoundsException"); } catch(IndexOutOfBoundsException e) { // // Index: 2737, Size: 0 // verifyException("java.util.ArrayList", e); } } @Test(timeout = 4000) public void test059() throws Throwable { JSONArray jSONArray0 = new JSONArray(); // Undeclared exception! try { jSONArray0.fluentAddAll(1310, (Collection<?>) null); fail("Expecting exception: IndexOutOfBoundsException"); } catch(IndexOutOfBoundsException e) { // // Index: 1310, Size: 0 // verifyException("java.util.ArrayList", e); } } @Test(timeout = 4000) public void test060() throws Throwable { JSONArray jSONArray0 = new JSONArray(); JSONArray jSONArray1 = jSONArray0.fluentAdd((Object) null); assertSame(jSONArray1, jSONArray0); } @Test(timeout = 4000) public void test061() throws Throwable { JSONArray jSONArray0 = new JSONArray(964); Iterator<Object> iterator0 = jSONArray0.iterator(); JSONArray jSONArray1 = jSONArray0.fluentAdd((Object) iterator0); assertEquals(989, JSON.DEFAULT_PARSER_FEATURE); } @Test(timeout = 4000) public void test062() throws Throwable { JSONArray jSONArray0 = new JSONArray(); // Undeclared exception! try { jSONArray0.fluentAdd((-1), (Object) null); fail("Expecting exception: IndexOutOfBoundsException"); } catch(IndexOutOfBoundsException e) { // // Index: -1, Size: 0 // verifyException("java.util.ArrayList", e); } } @Test(timeout = 4000) public void test063() throws Throwable { JSONArray jSONArray0 = new JSONArray(); LinkedHashSet<InputStream> linkedHashSet0 = new LinkedHashSet<InputStream>(); // Undeclared exception! try { jSONArray0.addAll((-1), (Collection<?>) linkedHashSet0); fail("Expecting exception: IndexOutOfBoundsException"); } catch(IndexOutOfBoundsException e) { // // Index: -1, Size: 0 // verifyException("java.util.ArrayList", e); } } @Test(timeout = 4000) public void test064() throws Throwable { JSONArray jSONArray0 = new JSONArray(452); // Undeclared exception! try { jSONArray0.add(452, (Object) null); fail("Expecting exception: IndexOutOfBoundsException"); } catch(IndexOutOfBoundsException e) { // // Index: 452, Size: 0 // verifyException("java.util.ArrayList", e); } } @Test(timeout = 4000) public void test065() throws Throwable { JSONArray jSONArray0 = new JSONArray(1001); Consumer<Object> consumer0 = (Consumer<Object>) mock(Consumer.class, new ViolatedAssumptionAnswer()); // Undeclared exception! try { jSONArray0.add(1001, (Object) consumer0); fail("Expecting exception: IndexOutOfBoundsException"); } catch(IndexOutOfBoundsException e) { // // Index: 1001, Size: 0 // verifyException("java.util.ArrayList", e); } } @Test(timeout = 4000) public void test066() throws Throwable { JSONArray jSONArray0 = new JSONArray(); LinkedHashSet<Integer> linkedHashSet0 = new LinkedHashSet<Integer>(); jSONArray0.add(0, (Object) linkedHashSet0); assertEquals(0, linkedHashSet0.size()); } @Test(timeout = 4000) public void test067() throws Throwable { JSONArray jSONArray0 = new JSONArray(); // Undeclared exception! try { jSONArray0.add((-1), (Object) jSONArray0); fail("Expecting exception: IndexOutOfBoundsException"); } catch(IndexOutOfBoundsException e) { // // Index: -1, Size: 0 // verifyException("java.util.ArrayList", e); } } @Test(timeout = 4000) public void test068() throws Throwable { JSONArray jSONArray0 = new JSONArray(); jSONArray0.fluentSet((-1), jSONArray0); Class<JSONObject> class0 = JSONObject.class; // Undeclared exception! try { jSONArray0.toJavaList(class0); fail("Expecting exception: RuntimeException"); } catch(RuntimeException e) { // // can not cast to : com.alibaba.fastjson.JSONObject // verifyException("com.alibaba.fastjson.util.TypeUtils", e); } } @Test(timeout = 4000) public void test069() throws Throwable { JSONArray jSONArray0 = new JSONArray(1); // Undeclared exception! try { jSONArray0.toArray((JSONArray[]) null); fail("Expecting exception: NullPointerException"); } catch(NullPointerException e) { // // no message in exception (getMessage() returned null) // } } @Test(timeout = 4000) public void test070() throws Throwable { JSONArray jSONArray0 = new JSONArray(); jSONArray0.fluentSet(468, jSONArray0.DEFAULT_PARSER_FEATURE); JSONArray[] jSONArrayArray0 = new JSONArray[1]; // Undeclared exception! try { jSONArray0.toArray(jSONArrayArray0); fail("Expecting exception: ArrayStoreException"); } catch(ArrayStoreException e) { // // no message in exception (getMessage() returned null) // verifyException("java.util.ArrayList", e); } } @Test(timeout = 4000) public void test071() throws Throwable { JSONArray jSONArray0 = new JSONArray(121); // Undeclared exception! try { jSONArray0.subList(121, (-1)); fail("Expecting exception: IllegalArgumentException"); } catch(IllegalArgumentException e) { // // fromIndex(121) > toIndex(-1) // verifyException("java.util.ArrayList", e); } } @Test(timeout = 4000) public void test072() throws Throwable { JSONArray jSONArray0 = new JSONArray(); // Undeclared exception! try { jSONArray0.remove(2075); fail("Expecting exception: IndexOutOfBoundsException"); } catch(IndexOutOfBoundsException e) { // // Index: 2075, Size: 0 // verifyException("java.util.ArrayList", e); } } @Test(timeout = 4000) public void test073() throws Throwable { JSONArray jSONArray0 = new JSONArray((List<Object>) null); // Undeclared exception! try { jSONArray0.iterator(); fail("Expecting exception: NullPointerException"); } catch(NullPointerException e) { // // no message in exception (getMessage() returned null) // verifyException("com.alibaba.fastjson.JSONArray", e); } } @Test(timeout = 4000) public void test074() throws Throwable { JSONArray jSONArray0 = new JSONArray(); // Undeclared exception! try { jSONArray0.getString((-1)); fail("Expecting exception: ArrayIndexOutOfBoundsException"); } catch(ArrayIndexOutOfBoundsException e) { // // no message in exception (getMessage() returned null) // } } @Test(timeout = 4000) public void test075() throws Throwable { JSONArray jSONArray0 = new JSONArray(); jSONArray0.fluentSet(2117, jSONArray0); // Undeclared exception! try { jSONArray0.getSqlDate(2117); fail("Expecting exception: RuntimeException"); } catch(RuntimeException e) { // // can not cast to Date, value : [null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,{\"$ref\":\"@\"}] // verifyException("com.alibaba.fastjson.util.TypeUtils", e); } } @Test(timeout = 4000) public void test076() throws Throwable { JSONArray jSONArray0 = new JSONArray(0); // Undeclared exception! try { jSONArray0.getShortValue((-1)); fail("Expecting exception: ArrayIndexOutOfBoundsException"); } catch(ArrayIndexOutOfBoundsException e) { // // no message in exception (getMessage() returned null) // } } @Test(timeout = 4000) public void test077() throws Throwable { JSONArray jSONArray0 = new JSONArray(); jSONArray0.fluentSet(2117, jSONArray0); // Undeclared exception! try { jSONArray0.getShort(2117); fail("Expecting exception: RuntimeException"); } catch(RuntimeException e) { // // can not cast to short, value : [null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,{\"$ref\":\"@\"}] // verifyException("com.alibaba.fastjson.util.TypeUtils", e); } } @Test(timeout = 4000) public void test078() throws Throwable { JSONArray jSONArray0 = new JSONArray(); // Undeclared exception! try { jSONArray0.getShort((-1)); fail("Expecting exception: ArrayIndexOutOfBoundsException"); } catch(ArrayIndexOutOfBoundsException e) { // // no message in exception (getMessage() returned null) // } } @Test(timeout = 4000) public void test079() throws Throwable { JSONArray jSONArray0 = new JSONArray(1001); Class<Integer> class0 = Integer.class; // Undeclared exception! try { jSONArray0.getObject((-1), (Type) class0); fail("Expecting exception: ArrayIndexOutOfBoundsException"); } catch(ArrayIndexOutOfBoundsException e) { // // no message in exception (getMessage() returned null) // } } @Test(timeout = 4000) public void test080() throws Throwable { JSONArray jSONArray0 = new JSONArray(1); Class<Integer> class0 = Integer.class; // Undeclared exception! try { jSONArray0.getObject((-1), class0); fail("Expecting exception: ArrayIndexOutOfBoundsException"); } catch(ArrayIndexOutOfBoundsException e) { // // no message in exception (getMessage() returned null) // } } @Test(timeout = 4000) public void test081() throws Throwable { JSONArray jSONArray0 = new JSONArray(); // Undeclared exception! try { jSONArray0.getLongValue((-1)); fail("Expecting exception: ArrayIndexOutOfBoundsException"); } catch(ArrayIndexOutOfBoundsException e) { // // no message in exception (getMessage() returned null) // } } @Test(timeout = 4000) public void test082() throws Throwable { JSONArray jSONArray0 = new JSONArray(); jSONArray0.fluentSet(2117, jSONArray0); // Undeclared exception! try { jSONArray0.getLong(2117); fail("Expecting exception: RuntimeException"); } catch(RuntimeException e) { // // can not cast to long, value : [null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,{\"$ref\":\"@\"}] // verifyException("com.alibaba.fastjson.util.TypeUtils", e); } } @Test(timeout = 4000) public void test083() throws Throwable { JSONArray jSONArray0 = new JSONArray(); // Undeclared exception! try { jSONArray0.getLong((-813)); fail("Expecting exception: ArrayIndexOutOfBoundsException"); } catch(ArrayIndexOutOfBoundsException e) { // // no message in exception (getMessage() returned null) // } } @Test(timeout = 4000) public void test084() throws Throwable { JSONArray jSONArray0 = new JSONArray(); // Undeclared exception! try { jSONArray0.getJSONObject(357); fail("Expecting exception: IndexOutOfBoundsException"); } catch(IndexOutOfBoundsException e) { // // Index: 357, Size: 0 // verifyException("java.util.ArrayList", e); } } @Test(timeout = 4000) public void test085() throws Throwable { JSONArray jSONArray0 = new JSONArray(); // Undeclared exception! try { jSONArray0.getJSONObject((-1)); fail("Expecting exception: ArrayIndexOutOfBoundsException"); } catch(ArrayIndexOutOfBoundsException e) { // // no message in exception (getMessage() returned null) // } } @Test(timeout = 4000) public void test086() throws Throwable { JSONArray jSONArray0 = new JSONArray((List<Object>) null); // Undeclared exception! try { jSONArray0.getJSONArray(423); fail("Expecting exception: NullPointerException"); } catch(NullPointerException e) { // // no message in exception (getMessage() returned null) // verifyException("com.alibaba.fastjson.JSONArray", e); } } @Test(timeout = 4000) public void test087() throws Throwable { JSONArray jSONArray0 = new JSONArray(); // Undeclared exception! try { jSONArray0.getInteger((-1)); fail("Expecting exception: ArrayIndexOutOfBoundsException"); } catch(ArrayIndexOutOfBoundsException e) { // // no message in exception (getMessage() returned null) // } } @Test(timeout = 4000) public void test088() throws Throwable { JSONArray jSONArray0 = new JSONArray(); // Undeclared exception! try { jSONArray0.getIntValue((-1)); fail("Expecting exception: ArrayIndexOutOfBoundsException"); } catch(ArrayIndexOutOfBoundsException e) { // // no message in exception (getMessage() returned null) // } } @Test(timeout = 4000) public void test089() throws Throwable { JSONArray jSONArray0 = new JSONArray(); // Undeclared exception! try { jSONArray0.getFloatValue((-1)); fail("Expecting exception: ArrayIndexOutOfBoundsException"); } catch(ArrayIndexOutOfBoundsException e) { // // no message in exception (getMessage() returned null) // } } @Test(timeout = 4000) public void test090() throws Throwable { JSONArray jSONArray0 = new JSONArray(); HashMap<String, Integer> hashMap0 = new HashMap<String, Integer>(); JSONArray jSONArray1 = jSONArray0.fluentSet(1322, hashMap0); // Undeclared exception! try { jSONArray1.getFloat(1322); fail("Expecting exception: RuntimeException"); } catch(RuntimeException e) { // // can not cast to float, value : {} // verifyException("com.alibaba.fastjson.util.TypeUtils", e); } } @Test(timeout = 4000) public void test091() throws Throwable { JSONArray jSONArray0 = new JSONArray(); // Undeclared exception! try { jSONArray0.getFloat((-1)); fail("Expecting exception: ArrayIndexOutOfBoundsException"); } catch(ArrayIndexOutOfBoundsException e) { // // no message in exception (getMessage() returned null) // } } @Test(timeout = 4000) public void test092() throws Throwable { JSONArray jSONArray0 = new JSONArray(0); // Undeclared exception! try { jSONArray0.getDoubleValue((-1)); fail("Expecting exception: ArrayIndexOutOfBoundsException"); } catch(ArrayIndexOutOfBoundsException e) { // // no message in exception (getMessage() returned null) // } } @Test(timeout = 4000) public void test093() throws Throwable { JSONArray jSONArray0 = new JSONArray(); jSONArray0.fluentSet(2117, jSONArray0); // Undeclared exception! try { jSONArray0.getDouble(2117); fail("Expecting exception: RuntimeException"); } catch(RuntimeException e) { // // can not cast to double, value : [null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,{\"$ref\":\"@\"}] // verifyException("com.alibaba.fastjson.util.TypeUtils", e); } } @Test(timeout = 4000) public void test094() throws Throwable { JSONArray jSONArray0 = new JSONArray(); // Undeclared exception! try { jSONArray0.getDouble((-1)); fail("Expecting exception: ArrayIndexOutOfBoundsException"); } catch(ArrayIndexOutOfBoundsException e) { // // no message in exception (getMessage() returned null) // } } @Test(timeout = 4000) public void test095() throws Throwable { JSONArray jSONArray0 = new JSONArray(); // Undeclared exception! try { jSONArray0.getDate(1794); fail("Expecting exception: IndexOutOfBoundsException"); } catch(IndexOutOfBoundsException e) { // // Index: 1794, Size: 0 // verifyException("java.util.ArrayList", e); } } @Test(timeout = 4000) public void test096() throws Throwable { JSONArray jSONArray0 = new JSONArray(1); // Undeclared exception! try { jSONArray0.getDate((-1255)); fail("Expecting exception: ArrayIndexOutOfBoundsException"); } catch(ArrayIndexOutOfBoundsException e) { // // no message in exception (getMessage() returned null) // } } @Test(timeout = 4000) public void test097() throws Throwable { JSONArray jSONArray0 = new JSONArray(); // Undeclared exception! try { jSONArray0.getByteValue((-1)); fail("Expecting exception: ArrayIndexOutOfBoundsException"); } catch(ArrayIndexOutOfBoundsException e) { // // no message in exception (getMessage() returned null) // } } @Test(timeout = 4000) public void test098() throws Throwable { JSONArray jSONArray0 = new JSONArray(); // Undeclared exception! try { jSONArray0.getBooleanValue((-1)); fail("Expecting exception: ArrayIndexOutOfBoundsException"); } catch(ArrayIndexOutOfBoundsException e) { // // no message in exception (getMessage() returned null) // } } @Test(timeout = 4000) public void test099() throws Throwable { JSONArray jSONArray0 = new JSONArray(); // Undeclared exception! try { jSONArray0.getBoolean(2114); fail("Expecting exception: IndexOutOfBoundsException"); } catch(IndexOutOfBoundsException e) { // // Index: 2114, Size: 0 // verifyException("java.util.ArrayList", e); } } @Test(timeout = 4000) public void test100() throws Throwable { JSONArray jSONArray0 = new JSONArray(); // Undeclared exception! try { jSONArray0.getBoolean((-672)); fail("Expecting exception: ArrayIndexOutOfBoundsException"); } catch(ArrayIndexOutOfBoundsException e) { // // no message in exception (getMessage() returned null) // } } @Test(timeout = 4000) public void test101() throws Throwable { JSONArray jSONArray0 = new JSONArray(); SerializerFeature serializerFeature0 = SerializerFeature.WriteClassName; jSONArray0.fluentSet((-1), serializerFeature0); // Undeclared exception! try { jSONArray0.getBigInteger(0); fail("Expecting exception: NumberFormatException"); } catch(NumberFormatException e) { // // For input string: \"com.al\" // verifyException("java.lang.NumberFormatException", e); } } @Test(timeout = 4000) public void test102() throws Throwable { JSONArray jSONArray0 = new JSONArray(); // Undeclared exception! try { jSONArray0.getBigInteger((-1)); fail("Expecting exception: ArrayIndexOutOfBoundsException"); } catch(ArrayIndexOutOfBoundsException e) { // // no message in exception (getMessage() returned null) // } } @Test(timeout = 4000) public void test103() throws Throwable { JSONArray jSONArray0 = new JSONArray(); jSONArray0.fluentSet(468, jSONArray0.DEFAULT_GENERATE_FEATURE); // Undeclared exception! try { jSONArray0.getBigDecimal(468); fail("Expecting exception: NumberFormatException"); } catch(NumberFormatException e) { // // no message in exception (getMessage() returned null) // verifyException("java.math.BigDecimal", e); } } @Test(timeout = 4000) public void test104() throws Throwable { JSONArray jSONArray0 = new JSONArray(); // Undeclared exception! try { jSONArray0.getBigDecimal((-1)); fail("Expecting exception: ArrayIndexOutOfBoundsException"); } catch(ArrayIndexOutOfBoundsException e) { // // no message in exception (getMessage() returned null) // } } @Test(timeout = 4000) public void test105() throws Throwable { JSONArray jSONArray0 = new JSONArray(); // Undeclared exception! jSONArray0.fluentSet(45380, (Object) null); } @Test(timeout = 4000) public void test106() throws Throwable { JSONArray jSONArray0 = new JSONArray(); // Undeclared exception! try { jSONArray0.fluentSet((-2147483647), (Object) null); fail("Expecting exception: ArrayIndexOutOfBoundsException"); } catch(ArrayIndexOutOfBoundsException e) { // // no message in exception (getMessage() returned null) // } } @Test(timeout = 4000) public void test107() throws Throwable { JSONArray jSONArray0 = new JSONArray((List<Object>) null); // Undeclared exception! try { jSONArray0.fluentRetainAll((Collection<?>) null); fail("Expecting exception: NullPointerException"); } catch(NullPointerException e) { // // no message in exception (getMessage() returned null) // verifyException("com.alibaba.fastjson.JSONArray", e); } } @Test(timeout = 4000) public void test108() throws Throwable { JSONArray jSONArray0 = new JSONArray((List<Object>) null); // Undeclared exception! try { jSONArray0.fluentRemove((Object) null); fail("Expecting exception: NullPointerException"); } catch(NullPointerException e) { // // no message in exception (getMessage() returned null) // verifyException("com.alibaba.fastjson.JSONArray", e); } } @Test(timeout = 4000) public void test109() throws Throwable { JSONArray jSONArray0 = new JSONArray((List<Object>) null); // Undeclared exception! try { jSONArray0.fluentRemove((-1984)); fail("Expecting exception: NullPointerException"); } catch(NullPointerException e) { // // no message in exception (getMessage() returned null) // verifyException("com.alibaba.fastjson.JSONArray", e); } } @Test(timeout = 4000) public void test110() throws Throwable { JSONArray jSONArray0 = new JSONArray((List<Object>) null); // Undeclared exception! try { jSONArray0.fluentClear(); fail("Expecting exception: NullPointerException"); } catch(NullPointerException e) { // // no message in exception (getMessage() returned null) // verifyException("com.alibaba.fastjson.JSONArray", e); } } @Test(timeout = 4000) public void test111() throws Throwable { JSONArray jSONArray0 = new JSONArray(); // Undeclared exception! try { jSONArray0.fluentAddAll((Collection<?>) null); fail("Expecting exception: NullPointerException"); } catch(NullPointerException e) { // // no message in exception (getMessage() returned null) // verifyException("java.util.ArrayList", e); } } @Test(timeout = 4000) public void test112() throws Throwable { JSONArray jSONArray0 = new JSONArray(); // Undeclared exception! try { jSONArray0.fluentAddAll((-1), (Collection<?>) jSONArray0); fail("Expecting exception: IndexOutOfBoundsException"); } catch(IndexOutOfBoundsException e) { // // Index: -1, Size: 0 // verifyException("java.util.ArrayList", e); } } @Test(timeout = 4000) public void test113() throws Throwable { JSONArray jSONArray0 = new JSONArray(); // Undeclared exception! try { jSONArray0.containsAll((Collection<?>) null); fail("Expecting exception: NullPointerException"); } catch(NullPointerException e) { } } @Test(timeout = 4000) public void test114() throws Throwable { JSONArray jSONArray0 = new JSONArray(0); JSONArray jSONArray1 = new JSONArray((List<Object>) null); // Undeclared exception! try { jSONArray1.add(663, (Object) jSONArray0); fail("Expecting exception: NullPointerException"); } catch(NullPointerException e) { // // no message in exception (getMessage() returned null) // verifyException("com.alibaba.fastjson.JSONArray", e); } } @Test(timeout = 4000) public void test115() throws Throwable { JSONArray jSONArray0 = null; try { jSONArray0 = new JSONArray((-534)); fail("Expecting exception: IllegalArgumentException"); } catch(IllegalArgumentException e) { // // Illegal Capacity: -534 // verifyException("java.util.ArrayList", e); } } @Test(timeout = 4000) public void test116() throws Throwable { JSONArray jSONArray0 = new JSONArray(); jSONArray0.fluentSet(468, (-1)); jSONArray0.set(445, jSONArray0); assertEquals(469, jSONArray0.size()); } @Test(timeout = 4000) public void test117() throws Throwable { JSONArray jSONArray0 = new JSONArray(); Object object0 = jSONArray0.set((-1), "b?*e|C"); assertNull(object0); } @Test(timeout = 4000) public void test118() throws Throwable { JSONArray jSONArray0 = new JSONArray(); JSONObject jSONObject0 = new JSONObject(949, true); JSONArray jSONArray1 = jSONArray0.fluentAdd((Object) jSONObject0); boolean boolean0 = jSONArray1.contains(jSONObject0); assertTrue(boolean0); } @Test(timeout = 4000) public void test119() throws Throwable { JSONArray jSONArray0 = new JSONArray(); jSONArray0.clear(); assertEquals(989, JSON.DEFAULT_PARSER_FEATURE); } @Test(timeout = 4000) public void test120() throws Throwable { JSONArray jSONArray0 = new JSONArray(1); Object[] objectArray0 = jSONArray0.toArray(); assertEquals(0, objectArray0.length); } @Test(timeout = 4000) public void test121() throws Throwable { JSONArray jSONArray0 = new JSONArray(440); int int0 = jSONArray0.size(); assertEquals(0, int0); } @Test(timeout = 4000) public void test122() throws Throwable { JSONArray jSONArray0 = new JSONArray(); boolean boolean0 = jSONArray0.add((Object) null); assertTrue(boolean0); } @Test(timeout = 4000) public void test123() throws Throwable { JSONArray jSONArray0 = new JSONArray(); JSONArray jSONArray1 = jSONArray0.fluentAdd((Object) jSONArray0); Class<Object> class0 = Object.class; List<Object> list0 = jSONArray1.toJavaList(class0); assertEquals(1, list0.size()); } @Test(timeout = 4000) public void test124() throws Throwable { JSONArray jSONArray0 = new JSONArray(); Class<Annotation> class0 = Annotation.class; List<Annotation> list0 = jSONArray0.toJavaList(class0); assertTrue(list0.isEmpty()); } @Test(timeout = 4000) public void test125() throws Throwable { JSONArray jSONArray0 = new JSONArray(); // Undeclared exception! try { jSONArray0.getDoubleValue(467); fail("Expecting exception: IndexOutOfBoundsException"); } catch(IndexOutOfBoundsException e) { // // Index: 467, Size: 0 // verifyException("java.util.ArrayList", e); } } @Test(timeout = 4000) public void test126() throws Throwable { JSONArray jSONArray0 = new JSONArray(); MockDate mockDate0 = new MockDate((-13), (-1), (-1), (-149), (-149), (-541)); JSONArray jSONArray1 = jSONArray0.fluentSet((-1), mockDate0); // Undeclared exception! try { jSONArray1.getDoubleValue(0); fail("Expecting exception: RuntimeException"); } catch(RuntimeException e) { // // can not cast to double, value : Mon Nov 22 16:21:59 GMT 1886 // verifyException("com.alibaba.fastjson.util.TypeUtils", e); } } @Test(timeout = 4000) public void test127() throws Throwable { JSONArray jSONArray0 = new JSONArray(); jSONArray0.fluentSet(2117, jSONArray0); float float0 = jSONArray0.getFloatValue(1); assertEquals(2118, jSONArray0.size()); assertEquals(0.0F, float0, 0.01F); } @Test(timeout = 4000) public void test128() throws Throwable { JSONArray jSONArray0 = new JSONArray(); jSONArray0.fluentSet(468, jSONArray0.DEFAULT_GENERATE_FEATURE); long long0 = jSONArray0.getLongValue(449); assertEquals(469, jSONArray0.size()); assertEquals(0L, long0); } @Test(timeout = 4000) public void test129() throws Throwable { JSONArray jSONArray0 = new JSONArray(); JSONArray jSONArray1 = jSONArray0.fluentSet(2117, jSONArray0); // Undeclared exception! try { jSONArray1.getLongValue(2117); fail("Expecting exception: RuntimeException"); } catch(RuntimeException e) { // // can not cast to long, value : [null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,{\"$ref\":\"@\"}] // verifyException("com.alibaba.fastjson.util.TypeUtils", e); } } @Test(timeout = 4000) public void test130() throws Throwable { JSONArray jSONArray0 = new JSONArray(); JSONArray jSONArray1 = jSONArray0.fluentSet(2117, jSONArray0); int int0 = jSONArray1.getIntValue(441); assertEquals(2118, jSONArray0.size()); assertEquals(0, int0); } @Test(timeout = 4000) public void test131() throws Throwable { JSONArray jSONArray0 = new JSONArray(); jSONArray0.fluentSet(468, jSONArray0.DEFAULT_PARSER_FEATURE); short short0 = jSONArray0.getShortValue(465); assertEquals(469, jSONArray0.size()); assertEquals((short)0, short0); } @Test(timeout = 4000) public void test132() throws Throwable { JSONArray jSONArray0 = new JSONArray(); JSONArray jSONArray1 = jSONArray0.fluentSet(468, jSONArray0.DEFAULT_PARSER_FEATURE); short short0 = jSONArray1.getShortValue(468); assertEquals(469, jSONArray0.size()); assertEquals((short)989, short0); } @Test(timeout = 4000) public void test133() throws Throwable { JSONArray jSONArray0 = new JSONArray(); // Undeclared exception! try { jSONArray0.getByteValue(2263); fail("Expecting exception: IndexOutOfBoundsException"); } catch(IndexOutOfBoundsException e) { // // Index: 2263, Size: 0 // verifyException("java.util.ArrayList", e); } } @Test(timeout = 4000) public void test134() throws Throwable { JSONArray jSONArray0 = new JSONArray(); JSONArray jSONArray1 = jSONArray0.fluentSet(2117, jSONArray0); // Undeclared exception! try { jSONArray1.getByteValue(2117); fail("Expecting exception: RuntimeException"); } catch(RuntimeException e) { // // can not cast to byte, value : [null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,{\"$ref\":\"@\"}] // verifyException("com.alibaba.fastjson.util.TypeUtils", e); } } @Test(timeout = 4000) public void test135() throws Throwable { JSONArray jSONArray0 = new JSONArray(); byte[] byteArray0 = new byte[14]; ByteArrayInputStream byteArrayInputStream0 = new ByteArrayInputStream(byteArray0); JSONArray jSONArray1 = jSONArray0.fluentSet(144, byteArrayInputStream0); boolean boolean0 = jSONArray1.getBooleanValue((byte)49); assertEquals(145, jSONArray0.size()); assertFalse(boolean0); } @Test(timeout = 4000) public void test136() throws Throwable { JSONArray jSONArray0 = new JSONArray(); jSONArray0.fluentSet(2117, jSONArray0); jSONArray0.getBoolean(889); assertEquals(2118, jSONArray0.size()); } @Test(timeout = 4000) public void test137() throws Throwable { JSONArray jSONArray0 = new JSONArray(); jSONArray0.fluentSet(468, (-1)); jSONArray0.getObject(445, (Type) null); assertEquals(469, jSONArray0.size()); } @Test(timeout = 4000) public void test138() throws Throwable { JSONArray jSONArray0 = new JSONArray(); jSONArray0.fluentSet(2150, jSONArray0); jSONArray0.getJSONArray(2150); assertEquals(2151, jSONArray0.size()); } @Test(timeout = 4000) public void test139() throws Throwable { JSONArray jSONArray0 = new JSONArray(); // Undeclared exception! try { jSONArray0.getJSONArray((-1)); fail("Expecting exception: ArrayIndexOutOfBoundsException"); } catch(ArrayIndexOutOfBoundsException e) { // // no message in exception (getMessage() returned null) // } } @Test(timeout = 4000) public void test140() throws Throwable { JSONArray jSONArray0 = new JSONArray(); jSONArray0.fluentSet(468, jSONArray0.DEFAULT_GENERATE_FEATURE); jSONArray0.getJSONObject(437); assertEquals(469, jSONArray0.size()); } @Test(timeout = 4000) public void test141() throws Throwable { JSONArray jSONArray0 = new JSONArray(); LinkedHashSet<InputStream> linkedHashSet0 = new LinkedHashSet<InputStream>(); PipedInputStream pipedInputStream0 = new PipedInputStream(); linkedHashSet0.add(pipedInputStream0); boolean boolean0 = jSONArray0.containsAll(linkedHashSet0); assertFalse(boolean0); } @Test(timeout = 4000) public void test142() throws Throwable { JSONArray jSONArray0 = new JSONArray(); byte[] byteArray0 = new byte[14]; ByteArrayInputStream byteArrayInputStream0 = new ByteArrayInputStream(byteArray0); JSONArray jSONArray1 = jSONArray0.fluentSet(144, byteArrayInputStream0); boolean boolean0 = jSONArray1.removeAll(jSONArray0); assertEquals(0, jSONArray1.size()); assertTrue(boolean0); } @Test(timeout = 4000) public void test143() throws Throwable { JSONArray jSONArray0 = new JSONArray(); boolean boolean0 = jSONArray0.contains((Object) null); assertFalse(boolean0); } @Test(timeout = 4000) public void test144() throws Throwable { JSONArray jSONArray0 = new JSONArray(); boolean boolean0 = jSONArray0.isEmpty(); assertTrue(boolean0); } @Test(timeout = 4000) public void test145() throws Throwable { JSONArray jSONArray0 = new JSONArray(); jSONArray0.setRelatedArray((Object) null); assertEquals(3089, JSON.DEFAULT_GENERATE_FEATURE); } @Test(timeout = 4000) public void test146() throws Throwable { JSONArray jSONArray0 = new JSONArray(); JSONArray jSONArray1 = jSONArray0.fluentRetainAll(jSONArray0); assertTrue(jSONArray1.isEmpty()); } @Test(timeout = 4000) public void test147() throws Throwable { JSONArray jSONArray0 = new JSONArray(); Object object0 = jSONArray0.getRelatedArray(); assertNull(object0); } @Test(timeout = 4000) public void test148() throws Throwable { JSONArray jSONArray0 = new JSONArray(0); // Undeclared exception! try { jSONArray0.getSqlDate((-1)); fail("Expecting exception: ArrayIndexOutOfBoundsException"); } catch(ArrayIndexOutOfBoundsException e) { // // no message in exception (getMessage() returned null) // } } @Test(timeout = 4000) public void test149() throws Throwable { JSONArray jSONArray0 = new JSONArray(); JSONArray jSONArray1 = new JSONArray(jSONArray0); jSONArray1.fluentSet((-1), jSONArray0); assertEquals(1, jSONArray1.size()); } @Test(timeout = 4000) public void test150() throws Throwable { JSONArray jSONArray0 = new JSONArray(); // Undeclared exception! try { jSONArray0.getTimestamp((-177)); fail("Expecting exception: ArrayIndexOutOfBoundsException"); } catch(ArrayIndexOutOfBoundsException e) { // // no message in exception (getMessage() returned null) // } } @Test(timeout = 4000) public void test151() throws Throwable { JSONArray jSONArray0 = new JSONArray(0); JSONArray jSONArray1 = jSONArray0.fluentAddAll(0, (Collection<?>) jSONArray0); assertEquals(3089, JSON.DEFAULT_GENERATE_FEATURE); } @Test(timeout = 4000) public void test152() throws Throwable { JSONArray jSONArray0 = new JSONArray(); Type type0 = jSONArray0.getComponentType(); assertNull(type0); } @Test(timeout = 4000) public void test153() throws Throwable { JSONArray jSONArray0 = new JSONArray(); jSONArray0.hashCode(); } @Test(timeout = 4000) public void test154() throws Throwable { JSONArray jSONArray0 = new JSONArray(0); jSONArray0.setComponentType((Type) null); assertEquals(989, JSON.DEFAULT_PARSER_FEATURE); } @Test(timeout = 4000) public void test155() throws Throwable { JSONArray jSONArray0 = new JSONArray(); LinkedList<Field> linkedList0 = new LinkedList<Field>(); // Undeclared exception! try { jSONArray0.addAll(1174536705, (Collection<?>) linkedList0); fail("Expecting exception: IndexOutOfBoundsException"); } catch(IndexOutOfBoundsException e) { // // Index: 1174536705, Size: 0 // verifyException("java.util.ArrayList", e); } } @Test(timeout = 4000) public void test156() throws Throwable { JSONArray jSONArray0 = new JSONArray(); boolean boolean0 = jSONArray0.removeAll(jSONArray0); assertFalse(boolean0); } @Test(timeout = 4000) public void test157() throws Throwable { JSONArray jSONArray0 = new JSONArray(); // Undeclared exception! try { jSONArray0.getBigDecimal(468); fail("Expecting exception: IndexOutOfBoundsException"); } catch(IndexOutOfBoundsException e) { // // Index: 468, Size: 0 // verifyException("java.util.ArrayList", e); } } @Test(timeout = 4000) public void test158() throws Throwable { JSONArray jSONArray0 = new JSONArray(); boolean boolean0 = jSONArray0.remove((Object) jSONArray0); assertFalse(boolean0); } @Test(timeout = 4000) public void test159() throws Throwable { JSONArray jSONArray0 = new JSONArray(1); // Undeclared exception! try { jSONArray0.getByte((-1)); fail("Expecting exception: ArrayIndexOutOfBoundsException"); } catch(ArrayIndexOutOfBoundsException e) { // // no message in exception (getMessage() returned null) // } } @Test(timeout = 4000) public void test160() throws Throwable { JSONArray jSONArray0 = new JSONArray((List<Object>) null); // Undeclared exception! try { jSONArray0.getDate(1); fail("Expecting exception: NullPointerException"); } catch(NullPointerException e) { // // no message in exception (getMessage() returned null) // } } @Test(timeout = 4000) public void test161() throws Throwable { JSONArray jSONArray0 = new JSONArray(); ListIterator<Object> listIterator0 = jSONArray0.listIterator(); assertFalse(listIterator0.hasPrevious()); } @Test(timeout = 4000) public void test162() throws Throwable { JSONArray jSONArray0 = new JSONArray(); LinkedHashSet<JSONObject> linkedHashSet0 = new LinkedHashSet<JSONObject>(); boolean boolean0 = jSONArray0.retainAll(linkedHashSet0); assertFalse(boolean0); } @Test(timeout = 4000) public void test163() throws Throwable { JSONArray jSONArray0 = new JSONArray(); boolean boolean0 = jSONArray0.containsAll(jSONArray0); assertTrue(boolean0); } @Test(timeout = 4000) public void test164() throws Throwable { JSONArray jSONArray0 = new JSONArray(); LinkedHashSet<JSONArray> linkedHashSet0 = new LinkedHashSet<JSONArray>(); boolean boolean0 = jSONArray0.addAll((Collection<?>) linkedHashSet0); assertFalse(boolean0); } @Test(timeout = 4000) public void test165() throws Throwable { JSONArray jSONArray0 = new JSONArray(); JSONArray jSONArray1 = jSONArray0.fluentAddAll((Collection<?>) jSONArray0); assertEquals(0, jSONArray1.size()); } @Test(timeout = 4000) public void test166() throws Throwable { JSONArray jSONArray0 = new JSONArray(); JSONArray jSONArray1 = (JSONArray)jSONArray0.clone(); assertTrue(jSONArray1.isEmpty()); } @Test(timeout = 4000) public void test167() throws Throwable { JSONArray jSONArray0 = new JSONArray(); JSONArray jSONArray1 = new JSONArray(jSONArray0); JSONArray jSONArray2 = jSONArray1.fluentClear(); assertEquals(3089, JSON.DEFAULT_GENERATE_FEATURE); } @Test(timeout = 4000) public void test168() throws Throwable { JSONArray jSONArray0 = new JSONArray(); // Undeclared exception! try { jSONArray0.fluentRemove((-1)); fail("Expecting exception: ArrayIndexOutOfBoundsException"); } catch(ArrayIndexOutOfBoundsException e) { // // no message in exception (getMessage() returned null) // } } @Test(timeout = 4000) public void test169() throws Throwable { JSONArray jSONArray0 = new JSONArray(); byte[] byteArray0 = new byte[14]; ByteArrayInputStream byteArrayInputStream0 = new ByteArrayInputStream(byteArray0); JSONArray jSONArray1 = jSONArray0.fluentSet(144, byteArrayInputStream0); boolean boolean0 = jSONArray1.isEmpty(); assertEquals(145, jSONArray0.size()); assertFalse(boolean0); } @Test(timeout = 4000) public void test170() throws Throwable { LinkedHashSet<Integer> linkedHashSet0 = new LinkedHashSet<Integer>(); JSONArray jSONArray0 = new JSONArray((List<Object>) null); // Undeclared exception! try { jSONArray0.fluentAdd(1, (Object) linkedHashSet0); fail("Expecting exception: NullPointerException"); } catch(NullPointerException e) { // // no message in exception (getMessage() returned null) // verifyException("com.alibaba.fastjson.JSONArray", e); } } @Test(timeout = 4000) public void test171() throws Throwable { JSONArray jSONArray0 = new JSONArray(); boolean boolean0 = jSONArray0.equals((Object) null); assertFalse(boolean0); } @Test(timeout = 4000) public void test172() throws Throwable { JSONArray jSONArray0 = new JSONArray(); int int0 = jSONArray0.indexOf(jSONArray0); assertEquals((-1), int0); } @Test(timeout = 4000) public void test173() throws Throwable { JSONArray jSONArray0 = new JSONArray(); // Undeclared exception! try { jSONArray0.remove((-346)); fail("Expecting exception: ArrayIndexOutOfBoundsException"); } catch(ArrayIndexOutOfBoundsException e) { // // no message in exception (getMessage() returned null) // } } @Test(timeout = 4000) public void test174() throws Throwable { JSONArray jSONArray0 = new JSONArray(1); // Undeclared exception! try { jSONArray0.fluentRemoveAll((Collection<?>) null); fail("Expecting exception: NullPointerException"); } catch(NullPointerException e) { // // no message in exception (getMessage() returned null) // verifyException("java.util.Objects", e); } } @Test(timeout = 4000) public void test175() throws Throwable { JSONArray jSONArray0 = new JSONArray(); JSONArray[] jSONArrayArray0 = new JSONArray[1]; JSONArray[] jSONArrayArray1 = jSONArray0.toArray(jSONArrayArray0); assertEquals(1, jSONArrayArray1.length); } @Test(timeout = 4000) public void test176() throws Throwable { JSONArray jSONArray0 = new JSONArray(); JSONArray jSONArray1 = jSONArray0.fluentAdd((Object) "[oyW^"); // Undeclared exception! try { jSONArray1.getJSONObject(0); fail("Expecting exception: ClassCastException"); } catch(ClassCastException e) { // // java.lang.String cannot be cast to com.alibaba.fastjson.JSONObject // verifyException("com.alibaba.fastjson.JSONArray", e); } } @Test(timeout = 4000) public void test177() throws Throwable { JSONArray jSONArray0 = new JSONArray(); // Undeclared exception! try { jSONArray0.getBigInteger(1975); fail("Expecting exception: IndexOutOfBoundsException"); } catch(IndexOutOfBoundsException e) { // // Index: 1975, Size: 0 // verifyException("java.util.ArrayList", e); } } }
[ "granogiovanni90@gmail.com" ]
granogiovanni90@gmail.com
101effb82b1de3865b20111c482291f581397c53
51c4cc8e2e44022fc315b7b424a49c968275aa5e
/eatgo-common/src/main/java/kr/co/fastcampus/eatgo/domain/MenuItem.java
0dab910a20f6fa9cb7189ed33999c5f562f4a8a7
[]
no_license
yongsuChang/RESTful-FastCam
80c929a2c70582707956e4aaf71e9ebbc1e144e2
eb713b0240250b9b22508b2d9845ec3d30054115
refs/heads/master
2023-05-06T05:12:27.013615
2021-05-31T05:47:47
2021-05-31T05:47:47
369,120,572
0
0
null
null
null
null
UTF-8
Java
false
false
556
java
package kr.co.fastcampus.eatgo.domain; import com.fasterxml.jackson.annotation.JsonInclude; import lombok.*; import javax.persistence.Entity; import javax.persistence.GeneratedValue; import javax.persistence.Id; import javax.persistence.Transient; @Entity @Getter @Builder @NoArgsConstructor @AllArgsConstructor public class MenuItem { @Id @GeneratedValue private Long id; @Setter private long restaurantId; private String name; @Transient @JsonInclude(JsonInclude.Include.NON_DEFAULT) private boolean destroy; }
[ "77391211+yongsuChang@users.noreply.github.com" ]
77391211+yongsuChang@users.noreply.github.com
9fc4f01d5d3890c5c870e035c5eb2078e100d737
f8158ef2ac4eb09c3b2762929e656ba8a7604414
/google-ads/src/main/java/com/google/ads/googleads/v1/services/GetAdGroupExtensionSettingRequest.java
7d01aca766fc51337bdb5ddbbc13412f9f64ca56
[ "LicenseRef-scancode-generic-cla", "Apache-2.0" ]
permissive
alejagapatrick/google-ads-java
12e89c371c730a66a7735f87737bd6f3d7d00e07
75591caeabcb6ea716a6067f65501d3af78804df
refs/heads/master
2020-05-24T15:50:40.010030
2019-05-13T12:10:17
2019-05-13T12:10:17
187,341,544
1
0
null
2019-05-18T09:56:19
2019-05-18T09:56:19
null
UTF-8
Java
false
true
21,388
java
// Generated by the protocol buffer compiler. DO NOT EDIT! // source: google/ads/googleads/v1/services/ad_group_extension_setting_service.proto package com.google.ads.googleads.v1.services; /** * <pre> * Request message for * [AdGroupExtensionSettingService.GetAdGroupExtensionSetting][google.ads.googleads.v1.services.AdGroupExtensionSettingService.GetAdGroupExtensionSetting]. * </pre> * * Protobuf type {@code google.ads.googleads.v1.services.GetAdGroupExtensionSettingRequest} */ public final class GetAdGroupExtensionSettingRequest extends com.google.protobuf.GeneratedMessageV3 implements // @@protoc_insertion_point(message_implements:google.ads.googleads.v1.services.GetAdGroupExtensionSettingRequest) GetAdGroupExtensionSettingRequestOrBuilder { private static final long serialVersionUID = 0L; // Use GetAdGroupExtensionSettingRequest.newBuilder() to construct. private GetAdGroupExtensionSettingRequest(com.google.protobuf.GeneratedMessageV3.Builder<?> builder) { super(builder); } private GetAdGroupExtensionSettingRequest() { resourceName_ = ""; } @java.lang.Override public final com.google.protobuf.UnknownFieldSet getUnknownFields() { return this.unknownFields; } private GetAdGroupExtensionSettingRequest( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { this(); if (extensionRegistry == null) { throw new java.lang.NullPointerException(); } int mutable_bitField0_ = 0; com.google.protobuf.UnknownFieldSet.Builder unknownFields = com.google.protobuf.UnknownFieldSet.newBuilder(); try { boolean done = false; while (!done) { int tag = input.readTag(); switch (tag) { case 0: done = true; break; case 10: { java.lang.String s = input.readStringRequireUtf8(); resourceName_ = s; break; } default: { if (!parseUnknownFieldProto3( input, unknownFields, extensionRegistry, tag)) { done = true; } break; } } } } catch (com.google.protobuf.InvalidProtocolBufferException e) { throw e.setUnfinishedMessage(this); } catch (java.io.IOException e) { throw new com.google.protobuf.InvalidProtocolBufferException( e).setUnfinishedMessage(this); } finally { this.unknownFields = unknownFields.build(); makeExtensionsImmutable(); } } public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { return com.google.ads.googleads.v1.services.AdGroupExtensionSettingServiceProto.internal_static_google_ads_googleads_v1_services_GetAdGroupExtensionSettingRequest_descriptor; } @java.lang.Override protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable() { return com.google.ads.googleads.v1.services.AdGroupExtensionSettingServiceProto.internal_static_google_ads_googleads_v1_services_GetAdGroupExtensionSettingRequest_fieldAccessorTable .ensureFieldAccessorsInitialized( com.google.ads.googleads.v1.services.GetAdGroupExtensionSettingRequest.class, com.google.ads.googleads.v1.services.GetAdGroupExtensionSettingRequest.Builder.class); } public static final int RESOURCE_NAME_FIELD_NUMBER = 1; private volatile java.lang.Object resourceName_; /** * <pre> * The resource name of the ad group extension setting to fetch. * </pre> * * <code>string resource_name = 1;</code> */ public java.lang.String getResourceName() { java.lang.Object ref = resourceName_; if (ref instanceof java.lang.String) { return (java.lang.String) ref; } else { com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; java.lang.String s = bs.toStringUtf8(); resourceName_ = s; return s; } } /** * <pre> * The resource name of the ad group extension setting to fetch. * </pre> * * <code>string resource_name = 1;</code> */ public com.google.protobuf.ByteString getResourceNameBytes() { java.lang.Object ref = resourceName_; if (ref instanceof java.lang.String) { com.google.protobuf.ByteString b = com.google.protobuf.ByteString.copyFromUtf8( (java.lang.String) ref); resourceName_ = b; return b; } else { return (com.google.protobuf.ByteString) ref; } } private byte memoizedIsInitialized = -1; @java.lang.Override public final boolean isInitialized() { byte isInitialized = memoizedIsInitialized; if (isInitialized == 1) return true; if (isInitialized == 0) return false; memoizedIsInitialized = 1; return true; } @java.lang.Override public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { if (!getResourceNameBytes().isEmpty()) { com.google.protobuf.GeneratedMessageV3.writeString(output, 1, resourceName_); } unknownFields.writeTo(output); } @java.lang.Override public int getSerializedSize() { int size = memoizedSize; if (size != -1) return size; size = 0; if (!getResourceNameBytes().isEmpty()) { size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, resourceName_); } size += unknownFields.getSerializedSize(); memoizedSize = size; return size; } @java.lang.Override public boolean equals(final java.lang.Object obj) { if (obj == this) { return true; } if (!(obj instanceof com.google.ads.googleads.v1.services.GetAdGroupExtensionSettingRequest)) { return super.equals(obj); } com.google.ads.googleads.v1.services.GetAdGroupExtensionSettingRequest other = (com.google.ads.googleads.v1.services.GetAdGroupExtensionSettingRequest) obj; boolean result = true; result = result && getResourceName() .equals(other.getResourceName()); result = result && unknownFields.equals(other.unknownFields); return result; } @java.lang.Override public int hashCode() { if (memoizedHashCode != 0) { return memoizedHashCode; } int hash = 41; hash = (19 * hash) + getDescriptor().hashCode(); hash = (37 * hash) + RESOURCE_NAME_FIELD_NUMBER; hash = (53 * hash) + getResourceName().hashCode(); hash = (29 * hash) + unknownFields.hashCode(); memoizedHashCode = hash; return hash; } public static com.google.ads.googleads.v1.services.GetAdGroupExtensionSettingRequest parseFrom( java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data); } public static com.google.ads.googleads.v1.services.GetAdGroupExtensionSettingRequest parseFrom( java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data, extensionRegistry); } public static com.google.ads.googleads.v1.services.GetAdGroupExtensionSettingRequest parseFrom( com.google.protobuf.ByteString data) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data); } public static com.google.ads.googleads.v1.services.GetAdGroupExtensionSettingRequest parseFrom( com.google.protobuf.ByteString data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data, extensionRegistry); } public static com.google.ads.googleads.v1.services.GetAdGroupExtensionSettingRequest parseFrom(byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data); } public static com.google.ads.googleads.v1.services.GetAdGroupExtensionSettingRequest parseFrom( byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data, extensionRegistry); } public static com.google.ads.googleads.v1.services.GetAdGroupExtensionSettingRequest parseFrom(java.io.InputStream input) throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3 .parseWithIOException(PARSER, input); } public static com.google.ads.googleads.v1.services.GetAdGroupExtensionSettingRequest parseFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3 .parseWithIOException(PARSER, input, extensionRegistry); } public static com.google.ads.googleads.v1.services.GetAdGroupExtensionSettingRequest parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3 .parseDelimitedWithIOException(PARSER, input); } public static com.google.ads.googleads.v1.services.GetAdGroupExtensionSettingRequest parseDelimitedFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3 .parseDelimitedWithIOException(PARSER, input, extensionRegistry); } public static com.google.ads.googleads.v1.services.GetAdGroupExtensionSettingRequest parseFrom( com.google.protobuf.CodedInputStream input) throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3 .parseWithIOException(PARSER, input); } public static com.google.ads.googleads.v1.services.GetAdGroupExtensionSettingRequest parseFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3 .parseWithIOException(PARSER, input, extensionRegistry); } @java.lang.Override public Builder newBuilderForType() { return newBuilder(); } public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); } public static Builder newBuilder(com.google.ads.googleads.v1.services.GetAdGroupExtensionSettingRequest prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } @java.lang.Override public Builder toBuilder() { return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); } @java.lang.Override protected Builder newBuilderForType( com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { Builder builder = new Builder(parent); return builder; } /** * <pre> * Request message for * [AdGroupExtensionSettingService.GetAdGroupExtensionSetting][google.ads.googleads.v1.services.AdGroupExtensionSettingService.GetAdGroupExtensionSetting]. * </pre> * * Protobuf type {@code google.ads.googleads.v1.services.GetAdGroupExtensionSettingRequest} */ public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder<Builder> implements // @@protoc_insertion_point(builder_implements:google.ads.googleads.v1.services.GetAdGroupExtensionSettingRequest) com.google.ads.googleads.v1.services.GetAdGroupExtensionSettingRequestOrBuilder { public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { return com.google.ads.googleads.v1.services.AdGroupExtensionSettingServiceProto.internal_static_google_ads_googleads_v1_services_GetAdGroupExtensionSettingRequest_descriptor; } @java.lang.Override protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable() { return com.google.ads.googleads.v1.services.AdGroupExtensionSettingServiceProto.internal_static_google_ads_googleads_v1_services_GetAdGroupExtensionSettingRequest_fieldAccessorTable .ensureFieldAccessorsInitialized( com.google.ads.googleads.v1.services.GetAdGroupExtensionSettingRequest.class, com.google.ads.googleads.v1.services.GetAdGroupExtensionSettingRequest.Builder.class); } // Construct using com.google.ads.googleads.v1.services.GetAdGroupExtensionSettingRequest.newBuilder() private Builder() { maybeForceBuilderInitialization(); } private Builder( com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { super(parent); maybeForceBuilderInitialization(); } private void maybeForceBuilderInitialization() { if (com.google.protobuf.GeneratedMessageV3 .alwaysUseFieldBuilders) { } } @java.lang.Override public Builder clear() { super.clear(); resourceName_ = ""; return this; } @java.lang.Override public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { return com.google.ads.googleads.v1.services.AdGroupExtensionSettingServiceProto.internal_static_google_ads_googleads_v1_services_GetAdGroupExtensionSettingRequest_descriptor; } @java.lang.Override public com.google.ads.googleads.v1.services.GetAdGroupExtensionSettingRequest getDefaultInstanceForType() { return com.google.ads.googleads.v1.services.GetAdGroupExtensionSettingRequest.getDefaultInstance(); } @java.lang.Override public com.google.ads.googleads.v1.services.GetAdGroupExtensionSettingRequest build() { com.google.ads.googleads.v1.services.GetAdGroupExtensionSettingRequest result = buildPartial(); if (!result.isInitialized()) { throw newUninitializedMessageException(result); } return result; } @java.lang.Override public com.google.ads.googleads.v1.services.GetAdGroupExtensionSettingRequest buildPartial() { com.google.ads.googleads.v1.services.GetAdGroupExtensionSettingRequest result = new com.google.ads.googleads.v1.services.GetAdGroupExtensionSettingRequest(this); result.resourceName_ = resourceName_; onBuilt(); return result; } @java.lang.Override public Builder clone() { return (Builder) super.clone(); } @java.lang.Override public Builder setField( com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { return (Builder) super.setField(field, value); } @java.lang.Override public Builder clearField( com.google.protobuf.Descriptors.FieldDescriptor field) { return (Builder) super.clearField(field); } @java.lang.Override public Builder clearOneof( com.google.protobuf.Descriptors.OneofDescriptor oneof) { return (Builder) super.clearOneof(oneof); } @java.lang.Override public Builder setRepeatedField( com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { return (Builder) super.setRepeatedField(field, index, value); } @java.lang.Override public Builder addRepeatedField( com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { return (Builder) super.addRepeatedField(field, value); } @java.lang.Override public Builder mergeFrom(com.google.protobuf.Message other) { if (other instanceof com.google.ads.googleads.v1.services.GetAdGroupExtensionSettingRequest) { return mergeFrom((com.google.ads.googleads.v1.services.GetAdGroupExtensionSettingRequest)other); } else { super.mergeFrom(other); return this; } } public Builder mergeFrom(com.google.ads.googleads.v1.services.GetAdGroupExtensionSettingRequest other) { if (other == com.google.ads.googleads.v1.services.GetAdGroupExtensionSettingRequest.getDefaultInstance()) return this; if (!other.getResourceName().isEmpty()) { resourceName_ = other.resourceName_; onChanged(); } this.mergeUnknownFields(other.unknownFields); onChanged(); return this; } @java.lang.Override public final boolean isInitialized() { return true; } @java.lang.Override public Builder mergeFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { com.google.ads.googleads.v1.services.GetAdGroupExtensionSettingRequest parsedMessage = null; try { parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); } catch (com.google.protobuf.InvalidProtocolBufferException e) { parsedMessage = (com.google.ads.googleads.v1.services.GetAdGroupExtensionSettingRequest) e.getUnfinishedMessage(); throw e.unwrapIOException(); } finally { if (parsedMessage != null) { mergeFrom(parsedMessage); } } return this; } private java.lang.Object resourceName_ = ""; /** * <pre> * The resource name of the ad group extension setting to fetch. * </pre> * * <code>string resource_name = 1;</code> */ public java.lang.String getResourceName() { java.lang.Object ref = resourceName_; if (!(ref instanceof java.lang.String)) { com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; java.lang.String s = bs.toStringUtf8(); resourceName_ = s; return s; } else { return (java.lang.String) ref; } } /** * <pre> * The resource name of the ad group extension setting to fetch. * </pre> * * <code>string resource_name = 1;</code> */ public com.google.protobuf.ByteString getResourceNameBytes() { java.lang.Object ref = resourceName_; if (ref instanceof String) { com.google.protobuf.ByteString b = com.google.protobuf.ByteString.copyFromUtf8( (java.lang.String) ref); resourceName_ = b; return b; } else { return (com.google.protobuf.ByteString) ref; } } /** * <pre> * The resource name of the ad group extension setting to fetch. * </pre> * * <code>string resource_name = 1;</code> */ public Builder setResourceName( java.lang.String value) { if (value == null) { throw new NullPointerException(); } resourceName_ = value; onChanged(); return this; } /** * <pre> * The resource name of the ad group extension setting to fetch. * </pre> * * <code>string resource_name = 1;</code> */ public Builder clearResourceName() { resourceName_ = getDefaultInstance().getResourceName(); onChanged(); return this; } /** * <pre> * The resource name of the ad group extension setting to fetch. * </pre> * * <code>string resource_name = 1;</code> */ public Builder setResourceNameBytes( com.google.protobuf.ByteString value) { if (value == null) { throw new NullPointerException(); } checkByteStringIsUtf8(value); resourceName_ = value; onChanged(); return this; } @java.lang.Override public final Builder setUnknownFields( final com.google.protobuf.UnknownFieldSet unknownFields) { return super.setUnknownFieldsProto3(unknownFields); } @java.lang.Override public final Builder mergeUnknownFields( final com.google.protobuf.UnknownFieldSet unknownFields) { return super.mergeUnknownFields(unknownFields); } // @@protoc_insertion_point(builder_scope:google.ads.googleads.v1.services.GetAdGroupExtensionSettingRequest) } // @@protoc_insertion_point(class_scope:google.ads.googleads.v1.services.GetAdGroupExtensionSettingRequest) private static final com.google.ads.googleads.v1.services.GetAdGroupExtensionSettingRequest DEFAULT_INSTANCE; static { DEFAULT_INSTANCE = new com.google.ads.googleads.v1.services.GetAdGroupExtensionSettingRequest(); } public static com.google.ads.googleads.v1.services.GetAdGroupExtensionSettingRequest getDefaultInstance() { return DEFAULT_INSTANCE; } private static final com.google.protobuf.Parser<GetAdGroupExtensionSettingRequest> PARSER = new com.google.protobuf.AbstractParser<GetAdGroupExtensionSettingRequest>() { @java.lang.Override public GetAdGroupExtensionSettingRequest parsePartialFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { return new GetAdGroupExtensionSettingRequest(input, extensionRegistry); } }; public static com.google.protobuf.Parser<GetAdGroupExtensionSettingRequest> parser() { return PARSER; } @java.lang.Override public com.google.protobuf.Parser<GetAdGroupExtensionSettingRequest> getParserForType() { return PARSER; } @java.lang.Override public com.google.ads.googleads.v1.services.GetAdGroupExtensionSettingRequest getDefaultInstanceForType() { return DEFAULT_INSTANCE; } }
[ "nwbirnie@gmail.com" ]
nwbirnie@gmail.com
24280d99526011df37da2b5a2f8cd7d6c9c58837
94228df04c8d71ef72d0278ed049e9eac43566bc
/modules/secure/secure-provider/src/main/java/com/bjike/goddess/secure/api/AttachedEndApiImpl.java
d095238fff6841887a443f9c5ab6635ae01aa001
[]
no_license
yang65700/goddess-java
b1c99ac4626c29651250969d58d346b7a13eb9ad
3f982a3688ee7c97d8916d9cb776151b5af8f04f
refs/heads/master
2021-04-12T11:10:39.345659
2017-09-12T02:32:51
2017-09-12T02:32:51
126,562,737
0
0
null
2018-03-24T03:33:53
2018-03-24T03:33:53
null
UTF-8
Java
false
false
1,790
java
package com.bjike.goddess.secure.api; import com.bjike.goddess.common.api.exception.SerException; import com.bjike.goddess.secure.bo.AttachedEndBO; import com.bjike.goddess.secure.dto.AttachedEndDTO; import com.bjike.goddess.secure.service.AttachedEndSer; import com.bjike.goddess.secure.to.AttachedEndTO; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import java.util.List; /** * 挂靠到期业务接口实现 * * @Author: [ chenjunhao ] * @Date: [ 2017-04-24 10:04 ] * @Description: [ 挂靠到期业务接口实现 ] * @Version: [ v1.0.0 ] * @Copy: [ com.bjike ] */ @Service("attachedEndApiImpl") public class AttachedEndApiImpl implements AttachedEndAPI { @Autowired private AttachedEndSer attachedEndSer; @Override public AttachedEndBO save(AttachedEndTO to) throws SerException { return attachedEndSer.save(to); } @Override public AttachedEndBO is_Again(AttachedEndTO to) throws SerException { return attachedEndSer.is_Again(to); } @Override public List<AttachedEndBO> find(AttachedEndDTO dto) throws SerException { return attachedEndSer.find(dto); } @Override public AttachedEndBO findByID(String id) throws SerException { return attachedEndSer.findByID(id); } @Override public AttachedEndBO delete(String id) throws SerException { return attachedEndSer.delete(id); } @Override public void send() throws SerException { attachedEndSer.send(); } @Override public void quartz() throws SerException { attachedEndSer.quartz(); } @Override public Long count(AttachedEndDTO dto) throws SerException { return attachedEndSer.count(dto); } }
[ "chenjunhao_aj@163.com" ]
chenjunhao_aj@163.com
f39cf9bd19f9dfb9b050718c4eccfdda46f4a33e
47070445674f45b416f9ad0a7ad9e43f831791a4
/src/jvm/cmd/BiPushCmd.java
d67c9d83dc11c20a0464c1812d2133adb5649c28
[]
no_license
gaozhuolun/miniJVM
71fc9df103c9c0d2ee4500bf8ddbdb10b354bcf9
f143b6ee56478ecce4b9209b7aff6f0306d274b0
refs/heads/master
2021-05-07T20:07:00.310451
2017-10-31T04:53:57
2017-10-31T04:53:57
108,946,587
0
1
null
null
null
null
UTF-8
Java
false
false
712
java
package jvm.cmd; import jvm.clz.ClassFile; import jvm.constant.ConstantInfo; import jvm.constant.ConstantPool; import jvm.engine.ExecutionResult; import jvm.engine.Heap; import jvm.engine.JavaObject; import jvm.engine.StackFrame; public class BiPushCmd extends OneOperandCmd { public BiPushCmd(ClassFile clzFile,String opCode) { super(clzFile,opCode); } @Override public String toString() { return this.getOffset()+":"+ this.getOpCode()+" " + this.getReadableCodeText() + " " + this.getOperand(); } public void execute(StackFrame frame,ExecutionResult result){ int value = this.getOperand(); JavaObject jo = Heap.getInstance().newInt(value); frame.getOprandStack().push(jo); } }
[ "gzhuolun@163.com" ]
gzhuolun@163.com
bddd6eb07ea3e49deeabc06ae1f0d7e14102895f
e08518a65ccca1426d6d1f320eb5d51c9bbb700d
/src/course/csv/Part1.java
38049b8d79a5b83c98f118b6b6547702f043b359
[ "MIT" ]
permissive
bmind12/Java-Programming-Solving-Problems-with-Software
f768e247f40ec0a39e2a6f12ae18db6eff46e597
e7d236132de877e947c367594e2da64a3b263ef2
refs/heads/master
2022-11-16T07:03:25.187555
2020-07-13T01:48:54
2020-07-13T01:48:54
275,378,639
0
0
MIT
2020-07-13T01:48:55
2020-06-27T13:33:42
Java
UTF-8
Java
false
false
2,386
java
package course.csv; import edu.duke.*; import org.apache.commons.csv.*; import javax.print.DocFlavor; public class Part1 { public static void main(String[] args) { tester(); } private static void tester() { FileResource fr = new FileResource("./assets/03-01-csv/exportdata.csv"); CSVParser parser = fr.getCSVParser(); // String test1 = countryInfo(parser,"Germany"); // System.out.println(test1); // Germany: motor vehicles, machinery, chemicals: $1,547,000,000,000 // parser = fr.getCSVParser(); // reset // listExportersTwoProducts(parser, "cotton", "flowers"); // Namibia, South Africa // parser = fr.getCSVParser(); // int test2 = numberOfExporters(parser, "cocoa"); // System.out.println(test2); // 3 parser = fr.getCSVParser(); bigExporters(parser, "$999,999,999,999"); } private static String countryInfo(CSVParser parser, String country) { for (CSVRecord record : parser) { if (record.get("Country").contains(country)) { String exports = record.get("Exports"); String exportValue = record.get("Value (dollars)"); return country + ": " + exports + ": " + exportValue; }; } return "NOT FOUND"; } private static void listExportersTwoProducts(CSVParser parser, String exportItem1, String exportItem2) { for (CSVRecord record : parser) { String exports = record.get("Exports"); if (exports.contains(exportItem1) && exports.contains(exportItem2)) { System.out.println(record.get("Country")); } } } private static int numberOfExporters(CSVParser parser, String exportItem) { int count = 0; for (CSVRecord record : parser) { String exports = record.get("Exports"); if (exports.contains(exportItem)) { count++; } } return count; } private static void bigExporters(CSVParser parser, String amount) { // $400,000,000 for (CSVRecord record : parser) { String exportValue = record.get("Value (dollars)"); if (exportValue.length() > amount.length()) { System.out.println(record.get("Country") + " " + exportValue); } } } }
[ "ryabovs@yahoo.com" ]
ryabovs@yahoo.com
d0ae0d83bb7bb754984f85883e72b9baba0756e8
9a04a6893e65ae0230dafd8ccab439371d895962
/study-elastic-job-reg/src/test/java/com/ejob/reg/zookeeper/ZookeeperRegistryCenterTest.java
dd4a11335a13c753270a29a7ad70e78f6cf08d84
[]
no_license
DukeXia/study-elastic-job
14bb7ab6139b0d261ff575d7b636b5cb6eb3aa7d
2a957c3ea15a4f6d2d148fd3e9941ffb32a2df75
refs/heads/master
2020-12-03T08:14:05.128831
2016-02-24T15:14:00
2016-02-24T15:14:00
null
0
0
null
null
null
null
UTF-8
Java
false
false
735
java
package com.ejob.reg.zookeeper; import com.ejob.reg.base.CoordinatorRegistryCenter; import com.sun.tools.javac.util.Assert; import org.junit.Test; import static org.junit.Assert.*; /** * Created by wanghongxing on 16/2/21. */ public class ZookeeperRegistryCenterTest { @Test public void testInit() throws Exception { ZookeeperConfiguration zkConfig = new ZookeeperConfiguration( "127.0.0.1:2181,127.0.0.1:2182,127.0.0.1:2183", "test ejob reg", 1000, 3000, 3); CoordinatorRegistryCenter regCenter = new ZookeeperRegistryCenter(zkConfig); regCenter.init();//block 直到连上zk Assert.check(true); } }
[ "hongxingwang@sohu-inc.com" ]
hongxingwang@sohu-inc.com
b4372867fcd06c383cafe234e2bafdaa2d0eff40
61b0a0172561b5545952099f47556969e01028f6
/Proyecto2/src/Estructuras/Bitacora_Pila/main.java
03f5aaffc68d37a1fbf37fb67f8e6cc5f7929399
[ "MIT" ]
permissive
Eduardo01004/EDD_2S2019_PY2_201612124
e2ee4e2c3829b92cc16c2a6b1bb7fc39f6b123b7
a1fcfb6e059be0520626380a78d4061d9a86ff68
refs/heads/master
2020-08-26T22:48:37.815560
2019-11-23T20:23:42
2019-11-23T20:23:42
217,171,766
3
0
null
null
null
null
UTF-8
Java
false
false
737
java
/* * To change this license header, choose License Headers in Project Properties. * To change this template file, choose Tools | Templates * and open the template in the editor. */ package Estructuras.Bitacora_Pila; /** * * @author Eduardo */ public class main { public static void main(String[] args) { Bitacora_Pila pila= new Bitacora_Pila(); pila.Insertar("25/10/2019", "16:40", "elimino"+"1","Saul"); pila.Insertar("26/10/2019", "16:41", "elimino","Saul"); pila.Insertar("27/10/2019", "16:42", "elimino","Saul"); pila.Insertar("28/10/2019", "16:43", "elimino","Saul"); pila.Insertar("29/10/2019", "16:44", "elimino","Saul"); pila.Mostrar(); } }
[ "eduardotun27@gmail.com" ]
eduardotun27@gmail.com
aa5535381cf4e9811ac13bbd1ef5e46d993aee2a
d058e3392e06f60224897656421ce3776e652f64
/app/src/main/java/app/sleep/detect/utils/AppExecutors.java
09d423928fd4e8a6c61d9a3f86403f495f54fabf
[]
no_license
svvashishtha/SleepTimeDetector
67c40bfe77a6961795923a6d8f0c83b6ad72c749
16ffe6669cb8d823a1da2eb183992719b3b04db1
refs/heads/master
2020-05-03T14:59:48.519780
2019-04-01T15:06:12
2019-04-01T15:06:12
178,693,882
0
0
null
null
null
null
UTF-8
Java
false
false
1,315
java
package app.sleep.detect.utils; import android.os.Handler; import android.os.Looper; import java.util.concurrent.Executor; import java.util.concurrent.Executors; import androidx.annotation.NonNull; import androidx.annotation.VisibleForTesting; public class AppExecutors { private static final int THREAD_COUNT = 3; private final Executor diskIO; private final Executor backgroundIO; private final Executor mainThread; @VisibleForTesting AppExecutors(Executor diskIO, Executor backgroundIO, Executor mainThread) { this.diskIO = diskIO; this.backgroundIO = backgroundIO; this.mainThread = mainThread; } public AppExecutors() { this(new DiskIOThreadExecutor(), Executors.newFixedThreadPool(THREAD_COUNT), new MainThreadExecutor()); } public Executor diskIO() { return diskIO; } public Executor backgroundIO() { return backgroundIO; } public Executor mainThread() { return mainThread; } private static class MainThreadExecutor implements Executor { private Handler mainThreadHandler = new Handler(Looper.getMainLooper()); @Override public void execute(@NonNull Runnable command) { mainThreadHandler.post(command); } } }
[ "svvashishtha@gmail.com" ]
svvashishtha@gmail.com
e3bfff28c98faee5ea81201d4bd93e8d35b7a4fb
b780c6d51def4f6631535d5751fc2b1bc40072c7
/bugswarm-sandbox/bugs/wmixvideo/nfe/128705454/pre_bug/src/test/java/com/fincatto/nfe310/classes/nota/NFGeraQRCodeTest.java
add36912841a34aea336cc12d3fd0debc89b6d06
[]
no_license
FranciscoRibeiro/bugswarm-case-studies
95fad7a9b3d78fcdd2d3941741163ad73e439826
b2fb9136c3dcdd218b80db39a8a1365bf0842607
refs/heads/master
2023-07-08T05:27:27.592054
2021-08-19T17:27:54
2021-08-19T17:27:54
null
0
0
null
null
null
null
UTF-8
Java
false
false
2,712
java
package com.fincatto.nfe310.classes.nota; import java.io.IOException; import java.security.NoSuchAlgorithmException; import org.junit.Assert; import org.junit.Test; import com.fincatto.nfe310.FabricaDeObjetosFake; import com.fincatto.nfe310.NFeConfig; import com.fincatto.nfe310.classes.NFAmbiente; import com.fincatto.nfe310.classes.NFTipoEmissao; import com.fincatto.nfe310.classes.NFUnidadeFederativa; import com.fincatto.nfe310.utils.NFGeraQRCode; public class NFGeraQRCodeTest { //EXEMPLO DO MANUAL DA RECEITA public static final String URL_TEST = "?chNFe=28140300156225000131650110000151341562040824&nVersao=100&tpAmb=1&cDest=13017959000181&dhEmi=323031342d30332d31385431303a35353a33332d30333a3030&vNF=60.90&vICMS=12.75&digVal=797a4759685578312f5859597a6b7357422b6650523351633530633d&cIdToken=000001&cHashQRCode=329f9d7b9fc5650372c1b2699ab88e9e22e0d33a"; @Test public void geraQRCodeConformeEsperado() throws NoSuchAlgorithmException { final NFNota nota = FabricaDeObjetosFake.getNotaQRCode(); NFGeraQRCode qr = new NFGeraQRCode(nota, createConfigTest()); String qrCode = qr.getQRCode(); nota.setInfoSuplementar(new NFNotaInfoSuplementar()); nota.getInfoSuplementar().setQrCode(qrCode); String urlUf = nota.getInfo().getIdentificacao().getUf().getQrCodeProducao(); Assert.assertEquals(urlUf+URL_TEST, nota.getInfoSuplementar().getQrCode()); } @Test public void geraSHA1() throws Exception{ String entrada = "chNFe=28140300156225000131650110000151341562040824&nVersao=100&tpAmb=1&cDest=13017959000181&dhEmi=323031342d30332d31385431303a35353a33332d30333a3030&vNF=60.90&vICMS=12.75&digVal=797a4759685578312f5859597a6b7357422b6650523351633530633d&cIdToken=000001SEU-CODIGO-CSC-CONTRIBUINTE-36-CARACTERES"; String saida = NFGeraQRCode.sha1(entrada); Assert.assertEquals(saida, "329f9d7b9fc5650372c1b2699ab88e9e22e0d33a"); } private NFeConfig createConfigTest() { return new NFeConfig() { @Override public Integer getCodigoSegurancaContribuinteID() { return 1; } @Override public String getCodigoSegurancaContribuinte() { return "SEU-CODIGO-CSC-CONTRIBUINTE-36-CARACTERES"; } @Override public NFUnidadeFederativa getCUF() { return NFUnidadeFederativa.SE; } @Override public NFAmbiente getAmbiente() { return NFAmbiente.PRODUCAO; } public NFTipoEmissao getTipoEmissao() {return null;} public String getSSLProtocolo() {return null;} public String getCertificadoSenha() {return null;} public byte[] getCertificado() throws IOException {return null;} public String getCadeiaCertificadosSenha() {return null;} public byte[] getCadeiaCertificados() throws IOException {return null;} }; } }
[ "kikoribeiro95@gmail.com" ]
kikoribeiro95@gmail.com
33d6a0a99dccfa71c880b4611386856ee05f294b
c6fae84fe3ccc8cc065eb160d6d911f36a0ea486
/src/test/java/sn/isi/security/SecurityUtilsUnitTest.java
f36d7f9a9edf279bf252aba0ce5dc7854bbf46ef
[]
no_license
Napalous/projetgatway
817523fab62c8cf949a818d57535f713447edac9
41bb72c9e6ff5a9732eeb789f6a3a4c0bdd0d57e
refs/heads/main
2023-03-29T01:26:41.067503
2021-03-28T09:50:18
2021-03-28T09:50:18
352,292,286
0
1
null
null
null
null
UTF-8
Java
false
false
2,849
java
package sn.isi.security; import static org.assertj.core.api.Assertions.assertThat; import static org.springframework.security.oauth2.core.oidc.endpoint.OidcParameterNames.ID_TOKEN; import java.time.Instant; import java.util.*; import org.junit.jupiter.api.AfterEach; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; import org.springframework.security.authentication.UsernamePasswordAuthenticationToken; import org.springframework.security.core.GrantedAuthority; import org.springframework.security.core.authority.SimpleGrantedAuthority; import org.springframework.security.core.context.ReactiveSecurityContextHolder; import reactor.util.context.Context; /** * Test class for the {@link SecurityUtils} utility class. */ class SecurityUtilsUnitTest { @Test void testgetCurrentUserLogin() { String login = SecurityUtils .getCurrentUserLogin() .subscriberContext(ReactiveSecurityContextHolder.withAuthentication(new UsernamePasswordAuthenticationToken("admin", "admin"))) .block(); assertThat(login).isEqualTo("admin"); } @Test void testIsAuthenticated() { Boolean isAuthenticated = SecurityUtils .isAuthenticated() .subscriberContext(ReactiveSecurityContextHolder.withAuthentication(new UsernamePasswordAuthenticationToken("admin", "admin"))) .block(); assertThat(isAuthenticated).isTrue(); } @Test void testAnonymousIsNotAuthenticated() { Collection<GrantedAuthority> authorities = new ArrayList<>(); authorities.add(new SimpleGrantedAuthority(AuthoritiesConstants.ANONYMOUS)); Boolean isAuthenticated = SecurityUtils .isAuthenticated() .subscriberContext( ReactiveSecurityContextHolder.withAuthentication(new UsernamePasswordAuthenticationToken("admin", "admin", authorities)) ) .block(); assertThat(isAuthenticated).isFalse(); } @Test void testHasCurrentUserThisAuthority() { Collection<GrantedAuthority> authorities = new ArrayList<>(); authorities.add(new SimpleGrantedAuthority(AuthoritiesConstants.USER)); Context context = ReactiveSecurityContextHolder.withAuthentication( new UsernamePasswordAuthenticationToken("admin", "admin", authorities) ); Boolean hasCurrentUserThisAuthority = SecurityUtils .hasCurrentUserThisAuthority(AuthoritiesConstants.USER) .subscriberContext(context) .block(); assertThat(hasCurrentUserThisAuthority).isTrue(); hasCurrentUserThisAuthority = SecurityUtils.hasCurrentUserThisAuthority(AuthoritiesConstants.ADMIN).subscriberContext(context).block(); assertThat(hasCurrentUserThisAuthority).isFalse(); } }
[ "napalousmanadda@gmail.com" ]
napalousmanadda@gmail.com
e11109d6974e52d0d0f520e98ba2b5cc82f71068
a36fd098a9e13250e723f0df99f65e552120c48b
/src/main/java/com/buihoanggia/entity/Json_SanPham.java
abad64cf32a1a4bf84e36336dcf69ae2bf2d6871
[]
no_license
giabui24/webbansach
0a6ef420d3bda14e30d5180cf06d229009e42227
44ddeff0d1612269409f4a03a432913adf73bbf0
refs/heads/master
2023-06-11T16:45:37.145816
2021-07-01T12:53:09
2021-07-01T12:53:09
360,917,177
0
0
null
null
null
null
UTF-8
Java
false
false
354
java
package com.buihoanggia.entity; public class Json_SanPham { int masanpham; String tensanpham; public int getMasanpham() { return masanpham; } public void setMasanpham(int masanpham) { this.masanpham = masanpham; } public String getTensanpham() { return tensanpham; } public void setTensanpham(String tensanpham) { this.tensanpham = tensanpham; } }
[ "giabui24@gmail.com" ]
giabui24@gmail.com
3eb092e576d7d8f1cee968e726e8f2bc7774e67d
f3414e405d68daa615b8010a949847b3fb7bd5b9
/utilities/idcserver.src/intradoc/server/SubjectCallback.java
65bfa91713c6dab72474e36265f0fcc2f9d8625b
[]
no_license
osgirl/ProjectUCM
ac2c1d554746c360f24414d96e85a6c61e31b102
5e0cc24cfad53d1f359d369d57b622c259f88311
refs/heads/master
2020-04-22T04:11:13.373873
2019-03-04T19:26:48
2019-03-04T19:26:48
170,114,287
0
0
null
2019-02-11T11:02:25
2019-02-11T11:02:25
null
UTF-8
Java
false
false
754
java
package intradoc.server; import intradoc.common.ExecutionContext; import intradoc.common.ServiceException; import intradoc.data.DataBinder; import intradoc.data.DataException; public abstract interface SubjectCallback { public static final String IDC_VERSION_INFO = "releaseInfo=7.3.5.185,relengDate=2013-07-11 17:07:21Z,releaseRevision=$Rev: 66660 $"; public abstract void refresh(String paramString) throws DataException, ServiceException; public abstract void loadBinder(String paramString, DataBinder paramDataBinder, ExecutionContext paramExecutionContext); } /* Location: C:\Documents and Settings\rastogia.EMEA\My Documents\idcserver\ * Qualified Name: intradoc.server.SubjectCallback * JD-Core Version: 0.5.4 */
[ "ranjodh.singh@hays.com" ]
ranjodh.singh@hays.com
5a27ef2d294fd8e2e86c759d14197895dcb25935
3621e884123f260364f7110d01b8db341ae3c633
/src/main/java/com/ads/voteapi/shared/utils/JsonUtil.java
f1eada13b5fbe64892401d8b0ec6eabfe4ae2cec
[]
no_license
AndersonSAndrade/vote-api
47fbb98fb1d4e4ee26684553df812fe20fcb9719
cfb73360aa8ff4eab4c45bb30c02556fe9eea2f7
refs/heads/developer
2023-09-06T10:21:41.691993
2021-11-19T17:28:40
2021-11-19T17:28:40
428,698,517
1
1
null
2022-04-26T01:56:58
2021-11-16T14:56:16
Java
UTF-8
Java
false
false
571
java
package com.ads.voteapi.shared.utils; import com.google.gson.Gson; import com.google.gson.GsonBuilder; /** * @author : Anderson S. Andrade * @since : 18/11/21, quinta-feira **/ public class JsonUtil { /** * Convert object to json * @param obj * @return String * @author Anderson S. Andrade */ public static String toJson(Object obj){ GsonBuilder gsonBuilder = new GsonBuilder(); gsonBuilder.setDateFormat("yyyy-MM-dd'T'HH:mm:ss"); Gson gson = gsonBuilder.create(); return gson.toJson(obj); } }
[ "itcodetechs@gmail.com" ]
itcodetechs@gmail.com