blob_id stringlengths 40 40 | directory_id stringlengths 40 40 | path stringlengths 7 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 684M ⌀ | 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 132
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 28
values | content stringlengths 3 9.45M | authors listlengths 1 1 | author_id stringlengths 0 352 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
9b3f02a1952954a341b8fa0ec93c2980a8c44422 | e2e1ff43cefaa435d3a0a1ce6e5d0ee9c0ce6c95 | /src/EPI/Binary_Search_Tree/findLargestKInBST.java | 44e1c1abcb7de050ded75507075baffc173cee5b | [] | no_license | stameying/lintcode | bf0836c097121ec9a70777b4886dc1334909778d | 1c0c4a45e09dcea89229c840422c5fa995b94a9a | refs/heads/master | 2021-01-10T03:26:08.526170 | 2016-04-12T22:41:41 | 2016-04-12T22:41:41 | 47,867,250 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 710 | java | package EPI.Binary_Search_Tree;
import EPI.binary_tree.TreeNode;
import java.util.ArrayList;
import java.util.List;
/**
* Created by stameying on 2/1/16.
*/
public class findLargestKInBST {
public static List<Integer> findKLargest(TreeNode root, int k){
List<Integer> res = new ArrayList<>();
findKLargestHelper(root,k,res);
return res;
}
public static void findKLargestHelper(TreeNode node, int k, List<Integer> res){
if (node != null && res.size() < k){
findKLargestHelper(node.right,k,res);
if (res.size() < k){
res.add(node.val);
findKLargestHelper(node.left,k,res);
}
}
}
}
| [
"huxiaora@usc.edu"
] | huxiaora@usc.edu |
53494a411cb06f5d050f5f57417fb32ee9d6d147 | 6893e449b74dda5ad0e1c2483d1bffbd8ab0294f | /app/src/androidTest/java/com/moss/dbreader/ExampleInstrumentedTest.java | b6dcb26565320c375b79c68ca2c825726a42a959 | [] | no_license | AndreiTang/dbreader | 1b88761da4c9ebb64248ee2547a1a08df2328cd0 | 428ef1fe4c6efefd659ab059597a912328a475a5 | refs/heads/master | 2018-09-25T18:01:50.206187 | 2018-06-06T09:41:34 | 2018-06-06T09:41:34 | 104,838,717 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 738 | java | package com.moss.dbreader;
import android.content.Context;
import android.support.test.InstrumentationRegistry;
import android.support.test.runner.AndroidJUnit4;
import org.junit.Test;
import org.junit.runner.RunWith;
import static org.junit.Assert.*;
/**
* Instrumentation test, which will execute on an Android device.
*
* @see <a href="http://d.android.com/tools/testing">Testing documentation</a>
*/
@RunWith(AndroidJUnit4.class)
public class ExampleInstrumentedTest {
@Test
public void useAppContext() throws Exception {
// Context of the app under test.
Context appContext = InstrumentationRegistry.getTargetContext();
assertEquals("com.moss.dbreader", appContext.getPackageName());
}
}
| [
"qi-feng.tang@hp.com"
] | qi-feng.tang@hp.com |
ee18e9375bc832e404ac724c19186171b9de5116 | 3da5da097a56543a4b1944d260aac1ee0f504479 | /cloudservices-web/src/main/java/request/SendServlet.java | 3cacd804d3fc1a7a1f09d6b91a585eda9008eb29 | [] | no_license | acmyonghua/PushServices | 9653aa2c2a9094531f53b7354fa091440e8f3d34 | 2a18b427f9f3c35ccf942b4156a0d8ecf060c0eb | refs/heads/master | 2021-01-12T22:21:04.663943 | 2015-04-21T09:52:27 | 2015-04-21T09:52:27 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,685 | java | package request;
import java.io.IOException;
import java.net.URLDecoder;
import java.net.URLEncoder;
import java.nio.ByteBuffer;
import javax.servlet.ServletConfig;
import javax.servlet.ServletException;
import javax.servlet.ServletInputStream;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import org.apache.log4j.Logger;
import org.dna.mqtt.moquette.messaging.spi.impl.events.PublishEvent;
import org.dna.mqtt.moquette.proto.messages.AbstractMessage.QOSType;
import org.dna.mqtt.moquette.server.Server;
import utils.ApplicationContextUtil;
import utils.StringUtil;
public class SendServlet extends HttpServlet {
private static Logger logger = Logger.getLogger(SendServlet.class);
private Server mqttServer;
private static final String ENCODING = "utf-8";
@Override
public void init(ServletConfig config) {
mqttServer = (Server) ApplicationContextUtil.getBeanByName("mqttServer");
}
public void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException{
doPost(request, response);
}
/**
* 注:多线程环境下运行
*/
public void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException{
logger.info("send Param - length:" + request.getContentLength());
request.setCharacterEncoding("utf-8");
ServletInputStream in = request.getInputStream();
int length = request.getContentLength();
byte[] data = new byte[length];
in.read(data);
ByteBuffer buffer = ByteBuffer.wrap(data);
String username = getString(buffer);
String topic = getString(buffer);
byte[] packet = getBytes(buffer);
// 验证参数有效性
if (StringUtil.isEmpty(username) || StringUtil.isEmpty(topic) || packet == null) {
response.getWriter().write("send fail, param error");
response.flushBuffer();
return;
}
// 接口测试
if ("test".equals(topic)) {
response.getWriter().write("send inteface test success");
response.flushBuffer();
return;
}
logger.info(String.format("send Param - username: %s, topic: %s, packet.len: %d", username, topic, packet.length));
mqttServer.getMessaging().publish2Subscribers(topic, QOSType.LEAST_ONE, packet, false, 0);
response.getWriter().write("sned success");
response.flushBuffer();
}
private byte[] getBytes(ByteBuffer buffer) {
// TODO Auto-generated method stub
int len = buffer.getInt();
byte[] data = new byte[len];
buffer.get(data);
return data;
}
private String getString(ByteBuffer buffer) {
// TODO Auto-generated method stub
return new String(getBytes(buffer));
}
}
| [
"xanthodont@hotmail.com"
] | xanthodont@hotmail.com |
1bf83b65c028a48c9e2e7e2d1e78076e3e6f845b | ab6bcc43d248464902cd06deb4d8336a0ad453b9 | /commun/librairies/src/main/java/fr/tripplanner/librairies/beans/BaseBeanSync.java | 973126ececf188e7d44520a82a2a640846913a06 | [] | no_license | dlapierre/tripplanner | e071267107ed1d58b809e57630a272547b0a96ab | e9dccadb42a5ae60d1967e5db9b61794c364c0b4 | refs/heads/master | 2021-07-12T20:39:32.739904 | 2017-10-17T20:42:18 | 2017-10-17T20:42:18 | 105,223,777 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,033 | java | /*
* David Lapierre - Code your dreams
*/
package fr.tripplanner.librairies.beans;
import java.io.Serializable;
import fr.tripplanner.librairies.beans.references.OperationSync;
/**
* The Class BaseBeanSync.
*/
public abstract class BaseBeanSync implements Serializable {
/** The Constant serialVersionUID. */
private static final long serialVersionUID = 1L;
/** The type. */
private OperationSync type;
/** The temp ID. */
private long tempID;
/**
* Gets the type.
*
* @return the type
*/
public OperationSync getType() {
return type;
}
/**
* Sets the type.
*
* @param type
* the new type
*/
public void setType(OperationSync type) {
this.type = type;
}
/**
* Gets the temp ID.
*
* @return the temp ID
*/
public long getTempID() {
return tempID;
}
/**
* Sets the temp ID.
*
* @param tempID
* the new temp ID
*/
public void setTempID(long tempID) {
this.tempID = tempID;
}
} | [
"db.lapierre@gmail.com"
] | db.lapierre@gmail.com |
c1fa4aafade651ff4779430eeee3925c4aec3ebd | a768090688c5a734eb7c33f357856b2ed7f15930 | /gamification/src/main/java/microservices/template/gamification/client/MultiplicationResultAttemptDeserializer.java | 6df6c106e17620b98d8193d501dde1c6c9ba3016 | [] | no_license | erithstudio/social-multiplication | 08b6dbdc26e205e86c0b1e9dc4583d9de81c4925 | 967663c25c06f4f3c21c986ca1e2ffee9e4e6fad | refs/heads/main | 2023-08-11T20:16:16.026748 | 2021-09-21T13:18:22 | 2021-09-21T13:18:22 | 375,406,138 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,253 | java | package microservices.template.gamification.client;
import com.fasterxml.jackson.core.JsonParser;
import com.fasterxml.jackson.core.ObjectCodec;
import com.fasterxml.jackson.databind.DeserializationContext;
import com.fasterxml.jackson.databind.JsonDeserializer;
import com.fasterxml.jackson.databind.JsonNode;
import microservices.template.gamification.client.dto.MultiplicationResultAttempt;
import java.io.IOException;
/**
* Deserializes an attempt coming from the Multiplication microservice
* into the Gamification's representation of an attempt.
*/
public class MultiplicationResultAttemptDeserializer extends JsonDeserializer<MultiplicationResultAttempt> {
@Override
public MultiplicationResultAttempt deserialize(JsonParser jsonParser, DeserializationContext deserializationContext) throws IOException {
ObjectCodec oc = jsonParser.getCodec();
JsonNode node = oc.readTree(jsonParser);
return new MultiplicationResultAttempt(node.get("user").get("alias").asText(),
node.get("multiplication").get("factorA").asInt(),
node.get("multiplication").get("factorB").asInt(),
node.get("resultAttempt").asInt(),
node.get("correct").asBoolean());
}
} | [
"denis.prasetio@primecash.co.id"
] | denis.prasetio@primecash.co.id |
70a8123d63c985d79b15d0f8482a10d9b2e7b28a | ce4cc4642b288148355fe688e156f2676784d148 | /intro/FirstLast.java | 76e1346baeec108c8b999d284d9ae1155f3ee756 | [] | no_license | cuzoaru90/java-portfolio | 37c837d86e7756b1f8740ea2532058b7c6780821 | 3d45f7145698c5979ea54abe7186aea2dd371619 | refs/heads/master | 2022-04-06T10:31:34.255461 | 2020-02-15T06:58:30 | 2020-02-15T06:58:30 | 110,923,201 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,360 | java | /* Write a program that starts with the string variable "first" set to your first name and the string variable
"last" set to your last name. Both names should be all lowercase. Your program should then create a new string that
contains your full name in pig latin with the first letter capitalized for the first and last name. Use only the pig
latin rule of moving the first letter to the end of the word and adding "ay". Output the pig latin name to the screen.
Use the substring and toUpperCase methods to construct the new name.
For example, given
first = "walt";
last = "savitch";
the program should create a new string with the text "Altway Avitchsay" and print it.
*/
/* I use Chapter 1 tools to solve this problem */
public class FirstLast {
public static void main (String [] args){
String first = "michael", last = "jordan";
String pigName = "";
// Creates uncapitalized pig latin for first and last names
first = first.substring(1, first.length() )
+ first.substring(0,1) + "ay ";
last = last.substring(1, last.length() )
+ last.substring(0, 1) + "ay";
// Capitalization in Java
first = first.substring(0,1).toUpperCase() + first.substring(1);
last = last.substring(0,1).toUpperCase() + last.substring(1);
pigName = first + last;
System.out.println(pigName);
}
}
| [
"chuckuzoaru@chucks-mbp.attlocal.net"
] | chuckuzoaru@chucks-mbp.attlocal.net |
b8959dac6fd17d829fddc841132546743141c0c8 | cd14c8ea6779a9f88a0d310f3147dd35aac2c70f | /app/src/main/java/com/example/StartQuest/FirstCoordinate.java | 094f8815805b431f4e47ee1162d8670c2237e564 | [] | no_license | TkachenkoND/Project_Autoquest | cdad291de283753c97e1a41433dbb514c089ea03 | 631af3044e694618823ce25e7bab300784a8d930 | refs/heads/master | 2023-07-07T09:12:12.187436 | 2021-08-06T09:45:36 | 2021-08-06T09:45:36 | 393,322,858 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,577 | java | package com.example.StartQuest;
import android.app.Activity;
import android.app.AlertDialog;
import android.content.DialogInterface;
import android.content.Intent;
import android.net.Uri;
import android.os.Bundle;
import android.view.View;
import android.widget.ImageView;
import android.widget.TextView;
import com.example.GPS.MyLocationListener;
import com.example.project_aq_version009.Coordinate;
import com.example.project_aq_version009.R;
public class FirstCoordinate extends Activity {
TextView _tvPrompt;
ImageView gotomap;
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.first_coordinate_activity);
getWindow().getDecorView().setSystemUiVisibility
(View.SYSTEM_UI_FLAG_HIDE_NAVIGATION
|View.SYSTEM_UI_FLAG_IMMERSIVE_STICKY
|View.SYSTEM_UI_FLAG_FULLSCREEN);
_tvPrompt = (TextView) findViewById(R.id.firstPrompt);
gotomap = (ImageView) findViewById(R.id.gotomap);
MyLocationListener.SetUpLocationListener(this);
position();
}
public void GoToMaP(View view){
Intent browserIntent = new Intent(Intent.ACTION_VIEW,
Uri.parse("https://www.google.com/maps/place/49%C2%B024'55.8%22N+32%C2%B001'43.3%22E/@49.4155,32.0287,17z/data=!3m1!4b1!4m5!3m4!1s0x0:0x0!8m2!3d49.4155!4d32.0287"));
startActivity(browserIntent);
}
public void position() {
if (MyLocationListener.checkPosition(MyLocationListener.imHere, Coordinate.latitude[0],Coordinate.longitude[0])) {
Intent intent = new Intent(FirstCoordinate.this, TheSecondTask.class);
FirstCoordinate.this.startActivity(intent);
} else {
AlertDialog.Builder builder = new AlertDialog.Builder(FirstCoordinate.this);
builder.setMessage("Виїхавши за радіус виконання завдання, ви не можете його вирішувати. Поверніться в точку отримання завдання!! \uD83D\uDE0A");
builder.setTitle("Попередження");
builder.setPositiveButton("Ок", new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
position();
dialog.cancel();
}
});
AlertDialog alertDialog = builder.create();
alertDialog.show();
}
}
}
| [
"tkachenkond00@gmail.com"
] | tkachenkond00@gmail.com |
44cf06ffc6d94aea3ad2762930f88cc3233982da | 0f7a936507acbcfb0998fe9fbd6767b4473f4d50 | /hello2/src/main/java/com/helloworld2/hello2/controller/helloController.java | 4d643804c30b5cd4c819b4b48d016f118ac97085 | [] | no_license | aline-brilhante/Hello-World-Spring | 816450e66db886d1563bdf1c865f4057a8ebd87e | 51c1dad4b47d1d9a6aab135836a998a56bde91c9 | refs/heads/main | 2023-04-28T21:29:57.251814 | 2021-05-26T00:22:11 | 2021-05-26T00:22:11 | 370,763,719 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 473 | java | package com.helloworld2.hello2.controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
@RestController
@RequestMapping("/hello2")
public class helloController {
@GetMapping
public String hello2() {
return "Meus objetivos de aprendizagem da semana:\nAprender Spring Boot e entender melhor o funcionamento de Git/Github";
}
}
| [
"lykarms@gmail.com"
] | lykarms@gmail.com |
6bca3f5264cbc2f96afec95def2c1a864a4590b3 | 282ac1db767ec2b4eb5d0829fc3478eb909f348e | /framework/modules/boot-starter/src/main/java/ms/dew/core/doc/DocLocalAutoConfiguration.java | 456841074439cc9cedb444fca7401e6c3258f0b4 | [
"Apache-2.0"
] | permissive | LiuHongcheng/dew | 653166a21fdc96b0abda669592ed2959b4af2f18 | 6ad2d9db5b6e758331e1afc1cdf75bc618adf0c5 | refs/heads/master | 2020-05-19T17:27:14.741921 | 2019-10-30T07:01:39 | 2019-10-30T07:01:39 | 185,134,486 | 0 | 0 | Apache-2.0 | 2019-05-06T06:13:41 | 2019-05-06T06:13:41 | null | UTF-8 | Java | false | false | 1,833 | java | /*
* Copyright 2019. the original author or authors.
*
* 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 ms.dew.core.doc;
import ms.dew.Dew;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingClass;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import java.util.ArrayList;
/**
* Doc local auto configuration.
*
* @author gudaoxuri
*/
@Configuration
@ConditionalOnMissingClass("org.springframework.cloud.client.discovery.DiscoveryClient")
public class DocLocalAutoConfiguration {
@Value("${server.ssl.key-store:}")
private String localSSLKeyStore;
@Value("${server.context-path:}")
private String localContextPath;
/**
* Doc controller doc controller.
*
* @return the doc controller
*/
@Bean
public DocController docController() {
return new DocController(() ->
new ArrayList<String>() {
{
add((localSSLKeyStore == null || localSSLKeyStore.isEmpty() ? "http" : "https")
+ "://localhost:" + Dew.Info.webPort + localContextPath + "/v2/api-docs");
}
}
);
}
}
| [
"i@sunisle.org"
] | i@sunisle.org |
f8fa5484df3e8b9ebddfeb812338d82c7a70a9ce | 32bb40550075b0c7465bd5b44c96198853d050d3 | /TTRepairBookKeeping/src/misc/Address.java | 2f0e1d8f953f2d46955abb31fd1c88a2e9d284a3 | [] | no_license | athoreso/TTAutoRepairBookKeeping | 0adbecc219742b9e964dfcbe78087150c258ef84 | df94f962a39a20b10872dc379ad8713b00561928 | refs/heads/main | 2023-01-28T04:27:15.485899 | 2020-11-30T01:50:32 | 2020-11-30T01:50:32 | 317,082,803 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 937 | java | package misc;
public class Address {
private String state;
private String street;
private String zipcode;
private String city;
public Address() {
this.state = null;
this.street = null;
this.zipcode = null;
this.city = null;
}
public Address(String state, String street, String zipcode, String city) {
this.state = state;
this.street = street;
this.zipcode = zipcode;
this.city = city;
}
public void setState(String state) {
this.state = state;
}
public void setStreet(String street) {
this.street = street;
}
public void setZipcode(String zipcode) {
this.zipcode = zipcode;
}
public void setCity(String city) {
this.city = city;
}
@Override
public String toString(){
StringBuilder sb = new StringBuilder();
sb.append(street + ", ");
sb.append(city + ", ");
sb.append(state + ", ");
sb.append(zipcode + "\n\n");
return sb.toString();
}
}
| [
"athoreso@iastate.edu"
] | athoreso@iastate.edu |
4440558d540cd32dbdea0ef40027c8a239f9c06f | 17f76f8c471673af9eae153c44e5d9776c82d995 | /convertor/java_code/includes/fromanceH.java | 41fa4f1b8d572f1b6c8c0531b1248a02b854b056 | [] | no_license | javaemus/arcadeflex-067 | ef1e47f8518cf214acc5eb246b1fde0d6cbc0028 | 1ea6e5c6a73cf8bca5d234b26d2b5b6312df3931 | refs/heads/main | 2023-02-25T09:25:56.492074 | 2021-02-05T11:40:36 | 2021-02-05T11:40:36 | 330,649,950 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 621 | java | /***************************************************************************
Game Driver for Video System Mahjong series and Pipe Dream.
Driver by Takahiro Nogi <nogi@kt.rim.or.jp> 2001/02/04 -
and Bryan McPhail, Nicola Salmoria, Aaron Giles
***************************************************************************/
/*
* ported to v0.67
* using automatic conversion tool v0.01
*/
package includes;
public class fromanceH
{
/*----------- defined in vidhrdw/fromance.c -----------*/
VIDEO_START( fromance );
VIDEO_START( nekkyoku );
VIDEO_UPDATE( fromance );
VIDEO_UPDATE( pipedrm );
}
| [
"giorgosmrls@gmail.com"
] | giorgosmrls@gmail.com |
b2cf8f5b19b067354950f5ba194013f2621c3415 | 756620bb69e5360f45fd6e95813f6fb86173a2d2 | /src/segfrp/NetworkGraph.java | fb38e547c17bbcf62b30cdbdb7e9501e13fe57a3 | [] | no_license | anix-anbiah/SegrouteFRP | 75375edb30cee59eeee59289c9df4607fa7b34aa | e5f4522a697aa65a2b48b1f46935b37e5b5b7f5a | refs/heads/master | 2023-05-30T19:01:08.613218 | 2021-06-11T04:35:06 | 2021-06-11T04:35:06 | 293,574,250 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,436 | 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 segfrp;
/* Simple graph drawing class
Bert Huang
COMS 3137 Data Structures and Algorithms, Spring 2009
This class is really elementary, but lets you draw
reasonably nice graphs/trees/diagrams. Feel free to
improve upon it!
*/
import java.util.*;
import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
public class NetworkGraph extends JFrame {
int width;
int height;
ArrayList<Node> nodes;
ArrayList<edge> edges;
public NetworkGraph() { //Constructor
this.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
nodes = new ArrayList<Node>();
edges = new ArrayList<edge>();
width = 30;
height = 30;
}
public NetworkGraph(String name) { //Construct with label
this.setTitle(name);
this.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
nodes = new ArrayList<Node>();
edges = new ArrayList<edge>();
width = 30;
height = 30;
}
class Node {
int x, y;
String name;
public Node(String myName, int myX, int myY) {
x = myX;
y = myY;
name = myName;
}
}
class edge {
int i,j;
public edge(int ii, int jj) {
i = ii;
j = jj;
}
}
public void addNode(String name, int x, int y) {
//add a node at pixel (x,y)
nodes.add(new Node(name,x,y));
//this.repaint();
}
public void addEdge(int i, int j) {
//add an edge between nodes i and j
edges.add(new edge(i,j));
//this.repaint();
}
public void paint(Graphics g) { // draw the nodes and edges
FontMetrics f = g.getFontMetrics();
int nodeHeight = Math.max(height, f.getHeight());
g.setColor(Color.black);
for (edge e : edges) {
g.drawLine(nodes.get(e.i).x, nodes.get(e.i).y,
nodes.get(e.j).x, nodes.get(e.j).y);
}
for (Node n : nodes) {
int nodeWidth = Math.max(width, f.stringWidth(n.name)+width/2);
g.setColor(Color.white);
//g.fillOval(n.x-nodeWidth/2, n.y-nodeHeight/2,
// nodeWidth, nodeHeight);
g.fillOval(n.x, n.y, 1, 1);
g.setColor(Color.black);
g.drawOval(n.x, n.y, 1, 1);
//g.drawOval(n.x-nodeWidth/2, n.y-nodeHeight/2,
//nodeWidth, nodeHeight);
// g.drawString(n.name, n.x-f.stringWidth(n.name)/2,
// n.y+f.getHeight()/2);
}
}
}
| [
"anix@riverstonetech.com"
] | anix@riverstonetech.com |
73a792ce2e6d819f03ad5712ad6214af1f1faa0e | 5fa6e955dc1a47321c085754f42d4abb7ea992b7 | /awzsu-label/src/main/java/com/awzsu/label/config/RedisConfig.java | 9888aaa62b20e6d2c589c59e46c6945a3d112729 | [] | no_license | xiaoziwei11z/awzsu_backend | f9327e087c9d4e3f178883d5f8cf192892ec9eb8 | 14d2bddd5675af2b484c90607d33bad9c0da3806 | refs/heads/master | 2023-03-09T12:42:45.126811 | 2021-02-25T09:36:53 | 2021-02-25T09:36:53 | 307,908,016 | 0 | 1 | null | null | null | null | UTF-8 | Java | false | false | 1,893 | java | package com.awzsu.label.config;
import com.fasterxml.jackson.annotation.JsonAutoDetect;
import com.fasterxml.jackson.annotation.PropertyAccessor;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.fasterxml.jackson.databind.ser.std.StringSerializer;
import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.data.redis.connection.RedisConnectionFactory;
import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.data.redis.core.StringRedisTemplate;
import org.springframework.data.redis.serializer.Jackson2JsonRedisSerializer;
import org.springframework.data.redis.serializer.StringRedisSerializer;
@Configuration
public class RedisConfig {
@Bean
public RedisTemplate<String, String> redisTemplate(RedisConnectionFactory factory) {
StringRedisTemplate redisTemplate = new StringRedisTemplate(factory);
Jackson2JsonRedisSerializer jackson2JsonRedisSerializer = new Jackson2JsonRedisSerializer(Object.class);
ObjectMapper om = new ObjectMapper();
om.setVisibility(PropertyAccessor.ALL, JsonAutoDetect.Visibility.ANY);
om.enableDefaultTyping(ObjectMapper.DefaultTyping.NON_FINAL);
jackson2JsonRedisSerializer.setObjectMapper(om);
//设置完这个可以直接将对象以json格式存入redis中,但是取出来的时候要用JSON.parseArray(Json.toJsonString(object),Object.class)解析一下
redisTemplate.setValueSerializer(jackson2JsonRedisSerializer);
redisTemplate.setHashValueSerializer(jackson2JsonRedisSerializer);
//调用后完成设置
redisTemplate.afterPropertiesSet();
return redisTemplate;
}
} | [
"zs@163.com"
] | zs@163.com |
f9317cfba10be07b883a27b8f394a1e20c75cc5c | c84ae94a1ba66e37eb0d4f3e209f3932dd05b40f | /earlywarning/src/main/java/taojinke/qianxing/earlywarning/MainActivity.java | 1f665da2fa1833b5c0439a5d269fce3d7ffdf524 | [] | no_license | ZengBule/TaoJinKe | 97a4646dd8a2a31e8bbdb26ac0ff7cbdae86ef8b | f81729127c1dd1a20b979fda63bf9b13637ae1c9 | refs/heads/master | 2021-07-12T11:03:18.497286 | 2020-06-23T09:46:57 | 2020-06-23T09:46:57 | 161,163,144 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 344 | java | package taojinke.qianxing.earlywarning;
import android.os.Bundle;
import androidx.appcompat.app.AppCompatActivity;
public class MainActivity extends AppCompatActivity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
}
}
| [
"tangwh@itaojin.cn"
] | tangwh@itaojin.cn |
1a1babc461716131e820e4e97c61c1caa4696791 | f1dd381b36337d6d9aeed0244626c161e0577d33 | /app/src/main/java/cn/protector/logic/entity/ChatMessage.java | 523175217ad1bdd1dafa01f8c04366f07f5d3eeb | [] | no_license | czg12300/Protector | d85bc38b4778377c6f0557b90ece5af7d4c9048e | 7df9fb4e3002aa68005ba5f9b7337ed90f6076ee | refs/heads/master | 2020-12-13T16:10:30.340658 | 2015-10-20T09:56:33 | 2015-10-20T09:56:33 | 40,595,970 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 521 | java | package cn.protector.logic.entity;
import java.io.Serializable;
/**
* 描述:宝贝信息实体类
*
* @author Created by Administrator on 2015/9/4.
*/
public class ChatMessage implements JsonParse {
public static final int TYPE_MESSAGE=1;
public static final int TYPE_VOICE=2;
public String name;
public String avator;
public String time;
public String message;
public int type;
public String voice;
public int id;
@Override
public void parse(String json) {
}
}
| [
"903475400@qq.com"
] | 903475400@qq.com |
ab08f5b020b9613a3f5d2246c8bd8778a8e01fe6 | 03a9ef0f70b9d00c635be0b3c31a8eaa797bc013 | /ERP_system/src/Interfaces/EmployeeMan/Report.java | d70b2e284b2e4a3d0348131e13fe8ecb43412859 | [] | no_license | chamila1997/ERP-Projct | 1f2d94c5d255d292663bad1f230034503b2ccd19 | e30dc8b4cc0a60cb901524b59dd2c9658ae0be2f | refs/heads/master | 2020-07-29T23:16:07.801313 | 2019-09-21T14:20:49 | 2019-09-21T14:20:49 | 209,997,475 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 36,888 | 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 Interfaces.EmployeeMan;
import com.itextpdf.text.BaseColor;
import com.itextpdf.text.pdf.PdfWriter;
import java.awt.Dimension;
import java.awt.Toolkit;
import com.itextpdf.text.Document;
import com.itextpdf.text.DocumentException;
import com.itextpdf.text.Element;
import com.itextpdf.text.Font.FontFamily;
import com.itextpdf.text.FontFactory;
import com.itextpdf.text.Paragraph;
import com.itextpdf.text.Phrase;
import com.itextpdf.text.pdf.GrayColor;
import com.itextpdf.text.pdf.PdfPCell;
import com.itextpdf.text.pdf.PdfWriter;
import com.itextpdf.text.pdf.PdfPTable;
import dbConnect.DBconnect;
import java.awt.Font;
import java.awt.event.MouseListener;
import java.io.File;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.OutputStream;
import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.ResultSetMetaData;
import java.text.DateFormat;
import java.text.SimpleDateFormat;
import java.util.logging.Level;
import java.util.logging.Logger;
import javax.swing.JFileChooser;
import javax.swing.JOptionPane;
import java.util.Date;
import java.util.GregorianCalendar;
import javax.swing.plaf.basic.BasicInternalFrameUI;
/**
*
* @author SAHAN
*/
public class Report extends javax.swing.JInternalFrame {
Connection con = null;
ResultSet rs=null;
PreparedStatement pst = null;
/**
* Creates new form Report
*/
public Report() {
initComponents();
setVisible(true);//not moving jinternal frame
BasicInternalFrameUI basicInternalFrameUI = (javax.swing.plaf.basic.BasicInternalFrameUI)this.getUI(); //not moving jinternal frame
for(MouseListener listener : basicInternalFrameUI.getNorthPane().getMouseListeners()){ //not moving jinternal frame
basicInternalFrameUI.getNorthPane().removeMouseListener(listener); //not moving jinternal frame
}
//DB connection
con = DBconnect.connect();
}
/**
* This method is called from within the constructor to initialize the form.
* WARNING: Do NOT modify this code. The content of this method is always
* regenerated by the Form Editor.
*/
@SuppressWarnings("unchecked")
// <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
private void initComponents() {
jPanel1 = new javax.swing.JPanel();
jButton1 = new javax.swing.JButton();
jButton3 = new javax.swing.JButton();
jComboBox1 = new javax.swing.JComboBox<>();
jSeparator1 = new javax.swing.JSeparator();
jLabel1 = new javax.swing.JLabel();
jLabel2 = new javax.swing.JLabel();
amount = new javax.swing.JTextField();
jLabel4 = new javax.swing.JLabel();
amount1 = new javax.swing.JTextField();
jLabel5 = new javax.swing.JLabel();
jLabel6 = new javax.swing.JLabel();
jButton4 = new javax.swing.JButton();
jSeparator2 = new javax.swing.JSeparator();
jLabel3 = new javax.swing.JLabel();
setBackground(new java.awt.Color(255, 255, 255));
jPanel1.setBackground(new java.awt.Color(102, 153, 255));
jButton1.setBackground(new java.awt.Color(255, 255, 255));
jButton1.setFont(new java.awt.Font("Agency FB", 1, 24)); // NOI18N
jButton1.setForeground(new java.awt.Color(204, 0, 0));
jButton1.setText("Generate Report");
jButton1.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jButton1ActionPerformed(evt);
}
});
jButton3.setBackground(new java.awt.Color(255, 255, 255));
jButton3.setFont(new java.awt.Font("Agency FB", 1, 24)); // NOI18N
jButton3.setForeground(new java.awt.Color(204, 0, 0));
jButton3.setText("Generate Report");
jButton3.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jButton3ActionPerformed(evt);
}
});
jComboBox1.setModel(new javax.swing.DefaultComboBoxModel<>(new String[] { "Executive", "Non-executive" }));
jSeparator1.setBackground(new java.awt.Color(0, 0, 0));
jLabel1.setBackground(new java.awt.Color(0, 0, 0));
jLabel1.setFont(new java.awt.Font("Arial Black", 1, 18)); // NOI18N
jLabel1.setForeground(new java.awt.Color(204, 0, 0));
jLabel1.setText(" Employee Details");
jLabel1.setBorder(javax.swing.BorderFactory.createMatteBorder(3, 3, 3, 3, new java.awt.Color(204, 255, 204)));
jLabel2.setBackground(new java.awt.Color(0, 0, 0));
jLabel2.setFont(new java.awt.Font("Arial Black", 1, 18)); // NOI18N
jLabel2.setForeground(new java.awt.Color(204, 0, 0));
jLabel2.setText(" Salary NetPay >");
jLabel2.setBorder(javax.swing.BorderFactory.createMatteBorder(3, 3, 3, 3, new java.awt.Color(204, 255, 204)));
jLabel4.setFont(new java.awt.Font("Tahoma", 1, 13)); // NOI18N
jLabel4.setText(" Enter The Amount :");
jLabel5.setBackground(new java.awt.Color(0, 0, 0));
jLabel5.setFont(new java.awt.Font("Arial Black", 1, 18)); // NOI18N
jLabel5.setForeground(new java.awt.Color(204, 0, 0));
jLabel5.setText(" Salary NetPay <");
jLabel5.setBorder(javax.swing.BorderFactory.createMatteBorder(3, 3, 3, 3, new java.awt.Color(204, 255, 204)));
jLabel6.setFont(new java.awt.Font("Tahoma", 1, 13)); // NOI18N
jLabel6.setText(" Enter The Amount :");
jButton4.setBackground(new java.awt.Color(255, 255, 255));
jButton4.setFont(new java.awt.Font("Agency FB", 1, 24)); // NOI18N
jButton4.setForeground(new java.awt.Color(204, 0, 0));
jButton4.setText("Generate Report");
jButton4.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jButton4ActionPerformed(evt);
}
});
jSeparator2.setBackground(new java.awt.Color(0, 0, 0));
javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1);
jPanel1.setLayout(jPanel1Layout);
jPanel1Layout.setHorizontalGroup(
jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPanel1Layout.createSequentialGroup()
.addGap(68, 68, 68)
.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
.addGroup(jPanel1Layout.createSequentialGroup()
.addGap(0, 0, Short.MAX_VALUE)
.addComponent(jButton1, javax.swing.GroupLayout.PREFERRED_SIZE, 180, javax.swing.GroupLayout.PREFERRED_SIZE))
.addGroup(jPanel1Layout.createSequentialGroup()
.addComponent(jLabel1, javax.swing.GroupLayout.PREFERRED_SIZE, 220, javax.swing.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 30, Short.MAX_VALUE)
.addComponent(jComboBox1, javax.swing.GroupLayout.PREFERRED_SIZE, 211, javax.swing.GroupLayout.PREFERRED_SIZE)))
.addGap(109, 109, 109))
.addGroup(jPanel1Layout.createSequentialGroup()
.addGap(69, 69, 69)
.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
.addComponent(jButton4, javax.swing.GroupLayout.PREFERRED_SIZE, 198, javax.swing.GroupLayout.PREFERRED_SIZE)
.addGroup(jPanel1Layout.createSequentialGroup()
.addComponent(jLabel5, javax.swing.GroupLayout.PREFERRED_SIZE, 220, javax.swing.GroupLayout.PREFERRED_SIZE)
.addGap(18, 18, 18)
.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
.addComponent(jLabel6, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addComponent(amount1, javax.swing.GroupLayout.PREFERRED_SIZE, 227, javax.swing.GroupLayout.PREFERRED_SIZE)))
.addComponent(jButton3, javax.swing.GroupLayout.PREFERRED_SIZE, 198, javax.swing.GroupLayout.PREFERRED_SIZE)
.addGroup(jPanel1Layout.createSequentialGroup()
.addComponent(jLabel2, javax.swing.GroupLayout.PREFERRED_SIZE, 220, javax.swing.GroupLayout.PREFERRED_SIZE)
.addGap(18, 18, 18)
.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
.addComponent(jLabel4, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addComponent(amount, javax.swing.GroupLayout.PREFERRED_SIZE, 227, javax.swing.GroupLayout.PREFERRED_SIZE))))
.addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
.addComponent(jSeparator2)
.addComponent(jSeparator1, javax.swing.GroupLayout.Alignment.TRAILING)
);
jPanel1Layout.setVerticalGroup(
jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPanel1Layout.createSequentialGroup()
.addGap(64, 64, 64)
.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
.addComponent(jComboBox1)
.addComponent(jLabel1, javax.swing.GroupLayout.DEFAULT_SIZE, 53, Short.MAX_VALUE))
.addGap(45, 45, 45)
.addComponent(jButton1, javax.swing.GroupLayout.PREFERRED_SIZE, 48, javax.swing.GroupLayout.PREFERRED_SIZE)
.addGap(18, 18, 18)
.addComponent(jSeparator1, javax.swing.GroupLayout.PREFERRED_SIZE, 19, javax.swing.GroupLayout.PREFERRED_SIZE)
.addGap(18, 18, 18)
.addComponent(jLabel4)
.addGap(18, 18, 18)
.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(jLabel2, javax.swing.GroupLayout.DEFAULT_SIZE, 53, Short.MAX_VALUE)
.addComponent(amount))
.addGap(46, 46, 46)
.addComponent(jButton3, javax.swing.GroupLayout.PREFERRED_SIZE, 49, javax.swing.GroupLayout.PREFERRED_SIZE)
.addGap(31, 31, 31)
.addComponent(jSeparator2, javax.swing.GroupLayout.PREFERRED_SIZE, 16, javax.swing.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(jLabel6)
.addGap(18, 18, 18)
.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(jLabel5, javax.swing.GroupLayout.DEFAULT_SIZE, 53, Short.MAX_VALUE)
.addComponent(amount1))
.addGap(46, 46, 46)
.addComponent(jButton4, javax.swing.GroupLayout.PREFERRED_SIZE, 49, javax.swing.GroupLayout.PREFERRED_SIZE)
.addGap(38, 38, 38))
);
jLabel3.setIcon(new javax.swing.ImageIcon(getClass().getResource("/erp_system/wallpaper.gif"))); // NOI18N
jLabel3.setText("jLabel2");
javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
getContentPane().setLayout(layout);
layout.setHorizontalGroup(
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(layout.createSequentialGroup()
.addContainerGap()
.addComponent(jPanel1, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addGap(18, 18, 18)
.addComponent(jLabel3, javax.swing.GroupLayout.PREFERRED_SIZE, 999, javax.swing.GroupLayout.PREFERRED_SIZE)
.addContainerGap())
);
layout.setVerticalGroup(
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(layout.createSequentialGroup()
.addContainerGap(25, Short.MAX_VALUE)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
.addComponent(jLabel3, javax.swing.GroupLayout.PREFERRED_SIZE, 741, javax.swing.GroupLayout.PREFERRED_SIZE)
.addContainerGap())
.addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
.addComponent(jPanel1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addGap(24, 24, 24))))
);
pack();
}// </editor-fold>//GEN-END:initComponents
private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton1ActionPerformed
JFileChooser dialog = new JFileChooser();
dialog.setSelectedFile(new File("Employees Report.pdf"));
int dialogResult = dialog.showSaveDialog(null);
if (dialogResult==JFileChooser.APPROVE_OPTION){
String filePath = dialog.getSelectedFile().getPath();
try {
// TODO add your handling code here:
String position = jComboBox1.getSelectedItem().toString();
String sql ="select * from employee where position = '"+position+"'";
pst=con.prepareStatement(sql);
rs=pst.executeQuery();
Document myDocument = new Document();
PdfWriter myWriter = PdfWriter.getInstance(myDocument, new FileOutputStream(filePath ));
PdfPTable table = new PdfPTable(16);
myDocument.open();
// float[] columnWidths = new float[]{10f, 20f, 10f, 20f,20f,20f,20f,20f,20f,20f,20f,20f,20f,20f,20f};
//table.setWidths(columnWidths);
float[] columnWidths = new float[] {20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20};
table.setWidths(columnWidths);
table.setWidthPercentage(100); //set table width to 100%
//newly added
//table.getDefaultCell().setUseAscender(true);
// table.getDefaultCell().setUseDescender(true);
myDocument.add(new Paragraph("Employees List",FontFactory.getFont(FontFactory.TIMES_BOLD,20,Font.BOLD )));
myDocument.add(new Paragraph(new Date().toString()));
myDocument.add(new Paragraph("-------------------------------------------------------------------------------------------"));
table.addCell(new PdfPCell(new Paragraph("ID",FontFactory.getFont(FontFactory.TIMES_ROMAN,9,Font.BOLD))));
table.addCell(new PdfPCell(new Paragraph("Name",FontFactory.getFont(FontFactory.TIMES_ROMAN,9,Font.BOLD))));
table.addCell(new PdfPCell(new Paragraph("Age",FontFactory.getFont(FontFactory.TIMES_ROMAN,9,Font.BOLD))));
table.addCell(new PdfPCell(new Paragraph("Street",FontFactory.getFont(FontFactory.TIMES_ROMAN,9,Font.BOLD))));
table.addCell(new PdfPCell(new Paragraph("City",FontFactory.getFont(FontFactory.TIMES_ROMAN,9,Font.BOLD))));
table.addCell(new PdfPCell(new Paragraph("State",FontFactory.getFont(FontFactory.TIMES_ROMAN,9,Font.BOLD))));
table.addCell(new PdfPCell(new Paragraph("NIC",FontFactory.getFont(FontFactory.TIMES_ROMAN,9,Font.BOLD))));
table.addCell(new PdfPCell(new Paragraph("Phone",FontFactory.getFont(FontFactory.TIMES_ROMAN,9,Font.BOLD))));
table.addCell(new PdfPCell(new Paragraph("Department",FontFactory.getFont(FontFactory.TIMES_ROMAN,9,Font.BOLD))));
table.addCell(new PdfPCell(new Paragraph("E-mail",FontFactory.getFont(FontFactory.TIMES_ROMAN,9,Font.BOLD))));
table.addCell(new PdfPCell(new Paragraph("Salary",FontFactory.getFont(FontFactory.TIMES_ROMAN,9,Font.BOLD))));
table.addCell(new PdfPCell(new Paragraph("Position",FontFactory.getFont(FontFactory.TIMES_ROMAN,9,Font.BOLD))));
table.addCell(new PdfPCell(new Paragraph("BRA",FontFactory.getFont(FontFactory.TIMES_ROMAN,9,Font.BOLD))));
table.addCell(new PdfPCell(new Paragraph("Incentive",FontFactory.getFont(FontFactory.TIMES_ROMAN,9,Font.BOLD))));
table.addCell(new PdfPCell(new Paragraph("Transport",FontFactory.getFont(FontFactory.TIMES_ROMAN,9,Font.BOLD))));
table.addCell(new PdfPCell(new Paragraph("EPF NO",FontFactory.getFont(FontFactory.TIMES_ROMAN,9,Font.BOLD))));
while(rs.next())
{
table.addCell(new PdfPCell(new Paragraph(rs.getString(1),FontFactory.getFont(FontFactory.TIMES_ROMAN,8,Font.PLAIN))));
table.addCell(new PdfPCell(new Paragraph(rs.getString(2),FontFactory.getFont(FontFactory.TIMES_ROMAN,8,Font.PLAIN))));
table.addCell(new PdfPCell(new Paragraph(rs.getString(3),FontFactory.getFont(FontFactory.TIMES_ROMAN,8,Font.PLAIN))));
table.addCell(new PdfPCell(new Paragraph(rs.getString(4),FontFactory.getFont(FontFactory.TIMES_ROMAN,8,Font.PLAIN))));
table.addCell(new PdfPCell(new Paragraph(rs.getString(5),FontFactory.getFont(FontFactory.TIMES_ROMAN,8,Font.PLAIN))));
table.addCell(new PdfPCell(new Paragraph(rs.getString(6),FontFactory.getFont(FontFactory.TIMES_ROMAN,8,Font.PLAIN))));
table.addCell(new PdfPCell(new Paragraph(rs.getString(7),FontFactory.getFont(FontFactory.TIMES_ROMAN,8,Font.PLAIN))));
table.addCell(new PdfPCell(new Paragraph(rs.getString(8),FontFactory.getFont(FontFactory.TIMES_ROMAN,8,Font.PLAIN))));
table.addCell(new PdfPCell(new Paragraph(rs.getString(9),FontFactory.getFont(FontFactory.TIMES_ROMAN,8,Font.PLAIN))));
table.addCell(new PdfPCell(new Paragraph(rs.getString(10),FontFactory.getFont(FontFactory.TIMES_ROMAN,8,Font.PLAIN))));
table.addCell(new PdfPCell(new Paragraph(rs.getString(11),FontFactory.getFont(FontFactory.TIMES_ROMAN,8,Font.PLAIN))));
table.addCell(new PdfPCell(new Paragraph(rs.getString(12),FontFactory.getFont(FontFactory.TIMES_ROMAN,8,Font.PLAIN))));
table.addCell(new PdfPCell(new Paragraph(rs.getString(13),FontFactory.getFont(FontFactory.TIMES_ROMAN,8,Font.PLAIN))));
table.addCell(new PdfPCell(new Paragraph(rs.getString(14),FontFactory.getFont(FontFactory.TIMES_ROMAN,8,Font.PLAIN))));
table.addCell(new PdfPCell(new Paragraph(rs.getString(15),FontFactory.getFont(FontFactory.TIMES_ROMAN,8,Font.PLAIN))));
table.addCell(new PdfPCell(new Paragraph(rs.getString(16),FontFactory.getFont(FontFactory.TIMES_ROMAN,8,Font.PLAIN))));
}
myDocument.add(table);
myDocument.add(new Paragraph("--------------------------------------------------------------------------------------------"));
myDocument.close();
JOptionPane.showMessageDialog(null,"Report was successfully generated");
}
catch(Exception e){
JOptionPane.showMessageDialog(null,e);
}
finally {
try{
rs.close();
pst.close();
}
catch(Exception e){
JOptionPane.showMessageDialog(null,e);
}
}
}
}//GEN-LAST:event_jButton1ActionPerformed
private void jButton3ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton3ActionPerformed
JFileChooser dialog = new JFileChooser();
dialog.setSelectedFile(new File("Salary Report.pdf"));
int dialogResult = dialog.showSaveDialog(null);
if (dialogResult==JFileChooser.APPROVE_OPTION){
String filePath = dialog.getSelectedFile().getPath();
try {
// TODO add your handling code here:
String Amount = amount.getText();
String sql ="select * from salary where NetPay > '"+Amount+"'";
pst=con.prepareStatement(sql);
rs=pst.executeQuery();
Document myDocument = new Document();
PdfWriter myWriter = PdfWriter.getInstance(myDocument, new FileOutputStream(filePath ));
PdfPTable table = new PdfPTable(19);
myDocument.open();
// float[] columnWidths = new float[]{10f, 20f, 10f, 20f,20f,20f,20f,20f,20f,20f,20f,20f,20f,20f,20f};
//table.setWidths(columnWidths);
float[] columnWidths = new float[] {20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20};
table.setWidths(columnWidths);
table.setWidthPercentage(100); //set table width to 100%
//newly added
//table.getDefaultCell().setUseAscender(true);
// table.getDefaultCell().setUseDescender(true);
myDocument.add(new Paragraph("Employees List",FontFactory.getFont(FontFactory.TIMES_BOLD,20,Font.BOLD )));
myDocument.add(new Paragraph(new Date().toString()));
myDocument.add(new Paragraph("-------------------------------------------------------------------------------------------"));
table.addCell(new PdfPCell(new Paragraph("ID",FontFactory.getFont(FontFactory.TIMES_ROMAN,9,Font.BOLD))));
table.addCell(new PdfPCell(new Paragraph("Name",FontFactory.getFont(FontFactory.TIMES_ROMAN,9,Font.BOLD))));
table.addCell(new PdfPCell(new Paragraph("Basic Salary",FontFactory.getFont(FontFactory.TIMES_ROMAN,9,Font.BOLD))));
table.addCell(new PdfPCell(new Paragraph("BRA",FontFactory.getFont(FontFactory.TIMES_ROMAN,9,Font.BOLD))));
table.addCell(new PdfPCell(new Paragraph("Incentive",FontFactory.getFont(FontFactory.TIMES_ROMAN,9,Font.BOLD))));
table.addCell(new PdfPCell(new Paragraph("Transport",FontFactory.getFont(FontFactory.TIMES_ROMAN,9,Font.BOLD))));
table.addCell(new PdfPCell(new Paragraph("Normal_OT",FontFactory.getFont(FontFactory.TIMES_ROMAN,9,Font.BOLD))));
table.addCell(new PdfPCell(new Paragraph("Holiday_OT",FontFactory.getFont(FontFactory.TIMES_ROMAN,9,Font.BOLD))));
table.addCell(new PdfPCell(new Paragraph("Attendance",FontFactory.getFont(FontFactory.TIMES_ROMAN,9,Font.BOLD))));
table.addCell(new PdfPCell(new Paragraph("No-Pay",FontFactory.getFont(FontFactory.TIMES_ROMAN,9,Font.BOLD))));
table.addCell(new PdfPCell(new Paragraph("EPF",FontFactory.getFont(FontFactory.TIMES_ROMAN,9,Font.BOLD))));
table.addCell(new PdfPCell(new Paragraph("ETF",FontFactory.getFont(FontFactory.TIMES_ROMAN,9,Font.BOLD))));
table.addCell(new PdfPCell(new Paragraph("Medical",FontFactory.getFont(FontFactory.TIMES_ROMAN,9,Font.BOLD))));
table.addCell(new PdfPCell(new Paragraph("OtherIncntv",FontFactory.getFont(FontFactory.TIMES_ROMAN,9,Font.BOLD))));
table.addCell(new PdfPCell(new Paragraph("OtherDeductn",FontFactory.getFont(FontFactory.TIMES_ROMAN,9,Font.BOLD))));
table.addCell(new PdfPCell(new Paragraph("Loan",FontFactory.getFont(FontFactory.TIMES_ROMAN,9,Font.BOLD))));
table.addCell(new PdfPCell(new Paragraph("Advance",FontFactory.getFont(FontFactory.TIMES_ROMAN,9,Font.BOLD))));
table.addCell(new PdfPCell(new Paragraph("NetPay",FontFactory.getFont(FontFactory.TIMES_ROMAN,9,Font.BOLD))));
table.addCell(new PdfPCell(new Paragraph("EpfNo",FontFactory.getFont(FontFactory.TIMES_ROMAN,9,Font.BOLD))));
while(rs.next())
{
table.addCell(new PdfPCell(new Paragraph(rs.getString(1),FontFactory.getFont(FontFactory.TIMES_ROMAN,8,Font.PLAIN))));
table.addCell(new PdfPCell(new Paragraph(rs.getString(2),FontFactory.getFont(FontFactory.TIMES_ROMAN,8,Font.PLAIN))));
table.addCell(new PdfPCell(new Paragraph(rs.getString(3),FontFactory.getFont(FontFactory.TIMES_ROMAN,8,Font.PLAIN))));
table.addCell(new PdfPCell(new Paragraph(rs.getString(4),FontFactory.getFont(FontFactory.TIMES_ROMAN,8,Font.PLAIN))));
table.addCell(new PdfPCell(new Paragraph(rs.getString(5),FontFactory.getFont(FontFactory.TIMES_ROMAN,8,Font.PLAIN))));
table.addCell(new PdfPCell(new Paragraph(rs.getString(6),FontFactory.getFont(FontFactory.TIMES_ROMAN,8,Font.PLAIN))));
table.addCell(new PdfPCell(new Paragraph(rs.getString(7),FontFactory.getFont(FontFactory.TIMES_ROMAN,8,Font.PLAIN))));
table.addCell(new PdfPCell(new Paragraph(rs.getString(8),FontFactory.getFont(FontFactory.TIMES_ROMAN,8,Font.PLAIN))));
table.addCell(new PdfPCell(new Paragraph(rs.getString(9),FontFactory.getFont(FontFactory.TIMES_ROMAN,8,Font.PLAIN))));
table.addCell(new PdfPCell(new Paragraph(rs.getString(10),FontFactory.getFont(FontFactory.TIMES_ROMAN,8,Font.PLAIN))));
table.addCell(new PdfPCell(new Paragraph(rs.getString(11),FontFactory.getFont(FontFactory.TIMES_ROMAN,8,Font.PLAIN))));
table.addCell(new PdfPCell(new Paragraph(rs.getString(12),FontFactory.getFont(FontFactory.TIMES_ROMAN,8,Font.PLAIN))));
table.addCell(new PdfPCell(new Paragraph(rs.getString(13),FontFactory.getFont(FontFactory.TIMES_ROMAN,8,Font.PLAIN))));
table.addCell(new PdfPCell(new Paragraph(rs.getString(14),FontFactory.getFont(FontFactory.TIMES_ROMAN,8,Font.PLAIN))));
table.addCell(new PdfPCell(new Paragraph(rs.getString(15),FontFactory.getFont(FontFactory.TIMES_ROMAN,8,Font.PLAIN))));
table.addCell(new PdfPCell(new Paragraph(rs.getString(16),FontFactory.getFont(FontFactory.TIMES_ROMAN,8,Font.PLAIN))));
table.addCell(new PdfPCell(new Paragraph(rs.getString(17),FontFactory.getFont(FontFactory.TIMES_ROMAN,8,Font.PLAIN))));
table.addCell(new PdfPCell(new Paragraph(rs.getString(18),FontFactory.getFont(FontFactory.TIMES_ROMAN,8,Font.PLAIN))));
table.addCell(new PdfPCell(new Paragraph(rs.getString(19),FontFactory.getFont(FontFactory.TIMES_ROMAN,8,Font.PLAIN))));
}
myDocument.add(table);
myDocument.add(new Paragraph("--------------------------------------------------------------------------------------------"));
myDocument.close();
JOptionPane.showMessageDialog(null,"Report was successfully generated");
}
catch(Exception e){
JOptionPane.showMessageDialog(null,e);
}
finally {
try{
rs.close();
pst.close();
}
catch(Exception e){
JOptionPane.showMessageDialog(null,e);
}
}
}
}//GEN-LAST:event_jButton3ActionPerformed
private void jButton4ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton4ActionPerformed
JFileChooser dialog = new JFileChooser();
dialog.setSelectedFile(new File("Salary Report.pdf"));
int dialogResult = dialog.showSaveDialog(null);
if (dialogResult==JFileChooser.APPROVE_OPTION){
String filePath = dialog.getSelectedFile().getPath();
try {
// TODO add your handling code here:
String Amount = amount.getText();
String sql ="select * from salary where NetPay < '"+Amount+"'";
pst=con.prepareStatement(sql);
rs=pst.executeQuery();
Document myDocument = new Document();
PdfWriter myWriter = PdfWriter.getInstance(myDocument, new FileOutputStream(filePath ));
PdfPTable table = new PdfPTable(19);
myDocument.open();
// float[] columnWidths = new float[]{10f, 20f, 10f, 20f,20f,20f,20f,20f,20f,20f,20f,20f,20f,20f,20f};
//table.setWidths(columnWidths);
float[] columnWidths = new float[] {20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20};
table.setWidths(columnWidths);
table.setWidthPercentage(100); //set table width to 100%
//newly added
//table.getDefaultCell().setUseAscender(true);
// table.getDefaultCell().setUseDescender(true);
myDocument.add(new Paragraph("Employees List",FontFactory.getFont(FontFactory.TIMES_BOLD,20,Font.BOLD )));
myDocument.add(new Paragraph(new Date().toString()));
myDocument.add(new Paragraph("-------------------------------------------------------------------------------------------"));
table.addCell(new PdfPCell(new Paragraph("ID",FontFactory.getFont(FontFactory.TIMES_ROMAN,9,Font.BOLD))));
table.addCell(new PdfPCell(new Paragraph("Name",FontFactory.getFont(FontFactory.TIMES_ROMAN,9,Font.BOLD))));
table.addCell(new PdfPCell(new Paragraph("Basic Salary",FontFactory.getFont(FontFactory.TIMES_ROMAN,9,Font.BOLD))));
table.addCell(new PdfPCell(new Paragraph("BRA",FontFactory.getFont(FontFactory.TIMES_ROMAN,9,Font.BOLD))));
table.addCell(new PdfPCell(new Paragraph("Incentive",FontFactory.getFont(FontFactory.TIMES_ROMAN,9,Font.BOLD))));
table.addCell(new PdfPCell(new Paragraph("Transport",FontFactory.getFont(FontFactory.TIMES_ROMAN,9,Font.BOLD))));
table.addCell(new PdfPCell(new Paragraph("Normal_OT",FontFactory.getFont(FontFactory.TIMES_ROMAN,9,Font.BOLD))));
table.addCell(new PdfPCell(new Paragraph("Holiday_OT",FontFactory.getFont(FontFactory.TIMES_ROMAN,9,Font.BOLD))));
table.addCell(new PdfPCell(new Paragraph("Attendance",FontFactory.getFont(FontFactory.TIMES_ROMAN,9,Font.BOLD))));
table.addCell(new PdfPCell(new Paragraph("No-Pay",FontFactory.getFont(FontFactory.TIMES_ROMAN,9,Font.BOLD))));
table.addCell(new PdfPCell(new Paragraph("EPF",FontFactory.getFont(FontFactory.TIMES_ROMAN,9,Font.BOLD))));
table.addCell(new PdfPCell(new Paragraph("ETF",FontFactory.getFont(FontFactory.TIMES_ROMAN,9,Font.BOLD))));
table.addCell(new PdfPCell(new Paragraph("Medical",FontFactory.getFont(FontFactory.TIMES_ROMAN,9,Font.BOLD))));
table.addCell(new PdfPCell(new Paragraph("OtherIncntv",FontFactory.getFont(FontFactory.TIMES_ROMAN,9,Font.BOLD))));
table.addCell(new PdfPCell(new Paragraph("OtherDeductn",FontFactory.getFont(FontFactory.TIMES_ROMAN,9,Font.BOLD))));
table.addCell(new PdfPCell(new Paragraph("Loan",FontFactory.getFont(FontFactory.TIMES_ROMAN,9,Font.BOLD))));
table.addCell(new PdfPCell(new Paragraph("Advance",FontFactory.getFont(FontFactory.TIMES_ROMAN,9,Font.BOLD))));
table.addCell(new PdfPCell(new Paragraph("NetPay",FontFactory.getFont(FontFactory.TIMES_ROMAN,9,Font.BOLD))));
table.addCell(new PdfPCell(new Paragraph("EpfNo",FontFactory.getFont(FontFactory.TIMES_ROMAN,9,Font.BOLD))));
while(rs.next())
{
table.addCell(new PdfPCell(new Paragraph(rs.getString(1),FontFactory.getFont(FontFactory.TIMES_ROMAN,8,Font.PLAIN))));
table.addCell(new PdfPCell(new Paragraph(rs.getString(2),FontFactory.getFont(FontFactory.TIMES_ROMAN,8,Font.PLAIN))));
table.addCell(new PdfPCell(new Paragraph(rs.getString(3),FontFactory.getFont(FontFactory.TIMES_ROMAN,8,Font.PLAIN))));
table.addCell(new PdfPCell(new Paragraph(rs.getString(4),FontFactory.getFont(FontFactory.TIMES_ROMAN,8,Font.PLAIN))));
table.addCell(new PdfPCell(new Paragraph(rs.getString(5),FontFactory.getFont(FontFactory.TIMES_ROMAN,8,Font.PLAIN))));
table.addCell(new PdfPCell(new Paragraph(rs.getString(6),FontFactory.getFont(FontFactory.TIMES_ROMAN,8,Font.PLAIN))));
table.addCell(new PdfPCell(new Paragraph(rs.getString(7),FontFactory.getFont(FontFactory.TIMES_ROMAN,8,Font.PLAIN))));
table.addCell(new PdfPCell(new Paragraph(rs.getString(8),FontFactory.getFont(FontFactory.TIMES_ROMAN,8,Font.PLAIN))));
table.addCell(new PdfPCell(new Paragraph(rs.getString(9),FontFactory.getFont(FontFactory.TIMES_ROMAN,8,Font.PLAIN))));
table.addCell(new PdfPCell(new Paragraph(rs.getString(10),FontFactory.getFont(FontFactory.TIMES_ROMAN,8,Font.PLAIN))));
table.addCell(new PdfPCell(new Paragraph(rs.getString(11),FontFactory.getFont(FontFactory.TIMES_ROMAN,8,Font.PLAIN))));
table.addCell(new PdfPCell(new Paragraph(rs.getString(12),FontFactory.getFont(FontFactory.TIMES_ROMAN,8,Font.PLAIN))));
table.addCell(new PdfPCell(new Paragraph(rs.getString(13),FontFactory.getFont(FontFactory.TIMES_ROMAN,8,Font.PLAIN))));
table.addCell(new PdfPCell(new Paragraph(rs.getString(14),FontFactory.getFont(FontFactory.TIMES_ROMAN,8,Font.PLAIN))));
table.addCell(new PdfPCell(new Paragraph(rs.getString(15),FontFactory.getFont(FontFactory.TIMES_ROMAN,8,Font.PLAIN))));
table.addCell(new PdfPCell(new Paragraph(rs.getString(16),FontFactory.getFont(FontFactory.TIMES_ROMAN,8,Font.PLAIN))));
table.addCell(new PdfPCell(new Paragraph(rs.getString(17),FontFactory.getFont(FontFactory.TIMES_ROMAN,8,Font.PLAIN))));
table.addCell(new PdfPCell(new Paragraph(rs.getString(18),FontFactory.getFont(FontFactory.TIMES_ROMAN,8,Font.PLAIN))));
table.addCell(new PdfPCell(new Paragraph(rs.getString(19),FontFactory.getFont(FontFactory.TIMES_ROMAN,8,Font.PLAIN))));
}
myDocument.add(table);
myDocument.add(new Paragraph("--------------------------------------------------------------------------------------------"));
myDocument.close();
JOptionPane.showMessageDialog(null,"Report was successfully generated");
}
catch(Exception e){
JOptionPane.showMessageDialog(null,e);
}
finally {
try{
rs.close();
pst.close();
}
catch(Exception e){
JOptionPane.showMessageDialog(null,e);
}
}
}
}//GEN-LAST:event_jButton4ActionPerformed
// Variables declaration - do not modify//GEN-BEGIN:variables
private javax.swing.JTextField amount;
private javax.swing.JTextField amount1;
private javax.swing.JButton jButton1;
private javax.swing.JButton jButton3;
private javax.swing.JButton jButton4;
private javax.swing.JComboBox<String> jComboBox1;
private javax.swing.JLabel jLabel1;
private javax.swing.JLabel jLabel2;
private javax.swing.JLabel jLabel3;
private javax.swing.JLabel jLabel4;
private javax.swing.JLabel jLabel5;
private javax.swing.JLabel jLabel6;
private javax.swing.JPanel jPanel1;
private javax.swing.JSeparator jSeparator1;
private javax.swing.JSeparator jSeparator2;
// End of variables declaration//GEN-END:variables
}
| [
"45890696+chamila1997@users.noreply.github.com"
] | 45890696+chamila1997@users.noreply.github.com |
a1081d6a2058c2a91ad7b7b1e793430de5c4f198 | fe303c6048622879e9beb0424e00df8b7c8046ad | /src/main/java/com/luxin/springbootribbitmq/exchange/topic/Provider_User2_Topic.java | e3bb182f8282310a69ef7f51f0384dc4b17e1baa | [] | no_license | luxin6666/springboot-ribbitmq | f27e045dd61957f0f1694456e25519effcb2808c | 4fe467372f98253e32ba7a9d6ddc54857ed86869 | refs/heads/master | 2020-12-05T07:13:26.540995 | 2020-01-06T07:08:24 | 2020-01-06T07:08:24 | 232,044,375 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 472 | java | package com.luxin.springbootribbitmq.exchange.topic;
import org.springframework.amqp.rabbit.core.RabbitTemplate;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
@Component
public class Provider_User2_Topic {
@Autowired
private RabbitTemplate rabbitTemplate;
public void send(String msg){
this.rabbitTemplate.convertAndSend("exchange-provider-topic","user2.routingkey",msg);
}
}
| [
"1759295945@qq.com"
] | 1759295945@qq.com |
4da6912d4891659fcc48cfaed7001855d8df2848 | 2c0d40d177beb78a053ee0e8771c75f0e2793513 | /src/main/java/br/com/jornada/conf/AppWebConfiguration.java | 6d274e59cfb0fb9ece69418cd2f404b6b3cbb449 | [] | no_license | jephcescon/Jornada | d12ee6fc68d93a1b1c6026dcc773962b6eeb16b0 | 576b6040d9e546924d0f36d91447c1bd3be8d3b8 | refs/heads/master | 2020-12-02T17:52:00.557172 | 2017-07-26T22:41:26 | 2017-07-26T22:41:26 | 96,441,909 | 0 | 1 | null | 2021-10-04T16:24:13 | 2017-07-06T14:55:10 | Java | UTF-8 | Java | false | false | 1,852 | java | package br.com.jornada.conf;
import org.springframework.context.MessageSource;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.support.ReloadableResourceBundleMessageSource;
import org.springframework.format.datetime.DateFormatter;
import org.springframework.format.datetime.DateFormatterRegistrar;
import org.springframework.format.support.DefaultFormattingConversionService;
import org.springframework.format.support.FormattingConversionService;
import org.springframework.web.servlet.config.annotation.EnableWebMvc;
import org.springframework.web.servlet.view.InternalResourceViewResolver;
import br.com.jornada.controllers.HomeController;
import br.com.jornada.daos.UsuarioDAO;
@EnableWebMvc
@ComponentScan(basePackageClasses = { HomeController.class, UsuarioDAO.class })
public class AppWebConfiguration {
@Bean
public InternalResourceViewResolver internalResourceViewResolver() {
InternalResourceViewResolver resolver = new InternalResourceViewResolver();
resolver.setPrefix("/WEB-INF/views/");
resolver.setSuffix(".jsp");
return resolver;
}
@Bean
public MessageSource messageSource() {
ReloadableResourceBundleMessageSource messageSource = new ReloadableResourceBundleMessageSource();
messageSource.setBasename("/WEB-INF/messages");
messageSource.setDefaultEncoding("UTF-8");
messageSource.setCacheSeconds(1);
return messageSource;
}
@Bean
public FormattingConversionService mvcConversionService() {
DefaultFormattingConversionService conversionService = new DefaultFormattingConversionService();
DateFormatterRegistrar registrar = new DateFormatterRegistrar();
registrar.setFormatter(new DateFormatter("dd/MM/yyyy"));
registrar.registerFormatters(conversionService);
return conversionService;
}
}
| [
"Jephcescon@hotmail.com"
] | Jephcescon@hotmail.com |
459d9721aa9bc8f47effdc97c21a69d1edc99028 | 7822eb2f86317aebf6e689da2a6708e9cc4ee1ea | /Rachio_apk/sources/android/support/v4/app/NotificationCompatApi21.java | 5c8555230d6950aeb7c8b28c9665aea58f094d21 | [
"BSD-2-Clause"
] | permissive | UCLA-ECE209AS-2018W/Haoming-Liang | 9abffa33df9fc7be84c993873dac39159b05ef04 | f567ae0adc327b669259c94cc49f9b29f50d1038 | refs/heads/master | 2021-04-06T20:29:41.296769 | 2018-03-21T05:39:43 | 2018-03-21T05:39:43 | 125,328,864 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,712 | java | package android.support.v4.app;
import android.annotation.TargetApi;
import android.app.Notification;
import android.app.PendingIntent;
import android.content.Context;
import android.graphics.Bitmap;
import android.os.Bundle;
import android.support.v4.app.NotificationCompatBase.Action;
import android.widget.RemoteViews;
import java.util.ArrayList;
import java.util.Iterator;
@TargetApi(21)
final class NotificationCompatApi21 {
public static class Builder implements NotificationBuilderWithActions, NotificationBuilderWithBuilderAccessor {
private android.app.Notification.Builder b;
private RemoteViews mBigContentView;
private RemoteViews mContentView;
private Bundle mExtras;
private RemoteViews mHeadsUpContentView;
public Builder(Context context, Notification n, CharSequence contentTitle, CharSequence contentText, CharSequence contentInfo, RemoteViews tickerView, int number, PendingIntent contentIntent, PendingIntent fullScreenIntent, Bitmap largeIcon, int progressMax, int progress, boolean progressIndeterminate, boolean showWhen, boolean useChronometer, int priority, CharSequence subText, boolean localOnly, String category, ArrayList<String> people, Bundle extras, int color, int visibility, Notification publicVersion, String groupKey, boolean groupSummary, String sortKey, RemoteViews contentView, RemoteViews bigContentView, RemoteViews headsUpContentView) {
this.b = new android.app.Notification.Builder(context).setWhen(n.when).setShowWhen(showWhen).setSmallIcon(n.icon, n.iconLevel).setContent(n.contentView).setTicker(n.tickerText, tickerView).setSound(n.sound, n.audioStreamType).setVibrate(n.vibrate).setLights(n.ledARGB, n.ledOnMS, n.ledOffMS).setOngoing((n.flags & 2) != 0).setOnlyAlertOnce((n.flags & 8) != 0).setAutoCancel((n.flags & 16) != 0).setDefaults(n.defaults).setContentTitle(contentTitle).setContentText(contentText).setSubText(subText).setContentInfo(contentInfo).setContentIntent(contentIntent).setDeleteIntent(n.deleteIntent).setFullScreenIntent(fullScreenIntent, (n.flags & 128) != 0).setLargeIcon(largeIcon).setNumber(number).setUsesChronometer(useChronometer).setPriority(priority).setProgress(progressMax, progress, progressIndeterminate).setLocalOnly(localOnly).setGroup(groupKey).setGroupSummary(groupSummary).setSortKey(sortKey).setCategory(category).setColor(color).setVisibility(visibility).setPublicVersion(publicVersion);
this.mExtras = new Bundle();
if (extras != null) {
this.mExtras.putAll(extras);
}
Iterator it = people.iterator();
while (it.hasNext()) {
this.b.addPerson((String) it.next());
}
this.mContentView = contentView;
this.mBigContentView = bigContentView;
this.mHeadsUpContentView = headsUpContentView;
}
public final void addAction(Action action) {
NotificationCompatApi20.addAction(this.b, action);
}
public final android.app.Notification.Builder getBuilder() {
return this.b;
}
public final Notification build() {
this.b.setExtras(this.mExtras);
Notification notification = this.b.build();
if (this.mContentView != null) {
notification.contentView = this.mContentView;
}
if (this.mBigContentView != null) {
notification.bigContentView = this.mBigContentView;
}
if (this.mHeadsUpContentView != null) {
notification.headsUpContentView = this.mHeadsUpContentView;
}
return notification;
}
}
}
| [
"zan@s-164-67-234-113.resnet.ucla.edu"
] | zan@s-164-67-234-113.resnet.ucla.edu |
bb69a9f4e5f94d0b59a3906d5996a97d2e13941e | 5741045375dcbbafcf7288d65a11c44de2e56484 | /reddit-decompilada/kotlin/reflect/jvm/internal/impl/load/kotlin/header/KotlinClassHeader.java | 2dbc4918d8604166281a3d12103f194f5956e76c | [] | no_license | miarevalo10/ReporteReddit | 18dd19bcec46c42ff933bb330ba65280615c281c | a0db5538e85e9a081bf268cb1590f0eeb113ed77 | refs/heads/master | 2020-03-16T17:42:34.840154 | 2018-05-11T10:16:04 | 2018-05-11T10:16:04 | 132,843,706 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,088 | java | package kotlin.reflect.jvm.internal.impl.load.kotlin.header;
import java.util.LinkedHashMap;
import java.util.Map;
import kotlin.collections.MapsKt__MapsKt;
import kotlin.jvm.internal.Intrinsics;
import kotlin.ranges.RangesKt___RangesKt;
import kotlin.reflect.jvm.internal.impl.load.java.JvmBytecodeBinaryVersion;
import kotlin.reflect.jvm.internal.impl.load.kotlin.JvmMetadataVersion;
/* compiled from: KotlinClassHeader.kt */
public final class KotlinClassHeader {
public final Kind f25837a;
public final JvmMetadataVersion f25838b;
public final String[] f25839c;
public final String[] f25840d;
public final String[] f25841e;
public final int f25842f;
private final JvmBytecodeBinaryVersion f25843g;
private final String f25844h;
/* compiled from: KotlinClassHeader.kt */
public enum Kind {
;
public static final Companion f25833g = null;
private static final Map<Integer, Kind> f25835j = null;
private final int f25836i;
/* compiled from: KotlinClassHeader.kt */
public static final class Companion {
private Companion() {
}
static Map<Integer, Kind> m27382a() {
return Kind.f25835j;
}
}
private Kind(int i) {
this.f25836i = i;
}
static {
f25833g = new Companion();
Object[] objArr = (Object[]) values();
Map linkedHashMap = new LinkedHashMap(RangesKt___RangesKt.m32855c(MapsKt__MapsKt.m36115a(objArr.length), 16));
int i;
while (i < objArr.length) {
Object obj = objArr[i];
linkedHashMap.put(Integer.valueOf(((Kind) obj).f25836i), obj);
i++;
}
f25835j = linkedHashMap;
}
public static final Kind m27384a(int i) {
Kind kind = (Kind) Companion.m27382a().get(Integer.valueOf(i));
return kind == null ? f25827a : kind;
}
}
public KotlinClassHeader(Kind kind, JvmMetadataVersion jvmMetadataVersion, JvmBytecodeBinaryVersion jvmBytecodeBinaryVersion, String[] strArr, String[] strArr2, String[] strArr3, String str, int i) {
Intrinsics.m26847b(kind, "kind");
Intrinsics.m26847b(jvmMetadataVersion, "metadataVersion");
Intrinsics.m26847b(jvmBytecodeBinaryVersion, "bytecodeVersion");
this.f25837a = kind;
this.f25838b = jvmMetadataVersion;
this.f25843g = jvmBytecodeBinaryVersion;
this.f25839c = strArr;
this.f25840d = strArr2;
this.f25841e = strArr3;
this.f25844h = str;
this.f25842f = i;
}
public final String m27385a() {
return Intrinsics.m26845a(this.f25837a, Kind.f25832f) ? this.f25844h : null;
}
public final String toString() {
StringBuilder stringBuilder = new StringBuilder();
stringBuilder.append(this.f25837a);
stringBuilder.append(" version=");
stringBuilder.append(this.f25838b);
return stringBuilder.toString();
}
}
| [
"mi.arevalo10@uniandes.edu.co"
] | mi.arevalo10@uniandes.edu.co |
7e3b990c37f1b7716e9b39841ec6f851ae89a7bd | 958a03242e1e29c942c72d104ff09326618114f9 | /app/src/main/java/com/study/modularization/MainApp.java | 90d938165deef7beea5da72be04dd8ec6c8687f0 | [] | no_license | hcgrady2/Modularization | 6a2d2137412e083e342f81459c9e6a3ea911fd27 | 5ea8916059ad996927d10c83b2be60f69792c075 | refs/heads/master | 2020-04-25T04:53:03.909480 | 2019-02-26T08:15:21 | 2019-02-26T08:15:21 | 172,525,027 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,378 | java | package com.study.modularization;
import android.app.Application;
import android.util.Log;
import com.study.compontlib.AppConfig;
import com.study.compontlib.IAppComponet;
/**
* Created by hcw on 2019/2/25.
* Copyright©hcw.All rights reserved.
*/
public class MainApp extends Application implements IAppComponet{
private static MainApp application;
public static MainApp getApplication(){
return application;
}
@Override
public void onCreate() {
super.onCreate();
initialize(this);
}
@Override
public void initialize(Application app) {
application = (MainApp)app;
for (String componet: AppConfig.CONPONENTS){
try {
Class<?> clazz = Class.forName(componet);
Object object = clazz.newInstance();
/**
* 当组件存在并且实现了IAppCompone接口,则通过反射初始化
*/
if (object instanceof IAppComponet){
((IAppComponet)object).initialize(this);
}
} catch (ClassNotFoundException e) {
e.printStackTrace();
} catch (IllegalAccessException e) {
e.printStackTrace();
} catch (InstantiationException e) {
e.printStackTrace();
}
}
}
}
| [
"hcwang1024@163.com"
] | hcwang1024@163.com |
d1a239d73938f5f8d16a4ea0fccb769d36cc8dda | a7cd6460d3c6f12c0559197088b9b0498ce3478e | /src/LC415.java | aea961fb3d58063a993234d136bebcedd8d46ad9 | [] | no_license | guptarakesh123/LC | 6cd8400b7615df601699e79601073e640283e555 | 8e2a170d3df038fa95b76be80687e1fd6b960a6e | refs/heads/master | 2021-01-21T10:46:49.418850 | 2017-07-26T20:59:51 | 2017-07-26T20:59:51 | 83,488,482 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 960 | java | import java.util.ArrayList;
import java.util.List;
/*
Write a program that outputs the string representation of numbers from 1 to n.
But for multiples of three it should output “Fizz” instead of the number and for the multiples of five output “Buzz”. For numbers which are multiples of both three and five output “FizzBuzz”.
*/
public class LC415 {
public static void main(String[] args) {
System.out.println(new LC415().fizzBuzz(15));
}
public List<String> fizzBuzz(int n) {
List<String> l = new ArrayList<>(15);
for(int i = 1; i <= n; i++){
boolean d3 = i % 3 == 0;
boolean d5 = i % 5 == 0;
if(d3 && d5){
l.add("FizzBuzz");
} else if(d3) {
l.add("Fizz");
} else if(d5){
l.add("Buzz");
} else {
l.add(String.valueOf(i));
}
}
return l;
}
}
| [
"rakesh.gupta@salesforce.com"
] | rakesh.gupta@salesforce.com |
677c5f038f42e04b01811f6599e4dbe184fb2364 | 053f65f90759a200c743e872cd1b4bf99d66a7b0 | /src/com/aoeng/dp/cat1/flyweight/Main.java | d9ecdb3f6a6ce850f53a962af4285fd56dbc663e | [] | no_license | tianshan20081/J2SETools | e58bb851a6a6e0082a810463405544d6b092619d | 39e3263128ce9fcc00d1dc4a43f3c76570df16d6 | refs/heads/master | 2020-06-01T15:35:25.571665 | 2015-02-06T11:02:39 | 2015-02-06T11:02:39 | 22,879,436 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 496 | java | /**
*
*/
package com.aoeng.dp.cat1.flyweight;
import org.junit.Test;
/**
* Jun 20, 2014 4:41:49 PM
*
* 享元模式 :如果在一个系统中存在多个相同的对象,那么只需共享一份对象的拷贝,
* 而不必为每一次使都创建新的对象。
*/
public class Main {
@Test
public void testFlyWeight() {
ReportManagerFactory factory = new ReportManagerFactory();
IReportManager rp = factory.getFinancialIReportManager("A");
System.out.println(rp);
}
}
| [
"zhangshch2008@gmail.com"
] | zhangshch2008@gmail.com |
0cda056b0a59de19514bade3d85c711d713fb684 | 60252a7dfc1211deb8421ed77cf5505c6186b39c | /src/cn/sharesdk/onekeyshare/ShareCore.java | a73e8188403446818ddbefe74017cc7007705b8d | [] | no_license | gxl1240779189/Intelligentkitchen | 2c92773aa36c181eefff851e34d8bd2733f9056e | 86ac9938738107183af5ecc7af2bed3cf056c853 | refs/heads/master | 2021-01-10T11:01:36.216916 | 2016-03-01T06:21:37 | 2016-03-01T06:21:37 | 49,501,160 | 2 | 0 | null | null | null | null | UTF-8 | Java | false | false | 5,551 | java | /*
* 官网地站:http://www.mob.com
* 技术支持QQ: 4006852216
* 官方微信:ShareSDK (如果发布新版本的话,我们将会第一时间通过微信将版本更新内容推送给您。如果使用过程中有任何问题,也可以通过微信与我们取得联系,我们将会在24小时内给予回复)
*
* Copyright (c) 2013年 mob.com. All rights reserved.
*/
package cn.sharesdk.onekeyshare;
import java.io.File;
import java.io.FileOutputStream;
import java.util.HashMap;
import android.content.Context;
import android.content.Intent;
import android.content.pm.ResolveInfo;
import android.graphics.Bitmap;
import android.graphics.Bitmap.CompressFormat;
import android.text.TextUtils;
import cn.sharesdk.framework.CustomPlatform;
import cn.sharesdk.framework.Platform;
import cn.sharesdk.framework.Platform.ShareParams;
import cn.sharesdk.framework.ShareSDK;
import com.mob.tools.utils.R;
/**
* ShareCore是快捷分享的实际出口,此类使用了反射的方式,配合传递进来的HashMap, 构造{@link ShareParams}
* 对象,并执行分享,使快捷分享不再需要考虑目标平台
*/
public class ShareCore {
private ShareContentCustomizeCallback customizeCallback;
/** 设置用于分享过程中,根据不同平台自定义分享内容的回调 */
public void setShareContentCustomizeCallback(
ShareContentCustomizeCallback callback) {
customizeCallback = callback;
}
/**
* 向指定平台分享内容
* <p>
* <b>注意:</b><br>
* 参数data的键值需要严格按照{@link ShareParams}不同子类具体字段来命名, 否则无法反射此字段,也无法设置其值。
*/
public boolean share(Platform plat, HashMap<String, Object> data) {
if (plat == null || data == null) {
return false;
}
try {
String imagePath = (String) data.get("imagePath");
Bitmap viewToShare = (Bitmap) data.get("viewToShare");
if (TextUtils.isEmpty(imagePath) && viewToShare != null
&& !viewToShare.isRecycled()) {
String path = R.getCachePath(plat.getContext(), "screenshot");
File ss = new File(path, String.valueOf(System
.currentTimeMillis()) + ".jpg");
FileOutputStream fos = new FileOutputStream(ss);
viewToShare.compress(CompressFormat.JPEG, 100, fos);
fos.flush();
fos.close();
data.put("imagePath", ss.getAbsolutePath());
}
} catch (Throwable t) {
t.printStackTrace();
return false;
}
ShareParams sp = new ShareParams(data);
if (customizeCallback != null) {
customizeCallback.onShare(plat, sp);
}
plat.share(sp);
return true;
}
/** 判断指定平台是否使用客户端分享 */
public static boolean isUseClientToShare(String platform) {
if ("Wechat".equals(platform) || "WechatMoments".equals(platform)
|| "WechatFavorite".equals(platform)
|| "ShortMessage".equals(platform) || "Email".equals(platform)
|| "GooglePlus".equals(platform) || "QQ".equals(platform)
|| "Pinterest".equals(platform) || "Instagram".equals(platform)
|| "Yixin".equals(platform) || "YixinMoments".equals(platform)
|| "QZone".equals(platform) || "Mingdao".equals(platform)
|| "Line".equals(platform) || "KakaoStory".equals(platform)
|| "KakaoTalk".equals(platform) || "Bluetooth".equals(platform)
|| "WhatsApp".equals(platform) || "BaiduTieba".equals(platform)
|| "Laiwang".equals(platform)
|| "LaiwangMoments".equals(platform)
|| "Alipay".equals(platform)) {
return true;
} else if ("Evernote".equals(platform)) {
Platform plat = ShareSDK.getPlatform(platform);
if ("true".equals(plat.getDevinfo("ShareByAppClient"))) {
return true;
}
} else if ("SinaWeibo".equals(platform)) {
Platform plat = ShareSDK.getPlatform(platform);
if ("true".equals(plat.getDevinfo("ShareByAppClient"))) {
Intent test = new Intent(Intent.ACTION_SEND);
test.setPackage("com.sina.weibo");
test.setType("image/*");
ResolveInfo ri = plat.getContext().getPackageManager()
.resolveActivity(test, 0);
return (ri != null);
}
}
return false;
}
/** 判断指定平台是否可以用来授权 */
public static boolean canAuthorize(Context context, String platform) {
return !("WechatMoments".equals(platform)
|| "WechatFavorite".equals(platform)
|| "ShortMessage".equals(platform) || "Email".equals(platform)
|| "Pinterest".equals(platform) || "Yixin".equals(platform)
|| "YixinMoments".equals(platform) || "Line".equals(platform)
|| "Bluetooth".equals(platform) || "WhatsApp".equals(platform)
|| "BaiduTieba".equals(platform) || "Laiwang".equals(platform)
|| "LaiwangMoments".equals(platform) || "Alipay"
.equals(platform));
}
/** 判断指定平台是否可以用来获取用户资料 */
public static boolean canGetUserInfo(Context context, String platform) {
return !("WechatMoments".equals(platform)
|| "WechatFavorite".equals(platform)
|| "ShortMessage".equals(platform) || "Email".equals(platform)
|| "Pinterest".equals(platform) || "Yixin".equals(platform)
|| "YixinMoments".equals(platform) || "Line".equals(platform)
|| "Bluetooth".equals(platform) || "WhatsApp".equals(platform)
|| "Pocket".equals(platform) || "BaiduTieba".equals(platform)
|| "Laiwang".equals(platform)
|| "LaiwangMoments".equals(platform) || "Alipay"
.equals(platform));
}
/** 判断是否直接分享 */
public static boolean isDirectShare(Platform platform) {
return platform instanceof CustomPlatform
|| isUseClientToShare(platform.getName());
}
}
| [
"1240779189@qq.com"
] | 1240779189@qq.com |
c580bc28de0f24dc8465b6a7e1d4fe4172f64de1 | b749eefbba078b2a25cd6a55b33b4d14b3ceb875 | /src/main/java/rabinizer/ltl/PseudoSubstitutionVisitor.java | 524a80924ebb4e2cd4fb770025e165e9115ab5d0 | [] | no_license | enthusiasticalProgrammer/RabinizerGSOC | bbfaba55fad965417192f618ad65a2da77e6d13c | 37dba4931434785103200145fa74e084dbb24591 | refs/heads/master | 2020-09-20T20:22:15.943313 | 2015-10-01T08:52:49 | 2016-08-18T08:25:09 | 65,975,378 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,282 | java | package rabinizer.ltl;
import java.util.HashSet;
import java.util.Set;
/**
*
* this method tries to substitute the subformula b in the first argument by the
* boolean constant specified by c, s.t. the returned formula is made up by
* assuming the subformula b has the value c.
*
*/
public class PseudoSubstitutionVisitor implements TripleVisitor<Formula, Formula, Boolean> {
private static PseudoSubstitutionVisitor instance = new PseudoSubstitutionVisitor();
private PseudoSubstitutionVisitor() {
super();
}
public static PseudoSubstitutionVisitor getVisitor() {
return instance;
}
@Override
public Formula visit(BooleanConstant bo, Formula b, Boolean c) {
return bo;
}
@Override
public Formula visit(Conjunction co, Formula b, Boolean c) {
if (co.equals(b)) {
return FormulaFactory.mkConst(c);
} else {
Set<Formula> set = new HashSet<Formula>();
set.addAll(co.children);
for (Formula form : set) {
Formula f = form.accept(this, b, c);
if (!f.equals(form)) {
set.remove(form);
set.add(f);
}
}
if (!set.equals(co.children)) {
return FormulaFactory.mkAnd((Formula[]) set.toArray());
}
return co;
}
}
@Override
public Formula visit(Disjunction d, Formula b, Boolean c) {
if (d.equals(b)) {
return FormulaFactory.mkConst(c);
} else {
Set<Formula> set = new HashSet<Formula>();
set.addAll(d.children);
for (Formula form : set) {
Formula f = form.accept(this, b, c);
if (!f.equals(form)) {
set.remove(form);
set.add(f);
}
}
if (!set.equals(d.children)) {
return FormulaFactory.mkOr(set);
}
return d;
}
}
@Override
public Formula visit(FOperator f, Formula b, Boolean c) {
if (f.equals(b)) {
return FormulaFactory.mkConst(c);
} else {
if (c) {
if (f.operand.equals(b)) {
return FormulaFactory.mkConst(c);
}
}
return f;
}
}
@Override
public Formula visit(GOperator g, Formula b, Boolean c) {
if (g.equals(b)) {
return FormulaFactory.mkConst(c);
} else {
if (!c) {
return FormulaFactory.mkG(g.operand.accept(this, b, c));
}
}
return g;
}
@Override
public Formula visit(Literal l, Formula b, Boolean c) {
if (l.equals(b)) {
return FormulaFactory.mkConst(c);
}
return l;
}
@Override
public Formula visit(UOperator u, Formula b, Boolean c) {
if (u.equals(b) || u.right.equals(b)) {
return FormulaFactory.mkConst(c);
}
return u;
}
@Override
public Formula visit(XOperator x, Formula b, Boolean c) {
if (x.equals(b)) {
return FormulaFactory.mkConst(c);
}
return x;
}
}
| [
"ga25suc@mytum.de"
] | ga25suc@mytum.de |
e451ed8596b563d00cc7b2dca043c455af053491 | 5f949538bbfb0430d1f80eae0aac10ee9346144d | /src/main/java/bitcamp/java89/ems/servlet/StudentListServlet.java | 043229f3357d0d811bfb9e1c6bb691a0a701038b | [] | no_license | Nina-K/java89-web | 2dfc193b2aacc9f0cf02f84d5c3004650f4db377 | f431846b71199856d9f17c6e8dcdd7386fb42637 | refs/heads/master | 2020-06-12T14:07:54.280495 | 2016-12-05T08:18:23 | 2016-12-05T08:18:23 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,885 | java | package bitcamp.java89.ems.servlet;
import java.io.IOException;
import java.io.PrintWriter;
import java.util.ArrayList;
import javax.servlet.ServletException;
import javax.servlet.ServletRequest;
import javax.servlet.ServletResponse;
import javax.servlet.annotation.WebServlet;
import bitcamp.java89.ems.dao.impl.StudentMysqlDao;
import bitcamp.java89.ems.vo.Student;
// 톰캣 서버가 실행할 수 있는 클래스는 반드시 Servlet 규격에 맞추어 제작해야 한다.
// 그러나 Servlet 인터페이스의 메서드가 많아서 구현하기 번거롭다.
// 그래서 AbstractServlet이라는 추상 클래스를 만들어서,
// 이 클래스를 상속 받아 간접적으로 Servlet인터페이스를 구현하는 방식을 취한다.
// 이 클래스를 상속받게 되면 오직 service() 메서드만 만들면 되기 때문에 코드가 편리하다.
@WebServlet("/student/list")
public class StudentListServlet extends AbstractServlet {
@Override
public void service(ServletRequest request, ServletResponse response)
throws ServletException, IOException {
try {
StudentMysqlDao studentDao = StudentMysqlDao.getInstance();
// 웹브라우저 쪽으로 출력할 수 있도록 출력 스트림 객체를 얻는다.
response.setContentType("text/plain;charset=UTF-8");
PrintWriter out = response.getWriter();
ArrayList<Student> list = studentDao.getList();
for (Student student : list) {
out.printf("%s,%s,%s,%s,%s,%s,%d,%s\n",
student.getUserId(),
student.getPassword(),
student.getName(),
student.getTel(),
student.getEmail(),
((student.isWorking())?"yes":"no"),
student.getBirthYear(),
student.getSchool());
}
} catch (Exception e) {
throw new ServletException(e);
}
}
}
| [
"jinyoung.eom@gmail.com"
] | jinyoung.eom@gmail.com |
7442108349de74c807e2ced9e3202a9741255c93 | 60daa601fb4518f9491c143a0b76059a8f634470 | /EchoDemo/src/main/java/cn/css/NettyTrain/EchoClientHandler.java | e1198dbe00acaa225e81ffb3342aaa6225fa5c3d | [] | no_license | GriefSeed/NettyTrain | 6e86fdbf55dd9144ef2f113efde89ab424e54a25 | 0f66e0e4d2bdb1237f004666bddf3ee16248f6ff | refs/heads/master | 2020-03-21T23:57:33.184021 | 2018-06-30T16:41:31 | 2018-06-30T16:41:31 | 139,215,796 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 893 | java | package cn.css.NettyTrain;
import io.netty.buffer.ByteBuf;
import io.netty.buffer.Unpooled;
import io.netty.channel.ChannelHandlerContext;
import io.netty.channel.SimpleChannelInboundHandler;
import io.netty.util.CharsetUtil;
public class EchoClientHandler extends SimpleChannelInboundHandler<ByteBuf> {
@Override
public void channelActive(ChannelHandlerContext ctx) throws Exception {
ctx.writeAndFlush(Unpooled.copiedBuffer("Netty rocks!", CharsetUtil.UTF_8));
}
@Override
protected void channelRead0(ChannelHandlerContext channelHandlerContext, ByteBuf byteBuf)
throws Exception {
System.out.println("Client received: " + byteBuf.toString(CharsetUtil.UTF_8));
}
@Override
public void exceptionCaught(ChannelHandlerContext ctx, Throwable cause) throws Exception {
cause.printStackTrace();
ctx.close();
}
}
| [
"shusen2013@outlook.com"
] | shusen2013@outlook.com |
1b117bdfd76c3f834feca4351953ce099ce5d849 | 1cdb44b2d4ac22e5ec8717d6bbd504ed09111add | /src/main/java/pers/hanchao/designpattern/responsibility/chain/GeneralInterview.java | fb038c1b8948ede18c10dc0427ef4e32b03b4d23 | [
"Apache-2.0"
] | permissive | hanchao5272/design-pattern | e1be2c40ec7d9a476e821d4b604403be6253bf4b | b830bc5e999624bee850ec8a98e1721815fe0bc6 | refs/heads/master | 2021-12-23T16:57:30.379720 | 2019-07-29T06:55:04 | 2019-07-29T06:55:04 | 193,321,405 | 0 | 0 | Apache-2.0 | 2021-12-14T21:29:18 | 2019-06-23T07:57:36 | Java | UTF-8 | Java | false | false | 1,087 | java | package pers.hanchao.designpattern.responsibility.chain;
import pers.hanchao.designpattern.responsibility.chain.impl.ExamInterview;
import pers.hanchao.designpattern.responsibility.chain.impl.HrInterview;
import pers.hanchao.designpattern.responsibility.chain.impl.PassInterview;
import pers.hanchao.designpattern.responsibility.chain.impl.TechnicalInterview;
/**
* <p>通用的面试类</P>
*
* @author hanchao
*/
public class GeneralInterview {
/**
* 针对普通求职者的面试过程
*/
public static void customInterview(String name) {
new ExamInterview(new TechnicalInterview(new HrInterview(new PassInterview()))).interview(name);
}
/**
* 针对高级求职者的面试过程
*/
public static void advancedInterview(String name) {
new TechnicalInterview(new HrInterview(new PassInterview())).interview(name);
}
public static void main(String[] args) {
for (int i = 0; i < 5; i++) {
GeneralInterview.customInterview("求职者" + i);
System.out.println();
}
}
}
| [
"hanchao@yidian-inc.com"
] | hanchao@yidian-inc.com |
fc677949792a5b0a46dd3eb91bb4745210e96abd | c885ef92397be9d54b87741f01557f61d3f794f3 | /results/Cli-33/org.apache.commons.cli.HelpFormatter/BBC-F0-opt-90/tests/10/org/apache/commons/cli/HelpFormatter_ESTest.java | 0b716046f363d7940584fb2e74ab013ca4e1654b | [
"CC-BY-4.0",
"MIT"
] | permissive | pderakhshanfar/EMSE-BBC-experiment | f60ac5f7664dd9a85f755a00a57ec12c7551e8c6 | fea1a92c2e7ba7080b8529e2052259c9b697bbda | refs/heads/main | 2022-11-25T00:39:58.983828 | 2022-04-12T16:04:26 | 2022-04-12T16:04:26 | 309,335,889 | 0 | 1 | null | 2021-11-05T11:18:43 | 2020-11-02T10:30:38 | null | UTF-8 | Java | false | false | 83,589 | java | /*
* This file was automatically generated by EvoSuite
* Wed Oct 13 14:48:48 GMT 2021
*/
package org.apache.commons.cli;
import org.junit.Test;
import static org.junit.Assert.*;
import static org.evosuite.shaded.org.mockito.Mockito.*;
import static org.evosuite.runtime.EvoAssertions.*;
import java.io.DataOutputStream;
import java.io.File;
import java.io.FileNotFoundException;
import java.io.OutputStream;
import java.io.PipedOutputStream;
import java.io.PrintWriter;
import java.io.StringWriter;
import java.net.URISyntaxException;
import java.util.Comparator;
import org.apache.commons.cli.HelpFormatter;
import org.apache.commons.cli.Option;
import org.apache.commons.cli.OptionGroup;
import org.apache.commons.cli.Options;
import org.evosuite.runtime.EvoRunner;
import org.evosuite.runtime.EvoRunnerParameters;
import org.evosuite.runtime.ViolatedAssumptionAnswer;
import org.evosuite.runtime.mock.java.io.MockFile;
import org.evosuite.runtime.mock.java.io.MockFileOutputStream;
import org.evosuite.runtime.mock.java.io.MockPrintStream;
import org.evosuite.runtime.mock.java.io.MockPrintWriter;
import org.evosuite.runtime.mock.java.net.MockURI;
import org.evosuite.runtime.testdata.EvoSuiteFile;
import org.evosuite.runtime.testdata.FileSystemHandling;
import org.junit.runner.RunWith;
@RunWith(EvoRunner.class) @EvoRunnerParameters(mockJVMNonDeterminism = true, useVFS = true, useVNET = true, resetStaticState = true, separateClassLoader = true)
public class HelpFormatter_ESTest extends HelpFormatter_ESTest_scaffolding {
@Test(timeout = 4000)
public void test000() throws Throwable {
HelpFormatter helpFormatter0 = new HelpFormatter();
helpFormatter0.setSyntaxPrefix("");
Options options0 = new Options();
helpFormatter0.printHelp(3, "arg", "arg", options0, "arg");
helpFormatter0.getSyntaxPrefix();
}
@Test(timeout = 4000)
public void test001() throws Throwable {
HelpFormatter helpFormatter0 = new HelpFormatter();
helpFormatter0.setOptPrefix("");
helpFormatter0.createPadding(1);
helpFormatter0.getOptPrefix();
}
@Test(timeout = 4000)
public void test002() throws Throwable {
HelpFormatter helpFormatter0 = new HelpFormatter();
Options options0 = new Options();
Option option0 = new Option("arg", "pRDJ.2");
Options options1 = options0.addOption(option0);
// Undeclared exception!
try {
helpFormatter0.printHelp(32, "", "4t KOu", options1, "yiM6Q?1", false);
fail("Expecting exception: IllegalArgumentException");
} catch(IllegalArgumentException e) {
//
// cmdLineSyntax not provided
//
verifyException("org.apache.commons.cli.HelpFormatter", e);
}
}
@Test(timeout = 4000)
public void test003() throws Throwable {
Options options0 = new Options();
HelpFormatter helpFormatter0 = new HelpFormatter();
helpFormatter0.getArgName();
helpFormatter0.renderOptions((StringBuffer) null, 1607, options0, 0, 2361);
}
@Test(timeout = 4000)
public void test004() throws Throwable {
HelpFormatter helpFormatter0 = new HelpFormatter();
helpFormatter0.getLeftPadding();
helpFormatter0.findWrapPos("K]Eek(", 3, 1);
}
@Test(timeout = 4000)
public void test005() throws Throwable {
FileSystemHandling.createFolder((EvoSuiteFile) null);
HelpFormatter helpFormatter0 = new HelpFormatter();
MockPrintWriter mockPrintWriter0 = new MockPrintWriter("usage: ");
PrintWriter printWriter0 = mockPrintWriter0.append('_');
// Undeclared exception!
try {
helpFormatter0.printUsage(printWriter0, (-344), (String) null);
fail("Expecting exception: NullPointerException");
} catch(NullPointerException e) {
//
// no message in exception (getMessage() returned null)
//
verifyException("org.apache.commons.cli.HelpFormatter", e);
}
}
@Test(timeout = 4000)
public void test006() throws Throwable {
HelpFormatter helpFormatter0 = new HelpFormatter();
Options options0 = new Options();
Options options1 = options0.addOption("", "usage: ", false, "Y\"Kq x].6AS(C,BU;");
Options options2 = options1.addOption("", "arg", false, "-");
Option option0 = new Option("", true, "");
options1.addOption(option0);
option0.setArgName("");
// Undeclared exception!
try {
helpFormatter0.printUsage((PrintWriter) null, (-2679), "usage: ", options2);
fail("Expecting exception: StringIndexOutOfBoundsException");
} catch(StringIndexOutOfBoundsException e) {
}
}
@Test(timeout = 4000)
public void test007() throws Throwable {
HelpFormatter helpFormatter0 = new HelpFormatter();
String string0 = helpFormatter0.defaultNewLine;
Options options0 = new Options();
OptionGroup optionGroup0 = new OptionGroup();
Options options1 = options0.addOptionGroup(optionGroup0);
Options options2 = options1.addOption("", "", false, "\n");
Option option0 = new Option("", true, "-");
options2.addOption(option0);
option0.setArgName("");
helpFormatter0.printHelp((-1), "\n", "D6>~$yXQ!?s_]", options2, (String) null);
}
@Test(timeout = 4000)
public void test008() throws Throwable {
HelpFormatter helpFormatter0 = new HelpFormatter();
String string0 = helpFormatter0.defaultNewLine;
Options options0 = new Options();
OptionGroup optionGroup0 = new OptionGroup();
Options options1 = options0.addOptionGroup(optionGroup0);
FileSystemHandling.setPermissions((EvoSuiteFile) null, true, true, true);
Options options2 = options1.addOption("", "", true, "\n");
options2.getOptions();
Option option0 = new Option("", true, "-");
options2.addOption(option0);
option0.setArgName("\n");
// Undeclared exception!
try {
helpFormatter0.printUsage((PrintWriter) null, (-751), "", options0);
fail("Expecting exception: StringIndexOutOfBoundsException");
} catch(StringIndexOutOfBoundsException e) {
}
}
@Test(timeout = 4000)
public void test009() throws Throwable {
HelpFormatter helpFormatter0 = new HelpFormatter();
String string0 = helpFormatter0.defaultNewLine;
Options options0 = new Options();
OptionGroup optionGroup0 = new OptionGroup();
Options options1 = options0.addOptionGroup(optionGroup0);
FileSystemHandling.setPermissions((EvoSuiteFile) null, true, true, true);
Options options2 = options1.addOption("", "", true, "\n");
Option option0 = new Option("", true, "-");
Options options3 = options2.addOption(option0);
option0.setArgName("\n");
Options options4 = options3.addOption("arg", true, "\n");
helpFormatter0.printHelp(63, "]", "]", options4, "arg");
helpFormatter0.getArgName();
}
@Test(timeout = 4000)
public void test010() throws Throwable {
HelpFormatter helpFormatter0 = new HelpFormatter();
helpFormatter0.setDescPadding(11);
helpFormatter0.rtrim("A;,y7p|nU=H");
helpFormatter0.getWidth();
StringWriter stringWriter0 = new StringWriter(11);
StringWriter stringWriter1 = stringWriter0.append('?');
MockPrintWriter mockPrintWriter0 = new MockPrintWriter(stringWriter1);
Options options0 = new Options();
OptionGroup optionGroup0 = new OptionGroup();
Options options1 = options0.addOptionGroup(optionGroup0);
Options options2 = options1.addOption((String) null, "A;,y7p|nU=H", true, (String) null);
Option option0 = new Option("FbSKc", " ");
Options options3 = options2.addOption(option0);
helpFormatter0.printUsage((PrintWriter) mockPrintWriter0, 919, (String) null, options3);
}
@Test(timeout = 4000)
public void test011() throws Throwable {
HelpFormatter helpFormatter0 = new HelpFormatter();
OptionGroup optionGroup0 = new OptionGroup();
Options options0 = new Options();
HelpFormatter helpFormatter1 = new HelpFormatter();
Option option0 = new Option("", "");
OptionGroup optionGroup1 = optionGroup0.addOption(option0);
Options options1 = options0.addOptionGroup(optionGroup0);
options1.getOptions();
options1.addOptionGroup(optionGroup1);
option0.toString();
PrintWriter printWriter0 = null;
// Undeclared exception!
helpFormatter1.printHelp((PrintWriter) null, 1, ",<:=FtUrc", "", options1, (-2), (-1), "f9Ouil0JwmOCYXSi>Yh", false);
}
@Test(timeout = 4000)
public void test012() throws Throwable {
HelpFormatter helpFormatter0 = new HelpFormatter();
helpFormatter0.getLeftPadding();
Options options0 = new Options();
String string0 = "";
// Undeclared exception!
try {
helpFormatter0.printHelp((String) null, options0);
fail("Expecting exception: IllegalArgumentException");
} catch(IllegalArgumentException e) {
//
// cmdLineSyntax not provided
//
verifyException("org.apache.commons.cli.HelpFormatter", e);
}
}
@Test(timeout = 4000)
public void test013() throws Throwable {
HelpFormatter helpFormatter0 = new HelpFormatter();
OptionGroup optionGroup0 = new OptionGroup();
Options options0 = new Options();
PipedOutputStream pipedOutputStream0 = new PipedOutputStream();
options0.getOptionGroups();
DataOutputStream dataOutputStream0 = new DataOutputStream(pipedOutputStream0);
MockPrintStream mockPrintStream0 = new MockPrintStream(dataOutputStream0, false);
MockPrintWriter mockPrintWriter0 = new MockPrintWriter(mockPrintStream0);
// Undeclared exception!
try {
helpFormatter0.printWrapped((PrintWriter) mockPrintWriter0, (-350), "");
fail("Expecting exception: StringIndexOutOfBoundsException");
} catch(StringIndexOutOfBoundsException e) {
}
}
@Test(timeout = 4000)
public void test014() throws Throwable {
HelpFormatter helpFormatter0 = new HelpFormatter();
OptionGroup optionGroup0 = new OptionGroup();
Options options0 = new Options();
HelpFormatter helpFormatter1 = new HelpFormatter();
helpFormatter0.defaultOptPrefix = "-";
options0.addOptionGroup(optionGroup0);
options0.helpOptions();
helpFormatter1.defaultDescPad = (-617);
// Undeclared exception!
try {
helpFormatter1.printHelp(3, "--", "f':0T,", options0, "P");
fail("Expecting exception: NegativeArraySizeException");
} catch(NegativeArraySizeException e) {
//
// no message in exception (getMessage() returned null)
//
verifyException("org.apache.commons.cli.HelpFormatter", e);
}
}
@Test(timeout = 4000)
public void test015() throws Throwable {
HelpFormatter helpFormatter0 = new HelpFormatter();
OptionGroup optionGroup0 = new OptionGroup();
Options options0 = new Options();
HelpFormatter helpFormatter1 = new HelpFormatter();
helpFormatter0.findWrapPos("[ARG...]", (-1), 1);
}
@Test(timeout = 4000)
public void test016() throws Throwable {
HelpFormatter helpFormatter0 = new HelpFormatter();
Options options0 = new Options();
OptionGroup optionGroup0 = new OptionGroup();
Option option0 = new Option("", false, (String) null);
OptionGroup optionGroup1 = optionGroup0.addOption(option0);
Options options1 = options0.addOptionGroup(optionGroup1);
helpFormatter0.printHelp("w", options1, false);
helpFormatter0.getDescPadding();
}
@Test(timeout = 4000)
public void test017() throws Throwable {
HelpFormatter helpFormatter0 = new HelpFormatter();
helpFormatter0.getLeftPadding();
Options options0 = new Options();
Options options1 = options0.addOption("", "arg", true, "");
Option option0 = new Option("arg", "-Y<lJhNM[r*;/-^");
options1.addOption(option0);
FileSystemHandling fileSystemHandling0 = new FileSystemHandling();
helpFormatter0.printHelp("b=~pMsq5`", "", options1, "", true);
helpFormatter0.getLeftPadding();
helpFormatter0.getArgName();
}
@Test(timeout = 4000)
public void test018() throws Throwable {
HelpFormatter helpFormatter0 = new HelpFormatter();
// Undeclared exception!
try {
helpFormatter0.printHelp("cmdLineSyntax not provided", "cmdLineSyntax not provided", (Options) null, "");
fail("Expecting exception: NullPointerException");
} catch(NullPointerException e) {
//
// no message in exception (getMessage() returned null)
//
verifyException("org.apache.commons.cli.HelpFormatter", e);
}
}
@Test(timeout = 4000)
public void test019() throws Throwable {
HelpFormatter helpFormatter0 = new HelpFormatter();
OptionGroup optionGroup0 = new OptionGroup();
Options options0 = new Options();
HelpFormatter helpFormatter1 = new HelpFormatter();
options0.getOptions();
Option option0 = new Option((String) null, "");
OptionGroup optionGroup1 = new OptionGroup();
optionGroup1.toString();
optionGroup1.setRequired(true);
OptionGroup optionGroup2 = optionGroup1.addOption(option0);
options0.addOptionGroup(optionGroup2);
// Undeclared exception!
try {
helpFormatter0.printUsage((PrintWriter) null, 74, "-", options0);
fail("Expecting exception: NullPointerException");
} catch(NullPointerException e) {
//
// no message in exception (getMessage() returned null)
//
verifyException("org.apache.commons.cli.HelpFormatter", e);
}
}
@Test(timeout = 4000)
public void test020() throws Throwable {
HelpFormatter helpFormatter0 = new HelpFormatter();
helpFormatter0.defaultSyntaxPrefix = " jdc9ei+";
helpFormatter0.setNewLine((String) null);
helpFormatter0.setOptPrefix("-");
helpFormatter0.getNewLine();
}
@Test(timeout = 4000)
public void test021() throws Throwable {
HelpFormatter helpFormatter0 = new HelpFormatter();
helpFormatter0.getNewLine();
Options options0 = new Options();
Option option0 = new Option("", " ", true, "usage: ");
Options options1 = options0.addOption(option0);
Options options2 = options1.addOption("", true, "--");
String string0 = "<";
Options options3 = options2.addOption("", "usage: ", false, "<");
OptionGroup optionGroup0 = new OptionGroup();
OptionGroup optionGroup1 = optionGroup0.addOption(option0);
Options options4 = options3.addOptionGroup(optionGroup1);
helpFormatter0.printHelp("\n", options4, true);
MockPrintWriter mockPrintWriter0 = new MockPrintWriter("arg");
mockPrintWriter0.append('w');
PrintWriter printWriter0 = mockPrintWriter0.append('$');
options4.getOption("arg");
mockPrintWriter0.print(3560.6984254306);
helpFormatter0.printOptions(printWriter0, (-1), options4, 34, 34);
helpFormatter0.getArgName();
helpFormatter0.getWidth();
helpFormatter0.printHelp((-1), "#wX", "", options4, "", true);
helpFormatter0.getWidth();
// Undeclared exception!
try {
helpFormatter0.printHelp("", options3, false);
fail("Expecting exception: IllegalArgumentException");
} catch(IllegalArgumentException e) {
//
// cmdLineSyntax not provided
//
verifyException("org.apache.commons.cli.HelpFormatter", e);
}
}
@Test(timeout = 4000)
public void test022() throws Throwable {
HelpFormatter helpFormatter0 = new HelpFormatter();
OptionGroup optionGroup0 = new OptionGroup();
Options options0 = new Options();
HelpFormatter helpFormatter1 = new HelpFormatter();
String string0 = "[";
options0.getMatchingOptions("--");
// Undeclared exception!
try {
helpFormatter0.printOptions((PrintWriter) null, 74, options0, 3, 1005);
fail("Expecting exception: NullPointerException");
} catch(NullPointerException e) {
//
// no message in exception (getMessage() returned null)
//
verifyException("org.apache.commons.cli.HelpFormatter", e);
}
}
@Test(timeout = 4000)
public void test023() throws Throwable {
HelpFormatter helpFormatter0 = new HelpFormatter();
Options options0 = null;
String string0 = " ";
int int0 = 112;
// Undeclared exception!
try {
helpFormatter0.printHelp(" ", (Options) null);
fail("Expecting exception: NullPointerException");
} catch(NullPointerException e) {
//
// no message in exception (getMessage() returned null)
//
verifyException("org.apache.commons.cli.HelpFormatter", e);
}
}
@Test(timeout = 4000)
public void test024() throws Throwable {
HelpFormatter helpFormatter0 = new HelpFormatter();
helpFormatter0.getLeftPadding();
Options options0 = new Options();
Options options1 = new Options();
HelpFormatter helpFormatter1 = new HelpFormatter();
// Undeclared exception!
helpFormatter0.printHelp(0, "\n", "t4,JXlVgInlzPl_", options0, "t4,JXlVgInlzPl_");
}
@Test(timeout = 4000)
public void test025() throws Throwable {
HelpFormatter helpFormatter0 = new HelpFormatter();
helpFormatter0.rtrim("tm");
Options options0 = new Options();
Option option0 = new Option("arg", "");
Options options1 = options0.addOption(option0);
// Undeclared exception!
try {
helpFormatter0.printHelp((-31), "arg", "", options1, "", false);
fail("Expecting exception: StringIndexOutOfBoundsException");
} catch(StringIndexOutOfBoundsException e) {
}
}
@Test(timeout = 4000)
public void test026() throws Throwable {
HelpFormatter helpFormatter0 = new HelpFormatter();
helpFormatter0.getLeftPadding();
Options options0 = new Options();
String string0 = "";
String string1 = "";
options0.addOption("", "arg", true, "");
options0.getOptions();
String string2 = "b=~pM\\sq5`";
StringBuffer stringBuffer0 = new StringBuffer("-");
// Undeclared exception!
helpFormatter0.renderOptions(stringBuffer0, 0, options0, 1, 111);
}
@Test(timeout = 4000)
public void test027() throws Throwable {
HelpFormatter helpFormatter0 = new HelpFormatter();
MockPrintWriter mockPrintWriter0 = new MockPrintWriter("4V`Vwd(uAo.");
PrintWriter printWriter0 = mockPrintWriter0.printf("--", (Object[]) null);
Options options0 = new Options();
StringBuffer stringBuffer0 = new StringBuffer("-");
helpFormatter0.printHelp(printWriter0, 13, "org.apache.commons.cli.HelpFormatter$OptionComparator", (String) null, options0, 72, 13, "4V`Vwd(uAo.", false);
}
@Test(timeout = 4000)
public void test028() throws Throwable {
HelpFormatter helpFormatter0 = new HelpFormatter();
MockPrintWriter mockPrintWriter0 = new MockPrintWriter("arg");
MockFile mockFile0 = new MockFile("-", "--");
Object object0 = new Object();
Object object1 = new Object();
Object object2 = new Object();
Options options0 = new Options();
StringBuffer stringBuffer0 = new StringBuffer("-");
helpFormatter0.renderWrappedText(stringBuffer0, 10, 94, "");
// Undeclared exception!
try {
helpFormatter0.createPadding((-206));
fail("Expecting exception: NegativeArraySizeException");
} catch(NegativeArraySizeException e) {
//
// no message in exception (getMessage() returned null)
//
verifyException("org.apache.commons.cli.HelpFormatter", e);
}
}
@Test(timeout = 4000)
public void test029() throws Throwable {
HelpFormatter helpFormatter0 = new HelpFormatter();
MockPrintWriter mockPrintWriter0 = new MockPrintWriter("arg");
HelpFormatter helpFormatter1 = new HelpFormatter();
StringBuffer stringBuffer0 = new StringBuffer(1);
helpFormatter1.renderWrappedText(stringBuffer0, 3, 1, "Ne'?B_@?NoN$!Q");
helpFormatter0.setNewLine("--");
Options options0 = new Options();
OptionGroup optionGroup0 = new OptionGroup();
Option option0 = new Option("", "Cannot add value, list full.");
OptionGroup optionGroup1 = optionGroup0.addOption(option0);
options0.addOptionGroup(optionGroup1);
Options options1 = null;
// Undeclared exception!
try {
helpFormatter1.printHelp((PrintWriter) mockPrintWriter0, 3, "m%3I,|(*xS^v4c^5|", "%)#IfPIm", (Options) null, 74, 74, "A CloneNotSupportedException was thrown: ", true);
fail("Expecting exception: NullPointerException");
} catch(NullPointerException e) {
//
// no message in exception (getMessage() returned null)
//
verifyException("org.apache.commons.cli.HelpFormatter", e);
}
}
@Test(timeout = 4000)
public void test030() throws Throwable {
HelpFormatter helpFormatter0 = new HelpFormatter();
String string0 = "";
Options options0 = null;
int int0 = 2;
// Undeclared exception!
try {
helpFormatter0.printHelp("", "", (Options) null, "");
fail("Expecting exception: IllegalArgumentException");
} catch(IllegalArgumentException e) {
//
// cmdLineSyntax not provided
//
verifyException("org.apache.commons.cli.HelpFormatter", e);
}
}
@Test(timeout = 4000)
public void test031() throws Throwable {
HelpFormatter helpFormatter0 = new HelpFormatter();
helpFormatter0.getLongOptPrefix();
OptionGroup optionGroup0 = new OptionGroup();
HelpFormatter helpFormatter1 = new HelpFormatter();
Options options0 = new Options();
Options options1 = options0.addOption("NO_ARGS_ALLOWED", "-", false, "S(}j\"'2vDqLR0,Q\u0002N");
Option option0 = new Option("z", "L)z7]5A", false, "--");
Options options2 = options1.addOption(option0);
// Undeclared exception!
try {
helpFormatter1.renderOptions((StringBuffer) null, (-682), options2, 74, 90);
fail("Expecting exception: StringIndexOutOfBoundsException");
} catch(StringIndexOutOfBoundsException e) {
}
}
@Test(timeout = 4000)
public void test032() throws Throwable {
HelpFormatter helpFormatter0 = new HelpFormatter();
MockPrintWriter mockPrintWriter0 = new MockPrintWriter("arg");
HelpFormatter helpFormatter1 = new HelpFormatter();
StringBuffer stringBuffer0 = new StringBuffer(1);
helpFormatter1.renderWrappedText(stringBuffer0, 3, 1, "Ne'?B_@NojNi$!.Q");
helpFormatter0.getOptionComparator();
helpFormatter0.setNewLine("--");
Options options0 = new Options();
OptionGroup optionGroup0 = new OptionGroup();
Option option0 = new Option("", "Cannot add value, list full.");
optionGroup0.addOption(option0);
Options options1 = options0.addOption(option0);
helpFormatter1.printUsage((PrintWriter) mockPrintWriter0, (-1), "", options1);
}
@Test(timeout = 4000)
public void test033() throws Throwable {
HelpFormatter helpFormatter0 = new HelpFormatter();
MockPrintWriter mockPrintWriter0 = new MockPrintWriter("arg");
HelpFormatter helpFormatter1 = new HelpFormatter();
StringBuffer stringBuffer0 = new StringBuffer(1);
helpFormatter1.renderWrappedText(stringBuffer0, 3, 1, "Ne'?B_@NojNi$!.Q");
helpFormatter0.getOptionComparator();
helpFormatter0.setNewLine("--");
Options options0 = new Options();
OptionGroup optionGroup0 = new OptionGroup();
Option option0 = new Option("", "Cannot add value, list full.");
OptionGroup optionGroup1 = optionGroup0.addOption(option0);
Options options1 = options0.addOptionGroup(optionGroup1);
helpFormatter1.printUsage((PrintWriter) mockPrintWriter0, (-1), "", options1);
}
@Test(timeout = 4000)
public void test034() throws Throwable {
HelpFormatter helpFormatter0 = new HelpFormatter();
MockPrintWriter mockPrintWriter0 = new MockPrintWriter("4,Ns}%&} $9skw}4w");
HelpFormatter helpFormatter1 = new HelpFormatter();
StringBuffer stringBuffer0 = new StringBuffer(14);
helpFormatter1.renderWrappedText(stringBuffer0, 502, 3, "");
helpFormatter0.getOptionComparator();
helpFormatter1.createPadding(502);
helpFormatter1.getOptionComparator();
}
@Test(timeout = 4000)
public void test035() throws Throwable {
HelpFormatter helpFormatter0 = new HelpFormatter();
HelpFormatter helpFormatter1 = new HelpFormatter();
StringBuffer stringBuffer0 = new StringBuffer((CharSequence) "arg");
// Undeclared exception!
try {
helpFormatter1.renderOptions(stringBuffer0, (-1142), (Options) null, 2345, 1);
fail("Expecting exception: NullPointerException");
} catch(NullPointerException e) {
//
// no message in exception (getMessage() returned null)
//
verifyException("org.apache.commons.cli.HelpFormatter", e);
}
}
@Test(timeout = 4000)
public void test036() throws Throwable {
HelpFormatter helpFormatter0 = new HelpFormatter();
helpFormatter0.getLongOptPrefix();
MockPrintWriter mockPrintWriter0 = new MockPrintWriter("UYfQ,S|>*`0I:W");
Options options0 = new Options();
HelpFormatter helpFormatter1 = new HelpFormatter();
// Undeclared exception!
try {
helpFormatter0.printHelp((PrintWriter) mockPrintWriter0, (-3624), "dY~5&J0YFSgU", "\n", options0, 0, 0, " K@b$U$#vGkt", false);
fail("Expecting exception: StringIndexOutOfBoundsException");
} catch(StringIndexOutOfBoundsException e) {
}
}
@Test(timeout = 4000)
public void test037() throws Throwable {
HelpFormatter helpFormatter0 = new HelpFormatter();
helpFormatter0.defaultLeftPad = 944;
MockPrintWriter mockPrintWriter0 = new MockPrintWriter("UYfQ,S|>*`0I:W");
helpFormatter0.printWrapped((PrintWriter) mockPrintWriter0, 45, 45, "UYfQ,S|>*`0I:W");
helpFormatter0.setOptPrefix((String) null);
helpFormatter0.getOptPrefix();
String string0 = HelpFormatter.DEFAULT_OPT_PREFIX;
Options options0 = new Options();
helpFormatter0.printUsage((PrintWriter) mockPrintWriter0, 71, " ", options0);
// Undeclared exception!
try {
helpFormatter0.findWrapPos((String) null, (-999), 48);
fail("Expecting exception: NullPointerException");
} catch(NullPointerException e) {
//
// no message in exception (getMessage() returned null)
//
verifyException("org.apache.commons.cli.HelpFormatter", e);
}
}
@Test(timeout = 4000)
public void test038() throws Throwable {
HelpFormatter helpFormatter0 = new HelpFormatter();
Options options0 = null;
HelpFormatter helpFormatter1 = new HelpFormatter();
Options options1 = new Options();
StringWriter stringWriter0 = new StringWriter();
StringWriter stringWriter1 = stringWriter0.append((CharSequence) "usage: ");
StringBuffer stringBuffer0 = stringWriter1.getBuffer();
StringBuffer stringBuffer1 = helpFormatter0.renderOptions(stringBuffer0, 44, options1, 44, 3);
int int0 = 74;
helpFormatter1.renderOptions(stringBuffer1, 1, options1, 74, 3);
// Undeclared exception!
try {
options1.addOption("--", " ", false, " ");
fail("Expecting exception: IllegalArgumentException");
} catch(IllegalArgumentException e) {
//
// The option '--' contains an illegal character : '-'
//
verifyException("org.apache.commons.cli.OptionValidator", e);
}
}
@Test(timeout = 4000)
public void test039() throws Throwable {
HelpFormatter helpFormatter0 = new HelpFormatter();
helpFormatter0.getLongOptPrefix();
OptionGroup optionGroup0 = new OptionGroup();
HelpFormatter helpFormatter1 = new HelpFormatter();
Options options0 = new Options();
Options options1 = options0.addOption("NO_ARGS_ALLOWED", "-", true, "S(}j\"'2vDqLR0,Q\u0002N");
Option option0 = new Option("", "L)z7]5A", true, "--");
Options options2 = options1.addOption(option0);
// Undeclared exception!
try {
helpFormatter1.renderOptions((StringBuffer) null, (-665), options2, 74, 90);
fail("Expecting exception: StringIndexOutOfBoundsException");
} catch(StringIndexOutOfBoundsException e) {
}
}
@Test(timeout = 4000)
public void test040() throws Throwable {
HelpFormatter helpFormatter0 = new HelpFormatter();
Options options0 = new Options();
options0.addOption("arg", "\n", true, "");
OptionGroup optionGroup0 = new OptionGroup();
FileSystemHandling.appendLineToFile((EvoSuiteFile) null, "arg");
options0.addOptionGroup(optionGroup0);
Option option0 = new Option("arg", true, ", ");
Options options1 = options0.addOption(option0);
Options options2 = options1.addOptionGroup(optionGroup0);
options2.getMatchingOptions("s5j");
helpFormatter0.printHelp("s5j", "w5w/U^(M:Rp_X", options0, "/\"a", true);
helpFormatter0.getLeftPadding();
}
@Test(timeout = 4000)
public void test041() throws Throwable {
HelpFormatter helpFormatter0 = new HelpFormatter();
MockPrintStream mockPrintStream0 = new MockPrintStream("-");
MockPrintWriter mockPrintWriter0 = new MockPrintWriter(mockPrintStream0);
HelpFormatter helpFormatter1 = new HelpFormatter();
helpFormatter1.getLongOptPrefix();
MockPrintWriter mockPrintWriter1 = new MockPrintWriter("-");
OptionGroup optionGroup0 = new OptionGroup();
Options options0 = new Options();
HelpFormatter helpFormatter2 = new HelpFormatter();
helpFormatter2.printHelp(3, "--", " ", options0, "E(c,lze&");
}
@Test(timeout = 4000)
public void test042() throws Throwable {
HelpFormatter helpFormatter0 = new HelpFormatter();
helpFormatter0.defaultLeftPad = 944;
helpFormatter0.getLongOptPrefix();
helpFormatter0.getLongOptPrefix();
MockPrintWriter mockPrintWriter0 = new MockPrintWriter("arg");
OptionGroup optionGroup0 = new OptionGroup();
Options options0 = new Options();
HelpFormatter helpFormatter1 = new HelpFormatter();
FileSystemHandling.appendStringToFile((EvoSuiteFile) null, "arg");
helpFormatter0.printHelp(74, " ] [ long ", "48z`e'e=dzanedn", options0, "-");
helpFormatter1.findWrapPos("-", 3, 74);
helpFormatter1.printWrapped((PrintWriter) mockPrintWriter0, 52, "-");
}
@Test(timeout = 4000)
public void test043() throws Throwable {
String string0 = "j\"~0\"<";
MockPrintWriter mockPrintWriter0 = new MockPrintWriter("j\"~0\"<");
HelpFormatter helpFormatter0 = new HelpFormatter();
String string1 = "k?-75?";
helpFormatter0.printWrapped((PrintWriter) mockPrintWriter0, 9, 34, "k?-75?");
helpFormatter0.setOptPrefix("k?-75?");
helpFormatter0.getLongOptPrefix();
helpFormatter0.getLongOptPrefix();
Options options0 = new Options();
int int0 = (-2);
// Undeclared exception!
try {
helpFormatter0.printUsage((PrintWriter) mockPrintWriter0, (-2), "5#{<YmAb(VyVa^:4a>", options0);
fail("Expecting exception: StringIndexOutOfBoundsException");
} catch(StringIndexOutOfBoundsException e) {
}
}
@Test(timeout = 4000)
public void test044() throws Throwable {
HelpFormatter helpFormatter0 = new HelpFormatter();
helpFormatter0.defaultLeftPad = 944;
helpFormatter0.getLongOptPrefix();
MockPrintWriter mockPrintWriter0 = new MockPrintWriter("UYfQ,S|>*`0I:W");
Object[] objectArray0 = new Object[3];
objectArray0[0] = (Object) "--";
mockPrintWriter0.printf("", objectArray0);
Options options0 = new Options();
HelpFormatter helpFormatter1 = new HelpFormatter();
helpFormatter0.printHelp((PrintWriter) mockPrintWriter0, 43, "usage: ", ",+\"KP@U(M;j@;>B", options0, 74, 1, (String) null, true);
}
@Test(timeout = 4000)
public void test045() throws Throwable {
HelpFormatter helpFormatter0 = new HelpFormatter();
helpFormatter0.defaultLeftPad = 944;
helpFormatter0.getLongOptPrefix();
MockPrintWriter mockPrintWriter0 = new MockPrintWriter("UYfQ,S|>*`0I:W");
OptionGroup optionGroup0 = new OptionGroup();
Comparator<Object> comparator0 = (Comparator<Object>) mock(Comparator.class, new ViolatedAssumptionAnswer());
doReturn((String) null).when(comparator0).toString();
helpFormatter0.optionComparator = comparator0;
Options options0 = new Options();
HelpFormatter helpFormatter1 = new HelpFormatter();
helpFormatter1.getLongOptPrefix();
helpFormatter0.getArgName();
helpFormatter0.printHelp((PrintWriter) mockPrintWriter0, 74, "arg", "arg", options0, 3, 97, "E&", false);
}
@Test(timeout = 4000)
public void test046() throws Throwable {
HelpFormatter helpFormatter0 = new HelpFormatter();
// Undeclared exception!
try {
helpFormatter0.printHelp("Md", "Md", (Options) null, (String) null, true);
fail("Expecting exception: NullPointerException");
} catch(NullPointerException e) {
//
// no message in exception (getMessage() returned null)
//
verifyException("org.apache.commons.cli.HelpFormatter", e);
}
}
@Test(timeout = 4000)
public void test047() throws Throwable {
HelpFormatter helpFormatter0 = new HelpFormatter();
helpFormatter0.defaultWidth = (-1140);
MockFileOutputStream mockFileOutputStream0 = new MockFileOutputStream("-");
MockPrintWriter mockPrintWriter0 = new MockPrintWriter(mockFileOutputStream0);
mockPrintWriter0.append('C');
char[] charArray0 = new char[3];
charArray0[0] = 'C';
charArray0[1] = 'C';
charArray0[2] = 'C';
mockPrintWriter0.write(charArray0);
helpFormatter0.printWrapped((PrintWriter) mockPrintWriter0, 1621, (-1), "-");
helpFormatter0.setOptPrefix("a5*DG");
helpFormatter0.getLongOptPrefix();
helpFormatter0.getLongOptPrefix();
helpFormatter0.getOptionComparator();
Options options0 = new Options();
Options options1 = options0.addOption("arg", "usage: ", false, "--");
// Undeclared exception!
try {
helpFormatter0.printOptions(mockPrintWriter0, (-1140), options1, 4, (-1));
fail("Expecting exception: NegativeArraySizeException");
} catch(NegativeArraySizeException e) {
//
// no message in exception (getMessage() returned null)
//
verifyException("org.apache.commons.cli.HelpFormatter", e);
}
}
@Test(timeout = 4000)
public void test048() throws Throwable {
FileSystemHandling.setPermissions((EvoSuiteFile) null, false, false, false);
HelpFormatter helpFormatter0 = new HelpFormatter();
Options options0 = new Options();
Options options1 = options0.addOption("arg", "U[q4upI S*2m", false, "Lp");
OptionGroup optionGroup0 = new OptionGroup();
FileSystemHandling.appendLineToFile((EvoSuiteFile) null, "j,x!/,Ux9D,{E6k+");
options0.addOptionGroup(optionGroup0);
options0.getMatchingOptions("--");
helpFormatter0.printHelp("+V7o@*:@J|aJ]lRiDM", "+V7o@*:@J|aJ]lRiDM", options1, " ] [ long ", false);
MockPrintWriter mockPrintWriter0 = new MockPrintWriter("T%?m{Osmisqk0TA~his");
helpFormatter0.printHelp("fR'K[IK5dB$6Hy", options1);
helpFormatter0.printHelp((PrintWriter) mockPrintWriter0, 5385, "j,x!/,Ux9D,{E6k+", "", options0, 5385, 1713, "", false);
}
@Test(timeout = 4000)
public void test049() throws Throwable {
HelpFormatter helpFormatter0 = new HelpFormatter();
helpFormatter0.getLongOptPrefix();
MockPrintWriter mockPrintWriter0 = new MockPrintWriter("arg");
Object[] objectArray0 = new Object[1];
objectArray0[0] = (Object) "--";
mockPrintWriter0.printf("", objectArray0);
Options options0 = new Options();
HelpFormatter helpFormatter1 = new HelpFormatter();
// Undeclared exception!
try {
helpFormatter0.printHelp((PrintWriter) mockPrintWriter0, 74, "arg", "", options0, (-280), (-170), "", false);
fail("Expecting exception: NegativeArraySizeException");
} catch(NegativeArraySizeException e) {
//
// no message in exception (getMessage() returned null)
//
verifyException("org.apache.commons.cli.HelpFormatter", e);
}
}
@Test(timeout = 4000)
public void test050() throws Throwable {
HelpFormatter helpFormatter0 = new HelpFormatter();
MockFile mockFile0 = new MockFile("", "--");
MockFileOutputStream mockFileOutputStream0 = new MockFileOutputStream(mockFile0);
MockPrintWriter mockPrintWriter0 = new MockPrintWriter(mockFileOutputStream0, false);
Comparator<Object> comparator0 = (Comparator<Object>) mock(Comparator.class, new ViolatedAssumptionAnswer());
helpFormatter0.setOptionComparator(comparator0);
helpFormatter0.getOptPrefix();
Comparator<Option> comparator1 = (Comparator<Option>) mock(Comparator.class, new ViolatedAssumptionAnswer());
doReturn((String) null).when(comparator1).toString();
helpFormatter0.setOptionComparator(comparator1);
MockPrintWriter mockPrintWriter1 = new MockPrintWriter(mockFile0);
Options options0 = new Options();
// Undeclared exception!
try {
helpFormatter0.printHelp((PrintWriter) mockPrintWriter1, 64, "-", "", options0, 13, (-785), "-", true);
fail("Expecting exception: NegativeArraySizeException");
} catch(NegativeArraySizeException e) {
//
// no message in exception (getMessage() returned null)
//
verifyException("org.apache.commons.cli.HelpFormatter", e);
}
}
@Test(timeout = 4000)
public void test051() throws Throwable {
HelpFormatter helpFormatter0 = new HelpFormatter();
Options options0 = new Options();
// Undeclared exception!
helpFormatter0.printHelp(1, "HeF++K", "0dCK`MGhI)_Ltm?>3z", options0, "0dCK`MGhI)_Ltm?>3z", false);
}
@Test(timeout = 4000)
public void test052() throws Throwable {
HelpFormatter helpFormatter0 = new HelpFormatter();
helpFormatter0.getLongOptPrefix();
MockPrintWriter mockPrintWriter0 = new MockPrintWriter("--");
OptionGroup optionGroup0 = new OptionGroup();
Options options0 = new Options();
options0.toString();
helpFormatter0.printHelp(74, "-", "2a 8v?d~%{=", options0, "--");
helpFormatter0.getLongOptSeparator();
}
@Test(timeout = 4000)
public void test053() throws Throwable {
HelpFormatter helpFormatter0 = new HelpFormatter();
helpFormatter0.getLongOptSeparator();
Options options0 = new Options();
String string0 = "";
Options options1 = options0.addOption("", "", false, "\n");
options1.hasLongOption("arg");
// Undeclared exception!
helpFormatter0.printHelp(0, " ", " ", options1, " ", false);
}
@Test(timeout = 4000)
public void test054() throws Throwable {
HelpFormatter helpFormatter0 = new HelpFormatter();
int int0 = HelpFormatter.DEFAULT_DESC_PAD;
Options options0 = new Options();
Options options1 = new Options();
HelpFormatter helpFormatter1 = new HelpFormatter();
HelpFormatter helpFormatter2 = new HelpFormatter();
MockPrintWriter mockPrintWriter0 = new MockPrintWriter("arg");
PrintWriter printWriter0 = mockPrintWriter0.append('B');
// Undeclared exception!
try {
helpFormatter2.printHelp(printWriter0, (-1741), "hikga,dL", "-", options1, 74, 1687, "X{UGV");
fail("Expecting exception: StringIndexOutOfBoundsException");
} catch(StringIndexOutOfBoundsException e) {
}
}
@Test(timeout = 4000)
public void test055() throws Throwable {
HelpFormatter helpFormatter0 = new HelpFormatter();
MockFile mockFile0 = new MockFile("", "--");
MockFileOutputStream mockFileOutputStream0 = new MockFileOutputStream(mockFile0);
MockPrintWriter mockPrintWriter0 = new MockPrintWriter(mockFileOutputStream0, false);
Object[] objectArray0 = new Object[8];
objectArray0[0] = (Object) "oz&_IX[ZY";
objectArray0[1] = (Object) "";
objectArray0[2] = (Object) mockFileOutputStream0;
objectArray0[3] = (Object) mockFileOutputStream0;
objectArray0[4] = (Object) "oz&_IX[ZY";
objectArray0[5] = (Object) "oz&_IX[ZY";
objectArray0[6] = (Object) mockFileOutputStream0;
objectArray0[7] = (Object) "";
OptionGroup optionGroup0 = new OptionGroup();
Options options0 = new Options();
int int0 = (-838);
// Undeclared exception!
try {
helpFormatter0.printHelp((-838), "oz&_IX[ZY", "kOI$Ts5)wR6z&", options0, "");
fail("Expecting exception: StringIndexOutOfBoundsException");
} catch(StringIndexOutOfBoundsException e) {
}
}
@Test(timeout = 4000)
public void test056() throws Throwable {
HelpFormatter helpFormatter0 = new HelpFormatter();
helpFormatter0.getLeftPadding();
MockPrintStream mockPrintStream0 = new MockPrintStream("-");
Options options0 = new Options();
options0.addOption("", "", true, "");
MockPrintWriter mockPrintWriter0 = new MockPrintWriter(mockPrintStream0);
char[] charArray0 = new char[7];
charArray0[0] = '[';
charArray0[1] = 'c';
charArray0[2] = '\\';
charArray0[3] = '-';
charArray0[4] = 'J';
charArray0[5] = '~';
charArray0[6] = ']';
mockPrintWriter0.write(charArray0);
HelpFormatter helpFormatter1 = new HelpFormatter();
// Undeclared exception!
helpFormatter0.printWrapped((PrintWriter) mockPrintWriter0, 1, 1, "y3Ql");
}
@Test(timeout = 4000)
public void test057() throws Throwable {
FileSystemHandling.shouldThrowIOException((EvoSuiteFile) null);
MockPrintWriter mockPrintWriter0 = new MockPrintWriter("CsJm|<=KP#l?[RL");
HelpFormatter helpFormatter0 = new HelpFormatter();
helpFormatter0.setOptPrefix("arg");
helpFormatter0.setOptPrefix("CsJm|<=KP#l?[RL");
helpFormatter0.getLongOptPrefix();
helpFormatter0.getLongOptPrefix();
Options options0 = new Options();
helpFormatter0.printHelp("CsJm|<=KP#l?[RL", options0);
}
@Test(timeout = 4000)
public void test058() throws Throwable {
HelpFormatter helpFormatter0 = new HelpFormatter();
MockPrintWriter mockPrintWriter0 = new MockPrintWriter("-");
helpFormatter0.printWrapped((PrintWriter) mockPrintWriter0, 944, (-1840), "[");
helpFormatter0.setOptPrefix("' was specified but an option from this group ");
helpFormatter0.getLongOptPrefix();
helpFormatter0.getLongOptPrefix();
Options options0 = new Options();
// Undeclared exception!
try {
helpFormatter0.printUsage((PrintWriter) null, 3441, "h\"V<NkQ8# 8sOu<F>p ", options0);
fail("Expecting exception: NullPointerException");
} catch(NullPointerException e) {
//
// no message in exception (getMessage() returned null)
//
verifyException("org.apache.commons.cli.HelpFormatter", e);
}
}
@Test(timeout = 4000)
public void test059() throws Throwable {
HelpFormatter helpFormatter0 = new HelpFormatter();
helpFormatter0.getLeftPadding();
Options options0 = new Options();
Options options1 = options0.addOption("", "arg", true, "");
options0.getOptions();
helpFormatter0.printHelp("b=~pMsq5`", "(Vr2", options1, "", true);
StringWriter stringWriter0 = null;
try {
stringWriter0 = new StringWriter((-1679));
fail("Expecting exception: IllegalArgumentException");
} catch(IllegalArgumentException e) {
//
// Negative buffer size
//
verifyException("java.io.StringWriter", e);
}
}
@Test(timeout = 4000)
public void test060() throws Throwable {
HelpFormatter helpFormatter0 = new HelpFormatter();
byte[] byteArray0 = new byte[9];
byteArray0[0] = (byte) (-99);
byteArray0[1] = (byte)43;
byteArray0[2] = (byte)35;
byteArray0[3] = (byte)64;
byteArray0[4] = (byte)13;
byteArray0[5] = (byte)61;
byteArray0[6] = (byte)88;
byteArray0[7] = (byte)9;
byteArray0[8] = (byte)56;
FileSystemHandling.appendDataToFile((EvoSuiteFile) null, byteArray0);
helpFormatter0.getLeftPadding();
MockPrintStream mockPrintStream0 = new MockPrintStream("-");
Options options0 = new Options();
OptionGroup optionGroup0 = new OptionGroup();
Option option0 = new Option((String) null, ")yZpKKnN");
optionGroup0.addOption(option0);
FileSystemHandling.appendLineToFile((EvoSuiteFile) null, (String) null);
Options options1 = options0.addOptionGroup(optionGroup0);
options1.getMatchingOptions(" ");
helpFormatter0.printHelp("[ARG...]", "E W<", options0, "[ARG...]", true);
helpFormatter0.getLeftPadding();
}
@Test(timeout = 4000)
public void test061() throws Throwable {
HelpFormatter helpFormatter0 = new HelpFormatter();
// Undeclared exception!
try {
helpFormatter0.printHelp(726, "g&E~;KU[yUA0", "usage: ", (Options) null, "<", false);
fail("Expecting exception: NullPointerException");
} catch(NullPointerException e) {
//
// no message in exception (getMessage() returned null)
//
verifyException("org.apache.commons.cli.HelpFormatter", e);
}
}
@Test(timeout = 4000)
public void test062() throws Throwable {
HelpFormatter helpFormatter0 = new HelpFormatter();
String string0 = "rt+p";
helpFormatter0.setLongOptSeparator("rt+p");
helpFormatter0.getLongOptPrefix();
helpFormatter0.getLongOptPrefix();
String string1 = "1AF;P%wZw`B^gTYya";
Options options0 = new Options();
OptionGroup optionGroup0 = new OptionGroup();
boolean boolean0 = false;
Option option0 = null;
try {
option0 = new Option("\n", false, "g^g9C?->=q");
fail("Expecting exception: IllegalArgumentException");
} catch(IllegalArgumentException e) {
//
// Illegal option name '
// '
//
verifyException("org.apache.commons.cli.OptionValidator", e);
}
}
@Test(timeout = 4000)
public void test063() throws Throwable {
HelpFormatter helpFormatter0 = new HelpFormatter();
helpFormatter0.getLeftPadding();
MockPrintStream mockPrintStream0 = new MockPrintStream("-");
Options options0 = new Options();
Options options1 = new Options();
OptionGroup optionGroup0 = new OptionGroup();
options0.addOptionGroup(optionGroup0);
// Undeclared exception!
try {
helpFormatter0.printHelp(1143, "", (String) null, options0, "org.apache.commons.cli.HelpFormatter");
fail("Expecting exception: IllegalArgumentException");
} catch(IllegalArgumentException e) {
//
// cmdLineSyntax not provided
//
verifyException("org.apache.commons.cli.HelpFormatter", e);
}
}
@Test(timeout = 4000)
public void test064() throws Throwable {
HelpFormatter helpFormatter0 = new HelpFormatter();
MockFile mockFile0 = new MockFile("", "--");
MockFileOutputStream mockFileOutputStream0 = new MockFileOutputStream(mockFile0);
MockPrintWriter mockPrintWriter0 = new MockPrintWriter(mockFileOutputStream0, false);
Object[] objectArray0 = new Object[8];
objectArray0[0] = (Object) "oz&_IX[ZY";
objectArray0[1] = (Object) "";
objectArray0[2] = (Object) mockFileOutputStream0;
objectArray0[3] = (Object) mockFileOutputStream0;
objectArray0[5] = (Object) "oz&_IX[ZY";
objectArray0[6] = (Object) mockFileOutputStream0;
objectArray0[7] = (Object) "";
mockPrintWriter0.printf("oz&_IX[ZY", objectArray0);
Options options0 = new Options();
Option option0 = new Option("", "arg", false, "org.apache.commons.cli.HelpFormatter$1");
options0.addOption(option0);
Options options1 = new Options();
// Undeclared exception!
try {
helpFormatter0.printHelp((PrintWriter) mockPrintWriter0, 103, (String) null, "`3q", options1, (-2), 983, "mq:E8JuMb^", false);
fail("Expecting exception: IllegalArgumentException");
} catch(IllegalArgumentException e) {
//
// cmdLineSyntax not provided
//
verifyException("org.apache.commons.cli.HelpFormatter", e);
}
}
@Test(timeout = 4000)
public void test065() throws Throwable {
HelpFormatter helpFormatter0 = new HelpFormatter();
helpFormatter0.defaultLeftPad = 944;
helpFormatter0.getLongOptPrefix();
MockPrintWriter mockPrintWriter0 = new MockPrintWriter("UYfQ,S|>*`0I:W");
Object[] objectArray0 = new Object[3];
objectArray0[0] = (Object) "--";
objectArray0[1] = (Object) "UYfQ,S|>*`0I:W";
char[] charArray0 = new char[5];
charArray0[0] = '2';
charArray0[1] = 'R';
charArray0[2] = 'r';
charArray0[3] = '@';
charArray0[4] = 'H';
mockPrintWriter0.write(charArray0);
HelpFormatter helpFormatter1 = new HelpFormatter();
helpFormatter1.printWrapped((PrintWriter) mockPrintWriter0, 537, 944, "o$cD#pD0/ Gvl<O{FoS");
helpFormatter1.setOptPrefix("");
helpFormatter1.getLongOptPrefix();
helpFormatter1.getLongOptPrefix();
Options options0 = new Options();
// Undeclared exception!
helpFormatter0.printUsage((PrintWriter) mockPrintWriter0, 1, "--", options0);
}
@Test(timeout = 4000)
public void test066() throws Throwable {
HelpFormatter helpFormatter0 = new HelpFormatter();
MockPrintStream mockPrintStream0 = new MockPrintStream("--");
MockPrintWriter mockPrintWriter0 = new MockPrintWriter(mockPrintStream0);
mockPrintWriter0.append('C');
char[] charArray0 = new char[5];
charArray0[0] = 'C';
charArray0[1] = 'C';
charArray0[2] = 'C';
charArray0[3] = 'C';
charArray0[4] = 'C';
mockPrintWriter0.write(charArray0);
helpFormatter0.setNewLine("a5*DG");
HelpFormatter helpFormatter1 = new HelpFormatter();
helpFormatter1.findWrapPos("-", 1, 1517);
helpFormatter1.getOptPrefix();
helpFormatter0.setSyntaxPrefix("");
helpFormatter0.rtrim((String) null);
}
@Test(timeout = 4000)
public void test067() throws Throwable {
FileSystemHandling.appendLineToFile((EvoSuiteFile) null, "$");
HelpFormatter helpFormatter0 = new HelpFormatter();
helpFormatter0.getOptPrefix();
Comparator<Option> comparator0 = (Comparator<Option>) mock(Comparator.class, new ViolatedAssumptionAnswer());
Options options0 = new Options();
File file0 = MockFile.createTempFile("Z[![}3\"Fd", "S]zwu<o ;0pa");
MockPrintWriter mockPrintWriter0 = new MockPrintWriter(file0);
helpFormatter0.printWrapped((PrintWriter) mockPrintWriter0, 559, 598, ")M:QT>");
options0.toString();
helpFormatter0.printHelp("$", options0, false);
helpFormatter0.setOptionComparator(comparator0);
helpFormatter0.defaultDescPad = (-1309);
helpFormatter0.getLeftPadding();
helpFormatter0.getDescPadding();
}
@Test(timeout = 4000)
public void test068() throws Throwable {
HelpFormatter helpFormatter0 = new HelpFormatter();
helpFormatter0.defaultLeftPad = 944;
helpFormatter0.getLongOptPrefix();
MockPrintWriter mockPrintWriter0 = new MockPrintWriter("UYfQ,S|>*`0I:W");
Object[] objectArray0 = new Object[3];
objectArray0[0] = (Object) "--";
objectArray0[1] = (Object) "UYfQ,S|>*`0I:W";
mockPrintWriter0.append((CharSequence) "usage: ");
objectArray0[2] = (Object) "--";
mockPrintWriter0.printf("arg", objectArray0);
Options options0 = new Options();
// Undeclared exception!
try {
helpFormatter0.printHelp(23, "--", "--", (Options) null, "UYfQ,S|>*`0I:W");
fail("Expecting exception: NullPointerException");
} catch(NullPointerException e) {
//
// no message in exception (getMessage() returned null)
//
verifyException("org.apache.commons.cli.HelpFormatter", e);
}
}
@Test(timeout = 4000)
public void test069() throws Throwable {
HelpFormatter helpFormatter0 = new HelpFormatter();
helpFormatter0.getLeftPadding();
Options options0 = new Options();
OptionGroup optionGroup0 = new OptionGroup();
Options options1 = new Options();
// Undeclared exception!
helpFormatter0.printHelp(1, "{CjW", "{CjW", options0, ")bKg0nRRSh&pHRK");
}
@Test(timeout = 4000)
public void test070() throws Throwable {
HelpFormatter helpFormatter0 = new HelpFormatter();
helpFormatter0.getLeftPadding();
MockPrintStream mockPrintStream0 = new MockPrintStream("-");
Options options0 = new Options();
Options options1 = options0.addOption("", "", true, "");
options1.getOptions();
helpFormatter0.printHelp("NI(jkz5=uC$~", "|d]8]]\"Q4g:>3", options1, (String) null, true);
StringWriter stringWriter0 = new StringWriter(3);
}
@Test(timeout = 4000)
public void test071() throws Throwable {
HelpFormatter helpFormatter0 = new HelpFormatter();
helpFormatter0.defaultWidth = (-1140);
Options options0 = new Options();
options0.addOption((String) null, "--", true, "--");
// Undeclared exception!
try {
helpFormatter0.printHelp("=ZV_%*S42*),'v", (String) null, options0, "", true);
fail("Expecting exception: StringIndexOutOfBoundsException");
} catch(StringIndexOutOfBoundsException e) {
}
}
@Test(timeout = 4000)
public void test072() throws Throwable {
HelpFormatter helpFormatter0 = new HelpFormatter();
MockPrintStream mockPrintStream0 = new MockPrintStream("--");
MockPrintWriter mockPrintWriter0 = new MockPrintWriter(mockPrintStream0);
char char0 = 'C';
PrintWriter printWriter0 = mockPrintWriter0.append('C');
int int0 = (-2003);
// Undeclared exception!
try {
helpFormatter0.printWrapped(printWriter0, (-2003), (-2003), "%C");
fail("Expecting exception: StringIndexOutOfBoundsException");
} catch(StringIndexOutOfBoundsException e) {
}
}
@Test(timeout = 4000)
public void test073() throws Throwable {
HelpFormatter helpFormatter0 = new HelpFormatter();
helpFormatter0.defaultWidth = (-1140);
Options options0 = new Options();
StringWriter stringWriter0 = new StringWriter(2924);
StringBuffer stringBuffer0 = stringWriter0.getBuffer();
// Undeclared exception!
try {
helpFormatter0.renderWrappedText(stringBuffer0, 1195, 2241, (String) null);
fail("Expecting exception: NullPointerException");
} catch(NullPointerException e) {
//
// no message in exception (getMessage() returned null)
//
verifyException("org.apache.commons.cli.HelpFormatter", e);
}
}
@Test(timeout = 4000)
public void test074() throws Throwable {
FileSystemHandling.shouldThrowIOException((EvoSuiteFile) null);
HelpFormatter helpFormatter0 = new HelpFormatter();
helpFormatter0.getLeftPadding();
MockPrintStream mockPrintStream0 = new MockPrintStream("-");
MockPrintWriter mockPrintWriter0 = new MockPrintWriter(mockPrintStream0);
mockPrintWriter0.append('B');
helpFormatter0.printWrapped((PrintWriter) mockPrintWriter0, 32, 32, "\n");
helpFormatter0.setOptPrefix("%C");
helpFormatter0.getLongOptPrefix();
}
@Test(timeout = 4000)
public void test075() throws Throwable {
HelpFormatter helpFormatter0 = new HelpFormatter();
MockPrintStream mockPrintStream0 = new MockPrintStream("--");
MockPrintWriter mockPrintWriter0 = new MockPrintWriter(mockPrintStream0);
mockPrintWriter0.append('C');
char[] charArray0 = new char[5];
charArray0[0] = 'C';
charArray0[1] = 'C';
charArray0[2] = 'C';
charArray0[3] = 'C';
charArray0[4] = 'C';
mockPrintWriter0.write(charArray0);
helpFormatter0.printWrapped((PrintWriter) mockPrintWriter0, 71, (-1), "a5*DG");
helpFormatter0.setOptPrefix("4<1&bMnj.sv;PVBeANj");
helpFormatter0.getLongOptPrefix();
helpFormatter0.getLongOptPrefix();
Options options0 = new Options();
helpFormatter0.printUsage((PrintWriter) mockPrintWriter0, 111, "org.apache.commons.cli.HelpFormatter", options0);
}
@Test(timeout = 4000)
public void test076() throws Throwable {
HelpFormatter helpFormatter0 = new HelpFormatter();
helpFormatter0.getLeftPadding();
MockPrintStream mockPrintStream0 = new MockPrintStream("-");
MockPrintWriter mockPrintWriter0 = new MockPrintWriter(mockPrintStream0);
MockPrintWriter mockPrintWriter1 = new MockPrintWriter("-");
Object[] objectArray0 = new Object[4];
objectArray0[0] = (Object) "TJ?1=w?c NNIxO=";
objectArray0[1] = (Object) mockPrintWriter0;
objectArray0[2] = (Object) "TJ?1=w?c NNIxO=";
objectArray0[3] = (Object) helpFormatter0;
mockPrintWriter0.printf("TJ?1=w?c NNIxO=", objectArray0);
Options options0 = new Options();
// Undeclared exception!
try {
helpFormatter0.printHelp((PrintWriter) mockPrintWriter1, 9, "TJ?1=w?c NNIxO=", (String) null, options0, (-873), 0, "k4<x_=+j.SN.2c|C'");
fail("Expecting exception: NegativeArraySizeException");
} catch(NegativeArraySizeException e) {
//
// no message in exception (getMessage() returned null)
//
verifyException("org.apache.commons.cli.HelpFormatter", e);
}
}
@Test(timeout = 4000)
public void test077() throws Throwable {
HelpFormatter helpFormatter0 = new HelpFormatter();
helpFormatter0.getLeftPadding();
MockPrintStream mockPrintStream0 = new MockPrintStream("-");
MockPrintWriter mockPrintWriter0 = new MockPrintWriter(mockPrintStream0);
mockPrintWriter0.append('C');
helpFormatter0.getArgName();
StringBuffer stringBuffer0 = new StringBuffer((CharSequence) "arg");
// Undeclared exception!
helpFormatter0.renderWrappedText(stringBuffer0, 1, 1513, "fHVT/-");
}
@Test(timeout = 4000)
public void test078() throws Throwable {
HelpFormatter helpFormatter0 = new HelpFormatter();
StringWriter stringWriter0 = new StringWriter();
StringWriter stringWriter1 = stringWriter0.append((CharSequence) " ");
stringWriter1.getBuffer();
// Undeclared exception!
try {
helpFormatter0.printWrapped((PrintWriter) null, 12, 2539, (String) null);
fail("Expecting exception: NullPointerException");
} catch(NullPointerException e) {
//
// no message in exception (getMessage() returned null)
//
verifyException("org.apache.commons.cli.HelpFormatter", e);
}
}
@Test(timeout = 4000)
public void test079() throws Throwable {
HelpFormatter helpFormatter0 = new HelpFormatter();
helpFormatter0.createPadding(2102);
helpFormatter0.setArgName("");
PrintWriter printWriter0 = null;
int int0 = (-136);
String string0 = "org.apache.commons.cli.OptionGroup";
String string1 = "4*qskCAq";
Options options0 = new Options();
helpFormatter0.printHelp("]", "", options0, "4*qskCAq");
int int1 = 0;
helpFormatter0.setNewLine("}");
// Undeclared exception!
try {
helpFormatter0.findWrapPos("ScaU", 0, (-136));
fail("Expecting exception: StringIndexOutOfBoundsException");
} catch(StringIndexOutOfBoundsException e) {
}
}
@Test(timeout = 4000)
public void test080() throws Throwable {
HelpFormatter helpFormatter0 = new HelpFormatter();
helpFormatter0.defaultLeftPad = 944;
helpFormatter0.getLongOptPrefix();
MockPrintWriter mockPrintWriter0 = new MockPrintWriter("UYfQ,S|>*`0I:W");
Object[] objectArray0 = new Object[3];
objectArray0[0] = (Object) "--";
StringWriter stringWriter0 = new StringWriter(74);
stringWriter0.append((CharSequence) "arg");
MockPrintWriter mockPrintWriter1 = new MockPrintWriter(stringWriter0);
PrintWriter printWriter0 = mockPrintWriter1.append((CharSequence) "-");
HelpFormatter helpFormatter1 = new HelpFormatter();
helpFormatter1.printUsage((PrintWriter) mockPrintWriter0, 64, "usage: ");
helpFormatter1.rtrim("'hQ `_il4ZIg=*dO+%");
HelpFormatter helpFormatter2 = new HelpFormatter();
int int0 = (-1817);
// Undeclared exception!
try {
helpFormatter2.printUsage(printWriter0, (-1817), "--");
fail("Expecting exception: StringIndexOutOfBoundsException");
} catch(StringIndexOutOfBoundsException e) {
}
}
@Test(timeout = 4000)
public void test081() throws Throwable {
HelpFormatter helpFormatter0 = new HelpFormatter();
helpFormatter0.getLongOptPrefix();
MockPrintWriter mockPrintWriter0 = new MockPrintWriter("--");
Object[] objectArray0 = new Object[2];
objectArray0[0] = (Object) mockPrintWriter0;
objectArray0[0] = (Object) "A CloneNotSupportedException was thrown: ";
PrintWriter printWriter0 = mockPrintWriter0.printf("A CloneNotSupportedException was thrown: ", objectArray0);
Options options0 = new Options();
helpFormatter0.printHelp(printWriter0, 944, "s#+Z!A0+", "A CloneNotSupportedException was thrown: ", options0, 944, 944, "oF%tF&hs");
}
@Test(timeout = 4000)
public void test082() throws Throwable {
HelpFormatter helpFormatter0 = new HelpFormatter();
helpFormatter0.getLeftPadding();
Options options0 = new Options();
OptionGroup optionGroup0 = new OptionGroup();
Options options1 = options0.addOptionGroup(optionGroup0);
helpFormatter0.printHelp(2246, "{CjW", "{CjW", options1, "{CjW");
}
@Test(timeout = 4000)
public void test083() throws Throwable {
HelpFormatter helpFormatter0 = new HelpFormatter();
helpFormatter0.setDescPadding(2772);
helpFormatter0.setSyntaxPrefix("");
helpFormatter0.rtrim("mB41*");
}
@Test(timeout = 4000)
public void test084() throws Throwable {
HelpFormatter helpFormatter0 = new HelpFormatter();
StringWriter stringWriter0 = new StringWriter();
StringWriter stringWriter1 = stringWriter0.append((CharSequence) " ");
helpFormatter0.defaultArgName = ",(I8+OR%le/yL";
StringBuffer stringBuffer0 = stringWriter1.getBuffer();
helpFormatter0.defaultOptPrefix = "!n{d'm)mrejiq";
stringBuffer0.ensureCapacity((-3142));
helpFormatter0.renderWrappedText(stringBuffer0, 1513, 1513, "org.apache.commons.cli.Options");
helpFormatter0.getSyntaxPrefix();
}
@Test(timeout = 4000)
public void test085() throws Throwable {
HelpFormatter helpFormatter0 = new HelpFormatter();
Options options0 = null;
boolean boolean0 = false;
// Undeclared exception!
try {
helpFormatter0.printHelp("li{[b1.{T:J>", (Options) null, false);
fail("Expecting exception: NullPointerException");
} catch(NullPointerException e) {
//
// no message in exception (getMessage() returned null)
//
verifyException("org.apache.commons.cli.HelpFormatter", e);
}
}
@Test(timeout = 4000)
public void test086() throws Throwable {
HelpFormatter helpFormatter0 = new HelpFormatter();
String string0 = "7d[l|ZB77TDNz";
int int0 = (-382);
helpFormatter0.findWrapPos("7d[l|ZB77TDNz", (-382), (-353));
StringBuffer stringBuffer0 = new StringBuffer((CharSequence) "\n");
// Undeclared exception!
try {
helpFormatter0.renderWrappedText(stringBuffer0, 3, (-353), "oG}8`GfueCy");
fail("Expecting exception: NegativeArraySizeException");
} catch(NegativeArraySizeException e) {
//
// no message in exception (getMessage() returned null)
//
verifyException("org.apache.commons.cli.HelpFormatter", e);
}
}
@Test(timeout = 4000)
public void test087() throws Throwable {
HelpFormatter helpFormatter0 = new HelpFormatter();
String string0 = "+V7o\\@*:@J|aJ]lRiDM";
Options options0 = new Options();
options0.getOptions();
String string1 = "U[q4up\\I S*2m";
boolean boolean0 = false;
Options options1 = options0.addOption("arg", "U[q4upI S*2m", false, "Lp");
OptionGroup optionGroup0 = new OptionGroup();
options0.addOptionGroup(optionGroup0);
options0.getMatchingOptions("--");
String string2 = " ] [ long ";
helpFormatter0.printHelp("+V7o@*:@J|aJ]lRiDM", "+V7o@*:@J|aJ]lRiDM", options1, " ] [ long ", false);
// Undeclared exception!
try {
helpFormatter0.printHelp("", (Options) null, false);
fail("Expecting exception: IllegalArgumentException");
} catch(IllegalArgumentException e) {
//
// cmdLineSyntax not provided
//
verifyException("org.apache.commons.cli.HelpFormatter", e);
}
}
@Test(timeout = 4000)
public void test088() throws Throwable {
HelpFormatter helpFormatter0 = new HelpFormatter();
StringWriter stringWriter0 = new StringWriter();
StringWriter stringWriter1 = stringWriter0.append((CharSequence) " ");
StringBuffer stringBuffer0 = stringWriter1.getBuffer();
helpFormatter0.defaultOptPrefix = "!n{d'm)mrejiq";
helpFormatter0.renderWrappedText(stringBuffer0, 1513, 1513, "org.apache.commons.cli.Options");
}
@Test(timeout = 4000)
public void test089() throws Throwable {
HelpFormatter helpFormatter0 = new HelpFormatter();
helpFormatter0.defaultSyntaxPrefix = "aTx4Z^N@";
helpFormatter0.getOptionComparator();
helpFormatter0.getOptPrefix();
StringBuffer stringBuffer0 = new StringBuffer();
int int0 = 74;
Options options0 = new Options();
// Undeclared exception!
try {
options0.addOption((Option) null);
fail("Expecting exception: NullPointerException");
} catch(NullPointerException e) {
//
// no message in exception (getMessage() returned null)
//
verifyException("org.apache.commons.cli.Options", e);
}
}
@Test(timeout = 4000)
public void test090() throws Throwable {
HelpFormatter helpFormatter0 = new HelpFormatter();
helpFormatter0.setOptPrefix("-");
helpFormatter0.getNewLine();
}
@Test(timeout = 4000)
public void test091() throws Throwable {
HelpFormatter helpFormatter0 = new HelpFormatter();
helpFormatter0.setOptPrefix("");
helpFormatter0.setArgName((String) null);
Comparator<Object> comparator0 = (Comparator<Object>) mock(Comparator.class, new ViolatedAssumptionAnswer());
helpFormatter0.optionComparator = comparator0;
helpFormatter0.setOptPrefix("");
helpFormatter0.defaultLongOptPrefix = "fjAw&@;\u0007u|)";
helpFormatter0.setLeftPadding((-3780));
helpFormatter0.getNewLine();
MockPrintStream mockPrintStream0 = null;
try {
mockPrintStream0 = new MockPrintStream("", " ] [ long ");
fail("Expecting exception: FileNotFoundException");
} catch(Throwable e) {
//
// no message in exception (getMessage() returned null)
//
verifyException("org.evosuite.runtime.mock.java.io.MockFileOutputStream", e);
}
}
@Test(timeout = 4000)
public void test092() throws Throwable {
HelpFormatter helpFormatter0 = new HelpFormatter();
helpFormatter0.getOptPrefix();
}
@Test(timeout = 4000)
public void test093() throws Throwable {
HelpFormatter helpFormatter0 = new HelpFormatter();
String string0 = "7d[l|ZB77TDNz";
int int0 = (-382);
helpFormatter0.findWrapPos("7d[l|ZB77TDNz", (-382), (-353));
StringBuffer stringBuffer0 = new StringBuffer((CharSequence) "\n");
// Undeclared exception!
try {
helpFormatter0.renderWrappedText(stringBuffer0, (-70), (-353), "oG}8`GfueCy");
fail("Expecting exception: StringIndexOutOfBoundsException");
} catch(StringIndexOutOfBoundsException e) {
}
}
@Test(timeout = 4000)
public void test094() throws Throwable {
HelpFormatter helpFormatter0 = new HelpFormatter();
StringBuffer stringBuffer0 = new StringBuffer((CharSequence) "\n");
stringBuffer0.append((-3638.11286854056));
String string0 = "X>i[#";
helpFormatter0.renderWrappedText(stringBuffer0, 2, 2, "X>i[#");
helpFormatter0.setOptionComparator((Comparator) null);
MockPrintWriter mockPrintWriter0 = null;
try {
mockPrintWriter0 = new MockPrintWriter((OutputStream) null);
fail("Expecting exception: NullPointerException");
} catch(NullPointerException e) {
//
// no message in exception (getMessage() returned null)
//
verifyException("java.io.Writer", e);
}
}
@Test(timeout = 4000)
public void test095() throws Throwable {
HelpFormatter helpFormatter0 = new HelpFormatter();
helpFormatter0.defaultNewLine = "R@z'meGR&X-='";
String string0 = "Cannot add value, list full.";
helpFormatter0.setLongOptPrefix("Cannot add value, list full.");
helpFormatter0.setOptPrefix("");
helpFormatter0.setOptPrefix("");
MockPrintWriter mockPrintWriter0 = null;
try {
mockPrintWriter0 = new MockPrintWriter("");
fail("Expecting exception: FileNotFoundException");
} catch(Throwable e) {
//
// no message in exception (getMessage() returned null)
//
verifyException("org.evosuite.runtime.mock.java.io.MockFileOutputStream", e);
}
}
@Test(timeout = 4000)
public void test096() throws Throwable {
HelpFormatter helpFormatter0 = new HelpFormatter();
String string0 = " ";
helpFormatter0.setLongOptPrefix(" ");
Comparator<Integer> comparator0 = (Comparator<Integer>) mock(Comparator.class, new ViolatedAssumptionAnswer());
helpFormatter0.setOptionComparator(comparator0);
PrintWriter printWriter0 = null;
int int0 = 0;
Options options0 = new Options();
boolean boolean0 = false;
// Undeclared exception!
try {
options0.addOption("usage: ", false, " ");
fail("Expecting exception: IllegalArgumentException");
} catch(IllegalArgumentException e) {
//
// The option 'usage: ' contains an illegal character : ':'
//
verifyException("org.apache.commons.cli.OptionValidator", e);
}
}
@Test(timeout = 4000)
public void test097() throws Throwable {
HelpFormatter helpFormatter0 = new HelpFormatter();
helpFormatter0.setNewLine("");
helpFormatter0.createPadding(385);
String string0 = "\\om{h-O";
Options options0 = new Options();
boolean boolean0 = false;
String string1 = "";
// Undeclared exception!
try {
options0.addOption("MV$]", (String) null, false, "");
fail("Expecting exception: IllegalArgumentException");
} catch(IllegalArgumentException e) {
//
// The option 'MV$]' contains an illegal character : ']'
//
verifyException("org.apache.commons.cli.OptionValidator", e);
}
}
@Test(timeout = 4000)
public void test098() throws Throwable {
HelpFormatter helpFormatter0 = new HelpFormatter();
helpFormatter0.setDescPadding(2772);
helpFormatter0.defaultOptPrefix = "";
helpFormatter0.setSyntaxPrefix("cmdLineSyntax not provided");
helpFormatter0.rtrim("");
}
@Test(timeout = 4000)
public void test099() throws Throwable {
HelpFormatter helpFormatter0 = new HelpFormatter();
helpFormatter0.setSyntaxPrefix(";i6RV)tj<:U2[nY");
helpFormatter0.setLeftPadding(31);
helpFormatter0.setOptPrefix(";i6RV)tj<:U2[nY");
helpFormatter0.getDescPadding();
}
@Test(timeout = 4000)
public void test100() throws Throwable {
HelpFormatter helpFormatter0 = new HelpFormatter();
helpFormatter0.getWidth();
StringWriter stringWriter0 = new StringWriter(711);
StringWriter stringWriter1 = stringWriter0.append('~');
MockPrintWriter mockPrintWriter0 = new MockPrintWriter(stringWriter1);
int int0 = 0;
Options options0 = new Options();
boolean boolean0 = true;
String string0 = "uj-V";
// Undeclared exception!
try {
options0.addOption("-", true, "uj-V");
fail("Expecting exception: IllegalArgumentException");
} catch(IllegalArgumentException e) {
//
// Illegal option name '-'
//
verifyException("org.apache.commons.cli.OptionValidator", e);
}
}
@Test(timeout = 4000)
public void test101() throws Throwable {
HelpFormatter helpFormatter0 = new HelpFormatter();
helpFormatter0.defaultWidth = (-1140);
String string0 = null;
Options options0 = new Options();
// Undeclared exception!
try {
helpFormatter0.printHelp("=ZV_%*S42*),'v", (String) null, options0, "", true);
fail("Expecting exception: StringIndexOutOfBoundsException");
} catch(StringIndexOutOfBoundsException e) {
}
}
@Test(timeout = 4000)
public void test102() throws Throwable {
HelpFormatter helpFormatter0 = new HelpFormatter();
helpFormatter0.defaultLeftPad = 944;
helpFormatter0.getLongOptPrefix();
MockPrintWriter mockPrintWriter0 = new MockPrintWriter("UYfQ,S|>*`0I:W");
Object[] objectArray0 = new Object[3];
objectArray0[0] = (Object) "--";
objectArray0[1] = (Object) "UYfQ,S|>*`0I:W";
objectArray0[2] = (Object) "--";
PrintWriter printWriter0 = mockPrintWriter0.printf("arg", objectArray0);
Options options0 = new Options();
// Undeclared exception!
helpFormatter0.printHelp(printWriter0, 0, "UYfQ,S|>*`0I:W", "--", options0, 944, 944, (String) null);
}
@Test(timeout = 4000)
public void test103() throws Throwable {
HelpFormatter helpFormatter0 = new HelpFormatter();
helpFormatter0.getLeftPadding();
MockPrintStream mockPrintStream0 = new MockPrintStream("-");
MockPrintWriter mockPrintWriter0 = new MockPrintWriter(mockPrintStream0);
PrintWriter printWriter0 = mockPrintWriter0.append('C');
// Undeclared exception!
try {
helpFormatter0.printWrapped(printWriter0, 1, (-1), "a5*DG");
fail("Expecting exception: NegativeArraySizeException");
} catch(NegativeArraySizeException e) {
//
// no message in exception (getMessage() returned null)
//
verifyException("org.apache.commons.cli.HelpFormatter", e);
}
}
@Test(timeout = 4000)
public void test104() throws Throwable {
HelpFormatter helpFormatter0 = new HelpFormatter();
int int0 = 2246;
String string0 = "zgGS}v4iY(O{Uq}wBX'";
// Undeclared exception!
try {
helpFormatter0.printWrapped((PrintWriter) null, 2246, "zgGS}v4iY(O{Uq}wBX'");
fail("Expecting exception: NullPointerException");
} catch(NullPointerException e) {
//
// no message in exception (getMessage() returned null)
//
verifyException("org.apache.commons.cli.HelpFormatter", e);
}
}
@Test(timeout = 4000)
public void test105() throws Throwable {
HelpFormatter helpFormatter0 = new HelpFormatter();
helpFormatter0.setWidth(0);
helpFormatter0.setDescPadding(0);
String string0 = "zow?Z}y#a& =]@";
Options options0 = new Options();
Option option0 = null;
try {
option0 = new Option("-", "org.apache.commons.cli.ParseException");
fail("Expecting exception: IllegalArgumentException");
} catch(IllegalArgumentException e) {
//
// Illegal option name '-'
//
verifyException("org.apache.commons.cli.OptionValidator", e);
}
}
@Test(timeout = 4000)
public void test106() throws Throwable {
HelpFormatter helpFormatter0 = new HelpFormatter();
StringBuffer stringBuffer0 = new StringBuffer();
Options options0 = new Options();
StringBuffer stringBuffer1 = helpFormatter0.renderOptions(stringBuffer0, 0, options0, 0, 0);
options0.getOption("");
// Undeclared exception!
try {
helpFormatter0.renderOptions(stringBuffer1, 3, options0, (-1), 1923);
fail("Expecting exception: NegativeArraySizeException");
} catch(NegativeArraySizeException e) {
//
// no message in exception (getMessage() returned null)
//
verifyException("org.apache.commons.cli.HelpFormatter", e);
}
}
@Test(timeout = 4000)
public void test107() throws Throwable {
HelpFormatter helpFormatter0 = new HelpFormatter();
// Undeclared exception!
try {
helpFormatter0.printHelp("", "", (Options) null, "\n", false);
fail("Expecting exception: IllegalArgumentException");
} catch(IllegalArgumentException e) {
//
// cmdLineSyntax not provided
//
verifyException("org.apache.commons.cli.HelpFormatter", e);
}
}
@Test(timeout = 4000)
public void test108() throws Throwable {
HelpFormatter helpFormatter0 = new HelpFormatter();
helpFormatter0.getLeftPadding();
MockPrintStream mockPrintStream0 = new MockPrintStream("-");
MockPrintWriter mockPrintWriter0 = new MockPrintWriter(mockPrintStream0);
PrintWriter printWriter0 = mockPrintWriter0.append('C');
Object[] objectArray0 = new Object[3];
Object object0 = new Object();
objectArray0[0] = object0;
objectArray0[1] = (Object) printWriter0;
Object object1 = new Object();
mockPrintWriter0.printf(" ", objectArray0);
Options options0 = new Options();
// Undeclared exception!
try {
helpFormatter0.printHelp((PrintWriter) null, 9, (String) null, "nCq8Md[M<]", options0, 0, 9, "nCq8Md[M<]");
fail("Expecting exception: IllegalArgumentException");
} catch(IllegalArgumentException e) {
//
// cmdLineSyntax not provided
//
verifyException("org.apache.commons.cli.HelpFormatter", e);
}
}
@Test(timeout = 4000)
public void test109() throws Throwable {
HelpFormatter helpFormatter0 = new HelpFormatter();
MockFile mockFile0 = new MockFile("", "--");
MockFileOutputStream mockFileOutputStream0 = new MockFileOutputStream(mockFile0);
MockPrintWriter mockPrintWriter0 = new MockPrintWriter(mockFileOutputStream0, false);
Object[] objectArray0 = new Object[8];
objectArray0[0] = (Object) "oz&_IX[ZY";
objectArray0[1] = (Object) "";
objectArray0[2] = (Object) mockFileOutputStream0;
objectArray0[3] = (Object) mockFileOutputStream0;
objectArray0[4] = (Object) "oz&_IX[ZY";
objectArray0[5] = (Object) "oz&_IX[ZY";
objectArray0[6] = (Object) mockFileOutputStream0;
objectArray0[7] = (Object) "";
PrintWriter printWriter0 = mockPrintWriter0.printf("oz&_IX[ZY", objectArray0);
MockPrintWriter mockPrintWriter1 = new MockPrintWriter(printWriter0);
Options options0 = new Options();
Option option0 = new Option("", "org.apache.commons.cli.AlreadySelectedException", false, "usage: ");
Options options1 = options0.addOption(option0);
// Undeclared exception!
try {
helpFormatter0.printHelp((PrintWriter) mockPrintWriter1, (-1929), "", "L?]=bC7}%`2Yu2dXZ!G", options1, 0, (-1), "", false);
fail("Expecting exception: IllegalArgumentException");
} catch(IllegalArgumentException e) {
//
// cmdLineSyntax not provided
//
verifyException("org.apache.commons.cli.HelpFormatter", e);
}
}
@Test(timeout = 4000)
public void test110() throws Throwable {
HelpFormatter helpFormatter0 = new HelpFormatter();
String string0 = "[ option: ";
try {
MockURI.URI("[ option: ");
fail("Expecting exception: URISyntaxException");
} catch(URISyntaxException e) {
//
// Illegal character in scheme name at index 0: [ option:
//
verifyException("java.net.URI$Parser", e);
}
}
@Test(timeout = 4000)
public void test111() throws Throwable {
HelpFormatter helpFormatter0 = new HelpFormatter();
helpFormatter0.createPadding(2102);
helpFormatter0.setArgName("");
PrintWriter printWriter0 = null;
int int0 = (-136);
String string0 = "org.apache.commons.cli.OptionGroup";
String string1 = "4*qskCAq";
Options options0 = new Options();
OptionGroup optionGroup0 = null;
helpFormatter0.printHelp("]", "", options0, "4*qskCAq");
// Undeclared exception!
try {
options0.addOptionGroup((OptionGroup) null);
fail("Expecting exception: NullPointerException");
} catch(NullPointerException e) {
//
// no message in exception (getMessage() returned null)
//
verifyException("org.apache.commons.cli.Options", e);
}
}
@Test(timeout = 4000)
public void test112() throws Throwable {
HelpFormatter helpFormatter0 = new HelpFormatter();
StringBuffer stringBuffer0 = null;
int int0 = 0;
String string0 = "";
boolean boolean0 = false;
// Undeclared exception!
try {
helpFormatter0.printHelp("", "", (Options) null, "`Cr*8S{NtQA|d}", false);
fail("Expecting exception: IllegalArgumentException");
} catch(IllegalArgumentException e) {
//
// cmdLineSyntax not provided
//
verifyException("org.apache.commons.cli.HelpFormatter", e);
}
}
}
| [
"pderakhshanfar@serg2.ewi.tudelft.nl"
] | pderakhshanfar@serg2.ewi.tudelft.nl |
83253a143e9cf3c70e31a0ba539894c90f1996b9 | b4d85cbd7b42e536062575ac9565835d466b96d9 | /mybatis_plugin_page_two/src/main/java/com/study/mybatis/free/page/two/domain/User.java | f41c3b71fa50897ef0024d9c520fb1c3556eceec | [] | no_license | pi408637535/Dynamic_Mybatis | 386f1f563590d79c81b90d585ff2a26c46eea605 | 8b3cbda3ffab00931d3b21cb945e1d466612e691 | refs/heads/master | 2021-01-09T06:23:48.018225 | 2017-05-07T23:58:42 | 2017-05-07T23:58:42 | 80,981,643 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 561 | java | package com.study.mybatis.free.page.two.domain;
public class User {
private Long id;
private String name;
public Long getId() {
return id;
}
public void setId(Long id) {
this.id = id;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name == null ? null : name.trim();
}
@Override
public String toString() {
return "User{" +
"id=" + id +
", name='" + name + '\'' +
'}';
}
} | [
"piguanghua@wordemotion.com"
] | piguanghua@wordemotion.com |
4925b2a077f8a0b2d84e3f7d3fb221328f14b61d | 6fd52eca495e0e14e100d8007b1c509eb74195d2 | /src/Structure/Bloque.java | 8e6fe3bd27afb8aa6f5a6ec9959437f7d73af63f | [] | no_license | djdhm/blockChain-java | 0cde59205f10d1410bbb38fe6970e3822e2fcb6d | 2dd530a485f4669c88e109e25995a32fa1ed7b07 | refs/heads/master | 2021-09-23T12:01:06.747058 | 2018-09-22T12:08:31 | 2018-09-22T12:08:31 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,677 | java | package Structure;
import java.io.Serializable;
import java.util.Date;
// Structure.Bloque doit implementer l'interface Serializable pour que les instances Structure.Bloque peuvent etre communiquées via RMI
public class Bloque implements Serializable {
private String hash;
private String hashPrecedent;
private String data;
private long timeStamp;
private int nonce;
private boolean encore;
public static String GENESIS_BLOQUE="Genesis Structure.Bloque";
public Bloque(String hashPrecedent, String data) {
this.hashPrecedent = hashPrecedent;
this.data = data;
this.timeStamp = new Date().getTime();
this.hash=calculerHash();
}
public String calculerHash(){
// calculer le hash des données contenu dans le bloque
return OutilHash.hasherEnSha(this.hashPrecedent+Long.toString(this.timeStamp)+Integer.toString(nonce) + this.data);
}
public void minerBlock(int difficulte) {
String target = new String(new char[difficulte]).replace('\0', '0'); //Creer une chaine avec difficulte * "0"
while(!hash.substring( 0, difficulte).equals(target)) {
nonce ++;
hash = calculerHash();
}
System.out.println("Structure.Bloque Resolu!!! : " + hash);
}
public void minerBlockaDistance(int difficulte) {
encore=true;
String target = new String(new char[difficulte]).replace('\0', '0'); //Creer une chaine avec difficulte * "0"
//Tanque ce bloque n'a pas reçu un signal disant qu'un autre bloque a terminé de miner le nouveau bloque, il continue à miner
while(encore && !hash.substring( 0, difficulte).equals(target)) {
nonce ++;
hash = calculerHash();
}
if(encore) System.out.println("Structure.Bloque Resolu!!! : " + hash);
}
// Verifie si le bloque est valide ou pas
public boolean estBloqueValide(String hashPrecedent,int difficulte){
if(!this.hashPrecedent.equals(hashPrecedent)) return false;
if(!this.calculerHash().equals(hash)) return false;
String hashTarget = new String(new char[difficulte]).replace('\0', '0');
if(!this.hash.substring(0,difficulte).equals(hashTarget)) return false;
return true;
}
public void arreterMining(){
encore=false;
}
public String getHash() {
return hash;
}
public String getHashPrecedent() {
return hashPrecedent;
}
public String getData() {
return data;
}
public long getTimeStamp() {
return timeStamp;
}
public int getNonce() {
return nonce;
}
}
| [
"dm_boudjelida@esi.dz"
] | dm_boudjelida@esi.dz |
0d92c1c501321e169427ce7ed55e7c9b2343f795 | b4c23abd3e1bdf7727a0406f865382d5b28c6810 | /HelloWorld/app/src/test/java/ro/atm/dmc/helloworldapplication/ExampleUnitTest.java | b2fb384210366fdccb79452414a7e3251570c3ff | [
"MIT"
] | permissive | catalinboja/dmc_2020 | 04531368bd1a3398d1e9a7e36b5ba9acc5e6c35f | c26a910dd5237b75ae102e0b2f6a88d0ac0c3107 | refs/heads/master | 2022-06-23T21:43:24.656035 | 2020-05-08T05:40:20 | 2020-05-08T05:40:20 | 256,119,642 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 393 | java | package ro.atm.dmc.helloworldapplication;
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);
}
} | [
"catalin.boja@hotmail.com"
] | catalin.boja@hotmail.com |
e0a5746ecb43d6bc3e4fdee1c236a492c6385a16 | 3e9b9266436f3b0b1db50b233b3f1d505040ed73 | /src/main/java/cn/ys/dao/RoleMapper.java | 91600035969c9e16f4b4fa546a1f53afa534ab0d | [] | no_license | cliffwaltz/batteryManager | 0555a8fb1413d0e86eed5d682888d9dfe4a26de6 | cb3d9e77f4afbd77c60941e28db82574cc691827 | refs/heads/master | 2022-12-24T21:20:26.647180 | 2019-10-18T07:30:15 | 2019-10-18T07:30:15 | 215,966,527 | 1 | 0 | null | 2022-12-16T05:16:34 | 2019-10-18T07:31:37 | HTML | UTF-8 | Java | false | false | 718 | java | package cn.ys.dao;
import cn.ys.entity.Role;
import org.apache.ibatis.annotations.Param;
import java.util.List;
public interface RoleMapper {
List<Role> findRoleByAdminId(Integer id);
List<Role> findAll();
List<Role> findAllPageRoles(@Param("limit1") Integer limit1, @Param("limit2") Integer limit2);
int findTotal();
boolean addRole(Role role);
Role findRoleById(Integer id);
boolean updateRole(@Param("role") Role role,@Param("key") Integer key);
boolean deleteRoleById(Integer id);
boolean addMenus(@Param("addmenus") List<Integer> addmenus, @Param("key") Integer key);
boolean deleteMenus(@Param("oldmenus") List<Integer> oldmenus,@Param("key") Integer key);
}
| [
"1395451909@qq.com"
] | 1395451909@qq.com |
d2164aec020e0f35b8d17e4659a915cdd117d0f0 | 3efceb8239379f9b15405a817aeae0ed94049db5 | /Code/250/Solution.java | 7521efc616160c483b2581387baac62e02882121 | [] | no_license | RazorK/Leetcode | 3661860c3e21a0993982c8d090f5531be1540124 | 5bccc9884ab2954ecb9a73966f55167b3ad284e9 | refs/heads/master | 2021-03-25T14:22:04.876847 | 2019-02-07T04:04:45 | 2019-02-07T04:04:45 | 110,893,069 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,460 | java | /**
* Definition for a binary tree node.
* public class TreeNode {
* int val;
* TreeNode left;
* TreeNode right;
* TreeNode(int x) { val = x; }
* }
*/
class Solution {
// Given a binary tree, count the number of uni-value subtrees.
// A Uni-value subtree means all nodes of the subtree have the same value.
// Example :
// Input: root = [5,1,5,5,5,null,5]
// 5
// / \
// 1 5
// / \ \
// 5 5 5
// Output: 4
public int countUnivalSubtrees(TreeNode root) {
return dfsHelper(root, new boolean[1]);
}
public int dfsHelper(TreeNode root, boolean [] flag) {
if(root == null) {
flag[0] = true;
return 0;
} else if(root.left == null && root.right == null) {
flag[0] = true;
return 1;
}
boolean [] leftFlag = new boolean[1];
boolean [] rightFlag = new boolean[1];
int left = dfsHelper(root.left, leftFlag);
int right = dfsHelper(root.right, rightFlag);
if(leftFlag[0] && rightFlag[0] &&
(root.left == null || root.left.val == root.val) &&
(root.right == null || root.right.val == root.val)
) {
flag[0] = true;
return left + right + 1;
} else {
flag[0] = false;
return left + right;
}
}
} | [
"aimin52qinhao@163.com"
] | aimin52qinhao@163.com |
b28616ca43f548775d0080a40f8e640804fd8ad0 | c3b327db8eedbb08d4ce0c33e17b84f3c8044f9e | /src/test/java/no/entra/bacnet/agent/devices/DeviceIdTest.java | 4821304b6bbd835765b10e925e29b3f318f7cb5b | [
"Apache-2.0"
] | permissive | entraeiendom/bacnet-ip-agent | 22bc4cd364779a195297f5e0fc8a622d7cc38b0c | 0567273013745ace2cd1c36e964b4a92d58bf113 | refs/heads/master | 2023-08-23T07:56:32.359389 | 2023-08-09T23:09:48 | 2023-08-09T23:09:52 | 222,636,317 | 1 | 1 | Apache-2.0 | 2023-08-09T23:09:53 | 2019-11-19T07:36:09 | Java | UTF-8 | Java | false | false | 2,851 | java | package no.entra.bacnet.agent.devices;
import org.junit.Test;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertTrue;
public class DeviceIdTest {
@Test
public void isValid() {
DeviceId deviceId = new DeviceId();
deviceId.setId("id");
assertTrue(deviceId.isValid());
deviceId.setId(null);
assertFalse(deviceId.isValid());
assertFalse(deviceId.isValid());
deviceId.setTfmTag("ttt");
assertTrue(deviceId.isValid());
deviceId.setTfmTag(null);
assertFalse(deviceId.isValid());
deviceId.setIpAddress("ip");
assertTrue(deviceId.isValid());
deviceId.setIpAddress(null);
assertFalse(deviceId.isValid());
deviceId.setInstanceNumber(2000);
assertTrue(deviceId.isValid());
}
@Test
public void gatwayIsValid() {
DeviceId deviceId = new DeviceId();
assertFalse(deviceId.isValid());
deviceId.setGatewayInstanceNumber(2000);
assertFalse(deviceId.isValid());
deviceId.setGatewayDeviceId(11);
assertTrue(deviceId.isValid());
deviceId.setGatewayInstanceNumber(null);
assertFalse(deviceId.isValid());
}
@Test
public void testEquals() {
String id = "id1234";
String tfmTag = "tfm1234";
Integer instanceNumber = 2002;
DeviceId originalId = new DeviceId();
originalId.setId(id);
DeviceId equalsId = new DeviceId();
equalsId.setId(id);
assertTrue(originalId.equals(equalsId));
//TFM only
originalId.setId(null);
originalId.setTfmTag(tfmTag);
equalsId.setId(null);
assertFalse(originalId.equals(equalsId));
equalsId.setTfmTag(tfmTag);
assertTrue(originalId.equals(equalsId));
//InstanceNumber
originalId.setId(id);
originalId.setInstanceNumber(instanceNumber);
equalsId.setId(id);
equalsId.setInstanceNumber(instanceNumber);
assertTrue(originalId.equals(equalsId));
}
@Test
public void testIsIntegerEqual() {
DeviceId deviceId = new DeviceId();
assertTrue( deviceId.isIntegerEqual(100, 100));
assertTrue( deviceId.isIntegerEqual(null, null));
assertFalse( deviceId.isIntegerEqual(100, 99));
assertFalse( deviceId.isIntegerEqual(null, 99));
assertFalse( deviceId.isIntegerEqual(100, null));
}
@Test
public void testIsStringEqual() {
DeviceId deviceId = new DeviceId();
assertTrue( deviceId.isStringEqual("ab", "ab"));
assertTrue( deviceId.isStringEqual(null, null));
assertFalse( deviceId.isStringEqual("ab","abc"));
assertFalse( deviceId.isStringEqual(null, "abc"));
assertFalse( deviceId.isStringEqual("ab", null));
}
} | [
"bard.lind@gmail.com"
] | bard.lind@gmail.com |
15be59e22c30b5faf1674e0812eea57406411c7a | 2408639641881ca6b083e1bdf05b866cc5712b15 | /src/main/java/org/spacehq/mc/protocol/data/game/world/notify/EnterCreditsValue.java | 04eb00d73e0406aa1913810876f5c472c3948826 | [
"MIT"
] | permissive | games647/MCProtocolLib | 2c40dbda3924d212b2ca48478ff5285de7f642ee | f0de35df53f40c8fdeee058ec46f4c1607389fd8 | refs/heads/master | 2021-01-13T03:44:20.650029 | 2020-11-04T11:24:41 | 2020-11-04T11:24:41 | 77,235,758 | 0 | 0 | MIT | 2020-11-04T11:24:43 | 2016-12-23T15:57:23 | Java | UTF-8 | Java | false | false | 159 | java | package org.spacehq.mc.protocol.data.game.world.notify;
public enum EnterCreditsValue implements ClientNotificationValue {
SEEN_BEFORE,
FIRST_TIME;
}
| [
"Steveice10@gmail.com"
] | Steveice10@gmail.com |
a75ca1a4ddc6f15eac4d7fd425e9792273c26ed5 | 130f06f9910f8d650736d3a23a32398200396bea | /TestingWithSBDCode/src/org/usfirst/frc/team5822/robot/commands/StopIntake.java | 6dea941e6becfebca3cbff3ce72aa99973af7eb3 | [] | no_license | SICPRobotics/2017-Robot-Code | 740621bc545ca19e51cd70d954c1c6cb90f499c4 | 71a451f7b0feee591802608f8139ab6616360376 | refs/heads/master | 2021-01-09T05:28:50.123122 | 2017-12-14T22:29:36 | 2017-12-14T22:29:36 | 80,773,694 | 0 | 1 | null | null | null | null | UTF-8 | Java | false | false | 1,239 | java | package org.usfirst.frc.team5822.robot.commands;
import org.usfirst.frc.team5822.robot.Robot;
import edu.wpi.first.wpilibj.command.Command;
import edu.wpi.first.wpilibj.smartdashboard.SmartDashboard;
/**
*
*/
public class StopIntake extends Command {
public StopIntake() {
// Use requires() here to declare subsystem dependencies
// eg. requires(chassis);
requires(Robot.intake);
}
// Called just before this Command runs the first time
protected void initialize() {
SmartDashboard.putBoolean("Intake", false);
SmartDashboard.putBoolean("Outtake Fast", false);
SmartDashboard.putBoolean("Outtake Slow", false);
}
// Called repeatedly when this Command is scheduled to run
protected void execute()
{
Robot.intake.doNothing();
System.out.println("Stop intake.");
}
// Make this return true when this Command no longer needs to run execute()
protected boolean isFinished() {
return true;
}
// Called once after isFinished returns true
protected void end() {
}
// Called when another command which requires one or more of the same
// subsystems is scheduled to run
protected void interrupted() {
}
}
| [
"sicp@a70-PC.ignatius.org"
] | sicp@a70-PC.ignatius.org |
3e6220d5aeffaa8aeb0aceaa24eee3634e57ab18 | 3f131fd5d38f91b5529e0e3b31a6f34fdd0cd84b | /app/src/main/java/com/gls/som/database/RetailerHelper.java | 8177c5b47b00556ae48800fa825fc0b6234cd271 | [] | no_license | PratimaPatil/SalesOrderManagement | f39f2774f0160da03a5a7c4daca5ec2900df0c00 | c6580727e2c261af01c1290ed42eaf6ee6a65419 | refs/heads/master | 2021-01-10T16:05:21.440911 | 2016-03-04T12:49:25 | 2016-03-04T12:49:25 | 52,942,767 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,257 | java | package com.gls.som.database;
import android.content.ContentValues;
import android.content.Context;
import android.database.Cursor;
import android.database.DatabaseUtils;
import android.database.sqlite.SQLiteDatabase;
import android.database.sqlite.SQLiteOpenHelper;
import android.util.Log;
import com.gls.som.retailer.RetailerBean;
import com.gls.som.utils.Constants;
import java.util.ArrayList;
/**
* Created by pratima on 3/3/16.
*/
public class RetailerHelper extends SQLiteOpenHelper {
public static final int DATABASE_VERSION = Constants.DB_VERSION;
public static final String DATABASE_NAME = "retailers.db";
public static final String RETAILER_TB_NAME = "retailers";
public static final String RETAILER_AREA = "retailer_area";
public static final String RETAILER_ID = "retailer_id";
public static final String RETAILER_NAME = "retailer_name";
public RetailerHelper(Context context)
{
super(context, DATABASE_NAME, null, DATABASE_VERSION);
}
@Override
public void onCreate(SQLiteDatabase db) {
db.execSQL("DROP TABLE IF EXISTS '" + RETAILER_TB_NAME + "'");
db.execSQL("create table " + RETAILER_TB_NAME + "(" + RETAILER_ID + " integer primary key, " + RETAILER_NAME + " text, " + RETAILER_AREA + " text)");
}
@Override
public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) {
onCreate(db);
}
public boolean saveRetailer (ArrayList<RetailerBean> retailerBeans) {
SQLiteDatabase db = this.getWritableDatabase();
for(int i=0;i<retailerBeans.size();i++) {
ContentValues contentValues = new ContentValues();
contentValues.put(RETAILER_ID, retailerBeans.get(i).getRetailer_id());
contentValues.put(RETAILER_NAME, retailerBeans.get(i).getRetailer_name());
contentValues.put(RETAILER_AREA, retailerBeans.get(i).getRetailer_area());
db.insert(RETAILER_TB_NAME, null, contentValues);
Log.e("Inserting", retailerBeans.get(i).getRetailer_id() + "=>" + retailerBeans.get(i).getRetailer_name() + "=>" + retailerBeans.get(i).getRetailer_area() + "=>");
}
db.close();
return true;
}
public ArrayList<RetailerBean> getAllItems(){
ArrayList<RetailerBean> itemBeans = new ArrayList<>();
SQLiteDatabase db = this.getReadableDatabase();
Cursor cursor = db.rawQuery("select * from "+RETAILER_TB_NAME,null);
if(cursor.moveToFirst()) {
do {
RetailerBean bean = new RetailerBean();
bean.setRetailer_id(cursor.getInt(0));
bean.setRetailer_name(cursor.getString(1));
bean.setRetailer_area(cursor.getString(2));
itemBeans.add(bean);
} while (cursor.moveToNext());
}
db.close();
return itemBeans;
}
public void clearTable(String tb_name) {
SQLiteDatabase db = this.getReadableDatabase();
db.rawQuery("delete from " + tb_name, null);
}
public int numberOfRows(String table_name){
SQLiteDatabase db = this.getReadableDatabase();
int numRows = (int) DatabaseUtils.queryNumEntries(db, table_name);
return numRows;
}
}
| [
"pratima@giantleapsystems.com"
] | pratima@giantleapsystems.com |
65ed2b8ddd4545b68d5e12bcc3885379edc3053f | 0ebb70de48584064370d00e325456b943d6d57f7 | /cos420/Example1/src/main/java/edu/usm/cos420/example1/domain/Customer.java | 9e5a8f72af1af5ef848dece6479ace608d9349ef | [] | no_license | ryanturner27/data-struct.prj1 | 5fa19c33b282de042cdaa2612bac589e771fcba0 | 88c35024326ee36c366f59c2b7fedddd3cba3e01 | refs/heads/master | 2021-01-11T17:43:33.625113 | 2017-01-23T17:03:39 | 2017-01-23T17:03:39 | 79,825,456 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,666 | java | package edu.usm.cos420.example1.domain;
import java.io.Serializable;
/**
*
* Customer holds three pieces of data. The class implements
* the interface Serializable in order to store and retrieve the information
* in the class
* @author Ryan Turner
*
*/
public class Customer implements Serializable{
private static final long serialVersionUID = 7526472295622776147L;
private Long ID;
private static Long COUNTER = 0L;
private String fullname;
private String address;
/**
* Default Constructor with no arguments:
* Uses the autogenerated sequence for an ID
*/
public Customer(){
this.fullname ="";
this.address = "";
ID = generateId();
}
/**
* Two field Constructor :
* Creates new Customer with an autogenerated sequence ID
*/
public Customer(String name, String add)
{
this.fullname = name;
this.address = add;
ID = generateId();
}
/**
* Three field Constructor:
* @param idnum is the ID number that is specified for the Customer Object
* @param name is the name of the Customer
* @param add is the address of the Customer
*/
public Customer(Long idnum, String name, String add){
this.fullname = name;
this.address = add;
this.ID = idnum;
}
/**
* Creates a new name for the Customer
* @param first is the first name of the Customer
* @param last is the last name of the Customer
*/
public void setName(String first, String last){
fullname = first + " " + last;
}
/**
* Update Address for the Customer Object
* @param newAdd is the new address that updates the older address from Customer Object
*/
public void setAddress(String newAdd){
address = newAdd;
}
/**
* Returns the current Address of the Customer Object
* @return the current Address
*/
public String getAddress(){
return address;
}
/**
* Returns the ID number for Customer
* @return the ID number as a long type
*/
public Long getIdnumber(){
return ID;
}
/**
* Returns the name of the Customer
* @return the String name data in Customer Object
*/
public String getName(){
return fullname;
}
/**
* Returns the String representation of this User. Not required, it just pleases reading logs.
* @see java.lang.Object#toString()
*/
@Override
public String toString() {
return String.format("\nid= %6d\nName= %s\nAddress= %s\n", getIdnumber(), fullname, address);
}
// for autogeneration of ids
private Long generateId()
{
return COUNTER = (long)Math.round(Math.random()*999999);
}
} | [
"ryan.a.turner@maine.edu"
] | ryan.a.turner@maine.edu |
ae18aa88f61c31df1a2bf97e1957912c47be7342 | 09401e467e7f0c15ccb29ba84d31eeab8e365e1d | /app/src/main/java/com/adjiekurniawan/sumbission2_dicoding/Fragments/FragmentTvShow.java | 8ab0ec5066885adf5dc137da31b82ff4a92b76f8 | [] | no_license | adjie46/GDK-2019-Submission2 | 190d0ff939bdf567eae045a08e58c5e6d8808f3a | 94d872cf554ffb2f81f969836f529172e9c96b6a | refs/heads/master | 2020-07-02T16:54:38.265333 | 2019-08-10T07:30:41 | 2019-08-10T07:30:41 | 201,596,023 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 5,170 | java | package com.adjiekurniawan.sumbission2_dicoding.Fragments;
import android.content.Context;
import android.content.Intent;
import android.content.res.TypedArray;
import android.os.Bundle;
import android.support.annotation.NonNull;
import android.support.annotation.Nullable;
import android.support.v4.app.Fragment;
import android.support.v7.widget.GridLayoutManager;
import android.support.v7.widget.LinearLayoutManager;
import android.support.v7.widget.RecyclerView;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import com.adjiekurniawan.sumbission2_dicoding.Activities.DetailMovieActivity;
import com.adjiekurniawan.sumbission2_dicoding.Adapters.TvShowAdapter;
import com.adjiekurniawan.sumbission2_dicoding.Models.TvShow;
import com.adjiekurniawan.sumbission2_dicoding.R;
import java.util.ArrayList;
public class FragmentTvShow extends Fragment {
private Context context;
private View rootView;
private RecyclerView recyclerView;
private String[] dataTvshow;
private String[] dataTvshowDuration;
private String[] dataTvshowCategory;
private String[] dataTvshowDescription;
private String[] dataTvshowRating;
private String[] category;
private String[] dataTvshowReleaseDateLong;
private String[] dataTvshowDirector;
private TypedArray dataTvshowCover;
private String categoryIntent = "tvshow";
public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
rootView = inflater.inflate(R.layout.fragment_tv_show, container, false);
context = getContext();
initView();
return rootView;
}
private void initView(){
recyclerView = rootView.findViewById(R.id.dataTvShow);
recyclerView.setLayoutManager(new LinearLayoutManager(getContext()));
recyclerView.setHasFixedSize(true);
recyclerView.setNestedScrollingEnabled(false);
RecyclerView.LayoutManager layoutManager = new GridLayoutManager(getContext(), 1, GridLayoutManager.VERTICAL, false);
recyclerView.setLayoutManager(layoutManager);
initData();
}
private void initData(){
dataTvshowCover = getResources().obtainTypedArray(R.array.data_cover_tvshow);
dataTvshow = getResources().getStringArray(R.array.data_tvshow);
dataTvshowDuration = getResources().getStringArray(R.array.data_tvshow_duration);
dataTvshowCategory = getResources().getStringArray(R.array.data_tvshow_category);
dataTvshowDescription = getResources().getStringArray(R.array.data_tvshow_description);
dataTvshowRating = getResources().getStringArray(R.array.data_tvshow_rating);
dataTvshowReleaseDateLong = getResources().getStringArray(R.array.data__tvshow_release_date_long);
dataTvshowDirector = getResources().getStringArray(R.array.data_tvshow_director);
category = getResources().getStringArray(R.array.category_tvshow);
String[] datareleasedate = getResources().getStringArray(R.array.data__tvshow_release_date_short);
ArrayList<TvShow> tvshow = new ArrayList<>();
for(int i=0;i<dataTvshow.length;i++){
TvShow tvShow = new TvShow();
tvShow.setPosterCover(dataTvshowCover.getResourceId(i,-1));
tvShow.setPosterName(dataTvshow[i]);
tvShow.setPosterCategory(dataTvshowCategory[i]);
tvShow.setPosterDuration(dataTvshowDuration[i]);
tvShow.setPosterDescription(dataTvshowDescription[i]);
tvShow.setPosterRating(dataTvshowRating[i]);
tvShow.setPosterReleaseDate(datareleasedate[i]);
tvShow.setPosterReleaseDateLong(dataTvshowReleaseDateLong[i]);
tvShow.setPosterDirector(dataTvshowDirector[i]);
tvShow.setCategory(category[i]);
tvshow.add(tvShow);
}
TvShowAdapter tvShowAdapter = new TvShowAdapter(context, tvshow);
tvShowAdapter.setOnItemClickListener(new TvShowAdapter.OnItemClickListener() {
@Override
public void onItemClick(View view, TvShow tvShow, int i) {
TvShow tvshow = new TvShow();
tvshow.setPosterCover(dataTvshowCover.getResourceId(i,-1));
tvshow.setPosterName(dataTvshow[i]);
tvshow.setPosterCategory(dataTvshowCategory[i]);
tvshow.setPosterDuration(dataTvshowDuration[i]);
tvshow.setPosterDescription(dataTvshowDescription[i]);
tvshow.setPosterRating(dataTvshowRating[i]);
tvshow.setPosterReleaseDateLong(dataTvshowReleaseDateLong[i]);
tvshow.setPosterDirector(dataTvshowDirector[i]);
tvshow.setCategory(category[i]);
Intent detailMovie = new Intent(getActivity(), DetailMovieActivity.class);
detailMovie.putExtra(DetailMovieActivity.extraTvShow, tvshow);
detailMovie.putExtra(DetailMovieActivity.extraCategory,categoryIntent);
startActivity(detailMovie);
}
});
recyclerView.setAdapter(tvShowAdapter);
}
}
| [
"adjie46@gmail.com"
] | adjie46@gmail.com |
298c2920c8fd0d4d71945bbc2f0be7c324b25406 | cc9b5c59184bda2966d615239807140574f90917 | /src/main/java/com/braintreegateway/MultipleValueNode.java | 82ad7014ad75bafd7ee11bc4743e07cbfceb8716 | [
"LicenseRef-scancode-free-unknown",
"MIT",
"LicenseRef-scancode-other-permissive",
"Apache-2.0"
] | permissive | appscode/braintree_java | 210562eebad91ee3e3d4f19d481874473f87628a | b4433b31179f0e1a770d2a5babdc044f9d182fea | refs/heads/master | 2021-01-11T19:00:48.798614 | 2017-01-11T19:59:42 | 2017-01-11T19:59:42 | 79,289,710 | 2 | 0 | MIT | 2019-07-21T21:14:13 | 2017-01-18T01:14:19 | Java | UTF-8 | Java | false | false | 535 | java | package com.braintreegateway;
import java.util.Arrays;
import java.util.List;
public class MultipleValueNode<T extends SearchRequest, S> extends SearchNode<T> {
public MultipleValueNode(String nodeName, T parent) {
super(nodeName, parent);
}
public T in(List<S> items) {
return assembleMultiValueCriteria(items);
}
public T in(S... items) {
return in(Arrays.asList(items));
}
@SuppressWarnings("unchecked")
public T is(S item) {
return in(item);
}
}
| [
"code@getbraintree.com"
] | code@getbraintree.com |
37a7efd90db4e920b9a08d4d098aaa0354ae315b | 6897222174736708531da65c74edbb3cc6baf506 | /src/Filter/UploadVedioServlet.java | ddd6a1a0356d26e4d6a0fc78384548a70f8c2cb7 | [] | no_license | GZzzhsmart/FitmentStore | 208ab4146f7be9be4dc7b648deb27d57ff6bd70c | a2300ff5a875d6cc1c97ebe8967e4cdf4a82dc05 | refs/heads/master | 2021-07-24T09:22:43.149639 | 2017-11-05T11:07:31 | 2017-11-05T11:07:31 | 104,160,796 | 2 | 1 | null | null | null | null | UTF-8 | Java | false | false | 3,615 | java | package Filter;
import java.io.File;
import java.io.IOException;
import java.io.PrintWriter;
import java.util.Enumeration;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import com.oreilly.servlet.MultipartRequest;
public class UploadVedioServlet extends HttpServlet {
public void doGet(HttpServletRequest request, HttpServletResponse response)
throws ServletException, IOException {
doPost(request, response);
}
/*文件上传:
* 1.要把cos.jar文件拷贝到WEB-INF/lib文件夹
* 2.创建上传的jsp页面,页面的表单必须有如下2个属性,并且值是固定的
* 1.enctype="multipart/form-data"
* 2.method = "post"
* 3.FileRenameUtil改类主要功能是对文件进行重命名,该类必须实现FileRenamePolicy接口
* 4.创建文件上传的servlet,实现文件上传
*
*
* */
public void doPost(HttpServletRequest request, HttpServletResponse response)
throws ServletException, IOException {
// 保存文件的路径,必须是tomcat里面当前项目下的子路径
String filePath = getServletContext().getRealPath("/") + "vedio";
System.out.println(filePath);//输出存放上传文件所到的路径
File uploadPath = new File(filePath);
// 检查文件夹是否存在 不存在 创建一个
if (!uploadPath.exists()) {
//创建文件夹
uploadPath.mkdir();
}
// 文件最大容量 1G
int fileMaxSize = 1024 * 1024 * 1024;
// 存放文件描述
@SuppressWarnings("unused")
String[] fileDiscription = { null, null };
// 文件名
String fileName = null;
// 上传文件数
int fileCount = 0;
// 重命名策略
FileRenameUtil rfrp = new FileRenameUtil();
// 上传文件
MultipartRequest mulit =null;
try{
mulit = new MultipartRequest(request, filePath,
fileMaxSize, "UTF-8", rfrp);//取得上传文件
}catch(Exception e){
request.setAttribute("msg", "上传文件的大小不能超过1G");
getServletContext().getRequestDispatcher("/T13/uploadVedio.jsp").forward(request, response);
return;
}
//获取普通控件的值,不能使用request对象
String section = mulit.getParameter("section");
System.out.println(section);
Enumeration filesname = mulit.getFileNames();//取得上传的所有文件(相当于标识)
while (filesname.hasMoreElements()) {
//控件名称
String name = (String) filesname.nextElement();//标识
System.out.println(name);
fileName = mulit.getFilesystemName(name); //取得文件名
String contentType = mulit.getContentType(name);//工具标识取得的文件类型
if (fileName != null) {
fileCount++;
}
// System.out.println("文件名:" + fileName);
// System.out.println("文件类型: " + contentType);
//在页面显示上传成功的图片
// out.println("<img src='upload/"+fileName+"' />");
}
PrintWriter out = response.getWriter();
response.setContentType("text/html;charset=utf-8");
out.println("正在开发中.............");
System.out.println("共上传" + fileCount + "个文件!");
out.close();
}
}
| [
"1729340612@qq.com"
] | 1729340612@qq.com |
d07ac6124ce879e9745a4af41821d65a8251d98b | bc7c3bb387650b9a1f420748227eb22ef1cae29f | /line/src/main/java/workstation/zjyk/line/modle/request/ExceptionRequest.java | 2a3293c2f8eb991178f9f8c3f1980aab23162c1d | [] | no_license | zxp0505/Mes2 | c493dbecb4fdcc78857cc7b895ef1490b5ace727 | 7e145567a8256fed2277fa2789b3e4efcfc6d547 | refs/heads/master | 2020-04-26T07:28:40.003681 | 2019-03-11T05:18:29 | 2019-03-11T05:18:29 | 173,395,451 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 4,799 | java | package workstation.zjyk.line.modle.request;
import workstation.zjyk.line.modle.bean.ExceptionDetailBean;
import workstation.zjyk.line.modle.bean.ExceptionOutBean;
import workstation.zjyk.line.modle.bean.ExceptionPrintBean;
import workstation.zjyk.line.modle.bean.ExceptionRecordBean;
import workstation.zjyk.line.modle.callback.RxDataCallBack;
import workstation.zjyk.line.modle.net.ApiManager;
import workstation.zjyk.line.modle.net.ChildHttpResultSubscriber;
import workstation.zjyk.line.ui.views.BaseView;
import workstation.zjyk.line.util.URLBuilder;
import java.util.List;
import java.util.Map;
/**
* Created by zjgz on 2017/11/10.
*/
public class ExceptionRequest {
/**
* 异常报告列表
*
* @param map
* @param baseView
* @param callBack
*/
public void getExceptionData(Map<String, String> map, final BaseView baseView, final RxDataCallBack<List<ExceptionRecordBean>> callBack) {
ApiManager.getInstance().post(URLBuilder.GET_EXCEPTION_RECORD, map, new ChildHttpResultSubscriber<List<ExceptionRecordBean>>(baseView, ExceptionRecordBean.class) {
@Override
public void _onSuccess(List<ExceptionRecordBean> exceptionRecordBeans) {
callBack.onSucess(exceptionRecordBeans);
baseView.hideLoadingDialog();
}
@Override
public void _showLoadingDialog(String message) {
baseView.showLoadingDialog(message);
}
@Override
protected void _onErrorChild(int code, String error, Throwable e) {
baseView.hideLoadingDialog();
callBack.onFail();
}
});
}
/**
*根据异常输出记录id查询异常输出记录详情
* @param map
* @param baseView
* @param callBack
*/
public void getExceptionDetailData(Map<String, String> map, final BaseView baseView, final RxDataCallBack<List<ExceptionDetailBean>> callBack) {
ApiManager.getInstance().post(URLBuilder.GET_EXCEPTION_RECORD_DETAIL, map, new ChildHttpResultSubscriber<List<ExceptionDetailBean>>(baseView, ExceptionDetailBean.class) {
@Override
public void _onSuccess(List<ExceptionDetailBean> exceptionRecordBeans) {
callBack.onSucess(exceptionRecordBeans);
baseView.hideLoadingDialog();
}
@Override
public void _showLoadingDialog(String message) {
baseView.showLoadingDialog(message);
}
@Override
protected void _onErrorChild(int code, String error, Throwable e) {
baseView.hideLoadingDialog();
callBack.onFail();
}
});
}
/**
*根据异常输出记录id查询异常输出打印信息
* @param map
* @param baseView
* @param callBack
*/
public void getExceptionPrintData(Map<String, String> map, final BaseView baseView, final RxDataCallBack<ExceptionPrintBean> callBack) {
ApiManager.getInstance().post(URLBuilder.GET_EXCEPTION_RECORD_INFO, map, new ChildHttpResultSubscriber<ExceptionPrintBean>(baseView, ExceptionPrintBean.class) {
@Override
public void _onSuccess(ExceptionPrintBean exceptionRecordBeans) {
callBack.onSucess(exceptionRecordBeans);
baseView.hideLoadingDialog();
}
@Override
public void _showLoadingDialog(String message) {
baseView.showLoadingDialog(message);
}
@Override
protected void _onErrorChild(int code, String error, Throwable e) {
baseView.hideLoadingDialog();
callBack.onFail();
}
});
}
/**
*保存异常输出信息
* @param map
* @param baseView
* @param callBack
*/
public void getExceptionOutData(Map<String, String> map, final BaseView baseView, final RxDataCallBack<ExceptionOutBean> callBack) {
ApiManager.getInstance().post(URLBuilder.SAVE_EXCEPTION_RECORD_OUT, map, new ChildHttpResultSubscriber<ExceptionOutBean>(baseView, ExceptionOutBean.class) {
@Override
public void _onSuccess(ExceptionOutBean exceptionRecordBeans) {
callBack.onSucess(exceptionRecordBeans);
baseView.hideLoadingDialog();
}
@Override
public void _showLoadingDialog(String message) {
baseView.showLoadingDialog(message);
}
@Override
protected void _onErrorChild(int code, String error, Throwable e) {
baseView.hideLoadingDialog();
callBack.onFail();
}
});
}
}
| [
"zhangxiaoping@xiyun.com.cn"
] | zhangxiaoping@xiyun.com.cn |
bd40ff01d2fb8889c29413290a7fe646ee14bce0 | 7f99070ed0b2828a47366c43c9c923368b947257 | /Seminar_9-Proxy/src/ro/ase/csie/cts/dp/proxy/ModulLogin.java | 68bb61194e26c25b88bb29a325f2744ef8f1a857 | [] | no_license | stirbuarina/CTS_Laborator_2020-2021 | 94ef772d673b1c4173d07e342ad7d8cc90eeaa50 | b3eebcdc4d448304f59d33ad00d6eef88d28f1fc | refs/heads/main | 2023-05-06T19:30:25.612680 | 2021-06-03T10:27:55 | 2021-06-03T10:27:55 | 342,592,035 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 424 | java | package ro.ase.csie.cts.dp.proxy;
public class ModulLogin implements InterfataLogin {
String ipServer;
public ModulLogin(String ipServer) {
super();
this.ipServer = ipServer;
}
@Override
public boolean login(String user, String pass) {
if(user.equals("admin") && pass.equals("root1234"))
return true;
else
return false;
}
@Override
public boolean verificaStatusServer() {
return true;
}
}
| [
"stirb@DESKTOP-0QGEL19"
] | stirb@DESKTOP-0QGEL19 |
8ec60869fffa92489d48a8fd48ba5a2840b416ba | aa99fc0f1e01104ea662f4d53e15e433a39c0208 | /COMP 1510 Assignment 2/src/q2/CylinderStats.java | 6225b9e25df4a255d9beed36c8e27bfe1b10dea0 | [] | no_license | hawawa/COMP-1510-Java | cc13a6c27baadd2635bacb57d941723d202a6867 | 2382dc31bb0b7f12db4c30c8f28807d379916635 | refs/heads/master | 2021-05-03T14:15:58.041698 | 2018-02-06T20:36:35 | 2018-02-06T20:36:35 | 120,520,830 | 1 | 5 | null | null | null | null | UTF-8 | Java | false | false | 1,236 | java | package q2;
import java.util.Scanner;
import java.text.DecimalFormat;
/**
* <p>
* Creates a cylinder.
* </p>
*
* @author Chih-Hsi Chang
* @version 1.0
*/
public class CylinderStats {
/**
* <p>This is the main method (entry point) that gets called by the JVM.</p>
*
* @param args command line arguments.
*/
public static void main(String[] args) {
Scanner scan = new Scanner(System.in);
DecimalFormat fmt = new DecimalFormat("0.####");
double radius;
double height;
double surfaceArea;
double volume;
System.out.println("Please enter the radius of the cylinder:");
radius = scan.nextDouble();
System.out.println("Please enter the height of the cylinder:");
height = scan.nextDouble();
surfaceArea = 2 * Math.PI * radius * (radius + height);
volume = Math.PI * Math.pow(radius, 2) * height;
System.out.println("The surface area of the cylinder is "
+ fmt.format(surfaceArea) + ".");
System.out.println("The volume of the cylinder is "
+ fmt.format(volume) + ".");
System.out.println("Question two was called and ran sucessfully.");
scan.close();
}
};
| [
"cchang189@my.bcit.ca"
] | cchang189@my.bcit.ca |
f34998d1a340af6de6958ab64f165ede2c6729d6 | 2ecc3668007650cd584a8e8a2a9df380b88f1263 | /PersonalExpenses/app/src/test/java/ggc/com/personalexpenses/ExampleUnitTest.java | c8a6ff2880bf2f3519ed05207954db1f351d86c4 | [] | no_license | guchait995/Personal_Expense_Manager | 8a81fdbac9cae076f4522118361d22d43ea1d931 | 725541f639acb1a1de81b2350336617d999f3506 | refs/heads/master | 2021-01-21T23:21:01.111051 | 2017-06-23T15:59:15 | 2017-06-23T15:59:15 | 95,233,221 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 402 | java | package ggc.com.personalexpenses;
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);
}
} | [
"guchaitsourav@gmail.com"
] | guchaitsourav@gmail.com |
34750bcd53e3b896374701a434803d9b4b845da8 | 4b52dae65488a52be5e01b14ca4602b5510f9f12 | /src/main/java/com/llj/mududataprocess/procecss/DataProcessChain.java | 5853e2be8d0fdcc38d2355f52fcca19cd69c4d1e | [] | no_license | GreenHaaaa/mudu | c66474e0691b969210f964a146f3ec04209364ec | da0261db4902adbe585c4d4a66afbe68d3574663 | refs/heads/master | 2020-04-09T04:45:41.394861 | 2018-12-02T10:23:36 | 2018-12-02T10:26:23 | 160,035,370 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,060 | java | package com.llj.mududataprocess.procecss;
import java.util.List;
public class DataProcessChain implements DataProcessor.Chain {
private int index;
private List<DataProcessor> processors;
private DataProcessRequest dataProcessRequest;
public DataProcessChain(int index, List<DataProcessor> processors, DataProcessRequest dataProcessRequest) {
this.index = index;
this.processors = processors;
this.dataProcessRequest = dataProcessRequest;
}
@Override
public DataProcessRequest request() {
return dataProcessRequest;
}
@Override
public DataProcessResult proceed(DataProcessRequest request) {
DataProcessResult proceed = new DataProcessResult();
proceed.setList(request.getData());
if (processors.size() > index) {
DataProcessChain realChain = new DataProcessChain(index+1,processors, request);
DataProcessor processor = processors.get(index);
proceed = processor.process(realChain);
}
return proceed;
}
}
| [
"1335033346@qq.com"
] | 1335033346@qq.com |
349742cb1ac34f471c557058a4dbbc61cf6bf932 | f947f6d79289f58259026b1e0921db4863f26f88 | /tsp-plugin/src/main/java/com/sunyard/frameworkset/plugin/tsp/manager/dao/JobServerConfigDao.java | 8bff189de64053c5e8578e67ef8deb37de9fb5fb | [] | no_license | OneTwoLiuLiuLiu/tsp | a34efc897e637cad65f43af7303464c8bcb4370c | f51bc5e435c5a858bbf32d1b50693a5a0cd22019 | refs/heads/master | 2021-04-05T23:38:57.617128 | 2018-03-12T06:13:47 | 2018-03-12T06:13:47 | 124,837,623 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 854 | java | package com.sunyard.frameworkset.plugin.tsp.manager.dao;
import com.sunyard.frameworkset.core.dao.BaseDao;
import com.sunyard.frameworkset.plugin.tsp.manager.entity.JobServerConfig;
import com.sunyard.frameworkset.plugin.tsp.manager.qo.JobServerConfigQo;
import java.util.List;
/**
* Write class comments here
* *
* User: jl
* Date: 2016/12/29 0029 上午 10:09
* version $Id: JpaJobServerConfig.java, v 0.1 Exp $
*/
public interface JobServerConfigDao extends BaseDao<JobServerConfig,String,JobServerConfigQo>{
/**
* 根据 hostName查找
* @param hostName
* @return
*/
JobServerConfig findByHostName(String hostName);
/**
* 根据可执行任务类型查找处于运行状态的JobServer
* @param jobType
* @return
*/
List<JobServerConfig> findActiveServerByJobType(String jobType);
}
| [
"OneTwoLiuLiuLiu@github.com"
] | OneTwoLiuLiuLiu@github.com |
093e39a96d393e366235101708967cf784f806fe | 034f0cd1fbcc219c5b95b51e6847b412671155cc | /src/main/java/com/elf/core/persistence/BaseEntity.java | bf0f9f86e5a945a98ce9ae44b1ad459d717ec654 | [] | no_license | iamlake/ELF2 | 8aa7f09853c97f3adbeed4ffa9538b411fabcda4 | ab1ec2fd98b9f8f4bedfd87f04a94c98fdc617ff | refs/heads/master | 2021-04-27T03:56:44.879105 | 2018-06-04T07:19:14 | 2018-06-04T07:19:14 | 122,722,505 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 850 | java | package com.elf.core.persistence;
import com.baomidou.mybatisplus.annotations.TableField;
import java.io.Serializable;
/**
* @Title: BaseEntity
* @Description: Entity支持类
* @Author:李一鸣(liyiming.neu@neusoft.com)
* @Date:2017年11月12日
*/
public abstract class BaseEntity implements Serializable {
/**
* @Description: 新增标识
* @Author:李一鸣(liyiming.neu@neusoft.com)
* @Date:2017年11月12日
*/
@TableField(exist = false)
protected boolean isNew = false;
public boolean getIsNew() {
return isNew;
}
public void setIsNew(boolean isNew) {
this.isNew = isNew;
}
/**
* @Description: serialVersionUID
* @Author:李一鸣(liyiming.neu@neusoft.com)
* @Date:2017年11月12日
*/
private static final long serialVersionUID = 1L;
}
| [
"iamlake@qq.com"
] | iamlake@qq.com |
58edb028c890ac776f2a0bd2def5aedc5fd6df3d | a5583d81500c5e309517682ab1ea4ebce2175c78 | /src/main/java/com/cad/poidocx/entity/city/template1/Template1_AreaAlarmInfo_ImportantVehicleAlarmRankingInfosSum.java | 3a49f710d54bbf2d757c8672ae72d424addbc37c | [] | no_license | liushuangqwe1117/poi-doc | b085f3a112ca60d7af52bbcf06ef23791837fc47 | c354dd070b027cd4afdd336cec4c11af54725b42 | refs/heads/master | 2022-12-19T18:34:49.639290 | 2020-07-24T07:43:45 | 2020-07-24T07:43:45 | 148,470,647 | 0 | 0 | null | 2022-12-16T06:51:26 | 2018-09-12T11:38:01 | Java | UTF-8 | Java | false | false | 980 | java | package com.cad.poidocx.entity.city.template1;
/**
* Created by LS on 2018/9/7 0007.
*/
public class Template1_AreaAlarmInfo_ImportantVehicleAlarmRankingInfosSum {
/**
* 661 (报警车辆数)
*/
private String vehilceNumber;
/**
* 2226 (报警次数)
*/
private String alarmNumber;
/**
* 3.37 (报警均值 = 报警次数 / 报警车辆数)
*/
private String avgAlarmNumber;
public String getVehilceNumber() {
return vehilceNumber;
}
public void setVehilceNumber(String vehilceNumber) {
this.vehilceNumber = vehilceNumber;
}
public String getAlarmNumber() {
return alarmNumber;
}
public void setAlarmNumber(String alarmNumber) {
this.alarmNumber = alarmNumber;
}
public String getAvgAlarmNumber() {
return avgAlarmNumber;
}
public void setAvgAlarmNumber(String avgAlarmNumber) {
this.avgAlarmNumber = avgAlarmNumber;
}
}
| [
"liushuangqwe1117@163.com"
] | liushuangqwe1117@163.com |
311018806cca7993684c1c4675808327371c398b | f2aa35754896638ac8230cb78d3620a77c76db00 | /app/src/main/java/com/shrikanthravi/alwaysondisplay/LockscreenIntentReceiver.java | ba99b27b13aefa4913c3e28fa73df1923c141469 | [
"MIT"
] | permissive | lukeisontheroad/Always-On-Display | 85adc20de74c517a0607a3e8dd978e603e4e2601 | 2b1c9ee6e6e7e8650e9aa9adfbdb8fb6fa67cf72 | refs/heads/master | 2021-09-07T04:18:44.846964 | 2018-02-17T10:03:58 | 2018-02-17T10:03:58 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 959 | java | package com.shrikanthravi.alwaysondisplay;
import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
/**
* Created by shrikanthravi on 07/11/17.
*/
public class LockscreenIntentReceiver extends BroadcastReceiver {
// Handle actions and display Lockscreen
@Override
public void onReceive(Context context, Intent intent) {
if (intent.getAction().equals(Intent.ACTION_SCREEN_OFF)
|| intent.getAction().equals(Intent.ACTION_SCREEN_ON)
|| intent.getAction().equals(Intent.ACTION_BOOT_COMPLETED)) {
System.out.println("service intent");
start_lockscreen(context);
}
}
// Display lock screen
private void start_lockscreen(Context context) {
Intent mIntent = new Intent(context, MainActivity.class);
mIntent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
context.startActivity(mIntent);
}
}
| [
"shrikanth7698@gmail.com"
] | shrikanth7698@gmail.com |
938db3184ded912b01a9be533a6ff7b1e915c2c7 | 8482bc8235e884a75258f9a76732f798de603013 | /app/src/main/java/com/hjt/phoneshow/util/DiskLruCache.java | 1729077e1a086bc44c7684185065625626f2f05a | [] | no_license | ChairmanHe/MyPhoneShow | b9bc4ed7f5b2b7e8c2e530515ed0c908f640293e | ad567a4459f64fe970bc8ae07c19eff5eb668c29 | refs/heads/master | 2021-01-19T12:47:36.587233 | 2017-03-25T07:44:59 | 2017-03-25T07:44:59 | 82,363,375 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 33,894 | java | /*
* Copyright (C) 2011 The Android Open Source Project
*
* 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 com.hjt.phoneshow.util;
import java.io.BufferedInputStream;
import java.io.BufferedWriter;
import java.io.Closeable;
import java.io.EOFException;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.FileWriter;
import java.io.FilterOutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.OutputStream;
import java.io.OutputStreamWriter;
import java.io.Reader;
import java.io.StringWriter;
import java.io.Writer;
import java.lang.reflect.Array;
import java.nio.charset.Charset;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Iterator;
import java.util.LinkedHashMap;
import java.util.Map;
import java.util.concurrent.Callable;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.LinkedBlockingQueue;
import java.util.concurrent.ThreadPoolExecutor;
import java.util.concurrent.TimeUnit;
/**
******************************************************************************
* Taken from the JB source code, can be found in:
* libcore/luni/src/main/java/libcore/io/DiskLruCache.java
* or direct link:
* https://android.googlesource.com/platform/libcore/+/android-4.1.1_r1/luni/src/main/java/libcore/io/DiskLruCache.java
******************************************************************************
*
* A cache that uses a bounded amount of space on a filesystem. Each cache
* entry has a string key and a fixed number of values. Values are byte
* sequences, accessible as streams or files. Each value must be between {@code
* 0} and {@code Integer.MAX_VALUE} bytes in length.
*
* <p>The cache stores its data in a directory on the filesystem. This
* directory must be exclusive to the cache; the cache may delete or overwrite
* files from its directory. It is an error for multiple processes to use the
* same cache directory at the same time.
*
* <p>This cache limits the number of bytes that it will store on the
* filesystem. When the number of stored bytes exceeds the limit, the cache will
* remove entries in the background until the limit is satisfied. The limit is
* not strict: the cache may temporarily exceed it while waiting for files to be
* deleted. The limit does not include filesystem overhead or the cache
* journal so space-sensitive applications should set a conservative limit.
*
* <p>Clients call {@link #edit} to create or update the values of an entry. An
* entry may have only one editor at one time; if a value is not available to be
* edited then {@link #edit} will return null.
* <ul>
* <li>When an entry is being <strong>created</strong> it is necessary to
* supply a full set of values; the empty value should be used as a
* placeholder if necessary.
* <li>When an entry is being <strong>edited</strong>, it is not necessary
* to supply data for every value; values default to their previous
* value.
* </ul>
* Every {@link #edit} call must be matched by a call to {@link Editor#commit}
* or {@link Editor#abort}. Committing is atomic: a read observes the full set
* of values as they were before or after the commit, but never a mix of values.
*
* <p>Clients call {@link #get} to read a snapshot of an entry. The read will
* observe the value at the time that {@link #get} was called. Updates and
* removals after the call do not impact ongoing reads.
*
* <p>This class is tolerant of some I/O errors. If files are missing from the
* filesystem, the corresponding entries will be dropped from the cache. If
* an error occurs while writing a cache value, the edit will fail silently.
* Callers should handle other problems by catching {@code IOException} and
* responding appropriately.
*/
public final class DiskLruCache implements Closeable {
static final String JOURNAL_FILE = "journal";
static final String JOURNAL_FILE_TMP = "journal.tmp";
static final String MAGIC = "libcore.io.DiskLruCache";
static final String VERSION_1 = "1";
static final long ANY_SEQUENCE_NUMBER = -1;
private static final String CLEAN = "CLEAN";
private static final String DIRTY = "DIRTY";
private static final String REMOVE = "REMOVE";
private static final String READ = "READ";
private static final Charset UTF_8 = Charset.forName("UTF-8");
private static final int IO_BUFFER_SIZE = 8 * 1024;
/*
* This cache uses a journal file named "journal". A typical journal file
* looks like this:
* libcore.io.DiskLruCache
* 1
* 100
* 2
*
* CLEAN 3400330d1dfc7f3f7f4b8d4d803dfcf6 832 21054
* DIRTY 335c4c6028171cfddfbaae1a9c313c52
* CLEAN 335c4c6028171cfddfbaae1a9c313c52 3934 2342
* REMOVE 335c4c6028171cfddfbaae1a9c313c52
* DIRTY 1ab96a171faeeee38496d8b330771a7a
* CLEAN 1ab96a171faeeee38496d8b330771a7a 1600 234
* READ 335c4c6028171cfddfbaae1a9c313c52
* READ 3400330d1dfc7f3f7f4b8d4d803dfcf6
*
* The first five lines of the journal form its header. They are the
* constant string "libcore.io.DiskLruCache", the disk cache's version,
* the application's version, the value count, and a blank line.
*
* Each of the subsequent lines in the file is a record of the state of a
* cache entry. Each line contains space-separated values: a state, a key,
* and optional state-specific values.
* o DIRTY lines track that an entry is actively being created or updated.
* Every successful DIRTY action should be followed by a CLEAN or REMOVE
* action. DIRTY lines without a matching CLEAN or REMOVE indicate that
* temporary files may need to be deleted.
* o CLEAN lines track a cache entry that has been successfully published
* and may be read. A publish line is followed by the lengths of each of
* its values.
* o READ lines track accesses for LRU.
* o REMOVE lines track entries that have been deleted.
*
* The journal file is appended to as cache operations occur. The journal may
* occasionally be compacted by dropping redundant lines. A temporary file named
* "journal.tmp" will be used during compaction; that file should be deleted if
* it exists when the cache is opened.
*/
private final File directory;
private final File journalFile;
private final File journalFileTmp;
private final int appVersion;
private final long maxSize;
private final int valueCount;
private long size = 0;
private Writer journalWriter;
private final LinkedHashMap<String, Entry> lruEntries
= new LinkedHashMap<String, Entry>(0, 0.75f, true);
private int redundantOpCount;
/**
* To differentiate between old and current snapshots, each entry is given
* a sequence number each time an edit is committed. A snapshot is stale if
* its sequence number is not equal to its entry's sequence number.
*/
private long nextSequenceNumber = 0;
/* From java.util.Arrays */
@SuppressWarnings("unchecked")
private static <T> T[] copyOfRange(T[] original, int start, int end) {
final int originalLength = original.length; // For exception priority compatibility.
if (start > end) {
throw new IllegalArgumentException();
}
if (start < 0 || start > originalLength) {
throw new ArrayIndexOutOfBoundsException();
}
final int resultLength = end - start;
final int copyLength = Math.min(resultLength, originalLength - start);
final T[] result = (T[]) Array
.newInstance(original.getClass().getComponentType(), resultLength);
System.arraycopy(original, start, result, 0, copyLength);
return result;
}
/**
* Returns the remainder of 'reader' as a string, closing it when done.
*/
public static String readFully(Reader reader) throws IOException {
try {
StringWriter writer = new StringWriter();
char[] buffer = new char[1024];
int count;
while ((count = reader.read(buffer)) != -1) {
writer.write(buffer, 0, count);
}
return writer.toString();
} finally {
reader.close();
}
}
/**
* Returns the ASCII characters up to but not including the next "\r\n", or
* "\n".
*
* @throws EOFException if the stream is exhausted before the next newline
* character.
*/
public static String readAsciiLine(InputStream in) throws IOException {
// TODO: support UTF-8 here instead
StringBuilder result = new StringBuilder(80);
while (true) {
int c = in.read();
if (c == -1) {
throw new EOFException();
} else if (c == '\n') {
break;
}
result.append((char) c);
}
int length = result.length();
if (length > 0 && result.charAt(length - 1) == '\r') {
result.setLength(length - 1);
}
return result.toString();
}
/**
* Closes 'closeable', ignoring any checked exceptions. Does nothing if 'closeable' is null.
*/
public static void closeQuietly(Closeable closeable) {
if (closeable != null) {
try {
closeable.close();
} catch (RuntimeException rethrown) {
throw rethrown;
} catch (Exception ignored) {
}
}
}
/**
* Recursively delete everything in {@code dir}.
*/
// TODO: this should specify paths as Strings rather than as Files
public static void deleteContents(File dir) throws IOException {
File[] files = dir.listFiles();
if (files == null) {
throw new IllegalArgumentException("not a directory: " + dir);
}
for (File file : files) {
if (file.isDirectory()) {
deleteContents(file);
}
if (!file.delete()) {
throw new IOException("failed to delete file: " + file);
}
}
}
/** This cache uses a single background thread to evict entries. */
private final ExecutorService executorService = new ThreadPoolExecutor(0, 1,
60L, TimeUnit.SECONDS, new LinkedBlockingQueue<Runnable>());
private final Callable<Void> cleanupCallable = new Callable<Void>() {
@Override public Void call() throws Exception {
synchronized (DiskLruCache.this) {
if (journalWriter == null) {
return null; // closed
}
trimToSize();
if (journalRebuildRequired()) {
rebuildJournal();
redundantOpCount = 0;
}
}
return null;
}
};
private DiskLruCache(File directory, int appVersion, int valueCount, long maxSize) {
this.directory = directory;
this.appVersion = appVersion;
this.journalFile = new File(directory, JOURNAL_FILE);
this.journalFileTmp = new File(directory, JOURNAL_FILE_TMP);
this.valueCount = valueCount;
this.maxSize = maxSize;
}
/**
* Opens the cache in {@code directory}, creating a cache if none exists
* there.
*
* @param directory a writable directory
* @param appVersion
* @param valueCount the number of values per cache entry. Must be positive.
* @param maxSize the maximum number of bytes this cache should use to store
* @throws IOException if reading or writing the cache directory fails
*/
public static DiskLruCache open(File directory, int appVersion, int valueCount, long maxSize)
throws IOException {
if (maxSize <= 0) {
throw new IllegalArgumentException("maxSize <= 0");
}
if (valueCount <= 0) {
throw new IllegalArgumentException("valueCount <= 0");
}
// prefer to pick up where we left off
DiskLruCache cache = new DiskLruCache(directory, appVersion, valueCount, maxSize);
if (cache.journalFile.exists()) {
try {
cache.readJournal();
cache.processJournal();
cache.journalWriter = new BufferedWriter(new FileWriter(cache.journalFile, true),
IO_BUFFER_SIZE);
return cache;
} catch (IOException journalIsCorrupt) {
// System.logW("DiskLruCache " + directory + " is corrupt: "
// + journalIsCorrupt.getMessage() + ", removing");
cache.delete();
}
}
// create a new empty cache
directory.mkdirs();
cache = new DiskLruCache(directory, appVersion, valueCount, maxSize);
cache.rebuildJournal();
return cache;
}
private void readJournal() throws IOException {
InputStream in = new BufferedInputStream(new FileInputStream(journalFile), IO_BUFFER_SIZE);
try {
String magic = readAsciiLine(in);
String version = readAsciiLine(in);
String appVersionString = readAsciiLine(in);
String valueCountString = readAsciiLine(in);
String blank = readAsciiLine(in);
if (!MAGIC.equals(magic)
|| !VERSION_1.equals(version)
|| !Integer.toString(appVersion).equals(appVersionString)
|| !Integer.toString(valueCount).equals(valueCountString)
|| !"".equals(blank)) {
throw new IOException("unexpected journal header: ["
+ magic + ", " + version + ", " + valueCountString + ", " + blank + "]");
}
while (true) {
try {
readJournalLine(readAsciiLine(in));
} catch (EOFException endOfJournal) {
break;
}
}
} finally {
closeQuietly(in);
}
}
private void readJournalLine(String line) throws IOException {
String[] parts = line.split(" ");
if (parts.length < 2) {
throw new IOException("unexpected journal line: " + line);
}
String key = parts[1];
if (parts[0].equals(REMOVE) && parts.length == 2) {
lruEntries.remove(key);
return;
}
Entry entry = lruEntries.get(key);
if (entry == null) {
entry = new Entry(key);
lruEntries.put(key, entry);
}
if (parts[0].equals(CLEAN) && parts.length == 2 + valueCount) {
entry.readable = true;
entry.currentEditor = null;
entry.setLengths(copyOfRange(parts, 2, parts.length));
} else if (parts[0].equals(DIRTY) && parts.length == 2) {
entry.currentEditor = new Editor(entry);
} else if (parts[0].equals(READ) && parts.length == 2) {
// this work was already done by calling lruEntries.get()
} else {
throw new IOException("unexpected journal line: " + line);
}
}
/**
* Computes the initial size and collects garbage as a part of opening the
* cache. Dirty entries are assumed to be inconsistent and will be deleted.
*/
private void processJournal() throws IOException {
deleteIfExists(journalFileTmp);
for (Iterator<Entry> i = lruEntries.values().iterator(); i.hasNext(); ) {
Entry entry = i.next();
if (entry.currentEditor == null) {
for (int t = 0; t < valueCount; t++) {
size += entry.lengths[t];
}
} else {
entry.currentEditor = null;
for (int t = 0; t < valueCount; t++) {
deleteIfExists(entry.getCleanFile(t));
deleteIfExists(entry.getDirtyFile(t));
}
i.remove();
}
}
}
/**
* Creates a new journal that omits redundant information. This replaces the
* current journal if it exists.
*/
private synchronized void rebuildJournal() throws IOException {
if (journalWriter != null) {
journalWriter.close();
}
Writer writer = new BufferedWriter(new FileWriter(journalFileTmp), IO_BUFFER_SIZE);
writer.write(MAGIC);
writer.write("\n");
writer.write(VERSION_1);
writer.write("\n");
writer.write(Integer.toString(appVersion));
writer.write("\n");
writer.write(Integer.toString(valueCount));
writer.write("\n");
writer.write("\n");
for (Entry entry : lruEntries.values()) {
if (entry.currentEditor != null) {
writer.write(DIRTY + ' ' + entry.key + '\n');
} else {
writer.write(CLEAN + ' ' + entry.key + entry.getLengths() + '\n');
}
}
writer.close();
journalFileTmp.renameTo(journalFile);
journalWriter = new BufferedWriter(new FileWriter(journalFile, true), IO_BUFFER_SIZE);
}
private static void deleteIfExists(File file) throws IOException {
// try {
// Libcore.os.remove(file.getPath());
// } catch (ErrnoException errnoException) {
// if (errnoException.errno != OsConstants.ENOENT) {
// throw errnoException.rethrowAsIOException();
// }
// }
if (file.exists() && !file.delete()) {
throw new IOException();
}
}
/**
* Returns a snapshot of the entry named {@code key}, or null if it doesn't
* exist is not currently readable. If a value is returned, it is moved to
* the head of the LRU queue.
*/
public synchronized Snapshot get(String key) throws IOException {
checkNotClosed();
validateKey(key);
Entry entry = lruEntries.get(key);
if (entry == null) {
return null;
}
if (!entry.readable) {
return null;
}
/*
* Open all streams eagerly to guarantee that we see a single published
* snapshot. If we opened streams lazily then the streams could come
* from different edits.
*/
InputStream[] ins = new InputStream[valueCount];
try {
for (int i = 0; i < valueCount; i++) {
ins[i] = new FileInputStream(entry.getCleanFile(i));
}
} catch (FileNotFoundException e) {
// a file must have been deleted manually!
return null;
}
redundantOpCount++;
journalWriter.append(READ + ' ' + key + '\n');
if (journalRebuildRequired()) {
executorService.submit(cleanupCallable);
}
return new Snapshot(key, entry.sequenceNumber, ins);
}
/**
* Returns an editor for the entry named {@code key}, or null if another
* edit is in progress.
*/
public Editor edit(String key) throws IOException {
return edit(key, ANY_SEQUENCE_NUMBER);
}
private synchronized Editor edit(String key, long expectedSequenceNumber) throws IOException {
checkNotClosed();
validateKey(key);
Entry entry = lruEntries.get(key);
if (expectedSequenceNumber != ANY_SEQUENCE_NUMBER
&& (entry == null || entry.sequenceNumber != expectedSequenceNumber)) {
return null; // snapshot is stale
}
if (entry == null) {
entry = new Entry(key);
lruEntries.put(key, entry);
} else if (entry.currentEditor != null) {
return null; // another edit is in progress
}
Editor editor = new Editor(entry);
entry.currentEditor = editor;
// flush the journal before creating files to prevent file leaks
journalWriter.write(DIRTY + ' ' + key + '\n');
journalWriter.flush();
return editor;
}
/**
* Returns the directory where this cache stores its data.
*/
public File getDirectory() {
return directory;
}
/**
* Returns the maximum number of bytes that this cache should use to store
* its data.
*/
public long maxSize() {
return maxSize;
}
/**
* Returns the number of bytes currently being used to store the values in
* this cache. This may be greater than the max size if a background
* deletion is pending.
*/
public synchronized long size() {
return size;
}
private synchronized void completeEdit(Editor editor, boolean success) throws IOException {
Entry entry = editor.entry;
if (entry.currentEditor != editor) {
throw new IllegalStateException();
}
// if this edit is creating the entry for the first time, every index must have a value
if (success && !entry.readable) {
for (int i = 0; i < valueCount; i++) {
if (!entry.getDirtyFile(i).exists()) {
editor.abort();
throw new IllegalStateException("edit didn't create file " + i);
}
}
}
for (int i = 0; i < valueCount; i++) {
File dirty = entry.getDirtyFile(i);
if (success) {
if (dirty.exists()) {
File clean = entry.getCleanFile(i);
dirty.renameTo(clean);
long oldLength = entry.lengths[i];
long newLength = clean.length();
entry.lengths[i] = newLength;
size = size - oldLength + newLength;
}
} else {
deleteIfExists(dirty);
}
}
redundantOpCount++;
entry.currentEditor = null;
if (entry.readable | success) {
entry.readable = true;
journalWriter.write(CLEAN + ' ' + entry.key + entry.getLengths() + '\n');
if (success) {
entry.sequenceNumber = nextSequenceNumber++;
}
} else {
lruEntries.remove(entry.key);
journalWriter.write(REMOVE + ' ' + entry.key + '\n');
}
if (size > maxSize || journalRebuildRequired()) {
executorService.submit(cleanupCallable);
}
}
/**
* We only rebuild the journal when it will halve the size of the journal
* and eliminate at least 2000 ops.
*/
private boolean journalRebuildRequired() {
final int REDUNDANT_OP_COMPACT_THRESHOLD = 2000;
return redundantOpCount >= REDUNDANT_OP_COMPACT_THRESHOLD
&& redundantOpCount >= lruEntries.size();
}
/**
* Drops the entry for {@code key} if it exists and can be removed. Entries
* actively being edited cannot be removed.
*
* @return true if an entry was removed.
*/
public synchronized boolean remove(String key) throws IOException {
checkNotClosed();
validateKey(key);
Entry entry = lruEntries.get(key);
if (entry == null || entry.currentEditor != null) {
return false;
}
for (int i = 0; i < valueCount; i++) {
File file = entry.getCleanFile(i);
if (!file.delete()) {
throw new IOException("failed to delete " + file);
}
size -= entry.lengths[i];
entry.lengths[i] = 0;
}
redundantOpCount++;
journalWriter.append(REMOVE + ' ' + key + '\n');
lruEntries.remove(key);
if (journalRebuildRequired()) {
executorService.submit(cleanupCallable);
}
return true;
}
/**
* Returns true if this cache has been closed.
*/
public boolean isClosed() {
return journalWriter == null;
}
private void checkNotClosed() {
if (journalWriter == null) {
throw new IllegalStateException("cache is closed");
}
}
/**
* Force buffered operations to the filesystem.
*/
public synchronized void flush() throws IOException {
checkNotClosed();
trimToSize();
journalWriter.flush();
}
/**
* Closes this cache. Stored values will remain on the filesystem.
*/
public synchronized void close() throws IOException {
if (journalWriter == null) {
return; // already closed
}
for (Entry entry : new ArrayList<Entry>(lruEntries.values())) {
if (entry.currentEditor != null) {
entry.currentEditor.abort();
}
}
trimToSize();
journalWriter.close();
journalWriter = null;
}
private void trimToSize() throws IOException {
while (size > maxSize) {
// Map.Entry<String, Entry> toEvict = lruEntries.eldest();
final Map.Entry<String, Entry> toEvict = lruEntries.entrySet().iterator().next();
remove(toEvict.getKey());
}
}
/**
* Closes the cache and deletes all of its stored values. This will delete
* all files in the cache directory including files that weren't created by
* the cache.
*/
public void delete() throws IOException {
close();
deleteContents(directory);
}
private void validateKey(String key) {
if (key.contains(" ") || key.contains("\n") || key.contains("\r")) {
throw new IllegalArgumentException(
"keys must not contain spaces or newlines: \"" + key + "\"");
}
}
private static String inputStreamToString(InputStream in) throws IOException {
return readFully(new InputStreamReader(in, UTF_8));
}
/**
* A snapshot of the values for an entry.
*/
public final class Snapshot implements Closeable {
private final String key;
private final long sequenceNumber;
private final InputStream[] ins;
private Snapshot(String key, long sequenceNumber, InputStream[] ins) {
this.key = key;
this.sequenceNumber = sequenceNumber;
this.ins = ins;
}
/**
* Returns an editor for this snapshot's entry, or null if either the
* entry has changed since this snapshot was created or if another edit
* is in progress.
*/
public Editor edit() throws IOException {
return DiskLruCache.this.edit(key, sequenceNumber);
}
/**
* Returns the unbuffered stream with the value for {@code index}.
*/
public InputStream getInputStream(int index) {
return ins[index];
}
/**
* Returns the string value for {@code index}.
*/
public String getString(int index) throws IOException {
return inputStreamToString(getInputStream(index));
}
@Override public void close() {
for (InputStream in : ins) {
closeQuietly(in);
}
}
}
/**
* Edits the values for an entry.
*/
public final class Editor {
private final Entry entry;
private boolean hasErrors;
private Editor(Entry entry) {
this.entry = entry;
}
/**
* Returns an unbuffered input stream to read the last committed value,
* or null if no value has been committed.
*/
public InputStream newInputStream(int index) throws IOException {
synchronized (DiskLruCache.this) {
if (entry.currentEditor != this) {
throw new IllegalStateException();
}
if (!entry.readable) {
return null;
}
return new FileInputStream(entry.getCleanFile(index));
}
}
/**
* Returns the last committed value as a string, or null if no value
* has been committed.
*/
public String getString(int index) throws IOException {
InputStream in = newInputStream(index);
return in != null ? inputStreamToString(in) : null;
}
/**
* Returns a new unbuffered output stream to write the value at
* {@code index}. If the underlying output stream encounters errors
* when writing to the filesystem, this edit will be aborted when
* {@link #commit} is called. The returned output stream does not throw
* IOExceptions.
*/
public OutputStream newOutputStream(int index) throws IOException {
synchronized (DiskLruCache.this) {
if (entry.currentEditor != this) {
throw new IllegalStateException();
}
return new FaultHidingOutputStream(new FileOutputStream(entry.getDirtyFile(index)));
}
}
/**
* Sets the value at {@code index} to {@code value}.
*/
public void set(int index, String value) throws IOException {
Writer writer = null;
try {
writer = new OutputStreamWriter(newOutputStream(index), UTF_8);
writer.write(value);
} finally {
closeQuietly(writer);
}
}
/**
* Commits this edit so it is visible to readers. This releases the
* edit lock so another edit may be started on the same key.
*/
public void commit() throws IOException {
if (hasErrors) {
completeEdit(this, false);
remove(entry.key); // the previous entry is stale
} else {
completeEdit(this, true);
}
}
/**
* Aborts this edit. This releases the edit lock so another edit may be
* started on the same key.
*/
public void abort() throws IOException {
completeEdit(this, false);
}
private class FaultHidingOutputStream extends FilterOutputStream {
private FaultHidingOutputStream(OutputStream out) {
super(out);
}
@Override public void write(int oneByte) {
try {
out.write(oneByte);
} catch (IOException e) {
hasErrors = true;
}
}
@Override public void write(byte[] buffer, int offset, int length) {
try {
out.write(buffer, offset, length);
} catch (IOException e) {
hasErrors = true;
}
}
@Override public void close() {
try {
out.close();
} catch (IOException e) {
hasErrors = true;
}
}
@Override public void flush() {
try {
out.flush();
} catch (IOException e) {
hasErrors = true;
}
}
}
}
private final class Entry {
private final String key;
/** Lengths of this entry's files. */
private final long[] lengths;
/** True if this entry has ever been published */
private boolean readable;
/** The ongoing edit or null if this entry is not being edited. */
private Editor currentEditor;
/** The sequence number of the most recently committed edit to this entry. */
private long sequenceNumber;
private Entry(String key) {
this.key = key;
this.lengths = new long[valueCount];
}
public String getLengths() throws IOException {
StringBuilder result = new StringBuilder();
for (long size : lengths) {
result.append(' ').append(size);
}
return result.toString();
}
/**
* Set lengths using decimal numbers like "10123".
*/
private void setLengths(String[] strings) throws IOException {
if (strings.length != valueCount) {
throw invalidLengths(strings);
}
try {
for (int i = 0; i < strings.length; i++) {
lengths[i] = Long.parseLong(strings[i]);
}
} catch (NumberFormatException e) {
throw invalidLengths(strings);
}
}
private IOException invalidLengths(String[] strings) throws IOException {
throw new IOException("unexpected journal line: " + Arrays.toString(strings));
}
public File getCleanFile(int i) {
return new File(directory, key + "." + i);
}
public File getDirtyFile(int i) {
return new File(directory, key + "." + i + ".tmp");
}
}
}
| [
"674487432@qq.com"
] | 674487432@qq.com |
78c7dd32ead44d51ecaa54aa097cc94db908675f | 728ba679aa508bc5b1943d1ef6a38716a0444a80 | /src/com/leetcode/array/TwoNonOverlappingSubArraysEachTargetSum2.java | 97fad6b1e20994426324cfe15765cd4e4f47a0bc | [] | no_license | eidofravi/JavaInterviewBookCoding | 3a729addf53cc0142f072ce3b96b74f229f47fcf | 507ef6e3c95c32d898686fa1ab50351b493302a0 | refs/heads/master | 2021-07-10T05:06:43.483440 | 2020-09-29T19:00:40 | 2020-09-29T19:00:40 | 200,144,297 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,945 | java | package com.leetcode.array;
public class TwoNonOverlappingSubArraysEachTargetSum2 {
public static void main(String[] args) {
//int arr[] = {5, 5, 4, 4, 5};
//int arr[] = {3,2,2,4,3};
// int arr[] = {3,1,1,1,5,1,2,1};
// int arr[] = {1, 2, 2, 3, 2, 6, 7, 2, 1, 4, 8}; //4
int arr[] = {1, 1, 1, 2, 2, 2, 4, 4};
int target = 6;
//int arr[] = {3, 1, 1, 1, 5, 1, 2, 1};
//int target = 3;
System.out.println(new TwoNonOverlappingSubArraysEachTargetSum2().minSumOfLengths(arr, target));
}
public int minSumOfLengths(int[] arr, int target) {
int firstIndex = 0;
int secondIndex = 0;
int firstArrLen = 0;
int secondArrLen = 0;
int sum = 0;
int count = 0;
while (secondIndex < arr.length) {
if (sum < target) {
sum = sum + arr[secondIndex];
count++;
if (sum < target) {
secondIndex++;
}
}
if (sum > target) {
sum = sum - arr[firstIndex];
count--;
if (sum > target) {
firstIndex++;
}
}
if (sum == target) {
if (firstArrLen == 0) {
firstArrLen = count;
} else if (secondArrLen == 0) {
secondArrLen = count;
} else if (secondArrLen > firstArrLen && secondArrLen > count) {
secondArrLen = count;
} else if (firstArrLen > secondArrLen && firstArrLen > count) {
firstArrLen = count;
}
secondIndex++;
firstIndex = secondIndex;
count = 0;
sum = 0;
}
}
return firstArrLen > 0 && secondArrLen > 0 ? firstArrLen + secondArrLen : -1;
}
}
| [
"ravi.kh123@gmail.com"
] | ravi.kh123@gmail.com |
c9e00c95999486ea2e9f95d6605c24b57d4335ac | 22214dbcdc62f5f000d7f1bafe2011c679d545e8 | /HW15-message-system/src/main/java/ru/otus/kushchenko/ms/model/PhoneDataSet.java | 1eda6062d83ec0a72f8658aa7528ba2d1aa89263 | [
"MIT"
] | permissive | ElenaKushchenko/otus-java-2017-06-kushchenko | bed617609fb4ffca030cb7cca8b63359d16aac01 | 3a02f2046e5b491e124e03aee217b34b33a05c07 | refs/heads/master | 2021-01-25T05:10:31.963241 | 2017-09-30T09:57:46 | 2017-09-30T09:57:46 | 93,519,485 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 411 | java | package ru.otus.kushchenko.ms.model;
import lombok.*;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Table;
@Getter
@Setter
@NoArgsConstructor
@AllArgsConstructor
@EqualsAndHashCode(callSuper = true)
@ToString(callSuper = true)
@Entity
@Table(name = "phones")
public class PhoneDataSet extends DataSet {
@Column(name = "number")
private String number;
}
| [
"kaname.aibyo@gmail.com"
] | kaname.aibyo@gmail.com |
b8636f03a6074de8d318ee94adeecbc6aaa3570d | 09a00394429e4bad33d18299358a54fcd395423d | /gradle/wrapper/dists/gradle-1.12-all/4ff8jj5a73a7zgj5nnzv1ubq0/gradle-1.12/src/launcher/org/gradle/tooling/internal/provider/ConfiguringBuildAction.java | dce07f0c8884da1670c2d4db3334779e2ce52a00 | [
"BSD-2-Clause",
"BSD-3-Clause",
"LicenseRef-scancode-unknown-license-reference",
"Apache-2.0",
"LGPL-2.1-or-later",
"MIT",
"CPL-1.0",
"LGPL-2.1-only"
] | permissive | agneske-arter-walter-mostertruck-firetr/pushfish-android | 35001c81ade9bb0392fda2907779c1d10d4824c0 | 09157e1d5d2e33a57b3def177cd9077cd5870b24 | refs/heads/master | 2021-12-02T21:13:04.281907 | 2021-10-18T21:48:59 | 2021-10-18T21:48:59 | 215,611,384 | 0 | 0 | BSD-2-Clause | 2019-10-16T17:58:05 | 2019-10-16T17:58:05 | null | UTF-8 | Java | false | false | 6,838 | java | /*
* Copyright 2011 the original author or authors.
*
* 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 org.gradle.tooling.internal.provider;
import org.gradle.StartParameter;
import org.gradle.api.logging.LogLevel;
import org.gradle.cli.CommandLineArgumentException;
import org.gradle.initialization.BuildAction;
import org.gradle.initialization.BuildController;
import org.gradle.initialization.DefaultCommandLineConverter;
import org.gradle.launcher.cli.converter.PropertiesToStartParameterConverter;
import org.gradle.tooling.internal.impl.LaunchableImplementation;
import org.gradle.tooling.internal.protocol.InternalLaunchable;
import org.gradle.tooling.internal.protocol.exceptions.InternalUnsupportedBuildArgumentException;
import org.gradle.tooling.internal.provider.connection.ProviderOperationParameters;
import org.gradle.tooling.model.UnsupportedMethodException;
import java.io.File;
import java.io.Serializable;
import java.util.ArrayList;
import java.util.Collections;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
class ConfiguringBuildAction<T> implements BuildAction<T>, Serializable {
private static List<InternalLaunchable> getLaunchables(ProviderOperationParameters parameters) {
try {
return parameters.getLaunchables();
} catch (UnsupportedMethodException ume) {
// older consumer version
return null;
}
}
private LogLevel buildLogLevel;
private List<String> arguments;
private List<String> tasks;
private List<InternalLaunchable> launchables;
private BuildAction<? extends T> action;
private File projectDirectory;
private File gradleUserHomeDir;
private Boolean searchUpwards;
private Map<String, String> properties = new HashMap<String, String>();
// Important that this is constructed on the client so that it has the right gradleHomeDir internally
private final StartParameter startParameterTemplate = new StartParameter();
public ConfiguringBuildAction() {}
public ConfiguringBuildAction(ProviderOperationParameters parameters, BuildAction<? extends T> action, Map<String, String> properties) {
this.properties.putAll(properties);
this.gradleUserHomeDir = parameters.getGradleUserHomeDir();
this.projectDirectory = parameters.getProjectDir();
this.searchUpwards = parameters.isSearchUpwards();
this.buildLogLevel = parameters.getBuildLogLevel();
this.arguments = parameters.getArguments(Collections.<String>emptyList());
this.tasks = parameters.getTasks();
this.launchables = getLaunchables(parameters);
this.action = action;
}
StartParameter configureStartParameter() {
return configureStartParameter(new PropertiesToStartParameterConverter());
}
StartParameter configureStartParameter(PropertiesToStartParameterConverter propertiesToStartParameterConverter) {
StartParameter startParameter = startParameterTemplate.newInstance();
startParameter.setProjectDir(projectDirectory);
if (gradleUserHomeDir != null) {
startParameter.setGradleUserHomeDir(gradleUserHomeDir);
}
if (launchables != null) {
List<String> allTasks = new ArrayList<String>();
String projectPath = null;
for (InternalLaunchable launchable : launchables) {
if (launchable instanceof LaunchableImplementation) {
LaunchableImplementation launchableImpl = (LaunchableImplementation) launchable;
allTasks.add(launchableImpl.getTaskName());
if (launchableImpl.getProjectPath() != null) {
if (projectPath != null && !projectPath.equals(launchableImpl.getProjectPath())) {
throw new InternalUnsupportedBuildArgumentException(
"Problem with provided launchable arguments: " + launchables + ". "
+ "\nOnly selector from the same Gradle project can be built."
);
}
projectPath = launchableImpl.getProjectPath();
}
} else {
throw new InternalUnsupportedBuildArgumentException(
"Problem with provided launchable arguments: " + launchables + ". "
+ "\nOnly objects from this provider can be built."
);
}
}
if (projectPath != null) {
startParameter.setProjectPath(projectPath);
}
startParameter.setTaskNames(allTasks);
} else if (tasks != null) {
startParameter.setTaskNames(tasks);
}
propertiesToStartParameterConverter.convert(properties, startParameter);
if (arguments != null) {
DefaultCommandLineConverter converter = new DefaultCommandLineConverter();
try {
converter.convert(arguments, startParameter);
} catch (CommandLineArgumentException e) {
throw new InternalUnsupportedBuildArgumentException(
"Problem with provided build arguments: " + arguments + ". "
+ "\n" + e.getMessage()
+ "\nEither it is not a valid build option or it is not supported in the target Gradle version."
+ "\nNot all of the Gradle command line options are supported build arguments."
+ "\nExamples of supported build arguments: '--info', '-u', '-p'."
+ "\nExamples of unsupported build options: '--daemon', '-?', '-v'."
+ "\nPlease find more information in the javadoc for the BuildLauncher class.", e);
}
}
if (searchUpwards != null) {
startParameter.setSearchUpwards(searchUpwards);
}
if (buildLogLevel != null) {
startParameter.setLogLevel(buildLogLevel);
}
return startParameter;
}
public T run(BuildController buildController) {
buildController.setStartParameter(configureStartParameter());
return action.run(buildController);
}
}
| [
"mega@ioexception.at"
] | mega@ioexception.at |
716e60e98c7aec4b9dd3cf2c88bb968090bec650 | f5b41dd40d39663ee18ddbdf3fb3d72b070acabb | /player/src/main/java/com/evistek/gallery/utils/CompatibilityChecker.java | d7df57f908ea2efe32366221a40eb4f99895fef5 | [] | no_license | wangqizhou/3D-APP | d2e0fe5e0cc742a267eee5144b20692742936659 | 9275f3d7e083dfaf912b705b331c691a7425ee67 | refs/heads/master | 2020-05-25T04:14:30.748502 | 2017-03-14T06:01:48 | 2017-03-14T06:01:48 | 84,910,392 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,111 | java | package com.evistek.gallery.utils;
import android.content.Context;
import android.content.DialogInterface;
import android.support.v7.app.AlertDialog;
import com.evistek.gallery.R;
/**
* Author: Weixiang Zhang
* Email: wxzhang@evistek.com
* Date: 2016/10/25.
*/
public class CompatibilityChecker {
public static boolean check(Context context) {
return true;
// PanelConfig.PanelDevice dev = PanelConfig.getInstance(context).findDevice();
// if (dev != null && !dev.getModel().equalsIgnoreCase("Dummy")) {
// return true;
// }
//
// return false;
}
public static void notifyDialog(Context context) {
AlertDialog.Builder builder = new AlertDialog.Builder(context);
builder.setMessage(R.string.compatibility_msg)
.setTitle(R.string.compatibility_title);
builder.setPositiveButton(R.string.ok, new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog, int id) {
}
});
AlertDialog dialog = builder.create();
dialog.show();
}
}
| [
"wqzhou0814@gmail.com"
] | wqzhou0814@gmail.com |
f79639127ba1b875ee55abc53effb3e8fc8c5583 | 0028ae642c9cd55e996ea0f05fd508b8956d0058 | /src/com/early/main/HttpServerTestDriver.java | 30fa47407373d995fae1732e6ad4645e74d1d8e6 | [] | no_license | earlywusa/DiyWebServices | a54e01f91d4c76cc58bcee35889d36fafcba9956 | 0ee0f924792c89133963c7567e84b6a8873035d2 | refs/heads/master | 2021-01-01T16:38:20.300349 | 2017-07-20T21:55:33 | 2017-07-20T21:55:33 | 97,879,857 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 550 | java | package com.early.main;
import java.lang.reflect.Method;
import java.util.List;
import com.early.http.servlet.api.annotation.UrlPath;
import com.early.http.servlet.api.util.UrlMappingScanner;
public class HttpServerTestDriver {
public static void main(String[] args) {
UrlMappingScanner scanner = UrlMappingScanner.getScanner();
List<Method> methods = scanner.findMethods(HttpServerTestDriver.class);
methods.forEach(System.out::println);
}
@UrlPath(value="/hello")
public String helloServlet() {
return "<h1>hello</h1>";
}
}
| [
"earliest@hotmail.com"
] | earliest@hotmail.com |
48a19c9851278d8e96bb266ff40d6e9dfd63ad4d | a55b85b6dd6a4ebf856b3fd80c9a424da2cd12bd | /orderloader/src/main/java/org/marketcetera/orderloader/system/EnumProcessor.java | f369b9e52fc49302c03bef98a347d1fb49ac8f44 | [] | no_license | jeffreymu/marketcetera-2.2.0-16652 | a384a42b2e404bcc6140119dd2c6d297d466596c | 81cdd34979492f839233552432f80b3606d0349f | refs/heads/master | 2021-12-02T11:18:01.399940 | 2013-08-09T14:36:21 | 2013-08-09T14:36:21 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,464 | java | package org.marketcetera.orderloader.system;
import org.marketcetera.util.misc.ClassVersion;
import org.marketcetera.util.log.I18NMessage2P;
import org.marketcetera.util.log.I18NBoundMessage2P;
import org.marketcetera.orderloader.OrderParsingException;
import java.util.EnumSet;
import java.util.Set;
/**
* Extracts enum value from an order row.
*
* @author anshul@marketcetera.com
* @version $Id: EnumProcessor.java 16154 2012-07-14 16:34:05Z colin $
* @since 1.0.0
*/
@ClassVersion("$Id: EnumProcessor.java 16154 2012-07-14 16:34:05Z colin $")
abstract class EnumProcessor<T extends Enum<T>>
extends IndexedProcessor {
/**
* Creates an instance.
*
* @param inClass the enum class handled by this instance.
* @param inDisallowedValue the enum value that is not allowed as a
* valid value.
* @param inErrorMessage the error message to display when the specified
* enum value is not valid.
* @param inIndex the column index of the index value in the order row.
*/
protected EnumProcessor(Class<T> inClass, T inDisallowedValue,
I18NMessage2P inErrorMessage, int inIndex) {
super(inIndex);
mClass = inClass;
mErrorMessage = inErrorMessage;
mValidValues = EnumSet.allOf(inClass);
mValidValues.remove(inDisallowedValue);
}
/**
* Extracts the enum value from the specified order row.
*
* @param inRow the order row.
*
* @return the enum value from the supplied row.
*
* @throws OrderParsingException if the value found in the row is not
* a valid enum value.
*/
protected T getEnumValue(String [] inRow) throws OrderParsingException {
String value = getValue(inRow);
if(value == null || value.isEmpty()) {
return null;
}
try {
T t = Enum.valueOf(mClass, getValue(inRow));
if(!mValidValues.contains(t)) {
throw new OrderParsingException(new I18NBoundMessage2P(
mErrorMessage, value, mValidValues.toString()));
}
return t;
} catch (IllegalArgumentException e) {
throw new OrderParsingException(e, new I18NBoundMessage2P(
mErrorMessage, value, mValidValues.toString()));
}
}
private final Set<T> mValidValues;
private final I18NMessage2P mErrorMessage;
private final Class<T> mClass;
}
| [
"vladimir_petrovich@yahoo.com"
] | vladimir_petrovich@yahoo.com |
d1ebe6e1075d89694fc4aa084092a852f3052e1a | e977c424543422f49a25695665eb85bfc0700784 | /benchmark/icse15/1298034/buggy-version/lucene/dev/trunk/lucene/core/src/test/org/apache/lucene/search/spans/TestSpans.java | 92b9caaea1f22ba0429c6289e7d171d909bcae0b | [] | no_license | amir9979/pattern-detector-experiment | 17fcb8934cef379fb96002450d11fac62e002dd3 | db67691e536e1550245e76d7d1c8dced181df496 | refs/heads/master | 2022-02-18T10:24:32.235975 | 2019-09-13T15:42:55 | 2019-09-13T15:42:55 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 17,469 | java | package org.apache.lucene.search.spans;
/**
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You 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.
*/
import org.apache.lucene.search.DocIdSetIterator;
import org.apache.lucene.search.Query;
import org.apache.lucene.search.CheckHits;
import org.apache.lucene.search.Scorer;
import org.apache.lucene.search.TermQuery;
import org.apache.lucene.search.IndexSearcher;
import org.apache.lucene.search.similarities.DefaultSimilarity;
import org.apache.lucene.search.similarities.Similarity;
import org.apache.lucene.store.Directory;
import org.apache.lucene.analysis.MockAnalyzer;
import org.apache.lucene.index.AtomicReaderContext;
import org.apache.lucene.index.IndexWriter;
import org.apache.lucene.index.IndexReader;
import org.apache.lucene.index.IndexWriterConfig;
import org.apache.lucene.index.RandomIndexWriter;
import org.apache.lucene.index.IndexReaderContext;
import org.apache.lucene.index.Term;
import org.apache.lucene.document.Document;
import org.apache.lucene.document.StringField;
import org.apache.lucene.document.TextField;
import org.apache.lucene.util.LuceneTestCase;
import org.apache.lucene.util.ReaderUtil;
import java.io.IOException;
public class TestSpans extends LuceneTestCase {
private IndexSearcher searcher;
private IndexReader reader;
private Directory directory;
public static final String field = "field";
@Override
public void setUp() throws Exception {
super.setUp();
directory = newDirectory();
RandomIndexWriter writer= new RandomIndexWriter(random, directory, newIndexWriterConfig(TEST_VERSION_CURRENT, new MockAnalyzer(random)).setMergePolicy(newLogMergePolicy()));
for (int i = 0; i < docFields.length; i++) {
Document doc = new Document();
doc.add(newField(field, docFields[i], TextField.TYPE_STORED));
writer.addDocument(doc);
}
reader = writer.getReader();
writer.close();
searcher = newSearcher(reader);
}
@Override
public void tearDown() throws Exception {
reader.close();
directory.close();
super.tearDown();
}
private String[] docFields = {
"w1 w2 w3 w4 w5",
"w1 w3 w2 w3",
"w1 xx w2 yy w3",
"w1 w3 xx w2 yy w3",
"u2 u2 u1",
"u2 xx u2 u1",
"u2 u2 xx u1",
"u2 xx u2 yy u1",
"u2 xx u1 u2",
"u2 u1 xx u2",
"u1 u2 xx u2",
"t1 t2 t1 t3 t2 t3"
};
public SpanTermQuery makeSpanTermQuery(String text) {
return new SpanTermQuery(new Term(field, text));
}
private void checkHits(Query query, int[] results) throws IOException {
CheckHits.checkHits(random, query, field, searcher, results);
}
private void orderedSlopTest3SQ(
SpanQuery q1,
SpanQuery q2,
SpanQuery q3,
int slop,
int[] expectedDocs) throws IOException {
boolean ordered = true;
SpanNearQuery snq = new SpanNearQuery( new SpanQuery[]{q1,q2,q3}, slop, ordered);
checkHits(snq, expectedDocs);
}
public void orderedSlopTest3(int slop, int[] expectedDocs) throws IOException {
orderedSlopTest3SQ(
makeSpanTermQuery("w1"),
makeSpanTermQuery("w2"),
makeSpanTermQuery("w3"),
slop,
expectedDocs);
}
public void orderedSlopTest3Equal(int slop, int[] expectedDocs) throws IOException {
orderedSlopTest3SQ(
makeSpanTermQuery("w1"),
makeSpanTermQuery("w3"),
makeSpanTermQuery("w3"),
slop,
expectedDocs);
}
public void orderedSlopTest1Equal(int slop, int[] expectedDocs) throws IOException {
orderedSlopTest3SQ(
makeSpanTermQuery("u2"),
makeSpanTermQuery("u2"),
makeSpanTermQuery("u1"),
slop,
expectedDocs);
}
public void testSpanNearOrdered01() throws Exception {
orderedSlopTest3(0, new int[] {0});
}
public void testSpanNearOrdered02() throws Exception {
orderedSlopTest3(1, new int[] {0,1});
}
public void testSpanNearOrdered03() throws Exception {
orderedSlopTest3(2, new int[] {0,1,2});
}
public void testSpanNearOrdered04() throws Exception {
orderedSlopTest3(3, new int[] {0,1,2,3});
}
public void testSpanNearOrdered05() throws Exception {
orderedSlopTest3(4, new int[] {0,1,2,3});
}
public void testSpanNearOrderedEqual01() throws Exception {
orderedSlopTest3Equal(0, new int[] {});
}
public void testSpanNearOrderedEqual02() throws Exception {
orderedSlopTest3Equal(1, new int[] {1});
}
public void testSpanNearOrderedEqual03() throws Exception {
orderedSlopTest3Equal(2, new int[] {1});
}
public void testSpanNearOrderedEqual04() throws Exception {
orderedSlopTest3Equal(3, new int[] {1,3});
}
public void testSpanNearOrderedEqual11() throws Exception {
orderedSlopTest1Equal(0, new int[] {4});
}
public void testSpanNearOrderedEqual12() throws Exception {
orderedSlopTest1Equal(0, new int[] {4});
}
public void testSpanNearOrderedEqual13() throws Exception {
orderedSlopTest1Equal(1, new int[] {4,5,6});
}
public void testSpanNearOrderedEqual14() throws Exception {
orderedSlopTest1Equal(2, new int[] {4,5,6,7});
}
public void testSpanNearOrderedEqual15() throws Exception {
orderedSlopTest1Equal(3, new int[] {4,5,6,7});
}
public void testSpanNearOrderedOverlap() throws Exception {
boolean ordered = true;
int slop = 1;
SpanNearQuery snq = new SpanNearQuery(
new SpanQuery[] {
makeSpanTermQuery("t1"),
makeSpanTermQuery("t2"),
makeSpanTermQuery("t3") },
slop,
ordered);
Spans spans = MultiSpansWrapper.wrap(searcher.getTopReaderContext(), snq);
assertTrue("first range", spans.next());
assertEquals("first doc", 11, spans.doc());
assertEquals("first start", 0, spans.start());
assertEquals("first end", 4, spans.end());
assertTrue("second range", spans.next());
assertEquals("second doc", 11, spans.doc());
assertEquals("second start", 2, spans.start());
assertEquals("second end", 6, spans.end());
assertFalse("third range", spans.next());
}
public void testSpanNearUnOrdered() throws Exception {
//See http://www.gossamer-threads.com/lists/lucene/java-dev/52270 for discussion about this test
SpanNearQuery snq;
snq = new SpanNearQuery(
new SpanQuery[] {
makeSpanTermQuery("u1"),
makeSpanTermQuery("u2") },
0,
false);
Spans spans = MultiSpansWrapper.wrap(searcher.getTopReaderContext(), snq);
assertTrue("Does not have next and it should", spans.next());
assertEquals("doc", 4, spans.doc());
assertEquals("start", 1, spans.start());
assertEquals("end", 3, spans.end());
assertTrue("Does not have next and it should", spans.next());
assertEquals("doc", 5, spans.doc());
assertEquals("start", 2, spans.start());
assertEquals("end", 4, spans.end());
assertTrue("Does not have next and it should", spans.next());
assertEquals("doc", 8, spans.doc());
assertEquals("start", 2, spans.start());
assertEquals("end", 4, spans.end());
assertTrue("Does not have next and it should", spans.next());
assertEquals("doc", 9, spans.doc());
assertEquals("start", 0, spans.start());
assertEquals("end", 2, spans.end());
assertTrue("Does not have next and it should", spans.next());
assertEquals("doc", 10, spans.doc());
assertEquals("start", 0, spans.start());
assertEquals("end", 2, spans.end());
assertTrue("Has next and it shouldn't: " + spans.doc(), spans.next() == false);
SpanNearQuery u1u2 = new SpanNearQuery(new SpanQuery[]{makeSpanTermQuery("u1"),
makeSpanTermQuery("u2")}, 0, false);
snq = new SpanNearQuery(
new SpanQuery[] {
u1u2,
makeSpanTermQuery("u2")
},
1,
false);
spans = MultiSpansWrapper.wrap(searcher.getTopReaderContext(), snq);
assertTrue("Does not have next and it should", spans.next());
assertEquals("doc", 4, spans.doc());
assertEquals("start", 0, spans.start());
assertEquals("end", 3, spans.end());
assertTrue("Does not have next and it should", spans.next());
//unordered spans can be subsets
assertEquals("doc", 4, spans.doc());
assertEquals("start", 1, spans.start());
assertEquals("end", 3, spans.end());
assertTrue("Does not have next and it should", spans.next());
assertEquals("doc", 5, spans.doc());
assertEquals("start", 0, spans.start());
assertEquals("end", 4, spans.end());
assertTrue("Does not have next and it should", spans.next());
assertEquals("doc", 5, spans.doc());
assertEquals("start", 2, spans.start());
assertEquals("end", 4, spans.end());
assertTrue("Does not have next and it should", spans.next());
assertEquals("doc", 8, spans.doc());
assertEquals("start", 0, spans.start());
assertEquals("end", 4, spans.end());
assertTrue("Does not have next and it should", spans.next());
assertEquals("doc", 8, spans.doc());
assertEquals("start", 2, spans.start());
assertEquals("end", 4, spans.end());
assertTrue("Does not have next and it should", spans.next());
assertEquals("doc", 9, spans.doc());
assertEquals("start", 0, spans.start());
assertEquals("end", 2, spans.end());
assertTrue("Does not have next and it should", spans.next());
assertEquals("doc", 9, spans.doc());
assertEquals("start", 0, spans.start());
assertEquals("end", 4, spans.end());
assertTrue("Does not have next and it should", spans.next());
assertEquals("doc", 10, spans.doc());
assertEquals("start", 0, spans.start());
assertEquals("end", 2, spans.end());
assertTrue("Has next and it shouldn't", spans.next() == false);
}
private Spans orSpans(String[] terms) throws Exception {
SpanQuery[] sqa = new SpanQuery[terms.length];
for (int i = 0; i < terms.length; i++) {
sqa[i] = makeSpanTermQuery(terms[i]);
}
return MultiSpansWrapper.wrap(searcher.getTopReaderContext(), new SpanOrQuery(sqa));
}
private void tstNextSpans(Spans spans, int doc, int start, int end)
throws Exception {
assertTrue("next", spans.next());
assertEquals("doc", doc, spans.doc());
assertEquals("start", start, spans.start());
assertEquals("end", end, spans.end());
}
public void testSpanOrEmpty() throws Exception {
Spans spans = orSpans(new String[0]);
assertFalse("empty next", spans.next());
SpanOrQuery a = new SpanOrQuery();
SpanOrQuery b = new SpanOrQuery();
assertTrue("empty should equal", a.equals(b));
}
public void testSpanOrSingle() throws Exception {
Spans spans = orSpans(new String[] {"w5"});
tstNextSpans(spans, 0, 4, 5);
assertFalse("final next", spans.next());
}
public void testSpanOrMovesForward() throws Exception {
Spans spans = orSpans(new String[] {"w1", "xx"});
spans.next();
int doc = spans.doc();
assertEquals(0, doc);
spans.skipTo(0);
doc = spans.doc();
// LUCENE-1583:
// according to Spans, a skipTo to the same doc or less
// should still call next() on the underlying Spans
assertEquals(1, doc);
}
public void testSpanOrDouble() throws Exception {
Spans spans = orSpans(new String[] {"w5", "yy"});
tstNextSpans(spans, 0, 4, 5);
tstNextSpans(spans, 2, 3, 4);
tstNextSpans(spans, 3, 4, 5);
tstNextSpans(spans, 7, 3, 4);
assertFalse("final next", spans.next());
}
public void testSpanOrDoubleSkip() throws Exception {
Spans spans = orSpans(new String[] {"w5", "yy"});
assertTrue("initial skipTo", spans.skipTo(3));
assertEquals("doc", 3, spans.doc());
assertEquals("start", 4, spans.start());
assertEquals("end", 5, spans.end());
tstNextSpans(spans, 7, 3, 4);
assertFalse("final next", spans.next());
}
public void testSpanOrUnused() throws Exception {
Spans spans = orSpans(new String[] {"w5", "unusedTerm", "yy"});
tstNextSpans(spans, 0, 4, 5);
tstNextSpans(spans, 2, 3, 4);
tstNextSpans(spans, 3, 4, 5);
tstNextSpans(spans, 7, 3, 4);
assertFalse("final next", spans.next());
}
public void testSpanOrTripleSameDoc() throws Exception {
Spans spans = orSpans(new String[] {"t1", "t2", "t3"});
tstNextSpans(spans, 11, 0, 1);
tstNextSpans(spans, 11, 1, 2);
tstNextSpans(spans, 11, 2, 3);
tstNextSpans(spans, 11, 3, 4);
tstNextSpans(spans, 11, 4, 5);
tstNextSpans(spans, 11, 5, 6);
assertFalse("final next", spans.next());
}
public void testSpanScorerZeroSloppyFreq() throws Exception {
boolean ordered = true;
int slop = 1;
IndexReaderContext topReaderContext = searcher.getTopReaderContext();
AtomicReaderContext[] leaves = topReaderContext.leaves();
int subIndex = ReaderUtil.subIndex(11, leaves);
for (int i = 0; i < leaves.length; i++) {
final Similarity sim = new DefaultSimilarity() {
@Override
public float sloppyFreq(int distance) {
return 0.0f;
}
};
final Similarity oldSim = searcher.getSimilarity();
Scorer spanScorer;
try {
searcher.setSimilarity(sim);
SpanNearQuery snq = new SpanNearQuery(
new SpanQuery[] {
makeSpanTermQuery("t1"),
makeSpanTermQuery("t2") },
slop,
ordered);
spanScorer = searcher.createNormalizedWeight(snq).scorer(leaves[i], true, false, leaves[i].reader().getLiveDocs());
} finally {
searcher.setSimilarity(oldSim);
}
if (i == subIndex) {
assertTrue("first doc", spanScorer.nextDoc() != DocIdSetIterator.NO_MORE_DOCS);
assertEquals("first doc number", spanScorer.docID() + leaves[i].docBase, 11);
float score = spanScorer.score();
assertTrue("first doc score should be zero, " + score, score == 0.0f);
} else {
assertTrue("no second doc", spanScorer.nextDoc() == DocIdSetIterator.NO_MORE_DOCS);
}
}
}
// LUCENE-1404
private void addDoc(IndexWriter writer, String id, String text) throws IOException {
final Document doc = new Document();
doc.add( newField("id", id, StringField.TYPE_STORED) );
doc.add( newField("text", text, TextField.TYPE_STORED) );
writer.addDocument(doc);
}
// LUCENE-1404
private int hitCount(IndexSearcher searcher, String word) throws Throwable {
return searcher.search(new TermQuery(new Term("text", word)), 10).totalHits;
}
// LUCENE-1404
private SpanQuery createSpan(String value) {
return new SpanTermQuery(new Term("text", value));
}
// LUCENE-1404
private SpanQuery createSpan(int slop, boolean ordered, SpanQuery[] clauses) {
return new SpanNearQuery(clauses, slop, ordered);
}
// LUCENE-1404
private SpanQuery createSpan(int slop, boolean ordered, String term1, String term2) {
return createSpan(slop, ordered, new SpanQuery[] {createSpan(term1), createSpan(term2)});
}
// LUCENE-1404
public void testNPESpanQuery() throws Throwable {
final Directory dir = newDirectory();
final IndexWriter writer = new IndexWriter(dir, new IndexWriterConfig(
TEST_VERSION_CURRENT, new MockAnalyzer(random)));
// Add documents
addDoc(writer, "1", "the big dogs went running to the market");
addDoc(writer, "2", "the cat chased the mouse, then the cat ate the mouse quickly");
// Commit
writer.close();
// Get searcher
final IndexReader reader = IndexReader.open(dir);
final IndexSearcher searcher = newSearcher(reader);
// Control (make sure docs indexed)
assertEquals(2, hitCount(searcher, "the"));
assertEquals(1, hitCount(searcher, "cat"));
assertEquals(1, hitCount(searcher, "dogs"));
assertEquals(0, hitCount(searcher, "rabbit"));
// This throws exception (it shouldn't)
assertEquals(1,
searcher.search(createSpan(0, true,
new SpanQuery[] {createSpan(4, false, "chased", "cat"),
createSpan("ate")}), 10).totalHits);
reader.close();
dir.close();
}
}
| [
"durieuxthomas@hotmail.com"
] | durieuxthomas@hotmail.com |
4882569e5c1a921129eedfb5751550f983a0f70d | bab596f41367e701de8862bdf08df97353b3e75c | /sandbox/src/main/java/one/sandbox/MyClass.java | c6efa981b1cc1505095847b00245803f729ddfca | [
"Apache-2.0"
] | permissive | Soadua/java_1 | b9859cf48245292e9d9e71caa037e0d08b66b9ba | 17821ba773d756667006c765752362602a331740 | refs/heads/master | 2021-08-23T16:56:23.977856 | 2017-12-05T19:29:01 | 2017-12-05T19:29:01 | 109,169,624 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 143 | java | package one.sandbox;
public class MyClass {
public static void main(String[] args){
System.out.println("Hello, Bitches");
}
} | [
"igor.nedashkovskiy@mirs.com"
] | igor.nedashkovskiy@mirs.com |
7e05e3126a34cdbd43390d45575442388f23a2b5 | ebb23aba43865912728a9ac5cfccce269c777f4d | /app/src/main/java/dev/ny/challenge/ui/base/BaseActivity.java | 3f024228a721c1a57b0aba4b9ae5c7bfe4b70555 | [] | no_license | KarimAbdellSalam/NYTIMES-Mobile-Challenge | 9fa56e1dea4946bae26b11d1786723094059c799 | 8b68c7eee75e21616f6799af82cd26242c46124b | refs/heads/main | 2023-02-10T11:15:49.197271 | 2021-01-02T22:09:25 | 2021-01-02T22:09:25 | 326,274,076 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 10,850 | java | package dev.ny.challenge.ui.base;
import android.annotation.TargetApi;
import android.app.AlertDialog;
import android.app.ProgressDialog;
import android.content.Context;
import android.content.DialogInterface;
import android.content.Intent;
import android.content.pm.PackageManager;
import android.os.Build;
import android.os.Bundle;
import android.os.Handler;
import android.util.Log;
import android.view.View;
import android.view.WindowManager;
import android.view.inputmethod.InputMethodManager;
import android.widget.Toast;
import androidx.annotation.LayoutRes;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.appcompat.app.AppCompatActivity;
import androidx.core.content.ContextCompat;
import androidx.databinding.DataBindingUtil;
import androidx.databinding.ViewDataBinding;
import com.google.android.material.snackbar.Snackbar;
import dev.ny.challenge.manager.LanguageControl;
import dev.ny.challenge.utils.Utils;
import dagger.android.AndroidInjection;
import io.github.inflationx.viewpump.ViewPumpContextWrapper;
/**
* Created by Karim Abdell Salam on 1,Jan,2021
*/
public abstract class BaseActivity<V extends BaseViewModel> extends AppCompatActivity
implements BaseFragment.Callback, UIHelper {
public String TAG;
// this can probably depend on isLoading variable of BaseViewModel,
// since its going to be common for all the activities
private ProgressDialog mProgressDialog;
private ViewDataBinding mViewDataBinding;
private V mViewModel;
/**
* Override for set binding variable
*
* @return variable id
*/
public abstract int getBindingVariable();
public abstract void init();
/**
* @return layout resource id
*/
public abstract
@LayoutRes
int getLayoutId();
/**
* Override for set view model
*
* @return view model instance
*/
public abstract V getViewModel();
@Override
public void onFragmentAttached() {
}
@Override
public void onFragmentDetached(String tag) {
}
@Override
protected void attachBaseContext(Context newBase) {
super.attachBaseContext(ViewPumpContextWrapper.wrap(newBase));
}
@Override
protected void onCreate(@Nullable Bundle savedInstanceState) {
TAG = this.getLocalClassName();
LanguageControl.adjustLayoutDirections(this);
performDependencyInjection();
// toggleFullscreen(true);
super.onCreate(savedInstanceState);
performDataBinding();
mViewModel.setUIHelper(this);
init();
String simpleName = this.getClass().getSimpleName();
}
@Override
protected void onResume() {
super.onResume();
}
public ViewDataBinding getViewDataBinding() {
return mViewDataBinding;
}
@TargetApi(Build.VERSION_CODES.M)
public boolean hasPermission(String permission) {
return Build.VERSION.SDK_INT < Build.VERSION_CODES.M ||
checkSelfPermission(permission) == PackageManager.PERMISSION_GRANTED;
}
public void hideKeyboard() {
View view = this.getCurrentFocus();
if (view != null) {
InputMethodManager imm = (InputMethodManager) getSystemService(Context.INPUT_METHOD_SERVICE);
if (imm != null) {
imm.hideSoftInputFromWindow(view.getWindowToken(), 0);
}
}
}
public void showLoading() {
hideLoading();
mProgressDialog = Utils.UI.showLoadingDialog(this);
}
public void hideLoading() {
if (mProgressDialog != null && mProgressDialog.isShowing()) {
mProgressDialog.cancel();
}
}
public boolean isLoading() {
if (mProgressDialog != null && mProgressDialog.isShowing()) {
return true;
} else return false;
}
public boolean isNetworkConnected() {
return Utils.Network.checkInternetConnection(getApplicationContext());
}
public void openActivityOnTokenExpire() {
//todo check me after token expire
finish();
}
public void performDependencyInjection() {
AndroidInjection.inject(this);
}
@Override
@TargetApi(Build.VERSION_CODES.M)
public void requestPermissionsSafely(String[] permissions, int requestCode) {
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {
requestPermissions(permissions, requestCode);
}
}
private void performDataBinding() {
mViewDataBinding = DataBindingUtil.setContentView(this, getLayoutId());
this.mViewModel = mViewModel == null ? getViewModel() : mViewModel;
mViewDataBinding.setVariable(getBindingVariable(), mViewModel);
mViewDataBinding.executePendingBindings();
}
@Override
public void showToast(String message) {
Toast.makeText(getApplicationContext(), message, Toast.LENGTH_SHORT).show();
}
@Override
public void showToast(int messageId) {
Toast.makeText(getApplicationContext(), getString(messageId), Toast.LENGTH_SHORT).show();
}
@Override
public void showSnake(String message) {
Snackbar.make(getWindow().getDecorView().getRootView(), message, Snackbar.LENGTH_LONG).show();
}
@Override
public void showSnake(String message, int action, View.OnClickListener onClickListener) {
Snackbar.make(getWindow().getDecorView().getRootView(), message, Snackbar.LENGTH_INDEFINITE).setAction(action, onClickListener).show();
}
@Override
public AlertDialog.Builder showAlertDialog(String title, CharSequence[]
options, DialogInterface.OnClickListener onClickListener) {
AlertDialog.Builder builder = new AlertDialog.Builder(this);
builder.setTitle(title);
if (options.length > 0 && onClickListener != null)
builder.setItems(options, onClickListener);
builder.show();
return builder;
}
@Override
public boolean checkPermission(String[] permissions) {
return Build.VERSION.SDK_INT < Build.VERSION_CODES.M ||
checkPermissions(permissions);
}
private boolean checkPermissions(String[] permissions) {
boolean allGranted = true;
for (String permission : permissions
) {
if (ContextCompat.checkSelfPermission(this, permission) != (PackageManager.PERMISSION_GRANTED)) {
allGranted = false;
}
}
return allGranted;
}
@Override
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
super.onActivityResult(requestCode, resultCode, data);
mViewModel.onActivityResult(requestCode, resultCode, data);
}
@Override
public void onRequestPermissionsResult(int requestCode, @NonNull String[] permissions,
@NonNull int[] grantResults) {
super.onRequestPermissionsResult(requestCode, permissions, grantResults);
mViewModel.onRequestPermissionsResult(requestCode, permissions, grantResults);
}
@Override
public void onBackPressed() {
super.onBackPressed();
hideLoading();
}
@Override
public void onBackClicked() {
super.onBackPressed();
}
@Override
public void postBack() {
new Handler().postDelayed(new Runnable() {
@Override
public void run() {
onBackPressed();
}
}, 2000);
}
@Override
public void postBack(int after) {
new Handler().postDelayed(new Runnable() {
@Override
public void run() {
onBackPressed();
}
}, after);
onBackPressed();
}
public void toggleFullscreen(boolean fs) {
if (Build.VERSION.SDK_INT >= 11) {
// The UI options currently enabled are represented by a bitfield.
// getSystemUiVisibility() gives us that bitfield.
int uiOptions = this.getWindow().getDecorView().getSystemUiVisibility();
int newUiOptions = uiOptions;
boolean isImmersiveModeEnabled =
((uiOptions | View.SYSTEM_UI_FLAG_IMMERSIVE_STICKY) == uiOptions);
if (isImmersiveModeEnabled) {
Log.i(getPackageName(), "Turning immersive mode mode off. ");
} else {
Log.i(getPackageName(), "Turning immersive mode mode on.");
}
// Navigation bar hiding: Backwards compatible to ICS.
if (Build.VERSION.SDK_INT >= 14) {
newUiOptions ^= View.SYSTEM_UI_FLAG_HIDE_NAVIGATION;
}
// Status bar hiding: Backwards compatible to Jellybean
if (Build.VERSION.SDK_INT >= 16) {
newUiOptions ^= View.SYSTEM_UI_FLAG_FULLSCREEN;
}
// Immersive mode: Backward compatible to KitKat.
// Note that this flag doesn't do anything by itself, it only augments the behavior
// of HIDE_NAVIGATION and FLAG_FULLSCREEN. For the purposes of this sample
// all three flags are being toggled together.
// Note that there are two immersive mode UI flags, one of which is referred to as "sticky".
// Sticky immersive mode differs in that it makes the navigation and status bars
// semi-transparent, and the UI flag does not get cleared when the user interacts with
// the screen.
if (Build.VERSION.SDK_INT >= 18) {
newUiOptions ^= View.SYSTEM_UI_FLAG_IMMERSIVE_STICKY;
}
getWindow().getDecorView().setSystemUiVisibility(newUiOptions);
} else {
// for android pre 11
WindowManager.LayoutParams attrs = getWindow().getAttributes();
if (fs) {
attrs.flags |= WindowManager.LayoutParams.FLAG_FULLSCREEN;
} else {
attrs.flags &= ~WindowManager.LayoutParams.FLAG_FULLSCREEN;
}
this.getWindow().setAttributes(attrs);
}
try {
// hide actionbar
if
(this instanceof AppCompatActivity) {
if (fs) getSupportActionBar().hide();
else getSupportActionBar().show();
} else if
(Build.VERSION.SDK_INT >= 11) {
if (fs) getActionBar().hide();
else getActionBar().show();
}
} catch (Exception e) {
e.printStackTrace();
}
}
@Override
protected void onPause() {
super.onPause();
}
@Override
protected void onStop() {
super.onStop();
}
@Override
protected void onDestroy() {
super.onDestroy();
}
} | [
"aitteam90@gmail.com"
] | aitteam90@gmail.com |
ddb0bb0b902d4dafe1f7ac54c90c477c7cc8be46 | 656820b161d3207f2a532e936f543c6d60e6ff44 | /Springs/springbooth2/src/main/java/com/bcits/springbooth2/controller/Employeecontrollere.java | bf8e2692fc3815c913e805ffa331caf2a671de20 | [] | no_license | ReddemSunil/TY_BCITS_ELF_BATCH1_JFS_REDYAMNAGASUNILREDDY | 7ad3e56bc291b4b0679ef72feccf724b12fc3f6a | 4e6d6c7b54eaba366f9c4b3a12e3da7fcebb600f | refs/heads/master | 2022-12-22T17:44:02.700192 | 2020-02-13T14:16:54 | 2020-02-13T14:16:54 | 228,772,364 | 0 | 0 | null | 2022-12-15T23:57:34 | 2019-12-18T06:22:16 | JavaScript | UTF-8 | Java | false | false | 1,933 | java | package com.bcits.springbooth2.controller;
import java.util.Optional;
import org.aspectj.lang.annotation.Pointcut;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.MediaType;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;
import com.bcits.springbooth2.beans.EmployeeInfoBean;
import com.bcits.springbooth2.repository.EmployeeRepository;
@RestController
public class Employeecontrollere {
@Autowired
private EmployeeRepository repository;
@GetMapping(path = "/getEmployee", produces = MediaType.APPLICATION_JSON_VALUE)
public EmployeeInfoBean getEmployee(int empId) {
Optional<EmployeeInfoBean> info = repository.findById(empId);
if (info.isPresent()) {
return info.get();
} else {
return null;
}
}// End of getEmployee()
@PostMapping(path = "/addEmployee", consumes = MediaType.APPLICATION_JSON_VALUE, produces = MediaType.APPLICATION_JSON_VALUE)
public EmployeeInfoBean addEmployee(@RequestBody EmployeeInfoBean employeeInfoBean) {
EmployeeInfoBean infobean = repository.save(employeeInfoBean);
return infobean;
}// End of addEmployee()
@PutMapping(path = "/updateEmployee",consumes = MediaType.APPLICATION_JSON_VALUE,produces =MediaType.APPLICATION_JSON_VALUE )
public EmployeeInfoBean updateEmployee(@RequestBody EmployeeInfoBean employeeInfoBean) {
Optional<EmployeeInfoBean> op=repository.findById(employeeInfoBean.getEmpId());
if (op.isPresent()) {
EmployeeInfoBean infobean = repository.save(employeeInfoBean);
return infobean;
}else {
return null;
}
}// End of updateEmployee()
}// End of class
| [
"rnsunil.software@gamil.com"
] | rnsunil.software@gamil.com |
d77cbe220ca8a2c32abab32dd515b9e94b25fd7b | 720b82f65fa1c37acb90229e0cab21e61527cacb | /src/main/java/org/jenkinsci/plugins/jobgenerator/parameterizedtrigger/FileGeneratorParameterFactory.java | 1a2a028990dbbed9b88b20509c42c8fdcc687461 | [
"MIT"
] | permissive | syl20bnr/jobgenerator-jenkins | f0099f49d9460b80114e0297153faa7af170c736 | 01eb2fb2a6809dae4b0f5c50ae3696cfb5747910 | refs/heads/master | 2021-01-10T20:19:32.845309 | 2014-02-16T05:18:55 | 2014-02-16T05:18:55 | 6,905,151 | 3 | 2 | MIT | 2020-02-11T15:58:58 | 2012-11-28T16:15:36 | Java | UTF-8 | Java | false | false | 5,761 | java | /*
The MIT License
Copyright (c) 2013, Sylvain Benner.
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 org.jenkinsci.plugins.jobgenerator.parameterizedtrigger;
import com.google.common.collect.Lists;
import hudson.Extension;
import hudson.FilePath;
import hudson.FilePath.FileCallable;
import hudson.Util;
import hudson.model.AbstractBuild;
import hudson.model.TaskListener;
import hudson.plugins.parameterizedtrigger.AbstractBuildParameterFactory;
import hudson.plugins.parameterizedtrigger.AbstractBuildParameterFactoryDescriptor;
import hudson.plugins.parameterizedtrigger.AbstractBuildParameters;
import hudson.remoting.VirtualChannel;
import hudson.util.LogTaskListener;
import hudson.util.StreamTaskListener;
import hudson.util.VariableResolver;
import java.io.BufferedReader;
import java.io.File;
import java.io.FileFilter;
import java.io.FileNotFoundException;
import java.io.FileReader;
import java.util.logging.Level;
import java.util.logging.Logger;
import java.io.IOException;
import java.io.PrintStream;
import java.util.ArrayList;
import java.util.List;
import org.apache.tools.ant.DirectoryScanner;
import org.apache.tools.ant.types.FileSet;
import org.kohsuke.stapler.DataBoundConstructor;
public class FileGeneratorParameterFactory extends
AbstractBuildParameterFactory {
/**
* Enum containing the action that could occur when there are no files found
* in the workspace
*
*/
public enum NoFilesFoundEnum {
SKIP("Don't trigger these projects") { // previous behaviour (default)
@Override
public void failCheck(TaskListener listener)
throws AbstractBuildParameters.DontTriggerException {
listener.getLogger()
.println(
Messages.FileGeneratorParameterFactory_NoFilesFoundSkipping());
throw new AbstractBuildParameters.DontTriggerException();
}
},
NOPARMS("Skip these parameters") {
@Override
public void failCheck(TaskListener listener)
throws AbstractBuildParameters.DontTriggerException {
listener.getLogger()
.println(
Messages.FileGeneratorParameterFactory_NoFilesFoundIgnore());
}
},
FAIL("Fail the build step") {
@Override
public void failCheck(TaskListener listener)
throws AbstractBuildParameters.DontTriggerException {
listener.getLogger()
.println(
Messages.FileGeneratorParameterFactory_NoFilesFoundTerminate());
throw new RuntimeException();
}
};
private String description;
public String getDescription() {
return description;
}
NoFilesFoundEnum(String description) {
this.description = description;
}
public abstract void failCheck(TaskListener listener)
throws AbstractBuildParameters.DontTriggerException;
}
private final String filePattern;
private final NoFilesFoundEnum noFilesFoundAction;
@DataBoundConstructor
public FileGeneratorParameterFactory(String filePattern,
NoFilesFoundEnum noFilesFoundAction) {
this.filePattern = filePattern;
this.noFilesFoundAction = noFilesFoundAction;
}
public FileGeneratorParameterFactory(String filePattern) {
this(filePattern, NoFilesFoundEnum.SKIP);
}
public String getFilePattern() {
return filePattern;
}
public NoFilesFoundEnum getNoFilesFoundAction() {
return noFilesFoundAction;
}
@Override
public List<AbstractBuildParameters> getParameters(
AbstractBuild<?, ?> build, TaskListener listener)
throws IOException, InterruptedException,
AbstractBuildParameters.DontTriggerException {
List<AbstractBuildParameters> result = Lists.newArrayList();
try {
FilePath workspace = getWorkspace(build);
FilePath[] files = workspace.list(getFilePattern());
if (files.length == 0) {
noFilesFoundAction.failCheck(listener);
} else {
for (FilePath f : files) {
String parametersStr = f.readToString();
Logger.getLogger(
FileGeneratorParameterFactory.class.getName()).log(
Level.INFO, null,
"Triggering build with " + f.getName());
result.add(new PredefinedGeneratorParameters(parametersStr));
}
}
} catch (IOException ex) {
Logger.getLogger(FileGeneratorParameterFactory.class.getName())
.log(Level.SEVERE, null, ex);
}
return result;
}
private FilePath getWorkspace(AbstractBuild build) {
FilePath workspace = build.getWorkspace();
if (workspace == null) {
workspace = build.getProject().getSomeWorkspace();
}
return workspace;
}
@Extension
public static class DescriptorImpl extends
AbstractBuildParameterFactoryDescriptor {
@Override
public String getDisplayName() {
return Messages.FileGeneratorParameterFactory_FileGeneratorParameterFactory();
}
}
}
| [
"sylvain.benner@gmail.com"
] | sylvain.benner@gmail.com |
e9ce13ceab1e7573c982b6989aaa46532a0a9310 | 67c94418eb9b789e6fbd60d43bacc4fc9ee96518 | /Java8Features/src/com/Java8Features/ParallelStreams/ParallelAndSequentialStreamExample.java | 407573ddfcdac8c16c02e74f8c079f71c8e54059 | [] | no_license | Alex-Prakash/Java8Features | 789b7ed8098e26cfb7fef9c958af7c54068ad537 | 39489af84c730325fef94cc553cfc40183b3c015 | refs/heads/main | 2023-04-18T07:40:40.212024 | 2021-05-05T08:47:58 | 2021-05-05T08:47:58 | 364,511,729 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 771 | java | package com.Java8Features.ParallelStreams;
import java.time.LocalTime;
import java.util.stream.Stream;
public class ParallelAndSequentialStreamExample {
public static void main(String[] args) {
System.out.println("Available Cores : "+ Runtime.getRuntime().availableProcessors());
String str[] = {"1","2","3","4","5","6","7","8","9","10"};
System.out.println("Sequential Stream :");
printStream(Stream.of(str));
System.out.println("Parallel Stream :");
printStream(Stream.of(str).parallel());
}
static void printStream(Stream<String> stream) {
stream.forEach(s ->
System.out.println(LocalTime.now() + " Value :"+s +" "+Thread.currentThread().getName()));
try {
Thread.sleep(2000);
} catch (Exception e) {
e.printStackTrace();
}
}
}
| [
"53953585+Alex-Prakash@users.noreply.github.com"
] | 53953585+Alex-Prakash@users.noreply.github.com |
2c06e35128f2bb44d511e8372722de7a12b68639 | 0caffe05aeee72bc681351c7ba843bb4b2a4cd42 | /dcma-gwt/dcma-gwt-home/src/main/java/com/ephesoft/dcma/gwt/home/client/TableModelServiceAsync.java | e58c39f398a7b7ae97fdb2646588ed71c7857e68 | [] | no_license | plutext/ephesoft | d201a35c6096f9f3b67df00727ae262976e61c44 | d84bf4fa23c9ed711ebf19f8d787a93a71d97274 | refs/heads/master | 2023-06-23T10:15:34.223961 | 2013-02-13T18:35:49 | 2013-02-13T18:35:49 | 43,588,917 | 4 | 1 | null | null | null | null | UTF-8 | Java | false | false | 4,894 | java | /*********************************************************************************
* Ephesoft is a Intelligent Document Capture and Mailroom Automation program
* developed by Ephesoft, Inc. Copyright (C) 2010-2012 Ephesoft Inc.
*
* This program is free software; you can redistribute it and/or modify it under
* the terms of the GNU Affero General Public License version 3 as published by the
* Free Software Foundation with the addition of the following permission added
* to Section 15 as permitted in Section 7(a): FOR ANY PART OF THE COVERED WORK
* IN WHICH THE COPYRIGHT IS OWNED BY EPHESOFT, EPHESOFT DISCLAIMS THE WARRANTY
* OF NON INFRINGEMENT OF THIRD PARTY RIGHTS.
*
* 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 Affero General Public License for more
* details.
*
* You should have received a copy of the GNU Affero General Public License along with
* this program; if not, see http://www.gnu.org/licenses or write to the Free
* Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
* 02110-1301 USA.
*
* You can contact Ephesoft, Inc. headquarters at 111 Academy Way,
* Irvine, CA 92617, USA. or at email address info@ephesoft.com.
*
* The interactive user interfaces in modified source and object code versions
* of this program must display Appropriate Legal Notices, as required under
* Section 5 of the GNU Affero General Public License version 3.
*
* In accordance with Section 7(b) of the GNU Affero General Public License version 3,
* these Appropriate Legal Notices must retain the display of the "Ephesoft" logo.
* If the display of the logo is not reasonably feasible for
* technical reasons, the Appropriate Legal Notices must display the words
* "Powered by Ephesoft".
********************************************************************************/
package com.ephesoft.dcma.gwt.home.client;
import java.util.List;
import com.ephesoft.dcma.core.common.Order;
import com.ephesoft.dcma.gwt.core.client.DCMARemoteServiceAsync;
import com.ephesoft.dcma.gwt.core.shared.BatchInstanceDTO;
import com.ephesoft.dcma.gwt.core.shared.DataFilter;
import com.google.gwt.user.client.rpc.AsyncCallback;
/**
* TableModelServiceAsync is a service interface that asynchronously provides data for displaying in a GWT AdvancedTable widget. The
* implementing class should provide paging, filtering and sorting as this interface specifies.
*
* Life-cycle: 1) getColumns() is called by the client to populate the table columns 2) getRowsCount() is called by the client to
* estimate the number of available records on the server. 3) getRows() is called by the client to display a particular page (a subset
* of the available data) The client call getRowsCount() and getRows() with the same filter. The implementing class can use database or
* other back-end as data source.
*
* The first table column is used as row identifier (primary key). It can be visible in the table or can be hidden and is passed as row
* id when a row is selected.
*
* @author Ephesoft
* @version 1.0
* @see com.ephesoft.dcma.gwt.core.client.DCMARemoteServiceAsync
*/
public interface TableModelServiceAsync extends DCMARemoteServiceAsync {
/**
* API to get total Rows Count for the given data filters asynchronously.
*
* @param filters {@link DataFilter}[ ]
* @param callback {@link AsyncCallback} < {@link Integer} >
*/
void getRowsCount(DataFilter[] filters, AsyncCallback<Integer> callback);
/**
* API to get Rows of the table in the form of BatchInstanceDTO for the given batch and filters asynchronously.
*
* @param batchNameToBeSearched {@link String}
* @param startRow int
* @param rowsCount int
* @param filters {@link DataFilter}[ ]
* @param order {@link Order}
* @param callback {@link AsyncCallback} < List< {@link BatchInstanceDTO}> >
*/
void getRows(String batchNameToBeSearched, int startRow, int rowsCount, DataFilter[] filters, Order order,
AsyncCallback<List<BatchInstanceDTO>> callback);
/**
* API to get Individual Row Counts for each batch asynchronously.
*
* @param callback {@link AsyncCallback} < {@link Integer}[ ] >
*/
void getIndividualRowCounts(AsyncCallback<Integer[]> asyncCallback);
/**
* API to get Next Batch Instance asynchronously.
*
* @param callback {@link AsyncCallback} < {@link String} >
*/
void getNextBatchInstance(AsyncCallback<String> callback);
/**
* API to get Rows Count of a batch passing the given data filters asynchronously.
*
* @param batchName {@link String}
* @param filters {@link DataFilter}[ ]
* @param callback {@link AsyncCallback} < {@link Integer} >
*/
void getRowsCount(String batchName, DataFilter[] filters, AsyncCallback<Integer> callback);
}
| [
"enterprise.support@ephesoft.com"
] | enterprise.support@ephesoft.com |
829ab16b57bb58b80f4d56f21cd89d59f21718a8 | fa91450deb625cda070e82d5c31770be5ca1dec6 | /Diff-Raw-Data/30/30_3827cc02205cb3cfc18b384ff60b7a804d8914ea/Test/30_3827cc02205cb3cfc18b384ff60b7a804d8914ea_Test_s.java | f2de47c2334612d40a9ed6df9a82220c5f12fa0d | [] | 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 | 1,581 | java | package org.encog.engine;
import org.encog.engine.data.BasicEngineDataSet;
import org.encog.engine.data.EngineDataSet;
import org.encog.engine.network.flat.FlatNetwork;
import org.encog.engine.network.train.TrainFlatNetworkResilient;
import org.encog.engine.data.EngineData;
public class Test {
public static double XOR_INPUT[][] = { { 0.0, 0.0 }, { 1.0, 0.0 },
{ 0.0, 1.0 }, { 1.0, 1.0 } };
public static double XOR_IDEAL[][] = { { 0.0 }, { 1.0 }, { 1.0 }, { 0.0 } };
public static void main(String[] args)
{
EncogEngine.getInstance().initCL();
FlatNetwork network = new FlatNetwork(2,3,0,1,true);
System.out.println( network.getWeights().length );
for(int i=0;i<network.getWeights().length;i++)
{
network.getWeights()[i] = (Math.random()*2.0) - 1.0;
}
EngineDataSet trainingSet = new BasicEngineDataSet(XOR_INPUT, XOR_IDEAL);
TrainFlatNetworkResilient train = new TrainFlatNetworkResilient(network,trainingSet);
int epoch = 1;
do {
train.iteration();
System.out
.println("Epoch #" + epoch + " Error:" + train.getError());
epoch++;
} while(train.getError() > 0.01);
// test the neural network
double[] output = new double[2];
System.out.println("Neural Network Results:");
for(EngineData pair: trainingSet ) {
network.compute(pair.getInput(),output);
System.out.println(pair.getInput()[0] + "," + pair.getInput()[1]
+ ", actual=" + output[0] + ",ideal=" + pair.getIdeal()[0]);
}
}
}
| [
"yuzhongxing88@gmail.com"
] | yuzhongxing88@gmail.com |
c7750607a7be683499742fce99c871e10e51d1d5 | dbaaa1549c328446ba9b787242e33ec7676dab4a | /app/src/main/java/com/jarvis/videoplayer/fragment/VideoFragment.java | 705ed7e06679d5baafb741151f21c4809ebc908f | [] | no_license | JarvisGG/VideoPlayer | 62354e0d08c08f5fab2f8983c929b1aa4da9c33c | d8fb88f43e9dabdf2c264d5a5d3a16d66a98c19d | refs/heads/master | 2020-06-01T09:59:54.531601 | 2017-07-30T16:17:04 | 2017-07-30T16:17:04 | 94,070,928 | 3 | 0 | null | null | null | null | UTF-8 | Java | false | false | 5,740 | java | package com.jarvis.videoplayer.fragment;
import android.os.Bundle;
import android.support.annotation.Nullable;
import android.support.v4.app.Fragment;
import android.support.v7.widget.LinearLayoutManager;
import android.support.v7.widget.RecyclerView;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import com.jarvis.jarvisvideoplayer.VideoPlayer;
import com.jarvis.jarvisvideoplayer.VideoPlayerManager;
import com.jarvis.videoplayer.R;
import com.jarvis.videoplayer.adapter.VideoAdapter;
import com.jarvis.videoplayer.model.VideoBean;
import java.util.ArrayList;
import java.util.List;
/**
* @author Jarvis
* @version 1.0
* @title VideoPlayer
* @description 该类主要功能描述
* @company 北京奔流网络技术有限公司
* @create 2017/7/27 上午8:58
* @changeRecord [修改记录] <br/>
*/
public class VideoFragment extends Fragment {
private RecyclerView mRecyclerView;
private VideoAdapter mVideoAdapter;
private LinearLayoutManager mLayoutManager;
public static VideoFragment newInstance(String info) {
return new VideoFragment();
}
@Override
public void onCreate(@Nullable Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
}
@Nullable
@Override
public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
View view = inflater.inflate(R.layout.fragment_video, null);
initView(view);
return view;
}
private void initView(View containerView) {
mRecyclerView = (RecyclerView) containerView.findViewById(R.id.recycler_view);
mVideoAdapter = new VideoAdapter(getContext(), getVideoList());
mLayoutManager = new LinearLayoutManager(getContext());
mRecyclerView.setAdapter(mVideoAdapter);
mRecyclerView.setLayoutManager(mLayoutManager);
mRecyclerView.addOnChildAttachStateChangeListener(new RecyclerView.OnChildAttachStateChangeListener() {
@Override
public void onChildViewAttachedToWindow(View view) {
}
@Override
public void onChildViewDetachedFromWindow(View view) {
VideoPlayer videoPlayer = (VideoPlayer) view.findViewById(R.id.video_player);
if (videoPlayer != null) {
videoPlayer.release();
}
}
});
}
public List<VideoBean> getVideoList() {
List<VideoBean> videoList = new ArrayList<>();
videoList.add(new VideoBean("办公室小野开番外了,居然在办公室开澡堂!老板还点赞?",
"http://tanzi27niu.cdsb.mobi/wps/wp-content/uploads/2017/05/2017-05-17_17-30-43.jpg",
"http://tanzi27niu.cdsb.mobi/wps/wp-content/uploads/2017/05/2017-05-17_17-33-30.mp4"));
videoList.add(new VideoBean("小野在办公室用丝袜做茶叶蛋 边上班边看《外科风云》",
"http://tanzi27niu.cdsb.mobi/wps/wp-content/uploads/2017/05/2017-05-10_10-09-58.jpg",
"http://tanzi27niu.cdsb.mobi/wps/wp-content/uploads/2017/05/2017-05-10_10-20-26.mp4"));
videoList.add(new VideoBean("花盆叫花鸡,怀念玩泥巴,过家家,捡根竹竿当打狗棒的小时候",
"http://tanzi27niu.cdsb.mobi/wps/wp-content/uploads/2017/05/2017-05-03_12-52-08.jpg",
"http://tanzi27niu.cdsb.mobi/wps/wp-content/uploads/2017/05/2017-05-03_13-02-41.mp4"));
videoList.add(new VideoBean("针织方便面,这可能是史上最不方便的方便面",
"http://tanzi27niu.cdsb.mobi/wps/wp-content/uploads/2017/04/2017-04-28_18-18-22.jpg",
"http://tanzi27niu.cdsb.mobi/wps/wp-content/uploads/2017/04/2017-04-28_18-20-56.mp4"));
videoList.add(new VideoBean("宵夜的下午茶,办公室不只有KPI,也有诗和远方",
"http://tanzi27niu.cdsb.mobi/wps/wp-content/uploads/2017/04/2017-04-26_10-00-28.jpg",
"http://tanzi27niu.cdsb.mobi/wps/wp-content/uploads/2017/04/2017-04-26_10-06-25.mp4"));
videoList.add(new VideoBean("可乐爆米花,嘭嘭嘭......收花的人说要把我娶回家",
"http://tanzi27niu.cdsb.mobi/wps/wp-content/uploads/2017/04/2017-04-21_16-37-16.jpg",
"http://tanzi27niu.cdsb.mobi/wps/wp-content/uploads/2017/04/2017-04-21_16-41-07.mp4"));
videoList.add(new VideoBean("可乐爆米花,嘭嘭嘭......收花的人说要把我娶回家",
"http://tanzi27niu.cdsb.mobi/wps/wp-content/uploads/2017/04/2017-04-21_16-37-16.jpg",
"http://tanzi27niu.cdsb.mobi/wps/wp-content/uploads/2017/04/2017-04-21_16-41-07.mp4"));
videoList.add(new VideoBean("可乐爆米花,嘭嘭嘭......收花的人说要把我娶回家",
"http://tanzi27niu.cdsb.mobi/wps/wp-content/uploads/2017/04/2017-04-21_16-37-16.jpg",
"http://tanzi27niu.cdsb.mobi/wps/wp-content/uploads/2017/04/2017-04-21_16-41-07.mp4"));
videoList.add(new VideoBean("可乐爆米花,嘭嘭嘭......收花的人说要把我娶回家",
"http://tanzi27niu.cdsb.mobi/wps/wp-content/uploads/2017/04/2017-04-21_16-37-16.jpg",
"http://tanzi27niu.cdsb.mobi/wps/wp-content/uploads/2017/04/2017-04-21_16-41-07.mp4"));
videoList.add(new VideoBean("可乐爆米花,嘭嘭嘭......收花的人说要把我娶回家",
"http://tanzi27niu.cdsb.mobi/wps/wp-content/uploads/2017/04/2017-04-21_16-37-16.jpg",
"http://tanzi27niu.cdsb.mobi/wps/wp-content/uploads/2017/04/2017-04-21_16-41-07.mp4"));
return videoList;
}
}
| [
"821388334@qq.com"
] | 821388334@qq.com |
7a5536ddd0db7e7223be009d840d2960a5ddf79d | 647ec12ce50f06e7380fdbfb5b71e9e2d1ac03b4 | /com.tencent.mm/classes.jar/com/tencent/mm/plugin/performance/b/a.java | d2ce478d298951a55e79482a2797bd9688776fa9 | [] | no_license | tsuzcx/qq_apk | 0d5e792c3c7351ab781957bac465c55c505caf61 | afe46ef5640d0ba6850cdefd3c11badbd725a3f6 | refs/heads/main | 2022-07-02T10:32:11.651957 | 2022-02-01T12:41:38 | 2022-02-01T12:41:38 | 453,860,108 | 36 | 9 | null | 2022-01-31T09:46:26 | 2022-01-31T02:43:22 | Java | UTF-8 | Java | false | false | 45,321 | java | package com.tencent.mm.plugin.performance.b;
import android.os.Environment;
import android.os.Looper;
import android.os.SystemClock;
import android.util.Pair;
import android.util.Printer;
import com.tencent.matrix.trace.core.AppMethodBeat;
import com.tencent.mm.app.q;
import com.tencent.mm.app.r;
import com.tencent.mm.plugin.expt.b.c.a;
import com.tencent.mm.pluginsdk.model.ab;
import com.tencent.mm.pluginsdk.model.ab.a;
import com.tencent.mm.sdk.platformtools.Log;
import com.tencent.mm.sdk.platformtools.MMApplicationContext;
import com.tencent.mm.sdk.platformtools.MMHandler;
import com.tencent.mm.sdk.platformtools.MTimerHandler;
import com.tencent.threadpool.b;
import com.tencent.threadpool.d.e;
import com.tencent.threadpool.d.f;
import com.tencent.threadpool.g.b;
import java.io.File;
import java.lang.ref.WeakReference;
import java.util.ArrayList;
import java.util.Collection;
import java.util.Comparator;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Iterator;
import java.util.LinkedHashMap;
import java.util.LinkedList;
import java.util.List;
import java.util.Map;
import java.util.Map.Entry;
import java.util.Random;
import java.util.Set;
import java.util.concurrent.BlockingQueue;
import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.atomic.AtomicInteger;
import java.util.concurrent.atomic.AtomicLong;
import kotlin.Metadata;
import kotlin.a.p;
import kotlin.ah;
import kotlin.g.b.s;
import kotlin.g.b.u;
import kotlin.j;
import kotlin.n.n;
@Metadata(d1={""}, d2={"Lcom/tencent/mm/plugin/performance/thread/ThreadPoolProfiler;", "Lcom/tencent/mm/app/IAppForegroundListener;", "Lcom/tencent/mm/pluginsdk/model/ScreenshotObserver$IOnScreenshotTakenListener;", "Lcom/tencent/mm/app/IPhoneScreenListener;", "()V", "aboutUITimer", "Lcom/tencent/mm/sdk/platformtools/MTimerHandler;", "batteryRecord", "Ljava/util/concurrent/ConcurrentHashMap;", "", "Lcom/tencent/mm/plugin/performance/thread/ThreadPoolProfiler$BatteryRecord;", "blowoutCount", "", "checkQueue", "Lcom/tencent/mm/plugin/performance/thread/ThreadPoolProfiler$CheckInfo;", "existThreadCount", "Ljava/util/concurrent/atomic/AtomicInteger;", "isNeedReport", "", "lastCheckTime", "", "lastDumpTime", "looperPrepareMonitor", "com/tencent/mm/plugin/performance/thread/ThreadPoolProfiler$looperPrepareMonitor$1", "Lcom/tencent/mm/plugin/performance/thread/ThreadPoolProfiler$looperPrepareMonitor$1;", "mainLooperListener", "com/tencent/mm/plugin/performance/thread/ThreadPoolProfiler$mainLooperListener$1", "Lcom/tencent/mm/plugin/performance/thread/ThreadPoolProfiler$mainLooperListener$1;", "mapOfRunningTasks", "Lcom/tencent/mm/plugin/performance/thread/ThreadPoolProfiler$TaskStatusInfo;", "maxBlowoutCount", "methodInfoMap", "Ljava/util/HashMap;", "", "Landroid/util/Pair;", "Lkotlin/collections/HashMap;", "otherTaskCount", "Ljava/util/concurrent/atomic/AtomicLong;", "otherThreadTime", "otherTime", "runCallback", "com/tencent/mm/plugin/performance/thread/ThreadPoolProfiler$runCallback$1", "Lcom/tencent/mm/plugin/performance/thread/ThreadPoolProfiler$runCallback$1;", "runnableMethodInfo", "Ljava/util/ArrayList;", "Lkotlin/collections/ArrayList;", "runningCount", "screenShotObserver", "Lcom/tencent/mm/pluginsdk/model/ScreenshotObserver;", "screenShotObserver2", "screenShotPath", "screenShotPath2", "taskPrinter", "com/tencent/mm/plugin/performance/thread/ThreadPoolProfiler$taskPrinter$1", "Lcom/tencent/mm/plugin/performance/thread/ThreadPoolProfiler$taskPrinter$1;", "threadPrinter", "com/tencent/mm/plugin/performance/thread/ThreadPoolProfiler$threadPrinter$1", "Lcom/tencent/mm/plugin/performance/thread/ThreadPoolProfiler$threadPrinter$1;", "timeRecord", "Lcom/tencent/mm/plugin/performance/thread/ThreadPoolProfiler$TimeRecord;", "uiBusyConcurrent", "", "uiTaskCount", "uiThreadTime", "uiTime", "checkExpiredTask", "", "dumpRunningTasks", "dumpThreadPool", "dumpUIAbout", "getStackTrace", "thread", "Ljava/lang/Thread;", "onAppBackground", "activity", "onAppForeground", "onScreen", "isScreenOff", "onScreenshotTaken", "path", "open", "isProcessMain", "reportStatistics", "BatteryRecord", "CheckInfo", "Companion", "ReportType", "TaskStatusInfo", "TimeRecord", "plugin-performance_release"}, k=1, mv={1, 5, 1}, xi=48)
public final class a
implements q, r, ab.a
{
public static final a.c MLE;
private static final j<Integer> MMf;
public static boolean eYL;
private long GgE;
private final ConcurrentHashMap<String, a.g> Gln;
private final AtomicInteger MLF;
private final AtomicInteger MLG;
private final ConcurrentHashMap<String, a.b> MLH;
private final boolean MLI;
private final ConcurrentHashMap<String, a.f> MLJ;
private final ConcurrentHashMap<String, a.a> MLK;
private volatile int MLL;
private int MLM;
private AtomicLong MLN;
private AtomicLong MLO;
private AtomicLong MLP;
private AtomicLong MLQ;
private AtomicLong MLR;
private AtomicLong MLS;
private int[] MLT;
public final n MLU;
public final i MLV;
public final m MLW;
private final ArrayList<Pair<String, String>> MLX;
private final String MLY;
private final String MLZ;
private final ab MMa;
private final ab MMb;
private final j MMc;
public final MTimerHandler MMd;
private final l MMe;
private long lastCheckTime;
private final HashMap<String, List<Pair<String, String>>> zCa;
static
{
AppMethodBeat.i(184684);
MLE = new a.c((byte)0);
MMf = kotlin.k.cm((kotlin.g.a.a)d.MMh);
AppMethodBeat.o(184684);
}
public a()
{
AppMethodBeat.i(184683);
this.MLF = new AtomicInteger();
this.MLG = new AtomicInteger();
this.MLH = new ConcurrentHashMap();
int i;
int j;
if ((com.tencent.mm.protocal.d.Yxi) || (com.tencent.mm.protocal.d.Yxj))
{
i = ((com.tencent.mm.plugin.expt.b.c)com.tencent.mm.kernel.h.ax(com.tencent.mm.plugin.expt.b.c.class)).a(c.a.yLa, 10);
j = new Random().nextInt(100000);
if (i < j) {
break label557;
}
}
label557:
for (boolean bool = true;; bool = false)
{
Log.i("ThreadPool.Profiler", "[isNeedReport] rand=" + i + " test=" + j + " isEnable=" + bool + " isRelease=" + com.tencent.mm.protocal.d.Yxi + " isTest=" + com.tencent.mm.protocal.d.Yxj);
this.MLI = bool;
this.MLJ = new ConcurrentHashMap();
this.MLK = new ConcurrentHashMap(100);
this.Gln = new ConcurrentHashMap(100);
this.MLN = new AtomicLong();
this.MLO = new AtomicLong();
this.MLP = new AtomicLong();
this.MLQ = new AtomicLong();
this.MLR = new AtomicLong();
this.MLS = new AtomicLong();
this.MLT = new int[2];
this.MLU = new n(this);
this.MLV = new i(this);
this.MLW = new m(this);
this.zCa = new HashMap();
this.MLX = new ArrayList();
this.MLY = (Environment.getExternalStorageDirectory().getPath() + File.separator + Environment.DIRECTORY_PICTURES + File.separator + "Screenshots" + File.separator);
this.MLZ = (Environment.getExternalStorageDirectory().getPath() + File.separator + Environment.DIRECTORY_DCIM + File.separator + "Screenshots" + File.separator);
this.MMa = new ab(this.MLY, (ab.a)this);
this.MMb = new ab(this.MLZ, (ab.a)this);
this.MMc = new j(this);
this.MMd = new MTimerHandler(com.tencent.threadpool.j.a.bFV("ThreadPool.Profiler"), new a..ExternalSyntheticLambda0(this), true);
this.MMe = new l(this);
AppMethodBeat.o(184683);
return;
i = ((com.tencent.mm.plugin.expt.b.c)com.tencent.mm.kernel.h.ax(com.tencent.mm.plugin.expt.b.c.class)).a(c.a.yLb, 100000);
break;
}
}
private static final boolean a(a parama)
{
AppMethodBeat.i(300856);
s.u(parama, "this$0");
parama.gzi();
AppMethodBeat.o(300856);
return true;
}
private final void gzh()
{
AppMethodBeat.i(184681);
StringBuilder localStringBuilder = new StringBuilder(" \n[RunningTask]\n");
Object localObject1 = com.tencent.threadpool.h.ahAB.jYS();
s.s(localObject1, "PROFILE.dumpRunningTask()");
localObject1 = ((Map)localObject1).entrySet().iterator();
Object localObject3;
Object localObject2;
while (((Iterator)localObject1).hasNext())
{
localObject3 = (Map.Entry)((Iterator)localObject1).next();
localObject2 = localStringBuilder.append("\t").append((String)((Map.Entry)localObject3).getKey()).append(" => ");
localObject3 = ((Map.Entry)localObject3).getValue();
s.s(localObject3, "it.value");
((StringBuilder)localObject2).append(((Number)localObject3).intValue()).append("\n");
}
Log.i("ThreadPool.Profiler", s.X("[dumpThreadPool] ", localStringBuilder));
s.s(localStringBuilder, "sb");
n.i(localStringBuilder);
localStringBuilder.append(" \n[WaitingTask]\n");
localObject1 = com.tencent.threadpool.h.ahAB.jYT();
s.s(localObject1, "PROFILE.dumpWaitingTask()");
localObject1 = ((Map)localObject1).entrySet().iterator();
while (((Iterator)localObject1).hasNext())
{
localObject2 = (Map.Entry)((Iterator)localObject1).next();
localStringBuilder.append("# ").append((String)((Map.Entry)localObject2).getKey()).append("\n");
localObject2 = ((Map.Entry)localObject2).getValue();
s.s(localObject2, "entry.value");
localObject2 = ((Iterable)localObject2).iterator();
while (((Iterator)localObject2).hasNext())
{
Object localObject4 = (Pair)((Iterator)localObject2).next();
localObject3 = localStringBuilder.append("\t|* ").append((String)((Pair)localObject4).first).append(" => ");
localObject4 = ((Pair)localObject4).second;
s.s(localObject4, "it.second");
((StringBuilder)localObject3).append(((Number)localObject4).intValue()).append("\n");
}
}
Log.i("ThreadPool.Profiler", s.X("[dumpThreadPool] ", localStringBuilder));
Log.i("ThreadPool.Profiler", "[dumpThreadPool] Alive Thread Count = " + this.MLG.get() + " Global Running Count = " + this.MLF.get() + " maxRunningCount=" + this.MLL);
gzi();
AppMethodBeat.o(184681);
}
private final void gzi()
{
AppMethodBeat.i(184682);
Log.i("ThreadPool.Profiler", "[dumpThreadPool]\n averageUITime=" + (float)this.MLQ.get() * 1.0F / (float)this.MLS.get() + " averageUIThreadTime=" + (float)this.MLR.get() * 1.0F / (float)this.MLS.get() + "\naverageOtherTime=" + (float)this.MLN.get() * 1.0F / (float)this.MLP.get() + " averageOtherThreadTime=" + (float)this.MLO.get() * 1.0F / (float)this.MLP.get() + "\nuiTaskCount=" + this.MLS.get() + " otherTaskCount=" + this.MLP.get() + "\nuiBusyConcurrent=" + this.MLT[1] + " averageUIConcurrent=" + this.MLT[0] * 1.0F / this.MLT[1] + " concurrentRadio=" + this.MLT[1] * 1.0F / (float)this.MLS.get());
AppMethodBeat.o(184682);
}
public final void gzf()
{
AppMethodBeat.i(184680);
if (!eYL)
{
AppMethodBeat.o(184680);
return;
}
com.tencent.mm.ae.c localc = new com.tencent.mm.ae.c("ThreadPool.Profiler#onScreenshotTaken");
gzh();
localc.bbW();
AppMethodBeat.o(184680);
}
public final void gzg()
{
AppMethodBeat.i(300967);
long l = SystemClock.uptimeMillis();
if (l - this.GgE < 300000L)
{
AppMethodBeat.o(300967);
return;
}
this.MLW.gzg();
this.GgE = l;
AppMethodBeat.o(300967);
}
public final void onAppBackground(String paramString)
{
AppMethodBeat.i(184679);
if (!eYL)
{
AppMethodBeat.o(184679);
return;
}
this.MMa.stopWatching();
this.MMb.stopWatching();
AppMethodBeat.o(184679);
}
public final void onAppForeground(String paramString)
{
AppMethodBeat.i(184678);
if (!eYL)
{
AppMethodBeat.o(184678);
return;
}
this.MMa.startWatching();
this.MMb.startWatching();
AppMethodBeat.o(184678);
}
public final void onScreen(boolean paramBoolean)
{
AppMethodBeat.i(184677);
long l;
LinkedList localLinkedList;
Object localObject2;
Object localObject1;
int i;
if (!paramBoolean)
{
l = SystemClock.uptimeMillis();
if ((l - this.lastCheckTime >= 900000L) && (this.MLI))
{
localLinkedList = new LinkedList();
localObject2 = (Map)this.MLH;
localObject1 = (Map)new LinkedHashMap();
localObject2 = ((Map)localObject2).entrySet().iterator();
label176:
while (((Iterator)localObject2).hasNext())
{
localObject3 = (Map.Entry)((Iterator)localObject2).next();
if ((SystemClock.uptimeMillis() - ((a.b)((Map.Entry)localObject3).getValue()).time >= 60000L) && (((a.b)((Map.Entry)localObject3).getValue()).type == 0)) {}
for (i = 1;; i = 0)
{
if (i == 0) {
break label176;
}
((Map)localObject1).put(((Map.Entry)localObject3).getKey(), ((Map.Entry)localObject3).getValue());
break;
}
}
Object localObject4 = ((Map)localObject1).entrySet().iterator();
i = 0;
Object localObject5;
if (((Iterator)localObject4).hasNext())
{
localObject5 = (Map.Entry)((Iterator)localObject4).next();
localObject1 = ((Map.Entry)localObject5).getKey();
if (n.a((CharSequence)localObject1, '@', 0, false, 6) >= 0)
{
i = 1;
label247:
if (i == 0) {
break label591;
}
label251:
localObject1 = (String)localObject1;
if (localObject1 != null) {
break label597;
}
localObject1 = null;
label266:
if (localObject1 != null) {
break label622;
}
localObject2 = (CharSequence)((Map.Entry)localObject5).getKey();
label286:
localObject1 = ((Map.Entry)localObject5).getKey();
if (n.a((CharSequence)localObject1, '#', 0, false, 6) < 0) {
break label629;
}
i = 1;
label317:
if (i == 0) {
break label634;
}
label321:
localObject1 = (String)localObject1;
if (localObject1 != null) {
break label640;
}
localObject1 = null;
label336:
localObject3 = localObject1;
if (localObject1 == null) {
localObject3 = (CharSequence)((Map.Entry)localObject5).getKey();
}
localObject1 = com.tencent.threadpool.j.a.bFW(localObject3.toString());
if (localObject1 != null) {
break label665;
}
localObject1 = null;
label378:
StringBuilder localStringBuilder = new StringBuilder().append((String)((Map.Entry)localObject5).getKey()).append(" has expired ").append(SystemClock.uptimeMillis() - ((a.b)((Map.Entry)localObject5).getValue()).time).append("ms size=");
if (localObject1 != null) {
break label675;
}
localObject3 = null;
label440:
localObject3 = localStringBuilder.append(localObject3).append(" queue is null=");
if (localObject1 != null) {
break label700;
}
paramBoolean = true;
label462:
localStringBuilder = ((StringBuilder)localObject3).append(paramBoolean).append(" isRunning=");
if (localObject1 != null) {
break label705;
}
localObject3 = null;
label484:
localObject3 = localObject3;
Log.e("ThreadPool.Profiler", (String)localObject3);
if (localObject1 != null) {
break label718;
}
i = 0;
}
for (;;)
{
com.tencent.mm.plugin.report.f.Ozc.b(18762, new Object[] { Integer.valueOf(e.MMi.value), localObject3, localObject2, Integer.valueOf(17), MMApplicationContext.getProcessName(), Integer.valueOf(i) });
localLinkedList.add(((Map.Entry)localObject5).getKey());
i = 1;
break;
i = 0;
break label247;
label591:
localObject1 = null;
break label251;
label597:
localObject1 = ((String)localObject1).subSequence(0, n.a((CharSequence)localObject1, '@', 0, false, 6));
break label266;
label622:
localObject2 = localObject1;
break label286;
label629:
i = 0;
break label317;
label634:
localObject1 = null;
break label321;
label640:
localObject1 = ((String)localObject1).subSequence(0, n.a((CharSequence)localObject1, '#', 0, false, 6));
break label336;
label665:
localObject1 = ((com.tencent.threadpool.j.a)localObject1).ahCy;
break label378;
label675:
localObject3 = Integer.valueOf(((com.tencent.threadpool.j.d)localObject1).ahCJ.size() + ((com.tencent.threadpool.j.d)localObject1).ahCI.size());
break label440;
label700:
paramBoolean = false;
break label462;
label705:
localObject3 = Boolean.valueOf(((com.tencent.threadpool.j.d)localObject1).Uz);
break label484;
label718:
if (((com.tencent.threadpool.j.d)localObject1).Uz) {
i = 2;
} else {
i = 1;
}
}
}
localObject1 = b.ahzY;
s.s(localObject1, "sGlobalForkThreadPool");
Object localObject3 = ((Iterable)localObject1).iterator();
if (((Iterator)localObject3).hasNext())
{
localObject5 = (b)((WeakReference)((Iterator)localObject3).next()).get();
if (localObject5 == null) {
break label1402;
}
localObject4 = ((b)localObject5).name;
int j = (int)((b)localObject5).jYQ();
int k = ((b)localObject5).ahzZ.size();
localObject2 = (a.b)this.MLH.get(localObject4);
localObject1 = localObject2;
if (localObject2 == null)
{
localObject1 = new a.b(SystemClock.uptimeMillis(), 1);
localObject2 = (Map)this.MLH;
s.s(localObject4, "key");
((Map)localObject2).put(localObject4, localObject1);
}
int m = ((a.b)localObject1).count;
if ((j > 0) && (k > 0) && (j - m == 0) && (SystemClock.uptimeMillis() - ((a.b)localObject1).time >= 60000L))
{
localObject2 = "[ForkThreadPoolExecutor] " + localObject4 + " has expired " + (SystemClock.uptimeMillis() - ((a.b)localObject1).time) + "ms " + localObject5;
Log.e("ThreadPool.Profiler", (String)localObject2);
com.tencent.mm.plugin.report.f.Ozc.b(18762, new Object[] { Integer.valueOf(e.MMi.value), localObject2, localObject4, Integer.valueOf(17), MMApplicationContext.getProcessName() });
localLinkedList.add(localObject4);
i = 1;
label1040:
((a.b)localObject1).count = j;
localObject1 = ah.aiuX;
}
}
}
}
label1402:
for (;;)
{
break;
((a.b)localObject1).time = SystemClock.uptimeMillis();
break label1040;
if (i != 0) {
gzh();
}
localObject1 = ((Iterable)localLinkedList).iterator();
while (((Iterator)localObject1).hasNext())
{
localObject2 = (String)((Iterator)localObject1).next();
this.MLH.remove(localObject2);
}
try
{
if (this.MLK.values().size() > 1)
{
localObject1 = this.MLK.values();
s.s(localObject1, "batteryRecord.values");
localObject1 = (Iterable)p.a((Iterable)localObject1, (Comparator)new a.h()).subList(0, kotlin.k.k.qv(30, this.MLK.values().size() - 1));
i = 0;
localObject1 = ((Iterable)localObject1).iterator();
while (((Iterator)localObject1).hasNext())
{
localObject2 = ((Iterator)localObject1).next();
if (i < 0) {
p.kkW();
}
localObject2 = (a.a)localObject2;
Log.i("ThreadPool.Profiler", "[batteryRecord]#" + i + ' ' + localObject2);
com.tencent.mm.plugin.report.f.Ozc.b(18883, new Object[] { Integer.valueOf(17), Integer.valueOf(e.MMw.value), Long.valueOf(((a.a)localObject2).MMg), MMApplicationContext.getProcessName(), ((a.a)localObject2).name, Integer.valueOf(((a.a)localObject2).count) });
i += 1;
}
this.MLK.clear();
}
}
catch (Exception localException)
{
for (;;)
{
Log.printErrStackTrace("ThreadPool.Profiler", (Throwable)localException, "", new Object[0]);
}
}
this.lastCheckTime = l;
gzg();
AppMethodBeat.o(184677);
return;
}
}
@Metadata(d1={""}, d2={"<anonymous>", ""}, k=3, mv={1, 5, 1}, xi=48)
static final class d
extends u
implements kotlin.g.a.a<Integer>
{
public static final d MMh;
static
{
AppMethodBeat.i(184654);
MMh = new d();
AppMethodBeat.o(184654);
}
d()
{
super();
}
}
@Metadata(d1={""}, d2={"Lcom/tencent/mm/plugin/performance/thread/ThreadPoolProfiler$ReportType;", "", "value", "", "(Ljava/lang/String;II)V", "getValue", "()I", "TYPE_EXPIRED", "TYPE_CONTROL", "TYPE_REJECT", "TYPE_TIMEOUT", "TYPE_STATISTICS_COUNT_BLOWOUT", "TYPE_STATISTICS_UI_TIME", "TYPE_STATISTICS_UI_THREAD_TIME", "TYPE_STATISTICS_UI_TIME_RADIO", "TYPE_STATISTICS_OTHER_TIME", "TYPE_STATISTICS_OTHER_THREAD_TIME", "TYPE_STATISTICS_OTHER_TIME_RADIO", "TYPE_STATISTICS_THREAD_COUNT", "TYPE_STATISTICS_UI_OTHER_AVERAGE", "TYPE_STATISTICS_MAX_COUNT_BLOWOUT", "TYPE_STATISTICS_TASK_THREAD_TIME", "TYPE_LOOPER_PREPARE", "plugin-performance_release"}, k=1, mv={1, 5, 1}, xi=48)
public static enum e
{
final int value;
static
{
AppMethodBeat.i(184657);
MMi = new e("TYPE_EXPIRED", 0, 1);
MMj = new e("TYPE_CONTROL", 1, 2);
MMk = new e("TYPE_REJECT", 2, 3);
MMl = new e("TYPE_TIMEOUT", 3, 4);
MMm = new e("TYPE_STATISTICS_COUNT_BLOWOUT", 4, 5);
MMn = new e("TYPE_STATISTICS_UI_TIME", 5, 6);
MMo = new e("TYPE_STATISTICS_UI_THREAD_TIME", 6, 7);
MMp = new e("TYPE_STATISTICS_UI_TIME_RADIO", 7, 8);
MMq = new e("TYPE_STATISTICS_OTHER_TIME", 8, 9);
MMr = new e("TYPE_STATISTICS_OTHER_THREAD_TIME", 9, 10);
MMs = new e("TYPE_STATISTICS_OTHER_TIME_RADIO", 10, 11);
MMt = new e("TYPE_STATISTICS_THREAD_COUNT", 11, 12);
MMu = new e("TYPE_STATISTICS_UI_OTHER_AVERAGE", 12, 13);
MMv = new e("TYPE_STATISTICS_MAX_COUNT_BLOWOUT", 13, 14);
MMw = new e("TYPE_STATISTICS_TASK_THREAD_TIME", 14, 15);
MMx = new e("TYPE_LOOPER_PREPARE", 15, 16);
MMy = new e[] { MMi, MMj, MMk, MMl, MMm, MMn, MMo, MMp, MMq, MMr, MMs, MMt, MMu, MMv, MMw, MMx };
AppMethodBeat.o(184657);
}
private e(int paramInt)
{
this.value = paramInt;
}
}
@Metadata(d1={""}, d2={"com/tencent/mm/plugin/performance/thread/ThreadPoolProfiler$looperPrepareMonitor$1", "Lcom/tencent/threadpool/ThreadModuleBoot$ILooperPrepareMonitor;", "isResetLooper", "", "()Z", "reportMap", "Ljava/util/concurrent/ConcurrentHashMap;", "", "getReportMap", "()Ljava/util/concurrent/ConcurrentHashMap;", "isHookResetLooper", "isOpenCheck", "isThrowException", "onLooperPreparedAtTask", "", "thread", "Ljava/lang/Thread;", "task", "plugin-performance_release"}, k=1, mv={1, 5, 1}, xi=48)
public static final class i
implements g.b
{
private final ConcurrentHashMap<String, String> EVH;
private final boolean MMD;
i(a parama)
{
AppMethodBeat.i(300831);
boolean bool = ((com.tencent.mm.plugin.expt.b.c)com.tencent.mm.kernel.h.ax(com.tencent.mm.plugin.expt.b.c.class)).a(c.a.yLc, true);
Log.w("ThreadPool.Profiler", s.X("[isHookResetLooper] ", Boolean.valueOf(bool)));
parama = ah.aiuX;
this.MMD = bool;
this.EVH = new ConcurrentHashMap();
AppMethodBeat.o(300831);
}
public final void a(Thread paramThread, String paramString)
{
AppMethodBeat.i(300845);
s.u(paramThread, "thread");
s.u(paramString, "task");
if (a.d(this.MME))
{
Object localObject = (CharSequence)paramString;
localObject = new kotlin.n.k("[0-9]\\d*").e((CharSequence)localObject, "?");
if (!this.EVH.contains(localObject))
{
String str = "task=" + (String)localObject + ' ' + paramThread;
Log.w("ThreadPool.Profiler", s.X("[onLooperPreparedAtTask] ", str));
com.tencent.mm.plugin.report.f.Ozc.b(18762, new Object[] { Integer.valueOf(a.e.MMx.value), str, paramString, Integer.valueOf(17), MMApplicationContext.getProcessName() });
((Map)this.EVH).put(localObject, String.valueOf(paramThread));
}
}
AppMethodBeat.o(300845);
}
public final boolean gzk()
{
return true;
}
public final boolean gzl()
{
return false;
}
public final boolean gzm()
{
return this.MMD;
}
}
@Metadata(d1={""}, d2={"com/tencent/mm/plugin/performance/thread/ThreadPoolProfiler$mainLooperListener$1", "Landroid/util/Printer;", "record", "Lcom/tencent/mm/plugin/performance/thread/ThreadPoolProfiler$TimeRecord;", "getRecord", "()Lcom/tencent/mm/plugin/performance/thread/ThreadPoolProfiler$TimeRecord;", "setRecord", "(Lcom/tencent/mm/plugin/performance/thread/ThreadPoolProfiler$TimeRecord;)V", "onDispatchEnd", "", "x", "", "onDispatchStart", "println", "plugin-performance_release"}, k=1, mv={1, 5, 1}, xi=48)
public static final class j
implements Printer
{
private a.g MMF;
j(a parama)
{
AppMethodBeat.i(184664);
this.MMF = new a.g(true, SystemClock.uptimeMillis(), SystemClock.currentThreadTimeMillis(), (byte)0);
AppMethodBeat.o(184664);
}
public final void println(String paramString)
{
AppMethodBeat.i(184663);
s.u(paramString, "x");
if (paramString.charAt(0) == '>')
{
s.u(paramString, "x");
this.MMF.time = SystemClock.uptimeMillis();
this.MMF.MMg = SystemClock.currentThreadTimeMillis();
int i = a.h(this.MME).get();
if (i > 0)
{
paramString = a.i(this.MME);
paramString[0] = (i + paramString[0]);
paramString = a.i(this.MME);
paramString[1] += 1;
}
AppMethodBeat.o(184663);
return;
}
if (paramString.charAt(0) == '<')
{
s.u(paramString, "x");
paramString = this.MMF;
a locala = this.MME;
long l1 = SystemClock.uptimeMillis();
long l2 = paramString.time;
long l3 = SystemClock.currentThreadTimeMillis();
long l4 = paramString.MMg;
a.j(locala).addAndGet(l1 - l2);
a.k(locala).addAndGet(l3 - l4);
a.l(locala).incrementAndGet();
}
AppMethodBeat.o(184663);
}
}
@Metadata(d1={""}, d2={"com/tencent/mm/plugin/performance/thread/ThreadPoolProfiler$open$1", "Ljava/lang/Runnable;", "run", "", "plugin-performance_release"}, k=1, mv={1, 5, 1}, xi=48)
public static final class k
implements Runnable
{
public k(a parama, MMHandler paramMMHandler) {}
public final void run()
{
AppMethodBeat.i(184665);
a.b(this.MME);
this.GlF.postDelayed((Runnable)this, 1800000L);
AppMethodBeat.o(184665);
}
}
@Metadata(d1={""}, d2={"com/tencent/mm/plugin/performance/thread/ThreadPoolProfiler$runCallback$1", "Lcom/tencent/mm/hellhoundlib/method/IHellMethodMonitorCallback;", "mainThreadId", "", "getMainThreadId", "()J", "runOnEnter", "", "className", "", "methodName", "methodDec", "caller", "", "args", "", "(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/Object;[Ljava/lang/Object;)V", "runOnExit", "retVal", "plugin-performance_release"}, k=1, mv={1, 5, 1}, xi=48)
public static final class l
implements com.tencent.mm.hellhoundlib.a.d
{
private final long MMG;
l(a parama)
{
AppMethodBeat.i(184668);
this.MMG = Looper.getMainLooper().getThread().getId();
AppMethodBeat.o(184668);
}
public final void a(String paramString1, String paramString2, String paramString3, Object paramObject1, Object paramObject2)
{
AppMethodBeat.i(300822);
s.u(paramString1, "className");
a.h(this.MME).decrementAndGet();
if (this.MMG != Thread.currentThread().getId())
{
paramString2 = a.o(this.MME);
paramString1 = new StringBuilder().append(paramString1);
if (paramObject1 == null) {
break label156;
}
}
label156:
for (int i = paramObject1.hashCode();; i = 0)
{
paramString1 = (a.g)paramString2.remove(i);
if (paramString1 != null)
{
paramString2 = this.MME;
long l1 = SystemClock.uptimeMillis();
long l2 = paramString1.time;
long l3 = SystemClock.currentThreadTimeMillis();
long l4 = paramString1.MMg;
a.p(paramString2).addAndGet(l3 - l4);
a.q(paramString2).addAndGet(l1 - l2);
a.r(paramString2).incrementAndGet();
}
AppMethodBeat.o(300822);
return;
}
}
public final void a(String paramString1, String paramString2, String paramString3, Object paramObject, Object[] paramArrayOfObject)
{
AppMethodBeat.i(184666);
s.u(paramString1, "className");
int i = a.h(this.MME).incrementAndGet();
if (i > a.m(this.MME)) {
a.a(this.MME, i);
}
paramString2 = a.MLE;
if (i > ((Number)a.gzj().getValue()).intValue())
{
paramString2 = this.MME;
a.b(paramString2, a.n(paramString2) + 1);
}
if (this.MMG != Thread.currentThread().getId())
{
paramString2 = (Map)a.o(this.MME);
paramString1 = new StringBuilder().append(paramString1);
if (paramObject == null) {
break label168;
}
}
label168:
for (i = paramObject.hashCode();; i = 0)
{
paramString2.put(i, new a.g(false, SystemClock.uptimeMillis(), SystemClock.currentThreadTimeMillis(), (byte)0));
AppMethodBeat.o(184666);
return;
}
}
}
@Metadata(d1={""}, d2={"com/tencent/mm/plugin/performance/thread/ThreadPoolProfiler$taskPrinter$1", "Lcom/tencent/threadpool/Printer$TaskPrinter;", "dumpRunningTasks", "", "error", "key", "", "hash", "", "e", "", "print", "state", "Lcom/tencent/threadpool/State;", "time", "", "costThreadMs", "pool", "isLogging", "", "rejected", "isShutdown", "shutdown", "wait", "runningCount", "waitFor", "plugin-performance_release"}, k=1, mv={1, 5, 1}, xi=48)
public static final class m
implements d.e
{
m(a parama) {}
public final void a(String paramString1, int paramInt1, int paramInt2, long paramLong, String paramString2)
{
AppMethodBeat.i(184671);
s.u(paramString1, "key");
s.u(paramString2, "pool");
paramString2 = "[wait] " + paramString1 + '@' + paramInt1 + " runningCount=" + paramInt2 + " waitFor=" + paramLong / 100000L + "ms " + paramString2;
Log.w("ThreadPool.Profiler", paramString2);
String str = MMApplicationContext.getProcessName();
com.tencent.mm.plugin.report.f.Ozc.b(18762, new Object[] { Integer.valueOf(a.e.MMj.value), paramString2, paramString1, Integer.valueOf(17), str });
AppMethodBeat.o(184671);
}
public final void a(String paramString1, int paramInt, com.tencent.threadpool.f paramf, long paramLong1, long paramLong2, String paramString2, boolean paramBoolean)
{
AppMethodBeat.i(185183);
s.u(paramString1, "key");
s.u(paramf, "state");
s.u(paramString2, "pool");
int i;
Object localObject1;
if ((a.d(this.MME)) && (paramf == com.tencent.threadpool.f.ahAx))
{
if (n.a((CharSequence)paramString1, '@', 0, false, 6) < 0) {
break label204;
}
i = 1;
if (i == 0) {
break label210;
}
localObject1 = paramString1;
label68:
if (localObject1 != null) {
break label216;
}
localObject1 = null;
label76:
if (localObject1 != null) {
break label244;
}
localObject1 = paramString1;
}
label204:
label210:
label216:
label244:
for (;;)
{
Object localObject3 = (a.a)a.e(this.MME).get(localObject1);
localObject2 = localObject3;
if (localObject3 == null)
{
localObject3 = this.MME;
localObject2 = new a.a((String)localObject1);
((Map)a.e((a)localObject3)).put(localObject1, localObject2);
}
((a.a)localObject2).count += 1;
if (((a.a)localObject2).count % 2 == 1) {
((a.a)localObject2).MMg += 1L;
}
((a.a)localObject2).MMg += paramLong2;
if (paramBoolean) {
break label247;
}
AppMethodBeat.o(185183);
return;
i = 0;
break;
localObject1 = null;
break label68;
localObject1 = ((String)localObject1).subSequence(0, n.a((CharSequence)localObject1, '@', 0, false, 6)).toString();
break label76;
}
label247:
Object localObject2 = paramString1 + '@' + paramInt;
switch (a.$EnumSwitchMapping$0[paramf.ordinal()])
{
default:
case 1:
case 2:
do
{
AppMethodBeat.o(185183);
return;
if (paramLong1 < 0L) {}
for (paramLong1 = 0L;; paramLong1 /= 1000000L)
{
if (a.d(this.MME)) {
((Map)a.f(this.MME)).put(localObject2, new a.b(SystemClock.uptimeMillis() + paramLong1));
}
Log.d("ThreadPool.Execute", "=== " + (String)localObject2 + " state=" + paramf + " delay=" + paramLong1 + "ms");
((Map)a.g(this.MME)).put(localObject2, new a.f(System.currentTimeMillis(), paramLong1, paramf));
AppMethodBeat.o(185183);
return;
}
if (a.d(this.MME))
{
paramString1 = (a.b)a.f(this.MME).get(localObject2);
if (paramString1 != null) {
paramString1.thread = Thread.currentThread();
}
a.f(this.MME).remove(localObject2);
}
Log.d("ThreadPool.Execute", ">>> " + (String)localObject2 + " state=" + paramf + ' ' + paramString2);
paramString1 = (a.f)a.g(this.MME).get(localObject2);
if (paramString1 != null) {
paramString1.MMz = System.currentTimeMillis();
}
if (paramString1 != null)
{
s.u(paramf, "<set-?>");
paramString1.MMA = paramf;
}
} while (paramString1 == null);
paramString1.MMB = paramString2;
AppMethodBeat.o(185183);
return;
case 3:
localObject1 = (a.f)a.g(this.MME).remove(localObject2);
paramString2 = new StringBuilder("<<< ").append((String)localObject2).append(" state=").append(paramf).append(" cost=").append(paramLong1).append("ms/").append(paramLong2).append("ms ").append(paramString2).append(" start@=");
if (localObject1 == null)
{
paramf = null;
paramString2 = paramString2.append(paramf).append("ms delay=");
if (localObject1 != null) {
break label852;
}
paramf = null;
paramString2 = paramString2.append(paramf).append("ms run@=");
if (localObject1 != null) {
break label864;
}
}
for (paramf = null;; paramf = Long.valueOf(((a.f)localObject1).MMz))
{
paramf = paramf;
Log.i("ThreadPool.Execute", paramf);
if ((!a.d(this.MME)) || (paramLong1 < 600000L)) {
break;
}
paramString2 = MMApplicationContext.getProcessName();
com.tencent.mm.plugin.report.f.Ozc.b(18762, new Object[] { Integer.valueOf(a.e.MMl.value), paramf, paramString1, Integer.valueOf(17), paramString2 });
AppMethodBeat.o(185183);
return;
paramf = Long.valueOf(((a.f)localObject1).startTime);
break label706;
paramf = Long.valueOf(((a.f)localObject1).delayTime);
break label727;
}
case 4:
label706:
label727:
label864:
if (a.d(this.MME)) {
a.f(this.MME).remove(localObject2);
}
label852:
paramString2 = (a.f)a.g(this.MME).remove(localObject2);
paramf = new StringBuilder("||| ").append((String)localObject2).append(" state=").append(paramf).append(" start@=");
if (paramString2 == null)
{
paramString1 = null;
paramf = paramf.append(paramString1).append("ms delay=");
if (paramString2 != null) {
break label1023;
}
paramString1 = null;
label973:
paramf = paramf.append(paramString1).append("ms run@=");
if (paramString2 != null) {
break label1035;
}
}
label1035:
for (paramString1 = null;; paramString1 = Long.valueOf(paramString2.MMz))
{
Log.i("ThreadPool.Execute", paramString1);
AppMethodBeat.o(185183);
return;
paramString1 = Long.valueOf(paramString2.startTime);
break;
label1023:
paramString1 = Long.valueOf(paramString2.delayTime);
break label973;
}
}
if (a.d(this.MME)) {
a.f(this.MME).remove(localObject2);
}
paramString2 = (a.f)a.g(this.MME).remove(localObject2);
paramf = new StringBuilder("*** ").append((String)localObject2).append(" state=").append(paramf).append(" start@=");
if (paramString2 == null)
{
paramString1 = null;
label1125:
paramf = paramf.append(paramString1).append("ms delay=");
if (paramString2 != null) {
break label1191;
}
paramString1 = null;
label1144:
paramf = paramf.append(paramString1).append("ms run@=");
if (paramString2 != null) {
break label1203;
}
}
label1191:
label1203:
for (paramString1 = null;; paramString1 = Long.valueOf(paramString2.MMz))
{
Log.i("ThreadPool.Execute", paramString1);
break;
paramString1 = Long.valueOf(paramString2.startTime);
break label1125;
paramString1 = Long.valueOf(paramString2.delayTime);
break label1144;
}
}
public final void a(String paramString, int paramInt, Throwable paramThrowable)
{
AppMethodBeat.i(184670);
s.u(paramString, "key");
s.u(paramThrowable, "e");
Log.e("ThreadPool.Profiler", paramString + '@' + paramInt + ' ' + paramThrowable);
AppMethodBeat.o(184670);
}
public final void gzg()
{
AppMethodBeat.i(300836);
for (;;)
{
try
{
Iterator localIterator = ((Map)new HashMap((Map)a.g(this.MME))).entrySet().iterator();
if (!localIterator.hasNext()) {
break;
}
Map.Entry localEntry = (Map.Entry)localIterator.next();
StringBuilder localStringBuilder = new StringBuilder("~~~ ").append(localEntry.getKey()).append(" state=");
a.f localf = (a.f)localEntry.getValue();
if (localf == null)
{
localf = null;
localStringBuilder = localStringBuilder.append(localf).append(" pool=");
localf = (a.f)localEntry.getValue();
if (localf != null) {
break label274;
}
localf = null;
localStringBuilder = localStringBuilder.append(localf).append(" start@=");
localf = (a.f)localEntry.getValue();
if (localf != null) {
break label282;
}
localf = null;
localStringBuilder = localStringBuilder.append(localf).append("ms delay=");
localf = (a.f)localEntry.getValue();
if (localf != null) {
break label293;
}
localf = null;
localStringBuilder = localStringBuilder.append(localf).append("ms run@=");
localf = (a.f)localEntry.getValue();
if (localf != null) {
break label304;
}
localf = null;
Log.i("ThreadPool.Execute", localf);
continue;
}
localObject = localThrowable.MMA;
}
finally
{
Log.printErrStackTrace("ThreadPool.Profiler", localThrowable, "", new Object[0]);
AppMethodBeat.o(300836);
return;
}
continue;
label274:
Object localObject = ((a.f)localObject).MMB;
continue;
label282:
localObject = Long.valueOf(((a.f)localObject).startTime);
continue;
label293:
localObject = Long.valueOf(((a.f)localObject).delayTime);
continue;
label304:
long l = ((a.f)localObject).MMz;
localObject = Long.valueOf(l);
}
AppMethodBeat.o(300836);
}
public final void h(String paramString1, int paramInt, String paramString2)
{
AppMethodBeat.i(184672);
s.u(paramString1, "key");
s.u(paramString2, "pool");
paramString2 = "[rejected] " + paramString1 + ' ' + paramString2 + " isShutdown=true";
Log.w("ThreadPool.Profiler", paramString2);
if (a.d(this.MME))
{
a.f(this.MME).remove(paramString1 + '@' + paramInt);
String str = MMApplicationContext.getProcessName();
com.tencent.mm.plugin.report.f.Ozc.b(18762, new Object[] { Integer.valueOf(a.e.MMk.value), paramString2, paramString1, Integer.valueOf(17), str });
}
AppMethodBeat.o(184672);
}
public final void shutdown()
{
AppMethodBeat.i(184673);
Log.w("ThreadPool.Profiler", "shutdown");
a.f(this.MME).clear();
AppMethodBeat.o(184673);
}
}
@Metadata(d1={""}, d2={"com/tencent/mm/plugin/performance/thread/ThreadPoolProfiler$threadPrinter$1", "Lcom/tencent/threadpool/Printer$ThreadPrinter;", "onExit", "", "thread", "Ljava/lang/Thread;", "name", "", "id", "", "onInterrupt", "onStart", "plugin-performance_release"}, k=1, mv={1, 5, 1}, xi=48)
public static final class n
implements d.f
{
n(a parama) {}
public final void a(Thread paramThread, String paramString, long paramLong)
{
AppMethodBeat.i(184674);
s.u(paramThread, "thread");
s.u(paramString, "name");
Log.i("ThreadPool.Profiler", "[onInterrupt] name=" + paramString + " id=" + paramLong);
AppMethodBeat.o(184674);
}
public final void b(Thread paramThread, String paramString, long paramLong)
{
AppMethodBeat.i(184675);
s.u(paramThread, "thread");
s.u(paramString, "name");
Log.i("ThreadPool.Profiler", "[onThreadStart] name=" + paramString + " id=" + paramLong);
a.c(this.MME).incrementAndGet();
AppMethodBeat.o(184675);
}
public final void c(Thread paramThread, String paramString, long paramLong)
{
AppMethodBeat.i(184676);
s.u(paramThread, "thread");
s.u(paramString, "name");
Log.i("ThreadPool.Profiler", "[onThreadExit] name=" + paramString + " id=" + paramLong);
a.c(this.MME).decrementAndGet();
AppMethodBeat.o(184676);
}
}
}
/* Location: L:\local\mybackup\temp\qq_apk\com.tencent.mm\classes7.jar
* Qualified Name: com.tencent.mm.plugin.performance.b.a
* JD-Core Version: 0.7.0.1
*/ | [
"98632993+tsuzcx@users.noreply.github.com"
] | 98632993+tsuzcx@users.noreply.github.com |
60449a6990cd9b3df23d009d40f3efb7367fd285 | e9e7ab1d69a42719f6bfadc9b221b3fc82a3c1d2 | /src/main/java/ng/upperlink/nibss/cmms/dto/emandates/AuthenticationRequest.java | a44785434e9b96ce1865b20073342a62dcc74a50 | [] | no_license | jtobiora/cmms_central_lib_module | 375d26257d74fa4b0534d82f71a3720996ef9187 | d6bdcb8aae827a3150ede0ce7ba1e8d3a3060aba | refs/heads/master | 2020-05-05T03:28:39.207074 | 2019-04-05T12:10:29 | 2019-04-05T12:10:29 | 179,674,023 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,362 | java | package ng.upperlink.nibss.cmms.dto.emandates;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.ToString;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlRootElement;
import java.math.BigDecimal;
@Data
@ToString
@AllArgsConstructor
@NoArgsConstructor
@XmlRootElement
@XmlAccessorType(XmlAccessType.FIELD)
public class AuthenticationRequest {
@XmlElement(name = "SessionID")
private String sessionId;
@XmlElement(name = "RequestorID")
private String requestorID;
@XmlElement(name = "PayerPhoneNumber")
private String payerPhoneNumber;
@XmlElement(name = "Amount")
private BigDecimal amount;
@XmlElement(name = "AdditionalFIRequiredData")
private String additionalFIRequiredData;
@XmlElement(name = "FIInstitution")
private String fIInstitution;
@XmlElement(name = "AccountNumber")
private String accountNumber;
@XmlElement(name = "AccountName")
private String accountName;
@XmlElement(name = "PassCode")
private String passCode;
@XmlElement(name = "MandateReferenceNumber")
private String mandateReferenceNumber;
@XmlElement(name = "ProductCode")
private String productCode;
}
| [
"jtobiora@gmail.com"
] | jtobiora@gmail.com |
4ec0c67ce9cb23ad08a978398b8059ad2258dfd6 | 21bcd1da03415fec0a4f3fa7287f250df1d14051 | /sources/com/google/common/cache/C7425e.java | 46ed70245bd4968cf388041e38fb2102dac68a64 | [] | no_license | lestseeandtest/Delivery | 9a5cc96bd6bd2316a535271ec9ca3865080c3ec8 | bc3fae8f30804a2520e6699df92c2e6a4a0a7cfc | refs/heads/master | 2022-04-24T12:14:22.396398 | 2020-04-25T21:50:29 | 2020-04-25T21:50:29 | 258,875,870 | 0 | 1 | null | null | null | null | UTF-8 | Java | false | false | 17,663 | java | package com.google.common.cache;
import com.google.common.base.C5786c0;
import com.google.common.base.C5827t;
import com.google.common.base.C7397x;
import com.google.common.collect.C8257x2;
import com.google.common.collect.C8302z2;
import java.util.concurrent.TimeUnit;
import p076c.p112d.p148d.p149a.C2775a;
import p076c.p112d.p148d.p149a.C2778d;
import p201f.p202a.C5952h;
@C2775a
/* renamed from: com.google.common.cache.e */
/* compiled from: CacheBuilderSpec */
public final class C7425e {
/* renamed from: o */
private static final C5786c0 f20877o = C5786c0.m25366b(',').mo23076b();
/* renamed from: p */
private static final C5786c0 f20878p = C5786c0.m25366b('=').mo23076b();
/* renamed from: q */
private static final C8302z2<String, C7438m> f20879q;
@C2778d
/* renamed from: a */
Integer f20880a;
@C2778d
/* renamed from: b */
Long f20881b;
@C2778d
/* renamed from: c */
Long f20882c;
@C2778d
/* renamed from: d */
Integer f20883d;
@C2778d
/* renamed from: e */
C7496u f20884e;
@C2778d
/* renamed from: f */
C7496u f20885f;
@C2778d
/* renamed from: g */
Boolean f20886g;
@C2778d
/* renamed from: h */
long f20887h;
@C2778d
/* renamed from: i */
TimeUnit f20888i;
@C2778d
/* renamed from: j */
long f20889j;
@C2778d
/* renamed from: k */
TimeUnit f20890k;
@C2778d
/* renamed from: l */
long f20891l;
@C2778d
/* renamed from: m */
TimeUnit f20892m;
/* renamed from: n */
private final String f20893n;
/* renamed from: com.google.common.cache.e$a */
/* compiled from: CacheBuilderSpec */
static /* synthetic */ class C7426a {
/* renamed from: a */
static final /* synthetic */ int[] f20894a = new int[C7496u.values().length];
/* JADX WARNING: Can't wrap try/catch for region: R(6:0|1|2|3|4|6) */
/* JADX WARNING: Code restructure failed: missing block: B:7:?, code lost:
return;
*/
/* JADX WARNING: Failed to process nested try/catch */
/* JADX WARNING: Missing exception handler attribute for start block: B:3:0x0014 */
static {
/*
com.google.common.cache.j$u[] r0 = com.google.common.cache.C7447j.C7496u.values()
int r0 = r0.length
int[] r0 = new int[r0]
f20894a = r0
int[] r0 = f20894a // Catch:{ NoSuchFieldError -> 0x0014 }
com.google.common.cache.j$u r1 = com.google.common.cache.C7447j.C7496u.WEAK // Catch:{ NoSuchFieldError -> 0x0014 }
int r1 = r1.ordinal() // Catch:{ NoSuchFieldError -> 0x0014 }
r2 = 1
r0[r1] = r2 // Catch:{ NoSuchFieldError -> 0x0014 }
L_0x0014:
int[] r0 = f20894a // Catch:{ NoSuchFieldError -> 0x001f }
com.google.common.cache.j$u r1 = com.google.common.cache.C7447j.C7496u.SOFT // Catch:{ NoSuchFieldError -> 0x001f }
int r1 = r1.ordinal() // Catch:{ NoSuchFieldError -> 0x001f }
r2 = 2
r0[r1] = r2 // Catch:{ NoSuchFieldError -> 0x001f }
L_0x001f:
return
*/
throw new UnsupportedOperationException("Method not decompiled: com.google.common.cache.C7425e.C7426a.<clinit>():void");
}
}
/* renamed from: com.google.common.cache.e$b */
/* compiled from: CacheBuilderSpec */
static class C7427b extends C7429d {
C7427b() {
}
/* access modifiers changed from: protected */
/* renamed from: a */
public void mo29342a(C7425e eVar, long j, TimeUnit timeUnit) {
C7397x.m35671a(eVar.f20890k == null, (Object) "expireAfterAccess already set");
eVar.f20889j = j;
eVar.f20890k = timeUnit;
}
}
/* renamed from: com.google.common.cache.e$c */
/* compiled from: CacheBuilderSpec */
static class C7428c extends C7431f {
C7428c() {
}
/* access modifiers changed from: protected */
/* renamed from: a */
public void mo29343a(C7425e eVar, int i) {
C7397x.m35672a(eVar.f20883d == null, "concurrency level was already set to ", eVar.f20883d);
eVar.f20883d = Integer.valueOf(i);
}
}
/* renamed from: com.google.common.cache.e$d */
/* compiled from: CacheBuilderSpec */
static abstract class C7429d implements C7438m {
C7429d() {
}
/* access modifiers changed from: protected */
/* renamed from: a */
public abstract void mo29342a(C7425e eVar, long j, TimeUnit timeUnit);
/* renamed from: a */
public void mo29344a(C7425e eVar, String str, String str2) {
C7397x.m35672a((str2 == null || str2.length() == 0) ? false : true, "value of key %s omitted", str);
try {
char charAt = str2.charAt(str2.length() - 1);
long j = 1;
if (charAt == 'd') {
j = 24;
} else if (charAt != 'h') {
if (charAt != 'm') {
if (charAt == 's') {
mo29342a(eVar, Long.parseLong(str2.substring(0, str2.length() - 1)) * j, TimeUnit.SECONDS);
}
throw new IllegalArgumentException(String.format("key %s invalid format. was %s, must end with one of [dDhHmMsS]", new Object[]{str, str2}));
}
j *= 60;
mo29342a(eVar, Long.parseLong(str2.substring(0, str2.length() - 1)) * j, TimeUnit.SECONDS);
}
j *= 60;
j *= 60;
mo29342a(eVar, Long.parseLong(str2.substring(0, str2.length() - 1)) * j, TimeUnit.SECONDS);
} catch (NumberFormatException unused) {
throw new IllegalArgumentException(String.format("key %s value set to %s, must be integer", new Object[]{str, str2}));
}
}
}
/* renamed from: com.google.common.cache.e$e */
/* compiled from: CacheBuilderSpec */
static class C7430e extends C7431f {
C7430e() {
}
/* access modifiers changed from: protected */
/* renamed from: a */
public void mo29343a(C7425e eVar, int i) {
C7397x.m35672a(eVar.f20880a == null, "initial capacity was already set to ", eVar.f20880a);
eVar.f20880a = Integer.valueOf(i);
}
}
/* renamed from: com.google.common.cache.e$f */
/* compiled from: CacheBuilderSpec */
static abstract class C7431f implements C7438m {
C7431f() {
}
/* access modifiers changed from: protected */
/* renamed from: a */
public abstract void mo29343a(C7425e eVar, int i);
/* renamed from: a */
public void mo29344a(C7425e eVar, String str, String str2) {
C7397x.m35672a((str2 == null || str2.length() == 0) ? false : true, "value of key %s omitted", str);
try {
mo29343a(eVar, Integer.parseInt(str2));
} catch (NumberFormatException e) {
throw new IllegalArgumentException(String.format("key %s value set to %s, must be integer", new Object[]{str, str2}), e);
}
}
}
/* renamed from: com.google.common.cache.e$g */
/* compiled from: CacheBuilderSpec */
static class C7432g implements C7438m {
/* renamed from: a */
private final C7496u f20895a;
public C7432g(C7496u uVar) {
this.f20895a = uVar;
}
/* renamed from: a */
public void mo29344a(C7425e eVar, String str, @C5952h String str2) {
C7397x.m35672a(str2 == null, "key %s does not take values", str);
C7397x.m35672a(eVar.f20884e == null, "%s was already set to %s", str, eVar.f20884e);
eVar.f20884e = this.f20895a;
}
}
/* renamed from: com.google.common.cache.e$h */
/* compiled from: CacheBuilderSpec */
static abstract class C7433h implements C7438m {
C7433h() {
}
/* access modifiers changed from: protected */
/* renamed from: a */
public abstract void mo29345a(C7425e eVar, long j);
/* renamed from: a */
public void mo29344a(C7425e eVar, String str, String str2) {
C7397x.m35672a((str2 == null || str2.length() == 0) ? false : true, "value of key %s omitted", str);
try {
mo29345a(eVar, Long.parseLong(str2));
} catch (NumberFormatException e) {
throw new IllegalArgumentException(String.format("key %s value set to %s, must be integer", new Object[]{str, str2}), e);
}
}
}
/* renamed from: com.google.common.cache.e$i */
/* compiled from: CacheBuilderSpec */
static class C7434i extends C7433h {
C7434i() {
}
/* access modifiers changed from: protected */
/* renamed from: a */
public void mo29345a(C7425e eVar, long j) {
C7397x.m35672a(eVar.f20881b == null, "maximum size was already set to ", eVar.f20881b);
C7397x.m35672a(eVar.f20882c == null, "maximum weight was already set to ", eVar.f20882c);
eVar.f20881b = Long.valueOf(j);
}
}
/* renamed from: com.google.common.cache.e$j */
/* compiled from: CacheBuilderSpec */
static class C7435j extends C7433h {
C7435j() {
}
/* access modifiers changed from: protected */
/* renamed from: a */
public void mo29345a(C7425e eVar, long j) {
C7397x.m35672a(eVar.f20882c == null, "maximum weight was already set to ", eVar.f20882c);
C7397x.m35672a(eVar.f20881b == null, "maximum size was already set to ", eVar.f20881b);
eVar.f20882c = Long.valueOf(j);
}
}
/* renamed from: com.google.common.cache.e$k */
/* compiled from: CacheBuilderSpec */
static class C7436k implements C7438m {
C7436k() {
}
/* renamed from: a */
public void mo29344a(C7425e eVar, String str, @C5952h String str2) {
boolean z = false;
C7397x.m35671a(str2 == null, (Object) "recordStats does not take values");
if (eVar.f20886g == null) {
z = true;
}
C7397x.m35671a(z, (Object) "recordStats already set");
eVar.f20886g = Boolean.valueOf(true);
}
}
/* renamed from: com.google.common.cache.e$l */
/* compiled from: CacheBuilderSpec */
static class C7437l extends C7429d {
C7437l() {
}
/* access modifiers changed from: protected */
/* renamed from: a */
public void mo29342a(C7425e eVar, long j, TimeUnit timeUnit) {
C7397x.m35671a(eVar.f20892m == null, (Object) "refreshAfterWrite already set");
eVar.f20891l = j;
eVar.f20892m = timeUnit;
}
}
/* renamed from: com.google.common.cache.e$m */
/* compiled from: CacheBuilderSpec */
private interface C7438m {
/* renamed from: a */
void mo29344a(C7425e eVar, String str, @C5952h String str2);
}
/* renamed from: com.google.common.cache.e$n */
/* compiled from: CacheBuilderSpec */
static class C7439n implements C7438m {
/* renamed from: a */
private final C7496u f20896a;
public C7439n(C7496u uVar) {
this.f20896a = uVar;
}
/* renamed from: a */
public void mo29344a(C7425e eVar, String str, @C5952h String str2) {
C7397x.m35672a(str2 == null, "key %s does not take values", str);
C7397x.m35672a(eVar.f20885f == null, "%s was already set to %s", str, eVar.f20885f);
eVar.f20885f = this.f20896a;
}
}
/* renamed from: com.google.common.cache.e$o */
/* compiled from: CacheBuilderSpec */
static class C7440o extends C7429d {
C7440o() {
}
/* access modifiers changed from: protected */
/* renamed from: a */
public void mo29342a(C7425e eVar, long j, TimeUnit timeUnit) {
C7397x.m35671a(eVar.f20888i == null, (Object) "expireAfterWrite already set");
eVar.f20887h = j;
eVar.f20888i = timeUnit;
}
}
static {
String str = "maximumSize";
String str2 = "maximumWeight";
String str3 = "concurrencyLevel";
String str4 = "recordStats";
String str5 = "expireAfterAccess";
String str6 = "expireAfterWrite";
String str7 = "refreshAfterWrite";
String str8 = "refreshInterval";
f20879q = C8302z2.m39628g().mo30687a("initialCapacity", new C7430e()).mo30687a(str, new C7434i()).mo30687a(str2, new C7435j()).mo30687a(str3, new C7428c()).mo30687a("weakKeys", new C7432g(C7496u.WEAK)).mo30687a("softValues", new C7439n(C7496u.SOFT)).mo30687a("weakValues", new C7439n(C7496u.WEAK)).mo30687a(str4, new C7436k()).mo30687a(str5, new C7427b()).mo30687a(str6, new C7440o()).mo30687a(str7, new C7437l()).mo30687a(str8, new C7437l()).mo30690a();
}
private C7425e(String str) {
this.f20893n = str;
}
/* renamed from: a */
public static C7425e m35748a(String str) {
C7425e eVar = new C7425e(str);
if (str.length() != 0) {
for (String str2 : f20877o.mo23075a((CharSequence) str)) {
C8257x2 a = C8257x2.m39392a(f20878p.mo23075a((CharSequence) str2));
C7397x.m35671a(!a.isEmpty(), (Object) "blank key-value pair");
C7397x.m35672a(a.size() <= 2, "key-value pair %s with more than one equals sign", str2);
String str3 = (String) a.get(0);
C7438m mVar = (C7438m) f20879q.get(str3);
C7397x.m35672a(mVar != null, "unknown key %s", str3);
mVar.mo29344a(eVar, str3, a.size() == 1 ? null : (String) a.get(1));
}
}
return eVar;
}
/* renamed from: c */
public static C7425e m35750c() {
return m35748a("maximumSize=0");
}
/* renamed from: b */
public String mo29338b() {
return this.f20893n;
}
public boolean equals(@C5952h Object obj) {
boolean z = true;
if (this == obj) {
return true;
}
if (!(obj instanceof C7425e)) {
return false;
}
C7425e eVar = (C7425e) obj;
if (!C5827t.m25562a(this.f20880a, eVar.f20880a) || !C5827t.m25562a(this.f20881b, eVar.f20881b) || !C5827t.m25562a(this.f20882c, eVar.f20882c) || !C5827t.m25562a(this.f20883d, eVar.f20883d) || !C5827t.m25562a(this.f20884e, eVar.f20884e) || !C5827t.m25562a(this.f20885f, eVar.f20885f) || !C5827t.m25562a(this.f20886g, eVar.f20886g) || !C5827t.m25562a(m35749a(this.f20887h, this.f20888i), m35749a(eVar.f20887h, eVar.f20888i)) || !C5827t.m25562a(m35749a(this.f20889j, this.f20890k), m35749a(eVar.f20889j, eVar.f20890k)) || !C5827t.m25562a(m35749a(this.f20891l, this.f20892m), m35749a(eVar.f20891l, eVar.f20892m))) {
z = false;
}
return z;
}
public int hashCode() {
return C5827t.m25558a(this.f20880a, this.f20881b, this.f20882c, this.f20883d, this.f20884e, this.f20885f, this.f20886g, m35749a(this.f20887h, this.f20888i), m35749a(this.f20889j, this.f20890k), m35749a(this.f20891l, this.f20892m));
}
public String toString() {
return C5827t.m25559a((Object) this).mo23146a((Object) mo29338b()).toString();
}
/* access modifiers changed from: 0000 */
/* renamed from: a */
public C5832d<Object, Object> mo29337a() {
C5832d<Object, Object> w = C5832d.m25587w();
Integer num = this.f20880a;
if (num != null) {
w.mo23169b(num.intValue());
}
Long l = this.f20881b;
if (l != null) {
w.mo23160a(l.longValue());
}
Long l2 = this.f20882c;
if (l2 != null) {
w.mo23170b(l2.longValue());
}
Integer num2 = this.f20883d;
if (num2 != null) {
w.mo23159a(num2.intValue());
}
C7496u uVar = this.f20884e;
if (uVar != null) {
if (C7426a.f20894a[uVar.ordinal()] == 1) {
w.mo23191s();
} else {
throw new AssertionError();
}
}
C7496u uVar2 = this.f20885f;
if (uVar2 != null) {
int i = C7426a.f20894a[uVar2.ordinal()];
if (i == 1) {
w.mo23192t();
} else if (i == 2) {
w.mo23190r();
} else {
throw new AssertionError();
}
}
Boolean bool = this.f20886g;
if (bool != null && bool.booleanValue()) {
w.mo23189q();
}
TimeUnit timeUnit = this.f20888i;
if (timeUnit != null) {
w.mo23171b(this.f20887h, timeUnit);
}
TimeUnit timeUnit2 = this.f20890k;
if (timeUnit2 != null) {
w.mo23161a(this.f20889j, timeUnit2);
}
TimeUnit timeUnit3 = this.f20892m;
if (timeUnit3 != null) {
w.mo23175c(this.f20891l, timeUnit3);
}
return w;
}
@C5952h
/* renamed from: a */
private static Long m35749a(long j, @C5952h TimeUnit timeUnit) {
if (timeUnit == null) {
return null;
}
return Long.valueOf(timeUnit.toNanos(j));
}
}
| [
"zsolimana@uaedomain.local"
] | zsolimana@uaedomain.local |
cc992e52f1a90c0b7297409a4436efbf461fad24 | adabf3704e0db7d93cc3343d67f84a9a366deb17 | /Databases/Spring Data/JSON Processing/CarDealer/src/main/java/com/example/cardealer/configurations/ApplicationBeansConfigurations.java | db9e908068fa5875fa8c49c5fc4d582da8edc30c | [] | no_license | DavideTodorov/SoftUni-Professional-Modules | 84a03a90029bfce149df826d522e047865e34597 | 31392227f824d0aa3fff27b39c79492bb74292d5 | refs/heads/master | 2023-06-28T08:16:01.483835 | 2021-08-02T14:45:59 | 2021-08-02T14:45:59 | 295,112,244 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 610 | java | package com.example.cardealer.configurations;
import com.google.gson.Gson;
import com.google.gson.GsonBuilder;
import org.modelmapper.ModelMapper;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
@Configuration
public class ApplicationBeansConfigurations {
@Bean
public ModelMapper modelMapper() {
return new ModelMapper();
}
@Bean
public Gson gson() {
return new GsonBuilder()
.excludeFieldsWithoutExposeAnnotation()
.setPrettyPrinting()
.create();
}
}
| [
"davide.todorov@abv.bg"
] | davide.todorov@abv.bg |
dfe1973e1903c0c5b7df0d34f98dfeb81beea31a | f5f57c46b1c355b3ce4fbfa7881f9cf4438e038d | /app/src/main/java/org/d3ifcool/trapali/MyIntro.java | 1a290eefc8c73a09df7e53673d0f9434866d7945 | [] | no_license | rimazaki/aplikasiKolab | ca04bc8dcb84632e6454413fc117c56bdfadaef6 | 66f36eec2af97c960aba99e0f985b00bb75cbbec | refs/heads/master | 2020-07-18T07:22:34.895948 | 2019-09-11T15:46:32 | 2019-09-11T15:46:32 | 206,205,337 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 57 | java | package org.d3ifcool.trapali;
public class MyIntro {
}
| [
"rimazakiyatin@gmail.com"
] | rimazakiyatin@gmail.com |
fcd602028482a4006f6acf87577747bb9de21615 | 59c42c8405c376ac6ee062e267fff406cfc3f947 | /src/javaapplication1/Patient.java | 2418bc4ceecf92a9e72217e75c1f4c294baf066d | [] | no_license | iMrOmarX/optics-app | 5538bfb8175aaef4bbd1c589d54a06405f24821a | 049e82da2e1a15c6308dbae056d9b6dc027fc2d9 | refs/heads/main | 2023-07-18T21:33:05.813817 | 2021-08-16T20:18:53 | 2021-08-16T20:18:53 | 396,960,107 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,418 | java | package javaapplication1;
/*
* 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.
*/
import java.io.Serializable;
import java.util.ArrayList;
import java.util.Date;
/**
*
* @author Omar AbuRish
*/
public class Patient implements Serializable {
int id ;
String name ;
Date birthDate;
ArrayList<Examination> exams;
int numberOfExams = 0 ;
public Patient( String name, int yearOfBirth , int id ) {
this.name = name;
this.birthDate = new Date(yearOfBirth, 1, 1);
this.exams = new ArrayList<>();
this.id = id ;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public Date getBirthDate() {
return birthDate;
}
public void setBirthDate(Date birthDate) {
this.birthDate = birthDate;
}
public ArrayList<Examination> getExams() {
return exams;
}
public void addExam(Examination newExam) {
numberOfExams++;
exams.add(newExam);
}
public int getNumberOfExams() {
return numberOfExams;
}
public int getId() {
return id;
}
public void setId(int id) {
this.id = id;
}
}
| [
"191020@ppu.edu.ps"
] | 191020@ppu.edu.ps |
67283d682710a78a5c6862211fadeb4ce6256bad | 1064c459df0c59a4fb169d6f17a82ba8bd2c6c1a | /trunk/bbs/src/service/cn/itcast/bbs/service/base/BaseService.java | fc8ebceae98532df754e9c82dca5a6f62d9e89f7 | [] | no_license | BGCX261/zju-svn-to-git | ad87ed4a95cea540299df6ce2d68b34093bcaef7 | 549378a9899b303cb7ac24a4b00da465b6ccebab | refs/heads/master | 2021-01-20T05:53:28.829755 | 2015-08-25T15:46:49 | 2015-08-25T15:46:49 | 41,600,366 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,205 | java | package cn.itcast.bbs.service.base;
import javax.annotation.Resource;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import cn.itcast.bbs.dao.ConfigDao;
import cn.itcast.bbs.dao.UserDao;
import cn.itcast.bbs.dao.article.ArticleDao;
import cn.itcast.bbs.dao.article.AttachmentDao;
import cn.itcast.bbs.dao.article.CategoryDao;
import cn.itcast.bbs.dao.article.DeletedArticleDao;
import cn.itcast.bbs.dao.article.ForumDao;
import cn.itcast.bbs.dao.article.ReplyDao;
import cn.itcast.bbs.dao.article.TopicDao;
import cn.itcast.bbs.dao.article.VoteDao;
import cn.itcast.bbs.dao.article.VoteItemDao;
import cn.itcast.bbs.dao.article.VoteRecordDao;
import cn.itcast.bbs.dao.log.ExceptionLogDao;
import cn.itcast.bbs.dao.log.OperationLogDao;
import cn.itcast.bbs.dao.privilege.GroupDao;
import cn.itcast.bbs.dao.privilege.PermissionDao;
import cn.itcast.bbs.dao.privilege.PermissionGroupDao;
import cn.itcast.bbs.dao.privilege.RoleDao;
import cn.itcast.bbs.dao.search.ArticleIndexDao;
import cn.itcast.bbs.service.article.impl.CategoryServiceImpl;
/**
*
* @author 传智播客.汤阳光 Dec 15, 2008
*/
public abstract class BaseService {
protected static Log log = LogFactory.getLog(CategoryServiceImpl.class);
@Resource protected UserDao userDao;
@Resource protected ConfigDao configDao;
@Resource protected CategoryDao categoryDao;
@Resource protected ForumDao forumDao;
@Resource protected ArticleDao articleDao;
@Resource protected TopicDao topicDao;
@Resource protected ReplyDao replyDao;
@Resource protected AttachmentDao attachmentDao;
@Resource protected DeletedArticleDao deletedArticleDao;
@Resource protected VoteDao voteDao;
@Resource protected VoteItemDao voteItemDao;
@Resource protected VoteRecordDao voteRecordDao;
@Resource protected GroupDao groupDao;
@Resource protected RoleDao roleDao;
@Resource protected PermissionDao permissionDao;
@Resource protected PermissionGroupDao permissionGroupDao;
@Resource protected OperationLogDao operationLogDao;
@Resource protected ExceptionLogDao exceptionLogDao;
@Resource protected ArticleIndexDao articleIndexDao;
}
| [
"you@example.com"
] | you@example.com |
e04826252f32ad114e282ab7c7f61212a30c9589 | 103978c5760f1a92604ec896c1e9d1ceab1cb2eb | /proxy/plugins/pgsql/src/main/java/eu/clarussecure/proxy/protocol/plugins/pgsql/raw/handler/codec/PgsqlRawPartEncoder.java | 1a640ba9ddb780a12fa908f59b3ddd7ef09e3046 | [] | no_license | hargathor/proxy | 49d5b3cf6af877b51e75534e5989e281d3b81223 | 4accb334a12f12dbebdc82399b7001e257d54e6f | refs/heads/master | 2021-07-15T01:45:25.041535 | 2017-01-27T13:36:47 | 2017-01-27T13:36:47 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,135 | java | package eu.clarussecure.proxy.protocol.plugins.pgsql.raw.handler.codec;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import eu.clarussecure.proxy.protocol.plugins.pgsql.raw.handler.PgsqlRawPart;
import io.netty.buffer.ByteBuf;
import io.netty.channel.ChannelHandlerContext;
import io.netty.handler.codec.MessageToByteEncoder;
public class PgsqlRawPartEncoder extends MessageToByteEncoder<PgsqlRawPart> {
private static final Logger LOGGER = LoggerFactory.getLogger(PgsqlRawPartEncoder.class);
private String to;
public PgsqlRawPartEncoder(boolean frontend) {
this.to = frontend ? "(F<-)" : "(->B)";
}
@Override
protected ByteBuf allocateBuffer(ChannelHandlerContext ctx, PgsqlRawPart msg, boolean preferDirect) throws Exception {
return msg.getBytes().readRetainedSlice(msg.getBytes().readableBytes());
}
@Override
protected void encode(ChannelHandlerContext ctx, PgsqlRawPart msg, ByteBuf out) throws Exception {
LOGGER.trace("{} Encoding raw message part: {}...", to, msg);
LOGGER.trace("{} {} bytes encoded", to, out.readableBytes());
}
}
| [
"f.brouille@akka.eu"
] | f.brouille@akka.eu |
8817a75b99f0625123cbb9682073e8dcf1d7f5e2 | 4f233ece52425c55d93f99cab25a3dbf7702ff32 | /java/samplePrograms/src/samplePrograms/Calculator.java | e730e45e5d5756c294784758ab8c6a1d6fb0f401 | [] | no_license | apoorvaran/geerLaboratory | 6989999d45e8654f771d399ca88df66762d456f5 | 1499e9745c32351b8def956412b2d492709116a5 | refs/heads/master | 2022-08-18T01:03:07.954335 | 2020-05-24T01:36:49 | 2020-05-24T01:36:49 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,007 | java | package samplePrograms;
import java.util.Scanner;
public class Calculator {
public static void main(String[] args) {
Scanner reader = new Scanner(System.in);
System.out.print("Enter two numbers: ");
// nextDouble() reads the next double from the keyboard
double first = reader.nextDouble();
double second = reader.nextDouble();
System.out.print("Enter an operator (+, -, *, /): ");
char operator = reader.next().charAt(0);
reader.close();
double result;
// switch case for each of the operations
switch (operator) {
case '+':
result = first + second;
break;
case '-':
result = first - second;
break;
case '*':
result = first * second;
break;
case '/':
result = first / second;
break;
// operator doesn't match any case constant (+, -, *, /)
default:
System.out.printf("Error! operator is not correct");
return;
}
// printing the result of the operations
System.out.printf("%.1f %c %.1f = %.1f", first, operator, second, result);
}
} | [
"gauravvjvargia@gmail.com"
] | gauravvjvargia@gmail.com |
d4637b1aa3be911d795a8ad723fc760954207442 | 5478fd6356e89dc0a8632319881b3396e840650c | /drools-core/src/main/java/org/drools/time/impl/ExpressionIntervalTimer.java | b92dff519d8fc69f11c6f945f3d9852cdd648599 | [
"Apache-2.0"
] | permissive | chrisdolan/drools | edb64f347746fffbe4691f37b5ce02600d82b2c1 | 69b0998cfc295f78840b635c30b97b4fae7c600e | refs/heads/master | 2021-01-18T08:02:40.324841 | 2012-04-17T10:48:11 | 2012-04-17T10:48:11 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 5,922 | java | /*
* Copyright 2010 JBoss Inc
*
* 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 org.drools.time.impl;
import org.drools.WorkingMemory;
import org.drools.base.mvel.MVELObjectExpression;
import org.drools.common.InternalWorkingMemory;
import org.drools.runtime.Calendars;
import org.drools.spi.Activation;
import org.drools.time.TimeUtils;
import org.drools.time.Trigger;
import java.io.Externalizable;
import java.io.IOException;
import java.io.ObjectInput;
import java.io.ObjectOutput;
import java.util.Date;
public class ExpressionIntervalTimer
implements
Timer,
Externalizable {
private Date startTime;
private Date endTime;
private int repeatLimit;
private MVELObjectExpression delay;
private MVELObjectExpression period;
public ExpressionIntervalTimer() {
}
public ExpressionIntervalTimer(Date startTime,
Date endTime,
int repeatLimit,
MVELObjectExpression delay,
MVELObjectExpression period) {
this.startTime = startTime;
this.endTime = endTime;
this.repeatLimit = repeatLimit;
this.delay = delay;
this.period = period;
}
public void writeExternal(ObjectOutput out) throws IOException {
out.writeObject( startTime );
out.writeObject( endTime );
out.writeInt( repeatLimit );
out.writeObject( delay );
out.writeObject( period );
}
public void readExternal(ObjectInput in) throws IOException,
ClassNotFoundException {
this.startTime = (Date) in.readObject();
this.endTime = (Date) in.readObject();
this.repeatLimit = in.readInt();
this.delay = (MVELObjectExpression) in.readObject();
this.period = (MVELObjectExpression) in.readObject();
}
public Date getStartTime() {
return startTime;
}
public Date getEndTime() {
return endTime;
}
public MVELObjectExpression getDelay() {
return delay;
}
public MVELObjectExpression getPeriod() {
return period;
}
public Trigger createTrigger( Activation item, WorkingMemory wm ) {
long timestamp = ((InternalWorkingMemory) wm).getTimerService().getCurrentTime();
String[] calendarNames = item.getRule().getCalendars();
Calendars calendars = ((InternalWorkingMemory) wm).getCalendars();
return new IntervalTrigger( timestamp,
this.startTime,
this.endTime,
this.repeatLimit,
delay != null ? evalDelay( item, wm ) : 0,
period != null ? evalPeriod( item, wm ) : 0,
calendarNames,
calendars );
}
private long evalPeriod( Activation item, WorkingMemory wm ) {
Object p = this.period.getValue( item.getTuple(), item.getRule(), wm );
if ( p instanceof Number ) {
return ((Number) p).longValue();
} else {
return TimeUtils.parseTimeString( p.toString() );
}
}
private long evalDelay(Activation item, WorkingMemory wm) {
Object d = this.delay.getValue( item.getTuple(), item.getRule(), wm );
if ( d instanceof Number ) {
return ((Number) d).longValue();
} else {
return TimeUtils.parseTimeString( d.toString() );
}
}
public Trigger createTrigger(long timestamp,
String[] calendarNames,
Calendars calendars) {
return new IntervalTrigger( timestamp,
this.startTime,
this.endTime,
this.repeatLimit,
0,
0,
calendarNames,
calendars );
}
@Override
public int hashCode() {
final int prime = 31;
int result = 1;
result = prime * result + delay.hashCode();
result = prime * result + ((endTime == null) ? 0 : endTime.hashCode());
result = prime * result + period.hashCode();
result = prime * result + repeatLimit;
result = prime * result + ((startTime == null) ? 0 : startTime.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;
ExpressionIntervalTimer other = (ExpressionIntervalTimer) obj;
if ( delay != other.delay ) return false;
if ( repeatLimit != other.repeatLimit ) return false;
if ( endTime == null ) {
if ( other.endTime != null ) return false;
} else if ( !endTime.equals( other.endTime ) ) return false;
if ( period != other.period ) return false;
if ( startTime == null ) {
if ( other.startTime != null ) return false;
} else if ( !startTime.equals( other.startTime ) ) return false;
return true;
}
}
| [
"mario.fusco@gmail.com"
] | mario.fusco@gmail.com |
5e1de3a950ba4385b925b821746495cfa0e75415 | a7b868c8c81984dbcb17c1acc09c0f0ab8e36c59 | /src/main/java/com/alipay/api/request/AlipayOpenInviteOrderQueryRequest.java | 860b3a1f79bea155c06ab83d475059de0e800c1c | [
"Apache-2.0"
] | permissive | 1755616537/alipay-sdk-java-all | a7ebd46213f22b866fa3ab20c738335fc42c4043 | 3ff52e7212c762f030302493aadf859a78e3ebf7 | refs/heads/master | 2023-02-26T01:46:16.159565 | 2021-02-02T01:54:36 | 2021-02-02T01:54:36 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,114 | java | package com.alipay.api.request;
import com.alipay.api.domain.AlipayOpenInviteOrderQueryModel;
import java.util.Map;
import com.alipay.api.AlipayRequest;
import com.alipay.api.internal.util.AlipayHashMap;
import com.alipay.api.response.AlipayOpenInviteOrderQueryResponse;
import com.alipay.api.AlipayObject;
/**
* ALIPAY API: alipay.open.invite.order.query request
*
* @author auto create
* @since 1.0, 2020-11-30 17:33:46
*/
public class AlipayOpenInviteOrderQueryRequest implements AlipayRequest<AlipayOpenInviteOrderQueryResponse> {
private AlipayHashMap udfParams; // add user-defined text parameters
private String apiVersion="1.0";
/**
* 查询签约申请单状态
*/
private String bizContent;
public void setBizContent(String bizContent) {
this.bizContent = bizContent;
}
public String getBizContent() {
return this.bizContent;
}
private String terminalType;
private String terminalInfo;
private String prodCode;
private String notifyUrl;
private String returnUrl;
private boolean needEncrypt=false;
private AlipayObject bizModel=null;
public String getNotifyUrl() {
return this.notifyUrl;
}
public void setNotifyUrl(String notifyUrl) {
this.notifyUrl = notifyUrl;
}
public String getReturnUrl() {
return this.returnUrl;
}
public void setReturnUrl(String returnUrl) {
this.returnUrl = returnUrl;
}
public String getApiVersion() {
return this.apiVersion;
}
public void setApiVersion(String apiVersion) {
this.apiVersion = apiVersion;
}
public void setTerminalType(String terminalType){
this.terminalType=terminalType;
}
public String getTerminalType(){
return this.terminalType;
}
public void setTerminalInfo(String terminalInfo){
this.terminalInfo=terminalInfo;
}
public String getTerminalInfo(){
return this.terminalInfo;
}
public void setProdCode(String prodCode) {
this.prodCode=prodCode;
}
public String getProdCode() {
return this.prodCode;
}
public String getApiMethodName() {
return "alipay.open.invite.order.query";
}
public Map<String, String> getTextParams() {
AlipayHashMap txtParams = new AlipayHashMap();
txtParams.put("biz_content", this.bizContent);
if(udfParams != null) {
txtParams.putAll(this.udfParams);
}
return txtParams;
}
public void putOtherTextParam(String key, String value) {
if(this.udfParams == null) {
this.udfParams = new AlipayHashMap();
}
this.udfParams.put(key, value);
}
public Class<AlipayOpenInviteOrderQueryResponse> getResponseClass() {
return AlipayOpenInviteOrderQueryResponse.class;
}
public boolean isNeedEncrypt() {
return this.needEncrypt;
}
public void setNeedEncrypt(boolean needEncrypt) {
this.needEncrypt=needEncrypt;
}
public AlipayObject getBizModel() {
return this.bizModel;
}
public void setBizModel(AlipayObject bizModel) {
this.bizModel=bizModel;
}
}
| [
"ben.zy@antfin.com"
] | ben.zy@antfin.com |
dc8641f1e733bcf65930a6d816148856334895db | 4875bb49ea87fa36faeae3ee80f97e6beaf7bae5 | /meiling_android_mes.git/app/src/main/java/com/mingjiang/android/app/bean/MaterialList.java | 9ebc98a265fdbf28dbaf43e573f63844a59873a1 | [] | no_license | zhangyoulai/ZongHeGuanLang | 47f3b3fbaec80008d51b3a33d9848873e0637dc9 | 3520e8ff854523fd46e8f2a2eeda8992a52ef540 | refs/heads/master | 2021-01-19T11:45:57.338250 | 2017-04-10T06:23:01 | 2017-04-10T06:23:01 | 82,263,332 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 583 | java | package com.mingjiang.android.app.bean;
/**
* Created by kouzeping on 2016/3/23.
* email:kouzeping@shmingjiang.org.cn
*
* {
"material_id": "12",物料编码
"alter_number": "12"退料数量
}
*/
public class MaterialList {
public String material_name;
public String material_id;
public int alter_number;
public MaterialList() {
}
public MaterialList(String material_name, String material_id, int alter_number) {
this.material_name = material_name;
this.material_id = material_id;
this.alter_number = alter_number;
}
}
| [
"2865046990@qq.com"
] | 2865046990@qq.com |
4e532920217b9973fdc851d652c850ce62d6b647 | c477de317220d15c312c082d8f8a3e66b7849fdc | /DMS Case Study 2019/Final BE/src/main/java/com/dms/dao/impl/ProductDAOImpl.java | 4a3cb9f5298332635f4eeb4da5225f6ca4387768 | [] | no_license | ayush9234/inventory_management_system | 07b3646eec01c4d24bae901de05cb364aec3b998 | e7730ee63b5f14bd14e98e891913c1d193ea447a | refs/heads/master | 2023-01-10T09:26:17.238262 | 2019-08-09T06:16:17 | 2019-08-09T06:16:17 | 199,896,765 | 1 | 0 | null | 2023-01-07T08:34:11 | 2019-07-31T17:01:12 | Java | UTF-8 | Java | false | false | 3,395 | java | package com.dms.dao.impl;
import java.time.LocalDateTime;
import java.util.ArrayList;
import java.util.List;
import org.apache.log4j.Logger;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.jdbc.core.JdbcTemplate;
import org.springframework.jdbc.support.rowset.SqlRowSet;
import org.springframework.stereotype.Repository;
import com.dms.constant.Constant;
import com.dms.constant.Query;
import com.dms.dao.IProductDAO;
import com.dms.exception.BADRequestException;
import com.dms.model.Product;
/**
* The Class ProductDAOImpl.
*/
@Repository
public class ProductDAOImpl implements IProductDAO {
/** The Constant LOG. */
private static final Logger LOG = Logger.getLogger(ProductDAOImpl.class);
/** The jdbc template. */
@Autowired
private JdbcTemplate jdbcTemplate;
/**
* Gets the products.
*
* @return the products
*/
@Override
public List<Product> getProducts() {
LOG.info("inside getProducts()");
SqlRowSet srs = jdbcTemplate.queryForRowSet(Query.GET_ALL_PRODUCTS);
List<Product> list = new ArrayList<>();
while (srs.next()) {
Product product = new Product();
product.setProductId(srs.getInt(Constant.PRODUCT_ID));
product.setProductName(srs.getString(Constant.PRODUCT_NAME));
product.setProductStatus(srs.getString(Constant.PRODUCT_STATUS));
product.setProductCost(srs.getDouble(Constant.PRODUCT_COST));
product.setCreationTime(srs.getDate(Constant.CREATION_TIME));
product.setUpdationTime(srs.getDate(Constant.UPDATION_TIME));
list.add(product);
}
return list;
}
/**
* Gets the product by id.
*
* @param productId the product id
* @return the product by id
* @throws BADRequestException the BAD request
*/
@Override
public Product getProductById(int productId) {
LOG.info("inside getProductById()");
Product product = new Product();
SqlRowSet srs = jdbcTemplate.queryForRowSet(Query.PRODUCT_BY_ID, productId);
if (srs.next()) {
product.setProductId(srs.getInt(Constant.PRODUCT_ID));
product.setProductName(srs.getString(Constant.PRODUCT_NAME));
product.setProductCost(srs.getDouble(Constant.PRODUCT_COST));
product.setProductStatus(srs.getString(Constant.PRODUCT_STATUS));
}
return product;
}
/**
* Adds the product.
*
* @param product the product
* @return true, if successful
*/
@Override
public boolean addProduct(Product product) {
LocalDateTime now = LocalDateTime.now();
return jdbcTemplate.update(Query.ADD_PRODUCT, product.getProductName(), product.getProductStatus(),
product.getProductCost(), now, now) > 0;
}
/**
* Product exists.
*
* @param name the name
* @return true, if successful
*/
@Override
public boolean productExists(String name) {
SqlRowSet srs = jdbcTemplate.queryForRowSet(Query.PRODUCT_EXIST, name);
int count = 0;
if (srs.next()) {
count++;
}
return count > 0 ? true : false;
}
/**
* Update product.
*
* @param product the product
* @return true, if successful
*/
@Override
public boolean updateProduct(Product product) {
LocalDateTime now = LocalDateTime.now();
return jdbcTemplate.update(Query.UPDATE_PRODUCT, product.getProductName(), product.getProductStatus(),
product.getProductCost(), now, product.getProductId()) > 0;
}
}
| [
"ayush.pal@impetus.co.in"
] | ayush.pal@impetus.co.in |
518ab632683180a883e23f2134c4f8a1b35f5f89 | ca72defea153bb0a8fa909818203b5894c63452a | /app/src/main/java/org/visapps/yandexdiskgallery/repository/YandexPassportAPI.java | df8f562aad608cbc1a55d640f252005898ff7c3e | [] | no_license | Viska97/YandexDiskGallery | 0f754859883b408e20c4611534fc98214ac675cc | 47ac047f96dcc0508193025723ff9dc31e91a664 | refs/heads/master | 2020-03-15T22:05:12.576292 | 2018-05-06T21:23:50 | 2018-05-06T21:23:50 | 132,366,696 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 514 | java | package org.visapps.yandexdiskgallery.repository;
import org.visapps.yandexdiskgallery.models.PassportResponse;
import io.reactivex.Single;
import retrofit2.http.GET;
import retrofit2.http.Header;
public interface YandexPassportAPI {
// Интерфейс REST API Яндекс Паспорта. Методы возвращают Single для использования в связке с RxJava
@GET("info?format=json")
Single<PassportResponse> getInfo(@Header("Authorization") String token);
}
| [
"m.viska97@gmail.com"
] | m.viska97@gmail.com |
4f702efab6fb39391d38102bca5e3dd0ddd10eef | e12af772256dccc4f44224f68b7a3124673d9ced | /jitsi/src/net/java/sip/communicator/impl/protocol/jabber/extensions/coin/UserLanguagesPacketExtension.java | c82fe8b66ade74fbf0b6419c00daa66da9c42114 | [] | no_license | leshikus/dataved | bc2f17d9d5304b3d7c82ccb0f0f58c7abcd25b2a | 6c43ab61acd08a25b21ed70432cd0294a5db2360 | refs/heads/master | 2021-01-22T02:33:58.915867 | 2016-11-03T08:35:22 | 2016-11-03T08:35:22 | 32,135,163 | 2 | 1 | null | null | null | null | UTF-8 | Java | false | false | 2,682 | java | /*
* Jitsi, the OpenSource Java VoIP and Instant Messaging client.
*
* Distributable under LGPL license.
* See terms of license at gnu.org.
*/
package net.java.sip.communicator.impl.protocol.jabber.extensions.coin;
import java.util.*;
import org.jivesoftware.smack.packet.*;
import net.java.sip.communicator.impl.protocol.jabber.extensions.*;
/**
* User languages packet extension.
*
* @author Sebastien Vincent
*/
public class UserLanguagesPacketExtension
extends AbstractPacketExtension
{
/**
* The namespace that user languages belongs to.
*/
public static final String NAMESPACE = "";
/**
* The name of the element that contains the user languages data.
*/
public static final String ELEMENT_NAME = "languages";
/**
* The name of the element that contains the media data.
*/
public static final String ELEMENT_LANGUAGES = "stringvalues";
/**
* The list of languages separated by space.
*/
private String languages = null;
/**
* Constructor.
*/
public UserLanguagesPacketExtension()
{
super(NAMESPACE, ELEMENT_NAME);
}
/**
* Set languages.
*
* @param languages list of languages
*/
public void setLanguages(String languages)
{
this.languages = languages;
}
/**
* Get languages.
*
* @return languages
*/
public String getLanguages()
{
return languages;
}
/**
* Get an XML string representation.
*
* @return XML string representation
*/
@Override
public String toXML()
{
StringBuilder bldr = new StringBuilder();
bldr.append("<").append(getElementName()).append(" ");
if(getNamespace() != null)
bldr.append("xmlns='").append(getNamespace()).append("'");
//add the rest of the attributes if any
for(Map.Entry<String, String> entry : attributes.entrySet())
{
bldr.append(" ")
.append(entry.getKey())
.append("='")
.append(entry.getValue())
.append("'");
}
bldr.append(">");
if(languages != null)
{
bldr.append("<").append(ELEMENT_LANGUAGES).append(">").append(
languages).append("</").append(
ELEMENT_LANGUAGES).append(">");
}
for(PacketExtension ext : getChildExtensions())
{
bldr.append(ext.toXML());
}
bldr.append("</").append(getElementName()).append(">");
return bldr.toString();
}
}
| [
"alexei.fedotov@917aa43a-1baf-11df-844d-27937797d2d2"
] | alexei.fedotov@917aa43a-1baf-11df-844d-27937797d2d2 |
a36dc1729fb06ee0d32a87605c2a2010062fabd8 | 4831e57ee4cf8aa4556882c9e7b3f4ad4bb5c617 | /reference/FindServicesNSD.java | 6d8e07d73dacd16bc43dad9dfa38f35fa552ce77 | [] | no_license | codenotes/ROS_ThirdParty | 657c84684dae690e964d5eb09235037c6deec0f3 | 61a2e148eb41ea65425fc262141258a3dd5518c4 | refs/heads/master | 2021-01-20T19:15:46.526678 | 2017-06-30T18:11:07 | 2017-06-30T18:11:07 | 65,235,425 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 5,954 | java | /*
* Created by VisualGDB. Based on hello-jni example.
* Copyright (C) 2009 The Android Open Source Project
*
* 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.
//some info but not all correct: http://apple.stackexchange.com/questions/175241/how-can-i-list-the-ip-addresses-of-all-the-airprint-printers-on-a-network
registration example, do this on windows, but may not resolve:
dns-sd -R MyWebsite _http._tcp local 80
//a complete working publishing tested on windows and picked up on using this
dns-sd -P ROSCore _http._tcp local 80 roscore.local 10.1.55.163
browse:
dns-sd -B _http._tcp local
lookup: but gives no up
dns-sd -L "ROSCore" _http._tcp local.
*/
package com.Infusion.TailForGreg;
import android.net.nsd.NsdManager;
import android.net.nsd.NsdManager.DiscoveryListener;
import android.net.nsd.NsdManager.ResolveListener;
import android.net.nsd.NsdServiceInfo;
import android.util.Log;
import java.util.HashMap;
import android.text.TextUtils;
public final class FindServicesNSD
implements
DiscoveryListener,
ResolveListener
{
// DiscoveryListener
// DiscoveryListener
public static HashMap<String, String> servicesMap = new HashMap<String, String>();
//public native void setENV();
@Override
public void onDiscoveryStarted(String theServiceType)
{
Log.d(TAG, "onDiscoveryStarted");
}
@Override
public void onStartDiscoveryFailed(String theServiceType, int theErrorCode)
{
Log.d(TAG, "onStartDiscoveryFailed(" + theServiceType + ", " + theErrorCode);
}
@Override
public void onDiscoveryStopped(String serviceType)
{
Log.d(TAG, "onDiscoveryStopped");
}
@Override
public void onStopDiscoveryFailed(String theServiceType, int theErrorCode)
{
Log.d(TAG, "onStartDiscoveryFailed(" + theServiceType + ", " + theErrorCode);
}
@Override
public void onServiceFound(NsdServiceInfo theServiceInfo)
{
Log.d(TAG, "onServiceFound(" + theServiceInfo + ")");
Log.d(TAG, "name == " + theServiceInfo.getServiceName());
Log.d(TAG, "type == " + theServiceInfo.getServiceType());
serviceFound(theServiceInfo);
}
@Override
public void onServiceLost(NsdServiceInfo theServiceInfo)
{
Log.d(TAG, "onServiceLost(" + theServiceInfo + ")");
}
// Resolve Listener
@Override
public void onServiceResolved(NsdServiceInfo theServiceInfo)
{
Log.d(TAG, "onServiceResolved(" + theServiceInfo + ")");
Log.d(TAG, "name == " + theServiceInfo.getServiceName());
Log.d(TAG, "type == " + theServiceInfo.getServiceType());
Log.d(TAG, "host == " + theServiceInfo.getHost());
Log.d(TAG, "port == " + theServiceInfo.getPort());
}
@Override
public void onResolveFailed(NsdServiceInfo theServiceInfo, int theErrorCode)
{
Log.d(TAG, "onResolveFailed(" + theServiceInfo + ", " + theErrorCode);
}
//
public FindServicesNSD(NsdManager theManager, String theServiceType)
{
manager = theManager;
serviceType = theServiceType;
}
public static String getResolution(String name)
{
try
{
String str= (String)servicesMap.get(name).toString();
if( TextUtils.isEmpty(str) )
{
return "NOTHING";
}
else
{
return str;
}
}
catch (Exception e)
{
return "NOTHING";
}
}
public void run()
{
//servicesMap.put("ROSCore","111.222.333.444"); //debug value
//setENV(); //native call to set environment and object variables
Log.d("FindServicesNSD", "^Run");
manager.discoverServices(serviceType, NsdManager.PROTOCOL_DNS_SD, this);
}
private void serviceFound(NsdServiceInfo theServiceInfo)
{
//manager.resolveService(theServiceInfo, this);
manager.resolveService(theServiceInfo,
new NsdManager.ResolveListener() {
@Override
public void onResolveFailed(NsdServiceInfo serviceInfo, int errorCode)
{
Log.e(TAG, "Resolve Failed: " + serviceInfo);
}
@Override
public void onServiceResolved(NsdServiceInfo theServiceInfo)
{
Log.d(TAG, "onServiceResolved(" + theServiceInfo + ")");
Log.d(TAG, "name == " + theServiceInfo.getServiceName());
Log.d(TAG, "type == " + theServiceInfo.getServiceType());
Log.d(TAG, "host == " + theServiceInfo.getHost());
Log.d(TAG, "port == " + theServiceInfo.getPort());
Log.d(TAG, "Place in servicesMap the name and host you see here...host:"+theServiceInfo.getHost());
servicesMap.put(theServiceInfo.getServiceName().toString(),theServiceInfo.getHost().toString());
String s=(String)servicesMap.get(theServiceInfo.getServiceName().toString());
Log.d(TAG, "Test pull from map:"+s);
}
}
);
}
//
private NsdManager manager;
private String serviceType;
//
private static final String TAG = "FindServicesNSD";
} | [
"gbrill@infusion.com"
] | gbrill@infusion.com |
e58202fcb3eb2cf0b30f662bb93d2931d63bcd55 | 7b2b997fd5d8747b836c2052f94325038769b56e | /yunke-core/src/main/java/com/yunke/core/module/oss/package-info.java | 51fb724427f18c8fc69af03c07b08bae63ca45b2 | [
"Apache-2.0"
] | permissive | misaya295/yunke-api | b10ca7f5eae41ec06a3239048c3b6c3995a3e78d | f2b6461d5c12dce9e1f4e845fbd1844a2cd5e075 | refs/heads/master | 2022-12-10T18:05:54.268507 | 2020-09-15T07:00:02 | 2020-09-15T07:00:02 | 272,206,339 | 8 | 5 | Apache-2.0 | 2020-09-03T14:44:47 | 2020-06-14T13:20:13 | Java | UTF-8 | Java | false | false | 148 | java | /**
* 七牛云OSS对象存储封装模块
*
* @author chachae
* @date 2020/7/8 20:55:28
* @version v1.0
*/
package com.yunke.core.module.oss; | [
"chenyuexin1998@gmail.com"
] | chenyuexin1998@gmail.com |
9d85673c2556dfcd7e40692a9ffe73a8df8ce41c | 205663422fc4b81cfa402391c790cbad2e5a8478 | /andmore-swt/org.eclipse.andmore.ddmuilib/src/main/java/com/android/ddmuilib/ClientDisplayPanel.java | 39ea342d447e2737126f232abdb01ae0925a6e96 | [
"Apache-2.0"
] | permissive | androidworx/andworx | 17f9691ef0bf6570abb035ce1a37555e7b1c9600 | f8de7f8caa20e632fdd1eda2e47f32ec391392c4 | refs/heads/master | 2020-04-07T01:48:48.664197 | 2018-12-26T03:13:29 | 2018-12-26T03:13:29 | 157,953,144 | 3 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,129 | java | /*
* Copyright (C) 2007 The Android Open Source Project
*
* 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 com.android.ddmuilib;
import com.android.ddmlib.AndroidDebugBridge;
import com.android.ddmlib.AndroidDebugBridge.IClientChangeListener;
public abstract class ClientDisplayPanel extends SelectionDependentPanel
implements IClientChangeListener {
@Override
protected void postCreation() {
AndroidDebugBridge.addClientChangeListener(this);
}
public void dispose() {
AndroidDebugBridge.removeClientChangeListener(this);
}
}
| [
"andrewbowley@aapt.net.au"
] | andrewbowley@aapt.net.au |
dea895a15872c12e0bbd2814c33cf2adb4edc653 | 54110ac5d4b817dc2f235c1375caf0cd09430339 | /SmallChartLib/com/idtk/smallchart/interfaces/IData/IAxisData.java | 93cc1b12995ca4297c070d120b70fc893ae205f7 | [] | no_license | ChinaVolvocars/CustomView | 4023ce99189859eb665f5cb10c7c83716e0313e5 | cdd20f64d89065644c4b0a598221389c26c17849 | refs/heads/master | 2021-05-31T11:24:55.189474 | 2016-06-08T09:17:26 | 2016-06-08T09:17:26 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 981 | java | package com.idtk.smallchart.interfaces.IData;
/**
* Created by Idtk on 2016/6/6.
* Blog : http://www.idtkm.com
* GitHub : https://github.com/Idtk
*/
public interface IAxisData extends IBaseData{
void setColor(int color);
int getColor();
void setTextSize(int textSize);
int getTextSize();
void setAxisLength(float axisLength);
float getAxisLength();
void setPaintWidth(float paintWidth);
float getPaintWidth();
void setMaximum(float maximum);
float getMaximum();
void setMinimum(float minimum);
float getMinimum();
void setInterval(float interval);
float getInterval();
void setUnit(String unit);
String getUnit();
void setDecimalPlaces(int decimalPlaces);
int getDecimalPlaces();
void setAxisScale(float axisScale);
float getAxisScale();
void setNarrowMax(float narrowMax);
float getNarrowMax();
void setNarrowMin(float narrowMin);
float getNarrowMin();
}
| [
"hs598375774sa@126.com"
] | hs598375774sa@126.com |
6468ed97bdca20ec5250546bb903770509d73990 | 065c1f648e8dd061a20147ff9c0dbb6b5bc8b9be | /eclipsejdt_cluster/10468/src_0.java | cfc22a3929755f457e30436701d126c4b1138d39 | [] | no_license | martinezmatias/GenPat-data-C3 | 63cfe27efee2946831139747e6c20cf952f1d6f6 | b360265a6aa3bb21bd1d64f1fc43c3b37d0da2a4 | refs/heads/master | 2022-04-25T17:59:03.905613 | 2020-04-15T14:41:34 | 2020-04-15T14:41:34 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 43,229 | java | /*******************************************************************************
* Copyright (c) 2005, 2007 IBM Corporation and others.
* 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
*
* Contributors:
* IBM Corporation - initial API and implementation
*******************************************************************************/
package org.eclipse.jdt.internal.compiler.lookup;
import org.eclipse.jdt.core.compiler.CharOperation;
import org.eclipse.jdt.internal.compiler.ast.TypeReference;
import org.eclipse.jdt.internal.compiler.ast.Wildcard;
/**
* A parameterized type encapsulates a type with type arguments,
*/
public class ParameterizedTypeBinding extends ReferenceBinding implements Substitution {
private ReferenceBinding type; // must ensure the type is resolved
public TypeBinding[] arguments;
public LookupEnvironment environment;
public char[] genericTypeSignature;
public ReferenceBinding superclass;
public ReferenceBinding[] superInterfaces;
public FieldBinding[] fields;
public ReferenceBinding[] memberTypes;
public MethodBinding[] methods;
private ReferenceBinding enclosingType;
public ParameterizedTypeBinding(ReferenceBinding type, TypeBinding[] arguments, ReferenceBinding enclosingType, LookupEnvironment environment){
this.environment = environment;
this.enclosingType = enclosingType; // never unresolved, never lazy per construction
// if (enclosingType != null && enclosingType.isGenericType()) {
// RuntimeException e = new RuntimeException("PARAM TYPE with GENERIC ENCLOSING");
// e.printStackTrace();
// throw e;
// }
initialize(type, arguments);
if (type instanceof UnresolvedReferenceBinding)
((UnresolvedReferenceBinding) type).addWrapper(this, environment);
if (arguments != null) {
for (int i = 0, l = arguments.length; i < l; i++)
if (arguments[i] instanceof UnresolvedReferenceBinding)
((UnresolvedReferenceBinding) arguments[i]).addWrapper(this, environment);
}
this.tagBits |= TagBits.HasUnresolvedTypeVariables; // cleared in resolve()
}
/**
* May return an UnresolvedReferenceBinding.
* @see ParameterizedTypeBinding#genericType()
*/
protected ReferenceBinding actualType() {
return this.type;
}
/**
* Iterate type arguments, and validate them according to corresponding variable bounds.
*/
public void boundCheck(Scope scope, TypeReference[] argumentReferences) {
if ((this.tagBits & TagBits.PassedBoundCheck) == 0) {
boolean hasErrors = false;
TypeVariableBinding[] typeVariables = this.type.typeVariables();
if (this.arguments != null && typeVariables != null) { // arguments may be null in error cases
for (int i = 0, length = typeVariables.length; i < length; i++) {
if (typeVariables[i].boundCheck(this, this.arguments[i]) != TypeConstants.OK) {
hasErrors = true;
scope.problemReporter().typeMismatchError(this.arguments[i], typeVariables[i], this.type, argumentReferences[i]);
}
}
}
if (!hasErrors) this.tagBits |= TagBits.PassedBoundCheck; // no need to recheck it in the future
}
}
/**
* @see org.eclipse.jdt.internal.compiler.lookup.ReferenceBinding#canBeInstantiated()
*/
public boolean canBeInstantiated() {
return ((this.tagBits & TagBits.HasDirectWildcard) == 0) && super.canBeInstantiated(); // cannot instantiate param type with wildcard arguments
}
/**
* Perform capture conversion for a parameterized type with wildcard arguments
* @see org.eclipse.jdt.internal.compiler.lookup.TypeBinding#capture(Scope,int)
*/
public TypeBinding capture(Scope scope, int position) {
if ((this.tagBits & TagBits.HasDirectWildcard) == 0)
return this;
TypeBinding[] originalArguments = arguments;
int length = originalArguments.length;
TypeBinding[] capturedArguments = new TypeBinding[length];
// Retrieve the type context for capture bindingKey
ReferenceBinding contextType = scope.enclosingSourceType();
if (contextType != null) contextType = contextType.outermostEnclosingType(); // maybe null when used programmatically by DOM
for (int i = 0; i < length; i++) {
TypeBinding argument = originalArguments[i];
if (argument.kind() == Binding.WILDCARD_TYPE && ((WildcardBinding)argument).otherBounds == null) { // no capture for intersection types
capturedArguments[i] = new CaptureBinding((WildcardBinding) argument, contextType, position, scope.compilationUnitScope().nextCaptureID());
} else {
capturedArguments[i] = argument;
}
}
ParameterizedTypeBinding capturedParameterizedType = this.environment.createParameterizedType(this.type, capturedArguments, enclosingType());
for (int i = 0; i < length; i++) {
TypeBinding argument = capturedArguments[i];
if (argument.isCapture()) {
((CaptureBinding)argument).initializeBounds(scope, capturedParameterizedType);
}
}
return capturedParameterizedType;
}
/**
* Collect the substitutes into a map for certain type variables inside the receiver type
* e.g. Collection<T>.collectSubstitutes(Collection<List<X>>, Map), will populate Map with: T --> List<X>
* Constraints:
* A << F corresponds to: F.collectSubstitutes(..., A, ..., CONSTRAINT_EXTENDS (1))
* A = F corresponds to: F.collectSubstitutes(..., A, ..., CONSTRAINT_EQUAL (0))
* A >> F corresponds to: F.collectSubstitutes(..., A, ..., CONSTRAINT_SUPER (2))
*/
public void collectSubstitutes(Scope scope, TypeBinding actualType, InferenceContext inferenceContext, int constraint) {
if ((this.tagBits & TagBits.HasTypeVariable) == 0) return;
if (actualType == TypeBinding.NULL) return;
if (!(actualType instanceof ReferenceBinding)) return;
TypeBinding formalEquivalent, actualEquivalent;
switch (constraint) {
case TypeConstants.CONSTRAINT_EQUAL :
case TypeConstants.CONSTRAINT_EXTENDS :
formalEquivalent = this;
actualEquivalent = actualType.findSuperTypeWithSameErasure(this.type);
if (actualEquivalent == null) return;
break;
case TypeConstants.CONSTRAINT_SUPER :
default:
formalEquivalent = this.findSuperTypeWithSameErasure(actualType);
if (formalEquivalent == null) return;
actualEquivalent = actualType;
break;
}
// collect through enclosing type
ReferenceBinding formalEnclosingType = formalEquivalent.enclosingType();
if (formalEnclosingType != null) {
formalEnclosingType.collectSubstitutes(scope, actualEquivalent.enclosingType(), inferenceContext, constraint);
}
// collect through type arguments
if (this.arguments == null) return;
TypeBinding[] formalArguments;
switch (formalEquivalent.kind()) {
case Binding.GENERIC_TYPE :
formalArguments = formalEquivalent.typeVariables();
break;
case Binding.PARAMETERIZED_TYPE :
formalArguments = ((ParameterizedTypeBinding)formalEquivalent).arguments;
break;
case Binding.RAW_TYPE :
if (!inferenceContext.checkRawSubstitution()) {
inferenceContext.status = InferenceContext.FAILED; // marker for impossible inference
}
return;
default :
return;
}
TypeBinding[] actualArguments;
switch (actualEquivalent.kind()) {
case Binding.GENERIC_TYPE :
actualArguments = actualEquivalent.typeVariables();
break;
case Binding.PARAMETERIZED_TYPE :
actualArguments = ((ParameterizedTypeBinding)actualEquivalent).arguments;
break;
case Binding.RAW_TYPE :
if (!inferenceContext.checkRawSubstitution()) {
inferenceContext.status = InferenceContext.FAILED; // marker for impossible inference
}
return;
default :
return;
}
inferenceContext.depth++;
for (int i = 0, length = formalArguments.length; i < length; i++) {
TypeBinding formalArgument = formalArguments[i];
TypeBinding actualArgument = actualArguments[i];
if (formalArgument.isWildcard()) {
formalArgument.collectSubstitutes(scope, actualArgument, inferenceContext, constraint);
continue;
} else if (actualArgument.isWildcard()){
WildcardBinding actualWildcardArgument = (WildcardBinding) actualArgument;
if (actualWildcardArgument.otherBounds == null) {
if (constraint == TypeConstants.CONSTRAINT_SUPER) { // JLS 15.12.7, p.459
switch(actualWildcardArgument.boundKind) {
case Wildcard.EXTENDS :
formalArgument.collectSubstitutes(scope, actualWildcardArgument.bound, inferenceContext, TypeConstants.CONSTRAINT_SUPER);
continue;
case Wildcard.SUPER :
formalArgument.collectSubstitutes(scope, actualWildcardArgument.bound, inferenceContext, TypeConstants.CONSTRAINT_EXTENDS);
continue;
default :
continue; // cannot infer anything further from unbound wildcard
}
} else {
continue; // cannot infer anything further from wildcard
}
}
}
// by default, use EQUAL constraint
formalArgument.collectSubstitutes(scope, actualArgument, inferenceContext, TypeConstants.CONSTRAINT_EQUAL);
}
inferenceContext.depth--;
}
/**
* @see org.eclipse.jdt.internal.compiler.lookup.ReferenceBinding#computeId()
*/
public void computeId() {
this.id = TypeIds.NoId;
}
public char[] computeUniqueKey(boolean isLeaf) {
StringBuffer sig = new StringBuffer(10);
ReferenceBinding enclosing;
if (isMemberType() && ((enclosing = enclosingType()).isParameterizedType() || enclosing.isRawType())) {
char[] typeSig = enclosing.computeUniqueKey(false/*not a leaf*/);
sig.append(typeSig, 0, typeSig.length-1); // copy all but trailing semicolon
sig.append('.').append(sourceName());
} else if(this.type.isLocalType()){
LocalTypeBinding localTypeBinding = (LocalTypeBinding) this.type;
enclosing = localTypeBinding.enclosingType();
ReferenceBinding temp;
while ((temp = enclosing.enclosingType()) != null)
enclosing = temp;
char[] typeSig = enclosing.computeUniqueKey(false/*not a leaf*/);
sig.append(typeSig, 0, typeSig.length-1); // copy all but trailing semicolon
sig.append('$');
sig.append(localTypeBinding.sourceStart);
} else {
char[] typeSig = this.type.computeUniqueKey(false/*not a leaf*/);
sig.append(typeSig, 0, typeSig.length-1); // copy all but trailing semicolon
}
ReferenceBinding captureSourceType = null;
if (this.arguments != null) {
sig.append('<');
for (int i = 0, length = this.arguments.length; i < length; i++) {
TypeBinding typeBinding = this.arguments[i];
sig.append(typeBinding.computeUniqueKey(false/*not a leaf*/));
if (typeBinding instanceof CaptureBinding)
captureSourceType = ((CaptureBinding) typeBinding).sourceType;
}
sig.append('>');
}
sig.append(';');
if (captureSourceType != null && captureSourceType != this.type) {
// contains a capture binding
sig.insert(0, "&"); //$NON-NLS-1$
sig.insert(0, captureSourceType.computeUniqueKey(false/*not a leaf*/));
}
int sigLength = sig.length();
char[] uniqueKey = new char[sigLength];
sig.getChars(0, sigLength, uniqueKey, 0);
return uniqueKey;
}
/**
* @see org.eclipse.jdt.internal.compiler.lookup.TypeBinding#constantPoolName()
*/
public char[] constantPoolName() {
return this.type.constantPoolName(); // erasure
}
public ParameterizedMethodBinding createParameterizedMethod(MethodBinding originalMethod) {
return new ParameterizedMethodBinding(this, originalMethod);
}
/**
* @see org.eclipse.jdt.internal.compiler.lookup.TypeBinding#debugName()
*/
public String debugName() {
StringBuffer nameBuffer = new StringBuffer(10);
nameBuffer.append(this.type.sourceName());
if (this.arguments != null) {
nameBuffer.append('<');
for (int i = 0, length = this.arguments.length; i < length; i++) {
if (i > 0) nameBuffer.append(',');
nameBuffer.append(this.arguments[i].debugName());
}
nameBuffer.append('>');
}
return nameBuffer.toString();
}
/**
* @see org.eclipse.jdt.internal.compiler.lookup.ReferenceBinding#enclosingType()
*/
public ReferenceBinding enclosingType() {
return this.enclosingType;
}
/**
* @see org.eclipse.jdt.internal.compiler.lookup.Substitution#environment()
*/
public LookupEnvironment environment() {
return this.environment;
}
/**
* @see org.eclipse.jdt.internal.compiler.lookup.TypeBinding#erasure()
*/
public TypeBinding erasure() {
return this.type.erasure(); // erasure
}
/**
* @see org.eclipse.jdt.internal.compiler.lookup.ReferenceBinding#fieldCount()
*/
public int fieldCount() {
return this.type.fieldCount(); // same as erasure (lazy)
}
/**
* @see org.eclipse.jdt.internal.compiler.lookup.ReferenceBinding#fields()
*/
public FieldBinding[] fields() {
if ((tagBits & TagBits.AreFieldsComplete) != 0)
return this.fields;
try {
FieldBinding[] originalFields = this.type.fields();
int length = originalFields.length;
FieldBinding[] parameterizedFields = new FieldBinding[length];
for (int i = 0; i < length; i++)
// substitute all fields, so as to get updated declaring class at least
parameterizedFields[i] = new ParameterizedFieldBinding(this, originalFields[i]);
this.fields = parameterizedFields;
} finally {
// if the original fields cannot be retrieved (ex. AbortCompilation), then assume we do not have any fields
if (this.fields == null)
this.fields = Binding.NO_FIELDS;
tagBits |= TagBits.AreFieldsComplete;
}
return this.fields;
}
/**
* Return the original generic type from which the parameterized type got instantiated from.
* This will perform lazy resolution automatically if needed.
* @see ParameterizedTypeBinding#actualType() if no resolution is required (unlikely)
*/
public ReferenceBinding genericType() {
if (this.type instanceof UnresolvedReferenceBinding)
((UnresolvedReferenceBinding) this.type).resolve(this.environment, false);
return this.type;
}
/**
* Ltype<param1 ... paramN>;
* LY<TT;>;
*/
public char[] genericTypeSignature() {
if (this.genericTypeSignature == null) {
if ((this.modifiers & ExtraCompilerModifiers.AccGenericSignature) == 0) {
this.genericTypeSignature = this.type.signature();
} else {
StringBuffer sig = new StringBuffer(10);
if (this.isMemberType()) {
ReferenceBinding enclosing = enclosingType();
boolean hasParameterizedEnclosing = enclosing.isParameterizedType();
char[] typeSig = hasParameterizedEnclosing ? enclosing.genericTypeSignature() : enclosing.signature();
sig.append(typeSig, 0, typeSig.length-1);// copy all but trailing semicolon
if (hasParameterizedEnclosing && (enclosing.modifiers & ExtraCompilerModifiers.AccGenericSignature) != 0) {
sig.append('.');
} else {
sig.append('$');
}
sig.append(this.sourceName());
} else {
char[] typeSig = this.type.signature();
sig.append(typeSig, 0, typeSig.length-1);// copy all but trailing semicolon
}
if (this.arguments != null) {
sig.append('<');
for (int i = 0, length = this.arguments.length; i < length; i++) {
sig.append(this.arguments[i].genericTypeSignature());
}
sig.append('>');
}
sig.append(';');
int sigLength = sig.length();
this.genericTypeSignature = new char[sigLength];
sig.getChars(0, sigLength, this.genericTypeSignature, 0);
}
}
return this.genericTypeSignature;
}
/**
* @see org.eclipse.jdt.internal.compiler.lookup.ReferenceBinding#getAnnotationTagBits()
*/
public long getAnnotationTagBits() {
return this.type.getAnnotationTagBits();
}
/**
* @see org.eclipse.jdt.internal.compiler.lookup.ReferenceBinding#getExactConstructor(TypeBinding[])
*/
public MethodBinding getExactConstructor(TypeBinding[] argumentTypes) {
int argCount = argumentTypes.length;
MethodBinding match = null;
if ((tagBits & TagBits.AreMethodsComplete) != 0) { // have resolved all arg types & return type of the methods
long range;
if ((range = ReferenceBinding.binarySearch(TypeConstants.INIT, this.methods)) >= 0) {
nextMethod: for (int imethod = (int)range, end = (int)(range >> 32); imethod <= end; imethod++) {
MethodBinding method = methods[imethod];
if (method.parameters.length == argCount) {
TypeBinding[] toMatch = method.parameters;
for (int iarg = 0; iarg < argCount; iarg++)
if (toMatch[iarg] != argumentTypes[iarg])
continue nextMethod;
if (match != null) return null; // collision case
match = method;
}
}
}
} else {
MethodBinding[] matchingMethods = getMethods(TypeConstants.INIT); // takes care of duplicates & default abstract methods
nextMethod : for (int m = matchingMethods.length; --m >= 0;) {
MethodBinding method = matchingMethods[m];
TypeBinding[] toMatch = method.parameters;
if (toMatch.length == argCount) {
for (int p = 0; p < argCount; p++)
if (toMatch[p] != argumentTypes[p])
continue nextMethod;
if (match != null) return null; // collision case
match = method;
}
}
}
return match;
}
/**
* @see org.eclipse.jdt.internal.compiler.lookup.ReferenceBinding#getExactMethod(char[], TypeBinding[],CompilationUnitScope)
*/
public MethodBinding getExactMethod(char[] selector, TypeBinding[] argumentTypes, CompilationUnitScope refScope) {
// sender from refScope calls recordTypeReference(this)
int argCount = argumentTypes.length;
boolean foundNothing = true;
MethodBinding match = null;
if ((tagBits & TagBits.AreMethodsComplete) != 0) { // have resolved all arg types & return type of the methods
long range;
if ((range = ReferenceBinding.binarySearch(selector, this.methods)) >= 0) {
nextMethod: for (int imethod = (int)range, end = (int)(range >> 32); imethod <= end; imethod++) {
MethodBinding method = methods[imethod];
foundNothing = false; // inner type lookups must know that a method with this name exists
if (method.parameters.length == argCount) {
TypeBinding[] toMatch = method.parameters;
for (int iarg = 0; iarg < argCount; iarg++)
if (toMatch[iarg] != argumentTypes[iarg])
continue nextMethod;
if (match != null) return null; // collision case
match = method;
}
}
}
} else {
MethodBinding[] matchingMethods = getMethods(selector); // takes care of duplicates & default abstract methods
foundNothing = matchingMethods == Binding.NO_METHODS;
nextMethod : for (int m = matchingMethods.length; --m >= 0;) {
MethodBinding method = matchingMethods[m];
TypeBinding[] toMatch = method.parameters;
if (toMatch.length == argCount) {
for (int p = 0; p < argCount; p++)
if (toMatch[p] != argumentTypes[p])
continue nextMethod;
if (match != null) return null; // collision case
match = method;
}
}
}
if (match != null) {
// cannot be picked up as an exact match if its a possible anonymous case, such as:
// class A<T extends Number> { public void id(T t) {} }
// class B<TT> extends A<Integer> { public <ZZ> void id(Integer i) {} }
if (match.hasSubstitutedParameters()) return null;
return match;
}
if (foundNothing && (this.arguments == null || this.arguments.length <= 1)) {
if (isInterface()) {
if (superInterfaces().length == 1) {
if (refScope != null)
refScope.recordTypeReference(superInterfaces[0]);
return superInterfaces[0].getExactMethod(selector, argumentTypes, refScope);
}
} else if (superclass() != null) {
if (refScope != null)
refScope.recordTypeReference(superclass);
return superclass.getExactMethod(selector, argumentTypes, refScope);
}
}
return null;
}
/**
* @see org.eclipse.jdt.internal.compiler.lookup.ReferenceBinding#getField(char[], boolean)
*/
public FieldBinding getField(char[] fieldName, boolean needResolve) {
fields(); // ensure fields have been initialized... must create all at once unlike methods
return ReferenceBinding.binarySearch(fieldName, this.fields);
}
/**
* @see org.eclipse.jdt.internal.compiler.lookup.ReferenceBinding#getMemberType(char[])
*/
public ReferenceBinding getMemberType(char[] typeName) {
memberTypes(); // ensure memberTypes have been initialized... must create all at once unlike methods
int typeLength = typeName.length;
for (int i = this.memberTypes.length; --i >= 0;) {
ReferenceBinding memberType = this.memberTypes[i];
if (memberType.sourceName.length == typeLength && CharOperation.equals(memberType.sourceName, typeName))
return memberType;
}
return null;
}
/**
* @see org.eclipse.jdt.internal.compiler.lookup.ReferenceBinding#getMethods(char[])
*/
public MethodBinding[] getMethods(char[] selector) {
if (this.methods != null) {
long range;
if ((range = ReferenceBinding.binarySearch(selector, this.methods)) >= 0) {
int start = (int) range;
int length = (int) (range >> 32) - start + 1;
// cannot optimize since some clients rely on clone array
// if (start == 0 && length == this.methods.length)
// return this.methods; // current set is already interesting subset
MethodBinding[] result;
System.arraycopy(this.methods, start, result = new MethodBinding[length], 0, length);
return result;
}
}
if ((tagBits & TagBits.AreMethodsComplete) != 0)
return Binding.NO_METHODS; // have created all the methods and there are no matches
MethodBinding[] parameterizedMethods = null;
try {
MethodBinding[] originalMethods = this.type.getMethods(selector);
int length = originalMethods.length;
if (length == 0) return Binding.NO_METHODS;
parameterizedMethods = new MethodBinding[length];
for (int i = 0; i < length; i++)
// substitute methods, so as to get updated declaring class at least
parameterizedMethods[i] = createParameterizedMethod(originalMethods[i]);
if (this.methods == null) {
MethodBinding[] temp = new MethodBinding[length];
System.arraycopy(parameterizedMethods, 0, temp, 0, length);
this.methods = temp; // must be a copy of parameterizedMethods since it will be returned below
} else {
int total = length + this.methods.length;
MethodBinding[] temp = new MethodBinding[total];
System.arraycopy(parameterizedMethods, 0, temp, 0, length);
System.arraycopy(this.methods, 0, temp, length, this.methods.length);
if (total > 1)
ReferenceBinding.sortMethods(temp, 0, total); // resort to ensure order is good
this.methods = temp;
}
return parameterizedMethods;
} finally {
// if the original methods cannot be retrieved (ex. AbortCompilation), then assume we do not have any methods
if (parameterizedMethods == null)
this.methods = parameterizedMethods = Binding.NO_METHODS;
}
}
public boolean hasMemberTypes() {
return this.type.hasMemberTypes();
}
/**
* @see org.eclipse.jdt.internal.compiler.lookup.ReferenceBinding#implementsMethod(MethodBinding)
*/
public boolean implementsMethod(MethodBinding method) {
return this.type.implementsMethod(method); // erasure
}
void initialize(ReferenceBinding someType, TypeBinding[] someArguments) {
this.type = someType;
this.sourceName = someType.sourceName;
this.compoundName = someType.compoundName;
this.fPackage = someType.fPackage;
this.fileName = someType.fileName;
// should not be set yet
// this.superclass = null;
// this.superInterfaces = null;
// this.fields = null;
// this.methods = null;
this.modifiers = someType.modifiers & ~ExtraCompilerModifiers.AccGenericSignature; // discard generic signature, will compute later
// only set AccGenericSignature if parameterized or have enclosing type required signature
if (someArguments != null) {
this.modifiers |= ExtraCompilerModifiers.AccGenericSignature;
} else if (this.enclosingType != null) {
this.modifiers |= (this.enclosingType.modifiers & ExtraCompilerModifiers.AccGenericSignature);
this.tagBits |= this.enclosingType.tagBits & TagBits.HasTypeVariable;
}
if (someArguments != null) {
this.arguments = someArguments;
for (int i = 0, length = someArguments.length; i < length; i++) {
TypeBinding someArgument = someArguments[i];
boolean isWildcardArgument = someArgument.isWildcard();
if (isWildcardArgument) {
this.tagBits |= TagBits.HasDirectWildcard;
}
if (!isWildcardArgument || ((WildcardBinding) someArgument).boundKind != Wildcard.UNBOUND) {
this.tagBits |= TagBits.IsBoundParameterizedType;
}
this.tagBits |= someArgument.tagBits & TagBits.HasTypeVariable;
}
}
this.tagBits |= someType.tagBits & (TagBits.IsLocalType| TagBits.IsMemberType | TagBits.IsNestedType);
this.tagBits &= ~(TagBits.AreFieldsComplete|TagBits.AreMethodsComplete);
}
protected void initializeArguments() {
// do nothing for true parameterized types (only for raw types)
}
public boolean isEquivalentTo(TypeBinding otherType) {
if (this == otherType)
return true;
if (otherType == null)
return false;
switch(otherType.kind()) {
case Binding.WILDCARD_TYPE :
return ((WildcardBinding) otherType).boundCheck(this);
case Binding.PARAMETERIZED_TYPE :
ParameterizedTypeBinding otherParamType = (ParameterizedTypeBinding) otherType;
if (this.type != otherParamType.type)
return false;
if (!isStatic()) { // static member types do not compare their enclosing
ReferenceBinding enclosing = enclosingType();
if (enclosing != null) {
ReferenceBinding otherEnclosing = otherParamType.enclosingType();
if (otherEnclosing == null) return false;
if ((otherEnclosing.tagBits & TagBits.HasDirectWildcard) == 0) {
if (enclosing != otherEnclosing) return false;
} else {
if (!enclosing.isEquivalentTo(otherParamType.enclosingType())) return false;
}
}
}
if (this.arguments == null) {
return otherParamType.arguments == null;
}
int length = this.arguments.length;
TypeBinding[] otherArguments = otherParamType.arguments;
if (otherArguments == null || otherArguments.length != length) return false;
for (int i = 0; i < length; i++) {
if (!this.arguments[i].isTypeArgumentContainedBy(otherArguments[i]))
return false;
}
return true;
case Binding.RAW_TYPE :
return erasure() == otherType.erasure();
}
return false;
}
public boolean isIntersectingWith(TypeBinding otherType) {
if (this == otherType)
return true;
if (otherType == null)
return false;
switch(otherType.kind()) {
case Binding.PARAMETERIZED_TYPE :
ParameterizedTypeBinding otherParamType = (ParameterizedTypeBinding) otherType;
if (this.type != otherParamType.type)
return false;
if (!isStatic()) { // static member types do not compare their enclosing
ReferenceBinding enclosing = enclosingType();
if (enclosing != null) {
ReferenceBinding otherEnclosing = otherParamType.enclosingType();
if (otherEnclosing == null) return false;
if ((otherEnclosing.tagBits & TagBits.HasDirectWildcard) == 0) {
if (enclosing != otherEnclosing) return false;
} else {
if (!enclosing.isEquivalentTo(otherParamType.enclosingType())) return false;
}
}
}
int length = this.arguments == null ? 0 : this.arguments.length;
TypeBinding[] otherArguments = otherParamType.arguments;
int otherLength = otherArguments == null ? 0 : otherArguments.length;
if (otherLength != length)
return false;
for (int i = 0; i < length; i++) {
if (!this.arguments[i].isTypeArgumentIntersecting(otherArguments[i]))
return false;
}
return true;
case Binding.GENERIC_TYPE :
SourceTypeBinding otherGenericType = (SourceTypeBinding) otherType;
if (this.type != otherGenericType)
return false;
if (!isStatic()) { // static member types do not compare their enclosing
ReferenceBinding enclosing = enclosingType();
if (enclosing != null) {
ReferenceBinding otherEnclosing = otherGenericType.enclosingType();
if (otherEnclosing == null) return false;
if ((otherEnclosing.tagBits & TagBits.HasDirectWildcard) == 0) {
if (enclosing != otherEnclosing) return false;
} else {
if (!enclosing.isEquivalentTo(otherGenericType.enclosingType())) return false;
}
}
}
length = this.arguments == null ? 0 : this.arguments.length;
otherArguments = otherGenericType.typeVariables();
otherLength = otherArguments == null ? 0 : otherArguments.length;
if (otherLength != length)
return false;
for (int i = 0; i < length; i++) {
if (!this.arguments[i].isTypeArgumentIntersecting(otherArguments[i]))
return false;
}
return true;
case Binding.RAW_TYPE :
return erasure() == otherType.erasure();
}
return false;
}
/**
* @see org.eclipse.jdt.internal.compiler.lookup.TypeBinding#isParameterizedType()
*/
public boolean isParameterizedType() {
return true;
}
/**
* @see org.eclipse.jdt.internal.compiler.lookup.Substitution#isRawSubstitution()
*/
public boolean isRawSubstitution() {
return isRawType();
}
public int kind() {
return PARAMETERIZED_TYPE;
}
/**
* @see org.eclipse.jdt.internal.compiler.lookup.ReferenceBinding#memberTypes()
*/
public ReferenceBinding[] memberTypes() {
if (this.memberTypes == null) {
try {
ReferenceBinding[] originalMemberTypes = this.type.memberTypes();
int length = originalMemberTypes.length;
ReferenceBinding[] parameterizedMemberTypes = new ReferenceBinding[length];
// boolean isRaw = this.isRawType();
for (int i = 0; i < length; i++)
// substitute all member types, so as to get updated enclosing types
parameterizedMemberTypes[i] = /*isRaw && originalMemberTypes[i].isGenericType()
? this.environment.createRawType(originalMemberTypes[i], this)
: */ this.environment.createParameterizedType(originalMemberTypes[i], null, this);
this.memberTypes = parameterizedMemberTypes;
} finally {
// if the original fields cannot be retrieved (ex. AbortCompilation), then assume we do not have any fields
if (this.memberTypes == null)
this.memberTypes = Binding.NO_MEMBER_TYPES;
}
}
return this.memberTypes;
}
/**
* @see org.eclipse.jdt.internal.compiler.lookup.ReferenceBinding#methods()
*/
public MethodBinding[] methods() {
if ((tagBits & TagBits.AreMethodsComplete) != 0)
return this.methods;
try {
MethodBinding[] originalMethods = this.type.methods();
int length = originalMethods.length;
MethodBinding[] parameterizedMethods = new MethodBinding[length];
for (int i = 0; i < length; i++)
// substitute all methods, so as to get updated declaring class at least
parameterizedMethods[i] = createParameterizedMethod(originalMethods[i]);
this.methods = parameterizedMethods;
} finally {
// if the original methods cannot be retrieved (ex. AbortCompilation), then assume we do not have any methods
if (this.methods == null)
this.methods = Binding.NO_METHODS;
tagBits |= TagBits.AreMethodsComplete;
}
return this.methods;
}
/**
* @see org.eclipse.jdt.internal.compiler.lookup.TypeBinding#qualifiedPackageName()
*/
public char[] qualifiedPackageName() {
return this.type.qualifiedPackageName();
}
/**
* @see org.eclipse.jdt.internal.compiler.lookup.TypeBinding#qualifiedSourceName()
*/
public char[] qualifiedSourceName() {
return this.type.qualifiedSourceName();
}
/**
* @see org.eclipse.jdt.internal.compiler.lookup.Binding#readableName()
*/
public char[] readableName() {
StringBuffer nameBuffer = new StringBuffer(10);
if (this.isMemberType()) {
nameBuffer.append(CharOperation.concat(this.enclosingType().readableName(), sourceName, '.'));
} else {
nameBuffer.append(CharOperation.concatWith(this.type.compoundName, '.'));
}
if (this.arguments != null) {
nameBuffer.append('<');
for (int i = 0, length = this.arguments.length; i < length; i++) {
if (i > 0) nameBuffer.append(',');
nameBuffer.append(this.arguments[i].readableName());
}
nameBuffer.append('>');
}
int nameLength = nameBuffer.length();
char[] readableName = new char[nameLength];
nameBuffer.getChars(0, nameLength, readableName, 0);
return readableName;
}
ReferenceBinding resolve() {
if ((this.tagBits & TagBits.HasUnresolvedTypeVariables) == 0)
return this;
this.tagBits &= ~TagBits.HasUnresolvedTypeVariables; // can be recursive so only want to call once
ReferenceBinding resolvedType = BinaryTypeBinding.resolveType(this.type, this.environment, false); // still part of parameterized type ref
if (this.arguments != null) {
int argLength = this.arguments.length;
for (int i = 0; i < argLength; i++)
BinaryTypeBinding.resolveType(this.arguments[i], this.environment, this, i);
// arity check
TypeVariableBinding[] refTypeVariables = resolvedType.typeVariables();
if (refTypeVariables == Binding.NO_TYPE_VARIABLES) { // check generic
this.environment.problemReporter.nonGenericTypeCannotBeParameterized(null, resolvedType, this.arguments);
return this; // cannot reach here as AbortCompilation is thrown
} else if (argLength != refTypeVariables.length) { // check arity
this.environment.problemReporter.incorrectArityForParameterizedType(null, resolvedType, this.arguments);
return this; // cannot reach here as AbortCompilation is thrown
}
// check argument type compatibility... REMOVED for now since incremental build will propagate change & detect in source
// for (int i = 0; i < argLength; i++) {
// TypeBinding resolvedArgument = this.arguments[i];
// if (refTypeVariables[i].boundCheck(this, resolvedArgument) != TypeConstants.OK) {
// this.environment.problemReporter.typeMismatchError(resolvedArgument, refTypeVariables[i], resolvedType, null);
// }
// }
}
return this;
}
/**
* @see org.eclipse.jdt.internal.compiler.lookup.Binding#shortReadableName()
*/
public char[] shortReadableName() {
StringBuffer nameBuffer = new StringBuffer(10);
if (this.isMemberType()) {
nameBuffer.append(CharOperation.concat(this.enclosingType().shortReadableName(), sourceName, '.'));
} else {
nameBuffer.append(this.type.sourceName);
}
if (this.arguments != null) {
nameBuffer.append('<');
for (int i = 0, length = this.arguments.length; i < length; i++) {
if (i > 0) nameBuffer.append(',');
nameBuffer.append(this.arguments[i].shortReadableName());
}
nameBuffer.append('>');
}
int nameLength = nameBuffer.length();
char[] shortReadableName = new char[nameLength];
nameBuffer.getChars(0, nameLength, shortReadableName, 0);
return shortReadableName;
}
/**
* @see org.eclipse.jdt.internal.compiler.lookup.TypeBinding#signature()
*/
public char[] signature() {
if (this.signature == null) {
this.signature = this.type.signature(); // erasure
}
return this.signature;
}
/**
* @see org.eclipse.jdt.internal.compiler.lookup.TypeBinding#sourceName()
*/
public char[] sourceName() {
return this.type.sourceName();
}
/**
* @see org.eclipse.jdt.internal.compiler.lookup.Substitution#substitute(org.eclipse.jdt.internal.compiler.lookup.TypeVariableBinding)
*/
public TypeBinding substitute(TypeVariableBinding originalVariable) {
ParameterizedTypeBinding currentType = this;
while (true) {
TypeVariableBinding[] typeVariables = currentType.type.typeVariables();
int length = typeVariables.length;
// check this variable can be substituted given parameterized type
if (originalVariable.rank < length && typeVariables[originalVariable.rank] == originalVariable) {
// lazy init, since cannot do so during binding creation if during supertype connection
if (currentType.arguments == null)
currentType.initializeArguments(); // only for raw types
if (currentType.arguments != null)
return currentType.arguments[originalVariable.rank];
}
// recurse on enclosing type, as it may hold more substitutions to perform
if (currentType.isStatic()) break;
ReferenceBinding enclosing = currentType.enclosingType();
if (!(enclosing instanceof ParameterizedTypeBinding))
break;
currentType = (ParameterizedTypeBinding) enclosing;
}
return originalVariable;
}
/**
* @see org.eclipse.jdt.internal.compiler.lookup.ReferenceBinding#superclass()
*/
public ReferenceBinding superclass() {
if (this.superclass == null) {
// note: Object cannot be generic
ReferenceBinding genericSuperclass = this.type.superclass();
if (genericSuperclass == null) return null; // e.g. interfaces
this.superclass = (ReferenceBinding) Scope.substitute(this, genericSuperclass);
}
return this.superclass;
}
/**
* @see org.eclipse.jdt.internal.compiler.lookup.ReferenceBinding#superInterfaces()
*/
public ReferenceBinding[] superInterfaces() {
if (this.superInterfaces == null) {
if (this.type.isHierarchyBeingConnected())
return Binding.NO_SUPERINTERFACES; // prevent superinterfaces from being assigned before they are connected
this.superInterfaces = Scope.substitute(this, this.type.superInterfaces());
}
return this.superInterfaces;
}
public void swapUnresolved(UnresolvedReferenceBinding unresolvedType, ReferenceBinding resolvedType, LookupEnvironment env) {
boolean update = false;
if (this.type == unresolvedType) {
this.type = resolvedType; // cannot be raw since being parameterized below
update = true;
ReferenceBinding enclosing = resolvedType.enclosingType();
if (enclosing != null) {
this.enclosingType = (ReferenceBinding) env.convertUnresolvedBinaryToRawType(enclosing); // needed when binding unresolved member type
}
}
if (this.arguments != null) {
for (int i = 0, l = this.arguments.length; i < l; i++) {
if (this.arguments[i] == unresolvedType) {
this.arguments[i] = env.convertUnresolvedBinaryToRawType(resolvedType);
update = true;
}
}
}
if (update)
initialize(this.type, this.arguments);
}
/**
* @see org.eclipse.jdt.internal.compiler.lookup.ReferenceBinding#syntheticEnclosingInstanceTypes()
*/
public ReferenceBinding[] syntheticEnclosingInstanceTypes() {
return this.type.syntheticEnclosingInstanceTypes();
}
/**
* @see org.eclipse.jdt.internal.compiler.lookup.ReferenceBinding#syntheticOuterLocalVariables()
*/
public SyntheticArgumentBinding[] syntheticOuterLocalVariables() {
return this.type.syntheticOuterLocalVariables();
}
/**
* @see java.lang.Object#toString()
*/
public String toString() {
StringBuffer buffer = new StringBuffer(30);
if (isDeprecated()) buffer.append("deprecated "); //$NON-NLS-1$
if (isPublic()) buffer.append("public "); //$NON-NLS-1$
if (isProtected()) buffer.append("protected "); //$NON-NLS-1$
if (isPrivate()) buffer.append("private "); //$NON-NLS-1$
if (isAbstract() && isClass()) buffer.append("abstract "); //$NON-NLS-1$
if (isStatic() && isNestedType()) buffer.append("static "); //$NON-NLS-1$
if (isFinal()) buffer.append("final "); //$NON-NLS-1$
if (isEnum()) buffer.append("enum "); //$NON-NLS-1$
else if (isAnnotationType()) buffer.append("@interface "); //$NON-NLS-1$
else if (isClass()) buffer.append("class "); //$NON-NLS-1$
else buffer.append("interface "); //$NON-NLS-1$
buffer.append(this.debugName());
buffer.append("\n\textends "); //$NON-NLS-1$
buffer.append((superclass != null) ? superclass.debugName() : "NULL TYPE"); //$NON-NLS-1$
if (superInterfaces != null) {
if (superInterfaces != Binding.NO_SUPERINTERFACES) {
buffer.append("\n\timplements : "); //$NON-NLS-1$
for (int i = 0, length = superInterfaces.length; i < length; i++) {
if (i > 0)
buffer.append(", "); //$NON-NLS-1$
buffer.append((superInterfaces[i] != null) ? superInterfaces[i].debugName() : "NULL TYPE"); //$NON-NLS-1$
}
}
} else {
buffer.append("NULL SUPERINTERFACES"); //$NON-NLS-1$
}
if (enclosingType() != null) {
buffer.append("\n\tenclosing type : "); //$NON-NLS-1$
buffer.append(enclosingType().debugName());
}
if (fields != null) {
if (fields != Binding.NO_FIELDS) {
buffer.append("\n/* fields */"); //$NON-NLS-1$
for (int i = 0, length = fields.length; i < length; i++)
buffer.append('\n').append((fields[i] != null) ? fields[i].toString() : "NULL FIELD"); //$NON-NLS-1$
}
} else {
buffer.append("NULL FIELDS"); //$NON-NLS-1$
}
if (methods != null) {
if (methods != Binding.NO_METHODS) {
buffer.append("\n/* methods */"); //$NON-NLS-1$
for (int i = 0, length = methods.length; i < length; i++)
buffer.append('\n').append((methods[i] != null) ? methods[i].toString() : "NULL METHOD"); //$NON-NLS-1$
}
} else {
buffer.append("NULL METHODS"); //$NON-NLS-1$
}
// if (memberTypes != null) {
// if (memberTypes != NoMemberTypes) {
// buffer.append("\n/* members */");
// for (int i = 0, length = memberTypes.length; i < length; i++)
// buffer.append('\n').append((memberTypes[i] != null) ? memberTypes[i].toString() : "NULL TYPE");
// }
// } else {
// buffer.append("NULL MEMBER TYPES");
// }
buffer.append("\n\n"); //$NON-NLS-1$
return buffer.toString();
}
public TypeVariableBinding[] typeVariables() {
if (this.arguments == null) {
// retain original type variables if not substituted (member type of parameterized type)
return this.type.typeVariables();
}
return Binding.NO_TYPE_VARIABLES;
}
}
| [
"375833274@qq.com"
] | 375833274@qq.com |
e7d198c3473156eaa98c72ffcd3423aaa4ed09cf | 602fdc5c23e5cb8b872566a34eaefe81ab910051 | /src/main/java/com/example/demo/model/Cozinha.java | b2e348580a146453e7e26ec275d1a701e669a3a0 | [] | no_license | marlusmarcos/teinamento-Spring | b5fcd2bdfaa21eaa2ae04bc3fcead51d8f68fa40 | 33083878ab95229050db0fb9bac443635c2e30bf | refs/heads/main | 2023-08-16T18:55:49.639545 | 2021-10-08T19:29:42 | 2021-10-08T19:29:42 | 415,079,299 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 917 | java | package com.example.demo.model;
import java.util.Objects;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
@Entity
public class Cozinha {
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
private Long id;
@Column (nullable = false)
private String nome;
public Long getId() {
return id;
}
public void setId(Long id) {
this.id = id;
}
public String getNome() {
return nome;
}
public void setNome(String nome) {
this.nome = nome;
}
@Override
public int hashCode() {
return Objects.hash(id);
}
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (getClass() != obj.getClass())
return false;
Cozinha other = (Cozinha) obj;
return Objects.equals(id, other.id);
}
}
| [
"marlusufrn@gmail.com"
] | marlusufrn@gmail.com |
6bd60a9ce325c5045c42ec9acc21bcf48f5c4917 | f49ff4003fed20a6d1482b60d87ee096344b3a2b | /TestNGPractise/src/com/testngexamples/MouseMovementTest.java | 18bb8e77a7133fcfefba035d1f1b82d6a98f94b9 | [] | no_license | ROSEANDSARU/MavenTest | 99e93f259c9a18032fee96b5ab47eab84eb9ec9e | eae5020f408bd0aa3a1fa5745ab69873b9e2baac | refs/heads/master | 2020-03-07T15:24:56.651326 | 2018-03-31T15:32:22 | 2018-03-31T15:32:22 | 127,554,135 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,587 | java | package com.testngexamples;
import java.util.concurrent.TimeUnit;
import org.openqa.selenium.By;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.chrome.ChromeDriver;
import org.openqa.selenium.interactions.Actions;
import org.testng.annotations.Test;
public class MouseMovementTest {
WebDriver driver ;
@Test
public void mousemoventTest() throws Exception{
System.setProperty("webdriver.chrome.driver", "D:\\selenium\\drivers\\chromedriver.exe");
driver = new ChromeDriver();
driver.manage().window().maximize();
driver.manage().deleteAllCookies();
driver.manage().timeouts().pageLoadTimeout(40, TimeUnit.SECONDS);
driver.manage().timeouts().implicitlyWait(40, TimeUnit.SECONDS);
driver.get("http://www.spicejet.com/");
Actions actions =new Actions(driver);
Thread.sleep(3000);
//actions.moveToElement(driver.findElement(By.xpath(".//*[@class='burger-bread']"))).build().perform();
actions.moveToElement(driver.findElement(By.id("ctl00_HyperLinkLogin"))).build().perform();
Thread.sleep(3000);
actions.moveToElement(driver.findElement(By.xpath(".//*[@class='li-login float-right']/ul/li[2]/a"))).build().perform();
Thread.sleep(3000);
driver.findElement(By.xpath(".//a[contains(text(),'Sign up')]")).click();
//driver.findElement(By.xpath(".//*[@id='smoothmenu1']/ul/li[13]/ul/li[3]/a")).click();
//actions.moveToElement(driver.findElement(By.xpath(".//*[@id='smoothmenu1']/ul/li[13]/ul/li[3]/a"))).build().perform();
// driver.findElement(By.xpath(".//*[@class='burger-bread']")).click();
}
}
| [
"roseandsaru@gmail.com"
] | roseandsaru@gmail.com |
e8230519a0753147326b9f228f29c19ddfcf58e7 | 0aed882c36fd5594fed0d2490c13743e69e2f6d5 | /src/main/java/com/company/interview/statistics/FloatStatistic.java | 2232261e4f583c7af11857a91212530f1eff1e8b | [] | no_license | anitasv/interview2 | ab14b8783b831d57c283dbb3163e4b3089e9034a | 26ac14ffed9920b262ffba4585b9c764e7530c98 | refs/heads/master | 2020-12-23T02:20:12.621815 | 2017-12-07T05:04:21 | 2017-12-07T05:04:21 | 59,847,249 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,126 | java | package com.company.interview.statistics;
public class FloatStatistic implements Statistic {
private volatile int minSoFar = Integer.MAX_VALUE;
private volatile int maxSoFar = Integer.MIN_VALUE;
private volatile long sum = 0;
private volatile float sum_sq = 0;
private volatile int count = 0;
public void event(int value) {
sum = Math.addExact(sum, value);
sum_sq = sum_sq + ((float)value) * value;
count++;
if (value < minSoFar) {
minSoFar = value;
}
if (value > maxSoFar) {
maxSoFar = value;
}
}
public float mean() {
return (float) sum / count;
}
public int minimum() {
return minSoFar;
}
public int maximum() {
return maxSoFar;
}
public float variance() {
return (sum_sq / count) - sq(mean());
}
private static float sq(float mean) {
return mean * mean;
}
public long sum() {
return sum;
}
public float sumSq() {
return sum_sq;
}
public long count() {
return count;
}
}
| [
"anita.vasu@inmobi.com"
] | anita.vasu@inmobi.com |
f909eb164151a5b4e47f99ed19d81b738a916312 | ab8254452d306d02c8ae838b860ca104965eea01 | /Code/src/groove/explore/abeona/AbeonaHelpers.java | cd6d55431581b7055904d0a75508601c3bf77a66 | [] | no_license | maritaria/abeona-groove | ed128c431099d6a18ea77ce10b9a9d9c1776c08a | e6152cded6ef64dbaa0bcc7f57ae2ad2b9b75739 | refs/heads/master | 2020-12-22T23:50:30.136397 | 2020-03-26T13:34:01 | 2020-03-26T13:34:01 | 236,968,333 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,141 | java | package groove.explore.abeona;
import groove.grammar.Rule;
import groove.lts.GraphState;
import groove.lts.RuleTransition;
import java.util.Objects;
import java.util.Optional;
import java.util.function.Function;
import java.util.stream.Stream;
public final class AbeonaHelpers {
public static Stream<RuleTransition> listOutgoingRuleTransitions(GraphState state) {
return Stream.of(listCachedRuleTransitions(state), listMatcherRuleTransitions(state))
.flatMap(Function.identity());
}
public static Stream<RuleTransition> listCachedRuleTransitions(GraphState state) {
return state.getRuleTransitions().stream();
}
public static Stream<RuleTransition> listMatcherRuleTransitions(GraphState state) {
return state.getMatches().stream().map(matchResult -> {
try {
return state.applyMatch(matchResult);
} catch (InterruptedException e) {
return null;
}
}).filter(Objects::nonNull);
}
public static Optional<RuleTransition> findRuleTransition(Rule rule, GraphState state) {
return Stream.of(findCachedRuleTransition(rule, state), findMatchedRuleTransition(rule, state))
.flatMap(Function.identity())
.findFirst();
}
private static Stream<RuleTransition> findCachedRuleTransition(Rule targetRule, GraphState state) {
return state.getRuleTransitions()
.stream()
.filter(ruleTransition -> ruleTransition.getEvent().getRule().equals(targetRule));
}
private static Stream<RuleTransition> findMatchedRuleTransition(Rule targetRule, GraphState state) {
return state.getMatches()
.stream()
.filter(matchResult -> matchResult.getAction().equals(targetRule))
.map(matchResult -> {
try {
return state.applyMatch(matchResult);
} catch (InterruptedException e) {
return null;
}
})
.filter(Objects::nonNull);
}
}
| [
"bramkamies@gmail.com"
] | bramkamies@gmail.com |
529197937d05f082c12e6d5ca57db4e3115ab3f9 | d3140a51514714b201d270afdb63d8fd71c6bff9 | /src/main/java/se/transport/bus/api/model/BusStops.java | 3820b71a01321eaca68470bb0c5229c139dffe57 | [] | no_license | lingapsg/bus-transport-service | 9117cdb44bfba5a6dec37513e89ca1a2236a05a5 | 672af406e5a1985c46ad186a5f9284fe01d9bc83 | refs/heads/master | 2020-12-28T11:20:35.136211 | 2020-02-05T12:00:50 | 2020-02-05T12:00:50 | 238,311,015 | 1 | 1 | null | null | null | null | UTF-8 | Java | false | false | 375 | java | package se.transport.bus.api.model;
import se.transport.bus.client.response.StopPoint;
import lombok.Builder;
import lombok.Data;
import java.io.Serializable;
import java.util.List;
import java.util.Map;
@Data
@Builder(toBuilder = true)
public class BusStops implements Serializable {
private String lineNumber;
private Map<String, List<StopPoint>> busStops;
}
| [
"lingarajkumar.srinivasaperumal@nordea.com"
] | lingarajkumar.srinivasaperumal@nordea.com |
2d7ee2df7627f66092004464c7ab9c99cb4dc18b | 65e5ce48b9b2ae13e1b8a8f42a6849736f35d024 | /experiments/DataSources/2-TestDS/2-treated_data/DetailReceptionIntrantEditor.java | 23d4ad03cf758161df9af650d9470a4a92b952c1 | [] | no_license | jiofidelus/knowExtracFromSC | ca47b146030323045188ad3ec05b54543f8bfa9d | 83d2e7f9ad558f4506dbc568ec44ef8fb9f24660 | refs/heads/master | 2020-03-19T07:11:49.586753 | 2018-06-25T23:42:01 | 2018-06-25T23:42:01 | 136,095,166 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 13,984 | java | package org.imogene.epicam.client.ui.editor ; public class DetailReceptionIntrantEditor extends Composite implements Editor<DetailReceptionIntrantProxy>, HasEditorDelegate<DetailReceptionIntrantProxy>, HasEditorErrors<DetailReceptionIntrantProxy> { interface Binder extends UiBinder<Widget, DetailReceptionIntrantEditor> { } private static final Binder BINDER = GWT.create(Binder.class) ; protected final EpicamRequestFactory requestFactory ; private List<HandlerRegistration> registrations = new ArrayList<HandlerRegistration>() ; private EditorDelegate<DetailReceptionIntrantProxy> delegate ; private DetailReceptionIntrantProxy editedValue ; //Not used by the editor private boolean hideButtons = false ; @UiField @Ignore FieldGroupPanel descriptionSection ; @UiField(provided = true) ImogSingleRelationBox<ReceptionProxy> reception ; private ReceptionDataProvider receptionDataProvider ; @UiField(provided = true) ImogSingleRelationBox<CommandeProxy> commande ; private CommandeDataProvider commandeDataProvider ; @UiField(provided = true) ImogSingleRelationBox<DetailCommandeIntrantProxy> detailCommande ; private DetailCommandeIntrantDataProvider detailCommandeDataProvider ; @UiField(provided = true) EntreeLotEditorNestedRow entreeLot ; private EntreeLotDataProvider entreeLotDataProvider ; * Constructor * @param factory the application request factory * @param hideButtons true if the relation field buttons shall be hidden public DetailReceptionIntrantEditor(EpicamRequestFactory factory, boolean hideButtons) { this.requestFactory = factory ; this.hideButtons = hideButtons ; setRelationFields() ; initWidget(BINDER.createAndBindUi(this)) ; properties() ; } * Constructor * @param factory the application request factory public DetailReceptionIntrantEditor(EpicamRequestFactory factory) { this(factory, false) ; } * Sets the properties of the fields private void properties() { descriptionSection.setGroupTitle(NLS.constants() .detailReceptionIntrant_group_description()) ; reception.setLabel(NLS.constants() .detailReceptionIntrant_field_reception()) ; // hidden field reception.setVisible(false) ; commande.setLabel(NLS.constants() .detailReceptionIntrant_field_commande()) ; // the value of commande affects the value of other fields commande.notifyChanges(requestFactory.getEventBus()) ; // hidden field commande.setVisible(false) ; detailCommande.setLabel(NLS.constants() .detailReceptionIntrant_field_detailCommande()) ; } * Configures the widgets that manage relation fields private void setRelationFields() { receptionDataProvider = new ReceptionDataProvider(requestFactory) ; if (hideButtons) // in popup, relation buttons hidden reception = new ImogSingleRelationBox<ReceptionProxy>( receptionDataProvider, EpicamRenderer.get(), true) ; else {// in wrapper panel, relation buttons enabled if (AccessManager.canCreateReception() && AccessManager.canEditReception()) reception = new ImogSingleRelationBox<ReceptionProxy>( receptionDataProvider, EpicamRenderer.get()) ; else reception = new ImogSingleRelationBox<ReceptionProxy>(false, receptionDataProvider, EpicamRenderer.get()) ; } commandeDataProvider = new CommandeDataProvider(requestFactory) ; if (hideButtons) // in popup, relation buttons hidden commande = new ImogSingleRelationBox<CommandeProxy>( commandeDataProvider, EpicamRenderer.get(), true) ; else {// in wrapper panel, relation buttons enabled if (AccessManager.canCreateCommande() && AccessManager.canEditCommande()) commande = new ImogSingleRelationBox<CommandeProxy>( commandeDataProvider, EpicamRenderer.get()) ; else commande = new ImogSingleRelationBox<CommandeProxy>(false, commandeDataProvider, EpicamRenderer.get()) ; } detailCommandeDataProvider = new DetailCommandeIntrantDataProvider( requestFactory) ; if (hideButtons) // in popup, relation buttons hidden detailCommande = new ImogSingleRelationBox<DetailCommandeIntrantProxy>( detailCommandeDataProvider, EpicamRenderer.get(), true) ; else {// in wrapper panel, relation buttons enabled if (AccessManager.canCreateDetailCommandeIntrant() && AccessManager.canEditDetailCommandeIntrant()) detailCommande = new ImogSingleRelationBox<DetailCommandeIntrantProxy>( detailCommandeDataProvider, EpicamRenderer.get()) ; else detailCommande = new ImogSingleRelationBox<DetailCommandeIntrantProxy>( false, detailCommandeDataProvider, EpicamRenderer.get()) ; } entreeLot = new EntreeLotEditorNestedRow(requestFactory) ; } * Sets the edition mode * @param isEdited true to enable the edition of the form public void setEdited(boolean isEdited) { if (isEdited) setFieldEditAccess() ; else setFieldReadAccess() ; // readonly field reception.setEdited(false) ; commande.setEdited(isEdited) ; detailCommande.setEdited(isEdited) ; entreeLot.setEdited(isEdited) ; } * Configures the visibility of the fields * in view mode depending on the user privileges private void setFieldReadAccess() { if (!AccessManager.canReadDetailReceptionIntrantDescription()) descriptionSection.setVisible(false) ; } * Configures the visibility of the fields * in edit mode depending on the user privileges private void setFieldEditAccess() { if (!AccessManager.canEditDetailReceptionIntrantDescription()) descriptionSection.setVisible(false) ; } * Sets the Request Context for the List Editors. public void setRequestContextForListEditors( DetailReceptionIntrantRequest ctx) { entreeLot.setRequestContextForListEditors(ctx) ; } * Manages editor updates when a field value changes private void setFieldValueChangeHandler() { registrations.add(requestFactory.getEventBus().addHandler( FieldValueChangeEvent.TYPE, new FieldValueChangeEvent.Handler() { @Override public void onValueChange(ImogField<?> field) { // field dependent visibility management computeVisibility(field, false) ; if (field.equals(commande)) { clearDetailCommandeWidget() ; getDetailCommandeFilteredByCommande(commande .getValue()) ; } } } )) ; } * Computes the field visibility public void computeVisibility(ImogField<?> source, boolean allValidation) { entreeLot.computeVisibility(source, allValidation) ; } * Filters the content of the RelationField DetailCommande by the value of * the RelationField Commande * @param commande the value of * the RelationField Commande public void getDetailCommandeFilteredByCommande(CommandeProxy pCommande) { if (pCommande != null) { if (!hideButtons) detailCommande.hideButtons(false) ; detailCommandeDataProvider.setFilterCriteria(pCommande.getId(), "commande.id") ; } else { detailCommande.hideButtons(true) ; detailCommandeDataProvider.setFilterCriteria(null) ; } } * Setter to inject a Reception value * @param value the value to be injected into the editor * @param isLocked true if relation field shall be locked (non editable) public void setReception(ReceptionProxy value, boolean isLocked) { reception.setLocked(isLocked) ; reception.setValue(value) ; } private void clearReceptionWidget() { reception.clear() ; } * Setter to inject a Commande value * @param value the value to be injected into the editor * @param isLocked true if relation field shall be locked (non editable) public void setCommande(CommandeProxy value, boolean isLocked) { commande.setLocked(isLocked) ; commande.setValue(value) ; // Field DetailCommande depends on the value of field commande clearDetailCommandeWidget() ; getDetailCommandeFilteredByCommande(value) ; } private void clearCommandeWidget() { commande.clear() ; } * Setter to inject a DetailCommandeIntrant value * @param value the value to be injected into the editor * @param isLocked true if relation field shall be locked (non editable) public void setDetailCommande(DetailCommandeIntrantProxy value, boolean isLocked) { detailCommande.setLocked(isLocked) ; detailCommande.setValue(value) ; } private void clearDetailCommandeWidget() { detailCommande.clear() ; } * Configures the handlers of the widgets that manage relation fields private void setRelationHandlers() { reception.setViewClickHandler(new ClickHandler() { @Override public void onClick(ClickEvent event) { if (reception.getValue() != null) { RelationPopupPanel relationPopup = new RelationPopupPanel() ; ReceptionFormPanel form = new ReceptionFormPanel( requestFactory, reception.getValue().getId(), relationPopup, "reception") ; relationPopup.addWidget(form) ; relationPopup.show() ; } } } ) ; reception.setAddClickHandler(new ClickHandler() { @Override public void onClick(ClickEvent event) { RelationPopupPanel relationPopup = new RelationPopupPanel() ; ReceptionFormPanel form = new ReceptionFormPanel( requestFactory, null, relationPopup, "reception") ; relationPopup.addWidget(form) ; relationPopup.show() ; } } ) ; registrations.add(requestFactory.getEventBus().addHandler( SaveReceptionEvent.TYPE, new SaveReceptionEvent.Handler() { @Override public void saveReception(ReceptionProxy value) { reception.setValue(value) ; } @Override public void saveReception(ReceptionProxy value, String initField) { if (initField.equals("reception")) reception.setValue(value, true) ; } } )) ; commande.setViewClickHandler(new ClickHandler() { @Override public void onClick(ClickEvent event) { if (commande.getValue() != null) { RelationPopupPanel relationPopup = new RelationPopupPanel() ; CommandeFormPanel form = new CommandeFormPanel( requestFactory, commande.getValue().getId(), relationPopup, "commande") ; relationPopup.addWidget(form) ; relationPopup.show() ; } } } ) ; commande.setAddClickHandler(new ClickHandler() { @Override public void onClick(ClickEvent event) { RelationPopupPanel relationPopup = new RelationPopupPanel() ; CommandeFormPanel form = new CommandeFormPanel(requestFactory, null, relationPopup, "commande") ; relationPopup.addWidget(form) ; relationPopup.show() ; } } ) ; registrations.add(requestFactory.getEventBus().addHandler( SaveCommandeEvent.TYPE, new SaveCommandeEvent.Handler() { @Override public void saveCommande(CommandeProxy value) { commande.setValue(value) ; } @Override public void saveCommande(CommandeProxy value, String initField) { if (initField.equals("commande")) commande.setValue(value, true) ; } } )) ; detailCommande.setViewClickHandler(new ClickHandler() { @Override public void onClick(ClickEvent event) { if (detailCommande.getValue() != null) { RelationPopupPanel relationPopup = new RelationPopupPanel() ; DetailCommandeIntrantFormPanel form = new DetailCommandeIntrantFormPanel( requestFactory, detailCommande.getValue().getId(), relationPopup, "detailCommande") ; relationPopup.addWidget(form) ; relationPopup.show() ; } } } ) ; detailCommande.setAddClickHandler(new ClickHandler() { @Override public void onClick(ClickEvent event) { RelationPopupPanel relationPopup = new RelationPopupPanel() ; DetailCommandeIntrantFormPanel form = new DetailCommandeIntrantFormPanel( requestFactory, null, relationPopup, "detailCommande") ; relationPopup.addWidget(form) ; relationPopup.show() ; } } ) ; registrations.add(requestFactory.getEventBus().addHandler( SaveDetailCommandeIntrantEvent.TYPE, new SaveDetailCommandeIntrantEvent.Handler() { @Override public void saveDetailCommandeIntrant( DetailCommandeIntrantProxy value) { detailCommande.setValue(value) ; } @Override public void saveDetailCommandeIntrant( DetailCommandeIntrantProxy value, String initField) { if (initField.equals("detailCommande")) detailCommande.setValue(value, true) ; } } )) ; } * Gets the DetailReceptionIntrantProxy that is edited in the Workflow * Not used by the editor * Temporary storage used to transmit the proxy to related entities * @return public DetailReceptionIntrantProxy getEditedValue() { return editedValue ; } * Sets the DetailReceptionIntrantProxy that is edited in the Workflow * Not used by the editor * Temporary storage used to transmit the proxy to related entities * @param editedValue public void setEditedValue(DetailReceptionIntrantProxy editedValue) { this.editedValue = editedValue ; } * public void raiseNotUniqueError(String field) { delegate.recordError(BaseNLS.messages().error_not_unique(), null, field) ; } * Validate fields values public void validateFields() { // commande is a required field if (commande.getValue() == null) delegate.recordError(BaseNLS.messages().error_required(), null, "commande") ; // detailCommande is a required field if (detailCommande.getValue() == null) delegate.recordError(BaseNLS.messages().error_required(), null, "detailCommande") ; // entreeLot nested form shall be validated entreeLot.validateFields() ; } private void setAllLabelWith(String width) { reception.setLabelWidth(width) ; commande.setLabelWidth(width) ; detailCommande.setLabelWidth(width) ; } private void setAllBoxWith(int width) { reception.setBoxWidth(width) ; commande.setBoxWidth(width) ; detailCommande.setBoxWidth(width) ; } @Override public void setDelegate(EditorDelegate<DetailReceptionIntrantProxy> delegate) { this.delegate = delegate ; } @Override public void showErrors(List<EditorError> errors) { if (errors != null && errors.size() > 0) { List<EditorError> commandeFieldErrors = new ArrayList<EditorError>() ; List<EditorError> detailCommandeFieldErrors = new ArrayList<EditorError>() ; for (EditorError error : errors) { Object userData = error.getUserData() ; if (userData != null && userData instanceof String) { String field = (String) userData ; if (field.equals("commande")) commandeFieldErrors.add(error) ; if (field.equals("detailCommande")) detailCommandeFieldErrors.add(error) ; } } if (commandeFieldErrors.size() > 0) commande.showErrors(commandeFieldErrors) ; if (detailCommandeFieldErrors.size() > 0) detailCommande.showErrors(detailCommandeFieldErrors) ; } } @Override protected void onUnload() { for (HandlerRegistration r : registrations) r.removeHandler() ; registrations.clear() ; super.onUnload() ; } @Override protected void onLoad() { setRelationHandlers() ; setFieldValueChangeHandler() ; super.onLoad() ; } } | [
"jiofidelus@gmail.com"
] | jiofidelus@gmail.com |
d6d83d84409d947ae82dfbc24a7efd7091f43987 | e83debe8026e94d587e6ee5cb648f8b35073f4bf | /app/src/main/java/com/dylanprioux/mareu/ui/add/SetupDateFragment.java | 7168849b0b3a4c2fbfab3f13a0f00eaca24758a4 | [] | no_license | DlnPrx/MaReu | 2ff63821c70ec4631f809a1e7db937f29f19c92f | 693f45bd30bcab075fcee1e08b45ff9c0304bdbb | refs/heads/master | 2023-06-17T06:59:44.074943 | 2021-07-10T12:39:33 | 2021-07-10T12:39:33 | 376,847,657 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,646 | java | package com.dylanprioux.mareu.ui.add;
import android.os.Bundle;
import androidx.fragment.app.Fragment;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.Button;
import android.widget.DatePicker;
import com.dylanprioux.mareu.R;
import com.dylanprioux.mareu.model.Meeting;
import java.util.Calendar;
import java.util.GregorianCalendar;
/**
* SetupDateFragment
* Fragment for add the meeting start day
*/
public class SetupDateFragment extends Fragment {
private Meeting mMeeting;
private View mView;
private Calendar mCalendar;
private DatePicker mDatePicker;
public SetupDateFragment() {
// Required empty public constructor
}
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
//get arguments from SetupSubjectFragment and put them into new meeting (mMeeting)
Bundle args = getArguments();
assert args != null;
mMeeting = args.getParcelable("newMeeting");
}
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,
Bundle savedInstanceState) {
// Inflate the layout for this fragment
mView = inflater.inflate(R.layout.fragment_setup_date, container, false);
setupWidget();
return mView;
}
private void setupWidget() {
//setup next button and datePicker
mDatePicker = mView.findViewById(R.id.fragment_setup_date_date_picker);
Button button = mView.findViewById(R.id.fragment_setup_date_next_button);
button.setTransformationMethod(null); //remove all caps
button.setOnClickListener(v -> {
mCalendar = new GregorianCalendar();
mCalendar.set(mDatePicker.getYear(), mDatePicker.getMonth(), mDatePicker.getDayOfMonth());
setupNewMeeting(mCalendar);
configureAndShowSetupTimeFragment();
});
}
private void setupNewMeeting(Calendar calendar) {
//add start time into meeting (mMeeting)
mMeeting.setStartCalendar(calendar);
}
private void configureAndShowSetupTimeFragment() {
//configure SetupTimeFragment and put the new meeting into arguments
SetupTimeFragment setupTimeFragment;
setupTimeFragment = new SetupTimeFragment();
Bundle args = new Bundle();
args.putParcelable("newMeeting", mMeeting);
setupTimeFragment.setArguments(args);
getParentFragmentManager().beginTransaction().replace(R.id.add_activity_container, setupTimeFragment).commit();
}
} | [
"73248967+DlnPrx@users.noreply.github.com"
] | 73248967+DlnPrx@users.noreply.github.com |
f34a09cf91db7e2b58beddcca80be18ff17d2f2b | 3456dcf752ae46f698baa188ffe98c8ed3269707 | /src/test/java/br/gov/df/se/pdaf/entities/UsuarioTests.java | 8ebf6eb3d87e4369a016cb8bf1c86b277fb97d45 | [] | no_license | carvalhosobrinhomatheus/basic_auth_custom | 7c57c4291c2ef3507d9e23c2c70c5d3c47419f3a | d333098c6075e924cfc6176c3929c42952815114 | refs/heads/master | 2020-09-21T19:39:18.876387 | 2019-11-29T18:45:52 | 2019-11-29T18:45:52 | 224,903,796 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 833 | java | package br.gov.df.se.pdaf.entities;
import static org.junit.Assert.assertNotNull;
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.test.context.junit4.SpringRunner;
import br.gov.df.se.pdaf.services.UsuarioService;
// https://static.javadoc.io/org.mockito/mockito-core/2.2.9/org/mockito/Mockito.html
// http://www.codeatest.com/mockito-isolamento-testes-unidade/
@RunWith(SpringRunner.class)
@SpringBootTest
public class UsuarioTests {
private String MOCK_MATRICULA = "2444267";
@Autowired
private UsuarioService usuarioService;
@Test
public void findByEmail() {
assertNotNull(usuarioService.findByMatricula(MOCK_MATRICULA));
}
} | [
"matheus.sobrinho@se.df.gov.br"
] | matheus.sobrinho@se.df.gov.br |
cd74744ec2e693974e88f25dec71b215ed9a50e9 | 527e6c527236f7a1f49800667a9331dc52c7eefa | /src/main/java/it/csi/siac/siacconsultazioneentitaapp/frontend/ui/util/datainfo/NumeroMovimentoGestioneTestataSubDataInfo.java | f6c618895428d1f3595f99631d7741c84b6362d7 | [] | no_license | unica-open/siacbilapp | 4953a8519a839c997798c3d39e220f61c0bce2b6 | bf2bf7d5609fe32cee2409057b811e5a6fa47a76 | refs/heads/master | 2021-01-06T14:57:26.105285 | 2020-03-03T17:01:19 | 2020-03-03T17:01:19 | 241,366,496 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,901 | java | /*
*SPDX-FileCopyrightText: Copyright 2020 | CSI Piemonte
*SPDX-License-Identifier: EUPL-1.2
*/
package it.csi.siac.siacconsultazioneentitaapp.frontend.ui.util.datainfo;
/**
* @author Marchino Alessandro
* @version 1.0.0 - 13/03/2017
*
*/
public class NumeroMovimentoGestioneTestataSubDataInfo extends PopoverDataInfo {
/**
* Costruttore
* @param name il nome del campo
* @param dataPlacement il posizionamento del popover
* @param descrizioneMovimentoGestioneKey la descrizione dell'accertamento
* @param annoMovimentoGestioneKey l'anno dell'accertamento
* @param numeroMovimentoGestioneKey il numero dell'accertamento
* @param numeroSubMovimentoGestioneKey il numero del subaccertamento
* @param testataSub se sia un accertamento o un subaccertamento
*/
public NumeroMovimentoGestioneTestataSubDataInfo(String name, String dataPlacement,String descrizioneMovimentoGestioneKey, String annoMovimentoGestioneKey, String numeroMovimentoGestioneKey, String numeroSubMovimentoGestioneKey, String testataSub) {
super(name, "{0}", dataPlacement, "Descrizione", "%%NUM_MG%%", descrizioneMovimentoGestioneKey, annoMovimentoGestioneKey, numeroMovimentoGestioneKey, numeroSubMovimentoGestioneKey, testataSub);
}
@Override
protected String preProcessPattern(String pattern, Object[] argumentsObject) {
String patternNew = pattern;
// Il parametro numero 4 indica se sono ub accertamento o un sub
if(argumentsObject.length > 4 && "T".equals(argumentsObject[4])) {
patternNew = patternNew.replaceAll("%%NUM_MG%%", "{1,number,#}/{2,number,#}");
} else {
patternNew = patternNew.replaceAll("%%NUM_MG%%", "{1,number,#}/{2,number,#}-{3}");
}
for (int i = 0; i < argumentsObject.length; i++) {
Object o = argumentsObject[i];
if(o==null){
patternNew = patternNew.replaceAll("\\{"+i+"(.*?)\\}", getDefaultForNullValues());
}
}
return patternNew;
}
}
| [
"michele.perdono@csi.it"
] | michele.perdono@csi.it |
fe640fbfef66e85543efcb1f32225639ea6a8e00 | 6649a4234c74baaf7229214c1052e18d28116fab | /HelpDesk/app/src/main/java/com/micro/helpdesk/model/Status.java | 886ceff2cbf2f8aeba4ad6ce7b5f53f41a143f83 | [] | no_license | CarlosVitorRibeiro/HelpDesk | 302d5f89d8a301c39482eab9b6f4fa9ca2ebb35c | c3ad4535ae764263d05e250f9dd32e93066a158f | refs/heads/master | 2020-08-14T11:06:34.315155 | 2019-10-14T22:29:46 | 2019-10-14T22:29:46 | 215,156,191 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 488 | java | package com.micro.helpdesk.model;
public enum Status {
ABERTO {
@Override
public String toString() {
return "ABERTO";
}
},
FECHADO {
@Override
public String toString() {
return "FECHADO";
}
},
SOLUCIONADOS {
@Override
public String toString() {
return "SOLUCIONADO";
}
}
}
| [
"arthurfernandesdealmeida@hotmail.com"
] | arthurfernandesdealmeida@hotmail.com |
40aa9ce67b278f7cee2b2fce3172ba9710dfa5be | 73917caf37c04d038c4e520b60892927dc0326e8 | /src/main/java/org/twdata/asfproxy/ASFRemoteDirectory.java | a1523e8fff93fd74e8cbfe7ff01cd1a516232498 | [] | no_license | mrdon/crowd-asf-directory | 5f20611b2bb359e31d9926ffa2282deb2fe42389 | a9b5358fa9f22e74e908e44f5dcbdd7feccc08ff | refs/heads/master | 2021-07-05T12:35:23.378692 | 2008-08-09T10:03:23 | 2008-08-09T10:03:23 | 41,285 | 2 | 2 | null | 2020-10-13T09:52:46 | 2008-08-09T10:04:29 | Java | UTF-8 | Java | false | false | 9,605 | java | package org.twdata.asfproxy;
import com.atlassian.crowd.integration.directory.RemoteDirectory;
import com.atlassian.crowd.integration.model.RemotePrincipal;
import com.atlassian.crowd.integration.model.RemoteGroup;
import com.atlassian.crowd.integration.model.RemoteRole;
import com.atlassian.crowd.integration.exception.*;
import com.atlassian.crowd.integration.authentication.PasswordCredential;
import com.atlassian.crowd.integration.SearchContext;
import java.util.Map;
import java.util.List;
import java.util.HashMap;
import java.util.Date;
import java.rmi.RemoteException;
import java.io.IOException;
import org.apache.commons.httpclient.HttpClient;
import org.apache.commons.httpclient.UsernamePasswordCredentials;
import org.apache.commons.httpclient.methods.GetMethod;
/**
*
*/
public class ASFRemoteDirectory implements RemoteDirectory {
public long getID() {
return 0; //To change body of implemented methods use File | Settings | File Templates.
}
public void setID(long ID) {
//To change body of implemented methods use File | Settings | File Templates.
}
public String getDirectoryType() {
return "ASF Proxy Directory";
}
public Map getAttributes() {
return new HashMap();
}
public void setAttributes(Map attributes) {
}
public RemotePrincipal addPrincipal(RemotePrincipal principal) throws InvalidPrincipalException, RemoteException, InvalidCredentialException {
throw new UnsupportedOperationException();
}
public RemoteGroup addGroup(RemoteGroup group) throws InvalidGroupException, RemoteException {
throw new UnsupportedOperationException();
}
public RemotePrincipal authenticate(String name, PasswordCredential[] credentials) throws RemoteException, InvalidPrincipalException, InactiveAccountException, InvalidAuthenticationException {
HttpClient client = new HttpClient();
// pass our credentials to HttpClient, they will only be used for
// authenticating to servers with realm "realm" on the host
// "www.verisign.com", to authenticate against
// an arbitrary realm or host change the appropriate argument to null.
client.getState().setCredentials(null, "svn.apache.org",
new UsernamePasswordCredentials(name, credentials[0].getCredential())
);
client.getState().setAuthenticationPreemptive(true);
// create a GET method that reads a file over HTTPS, we're assuming
// that this file requires basic authentication using the realm above.
GetMethod get = new GetMethod("https://svn.apache.org/repos/private/");
// Tell the GET method to automatically handle authentication. The
// method will use any appropriate credentials to handle basic
// authentication requests. Setting this value to false will cause
// any request for authentication to return with a status of 401.
// It will then be up to the client to handle the authentication.
try {
// execute the GET
int status = 0;
try {
System.out.println(get.getRequestHeaders());
status = client.executeMethod( get );
if (status == 401) {
System.out.println("Unauthorized");
return null;
} else {
RemotePrincipal principal = new RemotePrincipal(name);
principal.setAttribute(RemotePrincipal.FIRSTNAME, "");
principal.setAttribute(RemotePrincipal.LASTNAME, name);
principal.setAttribute(RemotePrincipal.PASSWORD_LASTCHANGED, Long.toString(new Date().getTime()));
principal.setAttribute(RemotePrincipal.REQUIRES_PASSSWORD_CHANGE, Boolean.FALSE.toString());
principal.setAttribute(RemotePrincipal.EMAIL, name+"@apache.org");
principal.setAttribute(RemotePrincipal.DISPLAYNAME, name);
return principal;
}
} catch (IOException e) {
throw new RemoteException("Unable to authenticate", e);
}
} finally {
// release any connection resources used by the method
get.releaseConnection();
}
}
public boolean isGroupMember(String group, String principal) throws RemoteException {
return false; //To change body of implemented methods use File | Settings | File Templates.
}
public List searchGroups(SearchContext searchContext) throws RemoteException {
throw new UnsupportedOperationException();
}
public RemoteGroup findGroupByName(String name) throws RemoteException, ObjectNotFoundException {
throw new UnsupportedOperationException();
}
public RemoteGroup updateGroup(RemoteGroup group) throws RemoteException, ObjectNotFoundException {
throw new UnsupportedOperationException();
}
public List searchRoles(SearchContext searchContext) throws RemoteException {
throw new UnsupportedOperationException();
}
public RemoteRole findRoleByName(String name) throws RemoteException, ObjectNotFoundException {
throw new UnsupportedOperationException();
}
public RemoteRole addRole(RemoteRole role) throws InvalidRoleException, RemoteException {
throw new UnsupportedOperationException();
}
public RemoteRole updateRole(RemoteRole role) throws RemoteException, ObjectNotFoundException {
throw new UnsupportedOperationException();
}
public void removeGroup(String name) throws RemoteException, ObjectNotFoundException {
throw new UnsupportedOperationException();
}
public void removeRole(String name) throws RemoteException, ObjectNotFoundException {
throw new UnsupportedOperationException();
}
public List searchPrincipals(SearchContext searchContext) throws RemoteException {
throw new UnsupportedOperationException();
}
public RemotePrincipal findPrincipalByName(String name) throws RemoteException, ObjectNotFoundException {
RemotePrincipal principal = new RemotePrincipal(name);
principal.setAttribute(RemotePrincipal.FIRSTNAME, "");
principal.setAttribute(RemotePrincipal.LASTNAME, name);
principal.setAttribute(RemotePrincipal.PASSWORD_LASTCHANGED, Long.toString(new Date().getTime()));
principal.setAttribute(RemotePrincipal.REQUIRES_PASSSWORD_CHANGE, Boolean.FALSE.toString());
principal.setAttribute(RemotePrincipal.EMAIL, name+"@apache.org");
principal.setAttribute(RemotePrincipal.DISPLAYNAME, name);
return principal;
}
public RemotePrincipal updatePrincipal(RemotePrincipal principal) throws RemoteException, ObjectNotFoundException {
throw new UnsupportedOperationException();
}
public void addPrincipalToGroup(String name, String unsubscribedGroup) throws RemoteException, ObjectNotFoundException {
throw new UnsupportedOperationException();
}
public void removePrincipalFromGroup(String name, String unsubscribedGroup) throws RemoteException, ObjectNotFoundException {
throw new UnsupportedOperationException();
}
public void addPrincipalToRole(String name, String unsubscribedRole) throws RemoteException, ObjectNotFoundException {
throw new UnsupportedOperationException();
}
public void removePrincipalFromRole(String name, String removeRole) throws RemoteException, ObjectNotFoundException {
throw new UnsupportedOperationException();
}
public void removePrincipal(String name) throws RemoteException, ObjectNotFoundException {
throw new UnsupportedOperationException();
}
public void updatePrincipalCredential(String name, PasswordCredential credential) throws RemoteException, ObjectNotFoundException, InvalidCredentialException {
throw new UnsupportedOperationException();
}
public void testConnection() throws RemoteException {
HttpClient client = new HttpClient();
// create a GET method that reads a file over HTTPS, we're assuming
// that this file requires basic authentication using the realm above.
GetMethod get = new GetMethod("https://svn.apache.org/repos/private/");
// Tell the GET method to automatically handle authentication. The
// method will use any appropriate credentials to handle basic
// authentication requests. Setting this value to false will cause
// any request for authentication to return with a status of 401.
// It will then be up to the client to handle the authentication.
try {
// execute the GET
int status = 0;
try {
client.executeMethod( get );
} catch (IOException e) {
e.printStackTrace(); //To change body of catch statement use File | Settings | File Templates.
}
} finally {
// release any connection resources used by the method
get.releaseConnection();
}
}
public boolean isRoleMember(String role, String principal) throws RemoteException {
return true;
}
public List findGroupMemberships(String principal) throws RemoteException, ObjectNotFoundException {
throw new UnsupportedOperationException();
}
public List findRoleMemberships(String principalName) throws RemoteException, ObjectNotFoundException {
throw new UnsupportedOperationException();
}
}
| [
"mrdon@twdata.org"
] | mrdon@twdata.org |
c7937220dba9cf7999aa946fa2ef207e97898c44 | 2fce12216bc5d1b2fd70f6d6cdeb79235a7c48a3 | /src/main/java/com/jsh/blog/test/TempControllerTest.java | a4f3d0aafc0d639030e794168141bb5b719c3d24 | [] | no_license | jsh-9999/Springboot-JPA-Blog | 33f7c519155b36b913615d40f9883024043d85b0 | 66e545d10cb9d96376c99b345d7f44d1b5364316 | refs/heads/master | 2023-06-07T10:43:16.194112 | 2021-07-14T14:16:25 | 2021-07-14T14:16:25 | 385,178,409 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 707 | java | package com.jsh.blog.test;
import org.hibernate.query.internal.NativeQueryReturnBuilder;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
@Controller
public class TempControllerTest {
@GetMapping("temp/home") // http://localhost:8000/blog/temp/home
public String tempHome() {
System.out.println("tempHome()");
//파일리턴 기본경로 : src/main/resources/static
//리턴명 : /home.html
//풀경로 : src/main/resources/static/home.html
return "/home.html";
}
@GetMapping("/temp/jsp")
public String tempJsp() {
//prefix: /WEB-INF/views/
// suffix: .jsp
// 풀네임 : /WEB-INF/views/test.jsp
return "/test";
}
}
| [
"60505773+jsh-9999@users.noreply.github.com"
] | 60505773+jsh-9999@users.noreply.github.com |
70680be357c15dfc51949ed6198383e91f485be7 | 93e0d425be720ee47c69a5761afe4a0444b1c978 | /app/src/main/java/com/opennetwork/secureim/PassphraseCreateActivity.java | 45e0a9823cf5a6f26ba58083484eb5979253473f | [] | no_license | opennetworkproject/secure-im-android | 98904aedd2e5f2bd596a5ed48e90afd5de57491f | 72351ad2823aace65922c1aea7e97568ebfce184 | refs/heads/master | 2021-05-10T18:53:05.059352 | 2018-01-30T14:38:27 | 2018-01-30T14:38:27 | 118,136,259 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,221 | java | package com.opennetwork.secureim;
import android.os.AsyncTask;
import android.os.Bundle;
import android.support.v7.app.ActionBar;
import com.opennetwork.secureim.crypto.IdentityKeyUtil;
import com.opennetwork.secureim.crypto.MasterSecret;
import com.opennetwork.secureim.crypto.MasterSecretUtil;
import com.opennetwork.secureim.util.TextSecurePreferences;
import com.opennetwork.secureim.util.Util;
import com.opennetwork.secureim.util.VersionTracker;
/**
* Activity for creating a user's local encryption passphrase.
*/
public class PassphraseCreateActivity extends PassphraseActivity {
public PassphraseCreateActivity() { }
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.create_passphrase_activity);
initializeResources();
}
private void initializeResources() {
new SecretGenerator().executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR, MasterSecretUtil.UNENCRYPTED_PASSPHRASE);
}
private class SecretGenerator extends AsyncTask<String, Void, Void> {
private MasterSecret masterSecret;
@Override
protected void onPreExecute() {
}
@Override
protected Void doInBackground(String... params) {
String passphrase = params[0];
masterSecret = MasterSecretUtil.generateMasterSecret(PassphraseCreateActivity.this,
passphrase);
MasterSecretUtil.generateAsymmetricMasterSecret(PassphraseCreateActivity.this, masterSecret);
IdentityKeyUtil.generateIdentityKeys(PassphraseCreateActivity.this);
VersionTracker.updateLastSeenVersion(PassphraseCreateActivity.this);
TextSecurePreferences.setLastExperienceVersionCode(PassphraseCreateActivity.this, Util.getCurrentApkReleaseVersion(PassphraseCreateActivity.this));
TextSecurePreferences.setPasswordDisabled(PassphraseCreateActivity.this, true);
TextSecurePreferences.setReadReceiptsEnabled(PassphraseCreateActivity.this, true);
return null;
}
@Override
protected void onPostExecute(Void param) {
setMasterSecret(masterSecret);
}
}
@Override
protected void cleanup() {
System.gc();
}
}
| [
"slmono@outlook.com"
] | slmono@outlook.com |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.