Unnamed: 0 int64 0 9.45k | cwe_id stringclasses 1
value | source stringlengths 37 2.53k | target stringlengths 19 2.4k |
|---|---|---|---|
600 | public void actionPerformed(NodeActionEvent e){
final Project project = (Project) functionModule.getProject();
AzureSignInAction.signInIfNotSignedIn(project).subscribe((isLoggedIn) -> {
if (isLoggedIn && AzureLoginHelper.isAzureSubsAvailableOrReportError(message("common.error.signIn"))) {
... | public void actionPerformed(NodeActionEvent e){
final Project project = (Project) functionModule.getProject();
AzureSignInAction.requireSignedIn(project, () -> this.openDialog(project, null));
} | |
601 | protected void deleteVertex(AtlasVertex instanceVertex, boolean force) throws AtlasException{
LOG.debug("Setting the external references to {} to null(removing edges)", string(instanceVertex));
Iterator<AtlasEdge> edges = instanceVertex.getEdges(AtlasEdgeDirection.IN).iterator();
while (edges.hasNext()) ... | protected void deleteVertex(AtlasVertex instanceVertex, boolean force) throws AtlasException{
LOG.debug("Setting the external references to {} to null(removing edges)", string(instanceVertex));
for (AtlasEdge edge : (Iterable<AtlasEdge>) instanceVertex.getEdges(AtlasEdgeDirection.IN)) {
Id.EntityStat... | |
602 | public View onCreateView(@NonNull LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState){
profileViewModel = ViewModelProviders.of(this).get(ProfileViewModel.class);
View root = inflater.inflate(R.layout.profile_fragment, container, false);
barraEditPerfil = root.findViewById(R.id.barra... | public View onCreateView(@NonNull LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState){
View root = inflater.inflate(R.layout.profile_fragment, container, false);
barraEditPerfil = root.findViewById(R.id.barraPerfil);
barraEditPerfil.setOnClickListener(new View.OnClickListener() {
... | |
603 | public UserDetails loadUserByUsername(String username) throws UsernameNotFoundException{
Optional<User> optionalUser = userRepository.findByUsername(username);
optionalUser.orElseThrow(() -> new UsernameNotFoundException("USERNAME not found"));
return optionalUser.map(user -> {
return new Custo... | public UserDetails loadUserByUsername(String username) throws UsernameNotFoundException{
Optional<User> optionalUser = userRepository.findByUsername(username);
optionalUser.orElseThrow(() -> new UsernameNotFoundException("USERNAME not found"));
return optionalUser.map(CustomUserDetails::new).get();
} | |
604 | public Report getReport(String userID, int testID, int reportID){
Gson gson = new Gson();
Report report = null;
Connection conn = DBConnector.getConnection();
PreparedStatement stmt = null;
try {
String sql = SQLConstants.RETRIEVE_REPORT;
stmt = conn.prepareStatement(sql);
... | public Report getReport(String userID, int testID, int reportID){
Gson gson = new Gson();
Report report = null;
Connection conn = DBConnector.getConnection();
PreparedStatement stmt = null;
try {
String sql = SQLConstants.RETRIEVE_REPORT;
stmt = conn.prepareStatement(sql);
... | |
605 | public static ResponseObject register1Journey(String port, String destin, String cont, String comp){
String Port;
String Destin;
String Cont;
String Comp;
if (port.equals("")) {
Port = null;
} else {
Port = port;
}
if (destin.equals("")) {
Destin = null... | public static ResponseObject register1Journey(String port, String destin, String cont, String comp){
String Port;
String Destin;
String Cont;
String Comp;
if (port.equals("")) {
Port = null;
} else {
Port = port;
}
if (destin.equals("")) {
Destin = null... | |
606 | public void testSomeRelationsForARequirement() throws Exception{
EntitySpec<? extends Application> app = create("classpath://templates/some-relationships-for-a-requirement.yaml");
assertNotNull(app);
assertEquals(app.getChildren().size(), 3);
EntitySpec<?> tomcatServer = EntitySpecs.findChildEntityS... | public void testSomeRelationsForARequirement() throws Exception{
EntitySpec<? extends Application> app = create("classpath://templates/some-relationships-for-a-requirement.yaml");
assertNotNull(app);
assertEquals(app.getChildren().size(), 3);
EntitySpec<?> tomcatServer = EntitySpecs.findChildEntityS... | |
607 | public void onClick(View v){
if (v.getId() == R.id.close) {
displayExitDialog(() -> close());
} else if (v.getId() == R.id.customFontTextViewSubmit) {
if (isHomeVisitCompleted) {
submitVisit();
} else {
Snackbar.make(findViewById(android.R.id.content), Html... | public void onClick(View v){
if (v.getId() == R.id.close) {
displayExitDialog(() -> close());
} else if (v.getId() == R.id.customFontTextViewSubmit) {
submitVisit();
}
} | |
608 | public View onCreateView(LayoutInflater i, ViewGroup container, Bundle savedInstanceState){
View rod = i.inflate(R.layout.fragment_bluetooth_i_activity, container, false);
blueetoothConnect = (Button) rod.findViewById(R.id.bluetoothConnect);
bt_BTN = (Button) rod.findViewById(R.id.BTN_Bluetooth);
bt... | public View onCreateView(LayoutInflater i, ViewGroup container, Bundle savedInstanceState){
View rod = i.inflate(R.layout.fragment_bluetooth_i_activity, container, false);
blueetoothConnect = (Button) rod.findViewById(R.id.bluetoothConnect);
bt_BTN = (Button) rod.findViewById(R.id.BTN_Bluetooth);
bt... | |
609 | public void encode(final ActiveMQBuffer buffer){
buffer.writeSimpleString(name);
buffer.writeSimpleString(address);
buffer.writeNullableSimpleString(filterString);
buffer.writeNullableSimpleString(createMetadata());
buffer.writeBoolean(autoCreated);
buffer.writeInt(maxConsumers);
buff... | public void encode(final ActiveMQBuffer buffer){
buffer.writeSimpleString(name);
buffer.writeSimpleString(address);
buffer.writeNullableSimpleString(filterString);
buffer.writeNullableSimpleString(createMetadata());
buffer.writeBoolean(autoCreated);
buffer.writeInt(maxConsumers);
buff... | |
610 | public void add(IDT id, T obj, Object source){
if (obj == null) {
throw new IllegalArgumentException("Object to add may not be null");
}
Map<T, Set<Object>> map = getConstructingCachedMap(id);
Set<Object> set = map.get(obj);
boolean fireNew = (set == null);
if (fireNew) {
... | public void add(IDT id, T obj, Object source){
Objects.requireNonNull(obj);
Map<T, Set<Object>> map = getConstructingCachedMap(id);
Set<Object> set = map.get(obj);
boolean fireNew = (set == null);
if (fireNew) {
set = new WrappedMapSet<>(IdentityHashMap.class);
map.put(obj, se... | |
611 | public void actionHandlingSetup(){
this.remove1Button.setOnAction(e -> addNPC(-1));
this.remove5Button.setOnAction(e -> addNPC(-5));
this.remove10Button.setOnAction(e -> addNPC(-10));
this.add1Button.setOnAction(e -> addNPC(1));
this.add5Button.setOnAction(e -> addNPC(5));
this.add10Button... | public void actionHandlingSetup(){
genericActionHandlingSetup();
this.remove1Button.setOnAction(e -> addNPC(-1));
this.remove5Button.setOnAction(e -> addNPC(-5));
this.remove10Button.setOnAction(e -> addNPC(-10));
this.add1Button.setOnAction(e -> addNPC(1));
this.add5Button.setOnAction(e -... | |
612 | private TaskResult doCall() throws Exception{
TaskResult result = new TaskResult();
checkState(StringUtils.isNotBlank(secretNamespace), Messages.DeploymentCommand_blankNamespace());
checkState(StringUtils.isNotBlank(configPaths), Messages.DeploymentCommand_blankConfigFiles());
KubernetesClientWrappe... | private TaskResult doCall() throws Exception{
TaskResult result = new TaskResult();
checkState(StringUtils.isNotBlank(secretNamespace), Messages.DeploymentCommand_blankNamespace());
checkState(StringUtils.isNotBlank(configPaths), Messages.DeploymentCommand_blankConfigFiles());
KubernetesClientWrappe... | |
613 | public Map<String, Object> queryAllGroup(){
Map<String, Object> result = new HashMap<>();
List<WorkerGroup> workerGroups = getWorkerGroups(false);
Set<String> availableWorkerGroupSet = workerGroups.stream().map(WorkerGroup::getName).collect(Collectors.toSet());
result.put(Constants.DATA_LIST, availa... | public Result<Set<String>> queryAllGroup(){
List<WorkerGroup> workerGroups = getWorkerGroups(false);
Set<String> availableWorkerGroupSet = workerGroups.stream().map(WorkerGroup::getName).collect(Collectors.toSet());
return Result.success(availableWorkerGroupSet);
} | |
614 | public void setEvents(){
Calendar from = Calendar.getInstance();
Calendar to;
List<Event> dayEventList;
try {
from.setTime(Constants.shortDateFormat.parse(date.getText().toString()));
to = (Calendar) from.clone();
to.add(Calendar.DAY_OF_YEAR, 1);
dayEventList = St... | public void setEvents(List<Event> eventList){
dayEventList = eventList;
CalendarInterval calendarInterval = getVisibleInterval();
Calendar from = calendarInterval.getFrom(), to = (Calendar) from.clone();
for (int i = 0; i < hours.getChildCount(); ++i) {
TextView h = (TextView) hours.getChil... | |
615 | public boolean onOptionsItemSelected(MenuItem item){
if (mDrawerToggle.onOptionsItemSelected(item)) {
return true;
}
if (item.getItemId() == R.id.action_settings) {
Toast.makeText(getActivity(), "Example action.", Toast.LENGTH_SHORT).show();
return true;
}
if (item.ge... | public boolean onOptionsItemSelected(MenuItem item){
if (mDrawerToggle.onOptionsItemSelected(item)) {
return true;
}
if (item.getItemId() == R.id.action_settings) {
Toast.makeText(getActivity(), "Example action.", Toast.LENGTH_SHORT).show();
return true;
}
if (item.ge... | |
616 | public Dialog onCreateDialog(Bundle savedInstanceState){
return new AlertDialog.Builder(getActivity()).setTitle(R.string.doze_settings_help_title).setMessage(R.string.doze_settings_help_text).setNegativeButton(R.string.dialog_ok, new DialogInterface.OnClickListener() {
@Override
public void onC... | public Dialog onCreateDialog(Bundle savedInstanceState){
return new AlertDialog.Builder(getActivity()).setTitle(R.string.doze_settings_help_title).setMessage(R.string.doze_settings_help_text).setNegativeButton(R.string.dialog_ok, (dialog, which) -> dialog.cancel()).create();
} | |
617 | public void sendMessage(ChannelId id, ByteBuf message){
Channel channel = allChannels.find(id);
if (channel != null) {
WebSocketFrame frame = new BinaryWebSocketFrame(message);
channel.writeAndFlush(frame);
}
} | public void sendMessage(ChannelId id, Message message){
Channel channel = allChannels.find(id);
if (channel != null) {
channel.writeAndFlush(message);
}
} | |
618 | public void test_isTogglePatternAvailable() throws Exception{
when(element.getPropertyValue(anyInt())).thenReturn(1);
IUIAutomation mocked_automation = Mockito.mock(IUIAutomation.class);
UIAutomation instance = new UIAutomation(mocked_automation);
AutomationWindow window = new AutomationWindow(new E... | public void test_isTogglePatternAvailable() throws Exception{
Toggle pattern = Mockito.mock(Toggle.class);
when(pattern.isAvailable()).thenReturn(true);
AutomationWindow window = new AutomationWindow(new ElementBuilder(element).addPattern(pattern));
boolean value = window.isTogglePatternAvailable();... | |
619 | private void findRoute(){
double startLa = 127.6433222;
double startLo = 37.7965062;
double destLa = 127.6423415;
double destLo = 37.7944884;
String url = "start=" + startLa + "," + startLo + "&destination=" + destLa + "," + destLo;
Communicator.getHttp(url, new Handler() {
publ... | private void findRoute(){
double startLa = 127.6433222;
double startLo = 37.7965062;
double destLa = 127.6423415;
double destLo = 37.7944884;
String url = "start=" + startLa + "," + startLo + "&destination=" + destLa + "," + destLo;
Communicator.getHttp(url, new Handler() {
publ... | |
620 | public void StartSpotting(){
Rectangle r = new Rectangle(0, 0, mCurrentBitmap.getWidth(), mCurrentBitmap.getHeight());
if (mCurrentTemplateRect == null || !r.contains(mCurrentTemplateRect)) {
Toast.makeText(this, "Please select a valid template first !!", Toast.LENGTH_SHORT).show();
return;
... | public void StartSpotting(){
Log.d(TAG, mCurrentTemplateRect.toString());
Log.d(TAG, "Bitmap Size: " + mCurrentBitmap.getWidth() + "," + mCurrentBitmap.getHeight());
final UpdateViewCallback uvcallback = this;
final Mat original = new Mat(), template = new Mat();
Utils.bitmapToMat(mCurrentBitma... | |
621 | public Object clone(){
HTTPSamplerBase base = (HTTPSamplerBase) super.clone();
base.dynamicPath = dynamicPath;
return base;
} | public Object clone(){
HTTPSamplerBase base = (HTTPSamplerBase) super.clone();
return base;
} | |
622 | public static void getGrenobleRoutes(Connection connection) throws SQLException{
MapPanel map = new MapPanel(4.75, 44.01, 0.1);
GeoMainFrame geo = new GeoMainFrame("Map", map);
st = connection.createStatement();
res = st.executeQuery("SELECT linestring, tags->'highway' as highway FROM ways WHERE tag... | public static void getGrenobleRoutes(Connection connection) throws SQLException{
MapPanel map = new MapPanel(4.75, 44.01, 0.1);
GeoMainFrame geo = new GeoMainFrame("Map", map);
st = connection.createStatement();
res = st.executeQuery("SELECT linestring, tags->'highway' as highway FROM ways WHERE tag... | |
623 | public ArrayList<TelephoneModel> getAll() throws EmptySearchException{
String query = "FROM TelephoneEntity t WHERE t.isActive = true ORDER by t.telephoneId ASC";
TypedQuery<TelephoneEntity> result = this.entityManager.createQuery(query, TelephoneEntity.class);
List<TelephoneEntity> entities = result.get... | public List<TelephoneModel> getAll() throws EmptySearchException{
String query = "FROM TelephoneEntity t WHERE t.isActive = true ORDER by t.telephoneId ASC";
TypedQuery<TelephoneEntity> result = this.entityManager.createQuery(query, TelephoneEntity.class);
List<TelephoneEntity> entities = result.getResul... | |
624 | public void batchExportProcessDefinitionByIds(User loginUser, String projectName, String processDefinitionIds, HttpServletResponse response){
if (StringUtils.isEmpty(processDefinitionIds)) {
return;
}
Project project = projectMapper.queryByName(projectName);
Map<String, Object> checkResult ... | public void batchExportProcessDefinitionByIds(User loginUser, String projectName, String processDefinitionIds, HttpServletResponse response){
if (StringUtils.isEmpty(processDefinitionIds)) {
return;
}
Project project = projectMapper.queryByName(projectName);
CheckParamResult checkResult = p... | |
625 | public String getAll(@QueryParam("batch") int batch){
JsonArrayBuilder jab = Json.createArrayBuilder();
Date date = new Date();
List<Series> serieslist = service.getAllSeries();
int batchend = batch + 5;
if (batchend > serieslist.size()) {
batchend = serieslist.size();
}
if (... | public String getAll(@QueryParam("batch") int batch){
JsonArrayBuilder jab = Json.createArrayBuilder();
List<Series> serieslist = service.getAllSeries();
int batchend = batch + 5;
if (batchend > serieslist.size()) {
batchend = serieslist.size();
}
if (batch <= serieslist.size()) {... | |
626 | private void OnConnectionSuccess(Context context){
Log.v(TAG, "OnConnectionSuccess");
bindSession();
if (progressDialog != null) {
progressDialog.dismiss();
progressDialog = null;
}
Bundle bundle = getIntent().getExtras();
if (bundle != null && bundle.containsKey(PARAM_CO... | private void OnConnectionSuccess(Context context){
Log.v(TAG, "OnConnectionSuccess");
bindSession();
if (progressDialog != null) {
progressDialog.dismiss();
progressDialog = null;
}
Bundle bundle = getIntent().getExtras();
if (bundle != null && bundle.containsKey(PARAM_CO... | |
627 | private static String tr(StringList _list){
String candidate_ = "tmp";
int index_ = 0;
while (StringList.contains(_list, candidate_)) {
candidate_ = StringList.concatNbs("tmp", index_);
index_++;
}
_list.add(candidate_);
return candidate_;
} | private static String tr(StringList _list){
return ValidatorStandard.tr(_list);
} | |
628 | private static Path handleWildCard(final String root){
if (root.contains(WILD_CARD)) {
int idx = root.indexOf(WILD_CARD);
idx = root.lastIndexOf('/', idx);
final String newRoot = root.substring(0, idx);
if (newRoot.length() == 0) {
return new Path("/");
}
... | private static Path handleWildCard(Path root){
String stringRoot = root.toUri().getPath();
if (stringRoot.contains(WILD_CARD)) {
int idx = stringRoot.indexOf(WILD_CARD);
idx = stringRoot.lastIndexOf('/', idx);
String newRoot = stringRoot.substring(0, idx);
return DrillFileS... | |
629 | private void initiateLocationSettings(){
int permission = ContextCompat.checkSelfPermission(this, Manifest.permission.ACCESS_FINE_LOCATION);
LocationManager locationManager = (LocationManager) getSystemService(LOCATION_SERVICE);
if (permission == PackageManager.PERMISSION_GRANTED) {
Log.e(TAG, "... | private void initiateLocationSettings(){
if (checkPermission()) {
LocationManager locationManager = (LocationManager) getSystemService(LOCATION_SERVICE);
Log.e(TAG, "PERMISSION_GRANTED for ACCESS_FINE_LOCATION");
if (!locationManager.isProviderEnabled(LocationManager.GPS_PROVIDER)) {
... | |
630 | public List<OutputFile> getOutputsForTask(Task task) throws FutureGatewayException{
String httpToCall = tasksHttpAddress + "/" + task.getId();
LOGGER.info("Calling: " + httpToCall);
Client client = null;
Response response = null;
try {
client = ClientBuilder.newClient();
respo... | public List<OutputFile> getOutputsForTask(Task task) throws FutureGatewayException{
String httpToCall = tasksHttpAddress + "/" + task.getId();
Response response = null;
try {
LOGGER.debug("GET " + httpToCall);
response = client.target(httpToCall).request(MediaType.APPLICATION_JSON_TYPE)... | |
631 | public Result<Object> checkConnection(DbType type, String parameter){
Result<Object> result = new Result<>();
BaseDataSource datasource = DataSourceFactory.getDatasource(type, parameter);
if (datasource == null) {
putMsg(result, Status.DATASOURCE_TYPE_NOT_EXIST, type);
return result;
... | public Result<Void> checkConnection(DbType type, String parameter){
BaseDataSource datasource = DataSourceFactory.getDatasource(type, parameter);
if (datasource == null) {
return Result.errorWithArgs(Status.DATASOURCE_TYPE_NOT_EXIST, type);
}
try (Connection connection = datasource.getConne... | |
632 | protected void loadDatasets() throws IOException{
LOG.debug("Loading datasets from " + userDatasetsFile);
if (pprlClusterHdfs.exists(userDatasetsFile)) {
final BufferedReader br = new BufferedReader(new InputStreamReader(pprlClusterHdfs.open(userDatasetsFile)));
try {
String lin... | protected void loadDatasets() throws IOException, DatasetException{
LOG.debug("Loading datasets from " + userDatasetsFile);
if (pprlClusterHdfs.exists(userDatasetsFile)) {
final BufferedReader br = new BufferedReader(new InputStreamReader(pprlClusterHdfs.open(userDatasetsFile)));
try {
... | |
633 | public static String[] getSortTypeStr(final Resources res){
String[] sortNames = { res.getString(R.string.menu_sort_create_descending), res.getString(R.string.menu_sort_create_ascending), res.getString(R.string.menu_sort_name_descending), res.getString(R.string.menu_sort_name_ascending) };
return sortNames;
... | public static String[] getSortTypeStr(final Resources res){
return new String[] { res.getString(R.string.menu_sort_create_descending), res.getString(R.string.menu_sort_create_ascending), res.getString(R.string.menu_sort_name_descending), res.getString(R.string.menu_sort_name_ascending) };
} | |
634 | protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec){
heightMeasureSpec = MeasureSpec.makeMeasureSpec(maxHeight, MeasureSpec.AT_MOST);
super.onMeasure(widthMeasureSpec, heightMeasureSpec);
} | protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec){
super.onMeasure(widthMeasureSpec, MeasureSpec.makeMeasureSpec(maxHeight, MeasureSpec.AT_MOST));
} | |
635 | public void addData(int acctNo, int pin, String balance, String acctType) throws SQLException{
try {
st = con.createStatement();
System.out.println("Creating table...");
st.executeUpdate("CREATE TABLE IF NOT EXISTS Accounts " + "(Account_Number INT PRIMARY KEY, Pin INT, Account_Balance V... | public void addData(int acctNo, int pin, String balance, String acctType) throws SQLException{
try {
System.out.println("Creating table...");
con.createStatement().executeUpdate("CREATE TABLE IF NOT EXISTS Accounts " + "(Account_Number INT PRIMARY KEY, Pin INT, Account_Balance VARCHAR(30), Accoun... | |
636 | public List<User> getLineEstimateCreatedByUsers(){
final Criteria criteria = entityManager.unwrap(Session.class).createCriteria(LineEstimate.class);
criteria.add(Restrictions.isNotNull("technicalSanctionNumber"));
final TypedQuery<User> query = (TypedQuery<User>) entityManager.createQuery("select distinc... | public List<User> getLineEstimateCreatedByUsers(){
return lineEstimateRepository.getLineEstimateCreatedByUsers(LineEstimateStatus.TECHNICAL_SANCTIONED.toString());
} | |
637 | public String execute(int[] code, int[] inputSignals){
int index = 0;
StringBuilder output = new StringBuilder();
OpCodeFactory opCodeFactory = new OpCodeFactory(inputSignals);
while (index < code.length) {
OpCode opCode = opCodeFactory.getOpCode(code, index);
code = opCode.execute... | public String execute(int[] code, int[] inputs){
StringBuilder output = new StringBuilder();
Context context = new Context(0, code, inputs, output.toString());
while (context.getPointer() < context.getCode().length) {
OpCode opCode = OpCodeFactory.getOpCode(context.getCode()[context.getPointer()... | |
638 | public boolean visit(FieldDeclaration node){
for (Object o : node.fragments()) {
VariableDeclarationFragment var = (VariableDeclarationFragment) o;
String name = var.getName().toString();
String type = node.getType().toString();
boolean isStatic = Modifier.isStatic(node.getModif... | public boolean visit(FieldDeclaration node){
for (Object o : node.fragments()) {
VariableDeclarationFragment var = (VariableDeclarationFragment) o;
String name = var.getName().toString();
String type = node.getType().toString();
boolean isStatic = Modifier.isStatic(node.getModif... | |
639 | private void findBaseTile(int[][] b){
for (int i = 0; i < ROWS; i++) {
for (int j = 0; j < COLS; j++) {
if (b[i][j] >= 0 && b[i][j] != 10) {
if (completable(b, i, j) == 1) {
baseTile = new int[] { i, j, 1 };
return;
}... | private void findBaseTile(int[][] b){
for (int i = 0; i < ROWS; i++) {
for (int j = 0; j < COLS; j++) {
if (b[i][j] >= 0 && b[i][j] != 10) {
int complete = completable(b, i, j);
if (complete == 1 || complete == -1) {
baseTile = new int[] ... | |
640 | public void call(ComplexFloat16MatrixMember a){
ComplexFloat16Member zero = G.CHLF.construct();
ComplexFloat16Member phi = G.CHLF.construct();
G.CHLF.PHI().call(phi);
for (long r = 0; r < a.rows(); r++) {
for (long c = 0; c < a.cols(); c++) {
if (r == c)
a.setV... | public void call(ComplexFloat16MatrixMember a){
ComplexFloat16Member phi = G.CHLF.construct();
G.CHLF.PHI().call(phi);
MatrixConstantDiagonal.compute(G.CHLF, phi, a);
} | |
641 | public TailCall processLeavingTail(XPathContext context) throws XPathException{
SequenceReceiver out = context.getReceiver();
Item item = select.evaluateItem(context);
if (item == null) {
}
if (!(item instanceof NodeInfo)) {
out.append(item, NodeInfo.ALL_NAMESPACES);
return nu... | public TailCall processLeavingTail(XPathContext context) throws XPathException{
SequenceReceiver out = context.getReceiver();
Item item = select.evaluateItem(context);
if (!(item instanceof NodeInfo)) {
out.append(item, NodeInfo.ALL_NAMESPACES);
return null;
}
NodeInfo source ... | |
642 | public Map<String, Object> queryResourceByProgramType(User loginUser, ResourceType type, ProgramType programType){
Map<String, Object> result = new HashMap<>();
String suffix = ".jar";
int userId = loginUser.getId();
if (isAdmin(loginUser)) {
userId = 0;
}
if (programType != null)... | public Result<List<ResourceComponent>> queryResourceByProgramType(User loginUser, ResourceType type, ProgramType programType){
Map<String, Object> result = new HashMap<>();
String suffix = ".jar";
int userId = loginUser.getId();
if (isAdmin(loginUser)) {
userId = 0;
}
if (programT... | |
643 | public void testConstructor(){
Menu menu1 = new Menu("Drinks");
Item item1 = new Item("1", "XYZ", "Drinks", 2.99, true);
assertEquals("XYZ", item1.getName());
assertEquals("Drinks", item1.getCategory());
assertEquals(2.99, item1.getPrice(), 0.01);
assertTrue(item1.isInStock());
} | public void testConstructor(){
Menu menu1 = new Menu("Drinks");
Item item1 = new Item("1", "XYZ", "Drinks", 2.99, true);
assertEquals("XYZ", item1.getName());
assertEquals(2.99, item1.getPrice(), 0.01);
assertTrue(item1.isInStock());
} | |
644 | public String execute(){
Pattern regexPattern = Pattern.compile(toFind, Pattern.CASE_INSENSITIVE);
List<Task> results = searchList(regexPattern);
if (results.size() == 0) {
String noMatchingTaskMsg = "There are no tasks matching your input :(";
return noMatchingTaskMsg;
} else {
... | public String execute(){
Pattern regexPattern = Pattern.compile(toFind, Pattern.CASE_INSENSITIVE);
List<Task> results = searchList(regexPattern);
if (results.size() == 0) {
String noMatchingTaskMsg = "There are no tasks matching your input :(";
return noMatchingTaskMsg;
}
retu... | |
645 | protected void onCreate(Bundle savedInstanceState){
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_survey);
myDbHandler = new MyDbHandler(this);
List<Value> valuesList = myDbHandler.getValuesList();
for (Value v : valuesList) {
int id = v.getID();
String ... | protected void onCreate(Bundle savedInstanceState){
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_survey);
myDbHandler = new MyDbHandler(this);
List<Value> valuesList = myDbHandler.getValuesList();
for (Value v : valuesList) {
int id = v.getID();
String ... | |
646 | protected void onCreate(@Nullable Bundle savedInstanceState){
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_add_quote);
initWidgets();
setOnClickListeners();
setFinishOnTouchOutside(false);
categoryViewModel = ViewModelProviders.of(this).get(QuoteCategoryViewModel.cl... | protected void onCreate(@Nullable Bundle savedInstanceState){
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_add_quote);
initWidgets();
setOnClickListeners();
setFinishOnTouchOutside(false);
categoryViewModel = ViewModelProviders.of(this).get(QuoteCategoryViewModel.cl... | |
647 | public void setValue(String value) throws InterruptedException{
Thread.sleep(2000);
driver.findElement(By.xpath(locator)).sendKeys(value);
} | public void setValue(String value){
driver.findElement(By.xpath(locator)).sendKeys(value);
} | |
648 | public void handleCommand(ChannelUID channelUID, Command command){
logger.debug("Handle Ceiling Command {}", command);
if (mDevice.isAutoConnect() && mDevice.getConnectionState() != ConnectState.CONNECTED) {
DeviceManager.getInstance().startDiscovery(5 * 1000);
return;
}
switch(cha... | public void handleCommand(ChannelUID channelUID, Command command){
handleCommandHelper(channelUID, command, "Handle Ceiling Command {}");
} | |
649 | private void buildInterface(Bundle savedInstanceState){
setContentView(R.layout.layout_main_time_line_activity);
mToolbar = (Toolbar) findViewById(R.id.mainTimeLineToolBar);
mDrawerLayout = (DrawerLayout) findViewById(R.id.writeWeiboDrawerL);
mDrawerToggle = new MyDrawerToggle(this, mDrawerLayout, m... | private void buildInterface(Bundle savedInstanceState){
setContentView(R.layout.layout_main_time_line_activity);
mToolbar = (Toolbar) findViewById(R.id.mainTimeLineToolBar);
mDrawerLayout = (DrawerLayout) findViewById(R.id.writeWeiboDrawerL);
mDrawerToggle = new MyDrawerToggle(this, mDrawerLayout, m... | |
650 | protected void onCreate(Bundle savedInstanceState){
super.onCreate(savedInstanceState);
Intent i = getIntent();
String temp = i.getStringExtra("LOGOUT");
if (temp != null && temp.equals("TRUE")) {
TOKEN = null;
}
setContentView(R.layout.activity_login);
apiService = ApiClient... | protected void onCreate(Bundle savedInstanceState){
super.onCreate(savedInstanceState);
Intent i = getIntent();
String temp = i.getStringExtra("LOGOUT");
if (temp != null && temp.equals("TRUE")) {
TOKEN = null;
}
setContentView(R.layout.activity_login);
usernameET = findViewB... | |
651 | public void process12Test(){
String folder_ = "messages";
String relative_ = "sample/file";
String html_ = "<html><body><c:try><c:try>{1/0}</c:try><c:catch className='java.lang.Object' var='ex'>Exc<c:return/></c:catch></c:try><c:catch className='java.lang.Object' var='ex'>Sec</c:catch></body></html>";
... | public void process12Test(){
String folder_ = "messages";
String relative_ = "sample/file";
String html_ = "<html><body><c:try><c:try>{1/0}</c:try><c:catch className='java.lang.Object' var='ex'>Exc<c:return/></c:catch></c:try><c:catch className='java.lang.Object' var='ex'>Sec</c:catch></body></html>";
... | |
652 | public List<MFPlant> addMFPlant(@Context SecurityContext ctx, @PathParam(value = "id") String id, @PathParam(value = "date") Date date, @PathParam(value = "o3") String o3){
List<MFPlant> retVal = null;
MFPlant plant = new MFPlant();
plant.setId(id);
plant.setDateField(date);
plant.setO3(o3);
... | public List<MFPlant> addMFPlant(@Context SecurityContext ctx, @PathParam(value = "id") String id, @PathParam(value = "date") Date date, @PathParam(value = "o3") String o3){
List<MFPlant> retVal = null;
MFPlant plant = new MFPlant();
plant.setId(id);
plant.setDateField(date);
plant.setO3(o3);
... | |
653 | public void onBindViewHolder(final ViewHolder holder, int position){
holder.bind(mItems.get(position), mItemClickListener, mIsFavoriteListener);
holder.itemView.setOnLongClickListener(new View.OnLongClickListener() {
@Override
public boolean onLongClick(View v) {
setPosition(h... | public void onBindViewHolder(final ViewHolder holder, int position){
holder.bind(mItems.get(position), mItemClickListener, mIsFavoriteListener);
holder.itemView.setOnLongClickListener(v -> {
setPosition(holder.getAdapterPosition());
return false;
});
} | |
654 | int getNumberOfActivitiesBefore(int currentTime){
int relTime = currentTime % partialLength;
int relScheduleIndex = currentTime / partialLength;
if (relScheduleIndex >= subschedules.size()) {
relScheduleIndex = subschedules.size() - 1;
}
var activitiesInCurrentSchedule = subschedules.... | int getNumberOfActivitiesBefore(int currentTime){
int relTime = relativeTime(currentTime);
int relScheduleIndex = relativeSchedule(currentTime);
var activitiesInCurrentSchedule = subschedules.get(relScheduleIndex).getNumberOfActivitiesBefore(relTime);
if (activitiesInCurrentSchedule < 0) {
... | |
655 | public void processResponse(HttpSession httpSession, InputStream streamFromServer, OutputStream streamToClient, UserInfo userInfo, String bucket, Boolean addPermissions) throws Exception{
JsonParser parser = ResponseParser.jsonFactory.createParser(streamFromServer);
JsonGenerator generator = ResponseParser.js... | public void processResponse(HttpSession httpSession, InputStream streamFromServer, OutputStream streamToClient, UserInfo userInfo, String bucket, Boolean addPermissions) throws Exception{
JsonParser parser = parserForStream(streamFromServer);
JsonGenerator generator = ResponseParser.jsonFactory.createGenerato... | |
656 | public Map<String, String> createVolumes(final String appStoreTemplate) throws IOException{
final Map<String, String> volumeNames = new HashMap<>();
final var templateObject = toJsonObject(appStoreTemplate);
var volumes = new JSONArray();
if (!templateObject.isNull("volumes")) {
volumes = t... | public Map<String, String> createVolumes(final String appStoreTemplate) throws IOException{
final Map<String, String> volumeNames = new HashMap<>();
final var templateObject = toJsonObject(appStoreTemplate);
var volumes = new JSONArray();
if (!templateObject.isNull("volumes")) {
volumes = t... | |
657 | public boolean onQueryTextChange(String s){
ArrayList<String> matchingLawFirms = new ArrayList<>();
String userInput = s.toLowerCase();
Set<String> lawFirms = data.lawFirms;
for (String firm : lawFirms) {
if (firm.toLowerCase().contains(userInput)) {
matchingLawFirms.add(firm);... | public boolean onQueryTextChange(String s){
ArrayList<String> matchingLawFirms = new ArrayList<>();
String userInput = s.toLowerCase();
for (String firm : lawFirms) {
if (firm.toLowerCase().contains(userInput)) {
matchingLawFirms.add(firm);
}
}
this.adapter.update... | |
658 | public ResponseEntity<TransformationResult> transform(@Parameter(required = true) @Valid @RequestBody TransformationModel model){
try {
byte[] decodedBytes = Base64.getDecoder().decode(model.getInput());
String input = new String(decodedBytes);
DeploymentModel deploymentModel = Deploymen... | public ResponseEntity<TransformationResult> transform(@Parameter(required = true) @Valid @RequestBody TransformationModel model){
try {
byte[] decodedBytes = Base64.getDecoder().decode(model.getInput());
String input = new String(decodedBytes);
DeploymentModel deploymentModel = Deploymen... | |
659 | public P appendChild(List<Node> children){
if (children != null) {
;
for (Node child : children) {
appendChild(child);
}
}
return this;
} | public P appendChild(List<Node> children){
if (children != null) {
for (Node child : children) {
appendChild(child);
}
}
return this;
} | |
660 | public boolean isTimeListContainsUniqueElements(){
List<String> timeTextList = new ArrayList<>();
for (WebElement timeElement : timeList) {
timeTextList.add(timeElement.getText());
}
Set<String> timeTextUnique = new HashSet<String>(timeTextList);
System.out.println(timeTextUnique.size(... | public boolean isTimeListContainsUniqueElements(){
List<String> timeTextList = new ArrayList<>();
for (WebElement timeElement : timeList) {
timeTextList.add(timeElement.getText());
}
Set<String> timeTextUnique = new HashSet<String>(timeTextList);
if (timeTextUnique.size() == timeTextLi... | |
661 | private static String filterOutNullRole(String originalFqan){
int index = originalFqan.indexOf(NULL_ROLE);
if (index == -1) {
return originalFqan;
}
StringBuilder filteredFqan = new StringBuilder();
filteredFqan.append(originalFqan.substring(0, index));
filteredFqan.append(origina... | private static String filterOutNullRole(String originalFqan){
int index = originalFqan.indexOf(NULL_ROLE);
if (index == -1) {
return originalFqan;
}
String filteredFqan = originalFqan.substring(0, index) + originalFqan.substring(index + NULL_ROLE.length());
return filteredFqan;
} | |
662 | public static void runAction(@NonNull Context context, @Action final int actionId, @Nullable final String data, final boolean background){
logger.log("runAction call");
Pair<ServiceInfo, Boolean> pair = getServiceWithMinimumVersion(context, MINIMUM_BIND_VERSION);
if (pair.second) {
bindServiceAn... | public static void runAction(@NonNull Context context, @Action int actionId, @Nullable String data, boolean background){
logger.log("runAction call");
ServiceManager serviceManager = ServiceManager.getInstance(context, RESPONSE_MANAGER);
if (serviceManager.supports(ServiceManager.Feature.BIND)) {
... | |
663 | public void onViewStateRestored(@Nullable Bundle savedInstanceState){
super.onViewStateRestored(savedInstanceState);
if (Logger.DEBUG) {
Log.d(TAG, "onViewStateRestored()");
}
String cityName = CityModel.getInstance().getCityName();
cityNameTextView.setText(cityName);
if (savedIns... | public void onViewStateRestored(@Nullable Bundle savedInstanceState){
super.onViewStateRestored(savedInstanceState);
if (Logger.DEBUG) {
Log.d(TAG, "onViewStateRestored()");
}
if (savedInstanceState != null) {
String forecast = savedInstanceState.getString(BundleKeys.FORECAST);
... | |
664 | public boolean match(final MatcherContext<V> context){
final Object valueStackSnapshot = context.getValueStack().takeSnapshot();
final List<Matcher> children = getChildren();
final int size = children.size();
for (int i = 0; i < size; i++) {
final Matcher matcher = children.get(i);
... | public boolean match(final MatcherContext<V> context){
final ValueStack<V> stack = context.getValueStack();
final Object snapshot = stack.takeSnapshot();
for (final Matcher matcher : getChildren()) {
if (matcher.getSubContext(context).runMatcher())
continue;
stack.restoreSn... | |
665 | private void init(){
view = LayoutInflater.from(getContext()).inflate(R.layout.video_window, null);
tvUserName = (TextView) view.findViewById(R.id.tvUserName);
view_window_ll = (LinearLayout) view.findViewById(R.id.Video_window_ll);
ivAudioStatus = (ImageView) view.findViewById(R.id.ivAudioStatus);
... | private void init(){
llVideoWindow = LayoutInflater.from(getContext()).inflate(R.layout.video_window, null);
tvUserName = (TextView) llVideoWindow.findViewById(R.id.tvUserName);
ivAudioStatus = (ImageView) llVideoWindow.findViewById(R.id.ivAudioStatus);
progressBar = (ProgressBar) llVideoWindow.find... | |
666 | protected void collectNavigationMarkers(@NotNull PsiElement element, Collection<? super RelatedItemLineMarkerInfo> result){
if (element instanceof PsiLiteralExpression) {
PsiLiteralExpression literalExpression = (PsiLiteralExpression) element;
String value = literalExpression.getValue() instanceo... | protected void collectNavigationMarkers(@NotNull PsiElement element, Collection<? super RelatedItemLineMarkerInfo> result){
if (element instanceof PsiLiteralExpression) {
PsiLiteralExpression literalExpression = (PsiLiteralExpression) element;
String value = literalExpression.getValue() instanceo... | |
667 | public WindowProxy getRootWindowProxy(){
if (!windows.isEmpty()) {
return windows.get(0);
} else {
return null;
}
} | public WindowProxy getRootWindowProxy(){
if (!windows.isEmpty()) {
return windows.get(0);
}
return null;
} | |
668 | public void write(MarshalledEntry entry){
log.debugf("In HBaseCacheStore.store for %s: %s", configuration.entryTable(), entry.getKey());
Object key = entry.getKey();
String hashedKey = hashKey(this.entryKeyPrefix, key);
try {
Map<String, byte[]> qualifiersData = new HashMap<>();
by... | public void write(MarshalledEntry entry){
log.debugf("In HBaseCacheStore.store for %s: %s", configuration.entryTable(), entry.getKey());
Object key = entry.getKey();
String hashedKey = hashKey(this.entryKeyPrefix, key);
try {
writeEntry(entry, hashedKey);
if (canExpire(entry)) {
... | |
669 | private ArrayList getXAxisValues(){
ArrayList<String> xLabels = dataManager.getMonthNameForLabel();
return xLabels;
} | private ArrayList getXAxisValues(){
return dataManager.getMonthNameForLabel();
} | |
670 | public void onClick(View v){
int position = getAdapterPosition();
Chord chordToDisplay = mChordsInLine.get(position);
String chordDialogTitle = context.getString(R.string.chord) + " " + mChord.getSymbolToDisplay();
String chordSymbolInLowerCase = mChord.getMSymbol().toLowerCase();
Resources res... | public void onClick(View v){
String chordDialogTitle = context.getString(R.string.chord) + " " + mChord.getSymbolToDisplay();
String chordSymbolInLowerCase = mChord.getMSymbol().toLowerCase();
Resources resources = context.getResources();
String packageName = context.getPackageName();
ArrayList... | |
671 | public void givenNoProducts_whenGetProductsCatalog_thenReturnEmptyJsonArray() throws Exception{
final Product product = dataGenerator.generateProduct(true);
given(productRepository.findAll()).willReturn(Collections.emptyList());
mvc.perform(get("/products").contentType(MediaType.APPLICATION_JSON)).andExp... | public void givenNoProducts_whenGetProductsCatalog_thenReturnEmptyJsonArray() throws Exception{
given(productRepository.findAll()).willReturn(Collections.emptyList());
mvc.perform(get("/products").contentType(MediaType.APPLICATION_JSON)).andExpect(status().isOk()).andExpect(jsonPath("$", hasSize(0)));
} | |
672 | public void run(){
try {
BufferedReader buffereedReader = new BufferedReader(new InputStreamReader(socket.getInputStream(), StandardCharsets.UTF_8));
PrintWriter printWriter = new PrintWriter(new OutputStreamWriter(socket.getOutputStream(), StandardCharsets.UTF_8));
while (true) {
... | public void run(){
try {
BufferedReader buffereedReader = new BufferedReader(new InputStreamReader(socket.getInputStream(), StandardCharsets.UTF_8));
PrintWriter printWriter = new PrintWriter(new OutputStreamWriter(socket.getOutputStream(), StandardCharsets.UTF_8));
while (true) {
... | |
673 | private void validate(RepoContext ctx) throws AuthException, ResourceConflictException, IOException, OrmException{
CommitValidators cv = commitValidatorsFactory.create(origCtl.getRefControl(), new NoSshInfo(), ctx.getRepository());
if (!origCtl.canAddPatchSet(ctx.getDb())) {
throw new AuthException("... | private void validate(RepoContext ctx) throws AuthException, ResourceConflictException, IOException, OrmException{
if (!origCtl.canAddPatchSet(ctx.getDb())) {
throw new AuthException("cannot add patch set");
}
if (validatePolicy == CommitValidators.Policy.NONE) {
return;
}
Str... | |
674 | public Result unauthDatasource(@ApiIgnore @RequestAttribute(value = Constants.SESSION_USER) User loginUser, @RequestParam("userId") Integer userId){
logger.info("unauthorized datasource, login user:{}, unauthorized userId:{}", loginUser.getUserName(), userId);
Map<String, Object> result = dataSourceService.un... | public Result<List<DataSource>> unauthDatasource(@ApiIgnore @RequestAttribute(value = Constants.SESSION_USER) User loginUser, @RequestParam("userId") Integer userId){
logger.info("unauthorized datasource, login user:{}, unauthorized userId:{}", loginUser.getUserName(), userId);
return dataSourceService.unauth... | |
675 | private static List<String> loadLines(File file, Charset charset) throws IOException{
BufferedReader reader = null;
boolean threw = true;
try {
reader = new BufferedReader(new InputStreamReader(new FileInputStream(file), charset));
List<String> strings = Lists.newArrayList();
S... | private static List<String> loadLines(File file, Charset charset) throws IOException{
try (BufferedReader reader = new BufferedReader(new InputStreamReader(new FileInputStream(file), charset))) {
List<String> strings = Lists.newArrayList();
String line = reader.readLine();
while (line !=... | |
676 | private static void fetchCastMethods(ContextEl _conf, ClassMethodId _uniqueId, String _glClass, CustList<MethodInfo> _methods, String _cl, GeneType _root, StringMap<String> _superTypesBaseMap){
ClassMethodIdAncestor uniq_ = null;
if (_uniqueId != null) {
uniq_ = new ClassMethodIdAncestor(new ClassMet... | private static void fetchCastMethods(ContextEl _conf, ClassMethodId _uniqueId, String _glClass, CustList<MethodInfo> _methods, String _cl, CustList<OverridableBlock> _casts, StringMap<String> _superTypesBaseMap){
ClassMethodIdAncestor uniq_ = null;
if (_uniqueId != null) {
uniq_ = new ClassMethodIdAn... | |
677 | public int compareTo(UnconfiguredBuildTargetWithOutputs other){
if (this == other) {
return 0;
}
int targetComparison = getBuildTarget().compareTo(other.getBuildTarget());
if (targetComparison != 0) {
return targetComparison;
}
if (getOutputLabel().isPresent() && other.ge... | public int compareTo(UnconfiguredBuildTargetWithOutputs other){
if (this == other) {
return 0;
}
int targetComparison = getBuildTarget().compareTo(other.getBuildTarget());
if (targetComparison != 0) {
return targetComparison;
}
return getOutputLabel().compareTo(other.getO... | |
678 | public boolean sendMessage(Message msg){
socketClientMS.sendMessage(msg);
return true;
} | public boolean sendMessage(Message msg){
return socketClientMS.sendMessage(msg);
} | |
679 | private List<ProductTable.ProductSupplier> listAllProductsOfSuppliers_Order_By_Supplier(){
List<ProductTable.ProductSupplier> productSuppliers = SELECT(asList(PRD_ID_ALIAS, PRD_NAME_ALIAS, PRD_UNIT_PRICE_ALIAS, PRD_CAT_ID_ALIAS, PRD_SUPP_ID_ALIAS, PRD_DISCONTINUED_ALIAS, SUPP_ID_ALIAS, SUPP_NAME_ALIAS, SUPP_CONTAC... | private List<ProductTable.ProductSupplier> listAllProductsOfSuppliers_Order_By_Supplier(){
return (List<ProductSupplier>) SELECT(asList(PRD_ID_ALIAS, PRD_NAME_ALIAS, PRD_UNIT_PRICE_ALIAS, PRD_CAT_ID_ALIAS, PRD_SUPP_ID_ALIAS, PRD_DISCONTINUED_ALIAS, SUPP_ID_ALIAS, SUPP_NAME_ALIAS, SUPP_CONTACT_ALIAS, SUPP_ADDRESS_A... | |
680 | public void readRecord(String name){
boolean found = false;
String firstName = "";
String lastName = "";
String address = "";
String city = "";
String state = "";
String zip = "";
String phone = "";
try {
Scanner sc = new Scanner(new File("C:/Users/w/Desktop/AddBook... | public void readRecord(String name) throws FileNotFoundException{
boolean found = false;
String firstName = "";
String lastName = "";
String address = "";
String city = "";
String state = "";
String zip = "";
String phone = "";
Scanner sc = new Scanner(new File("C:/Users/w/D... | |
681 | public void onDateSet(Date date){
SimpleDateFormat dateFormatter = new SimpleDateFormat(DATE_FORMAT_ON_DATE_PICKER);
String strDate = dateFormatter.format(date);
etBeginDate.setText(strDate);
} | public void onDateSet(Date date){
String strDate = datePickerFormatter.format(date);
etBeginDate.setText(strDate);
} | |
682 | public String randomLoad(String username){
String retMessage = "INIT";
int slot = -1;
JSONArray json = getJSON();
if (username.isEmpty()) {
double random = Math.abs(Math.random() * json.length());
slot = ((int) random) % json.length();
retMessage = json.getJSONObject(slot)... | public String randomLoad(String username){
JSONObject savestate;
int slot = -1;
JSONArray json = getJSON();
if (username.isEmpty()) {
slot = rand.nextInt(json.length());
savestate = json.getJSONObject(slot);
} else {
JSONArray userArray = new JSONArray();
for... | |
683 | void generateMaze_noDimensionalVariance_success(){
doReturn(3).when(random).nextInt(4);
doReturn(2).when(random).nextInt(5);
MazeTile[][] generatedMaze = new Prim(4, 4, 5, 5, random).generateMaze();
assertThat(generatedMaze.length).isEqualTo(4);
for (MazeTile[] row : generatedMaze) {
... | void generateMaze_noDimensionalVariance_success(){
doReturn(3).when(random).nextInt(4);
doReturn(2).when(random).nextInt(5);
MazeTile[][] generatedMaze = new Prim(4, 4, 5, 5, random).generateMaze();
assertThat(generatedMaze.length).isEqualTo(4);
for (MazeTile[] row : generatedMaze) {
... | |
684 | static EbicsBank sendHPB(final EbicsSession session) throws IOException, GeneralSecurityException, EbicsException{
final HPBRequestElement request = new HPBRequestElement(session);
final EbicsNoPubKeyDigestsRequest ebicsNoPubKeyDigestsRequest = request.build();
final byte[] xml = XmlUtil.prettyPrint(Ebi... | static EbicsBank sendHPB(final EbicsSession session) throws IOException, GeneralSecurityException, EbicsException{
final EbicsNoPubKeyDigestsRequest ebicsNoPubKeyDigestsRequest = HPBRequestElement.create(session);
final byte[] xml = XmlUtil.prettyPrint(EbicsNoPubKeyDigestsRequest.class, ebicsNoPubKeyDigestsR... | |
685 | Data transform(Data data, XMLCryptoContext xc, DOMSignContext context) throws MarshalException, TransformException{
Node parent = context.getParent();
XmlWriter xwriter = new XmlWriterToTree(Marshaller.getMarshallers(), parent);
marshal(xwriter, DOMUtils.getSignaturePrefix(context), context);
retur... | Data transform(Data data, XMLCryptoContext xc, DOMSignContext context) throws MarshalException, TransformException{
marshal(context.getParent(), DOMUtils.getSignaturePrefix(context), context);
return transform(data, xc);
} | |
686 | public Map<String, Object> authedDatasource(User loginUser, Integer userId){
Map<String, Object> result = new HashMap<>();
if (!isAdmin(loginUser)) {
putMsg(result, Status.USER_NO_OPERATION_PERM);
return result;
}
List<DataSource> authedDatasourceList = dataSourceMapper.queryAuthed... | public Result<List<DataSource>> authedDatasource(User loginUser, Integer userId){
if (!isAdmin(loginUser)) {
return Result.error(Status.USER_NO_OPERATION_PERM);
}
List<DataSource> authedDatasourceList = dataSourceMapper.queryAuthedDatasource(userId);
return Result.success(authedDatasourceLi... | |
687 | public void signUpStep1(){
SignUpPage signUpPage = new SignUpPage(driver, SignUpPage.PAGE_URL);
CommonActions common = new CommonActions(driver);
common.fillInNewUserDetails("test", "test", "test");
signUpPage.clickCreateAccount();
signUpPage.checkAccountCreationSuccessful();
} | public void signUpStep1(){
common.fillInNewUserDetails("test", "test", "test");
signUpPage.clickCreateAccount();
signUpPage.checkAccountCreationSuccessful();
} | |
688 | private void indexSingleEntity(@NonNull SoundFile soundFile){
try (DirectoryReader reader = DirectoryReader.open(writer)) {
IndexSearcher searcher = new IndexSearcher(reader);
if (isNew(soundFile, searcher)) {
writer.addDocument(docConverter.docFrom(soundFile));
} else {
... | private void indexSingleEntity(@NonNull SoundFile soundFile){
try (DirectoryReader reader = DirectoryReader.open(writer)) {
IndexSearcher searcher = new IndexSearcher(reader);
if (isNew(soundFile, searcher)) {
writer.addDocument(docConverter.docFrom(soundFile));
} else {
... | |
689 | public Map<String, Object> queryAccessTokenList(User loginUser, String searchVal, Integer pageNo, Integer pageSize){
Map<String, Object> result = new HashMap<>();
PageInfo<AccessToken> pageInfo = new PageInfo<>(pageNo, pageSize);
Page<AccessToken> page = new Page<>(pageNo, pageSize);
int userId = lo... | public Result<PageListVO<AccessToken>> queryAccessTokenList(User loginUser, String searchVal, Integer pageNo, Integer pageSize){
PageInfo<AccessToken> pageInfo = new PageInfo<>(pageNo, pageSize);
Page<AccessToken> page = new Page<>(pageNo, pageSize);
int userId = loginUser.getId();
if (loginUser.get... | |
690 | public void handleScoreButton(ActionEvent event){
player[currentPlayer].enterScore(currentScoreBox);
scoreBorder[currentScoreBox].setFill(Color.TRANSPARENT);
scoreButton[currentScoreBox].setDisable(true);
currentScoreBox = -1;
scoreRollButton.setDisable(true);
if (!player[player.length - 1... | public void handleScoreButton(ActionEvent event){
players[currentPlayer].enterScore(currentScoreBox);
scoreBorder[currentScoreBox].setFill(Color.TRANSPARENT);
scoreButton[currentScoreBox].setDisable(true);
currentScoreBox = -1;
scoreRollButton.setDisable(true);
if (!players[players.length ... | |
691 | public boolean onNavigationItemSelected(@NonNull MenuItem item){
Fragment fragment;
switch(item.getItemId()) {
case R.id.navigation_football:
toolbar.setTitle(R.string.title_football);
loadFragmentWithCategory(getString(R.string.retrofit_football));
return true;... | public boolean onNavigationItemSelected(@NonNull MenuItem item){
switch(item.getItemId()) {
case R.id.navigation_football:
toolbar.setTitle(R.string.title_football);
loadFragmentWithCategory(getString(R.string.retrofit_football));
return true;
case R.id.navi... | |
692 | private String getPageSource(String url, int attempts){
try {
System.out.println(webDrivers.stream().filter(wd -> !wd.isOccupied()).count());
CustomChromeDriver usableDriver = webDrivers.stream().filter(wd -> !wd.isOccupied()).findFirst().get();
return usableDriver.getPageSource(url);
... | private String getPageSource(String url, int attempts){
try {
CustomChromeDriver usableDriver = webDrivers.stream().filter(wd -> !wd.isOccupied()).findFirst().get();
return usableDriver.getPageSource(url);
} catch (Exception e) {
e.printStackTrace();
if (attempts < 3) {
... | |
693 | protected void onPostExecute(String response){
if (response == null) {
response = "THERE WAS AN ERROR";
}
Log.i("INFO", response);
Gson gson = new Gson();
Type collectionType = new TypeToken<Collection<new_crime_incident>>() {
}.getType();
Collection<new_crime_incident> enums... | protected void onPostExecute(String response){
if (response == null) {
response = "THERE WAS AN ERROR";
}
Gson gson = new Gson();
Type collectionType = new TypeToken<Collection<Seattle_incident>>() {
}.getType();
Collection<Seattle_incident> enums = gson.fromJson(response, collect... | |
694 | public void verifyGeneratedContestedDocumentCanBeAccessedAndVerifyGetResponseContent(){
String documentUrl = getDocumentUrlOrDocumentBinaryUrl(MINIFORMA_CONTESTED_JSON, generateContestedUrl, "document", "miniForma", contestedDir);
validatePostSuccessForaccessingGeneratedDocument(fileRetrieveUrl(documentUrl));... | public void verifyGeneratedContestedDocumentCanBeAccessedAndVerifyGetResponseContent(){
String documentUrl = getDocumentUrlOrDocumentBinaryUrl(MINIFORMA_CONTESTED_JSON, generateContestedUrl, "document", "miniForma", contestedDir);
JsonPath jsonPathEvaluator1 = accessGeneratedDocument(fileRetrieveUrl(documentU... | |
695 | public void handle(CommandWithArgs commandWithArgs){
List<Note> notes = noteDao.findAll();
if (notes.isEmpty()) {
adapter.writeLine("There are no notes in the system now.");
} else {
adapter.writeLine("All notes:");
adapter.newLine();
for (var note : notes) {
... | public void handle(CommandWithArgs commandWithArgs){
List<Note> notes = noteDao.findAll();
if (notes.isEmpty()) {
adapter.writeLine("There are no notes in the system now.");
} else {
adapter.writeLine("All notes:");
adapter.newLine();
notes.forEach(adapter::writeLine);... | |
696 | public Response<BookView, String> editBook(@RequestBody BookView bookView){
validateInputData(bookView);
BookView data = null;
String error = null;
try {
data = bookService.findById(bookView);
} catch (NullPointerException e) {
if (data == null)
throw new BookNotF... | public Response<BookView, String> editBook(@RequestBody BookView bookView){
validateInputData(bookView);
BookView data = null;
try {
data = bookService.findById(bookView);
} catch (NullPointerException e) {
if (data == null)
throw new BookNotFoundException(bookView.get... | |
697 | public Result authorizeResourceTree(@ApiIgnore @RequestAttribute(value = Constants.SESSION_USER) User loginUser, @RequestParam("userId") Integer userId){
logger.info("all resource file, user:{}, user id:{}", loginUser.getUserName(), userId);
Map<String, Object> result = resourceService.authorizeResourceTree(l... | public Result<List<ResourceComponent>> authorizeResourceTree(@ApiIgnore @RequestAttribute(value = Constants.SESSION_USER) User loginUser, @RequestParam("userId") Integer userId){
logger.info("all resource file, user:{}, user id:{}", loginUser.getUserName(), userId);
return resourceService.authorizeResourceTre... | |
698 | public static double calculateGcContent(final Allele refAllele, final Allele altAllele, final ReferenceContext referenceContext, final int windowSize){
Utils.nonNull(referenceContext);
ParamUtils.isPositive(windowSize, "Window size must be >= 1.");
final int leadingWindowSize;
final int trailingWind... | public static double calculateGcContent(final Allele refAllele, final Allele altAllele, final ReferenceContext referenceContext, final int windowSize){
Utils.nonNull(referenceContext);
ParamUtils.isPositive(windowSize, "Window size must be >= 1.");
final int leadingWindowSize;
final int trailingWind... | |
699 | public Result authorizedUser(@ApiIgnore @RequestAttribute(value = Constants.SESSION_USER) User loginUser, @RequestParam("alertgroupId") Integer alertgroupId){
try {
logger.info("authorized user , login user:{}, alert group id:{}", loginUser.getUserName(), alertgroupId);
Map<String, Object> result... | public Result<List<User>> authorizedUser(@ApiIgnore @RequestAttribute(value = Constants.SESSION_USER) User loginUser, @RequestParam("alertgroupId") Integer alertgroupId){
try {
logger.info("authorized user , login user:{}, alert group id:{}", loginUser.getUserName(), alertgroupId);
return usersSe... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.