blob_id stringlengths 40 40 | directory_id stringlengths 40 40 | path stringlengths 7 390 | content_id stringlengths 40 40 | detected_licenses listlengths 0 35 | license_type stringclasses 2 values | repo_name stringlengths 6 132 | snapshot_id stringlengths 40 40 | revision_id stringlengths 40 40 | branch_name stringclasses 539 values | visit_date timestamp[us]date 2016-08-02 21:09:20 2023-09-06 10:10:07 | revision_date timestamp[us]date 1990-01-30 01:55:47 2023-09-05 21:45:37 | committer_date timestamp[us]date 2003-07-12 18:48:29 2023-09-05 21:45:37 | github_id int64 7.28k 684M ⌀ | star_events_count int64 0 77.7k | fork_events_count int64 0 48k | gha_license_id stringclasses 13 values | gha_event_created_at timestamp[us]date 2012-06-11 04:05:37 2023-09-14 21:59:18 ⌀ | gha_created_at timestamp[us]date 2008-05-22 07:58:19 2023-08-28 02:39:21 ⌀ | gha_language stringclasses 62 values | src_encoding stringclasses 26 values | language stringclasses 1 value | is_vendor bool 1 class | is_generated bool 2 classes | length_bytes int64 128 12.8k | extension stringclasses 11 values | content stringlengths 128 8.19k | authors listlengths 1 1 | author_id stringlengths 1 79 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
f97745e6cf1f158f423dc6c5e63e4cd6fcdc5257 | 6cc2595fb4fce1646d623a702ff37a20598da7a4 | /schema/ab-products/solutions/localization/src/test/com/archibus/app/solution/localization/TestLocalization.java | f7a460d01f4494fdbb2ef8ce6b12bfc57c74956f | [] | no_license | ShyLee/gcu | 31581b4ff583c04edc64ed78132c0505b4820b89 | 21a3f9a0fc6e4902ea835707a1ec01823901bfc3 | refs/heads/master | 2020-03-13T11:43:41.450995 | 2018-04-27T04:51:27 | 2018-04-27T04:51:27 | 131,106,455 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 566 | java | package com.archibus.app.solution.localization;
import junit.framework.TestCase;
/**
* TODO
*/
public class TestLocalization extends TestCase {
/**
* The JUnit setup method
*
* @exception Exception Description of the Exception
*/
@Override
protected void setUp() throws Exception {
super.setUp();
}
/**
* The teardown method for JUnit
*
* @exception Exception Description of the Exception
*/
@Override
protected void tearDown() throws Exception {
super.tearDown();
}
}
| [
"lixinwo@vip.qq.com"
] | lixinwo@vip.qq.com |
7cc090a855e5a40c4c55225d8a718e8514a66e53 | fa91450deb625cda070e82d5c31770be5ca1dec6 | /Diff-Raw-Data/27/27_e57fb404a3c428019896759986af16f35f183e44/PolyType/27_e57fb404a3c428019896759986af16f35f183e44_PolyType_t.java | 29104aed365c3e48a9f22b5e6e756d38d3a28b65 | [] | no_license | zhongxingyu/Seer | 48e7e5197624d7afa94d23f849f8ea2075bcaec0 | c11a3109fdfca9be337e509ecb2c085b60076213 | refs/heads/master | 2023-07-06T12:48:55.516692 | 2023-06-22T07:55:56 | 2023-06-22T07:55:56 | 259,613,157 | 6 | 2 | null | 2023-06-22T07:55:57 | 2020-04-28T11:07:49 | null | UTF-8 | Java | false | false | 5,275 | java | package de.unisiegen.tpml.core.types;
import java.util.Iterator;
import java.util.Set;
import java.util.TreeSet;
import de.unisiegen.tpml.core.prettyprinter.PrettyStringBuilder;
import de.unisiegen.tpml.core.prettyprinter.PrettyStringBuilderFactory;
import de.unisiegen.tpml.core.typechecker.TypeSubstitution;
import de.unisiegen.tpml.core.typechecker.TypeUtilities;
/**
* Instances of this class represent polymorphic types, which are basicly monomorphic types with
* a set of quantified type variables.
*
* @author Benedikt Meurer
* @version $Rev$
*
* @see de.unisiegen.tpml.core.types.Type
*/
public final class PolyType extends Type {
//
// Attributes
//
/**
* The quantified type variables.
*
* @see #getQuantifiedVariables()
*/
private Set<TypeVariable> quantifiedVariables;
/**
* The monomorphic type.
*
* @see #getTau()
*/
private MonoType tau;
//
// Constructor
//
/**
* Allocates a new <code>PolyType</code> with the given <code>quantifiedVariables</code> and
* the monomorphic type <code>tau</code>.
*
* @param quantifiedVariables the set of quantified type variables for <code>tau</code>.
* @param tau the monomorphic type.
*
* @throws NullPointerException if <code>quantifiedVariables</code> or <code>tau</code> is <code>null</code>.
* @see MonoType
*/
public PolyType(Set<TypeVariable> quantifiedVariables, MonoType tau) {
if (quantifiedVariables == null) {
throw new NullPointerException("quantifiedVariables is null");
}
if (tau == null) {
throw new NullPointerException("tau is null");
}
this.quantifiedVariables = quantifiedVariables;
this.tau = tau;
}
//
// Accessors
//
/**
* Returns the set of quantified variables.
*
* @return the quantified type variables.
*/
public Set<TypeVariable> getQuantifiedVariables() {
return this.quantifiedVariables;
}
/**
* Returns the monomorphic type.
*
* @return the monomorphic type.
*/
public MonoType getTau() {
return this.tau;
}
//
// Primitives
//
/**
* {@inheritDoc}
*
* @see de.unisiegen.tpml.core.types.Type#free()
*/
@Override
public TreeSet<TypeVariable> free() {
TreeSet<TypeVariable> free = new TreeSet<TypeVariable>();
free.addAll(this.tau.free());
free.removeAll(this.quantifiedVariables);
return free;
}
/**
* {@inheritDoc}
*
* @see de.unisiegen.tpml.core.types.Type#substitute(de.unisiegen.tpml.core.typechecker.TypeSubstitution)
*/
@Override
public Type substitute(TypeSubstitution substitution) {
// determine the monomorphic type
MonoType tau = this.tau;
// perform a bound rename on the type variables
TreeSet<TypeVariable> quantifiedVariables = new TreeSet<TypeVariable>();
for (TypeVariable tvar : this.quantifiedVariables) {
// generate a type variable that is not present in the substitution
TypeVariable tvarn = tvar;
while (!tvarn.substitute(substitution).equals(tvarn)) {
tvarn = new TypeVariable(tvarn.getIndex(), tvarn.getOffset() + 1);
}
// check if we had to generate a new type variable
if (!tvar.equals(tvarn)) {
// substitute tvarn for tvar in tau
tau = tau.substitute(TypeUtilities.newSubstitution(tvar, tvarn));
}
// add the type variable to the set
quantifiedVariables.add(tvarn);
}
// apply the substitution to the monomorphic type
tau = tau.substitute(substitution);
// generate the polymorphic type
return new PolyType(quantifiedVariables, tau);
}
//
// Pretty printing
//
/**
* {@inheritDoc}
*
* @see de.unisiegen.tpml.core.types.Type#toPrettyStringBuilder(de.unisiegen.tpml.core.prettyprinter.PrettyStringBuilderFactory)
*/
@Override
public PrettyStringBuilder toPrettyStringBuilder(PrettyStringBuilderFactory factory) {
PrettyStringBuilder builder = factory.newBuilder(this, PRIO_POLY);
if (!this.quantifiedVariables.isEmpty()) {
builder.addText("\u2200");
for (Iterator<TypeVariable> it = this.quantifiedVariables.iterator(); it.hasNext(); ) {
builder.addText(it.next().toString());
if (it.hasNext()) {
builder.addText(", ");
}
}
builder.addText(".");
}
builder.addBuilder(this.tau.toPrettyStringBuilder(factory), PRIO_POLY_TAU);
return builder;
}
//
// Base methods
//
/**
* {@inheritDoc}
*
* @see java.lang.Object#equals(java.lang.Object)
*/
@Override
public boolean equals(Object obj) {
if (obj instanceof PolyType) {
PolyType other = (PolyType)obj;
return (this.quantifiedVariables.equals(other.quantifiedVariables) && this.tau.equals(other.tau));
}
return false;
}
/**
* {@inheritDoc}
*
* @see java.lang.Object#hashCode()
*/
@Override
public int hashCode() {
return this.quantifiedVariables.hashCode() + this.tau.hashCode();
}
}
| [
"yuzhongxing88@gmail.com"
] | yuzhongxing88@gmail.com |
a076e8afe5a79d6517cc7f7ee492de72a058f057 | fa1408365e2e3f372aa61e7d1e5ea5afcd652199 | /src/testcases/CWE80_XSS/s01/CWE80_XSS__CWE182_Servlet_connect_tcp_54e.java | 1d621fa4d1c8bff2e6fa494801588e1526c2be17 | [] | no_license | bqcuong/Juliet-Test-Case | 31e9c89c27bf54a07b7ba547eddd029287b2e191 | e770f1c3969be76fdba5d7760e036f9ba060957d | refs/heads/master | 2020-07-17T14:51:49.610703 | 2019-09-03T16:22:58 | 2019-09-03T16:22:58 | 206,039,578 | 1 | 2 | null | null | null | null | UTF-8 | Java | false | false | 1,944 | java | /* TEMPLATE GENERATED TESTCASE FILE
Filename: CWE80_XSS__CWE182_Servlet_connect_tcp_54e.java
Label Definition File: CWE80_XSS__CWE182_Servlet.label.xml
Template File: sources-sink-54e.tmpl.java
*/
/*
* @description
* CWE: 80 Cross Site Scripting (XSS)
* BadSource: connect_tcp Read data using an outbound tcp connection
* GoodSource: A hardcoded string
* Sinks:
* BadSink : Display of data in web page after using replaceAll() to remove script tags, which will still allow XSS (CWE 182: Collapse of Data into Unsafe Value)
* Flow Variant: 54 Data flow: data passed as an argument from one method through three others to a fifth; all five functions are in different classes in the same package
*
* */
package testcases.CWE80_XSS.s01;
import testcasesupport.*;
import javax.servlet.http.*;
public class CWE80_XSS__CWE182_Servlet_connect_tcp_54e
{
public void badSink(String data , HttpServletRequest request, HttpServletResponse response) throws Throwable
{
if (data != null)
{
/* POTENTIAL FLAW: Display of data in web page after using replaceAll() to remove script tags, which will still allow XSS with strings like <scr<script>ipt> (CWE 182: Collapse of Data into Unsafe Value) */
response.getWriter().println("<br>bad(): data = " + data.replaceAll("(<script>)", ""));
}
}
/* goodG2B() - use goodsource and badsink */
public void goodG2BSink(String data , HttpServletRequest request, HttpServletResponse response) throws Throwable
{
if (data != null)
{
/* POTENTIAL FLAW: Display of data in web page after using replaceAll() to remove script tags, which will still allow XSS with strings like <scr<script>ipt> (CWE 182: Collapse of Data into Unsafe Value) */
response.getWriter().println("<br>bad(): data = " + data.replaceAll("(<script>)", ""));
}
}
}
| [
"bqcuong2212@gmail.com"
] | bqcuong2212@gmail.com |
e1a4777d5e0916220f3dd26f2c3d19f7039b4497 | 5570784ff848412ab7bed64230fc27451ecbd5ab | /Annotation/src/com/clt/CltStudent.java | 2a7ebe2ea4fd0d5ec4f8f42a9b1fc6943d712264 | [] | no_license | dream-cool/JAVASE | 9b9616d48efd79443c4c6f2ebdeb3b422d6856cc | 306ede963d4f3f63a6c839a0af17eab71bbe371a | refs/heads/master | 2020-12-05T11:56:22.859488 | 2020-01-06T12:50:19 | 2020-01-06T12:50:19 | 232,096,662 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 724 | java | package com.clt;
@Table("tb_student")
public class CltStudent {
@Clt_Field(columnName ="id",type ="int",legth =10)
private int id;
@Clt_Field(columnName ="studentName",type ="varchar",legth =20)
private String studentName;
@Clt_Field(columnName ="age",type ="int",legth =3)
private int age ;
public void setId(int id) {
this.id = id;
}
public void setStudentName(String studentName) {
this.studentName = studentName;
}
public void setAge(int age) {
this.age = age;
}
public int getId() {
return id;
}
public String getStudentName() {
return studentName;
}
public int getAge() {
return age;
}
}
| [
"1142170725@qq.com"
] | 1142170725@qq.com |
41bf2bee69575eb44fabb5000abc9e70c1dc16c8 | e4c619ca642325f4149c96225342752a70e5bcc5 | /src/test/java/com/hack23/maven/plugin/SonarQualityGatesMojoTest.java | 489081d43faa3d67b1f52c0239e1311bc20f8c17 | [
"Apache-2.0"
] | permissive | pethers/sonar-quality-gates-maven-plugin | de0379ffdea46f79bd898317a1e4bfacd07a9b17 | f2c9b1349ad6fe1201ffac6701bf5aec1d3576f2 | refs/heads/master | 2020-07-27T16:04:47.279332 | 2019-10-24T21:26:22 | 2019-10-24T21:26:22 | 209,151,310 | 0 | 1 | Apache-2.0 | 2019-10-24T21:26:23 | 2019-09-17T20:33:01 | Java | UTF-8 | Java | false | false | 4,669 | java | package com.hack23.maven.plugin;
import java.io.IOException;
import java.io.OutputStream;
import java.lang.reflect.Field;
import java.net.InetSocketAddress;
import java.util.Scanner;
import org.apache.maven.plugin.Mojo;
import org.apache.maven.plugin.MojoExecutionException;
import org.apache.maven.plugin.MojoFailureException;
import org.apache.maven.plugin.testing.MojoRule;
import org.apache.maven.plugin.testing.resources.TestResources;
import org.apache.maven.project.MavenProject;
import org.junit.After;
import org.junit.Before;
import org.junit.Rule;
import org.junit.Test;
import org.junit.rules.ExpectedException;
import com.mashape.unirest.http.Unirest;
import com.sun.net.httpserver.HttpExchange;
import com.sun.net.httpserver.HttpHandler;
import com.sun.net.httpserver.HttpServer;
public class SonarQualityGatesMojoTest {
@Rule
public MojoRule rule = new MojoRule();
@Rule
public TestResources resources = new TestResources();
@Rule
public ExpectedException exception = ExpectedException.none();
private HttpServer server;
private SonarEventHandler sonarEventHandler;
private Mojo mojo;
private MavenProject project;
@Before
public void setUp() throws Exception {
sonarEventHandler = new SonarEventHandler();
server = HttpServer.create(new InetSocketAddress(0), 0);
server.createContext("/", sonarEventHandler);
server.setExecutor(null);
server.start();
project = rule.readMavenProject(resources.getBasedir(""));
mojo = rule.lookupConfiguredMojo(project, "inspect");
project.getProperties().put("sonar.host.url", "http://localhost:" + server.getAddress().getPort());
}
@After
public void tearDown() {
server.stop(0);
}
@Test
public void failedQualityGateTest() throws Exception {
exception.expect(MojoExecutionException.class);
exception.expectMessage("Failed quality gate\n"
+ "Conditions[op=LT,period=1,metric=new_coverage,level=ERROR,error=95,actual=47.05882352941177]\n"
+ "Conditions[op=LT,period=<null>,metric=coverage,level=ERROR,error=95,actual=47.4]");
sonarEventHandler.setResponse(200, getResponse("failedqualitygate.json"));
mojo.execute();
}
@Test
public void passedQualityGateTest() throws MojoFailureException, MojoExecutionException {
sonarEventHandler.setResponse(200, getResponse("passedqualitygate.json"));
mojo.execute();
}
@Test
public void failedMissingProjectQualityGateTest() throws MojoFailureException, MojoExecutionException {
exception.expect(MojoExecutionException.class);
exception.expectMessage("no matching project in sonarqube for project key:com.hack23.maven:test-sonar-quality-gates-maven-plugin");
sonarEventHandler.setResponse(200, getResponse("missingproject.json"));
mojo.execute();
}
@Test
public void sonarProjectKeyPropertyTest() throws MojoFailureException, MojoExecutionException, Exception, SecurityException {
sonarEventHandler.setResponse(200, getResponse("passedqualitygate.json"));
project.getProperties().put("sonar.projectKey", "com.hack23.maven:test-property");
final Field f1 = mojo.getClass().getDeclaredField("sonarHostUrl");
f1.setAccessible(true);
f1.set(mojo, "http://localhost:" + server.getAddress().getPort());
mojo.execute();
}
@Test
public void sonarqube404Test() throws Exception {
exception.expect(MojoFailureException.class);
exception.expectMessage(
"Attempt to call Sonarqube responded with an error status :404 : for url:http://localhost:"
+ server.getAddress().getPort()
+ "/api/measures/search?projectKeys=com.hack23.maven:test-sonar-quality-gates-maven-plugin&metricKeys=alert_status,quality_gate_details : response: ");
sonarEventHandler.setResponse(404, "");
mojo.execute();
}
@Test
public void unirestExceptionTest() throws MojoFailureException, MojoExecutionException {
exception.expect(MojoFailureException.class);
exception.expectMessage("Could not execute sonar-quality-gates-plugin");
Unirest.setHttpClient(null);
mojo.execute();
}
private String getResponse(final String file) {
return new Scanner(getClass().getClassLoader().getResourceAsStream(file)).useDelimiter("\\Z").next();
}
private static final class SonarEventHandler implements HttpHandler {
private String response = "[]";
private int status = 200;
public void handle(final HttpExchange httpExchange) throws IOException {
try (OutputStream responseBody = httpExchange.getResponseBody()) {
httpExchange.sendResponseHeaders(status, response.length());
responseBody.write(response.getBytes());
}
}
public void setResponse(final int status, final String response) {
this.status = status;
this.response = response;
}
}
}
| [
"pether.sorling@gmail.com"
] | pether.sorling@gmail.com |
9c095046eb392b36966922e718ceda98fe1e304b | 1ca86d5d065372093c5f2eae3b1a146dc0ba4725 | /spring-boot-modules/spring-boot/src/main/java/com/surya/shutdownhooks/ShutdownHookApplication.java | 97ae221fb5b7148b5821365a8a13f0acf5612c0e | [] | no_license | Suryakanta97/DemoExample | 1e05d7f13a9bc30f581a69ce811fc4c6c97f2a6e | 5c6b831948e612bdc2d9d578a581df964ef89bfb | refs/heads/main | 2023-08-10T17:30:32.397265 | 2021-09-22T16:18:42 | 2021-09-22T16:18:42 | 391,087,435 | 0 | 1 | null | null | null | null | UTF-8 | Java | false | false | 435 | java | package com.surya.shutdownhooks;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
import org.springframework.boot.autoconfigure.SpringBootApplication;
@SpringBootApplication
@EnableAutoConfiguration
public class ShutdownHookApplication {
public static void main(String args[]) {
SpringApplication.run(ShutdownHookApplication.class, args);
}
}
| [
"suryakanta97@github.com"
] | suryakanta97@github.com |
b6b783d7b87d2d7309b5d7e6a26a26d61a4bef1e | e62e0ddb1a593eb082f62b159c96449e5845e6c4 | /entities/src/main/java/com/ofss/fcubs/service/fcubsaccservice/AccCloseQueryIOType.java | d08ef8cc691ccc163b9eafedb6b9cbe2e4a8e4ec | [] | no_license | pwcfstech/CustomerOnboarding_WhiteLabel_Backend | 68adb8b4640b0b468bd02e8fb8a6fa699c78dfa8 | 2265801768d4f68e3e92a3ceb624aa179e6f60f6 | refs/heads/master | 2021-08-11T07:41:18.970465 | 2017-11-13T09:52:19 | 2017-11-13T09:52:19 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,034 | java |
package com.ofss.fcubs.service.fcubsaccservice;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlType;
/**
* <p>Java class for AccClose-Query-IO-Type complex type.
*
* <p>The following schema fragment specifies the expected content contained within this class.
*
* <pre>
* <complexType name="AccClose-Query-IO-Type">
* <complexContent>
* <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
* <sequence>
* <element name="BRN" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
* <element name="ACC" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
* </sequence>
* </restriction>
* </complexContent>
* </complexType>
* </pre>
*
*
*/
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "AccClose-Query-IO-Type", propOrder = {
"brn",
"acc"
})
public class AccCloseQueryIOType {
@XmlElement(name = "BRN")
protected String brn;
@XmlElement(name = "ACC")
protected String acc;
/**
* Gets the value of the brn property.
*
* @return
* possible object is
* {@link String }
*
*/
public String getBRN() {
return brn;
}
/**
* Sets the value of the brn property.
*
* @param value
* allowed object is
* {@link String }
*
*/
public void setBRN(String value) {
this.brn = value;
}
/**
* Gets the value of the acc property.
*
* @return
* possible object is
* {@link String }
*
*/
public String getACC() {
return acc;
}
/**
* Sets the value of the acc property.
*
* @param value
* allowed object is
* {@link String }
*
*/
public void setACC(String value) {
this.acc = value;
}
}
| [
"kousik70@gmail.com"
] | kousik70@gmail.com |
75e16020f53e88d638cf7086b717bc75811c7983 | 60e4e5060fc16c44dcbd02787ad8f99295467503 | /src/main/java/org/gvt/action/QueryPCPathwaysAction.java | 13605b9d990019ccdaebb9e7a918d3c9a716b58a | [] | no_license | tramyn/chibe | d7f0846c3f215cd6e72f6b021d43412528aecc0c | dcad572537ed31bb5d3ecd21a6d2d283665f74cb | refs/heads/master | 2021-01-18T14:07:20.983126 | 2016-06-17T01:01:09 | 2016-06-17T01:01:09 | 62,402,742 | 1 | 0 | null | 2016-07-01T15:34:24 | 2016-07-01T15:34:24 | null | UTF-8 | Java | false | false | 6,039 | java | package org.gvt.action;
import cpath.client.util.CPathException;
import cpath.service.jaxb.SearchHit;
import cpath.service.jaxb.SearchResponse;
import org.biopax.paxtools.model.BioPAXElement;
import org.biopax.paxtools.model.BioPAXLevel;
import org.biopax.paxtools.model.Model;
import org.eclipse.jface.dialogs.MessageDialog;
import org.gvt.ChisioMain;
import org.gvt.gui.AbstractQueryParamDialog;
import org.gvt.gui.ItemSelectionDialog;
import org.gvt.gui.StringInputDialog;
import org.gvt.model.basicsif.BasicSIFGraph;
import org.patika.mada.graph.GraphObject;
import java.util.*;
/**
* @author Ozgun Babur
*
*/
public class QueryPCPathwaysAction extends QueryPCAction
{
String keyword;
String latestKeyword;
String pathwayID;
public QueryPCPathwaysAction(ChisioMain main, QueryLocation qLoc)
{
super(main, "Pathways With Keyword ...", false, qLoc);
createNewPathwayForView = false;
}
public void run()
{
if(main.getBioPAXModel() == null || main.getBioPAXModel().getLevel().equals(BioPAXLevel.L3))
{
try
{
StringInputDialog dialog = new StringInputDialog(main.getShell(), "Query Pathways",
"Enter a keyword for pathway name", keyword != null ? keyword : latestKeyword,
"Find pathways related to the specified keyword");
keyword = dialog.open();
if (keyword == null || keyword.trim().length() == 0)
{
return;
}
latestKeyword = keyword;
keyword = keyword.trim().toLowerCase();
main.lockWithMessage("Querying Pathway Commons ...");
SearchResponse resp = getPCSearchQuery().
typeFilter("Pathway").
queryString("name:" + keyword).
result();
main.unlock();
if (resp != null)
{
List<Holder> holders = extractResultFromServResp(resp, keyword);
ItemSelectionDialog isd = new ItemSelectionDialog(main.getShell(),
500, "Result Pathways", "Select Pathway to Get", holders, null,
false, true, null);
isd.setDoSort(false);
Object selected = isd.open();
if (selected == null) return;
pathwayID = ((Holder) selected).getID();
setOpenPathwayName(((Holder) selected).getName());
execute();
}
else
{
MessageDialog.openInformation(main.getShell(), "No result",
"Could not find any match.\n");
}
}
catch (Exception e)
{
e.printStackTrace();
MessageDialog.openError(main.getShell(), "Error",
"An error occured during querying:\n" + e.getMessage());
}
finally
{
main.unlock();
pathwayID = null;
keyword = null;
}
}
else
{
MessageDialog.openError(main.getShell(), "Incompatible Levels","This query is only applicable to Level 3 models.");
}
}
private List<Holder> extractResultFromServResp(SearchResponse resp, String keyword)
{
List<Holder> holders = new ArrayList<Holder>();
for (SearchHit hit : resp.getSearchHit())
{
Holder h = new Holder(hit);
if (h.getID() != null && h.getName() != null) holders.add(h);
}
return holders;
}
private List<String> getIDList(List<Holder> holders)
{
List<String> ids = new ArrayList<String>(holders.size());
for (Holder holder : holders)
{
ids.add(holder.getID());
}
return ids;
}
private Set<String> getKeywords(String keyword)
{
Set<String> set = new HashSet<String>();
for (String s : keyword.split(" "))
{
s = s.trim();
if (s.length() > 1) set.add(s);
}
return set;
}
@Override
protected Model doQuery() throws CPathException
{
return getPCGetQuery().sources(new String[]{pathwayID}).result();
}
@Override
protected Set<BioPAXElement> doFileQuery(Model model)
{
return findInFile(model, Collections.singleton(pathwayID));
}
@Override
protected Collection<GraphObject> doSIFQuery(BasicSIFGraph graph) throws CPathException
{
throw new UnsupportedOperationException("Cannot get from SIF");
}
@Override
protected AbstractQueryParamDialog getDialog()
{
return null;
}
@Override
protected boolean canQuery()
{
return pathwayID != null && pathwayID.length() > 0;
}
private class Holder implements Comparable
{
SearchHit hit;
private Holder(SearchHit hit)
{
this.hit = hit;
}
@Override
public int compareTo(Object o)
{
return hit.getName().compareTo(((Holder) o).hit.getName());
}
@Override
public int hashCode()
{
return hit.getUri().hashCode();
}
@Override
public boolean equals(Object o)
{
if (o instanceof Holder)
{
Holder h = (Holder) o;
return hit.getUri().equals(h.hit.getUri());
}
return false;
}
public String getDataSource()
{
if (!hit.getDataSource().isEmpty())
{
String s = hit.getDataSource().iterator().next();
if (s.contains("/") && !s.endsWith("/")) s = s.substring(s.lastIndexOf("/") + 1);
return s;
}
return null;
}
public String getOrganism()
{
if (!hit.getOrganism().isEmpty())
{
String s = hit.getOrganism().iterator().next();
if (s.contains("/") && !s.endsWith("/")) s = s.substring(s.lastIndexOf("/") + 1);
if (s.equals("9606")) s = "Human";
return s;
}
return null;
}
public String getID()
{
return hit.getUri();
}
public String getName()
{
return hit.getName();
}
@Override
public String toString()
{
String s = hit.getName();
String d = getDataSource();
if (d != null) s += " [" + d + "]";
String o = getOrganism();
if (o != null) s += " [" + o + "]";
return s;
}
}
}
| [
"ozgunbabur@gmail.com"
] | ozgunbabur@gmail.com |
6095befa195cf4c0583c58cda78613851a94dd35 | dc1dbb7e5a4b95bf44170d2f51fd08b3814f2ac9 | /data_defect4j/preprossed_method_corpus/Math/1/org/apache/commons/math3/linear/ArrayFieldVector_projection_732.java | 775557a83b824e525b765f82fd7f28d8ab8a0667 | [] | no_license | hvdthong/NetML | dca6cf4d34c5799b400d718e0a6cd2e0b167297d | 9bb103da21327912e5a29cbf9be9ff4d058731a5 | refs/heads/master | 2021-06-30T15:03:52.618255 | 2020-10-07T01:58:48 | 2020-10-07T01:58:48 | 150,383,588 | 1 | 1 | null | 2018-09-26T07:08:45 | 2018-09-26T07:08:44 | null | UTF-8 | Java | false | false | 1,642 | java |
org apach common math3 linear
link field vector fieldvector link field element fieldel arrai
param type field element
version
arrai field vector arrayfieldvector field element fieldel field vector fieldvector serializ
find orthogon project vector vector
param vector code project
project code code
dimens mismatch except dimensionmismatchexcept code size
code
math arithmet except matharithmeticexcept code vector
arrai field vector arrayfieldvector project arrai field vector arrayfieldvector
dimens mismatch except dimensionmismatchexcept math arithmet except matharithmeticexcept
arrai field vector arrayfieldvector map multipli mapmultipli dot product dotproduct divid dot product dotproduct
| [
"hvdthong@gmail.com"
] | hvdthong@gmail.com |
2dbbbbad73b891a9937d0bde06a4bdd6671fac7d | b5563c5edf991beaaf1c4b0947a92337812a186c | /modules/se-geonames/src/main/java/org/mapton/geonames/api/Geoname.java | af3f46184cc5592059cad86880c0bb55423c0f80 | [
"Apache-2.0"
] | permissive | trixon/mapton | 1efcc242d84d66555a1b4567114b61cf577859c4 | c76431769bedbc321d3a0c665ea926191986291f | refs/heads/develop | 2023-08-31T00:53:54.215846 | 2023-08-25T07:21:00 | 2023-08-25T07:21:00 | 131,149,992 | 73 | 7 | Apache-2.0 | 2023-07-07T21:57:46 | 2018-04-26T12:07:30 | Java | UTF-8 | Java | false | false | 2,966 | java | /*
* Copyright 2023 Patrik Karlström.
*
* 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.mapton.geonames.api;
import com.google.gson.annotations.SerializedName;
import org.mapton.api.MLatLon;
/**
*
* @author Patrik Karlström
*/
public class Geoname {
@SerializedName("alternate_names")
private String mAlternateNames;
@SerializedName("ascii_name")
private String mAsciiName;
@SerializedName("country_code")
private String mCountryCode;
@SerializedName("elevation")
private Integer mElevation;
@SerializedName("lat")
private Double mLatitude;
@SerializedName("lon")
private Double mLongitude;
@SerializedName("name")
private String mName;
@SerializedName("population")
private Integer mPopulation;
public Geoname() {
}
public String getAlternateNames() {
return mAlternateNames;
}
public String getAsciiName() {
return mAsciiName;
}
public Country getCountry() {
return CountryManager.getInstance().getCodeCountryMap().get(getCountryCode());
}
public String getCountryCode() {
return mCountryCode;
}
public String getCountryName() {
return CountryManager.getInstance().getCodeNameMap().getOrDefault(getCountryCode(), "");
}
public Integer getElevation() {
return mElevation;
}
public MLatLon getLatLon() {
return new MLatLon(getLatitude(), getLongitude());
}
public Double getLatitude() {
return mLatitude;
}
public Double getLongitude() {
return mLongitude;
}
public String getName() {
return mName;
}
public Integer getPopulation() {
return mPopulation;
}
public void setAlternateNames(String alternateNames) {
mAlternateNames = alternateNames;
}
public void setAsciiName(String asciiName) {
mAsciiName = asciiName;
}
public void setCountryCode(String countryCode) {
mCountryCode = countryCode;
}
public void setElevation(Integer elevation) {
mElevation = elevation;
}
public void setLatitude(Double latitude) {
mLatitude = latitude;
}
public void setLongitude(Double longitude) {
mLongitude = longitude;
}
public void setName(String name) {
mName = name;
}
public void setPopulation(Integer population) {
mPopulation = population;
}
}
| [
"patrik@trixon.se"
] | patrik@trixon.se |
7ee161bc3f84094b4761cb62ddf2b06ca274a457 | ea8013860ed0b905c64f449c8bce9e0c34a23f7b | /SystemUIGoogle/sources/com/android/settingslib/bluetooth/OppProfile.java | 66b384cead9c4892faf48ae8fd330e2f80fa3827 | [] | no_license | TheScarastic/redfin_b5 | 5efe0dc0d40b09a1a102dfb98bcde09bac4956db | 6d85efe92477576c4901cce62e1202e31c30cbd2 | refs/heads/master | 2023-08-13T22:05:30.321241 | 2021-09-28T12:33:20 | 2021-09-28T12:33:20 | 411,210,644 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,126 | java | package com.android.settingslib.bluetooth;
import android.bluetooth.BluetoothClass;
import android.bluetooth.BluetoothDevice;
/* access modifiers changed from: package-private */
/* loaded from: classes.dex */
public final class OppProfile implements LocalBluetoothProfile {
@Override // com.android.settingslib.bluetooth.LocalBluetoothProfile
public boolean accessProfileEnabled() {
return false;
}
@Override // com.android.settingslib.bluetooth.LocalBluetoothProfile
public int getConnectionStatus(BluetoothDevice bluetoothDevice) {
return 0;
}
@Override // com.android.settingslib.bluetooth.LocalBluetoothProfile
public int getDrawableResource(BluetoothClass bluetoothClass) {
return 0;
}
@Override // com.android.settingslib.bluetooth.LocalBluetoothProfile
public int getProfileId() {
return 20;
}
@Override // com.android.settingslib.bluetooth.LocalBluetoothProfile
public boolean setEnabled(BluetoothDevice bluetoothDevice, boolean z) {
return false;
}
public String toString() {
return "OPP";
}
}
| [
"warabhishek@gmail.com"
] | warabhishek@gmail.com |
f7918235a25f6f511a752aedd5ec736236dcad0e | 711e906f2b6490ef1e4f1f58ca840fd14b857ce2 | /com/android/systemui/EventLogTags.java | 0397b9411243be24d1904bdb9b383ea9880e1b05 | [] | no_license | dovanduy/SystemUIGoogle | 51a29b812000d1857145f429f983e93c02bff14c | cd41959ee1bd39a22d0d4e95dc40cefb72a75ec8 | refs/heads/master | 2022-07-09T01:48:40.088858 | 2020-05-16T16:01:21 | 2020-05-16T16:01:21 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 506 | java | //
// Decompiled by Procyon v0.5.36
//
package com.android.systemui;
import android.util.EventLog;
public class EventLogTags
{
public static void writeSysuiLockscreenGesture(final int i, final int j, final int k) {
EventLog.writeEvent(36021, new Object[] { i, j, k });
}
public static void writeSysuiStatusBarState(final int i, final int j, final int k, final int l, final int m, final int i2) {
EventLog.writeEvent(36004, new Object[] { i, j, k, l, m, i2 });
}
}
| [
"ethan.halsall@gmail.com"
] | ethan.halsall@gmail.com |
201f20789cbe4b072685706e71c01c2105b99acf | 28aba5a2aeb995cd8b32ab8a4c7ac4b1ae04f446 | /dronekit-android/ClientLib/src/main/java/org/usvplanner/services/android/impl/core/drone/DroneEvents.java | 608458930303c0a5d5c86d582c2b51c09fce60ec | [
"Apache-2.0"
] | permissive | zb556/USVAndroid_v32 | c5e1693ffd1d182cd4b86f571519bdb12254b4d4 | 18bb544b7abe301838daf68af8db870811260273 | refs/heads/master | 2023-03-08T00:31:23.164117 | 2021-02-22T03:09:49 | 2021-02-22T03:09:49 | 340,804,401 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,332 | java | package org.usvplanner.services.android.impl.core.drone;
import org.usvplanner.services.android.impl.core.drone.DroneInterfaces.DroneEventsType;
import org.usvplanner.services.android.impl.core.drone.DroneInterfaces.OnDroneListener;
import org.usvplanner.services.android.impl.core.drone.autopilot.MavLinkDrone;
import java.util.concurrent.ConcurrentLinkedQueue;
public class DroneEvents extends DroneVariable<MavLinkDrone> {
private final ConcurrentLinkedQueue<OnDroneListener> droneListeners = new ConcurrentLinkedQueue<OnDroneListener>();
public DroneEvents(MavLinkDrone myDrone) {
super(myDrone);
}
public void addDroneListener(OnDroneListener listener) {
if (listener != null & !droneListeners.contains(listener))
droneListeners.add(listener);
}
public void removeDroneListener(OnDroneListener listener) {
if (listener != null && droneListeners.contains(listener))
droneListeners.remove(listener);
}
public void removeAllDroneListeners(){
droneListeners.clear();
}
public void notifyDroneEvent(DroneEventsType event) {
if (event == null || droneListeners.isEmpty())
return;
for (OnDroneListener listener : droneListeners) {
listener.onDroneEvent(event, myDrone);
}
}
}
| [
"942391026@qq.com"
] | 942391026@qq.com |
fe6a3711ed2fdfd7860ea63ac5019e7e39b06b1a | fd4a1ae2595798fd06b73c2d888749f8c248c8a5 | /core/kernel/src/main/java/io/thorntail/config/impl/converters/URLConverter.java | 5d3d8dba05044165f0db949084646a25d7deb043 | [
"Apache-2.0"
] | permissive | dandreadis/thorntail | f0bc9697780d5e1c866bd917cac3ff408cd50bdc | 1d243697b9bb74e2acf308357bfa16f5558535d5 | refs/heads/master | 2020-03-16T23:45:55.988465 | 2018-05-07T15:23:07 | 2018-05-07T15:23:07 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 432 | java | package io.thorntail.config.impl.converters;
import java.net.MalformedURLException;
import java.net.URL;
import org.eclipse.microprofile.config.spi.Converter;
public class URLConverter implements Converter<URL> {
@Override
public URL convert(String value) {
try {
return new URL(value);
} catch (MalformedURLException e) {
throw new IllegalArgumentException(e);
}
}
}
| [
"bob@mcwhirter.org"
] | bob@mcwhirter.org |
64986437123b3f5bb981ff49fdb24b0fef305b0e | dac8a56ee2c38c3a48f7a38677cc252fd0b5f94a | /CodeSnippets/August/7Aug/Program5/Program5.java | db9e3aa940ad2054a55fe98a18b527b493a5a2d9 | [] | no_license | nikitasanjaypatil/Java9 | 64dbc0ec8b204c54bfed128d9517ea0fb00e97a4 | fd92b1b13d767e5ee48d88fe22f0260d3d1ac391 | refs/heads/master | 2023-03-15T03:44:34.347450 | 2021-02-28T17:13:01 | 2021-02-28T17:13:01 | 281,289,978 | 0 | 1 | null | null | null | null | UTF-8 | Java | false | false | 145 | java |
class Core2Web {
public static void main(String[] args) {
char var1 = 'A';
char var2 = 'a';
System.out.println(var1 > var2);
}
}
| [
"nikitaspatilaarvi@gmail.com"
] | nikitaspatilaarvi@gmail.com |
7daf4bebf15b90b3994733036145b8032cbeea7a | 046af9baf63f9515e0e8250abfd3b91b80421323 | /src/main/java/com/tzt/workLog/core/exception/message/MessageDefinition.java | a11d923a1becabeb2b81ec75345c8cb85110e671 | [] | no_license | lx747949091/workLog | 57a3539766942090e32ec03966b81b719ae72fa8 | 119af054e51a4db2ed0abb8f2c1b150b63ba73fa | refs/heads/master | 2021-03-25T19:08:44.493084 | 2018-04-03T09:16:36 | 2018-04-03T09:16:36 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,038 | java | package com.tzt.workLog.core.exception.message;
import java.io.Serializable;
import com.tzt.workLog.core.cache.CachedObject;
public class MessageDefinition implements CachedObject<Integer>, Serializable {
private static final long serialVersionUID = 1L;
public static final String LEVEL_INFO = "INFO";
public static final String LEVEL_WARN = "WARN";
public static final String LEVEL_ERROR = "ERROR";
private int id;
/**
* 提示信息的级别,分为INFO,WARN,ERROR 3级
*/
private String level;
/**
* 内部代码,如USER_NOT_FOUND
*/
private String internalCode;
/**
* 外部代码,主要显示给用户,如EWELL_BIZ_ERROR_0001
*/
private String externalCode;
/**
* 中文错误描述信息,如病人 'Steven Lee' 不存在.
*/
private String message;
/**
* 英文描述信息 如Patient 'Steven Lee' isn't found.
*/
private String messageEn;
public int getId() {
return id;
}
public void setId(int id) {
this.id = id;
}
public String getLevel() {
return level;
}
public void setLevel(String level) {
this.level = level;
}
public String getInternalCode() {
return internalCode;
}
public void setInternalCode(String internalCode) {
this.internalCode = internalCode;
}
public String getExternalCode() {
return externalCode;
}
public void setExternalCode(String externalCode) {
this.externalCode = externalCode;
}
public String getMessage() {
return message;
}
public void setMessage(String message) {
this.message = message;
}
public String getMessageEn() {
return messageEn;
}
public void setMessageEn(String messageEn) {
this.messageEn = messageEn;
}
public MessageDefinition copy() {
MessageDefinition def = new MessageDefinition();
def.setId(getId());
def.setExternalCode(getExternalCode());
def.setInternalCode(getInternalCode());
def.setLevel(getLevel());
def.setMessage(getMessage());
def.setMessageEn(getMessageEn());
return def;
}
public Integer getKey() {
return getId();
}
} | [
"zy135185@163.com"
] | zy135185@163.com |
6afc31fa985dcc1cd32604aff1c703fffe8935bf | 6d2fe29219cbdd28b64a3cff54c3de3050d6c7be | /plc4j/drivers/bacnet/src/main/generated/org/apache/plc4x/java/bacnetip/readwrite/BACnetConstructedDataOctetstringValueAll.java | 73fa521c0690574c856761fa11e8c9d67a985981 | [
"Apache-2.0",
"Unlicense"
] | permissive | siyka-au/plc4x | ca5e7b02702c8e59844bf45ba595052fcda24ac8 | 44e4ede3b4f54370553549946639a3af2c956bd1 | refs/heads/develop | 2023-05-12T12:28:09.037476 | 2023-04-27T22:55:23 | 2023-04-27T22:55:23 | 179,656,431 | 4 | 3 | Apache-2.0 | 2023-03-02T21:19:18 | 2019-04-05T09:43:27 | Java | UTF-8 | Java | false | false | 6,071 | java | /*
* 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
*
* https://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.apache.plc4x.java.bacnetip.readwrite;
import static org.apache.plc4x.java.spi.codegen.fields.FieldReaderFactory.*;
import static org.apache.plc4x.java.spi.codegen.fields.FieldWriterFactory.*;
import static org.apache.plc4x.java.spi.codegen.io.DataReaderFactory.*;
import static org.apache.plc4x.java.spi.codegen.io.DataWriterFactory.*;
import static org.apache.plc4x.java.spi.generation.StaticHelper.*;
import java.time.*;
import java.util.*;
import org.apache.plc4x.java.api.exceptions.*;
import org.apache.plc4x.java.api.value.*;
import org.apache.plc4x.java.spi.codegen.*;
import org.apache.plc4x.java.spi.codegen.fields.*;
import org.apache.plc4x.java.spi.codegen.io.*;
import org.apache.plc4x.java.spi.generation.*;
// Code generated by code-generation. DO NOT EDIT.
public class BACnetConstructedDataOctetstringValueAll extends BACnetConstructedData
implements Message {
// Accessors for discriminator values.
public BACnetObjectType getObjectTypeArgument() {
return BACnetObjectType.OCTETSTRING_VALUE;
}
public BACnetPropertyIdentifier getPropertyIdentifierArgument() {
return BACnetPropertyIdentifier.ALL;
}
// Arguments.
protected final Short tagNumber;
protected final BACnetTagPayloadUnsignedInteger arrayIndexArgument;
public BACnetConstructedDataOctetstringValueAll(
BACnetOpeningTag openingTag,
BACnetTagHeader peekedTagHeader,
BACnetClosingTag closingTag,
Short tagNumber,
BACnetTagPayloadUnsignedInteger arrayIndexArgument) {
super(openingTag, peekedTagHeader, closingTag, tagNumber, arrayIndexArgument);
this.tagNumber = tagNumber;
this.arrayIndexArgument = arrayIndexArgument;
}
@Override
protected void serializeBACnetConstructedDataChild(WriteBuffer writeBuffer)
throws SerializationException {
PositionAware positionAware = writeBuffer;
boolean _lastItem = ThreadLocalHelper.lastItemThreadLocal.get();
int startPos = positionAware.getPos();
writeBuffer.pushContext("BACnetConstructedDataOctetstringValueAll");
writeBuffer.popContext("BACnetConstructedDataOctetstringValueAll");
}
@Override
public int getLengthInBytes() {
return (int) Math.ceil((float) getLengthInBits() / 8.0);
}
@Override
public int getLengthInBits() {
int lengthInBits = super.getLengthInBits();
BACnetConstructedDataOctetstringValueAll _value = this;
boolean _lastItem = ThreadLocalHelper.lastItemThreadLocal.get();
return lengthInBits;
}
public static BACnetConstructedDataBuilder staticParseBACnetConstructedDataBuilder(
ReadBuffer readBuffer,
Short tagNumber,
BACnetObjectType objectTypeArgument,
BACnetPropertyIdentifier propertyIdentifierArgument,
BACnetTagPayloadUnsignedInteger arrayIndexArgument)
throws ParseException {
readBuffer.pullContext("BACnetConstructedDataOctetstringValueAll");
PositionAware positionAware = readBuffer;
int startPos = positionAware.getPos();
int curPos;
boolean _lastItem = ThreadLocalHelper.lastItemThreadLocal.get();
// Validation
if (!((1) == (2))) {
throw new ParseValidationException(
"All should never occur in context of constructed data. If it does please report");
}
readBuffer.closeContext("BACnetConstructedDataOctetstringValueAll");
// Create the instance
return new BACnetConstructedDataOctetstringValueAllBuilderImpl(tagNumber, arrayIndexArgument);
}
public static class BACnetConstructedDataOctetstringValueAllBuilderImpl
implements BACnetConstructedData.BACnetConstructedDataBuilder {
private final Short tagNumber;
private final BACnetTagPayloadUnsignedInteger arrayIndexArgument;
public BACnetConstructedDataOctetstringValueAllBuilderImpl(
Short tagNumber, BACnetTagPayloadUnsignedInteger arrayIndexArgument) {
this.tagNumber = tagNumber;
this.arrayIndexArgument = arrayIndexArgument;
}
public BACnetConstructedDataOctetstringValueAll build(
BACnetOpeningTag openingTag,
BACnetTagHeader peekedTagHeader,
BACnetClosingTag closingTag,
Short tagNumber,
BACnetTagPayloadUnsignedInteger arrayIndexArgument) {
BACnetConstructedDataOctetstringValueAll bACnetConstructedDataOctetstringValueAll =
new BACnetConstructedDataOctetstringValueAll(
openingTag, peekedTagHeader, closingTag, tagNumber, arrayIndexArgument);
return bACnetConstructedDataOctetstringValueAll;
}
}
@Override
public boolean equals(Object o) {
if (this == o) {
return true;
}
if (!(o instanceof BACnetConstructedDataOctetstringValueAll)) {
return false;
}
BACnetConstructedDataOctetstringValueAll that = (BACnetConstructedDataOctetstringValueAll) o;
return super.equals(that) && true;
}
@Override
public int hashCode() {
return Objects.hash(super.hashCode());
}
@Override
public String toString() {
WriteBufferBoxBased writeBufferBoxBased = new WriteBufferBoxBased(true, true);
try {
writeBufferBoxBased.writeSerializable(this);
} catch (SerializationException e) {
throw new RuntimeException(e);
}
return "\n" + writeBufferBoxBased.getBox().toString() + "\n";
}
}
| [
"christofer.dutz@c-ware.de"
] | christofer.dutz@c-ware.de |
103bccb67718112ae6a97eeae1756ff893543527 | f2b6d20a53b6c5fb451914188e32ce932bdff831 | /src/com/linkedin/messengerlib/shared/ToolbarBaseBundleBuilder.java | aa1f0e958efe9e43a49d6ddcd82774393138135f | [] | no_license | reverseengineeringer/com.linkedin.android | 08068c28267335a27a8571d53a706604b151faee | 4e7235e12a1984915075f82b102420392223b44d | refs/heads/master | 2021-04-09T11:30:00.434542 | 2016-07-21T03:54:43 | 2016-07-21T03:54:43 | 63,835,028 | 3 | 0 | null | null | null | null | UTF-8 | Java | false | false | 988 | java | package com.linkedin.messengerlib.shared;
import android.os.Bundle;
public class ToolbarBaseBundleBuilder
extends BaseBundleBuilder
{
public static int getToolbarLayoutResourceId(Bundle paramBundle)
{
if (paramBundle == null) {
return -1;
}
return paramBundle.getInt("TOOLBAR_LAYOUT_RESOURCE_ID");
}
public static String getToolbarTitle(Bundle paramBundle)
{
if (paramBundle == null) {
return "";
}
return paramBundle.getString("TOOLBAR_TITLE");
}
public final ToolbarBaseBundleBuilder setToolbarLayoutResourceId(int paramInt)
{
bundle.putInt("TOOLBAR_LAYOUT_RESOURCE_ID", paramInt);
return this;
}
public final ToolbarBaseBundleBuilder setToolbarTitle(String paramString)
{
bundle.putString("TOOLBAR_TITLE", paramString);
return this;
}
}
/* Location:
* Qualified Name: com.linkedin.messengerlib.shared.ToolbarBaseBundleBuilder
* Java Class Version: 6 (50.0)
* JD-Core Version: 0.7.1
*/ | [
"reverseengineeringer@hackeradmin.com"
] | reverseengineeringer@hackeradmin.com |
ae0f1daa2d90c026b4025fb6d353b8c9ce93d38c | a656fcb687fd49465444397be20a82d8d83a3f60 | /chrome/android/feed/core/java/src/org/chromium/chrome/browser/feed/FeedSurfaceScopeDependencyProvider.java | b6921da774e1540457c197e6a8c11877e3fc89cc | [
"BSD-3-Clause"
] | permissive | zhaopufeng/chromium | 484ff8653a38e7d6ec6a08f105b5382f7eaf69be | 3f95a71cc0278e42fdcd40d9ef5881f0535b4585 | refs/heads/main | 2023-03-25T00:59:38.968192 | 2021-05-12T09:41:43 | 2021-05-12T09:41:43 | 366,679,098 | 1 | 0 | BSD-3-Clause | 2021-05-12T10:34:37 | 2021-05-12T10:34:37 | null | UTF-8 | Java | false | false | 5,351 | java | // Copyright 2021 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
package org.chromium.chrome.browser.feed;
import android.app.Activity;
import android.content.Context;
import org.chromium.base.Log;
import org.chromium.base.ThreadUtils;
import org.chromium.base.metrics.RecordHistogram;
import org.chromium.chrome.browser.feed.v2.FeedProcessScopeDependencyProvider;
import org.chromium.chrome.browser.feed.v2.FeedStream;
import org.chromium.chrome.browser.ntp.NewTabPageUma;
import org.chromium.chrome.browser.profiles.Profile;
import org.chromium.chrome.browser.signin.services.IdentityServicesProvider;
import org.chromium.chrome.browser.xsurface.SurfaceScopeDependencyProvider;
import org.chromium.chrome.browser.xsurface.SurfaceScopeDependencyProvider.AutoplayEvent;
import org.chromium.components.signin.base.CoreAccountInfo;
import org.chromium.components.signin.identitymanager.ConsentLevel;
/**
* Provides activity and darkmode context for a single surface.
*/
public class FeedSurfaceScopeDependencyProvider implements SurfaceScopeDependencyProvider {
// This must match the FeedAutoplayEvent enum in enums.xml.
private @interface FeedAutoplayEvent {
int AUTOPLAY_REQUESTED = 0;
int AUTOPLAY_STARTED = 1;
int AUTOPLAY_STOPPED = 2;
int AUTOPLAY_ENDED = 3;
int AUTOPLAY_CLICKED = 4;
int NUM_ENTRIES = 5;
}
private static final String TAG = "Feed";
private final Activity mActivity;
private final Context mActivityContext;
private final boolean mDarkMode;
private final FeedStream mFeedStream;
public FeedSurfaceScopeDependencyProvider(
Activity activity, Context activityContext, boolean darkMode, FeedStream feedStream) {
mActivityContext = FeedProcessScopeDependencyProvider.createFeedContext(activityContext);
mDarkMode = darkMode;
mFeedStream = feedStream;
mActivity = activity;
}
@Override
public Activity getActivity() {
return mActivity;
}
@Override
public Context getActivityContext() {
return mActivityContext;
}
@Override
public boolean isDarkModeEnabled() {
return mDarkMode;
}
@Override
public String getAccountName() {
// Don't return account name if there's a signed-out session ID.
if (!getSignedOutSessionId().isEmpty()) {
return "";
}
assert ThreadUtils.runningOnUiThread();
CoreAccountInfo primaryAccount =
IdentityServicesProvider.get()
.getIdentityManager(Profile.getLastUsedRegularProfile())
.getPrimaryAccountInfo(ConsentLevel.SIGNIN);
return (primaryAccount == null) ? "" : primaryAccount.getEmail();
}
@Override
public String getClientInstanceId() {
// Don't return client instance id if there's a signed-out session ID.
if (!getSignedOutSessionId().isEmpty()) {
return "";
}
assert ThreadUtils.runningOnUiThread();
return FeedServiceBridge.getClientInstanceId();
}
@Override
public int[] getExperimentIds() {
assert ThreadUtils.runningOnUiThread();
return mFeedStream.getExperimentIds();
}
@Override
public boolean isActivityLoggingEnabled() {
return mFeedStream.isActivityLoggingEnabled();
}
@Override
public String getSignedOutSessionId() {
return mFeedStream.getSignedOutSessionId();
}
@Override
public AutoplayPreference getAutoplayPreference() {
assert ThreadUtils.runningOnUiThread();
@VideoPreviewsType
int videoPreviewsType = FeedServiceBridge.getVideoPreviewsTypePreference();
switch (videoPreviewsType) {
case VideoPreviewsType.NEVER:
return AutoplayPreference.AUTOPLAY_DISABLED;
case VideoPreviewsType.WIFI_AND_MOBILE_DATA:
return AutoplayPreference.AUTOPLAY_ON_WIFI_AND_MOBILE_DATA;
case VideoPreviewsType.WIFI:
default:
return AutoplayPreference.AUTOPLAY_ON_WIFI_ONLY;
}
}
@Override
public void reportAutoplayEvent(AutoplayEvent event) {
int feedAutoplayEvent;
if (event == AutoplayEvent.AUTOPLAY_REQUESTED) {
feedAutoplayEvent = FeedAutoplayEvent.AUTOPLAY_REQUESTED;
} else if (event == AutoplayEvent.AUTOPLAY_STARTED) {
feedAutoplayEvent = FeedAutoplayEvent.AUTOPLAY_STARTED;
} else if (event == AutoplayEvent.AUTOPLAY_STOPPED) {
feedAutoplayEvent = FeedAutoplayEvent.AUTOPLAY_STOPPED;
} else if (event == AutoplayEvent.AUTOPLAY_ENDED) {
feedAutoplayEvent = FeedAutoplayEvent.AUTOPLAY_ENDED;
} else if (event == AutoplayEvent.AUTOPLAY_CLICKED) {
feedAutoplayEvent = FeedAutoplayEvent.AUTOPLAY_CLICKED;
NewTabPageUma.recordAction(NewTabPageUma.ACTION_OPENED_VIDEO);
} else {
Log.wtf(TAG, "Unable to map AutoplayEvent " + event.name());
return;
}
RecordHistogram.recordEnumeratedHistogram("ContentSuggestions.Feed.AutoplayEvent",
feedAutoplayEvent, FeedAutoplayEvent.NUM_ENTRIES);
}
}
| [
"chromium-scoped@luci-project-accounts.iam.gserviceaccount.com"
] | chromium-scoped@luci-project-accounts.iam.gserviceaccount.com |
4dd642148e34fdd3af4863b16d6a98186c6c08c9 | 7016cec54fb7140fd93ed805514b74201f721ccd | /src/java/com/echothree/control/user/core/server/command/GetEntityTypesCommand.java | a110cb3485a89d316f245f57bc5ba2a2bf70739e | [
"MIT",
"Apache-1.1",
"Apache-2.0"
] | permissive | echothreellc/echothree | 62fa6e88ef6449406d3035de7642ed92ffb2831b | bfe6152b1a40075ec65af0880dda135350a50eaf | refs/heads/master | 2023-09-01T08:58:01.429249 | 2023-08-21T11:44:08 | 2023-08-21T11:44:08 | 154,900,256 | 5 | 1 | null | null | null | null | UTF-8 | Java | false | false | 5,077 | java | // --------------------------------------------------------------------------------
// Copyright 2002-2023 Echo Three, LLC
//
// 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.echothree.control.user.core.server.command;
import com.echothree.control.user.core.common.form.GetEntityTypesForm;
import com.echothree.control.user.core.common.result.CoreResultFactory;
import com.echothree.model.control.core.server.logic.ComponentVendorLogic;
import com.echothree.model.control.party.common.PartyTypes;
import com.echothree.model.control.security.common.SecurityRoleGroups;
import com.echothree.model.control.security.common.SecurityRoles;
import com.echothree.model.data.core.server.entity.ComponentVendor;
import com.echothree.model.data.core.server.entity.EntityType;
import com.echothree.model.data.core.server.factory.EntityTypeFactory;
import com.echothree.model.data.user.common.pk.UserVisitPK;
import com.echothree.util.common.command.BaseResult;
import com.echothree.util.common.message.ExecutionErrors;
import com.echothree.util.common.validation.FieldDefinition;
import com.echothree.util.common.validation.FieldType;
import com.echothree.util.server.control.BaseMultipleEntitiesCommand;
import com.echothree.util.server.control.CommandSecurityDefinition;
import com.echothree.util.server.control.PartyTypeDefinition;
import com.echothree.util.server.control.SecurityRoleDefinition;
import java.util.Arrays;
import java.util.Collection;
import java.util.Collections;
import java.util.List;
public class GetEntityTypesCommand
extends BaseMultipleEntitiesCommand<EntityType, GetEntityTypesForm> {
private final static CommandSecurityDefinition COMMAND_SECURITY_DEFINITION;
private final static List<FieldDefinition> FORM_FIELD_DEFINITIONS;
static {
COMMAND_SECURITY_DEFINITION = new CommandSecurityDefinition(Collections.unmodifiableList(Arrays.asList(
new PartyTypeDefinition(PartyTypes.UTILITY.name(), null),
new PartyTypeDefinition(PartyTypes.EMPLOYEE.name(), Collections.unmodifiableList(Arrays.asList(
new SecurityRoleDefinition(SecurityRoleGroups.EntityType.name(), SecurityRoles.List.name())
)))
)));
FORM_FIELD_DEFINITIONS = Collections.unmodifiableList(Arrays.asList(
new FieldDefinition("ComponentVendorName", FieldType.ENTITY_NAME, false, null, null)
));
}
/** Creates a new instance of GetEntityTypesCommand */
public GetEntityTypesCommand(UserVisitPK userVisitPK, GetEntityTypesForm form) {
super(userVisitPK, form, COMMAND_SECURITY_DEFINITION, FORM_FIELD_DEFINITIONS, true);
}
ComponentVendor componentVendor;
@Override
protected Collection<EntityType> getEntities() {
var coreControl = getCoreControl();
var componentVendorName = form.getComponentVendorName();
Collection<EntityType> entities = null;
if(componentVendorName == null) {
entities = coreControl.getEntityTypes();
} else {
componentVendor = ComponentVendorLogic.getInstance().getComponentVendorByName(this, componentVendorName);
if(!hasExecutionErrors()) {
entities = coreControl.getEntityTypesByComponentVendor(componentVendor);
} else {
addExecutionError(ExecutionErrors.UnknownComponentVendorName.name(), componentVendorName);
}
}
return entities;
}
@Override
protected BaseResult getTransfers(Collection<EntityType> entities) {
var result = CoreResultFactory.getGetEntityTypesResult();
if(entities != null) {
var coreControl = getCoreControl();
var userVisit = getUserVisit();
if(componentVendor != null) {
result.setComponentVendor(coreControl.getComponentVendorTransfer(userVisit, componentVendor));
if(session.hasLimit(EntityTypeFactory.class)) {
result.setEntityTypeCount(coreControl.countEntityTypesByComponentVendor(componentVendor));
}
} else {
if(session.hasLimit(EntityTypeFactory.class)) {
result.setEntityTypeCount(coreControl.countEntityTypes());
}
}
result.setEntityTypes(coreControl.getEntityTypeTransfers(userVisit, entities));
}
return result;
}
}
| [
"rich@echothree.com"
] | rich@echothree.com |
0498375e0861ec3a53897c1b54cb571bf5d7bdbe | cfc9e6b1d923642307c494cfaf31e5d437e8609b | /com/hbm/entity/missile/EntityMissileStrong.java | 59c46ffedf5a08c657e002d8f0138c975e8838fe | [
"WTFPL"
] | permissive | erbege/Hbm-s-Nuclear-Tech-GIT | 0553ff447032c6e9bbc5b5d8a3f480bc33aac13d | 043a07d5871568993526928db1457508f6e4c4f3 | refs/heads/master | 2023-08-02T16:32:28.680199 | 2020-09-16T20:53:45 | 2020-09-16T20:53:45 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,268 | java | package com.hbm.entity.missile;
import java.util.ArrayList;
import java.util.List;
import com.hbm.entity.particle.EntitySmokeFX;
import com.hbm.explosion.ExplosionLarge;
import com.hbm.items.ModItems;
import net.minecraft.init.Blocks;
import net.minecraft.item.ItemStack;
import net.minecraft.world.World;
public class EntityMissileStrong extends EntityMissileBaseAdvanced {
public EntityMissileStrong(World p_i1582_1_) {
super(p_i1582_1_);
}
public EntityMissileStrong(World world, float x, float y, float z, int a, int b) {
super(world, x, y, z, a, b);
}
@Override
public void onImpact() {
ExplosionLarge.explode(worldObj, posX, posY, posZ, 25.0F, true, true, true);
}
@Override
public List<ItemStack> getDebris() {
List<ItemStack> list = new ArrayList<ItemStack>();
list.add(new ItemStack(ModItems.plate_steel, 10));
list.add(new ItemStack(ModItems.plate_titanium, 6));
list.add(new ItemStack(ModItems.thruster_medium, 1));
list.add(new ItemStack(ModItems.circuit_targeting_tier2, 1));
return list;
}
@Override
public ItemStack getDebrisRareDrop() {
return new ItemStack(ModItems.warhead_generic_medium);
}
@Override
public int getMissileType() {
return 1;
}
}
| [
"hbmmods@gmail.com"
] | hbmmods@gmail.com |
bc58fedaf73864ca7d080afba1afb4ceeaae0ea8 | 9ab5bdb918b886f1f2d09d81efb63ff83a86bfb0 | /core/src/test/java/com/jdt/fedlearn/core/entity/boost/TestQueryEntry.java | 518b72acc8877c6d41fd4a63e2fb441697ad2327 | [
"Apache-2.0"
] | permissive | BestJex/fedlearn | 75a795ec51c4a37af34886c551874df419da3a9c | 15395f77ac3ddd983ae3affb1c1a9367287cc125 | refs/heads/master | 2023-06-17T01:27:36.143351 | 2021-07-19T10:43:09 | 2021-07-19T10:43:09 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 411 | java | package com.jdt.fedlearn.core.entity.boost;
import org.testng.Assert;
import org.testng.annotations.Test;
public class TestQueryEntry {
@Test
public void construct(){
QueryEntry entry = new QueryEntry(1, 5, 12.44);
Assert.assertEquals(entry.getRecordId(), 1);
Assert.assertEquals(entry.getFeatureIndex(), 5);
Assert.assertEquals(entry.getSplitValue(), 12.44);
}
}
| [
"wangpeiqi@jd.com"
] | wangpeiqi@jd.com |
f8dfb7708fa0f85ea550ded81954681d19d124ca | b74bc2324c6b6917d24e1389f1cf95936731643f | /basedata/src/main/java/com/wuyizhiye/basedata/code/dao/RuleItemsDao.java | dc292b841f6606b11709e31b1d6aa9d0b8fb1f29 | [] | no_license | 919126624/Feiying- | ebeb8fcfbded932058347856e2a3f38731821e5e | d3b14ff819cc894dcbe80e980792c08c0eb7167b | refs/heads/master | 2021-01-13T00:40:59.447803 | 2016-03-24T03:41:30 | 2016-03-24T03:41:30 | 54,537,727 | 1 | 1 | null | null | null | null | UTF-8 | Java | false | false | 552 | java | package com.wuyizhiye.basedata.code.dao;
import java.util.List;
import com.wuyizhiye.base.dao.BaseDao;
import com.wuyizhiye.basedata.code.model.RuleItems;
/**
* @ClassName RuleItemsDao
* @Description TODO
* @author li.biao
* @date 2015-4-2
*/
public interface RuleItemsDao extends BaseDao {
/**
* 根据规则主表ID,删除明细信息
* @param id
*/
void deleteByRule(String id);
/**
* 根据规则主表ID,查找该规则的明细规则
* @param ruleId
* @return
*/
List<RuleItems> getByRuleItems(String ruleId);
}
| [
"919126624@qq.com"
] | 919126624@qq.com |
92c6657fb6bd75d813c0c9ed81eb70906d4b97b6 | 0d3b137f74ae72b42348a898d1d7ce272d80a73b | /src/main/java/com/dingtalk/api/request/OapiAlitripBtripReimbursementInitRequest.java | 5f5fc3ac7772c86017f8632cb434aa09e08afe88 | [] | no_license | devezhao/dingtalk-sdk | 946eaadd7b266a0952fb7a9bf22b38529ee746f9 | 267ff4a7569d24465d741e6332a512244246d814 | refs/heads/main | 2022-07-29T22:58:51.460531 | 2021-08-31T15:51:20 | 2021-08-31T15:51:20 | 401,749,078 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 7,580 | java | package com.dingtalk.api.request;
import java.util.List;
import com.taobao.api.internal.mapping.ApiField;
import com.taobao.api.internal.mapping.ApiListField;
import com.taobao.api.internal.util.json.JSONValidatingReader;
import com.taobao.api.TaobaoObject;
import java.util.Date;
import java.util.Map;
import java.util.List;
import com.taobao.api.ApiRuleException;
import com.taobao.api.BaseTaobaoRequest;
import com.dingtalk.api.DingTalkConstants;
import com.taobao.api.Constants;
import com.taobao.api.internal.util.TaobaoHashMap;
import com.taobao.api.internal.util.TaobaoUtils;
import com.taobao.api.internal.util.json.JSONWriter;
import com.dingtalk.api.response.OapiAlitripBtripReimbursementInitResponse;
/**
* TOP DingTalk-API: dingtalk.oapi.alitrip.btrip.reimbursement.init request
*
* @author top auto create
* @since 1.0, 2020.09.11
*/
public class OapiAlitripBtripReimbursementInitRequest extends BaseTaobaoRequest<OapiAlitripBtripReimbursementInitResponse> {
/**
* 入参,创建报销单参数
*/
private String rq;
public void setRq(String rq) {
this.rq = rq;
}
public void setRq(OpenApiNewReimbursementRq rq) {
this.rq = new JSONWriter(false,false,true).write(rq);
}
public String getRq() {
return this.rq;
}
public String getApiMethodName() {
return "dingtalk.oapi.alitrip.btrip.reimbursement.init";
}
private String topResponseType = Constants.RESPONSE_TYPE_DINGTALK_OAPI;
public String getTopResponseType() {
return this.topResponseType;
}
public void setTopResponseType(String topResponseType) {
this.topResponseType = topResponseType;
}
public String getTopApiCallType() {
return DingTalkConstants.CALL_TYPE_OAPI;
}
private String topHttpMethod = DingTalkConstants.HTTP_METHOD_POST;
public String getTopHttpMethod() {
return this.topHttpMethod;
}
public void setTopHttpMethod(String topHttpMethod) {
this.topHttpMethod = topHttpMethod;
}
public void setHttpMethod(String httpMethod) {
this.setTopHttpMethod(httpMethod);
}
public Map<String, String> getTextParams() {
TaobaoHashMap txtParams = new TaobaoHashMap();
txtParams.put("rq", this.rq);
if(this.udfParams != null) {
txtParams.putAll(this.udfParams);
}
return txtParams;
}
public Class<OapiAlitripBtripReimbursementInitResponse> getResponseClass() {
return OapiAlitripBtripReimbursementInitResponse.class;
}
public void check() throws ApiRuleException {
}
/**
* 报销人
*
* @author top auto create
* @since 1.0, null
*/
public static class OpenUserInfo extends TaobaoObject {
private static final long serialVersionUID = 2497663983378811336L;
/**
* 报销人id
*/
@ApiField("userid")
private String userid;
public String getUserid() {
return this.userid;
}
public void setUserid(String userid) {
this.userid = userid;
}
}
/**
* 审批列表
*
* @author top auto create
* @since 1.0, null
*/
public static class ApproverNode extends TaobaoObject {
private static final long serialVersionUID = 6613224752448183226L;
/**
* 备注
*/
@ApiField("note")
private String note;
/**
* 审批操作时间
*/
@ApiField("operate_time")
private Date operateTime;
/**
* 报销审批单状态:0审批中 1已同意 2已拒绝 3已转交,4已取消 5已终止
*/
@ApiField("status")
private Long status;
/**
* 审批人id
*/
@ApiField("userid")
private String userid;
public String getNote() {
return this.note;
}
public void setNote(String note) {
this.note = note;
}
public Date getOperateTime() {
return this.operateTime;
}
public void setOperateTime(Date operateTime) {
this.operateTime = operateTime;
}
public Long getStatus() {
return this.status;
}
public void setStatus(Long status) {
this.status = status;
}
public String getUserid() {
return this.userid;
}
public void setUserid(String userid) {
this.userid = userid;
}
}
/**
* 入参,创建报销单参数
*
* @author top auto create
* @since 1.0, null
*/
public static class OpenApiNewReimbursementRq extends TaobaoObject {
private static final long serialVersionUID = 6749536444539874761L;
/**
* 申请单编号
*/
@ApiField("apply_flow_no")
private Long applyFlowNo;
/**
* 审批列表
*/
@ApiListField("audit_list")
@ApiField("approver_node")
private List<ApproverNode> auditList;
/**
* corp id
*/
@ApiField("corpid")
private String corpid;
/**
* 部门ID,不填时取用户所在部门id
*/
@ApiField("depart_id")
private String departId;
/**
* 部门名称,不填时取用户所在部门id
*/
@ApiField("depart_name")
private String departName;
/**
* 报销单详情
*/
@ApiField("detail_url")
private String detailUrl;
/**
* isv标识
*/
@ApiField("isv_code")
private String isvCode;
/**
* 报销人
*/
@ApiField("operator")
private OpenUserInfo operator;
/**
* 关联的报销订单id列表,<订单id:类型(机、酒、火、用车)>
*/
@ApiField("order_ids")
private String orderIds;
/**
* 报销金额
*/
@ApiField("pay_amount")
private Long payAmount;
/**
* 状态 0:审批中,1:已同意,2:已拒绝,4:已撤销
*/
@ApiField("status")
private Long status;
/**
* 第三方流程id
*/
@ApiField("thirdparty_flow_id")
private String thirdpartyFlowId;
/**
* 报销单标题
*/
@ApiField("title")
private String title;
public Long getApplyFlowNo() {
return this.applyFlowNo;
}
public void setApplyFlowNo(Long applyFlowNo) {
this.applyFlowNo = applyFlowNo;
}
public List<ApproverNode> getAuditList() {
return this.auditList;
}
public void setAuditList(List<ApproverNode> auditList) {
this.auditList = auditList;
}
public String getCorpid() {
return this.corpid;
}
public void setCorpid(String corpid) {
this.corpid = corpid;
}
public String getDepartId() {
return this.departId;
}
public void setDepartId(String departId) {
this.departId = departId;
}
public String getDepartName() {
return this.departName;
}
public void setDepartName(String departName) {
this.departName = departName;
}
public String getDetailUrl() {
return this.detailUrl;
}
public void setDetailUrl(String detailUrl) {
this.detailUrl = detailUrl;
}
public String getIsvCode() {
return this.isvCode;
}
public void setIsvCode(String isvCode) {
this.isvCode = isvCode;
}
public OpenUserInfo getOperator() {
return this.operator;
}
public void setOperator(OpenUserInfo operator) {
this.operator = operator;
}
public String getOrderIds() {
return this.orderIds;
}
public void setOrderIds(String orderIds) {
this.orderIds = orderIds;
}
public void setOrderIdsString(String orderIds) {
this.orderIds = orderIds;
}
public Long getPayAmount() {
return this.payAmount;
}
public void setPayAmount(Long payAmount) {
this.payAmount = payAmount;
}
public Long getStatus() {
return this.status;
}
public void setStatus(Long status) {
this.status = status;
}
public String getThirdpartyFlowId() {
return this.thirdpartyFlowId;
}
public void setThirdpartyFlowId(String thirdpartyFlowId) {
this.thirdpartyFlowId = thirdpartyFlowId;
}
public String getTitle() {
return this.title;
}
public void setTitle(String title) {
this.title = title;
}
}
} | [
"zhaofang123@gmail.com"
] | zhaofang123@gmail.com |
5667c77fb10a0037ea6835d8d244fe41a8f576f8 | be73270af6be0a811bca4f1710dc6a038e4a8fd2 | /crash-reproduction-moho/results/XWIKI-12798-139-10-MOEAD-WeightedSum:TestLen:CallDiversity/org/xwiki/container/servlet/filters/internal/SetCharacterEncodingFilter_ESTest_scaffolding.java | 1731cf5bc4234d5d8ce0182212bb36440f5375cd | [] | no_license | STAMP-project/Botsing-multi-objectivization-using-helper-objectives-application | cf118b23ecb87a8bf59643e42f7556b521d1f754 | 3bb39683f9c343b8ec94890a00b8f260d158dfe3 | refs/heads/master | 2022-07-29T14:44:00.774547 | 2020-08-10T15:14:49 | 2020-08-10T15:14:49 | 285,804,495 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 475 | java | /**
* Scaffolding file used to store all the setups needed to run
* tests automatically generated by EvoSuite
* Wed Apr 08 21:19:44 UTC 2020
*/
package org.xwiki.container.servlet.filters.internal;
import org.evosuite.runtime.annotation.EvoSuiteClassExclude;
import org.junit.BeforeClass;
import org.junit.Before;
import org.junit.After;
@EvoSuiteClassExclude
public class SetCharacterEncodingFilter_ESTest_scaffolding {
// Empty scaffolding for empty test suite
}
| [
"pouria.derakhshanfar@gmail.com"
] | pouria.derakhshanfar@gmail.com |
8ac22c3428ed5eda1c0d884ad1849e5c44bb30fb | 33c3fd2a137b193d6055fd4412966280e7caf98c | /Platform/src/net/sf/anathema/framework/view/perspective/PerspectiveSelectionBar.java | 78c55c9b2bc078cf6cabacdaad5977fe8f2ea424 | [] | no_license | lordarcanix/anathema | 633628a2e42701017149e57358a2a11cd2d6a9d2 | 177a8cc4f53a28e932d287bbe4eb007afaf6d5fd | refs/heads/master | 2021-01-24T02:16:05.206853 | 2013-03-12T21:31:08 | 2013-03-12T21:31:08 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,592 | java | package net.sf.anathema.framework.view.perspective;
import net.sf.anathema.lib.gui.action.SmartAction;
import net.sf.anathema.lib.resources.IResources;
import javax.swing.ButtonGroup;
import javax.swing.JComponent;
import javax.swing.JToggleButton;
import javax.swing.JToolBar;
import java.awt.Component;
public class PerspectiveSelectionBar {
private final JToolBar toolbar = new JToolBar();
private final ButtonGroup buttonGroup = new ButtonGroup();
private final PerspectiveStack perspectiveStack;
public PerspectiveSelectionBar(PerspectiveStack perspectiveStack) {
this.perspectiveStack = perspectiveStack;
this.toolbar.setFloatable(false);
}
public void addPerspective(final Perspective perspective, IResources resources) {
SmartAction action = createAction(perspective, resources);
JToggleButton selectionButton = new JToggleButton(action);
toolbar.add(selectionButton);
buttonGroup.add(selectionButton);
}
private SmartAction createAction(final Perspective perspective, IResources resources) {
SmartAction action = new SmartAction() {
@Override
protected void execute(Component parentComponent) {
perspectiveStack.show(perspective);
}
};
PerspectiveToggle toggle = new ActionPerspectiveToggle(action, resources, perspective.getClass());
perspective.configureToggle(toggle);
return action;
}
public JComponent getContent() {
return toolbar;
}
public void selectFirstButton() {
JToggleButton button = (JToggleButton) toolbar.getComponent(0);
button.setSelected(true);
}
} | [
"sandra.sieroux@googlemail.com"
] | sandra.sieroux@googlemail.com |
fc2add87431b94f69bb5d6822b33beedda705306 | b18a33dbfbe6aa49645823cb6d34179b5a942910 | /task12/src/main/java/by/avdeev/task12/dao/MatrixDAOImpl.java | 39ddafab9567668b58e6d710f62573eea2fc2db1 | [] | no_license | Bogdan1506/24_JavaST | 587d0a31f625844804403803835a8ef60cc3f0cf | d9328b5bf726bb64fd329f2f52fb57ebf0cd03c8 | refs/heads/master | 2022-07-09T00:17:53.552808 | 2020-05-27T10:58:40 | 2020-05-27T10:58:40 | 227,462,682 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,145 | java | package by.avdeev.task12.dao;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import java.io.BufferedReader;
import java.io.FileInputStream;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.ArrayList;
import java.util.List;
public class MatrixDAOImpl implements MatrixDAO {
private final Logger logger = LogManager.getLogger();
private final static String START = "started";
private final static String PARAM = "parameter is {}";
private final static String RESULT = "return value is {}";
@Override
public List<String> readFile(String pathname) throws DAOException {
logger.debug(START);
logger.debug(PARAM, pathname);
List<String> strings = new ArrayList<>();
try (BufferedReader reader = new BufferedReader(new InputStreamReader(new FileInputStream(pathname)))) {
while (reader.ready()) {
strings.add(reader.readLine());
}
} catch (IOException e) {
throw new DAOException(e);
}
logger.debug(RESULT, strings);
return strings;
}
}
| [
"avdeev1506@mail.ru"
] | avdeev1506@mail.ru |
c115c22b483417aafc24b89b71e0bbb4b8c71019 | 065c1f648e8dd061a20147ff9c0dbb6b5bc8b9be | /checkstyle_cluster/7909/tar_1.java | 0c31528885581296aa38c7ce20220b55efb45eaf | [] | 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 | 4,129 | java | ////////////////////////////////////////////////////////////////////////////////
// checkstyle: Checks Java source code for adherence to a set of rules.
// Copyright (C) 2001-2015 the original author or authors.
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
// version 2.1 of the License, or (at your option) any later version.
//
// This library 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
// Lesser General Public License for more details.
//
// You should have received a copy of the GNU Lesser General Public
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
////////////////////////////////////////////////////////////////////////////////
package com.puppycrawl.tools.checkstyle.checks.indentation;
import com.puppycrawl.tools.checkstyle.api.DetailAST;
import com.puppycrawl.tools.checkstyle.api.TokenTypes;
/**
* Handler for inner classes.
*
* @author jrichard
*/
public class ObjectBlockHandler extends BlockParentHandler
{
/**
* Construct an instance of this handler with the given indentation check,
* abstract syntax tree, and parent handler.
*
* @param indentCheck the indentation check
* @param ast the abstract syntax tree
* @param parent the parent handler
*/
public ObjectBlockHandler(IndentationCheck indentCheck,
DetailAST ast, ExpressionHandler parent)
{
super(indentCheck, "object def", ast, parent);
}
@Override
protected DetailAST getToplevelAST()
{
return null;
}
@Override
protected DetailAST getLCurly()
{
return getMainAst().findFirstToken(TokenTypes.LCURLY);
}
@Override
protected DetailAST getRCurly()
{
return getMainAst().findFirstToken(TokenTypes.RCURLY);
}
@Override
protected DetailAST getListChild()
{
return getMainAst();
}
@Override
protected IndentLevel getLevelImpl()
{
final DetailAST parentAST = getMainAst().getParent();
IndentLevel indent = getParent().getLevel();
if (parentAST.getType() == TokenTypes.LITERAL_NEW) {
indent.addAcceptedIndent(super.getLevelImpl());
}
else if (parentAST.getType() == TokenTypes.ENUM_CONSTANT_DEF) {
indent = super.getLevelImpl();
}
return indent;
}
@Override
public void checkIndentation()
{
// if we have a class or interface as a parent, don't do anything,
// as this is checked by class def; so
// only do this if we have a new for a parent (anonymous inner
// class)
final DetailAST parentAST = getMainAst().getParent();
if (parentAST.getType() != TokenTypes.LITERAL_NEW) {
return;
}
super.checkIndentation();
}
@Override
protected boolean rcurlyMustStart()
{
return false;
}
@Override
protected void checkRCurly()
{
final DetailAST lcurly = getLCurly();
final DetailAST rcurly = getRCurly();
final int rcurlyPos = expandedTabsColumnNo(rcurly);
final IndentLevel level = curlyLevel();
level.addAcceptedIndent(level.getFirstIndentLevel() + getLineWrappingIndent());
if (!level.accept(rcurlyPos)
&& (rcurlyMustStart() || startsLine(rcurly))
&& !areOnSameLine(rcurly, lcurly))
{
logError(rcurly, "rcurly", rcurlyPos, curlyLevel());
}
}
/**
* A shortcut for <code>IndentationCheck</code> property.
* @return value of lineWrappingIndentation property
* of <code>IndentationCheck</code>
*/
private int getLineWrappingIndent()
{
return getIndentCheck().getLineWrappingIndentation();
}
}
| [
"375833274@qq.com"
] | 375833274@qq.com |
ecf5a441042dec8e6441920723f577c28185a221 | 6d54c69641e421d7a737950f6f7301b1fb0b9b12 | /2.JavaCore/src/com/javarush/task/task14/task1413/Keyboard.java | 6e32f3b19fe9ddeadac31480349bd976528aa3db | [] | no_license | MarvineGothic/JavaRushTasks | ab91358bbbce7934b2ed0d05bd62510be17747c9 | ec77371bc91fe415ee06d949ed6ad9490d21b597 | refs/heads/master | 2021-08-05T20:51:23.112564 | 2021-07-27T18:24:19 | 2021-07-27T18:24:19 | 105,068,893 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 210 | java | package com.javarush.task.task14.task1413;
/**
* Created by Admin on 15.02.2017.
*/
public class Keyboard implements CompItem {
@Override
public String getName() {
return "Keyboard";
}
}
| [
"seis@itu.dk"
] | seis@itu.dk |
1fca1626ef73c75d873d45dcc9fca2157eac2394 | a6e2cd9ea01bdc5cfe58acce25627786fdfe76e9 | /src/main/java/com/alipay/api/domain/AntMerchantExpandItemOpenQueryModel.java | e926e54a027afbe74bf27ddd30114bf28f3eafe0 | [
"Apache-2.0"
] | permissive | cc-shifo/alipay-sdk-java-all | 38b23cf946b73768981fdeee792e3dae568da48c | 938d6850e63160e867d35317a4a00ed7ba078257 | refs/heads/master | 2022-12-22T14:06:26.961978 | 2020-09-23T04:00:10 | 2020-09-23T04:00:10 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,512 | java | package com.alipay.api.domain;
import com.alipay.api.AlipayObject;
import com.alipay.api.internal.mapping.ApiField;
/**
* 查询商品接口
*
* @author auto create
* @since 1.0, 2019-09-17 17:21:31
*/
public class AntMerchantExpandItemOpenQueryModel extends AlipayObject {
private static final long serialVersionUID = 6123984466976722585L;
/**
* 场景码(具体值请参见产品文档)
*/
@ApiField("scene")
private String scene;
/**
* 商品状态:EFFECT(有效)、INVALID(无效)
*/
@ApiField("status")
private String status;
/**
* 商品归属主体ID
例:商品归属主体类型为店铺,则商品归属主体ID为店铺ID;归属主体为小程序,则归属主体ID为小程序ID
*/
@ApiField("target_id")
private String targetId;
/**
* 商品归属主体类型:
5(店铺)
8(小程序)
*/
@ApiField("target_type")
private String targetType;
public String getScene() {
return this.scene;
}
public void setScene(String scene) {
this.scene = scene;
}
public String getStatus() {
return this.status;
}
public void setStatus(String status) {
this.status = status;
}
public String getTargetId() {
return this.targetId;
}
public void setTargetId(String targetId) {
this.targetId = targetId;
}
public String getTargetType() {
return this.targetType;
}
public void setTargetType(String targetType) {
this.targetType = targetType;
}
}
| [
"ben.zy@antfin.com"
] | ben.zy@antfin.com |
988eae33bf3bd3f30c528cecac2545305d039f67 | 963599f6f1f376ba94cbb504e8b324bcce5de7a3 | /sources/androidx/renderscript/Matrix3f.java | 90c6cbed8b1b9af09fce2d55edcb5aec406abe0c | [] | no_license | NikiHard/cuddly-pancake | 563718cb73fdc4b7b12c6233d9bf44f381dd6759 | 3a5aa80d25d12da08fd621dc3a15fbd536d0b3d4 | refs/heads/main | 2023-04-09T06:58:04.403056 | 2021-04-20T00:45:08 | 2021-04-20T00:45:08 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 4,764 | java | package androidx.renderscript;
public class Matrix3f {
final float[] mMat = new float[9];
public Matrix3f() {
loadIdentity();
}
public Matrix3f(float[] fArr) {
float[] fArr2 = this.mMat;
System.arraycopy(fArr, 0, fArr2, 0, fArr2.length);
}
public float[] getArray() {
return this.mMat;
}
public float get(int i, int i2) {
return this.mMat[(i * 3) + i2];
}
public void set(int i, int i2, float f) {
this.mMat[(i * 3) + i2] = f;
}
public void loadIdentity() {
float[] fArr = this.mMat;
fArr[0] = 1.0f;
fArr[1] = 0.0f;
fArr[2] = 0.0f;
fArr[3] = 0.0f;
fArr[4] = 1.0f;
fArr[5] = 0.0f;
fArr[6] = 0.0f;
fArr[7] = 0.0f;
fArr[8] = 1.0f;
}
public void load(Matrix3f matrix3f) {
float[] array = matrix3f.getArray();
float[] fArr = this.mMat;
System.arraycopy(array, 0, fArr, 0, fArr.length);
}
public void loadRotate(float f, float f2, float f3, float f4) {
double d = (double) (f * 0.017453292f);
float cos = (float) Math.cos(d);
float sin = (float) Math.sin(d);
float sqrt = (float) Math.sqrt((double) ((f2 * f2) + (f3 * f3) + (f4 * f4)));
if (sqrt == 1.0f) {
float f5 = 1.0f / sqrt;
f2 *= f5;
f3 *= f5;
f4 *= f5;
}
float f6 = 1.0f - cos;
float f7 = f2 * sin;
float f8 = f3 * sin;
float f9 = sin * f4;
float[] fArr = this.mMat;
fArr[0] = (f2 * f2 * f6) + cos;
float f10 = f2 * f3 * f6;
fArr[3] = f10 - f9;
float f11 = f4 * f2 * f6;
fArr[6] = f11 + f8;
fArr[1] = f10 + f9;
fArr[4] = (f3 * f3 * f6) + cos;
float f12 = f3 * f4 * f6;
fArr[7] = f12 - f7;
fArr[2] = f11 - f8;
fArr[5] = f12 + f7;
fArr[8] = (f4 * f4 * f6) + cos;
}
public void loadRotate(float f) {
loadIdentity();
double d = (double) (f * 0.017453292f);
float cos = (float) Math.cos(d);
float sin = (float) Math.sin(d);
float[] fArr = this.mMat;
fArr[0] = cos;
fArr[1] = -sin;
fArr[3] = sin;
fArr[4] = cos;
}
public void loadScale(float f, float f2) {
loadIdentity();
float[] fArr = this.mMat;
fArr[0] = f;
fArr[4] = f2;
}
public void loadScale(float f, float f2, float f3) {
loadIdentity();
float[] fArr = this.mMat;
fArr[0] = f;
fArr[4] = f2;
fArr[8] = f3;
}
public void loadTranslate(float f, float f2) {
loadIdentity();
float[] fArr = this.mMat;
fArr[6] = f;
fArr[7] = f2;
}
public void loadMultiply(Matrix3f matrix3f, Matrix3f matrix3f2) {
for (int i = 0; i < 3; i++) {
float f = 0.0f;
float f2 = 0.0f;
float f3 = 0.0f;
for (int i2 = 0; i2 < 3; i2++) {
float f4 = matrix3f2.get(i, i2);
f += matrix3f.get(i2, 0) * f4;
f2 += matrix3f.get(i2, 1) * f4;
f3 += matrix3f.get(i2, 2) * f4;
}
set(i, 0, f);
set(i, 1, f2);
set(i, 2, f3);
}
}
public void multiply(Matrix3f matrix3f) {
Matrix3f matrix3f2 = new Matrix3f();
matrix3f2.loadMultiply(this, matrix3f);
load(matrix3f2);
}
public void rotate(float f, float f2, float f3, float f4) {
Matrix3f matrix3f = new Matrix3f();
matrix3f.loadRotate(f, f2, f3, f4);
multiply(matrix3f);
}
public void rotate(float f) {
Matrix3f matrix3f = new Matrix3f();
matrix3f.loadRotate(f);
multiply(matrix3f);
}
public void scale(float f, float f2) {
Matrix3f matrix3f = new Matrix3f();
matrix3f.loadScale(f, f2);
multiply(matrix3f);
}
public void scale(float f, float f2, float f3) {
Matrix3f matrix3f = new Matrix3f();
matrix3f.loadScale(f, f2, f3);
multiply(matrix3f);
}
public void translate(float f, float f2) {
Matrix3f matrix3f = new Matrix3f();
matrix3f.loadTranslate(f, f2);
multiply(matrix3f);
}
public void transpose() {
int i = 0;
while (i < 2) {
int i2 = i + 1;
for (int i3 = i2; i3 < 3; i3++) {
float[] fArr = this.mMat;
int i4 = (i * 3) + i3;
float f = fArr[i4];
int i5 = (i3 * 3) + i;
fArr[i4] = fArr[i5];
fArr[i5] = f;
}
i = i2;
}
}
}
| [
"a.amirovv@mail.ru"
] | a.amirovv@mail.ru |
71d93f82ec94d3f180e52a02a2f3d6f9d0f21223 | bead5c9388e0d70156a08dfe86d48f52cb245502 | /MyNotes/JDK_8/myNotes/J_Stream/D_Stream_of/M1.java | 3e9b1019de5f5eade473318a0323dcd43f088e0e | [] | no_license | LinZiYU1996/Learning-Java | bd96e2af798c09bc52a56bf21e13f5763bb7a63d | a0d9f538c9d373c3a93ccd890006ce0e5e1f2d5d | refs/heads/master | 2020-11-28T22:22:56.135760 | 2020-05-03T01:24:57 | 2020-05-03T01:24:57 | 229,930,586 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 820 | java | package JDK_8.myNotes.J_Stream.D_Stream_of;
import java.util.stream.Stream;
/**
* \* Created with IntelliJ IDEA.
* \* User: LinZiYu
* \* Date: 2020/2/2
* \* Time: 21:57
* \* Description:
* \
*/
public class M1 {
public static void main(String[] args) {
// /*************流的来源*************/
// 1、of方法
// of(T... values):返回含有多个T元素的Stream
// of(T t):返回含有一个T元素的Stream
Stream<String> stream1 = Stream.of(
"a","b","c","d","e"
);
stream1.forEach(System.out::println);
System.out.println("--------------------");
String[] strings = {"a","45","a"};
Stream<String> stream2 = Stream.of(strings);
stream2.forEach(System.out::println);
}
}
| [
"2669093302@qq.com"
] | 2669093302@qq.com |
6fe1e13c2ab6e5b6de3992e5e2d35c6bb074ee5d | 28b3a4074c919eb5fa0bc53665a977079d2d8f89 | /taxi-e/smartkab/smartkab-ws/src/main/java/com/speedtalk/smartkab/ws/filters/CorsFilter.java | e09245275270c0439087330c3e1aa47ee895db2c | [] | no_license | vrqin/taxi | 43e7b65c420ace1280d3621662db6db02aa268d9 | c3c1bd4739425393b2de888b716d7343af8097a4 | refs/heads/master | 2020-05-31T15:30:49.540392 | 2018-12-07T12:23:34 | 2018-12-07T12:23:34 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 791 | java | package com.speedtalk.smartkab.ws.filters;
import javax.ws.rs.container.ContainerRequestContext;
import javax.ws.rs.container.ContainerResponseContext;
import javax.ws.rs.container.ContainerResponseFilter;
import javax.ws.rs.core.MultivaluedMap;
import java.io.IOException;
public class CorsFilter implements ContainerResponseFilter {
@Override
public void filter(ContainerRequestContext req, ContainerResponseContext resp) throws IOException {
MultivaluedMap<String, Object> headers = resp.getHeaders();
headers.add("Access-Control-Allow-Origin", "*");
headers.add("Access-Control-Allow-Methods", "GET, POST, DELETE, PUT,OPTIONS");
headers.add("Access-Control-Allow-Headers", "X-Requested-With, Content-Type, X-Codingpedia,Authorization");
}
}
| [
"heavenlystate@163.com"
] | heavenlystate@163.com |
470e93d5bba5b5b41e32905c177ca727a0385e2b | d325b5684898d409c6cc9c5bef65fe5badda0199 | /LeetCode/src/leetcode897/TreeNode.java | e35f59c34245e3e09d1b78b852ff91378d4c4557 | [] | no_license | Bumble-B11/LeetCode | 25a05fc4610f923344829e874bb991446b5c37bb | aee9e60302e23d3095f8e5244b45b89570b53f8a | refs/heads/master | 2020-06-10T13:33:02.809994 | 2019-11-16T23:33:09 | 2019-11-16T23:33:09 | 193,651,161 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 192 | java | package leetcode897;
/**
* Created by bumblebee on 2019/6/27.
*/
public class TreeNode {
int val;
TreeNode left;
TreeNode right;
TreeNode(int x) {
val = x;
}
}
| [
"="
] | = |
287483113a5edbdaf012448255da6c628994ba19 | 785b5780e27e3028ce1e84496d02080cd63617ee | /chap03_Distributed_And_High_Concurrency/chap03_02_JUC/chap03_02_05_Thread_Pool/src/main/java/cn/sitedev/FixedThreadPoolSubmitDemo.java | baadab3f1690af748fbf6223120ae065ccce5f8d | [] | no_license | mrp321/java_architect_lesson_2020 | 52bbcee169ea527ff764ae2f6f200204d11ad705 | 890f11291681f5ade35ca6aeb23d4df8a8087df7 | refs/heads/master | 2022-06-27T09:22:05.278456 | 2020-06-25T15:55:52 | 2020-06-25T15:55:52 | 243,526,129 | 0 | 0 | null | 2022-06-17T02:58:42 | 2020-02-27T13:29:23 | Java | UTF-8 | Java | false | false | 561 | java | package cn.sitedev;
import java.util.concurrent.*;
public class FixedThreadPoolSubmitDemo implements Callable<String> {
public static void main(String[] args) throws ExecutionException, InterruptedException {
ExecutorService executorService = Executors.newFixedThreadPool(1);
Future<String> future = executorService.submit(new FixedThreadPoolSubmitDemo());
System.out.println(future.get());
executorService.shutdown();
}
@Override
public String call() throws Exception {
return "hello world";
}
}
| [
"y7654f@gmail.com"
] | y7654f@gmail.com |
9a12f72a49e83944091c63ca80854c6a5ffd3616 | ba2b6b34e73e4f6b9cf139fe7ba79eaeb3634870 | /ratpack-core/src/main/java/ratpack/exec/Fulfiller.java | 6873f0e43697a455bee0dda3c260fbacfaf53c23 | [
"Apache-2.0"
] | permissive | leleuj/ratpack | 1ab99e59bff6fc4d316f55f6b73dc13010e5cd9f | 32949ff502e349abed01c531c1c9e036c7d736b4 | refs/heads/master | 2020-07-12T14:33:29.325139 | 2014-04-15T13:23:12 | 2014-04-15T13:23:12 | 18,801,662 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,141 | java | /*
* Copyright 2014 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 ratpack.exec;
/**
* An object that is used to fulfill a promise.
*
* @param <T> the type of value that was promised.
* @see ratpack.handling.Context#promise(ratpack.func.Action)
*/
public interface Fulfiller<T> {
/**
* Fulfills the promise with an error result.
*
* @param throwable the error result
*/
void error(Throwable throwable);
/**
* Fulfills the promise with the given value.
*
* @param value the value to provide to the promise subscriber
*/
void success(T value);
}
| [
"ld@ldaley.com"
] | ld@ldaley.com |
999f77b8c96cfb06836f7ea2bfb17715a0112a8b | 0e87e32fb92c5080e76257d94c04b2ec05b023fe | /src/test/java/org/compass/core/test/component/unmarshallpoly/Slave.java | 7ead9194bf6b4e6e56a222b890ca2d881e95e54a | [
"Apache-2.0"
] | permissive | molindo/elastic-compass | 7216e4f69bc75bbfcd91c3b7a43a2cc48453f2c5 | dd8c19e48efd9f620a92e07f7b35fefae556b9fc | refs/heads/master | 2016-09-06T15:09:45.331273 | 2011-05-09T09:51:33 | 2011-05-09T09:51:33 | 1,649,609 | 2 | 0 | null | null | null | null | UTF-8 | Java | false | false | 267 | java | package org.compass.core.test.component.unmarshallpoly;
public interface Slave {
public int getId();
public void setId(int id);
public Master getMaster();
public void setMaster(Master master);
public String getName();
public void setName(String name);
} | [
"stf+git@molindo.at"
] | stf+git@molindo.at |
4d8232384148ba0808f8a24adae0caa4aea13778 | 7f7c0ee0efc37528e7a9a6c96b240515b751eee1 | /src/main/java/leetcode/Problem725.java | 690058bf4a45b785042f11cb200b0bcbcea920a5 | [
"MIT"
] | permissive | fredyw/leetcode | ac7d95361cf9ada40eedd8925dc29fdf69bbb7c5 | 3dae006f4a38c25834f545e390acebf6794dc28f | refs/heads/master | 2023-09-01T21:29:23.960806 | 2023-08-30T05:45:58 | 2023-08-30T05:45:58 | 28,460,187 | 7 | 1 | null | null | null | null | UTF-8 | Java | false | false | 1,693 | java | package leetcode;
/**
* https://leetcode.com/problems/split-linked-list-in-parts/
*/
public class Problem725 {
public static class ListNode {
int val;
ListNode next;
ListNode(int x) {
val = x;
}
}
public ListNode[] splitListToParts(ListNode root, int k) {
int size = 0;
for (ListNode node = root; node != null; node = node.next) {
size++;
}
int division = size / k;
int remainder = size % k;
ListNode[] result = new ListNode[k];
int i = 0;
int d = division;
ListNode previous = null;
ListNode current = root;
while (current != null) {
if (i == 0) {
result[i++] = current;
} else if (d <= 0) {
if (remainder > 0) {
if (d == 0) {
previous = current;
current = current.next;
}
remainder--;
}
previous.next = null;
result[i++] = current;
d = division;
}
d--;
previous = current;
current = current.next;
}
return result;
}
private static ListNode build(int... nums) {
ListNode head = null;
ListNode next = null;
for (int i = 0; i < nums.length; i++) {
if (i == 0) {
head = new ListNode(nums[i]);
next = head;
} else {
next.next = new ListNode(nums[i]);
next = next.next;
}
}
return head;
}
}
| [
"fredy.wijaya@gmail.com"
] | fredy.wijaya@gmail.com |
fe4f2b359eb435b06ce19724b0e1bc7ee211aea2 | 18b054f5f7a1574cdfdb5addce8cad12b6a0c823 | /app/src/main/java/com/android/mb/wash/view/EditActivity.java | fb4fa4b27c9d0f22aa715f5e1b1a096e59c6f653 | [] | no_license | cgy529387306/WashMachine | 899ce95b8d552e200a108c6606030fa7881ed7db | dbdc34ccdf9a2e37d057935fe58826c20987368f | refs/heads/master | 2023-06-16T13:57:19.417060 | 2021-07-13T12:28:30 | 2021-07-13T12:28:30 | 290,173,378 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,790 | java | package com.android.mb.wash.view;
import android.content.Intent;
import android.os.Bundle;
import android.widget.EditText;
import com.android.mb.wash.R;
import com.android.mb.wash.base.BaseActivity;
import com.android.mb.wash.utils.Helper;
import com.android.mb.wash.utils.ToastHelper;
public class EditActivity extends BaseActivity {
private String mTitle;
private String mValue;
private String mHint;
private String mEmptyHint;
private EditText mEditText;
@Override
protected void loadIntent() {
mTitle = getIntent().getStringExtra("title");
mValue = getIntent().getStringExtra("value");
mHint = getIntent().getStringExtra("hint");
mEmptyHint = getIntent().getStringExtra("emptyHint");
}
@Override
protected int getLayoutId() {
return R.layout.activity_edit;
}
@Override
protected void initTitle() {
setTitleText(mTitle);
setRightText("保存");
}
@Override
protected void onRightAction() {
super.onRightAction();
String editText = mEditText.getText().toString().trim();
if (Helper.isEmpty(editText)){
ToastHelper.showLongToast(mEmptyHint);
return;
}
Intent intent = new Intent();
intent.putExtra("editText",editText);
setResult(RESULT_OK,intent);
finish();
}
@Override
protected void bindViews() {
mEditText = findViewById(R.id.editView);
}
@Override
protected void processLogic(Bundle savedInstanceState) {
mEditText.setText(mValue==null?"":mValue);
mEditText.setSelection(mValue==null?0:mValue.length());
mEditText.setHint(mHint==null?"":mHint);
}
@Override
protected void setListener() {
}
}
| [
"529387306@qq.com"
] | 529387306@qq.com |
9c157733eacbc50a4eb60bb3fa89bbdc53ca466d | c4c0bb558b4a273674a4ab2c18c7929c92fa583a | /old/es.uam.miso.modelado/src/projectHistory/History.java | 1173db0e2a550bf13097913f57296a51c672399b | [
"MIT"
] | permissive | vnmabus/ModellingBot | fb872a374dd8c1c235fa57e7b14f4fef8c91daba | 85229f5998b9022d1ba8d028443023318cf7efe7 | refs/heads/master | 2020-04-18T18:31:21.143258 | 2018-12-11T15:48:09 | 2018-12-11T15:48:09 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,061 | java | /**
*/
package projectHistory;
import org.eclipse.emf.common.util.EList;
import org.eclipse.emf.ecore.EObject;
/**
* <!-- begin-user-doc -->
* A representation of the model object '<em><b>History</b></em>'.
* <!-- end-user-doc -->
*
* <p>
* The following features are supported:
* </p>
* <ul>
* <li>{@link projectHistory.History#getMsg <em>Msg</em>}</li>
* <li>{@link projectHistory.History#getCreateMsg <em>Create Msg</em>}</li>
* </ul>
*
* @see projectHistory.projectHistoryPackage#getHistory()
* @model
* @generated
*/
public interface History extends EObject {
/**
* Returns the value of the '<em><b>Msg</b></em>' containment reference list.
* The list contents are of type {@link projectHistory.Msg}.
* <!-- begin-user-doc -->
* <p>
* If the meaning of the '<em>Msg</em>' containment reference list isn't clear,
* there really should be more of a description here...
* </p>
* <!-- end-user-doc -->
* @return the value of the '<em>Msg</em>' containment reference list.
* @see projectHistory.projectHistoryPackage#getHistory_Msg()
* @model containment="true"
* @generated
*/
EList<Msg> getMsg();
/**
* Returns the value of the '<em><b>Create Msg</b></em>' containment reference.
* <!-- begin-user-doc -->
* <p>
* If the meaning of the '<em>Create Msg</em>' reference isn't clear,
* there really should be more of a description here...
* </p>
* <!-- end-user-doc -->
* @return the value of the '<em>Create Msg</em>' containment reference.
* @see #setCreateMsg(CreateMsg)
* @see projectHistory.projectHistoryPackage#getHistory_CreateMsg()
* @model containment="true" required="true"
* @generated
*/
CreateMsg getCreateMsg();
/**
* Sets the value of the '{@link projectHistory.History#getCreateMsg <em>Create Msg</em>}' containment reference.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @param value the new value of the '<em>Create Msg</em>' containment reference.
* @see #getCreateMsg()
* @generated
*/
void setCreateMsg(CreateMsg value);
} // History
| [
"saraperezsoler@gmail.com"
] | saraperezsoler@gmail.com |
9acb5c2442ef81606b62d8e58bf5c1b6310f36b7 | 0d26d715a0e66246d9a88d1ca77637c208089ec4 | /fxadmin/src/main/java/com/ylxx/fx/core/domain/GetValueListVo.java | baebb7cca817aed0f7c7ee8f2de93b7e514eb08c | [] | no_license | lkp7321/sour | ff997625c920ddbc8f8bd05307184afc748c22b7 | 06ac40e140bad1dc1e7b3590ce099bc02ae065f2 | refs/heads/master | 2021-04-12T12:18:22.408705 | 2018-04-26T06:22:26 | 2018-04-26T06:22:26 | 126,673,285 | 2 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,922 | java | package com.ylxx.fx.core.domain;
import java.util.List;
import com.ylxx.fx.utils.Table;
public class GetValueListVo{
private String ornm;
private Integer pageNo;
private Integer pageSize;
private String userKey;
private String lable;
private String small;
private String data;
private String big;
private String idog;
private String yhbm;
private String yhmc;
private String defau;
private String bian;
private List<AddFavruleBean> list;
private String maxyh;
private String tiao;
private String cunm;
private String shno;
private String trdtbegin;
private String trdtend;
private String fldt;
private String mafl;
private String con;
private String fvid;
private String ogcd;
private String tableName;
private List<Table> tableList;
public String getTableName() {
return tableName;
}
public void setTableName(String tableName) {
this.tableName = tableName;
}
public List<Table> getTableList() {
return tableList;
}
public void setTableList(List<Table> tableList) {
this.tableList = tableList;
}
public String getOgcd() {
return ogcd;
}
public void setOgcd(String ogcd) {
this.ogcd = ogcd;
}
public String getFvid() {
return fvid;
}
public void setFvid(String fvid) {
this.fvid = fvid;
}
public String getCon() {
return con;
}
public void setCon(String con) {
this.con = con;
}
public String getMafl() {
return mafl;
}
public void setMafl(String mafl) {
this.mafl = mafl;
}
public String getFldt() {
return fldt;
}
public void setFldt(String fldt) {
this.fldt = fldt;
}
public String getTrdtbegin() {
return trdtbegin;
}
public void setTrdtbegin(String trdtbegin) {
this.trdtbegin = trdtbegin;
}
public String getTrdtend() {
return trdtend;
}
public void setTrdtend(String trdtend) {
this.trdtend = trdtend;
}
public String getDirc() {
return dirc;
}
public void setDirc(String dirc) {
this.dirc = dirc;
}
private String dirc;
public String getCunm() {
return cunm;
}
public void setCunm(String cunm) {
this.cunm = cunm;
}
public String getShno() {
return shno;
}
public void setShno(String shno) {
this.shno = shno;
}
public String getTiao() {
return tiao;
}
public void setTiao(String tiao) {
this.tiao = tiao;
}
public String getIdog() {
return idog;
}
public void setIdog(String idog) {
this.idog = idog;
}
public String getYhbm() {
return yhbm;
}
public void setYhbm(String yhbm) {
this.yhbm = yhbm;
}
public String getYhmc() {
return yhmc;
}
public void setYhmc(String yhmc) {
this.yhmc = yhmc;
}
public String getDefau() {
return defau;
}
public void setDefau(String defau) {
this.defau = defau;
}
public String getBian() {
return bian;
}
public void setBian(String bian) {
this.bian = bian;
}
public List<AddFavruleBean> getList() {
return list;
}
public void setList(List<AddFavruleBean> list) {
this.list = list;
}
public String getMaxyh() {
return maxyh;
}
public void setMaxyh(String maxyh) {
this.maxyh = maxyh;
}
public String getLable() {
return lable;
}
public void setLable(String lable) {
this.lable = lable;
}
public String getSmall() {
return small;
}
public void setSmall(String small) {
this.small = small;
}
public String getData() {
return data;
}
public void setData(String data) {
this.data = data;
}
public String getBig() {
return big;
}
public void setBig(String big) {
this.big = big;
}
public String getUserKey() {
return userKey;
}
public void setUserKey(String userKey) {
this.userKey = userKey;
}
public String getOrnm() {
return ornm;
}
public void setOrnm(String ornm) {
this.ornm = ornm;
}
public Integer getPageNo() {
return pageNo;
}
public void setPageNo(Integer pageNo) {
this.pageNo = pageNo;
}
public Integer getPageSize() {
return pageSize;
}
public void setPageSize(Integer pageSize) {
this.pageSize = pageSize;
}
} | [
"lz13037330@163.com"
] | lz13037330@163.com |
fcbfb6a1ba530cf2c5818303136a1eaf21d5d922 | 4761a66291f892ca829523b0a855ee304f1ca5d0 | /android/android_framework/base/src/main/java/github/tornaco/android/thanos/core/util/MessagePoolSync.java | 82efef55c4719e9c076a7a086aa68755bd633b30 | [
"Apache-2.0"
] | permissive | Tornaco/Thanox | dacd0e01c37c1c0e0a22b72132933cef02f171c8 | 98b077e268c75f598dfba73c7425a25639d8982b | refs/heads/master | 2023-09-06T03:58:39.010663 | 2023-09-05T01:25:18 | 2023-09-05T01:25:18 | 228,014,878 | 1,539 | 85 | Apache-2.0 | 2023-09-06T21:21:12 | 2019-12-14T11:54:54 | Java | UTF-8 | Java | false | false | 544 | java | package github.tornaco.android.thanos.core.util;
import android.os.Message;
import android.util.Log;
import lombok.AccessLevel;
import lombok.NoArgsConstructor;
import util.ReflectionUtils;
@NoArgsConstructor(access = AccessLevel.PRIVATE)
public class MessagePoolSync {
// private static final Object sPoolSync = new Object();
public static final Object sPoolSync;
static {
sPoolSync = ReflectionUtils.getStaticObjectField(Message.class, "sPoolSync");
Log.d("MessagePoolSync", "sPoolSync=" + sPoolSync);
}
}
| [
"tornaco@163.com"
] | tornaco@163.com |
e1fa99c967785c0066ad2ea03282677af125df9f | a1826c2ed9c12cfc395fb1a14c1a2e1f097155cb | /governance-20210120/src/main/java/com/aliyun/governance20210120/models/ListAccountFactoryBaselinesResponseBody.java | 951a2587efabd48739892eb07cc8633ef8c3faa2 | [
"Apache-2.0"
] | permissive | aliyun/alibabacloud-java-sdk | 83a6036a33c7278bca6f1bafccb0180940d58b0b | 008923f156adf2e4f4785a0419f60640273854ec | refs/heads/master | 2023-09-01T04:10:33.640756 | 2023-09-01T02:40:45 | 2023-09-01T02:40:45 | 288,968,318 | 40 | 45 | null | 2023-06-13T02:47:13 | 2020-08-20T09:51:08 | Java | UTF-8 | Java | false | false | 3,842 | java | // This file is auto-generated, don't edit it. Thanks.
package com.aliyun.governance20210120.models;
import com.aliyun.tea.*;
public class ListAccountFactoryBaselinesResponseBody extends TeaModel {
@NameInMap("Baselines")
public java.util.List<ListAccountFactoryBaselinesResponseBodyBaselines> baselines;
@NameInMap("NextToken")
public String nextToken;
@NameInMap("RequestId")
public String requestId;
public static ListAccountFactoryBaselinesResponseBody build(java.util.Map<String, ?> map) throws Exception {
ListAccountFactoryBaselinesResponseBody self = new ListAccountFactoryBaselinesResponseBody();
return TeaModel.build(map, self);
}
public ListAccountFactoryBaselinesResponseBody setBaselines(java.util.List<ListAccountFactoryBaselinesResponseBodyBaselines> baselines) {
this.baselines = baselines;
return this;
}
public java.util.List<ListAccountFactoryBaselinesResponseBodyBaselines> getBaselines() {
return this.baselines;
}
public ListAccountFactoryBaselinesResponseBody setNextToken(String nextToken) {
this.nextToken = nextToken;
return this;
}
public String getNextToken() {
return this.nextToken;
}
public ListAccountFactoryBaselinesResponseBody setRequestId(String requestId) {
this.requestId = requestId;
return this;
}
public String getRequestId() {
return this.requestId;
}
public static class ListAccountFactoryBaselinesResponseBodyBaselines extends TeaModel {
@NameInMap("BaselineId")
public String baselineId;
@NameInMap("BaselineName")
public String baselineName;
@NameInMap("CreateTime")
public String createTime;
@NameInMap("Description")
public String description;
@NameInMap("Type")
public String type;
@NameInMap("UpdateTime")
public String updateTime;
public static ListAccountFactoryBaselinesResponseBodyBaselines build(java.util.Map<String, ?> map) throws Exception {
ListAccountFactoryBaselinesResponseBodyBaselines self = new ListAccountFactoryBaselinesResponseBodyBaselines();
return TeaModel.build(map, self);
}
public ListAccountFactoryBaselinesResponseBodyBaselines setBaselineId(String baselineId) {
this.baselineId = baselineId;
return this;
}
public String getBaselineId() {
return this.baselineId;
}
public ListAccountFactoryBaselinesResponseBodyBaselines setBaselineName(String baselineName) {
this.baselineName = baselineName;
return this;
}
public String getBaselineName() {
return this.baselineName;
}
public ListAccountFactoryBaselinesResponseBodyBaselines setCreateTime(String createTime) {
this.createTime = createTime;
return this;
}
public String getCreateTime() {
return this.createTime;
}
public ListAccountFactoryBaselinesResponseBodyBaselines setDescription(String description) {
this.description = description;
return this;
}
public String getDescription() {
return this.description;
}
public ListAccountFactoryBaselinesResponseBodyBaselines setType(String type) {
this.type = type;
return this;
}
public String getType() {
return this.type;
}
public ListAccountFactoryBaselinesResponseBodyBaselines setUpdateTime(String updateTime) {
this.updateTime = updateTime;
return this;
}
public String getUpdateTime() {
return this.updateTime;
}
}
}
| [
"sdk-team@alibabacloud.com"
] | sdk-team@alibabacloud.com |
fed027a333e6e217f21e8510a0be5d2b937db119 | f53b37575f2b005b3ac43537755664770fc60cab | /src/main/java/com/microwise/proxima/dao/InfraredMarkRegionDao.java | 08023346ea1b7c6395928dd5b904a3f29ce9c470 | [] | no_license | algsun/proxima-daemon | e81fe6432ab4deb03b844a7e866b86bfedb64268 | caddb83264f15745d0306d37be1f8718376fee3e | refs/heads/master | 2020-03-16T00:36:56.012811 | 2018-05-07T08:19:18 | 2018-05-07T08:19:18 | 132,419,356 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,455 | java | package com.microwise.proxima.dao;
import com.microwise.proxima.bean.DVPlaceBean;
import com.microwise.proxima.bean.InfraredMarkRegionBean;
import com.microwise.proxima.dao.base.BaseDao;
import java.util.List;
/**
* 红外标记区域 dao
*
* @author gaohui
* @date 2012-9-5
*/
public interface InfraredMarkRegionDao extends BaseDao<InfraredMarkRegionBean> {
/**
* 根据摄像机点位查询红外标记区域
*
* @author zhang.licong
* @date 2012-9-6
* @param dvPlaceId
*
*/
public List<InfraredMarkRegionBean> findInfraredMarkRegions(String dvPlaceId);
/**
* 返回摄像机点位下的所有标记区域
*
* @param dvPlaceId
* 摄像机点位ID
* @return
*/
public List<InfraredMarkRegionBean> findAllByDVPlaceId(int dvPlaceId);
/**
* 更新标记区域的位置和宽高
*
* @param markRegionId
* 标记区域ID
* @param x
* @param y
* @param width
* @param height
*/
public void updateById(int markRegionId, int x, int y, int width, int height);
/**
* 返回标记区域返回对应的摄像机点位
*
* @param markRegionId
* 标记区域ID
* @return
*/
public DVPlaceBean findDVPlaceByMarkRegionId(int markRegionId);
/**
* 查找某个位置的标记区域
* @param dvPlaceId 摄像机点位
* @param x 位置
* @param y 位置
* @return
*/
public InfraredMarkRegionBean findAt(int dvPlaceId, int x, int y);
}
| [
"algtrue@163.com"
] | algtrue@163.com |
6d8981c49351b298dffe579dc1ef2866b2c6f16c | 7016cec54fb7140fd93ed805514b74201f721ccd | /src/java/com/echothree/control/user/payment/common/form/CreatePaymentMethodTypeForm.java | 1efa083163e23e3cfc6ba6433681a84dd9d03bf9 | [
"MIT",
"Apache-1.1",
"Apache-2.0"
] | permissive | echothreellc/echothree | 62fa6e88ef6449406d3035de7642ed92ffb2831b | bfe6152b1a40075ec65af0880dda135350a50eaf | refs/heads/master | 2023-09-01T08:58:01.429249 | 2023-08-21T11:44:08 | 2023-08-21T11:44:08 | 154,900,256 | 5 | 1 | null | null | null | null | UTF-8 | Java | false | false | 1,053 | java | // --------------------------------------------------------------------------------
// Copyright 2002-2023 Echo Three, LLC
//
// 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.echothree.control.user.payment.common.form;
import com.echothree.control.user.payment.common.edit.PaymentMethodTypeEdit;
public interface CreatePaymentMethodTypeForm
extends PaymentMethodTypeEdit {
// Nothing additional beyond PaymentMethodTypeEdit
}
| [
"rich@echothree.com"
] | rich@echothree.com |
57d49450696bb39de6aae8de57f32a8ec4e421e5 | 21bcd1da03415fec0a4f3fa7287f250df1d14051 | /sources/p212io/fabric/sdk/android/p493p/p494a/C14235d.java | 91307cf56aa334fa690e4f77d28f9a8e2b1266fa | [] | 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 | 240 | java | package p212io.fabric.sdk.android.p493p.p494a;
import android.content.Context;
/* renamed from: io.fabric.sdk.android.p.a.d */
/* compiled from: ValueLoader */
public interface C14235d<T> {
T load(Context context) throws Exception;
}
| [
"zsolimana@uaedomain.local"
] | zsolimana@uaedomain.local |
141008793905029c8d179adc076311b9d95b0d16 | ed5159d056e98d6715357d0d14a9b3f20b764f89 | /test/irvine/oeis/a017/A017134Test.java | 716e67ed28e070138fe6b64edc0cc61fc22866e8 | [] | no_license | flywind2/joeis | c5753169cf562939b04dd246f8a2958e97f74558 | e5efd6971a0062ac99f4fae21a7c78c9f9e74fea | refs/heads/master | 2020-09-13T18:34:35.080552 | 2019-11-19T05:40:55 | 2019-11-19T05:40:55 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 195 | java | package irvine.oeis.a017;
import irvine.oeis.AbstractSequenceTest;
/**
* Tests the corresponding class.
* @author Sean A. Irvine
*/
public class A017134Test extends AbstractSequenceTest {
}
| [
"sairvin@gmail.com"
] | sairvin@gmail.com |
1675825caadcb080cd2fb75f74e285e96aa8a6d1 | 4c19b724f95682ed21a82ab09b05556b5beea63c | /XMSYGame/java2/server/zxyy-webhome/src/main/java/com/xmsy/server/zxyy/webhome/modules/manager/sysprop/service/SysPropService.java | 5293a3c12abcc5bfeeb3fea41903b4b17641d3dc | [] | no_license | angel-like/angel | a66f8fda992fba01b81c128dd52b97c67f1ef027 | 3f7d79a61dc44a9c4547a60ab8648bc390c0f01e | refs/heads/master | 2023-03-11T03:14:49.059036 | 2022-11-17T11:35:37 | 2022-11-17T11:35:37 | 222,582,930 | 3 | 5 | null | 2023-02-22T05:29:45 | 2019-11-19T01:41:25 | JavaScript | UTF-8 | Java | false | false | 367 | java | package com.xmsy.server.zxyy.webhome.modules.manager.sysprop.service;
import com.baomidou.mybatisplus.service.IService;
import com.xmsy.server.zxyy.webhome.modules.manager.sysprop.entity.SysPropEntity;
/**
* 系统道具
*
* @author xiaoling
* @email xxxxx
* @date 2019-05-23 10:18:28
*/
public interface SysPropService extends IService<SysPropEntity> {
}
| [
"163@qq.com"
] | 163@qq.com |
627264fd7062c7be2c7d1cb7e5d54337f4c70c07 | 6cf8317e1daac7d59eb3a7290e4d877392d988a1 | /src/jedis/org/apache/commons/pool2/PooledObjectState.java | 82b628973f9caad846ce9ea081f2754ba4c86e14 | [] | no_license | gufanyi/jedis | 5f28ae5b49e067ce39b4ab6498aa4681b93c1c0f | cee520a0dcb9b45454e31b871f2a8e8f8ff6cb69 | refs/heads/master | 2021-01-10T10:58:27.791467 | 2015-12-16T02:22:11 | 2015-12-16T02:22:11 | 48,081,493 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,569 | java | /*
* 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.
*/
package org.apache.commons.pool2;
/**
* Provides the possible states that a {@link PooledObject} may be in.
*
* @version $Revision: $
*
* @since 2.0
*/
public enum PooledObjectState {
/**
* In the queue, not in use.
*/
IDLE,
/**
* In use.
*/
ALLOCATED,
/**
* In the queue, currently being tested for possible eviction.
*/
EVICTION,
/**
* Not in the queue, currently being tested for possible eviction. An
* attempt to borrow the object was made while being tested which removed it
* from the queue. It should be returned to the head of the queue once
* eviction testing completes.
* TODO: Consider allocating object and ignoring the result of the eviction
* test.
*/
EVICTION_RETURN_TO_HEAD,
/**
* In the queue, currently being validated.
*/
VALIDATION,
/**
* Not in queue, currently being validated. The object was borrowed while
* being validated and since testOnBorrow was configured, it was removed
* from the queue and pre-allocated. It should be allocated once validation
* completes.
*/
VALIDATION_PREALLOCATED,
/**
* Not in queue, currently being validated. An attempt to borrow the object
* was made while previously being tested for eviction which removed it from
* the queue. It should be returned to the head of the queue once validation
* completes.
*/
VALIDATION_RETURN_TO_HEAD,
/**
* Failed maintenance (e.g. eviction test or validation) and will be / has
* been destroyed
*/
INVALID,
/**
* Deemed abandoned, to be invalidated.
*/
ABANDONED,
/**
* Returning to the pool.
*/
RETURNING
}
| [
"303240304@qq.com"
] | 303240304@qq.com |
14cc7cd8906e02de6151c5ec68eb890be2848df5 | efca855f83be608cc5fcd5f9976b820f09f11243 | /acceptance-tests/dsl/src/main/java/org/enterchain/enter/tests/acceptance/dsl/condition/clique/ExpectValidators.java | 97f96002bec9f4e41d71bbfa66a41fd4d5373da7 | [
"Apache-2.0"
] | permissive | enterpact/enterchain | 5438e127c851597cbd7e274526c3328155483e58 | d8b272fa6885e5d263066da01fff3be74a6357a0 | refs/heads/master | 2023-05-28T12:48:02.535365 | 2021-06-09T20:44:01 | 2021-06-09T20:44:01 | 375,483,000 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,666 | java | /*
* Copyright ConsenSys AG.
*
* 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.
*
* SPDX-License-Identifier: Apache-2.0
*/
package org.enterchain.enter.tests.acceptance.dsl.condition.clique;
import static org.assertj.core.api.Assertions.assertThat;
import static org.enterchain.enter.tests.acceptance.dsl.transaction.clique.CliqueTransactions.LATEST;
import org.enterchain.enter.ethereum.core.Address;
import org.enterchain.enter.tests.acceptance.dsl.WaitUtils;
import org.enterchain.enter.tests.acceptance.dsl.condition.Condition;
import org.enterchain.enter.tests.acceptance.dsl.node.Node;
import org.enterchain.enter.tests.acceptance.dsl.transaction.clique.CliqueTransactions;
public class ExpectValidators implements Condition {
private final CliqueTransactions clique;
private final Address[] validators;
public ExpectValidators(final CliqueTransactions clique, final Address... validators) {
this.clique = clique;
this.validators = validators;
}
@Override
public void verify(final Node node) {
WaitUtils.waitFor(
() ->
assertThat(node.execute(clique.createGetSigners(LATEST))).containsExactly(validators));
}
}
| [
"webframes@gmail.com"
] | webframes@gmail.com |
04bd1e92f8b11d4f55c62ac99882b682414f86d4 | 2be6fab307c991db80d50559b841c10b9f592a08 | /Solution1011/src/Solution.java | ea84119261f201f52801623d887359031a4486d5 | [] | no_license | Junghun0/JavaAlgorithm | 3d389f7fbeb9312d59305139c391fe3a461b2c68 | 6a77b4699e9edbd74bf31b6ca75cb4d6b28240a5 | refs/heads/master | 2020-04-30T20:37:43.129007 | 2019-11-05T06:01:45 | 2019-11-05T06:01:45 | 177,072,132 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 406 | java | import java.io.*;
public class Solution {
/*
3
0 3
1 5
45 50
*/
public static void main(String[] args) throws IOException {
BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
BufferedWriter writer = new BufferedWriter(new OutputStreamWriter(System.out));
int testCaseLength = Integer.parseInt(reader.readLine());
}
}
| [
"go9018@naver.com"
] | go9018@naver.com |
70e3a1704218fdd84344d228c4c4279af7c3443a | 6a14cc6ffacbe4459b19f882b33d307ab08e8783 | /aliyun-java-sdk-drds/src/main/java/com/aliyuncs/drds/model/v20150413/RemoveDrdsInstanceResponse.java | 6c55d8c4e1f0fd5657b67299a5fd7d6fcdff5984 | [
"Apache-2.0"
] | permissive | 425296516/aliyun-openapi-java-sdk | ea547c7dc8f05d1741848e1db65df91b19a390da | 0ed6542ff71e907bab3cf21311db3bfbca6ca84c | refs/heads/master | 2023-09-04T18:27:36.624698 | 2015-11-10T07:52:55 | 2015-11-10T07:52:55 | 46,623,385 | 1 | 2 | null | 2016-12-07T18:36:30 | 2015-11-21T16:28:33 | Java | UTF-8 | Java | false | false | 1,627 | java | /*
* 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.
*/
package com.aliyuncs.drds.model.v20150413;
import com.aliyuncs.AcsResponse;
import com.aliyuncs.drds.transform.v20150413.RemoveDrdsInstanceResponseUnmarshaller;
import com.aliyuncs.transform.UnmarshallerContext;
/**
* @author auto create
* @version
*/
public class RemoveDrdsInstanceResponse extends AcsResponse {
private String requestId;
private Boolean success;
public String getRequestId() {
return this.requestId;
}
public void setRequestId(String requestId) {
this.requestId = requestId;
}
public Boolean getSuccess() {
return this.success;
}
public void setSuccess(Boolean success) {
this.success = success;
}
@Override
public RemoveDrdsInstanceResponse getInstance(UnmarshallerContext context) {
return RemoveDrdsInstanceResponseUnmarshaller.unmarshall(this, context);
}
}
| [
"lijie.ma@alibaba-inc.com"
] | lijie.ma@alibaba-inc.com |
e641d5c8c69fa0bd21e6c116978d95c9b5377c7f | 42b2e6c58e469858d8c83a68b175ce5f3a6ebd62 | /src/main/java/org/ssssssss/magicapi/spring/boot/starter/MagicAPIProperties.java | a8feced2ca816676f1313117b6eae92b504a5c8c | [
"MIT"
] | permissive | fuqingli/magic-api-spring-boot-starter | f005c0b46eb470e4255f1c0d280020ed50b410ba | 69dd51e799774ca4422c2dbf9ed9889f77b9d5bc | refs/heads/master | 2023-02-11T13:16:17.254700 | 2021-01-03T10:39:51 | 2021-01-03T10:39:51 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 5,269 | java | package org.ssssssss.magicapi.spring.boot.starter;
import org.apache.commons.lang3.StringUtils;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.boot.context.properties.NestedConfigurationProperty;
import org.ssssssss.magicapi.controller.RequestHandler;
import java.util.Arrays;
import java.util.Collections;
import java.util.List;
@ConfigurationProperties(prefix = "magic-api")
public class MagicAPIProperties {
/**
* web页面入口
*/
private String web;
/**
* 接口路径前缀
*/
private String prefix;
/**
* 打印banner
*/
private boolean banner = true;
/**
* 是否抛出异常
*/
private boolean throwException = false;
/**
* 接口保存的数据源
*/
private String datasource;
/**
* 自动导入的模块,多个用","分隔
* @since 0.3.2
*/
private String autoImportModule = "db";
/**
* 可自动导入的包(目前只支持以.*结尾的通配符),多个用","分隔
* @since 0.4.0
*/
private String autoImportPackage;
/**
* 自动刷新间隔,单位为秒,默认不开启
* @since 0.3.4
*/
private int refreshInterval = 0;
/**
* 是否允许覆盖应用接口,默认为false
* @since 0.4.0
*/
private boolean allowOverride = false;
/**
* SQL列名转换
* @since 0.5.0
*/
private String sqlColumnCase = "default";
/**
* 线程核心数,需要>0,<=0时采用默认配置,即CPU核心数 * 2
* @since 0.4.5
*/
private int threadPoolExecutorSize = 0;
/**
* 版本号
*/
private final String version = RequestHandler.class.getPackage().getImplementationVersion();
@NestedConfigurationProperty
private SecurityConfig securityConfig = new SecurityConfig();
@NestedConfigurationProperty
private PageConfig pageConfig = new PageConfig();
@NestedConfigurationProperty
private CacheConfig cacheConfig = new CacheConfig();
@NestedConfigurationProperty
private DebugConfig debugConfig = new DebugConfig();
@NestedConfigurationProperty
private SwaggerConfig swaggerConfig = new SwaggerConfig();
public String getWeb() {
if (StringUtils.isBlank(web)) {
return null;
}
if (web.endsWith("/**")) {
return web.substring(0, web.length() - 3);
}
if (web.endsWith("/*")) {
return web.substring(0, web.length() - 2);
}
if (web.endsWith("/")) {
return web.substring(0, web.length() - 1);
}
return web;
}
public void setWeb(String web) {
this.web = web;
}
public String getSqlColumnCase() {
return sqlColumnCase;
}
public void setSqlColumnCase(String sqlColumnCase) {
this.sqlColumnCase = sqlColumnCase;
}
public boolean isBanner() {
return banner;
}
public void setBanner(boolean banner) {
this.banner = banner;
}
public PageConfig getPageConfig() {
return pageConfig;
}
public void setPageConfig(PageConfig pageConfig) {
this.pageConfig = pageConfig;
}
public boolean isThrowException() {
return throwException;
}
public void setThrowException(boolean throwException) {
this.throwException = throwException;
}
public CacheConfig getCacheConfig() {
return cacheConfig;
}
public void setCacheConfig(CacheConfig cacheConfig) {
this.cacheConfig = cacheConfig;
}
public DebugConfig getDebugConfig() {
return debugConfig;
}
public void setDebugConfig(DebugConfig debugConfig) {
this.debugConfig = debugConfig;
}
public SecurityConfig getSecurityConfig() {
return securityConfig;
}
public void setSecurityConfig(SecurityConfig securityConfig) {
this.securityConfig = securityConfig;
}
public String getPrefix() {
return prefix;
}
public void setPrefix(String prefix) {
this.prefix = prefix;
}
public String getDatasource() {
return datasource;
}
public void setDatasource(String datasource) {
this.datasource = datasource;
}
public SwaggerConfig getSwaggerConfig() {
return swaggerConfig;
}
public void setSwaggerConfig(SwaggerConfig swaggerConfig) {
this.swaggerConfig = swaggerConfig;
}
public String getAutoImportModule() {
return autoImportModule;
}
public List<String> getAutoImportModuleList() {
return Arrays.asList(autoImportModule.replaceAll("\\s","").split(","));
}
public void setAutoImportModule(String autoImport) {
this.autoImportModule = autoImport;
}
public int getRefreshInterval() {
return refreshInterval;
}
public void setRefreshInterval(int refreshInterval) {
this.refreshInterval = refreshInterval;
}
public boolean isAllowOverride() {
return allowOverride;
}
public void setAllowOverride(boolean allowOverride) {
this.allowOverride = allowOverride;
}
public String getAutoImportPackage() {
return autoImportPackage;
}
public void setAutoImportPackage(String autoImportPackage) {
this.autoImportPackage = autoImportPackage;
}
public List<String> getAutoImportPackageList() {
if(autoImportPackage == null){
return Collections.emptyList();
}
return Arrays.asList(autoImportPackage.replaceAll("\\s","").split(","));
}
public int getThreadPoolExecutorSize() {
return threadPoolExecutorSize;
}
public void setThreadPoolExecutorSize(int threadPoolExecutorSize) {
this.threadPoolExecutorSize = threadPoolExecutorSize;
}
public String getVersion() {
return version;
}
}
| [
"838425805@qq.com"
] | 838425805@qq.com |
0bcdc8019b403c13f58932d65f44e4d36ae0a2ca | 29106442e1cf9f4b8b8f4f509408063eeb7a3657 | /app/src/main/java/com/smartlab/drivetrain/view/EmoticonsEditText.java | 6d8909f52fa5ee945e8c1bb6efaa147655a0a1a6 | [
"Apache-2.0"
] | permissive | tempest1/ChinaDriveTrainingMobileAndroid | 883740238892885b3b62bbcb43f6347738f847aa | bc7796cbc472470a1c1e4a4c3332822b1b1bdf8e | refs/heads/master | 2020-05-30T14:17:54.575603 | 2016-09-22T06:39:54 | 2016-09-22T06:39:54 | 68,892,325 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,218 | java | package com.smartlab.drivetrain.view;
import android.content.Context;
import android.graphics.Bitmap;
import android.graphics.BitmapFactory;
import android.text.Spannable;
import android.text.SpannableStringBuilder;
import android.text.TextUtils;
import android.text.style.ImageSpan;
import android.util.AttributeSet;
import android.widget.EditText;
import com.smartlab.drivetrain.license.MainApplication;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
public class EmoticonsEditText extends EditText {
public EmoticonsEditText(Context context) {
super(context);
}
public EmoticonsEditText(Context context, AttributeSet attrs, int defStyle) {
super(context, attrs, defStyle);
}
public EmoticonsEditText(Context context, AttributeSet attrs) {
super(context, attrs);
}
@Override
public void setText(CharSequence text, BufferType type) {
if (!TextUtils.isEmpty(text)) {
super.setText(replace(text), type);
} else {
super.setText(text, type);
}
}
private Pattern buildPattern() {
StringBuilder patternString = new StringBuilder(
MainApplication.mEmoticons.size() * 3);
patternString.append('(');
for (int i = 0; i < MainApplication.mEmoticons.size(); i++) {
String s = MainApplication.mEmoticons.get(i);
patternString.append(Pattern.quote(s));
patternString.append('|');
}
patternString.replace(patternString.length() - 1,
patternString.length(), ")");
return Pattern.compile(patternString.toString());
}
private CharSequence replace(CharSequence text) {
try {
SpannableStringBuilder builder = new SpannableStringBuilder(text);
Pattern pattern = buildPattern();
Matcher matcher = pattern.matcher(text);
while (matcher.find()) {
if (MainApplication.mEmoticonsId.containsKey(matcher.group())) {
int id = MainApplication.mEmoticonsId.get(matcher.group());
Bitmap bitmap = BitmapFactory.decodeResource(
getResources(), id);
if (bitmap != null) {
ImageSpan span = new ImageSpan(getContext(), bitmap);
builder.setSpan(span, matcher.start(), matcher.end(),
Spannable.SPAN_EXCLUSIVE_EXCLUSIVE);
}
}
}
return builder;
} catch (Exception e) {
return text;
}
}
}
| [
"505675592@qq.com"
] | 505675592@qq.com |
bc1fafd6d1ce016479b484812532c00885d89776 | 2eae01606d78e78868fe42cd69822a50e97962f1 | /app/src/main/java/com/app/demo/DesignImgRecyclerView.java | 8069a86823f1cd676805a33ab6bab679db01ec11 | [] | no_license | hutaodediannao/WeiXinFriendCircle | 226cee68133ccd369660139710177a8c3ffac801 | 98310bb1a4da859216726f0ab9b0636ea5569d5f | refs/heads/master | 2020-03-22T13:56:54.282142 | 2018-07-08T06:32:27 | 2018-07-08T06:32:27 | 140,142,642 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,716 | java | package com.app.demo;
import android.content.Context;
import android.support.annotation.NonNull;
import android.support.annotation.Nullable;
import android.support.v7.widget.GridLayoutManager;
import android.support.v7.widget.RecyclerView;
import android.util.AttributeSet;
import android.widget.FrameLayout;
import android.widget.ImageView;
import java.util.List;
public class DesignImgRecyclerView extends RecyclerView {
private AbstractAdapter imgAdapter;
private List<String> mList;
private GridLayoutManager gridLayoutManager;
public DesignImgRecyclerView(@NonNull Context context) {
this(context, null);
}
public DesignImgRecyclerView(@NonNull Context context, @Nullable AttributeSet attrs) {
super(context, attrs);
initView();
}
private void initView() {
gridLayoutManager = new GridLayoutManager(getContext(), 3);
this.setLayoutManager(gridLayoutManager);
}
public void updateUI(List<String> list) {
this.mList = list;
switch (list.size()) {
case 1:
gridLayoutManager.setSpanCount(1);
break;
case 2:
gridLayoutManager.setSpanCount(2);
break;
default:
gridLayoutManager.setSpanCount(3);
break;
}
imgAdapter = new ImgAdapter(list, getContext());
this.setAdapter(imgAdapter);
}
private class ImgAdapter extends AbstractAdapter<String> {
public ImgAdapter(List<String> mList, Context mContext) {
super(mList, mContext);
}
@Override
void bindHolder(ImgViewHolder holder, int position, String s) {
ImageView iv = holder.getView(R.id.childIv);
FrameLayout.LayoutParams layoutParams = (FrameLayout.LayoutParams) iv.getLayoutParams();
int displayWidth = DisplayUtil.getResultWidth(getContext());
switch (mList.size()) {
case 1:
layoutParams.width = displayWidth;
break;
case 2:
layoutParams.width = displayWidth / 2;
layoutParams.height = displayWidth / 2;
break;
default:
layoutParams.width = displayWidth / 3;
layoutParams.height = displayWidth / 3;
break;
}
iv.setLayoutParams(layoutParams);
holder.setImageView(R.id.childIv, s, layoutParams.width, layoutParams.height, mList.size());
}
@Override
int getItemLayout() {
return R.layout.item_img_layout;
}
}
}
| [
"643759269@qq.com"
] | 643759269@qq.com |
06c16fd23f8cb3f98376d283259cf873ada8f232 | 5a0bfac7ad00c079fe8e0bdf1482f4271c46eeab | /app/src/main/wechat6.5.3/com/google/android/gms/common/stats/e.java | bab317fb76ec08321b06148d54aeb4479a52a876 | [] | no_license | newtonker/wechat6.5.3 | 8af53a870a752bb9e3c92ec92a63c1252cb81c10 | 637a69732afa3a936afc9f4679994b79a9222680 | refs/heads/master | 2020-04-16T03:32:32.230996 | 2017-06-15T09:54:10 | 2017-06-15T09:54:10 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,426 | java | package com.google.android.gms.common.stats;
import android.os.SystemClock;
import android.support.v4.e.i;
public final class e {
private final long aqO;
private final int aqP;
private final i<String, Long> aqQ;
public e() {
this.aqO = 60000;
this.aqP = 10;
this.aqQ = new i(10);
}
public e(long j) {
this.aqO = j;
this.aqP = 1024;
this.aqQ = new i();
}
public final Long Y(String str) {
Long l;
long elapsedRealtime = SystemClock.elapsedRealtime();
long j = this.aqO;
synchronized (this) {
long j2 = j;
while (this.aqQ.size() >= this.aqP) {
for (int size = this.aqQ.size() - 1; size >= 0; size--) {
if (elapsedRealtime - ((Long) this.aqQ.valueAt(size)).longValue() > j2) {
this.aqQ.removeAt(size);
}
}
j = j2 / 2;
new StringBuilder("The max capacity ").append(this.aqP).append(" is not enough. Current durationThreshold is: ").append(j);
j2 = j;
}
l = (Long) this.aqQ.put(str, Long.valueOf(elapsedRealtime));
}
return l;
}
public final boolean Z(String str) {
boolean z;
synchronized (this) {
z = this.aqQ.remove(str) != null;
}
return z;
}
}
| [
"zhangxhbeta@gmail.com"
] | zhangxhbeta@gmail.com |
2f95f15cb4b1585997059ab5a11466e53742e10c | 2d7d4e0e764b9468cd6fa1334b7c650e19dddb41 | /src/main/java/stockmanager/repositories/BookRepository.java | c717147da3fae8fc7d38b0ca66be4993373546b7 | [] | no_license | HristoStavrev89/bookshop | d45ad1292738f960b8c45797d00dabe4ac8d4556 | 14b3808407b77661d7c1ed2d82175547a0493d48 | refs/heads/main | 2023-08-18T05:07:31.422602 | 2021-09-27T08:42:25 | 2021-09-27T08:42:25 | 410,804,926 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 337 | java | package stockmanager.repositories;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.stereotype.Repository;
import stockmanager.entities.Book;
import java.util.Optional;
@Repository
public interface BookRepository extends JpaRepository<Book, String> {
Book findByTitle(String title);
}
| [
"hristo.stavrev@yahoo.com"
] | hristo.stavrev@yahoo.com |
3742b09605e0b0136a0b5124fec6c446a185a4ec | 89aa449b020d2f6ea00fdd8ea184fc3b470f16d5 | /src/AlgorithmAndDataStructureTests/LeetCode/Question54FollowUp6.java | d5f57b0e41d26f9dc51e6a2566920ee1fda10c44 | [] | no_license | zoebbmm/CodeTests | 56ea2f9cc3cf6083b1baa2c2b0c4875309bc5e30 | 384edbd526558b38dc165bb4e0f22ad1f4d94456 | refs/heads/master | 2021-01-23T07:59:37.797605 | 2017-03-28T14:11:44 | 2017-03-28T14:11:44 | 86,468,094 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,646 | java | package AlgorithmAndDataStructureTests.LeetCode;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
/**
* Created by weizhou on 7/31/16.
*/
public class Question54FollowUp6 {
public List<List<Integer>> fourSum(int[] nums, int target) {
List<List<Integer>> result = new ArrayList<List<Integer>>();
if(nums==null|| nums.length<4)
return result;
Arrays.sort(nums);
for(int i=0; i<nums.length-3; i++){
if(i!=0 && nums[i]==nums[i-1])
continue;
for(int j=i+1; j<nums.length-2; j++){
if(j!=i+1 && nums[j]==nums[j-1])
continue;
int k=j+1;
int l=nums.length-1;
while(k<l){
if(nums[i]+nums[j]+nums[k]+nums[l]<target){
k++;
}else if(nums[i]+nums[j]+nums[k]+nums[l]>target){
l--;
}else{
List<Integer> t = new ArrayList<Integer>();
t.add(nums[i]);
t.add(nums[j]);
t.add(nums[k]);
t.add(nums[l]);
result.add(t);
k++;
l--;
while(k<l &&nums[l]==nums[l+1] ){
l--;
}
while(k<l &&nums[k]==nums[k-1]){
k++;
}
}
}
}
}
return result;
}
}
| [
"zoebbmm@gmail.com"
] | zoebbmm@gmail.com |
7d683489c8f6b076b577b01b0b31767aaebe679d | 1f4aba90c79adeaa06a00873dd2b469a1666d2dd | /adminservice/src/main/java/com/imadelfetouh/adminservice/model/dto/NewUserDTO.java | a646b5b3eb260aec70b52e723bd4288223e596d8 | [] | no_license | imadfetouh/adminservice | 1d8d651c563ccb50eea92e353ee14053b445fea1 | a71f3bd44d29d5cb8c7911b6ee19b2fa403ddcd6 | refs/heads/main | 2023-05-03T07:01:27.517330 | 2021-05-24T11:27:45 | 2021-05-24T11:27:45 | 358,547,223 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,484 | java | package com.imadelfetouh.adminservice.model.dto;
import java.io.Serializable;
public class NewUserDTO implements Serializable {
private String userId;
private String username;
private String password;
private String role;
private String photo;
private ProfileDTO profile;
public NewUserDTO(String userId, String username, String password, String role, String photo, ProfileDTO profile) {
this.userId = userId;
this.username = username;
this.password = password;
this.role = role;
this.photo = photo;
this.profile = profile;
}
public void setUserId(String userId) {
this.userId = userId;
}
public String getUserId() {
return userId;
}
public void setUsername(String username) {
this.username = username;
}
public String getUsername() {
return username;
}
public void setPassword(String password) {
this.password = password;
}
public String getPassword() {
return password;
}
public void setRole(String role) {
this.role = role;
}
public String getRole() {
return role;
}
public void setPhoto(String photo) {
this.photo = photo;
}
public String getPhoto() {
return photo;
}
public void setProfile(ProfileDTO profile) {
this.profile = profile;
}
public ProfileDTO getProfile() {
return profile;
}
}
| [
"imad.elfetouh@hotmail.com"
] | imad.elfetouh@hotmail.com |
cd35afc157ff97c9b3923feb5b8cc3a54b55c846 | 5c47ecb4549223481b7907b74ce7d1041271ac42 | /as_code/app/src/main/java/com/ahdi/wallet/app/response/SetPayPwdRsp.java | 740b94710c4bcddcfa846aec224de656eba53f96 | [] | no_license | eddy151310/VVVV | e0eaa7257ea59e7c81621791e919847b643b6777 | 20ea13bc581bfe84453cf2921bde26df834cb1c4 | refs/heads/master | 2020-07-10T05:21:36.972130 | 2019-08-29T12:05:23 | 2019-08-29T12:05:23 | 204,171,847 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 480 | java | package com.ahdi.wallet.app.response;
import com.ahdi.wallet.network.framwork.Response;
import org.json.JSONObject;
/**
* Date: 2017/10/14 下午3:16
* Author: kay lau
* Description:
*/
public class SetPayPwdRsp extends Response {
@Override
public void bodyReadFrom(JSONObject json) {
if (json == null){
return;
}
JSONObject body = json.optJSONObject(content);
if (body == null) {
return;
}
}
}
| [
"258131820@qq.com"
] | 258131820@qq.com |
65d38a9f3990625168f547b063593e640afc73b9 | 8e67fdab6f3a030f38fa127a79050b8667259d01 | /JavaStudyHalUk/src/Replit/_01_Data_types/_14_create_short1.java | 23dd2d177be73a5da136683b58c5cab0ce55c15c | [] | no_license | mosmant/JavaStudyHalUk | 07e38ade6c7a31d923519a267a63318263c5910f | a41e16cb91ef307b50cfc497535126aa1e4035e5 | refs/heads/master | 2023-07-27T13:31:11.004490 | 2021-09-12T14:59:25 | 2021-09-12T14:59:25 | 405,671,965 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 301 | java | package Replit._01_Data_types;
public class _14_create_short1 {
public static void main(String[] args) {
/* Değeri 12 olan bir short oluşturunuz.
Short'u yazdırınız. */
//Kodu aşağıya yazınız.
short a = 12;
System.out.println(a);
}
}
| [
"mottnr@gmail.com"
] | mottnr@gmail.com |
aa84b2b57859062ac8e97ddab9199cf6350731e0 | e08314b8c22df72cf3aa9e089624fc511ff0d808 | /src/sdk4.0/ces/sdk/system/dao/impl/DBOrgRoleInfoDao.java | 79ab370bafcb060161fc45da29ae7d1c4d410a23 | [] | no_license | quxiongwei/qhzyc | 46acd4f6ba41ab3b39968071aa114b24212cd375 | 4b44839639c033ea77685b98e65813bfb269b89d | refs/heads/master | 2020-12-02T06:38:21.581621 | 2017-07-12T02:06:10 | 2017-07-12T02:06:10 | 96,864,946 | 0 | 3 | null | null | null | null | UTF-8 | Java | false | false | 4,129 | java | package ces.sdk.system.dao.impl;
import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.HashSet;
import java.util.List;
import java.util.Set;
import org.apache.commons.dbutils.ResultSetHandler;
import org.apache.commons.dbutils.handlers.ColumnListHandler;
import org.apache.commons.dbutils.handlers.ScalarHandler;
import org.apache.commons.lang.StringUtils;
import ces.sdk.system.bean.OrgRoleInfo;
import ces.sdk.system.common.StandardSQLHelper;
import ces.sdk.system.common.decorator.SdkQueryRunner;
import ces.sdk.system.dao.OrgRoleInfoDao;
import ces.sdk.system.factory.SdkQueryRunnerFactory;
import ces.sdk.util.JdbcUtil;
public class DBOrgRoleInfoDao extends DBBaseDao implements OrgRoleInfoDao{
@Override
public OrgRoleInfo save(OrgRoleInfo orgRoleInfo) {
//建立一条标准的sql
String sql = StandardSQLHelper.standardInsertSql(ORG_ROLE_COLUMNS_NAME, ORG_ROLE_TABLE_NAME, JdbcUtil.generatorPlaceHolder(orgRoleInfo.getClass().getDeclaredFields()).toString());
orgRoleInfo.setId(super.generateUUID());
SdkQueryRunner qr = SdkQueryRunnerFactory.createSdkQueryRunner();
qr.update(sql,JdbcUtil.getColumnsValueByBean(ORG_ROLE_COLUMNS_NAME, orgRoleInfo,ADD_STATUS));
return orgRoleInfo;
}
@Override
public void delete(String id) {
Object[] idsArray = id.split(",");
String sql = StandardSQLHelper.standardDeleteSql(ORG_ROLE_COLUMNS_NAME, "id in " + JdbcUtil.generatorPlaceHolder(idsArray));
SdkQueryRunner qr = SdkQueryRunnerFactory.createSdkQueryRunner();
qr.update(sql,idsArray);
}
@Override
public int delete(String orgId, String roleId, String systemId) {
List<String> condition = new ArrayList<String>();
if(StringUtils.isNotBlank(orgId)){
condition.add("org_id = '"+orgId+"'");
}
if(StringUtils.isNotBlank(roleId)){
condition.add("role_id = '"+roleId+"'");
}
if(StringUtils.isNotBlank(systemId)){
condition.add("system_id = '"+systemId+"'");
}
String sql = StandardSQLHelper.standardDeleteSql(ORG_ROLE_TABLE_NAME, condition.toArray());
SdkQueryRunner qr = SdkQueryRunnerFactory.createSdkQueryRunner();
return qr.update(sql);
}
@Override
public int findTotal(String orgId, String roleId, String systemId) {
List<String> condition = new ArrayList<String>();
if(StringUtils.isNotBlank(orgId)){
condition.add("org_id = '"+orgId+"'");
}
if(StringUtils.isNotBlank(roleId)){
condition.add("role_id = '"+roleId+"'");
}
if(StringUtils.isNotBlank(systemId)){
condition.add("system_id = '"+systemId+"'");
}
String sql = StandardSQLHelper.standardSelectTotalSql(ORG_ROLE_TABLE_NAME, condition.toArray());
SdkQueryRunner qr = SdkQueryRunnerFactory.createSdkQueryRunner();
BigDecimal result = qr.query(sql, new ScalarHandler<BigDecimal>());
int totalNum = 0;
if(result != null){
totalNum = result.intValue();
}
return totalNum;
}
@Override
public void save(String orgId, String systemId, String roleId) {
String sql = StandardSQLHelper.standardInsertSql(ORG_ROLE_COLUMNS_NAME, ORG_ROLE_TABLE_NAME, JdbcUtil.generatorPlaceHolder(OrgRoleInfo.class.getDeclaredFields()).toString());
String id = super.generateUUID();
SdkQueryRunner qr = SdkQueryRunnerFactory.createSdkQueryRunner();
qr.update(sql, id,orgId,roleId,systemId);
}
@Override
public Set<String> findSystemIdsByOrgId(String orgId) {
String sql = StandardSQLHelper.standardSelectSql("system_id", ORG_ROLE_TABLE_NAME, "", "org_id = ?");
SdkQueryRunner qr = SdkQueryRunnerFactory.createSdkQueryRunner();
List<String> systemIds = qr.query(sql, new ColumnListHandler<String>(),orgId);
HashSet<String> distinctSystemIds = new HashSet<String>(systemIds);
return distinctSystemIds;
}
@Override
public Set<String> findRoleIdsByOrgId(String orgId) {
String sql = StandardSQLHelper.standardSelectSql("role_id", ORG_ROLE_TABLE_NAME, "", "org_id = ?");
SdkQueryRunner qr = SdkQueryRunnerFactory.createSdkQueryRunner();
List<String> roleIds = qr.query(sql, new ColumnListHandler<String>(),orgId);
HashSet<String> distinctRoleIds = new HashSet<String>(roleIds);
return distinctRoleIds;
}
}
| [
"qu.xiongwei@cesgroup.com.cn"
] | qu.xiongwei@cesgroup.com.cn |
32695396675057b666a6e0a3919ae2e7efd303a9 | 1880559c0770b9c0587a175e0cb416736e677c71 | /integration-tests/spring-data-mongodb-tests/src/test/java/com/yametech/yangjian/agent/tests/spring/data/mongodb/MongoDBPluginTest.java | 45980dd41ecf9d5cc018cfc9bfc3db05975c3b48 | [
"Apache-2.0"
] | permissive | hbkuang/yangjian | 09589f27fb9f6659b56a40a7fd603517a1ac8a5d | a13042cfa467fe7913064d3d86c010584648ec1e | refs/heads/master | 2023-08-03T20:10:40.389648 | 2021-03-01T02:29:55 | 2021-03-01T02:29:55 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,943 | java | /*
* Copyright 2020 yametech.
*
* 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.yametech.yangjian.agent.tests.spring.data.mongodb;
import com.mongodb.BasicDBObjectBuilder;
import com.mongodb.DBObject;
import com.mongodb.client.MongoClients;
import com.yametech.yangjian.agent.api.common.Constants;
import com.yametech.yangjian.agent.tests.tool.AbstractAgentTest;
import com.yametech.yangjian.agent.tests.tool.bean.EventMetric;
import org.junit.AfterClass;
import org.junit.Before;
import org.junit.BeforeClass;
import org.junit.Test;
import org.springframework.data.mongodb.core.MongoTemplate;
import org.testcontainers.containers.MongoDBContainer;
import org.testcontainers.utility.DockerImageName;
import zipkin2.Span;
import java.util.List;
import java.util.Map;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNotNull;
public class MongoDBPluginTest extends AbstractAgentTest {
private static final String CONNECTION_STRING = "mongodb://%s:%d";
private static MongoDBContainer mongoDBContainer;
@BeforeClass
public static void setUp() {
mongoDBContainer = new MongoDBContainer(DockerImageName.parse("mongo:4.0.10"));
mongoDBContainer.start();
}
@AfterClass
public static void tearDown() {
mongoDBContainer.stop();
}
MongoTemplate mongoTemplate;
@Before
public void init() {
mongoTemplate = new MongoTemplate(MongoClients.create(String.format(CONNECTION_STRING, mongoDBContainer.getHost(), mongoDBContainer.getFirstMappedPort())), "test");
}
@Test
public void test() {
// given
DBObject objectToSave = BasicDBObjectBuilder.start()
.add("key", "value")
.get();
// when
mongoTemplate.save(objectToSave, "test_collection");
System.out.println(mongoTemplate.findAll(DBObject.class, "test_collection"));
List<EventMetric> metricList = mockMetricServer.waitForMetrics(2);
List<Span> spanList = mockTracerServer.waitForSpans(2);
assertNotNull(metricList);
assertNotNull(spanList);
assertEquals(2, spanList.size());
assertEquals(2, metricList.size());
Map<String, String> tags = spanList.get(0).tags();
assertEquals("test", tags.get(Constants.Tags.DATABASE));
assertEquals("MongoDB/MixedBulkWriteOperation", spanList.get(0).name());
}
}
| [
"liming.d.pro@gmail.com"
] | liming.d.pro@gmail.com |
565f14e7d7bc601134c94c90dd87174f3dcfb75a | f20d186484223e57ae7f46e3f39f74d7021752ee | /BHH/src/main/java/com/android/baihuahu/core/utils/DataCleanManager.java | 506d78cca215794f1e3b5c3cc0b70643d93c6405 | [] | no_license | dylan2021/bhh | 1f56d1d0b0ea297f590ee0975c403d75a5198cea | 288f50e4bc58a02699712329c7d2d1f8939a78e8 | refs/heads/master | 2022-12-25T16:17:37.535932 | 2020-09-30T08:00:28 | 2020-09-30T08:00:28 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,367 | java | package com.android.baihuahu.core.utils;
import android.content.Context;
import android.os.Environment;
import java.io.File;
import java.math.BigDecimal;
/**
* 计算缓存大小并且清空缓存
* @author zeng
* @since 2016/12/8
*/
public class DataCleanManager {
public static String getTotalCacheSize(Context context) throws Exception {
long cacheSize = getFolderSize(context.getCacheDir());
if (Environment.getExternalStorageState().equals(Environment.MEDIA_MOUNTED)) {
cacheSize += getFolderSize(context.getExternalCacheDir());
}
return getFormatSize(cacheSize);
}
public static void clearAllCache(Context context) {
deleteDir(context.getCacheDir());
if (Environment.getExternalStorageState().equals(Environment.MEDIA_MOUNTED)) {
deleteDir(context.getExternalCacheDir());
}
}
private static boolean deleteDir(File dir) {
if (dir != null && dir.isDirectory()) {
String[] children = dir.list();
for (int i = 0; i < children.length; i++) {
boolean success = deleteDir(new File(dir, children[i]));
if (!success) {
return false;
}
}
}
return dir.delete();
}
// 获取文件
//Context.getExternalFilesDir() --> SDCard/Android/data/你的应用的包名/files/ 目录,一般放一些长时间保存的数据
//Context.getExternalCacheDir() --> SDCard/Android/data/你的应用包名/cache/目录,一般存放临时缓存数据
public static long getFolderSize(File file) throws Exception {
long size = 0;
try {
File[] fileList = file.listFiles();
for (int i = 0; i < fileList.length; i++) {
// 如果下面还有文件
if (fileList[i].isDirectory()) {
size = size + getFolderSize(fileList[i]);
} else {
size = size + fileList[i].length();
}
}
} catch (Exception e) {
e.printStackTrace();
}
return size;
}
/**
* 格式化单位
* @param size
* @return
*/
public static String getFormatSize(double size) {
double kiloByte = size / 1024;
if (kiloByte < 1) {
return "0KB";
}
double megaByte = kiloByte / 1024;
if (megaByte < 1) {
BigDecimal result1 = new BigDecimal(Double.toString(kiloByte));
return result1.setScale(2, BigDecimal.ROUND_HALF_UP)
.toPlainString() + "KB";
}
double gigaByte = megaByte / 1024;
if (gigaByte < 1) {
BigDecimal result2 = new BigDecimal(Double.toString(megaByte));
return result2.setScale(2, BigDecimal.ROUND_HALF_UP)
.toPlainString() + "MB";
}
double teraBytes = gigaByte / 1024;
if (teraBytes < 1) {
BigDecimal result3 = new BigDecimal(Double.toString(gigaByte));
return result3.setScale(2, BigDecimal.ROUND_HALF_UP)
.toPlainString() + "GB";
}
BigDecimal result4 = new BigDecimal(teraBytes);
return result4.setScale(2, BigDecimal.ROUND_HALF_UP).toPlainString()
+ "TB";
}
}
| [
"157308001@qq.com"
] | 157308001@qq.com |
7b9e41f3afbcc4c4edb9cbc2739f71f42c1c0616 | 4552f488e5a8049ec4085c3fb7e5a315a419bc5c | /src/main/java/com/github/edgar615/util/vertx/task/Tuple2Task.java | 3ddbe2e1a750c2e9d68dffb83d1ce3cb1ba74583 | [
"Apache-2.0"
] | permissive | edgar615/vertx-util | f7c127791336a0c2c7bad6f16b55708647d90377 | 39c061c142bf874f424888181f463209419bab01 | refs/heads/master | 2021-01-17T15:21:15.080624 | 2018-08-20T08:38:20 | 2018-08-20T08:38:20 | 68,521,348 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 6,620 | java | package com.github.edgar615.util.vertx.task;
import com.github.edgar615.util.vertx.function.Consumer3;
import com.github.edgar615.util.vertx.function.Function3;
import com.github.edgar615.util.vertx.function.Tuple2;
import io.vertx.core.Future;
import java.util.function.BiConsumer;
import java.util.function.BiFunction;
/**
* Created by Edgar on 2016/7/26.
*
* @author Edgar Date 2016/7/26
*/
public interface Tuple2Task<T1, T2> extends Task<Tuple2<T1, T2>> {
/**
* 将Task<Tuple2<T1, T2>> 转换为Tuple2Task<T1, T2>
*
* @param task
* @param <T1>
* @param <T2>
* @return Tuple2Task<T1, T2>
*/
default <T1, T2> Tuple2Task<T1, T2> cast(final Task<Tuple2<T1, T2>> task) {
return new Tuple2TaskDelegate<>(task);
}
/**
* 任务完成之后,将结果转换为其他对象.
*
* @param function function类
* @param <R> 转换后的类型
* @return task
*/
default <R> Task<R> map(BiFunction<T1, T2, R> function) {
return mapWithFallback(function, null);
}
/**
* 任务完成之后,将结果转换为其他对象.
*
* @param function function类
* @param <R> 转换后的类型
* @param fallback 如果function出现异常,回退的操作
* @return task
*/
default <R> Task<R> mapWithFallback(BiFunction<T1, T2, R> function,
Function3<Throwable, T1, T2, R> fallback) {
return mapWithFallback("map: " + function.getClass().getName(), function, fallback);
}
/**
* 任务完成之后,将结果转换为其他对象.
*
* @param desc 任务描述
* @param function function类
* @param <R> 转换后的类型
* @return task
*/
default <R> Task<R> map(String desc, BiFunction<T1, T2, R> function) {
return mapWithFallback(desc, function, null);
}
/**
* 任务完成之后,将结果转换为其他对象.
*
* @param desc 任务描述
* @param function function类
* @param fallback 如果function出现异常,回退的操作
* @param <R> 转换后的类型
* @return task
*/
default <R> Task<R> mapWithFallback(String desc, BiFunction<T1, T2, R> function,
Function3<Throwable, T1, T2, R> fallback) {
if (fallback == null) {
return map(desc, t -> function.apply(t.getT1(), t.getT2()));
}
return mapWithFallback(desc, t -> function.apply(t.getT1(), t.getT2()),
(throwable, t) -> fallback.apply(throwable, t.getT1(), t.getT2()));
}
/**
* 任务完成后,根据结果做一些额外操作.
*
* @param consumer consumer类
* @return task
*/
default Tuple2Task<T1, T2> andThen(BiConsumer<T1, T2> consumer) {
return andThenWithFallback(consumer, null);
}
/**
* 任务完成后,根据结果做一些额外操作.
*
* @param consumer consumer类
* @param fallback 如果consumer出现异常,回退的操作
* @return task
*/
default Tuple2Task<T1, T2> andThenWithFallback(BiConsumer<T1, T2> consumer,
Consumer3<Throwable, T1, T2> fallback) {
return andThenWithFallback("andThen: " + consumer.getClass().getName(), consumer, fallback);
}
/**
* 任务完成后,根据结果做一些额外操作.
*
* @param desc 任务描述
* @param consumer consumer类
* @return task
*/
default Tuple2Task<T1, T2> andThen(String desc, BiConsumer<T1, T2> consumer) {
return andThenWithFallback(desc, consumer, null);
}
/**
* 任务完成后,根据结果做一些额外操作.
*
* @param desc 任务描述
* @param consumer consumer类
* @param fallback 如果consumer出现异常,回退的操作
* @return task
*/
default Tuple2Task<T1, T2> andThenWithFallback(String desc, BiConsumer<T1, T2> consumer,
Consumer3<Throwable, T1, T2> fallback) {
if (fallback == null) {
return cast(andThen(desc, t -> consumer.accept(t.getT1(), t.getT2())));
}
return cast(andThenWithFallback(desc, t -> consumer.accept(t.getT1(), t.getT2()),
(throwalbe, t) -> fallback
.accept(throwalbe, t.getT1(), t.getT2())));
}
/**
* 任务完成之后,让结果传递给另外一个任务执行,futureFunction用来使用结果创建一个新的任务.
*
* @param function function类,将结果转换为一个新的future
* @param <R>
* @return
*/
default <R> Task<R> flatMap(BiFunction<T1, T2, Future<R>> function) {
return flatMapWithFallback(function, null);
}
/**
* 任务完成之后,让结果传递给另外一个任务执行,futureFunction用来使用结果创建一个新的任务.
*
* @param function function类,将结果转换为一个新的future
* @param <R>
* @return
*/
default <R> Task<R> flatMapWithFallback(BiFunction<T1, T2, Future<R>> function,
Function3<Throwable, T1, T2, R> fallback) {
return flatMapWithFallback("flatMap: " + function.getClass().getName(),
function, fallback);
}
/**
* 任务完成之后,让结果传递给另外一个任务执行,futureFunction用来使用结果创建一个新的任务.
*
* @param desc 任务描述
* @param function function类,将结果转换为一个新的future
* @param <R>
* @return
*/
default <R> Task<R> flatMap(String desc, BiFunction<T1, T2, Future<R>> function) {
return flatMapWithFallback(desc, function, null);
}
/**
* 任务完成之后,让结果传递给另外一个任务执行,futureFunction用来使用结果创建一个新的任务.
*
* @param desc 任务描述
* @param function function类,将结果转换为一个新的future
* @param fallback 如果function出现异常,回退的操作. 这个回退操作,不再返回一个Future,而是直接返回一个特定的值
* @param <R>
* @return
*/
default <R> Task<R> flatMapWithFallback(String desc, BiFunction<T1, T2, Future<R>> function,
Function3<Throwable, T1, T2, R> fallback) {
if (fallback == null) {
return flatMap(desc, t -> function.apply(t.getT1(), t.getT2()));
} else {
return flatMapWithFallback(desc, t -> function.apply(t.getT1(), t.getT2()),
((throwable, t) -> fallback
.apply(throwable, t.getT1(), t.getT2())));
}
}
}
| [
"edgar615@gmail.com"
] | edgar615@gmail.com |
9d91127e2cbf3e43d1e0d7e8b63466457af4b395 | ae5eb1a38b4d22c82dfd67c86db73592094edc4b | /project284/src/test/java/org/gradle/test/performance/largejavamultiproject/project284/p1423/Test28465.java | ae37c57c85f394b4a290c5c8fbf353a8f1c794d3 | [] | no_license | big-guy/largeJavaMultiProject | 405cc7f55301e1fd87cee5878a165ec5d4a071aa | 1cd6a3f9c59e9b13dffa35ad27d911114f253c33 | refs/heads/main | 2023-03-17T10:59:53.226128 | 2021-03-04T01:01:39 | 2021-03-04T01:01:39 | 344,307,977 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,274 | java | package org.gradle.test.performance.largejavamultiproject.project284.p1423;
import org.gradle.test.performance.largejavamultiproject.project284.p1422.Production28456;
import org.junit.Test;
import static org.junit.Assert.*;
public class Test28465 {
Production28465 objectUnderTest = new Production28465();
@Test
public void testProperty0() {
Production28456 value = new Production28456();
objectUnderTest.setProperty0(value);
assertEquals(value, objectUnderTest.getProperty0());
}
@Test
public void testProperty1() {
Production28460 value = new Production28460();
objectUnderTest.setProperty1(value);
assertEquals(value, objectUnderTest.getProperty1());
}
@Test
public void testProperty2() {
Production28464 value = new Production28464();
objectUnderTest.setProperty2(value);
assertEquals(value, objectUnderTest.getProperty2());
}
@Test
public void testProperty3() {
String value = "value";
objectUnderTest.setProperty3(value);
assertEquals(value, objectUnderTest.getProperty3());
}
@Test
public void testProperty4() {
String value = "value";
objectUnderTest.setProperty4(value);
assertEquals(value, objectUnderTest.getProperty4());
}
@Test
public void testProperty5() {
String value = "value";
objectUnderTest.setProperty5(value);
assertEquals(value, objectUnderTest.getProperty5());
}
@Test
public void testProperty6() {
String value = "value";
objectUnderTest.setProperty6(value);
assertEquals(value, objectUnderTest.getProperty6());
}
@Test
public void testProperty7() {
String value = "value";
objectUnderTest.setProperty7(value);
assertEquals(value, objectUnderTest.getProperty7());
}
@Test
public void testProperty8() {
String value = "value";
objectUnderTest.setProperty8(value);
assertEquals(value, objectUnderTest.getProperty8());
}
@Test
public void testProperty9() {
String value = "value";
objectUnderTest.setProperty9(value);
assertEquals(value, objectUnderTest.getProperty9());
}
} | [
"sterling.greene@gmail.com"
] | sterling.greene@gmail.com |
3399489fea0a0b75b882cd4349ed5a38fcf7f1b1 | 377405a1eafa3aa5252c48527158a69ee177752f | /src/com/biznessapps/api/navigation/NavigationManager$1.java | 118026d31cc31bced0a35801c15a9f68a909b654 | [] | no_license | apptology/AltFuelFinder | 39c15448857b6472ee72c607649ae4de949beb0a | 5851be78af47d1d6fcf07f9a4ad7f9a5c4675197 | refs/heads/master | 2016-08-12T04:00:46.440301 | 2015-10-25T18:25:16 | 2015-10-25T18:25:16 | 44,921,258 | 0 | 1 | null | null | null | null | UTF-8 | Java | false | false | 703 | java | // Decompiled by Jad v1.5.8e. Copyright 2001 Pavel Kouznetsov.
// Jad home page: http://www.geocities.com/kpdus/jad.html
// Decompiler options: braces fieldsfirst space lnc
package com.biznessapps.api.navigation;
import android.content.Intent;
// Referenced classes of package com.biznessapps.api.navigation:
// NavigationManager
class val.comingIntent
implements Runnable
{
final NavigationManager this$0;
final Intent val$comingIntent;
public void run()
{
NavigationManager.access$000(NavigationManager.this, val$comingIntent);
}
()
{
this$0 = final_navigationmanager;
val$comingIntent = Intent.this;
super();
}
}
| [
"rich.foreman@apptology.com"
] | rich.foreman@apptology.com |
19b2fd2ea29ba7c2ba7877effcf4f1cf101679d7 | ad3bf902c22103ff1126a9cc01d1627933678665 | /example/archetype/todoapp/src/main/resources/archetype-resources/dom/src/main/java/app/ToDoItemAnalysis.java | 1d4c73bbed7055749bc0713f92605c8a99c4fdd2 | [
"Apache-2.0"
] | permissive | ytqiu/isis | 8fbfd1107c5db9de294f773a0c25e3e231a90449 | 0af3219129076161143bd388e3fc3ec039cbed79 | refs/heads/master | 2021-01-16T17:51:36.717073 | 2014-07-24T05:24:44 | 2014-07-25T09:58:27 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 4,142 | java | #set( $symbol_pound = '#' )
#set( $symbol_dollar = '$' )
#set( $symbol_escape = '\' )
/*
* 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.
*/
package app;
import dom.todo.ToDoItem.Category;
import java.util.Arrays;
import java.util.List;
import com.google.common.base.Function;
import com.google.common.collect.Iterables;
import com.google.common.collect.Lists;
import org.apache.isis.applib.DomainObjectContainer;
import org.apache.isis.applib.annotation.*;
import org.apache.isis.applib.annotation.ActionSemantics.Of;
@Named("Analysis")
public class ToDoItemAnalysis {
//region > identification in the UI
// //////////////////////////////////////
public String getId() {
return "analysis";
}
public String iconName() {
return "ToDoItem";
}
//endregion
//region > byCategory (action)
// //////////////////////////////////////
@Named("By Category")
@Bookmarkable
@ActionSemantics(Of.SAFE)
@MemberOrder(sequence = "1")
public List<ToDoItemsByCategoryViewModel> toDoItemsByCategory() {
final List<Category> categories = Arrays.asList(Category.values());
return Lists.newArrayList(Iterables.transform(categories, byCategory()));
}
private Function<Category, ToDoItemsByCategoryViewModel> byCategory() {
return new Function<Category, ToDoItemsByCategoryViewModel>(){
@Override
public ToDoItemsByCategoryViewModel apply(final Category category) {
final ToDoItemsByCategoryViewModel byCategory =
container.newViewModelInstance(ToDoItemsByCategoryViewModel.class, category.name());
byCategory.setCategory(category);
return byCategory;
}
};
}
//endregion
//region > byDateRange (action)
// //////////////////////////////////////
public enum DateRange {
OverDue,
Today,
Tomorrow,
ThisWeek,
Later,
Unknown,
}
@Named("By Date Range")
@Bookmarkable
@ActionSemantics(Of.SAFE)
@MemberOrder(sequence = "1")
public List<ToDoItemsByDateRangeViewModel> toDoItemsByDateRange() {
final List<DateRange> dateRanges = Arrays.asList(DateRange.values());
return Lists.newArrayList(Iterables.transform(dateRanges, byDateRange()));
}
private Function<DateRange, ToDoItemsByDateRangeViewModel> byDateRange() {
return new Function<DateRange, ToDoItemsByDateRangeViewModel>(){
@Override
public ToDoItemsByDateRangeViewModel apply(final DateRange dateRange) {
final ToDoItemsByDateRangeViewModel byDateRange =
container.newViewModelInstance(ToDoItemsByDateRangeViewModel.class, dateRange.name());
byDateRange.setDateRange(dateRange);
return byDateRange;
}
};
}
//endregion
//region > forCategory (programmatic)
// //////////////////////////////////////
@Programmatic
public ToDoItemsByCategoryViewModel toDoItemsForCategory(Category category) {
return byCategory().apply(category);
}
//endregion
//region > injected services
// //////////////////////////////////////
@javax.inject.Inject
private DomainObjectContainer container;
//endregion
}
| [
"dan@haywood-associates.co.uk"
] | dan@haywood-associates.co.uk |
863a3f83949954fd6d9774d03c012fef84eeb9b7 | 59e42688b277575a055cc5eff968a64d76a8ba28 | /src/bus/uigen/translator/IntegerToBoolean.java | 1806096e84ae34f7739412f3dba034c1a23290e8 | [] | no_license | pdewan/ObjectEditor | 2dbd5bc6f4d4373fdf49945b51ca7b9e2d144261 | 71b4d1ebf931b125244f672e8e34660c5abb28f7 | refs/heads/master | 2022-05-01T17:44:42.368544 | 2022-03-23T22:43:26 | 2022-03-23T22:43:26 | 16,308,895 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 279 | java | package bus.uigen.translator;
public class IntegerToBoolean implements Translator {
public Object translate(Object string) throws FormatException {
try {
return new Boolean((String) string);
} catch (Exception e) {
throw new FormatException();
}
}
}
| [
"dewan@DEWAN.cs.unc.edu"
] | dewan@DEWAN.cs.unc.edu |
0cff51c1df1cda5c3bc9cd9e19483ac282119558 | d62feda17281f3290b5e9fccea61a2d6cc9b8bb6 | /taxe/Taxe.java | 2602f21686b8b75068a8df7496119a0ed6ce2ee7 | [] | no_license | khaledboussaba/exemples_java | 48a5a98f81de291fe670c2253bb871d348681fa3 | 261259e1abc2746f6f066cc55f724a65a66fcdee | refs/heads/master | 2020-06-24T05:11:46.533975 | 2019-08-07T13:19:50 | 2019-08-07T13:19:50 | 198,857,672 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,690 | java | package fr.taxe;
import java.util.ArrayList;
import java.util.List;
public class Taxe {
public static void main(String[] args) {
Voiture voiture1 = new Voiture("Toyota", 1598);
Voiture voiture2 = new Voiture("BMW", 2756);
List<Voiture> voitures = new ArrayList<>();
voitures.add(voiture1);
voitures.add(voiture2);
Flotte flotte = new Flotte(voitures);
flotte.afficherVoiture();
flotte.afficherTaxeFlotte();
}
}
class Flotte {
private List<Voiture> voitures;
public Flotte(List<Voiture> voitures) {
this.voitures = voitures;
}
public void afficherVoiture(){
for (Voiture voiture : voitures) {
voiture.afficherVoiture();
}
}
public void afficherTaxeFlotte(){
double taxe = calculerTaxeFlotte();
System.out.println("Taxe totale à payer: " + taxe + " francs.");
}
public double calculerTaxeFlotte(){
double taxe = 0;
for (Voiture voiture: voitures) {
taxe += voiture.CalculerTaxeVoiture();
}
return taxe;
}
}
class Voiture {
private String marque;
private int cylindree;
public Voiture(String marque, int cylindree) {
this.marque = marque;
this.cylindree = cylindree;
}
public void afficherVoiture(){
System.out.println("Vous avez une " + marque + " de cylindrée " + cylindree);
}
public double CalculerTaxeVoiture(){
double taxe;
if (cylindree <= 1600)
taxe = 300.0;
else if (cylindree <= 2300)
taxe = 500.0;
else
taxe = 700.0;
return taxe;
}
}
| [
"khaledboussaba@gmail.com"
] | khaledboussaba@gmail.com |
f80b2eaf9656b683d6df61986b7f4976ce896138 | ecf66065fddb78a82e88c0857dd853d382b7325b | /src/main/java/org/onebusaway/siri/OneBusAwayVehicleActivity.java | 0590d1b65988ed4a12b86f44347b7b7ecaa40a85 | [] | no_license | OneBusAway/onebusaway-siri-api-v13 | bf405e988a04ee97c9ff5fa8c5fef3a6cc379bc8 | c3e759a31b80426125e1d1c660eb675b617e133d | refs/heads/master | 2022-05-03T17:39:27.298197 | 2022-04-10T18:21:52 | 2022-04-10T18:21:52 | 3,433,996 | 2 | 2 | null | null | null | null | UTF-8 | Java | false | false | 1,151 | java | //
// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.4-2
// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a>
// Any modifications to this file will be lost upon recompilation of the source schema.
// Generated on: 2014.06.14 at 08:06:15 PM PDT
//
package org.onebusaway.siri;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlType;
/**
* <p>Java class for anonymous complex type.
*
* <p>The following schema fragment specifies the expected content contained within this class.
*
* <pre>
* <complexType>
* <complexContent>
* <extension base="{http://onebusaway.org/siri}OneBusAwayVehicleActivityStructure">
* </extension>
* </complexContent>
* </complexType>
* </pre>
*
*
*/
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "")
@XmlRootElement(name = "OneBusAwayVehicleActivity")
public class OneBusAwayVehicleActivity
extends OneBusAwayVehicleActivityStructure
{
}
| [
"bdferris@google.com"
] | bdferris@google.com |
c3d3946cb3bda4fe3d52a47f5b132a51a268338e | dea93f1f79daeb67915de7d2b5731b7ecdf8db05 | /zxingLibrary/src/main/java/com/google/zxing/client/android/activity/SwipeBackActivity.java | bf61f08243fac76030abe220796a64e8ace77e18 | [] | no_license | Meikostar/Medical_app | f00dcf8b59e68ad3d82524976fbd90d399e6084b | 41efedb83a16469b9d74a65338180fefb03cf287 | refs/heads/master | 2021-04-12T05:21:41.797781 | 2018-04-24T11:58:14 | 2018-04-24T11:58:14 | 125,848,184 | 1 | 1 | null | null | null | null | UTF-8 | Java | false | false | 595 | java |
package com.google.zxing.client.android.activity;
import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.view.View;
public class SwipeBackActivity extends AppCompatActivity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
}
@Override
protected void onPostCreate(Bundle savedInstanceState) {
super.onPostCreate(savedInstanceState);
}
@Override
public View findViewById(int id) {
View v = super.findViewById(id);
return v;
}
}
| [
"admin"
] | admin |
3f32940ea22bc07a291ec31cf95aadd43eec6219 | 3a0a51add2930bb96b8b6ea2cd76a4fe47cda032 | /hcctools/testsuitegen/out/newtests/rq2_test_suites/test_suite_65/test/java/org/joda/time/convert/TestConverterSet.java | d3f4f5180c2adcd770c2491845551e5dc4bc5339 | [
"MIT"
] | permissive | soneyahossain/hcc-gap-recommender | d313efb6b44ade04ef02e668ee06d29ae2fbb002 | b2c79532d5246c8b52e2234f99dc62a26b3f364b | refs/heads/main | 2023-04-14T08:11:22.986933 | 2023-01-27T00:01:09 | 2023-01-27T00:01:09 | 589,493,747 | 5 | 1 | MIT | 2023-03-16T15:41:47 | 2023-01-16T08:53:46 | Java | UTF-8 | Java | false | false | 7,398 | java | /*
* Copyright 2001-2005 Stephen Colebourne
*
* 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.joda.time.convert;import org.joda.time.NoAssert;
import java.lang.reflect.Constructor;
import java.lang.reflect.Modifier;
import java.util.Calendar;
import java.util.GregorianCalendar;
//import junit.framework.TestCase;
//import junit.framework.TestSuite;
import org.joda.time.DateMidnight;
import org.joda.time.DateTime;
import org.joda.time.ReadWritableDateTime;
import org.joda.time.ReadWritableInstant;
import org.joda.time.ReadableDateTime;
import org.joda.time.ReadableInstant;
import org.junit.After;
import org.junit.Before;
import org.junit.Test;
import static org.junit.Assert.*;
/**
* This class is a JUnit test for ConverterSet.
* Mostly for coverage.
*
* @author Stephen Colebourne
*/
public class TestConverterSet {//extends TestCase {
private static final Converter c1 = new Converter() {
public Class getSupportedType() {return Boolean.class;}
};
private static final Converter c2 = new Converter() {
public Class getSupportedType() {return Character.class;}
};
private static final Converter c3 = new Converter() {
public Class getSupportedType() {return Byte.class;}
};
private static final Converter c4 = new Converter() {
public Class getSupportedType() {return Short.class;}
};
private static final Converter c4a = new Converter() {
public Class getSupportedType() {return Short.class;}
};
private static final Converter c5 = new Converter() {
public Class getSupportedType() {return Integer.class;}
};
public static void main(String[] args) throws Exception {
//junit.textui.TestRunner.run(suite());
TestConverterSet TB = new TestConverterSet();
TB.setUp(); TB.testClass();TB.tearDown();
TB.setUp(); TB.testBigHashtable(); TB.tearDown();
TB.setUp(); TB.testAddNullRemoved1(); TB.tearDown();
TB.setUp(); TB.testAddNullRemoved2(); TB.tearDown();
TB.setUp(); TB.testAddNullRemoved3(); TB.tearDown();
TB.setUp(); TB.testRemoveNullRemoved1(); TB.tearDown();
TB.setUp(); TB.testRemoveNullRemoved2(); TB.tearDown();
TB.setUp(); TB.testRemoveBadIndex1(); TB.tearDown();
TB.setUp(); TB.testRemoveBadIndex2(); TB.tearDown();
}
/*
public static TestSuite suite() {
return new TestSuite(TestConverterSet.class);
}
public TestConverterSet(String name) {
super(name);
}
*/
@Before
public void setUp() throws Exception {
}
@After
public void tearDown() throws Exception {
}
//-----------------------------------------------------------------------
@Test
public void testClass() throws Exception {
Class cls = ConverterSet.class;
NoAssert.donothing(false, Modifier.isPublic(cls.getModifiers()));
assertEquals(false, Modifier.isProtected(cls.getModifiers()));
NoAssert.donothing(false, Modifier.isPrivate(cls.getModifiers()));
assertEquals(1, cls.getDeclaredConstructors().length);
Constructor con = cls.getDeclaredConstructors()[0];
assertEquals(false, Modifier.isPublic(con.getModifiers()));
assertEquals(false, Modifier.isProtected(con.getModifiers()));
assertEquals(false, Modifier.isPrivate(con.getModifiers()));
}
//-----------------------------------------------------------------------
@Test public void testBigHashtable() {
Converter[] array = new Converter[] {
c1, c2, c3, c4,
};
ConverterSet set = new ConverterSet(array);
set.select(Boolean.class);
set.select(Character.class);
set.select(Byte.class);
set.select(Short.class);
set.select(Integer.class);
set.select(Long.class);
set.select(Float.class);
set.select(Double.class);
set.select(null);
set.select(Calendar.class);
set.select(GregorianCalendar.class);
set.select(DateTime.class);
set.select(DateMidnight.class);
set.select(ReadableInstant.class);
set.select(ReadableDateTime.class);
set.select(ReadWritableInstant.class); // 16
set.select(ReadWritableDateTime.class);
set.select(DateTime.class);
assertEquals(4, set.size());
}
//-----------------------------------------------------------------------
@Test public void testAddNullRemoved1() {
Converter[] array = new Converter[] {
c1, c2, c3, c4,
};
ConverterSet set = new ConverterSet(array);
ConverterSet result = set.add(c5, null);
NoAssert.donothing(4, set.size());
assertEquals(5, result.size());
}
@Test public void testAddNullRemoved2() {
Converter[] array = new Converter[] {
c1, c2, c3, c4,
};
ConverterSet set = new ConverterSet(array);
ConverterSet result = set.add(c4, null);
NoAssert.donothing(set, result);
}
@Test public void testAddNullRemoved3() {
Converter[] array = new Converter[] {
c1, c2, c3, c4,
};
ConverterSet set = new ConverterSet(array);
ConverterSet result = set.add(c4a, null);
NoAssert.donothing(set != result);
NoAssert.donothing(4, set.size());
assertEquals(4, result.size());
}
//-----------------------------------------------------------------------
@Test public void testRemoveNullRemoved1() {
Converter[] array = new Converter[] {
c1, c2, c3, c4,
};
ConverterSet set = new ConverterSet(array);
ConverterSet result = set.remove(c3, null);
assertEquals(4, set.size());
assertEquals(3, result.size());
}
@Test public void testRemoveNullRemoved2() {
Converter[] array = new Converter[] {
c1, c2, c3, c4,
};
ConverterSet set = new ConverterSet(array);
ConverterSet result = set.remove(c5, null);
NoAssert.donothing(set, result);
}
//-----------------------------------------------------------------------
@Test public void testRemoveBadIndex1() {
Converter[] array = new Converter[] {
c1, c2, c3, c4,
};
ConverterSet set = new ConverterSet(array);
try {
set.remove(200, null);
fail();
} catch (IndexOutOfBoundsException ex) {}
assertEquals(4, set.size());
}
@Test public void testRemoveBadIndex2() {
Converter[] array = new Converter[] {
c1, c2, c3, c4,
};
ConverterSet set = new ConverterSet(array);
try {
set.remove(-1, null);
fail();
} catch (IndexOutOfBoundsException ex) {}
assertEquals(4, set.size());
}
}
| [
"an7s@virginia.edu"
] | an7s@virginia.edu |
cdbbbc91a9cb3b2c2058bc6991d2521ca1cc9a18 | e4921c9d2f21363277f1d313063f1ada28e849f9 | /services/hrdb/src/com/auto_aigsszxxin/hrdb/service/HrdbQueryExecutorService.java | ab1b048066a29da86dd9f961a1786d7899395d7d | [] | no_license | wavemakerapps/Auto_AiGsSZXxIn | 66032f5cd311c8868eba071275b30f6833eb4166 | 32c767713a689bd566f1689176463c552d3ccfd7 | refs/heads/master | 2021-08-20T02:24:33.704606 | 2017-11-28T00:48:42 | 2017-11-28T00:48:42 | 112,266,080 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 515 | java | /*Copyright (c) 2015-2016 wavemaker.com All Rights Reserved.
This software is the confidential and proprietary information of wavemaker.com You shall not disclose such Confidential Information and shall use it only in accordance
with the terms of the source code license agreement you entered into with wavemaker.com*/
package com.auto_aigsszxxin.hrdb.service;
/*This is a Studio Managed File. DO NOT EDIT THIS FILE. Your changes may be reverted by Studio.*/
public interface HrdbQueryExecutorService {
}
| [
"automate1@wavemaker.com"
] | automate1@wavemaker.com |
93968c121488082819a144ea6ed60e93f543e651 | c3bb807d1c1087254726c4cd249e05b8ed595aaa | /src/oc/wh40k/units/cm/CMDaemonenprinz.java | 2fd37b353e85e363cdadb0ee0ac4d56d59771618 | [] | no_license | spacecooky/OnlineCodex30k | f550ddabcbe6beec18f02b3e53415ed5c774d92f | db6b38329b2046199f6bbe0f83a74ad72367bd8d | refs/heads/master | 2020-12-31T07:19:49.457242 | 2014-05-04T14:23:19 | 2014-05-04T14:23:19 | 55,958,944 | 0 | 0 | null | null | null | null | ISO-8859-1 | Java | false | false | 3,031 | java | package oc.wh40k.units.cm;
import oc.BuildaHQ;
import oc.Eintrag;
import oc.OptionsEinzelUpgrade;
import oc.OptionsGruppeEintrag;
import oc.OptionsUpgradeGruppe;
import oc.RuestkammerStarter;
public class CMDaemonenprinz extends Eintrag {
OptionsEinzelUpgrade o1;
OptionsEinzelUpgrade o2;
OptionsUpgradeGruppe mal;
OptionsUpgradeGruppe psi;
RuestkammerStarter chaosBelohnungen;
RuestkammerStarter waffenUndArtefakte;
public CMDaemonenprinz() {
name = "Dämonenprinz";
grundkosten = 145;
add(ico = new oc.Picture("oc/wh40k/images/DaemonPrince.gif"));
seperator();
add(o1 = new OptionsEinzelUpgrade(ID, randAbstand, cnt, "", "Flügel", 40));
add(o2 = new OptionsEinzelUpgrade(ID, randAbstand, cnt, "", "Servorüstung", 20));
seperator();
ogE.addElement(new OptionsGruppeEintrag("Dämon des Khorne", 15));
ogE.addElement(new OptionsGruppeEintrag("Dämon des Tzeentch", 15));
ogE.addElement(new OptionsGruppeEintrag("Dämon des Nurgle", 15));
ogE.addElement(new OptionsGruppeEintrag("Dämon des Slaanesh", 10));
add(mal = new OptionsUpgradeGruppe(ID, randAbstand, cnt, "", ogE, 1));
seperator();
ogE.addElement(new OptionsGruppeEintrag("Meisterschaftsgrad 1", 25));
ogE.addElement(new OptionsGruppeEintrag("Meisterschaftsgrad 2", 50));
ogE.addElement(new OptionsGruppeEintrag("Meisterschaftsgrad 3", 75));
add(psi = new OptionsUpgradeGruppe(ID, randAbstand, cnt, "", ogE, 1));
seperator();
chaosBelohnungen = new RuestkammerStarter(ID, randAbstand, cnt, "CMChaosbelohnungen", "");
chaosBelohnungen.initKammer(mal.isSelected("Dämon des Khorne"), mal.isSelected("Dämon des Tzeentch"), mal.isSelected("Dämon des Nurgle"), mal.isSelected("Dämon des Slaanesh"), false,true);
chaosBelohnungen.setButtonText(BuildaHQ.translate("Gaben des Chaos"));
add(chaosBelohnungen);
seperator();
waffenUndArtefakte = new RuestkammerStarter(ID, randAbstand, cnt, "CMWaffenUndArtefakte", "");
// General, Hexer, Warpschmied, Apostel, Daemon
waffenUndArtefakte.initKammer(false, false, false, false, true);
waffenUndArtefakte.setButtonText(BuildaHQ.translate("Waffen & Artefakte"));
add(waffenUndArtefakte);
waffenUndArtefakte.setAbwaehlbar(false);
complete();
}
@Override
public void refreshen() {
if(mal.getAnzahl() < 1) {
mal.setLegal(false);
setFehlermeldung("Wähle einen Gott");
} else {
mal.setLegal(true);
setFehlermeldung("");
}
if (mal.isSelected("Dämon des Khorne")) {
psi.setAktiv(false);
} else {
psi.setAktiv(true);
}
//waffenUndArtefakte.getKammer().switchEntry("Axt der blinden Wut", mal.isSelected("Dämon des Khorne"));
//waffenUndArtefakte.getKammer().switchEntry("Schriftrollen des Magnus", mal.isSelected("Dämon des Tzeentch"));
if(((CMWaffenUndArtefakte)waffenUndArtefakte.getKammer()).uniqueError){
setFehlermeldung("Artefakt doppelt!");
} else{
setFehlermeldung("");
}
}
}
| [
"spacecooky@b551ab73-3a01-0010-9fae-47f737f7a8aa"
] | spacecooky@b551ab73-3a01-0010-9fae-47f737f7a8aa |
63a004c2ec824adf8f0f3d5424731bcdf6284456 | 3f605d058523f0b1e51f6557ed3c7663d5fa31d6 | /core/org.ebayopensource.vjet.core.jst/src/org/ebayopensource/dsf/jst/declaration/JstBlock.java | 64f17b694c77830e8b69bb0c7a4347be3c7d8467 | [] | no_license | vjetteam/vjet | 47e21a13978cd860f1faf5b0c2379e321a9b688c | ba90843b89dc40d7a7eb289cdf64e127ec548d1d | refs/heads/master | 2020-12-25T11:05:55.420303 | 2012-08-07T21:56:30 | 2012-08-07T21:56:30 | 3,181,492 | 3 | 1 | null | null | null | null | UTF-8 | Java | false | false | 2,166 | java | /*******************************************************************************
* Copyright (c) 2005-2011 eBay Inc.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*
*******************************************************************************/
package org.ebayopensource.dsf.jst.declaration;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import org.ebayopensource.dsf.jst.BaseJstNode;
import org.ebayopensource.dsf.jst.token.IStmt;
import org.ebayopensource.dsf.jst.traversal.IJstNodeVisitor;
public class JstBlock extends BaseJstNode {
private static final long serialVersionUID = 1L;
private List<IStmt> m_stmts;
protected VarTable m_varTable;
public JstBlock() {
// TODO Auto-generated constructor stub
}
//
// API
//
public JstBlock addStmt(int index, final IStmt stmt){
if (stmt == null){
return this;
}
if (m_stmts == null){
m_stmts = new ArrayList<IStmt>(5);
}
m_stmts.add(index, stmt);
addChild((BaseJstNode)stmt);
return this;
}
public JstBlock addStmt(final IStmt stmt){
if (stmt == null){
return this;
}
if (m_stmts == null){
m_stmts = new ArrayList<IStmt>(5);
}
m_stmts.add(stmt);
addChild((BaseJstNode)stmt);
return this;
}
public List<IStmt> getStmts(){
if (m_stmts == null){
return Collections.emptyList();
}
return Collections.unmodifiableList(m_stmts);
}
public VarTable getVarTable(){
if (m_varTable == null){
m_varTable = new VarTable();
}
return m_varTable;
}
public String toBlockText(){
StringBuilder sb = new StringBuilder("{");
for (IStmt stmt: getStmts()){
sb.append("\n").append(stmt.toStmtText());
}
sb.append("\n}");
return sb.toString();
}
@Override
public void accept(IJstNodeVisitor visitor){
visitor.visit(this);
}
@Override
public String toString(){
return toBlockText();
}
}
| [
"pwang@27f4aac7-f869-4a38-a8c2-f1a995e726e6"
] | pwang@27f4aac7-f869-4a38-a8c2-f1a995e726e6 |
d272034dbb99ed9bc793e8e7466b046abf1c60cc | 28e83c89cb21035762ad57c0a6c0edda49db8bd8 | /4.JavaCollections/src/com/javarush/task/task32/task3203/Solution.java | 17b5eb9b02789fc24cc34b0b31ab0031d0ce54c0 | [] | no_license | serggrp/JRT | b85a179176babffc6ae1649c07eab00c3b65a773 | f7a5cc3fc3fb538394572a6986a74782e73aeb44 | refs/heads/master | 2023-02-15T15:10:42.278785 | 2021-01-12T21:13:55 | 2021-01-12T21:13:55 | 329,107,716 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 526 | java | package com.javarush.task.task32.task3203;
import java.io.PrintWriter;
import java.io.StringWriter;
/*
Пишем стек-трейс
*/
public class Solution {
public static void main(String[] args) {
String text = getStackTrace(new IndexOutOfBoundsException("fff"));
System.out.println(text);
}
public static String getStackTrace(Throwable throwable) {
StringWriter sw = new StringWriter();
throwable.printStackTrace(new PrintWriter(sw));
return sw.toString();
}
} | [
"sergie92@yandex.ru"
] | sergie92@yandex.ru |
76eacbe74e7c884fe2cfdaeec1fb0ee878d897a1 | 402fd2cb77fe5e4f77a8c8ffe12c2debae552fad | /app/src/main/java/com/louis/agricultural/presenter/MyOrderFragmentPresenter.java | cbcdec24546cc9263bd20aa217041f6cf2b9d23c | [] | no_license | himon/FengYouAgricultural | eea55f74cc1bb341e23ded90c3b217f789f85767 | 9fb0656d2fb7e8fca0709f4d2383c0efd7768fb7 | refs/heads/master | 2021-01-21T00:53:01.334403 | 2016-08-23T02:11:23 | 2016-08-23T02:11:23 | 50,173,076 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,711 | java | package com.louis.agricultural.presenter;
import android.support.v4.app.Fragment;
import com.louis.agricultural.base.app.Constants;
import com.louis.agricultural.base.presenter.UserLosePresenter;
import com.louis.agricultural.callback.UserLoseMultiLoadedListener;
import com.louis.agricultural.model.entities.BaseEntity;
import com.louis.agricultural.model.entities.OrderEntity;
import com.louis.agricultural.model.mode.MyOrderFragmentMode;
import com.louis.agricultural.model.mode.impl.MyOrderFragmentModeImpl;
import com.louis.agricultural.ui.fragment.MyOrderFragment;
import com.louis.agricultural.ui.view.IMyOrderView;
/**
* Created by lc on 16/3/10.
*/
public class MyOrderFragmentPresenter extends UserLosePresenter<IMyOrderView> implements UserLoseMultiLoadedListener<BaseEntity> {
private IMyOrderView mIMyOrderView;
private MyOrderFragmentMode mMyOrderFragmentMode;
public MyOrderFragmentPresenter(IMyOrderView view) {
mIMyOrderView = view;
mMyOrderFragmentMode = new MyOrderFragmentModeImpl((Fragment) view);
}
@Override
public void onSuccess(int event_tag, BaseEntity data) {
switch (event_tag){
case Constants.GET_ORDER_LIST_LISTENER:
mIMyOrderView.setData((OrderEntity)data);
break;
}
}
/**
* 查看个人商品订单
* @param user_id
* @param page
* @param status
* @param payment_status
* @param express_status
*/
public void getOrderList(String user_id, int page, String status, String payment_status, String express_status) {
mMyOrderFragmentMode.getOrderList(user_id, page, status, payment_status, express_status, this);
}
}
| [
"258798596@qq.com"
] | 258798596@qq.com |
d3b41284e7867e897cb5b5eaf5b7cfe02423030e | 3facc04d3b918e01dcbefbc29f1696adbe260cde | /pattern-learning/src/main/java/com/comenie/pattern/structural/facade/package-info.java | 14929a15b7b7afd9b72602079deb1c0649c7f371 | [] | no_license | comeNie/training | 1d9012658f084b84cdb5cdad9d42866bf314167d | a64977f1d47d417f43d8e656e4692c1101c54246 | refs/heads/master | 2021-01-11T22:53:29.016070 | 2017-04-09T06:31:52 | 2017-04-09T06:31:52 | 78,517,724 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,048 | java | /**
* Created by 波 on 2017/2/4.
*/
package com.comenie.pattern.structural.facade;
/**
* 外观模式:为子系统中的一组接口提供一个统一的入口。外观模式定义
* 了一个高层接口,这个接口使得这一子系统更加容易使用。
*
* Facade(外观角色):在客户端可以调用它的方法,在外观角色中可以知道相关的(一个
* 或者多个)子系统的功能和责任;在正常情况下,它将所有从客户端发来的请求委派到相应
* 的子系统去,传递给相应的子系统对象处理。
*
* SubSystem(子系统角色):在软件系统中可以有一个或者多个子系统角色,每一个子系统
* 可以不是一个单独的类,而是一个类的集合,它实现子系统的功能;每一个子系统都可以被
* 客户端直接调用,或者被外观角色调用,它处理由外观类传过来的请求;子系统并不知道外
* 观的存在,对于子系统而言,外观角色仅仅是另外一个客户端而已。
*
*/
| [
"123456"
] | 123456 |
86984e8a909f9dbd74199302634c11d7b691e93b | 9254e7279570ac8ef687c416a79bb472146e9b35 | /mseap-20210118/src/main/java/com/aliyun/mseap20210118/models/DescribeAgreementStatusResponseBody.java | f302fa42ab5b472c4bd6ab538575dea7873ddd91 | [
"Apache-2.0"
] | permissive | lquterqtd/alibabacloud-java-sdk | 3eaa17276dd28004dae6f87e763e13eb90c30032 | 3e5dca8c36398469e10cdaaa34c314ae0bb640b4 | refs/heads/master | 2023-08-12T13:56:26.379027 | 2021-10-19T07:22:15 | 2021-10-19T07:22:15 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,528 | java | // This file is auto-generated, don't edit it. Thanks.
package com.aliyun.mseap20210118.models;
import com.aliyun.tea.*;
public class DescribeAgreementStatusResponseBody extends TeaModel {
@NameInMap("Status")
public Integer status;
@NameInMap("RequestId")
public String requestId;
@NameInMap("UserId")
public String userId;
@NameInMap("AgreementCode")
public String agreementCode;
public static DescribeAgreementStatusResponseBody build(java.util.Map<String, ?> map) throws Exception {
DescribeAgreementStatusResponseBody self = new DescribeAgreementStatusResponseBody();
return TeaModel.build(map, self);
}
public DescribeAgreementStatusResponseBody setStatus(Integer status) {
this.status = status;
return this;
}
public Integer getStatus() {
return this.status;
}
public DescribeAgreementStatusResponseBody setRequestId(String requestId) {
this.requestId = requestId;
return this;
}
public String getRequestId() {
return this.requestId;
}
public DescribeAgreementStatusResponseBody setUserId(String userId) {
this.userId = userId;
return this;
}
public String getUserId() {
return this.userId;
}
public DescribeAgreementStatusResponseBody setAgreementCode(String agreementCode) {
this.agreementCode = agreementCode;
return this;
}
public String getAgreementCode() {
return this.agreementCode;
}
}
| [
"sdk-team@alibabacloud.com"
] | sdk-team@alibabacloud.com |
83e1da8ca29fe08155e70e240f91bb32eabe77ed | a5daeb7821275ef443ed0f9c2a68756bb92a9192 | /Homeworks/Rachit_Shukla/SpaceInfo/app/src/main/java/rs21/spaceinfo/FragDetailPlanet.java | cd2b99c3553b3b5e15d3055422633a9c9faadf20 | [] | no_license | rambabu20312/NoidaAndroidSummer2018 | fd497345dc3a918ff02ad3a30f741a01f61e7f9a | 62c638dc5d99738e33424625d728cbd866a0e759 | refs/heads/master | 2021-09-21T22:39:28.648331 | 2018-09-02T06:22:57 | 2018-09-02T06:22:57 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,164 | java | package rs21.spaceinfo;
import android.os.Bundle;
import android.support.v4.app.Fragment;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.webkit.WebView;
import android.webkit.WebViewClient;
public class FragDetailPlanet extends Fragment{
public static FragDetailPlanet newInstance(Planets a) {
Bundle args = new Bundle();
args.putParcelable("Current", a);
FragDetailPlanet fragment = new FragDetailPlanet();
fragment.setArguments(args);
return fragment;
}
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,
Bundle savedInstanceState) {
Bundle bundle = getArguments();
Planets data = (Planets) bundle.getParcelable("Current");
View view = inflater.inflate(R.layout.frag_detail, container, false);
WebView v = view.findViewById(R.id.wiki);
v.getSettings().setJavaScriptEnabled(true);
v.getSettings().setAppCacheEnabled(true);
v.loadUrl(data.getUrl());
v.setWebViewClient(new WebViewClient());
return view;
}
}
| [
"harshithdwivedi@gmail.com"
] | harshithdwivedi@gmail.com |
7606dd781eb39815c185b025bd6a0a3a797baac9 | 56ac314fe3a9360a16a5833217bca1f47596e1bc | /CDIDynamicProducer/src/main/java/some/beans/DynamicIntegerProducer.java | 0b199ccb519b9aaa5238d9b0e61ce0ded5c2aae5 | [] | no_license | cybernetics/JSF-2.x | 083a34f60df58f82178fae733baf34303cefc6f2 | 5022f3b7f215a8a723f7c75fbfedfd85cd22c9f7 | refs/heads/master | 2021-01-21T08:12:15.937061 | 2016-03-07T08:25:37 | 2016-03-07T08:25:37 | 53,640,187 | 1 | 0 | null | 2016-03-11T04:44:37 | 2016-03-11T04:44:37 | null | UTF-8 | Java | false | false | 2,181 | java | package some.beans;
import java.lang.annotation.Annotation;
import java.lang.reflect.Type;
import static java.util.Arrays.asList;
import static java.util.Collections.emptySet;
import static java.util.Collections.singleton;
import java.util.HashSet;
import java.util.Random;
import java.util.Set;
import javax.enterprise.context.Dependent;
import javax.enterprise.context.spi.CreationalContext;
import javax.enterprise.inject.Default;
import javax.enterprise.inject.spi.Bean;
import javax.enterprise.inject.spi.InjectionPoint;
import javax.enterprise.util.AnnotationLiteral;
import org.omnifaces.util.Beans;
public class DynamicIntegerProducer implements Bean<Integer> {
@SuppressWarnings("all")
public static class DefaultAnnotationLiteral extends AnnotationLiteral<Default> implements Default {
private static final long serialVersionUID = 1L;
}
@Override
public Class<?> getBeanClass() {
return Integer.class;
}
@Override
public Set<Type> getTypes() {
return new HashSet<>(asList(Integer.class, Object.class));
}
@Override
public Integer create(CreationalContext<Integer> creationalContext) {
InjectionPoint injectionPoint = Beans.getCurrentInjectionPoint(creationalContext);
System.out.println("Current Injection Point: " + injectionPoint);
return new Random().nextInt(1000);
}
@Override
public Set<Annotation> getQualifiers() {
return singleton((Annotation) new DefaultAnnotationLiteral());
}
@Override
public Class<? extends Annotation> getScope() {
return Dependent.class;
}
@Override
public Set<Class<? extends Annotation>> getStereotypes() {
return emptySet();
}
@Override
public Set<InjectionPoint> getInjectionPoints() {
return emptySet();
}
@Override
public boolean isAlternative() {
return false;
}
@Override
public boolean isNullable() {
return false;
}
@Override
public String getName() {
return null;
}
@Override
public void destroy(Integer instance, CreationalContext<Integer> creationalContext) {
}
}
| [
"leoprivacy@yahoo.com"
] | leoprivacy@yahoo.com |
043a89c67e03e5777a946e3bac84ed4773eceef8 | ffe0ea2a467e12ce661497150692faa9758225f7 | /VRShow/app/okhttputils/src/main/java/com/hch/filedownloader/FileDownloadDriver.java | 98c6d617adf45ad2b5474a53eb8818ca79d91f93 | [] | no_license | changjigang52084/Mark-s-Project | cc1be3e3e4d2b5d0d7d48b8decbdb0c054b742b7 | 8e82a8c3b1d75d00a70cf54838f3a91411ff1d16 | refs/heads/master | 2022-12-31T01:21:42.822825 | 2020-10-13T10:24:58 | 2020-10-13T10:24:58 | 303,652,140 | 1 | 1 | null | null | null | null | UTF-8 | Java | false | false | 5,991 | java | /*
* Copyright (c) 2015 LingoChamp 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 com.hch.filedownloader;
import com.hch.filedownloader.util.FileDownloadLog;
/**
* Created by Jacksgong on 12/21/15.
*/
class FileDownloadDriver implements IFileDownloadMessage {
private final BaseDownloadTask download;
FileDownloadDriver(final BaseDownloadTask download) {
this.download = download;
}
// Start state, from FileDownloadList, to addEventListener ---------------
@Override
public void notifyStarted() {
if (FileDownloadLog.NEED_LOG) {
FileDownloadLog.d(this, "notify started %s", download);
}
download.begin();
}
// in-between state, from BaseDownloadTask#update, to user ---------------------------
@Override
public void notifyPending() {
if (FileDownloadLog.NEED_LOG) {
FileDownloadLog.d(this, "notify pending %s", download);
}
download.ing();
final FileDownloadEvent event = download.getIngEvent().pending();
if (download.isSyncCallback()) {
FileDownloadEventPool.getImpl().publish(event);
} else {
FileDownloadEventPool.getImpl().send2UIThread(event);
}
}
@Override
public void notifyConnected() {
if (FileDownloadLog.NEED_LOG) {
FileDownloadLog.d(this, "notify connected %s", download);
}
download.ing();
final FileDownloadEvent event = download.getIngEvent().connected();
if (download.isSyncCallback()) {
FileDownloadEventPool.getImpl().publish(event);
} else {
FileDownloadEventPool.getImpl().send2UIThread(event);
}
}
@Override
public void notifyProgress() {
if (FileDownloadLog.NEED_LOG) {
FileDownloadLog.d(this, "notify progress %s %d %d",
download, download.getLargeFileSoFarBytes(), download.getLargeFileTotalBytes());
}
if (download.getCallbackProgressTimes() <= 0) {
if (FileDownloadLog.NEED_LOG) {
FileDownloadLog.d(this, "notify progress but client not request notify %s", download);
}
return;
}
download.ing();
final FileDownloadEvent event = download.getIngEvent().progress();
if (download.isSyncCallback()) {
FileDownloadEventPool.getImpl().publish(event);
} else {
FileDownloadEventPool.getImpl().send2UIThread(event);
}
}
/**
* sync
*/
@Override
public void notifyBlockComplete() {
if (FileDownloadLog.NEED_LOG) {
FileDownloadLog.d(this, "notify block completed %s %s", download, Thread.currentThread().getName());
}
download.ing();
FileDownloadEventPool.getImpl().publish(download.getIngEvent()
.blockComplete());
}
@Override
public void notifyRetry() {
if (FileDownloadLog.NEED_LOG) {
FileDownloadLog.d(this, "notify retry %s %d %d %s", download,
download.getAutoRetryTimes(), download.getRetryingTimes(), download.getEx());
}
download.ing();
final FileDownloadEvent event = download.getIngEvent().retry();
if (download.isSyncCallback()) {
FileDownloadEventPool.getImpl().publish(event);
} else {
FileDownloadEventPool.getImpl().send2UIThread(event);
}
}
// Over state, from FileDownloadList, to user -----------------------------
@Override
public void notifyWarn() {
if (FileDownloadLog.NEED_LOG) {
FileDownloadLog.d(this, "notify warn %s", download);
}
download.over();
final FileDownloadEvent event = download.getOverEvent().warn();
if (download.isSyncCallback()) {
FileDownloadEventPool.getImpl().publish(event);
} else {
FileDownloadEventPool.getImpl().send2UIThread(event);
}
}
@Override
public void notifyError() {
if (FileDownloadLog.NEED_LOG) {
FileDownloadLog.d(this, "notify error %s %s", download, download.getEx());
}
download.over();
final FileDownloadEvent event = download.getOverEvent().error();
if (download.isSyncCallback()) {
FileDownloadEventPool.getImpl().publish(event);
} else {
FileDownloadEventPool.getImpl().send2UIThread(event);
}
}
@Override
public void notifyPaused() {
if (FileDownloadLog.NEED_LOG) {
FileDownloadLog.d(this, "notify paused %s", download);
}
download.over();
final FileDownloadEvent event = download.getOverEvent().pause();
if (download.isSyncCallback()) {
FileDownloadEventPool.getImpl().publish(event);
} else {
FileDownloadEventPool.getImpl().send2UIThread(event);
}
}
@Override
public void notifyCompleted() {
if (FileDownloadLog.NEED_LOG) {
FileDownloadLog.d(this, "notify completed %s", download);
}
download.over();
final FileDownloadEvent event = download.getOverEvent().complete();
if (download.isSyncCallback()) {
FileDownloadEventPool.getImpl().publish(event);
} else {
FileDownloadEventPool.getImpl().send2UIThread(event);
}
}
}
| [
"451861975@qq.com"
] | 451861975@qq.com |
d61d55b57103a5bff908891e91c2f7403896b272 | 8b94813f0c262c01b91b6835b503dc80772fdcc4 | /oap-server/server-storage-plugin/storage-elasticsearch-plugin/src/main/java/org/apache/skywalking/oap/server/storage/plugin/elasticsearch/base/HistoryDeleteEsDAO.java | 44c6fdd71609618d71c69cc2618d1a5005e80cec | [
"Apache-2.0",
"BSD-3-Clause",
"MIT"
] | permissive | XhangUeiJong/skywalking | 868d22873dda1c56d51c39d2e1be1472dd38db55 | 01a3cb410eeadf07015a62b7216c2d69d7858526 | refs/heads/master | 2020-05-29T21:51:43.638497 | 2019-06-18T09:26:31 | 2019-06-18T09:26:31 | 189,395,105 | 2 | 0 | Apache-2.0 | 2019-05-30T10:36:51 | 2019-05-30T10:36:51 | null | UTF-8 | Java | false | false | 1,843 | java | /*
* 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.
*
*/
package org.apache.skywalking.oap.server.storage.plugin.elasticsearch.base;
import java.io.IOException;
import org.apache.skywalking.oap.server.core.storage.IHistoryDeleteDAO;
import org.apache.skywalking.oap.server.library.client.elasticsearch.ElasticSearchClient;
import org.slf4j.*;
/**
* @author peng-yongsheng
*/
public class HistoryDeleteEsDAO extends EsDAO implements IHistoryDeleteDAO {
private static final Logger logger = LoggerFactory.getLogger(HistoryDeleteEsDAO.class);
public HistoryDeleteEsDAO(ElasticSearchClient client) {
super(client);
}
@Override
public void deleteHistory(String modelName, String timeBucketColumnName, Long timeBucketBefore) throws IOException {
ElasticSearchClient client = getClient();
int statusCode = client.delete(modelName, timeBucketColumnName, timeBucketBefore);
if (logger.isDebugEnabled()) {
logger.debug("Delete history from {} index, status code {}", client.formatIndexName(modelName), statusCode);
}
}
}
| [
"wu.sheng@foxmail.com"
] | wu.sheng@foxmail.com |
b796f2e0127d325f609289549d9c29454f403a88 | 95d20c83d8aff34e314c56a3ecb2b87c9fa9fc86 | /Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/gui/colors/DebuggerTrackedRegisterBackgroundColorModel.java | ca2b691d155fde4f1412589fa61ae277184230e0 | [
"GPL-1.0-or-later",
"GPL-3.0-only",
"Apache-2.0",
"LicenseRef-scancode-public-domain",
"LGPL-2.1-only",
"LicenseRef-scancode-unknown-license-reference"
] | permissive | NationalSecurityAgency/ghidra | 969fe0d2ca25cb8ac72f66f0f90fc7fb2dbfa68d | 7cc135eb6bfabd166cbc23f7951dae09a7e03c39 | refs/heads/master | 2023-08-31T21:20:23.376055 | 2023-08-29T23:08:54 | 2023-08-29T23:08:54 | 173,228,436 | 45,212 | 6,204 | Apache-2.0 | 2023-09-14T18:00:39 | 2019-03-01T03:27:48 | Java | UTF-8 | Java | false | false | 2,046 | java | /* ###
* IP: GHIDRA
*
* 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 ghidra.app.plugin.core.debug.gui.colors;
import java.awt.Color;
import java.math.BigInteger;
import docking.widgets.fieldpanel.support.BackgroundColorModel;
import ghidra.app.plugin.core.debug.gui.DebuggerResources;
import ghidra.app.util.viewer.util.AddressIndexMap;
import ghidra.program.model.address.Address;
import ghidra.program.model.listing.Program;
import ghidra.program.util.ProgramLocation;
public abstract class DebuggerTrackedRegisterBackgroundColorModel implements BackgroundColorModel {
protected Color defaultBackgroundColor;
protected Program program;
protected AddressIndexMap addressIndexMap;
private final Color trackingColor = DebuggerResources.COLOR_REGISTER_MARKERS;
/**
* Get the location which is to be highlighted as "tracked."
*
* @return the location
*/
protected abstract ProgramLocation getTrackedLocation();
@Override
public Color getBackgroundColor(BigInteger index) {
if (addressIndexMap == null) {
return defaultBackgroundColor;
}
ProgramLocation loc = getTrackedLocation();
if (loc == null) {
return defaultBackgroundColor;
}
Address address = addressIndexMap.getAddress(index);
if (!loc.getAddress().equals(address)) {
return defaultBackgroundColor;
}
return trackingColor;
}
@Override
public Color getDefaultBackgroundColor() {
return defaultBackgroundColor;
}
@Override
public void setDefaultBackgroundColor(Color c) {
defaultBackgroundColor = c;
}
}
| [
"46821332+nsadeveloper789@users.noreply.github.com"
] | 46821332+nsadeveloper789@users.noreply.github.com |
dda81670778330b5b93601852dc1f506ddfc2fe7 | 9b6e669381193a97728001e9de0ccdc15ff4d892 | /playerkit/src/main/java/com/netease/neliveplayer/playerkit/sdk/constant/DecryptionConfigCode.java | 50394f115aa25c8da1b8cdab371f1ab9b3686572 | [] | no_license | 13525846841/ConSonP | 94d0e14a67a0930ac65aacfae668ab6820287650 | 2a469de7b0e8c7547cbff23b88e0e036683a3bc6 | refs/heads/master | 2020-05-22T07:26:40.576191 | 2019-06-05T09:56:35 | 2019-06-05T09:56:35 | 186,260,855 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 422 | java | package com.netease.neliveplayer.playerkit.sdk.constant;
/**
* 解密选项
* 只适用于点播
*/
public interface DecryptionConfigCode {
/**
* 不需要对视频进行解密
*/
int CODE_Decryptio_NONE = 0;
/**
* 使用解密信息对视频进行解密
*/
int CODE_DECRYPTIO_INFO = 1;
/**
* 解密秘钥对视频进行解密
*/
int CODE_DECRYPTIO_KEY = 2;
}
| [
"2965378806"
] | 2965378806 |
75c765b6d311bd5c5fdd10dc8ebaaaa702931920 | 3a59bd4f3c7841a60444bb5af6c859dd2fe7b355 | /sources/com/google/android/gms/internal/ads/zzdhp.java | d103d1d84d7591ea446db8edc0957a5187c8deaa | [] | no_license | sengeiou/KnowAndGo-android-thunkable | 65ac6882af9b52aac4f5a4999e095eaae4da3c7f | 39e809d0bbbe9a743253bed99b8209679ad449c9 | refs/heads/master | 2023-01-01T02:20:01.680570 | 2020-10-22T04:35:27 | 2020-10-22T04:35:27 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,630 | java | package com.google.android.gms.internal.ads;
import com.google.android.gms.internal.ads.zzdob;
final /* synthetic */ class zzdhp {
static final /* synthetic */ int[] zzdi = new int[zzdob.zze.zzayb().length];
/* JADX WARNING: Can't wrap try/catch for region: R(16:0|1|2|3|4|5|6|7|8|9|10|11|12|13|14|16) */
/* JADX WARNING: Code restructure failed: missing block: B:17:?, code lost:
return;
*/
/* JADX WARNING: Failed to process nested try/catch */
/* JADX WARNING: Missing exception handler attribute for start block: B:11:0x0031 */
/* JADX WARNING: Missing exception handler attribute for start block: B:13:0x0039 */
/* JADX WARNING: Missing exception handler attribute for start block: B:3:0x0011 */
/* JADX WARNING: Missing exception handler attribute for start block: B:5:0x0019 */
/* JADX WARNING: Missing exception handler attribute for start block: B:7:0x0021 */
/* JADX WARNING: Missing exception handler attribute for start block: B:9:0x0029 */
static {
/*
int[] r0 = com.google.android.gms.internal.ads.zzdob.zze.zzayb()
int r0 = r0.length
int[] r0 = new int[r0]
zzdi = r0
r0 = 1
int[] r1 = zzdi // Catch:{ NoSuchFieldError -> 0x0011 }
int r2 = com.google.android.gms.internal.ads.zzdob.zze.zzhhn // Catch:{ NoSuchFieldError -> 0x0011 }
int r2 = r2 - r0
r1[r2] = r0 // Catch:{ NoSuchFieldError -> 0x0011 }
L_0x0011:
int[] r1 = zzdi // Catch:{ NoSuchFieldError -> 0x0019 }
int r2 = com.google.android.gms.internal.ads.zzdob.zze.zzhho // Catch:{ NoSuchFieldError -> 0x0019 }
int r2 = r2 - r0
r3 = 2
r1[r2] = r3 // Catch:{ NoSuchFieldError -> 0x0019 }
L_0x0019:
int[] r1 = zzdi // Catch:{ NoSuchFieldError -> 0x0021 }
int r2 = com.google.android.gms.internal.ads.zzdob.zze.zzhhm // Catch:{ NoSuchFieldError -> 0x0021 }
int r2 = r2 - r0
r3 = 3
r1[r2] = r3 // Catch:{ NoSuchFieldError -> 0x0021 }
L_0x0021:
int[] r1 = zzdi // Catch:{ NoSuchFieldError -> 0x0029 }
int r2 = com.google.android.gms.internal.ads.zzdob.zze.zzhhp // Catch:{ NoSuchFieldError -> 0x0029 }
int r2 = r2 - r0
r3 = 4
r1[r2] = r3 // Catch:{ NoSuchFieldError -> 0x0029 }
L_0x0029:
int[] r1 = zzdi // Catch:{ NoSuchFieldError -> 0x0031 }
int r2 = com.google.android.gms.internal.ads.zzdob.zze.zzhhq // Catch:{ NoSuchFieldError -> 0x0031 }
int r2 = r2 - r0
r3 = 5
r1[r2] = r3 // Catch:{ NoSuchFieldError -> 0x0031 }
L_0x0031:
int[] r1 = zzdi // Catch:{ NoSuchFieldError -> 0x0039 }
int r2 = com.google.android.gms.internal.ads.zzdob.zze.zzhhk // Catch:{ NoSuchFieldError -> 0x0039 }
int r2 = r2 - r0
r3 = 6
r1[r2] = r3 // Catch:{ NoSuchFieldError -> 0x0039 }
L_0x0039:
int[] r1 = zzdi // Catch:{ NoSuchFieldError -> 0x0041 }
int r2 = com.google.android.gms.internal.ads.zzdob.zze.zzhhl // Catch:{ NoSuchFieldError -> 0x0041 }
int r2 = r2 - r0
r0 = 7
r1[r2] = r0 // Catch:{ NoSuchFieldError -> 0x0041 }
L_0x0041:
return
*/
throw new UnsupportedOperationException("Method not decompiled: com.google.android.gms.internal.ads.zzdhp.<clinit>():void");
}
}
| [
"joshuahj.tsao@gmail.com"
] | joshuahj.tsao@gmail.com |
21a2b295f12d0dfd5be7a9b02db729b78d778ed2 | c3381ece1e660f2d626480152349262a511aefb5 | /icefrog-core/src/main/java/com/whaleal/icefrog/core/map/CamelCaseMap.java | b2e471a95091167b0ee1c06975d7b2074ea8df2f | [
"Apache-2.0"
] | permissive | whaleal/icefrog | 775e02be5b2fc8d04df1dd490aa765232cb0e6a4 | c8dc384a3de1ed17077ff61ba733b1e2f37e32ab | refs/heads/v1-dev | 2022-07-27T01:27:52.624849 | 2022-06-20T13:38:12 | 2022-06-20T13:38:12 | 414,203,703 | 9 | 5 | Apache-2.0 | 2022-06-20T14:08:57 | 2021-10-06T12:30:31 | Java | UTF-8 | Java | false | false | 2,004 | java | package com.whaleal.icefrog.core.map;
import com.whaleal.icefrog.core.util.StrUtil;
import java.util.HashMap;
import java.util.Map;
/**
* 驼峰Key风格的Map<br>
* 对KEY转换为驼峰,get("int_value")和get("intValue")获得的值相同,put进入的值也会被覆盖
*
* @param <K> 键类型
* @param <V> 值类型
* @author Looly
* @author wh
* @since 1.0.0
*/
public class CamelCaseMap<K, V> extends CustomKeyMap<K, V> {
private static final long serialVersionUID = 4043263744224569870L;
// ------------------------------------------------------------------------- Constructor start
/**
* 构造
*/
public CamelCaseMap() {
this(DEFAULT_INITIAL_CAPACITY);
}
/**
* 构造
*
* @param initialCapacity 初始大小
*/
public CamelCaseMap( int initialCapacity ) {
this(initialCapacity, DEFAULT_LOAD_FACTOR);
}
/**
* 构造
*
* @param m Map
*/
public CamelCaseMap( Map<? extends K, ? extends V> m ) {
this(DEFAULT_LOAD_FACTOR, m);
}
/**
* 构造
*
* @param loadFactor 加载因子
* @param m Map
*/
public CamelCaseMap( float loadFactor, Map<? extends K, ? extends V> m ) {
this(m.size(), loadFactor);
this.putAll(m);
}
/**
* 构造
*
* @param initialCapacity 初始大小
* @param loadFactor 加载因子
*/
public CamelCaseMap( int initialCapacity, float loadFactor ) {
super(new HashMap<>(initialCapacity, loadFactor));
}
// ------------------------------------------------------------------------- Constructor end
/**
* 将Key转为驼峰风格,如果key为字符串的话
*
* @param key KEY
* @return 驼峰Key
*/
@Override
protected Object customKey( Object key ) {
if (key instanceof CharSequence) {
key = StrUtil.toCamelCase(key.toString());
}
return key;
}
}
| [
"hbn.king@gmail.com"
] | hbn.king@gmail.com |
4c82d1176fbfc61624ab71e14f6fa3fb15a25f62 | fa93c9be2923e697fb8a2066f8fb65c7718cdec7 | /sources/com/google/android/exoplayer2/trackselection/TrackSelectorResult.java | 8149df0f612bd00f2d67e844b20b8558e99462bc | [] | no_license | Auch-Auch/avito_source | b6c9f4b0e5c977b36d5fbc88c52f23ff908b7f8b | 76fdcc5b7e036c57ecc193e790b0582481768cdc | refs/heads/master | 2023-05-06T01:32:43.014668 | 2021-05-25T10:19:22 | 2021-05-25T10:19:22 | 370,650,685 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,704 | java | package com.google.android.exoplayer2.trackselection;
import androidx.annotation.Nullable;
import com.google.android.exoplayer2.RendererConfiguration;
import com.google.android.exoplayer2.util.Util;
public final class TrackSelectorResult {
@Nullable
public final Object info;
public final int length;
public final RendererConfiguration[] rendererConfigurations;
public final TrackSelectionArray selections;
public TrackSelectorResult(RendererConfiguration[] rendererConfigurationArr, TrackSelection[] trackSelectionArr, @Nullable Object obj) {
this.rendererConfigurations = rendererConfigurationArr;
this.selections = new TrackSelectionArray(trackSelectionArr);
this.info = obj;
this.length = rendererConfigurationArr.length;
}
public boolean isEquivalent(@Nullable TrackSelectorResult trackSelectorResult) {
if (trackSelectorResult == null || trackSelectorResult.selections.length != this.selections.length) {
return false;
}
for (int i = 0; i < this.selections.length; i++) {
if (!isEquivalent(trackSelectorResult, i)) {
return false;
}
}
return true;
}
public boolean isRendererEnabled(int i) {
return this.rendererConfigurations[i] != null;
}
public boolean isEquivalent(@Nullable TrackSelectorResult trackSelectorResult, int i) {
if (trackSelectorResult != null && Util.areEqual(this.rendererConfigurations[i], trackSelectorResult.rendererConfigurations[i]) && Util.areEqual(this.selections.get(i), trackSelectorResult.selections.get(i))) {
return true;
}
return false;
}
}
| [
"auchhunter@gmail.com"
] | auchhunter@gmail.com |
07aaf735ad317c1b779b4132905f78b23f8fe614 | 6daa112424ce2e0a21ffcd52bc9525f7210f0bba | /docroot/WEB-INF/service/com/innova4b/service/service/ClpSerializer.java | c6bd5c22ba625438defa82ad50b70e5daa7e7632 | [] | no_license | IndabaConsultores/innova4b-portlet | 972e5870ab7858a83ebf68dda7d29865dcf947d7 | 4dc4179eea7ae4baedb470a3ca7ed4c57db98035 | refs/heads/master | 2018-12-28T23:35:17.262706 | 2015-04-17T13:00:20 | 2015-04-17T13:00:20 | 34,102,039 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 8,138 | java | /**
* Copyright (c) 2000-present Liferay, Inc. All rights reserved.
*
* This library is free software; you can redistribute it and/or modify it under
* the terms of the GNU Lesser General Public License as published by the Free
* Software Foundation; either version 2.1 of the License, or (at your option)
* any later version.
*
* This library 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 Lesser General Public License for more
* details.
*/
package com.innova4b.service.service;
import com.innova4b.service.model.LibroClp;
import com.liferay.portal.kernel.exception.PortalException;
import com.liferay.portal.kernel.exception.SystemException;
import com.liferay.portal.kernel.io.unsync.UnsyncByteArrayInputStream;
import com.liferay.portal.kernel.io.unsync.UnsyncByteArrayOutputStream;
import com.liferay.portal.kernel.log.Log;
import com.liferay.portal.kernel.log.LogFactoryUtil;
import com.liferay.portal.kernel.util.ClassLoaderObjectInputStream;
import com.liferay.portal.kernel.util.PropsUtil;
import com.liferay.portal.kernel.util.Validator;
import com.liferay.portal.model.BaseModel;
import java.io.ObjectInputStream;
import java.io.ObjectOutputStream;
import java.lang.reflect.Method;
import java.util.ArrayList;
import java.util.List;
/**
* @author aritz
*/
public class ClpSerializer {
public static String getServletContextName() {
if (Validator.isNotNull(_servletContextName)) {
return _servletContextName;
}
synchronized (ClpSerializer.class) {
if (Validator.isNotNull(_servletContextName)) {
return _servletContextName;
}
try {
ClassLoader classLoader = ClpSerializer.class.getClassLoader();
Class<?> portletPropsClass = classLoader.loadClass(
"com.liferay.util.portlet.PortletProps");
Method getMethod = portletPropsClass.getMethod("get",
new Class<?>[] { String.class });
String portletPropsServletContextName = (String)getMethod.invoke(null,
"innova4b-portlet-deployment-context");
if (Validator.isNotNull(portletPropsServletContextName)) {
_servletContextName = portletPropsServletContextName;
}
}
catch (Throwable t) {
if (_log.isInfoEnabled()) {
_log.info(
"Unable to locate deployment context from portlet properties");
}
}
if (Validator.isNull(_servletContextName)) {
try {
String propsUtilServletContextName = PropsUtil.get(
"innova4b-portlet-deployment-context");
if (Validator.isNotNull(propsUtilServletContextName)) {
_servletContextName = propsUtilServletContextName;
}
}
catch (Throwable t) {
if (_log.isInfoEnabled()) {
_log.info(
"Unable to locate deployment context from portal properties");
}
}
}
if (Validator.isNull(_servletContextName)) {
_servletContextName = "innova4b-portlet";
}
return _servletContextName;
}
}
public static Object translateInput(BaseModel<?> oldModel) {
Class<?> oldModelClass = oldModel.getClass();
String oldModelClassName = oldModelClass.getName();
if (oldModelClassName.equals(LibroClp.class.getName())) {
return translateInputLibro(oldModel);
}
return oldModel;
}
public static Object translateInput(List<Object> oldList) {
List<Object> newList = new ArrayList<Object>(oldList.size());
for (int i = 0; i < oldList.size(); i++) {
Object curObj = oldList.get(i);
newList.add(translateInput(curObj));
}
return newList;
}
public static Object translateInputLibro(BaseModel<?> oldModel) {
LibroClp oldClpModel = (LibroClp)oldModel;
BaseModel<?> newModel = oldClpModel.getLibroRemoteModel();
newModel.setModelAttributes(oldClpModel.getModelAttributes());
return newModel;
}
public static Object translateInput(Object obj) {
if (obj instanceof BaseModel<?>) {
return translateInput((BaseModel<?>)obj);
}
else if (obj instanceof List<?>) {
return translateInput((List<Object>)obj);
}
else {
return obj;
}
}
public static Object translateOutput(BaseModel<?> oldModel) {
Class<?> oldModelClass = oldModel.getClass();
String oldModelClassName = oldModelClass.getName();
if (oldModelClassName.equals(
"com.innova4b.service.model.impl.LibroImpl")) {
return translateOutputLibro(oldModel);
}
else if (oldModelClassName.endsWith("Clp")) {
try {
ClassLoader classLoader = ClpSerializer.class.getClassLoader();
Method getClpSerializerClassMethod = oldModelClass.getMethod(
"getClpSerializerClass");
Class<?> oldClpSerializerClass = (Class<?>)getClpSerializerClassMethod.invoke(oldModel);
Class<?> newClpSerializerClass = classLoader.loadClass(oldClpSerializerClass.getName());
Method translateOutputMethod = newClpSerializerClass.getMethod("translateOutput",
BaseModel.class);
Class<?> oldModelModelClass = oldModel.getModelClass();
Method getRemoteModelMethod = oldModelClass.getMethod("get" +
oldModelModelClass.getSimpleName() + "RemoteModel");
Object oldRemoteModel = getRemoteModelMethod.invoke(oldModel);
BaseModel<?> newModel = (BaseModel<?>)translateOutputMethod.invoke(null,
oldRemoteModel);
return newModel;
}
catch (Throwable t) {
if (_log.isInfoEnabled()) {
_log.info("Unable to translate " + oldModelClassName, t);
}
}
}
return oldModel;
}
public static Object translateOutput(List<Object> oldList) {
List<Object> newList = new ArrayList<Object>(oldList.size());
for (int i = 0; i < oldList.size(); i++) {
Object curObj = oldList.get(i);
newList.add(translateOutput(curObj));
}
return newList;
}
public static Object translateOutput(Object obj) {
if (obj instanceof BaseModel<?>) {
return translateOutput((BaseModel<?>)obj);
}
else if (obj instanceof List<?>) {
return translateOutput((List<Object>)obj);
}
else {
return obj;
}
}
public static Throwable translateThrowable(Throwable throwable) {
if (_useReflectionToTranslateThrowable) {
try {
UnsyncByteArrayOutputStream unsyncByteArrayOutputStream = new UnsyncByteArrayOutputStream();
ObjectOutputStream objectOutputStream = new ObjectOutputStream(unsyncByteArrayOutputStream);
objectOutputStream.writeObject(throwable);
objectOutputStream.flush();
objectOutputStream.close();
UnsyncByteArrayInputStream unsyncByteArrayInputStream = new UnsyncByteArrayInputStream(unsyncByteArrayOutputStream.unsafeGetByteArray(),
0, unsyncByteArrayOutputStream.size());
Thread currentThread = Thread.currentThread();
ClassLoader contextClassLoader = currentThread.getContextClassLoader();
ObjectInputStream objectInputStream = new ClassLoaderObjectInputStream(unsyncByteArrayInputStream,
contextClassLoader);
throwable = (Throwable)objectInputStream.readObject();
objectInputStream.close();
return throwable;
}
catch (SecurityException se) {
if (_log.isInfoEnabled()) {
_log.info("Do not use reflection to translate throwable");
}
_useReflectionToTranslateThrowable = false;
}
catch (Throwable throwable2) {
_log.error(throwable2, throwable2);
return throwable2;
}
}
Class<?> clazz = throwable.getClass();
String className = clazz.getName();
if (className.equals(PortalException.class.getName())) {
return new PortalException();
}
if (className.equals(SystemException.class.getName())) {
return new SystemException();
}
if (className.equals("com.innova4b.service.NoSuchLibroException")) {
return new com.innova4b.service.NoSuchLibroException();
}
return throwable;
}
public static Object translateOutputLibro(BaseModel<?> oldModel) {
LibroClp newModel = new LibroClp();
newModel.setModelAttributes(oldModel.getModelAttributes());
newModel.setLibroRemoteModel(oldModel);
return newModel;
}
private static Log _log = LogFactoryUtil.getLog(ClpSerializer.class);
private static String _servletContextName;
private static boolean _useReflectionToTranslateThrowable = true;
} | [
"galdos.aritz@gmail.com"
] | galdos.aritz@gmail.com |
59ca31cde2ccbecc035ae6fd0eaa3c593105ef65 | 81b0bb3cfb2e9501f53451e7f03ec072ee2b0e13 | /src/bo/app/ao.java | a8722ec238a26338bdd4f4b10869164eaf7c04f7 | [] | no_license | reverseengineeringer/me.lyft.android | 48bb85e8693ce4dab50185424d2ec51debf5c243 | 8c26caeeb54ffbde0711d3ce8b187480d84968ef | refs/heads/master | 2021-01-19T02:32:03.752176 | 2016-07-19T16:30:00 | 2016-07-19T16:30:00 | 63,710,356 | 3 | 0 | null | null | null | null | UTF-8 | Java | false | false | 259 | java | package bo.app;
import com.appboy.events.IEventSubscriber;
public final class ao
implements IEventSubscriber<bf>
{
public ao(an paraman) {}
}
/* Location:
* Qualified Name: bo.app.ao
* Java Class Version: 6 (50.0)
* JD-Core Version: 0.7.1
*/ | [
"reverseengineeringer@hackeradmin.com"
] | reverseengineeringer@hackeradmin.com |
94d6144fd7573c4539802e386e282aab3fc138d0 | ae57590200b4620506f8f4020964a7b30951b194 | /NeoDatis/test/org/neodatis/odb/test/server/trigger/oid/MySelectTrigger.java | 0d7ddc047c484f47070657cb0242864b0985d10d | [] | no_license | antonisvarsamis/NeoDatis | d472e2d0720a88afcfd2e6c3958683f4a162a1fc | 022ed4fe5f1a800a970e8226a08599609db69617 | refs/heads/master | 2020-04-15T12:24:58.311118 | 2014-02-02T17:53:52 | 2014-02-02T17:53:52 | 164,673,078 | 0 | 0 | null | 2019-01-08T15:03:46 | 2019-01-08T15:03:45 | null | UTF-8 | Java | false | false | 443 | java | /**
*
*/
package org.neodatis.odb.test.server.trigger.oid;
import org.neodatis.odb.OID;
import org.neodatis.odb.ObjectRepresentation;
import org.neodatis.odb.core.server.trigger.ServerSelectTrigger;
/**
* @author olivier
*
*/
public class MySelectTrigger extends ServerSelectTrigger {
public void afterSelect(ObjectRepresentation objectRepresentation, OID oid) {
objectRepresentation.setValueOf("id", oid.oidToString());
}
}
| [
"sirlordt@gmail.com"
] | sirlordt@gmail.com |
4f82ab93f2058bc81d44210ca7174566fa94640c | f10dc8fb4181c4865cd4797de9d5a79f2c98af7a | /oaSpring/oa/spring/po/ProductType.java | dbd1c8774cb8fb6e2873d6d4ffac8598464364bc | [] | no_license | DennisAZ/NewtouchOA | b9c41cc1f4caac53b453c56952af0f5156b6c4fa | 881d72d80c83e1f2ad578c92e37a3241498499fc | refs/heads/master | 2020-03-30T05:37:21.900004 | 2018-09-29T02:11:34 | 2018-09-29T02:11:34 | 150,809,685 | 0 | 3 | null | null | null | null | UTF-8 | Java | false | false | 1,361 | java | package oa.spring.po;
public class ProductType {
private String id;
private String name;//产品类别名称
private String parentId;//上级节点
private String treeCode;//上级节点加当前节点
private String treeName;
private String parentName;
private String remark;
public ProductType(){}
public ProductType(String name,String parentId,String treeCode,String treeName,String remark,String parentName){
this.name = name;
this.parentId=parentId;
this.treeCode=treeCode;
this.treeName=treeName;
this.remark = remark;
this.parentName=parentName;
}
public String getId() {
return id;
}
public void setId(String id) {
this.id = id;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public String getParentId() {
return parentId;
}
public void setParentId(String parentId) {
this.parentId = parentId;
}
public String getRemark() {
return remark;
}
public void setRemark(String remark) {
this.remark = remark;
}
public String getTreeCode() {
return treeCode;
}
public void setTreeCode(String treeCode) {
this.treeCode = treeCode;
}
public String getTreeName() {
return treeName;
}
public void setTreeName(String treeName) {
this.treeName = treeName;
}
public String getParentName() {
return parentName;
}
public void setParentName(String parentName) {
this.parentName = parentName;
}
}
| [
"hao.duan@newtouch.cn"
] | hao.duan@newtouch.cn |
d639955b4bb458a9d831ce675fb92e2a4997acdd | 3d809f6dc29d37ee6da61ce825be6f3e27c4f824 | /java/org/apache/catalina/websocket/WsInputStream.java | ddb47de99ef4456300d6214a474413362b09046f | [
"Zlib",
"EPL-1.0",
"LZMA-exception",
"bzip2-1.0.6",
"CPL-1.0",
"CDDL-1.0",
"Apache-2.0",
"LicenseRef-scancode-unknown-license-reference"
] | permissive | lovejavaee/tomcat70 | 646661e70c132bc948bc82040b6b4b0c84720919 | 35aea8c399732186afdf0a1776a88e714a342ecb | refs/heads/trunk | 2023-05-04T22:38:25.822113 | 2014-09-13T16:18:56 | 2014-09-13T16:18:56 | 24,003,554 | 0 | 0 | Apache-2.0 | 2023-04-14T02:06:02 | 2014-09-13T19:26:33 | null | UTF-8 | Java | false | false | 5,281 | java | /*
* 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.
*/
package org.apache.catalina.websocket;
import java.io.IOException;
import java.io.InputStream;
import org.apache.coyote.http11.upgrade.UpgradeProcessor;
import org.apache.tomcat.util.res.StringManager;
/**
* This class is used to read WebSocket frames from the underlying socket and
* makes the payload available for reading as an {@link InputStream}. It only
* makes the number of bytes declared in the payload length available for
* reading even if more bytes are available from the socket.
*
* @deprecated Replaced by the JSR356 WebSocket 1.0 implementation and will be
* removed in Tomcat 8.0.x.
*/
@Deprecated
public class WsInputStream extends InputStream {
private static final StringManager sm =
StringManager.getManager(Constants.Package);
private final UpgradeProcessor<?> processor;
private final WsOutbound outbound;
private WsFrame frame;
private long remaining;
private long readThisFragment;
private String error = null;
public WsInputStream(UpgradeProcessor<?> processor, WsOutbound outbound) {
this.processor = processor;
this.outbound = outbound;
}
/**
* Process the next WebSocket frame.
*
* @param block Should this method block until a frame is presented if no
* data is currently available to process. Note that if a
* single byte is available, this method will block until the
* complete frame (excluding payload for non-control frames) is
* available.
*
* @return The next frame to be processed or <code>null</code> if block is
* <code>false</code> and there is no data to be processed.
*
* @throws IOException If a problem occurs reading the data for the frame.
*/
public WsFrame nextFrame(boolean block) throws IOException {
frame = WsFrame.nextFrame(processor, block);
if (frame != null) {
readThisFragment = 0;
remaining = frame.getPayLoadLength();
}
return frame;
}
// ----------------------------------------------------- InputStream methods
@Override
public int read() throws IOException {
makePayloadDataAvailable();
if (remaining == 0) {
return -1;
}
remaining--;
readThisFragment++;
int masked = processor.read();
if(masked == -1) {
return -1;
}
return masked ^
(frame.getMask()[(int) ((readThisFragment - 1) % 4)] & 0xFF);
}
@Override
public int read(byte b[], int off, int len) throws IOException {
makePayloadDataAvailable();
if (remaining == 0) {
return -1;
}
if (len > remaining) {
len = (int) remaining;
}
int result = processor.read(true, b, off, len);
if(result == -1) {
return -1;
}
for (int i = off; i < off + result; i++) {
b[i] = (byte) (b[i] ^
frame.getMask()[(int) ((readThisFragment + i - off) % 4)]);
}
remaining -= result;
readThisFragment += result;
return result;
}
/*
* Ensures that there is payload data ready to read.
*/
private void makePayloadDataAvailable() throws IOException {
if (error != null) {
throw new IOException(error);
}
while (remaining == 0 && !frame.getFin()) {
// Need more data - process next frame
nextFrame(true);
while (frame.isControl()) {
if (frame.getOpCode() == Constants.OPCODE_PING) {
outbound.pong(frame.getPayLoad());
} else if (frame.getOpCode() == Constants.OPCODE_PONG) {
// NO-OP. Swallow it.
} else if (frame.getOpCode() == Constants.OPCODE_CLOSE) {
outbound.close(frame);
} else{
throw new IOException(sm.getString("is.unknownOpCode",
Byte.valueOf(frame.getOpCode())));
}
nextFrame(true);
}
if (frame.getOpCode() != Constants.OPCODE_CONTINUATION) {
error = sm.getString("is.notContinuation",
Byte.valueOf(frame.getOpCode()));
throw new IOException(error);
}
}
}
}
| [
"markt@apache.org"
] | markt@apache.org |
21491b5889a0c9719715ead2c4c3d96c4385380a | 464e39233d1fc767473df00ba0c6679349b97b20 | /Mrskin/app/src/main/java/com/yoka/mrskin/model/managers/YKPlanTaskManager.java | c01173cf4730c3099acdd89eb103621cb8395cd6 | [] | no_license | zhangji92/newProject11.28 | 5e23bac774efb2d544ad9f2d373eb5a9755c4ec8 | 2e9c29527bd1c0260b6e405f7897626941767832 | refs/heads/master | 2020-06-18T00:52:18.988121 | 2016-11-30T03:47:21 | 2016-11-30T03:47:21 | 74,964,167 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,428 | java | package com.yoka.mrskin.model.managers;
import java.util.ArrayList;
import java.util.HashMap;
import org.json.JSONObject;
import com.yoka.mrskin.model.base.YKResult;
import com.yoka.mrskin.model.data.PlanTask;
import com.yoka.mrskin.model.http.YKHttpTask;
import com.yoka.mrskin.model.managers.base.YKManager;
/**
* 美丽计划
* @author zlz
* @Data 2016年8月5日
*/
public class YKPlanTaskManager extends YKManager{
private static final String PATH = getBase() + "finish/subtask";
private static YKPlanTaskManager singleton = null;
private static Object lock = new Object();
public static YKPlanTaskManager getInstance() {
synchronized (lock) {
if (singleton == null) {
singleton = new YKPlanTaskManager();
}
}
return singleton;
}
/**
* 请求网络,完成任务
*/
public void requestFinishTask(String authtoken,ArrayList<JSONObject>_taskList,final Callback callback){
HashMap<String, Object> parameters = new HashMap<String, Object>();
parameters.put("authtoken",authtoken);
parameters.put("tasklist", _taskList);
super.postPlanURL(PATH, parameters, new com.yoka.mrskin.model.managers.base.Callback() {
@Override
public void doCallback(YKHttpTask task, JSONObject object,
YKResult result) {
if (callback != null) {
callback.callback(result);
}
}
});
}
public interface Callback
{
public void callback(YKResult result);
}
}
| [
"938361820@qq.com"
] | 938361820@qq.com |
04633bd09bfe0eafec0497f39dc6a9147226177c | fa91450deb625cda070e82d5c31770be5ca1dec6 | /Diff-Raw-Data/6/6_5215744edb44bb26e2d950d0eb20f4a6c22e737c/AddAuthsCommand/6_5215744edb44bb26e2d950d0eb20f4a6c22e737c_AddAuthsCommand_t.java | c1354cd8a6f37fb37a1fb130addc8da01be18a4c | [] | 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 | 3,376 | java | /*
* 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.
*/
package org.apache.accumulo.core.util.shell.commands;
import java.util.Map;
import java.util.Set;
import org.apache.accumulo.core.client.AccumuloException;
import org.apache.accumulo.core.client.AccumuloSecurityException;
import org.apache.accumulo.core.security.Authorizations;
import org.apache.accumulo.core.util.shell.Shell;
import org.apache.accumulo.core.util.shell.Shell.Command;
import org.apache.accumulo.core.util.shell.Token;
import org.apache.commons.cli.CommandLine;
import org.apache.commons.cli.Option;
import org.apache.commons.cli.OptionGroup;
import org.apache.commons.cli.Options;
public class AddAuthsCommand extends Command {
private Option userOpt;
private Option scanOptAuths;
@Override
public int execute(final String fullCommand, final CommandLine cl, final Shell shellState) throws AccumuloException, AccumuloSecurityException {
final String user = cl.getOptionValue(userOpt.getOpt(), shellState.getConnector().whoami());
final String scanOpts = cl.getOptionValue(scanOptAuths.getOpt());
Authorizations auths = shellState.getConnector().securityOperations().getUserAuthorizations(user);
StringBuilder userAuths = new StringBuilder();
if (!auths.isEmpty()) {
userAuths.append(auths.toString());
userAuths.append(",");
}
userAuths.append(scanOpts);
shellState.getConnector().securityOperations().changeUserAuthorizations(user, ScanCommand.parseAuthorizations(userAuths.toString()));
Shell.log.debug("Changed record-level authorizations for user " + user);
return 0;
}
@Override
public String description() {
return "adds authorizations to the maximum scan authorizations for a user";
}
@Override
public void registerCompletion(final Token root, final Map<Command.CompletionSet,Set<String>> completionSet) {
registerCompletionForUsers(root, completionSet);
}
@Override
public Options getOptions() {
final Options o = new Options();
final OptionGroup setOrClear = new OptionGroup();
scanOptAuths = new Option("s", "scan-authorizations", true, "scan authorizations to set");
scanOptAuths.setArgName("comma-separated-authorizations");
setOrClear.addOption(scanOptAuths);
setOrClear.setRequired(true);
o.addOptionGroup(setOrClear);
userOpt = new Option(Shell.userOption, "user", true, "user to operate on");
userOpt.setArgName("user");
o.addOption(userOpt);
return o;
}
@Override
public int numArgs() {
return 0;
}
}
| [
"yuzhongxing88@gmail.com"
] | yuzhongxing88@gmail.com |
b50e0ca57e9fd56ca711f35a839b75cccf87686a | 0af8b92686a58eb0b64e319b22411432aca7a8f3 | /single-large-project/src/test/java/org/gradle/test/performancenull_213/Testnull_21287.java | 7ff086389230bc9e7580320cb87dc639a9cedfac | [] | no_license | gradle/performance-comparisons | b0d38db37c326e0ce271abebdb3c91769b860799 | e53dc7182fafcf9fedf07920cbbea8b40ee4eef4 | refs/heads/master | 2023-08-14T19:24:39.164276 | 2022-11-24T05:18:33 | 2022-11-24T05:18:33 | 80,121,268 | 17 | 15 | null | 2022-09-30T08:04:35 | 2017-01-26T14:25:33 | null | UTF-8 | Java | false | false | 308 | java | package org.gradle.test.performancenull_213;
import static org.junit.Assert.*;
public class Testnull_21287 {
private final Productionnull_21287 production = new Productionnull_21287("value");
@org.junit.Test
public void test() {
assertEquals(production.getProperty(), "value");
}
} | [
"cedric.champeau@gmail.com"
] | cedric.champeau@gmail.com |
d03810060de01e55561f60569e25545e296acf89 | 244c9496d50a627bca5a0b89a1370379be1994e3 | /test-binding-rs/src/main/java/org/fabric3/tests/rs/MetaProviderAnnotation.java | ede5b0da9e525e974d2c6dc30322be91fe2f56f0 | [
"Apache-2.0"
] | permissive | Fabric3/fabric3-integration-tests | 9b00778931f20466925ad54b252016c7055420de | 023b6f8c94323746f65d6e2d1b0f3335efba0fe4 | refs/heads/master | 2021-01-23T09:30:06.086738 | 2015-11-26T12:34:57 | 2015-11-26T12:34:57 | 6,455,325 | 1 | 0 | null | 2013-12-04T00:30:33 | 2012-10-30T10:14:59 | Java | UTF-8 | Java | false | false | 339 | java | package org.fabric3.tests.rs;
import javax.ws.rs.Consumes;
import javax.ws.rs.ext.Provider;
/**
*
*/
@Provider
@Consumes({"application/foo"})
@java.lang.annotation.Target({java.lang.annotation.ElementType.TYPE})
@java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy.RUNTIME)
public @interface MetaProviderAnnotation {
}
| [
"jim.marino@gmail.com"
] | jim.marino@gmail.com |
22a5da007de89df09cc9c2e0ef80acce0750840c | e6657538e0c32a68239476f0a2930482c9a83994 | /【演示】实现登录模块与Ajax文件上传(三)/src/org/demo/UserServlet.java | cc04445e96cef985d3a800dab64a64c6373f75b4 | [] | no_license | yanchao00551/ZJoracleJavaSE | cf4cc2ceee20bbb0436a1d80368a3d0d4c645f1d | 084ceaac4fa04e130276094da5c26f88a127f385 | refs/heads/master | 2023-07-30T00:02:54.090197 | 2021-09-19T09:00:52 | 2021-09-19T09:00:52 | 348,271,676 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,933 | java | package org.demo;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import java.util.Map;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import org.apache.commons.fileupload.FileItem;
import org.apache.commons.fileupload.disk.DiskFileItemFactory;
import org.apache.commons.fileupload.servlet.ServletFileUpload;
import org.demo.entity.User;
import org.demo.utils.PrintUtil;
import org.demo.utils.R;
import org.demo.utils.UploadUtils;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
public class UserServlet extends HttpServlet{
private static final long serialVersionUID = 1L;
@Override
public void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
req.getRequestDispatcher("login.jsp").forward(req, resp);
}
@Override
public void doPost(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
// TODO Auto-generated method stub
//第一种提交
String username = req.getParameter("username").trim();
String password = req.getParameter("password").trim();
System.out.println("接收参数username:" + username);
System.out.println("接收参数password:" + password);
R r = new R();
//最终从 service层拿到的数据结果
List<User> userList = new ArrayList<User>();
userList.add(new User("admin","123"));
userList.add(new User("zhang3","456"));
int total = 20;
//1行解决返回值
r.setTotal(total);
r.returnSuccess(userList);
//1行解决 javabean转json字符串
//String json = "{\"status\":0,\"msg\":\"操作成功\"}";
//System.out.println(json);
PrintUtil.write(r, resp);
//第二种提交 FormData 支持Ajax文件上传 需要用到apache comomon-file-upload jar包
//方式一:不用工具类
// DiskFileItemFactory factory = new DiskFileItemFactory();
// ServletFileUpload upload = new ServletFileUpload(factory);
// String username = "";
// String password = "";
// try {
// List<FileItem> items = upload.parseRequest(req);
// for(FileItem item:items) {
// if(item.isFormField()) {
// if("username".equals(item.getFieldName())) {
// username = item.getString("UTF-8");
// }else if("password".equals(item.getFieldName())) {
// password = item.getString("UTF-8");
// }
// }else {
// //图片上传逻辑
//
// }
// }
// }catch(Exception e) {
// e.printStackTrace();
// }
//
// System.out.println("接收参数:" + username);
// System.out.println("接收参数:" + password);
//方式二:使用工具类 、实现Ajax文件上传
// UploadUtils upl = new UploadUtils();
// upl.setSavePath("D:/working1/login3/WebRoot/" + upl.getBasePath() + "/");
// String[] result = upl.uploadFile(req);
// Map<String,String> fields =upl.getFoList();
// System.out.println("用户名:" + fields.get("username"));
// System.out.println("密码:" +fields.get("password"));
/*微服务ajax 提交方式 */
// String param= null;
// BufferedReader streamReader = new BufferedReader( new InputStreamReader(req.getInputStream(), "UTF-8"));
// StringBuilder responseStrBuilder = new StringBuilder();
// String inputStr;
// while ((inputStr = streamReader.readLine()) != null)
// responseStrBuilder.append(inputStr);
//
// JSONObject jsonObject = JSONObject.parseObject(responseStrBuilder.toString());
// User user = JSON.toJavaObject(jsonObject, User.class);
//
//
// System.out.println(user);
}
}
| [
"10947@163.com"
] | 10947@163.com |
31e8a03698fdbf0ee6b403143e405aad728a9352 | f051652e32b3bd6e4bdd7b20772e3d5739baace4 | /src/模板方法/HummerH1.java | d69f249e0c64fc6373f8562d4e7a37c423c4abf2 | [] | no_license | Yuwenbiao/DesignPattern2 | 16b2d9108c950163ee2df502c79f3f2f14541ec6 | 4c565203ec692dd3a304f0e1646229728934dbd2 | refs/heads/master | 2022-04-01T11:57:34.720214 | 2020-01-28T13:22:36 | 2020-01-28T13:22:36 | 115,919,686 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 455 | java | package 模板方法;
/**
* H1型号悍马模型
*/
public class HummerH1 extends HummerModel {
@Override
public void start() {
System.out.println("H1发动");
}
@Override
public void stop() {
System.out.println("H1停车");
}
@Override
public void alarm() {
System.out.println("H1鸣笛");
}
@Override
public void engineBoom() {
System.out.println("H1引擎声");
}
}
| [
"2383299053@qq.com"
] | 2383299053@qq.com |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.