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
9366548956569c8c8e1b1f78415d76b7514e85f0
a00326c0e2fc8944112589cd2ad638b278f058b9
/src/main/java/000/131/329/CWE191_Integer_Underflow__int_File_multiply_67a.java
776478fb8b38dfad48e18af085304dd670684ce8
[]
no_license
Lanhbao/Static-Testing-for-Juliet-Test-Suite
6fd3f62713be7a084260eafa9ab221b1b9833be6
b095b11c7cb6d4a5bb2b76181e35d6ee00e96e68
refs/heads/master
2020-08-24T13:34:04.004149
2019-10-25T09:26:00
2019-10-25T09:26:00
216,822,684
0
1
null
2019-11-08T09:51:54
2019-10-22T13:37:13
Java
UTF-8
Java
false
false
8,165
java
/* TEMPLATE GENERATED TESTCASE FILE Filename: CWE191_Integer_Underflow__int_File_multiply_67a.java Label Definition File: CWE191_Integer_Underflow__int.label.xml Template File: sources-sinks-67a.tmpl.java */ /* * @description * CWE: 191 Integer Underflow * BadSource: File Read data from file (named c:\data.txt) * GoodSource: A hardcoded non-zero, non-min, non-max, even number * Sinks: multiply * GoodSink: Ensure there will not be an underflow before multiplying data by 2 * BadSink : If data is negative, multiply by 2, which can cause an underflow * Flow Variant: 67 Data flow: data passed in a class from one method to another in different source files in the same package * * */ import java.io.BufferedReader; import java.io.InputStreamReader; import java.io.FileInputStream; import java.io.File; import java.io.IOException; import java.util.logging.Level; public class CWE191_Integer_Underflow__int_File_multiply_67a extends AbstractTestCase { static class Container { public int containerOne; } public void bad() throws Throwable { int data; data = Integer.MIN_VALUE; /* Initialize data */ { File file = new File("C:\\data.txt"); FileInputStream streamFileInput = null; InputStreamReader readerInputStream = null; BufferedReader readerBuffered = null; try { /* read string from file into data */ streamFileInput = new FileInputStream(file); readerInputStream = new InputStreamReader(streamFileInput, "UTF-8"); readerBuffered = new BufferedReader(readerInputStream); /* POTENTIAL FLAW: Read data from a file */ /* This will be reading the first "line" of the file, which * could be very long if there are little or no newlines in the file */ String stringNumber = readerBuffered.readLine(); if (stringNumber != null) /* avoid NPD incidental warnings */ { try { data = Integer.parseInt(stringNumber.trim()); } catch(NumberFormatException exceptNumberFormat) { IO.logger.log(Level.WARNING, "Number format exception parsing data from string", exceptNumberFormat); } } } catch (IOException exceptIO) { IO.logger.log(Level.WARNING, "Error with stream reading", exceptIO); } finally { /* Close stream reading objects */ try { if (readerBuffered != null) { readerBuffered.close(); } } catch (IOException exceptIO) { IO.logger.log(Level.WARNING, "Error closing BufferedReader", exceptIO); } try { if (readerInputStream != null) { readerInputStream.close(); } } catch (IOException exceptIO) { IO.logger.log(Level.WARNING, "Error closing InputStreamReader", exceptIO); } try { if (streamFileInput != null) { streamFileInput.close(); } } catch (IOException exceptIO) { IO.logger.log(Level.WARNING, "Error closing FileInputStream", exceptIO); } } } Container dataContainer = new Container(); dataContainer.containerOne = data; (new CWE191_Integer_Underflow__int_File_multiply_67b()).badSink(dataContainer ); } public void good() throws Throwable { goodG2B(); goodB2G(); } /* goodG2B() - use goodsource and badsink */ private void goodG2B() throws Throwable { int data; /* FIX: Use a hardcoded number that won't cause underflow, overflow, divide by zero, or loss-of-precision issues */ data = 2; Container dataContainer = new Container(); dataContainer.containerOne = data; (new CWE191_Integer_Underflow__int_File_multiply_67b()).goodG2BSink(dataContainer ); } /* goodB2G() - use badsource and goodsink */ private void goodB2G() throws Throwable { int data; data = Integer.MIN_VALUE; /* Initialize data */ { File file = new File("C:\\data.txt"); FileInputStream streamFileInput = null; InputStreamReader readerInputStream = null; BufferedReader readerBuffered = null; try { /* read string from file into data */ streamFileInput = new FileInputStream(file); readerInputStream = new InputStreamReader(streamFileInput, "UTF-8"); readerBuffered = new BufferedReader(readerInputStream); /* POTENTIAL FLAW: Read data from a file */ /* This will be reading the first "line" of the file, which * could be very long if there are little or no newlines in the file */ String stringNumber = readerBuffered.readLine(); if (stringNumber != null) /* avoid NPD incidental warnings */ { try { data = Integer.parseInt(stringNumber.trim()); } catch(NumberFormatException exceptNumberFormat) { IO.logger.log(Level.WARNING, "Number format exception parsing data from string", exceptNumberFormat); } } } catch (IOException exceptIO) { IO.logger.log(Level.WARNING, "Error with stream reading", exceptIO); } finally { /* Close stream reading objects */ try { if (readerBuffered != null) { readerBuffered.close(); } } catch (IOException exceptIO) { IO.logger.log(Level.WARNING, "Error closing BufferedReader", exceptIO); } try { if (readerInputStream != null) { readerInputStream.close(); } } catch (IOException exceptIO) { IO.logger.log(Level.WARNING, "Error closing InputStreamReader", exceptIO); } try { if (streamFileInput != null) { streamFileInput.close(); } } catch (IOException exceptIO) { IO.logger.log(Level.WARNING, "Error closing FileInputStream", exceptIO); } } } Container dataContainer = new Container(); dataContainer.containerOne = data; (new CWE191_Integer_Underflow__int_File_multiply_67b()).goodB2GSink(dataContainer ); } /* Below is the main(). It is only used when building this testcase on * its own for testing or for building a binary to use in testing binary * analysis tools. It is not used when compiling all the testcases as one * application, which is how source code analysis tools are tested. */ public static void main(String[] args) throws ClassNotFoundException, InstantiationException, IllegalAccessException { mainFromParent(args); } }
[ "anhtluet12@gmail.com" ]
anhtluet12@gmail.com
87394819edd96f8fd0a6880e1e8935540b093b25
2cbde65fa8f85232bc953dccdb7c4c1beb892c19
/src/util/adibrata/support/common/Terbilang.java
f2829f10dcadca8c20dd55815d4788ad8c1c854c
[]
no_license
AdibrataCompany/Smile
c02f1489222e27f570eed64d901abb10139b14d6
09238a30b9fd0fccc19882ddba02401ff47738d6
refs/heads/master
2021-01-10T18:23:47.256061
2015-09-27T03:57:57
2015-11-01T04:08:53
39,287,257
1
1
null
2015-07-24T07:37:05
2015-07-18T05:00:35
HTML
UTF-8
Java
false
false
7,442
java
/** * */ package util.adibrata.support.common; /** * @author Henry * */ public class Terbilang { /** * */ public Terbilang() { // TODO Auto-generated constructor stub } protected static String terbilang(int bilint) { /* * Nilai maksimal yang bisa diolah adalah 2147483647; */ String terbilang = null; if (bilint < 0) { System.out.println("Bilangan tidak boleh lebih kecil dari nol"); } else if (bilint > Integer.MAX_VALUE) { System.out.println("Bilangan tidak boleh lebih besar dari " + Integer.MAX_VALUE); } else { String bilangan = String.valueOf(bilint); if (bilangan.equals("0")) { terbilang = "Nol"; } else { int jumlahDigit = Terbilang.berapaDigit(bilangan); switch (jumlahDigit) { case 1: terbilang = Terbilang.satuDigit(bilangan); break; case 2: terbilang = Terbilang.duaDigit(bilangan); break; case 3: terbilang = Terbilang.tigaDigit(bilangan); break; case 4: terbilang = Terbilang.empatDigit(bilangan); break; case 5: terbilang = Terbilang.limaDigit(bilangan); break; case 6: terbilang = Terbilang.enamDigit(bilangan); break; case 7: terbilang = Terbilang.tujuhDigit(bilangan); break; case 8: terbilang = Terbilang.delapanDigit(bilangan); break; case 9: terbilang = Terbilang.sembilanDigit(bilangan); break; case 10: terbilang = Terbilang.sepuluhDigit(bilangan); break; } } } return terbilang; } protected static int berapaDigit(String bilangan) { return bilangan.length(); } protected static String satuDigit(String bilangan) { String terbilang = null; switch (bilangan) { case "1": terbilang = "Satu"; break; case "2": terbilang = "Dua"; break; case "3": terbilang = "Tiga"; break; case "4": terbilang = "Empat"; break; case "5": terbilang = "Lima"; break; case "6": terbilang = "Enam"; break; case "7": terbilang = "Tujuh"; break; case "8": terbilang = "Delapan"; break; case "9": terbilang = "Sembilan"; break; } return terbilang; } protected static String duaDigit(String bilangan) { String terbilang = null; if (bilangan.charAt(0) == '1') { if (bilangan.charAt(1) == '0') { terbilang = "Sepuluh"; } else if (bilangan.charAt(1) == '1') { terbilang = "Sebelas"; } else { terbilang = Terbilang.satuDigit(String.valueOf(bilangan .charAt(1))) + " Belas"; } } else { terbilang = Terbilang.satuDigit(bilangan.substring(0, 1)) + " Puluh"; if (bilangan.substring(1).equals("0")) { } else { terbilang = terbilang + " " + Terbilang.satuDigit(bilangan.substring(1)); } } return terbilang; } protected static String tigaDigit(String bilangan) { String terbilang = null; if (bilangan.charAt(0) == '1') { terbilang = "Seratus"; if (bilangan.charAt(1) == '0') { if (bilangan.charAt(2) == '0') { } else { terbilang = terbilang + " " + Terbilang.satuDigit(String.valueOf(bilangan .charAt(2))); } } else { terbilang = terbilang + " " + Terbilang.duaDigit(bilangan.substring(1)); } } else { terbilang = Terbilang.satuDigit(bilangan.substring(0, 1)) + " Ratus"; if (bilangan.charAt(1) == '0') { if (bilangan.charAt(2) == '0') { } else { terbilang = terbilang + " " + Terbilang.satuDigit(String.valueOf(bilangan .charAt(2))); } } else { terbilang = terbilang + " " + Terbilang.duaDigit(bilangan.substring(1)); } } return terbilang; } protected static String empatDigit(String bilangan) { String terbilang = null; if (bilangan.charAt(0) == '1') { if (bilangan.charAt(1) == '0') { if (bilangan.charAt(2) == '0') { if (bilangan.charAt(3) == '0') { terbilang = "Seribu"; } else { terbilang = "Seribu " + Terbilang.satuDigit(String.valueOf(bilangan .charAt(3))); } } else { terbilang = "Seribu " + Terbilang.duaDigit(bilangan.substring(2)); } } else { terbilang = "Seribu " + Terbilang.tigaDigit(bilangan.substring(1)); } } else { if (bilangan.charAt(1) == '0') { if (bilangan.charAt(2) == '0') { if (bilangan.charAt(3) == '0') { terbilang = Terbilang.satuDigit(String.valueOf(bilangan .charAt(0))) + " Ribu"; } else { terbilang = Terbilang.satuDigit(String.valueOf(bilangan .charAt(0))) + " Ribu " + Terbilang.satuDigit(String.valueOf(bilangan .charAt(3))); } } else { terbilang = Terbilang.satuDigit(String.valueOf(bilangan .charAt(0))) + " Ribu " + Terbilang.duaDigit(bilangan.substring(2)); } } else { terbilang = Terbilang.satuDigit(String.valueOf(bilangan .charAt(0))) + " Ribu " + Terbilang.tigaDigit(bilangan.substring(1)); } } return terbilang; } protected static String limaDigit(String bilangan) { String terbilang = Terbilang.duaDigit(bilangan.substring(0, 2)) + " Ribu"; if (bilangan.substring(2, 5).equals("000")) { } else { if (bilangan.charAt(2) == '0') { if (bilangan.charAt(3) == '0') { terbilang = terbilang + " " + Terbilang.satuDigit(bilangan.substring(4)); } else { terbilang = terbilang + " " + Terbilang.duaDigit(bilangan.substring(3)); } } else { terbilang = terbilang + " " + Terbilang.tigaDigit(bilangan.substring(2)); } } return terbilang; } protected static String enamDigit(String bilangan) { String terbilang = Terbilang.tigaDigit(bilangan.substring(0, 3)) + " Ribu"; if (bilangan.substring(2, 6).equals("0000")) { } else { terbilang = terbilang + " " + Terbilang.tigaDigit(bilangan.substring(3, 6)); } return terbilang; } protected static String tujuhDigit(String bilangan) { String terbilang = Terbilang.satuDigit(bilangan.substring(0, 1)) + " Juta"; if (bilangan.substring(1).equals("000000")) { } else { terbilang = terbilang + " " + Terbilang.enamDigit(bilangan.substring(1)); } return terbilang; } protected static String delapanDigit(String bilangan) { String terbilang = Terbilang.duaDigit(bilangan.substring(0, 2)) + " Juta"; if (bilangan.substring(2).equals("000000")) { } else { terbilang = terbilang + " " + Terbilang.enamDigit(bilangan.substring(2)); } return terbilang; } protected static String sembilanDigit(String bilangan) { String terbilang = Terbilang.tigaDigit(bilangan.substring(0, 3)) + " Juta"; if (bilangan.substring(3).equals("000000")) { } else { terbilang = terbilang + " " + Terbilang.enamDigit(bilangan.substring(3)); } return terbilang; } protected static String sepuluhDigit(String bilangan) { String terbilang = Terbilang.satuDigit(bilangan.substring(0, 1)) + " Miliar"; if (bilangan.substring(1).equals("000000000")) { } else { terbilang = terbilang + " " + Terbilang.sembilanDigit(bilangan.substring(1)); } return terbilang; } }
[ "henry.sudarma@adibrata.co.id" ]
henry.sudarma@adibrata.co.id
c6c898bea73ead56ea437fc3d017280d0a855bef
94c46a6399b92ae416a212f9eb388822e379a222
/basex-core/src/main/java/org/basex/query/expr/Quantifier.java
55bc41fc29d4bd437ab388707727eb1067be5dc1
[ "BSD-3-Clause" ]
permissive
rosishadura/basex
ddfc44f89c62ddc2cb67b316b86d635079af589b
5b5b42fe4fb8adc73e6cde8d46a3d40bebfaa5b4
refs/heads/master
2021-01-18T13:31:25.577634
2014-07-21T17:42:51
2014-07-21T17:42:51
1,387,757
0
0
null
null
null
null
UTF-8
Java
false
false
2,799
java
package org.basex.query.expr; import static org.basex.query.QueryText.*; import java.util.*; import org.basex.query.*; import org.basex.query.gflwor.*; import org.basex.query.iter.*; import org.basex.query.value.*; import org.basex.query.value.item.*; import org.basex.query.value.node.*; import org.basex.query.value.type.*; import org.basex.query.var.*; import org.basex.util.*; import org.basex.util.hash.*; /** * Some/Every satisfier clause. * * @author BaseX Team 2005-14, BSD License * @author Christian Gruen */ public final class Quantifier extends Single { /** Every flag. */ private final boolean every; /** * Constructor. * @param info input info * @param inputs variable inputs * @param expr satisfier * @param every every flag */ public Quantifier(final InputInfo info, final For[] inputs, final Expr expr, final boolean every) { this(info, new GFLWOR(info, new LinkedList<GFLWOR.Clause>(Arrays.asList(inputs)), compBln(expr, info)), every); } /** * Copy constructor. * @param info input info * @param tests expression * @param every every flag */ private Quantifier(final InputInfo info, final Expr tests, final boolean every) { super(info, tests); this.every = every; seqType = SeqType.BLN; } @Override public Expr compile(final QueryContext qc, final VarScope scp) throws QueryException { super.compile(qc, scp); return optimize(qc, scp); } @Override public Expr optimize(final QueryContext qc, final VarScope scp) throws QueryException { // return pre-evaluated result if(expr.isValue()) return optPre(item(qc, info), qc); // pre-evaluate satisfy clause if it is a value if(expr instanceof GFLWOR && !expr.has(Flag.NDT) && !expr.has(Flag.UPD)) { final GFLWOR gflwor = (GFLWOR) expr; if(gflwor.size() > 0 && gflwor.ret.isValue()) { final Value value = (Value) gflwor.ret; qc.compInfo(OPTPRE, value); return Bln.get(value.ebv(qc, info).bool(info)); } } return this; } @Override public Bln item(final QueryContext qc, final InputInfo ii) throws QueryException { final Iter iter = expr.iter(qc); for(Item it; (it = iter.next()) != null;) if(every ^ it.ebv(qc, ii).bool(ii)) return Bln.get(!every); return Bln.get(every); } @Override public Expr copy(final QueryContext qc, final VarScope scp, final IntObjMap<Var> vs) { return new Quantifier(info, expr.copy(qc, scp, vs), every); } @Override public void plan(final FElem plan) { addPlan(plan, planElem(TYP, every ? EVERY : SOME), expr); } @Override public String toString() { return every ? EVERY : SOME + '(' + expr + ')'; } @Override public int exprSize() { return expr.exprSize(); } }
[ "christian.gruen@gmail.com" ]
christian.gruen@gmail.com
3650bef79e6f3525692c0302e7aaf582522468ba
c8d2d0aa44ee524e5959067b44ce08b72c19bdf7
/src/main/java/com/kd/platform/minidao/datasource/DynamicDataSource.java
5d7a7ee11deb00a0a8ad6b277d4fe85b9fe7f4be
[]
no_license
FreyFan/aund
c968af903f0abcdc2b9fd6ba0c6b5ecf19eb737a
bc83b633a809300532e087d4ec451070e8ab1157
refs/heads/master
2021-01-01T03:50:20.352172
2016-05-12T09:03:19
2016-05-12T09:03:19
58,625,368
0
0
null
null
null
null
UTF-8
Java
false
false
1,215
java
package com.kd.platform.minidao.datasource; import java.util.Map; import org.springframework.jdbc.datasource.lookup.AbstractRoutingDataSource; import org.springframework.jdbc.datasource.lookup.DataSourceLookup; /** * <b>Application name:</b> DynamicDataSource.java <br> * <b>Application describing: 动态数据源类</b> <br> * <b>Copyright:</b> Copyright &copy; 2015 Frey.Fan 版权所有。<br> * <b>Company:</b> Frey.Fan <br> * <b>Date:</b> 2015-6-10 <br> * @author <a href="mailto:Frey.Fan@163.com"> Frey.Fan </a> * @version V1.0 */ public class DynamicDataSource extends AbstractRoutingDataSource { protected Object determineCurrentLookupKey() { DataSourceType dataSourceType = DataSourceContextHolder.getDataSourceType(); return dataSourceType; } public void setDataSourceLookup(DataSourceLookup dataSourceLookup) { super.setDataSourceLookup(dataSourceLookup); } public void setDefaultTargetDataSource(Object defaultTargetDataSource) { super.setDefaultTargetDataSource(defaultTargetDataSource); } public void setTargetDataSources(Map<Object, Object> targetDataSources) { super.setTargetDataSources(targetDataSources); } }
[ "863083337@qq.com" ]
863083337@qq.com
6323f96b97f581dbbd226cebfc42871841de9b4a
71264e8cf7f467c8d668352369031ca0572cc477
/src/main/java/com/algaworks/algafood/mail/EmailConfiguration.java
8365b821ee24c6e7b0969d2bae81f0eddb953c48
[]
no_license
mucheniski/algafood-api
5749fafe9c26d3559776cb975826bee7bb1f764c
261dc13ed11b3a602bf62106a9bda59b2cb936cd
refs/heads/master
2022-08-27T02:09:23.311550
2022-08-01T19:14:27
2022-08-01T19:14:27
237,074,675
5
6
null
2022-07-15T21:10:03
2020-01-29T20:22:46
Java
UTF-8
Java
false
false
942
java
package com.algaworks.algafood.mail; import com.algaworks.algafood.enuns.TipoSevicoEmail; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; @Configuration public class EmailConfiguration { @Autowired private EmailProperties emailProperties; /* A definição de qual servico vai ser usado é feita no application.properties de acordo com o @Bean definido em EmailProperties */ @Bean public EnvioEmailService envioEmailService() { if(emailProperties.getServicoUsado().equals(TipoSevicoEmail.MOCK.getDescricao())) { return new MockEmailService(); } else if (emailProperties.getServicoUsado().equals(TipoSevicoEmail.SMTP.getDescricao())) { return new SmtpEnvioEmailService(); } return null; } }
[ "mucheniski@gmail.com" ]
mucheniski@gmail.com
fc801e3a8c453d65ca0ae62e9af394d8a5e419e9
e11f74a864bf5133a86450561460c9ede2161f62
/demo/src/main/java/Nanifarfalla/app/repository/IgvVentaRepository.java
f4f310571cd3ce3b5cfd062cc7386360a99423c5
[]
no_license
joffrehermosilla/IniciodeSesion
e27f49248828093523c32da69a9574c2a42dc3b1
3e4f6e1d34b5df4d8eebbda5d0b0f2c12445daac
refs/heads/master
2023-03-26T07:36:48.430242
2021-03-04T05:02:21
2021-03-04T05:02:21
344,170,455
0
0
null
null
null
null
UTF-8
Java
false
false
286
java
package Nanifarfalla.app.repository; import org.springframework.data.jpa.repository.JpaRepository; import org.springframework.stereotype.Repository; import Nanifarfalla.app.model.IgvVenta; @Repository public interface IgvVentaRepository extends JpaRepository<IgvVenta, Integer> { }
[ "joffre.hermosilla@gmail.com" ]
joffre.hermosilla@gmail.com
b366a988e8d6ea6e629928e65db66add5d94fcbd
61ca80dbb014ee6a513b5e6cceb485904e19b2ff
/mycop/src/main/java/com/gever/sysman/organization/dao/impl/oracle/OracleSQLFactory.java
1dd148bba553f1df5fab35115936acb8eb608454
[]
no_license
myosmatrix/mycop
3fbc1e243dfbb32fe9c4b3cef5f2bfa7d984f1f4
b1f0260ea8d21176ebc2fc06de47b523e22e27df
refs/heads/master
2021-05-29T13:10:02.076980
2010-09-11T15:23:34
2010-09-11T15:23:34
null
0
0
null
null
null
null
GB18030
Java
false
false
1,535
java
/* * 创建日期 2004-10-12 */ package com.gever.sysman.organization.dao.impl.oracle; import com.gever.sysman.organization.dao.impl.DefaultSQLFactory; import java.util.Properties; /** * * @author Hu.Walker */ public class OracleSQLFactory extends DefaultSQLFactory { private static Properties m_queries = null; private static String SQLFile = "com/gever/sysman/organization/dao/impl/oracle/sql.properties"; /** * 构造函数 */ public OracleSQLFactory() { if (m_queries == null) { m_queries = new Properties(); try { m_queries.load(getClass().getClassLoader().getResourceAsStream(SQLFile)); } catch (NullPointerException exc) { System.err.println("[SQLFactory] cannot get " + SQLFile); } catch (java.io.IOException exc) { System.err.println("[SQLFactory] cannot get " + SQLFile); } } } /** * Get the value for the query name * * @param queryName the name of the property * @return The value of the property */ public String get(String queryName) { String value = m_queries.getProperty(queryName); if (value == null) { value = super.get(queryName); } if (value == null) { System.err.println("[SQLFactory] query '" + queryName + "' not found in sql.properties!"); } return value; } }
[ "huhongjun@gmail.com" ]
huhongjun@gmail.com
0624b893ea47e7b13c3114162139762cdf15ce4b
d1a6d1e511df6db8d8dd0912526e3875c7e1797d
/genny_JavaWithoutLambdasApi21_ReducedClassCount/applicationModule/src/test/java/applicationModulepackageJava3/Foo356Test.java
1acec02bcb3f98eda9ff2b28359df03afa0ff867
[]
no_license
NikitaKozlov/generated-project-for-desugaring
0bc1443ab3ddc84cd289331c726761585766aea7
81506b3711004185070ca4bb9a93482b70011d36
refs/heads/master
2020-03-20T00:35:06.996525
2018-06-12T09:30:37
2018-06-12T09:30:37
137,049,317
0
0
null
null
null
null
UTF-8
Java
false
false
741
java
package applicationModulepackageJava3; import org.junit.Test; public class Foo356Test { @Test public void testFoo0() { new Foo356().foo0(); } @Test public void testFoo1() { new Foo356().foo1(); } @Test public void testFoo2() { new Foo356().foo2(); } @Test public void testFoo3() { new Foo356().foo3(); } @Test public void testFoo4() { new Foo356().foo4(); } @Test public void testFoo5() { new Foo356().foo5(); } @Test public void testFoo6() { new Foo356().foo6(); } @Test public void testFoo7() { new Foo356().foo7(); } @Test public void testFoo8() { new Foo356().foo8(); } @Test public void testFoo9() { new Foo356().foo9(); } }
[ "nikita.e.kozlov@gmail.com" ]
nikita.e.kozlov@gmail.com
06c6df7d6cb74446f5fa8284b0f72a5bcb426952
5148293c98b0a27aa223ea157441ac7fa9b5e7a3
/Method_Scraping/xml_scraping/NicadOutputFile_t1_beam_2nd/Nicad_t1_beam_2nd1848.java
77fe979b1625423cccf26f375455c8ce9b48087d
[]
no_license
ryosuke-ku/TestCodeSeacherPlus
cfd03a2858b67a05ecf17194213b7c02c5f2caff
d002a52251f5461598c7af73925b85a05cea85c6
refs/heads/master
2020-05-24T01:25:27.000821
2019-08-17T06:23:42
2019-08-17T06:23:42
187,005,399
0
0
null
null
null
null
UTF-8
Java
false
false
532
java
// clone pairs:8595:80% // 11729:beam/runners/flink/src/main/java/org/apache/beam/runners/flink/translation/wrappers/streaming/state/FlinkStateInternals.java public class Nicad_t1_beam_2nd1848 { public boolean equals(Object o) { if (this == o) { return true; } if (o == null || getClass() != o.getClass()) { return false; } FlinkMapState<?, ?> that = (FlinkMapState<?, ?>) o; return namespace.equals(that.namespace) && stateId.equals(that.stateId); } }
[ "naist1020@gmail.com" ]
naist1020@gmail.com
56470404ce918b9892e63f5e371806902c710e21
366a06b8a81e1f121a40b8d8e6f8e1ae507b5ecc
/app/src/main/java/be/ugent/zeus/hydra/sko/OverviewActivity.java
381048b02cfc644d0291dabff22a8fe9e9083ffa
[]
no_license
bhavyagera10/hydra-android
2c4ba76ee970da469fbf86fb1ecd685df0a6a189
5bd0f5defa3f1c3ea112e72cf885acdc294388a6
refs/heads/master
2022-09-26T16:02:40.614742
2020-05-04T09:53:09
2020-05-04T09:53:09
null
0
0
null
null
null
null
UTF-8
Java
false
false
1,568
java
package be.ugent.zeus.hydra.sko; import android.content.Context; import android.content.Intent; import android.os.Bundle; import android.view.Menu; import android.view.MenuItem; import androidx.annotation.Nullable; import be.ugent.zeus.hydra.R; import be.ugent.zeus.hydra.common.network.Endpoints; import be.ugent.zeus.hydra.common.ui.BaseActivity; import be.ugent.zeus.hydra.common.utils.NetworkUtils; /** * SKO overview activity. Only displays the line-up. * * @author Niko Strijbol */ public class OverviewActivity extends BaseActivity { private static final String SKO_WEBSITE = Endpoints.SKO; /** * Start the activity on the default tab. * * @param context The context. * * @return The intent to start the activity. */ public static Intent start(Context context) { return new Intent(context, OverviewActivity.class); } @Override protected void onCreate(@Nullable Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_sko_main); } @Override public boolean onCreateOptionsMenu(Menu menu) { getMenuInflater().inflate(R.menu.menu_sko, menu); tintToolbarIcons(menu, R.id.sko_visit_website); return true; } @Override public boolean onOptionsItemSelected(MenuItem item) { if (item.getItemId() == R.id.sko_visit_website) { NetworkUtils.maybeLaunchBrowser(this, SKO_WEBSITE); return true; } return super.onOptionsItemSelected(item); } }
[ "strijbol.niko@gmail.com" ]
strijbol.niko@gmail.com
c6aba044ddfb304e010500c209bc4db8d303cc4e
4e93bf76ea47854b9c27af21c65c4281aa919a24
/JAVA/efficientJava/mycodes/src/chapter04/item21/Comparator.java
c369e547998ce661bc4fbbdbeb6e3de249a42a31
[]
no_license
CodingWorker/enhancingProgram
fc4120b23007db4a36bb0cf102187cda63bf6153
0fc30474470597b377d9d652973520f4825b58f7
refs/heads/master
2021-01-12T05:11:16.285221
2017-12-25T14:24:13
2017-12-25T14:24:13
77,871,573
1
0
null
null
null
null
UTF-8
Java
false
false
161
java
package chapter04.item21; /** * Created by DaiYan on 2017/4/26. */ //定义一个策略接口 public interface Comparator<T> { int compare(T t1,T t2); }
[ "dy10010@sina.cn" ]
dy10010@sina.cn
f9df7f64ed5a5779daed8166aa5b6d072ee165ce
d0b2259b74644d2361a9e0fbfdca8af81bca3760
/src/main/java/com/example/demo/controller/InsertService.java
874e475961e6c9314a6ec7db970964c0d534d4fe
[]
no_license
tianyaleixiaowu/RocksdbBatch
68548a3014f266d48758fe03d141221b9f1dbd51
4ae3fe9af7c9543f56fd0a84ff665412b272bf78
refs/heads/master
2020-06-05T19:51:25.637887
2019-08-22T02:56:07
2019-08-22T02:56:07
192,530,797
0
0
null
null
null
null
UTF-8
Java
false
false
3,362
java
package com.example.demo.controller; import com.example.demo.redis.ImportToRedis; import org.springframework.beans.factory.annotation.Value; import org.springframework.data.redis.core.StringRedisTemplate; import org.springframework.stereotype.Service; import javax.annotation.PostConstruct; import javax.annotation.Resource; import java.util.ArrayList; import java.util.List; import java.util.concurrent.CountDownLatch; import java.util.concurrent.ExecutorService; import java.util.concurrent.Executors; /** * @author wuweifeng wrote on 2019/6/17. */ @Service public class InsertService { //@Resource //private DbStore dbStore; @Value("${thread.count}") private Integer threadCount; @Resource private StringRedisTemplate stringRedisTemplate; private ExecutorService executorService; @PostConstruct public void init() { executorService = Executors.newFixedThreadPool(8); } @SuppressWarnings("AlibabaThreadPoolCreation") public void insert(long number) { System.out.println("--------------------------------------当前号段" + number); //每次每个线程写入10万个 int batchSize = 100000; //这一亿个数,分多少次写入 int loopCount = 100000000 / batchSize; CountDownLatch countDownLatch = new CountDownLatch(loopCount); for (int i = 0; i < loopCount; i++) { List<String> tempList = new ArrayList<>(); for (long j = number + batchSize * i; j < number + (batchSize * (i + 1)); j++) { tempList.add(j + ""); } executorService.execute(new ImportToRedis(stringRedisTemplate, tempList, countDownLatch)); } try { countDownLatch.await(); System.out.println("-----------------------------插入完毕-------------------------"); } catch (InterruptedException e) { e.printStackTrace(); } } public void insertAll() { //18000000000L,18100000000L, 18200000000L,18300000000L,18400000000L,18500000000L, //13000000000L, 13100000000L, 13200000000L, 13300000000L, 13400000000L, 13500000000L, // 13600000000L, 13700000000L, 13800000000L, 13900000000L, 14500000000L, 14600000000L, // 14700000000L, 14800000000L, 14900000000L, 15000000000L, 15100000000L, 15200000000L, // 15300000000L, long[] array = { 15500000000L, 15600000000L, 15700000000L, 15800000000L, 15900000000L, 16500000000L, 16600000000L, 17000000000L, 17100000000L, 17200000000L, 17300000000L, 17400000000L, 17500000000L, 17600000000L, 17700000000L, 17800000000L, 18600000000L, 18000000000L, 18100000000L, 18200000000L, 18300000000L, 18400000000L, 18500000000L, 18700000000L, 18800000000L, 18900000000L, 19800000000L, 19900000000L}; CountDownLatch countDownLatch = new CountDownLatch(array.length); for (long num : array) { insert(num); countDownLatch.countDown(); } try { countDownLatch.await(); System.out.println("-----------------------------插入完毕-------------------------"); } catch (InterruptedException e) { e.printStackTrace(); } } }
[ "272551766@qq.com" ]
272551766@qq.com
1d34d002746d4addd1215c0369786c382ecb8d08
4fab44e9f3205863c0c4e888c9de1801919dc605
/AL-Game/data/scripts/system/handlers/quest/beluslan/_2553TheBrigadeGeneralsCall.java
cff32a09697a716c5a737fa6c9c3e45889d69c9a
[]
no_license
YggDrazil/AionLight9
fce24670dcc222adb888f4a5d2177f8f069fd37a
81f470775c8a0581034ed8c10d5462f85bef289a
refs/heads/master
2021-01-11T00:33:15.835333
2016-07-29T19:20:11
2016-07-29T19:20:11
70,515,345
2
0
null
null
null
null
UTF-8
Java
false
false
4,664
java
/** * This file is part of Aion-Lightning <aion-lightning.org>. * * Aion-Lightning is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * Aion-Lightning is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with Aion-Lightning. * If not, see <http://www.gnu.org/licenses/>. */ package quest.beluslan; import com.aionemu.gameserver.model.gameobjects.Npc; import com.aionemu.gameserver.model.gameobjects.player.Player; import com.aionemu.gameserver.network.aion.serverpackets.SM_DIALOG_WINDOW; import com.aionemu.gameserver.questEngine.handlers.QuestHandler; import com.aionemu.gameserver.model.DialogAction; import com.aionemu.gameserver.questEngine.model.QuestEnv; import com.aionemu.gameserver.questEngine.model.QuestState; import com.aionemu.gameserver.questEngine.model.QuestStatus; import com.aionemu.gameserver.utils.PacketSendUtility; /** * author : Altaress */ public class _2553TheBrigadeGeneralsCall extends QuestHandler { private final static int questId = 2553; public _2553TheBrigadeGeneralsCall() { super(questId); } @Override public void register() { qe.registerQuestNpc(798119).addOnQuestStart(questId); qe.registerQuestNpc(798119).addOnTalkEvent(questId); qe.registerQuestNpc(204702).addOnTalkEvent(questId); } @Override public boolean onDialogEvent(QuestEnv env) { final Player player = env.getPlayer(); int targetId = 0; if (env.getVisibleObject() instanceof Npc) { targetId = ((Npc) env.getVisibleObject()).getNpcId(); } QuestState qs = player.getQuestStateList().getQuestState(questId); if (targetId == 798119) { if (qs == null || qs.getStatus() == QuestStatus.NONE) { if (env.getDialog() == DialogAction.QUEST_SELECT) { return sendQuestDialog(env, 1011); } else { return sendQuestStartDialog(env); } } else if (qs != null && qs.getStatus() == QuestStatus.START) { if (env.getDialog() == DialogAction.QUEST_SELECT) { return sendQuestDialog(env, 2375); } else if (env.getDialogId() == DialogAction.SELECT_QUEST_REWARD.id()) { qs.setStatus(QuestStatus.REWARD); updateQuestStatus(env); PacketSendUtility.sendPacket(player, new SM_DIALOG_WINDOW(env.getVisibleObject().getObjectId(), 10)); return true; } else { return sendQuestEndDialog(env); } } else if (qs != null && qs.getStatus() == QuestStatus.REWARD) { return sendQuestEndDialog(env); } } else if (targetId == 204702) { if (qs != null && qs.getStatus() == QuestStatus.START && qs.getQuestVarById(0) == 0) { if (env.getDialog() == DialogAction.QUEST_SELECT) { return sendQuestDialog(env, 1352); } else if (env.getDialog() == DialogAction.SETPRO1) { qs.setQuestVarById(0, qs.getQuestVarById(0) + 1); updateQuestStatus(env); PacketSendUtility.sendPacket(player, new SM_DIALOG_WINDOW(env.getVisibleObject().getObjectId(), 10)); return true; } else { return sendQuestStartDialog(env); } } } else if (targetId == 798119) { if (qs != null) { if (env.getDialog() == DialogAction.QUEST_SELECT && qs.getStatus() == QuestStatus.START) { return sendQuestDialog(env, 2375); } else if (env.getDialogId() == DialogAction.SELECT_QUEST_REWARD.id() && qs.getStatus() != QuestStatus.COMPLETE && qs.getStatus() != QuestStatus.NONE) { qs.setQuestVar(3); qs.setStatus(QuestStatus.REWARD); updateQuestStatus(env); return sendQuestEndDialog(env); } else { return sendQuestEndDialog(env); } } } return false; } }
[ "michelgorter@outlook.com" ]
michelgorter@outlook.com
bdf3e7ec2224b8d504f724fe1d3733c3a6c3cc72
b8f680a3d5f9fa4a6c28fe5dbfc479ecb1079685
/src/ANXGallery/sources/com/miui/gallery/editor/photo/app/remover/RemoverAdapter.java
5111937bb30ae482318e8464e94c02bc9d5cb8d7
[]
no_license
nckmml/ANXGallery
fb6d4036f5d730f705172e524a038f9b62984c4c
392f7a28a34556b6784979dd5eddcd9e4ceaaa69
refs/heads/master
2020-12-19T05:07:14.669897
2020-01-22T15:56:10
2020-01-22T15:56:10
235,607,907
0
2
null
null
null
null
UTF-8
Java
false
false
2,435
java
package com.miui.gallery.editor.photo.app.remover; import android.content.Context; import android.view.View; import android.view.ViewGroup; import androidx.recyclerview.widget.RecyclerView; import com.miui.gallery.R; import com.miui.gallery.editor.photo.core.common.model.RemoverData; import com.miui.gallery.editor.photo.widgets.recyclerview.Selectable; import com.miui.gallery.util.ScreenUtils; import com.miui.gallery.widget.recyclerview.SimpleRecyclerView; import java.util.List; public class RemoverAdapter extends SimpleRecyclerView.Adapter<RemoverItemHolder> implements Selectable { private List<RemoverData> mDataList; private Selectable.Delegator mDelegator; private int mItemWidth; public RemoverAdapter(Context context, List<RemoverData> list, Selectable.Selector selector) { this.mDataList = list; this.mDelegator = new Selectable.Delegator(-1, selector); if (getItemCount() != 0) { this.mItemWidth = (int) ((((float) ScreenUtils.getScreenWidth()) - (context.getResources().getDimension(R.dimen.editor_menu_remove_item_start) * 2.0f)) / ((float) getItemCount())); } } public int getItemCount() { List<RemoverData> list = this.mDataList; if (list == null) { return 0; } return list.size(); } public int getSelection() { return this.mDelegator.getSelection(); } public void onAttachedToRecyclerView(RecyclerView recyclerView) { super.onAttachedToRecyclerView(recyclerView); this.mDelegator.onAttachedToRecyclerView(recyclerView); } public void onBindViewHolder(RemoverItemHolder removerItemHolder, int i) { super.onBindViewHolder(removerItemHolder, i); removerItemHolder.bind(this.mDataList.get(i)); this.mDelegator.onBindViewHolder(removerItemHolder, i); } public RemoverItemHolder onCreateViewHolder(ViewGroup viewGroup, int i) { View inflate = getInflater().inflate(R.layout.remover_menu_item, viewGroup, false); inflate.getLayoutParams().width = this.mItemWidth; return new RemoverItemHolder(inflate); } public void onDetachedFromRecyclerView(RecyclerView recyclerView) { super.onDetachedFromRecyclerView(recyclerView); this.mDelegator.onDetachedFromRecyclerView(recyclerView); } public void setSelection(int i) { this.mDelegator.setSelection(i); } }
[ "nico.kuemmel@gmail.com" ]
nico.kuemmel@gmail.com
9f0c8e94a8a7d15d42d4645b5417205c64caff67
0ca1884a6b89093cc9b81d93bb8e450c4ce2d509
/src/main/java/com/zheng/auth/domain/ControllerResource.java
68d2cb3cd29a05fe9a734410adf282df7deb14e1
[]
no_license
hanpang8983/auth-core
1fd4059ea90bd52d3a3537508d493303d7d6e104
732eeda33efd28f85e5622ef1f0a5e912f88f9d7
refs/heads/master
2021-01-17T08:56:24.110673
2016-01-09T05:00:33
2016-01-09T05:00:33
null
0
0
null
null
null
null
UTF-8
Java
false
false
2,047
java
package com.zheng.auth.domain; import javax.persistence.Entity; import javax.persistence.GeneratedValue; import javax.persistence.Id; import javax.persistence.JoinColumn; import javax.persistence.ManyToOne; import javax.persistence.Table; import org.apache.commons.lang3.StringUtils; /** * controller权限资源,管理controller类的操作 * * @author zhenglian * @data 2015年12月16日 下午9:51:02 */ @Entity @Table(name = "t_controller_resource") public class ControllerResource implements SystemResource { public static final String RES_TYPE = "controller"; @Id @GeneratedValue private Integer id; private String name; private String classname; // classname,默认使用类的权限类名,可能会存在多个值 private Integer orderNum; // 顺序 @ManyToOne @JoinColumn(name = "parentId") private ControllerResource parent; private String sn; // 用于在系统中显示标识,默认使用类简单名 private String psn; // 父级资源标识 public Integer getId() { return id; } public void setId(Integer id) { this.id = id; } public String getName() { return name; } public void setName(String name) { this.name = name; } public String getClassname() { return classname; } public void setClassname(String classname) { if (StringUtils.isBlank(this.classname)) { this.classname = classname; } else { if (this.classname.indexOf(classname) == -1) { this.classname += "|" + classname; } } } public Integer getOrderNum() { return orderNum; } public void setOrderNum(Integer orderNum) { this.orderNum = orderNum; } public ControllerResource getParent() { return parent; } public void setParent(ControllerResource parent) { this.parent = parent; } public String getSn() { return sn; } public void setSn(String sn) { this.sn = sn; } public String getPsn() { return psn; } public void setPsn(String psn) { this.psn = psn; } }
[ "736732419@qq.com" ]
736732419@qq.com
30f9c47d7af5d20e35b1a13972c5282359684fa0
fe02f3a48cd516469abce09fff7255e50279dbbb
/copybook-parser/src/main/java/com/asksunny/ebcdic/Field.java
ff124a115f080e1a000a354fdd818f8d976ce204
[ "MIT" ]
permissive
devsunny/app-galleries
149cd74d04f2547093e20c34ddaf86be289e2cce
98aed1b18031ded93056ad12bda5b2c62c40a85b
refs/heads/master
2022-12-21T05:20:40.210246
2018-09-20T01:40:20
2018-09-20T01:40:20
21,674,470
0
1
MIT
2022-12-16T06:42:58
2014-07-10T01:20:03
Java
UTF-8
Java
false
false
1,358
java
package com.asksunny.ebcdic; public class Field extends Entity { public static enum NumericType {BINARY, COMP, COMP1, COMP2, COMP3, NONE} private int length = 0; private int decimalLength = 0; private boolean implicitDecimal = false; private boolean singed = false; private NumericType numericType = NumericType.NONE; public Field() { super(); } public int getLength() { return length; } public void setLength(int length) { this.length = length; } public int getDecimalLength() { return decimalLength; } public void setDecimalLength(int decimalLength) { this.decimalLength = decimalLength; } public boolean isImplicitDecimal() { return implicitDecimal; } public void setImplicitDecimal(boolean implicitDecimal) { this.implicitDecimal = implicitDecimal; } public boolean isSinged() { return singed; } public void setSinged(boolean singed) { this.singed = singed; } @Override public String toString() { return "Field [getName()=" + getName() + ", getType()=" + getType() + ", length=" + length + ", decimalLength=" + decimalLength + ", implicitDecimal=" + implicitDecimal + ", singed=" + singed + "]"; } public NumericType getNumericType() { return numericType; } public void setNumericType(NumericType numericType) { this.numericType = numericType; } }
[ "sunnyliu2@gmail.com" ]
sunnyliu2@gmail.com
3064ea551232bf508d664133c83c47121415925d
7f223ec1ddfc88fd1e8732fe227a88fddc054926
/app/androidF/application/build/generated/source/kapt/debug/com/wy/adbook/di/module/GenderModule_ProvideAboutViewFactory.java
3509f71a880e5cb44d66d56ac9d4dfc7ad0abd1f
[]
no_license
sengeiou/qy_book_free
93da8933e0b1bd584bf974f97ed65063615917c4
42e35f88c24ce864de61d9f4f6921ca7df2970b7
refs/heads/master
2022-04-07T11:28:18.472504
2019-06-25T07:57:58
2019-06-25T07:57:58
null
0
0
null
null
null
null
UTF-8
Java
false
false
1,108
java
package com.wy.adbook.di.module; import com.wy.adbook.mvp.contranct.GenderContract; import dagger.internal.Factory; import dagger.internal.Preconditions; import javax.annotation.Generated; @Generated( value = "dagger.internal.codegen.ComponentProcessor", comments = "https://google.github.io/dagger" ) public final class GenderModule_ProvideAboutViewFactory implements Factory<GenderContract.View> { private final GenderModule module; public GenderModule_ProvideAboutViewFactory(GenderModule module) { this.module = module; } @Override public GenderContract.View get() { return Preconditions.checkNotNull( module.provideAboutView(), "Cannot return null from a non-@Nullable @Provides method"); } public static GenderModule_ProvideAboutViewFactory create(GenderModule module) { return new GenderModule_ProvideAboutViewFactory(module); } public static GenderContract.View proxyProvideAboutView(GenderModule instance) { return Preconditions.checkNotNull( instance.provideAboutView(), "Cannot return null from a non-@Nullable @Provides method"); } }
[ "chenchendedefeng@126.com" ]
chenchendedefeng@126.com
ced83681000fa24dd71da3c58bf16f7eb6375cf8
3f7a5d7c700199625ed2ab3250b939342abee9f1
/src/gcom/batch/atendimentopublico/BatchProgramacaoAutoRoteiroAcompServicoMDB.java
be26f2dccc42fc0fbf8544dac64382fa6e51828f
[]
no_license
prodigasistemas/gsan-caema
490cecbd2a784693de422d3a2033967d8063204d
87a472e07e608c557e471d555563d71c76a56ec5
refs/heads/master
2021-01-01T06:05:09.920120
2014-10-08T20:10:40
2014-10-08T20:10:40
24,958,220
1
0
null
null
null
null
ISO-8859-1
Java
false
false
2,829
java
package gcom.batch.atendimentopublico; import gcom.atendimentopublico.ordemservico.ControladorOrdemServicoLocal; import gcom.atendimentopublico.ordemservico.ControladorOrdemServicoLocalHome; import gcom.cadastro.unidade.UnidadeOrganizacional; import gcom.util.ConstantesJNDI; import gcom.util.ControladorException; import gcom.util.ServiceLocator; import gcom.util.ServiceLocatorException; import gcom.util.SistemaException; import java.util.Date; import javax.ejb.CreateException; import javax.ejb.EJBException; import javax.ejb.MessageDrivenBean; import javax.ejb.MessageDrivenContext; import javax.jms.JMSException; import javax.jms.Message; import javax.jms.MessageListener; import javax.jms.ObjectMessage; /** * [UC1190] Programação Automática do Roteiro para Acompanhamento das OS * * @author Sávio Luiz * @date 30/07/2011 */ public class BatchProgramacaoAutoRoteiroAcompServicoMDB implements MessageDrivenBean, MessageListener { private static final long serialVersionUID = 1L; public BatchProgramacaoAutoRoteiroAcompServicoMDB() { super(); } public void setMessageDrivenContext(MessageDrivenContext ctx) throws EJBException { } public void ejbRemove() throws EJBException { } public void onMessage(Message message) { if (message instanceof ObjectMessage) { ObjectMessage objectMessage = (ObjectMessage) message; try { this.getControladorOrdemServico().inserirProgramacaoAutomaticaAcompanhamentoOS( (UnidadeOrganizacional) ((Object[]) objectMessage.getObject())[0], (Date) ((Object[]) objectMessage.getObject())[1], (Integer) ((Object[]) objectMessage.getObject())[2]); } catch (JMSException e) { System.out.println("Erro no MDB"); e.printStackTrace(); } catch (ControladorException e) { System.out.println("Erro no MDB"); e.printStackTrace(); } } } private ControladorOrdemServicoLocal getControladorOrdemServico() { ControladorOrdemServicoLocalHome localHome = null; ControladorOrdemServicoLocal local = null; ServiceLocator locator = null; try { locator = ServiceLocator.getInstancia(); localHome = (ControladorOrdemServicoLocalHome) locator .getLocalHome(ConstantesJNDI.CONTROLADOR_ORDEM_SERVICO_SEJB); local = localHome.create(); return local; } catch (CreateException e) { throw new SistemaException(e); } catch (ServiceLocatorException e) { throw new SistemaException(e); } } /** * Default create method * * @throws CreateException */ public void ejbCreate() { } }
[ "felipesantos2089@gmail.com" ]
felipesantos2089@gmail.com
15675777e544e5dd96b4f18fa38ef0eea36e9ade
8d4a69e281915a8a68b0488db0e013b311942cf4
/spring-boot-project/spring-boot-test-autoconfigure/src/main/java/org/springframework/boot/test/autoconfigure/web/reactive/WebFluxTestContextBootstrapper.java
6ee1e41fcb933b24ac3ffc9213e525e938b4b5b6
[ "Apache-2.0" ]
permissive
yuanmabiji/spring-boot-2.1.0.RELEASE
798b4c29d25fdcb22fa3a0baf24a08ddd0dfa27e
6fe0467c9bc95d3849eb2ad5bae04fd9bdee3a82
refs/heads/master
2023-03-10T05:20:52.846557
2022-03-25T15:53:13
2022-03-25T15:53:13
252,902,347
320
107
Apache-2.0
2023-02-22T07:44:16
2020-04-04T03:49:51
Java
UTF-8
Java
false
false
1,768
java
/* * Copyright 2012-2018 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org.springframework.boot.test.autoconfigure.web.reactive; import org.springframework.boot.test.context.ReactiveWebMergedContextConfiguration; import org.springframework.boot.test.context.SpringBootTestContextBootstrapper; import org.springframework.core.annotation.AnnotatedElementUtils; import org.springframework.test.context.MergedContextConfiguration; import org.springframework.test.context.TestContextBootstrapper; /** * {@link TestContextBootstrapper} for {@link WebFluxTest @WebFluxTest} support. * * @author Stephane Nicoll * @author Artsiom Yudovin */ class WebFluxTestContextBootstrapper extends SpringBootTestContextBootstrapper { @Override protected MergedContextConfiguration processMergedContextConfiguration( MergedContextConfiguration mergedConfig) { return new ReactiveWebMergedContextConfiguration( super.processMergedContextConfiguration(mergedConfig)); } @Override protected String[] getProperties(Class<?> testClass) { WebFluxTest annotation = AnnotatedElementUtils.getMergedAnnotation(testClass, WebFluxTest.class); return (annotation != null) ? annotation.properties() : null; } }
[ "983656956@qq.com" ]
983656956@qq.com
50a5dad39fe0877c12e4fd934bae73c13d15f491
54dfc385cd2b6ececd0888c3defeb9c26a147ed8
/src/main/java/com/helospark/telnetsnake/game/jcommander/JCommanderUsagePrinter.java
e2953651b5582e3f6d2c96065cf5c7da43c2c7ef
[ "MIT" ]
permissive
helospark/telnet-snake
cede31df47325d386193ae044f6ea1f9d85d6898
625b10464553da46c722a8e86bcc98bb1c6d040d
refs/heads/master
2022-07-13T22:15:19.903314
2019-06-20T18:05:44
2019-06-20T18:05:44
86,938,156
4
1
MIT
2022-05-20T20:47:20
2017-04-01T19:41:23
Java
UTF-8
Java
false
false
702
java
package com.helospark.telnetsnake.game.jcommander; import com.helospark.lightdi.annotation.Autowired; import com.helospark.lightdi.annotation.Component; import com.beust.jcommander.JCommander; import com.helospark.telnetsnake.game.output.ScreenWriter; @Component public class JCommanderUsagePrinter { private final ScreenWriter screenWriter; @Autowired public JCommanderUsagePrinter(ScreenWriter screenWriter) { this.screenWriter = screenWriter; } public void printUsage(JCommander jCommander) { StringBuilder stringBuilder = new StringBuilder(); jCommander.usage(stringBuilder); screenWriter.printlnToScreen(stringBuilder.toString()); } }
[ "helospark@gmail.com" ]
helospark@gmail.com
e7925bb3ad5a40895ea0fa91e99952ff1506a9db
3883554587c8f3f75a7bebd746e1269b8e1e5ef1
/kubernetes-model-generator/openshift-model/src/generated/java/io/fabric8/openshift/api/model/IBMCloudPlatformStatus.java
bb705c4041aeadfad1dc8effa951072936a09fc3
[ "Apache-2.0" ]
permissive
KamalSinghKhanna/kubernetes-client
58f663fdc0ca4b6006ae1448ac89b04b6093e46d
08261fba6c9306eb063534ec2320e9166f85c71c
refs/heads/master
2023-08-17T04:33:28.646984
2021-09-23T17:17:24
2021-09-23T17:17:24
409,863,910
1
0
Apache-2.0
2021-09-24T06:55:57
2021-09-24T06:55:57
null
UTF-8
Java
false
false
3,994
java
package io.fabric8.openshift.api.model; import java.util.HashMap; import java.util.Map; import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import io.fabric8.kubernetes.api.model.Container; import io.fabric8.kubernetes.api.model.IntOrString; import io.fabric8.kubernetes.api.model.KubernetesResource; import io.fabric8.kubernetes.api.model.LabelSelector; import io.fabric8.kubernetes.api.model.LocalObjectReference; import io.fabric8.kubernetes.api.model.ObjectMeta; import io.fabric8.kubernetes.api.model.ObjectReference; import io.fabric8.kubernetes.api.model.PersistentVolumeClaim; import io.fabric8.kubernetes.api.model.PodTemplateSpec; import io.fabric8.kubernetes.api.model.ResourceRequirements; import io.sundr.builder.annotations.Buildable; import io.sundr.builder.annotations.BuildableReference; import lombok.EqualsAndHashCode; import lombok.ToString; @JsonDeserialize(using = com.fasterxml.jackson.databind.JsonDeserializer.None.class) @JsonInclude(JsonInclude.Include.NON_NULL) @JsonPropertyOrder({ "apiVersion", "kind", "metadata", "location", "providerType", "resourceGroupName" }) @ToString @EqualsAndHashCode @Buildable(editableEnabled = false, validationEnabled = false, generateBuilderPackage = false, lazyCollectionInitEnabled = false, builderPackage = "io.fabric8.kubernetes.api.builder", refs = { @BuildableReference(ObjectMeta.class), @BuildableReference(LabelSelector.class), @BuildableReference(Container.class), @BuildableReference(PodTemplateSpec.class), @BuildableReference(ResourceRequirements.class), @BuildableReference(IntOrString.class), @BuildableReference(ObjectReference.class), @BuildableReference(LocalObjectReference.class), @BuildableReference(PersistentVolumeClaim.class) }) public class IBMCloudPlatformStatus implements KubernetesResource { @JsonProperty("location") private String location; @JsonProperty("providerType") private String providerType; @JsonProperty("resourceGroupName") private String resourceGroupName; @JsonIgnore private Map<String, Object> additionalProperties = new HashMap<String, Object>(); /** * No args constructor for use in serialization * */ public IBMCloudPlatformStatus() { } /** * * @param resourceGroupName * @param location * @param providerType */ public IBMCloudPlatformStatus(String location, String providerType, String resourceGroupName) { super(); this.location = location; this.providerType = providerType; this.resourceGroupName = resourceGroupName; } @JsonProperty("location") public String getLocation() { return location; } @JsonProperty("location") public void setLocation(String location) { this.location = location; } @JsonProperty("providerType") public String getProviderType() { return providerType; } @JsonProperty("providerType") public void setProviderType(String providerType) { this.providerType = providerType; } @JsonProperty("resourceGroupName") public String getResourceGroupName() { return resourceGroupName; } @JsonProperty("resourceGroupName") public void setResourceGroupName(String resourceGroupName) { this.resourceGroupName = resourceGroupName; } @JsonAnyGetter public Map<String, Object> getAdditionalProperties() { return this.additionalProperties; } @JsonAnySetter public void setAdditionalProperty(String name, Object value) { this.additionalProperties.put(name, value); } }
[ "marc@marcnuri.com" ]
marc@marcnuri.com
a9473ed141c977c7873a0c2c153632165bc594a3
dc1dbb7e5a4b95bf44170d2f51fd08b3814f2ac9
/data_defect4j/preprossed_method_corpus/Math/9/org/apache/commons/math3/stat/inference/TestUtils_rootLogLikelihoodRatio_423.java
84b8d83ee9b69eda6b520a79dd211bc8d63215af
[]
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
890
java
org apach common math3 stat infer collect method creat infer test instanc perform infer test version test util testutil org apach common math3 stat infer test gtest root log likelihood ratio rootloglikelihoodratio root log likelihood ratio rootloglikelihoodratio k11 k12 k21 k22 dimens mismatch except dimensionmismatchexcept posit except notpositiveexcept except zeroexcept test root log likelihood ratio rootloglikelihoodratio k11 k12 k21 k22
[ "hvdthong@gmail.com" ]
hvdthong@gmail.com
6e1b7856e1bcbfbfa844e37a833e1de811418308
15b260ccada93e20bb696ae19b14ec62e78ed023
/v2/src/main/java/com/alipay/api/domain/ChannelPutPlanDetailDTO.java
8cf2d40d0fca03387d13da03509e9dcd402bebd5
[ "Apache-2.0" ]
permissive
alipay/alipay-sdk-java-all
df461d00ead2be06d834c37ab1befa110736b5ab
8cd1750da98ce62dbc931ed437f6101684fbb66a
refs/heads/master
2023-08-27T03:59:06.566567
2023-08-22T14:54:57
2023-08-22T14:54:57
132,569,986
470
207
Apache-2.0
2022-12-25T07:37:40
2018-05-08T07:19:22
Java
UTF-8
Java
false
false
7,863
java
package com.alipay.api.domain; import java.util.Date; import java.util.List; import com.alipay.api.AlipayObject; import com.alipay.api.internal.mapping.ApiField; import com.alipay.api.internal.mapping.ApiListField; /** * 投放计划详情数据对象 * * @author auto create * @since 1.0, 2022-09-13 20:39:08 */ public class ChannelPutPlanDetailDTO extends AlipayObject { private static final long serialVersionUID = 1836156823249678473L; /** * 已有活动页面 code */ @ApiField("activity_page") private String activityPage; /** * 已有活动页面名称 */ @ApiField("activity_page_name") private String activityPageName; /** * 已有活动页面链接 */ @ApiField("activity_page_url") private String activityPageUrl; /** * 活动主标题 */ @ApiField("activity_title") private String activityTitle; /** * 权益描述 */ @ApiField("benefit_desc") private String benefitDesc; /** * 计费方式 */ @ApiField("bill_way") private String billWay; /** * 渠道 code,渠道信息唯一标识 */ @ApiField("channel_code") private String channelCode; /** * 投放计划绑定渠道 id */ @ApiField("channel_id") private Long channelId; /** * 投放计划绑定的渠道名称 */ @ApiField("channel_name") private String channelName; /** * 创建人 id */ @ApiField("creator_id") private String creatorId; /** * 创建人名称 */ @ApiField("creator_name") private String creatorName; /** * 人群 id 集合 */ @ApiListField("crowd_ids") @ApiField("string") private List<String> crowdIds; /** * 人群信息 */ @ApiListField("crowd_info") @ApiField("channel_put_plan_crowd_d_t_o") private List<ChannelPutPlanCrowdDTO> crowdInfo; /** * 自定义活动页面地址 */ @ApiField("customize_page") private String customizePage; /** * 详情页标题 */ @ApiField("detail_page_title") private String detailPageTitle; /** * 创建时间 */ @ApiField("gmt_create") private Date gmtCreate; /** * 更新时间 */ @ApiField("gmt_modified") private Date gmtModified; /** * 计划结束时间 */ @ApiField("gmt_plan_end") private Date gmtPlanEnd; /** * 计划开始时间 */ @ApiField("gmt_plan_start") private Date gmtPlanStart; /** * 投放计划主键 id */ @ApiField("id") private Long id; /** * 修改人 id */ @ApiField("modifier_id") private String modifierId; /** * 修改人名称 */ @ApiField("modifier_name") private String modifierName; /** * 投放计划名称 */ @ApiField("name") private String name; /** * 投放计划关联的页面类型 */ @ApiField("page_type") private String pageType; /** * 列表页展示图 */ @ApiField("pic_url") private String picUrl; /** * 投放计划拒绝原因 */ @ApiField("reject_reason") private String rejectReason; /** * 投放描述+不唯一+投放计划修改+数据库获取 */ @ApiField("rule_text") private String ruleText; /** * 投放计划状态值 */ @ApiField("status") private String status; /** * 运营增长活动 id */ @ApiField("task_id") private Long taskId; /** * 运营增长活动名称 */ @ApiField("task_name") private String taskName; /** * 所属租户 code */ @ApiField("tenant_code") private String tenantCode; public String getActivityPage() { return this.activityPage; } public void setActivityPage(String activityPage) { this.activityPage = activityPage; } public String getActivityPageName() { return this.activityPageName; } public void setActivityPageName(String activityPageName) { this.activityPageName = activityPageName; } public String getActivityPageUrl() { return this.activityPageUrl; } public void setActivityPageUrl(String activityPageUrl) { this.activityPageUrl = activityPageUrl; } public String getActivityTitle() { return this.activityTitle; } public void setActivityTitle(String activityTitle) { this.activityTitle = activityTitle; } public String getBenefitDesc() { return this.benefitDesc; } public void setBenefitDesc(String benefitDesc) { this.benefitDesc = benefitDesc; } public String getBillWay() { return this.billWay; } public void setBillWay(String billWay) { this.billWay = billWay; } public String getChannelCode() { return this.channelCode; } public void setChannelCode(String channelCode) { this.channelCode = channelCode; } public Long getChannelId() { return this.channelId; } public void setChannelId(Long channelId) { this.channelId = channelId; } public String getChannelName() { return this.channelName; } public void setChannelName(String channelName) { this.channelName = channelName; } public String getCreatorId() { return this.creatorId; } public void setCreatorId(String creatorId) { this.creatorId = creatorId; } public String getCreatorName() { return this.creatorName; } public void setCreatorName(String creatorName) { this.creatorName = creatorName; } public List<String> getCrowdIds() { return this.crowdIds; } public void setCrowdIds(List<String> crowdIds) { this.crowdIds = crowdIds; } public List<ChannelPutPlanCrowdDTO> getCrowdInfo() { return this.crowdInfo; } public void setCrowdInfo(List<ChannelPutPlanCrowdDTO> crowdInfo) { this.crowdInfo = crowdInfo; } public String getCustomizePage() { return this.customizePage; } public void setCustomizePage(String customizePage) { this.customizePage = customizePage; } public String getDetailPageTitle() { return this.detailPageTitle; } public void setDetailPageTitle(String detailPageTitle) { this.detailPageTitle = detailPageTitle; } public Date getGmtCreate() { return this.gmtCreate; } public void setGmtCreate(Date gmtCreate) { this.gmtCreate = gmtCreate; } public Date getGmtModified() { return this.gmtModified; } public void setGmtModified(Date gmtModified) { this.gmtModified = gmtModified; } public Date getGmtPlanEnd() { return this.gmtPlanEnd; } public void setGmtPlanEnd(Date gmtPlanEnd) { this.gmtPlanEnd = gmtPlanEnd; } public Date getGmtPlanStart() { return this.gmtPlanStart; } public void setGmtPlanStart(Date gmtPlanStart) { this.gmtPlanStart = gmtPlanStart; } public Long getId() { return this.id; } public void setId(Long id) { this.id = id; } public String getModifierId() { return this.modifierId; } public void setModifierId(String modifierId) { this.modifierId = modifierId; } public String getModifierName() { return this.modifierName; } public void setModifierName(String modifierName) { this.modifierName = modifierName; } public String getName() { return this.name; } public void setName(String name) { this.name = name; } public String getPageType() { return this.pageType; } public void setPageType(String pageType) { this.pageType = pageType; } public String getPicUrl() { return this.picUrl; } public void setPicUrl(String picUrl) { this.picUrl = picUrl; } public String getRejectReason() { return this.rejectReason; } public void setRejectReason(String rejectReason) { this.rejectReason = rejectReason; } public String getRuleText() { return this.ruleText; } public void setRuleText(String ruleText) { this.ruleText = ruleText; } public String getStatus() { return this.status; } public void setStatus(String status) { this.status = status; } public Long getTaskId() { return this.taskId; } public void setTaskId(Long taskId) { this.taskId = taskId; } public String getTaskName() { return this.taskName; } public void setTaskName(String taskName) { this.taskName = taskName; } public String getTenantCode() { return this.tenantCode; } public void setTenantCode(String tenantCode) { this.tenantCode = tenantCode; } }
[ "auto-publish" ]
auto-publish
849bdef46ef0bf410f740ad20afe4a47abec05d7
8b6818bbf9bf5a13644e30e4f3b8f91ed6567e05
/src/main/java/com/github/wnameless/spring/bulkapi/DefaultBulkApiService.java
1382327dd59fee7f1f1372d9687b37b607f513d0
[ "Apache-2.0" ]
permissive
ebann/spring-bulk-api
13f76091dce212fd2ccff73a57ac4dd33d9e12db
7e60e88f520906c82de6d69f6c1d7ce97ad9c597
refs/heads/master
2020-03-13T13:39:31.388669
2018-03-09T09:12:30
2018-03-09T09:12:30
131,143,165
0
0
null
2018-04-26T11:02:52
2018-04-26T11:02:52
null
UTF-8
Java
false
false
5,502
java
/* * * Copyright 2016 Wei-Ming Wu * * 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.github.wnameless.spring.bulkapi; import static org.springframework.http.HttpStatus.PAYLOAD_TOO_LARGE; import static org.springframework.http.HttpStatus.UNPROCESSABLE_ENTITY; import java.net.URI; import java.net.URISyntaxException; import java.util.ArrayList; import java.util.List; import java.util.Map.Entry; import javax.servlet.http.HttpServletRequest; import org.springframework.context.ApplicationContext; import org.springframework.core.env.Environment; import org.springframework.http.HttpMethod; import org.springframework.http.RequestEntity; import org.springframework.http.RequestEntity.BodyBuilder; import org.springframework.http.ResponseEntity; import org.springframework.util.LinkedMultiValueMap; import org.springframework.util.MultiValueMap; import org.springframework.web.client.RestTemplate; /** * * {@link DefaultBulkApiService} id the default implementation of * {@link BulkApiService}. * */ public class DefaultBulkApiService implements BulkApiService { private final ApplicationContext appCtx; private final Environment env; private BulkApiValidator validator; /** * Creates a {@link DefaultBulkApiService}. * * @param appCtx * the Spring {@link ApplicationContext} */ public DefaultBulkApiService(ApplicationContext appCtx) { this.appCtx = appCtx; env = appCtx.getEnvironment(); } private BulkApiValidator validator() { if (validator == null) validator = new BulkApiValidator(appCtx); return validator; } @Override public BulkResponse bulk(BulkRequest req, HttpServletRequest servReq) { validateBulkRequest(req, servReq); List<BulkResult> results = new ArrayList<BulkResult>(); RestTemplate template = new RestTemplate(); for (BulkOperation op : req.getOperations()) { BodyBuilder bodyBuilder = RequestEntity.method(// httpMethod(op.getMethod()), computeUri(servReq, op)); ResponseEntity<String> rawRes = template.exchange(requestEntity(bodyBuilder, op), String.class); if (!op.isSilent()) results.add(buldResult(rawRes)); } return new BulkResponse(results); } private RequestEntity<MultiValueMap<String, Object>> requestEntity( BodyBuilder bodyBuilder, BulkOperation op) { for (Entry<String, String> header : op.getHeaders().entrySet()) { bodyBuilder.header(header.getKey(), header.getValue()); } MultiValueMap<String, Object> params = new LinkedMultiValueMap<String, Object>(); for (Entry<String, ?> param : op.getParams().entrySet()) { params.add(param.getKey(), param.getValue()); } return bodyBuilder.body(params); } private URI computeUri(HttpServletRequest servReq, BulkOperation op) { String rawUrl = servReq.getRequestURL().toString(); String rawUri = servReq.getRequestURI().toString(); if (op.getUrl() == null || isBulkPath(op.getUrl())) { throw new BulkApiException(UNPROCESSABLE_ENTITY, "Invalid URL(" + rawUri + ") exists in this bulk request"); } URI uri; try { String servletPath = rawUrl.substring(0, rawUrl.indexOf(rawUri)); uri = new URI(servletPath + urlify(op.getUrl())); } catch (URISyntaxException e) { throw new BulkApiException(UNPROCESSABLE_ENTITY, "Invalid URL(" + urlify(op.getUrl()) + ") exists in this bulk request"); } if (!validator().validatePath(urlify(op.getUrl()), httpMethod(op.getMethod()))) { throw new BulkApiException(UNPROCESSABLE_ENTITY, "Invalid URL(" + urlify(op.getUrl()) + ") exists in this bulk request"); } return uri; } private boolean isBulkPath(String url) { String bulkPath = urlify(env.getProperty("spring.bulk.api.path", "/bulk")); url = urlify(url); return url.equals(bulkPath) || url.startsWith(bulkPath + "/"); } private String urlify(String url) { url = url.trim(); return url.startsWith("/") ? url : "/" + url; } private BulkResult buldResult(ResponseEntity<String> rawRes) { BulkResult res = new BulkResult(); res.setStatus(Short.valueOf(rawRes.getStatusCode().toString())); res.setHeaders(rawRes.getHeaders().toSingleValueMap()); res.setBody(rawRes.getBody()); return res; } private void validateBulkRequest(BulkRequest req, HttpServletRequest servReq) { int max = env.getProperty("spring.bulk.api.limit", int.class, 100); if (req.getOperations().size() > max) { throw new BulkApiException(PAYLOAD_TOO_LARGE, "Bulk operations exceed the limitation(" + max + ")"); } // Check if any invalid URL exists for (BulkOperation op : req.getOperations()) { computeUri(servReq, op); } } private static HttpMethod httpMethod(String method) { try { return HttpMethod.valueOf(method.toUpperCase()); } catch (Exception e) { return HttpMethod.GET; } } }
[ "wnameless@gmail.com" ]
wnameless@gmail.com
61c75ee611f573c7fc6a29e67e5b82ff229da7cc
3389348b101e48c482476ffb8c172712981286a8
/src/CL7/IOStream/ReverseStream/Demo2OutputStreamWriter.java
ae73b0258c3130078b322e1cf1529337fd8d7186
[]
no_license
7IsEnough/workspace4Java
2b78c0d11acc181f85642b5131959e0b9bd88843
154871364907aadb7f70ccd9d606e9c1b2b0b021
refs/heads/master
2023-03-09T20:17:28.867838
2021-02-20T11:44:48
2021-02-20T11:44:48
340,636,805
0
0
null
null
null
null
UTF-8
Java
false
false
1,629
java
package CL7.IOStream.ReverseStream; import java.io.FileOutputStream; import java.io.IOException; import java.io.OutputStreamWriter; /** * @author Promise * @create 2019-08-21-9:56 */ public class Demo2OutputStreamWriter { public static void main(String[] args) throws IOException { write_utf_8(); write_gbk(); } // 使用转换流OutputStreamWriter写UTF-8格式的文件 private static void write_utf_8() throws IOException { //创建OutputStreamWriter对象,构造方法中传递字节输出流和指定的编码表名称 OutputStreamWriter osw = new OutputStreamWriter(new FileOutputStream("G:\\workspace4Java\\utf_8.txt"),"utf-8"); //使用write方法,把字符转换为字节存储缓冲区中(编码) osw.write("你好"); //使用flush方法,把内存缓冲区的字节刷新到文件中(使用字节流写字节的过程) osw.flush(); //释放资源 osw.close(); } // 使用转换流OutputStreamWriter写gbk格式的文件 private static void write_gbk() throws IOException { //创建OutputStreamWriter对象,构造方法中传递字节输出流和指定的编码表名称 OutputStreamWriter osw = new OutputStreamWriter(new FileOutputStream("G:\\workspace4Java\\gbk.txt"),"gbk"); //使用write方法,把字符转换为字节存储缓冲区中(编码) osw.write("你好"); //使用flush方法,把内存缓冲区的字节刷新到文件中(使用字节流写字节的过程) osw.flush(); //释放资源 osw.close(); } }
[ "976949689@qq.com" ]
976949689@qq.com
6c86dffdfaaff05f9e6f320afdd0ec9cad1ca6c4
bceba483c2d1831f0262931b7fc72d5c75954e18
/src/qubed/corelogic/HMDADispositionEnum.java
b78a44e97a272e2f7f9fae8efba4445d9e576fd3
[]
no_license
Nigel-Qubed/credit-services
6e2acfdb936ab831a986fabeb6cefa74f03c672c
21402c6d4328c93387fd8baf0efd8972442d2174
refs/heads/master
2022-12-01T02:36:57.495363
2020-08-10T17:26:07
2020-08-10T17:26:07
285,552,565
0
1
null
null
null
null
UTF-8
Java
false
false
7,296
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: 2020.08.05 at 04:46:29 AM CAT // package qubed.corelogic; import java.util.HashMap; import java.util.Map; import javax.xml.bind.annotation.XmlAccessType; import javax.xml.bind.annotation.XmlAccessorType; import javax.xml.bind.annotation.XmlAnyAttribute; import javax.xml.bind.annotation.XmlAttribute; import javax.xml.bind.annotation.XmlType; import javax.xml.bind.annotation.XmlValue; import javax.xml.bind.annotation.adapters.CollapsedStringAdapter; import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter; import javax.xml.namespace.QName; /** * A value from a MISMO prescribed list that specifies the type of action taken on the application or HMDA covered loan. * * <p>Java class for HMDADispositionEnum complex type. * * <p>The following schema fragment specifies the expected content contained within this class. * * <pre> * &lt;complexType name="HMDADispositionEnum"> * &lt;simpleContent> * &lt;extension base="&lt;http://www.mismo.org/residential/2009/schemas>HMDADispositionBase"> * &lt;attGroup ref="{http://www.mismo.org/residential/2009/schemas}AttributeExtension"/> * &lt;attGroup ref="{http://www.w3.org/1999/xlink}MISMOresourceLink"/> * &lt;attribute name="DataNotSuppliedReasonType" type="{http://www.mismo.org/residential/2009/schemas}DataNotSuppliedReasonBase" /> * &lt;attribute name="DataNotSuppliedReasonTypeAdditionalDescription" type="{http://www.mismo.org/residential/2009/schemas}MISMOString_Base" /> * &lt;attribute name="DataNotSuppliedReasonTypeOtherDescription" type="{http://www.mismo.org/residential/2009/schemas}MISMOString_Base" /> * &lt;attribute name="SensitiveIndicator" type="{http://www.mismo.org/residential/2009/schemas}MISMOIndicator_Base" /> * &lt;anyAttribute processContents='lax'/> * &lt;/extension> * &lt;/simpleContent> * &lt;/complexType> * </pre> * * */ @XmlAccessorType(XmlAccessType.FIELD) @XmlType(name = "HMDADispositionEnum", propOrder = { "value" }) public class HMDADispositionEnum { @XmlValue protected HMDADispositionBase value; @XmlAttribute(name = "DataNotSuppliedReasonType") protected DataNotSuppliedReasonBase dataNotSuppliedReasonType; @XmlAttribute(name = "DataNotSuppliedReasonTypeAdditionalDescription") protected String dataNotSuppliedReasonTypeAdditionalDescription; @XmlAttribute(name = "DataNotSuppliedReasonTypeOtherDescription") protected String dataNotSuppliedReasonTypeOtherDescription; @XmlAttribute(name = "SensitiveIndicator") protected Boolean sensitiveIndicator; @XmlAttribute(name = "label", namespace = "http://www.w3.org/1999/xlink") @XmlJavaTypeAdapter(CollapsedStringAdapter.class) protected String label; @XmlAnyAttribute private Map<QName, String> otherAttributes = new HashMap<QName, String>(); /** * Term: HMDA Disposition Type Definition: A value from a MISMO prescribed list that specifies the type of action taken on the application or HMDA covered loan. * * @return * possible object is * {@link HMDADispositionBase } * */ public HMDADispositionBase getValue() { return value; } /** * Sets the value of the value property. * * @param value * allowed object is * {@link HMDADispositionBase } * */ public void setValue(HMDADispositionBase value) { this.value = value; } /** * Gets the value of the dataNotSuppliedReasonType property. * * @return * possible object is * {@link DataNotSuppliedReasonBase } * */ public DataNotSuppliedReasonBase getDataNotSuppliedReasonType() { return dataNotSuppliedReasonType; } /** * Sets the value of the dataNotSuppliedReasonType property. * * @param value * allowed object is * {@link DataNotSuppliedReasonBase } * */ public void setDataNotSuppliedReasonType(DataNotSuppliedReasonBase value) { this.dataNotSuppliedReasonType = value; } /** * Gets the value of the dataNotSuppliedReasonTypeAdditionalDescription property. * * @return * possible object is * {@link String } * */ public String getDataNotSuppliedReasonTypeAdditionalDescription() { return dataNotSuppliedReasonTypeAdditionalDescription; } /** * Sets the value of the dataNotSuppliedReasonTypeAdditionalDescription property. * * @param value * allowed object is * {@link String } * */ public void setDataNotSuppliedReasonTypeAdditionalDescription(String value) { this.dataNotSuppliedReasonTypeAdditionalDescription = value; } /** * Gets the value of the dataNotSuppliedReasonTypeOtherDescription property. * * @return * possible object is * {@link String } * */ public String getDataNotSuppliedReasonTypeOtherDescription() { return dataNotSuppliedReasonTypeOtherDescription; } /** * Sets the value of the dataNotSuppliedReasonTypeOtherDescription property. * * @param value * allowed object is * {@link String } * */ public void setDataNotSuppliedReasonTypeOtherDescription(String value) { this.dataNotSuppliedReasonTypeOtherDescription = value; } /** * Gets the value of the sensitiveIndicator property. * * @return * possible object is * {@link Boolean } * */ public Boolean isSensitiveIndicator() { return sensitiveIndicator; } /** * Sets the value of the sensitiveIndicator property. * * @param value * allowed object is * {@link Boolean } * */ public void setSensitiveIndicator(Boolean value) { this.sensitiveIndicator = value; } /** * Gets the value of the label property. * * @return * possible object is * {@link String } * */ public String getLabel() { return label; } /** * Sets the value of the label property. * * @param value * allowed object is * {@link String } * */ public void setLabel(String value) { this.label = value; } /** * Gets a map that contains attributes that aren't bound to any typed property on this class. * * <p> * the map is keyed by the name of the attribute and * the value is the string value of the attribute. * * the map returned by this method is live, and you can add new attribute * by updating the map directly. Because of this design, there's no setter. * * * @return * always non-null */ public Map<QName, String> getOtherAttributes() { return otherAttributes; } }
[ "vectorcrael@yahoo.com" ]
vectorcrael@yahoo.com
d377b63c74770b0f36227313c13f82fbcfdb50cf
d44961b736d956be5e294d3e6def8ffb008376ee
/crp-rule-stomach/src/main/java/com/clinical/service/FollowUpService.java
f1910bc2c37cf6d68a95f29c2488908a083a8022
[]
no_license
zhiji6/rule-2
2b5062f2e77797a87e43061b190d90fef5bbdbd8
cb58cde99257242bd0c394f75f1f2d02dd00b5c2
refs/heads/master
2023-08-15T06:21:07.833357
2021-03-06T08:28:14
2021-03-06T08:28:14
null
0
0
null
null
null
null
UTF-8
Java
false
false
217
java
package com.clinical.service; import com.clinical.model.cluster.FollowUp; public interface FollowUpService { public void saveFollowUp(FollowUp followUp); public void deleteFollowUp(String uniqueId); }
[ "sdlqmc@yeah.net" ]
sdlqmc@yeah.net
b1c1a7176b720e2c0a67172ab2b2d7e46c4e1d6a
6fa701cdaa0d83caa0d3cbffe39b40e54bf3d386
/google/cloud/asset/v1/google-cloud-asset-v1-java/proto-google-cloud-asset-v1-java/src/main/java/com/google/cloud/asset/v1/ListFeedsRequestOrBuilder.java
be5ab609718906ded1bf4b95609e9e5873551652
[ "Apache-2.0" ]
permissive
oltoco/googleapis-gen
bf40cfad61b4217aca07068bd4922a86e3bbd2d5
00ca50bdde80906d6f62314ef4f7630b8cdb6e15
refs/heads/master
2023-07-17T22:11:47.848185
2021-08-29T20:39:47
2021-08-29T20:39:47
null
0
0
null
null
null
null
UTF-8
Java
false
true
1,184
java
// Generated by the protocol buffer compiler. DO NOT EDIT! // source: google/cloud/asset/v1/asset_service.proto package com.google.cloud.asset.v1; public interface ListFeedsRequestOrBuilder extends // @@protoc_insertion_point(interface_extends:google.cloud.asset.v1.ListFeedsRequest) com.google.protobuf.MessageOrBuilder { /** * <pre> * Required. The parent project/folder/organization whose feeds are to be * listed. It can only be using project/folder/organization number (such as * "folders/12345")", or a project ID (such as "projects/my-project-id"). * </pre> * * <code>string parent = 1 [(.google.api.field_behavior) = REQUIRED];</code> * @return The parent. */ java.lang.String getParent(); /** * <pre> * Required. The parent project/folder/organization whose feeds are to be * listed. It can only be using project/folder/organization number (such as * "folders/12345")", or a project ID (such as "projects/my-project-id"). * </pre> * * <code>string parent = 1 [(.google.api.field_behavior) = REQUIRED];</code> * @return The bytes for parent. */ com.google.protobuf.ByteString getParentBytes(); }
[ "bazel-bot-development[bot]@users.noreply.github.com" ]
bazel-bot-development[bot]@users.noreply.github.com
0db9b15b688312c50d2f1a2bcefbb8ac602ac31d
15d55ff9cddff64dd1460b0134d98803adac2f44
/gulimall-product/src/main/java/cn/lxtkj/gulimall/product/feign/SearchFeignService.java
64505357288cb908992d86053fa726fa16de3e57
[ "Apache-2.0" ]
permissive
leiphp/gulimall
b70bb4ac62b09bca61b5d321240ad4018401ab4c
6c53e6db69444cac73899f97e1d5c47b8d5fb43a
refs/heads/master
2023-08-22T22:14:29.676944
2021-10-18T09:42:47
2021-10-18T09:42:47
394,718,467
0
0
null
null
null
null
UTF-8
Java
false
false
495
java
package cn.lxtkj.gulimall.product.feign; import cn.lxtkj.common.to.es.SkuEsModel; import cn.lxtkj.common.utils.R; import org.springframework.cloud.openfeign.FeignClient; import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.RequestBody; import java.util.List; @FeignClient("gulimall-search") public interface SearchFeignService { @PostMapping("/search/save/product") R productStatusUp(@RequestBody List<SkuEsModel> skuEsModels); }
[ "657106593@qq.com" ]
657106593@qq.com
6d885a6fbb64afafa2f6d2a04d099ea2273b8fcb
0cfa4343f83eea4288bafeef64ad2f7cb7a499ba
/app/src/main/java/com/example/huichuanyi/common_view/model/ItemHmShopCarRecommend.java
02cdb051dd97d01c4335decbdffe32a86d7d9443
[]
no_license
wodejiusannian/HuiChuanYi
4a049b2a901d6b2dc868ccff5a7227c2462315f0
14aa2cc99ec1b0a1c1c085662d6fb324f3a714fc
refs/heads/master
2020-12-02T18:16:53.406731
2018-07-10T01:14:28
2018-07-10T01:14:28
81,194,590
0
0
null
null
null
null
UTF-8
Java
false
false
592
java
package com.example.huichuanyi.common_view.model; import com.example.huichuanyi.common_view.Type.TypeFactory; /** * Created by 小五 on 2018/6/26. */ public class ItemHmShopCarRecommend implements Visitable { private boolean isSelect; public ItemHmShopCarRecommend(boolean isSelect) { this.isSelect = isSelect; } public boolean isSelect() { return isSelect; } public void setSelect(boolean select) { isSelect = select; } @Override public int type(TypeFactory typeFactory) { return typeFactory.type(this); } }
[ "752443668@qq.com" ]
752443668@qq.com
0bfa0070cd31271060a4470b40e3b53172a18e08
bfc08f90092c4981a6e6d23bb62b7963460c3afd
/ch09-21/src/holding/EnvironmentVariables.java
75244495b6e073598da94910e82ef9d87cd5f228
[]
no_license
OneTe/Thinking-in-java-note
88ca3ac7374f8ffdf0771b0bec2f7c92166434b4
35b70ace64e636a6afcdd8f520d44fb08beadb85
refs/heads/master
2021-03-24T12:18:32.428829
2018-01-31T11:23:36
2018-01-31T11:23:36
83,625,936
0
0
null
null
null
null
UTF-8
Java
false
false
533
java
package holding; import org.omg.Messaging.SYNC_WITH_TRANSPORT; import java.util.*; /** * Created by wangcheng on 2017/8/14. */ public class EnvironmentVariables { public static void main(String[] args){ //System.getenv()返回一个Map,entrySet()产生一个由Map.Entry元素构成的Set,并且这个Set是一个Iterable, //所以可以用于foreach for(Map.Entry entry : System.getenv().entrySet()){ System.out.println(entry.getKey() + ": " + entry.getValue()); } } }
[ "veoxft@hotmail.com" ]
veoxft@hotmail.com
35078eb5c34c6dbf5c3f26a34830258e05893490
5e11647623aac88a38c5a6cbc3b19f6d3e7eb097
/school-war/src/java/converter/BrancheConverter.java
301b4d4d8b0836ef9d494515e62a4ec313ee9d22
[]
no_license
lanaflon-cda2/schoolmanager
20e56da52c32bb128bcce38006acf03cae6e487b
6270d25371010589105473ad7fda42d35bce2822
refs/heads/master
2021-06-11T08:00:46.488660
2017-02-27T15:16:42
2017-02-27T15:16:42
null
0
0
null
null
null
null
UTF-8
Java
false
false
1,720
java
package converter; import entities.Enseignement; import java.util.logging.Level; import java.util.logging.Logger; import javax.ejb.EJB; import javax.faces.convert.FacesConverter; import javax.faces.component.UIComponent; import javax.faces.context.FacesContext; import javax.faces.convert.Converter; import session.EnseignementFacadeLocal; import utils.JsfUtil; @FacesConverter(value = "brancheConverter") public class BrancheConverter implements Converter { @EJB private EnseignementFacadeLocal ejbFacade; @Override public Object getAsObject(FacesContext facesContext, UIComponent component, String value) { if (value == null || value.length() == 0 || JsfUtil.isDummySelectItem(component, value)) { return null; } return this.ejbFacade.find(getKey(value)); } java.lang.Integer getKey(String value) { java.lang.Integer key; key = Integer.valueOf(value); return key; } String getStringKey(java.lang.Integer value) { return "" + value; } @Override public String getAsString(FacesContext facesContext, UIComponent component, Object object) { if (object == null || (object instanceof String && ((String) object).length() == 0)) { return null; } if (object instanceof Enseignement) { Enseignement o = (Enseignement) object; return getStringKey(o.getIdbranche()); } else { Logger.getLogger(this.getClass().getName()).log(Level.SEVERE, "object {0} is of type {1}; expected type: {2}", new Object[]{object, object.getClass().getName(), Enseignement.class.getName()}); return null; } } }
[ "kenne_gervais@yahoo.fr" ]
kenne_gervais@yahoo.fr
921802c998b38f939264f94a5c06983b963482eb
b7e4f2b398a8660bdbe4e44bd86d9915f08356bb
/app/src/main/java/com/coodev/androidcollection/widget/ItemHoverConstraintlayout.java
fadc18a06969a0b89c76d43186a0aa0fe9b2b52f
[]
no_license
coodeve/AndroidCollection
d21dd0f27e81b2deb64a9798a333417a23f5f149
d534d82ed53da5b67d1b125aea9e619e458feb9a
refs/heads/master
2021-12-01T08:07:33.295393
2021-11-30T14:59:43
2021-11-30T14:59:43
138,004,785
11
6
null
null
null
null
UTF-8
Java
false
false
3,098
java
package com.coodev.androidcollection.widget; import android.content.Context; import android.graphics.Canvas; import android.graphics.Paint; import android.util.AttributeSet; import android.view.MotionEvent; import android.view.View; import androidx.constraintlayout.widget.ConstraintLayout; import com.coodev.androidcollection.R; public class ItemHoverConstraintlayout extends ConstraintLayout { /** * 边框宽度 */ private float borderWidth; /** * 边框距离主体距离,类似padding */ private float borderHostInterval; /** * 边框颜色 */ private int color; /** * 圆角半径 */ private float radius; private boolean hovered; private Paint mPaint; /** * 是否按下 */ private boolean press; public ItemHoverConstraintlayout(Context context) { this(context, null); } public ItemHoverConstraintlayout(Context context, AttributeSet attrs) { this(context, attrs, 0); } public ItemHoverConstraintlayout(Context context, AttributeSet attrs, int defStyleAttr) { super(context, attrs, defStyleAttr); borderWidth = getResources().getDimension(R.dimen.game_app_list_item_hover_line_width); borderHostInterval = getResources().getDimension(R.dimen.game_app_list_item_hover_line_bg_interval); radius = getResources().getDimension(R.dimen.common_conners_10); color = getResources().getColor(R.color.Button_Text_Hover, null); mPaint = new Paint(); mPaint.setAntiAlias(true); mPaint.setStyle(Paint.Style.STROKE); mPaint.setStrokeWidth(borderWidth); mPaint.setColor(color); } @Override protected void onDraw(Canvas canvas) { super.onDraw(canvas); // 绘制边框 if (hovered) { canvas.drawRoundRect(-borderHostInterval, -borderHostInterval, getWidth() + borderHostInterval, getHeight() + borderHostInterval, radius, radius, mPaint); } if (press) { canvas.drawRoundRect(-borderWidth, -borderWidth, getWidth() + borderWidth, getHeight() + borderWidth, radius, radius, mPaint); } } @Override public void onHoverChanged(boolean hovered) { this.hovered = hovered; View parent = (View) getParent(); if (parent == null) { return; } postInvalidate(); } @Override public boolean onTouchEvent(MotionEvent event) { if (event.getAction() == MotionEvent.ACTION_DOWN) { press = true; postInvalidate(); } else if (event.getAction() == MotionEvent.ACTION_UP || event.getAction() == MotionEvent.ACTION_CANCEL) { press = false; postInvalidate(); } return super.onTouchEvent(event); } }
[ "patrick.ding@picovr.com" ]
patrick.ding@picovr.com
58bac7b14bfc23362d4224502bcab80f923a7079
01b23223426a1eb84d4f875e1a6f76857d5e8cd9
/icemobile/branches/icemobile-1.3.1.P02A-demo/icemobile/jsf/components/tests/mobitest/src/main/java/org/icefaces/mobile/MenuBean.java
d5e6856c0891f6d68932ca3067c7ce553b21ed68
[ "Apache-2.0" ]
permissive
numbnet/icesoft
8416ac7e5501d45791a8cd7806c2ae17305cdbb9
2f7106b27a2b3109d73faf85d873ad922774aeae
refs/heads/master
2021-01-11T04:56:52.145182
2016-11-04T16:43:45
2016-11-04T16:43:45
72,894,498
0
0
null
null
null
null
UTF-8
Java
false
false
7,793
java
/* * Copyright 2004-2014 ICEsoft Technologies Canada Corp. * * 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.icefaces.mobile; import javax.faces.bean.ManagedBean; import javax.faces.bean.ViewScoped; import java.io.Serializable; import javax.faces.component.UIComponent; import javax.faces.model.SelectItem; import java.lang.String; import java.util.ArrayList; import java.util.List; import javax.faces.event.ActionEvent; import java.util.logging.Logger; import org.icefaces.mobi.component.menubutton.MenuButtonItem; @ManagedBean(name="menu") @ViewScoped public class MenuBean implements Serializable { private static final Logger logger = Logger.getLogger(ListBean.class.toString()); private List<String> simpleList = new ArrayList<String>() ; private String outputString = "none"; private String selTitle="Select"; private String buttonLabel = "Buttonlabel"; private String itemChosen="none"; private boolean disabled = false; private String mbstyle; // private List<MenuAction> itemList = new ArrayList<MenuAction>(); private List<ModelData> data = new ArrayList<ModelData>(); private String height="12px"; private String style="display:inline-block;position:relative;top:-25px;left:0;color:white;"; private String styleClass; public MenuBean(){ this.simpleList.add("Edit"); this.simpleList.add("File"); this.simpleList.add("Delete"); this.simpleList.add("Cancel"); fillModelData(); } private void fillModelData(){ this.data.add(new ModelData("File", "file item","pc1" , null )); this.data.add(new ModelData("Add", "add item", "pcAdd", "sn1" )); this.data.add(new ModelData("Delete", "delete item", "pcDel", null )); this.data.add(new ModelData("Print", "print item", null, "sn1")); this.data.add(new ModelData("Cancel", "cancel item", null, null )); } public List<ModelData> getData() { return data; } public String getSelTitle() { return this.selTitle; } public void setSelTitle(String selTitle) { this.selTitle = selTitle; } public void setData(List<ModelData> data) { this.data = data; } public List<String> getSimpleList() { return simpleList; } public void setSimpleList(List<String> simpleList) { this.simpleList = simpleList; } public String getHeight() { return height; } public void setHeight(String height) { this.height = height; } public String getStyle() { return style; } public void setStyle(String style) { this.style = style; } public void actionMethod(ActionEvent ae){ UIComponent uic = ae.getComponent(); if (uic instanceof MenuButtonItem) { MenuButtonItem mbi = (MenuButtonItem)uic; // logger.info("Item selected="+mbi.getValue()+" label="+mbi.getLabel()); this.itemChosen = mbi.getValue().toString(); } } public void actionMethodSleep(ActionEvent ae){ UIComponent uic = ae.getComponent(); if (uic instanceof MenuButtonItem) { MenuButtonItem mbi = (MenuButtonItem)uic; // logger.info("Item selected="+mbi.getValue()+" label="+mbi.getLabel()); this.itemChosen = mbi.getValue().toString(); } try{ Thread.sleep(5000); logger.info("slept"); } catch (Exception e){ } } public String getItemChosen() { return itemChosen; } public static String EVENT_TRIGGERED="NONE"; public String getOutputString() { return EVENT_TRIGGERED; } public String getStyleClass() { return styleClass; } public void setStyleClass(String styleClass) { this.styleClass = styleClass; } public String getButtonLabel() { return buttonLabel; } public void setButtonLabel(String buttonLabel) { this.buttonLabel = buttonLabel; } public boolean isDisabled() { return disabled; } public void setDisabled(boolean disabled) { this.disabled = disabled; } public String getMbstyle() { return mbstyle; } public void setMbstyle(String mbstyle) { this.mbstyle = mbstyle; } public class ModelData implements Serializable{ private String eventTriggered = "none"; private String value; private String label; private String panelConfId= null; private String submitNotif=null; private String disabled= "false"; private String singleSubmit = "false"; private boolean panelConfOnly; private boolean submitNotifOnly; private boolean both; private boolean none; public ModelData (String val, String label, String pcId, String snId){ this.value = val; this.label = label; if (null != snId && snId.length() > 0){ this.submitNotif = snId; } if (null != pcId && pcId.length() > 0){ this.panelConfId = pcId; } } public String getDisabled() { return disabled; } public void setDisabled(String disabled) { this.disabled = disabled; } public String getValue() { return value; } public void setValue(String value) { this.value = value; } public String getLabel() { return label; } public void setLabel(String label) { this.label = label; } public String getPanelConfId() { return panelConfId; } public void actionMethod(ActionEvent ae){ // logger.info(" actionMethod for value="+this.value); MenuBean.EVENT_TRIGGERED="item "+this.value+" was selected"; if (this.value.equals("Add") || this.value.equals("Print")){ try{ Thread.sleep(5000); logger.info(" after sleeping value="+this.value); } catch (Exception e){ } } } public void setPanelConfId(String panelConfId) { this.panelConfId = panelConfId; } public String getSubmitNotif() { return submitNotif; } public void setSubmitNotif(String submitNotif) { this.submitNotif = submitNotif; } public String getSingleSubmit() { return singleSubmit; } public void setSingleSubmit(String singleSubmit) { this.singleSubmit = singleSubmit; } public boolean isBoth(){ return this.submitNotif !=null && this.panelConfId !=null; } public boolean isSubmitNotifOnly(){ return this.submitNotif !=null && this.panelConfId == null; } public boolean isPanelConfOnly(){ return this.panelConfId !=null && this.submitNotif ==null; } public boolean isNone(){ return this.panelConfId==null && this.submitNotif ==null; } } }
[ "ken.fyten@8668f098-c06c-11db-ba21-f49e70c34f74" ]
ken.fyten@8668f098-c06c-11db-ba21-f49e70c34f74
49a1accd633ee67214b46cb46742f91e0092d21e
5957a974c1cfb71b5c7f41cb5b0ede3a70b2cfc9
/HuaFen/src/com/huapu/huafen/chatim/holder/viewholder/LCIMCommentItemHolder.java
d745289a06027098302913a98334ff5b44c170a8
[]
no_license
frulistrawberry/huafer
46f3492508be1260d753a592bfe03ec1850fde98
596c6154e9158c492d4f336a884aee9e87368ee0
refs/heads/master
2021-09-06T14:37:48.883398
2018-02-07T16:31:57
2018-02-07T16:31:57
120,640,785
0
1
null
null
null
null
UTF-8
Java
false
false
3,610
java
package com.huapu.huafen.chatim.holder.viewholder; import android.content.Context; import android.content.Intent; import android.util.TypedValue; import android.view.View; import android.view.ViewGroup; import android.widget.TextView; import com.alibaba.fastjson.util.TypeUtils; import com.avos.avoscloud.im.v2.messages.AVIMTextMessage; import com.facebook.drawee.view.SimpleDraweeView; import com.huapu.huafen.common.MyConstants; import com.huapu.huafen.R2; import com.huapu.huafen.activity.HPReplyListActivityNew; import com.huapu.huafen.activity.PersonalPagerHomeActivity; import com.huapu.huafen.beans.CommentMsg; import com.huapu.huafen.beans.Msg; import com.huapu.huafen.beans.UserInfo; import com.huapu.huafen.utils.DateTimeUtils; import com.huapu.huafen.utils.StringUtils; import com.huapu.huafen.views.CommonTitleView; import com.huapu.huafen.views.HLinkTextView; import butterknife.BindView; import butterknife.ButterKnife; /** * 聊天页面中的文本 commentMsg 对应的 holder */ public class LCIMCommentItemHolder extends LCIMCommonViewHolder { @BindView(R2.id.ivHeader) SimpleDraweeView ivHeader; @BindView(R2.id.ctvName) CommonTitleView ctvName; @BindView(R2.id.tvCommentTime) TextView tvCommentTime; @BindView(R2.id.hltvContent) HLinkTextView hltvContent; @BindView(R2.id.ivGoodsPic) SimpleDraweeView ivGoodsPic; public LCIMCommentItemHolder(Context context, ViewGroup root, int layoutRes) { super(context, root, layoutRes); ButterKnife.bind(this, itemView); } @Override public void bindData(Object avimMessage) { if (!(avimMessage instanceof AVIMTextMessage)) { return; } AVIMTextMessage msg = (AVIMTextMessage) avimMessage; final CommentMsg commentMsg = new CommentMsg(); commentMsg.image = (String) msg.getAttrs().get("image"); commentMsg.action = (String) msg.getAttrs().get("action"); commentMsg.target = (Integer) msg.getAttrs().get("target"); final UserInfo userInfo = TypeUtils.castToJavaBean(msg.getAttrs().get("user"), UserInfo.class); commentMsg.message = TypeUtils.castToJavaBean(msg.getAttrs().get("message"), Msg.class); ctvName.setData(userInfo); ctvName.setNameSize(TypedValue.COMPLEX_UNIT_SP, 12); tvCommentTime.setText(DateTimeUtils.getYearMonthDay(msg.getTimestamp())); ivHeader.setImageURI(userInfo.avatarUrl); ivGoodsPic.setImageURI(commentMsg.image); if (commentMsg.message.user != null) { if (!StringUtils.isEmpty(commentMsg.message.user.userName)) { hltvContent.setLinkText(commentMsg.message.user.userName, commentMsg.message.content); } } else { hltvContent.setText(commentMsg.message.content); } ivHeader.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { Intent intent = new Intent(getContext(), PersonalPagerHomeActivity.class); intent.putExtra(MyConstants.EXTRA_USER_ID, userInfo.getUserId()); getContext().startActivity(intent); } }); itemView.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { Intent intent = new Intent(getContext(), HPReplyListActivityNew.class); intent.putExtra(MyConstants.EXTRA_COMMENT_TARGET_ID, commentMsg.target); getContext().startActivity(intent); } }); } }
[ "553882594@qq.com" ]
553882594@qq.com
f5f5d2d191b088634071a0efc85b00afaa0d942a
245574acadf9349da9fb9bde35f52360629460b9
/collect_app/src/test/java/org/odk/collect/android/support/SwipableParentActivity.java
a5a214db49d7ace84bab0688da945dcb1d3d523f
[ "Apache-2.0", "LicenseRef-scancode-unknown-license-reference" ]
permissive
fieldsight/fieldsight-mobile
8cec6921c568e9869db04c3ce31b7282feddf40d
7701392814ff83a4dd9f07421ecbae61d799f021
refs/heads/master
2022-02-25T16:10:07.814830
2022-02-08T14:18:12
2022-02-08T14:18:12
166,636,413
15
5
NOASSERTION
2022-02-08T14:18:26
2019-01-20T07:51:08
Java
UTF-8
Java
false
false
488
java
package org.odk.collect.android.support; import androidx.fragment.app.FragmentActivity; import org.odk.collect.android.audio.AudioControllerView; public class SwipableParentActivity extends FragmentActivity implements AudioControllerView.SwipableParent { private boolean swipingAllowed; @Override public void allowSwiping(boolean allowSwiping) { swipingAllowed = allowSwiping; } public boolean isSwipingAllowed() { return swipingAllowed; } }
[ "callum@seadowg.com" ]
callum@seadowg.com
0aa6a3ff8dde845f9e00c43587f20e51cdff9d16
fa91450deb625cda070e82d5c31770be5ca1dec6
/Diff-Raw-Data/2/2_27a43804f7a4d01bfe10f960334e55dcb174db0b/QuitEvent/2_27a43804f7a4d01bfe10f960334e55dcb174db0b_QuitEvent_t.java
ad0134a2071c1f9b28f8604eec08f05a81c00a11
[]
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
2,145
java
/** * Copyright (C) 2010-2011 Leon Blakey <lord.quackstar at gmail.com> * * This file is part of PircBotX. * * PircBotX is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * PircBotX is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with PircBotX. If not, see <http://www.gnu.org/licenses/>. */ package org.pircbotx.hooks.events; import lombok.Data; import lombok.EqualsAndHashCode; import org.pircbotx.hooks.Event; import org.pircbotx.PircBotX; import org.pircbotx.UserSnapshot; /** * This event is dispatched whenever someone (possibly us) quits from the * server. We will only observe this if the user was in one of the * channels to which we are connected. * @author Leon Blakey <lord.quackstar at gmail.com> */ @Data @EqualsAndHashCode(callSuper = true) public class QuitEvent<T extends PircBotX> extends Event<T> { protected final UserSnapshot user; protected final String reason; /** * Default constructor to setup object. Timestamp is automatically set * to current time as reported by {@link System#currentTimeMillis() } * @param user The user that quit from the server in snapshot form * @param reason The reason given for quitting the server. */ public QuitEvent(T bot, UserSnapshot user, String reason) { super(bot); this.user = user; this.reason = reason; } /** * Does NOT respond! This will throw an {@link UnsupportedOperationException} * since we can't respond to a user that just quit * @param response The response to send */ @Override public void respond(String response) { throw new UnsupportedOperationException("Attempting to respond to a user that quit"); } }
[ "yuzhongxing88@gmail.com" ]
yuzhongxing88@gmail.com
a7083f4a09a98854063a3f77efe237df47897abc
699d443f763dc73dffbc47a3408f949e9ea1841e
/app/src/main/java/com/huiketong/guanjiatong/presenter/ActivitiesPresenter.java
f7adfa244a0ef500d7587c150155c823724d87e0
[]
no_license
ZuofeiGithub/Guanjiatong
f92c5d21f61dcc4f656490dcb9ce7dc81873500f
87405dc5905eb8f107bb8d47c6a1b03bdca65b5a
refs/heads/master
2020-06-02T11:14:57.856273
2019-06-24T05:50:53
2019-06-24T05:50:53
191,136,618
0
0
null
null
null
null
UTF-8
Java
false
false
280
java
package com.huiketong.guanjiatong.presenter; import android.content.Context; import com.huiketong.guanjiatong.base.BasePresenter; public class ActivitiesPresenter extends BasePresenter { public ActivitiesPresenter(Context context) { this.context = context; } }
[ "348068347@qq.com" ]
348068347@qq.com
b9951723c885d2c9842bda2e2d8e81d917d6c941
f08256664e46e5ac1466f5c67dadce9e19b4e173
/sources/p163g/p201e/p203b/C5368a.java
099eeac417e9163a8fed9674323338ad03558221
[]
no_license
IOIIIO/DisneyPlusSource
5f981420df36bfbc3313756ffc7872d84246488d
658947960bd71c0582324f045a400ae6c3147cc3
refs/heads/master
2020-09-30T22:33:43.011489
2019-12-11T22:27:58
2019-12-11T22:27:58
227,382,471
6
3
null
null
null
null
UTF-8
Java
false
false
1,371
java
package p163g.p201e.p203b; import com.appboy.p030r.C1532b; import com.appboy.p030r.C1544n; import com.appboy.p034ui.inappmessage.InAppMessageCloser; import com.appboy.p034ui.inappmessage.InAppMessageOperation; import com.appboy.p034ui.inappmessage.listeners.IInAppMessageManagerListener; import com.bamtechmedia.dominguez.analytics.C2447q; import p686n.p687a.Timber; /* renamed from: g.e.b.a */ /* compiled from: InAppMessageManager.kt */ public final class C5368a implements IInAppMessageManagerListener { /* renamed from: a */ private final C2447q f12864a; public C5368a(C2447q qVar) { this.f12864a = qVar; } public InAppMessageOperation beforeInAppMessageDisplayed(C1532b bVar) { if (!this.f12864a.mo11575a()) { return InAppMessageOperation.DISPLAY_NOW; } Timber.m44522a("kidsmode profile enabled, in app message was dropped", new Object[0]); return InAppMessageOperation.DISCARD; } public boolean onInAppMessageButtonClicked(C1544n nVar, InAppMessageCloser inAppMessageCloser) { return false; } public boolean onInAppMessageClicked(C1532b bVar, InAppMessageCloser inAppMessageCloser) { return false; } public void onInAppMessageDismissed(C1532b bVar) { } public boolean onInAppMessageReceived(C1532b bVar) { return false; } }
[ "101110@vivaldi.net" ]
101110@vivaldi.net
d0373a4568f6acf8204951034cd01a6b50527c6a
85659db6cd40fcbd0d4eca9654a018d3ac4d0925
/packages/apps/APR/APR_Flex/src/com/motorola/motoapr/service/SpeedInfo.java
325abfd27f45c0f609e515222634b3663272e1e4
[]
no_license
qwe00921/switchui
28e6e9e7da559c27a3a6663495a5f75593f48fb8
6d859b67402fb0cd9f7e7a9808428df108357e4d
refs/heads/master
2021-01-17T06:34:05.414076
2014-01-15T15:40:35
2014-01-15T15:40:35
null
0
0
null
null
null
null
UTF-8
Java
false
false
2,446
java
package com.motorola.motoapr.service; public class SpeedInfo { public static final String EMAIL_VIA_SMS = "EMAIL_VIA_SMS"; public static final String EMAIL_VIA_SMS2 = "EMAIL_VIA_SMS2"; public static final String SMS_ONLY = "SMS_ONLY"; static String TAG = "SpeedInfo"; SpeedInfo speed_info = null; static boolean num_carriers_init = false; static int num_carriers = 0; enum SPEED { FIFTEEN(0, "15 minutes", 15 * 60), ONEHOUR(1, "1 hour", 60 * 60), THREEHOURS(2, "3 hours", 3 * 60 * 60), SIXHOURS(3, "6 hours", 6 * 60 * 60), TWELVEHOURS(4, "12 hours", 12 * 60 * 60); // Add new entries above this line, at the END of the list. public final int id; public final String label; public final long time; SPEED(final int id, final String label, final long time) { this.id = id; this.label = label; this.time = time; } public int getId() { return id; } public String toString() { return label; } public static SPEED fromLabel(final String label) { for (SPEED carrier : SPEED.values()) { if (carrier.toString().equalsIgnoreCase(label)) { return carrier; } } return null; } public static SPEED fromId(final int id) { for (SPEED carrier : SPEED.values()) { if (carrier.id == id) { return carrier; } } return null; } public static int getNumCarriers() { if ( ! num_carriers_init ) { num_carriers = 0; for ( SPEED carrier : SPEED.values() ) { num_carriers++; } num_carriers_init = true; } return num_carriers; } public static String[] getAllLabels() { String[] all_labels = null; int count = 0; all_labels = new String[ getNumCarriers() ]; for ( SPEED carrier : SPEED.values() ) { all_labels[ count ] = carrier.toString(); count++; } return all_labels; } } }
[ "cheng.carmark@gmail.com" ]
cheng.carmark@gmail.com
a6383ae74ef189d901f4c9c401760924abca0b9d
9e6175752640891f54aad0dca18fd3bca13b6c45
/src/main/java/io/jboot/components/limiter/LimitType.java
f4b7f7d36b2bd37b37f30b6f643dd0cc2fba0278
[ "Apache-2.0" ]
permissive
c2cn/jboot
68a28b59d9ee3a413a746ac7cdfc71b51d5161b0
66b5b015f1024912c2f95133ae07b89ad00e07b6
refs/heads/master
2023-04-19T16:57:52.314575
2021-05-08T05:15:33
2021-05-08T05:15:33
288,644,695
0
0
Apache-2.0
2021-05-08T05:15:33
2020-08-19T05:46:39
null
UTF-8
Java
false
false
978
java
/** * Copyright (c) 2015-2021, Michael Yang 杨福海 (fuhai999@gmail.com). * <p> * 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 * <p> * http://www.apache.org/licenses/LICENSE-2.0 * <p> * 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 io.jboot.components.limiter; /** * 限制类型 */ public class LimitType { /** * 令牌桶,通过 guava 的 RateLimiter 来实现 */ public static final String TOKEN_BUCKET = "tb"; /** * 并发量,通过 Semaphore 来实现 */ public static final String CONCURRENCY = "cc"; }
[ "fuhai999@gmail.com" ]
fuhai999@gmail.com
38095b4ff5dc7f36b754c1bb9da06f41d4085ceb
fa91450deb625cda070e82d5c31770be5ca1dec6
/Diff-Raw-Data/2/2_7e481a0fba5d6d5bdf3e771b6f62cfadc4593ebc/LegalizeEmbellishmentAction/2_7e481a0fba5d6d5bdf3e771b6f62cfadc4593ebc_LegalizeEmbellishmentAction_s.java
364c4065b87079f349415cc31b6de30dcaf7ddd6
[]
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
664
java
package pipes.editing.actions; import pipes.model.Note; import pipes.model.embellishment.EmbellishmentFamily; public class LegalizeEmbellishmentAction implements EditAction { public void execute() { if (oldFamily != null && !oldFamily.canEmbellish(target, target.getTune().getNoteAfter(target))) target.setEmbellishmentFamily(null); else target.setEmbellishmentFamily(oldFamily); } public void undo() { target.setEmbellishmentFamily(oldFamily); } public LegalizeEmbellishmentAction(Note n) { target = n; oldFamily = n.getEmbellishmentFamily(); } private Note target; private EmbellishmentFamily oldFamily; }
[ "yuzhongxing88@gmail.com" ]
yuzhongxing88@gmail.com
ebdb612e9780aad3bdba95ec6654c365ca63fda4
c94e77122d87ae517dd103a30081a3f142f1c1f7
/app/src/main/java/com/brice/comet/launchers/EpicLauncher.java
c1f9bd4b5dc8b147f0cb675863a7b246d766a645
[]
no_license
MaTriXy/Comet
e013c663ff13260136c4d041dd9bb3d3cfd67d40
f3fdf0f70688ffa8d81376bd26eeb1dbcfe77860
refs/heads/master
2023-08-08T17:34:00.977199
2016-04-29T13:05:14
2016-04-29T13:05:14
74,939,249
0
0
null
2023-08-01T20:35:10
2016-11-28T05:09:22
Java
UTF-8
Java
false
false
404
java
package com.brice.comet.launchers; import android.content.ComponentName; import android.content.Context; import android.content.Intent; public class EpicLauncher { public EpicLauncher(Context context) { Intent intent = new Intent(Intent.ACTION_MAIN); intent.setComponent(new ComponentName("com.epic.launcher", "com.epic.launcher.s")); context.startActivity(intent); } }
[ "18jafenn90@gmail.com" ]
18jafenn90@gmail.com
93492282715823ee7c99bde6439d1b13420c2f0d
01545678f1e231de5b7e23635be11d29c0c7eb68
/java/src/com/ibm/streamsx/topology/internal/process/ProcessOutputToLogger.java
029513870b88bc19d4079a1ca265d994b33881d4
[ "Apache-2.0" ]
permissive
IBMStreams/streamsx.topology
0bcb108836dd3a06905a99276de27bf3b73467e7
20d5179d77524c04ba178f694f7d1eb84ac881c4
refs/heads/develop
2022-08-02T15:24:31.808646
2022-07-24T18:34:46
2022-07-24T18:34:46
36,458,001
32
54
Apache-2.0
2021-02-01T12:28:19
2015-05-28T18:30:13
Java
UTF-8
Java
false
false
1,510
java
/* # Licensed Materials - Property of IBM # Copyright IBM Corp. 2015 */ package com.ibm.streamsx.topology.internal.process; import java.io.BufferedReader; import java.io.IOException; import java.io.InputStream; import java.io.InputStreamReader; import java.util.logging.Level; import java.util.logging.Logger; public class ProcessOutputToLogger implements Runnable { private final Logger logger; private final Level level; private final BufferedReader reader; public static void log(Logger logger, Process process) { // standard error new ProcessOutputToLogger(logger, Level.SEVERE, process.getErrorStream()); // standard out new ProcessOutputToLogger(logger, Level.INFO, process.getInputStream()); } ProcessOutputToLogger(Logger logger, Level level, InputStream processOutput) { super(); this.logger = logger; this.level = level; this.reader = new BufferedReader(new InputStreamReader(processOutput)); Thread t = new Thread(this); t.setDaemon(true); t.start(); } @Override public void run() { try (BufferedReader r = reader) { while (!Thread.currentThread().isInterrupted()) { String line = reader.readLine(); if (line == null) break; logger.log(level, line); } } catch (IOException e) { throw new RuntimeException(e); } } }
[ "debrunne@us.ibm.com" ]
debrunne@us.ibm.com
c83292905e8da06ef759b952882a6c62c0f2aa49
1ba27fc930ba20782e9ef703e0dc7b69391e191b
/Src/JDBCImporter/src/main/java/net/sourceforge/jdbcimporter/connection/JNDIConnectionDef.java
4b115ea26befa8aacc8286c20d06e9de718d6158
[]
no_license
LO-RAN/codeQualityPortal
b0d81c76968bdcfce659959d0122e398c647b09f
a7c26209a616d74910f88ce0d60a6dc148dda272
refs/heads/master
2023-07-11T18:39:04.819034
2022-03-31T15:37:56
2022-03-31T15:37:56
37,261,337
0
0
null
null
null
null
UTF-8
Java
false
false
4,020
java
package net.sourceforge.jdbcimporter.connection; /* * JDBC Importer - database import utility/framework. * Copyright (C) 2002 Chris Nagy * * 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 * * Chris Nagy * Email: cnagyxyz@hotmail.com */ import java.sql.Connection; import java.sql.SQLException; import java.util.Hashtable; import javax.naming.Context; import javax.naming.InitialContext; import javax.naming.NamingException; import javax.sql.ConnectionPoolDataSource; import javax.sql.DataSource; import javax.sql.PooledConnection; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import net.sourceforge.jdbcimporter.ConnectionDef; /** * The JNDIConnectionDef defines attributes to use to retrieve * a connection from a data source in a JNDI namespace. * * @version 0.63 * @author Chris Nagy */ public class JNDIConnectionDef implements ConnectionDef { /** * The log for debug information. */ protected static Log LOG = LogFactory.getLog( JNDIConnectionDef.class ); /** * The hashtable for the Initial Context. */ Hashtable env; /** * The name of data source. */ String name; /** * Create a JNDI connection definition. */ public JNDIConnectionDef( ) { super( ); } /** * Sets the name of the data source. * * @param name name of the data source */ public void setName( String name ) { this.name = name; } /** * Sets the url of the JNDI. * * @param url the provider url */ public void setProviderURL( String url ) { if ( env == null ) { env = new Hashtable(); } env.put( Context.PROVIDER_URL, url ); } /** * Sets the list of classnames that should be used * as object factories. * * @param factories the list of object factories */ public void setObjectFactories( String factories ) { if ( env == null ) { env = new Hashtable(); } env.put( Context.OBJECT_FACTORIES, factories ); } /** * @see net.sourceforge.jdbcimporter.ConnectionDef#getConnection() */ public Connection getConnection( ) { InitialContext ic = null; try { if ( env != null ) { ic = new InitialContext(env); } else { ic = new InitialContext(); } Object obj = ic.lookup( name ); if ( obj instanceof ConnectionPoolDataSource ) { ConnectionPoolDataSource ds = (ConnectionPoolDataSource) obj; PooledConnection poolConnection = ds.getPooledConnection(); return poolConnection.getConnection(); } else if ( obj instanceof DataSource ) { DataSource ds = (DataSource) obj; return ds.getConnection(); } else { LOG.error("Unknown Datasource : "+obj.getClass().getName() ); } } catch ( NamingException n ) { LOG.error( "Could not lookup datasource", n ); } catch ( SQLException e ) { LOG.error( "Could not get connection", e ); } return null; } /** * @see net.sourceforge.jdbcimporter.ConnectionDef#releaseConnection(java.sql.Connection) */ public void releaseConnection( Connection con ) { try { con.close(); } catch ( SQLException e ) { LOG.error("Could not close connection", e ); } } }
[ "laurent.izac@gmail.com" ]
laurent.izac@gmail.com
8b1432585f1491f1107d29caf0dc472438ee9813
ae28bf3486eba843a46a84e29049ee603ed098ce
/src/main/java/org/librairy/boot/storage/system/column/repository/AnalysisColumnRepository.java
1289a7d6db780f9ff0216f07f6d20fe9bca75c70
[ "Apache-2.0" ]
permissive
frascuchon/boot
95f82ba3b7a62779220a06938067aac5e4f42125
e8b85b3aa5a34bf1f2a1fca56676ed6867f8ae4a
refs/heads/master
2020-06-23T01:25:07.514953
2017-06-07T19:08:17
2017-06-07T19:08:17
94,227,866
0
0
null
2017-06-13T15:25:18
2017-06-13T15:25:17
null
UTF-8
Java
false
false
1,479
java
/* * Copyright (c) 2016. Universidad Politecnica de Madrid * * @author Badenes Olmedo, Carlos <cbadenes@fi.upm.es> * */ package org.librairy.boot.storage.system.column.repository; import org.librairy.boot.storage.system.column.domain.AnalysisColumn; import org.springframework.data.cassandra.repository.Query; /** * Created by cbadenes on 21/12/15. */ public interface AnalysisColumnRepository extends BaseColumnRepository<AnalysisColumn> { //Future Version of Spring-Data-Cassandra will implements native queries @Query("select * from analyses where uri = ?0") Iterable<AnalysisColumn> findByUri(String uri); @Query("select * from analyses where creationTime = ?0") Iterable<AnalysisColumn> findByCreationTime(String creationTime); @Query("select * from analyses where type = ?0") Iterable<AnalysisColumn> findByType(String type); @Query("select * from analyses where description = ?0") Iterable<AnalysisColumn> findByDescription(String description); @Query("select * from analyses where configuration = ?0") Iterable<AnalysisColumn> findByConfiguration(String configuration); @Query("select * from analyses where domain = ?0") Iterable<AnalysisColumn> findByDomain(String domain); @Query("select * from analyses where startUri = ?0") Iterable<AnalysisColumn> findByStart(String uri); @Query("select * from analyses where endUri = ?0") Iterable<AnalysisColumn> findByEnd(String uri); }
[ "cbadenes@gmail.com" ]
cbadenes@gmail.com
fd9d89061f076a1879bdbab57225cb623b7522cb
b394ee4adfc5b450fa316f299ef73f63c01dfd77
/tests-arquillian/src/test/java/org/jboss/weld/tests/instance/iterator/dependent/InstanceIteratorTest.java
c8b1552b09d05956a6646939ce75af98bbc80c7a
[]
no_license
mkouba/core
e0156c84d52cacb3ac00d99f2db94435f16be012
9af3d9620ec9aed315caa98d917aba4d290dbbb6
refs/heads/master
2021-11-26T15:34:30.066393
2015-09-14T07:32:51
2015-09-14T07:32:51
2,215,763
1
0
null
null
null
null
UTF-8
Java
false
false
3,109
java
/* * JBoss, Home of Professional Open Source * Copyright 2012, Red Hat, Inc., and individual contributors * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * 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.jboss.weld.tests.instance.iterator.dependent; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertNotNull; import static org.junit.Assert.assertTrue; import javax.enterprise.context.spi.CreationalContext; import javax.enterprise.inject.spi.Bean; import javax.enterprise.inject.spi.BeanManager; import javax.inject.Inject; import org.jboss.arquillian.container.test.api.Deployment; import org.jboss.arquillian.junit.Arquillian; import org.jboss.shrinkwrap.api.Archive; import org.jboss.shrinkwrap.api.BeanArchive; import org.jboss.shrinkwrap.api.ShrinkWrap; import org.jboss.weld.test.util.ActionSequence; import org.jboss.weld.test.util.Utils; import org.junit.Test; import org.junit.runner.RunWith; /** * Test for WELD-1320. It verifies the iterator works correctly. * * @author Martin Kouba */ @RunWith(Arquillian.class) public class InstanceIteratorTest { @Deployment public static Archive<?> createTestArchive() { return ShrinkWrap.create(BeanArchive.class).addPackage(InstanceIteratorTest.class.getPackage()) .addClasses(ActionSequence.class, Utils.class); } @Inject BeanManager beanManager; @Test public void testIteration() { ActionSequence.reset(); Bean<Master> bean = Utils.getBean(beanManager, Master.class); CreationalContext<Master> ctx = beanManager.createCreationalContext(bean); Master master = bean.create(ctx); master.iterate(); bean.destroy(master, ctx); ActionSequence init = ActionSequence.getSequence("init"); assertNotNull(init); assertEquals(2, init.getData().size()); assertTrue(init.containsAll(Alpha.class.getName(), Bravo.class.getName())); ActionSequence destroy = ActionSequence.getSequence("destroy"); assertNotNull(destroy); assertEquals(2, destroy.getData().size()); assertTrue(destroy.containsAll(Alpha.class.getName(), Bravo.class.getName())); } @Test public void testRemoveNotSupported() { Bean<Master> bean = Utils.getBean(beanManager, Master.class); CreationalContext<Master> ctx = beanManager.createCreationalContext(bean); Master master = bean.create(ctx); master.iterateAndRemove(); bean.destroy(master, ctx); } }
[ "mkouba@redhat.com" ]
mkouba@redhat.com
d31c7c5878d0aa4f6025061212d61c07d1bb5a9a
87901d9fd3279eb58211befa5357553d123cfe0c
/bin/ext-commerce/solrfacetsearch/testsrc/de/hybris/platform/solrfacetsearch/integration/EmbeddedCoreSwapTest.java
8d2407bc835f0323460f075f30fa5c15e0991ca8
[]
no_license
prafullnagane/learning
4d120b801222cbb0d7cc1cc329193575b1194537
02b46a0396cca808f4b29cd53088d2df31f43ea0
refs/heads/master
2020-03-27T23:04:17.390207
2014-02-27T06:19:49
2014-02-27T06:19:49
null
0
0
null
null
null
null
UTF-8
Java
false
false
1,937
java
/* * [y] hybris Platform * * Copyright (c) 2000-2013 hybris AG * All rights reserved. * * This software is the confidential and proprietary information of hybris * ("Confidential Information"). You shall not disclose such Confidential * Information and shall use it only in accordance with the terms of the * license agreement you entered into with hybris. * * */ package de.hybris.platform.solrfacetsearch.integration; import de.hybris.platform.core.Registry; import de.hybris.platform.solrfacetsearch.solr.impl.SolrCoreRegistry; import de.hybris.platform.testframework.HybrisJUnit4TransactionalTest; import junit.framework.Assert; import org.apache.solr.core.SolrCore; import org.junit.After; import org.junit.Before; import org.junit.Test; /** * */ public class EmbeddedCoreSwapTest extends HybrisJUnit4TransactionalTest { private static final String CORE_1 = "index1"; private static final String CORE_2 = "index2"; private String coreName1; private String coreName2; private SolrCore core1; private SolrCore core2; @Before public void setUp() { final String tenantId = Registry.getCurrentTenant().getTenantID(); SolrCoreRegistry.getInstance().getEmbeddedSolrServer(tenantId, CORE_1); SolrCoreRegistry.getInstance().getEmbeddedSolrServer(tenantId, CORE_2); coreName1 = tenantId + '_' + CORE_1; coreName2 = tenantId + '_' + CORE_2; } @Test public void testEmbeddedCoresSwap() { core1 = SolrCoreRegistry.getInstance().getCore(coreName1); core2 = SolrCoreRegistry.getInstance().getCore(coreName2); SolrCoreRegistry.getInstance().swap(coreName1, coreName2); Assert.assertEquals(core2, SolrCoreRegistry.getInstance().getCore(coreName1)); Assert.assertEquals(core1, SolrCoreRegistry.getInstance().getCore(coreName2)); } @After public void tearDown() { // core1.close(); // core2.close(); } }
[ "admin1@neev31.(none)" ]
admin1@neev31.(none)
c3f65d59929f6ae5362c5c1eff142ae1bb9907a3
38ee0271dd601420dba9dd133343a6d06a2880d7
/EasyPersistance/src/main/java/com/easy/persistance/dao/IJdbcTemplateEx.java
173ad2fc2563f674a86e747a5c21295119eb08a6
[]
no_license
tankmyb/EasyProject
c630ba69f458fe13449c0ff5b88d797bb46e90cf
e699826d41c034d1ca1f8092463e7426e85778b3
refs/heads/master
2016-09-06T02:36:59.128880
2015-02-17T02:03:51
2015-02-17T02:03:51
30,898,342
2
0
null
null
null
null
UTF-8
Java
false
false
673
java
package com.easy.persistance.dao; import java.util.List; import com.easy.persistance.resultset.DBResultSet; /** * 所有方法都要按以下约定 * 第一个参数一定要是sql语句,如果sql需要传入参数的话,则放在第二参数里 * */ public interface IJdbcTemplateEx { DBResultSet queryForDBResultSet(String sql,List<Object> values); void insert(String sql,List<Object> values); int[] batchInsert(String sql,List<List<Object>> values); int update(String sql,List<Object> values); int delete(String sql,List<Object> values); int insertWithGeneratedKey(String sql,List<Object> values); int count(String sql,List<Object> values); }
[ "=" ]
=
74ddc6d6a9e3ec29287afd68ba46079a7ee0a5bf
5cfaeebdc7c50ca23ee368fa372d48ed1452dfeb
/xiaodou-jmsg/src/main/java/com/xiaodou/jmsg/entity/MessageRemoteResult.java
d4d693d1075d446a9f5bb638e9eb055690355185
[]
no_license
zdhuangelephant/xd_pro
c8c8ff6dfcfb55aead733884909527389e2c8283
5611b036968edfff0b0b4f04f0c36968333b2c3b
refs/heads/master
2022-12-23T16:57:28.306580
2019-12-05T06:05:43
2019-12-05T06:05:43
226,020,526
0
2
null
2022-12-16T02:23:20
2019-12-05T05:06:27
JavaScript
UTF-8
Java
false
false
1,834
java
package com.xiaodou.jmsg.entity; import com.xiaodou.common.util.warp.FastJsonUtil; /** * Created by zyp on 14-6-30. */ public class MessageRemoteResult { /** * 异常消息 */ private String ExceptionMessgage; /** * 响应码 */ private Integer ResponseCode; /** tag 外部消息Tag */ private String tag; /** * 构造函数 * * @param omsRemoteResultType */ public MessageRemoteResult(MessageRemoteResultType omsRemoteResultType) { this.ResponseCode = omsRemoteResultType.getResponseCode(); this.ExceptionMessgage = omsRemoteResultType.getExceptionMessage(); } public String getExceptionMessgage() { return ExceptionMessgage; } public void setExceptionMessgage(String exceptionMessgage) { ExceptionMessgage = exceptionMessgage; } public Integer getResponseCode() { return ResponseCode; } public void setResponseCode(Integer responseCode) { ResponseCode = responseCode; } public void appendRetdesc(String retdesc) { this.ExceptionMessgage += retdesc; } public String getTag() { return tag; } public void setTag(String tag) { this.tag = tag; } @Override public String toString() { return FastJsonUtil.toJson(this); } public enum MessageRemoteResultType { SUCCESS(0, "null"), FAIL(-1, "fail"); private String exceptionMessage; private Integer responseCode; private MessageRemoteResultType(Integer responseCode, String exceptionMessgage) { this.responseCode = responseCode; this.exceptionMessage = exceptionMessgage; } public String getExceptionMessage() { return exceptionMessage; } public Integer getResponseCode() { return responseCode; } } }
[ "zedong.huang@bitmain.com" ]
zedong.huang@bitmain.com
45f092cfadf8f35293e90001ab42e36401b17fa3
88ae531edae050cf8a2400ccaa0618e35a9fa0fa
/exercises/week7/exercise3/src/main/java/academy/everyoncecodes/phoneBook/persistence/domain/Contact.java
1b3bdc6ad1b09dc557fa5f9e6347c1c923080879
[]
no_license
Atlantisland/backend-module
442f25de001d88206ce40f8bb95fbc2966b8085f
b038f0d6f88eab3512b6218e9a41b2a702c0bc8b
refs/heads/master
2022-12-24T19:29:04.189942
2020-09-28T07:01:22
2020-09-28T07:01:22
null
0
0
null
null
null
null
UTF-8
Java
false
false
1,481
java
package academy.everyoncecodes.phoneBook.persistence.domain; import javax.persistence.Entity; import javax.persistence.GeneratedValue; import javax.persistence.Id; import javax.persistence.OneToOne; import javax.validation.Valid; import javax.validation.constraints.NotEmpty; import java.util.Objects; @Entity public class Contact { @Id @GeneratedValue private Long id; @NotEmpty private String name; @Valid @OneToOne private Address address; public Contact() { } public Contact(String name, Address address) { this.name = name; this.address = address; } public Long getId() { return id; } public void setId(Long id) { this.id = id; } public String getName() { return name; } public void setName(String name) { this.name = name; } public Address getAddress() { return address; } public void setAddress(Address address) { this.address = address; } @Override public boolean equals(Object o) { if (this == o) return true; if (o == null || getClass() != o.getClass()) return false; Contact contact = (Contact) o; return Objects.equals(id, contact.id) && Objects.equals(name, contact.name) && Objects.equals(address, contact.address); } @Override public int hashCode() { return Objects.hash(id, name, address); } }
[ "egkougko@gmail.com" ]
egkougko@gmail.com
265932637f3b94859f90fa71ee50c058449b3299
8bbeb7b5721a9dbf40caa47a96e6961ceabb0128
/java/720.Longest Word in Dictionary(词典中最长的单词).java
f57016f6ccad2f372105278452954b2f5e9d2275
[ "MIT" ]
permissive
lishulongVI/leetcode
bb5b75642f69dfaec0c2ee3e06369c715125b1ba
6731e128be0fd3c0bdfe885c1a409ac54b929597
refs/heads/master
2020-03-23T22:17:40.335970
2018-07-23T14:46:06
2018-07-23T14:46:06
null
0
0
null
null
null
null
UTF-8
Java
false
false
3,985
java
/** <p>Given a list of strings <code>words</code> representing an English Dictionary, find the longest word in <code>words</code> that can be built one character at a time by other words in <code>words</code>. If there is more than one possible answer, return the longest word with the smallest lexicographical order.</p> If there is no answer, return the empty string. <p><b>Example 1:</b><br /> <pre> <b>Input:</b> words = ["w","wo","wor","worl", "world"] <b>Output:</b> "world" <b>Explanation:</b> The word "world" can be built one character at a time by "w", "wo", "wor", and "worl". </pre> </p> <p><b>Example 2:</b><br /> <pre> <b>Input:</b> words = ["a", "banana", "app", "appl", "ap", "apply", "apple"] <b>Output:</b> "apple" <b>Explanation:</b> Both "apply" and "apple" can be built from other words in the dictionary. However, "apple" is lexicographically smaller than "apply". </pre> </p> <p><b>Note:</b> <li>All the strings in the input will only contain lowercase letters.</li> <li>The length of <code>words</code> will be in the range <code>[1, 1000]</code>.</li> <li>The length of <code>words[i]</code> will be in the range <code>[1, 30]</code>.</li> </p><p>给出一个字符串数组<code>words</code>组成的一本英语词典。从中找出最长的一个单词,该单词是由<code>words</code>词典中其他单词逐步添加一个字母组成。若其中有多个可行的答案,则返回答案中字典序最小的单词。</p> <p>若无答案,则返回空字符串。</p> <p><strong>示例 1:</strong></p> <pre> <strong>输入:</strong> words = [&quot;w&quot;,&quot;wo&quot;,&quot;wor&quot;,&quot;worl&quot;, &quot;world&quot;] <strong>输出:</strong> &quot;world&quot; <strong>解释:</strong> 单词&quot;world&quot;可由&quot;w&quot;, &quot;wo&quot;, &quot;wor&quot;, 和 &quot;worl&quot;添加一个字母组成。 </pre> <p><strong>示例 2:</strong></p> <pre> <strong>输入:</strong> words = [&quot;a&quot;, &quot;banana&quot;, &quot;app&quot;, &quot;appl&quot;, &quot;ap&quot;, &quot;apply&quot;, &quot;apple&quot;] <strong>输出:</strong> &quot;apple&quot; <strong>解释:</strong> &quot;apply&quot;和&quot;apple&quot;都能由词典中的单词组成。但是&quot;apple&quot;得字典序小于&quot;apply&quot;。 </pre> <p><strong>注意:</strong></p> <ul> <li>所有输入的字符串都只包含小写字母。</li> <li><code>words</code>数组长度范围为<code>[1,1000]</code>。</li> <li><code>words[i]</code>的长度范围为<code>[1,30]</code>。</li> </ul> <p>给出一个字符串数组<code>words</code>组成的一本英语词典。从中找出最长的一个单词,该单词是由<code>words</code>词典中其他单词逐步添加一个字母组成。若其中有多个可行的答案,则返回答案中字典序最小的单词。</p> <p>若无答案,则返回空字符串。</p> <p><strong>示例 1:</strong></p> <pre> <strong>输入:</strong> words = [&quot;w&quot;,&quot;wo&quot;,&quot;wor&quot;,&quot;worl&quot;, &quot;world&quot;] <strong>输出:</strong> &quot;world&quot; <strong>解释:</strong> 单词&quot;world&quot;可由&quot;w&quot;, &quot;wo&quot;, &quot;wor&quot;, 和 &quot;worl&quot;添加一个字母组成。 </pre> <p><strong>示例 2:</strong></p> <pre> <strong>输入:</strong> words = [&quot;a&quot;, &quot;banana&quot;, &quot;app&quot;, &quot;appl&quot;, &quot;ap&quot;, &quot;apply&quot;, &quot;apple&quot;] <strong>输出:</strong> &quot;apple&quot; <strong>解释:</strong> &quot;apply&quot;和&quot;apple&quot;都能由词典中的单词组成。但是&quot;apple&quot;得字典序小于&quot;apply&quot;。 </pre> <p><strong>注意:</strong></p> <ul> <li>所有输入的字符串都只包含小写字母。</li> <li><code>words</code>数组长度范围为<code>[1,1000]</code>。</li> <li><code>words[i]</code>的长度范围为<code>[1,30]</code>。</li> </ul> **/ class Solution { public String longestWord(String[] words) { } }
[ "lishulong@wecash.net" ]
lishulong@wecash.net
d90fc4cf12afcbdfe28926d600020adf7f85dfb5
7ef841751c77207651aebf81273fcc972396c836
/dstream/src/main/java/com/loki/dstream/stubs/SampleClass6304.java
b9043ec0d10d0f4f94dc270617d9f5c063e1db84
[]
no_license
SergiiGrechukha/ModuleApp
e28e4dd39505924f0d36b4a0c3acd76a67ed4118
00e22d51c8f7100e171217bcc61f440f94ab9c52
refs/heads/master
2022-05-07T13:27:37.704233
2019-11-22T07:11:19
2019-11-22T07:11:19
null
0
0
null
null
null
null
UTF-8
Java
false
false
274
java
package com.loki.dstream.stubs; public class SampleClass6304 { private SampleClass6305 sampleClass; public SampleClass6304(){ sampleClass = new SampleClass6305(); } public String getClassName() { return sampleClass.getClassName(); } }
[ "sergey.grechukha@gmail.com" ]
sergey.grechukha@gmail.com
640f7bdcf989a744147ab04bd11cbf87c1a8056f
ed3cb95dcc590e98d09117ea0b4768df18e8f99e
/project_1_2/src/b/i/b/b/Calc_1_2_18118.java
bd7b043b73e3c836e876bbf9d8887e0a23acf959
[]
no_license
chalstrick/bigRepo1
ac7fd5785d475b3c38f1328e370ba9a85a751cff
dad1852eef66fcec200df10083959c674fdcc55d
refs/heads/master
2016-08-11T17:59:16.079541
2015-12-18T14:26:49
2015-12-18T14:26:49
48,244,030
0
0
null
null
null
null
UTF-8
Java
false
false
134
java
package b.i.b.b; public class Calc_1_2_18118 { /** @return the sum of a and b */ public int add(int a, int b) { return a+b; } }
[ "christian.halstrick@sap.com" ]
christian.halstrick@sap.com
96c8e92cfd53d2a3098033202a8280dde7846270
5d2d0954f6dfcc0919f0011c182ddb7d71e261f6
/src/com/facebook/buck/rules/modern/builders/IsolatedExecution.java
2f38706febbb093329ae541e406df734d332d610
[ "Apache-2.0" ]
permissive
shs96c/buck
0c43f27ea9ad809a2a1b7e20ec13f04218b2bd0b
9918f375ec720fda0de131fb612c4c8213a076d8
refs/heads/master
2020-02-26T16:38:29.579464
2018-09-26T16:10:11
2018-09-26T16:50:26
14,203,105
3
4
null
null
null
null
UTF-8
Java
false
false
2,326
java
/* * Copyright 2018-present Facebook, 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.facebook.buck.rules.modern.builders; import com.facebook.buck.core.cell.Cell; import com.facebook.buck.core.cell.CellPathResolver; import com.facebook.buck.core.model.BuildTarget; import com.facebook.buck.core.rules.SourcePathRuleFinder; import com.facebook.buck.core.rules.build.strategy.BuildRuleStrategy; import com.facebook.buck.remoteexecution.Protocol; import com.facebook.buck.step.ExecutionContext; import com.facebook.buck.step.StepFailedException; import com.facebook.buck.util.function.ThrowingFunction; import com.google.common.hash.HashCode; import java.io.Closeable; import java.io.IOException; import java.nio.file.Path; import java.util.Set; /** * Interface used to implement various isolated execution strategies. In these strategies, * buildrules are run in isolation (i.e. outside of the real build root, in a different directory, * on a different machine, etc). */ public interface IsolatedExecution extends Closeable { void build( ExecutionContext executionContext, FileTreeBuilder inputsBuilder, Set<Path> outputs, Path projectRoot, HashCode hash, BuildTarget buildTarget, Path cellPrefixRoot) throws IOException, StepFailedException, InterruptedException; Protocol getProtocol(); /** Creates a BuildRuleStrategy for a particular */ static BuildRuleStrategy createIsolatedExecutionStrategy( IsolatedExecution executionStrategy, SourcePathRuleFinder ruleFinder, CellPathResolver cellResolver, Cell rootCell, ThrowingFunction<Path, HashCode, IOException> fileHasher) { return new IsolatedExecutionStrategy( executionStrategy, ruleFinder, cellResolver, rootCell, fileHasher); } }
[ "facebook-github-bot@users.noreply.github.com" ]
facebook-github-bot@users.noreply.github.com
0c06be0442e8e2ee8ee5c6dbf7866aa71e07c6a1
ba9cc65650c01c079e36cc5ee5853c67af3b691a
/nfs/src/main/java/net/openhft/chronicle/engine/nfs/NFSUtils.java
ce60b9d8f0f4aeceb4cf729d9625dc690c2fdc3b
[ "Apache-2.0" ]
permissive
tchen0123/Chronicle-Engine
b97d09075f59d28b43bafb031425554ea8680296
24761220caf2220229735881d14fe403e478005b
refs/heads/master
2020-04-12T21:31:47.378595
2018-11-12T18:29:19
2018-11-12T18:29:19
162,764,299
0
2
NOASSERTION
2018-12-21T22:49:05
2018-12-21T22:49:04
null
UTF-8
Java
false
false
1,948
java
/* * Copyright (C) 2015 higherfrequencytrading.com * * This program 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 3 of the License. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with this program. If not, see <http://www.gnu.org/licenses/>. */ package net.openhft.chronicle.engine.nfs; import org.dcache.nfs.vfs.FileHandle; import org.dcache.nfs.vfs.Inode; import java.lang.reflect.Field; import java.nio.ByteBuffer; import java.util.Arrays; /* * Created by Peter Lawrey on 24/08/15. */ public enum NFSUtils { ; public static String toString(Inode inode) { try { Field fhField = Inode.class.getDeclaredField("fh"); fhField.setAccessible(true); FileHandle fh = (FileHandle) fhField.get(inode); byte[] fsOpaque = fh.getFsOpaque(); String fsos; if (fsOpaque.length == 8) fsos = Long.toHexString(ByteBuffer.wrap(fsOpaque).getLong()); else fsos = Arrays.toString(fsOpaque); return "v:" + Integer.toHexString(fh.getVersion()) + ",m:" + Integer.toHexString(fh.getMagic()) + ",g:" + Integer.toHexString(fh.getGeneration()) + ",i:" + Integer.toHexString(fh.getExportIdx()) + ",t:" + Integer.toHexString(fh.getType()) + ",o:" + fsos; } catch (Exception e) { return String.valueOf(inode); } } }
[ "peter.lawrey@higherfrequencytrading.com" ]
peter.lawrey@higherfrequencytrading.com
923cd097f971860499dcfa259ddbe83834a39fe6
875d88ee9cf7b40c9712178d1ee48f0080fa0f8a
/geronimo-jcdi_1.1_spec/src/main/java/javax/enterprise/context/spi/Context.java
33d54b28ff3d8ff4be1f65d0fda925d4cda0ef79
[ "Apache-2.0", "W3C", "W3C-19980720" ]
permissive
jgallimore/geronimo-specs
b152164488692a7e824c73a9ba53e6fb72c6a7a3
09c09bcfc1050d60dcb4656029e957837f851857
refs/heads/trunk
2022-12-15T14:02:09.338370
2020-09-14T18:21:46
2020-09-14T18:21:46
284,994,475
0
1
Apache-2.0
2020-09-14T18:21:47
2020-08-04T13:51:47
Java
UTF-8
Java
false
false
3,470
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 javax.enterprise.context.spi; import java.lang.annotation.Annotation; import javax.enterprise.context.ContextNotActiveException; import javax.enterprise.context.NormalScope; /** * Every webbeans component has an associated context that are * defined by the {@link NormalScope} annotation. Webbeans components * that are contained in the context are managed by the webbeans container. * * <p> * Every context has a well-defined lifecycle. It means that * in some time, context is active and some other time context may * be passive. Moreover, each context is created and destroyed by the container * according to the timing requirements. For example, request context is started by every * http request and destroyed at the end of the http response. According to the current thread, * active context is called an thread current context. * </p> * * <p> * Context is responsible for creating and destroying the {@link Contextual} instances of the * webbeans components. * </p> * * @version $Rev$ $Date$ */ public interface Context { /** * Returns the scope type of the context. * * @return the scope type of the context */ public Class<? extends Annotation> getScope(); /** * If the context is not active, throws {@link ContextNotActiveException}. * Otherwise, it looks for the given component instance in the context map. If * this context contains the given webbeans component instance, it returns the component. * If the component is not found in this context map, it looks for the <code>creationalContext</code> * argument. If it is null, it returns null, otherwise new webbeans instance is created * and puts into the context and returns it. * * @param <T> type of the webbeans component * @param component webbeans component * @param creationalContext {@link CreationalContext} instance * @return the contextual instance or null */ public <T> T get(Contextual<T> component, CreationalContext<T> creationalContext); /** * Returns the instance of the webbeans in this context if exist otherwise return null. * * @param <T> type of the webbeans component * @param component webbeans component * @return the instance of the webbeans in this context if exist otherwise return null */ public <T> T get(Contextual<T> component); /** * Returns true if context is active according to the current thread, * returns false otherwise. * * @return true if context is active according to the current thread, * return false otherwise */ boolean isActive(); }
[ "djencks@apache.org" ]
djencks@apache.org
148dd4c007e14ea4cd789f8d335463d29c94826e
f86187d88375939cc299b361af3dc84cd9f705c4
/EclipseDevelop_JavaEE2/baiHoo.activiti/src/com/baiHoo/activiti/approveInfo/dao/dao/ApproveInfoDao.java
46c43cfd580cfd421e47d1f861d5536b58a721af
[]
no_license
ChenBaiHong/baihoo.EclipseDataBank
83c7b5ceccf80eea5e8b606893463d2d98a53d67
e4698c40f2a1d3ffc0be07115838234aebb8ba95
refs/heads/master
2020-03-26T11:45:49.204873
2018-08-15T14:37:38
2018-08-15T14:37:38
144,859,060
0
0
null
null
null
null
UTF-8
Java
false
false
324
java
package com.baiHoo.activiti.approveInfo.dao.dao; import java.util.List; import com.baiHoo.activiti.approveInfo.vo.ApproveInfoModel; import com.baiHoo.utils.base.BaseDao; public interface ApproveInfoDao extends BaseDao<ApproveInfoModel> { public List<ApproveInfoModel> findListByApplicationId(Integer applicationId); }
[ "cbh12345661@hotmail.com.cn" ]
cbh12345661@hotmail.com.cn
c06f9050dbce38cf9cc43467460decfe8a406cde
06ba265590ca22f8539ebe5d87d5d20833636eb6
/src/test/java/io/jzheaux/pluralsight/securecoding/module4/MessageTest.java
0f8d62f9d8e0e5f1756c630495a11105b66eb40f
[]
no_license
jzheaux/pluralsight-secure-coding-java-11
c8e1d814ca9787c902962a84a5f170d9e6ad1a42
ebbb5914fab07b7864a35268f2563526ed1a93cd
refs/heads/main
2023-04-01T08:07:53.814450
2021-03-30T05:32:46
2021-03-30T05:32:46
352,881,532
3
1
null
null
null
null
UTF-8
Java
false
false
2,809
java
package io.jzheaux.pluralsight.securecoding.module4; import org.apache.commons.logging.LogFactory; import org.assertj.core.util.Files; import org.junit.jupiter.api.Test; import org.springframework.beans.factory.xml.DefaultDocumentLoader; import org.springframework.beans.factory.xml.DocumentLoader; import org.springframework.beans.factory.xml.PluggableSchemaResolver; import org.springframework.util.xml.SimpleSaxErrorHandler; import org.w3c.dom.Document; import org.xml.sax.InputSource; import javax.xml.parsers.DocumentBuilder; import javax.xml.parsers.DocumentBuilderFactory; import java.io.ByteArrayInputStream; import java.io.File; import java.nio.charset.StandardCharsets; import java.util.stream.Collectors; public class MessageTest { @Test public void testEtcHosts() { File file = new File("C:\\Windows\\system32\\drivers\\etc\\hosts"); System.out.println(file.exists()); System.out.println(Files.linesOf(file, StandardCharsets.UTF_8) .stream().collect(Collectors.joining("\r\n"))); } @Test public void testXMLParsing() throws Exception { DocumentBuilderFactory factory = DocumentBuilderFactory.newDefaultInstance(); DocumentBuilder builder = factory.newDocumentBuilder(); String xml = "<?xml version=\"1.0\" encoding=\"ISO-8859-1\"?>\n" + "<!DOCTYPE root [\n" + " <!ELEMENT includeme ANY>\n" + " <!ENTITY xxe SYSTEM \"c:\\Windows\\System32\\drivers\\etc\\hosts\">\n" + "]>\n" + "<root>&xxe;</root>"; Document doc = builder.parse(new ByteArrayInputStream(xml.getBytes())); System.out.println(doc.getDocumentElement().getChildNodes().item(0).getTextContent()); } @Test public void testXMLValidating() throws Exception { DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance(); factory.setValidating(true); factory.setNamespaceAware(true); factory.setAttribute("http://java.sun.com/xml/jaxp/properties/schemaLanguage", "http://www.w3.org/2001/XMLSchema"); DocumentBuilder builder = factory.newDocumentBuilder(); String xml = "<?xml version=\"1.0\" encoding=\"ISO-8859-1\"?>\n" + "<root xmlns=\"https://example.org\"" + " xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" " + " xsi:schemaLocation=\"https://example.org http://springframework.org/schema/spring-beans.xsd\"></root>"; DocumentLoader loader = new DefaultDocumentLoader(); Document doc = builder.parse(new ByteArrayInputStream(xml.getBytes())); Document d = loader.loadDocument(new InputSource(new ByteArrayInputStream(xml.getBytes())), new PluggableSchemaResolver(this.getClass().getClassLoader()), new SimpleSaxErrorHandler(LogFactory.getLog(this.getClass())), 3, true); System.out.println(doc.getDocumentElement().getChildNodes().item(0).getTextContent()); } }
[ "josh.cummings@gmail.com" ]
josh.cummings@gmail.com
d5bc3dffc2db3b436c85a370087605e2c202f866
ecf796983785c4e92a1377b3271b5b1cf66a6495
/Projects/NCC_621/app/src/main/java/cn/rongcloud/werewolf/ui/widget/ListItemSwitchButton.java
de37c635987effddaed6e4989f276f34ec41b304
[]
no_license
rongcloud-community/RongCloud_Hackathon_2020
1b56de94b470229242d3680ac46d6a00c649c7d6
d4ef61d24cfed142cd90f7d1d8dcd19fb5cbf015
refs/heads/master
2022-07-27T18:24:19.210225
2020-10-16T01:14:41
2020-10-16T01:14:41
286,389,237
6
129
null
2020-10-16T05:44:11
2020-08-10T05:59:35
JavaScript
UTF-8
Java
false
false
2,460
java
package cn.rongcloud.werewolf.ui.widget; import android.content.Context; import android.content.res.TypedArray; import android.graphics.drawable.Drawable; import android.util.AttributeSet; import android.widget.CompoundButton; import android.widget.LinearLayout; import android.widget.TextView; import cn.rongcloud.werewolf.R; public class ListItemSwitchButton extends LinearLayout { private SwitchButton switchButton; private TextView listItemTitle; public ListItemSwitchButton(Context context) { super(context); initView(null); } public ListItemSwitchButton(Context context, AttributeSet attrs) { super(context, attrs); initView(attrs); } private void initView(AttributeSet attrs) { inflate(getContext(), R.layout.view_switch_button_list_item, this); switchButton = findViewById(R.id.switch_button); listItemTitle = findViewById(R.id.tv_title); if (attrs != null) { TypedArray attributes = getContext().obtainStyledAttributes(attrs, R.styleable.swb_list_item); CharSequence title = attributes.getText(R.styleable.swb_list_item_swb_list_item_title); Drawable drawable = attributes.getDrawable(R.styleable.swb_list_item_swb_list_item_button_drawable); listItemTitle.setText(title); if (drawable != null) { switchButton.setBackDrawable(drawable); } attributes.recycle(); } } public void setSwitchButtonChangedListener(CompoundButton.OnCheckedChangeListener checkedChangeListener) { switchButton.setOnCheckedChangeListener(checkedChangeListener); } public void setChecked(boolean checked) { switchButton.setChecked(checked); } public boolean isChecked() { return switchButton.isChecked(); } public void setCheckedImmediately(boolean checked) { switchButton.setCheckedImmediately(checked); } public void setSwitchButtonClickListener(OnClickListener clickListener) { switchButton.setOnClickListener(clickListener); } public void setContent(String content) { listItemTitle.setText(content); } public TextView getContent(){ return listItemTitle; } public void setContentColor(int color) { listItemTitle.setTextColor(color); } public void setListItemSwitchButtonAlpha(float alpha) { setAlpha(alpha); } }
[ "geekonline@126.com" ]
geekonline@126.com
a38f86559f88e64681d0c42e0e02e0b795b4afa0
be73270af6be0a811bca4f1710dc6a038e4a8fd2
/crash-reproduction-moho/results/XWIKI-13196-5-13-NSGA_II-WeightedSum:TestLen:CallDiversity/org/xwiki/search/solr/internal/reference/DocumentSolrReferenceResolver_ESTest_scaffolding.java
671c87660954a28d6ecf1f26523c958116a92060
[]
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
474
java
/** * Scaffolding file used to store all the setups needed to run * tests automatically generated by EvoSuite * Thu Apr 02 02:03:22 UTC 2020 */ package org.xwiki.search.solr.internal.reference; import org.evosuite.runtime.annotation.EvoSuiteClassExclude; import org.junit.BeforeClass; import org.junit.Before; import org.junit.After; @EvoSuiteClassExclude public class DocumentSolrReferenceResolver_ESTest_scaffolding { // Empty scaffolding for empty test suite }
[ "pouria.derakhshanfar@gmail.com" ]
pouria.derakhshanfar@gmail.com
ec3496ce9bc95112c2a119fca911f779a02dc5f6
2346640d12fc55f659f9b21f0b3e8a83d0e34955
/jtransc-rt/src/java/security/Provider.java
4dd155fa3fbfd73e0d65b54deced0ad5a22b3848
[ "W3C", "EPL-1.0", "BSD-3-Clause", "LicenseRef-scancode-other-permissive", "TCL", "MIT", "Apache-2.0", "ICU" ]
permissive
renesugar/jtransc
b28e701186d8e574de2f6eaf856cd901d3f0250e
9a562bf3f855c16cbea8c8c2e2ca4f3665d8626a
refs/heads/master
2021-04-06T04:04:03.461653
2020-05-25T01:38:20
2020-05-25T01:38:20
124,779,921
0
0
Apache-2.0
2020-05-25T01:38:22
2018-03-11T17:15:01
Java
UTF-8
Java
false
false
2,816
java
/* * Copyright 2016 Carlos Ballesteros Velasco * * 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 java.security; import java.io.IOException; import java.io.InputStream; import java.util.*; public abstract class Provider extends Properties { private String name; private String info; private double version; protected Provider(String name, double version, String info) { this.name = name; this.version = version; this.info = info; } public String getName() { return name; } public double getVersion() { return version; } public String getInfo() { return info; } public String toString() { return name + " version " + version; } @Override public native synchronized void clear(); @Override public native synchronized void load(InputStream inStream) throws IOException; @Override native public synchronized void putAll(Map<?, ?> t); @Override public native synchronized Set<Map.Entry<Object, Object>> entrySet(); @Override public native Set<Object> keySet(); @Override public native Collection<Object> values(); @Override public native synchronized Object put(Object key, Object value); @Override public native synchronized Object remove(Object key); @Override public native Object get(Object key); @Override public native Enumeration<Object> keys(); @Override public native Enumeration<Object> elements(); public native String getProperty(String key); public synchronized native Service getService(String type, String algorithm); public native synchronized Set<Service> getServices(); protected native synchronized void putService(Service s); protected native synchronized void removeService(Service s); public static class Service { public Service(Provider provider, String type, String algorithm, String className, List<String> aliases, Map<String, String> attributes) { } public native final String getType(); public native final String getAlgorithm(); public native final Provider getProvider(); public native final String getClassName(); public native final String getAttribute(String name); public native Object newInstance(Object constructorParameter) throws NoSuchAlgorithmException; public native boolean supportsParameter(Object parameter); public native String toString(); } }
[ "soywiz@gmail.com" ]
soywiz@gmail.com
0d39b873346cae4fbc5e2a20c72f8c6e8ec0f437
93346337f6b0865cfaac5cfd9d945cc5f865ab36
/app/src/main/java/be/ugent/zeus/hydra/data/database/minerva/AgendaExtractor.java
e01a7dcf49c23d23b15a053b6a26d4e4f1601b05
[ "MIT", "Apache-2.0" ]
permissive
codetriage-readme-bot/hydra-android
900d16fc4dce54fc3a47c2b21bc1cb11cbbb3d1d
d21bb396c5c64bc62e79f7497fd516fa91ceecc3
refs/heads/master
2021-04-29T15:02:57.774731
2017-12-06T23:05:41
2017-12-06T23:05:41
121,788,276
0
0
null
2018-02-16T18:54:27
2018-02-16T18:54:27
null
UTF-8
Java
false
false
6,582
java
package be.ugent.zeus.hydra.data.database.minerva; import android.database.Cursor; import android.support.annotation.NonNull; import be.ugent.zeus.hydra.data.models.minerva.AgendaItem; import be.ugent.zeus.hydra.data.models.minerva.Course; import be.ugent.zeus.hydra.utils.TtbUtils; import static be.ugent.zeus.hydra.data.database.Utils.intToBool; /** * Class to extract a {@link AgendaItem} from a {@link Cursor}. * * This class should be set up once per database request. Build this class with the builder class. * * The builder class needs to be provided with the Cursor. Note that this class does NOT advance the cursor. * * @author Niko Strijbol */ class AgendaExtractor { private int columnIndex; private int columnTitle; private int columnContent; private int columnStartDate; private int columnEndDate; private int columnLocation; private int columnType; private int columnLastEditUser; private int columnLastEdit; private int columnLastEditType; private int columnCalendarId; private int columnIsMerged; private final Cursor cursor; private AgendaExtractor(Cursor cursor) { this.cursor = cursor; } /** * Get an announcement from the cursor. To re-iterate, this does NOT affect the position of the cursor in any way. * * @return The announcement. */ public AgendaItem getAgendaItem(Course course) { AgendaItem a = new AgendaItem(); a.setCourse(course); a.setItemId(cursor.getInt(columnIndex)); a.setTitle(cursor.getString(columnTitle)); a.setContent(cursor.getString(columnContent)); a.setStartDate(TtbUtils.unserialize(cursor.getLong(columnStartDate))); a.setEndDate(TtbUtils.unserialize(cursor.getLong(columnEndDate))); a.setLocation(cursor.getString(columnLocation)); a.setType(cursor.getString(columnType)); a.setLastEditUser(cursor.getString(columnLastEditUser)); a.setLastEdited(TtbUtils.unserialize(cursor.getLong(columnLastEdit))); a.setLastEditType(cursor.getString(columnLastEditType)); a.setCalendarId(cursor.getLong(columnCalendarId)); a.setMerged(intToBool(cursor.getInt(columnIsMerged))); return a; } public int getColumnIndex() { return columnIndex; } public int getColumnTitle() { return columnTitle; } public int getColumnContent() { return columnContent; } public int getColumnStartDate() { return columnStartDate; } public int getColumnEndDate() { return columnEndDate; } public int getColumnLocation() { return columnLocation; } public int getColumnType() { return columnType; } public int getColumnLastEditUser() { return columnLastEditUser; } public int getColumnLastEdit() { return columnLastEdit; } public int getColumnLastEditType() { return columnLastEditType; } public int getColumnIsMerged() { return columnIsMerged; } /** * Builder class. */ @SuppressWarnings("unused") public static class Builder { private final AgendaExtractor extractor; public Builder(@NonNull Cursor cursor) { this.extractor = new AgendaExtractor(cursor); } /** * Set every column int to the default value. The default value is the column name in the database table. */ public Builder defaults() { extractor.columnIndex = extract(AgendaTable.Columns.ID); extractor.columnTitle = extract(AgendaTable.Columns.TITLE); extractor.columnContent = extract(AgendaTable.Columns.CONTENT); extractor.columnStartDate = extract(AgendaTable.Columns.START_DATE); extractor.columnEndDate = extract(AgendaTable.Columns.END_DATE); extractor.columnLocation = extract(AgendaTable.Columns.LOCATION); extractor.columnType = extract(AgendaTable.Columns.TYPE); extractor.columnLastEditUser = extract(AgendaTable.Columns.LAST_EDIT_USER); extractor.columnLastEdit = extract(AgendaTable.Columns.LAST_EDIT); extractor.columnLastEditType = extract(AgendaTable.Columns.LAST_EDIT_TYPE); extractor.columnCalendarId = extract(AgendaTable.Columns.CALENDAR_ID); extractor.columnIsMerged = extract(AgendaTable.Columns.IS_MERGED); return this; } private int extract(String column) { return extractor.cursor.getColumnIndexOrThrow(column); } public Builder columnIndex(String columnIndex) { extractor.columnIndex = extract(columnIndex); return this; } public Builder columnTitle(String columnTitle) { extractor.columnTitle = extract(columnTitle); return this; } public Builder columnContent(String columnContent) { extractor.columnContent = extract(columnContent); return this; } public Builder columnStartDate(String columnName) { extractor.columnStartDate = extract(columnName); return this; } public Builder columnEndDate(String columnName) { extractor.columnEndDate = extract(columnName); return this; } public Builder columnLocation(String columnName) { extractor.columnLocation = extract(columnName); return this; } public Builder columnType(String columnName) { extractor.columnType = extract(columnName); return this; } public Builder columnLastEditUser(String columnName) { extractor.columnLastEditUser = extract(columnName); return this; } public Builder columnLastEdit(String columnName) { extractor.columnLastEdit = extract(columnName); return this; } public Builder columnLastEditType(String columnName) { extractor.columnLastEditType = extract(columnName); return this; } public Builder columnCalendarId(String columnName) { extractor.columnCalendarId = extract(columnName); return this; } public Builder columnIsMerged(String columnName) { extractor.columnIsMerged = extract(columnName); return this; } public AgendaExtractor build() { return extractor; } } }
[ "strijbol.niko@gmail.com" ]
strijbol.niko@gmail.com
07349a4b3f68e7a8c0786adebe65f21c4c7c24c5
cd15885f1af5387bec79c475461361484e7354e1
/src/selftest/java/polymorphism/L3.java
e897445e724e125766e3dfbf06a5caa392124a49
[]
no_license
jyjun1015/java-study
b6b7d7acd9d5600b0445f3ac7581dd215522d2ff
1c1cefa65c1221dd610eb3e4bdff4e6306484d44
refs/heads/master
2023-01-07T21:19:11.134340
2020-11-04T08:14:06
2020-11-04T08:14:06
null
0
0
null
null
null
null
UTF-8
Java
false
false
706
java
package selftest.java.polymorphism; public class L3 extends Car implements Temp { public L3() { } public L3(String name, String engine, int oilTank, int oilSize, int distance) { super(name, engine, oilTank, oilSize, distance); } @Override public int getTempGage() { return getDistance() / 10; } @Override void go(int distance) { super.setDistance(getDistance() + distance); setOilSize(getOilSize() - distance / 10); } @Override void setOil(int oilSize) { super.setOilSize(getOilSize() + oilSize);; } @Override public String toString() { return getName() + " " + getEngine() + " " + getOilTank() + " " + getOilSize() + " " + getDistance() + " " + getTempGage(); } }
[ "choihwan2@naver.com" ]
choihwan2@naver.com
80bc151abd20e993390576d494e8423e330d7fc6
10bd8fb31efc77d3ba139180a1346081e389a770
/greencoffee/src/main/java/gherkin/TokenFormatter.java
1375ec9437270aed0a8358dc29ceeb447cf80916
[ "MIT" ]
permissive
mauriciotogneri/green-coffee
399b409824369c420bba255f2d999f0420267a2b
caf960ec6f63c91428909b556410691ab1e38d46
refs/heads/master
2021-07-04T10:22:00.538649
2021-02-15T21:06:46
2021-02-15T21:06:46
66,268,420
247
35
MIT
2018-08-23T20:07:39
2016-08-22T11:52:37
Java
UTF-8
Java
false
false
930
java
package gherkin; public class TokenFormatter { private static final StringUtils.ToString<GherkinLineSpan> SPAN_TO_STRING = new StringUtils.ToString<GherkinLineSpan>() { @Override public String toString(GherkinLineSpan o) { return o.column + ":" + o.text; } }; public String formatToken(Token token) { if (token.isEOF()) return "EOF"; return String.format("(%s:%s)%s:%s/%s/%s", toString(token.location.getLine()), toString(token.location.getColumn()), toString(token.matchedType), toString(token.matchedKeyword), toString(token.matchedText), toString(token.mathcedItems == null ? "" : StringUtils.join(SPAN_TO_STRING, ",", token.mathcedItems)) ); } private String toString(Object o) { return o == null ? "" : o.toString(); } }
[ "mauricio.togneri@gmail.com" ]
mauricio.togneri@gmail.com
89de177b16390bed03d0052f61940a1c68747347
69a4f2d51ebeea36c4d8192e25cfb5f3f77bef5e
/methods/Method_864.java
da533cbeeaf7b9f860a927e96d03b8b514af6bba
[]
no_license
P79N6A/icse_20_user_study
5b9c42c6384502fdc9588430899f257761f1f506
8a3676bc96059ea2c4f6d209016f5088a5628f3c
refs/heads/master
2020-06-24T08:25:22.606717
2019-07-25T15:31:16
2019-07-25T15:31:16
null
0
0
null
null
null
null
UTF-8
Java
false
false
1,410
java
protected void checkCommentsBetweenDeclarations(ASTCompilationUnit cUnit,Object data){ SortedMap<Integer,Node> itemsByLineNumber=orderedCommentsAndDeclarations(cUnit); Comment lastComment=null; boolean suppressWarning=false; CommentPatternEnum commentPattern=CommentPatternEnum.NONE; for ( Entry<Integer,Node> entry : itemsByLineNumber.entrySet()) { Node value=entry.getValue(); if (value instanceof JavaNode) { JavaNode node=(JavaNode)value; if (lastComment != null && isCommentBefore(lastComment,node)) { if (!CommentPatternEnum.NONE.equals(commentPattern)) { boolean statementOutsideMethod=CommentPatternEnum.STATEMENT.equals(commentPattern) && !(node instanceof ASTBlockStatement); if (!statementOutsideMethod) { addViolationWithMessage(data,node,getMessage(),lastComment.getBeginLine(),lastComment.getEndLine()); } } lastComment=null; } suppressWarning=false; commentPattern=CommentPatternEnum.NONE; } else if (value instanceof Comment) { lastComment=(Comment)value; String content=lastComment.getImage(); if (!suppressWarning) { suppressWarning=SUPPRESS_PATTERN.matcher(content).matches(); } if (!suppressWarning && CommentPatternEnum.NONE.equals(commentPattern)) { commentPattern=this.scanCommentedCode(content); } } } }
[ "sonnguyen@utdallas.edu" ]
sonnguyen@utdallas.edu
b71e76f1368f95181487cebbd6e812d55375ca04
afb6ed9359f1af15300c4e1074a685f6d56a8298
/gatling-netty-util/src/test/java/io/gatling/netty/util/ahc/TestUTF8UrlCodec.java
af07d8fd7f9ca392f307e48c249e5dba1d05a5b8
[ "Apache-2.0", "BSD-3-Clause", "EPL-1.0", "GPL-2.0-only", "BSD-2-Clause", "MPL-2.0", "MIT" ]
permissive
negokaz/gatling
954e58eb49808e382157f56b89f95633ee9a6bf8
add941efd09116898c07006735acb80d6c4ec01d
refs/heads/master
2020-03-27T19:15:29.872978
2018-08-31T07:01:23
2018-08-31T07:04:35
146,976,152
0
0
Apache-2.0
2018-09-01T07:01:31
2018-09-01T07:01:30
null
UTF-8
Java
false
false
1,320
java
/* * Copyright 2011-2018 GatlingCorp (http://gatling.io) * * 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 io.gatling.netty.util.ahc; import org.junit.jupiter.api.Test; import static org.junit.jupiter.api.Assertions.assertEquals; class TestUTF8UrlCodec { @Test void testBasics() { assertEquals("foobar", Utf8UrlEncoder.encodeQueryElement("foobar")); assertEquals("a%26b", Utf8UrlEncoder.encodeQueryElement("a&b")); assertEquals("a%2Bb", Utf8UrlEncoder.encodeQueryElement("a+b")); } @Test void testPercentageEncoding() { assertEquals("foobar", Utf8UrlEncoder.percentEncodeQueryElement("foobar")); assertEquals("foo%2Abar", Utf8UrlEncoder.percentEncodeQueryElement("foo*bar")); assertEquals("foo~b_ar", Utf8UrlEncoder.percentEncodeQueryElement("foo~b_ar")); } }
[ "slandelle@gatling.io" ]
slandelle@gatling.io
4d9d8a8a61bf9d3a570341eea33932defb30c13e
d883f3b07e5a19ff8c6eb9c3a4b03d9f910f27b2
/Model/DataModel/src/main/java/com/sandata/lab/data/model/dl/model/FindClassResult.java
1ca46ce66602c84047fc72983815d95690811931
[]
no_license
dev0psunleashed/Sandata_SampleDemo
ec2c1f79988e129a21c6ddf376ac572485843b04
a1818601c59b04e505e45e33a36e98a27a69bc39
refs/heads/master
2021-01-25T12:31:30.026326
2017-02-20T11:49:37
2017-02-20T11:49:37
82,551,409
0
0
null
null
null
null
UTF-8
Java
false
false
3,942
java
package com.sandata.lab.data.model.dl.model; import com.google.gson.annotations.SerializedName; import com.sandata.lab.data.model.*; import com.sandata.lab.data.model.base.BaseObject; import com.sandata.lab.data.model.dl.annotation.Mapping; import javax.xml.bind.annotation.XmlAttribute; import javax.xml.bind.annotation.XmlSchemaType; import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter; import java.util.Date; /** * Date: 10/8/15 * Time: 11:21 AM */ public class FindClassResult extends BaseObject { private static final long serialVersionUID = 1L; @SerializedName("StaffTrainingLocationName") protected String staffTrainingLocationName; @SerializedName("StaffTrainingCode") protected String staffTrainingCode; @SerializedName("StaffTrainingStartDateTime") protected Date staffTrainingStartDateTime; @SerializedName("StaffTrainingEndDateTime") protected Date staffTrainingEndDateTime; @SerializedName("StaffTrainingName") protected String staffTrainingName; @SerializedName("StaffTrainingDescription") protected String staffTrainingDescription; @SerializedName("StaffTrainingCompletedIndicator") private boolean staffTrainingCompletedIndicator; @SerializedName("StaffTrainingNoShowIndicator") private boolean staffTrainingNoShowIndicator; @SerializedName("StaffTrainingDropIndicator") protected Boolean staffTrainingDropIndicator; @SerializedName("ClassStatus") protected String classStatus; public String getClassStatus() { return classStatus; } public void setClassStatus(String classStatus) { this.classStatus = classStatus; } public Boolean getStaffTrainingDropIndicator() { return staffTrainingDropIndicator; } public void setStaffTrainingDropIndicator(Boolean staffTrainingDropIndicator) { this.staffTrainingDropIndicator = staffTrainingDropIndicator; } public String getStaffTrainingLocationName() { return staffTrainingLocationName; } public void setStaffTrainingLocationName(String staffTrainingLocationName) { this.staffTrainingLocationName = staffTrainingLocationName; } public String getStaffTrainingCode() { return staffTrainingCode; } public void setStaffTrainingCode(String staffTrainingCode) { this.staffTrainingCode = staffTrainingCode; } public Date getStaffTrainingStartDateTime() { return staffTrainingStartDateTime; } public void setStaffTrainingStartDateTime(Date staffTrainingStartDateTime) { this.staffTrainingStartDateTime = staffTrainingStartDateTime; } public Date getStaffTrainingEndDateTime() { return staffTrainingEndDateTime; } public void setStaffTrainingEndDateTime(Date staffTrainingEndDateTime) { this.staffTrainingEndDateTime = staffTrainingEndDateTime; } public String getStaffTrainingName() { return staffTrainingName; } public void setStaffTrainingName(String staffTrainingName) { this.staffTrainingName = staffTrainingName; } public String getStaffTrainingDescription() { return staffTrainingDescription; } public void setStaffTrainingDescription(String staffTrainingDescription) { this.staffTrainingDescription = staffTrainingDescription; } public boolean isStaffTrainingCompletedIndicator() { return staffTrainingCompletedIndicator; } public void setStaffTrainingCompletedIndicator(boolean staffTrainingCompletedIndicator) { this.staffTrainingCompletedIndicator = staffTrainingCompletedIndicator; } public boolean isStaffTrainingNoShowIndicator() { return staffTrainingNoShowIndicator; } public void setStaffTrainingNoShowIndicator(boolean staffTrainingNoShowIndicator) { this.staffTrainingNoShowIndicator = staffTrainingNoShowIndicator; } }
[ "pradeep.ganesh@softcrylic.co.in" ]
pradeep.ganesh@softcrylic.co.in
e34893d67ce09db50546d4cb59ed953ac7123398
6d86122880020a3766f4f4faa01af45e353595df
/spring-boot-example/src/test/java/de/rieckpil/blog/selenide/FirefoxDashboardControllerWebTest.java
a318c058c7e0bdc66d9894aa92604afbde538762
[ "MIT" ]
permissive
ibercode/java-testing-ecosystem
35abc150a14864983c23fb482300181eab4f6560
2fac24353514cdf4f16402b7fa6e7e705f7eed04
refs/heads/master
2023-07-15T23:26:51.940907
2021-08-31T16:33:45
2021-08-31T16:33:45
null
0
0
null
null
null
null
UTF-8
Java
false
false
2,070
java
package de.rieckpil.blog.selenide; import com.codeborne.selenide.CollectionCondition; import com.codeborne.selenide.Condition; import com.codeborne.selenide.Configuration; import com.codeborne.selenide.Selenide; import org.junit.jupiter.api.BeforeAll; import org.junit.jupiter.api.Disabled; import org.junit.jupiter.api.Test; import org.openqa.selenium.By; import org.springframework.boot.test.context.SpringBootTest; import org.springframework.boot.web.server.LocalServerPort; import static org.springframework.boot.test.context.SpringBootTest.WebEnvironment.RANDOM_PORT; @Disabled("Showcase only") @SpringBootTest(webEnvironment = RANDOM_PORT) class FirefoxDashboardControllerWebTest { @LocalServerPort private Integer port; @BeforeAll static void configure() { Configuration.browser = "firefox"; Configuration.browserSize = "1337x1337"; Configuration.timeout = 2000; } @Test void accessDashboardPage() { Selenide.open("http://localhost:" + port + "/dashboard"); Selenide.$(By.tagName("button")).click(); Selenide.$(By.tagName("h1")).shouldHave(Condition.text("Welcome to the Dashboard!")); Selenide.$(By.tagName("h1")).shouldNotHave(Condition.cssClass("navy-blue")); Selenide.$(By.tagName("h1")).shouldBe(Condition.visible); Selenide.$(By.tagName("h1")).shouldNotBe(Condition.hidden); Selenide.$$(By.tagName("h1")).shouldHave(CollectionCondition.size(1)); } @Test void accessDashboardPageAndLoadCustomers() { Selenide.open("http://localhost:" + port + "/dashboard"); // customer table should not be part of the DOM Selenide.$(By.id("all-customers")).shouldNot(Condition.exist); Selenide.screenshot("pre-customer-fetch"); // let's fetch some customers Selenide.$(By.id("fetch-customers")).click(); Selenide.screenshot("post-customer-fetch"); // the customer table should now be part of the DOM Selenide.$(By.id("all-customers")).should(Condition.exist); Selenide.$$(By.className("customer-information")).shouldHave(CollectionCondition.size(3)); } }
[ "mail@philipriecks.de" ]
mail@philipriecks.de
d053a33b46148929ab5da9e23adebd94a26acf80
d17dd60c17f1186de7467f6d3394c1b54fba0961
/src/main/java/enterprises/orbital/evekit/model/character/sync/ESICharacterShipSync.java
89cd373b0a45c254719ebbb73e5c0ef31e5e4017
[]
no_license
OrbitalEnterprises/evekit-sync
9777bd40e2c4756df96dc981ec72629dae566d2e
5a6da9ac58d9e68956ee39df955b01ad644a7e18
refs/heads/master
2021-01-18T22:08:03.833650
2018-10-12T11:05:38
2018-10-12T11:05:38
52,209,640
0
0
null
null
null
null
UTF-8
Java
false
false
2,606
java
package enterprises.orbital.evekit.model.character.sync; import enterprises.orbital.base.OrbitalProperties; import enterprises.orbital.eve.esi.client.api.LocationApi; import enterprises.orbital.eve.esi.client.invoker.ApiException; import enterprises.orbital.eve.esi.client.invoker.ApiResponse; import enterprises.orbital.eve.esi.client.model.GetCharactersCharacterIdLocationOk; import enterprises.orbital.eve.esi.client.model.GetCharactersCharacterIdShipOk; import enterprises.orbital.evekit.account.SynchronizedEveAccount; import enterprises.orbital.evekit.model.*; import enterprises.orbital.evekit.model.character.CharacterLocation; import enterprises.orbital.evekit.model.character.CharacterShip; import java.io.IOException; import java.util.List; import java.util.logging.Logger; public class ESICharacterShipSync extends AbstractESIAccountSync<GetCharactersCharacterIdShipOk> { protected static final Logger log = Logger.getLogger(ESICharacterShipSync.class.getName()); public ESICharacterShipSync(SynchronizedEveAccount account) { super(account); } @Override public ESISyncEndpoint endpoint() { return ESISyncEndpoint.CHAR_SHIP_TYPE; } @Override protected void commit(long time, CachedData item) throws IOException { assert item instanceof CharacterShip; CachedData existing = null; if (item.getLifeStart() == 0) // Only need to check for existing item if current item is an update existing = CharacterShip.get(account, time); evolveOrAdd(time, existing, item); } @Override protected ESIAccountServerResult<GetCharactersCharacterIdShipOk> getServerData(ESIAccountClientProvider cp) throws ApiException, IOException { LocationApi apiInstance = cp.getLocationApi(); ESIThrottle.throttle(endpoint().name(), account); ApiResponse<GetCharactersCharacterIdShipOk> result = apiInstance.getCharactersCharacterIdShipWithHttpInfo((int) account.getEveCharacterID(), null, null, accessToken()); checkCommonProblems(result); return new ESIAccountServerResult<>(extractExpiry(result, OrbitalProperties.getCurrentTime() + maxDelay()), result.getData()); } @SuppressWarnings("RedundantThrows") @Override protected void processServerData(long time, ESIAccountServerResult<GetCharactersCharacterIdShipOk> data, List<CachedData> updates) throws IOException { updates.add(new CharacterShip(data.getData().getShipTypeId(), data.getData().getShipItemId(), data.getData().getShipName())); } }
[ "deadlybulb@orbital.enterprises" ]
deadlybulb@orbital.enterprises
3dbb1ced7d4d4100031ece633dce19f879859714
ae21f9d61d1b5024d0fc2a9763273470abd890c0
/beans/src/main/java/com/tqmall/mana/beans/VO/ZTree.java
c96d0ac547cea359255771b4744a8c8121083bf8
[]
no_license
xie-summer/mana
d418ae4661109afa843ab97cd5d7968ba44da4b6
ea5bd77880fc60e2b6f18f0241002151f2cd6748
refs/heads/master
2021-06-16T04:20:16.269632
2017-05-11T08:06:38
2017-05-11T08:06:38
null
0
0
null
null
null
null
UTF-8
Java
false
false
772
java
package com.tqmall.mana.beans.VO; import lombok.Data; import java.util.ArrayList; import java.util.List; /** * Created by huangzhangting on 16/12/19. */ @Data public class ZTree { private Integer id; private Integer pid; private String name; private Boolean open; private Boolean checked; private List<ZTree> children; public ZTree(){ this.open = true; this.checked = false; this.children = new ArrayList<>(); } public ZTree(Boolean open){ this.open = open; this.checked = false; this.children = new ArrayList<>(); } public ZTree(Boolean open, Boolean checked){ this.open = open; this.checked = checked; this.children = new ArrayList<>(); } }
[ "zhangting.huang@tqmall.com" ]
zhangting.huang@tqmall.com
2f66362a383c6f0d37ec1ffcc8b5ec7808db51c8
adb408f34837d4d061d91dfc7d737e57cbf49fa1
/steerio/examples/org/magnos/steer/behavior/SteerAvoidObstaclesExample.java
c105828e0a0c04a8edd7ad1b5a83d20f55f8232a
[]
no_license
bacta/swg-server
3a045be60c05520dc7f1045e5499de04aacc2e17
71115eea1792960b4bbb448921f262f4fdd86ce2
refs/heads/develop
2023-01-09T16:51:37.334035
2019-10-30T00:48:24
2019-10-30T00:48:24
87,016,230
8
1
null
2023-01-04T12:33:23
2017-04-02T21:06:39
Java
UTF-8
Java
false
false
1,785
java
package org.magnos.steer.behavior; import java.awt.Color; import org.magnos.steer.SteerMath; import org.magnos.steer.SteerModifier; import org.magnos.steer.SteerSet; import org.magnos.steer.spatial.SpatialDatabase; import org.magnos.steer.spatial.array.SpatialArray; import org.magnos.steer.test.SteerSprite; import org.magnos.steer.vec.Vec2; import com.gameprogblog.engine.Game; import com.gameprogblog.engine.GameLoop; import com.gameprogblog.engine.GameLoopVariable; import com.gameprogblog.engine.GameScreen; import com.gameprogblog.engine.Scene; public class SteerAvoidObstaclesExample extends SteerBasicExample { public static void main( String[] args ) { Game game = new SteerAvoidObstaclesExample( DEFAULT_WIDTH, DEFAULT_HEIGHT ); GameLoop loop = new GameLoopVariable( 0.1f ); GameScreen screen = new GameScreen( DEFAULT_WIDTH, DEFAULT_HEIGHT, true, loop, game ); screen.setBackground( Color.black ); GameScreen.showWindow( screen, "SteerAvoidObstaclesExample" ); } public SpatialDatabase<Vec2> database; public SteerAvoidObstaclesExample( int w, int h ) { super( w, h ); } @Override public void start( Scene scene ) { database = new SpatialArray<Vec2>( 32 ); for (int i = 0; i < 24; i++) { SteerSprite lamb = newSprite( Color.green, 15, 200, new SteerSet<Vec2>( 2000, new SteerSeparation<Vec2>( 0, 2000, database, 15, Vec2.FACTORY ), new SteerModifier<Vec2>( 0, 2000, new SteerAvoidObstacles<Vec2>( 0, 2000, database, 100.0f, 30.0f, Vec2.FACTORY ), 0.9f ), new SteerConstant<Vec2>( 2000, new Vec2( SteerMath.randomFloat( -300, 300 ), SteerMath.randomFloat( -300, 300 ) ) ) )); lamb.position.set( SteerMath.randomFloat( width ), SteerMath.randomFloat( height ) ); database.add( lamb ); } } }
[ "mustangcoupe69@gmail.com" ]
mustangcoupe69@gmail.com
306a18a0f75d917dc0d335476fe16ca1be426bc6
2386fb0a417615bfbdcb234a2c44a3efb13fb242
/src/main/java/com/helger/genericode/Genericode10ColumnSetMarshaller.java
176c372f8da7adb57ce306fba080640c8b425514
[ "Apache-2.0" ]
permissive
phax/ph-genericode
01c4e4a204b30dc9883b3467e6f80550177d90e2
f25991fe9aa397524513607985484e9941e3c6fb
refs/heads/master
2023-09-04T06:16:05.268507
2023-08-16T21:50:04
2023-08-16T21:50:04
23,307,362
3
4
null
null
null
null
UTF-8
Java
false
false
1,318
java
/* * Copyright (C) 2014-2023 Philip Helger (www.helger.com) * philip[at]helger[dot]com * * 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.helger.genericode; import com.helger.genericode.v10.ColumnSetDocument; import com.helger.genericode.v10.ObjectFactory; import com.helger.jaxb.GenericJAXBMarshaller; /** * This is the reader and writer for Genericode 1.0 column sets. This class may * be derived to override protected methods from {@link GenericJAXBMarshaller}. * * @author Philip Helger */ public class Genericode10ColumnSetMarshaller extends GenericJAXBMarshaller <ColumnSetDocument> { /** * Constructor */ public Genericode10ColumnSetMarshaller () { super (ColumnSetDocument.class, CGenericode.GENERICODE_10_XSDS, new ObjectFactory ()::createColumnSet); } }
[ "philip@helger.com" ]
philip@helger.com
7f91b81871b6ec60756ddc50e742b9c807b176d8
95e1a01a458b4e76e6c8dfba33d89fb4eafdb15b
/springboot-demo/springboot-redis/src/main/java/com/vesus/springbootredis/config/DruidConfiguration.java
53e20f40486f4faf32debdfc872989fb62418f9d
[]
no_license
chenzhenpin/mySpringBoot
0d78f3e58a6da8d166e6c6619f7d51388fe73f86
1a41ce0950a2e46008c59d5f519d9d434b1d19bf
refs/heads/master
2020-04-13T15:30:55.967149
2018-12-27T12:51:04
2018-12-27T12:51:04
159,366,176
0
0
null
null
null
null
UTF-8
Java
false
false
4,769
java
package com.vesus.springbootredis.config; import com.alibaba.druid.pool.DruidDataSource; import com.alibaba.druid.support.http.StatViewServlet; import com.alibaba.druid.support.http.WebStatFilter; import org.springframework.beans.factory.annotation.Value; import org.springframework.boot.web.servlet.FilterRegistrationBean; import org.springframework.boot.web.servlet.ServletRegistrationBean; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; import org.springframework.context.annotation.Primary; import javax.sql.DataSource; import java.sql.SQLException; @Configuration public class DruidConfiguration { @Value("${spring.datasource.url}") private String dbUrl; @Value("${spring.datasource.username}") private String username; @Value("${spring.datasource.password}") private String password; @Value("${spring.datasource.driver-class-name}") private String driverClassName; @Value("${spring.datasource.initialSize}") private int initialSize; @Value("${spring.datasource.minIdle}") private int minIdle; @Value("${spring.datasource.maxActive}") private int maxActive; @Value("${spring.datasource.maxWait}") private int maxWait; @Value("${spring.datasource.timeBetweenEvictionRunsMillis}") private int timeBetweenEvictionRunsMillis; @Value("${spring.datasource.minEvictableIdleTimeMillis}") private int minEvictableIdleTimeMillis; @Value("${spring.datasource.validationQuery}") private String validationQuery; @Value("${spring.datasource.testWhileIdle}") private boolean testWhileIdle; @Value("${spring.datasource.testOnBorrow}") private boolean testOnBorrow; @Value("${spring.datasource.testOnReturn}") private boolean testOnReturn; @Value("${spring.datasource.poolPreparedStatements}") private boolean poolPreparedStatements; @Value("${spring.datasource.maxPoolPreparedStatementPerConnectionSize}") private int maxPoolPreparedStatementPerConnectionSize; @Value("${spring.datasource.filters}") private String filters; @Value("${spring.datasource.connectionProperties}") private String connectionProperties; @Value("${spring.datasource.useGlobalDataSourceStat}") private boolean useGlobalDataSourceStat; @Bean public ServletRegistrationBean druidStatViewServlet() { ServletRegistrationBean registrationBean = new ServletRegistrationBean(new StatViewServlet(), "/druid/*"); registrationBean.addInitParameter("allow", "127.0.0.1"); registrationBean.addInitParameter("deny", "192.168.100.106"); registrationBean.addInitParameter("loginUsername", "admin"); registrationBean.addInitParameter("loginPassword", "123456"); registrationBean.addInitParameter("resetEnable", "false"); return registrationBean; } @Bean public FilterRegistrationBean druidWebStatViewFilter() { FilterRegistrationBean registrationBean = new FilterRegistrationBean(new WebStatFilter()); registrationBean.addInitParameter("urlPatterns", "/*"); registrationBean.addInitParameter("exclusions", "*.js,*.gif,*.jpg,*.bmp,*.png,*.css,*.ico,/druid/*"); return registrationBean; } @Bean //声明其为Bean实例 @Primary //在同样的DataSource中,首先使用被标注的DataSource public DataSource dataSource(){ DruidDataSource datasource = new DruidDataSource(); datasource.setUrl(this.dbUrl); datasource.setUsername(username); datasource.setPassword(password); datasource.setDriverClassName(driverClassName); //configuration datasource.setInitialSize(initialSize); datasource.setMinIdle(minIdle); datasource.setMaxActive(maxActive); datasource.setMaxWait(maxWait); datasource.setTimeBetweenEvictionRunsMillis(timeBetweenEvictionRunsMillis); datasource.setMinEvictableIdleTimeMillis(minEvictableIdleTimeMillis); datasource.setValidationQuery(validationQuery); datasource.setTestWhileIdle(testWhileIdle); datasource.setTestOnBorrow(testOnBorrow); datasource.setTestOnReturn(testOnReturn); datasource.setPoolPreparedStatements(poolPreparedStatements); datasource.setMaxPoolPreparedStatementPerConnectionSize(maxPoolPreparedStatementPerConnectionSize); datasource.setUseGlobalDataSourceStat(useGlobalDataSourceStat); try { datasource.setFilters(filters); } catch (SQLException e) { System.err.println("druid configuration initialization filter: "+ e); } datasource.setConnectionProperties(connectionProperties); return datasource; } }
[ "1595347682@qq.com" ]
1595347682@qq.com
add89619fc53979356c6ba49be2dbbda308d256e
fa93c9be2923e697fb8a2066f8fb65c7718cdec7
/sources/com/yandex/mobile/ads/impl/hh.java
6406a24b580873628e3d0f11bcbe3e30333cb9bb
[]
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
684
java
package com.yandex.mobile.ads.impl; import android.content.Context; import android.support.annotation.NonNull; public final class hh { @NonNull private final Context a; public hh(@NonNull Context context) { this.a = context.getApplicationContext(); } public final boolean a() { return a("android.permission.ACCESS_COARSE_LOCATION"); } public final boolean b() { return a("android.permission.ACCESS_FINE_LOCATION"); } private boolean a(@NonNull String str) { try { return this.a.checkCallingOrSelfPermission(str) == 0; } catch (Throwable unused) { return false; } } }
[ "auchhunter@gmail.com" ]
auchhunter@gmail.com
ced47547fa49567b34b287dc61f93506eb95b8c4
13779adeb942eea5c3f3a90f0010e30257553436
/ch.eugster.events.course/src/ch/eugster/events/course/editors/StateSorter.java
c74d5bd14e7ce3defb5491a4c22c42ca7b15e43c
[]
no_license
ceugster/administrator
56b6ad51a409d06f2579aecf4d229ef3811bcdf7
ec0b6688b85ac3ab231f9648fd071915197da17d
refs/heads/master
2022-03-12T11:42:37.597568
2022-02-22T09:51:08
2022-02-22T09:51:08
256,752,288
0
0
null
null
null
null
UTF-8
Java
false
false
499
java
package ch.eugster.events.course.editors; import org.eclipse.jface.viewers.Viewer; import org.eclipse.jface.viewers.ViewerSorter; import ch.eugster.events.persistence.model.CourseState; public class StateSorter extends ViewerSorter { @Override public int compare(Viewer viewer, Object e1, Object e2) { CourseState state1 = (CourseState) e1; CourseState state2 = (CourseState) e2; return new Integer(state1.ordinal()).compareTo(new Integer(state2.ordinal())); } }
[ "christian.eugster@gmx.net" ]
christian.eugster@gmx.net
822b594b2b391ea509eb8a350b7c4a53951a1d1b
fe5b610f0ded630462e9f98806edc7b24dcc2ef0
/Downloads/AyoKeMasjid_v0.3_apkpure.com_source_from_JADX/com/google/android/gms/drive/internal/zzac.java
2b9e73d1cc18bb92f4ac57adadc1b6add1a5671e
[]
no_license
rayga/n4rut0
328303f0adcb28140b05c0a18e54abecf21ef778
e1f706aeb6085ee3752cb92187bf339c6dfddef0
refs/heads/master
2020-12-25T15:18:25.346886
2016-08-29T22:51:25
2016-08-29T22:51:25
66,826,428
1
0
null
null
null
null
UTF-8
Java
false
false
1,807
java
package com.google.android.gms.drive.internal; import android.os.IBinder; import android.os.Parcel; import android.os.Parcelable.Creator; import com.google.android.gms.common.internal.safeparcel.zza; import com.google.android.gms.common.internal.safeparcel.zzb; import com.google.android.gms.drive.events.CompletionEvent; public class zzac implements Creator<DriveServiceResponse> { static void zza(DriveServiceResponse driveServiceResponse, Parcel parcel, int i) { int zzak = zzb.zzak(parcel); zzb.zzc(parcel, 1, driveServiceResponse.mVersionCode); zzb.zza(parcel, 2, driveServiceResponse.zzaje, false); zzb.zzH(parcel, zzak); } public /* synthetic */ Object createFromParcel(Parcel x0) { return zzaY(x0); } public /* synthetic */ Object[] newArray(int x0) { return zzcI(x0); } public DriveServiceResponse zzaY(Parcel parcel) { int zzaj = zza.zzaj(parcel); int i = 0; IBinder iBinder = null; while (parcel.dataPosition() < zzaj) { int zzai = zza.zzai(parcel); switch (zza.zzbH(zzai)) { case CompletionEvent.STATUS_FAILURE /*1*/: i = zza.zzg(parcel, zzai); break; case CompletionEvent.STATUS_CONFLICT /*2*/: iBinder = zza.zzp(parcel, zzai); break; default: zza.zzb(parcel, zzai); break; } } if (parcel.dataPosition() == zzaj) { return new DriveServiceResponse(i, iBinder); } throw new zza.zza("Overread allowed size end=" + zzaj, parcel); } public DriveServiceResponse[] zzcI(int i) { return new DriveServiceResponse[i]; } }
[ "arga@lahardi.com" ]
arga@lahardi.com
b22c05568d4882d3df25f941d2c49517fd969c4f
c911cec851122d0c6c24f0e3864cb4c4def0da99
/com/google/android/gms/location/places/internal/AutocompletePredictionEntity.java
d2747f28148de92d0b4147ea792a368e4e4ec411
[]
no_license
riskyend/PokemonGo_RE_0.47.1
3a468ad7b6fbda5b4f8b9ace30447db2211fc2ed
2ca0c6970a909ae5e331a2430f18850948cc625c
refs/heads/master
2020-01-23T22:04:35.799795
2016-11-19T01:01:46
2016-11-19T01:01:46
null
0
0
null
null
null
null
UTF-8
Java
false
false
6,848
java
package com.google.android.gms.location.places.internal; import android.os.Parcel; import android.os.Parcelable.Creator; import android.text.style.CharacterStyle; import com.google.android.gms.common.internal.safeparcel.SafeParcelable; import com.google.android.gms.common.internal.zzw; import com.google.android.gms.common.internal.zzw.zza; import com.google.android.gms.common.internal.zzx; import com.google.android.gms.location.places.AutocompletePrediction; import com.google.android.gms.location.places.AutocompletePrediction.Substring; import java.util.Collections; import java.util.List; public class AutocompletePredictionEntity implements SafeParcelable, AutocompletePrediction { public static final Parcelable.Creator<AutocompletePredictionEntity> CREATOR = new zza(); private static final List<SubstringEntity> zzaGN = Collections.emptyList(); final int mVersionCode; final List<Integer> zzaFT; final String zzaGO; final List<SubstringEntity> zzaGP; final int zzaGQ; final String zzaGR; final List<SubstringEntity> zzaGS; final String zzaGT; final List<SubstringEntity> zzaGU; final String zzaGt; AutocompletePredictionEntity(int paramInt1, String paramString1, List<Integer> paramList, int paramInt2, String paramString2, List<SubstringEntity> paramList1, String paramString3, List<SubstringEntity> paramList2, String paramString4, List<SubstringEntity> paramList3) { this.mVersionCode = paramInt1; this.zzaGt = paramString1; this.zzaFT = paramList; this.zzaGQ = paramInt2; this.zzaGO = paramString2; this.zzaGP = paramList1; this.zzaGR = paramString3; this.zzaGS = paramList2; this.zzaGT = paramString4; this.zzaGU = paramList3; } public static AutocompletePredictionEntity zza(String paramString1, List<Integer> paramList, int paramInt, String paramString2, List<SubstringEntity> paramList1, String paramString3, List<SubstringEntity> paramList2, String paramString4, List<SubstringEntity> paramList3) { return new AutocompletePredictionEntity(0, paramString1, paramList, paramInt, (String)zzx.zzw(paramString2), paramList1, paramString3, paramList2, paramString4, paramList3); } public int describeContents() { return 0; } public boolean equals(Object paramObject) { if (this == paramObject) {} do { return true; if (!(paramObject instanceof AutocompletePredictionEntity)) { return false; } paramObject = (AutocompletePredictionEntity)paramObject; } while ((zzw.equal(this.zzaGt, ((AutocompletePredictionEntity)paramObject).zzaGt)) && (zzw.equal(this.zzaFT, ((AutocompletePredictionEntity)paramObject).zzaFT)) && (zzw.equal(Integer.valueOf(this.zzaGQ), Integer.valueOf(((AutocompletePredictionEntity)paramObject).zzaGQ))) && (zzw.equal(this.zzaGO, ((AutocompletePredictionEntity)paramObject).zzaGO)) && (zzw.equal(this.zzaGP, ((AutocompletePredictionEntity)paramObject).zzaGP)) && (zzw.equal(this.zzaGR, ((AutocompletePredictionEntity)paramObject).zzaGR)) && (zzw.equal(this.zzaGS, ((AutocompletePredictionEntity)paramObject).zzaGS)) && (zzw.equal(this.zzaGT, ((AutocompletePredictionEntity)paramObject).zzaGT)) && (zzw.equal(this.zzaGU, ((AutocompletePredictionEntity)paramObject).zzaGU))); return false; } public String getDescription() { return this.zzaGO; } public CharSequence getFullText(CharacterStyle paramCharacterStyle) { return zzc.zza(this.zzaGO, this.zzaGP, paramCharacterStyle); } public List<? extends AutocompletePrediction.Substring> getMatchedSubstrings() { return this.zzaGP; } public String getPlaceId() { return this.zzaGt; } public List<Integer> getPlaceTypes() { return this.zzaFT; } public CharSequence getPrimaryText(CharacterStyle paramCharacterStyle) { return zzc.zza(this.zzaGR, this.zzaGS, paramCharacterStyle); } public CharSequence getSecondaryText(CharacterStyle paramCharacterStyle) { return zzc.zza(this.zzaGT, this.zzaGU, paramCharacterStyle); } public int hashCode() { return zzw.hashCode(new Object[] { this.zzaGt, this.zzaFT, Integer.valueOf(this.zzaGQ), this.zzaGO, this.zzaGP, this.zzaGR, this.zzaGS, this.zzaGT, this.zzaGU }); } public boolean isDataValid() { return true; } public String toString() { return zzw.zzv(this).zzg("placeId", this.zzaGt).zzg("placeTypes", this.zzaFT).zzg("fullText", this.zzaGO).zzg("fullTextMatchedSubstrings", this.zzaGP).zzg("primaryText", this.zzaGR).zzg("primaryTextMatchedSubstrings", this.zzaGS).zzg("secondaryText", this.zzaGT).zzg("secondaryTextMatchedSubstrings", this.zzaGU).toString(); } public void writeToParcel(Parcel paramParcel, int paramInt) { zza.zza(this, paramParcel, paramInt); } public AutocompletePrediction zzwV() { return this; } public static class SubstringEntity implements SafeParcelable, AutocompletePrediction.Substring { public static final Parcelable.Creator<SubstringEntity> CREATOR = new zzv(); final int mLength; final int mOffset; final int mVersionCode; public SubstringEntity(int paramInt1, int paramInt2, int paramInt3) { this.mVersionCode = paramInt1; this.mOffset = paramInt2; this.mLength = paramInt3; } public int describeContents() { return 0; } public boolean equals(Object paramObject) { if (this == paramObject) {} do { return true; if (!(paramObject instanceof SubstringEntity)) { return false; } paramObject = (SubstringEntity)paramObject; } while ((zzw.equal(Integer.valueOf(this.mOffset), Integer.valueOf(((SubstringEntity)paramObject).mOffset))) && (zzw.equal(Integer.valueOf(this.mLength), Integer.valueOf(((SubstringEntity)paramObject).mLength)))); return false; } public int getLength() { return this.mLength; } public int getOffset() { return this.mOffset; } public int hashCode() { return zzw.hashCode(new Object[] { Integer.valueOf(this.mOffset), Integer.valueOf(this.mLength) }); } public String toString() { return zzw.zzv(this).zzg("offset", Integer.valueOf(this.mOffset)).zzg("length", Integer.valueOf(this.mLength)).toString(); } public void writeToParcel(Parcel paramParcel, int paramInt) { zzv.zza(this, paramParcel, paramInt); } } } /* Location: /Users/mohamedtajjiou/Downloads/Rerverse Engeneering/dex2jar-2.0/com.nianticlabs.pokemongo_0.47.1-2016111700_minAPI19(armeabi-v7a)(nodpi)_apkmirror.com (1)-dex2jar.jar!/com/google/android/gms/location/places/internal/AutocompletePredictionEntity.class * Java compiler version: 6 (50.0) * JD-Core Version: 0.7.1 */
[ "mohamedtajjiou@Mohameds-Air.SpeedportEntry2090126200030" ]
mohamedtajjiou@Mohameds-Air.SpeedportEntry2090126200030
c5b64f0e5debd73982d9b8c0cf2e20d2b6fabbbc
80a44ca4014ec772533c17d761a9aded818bbbb1
/core/src/test/java/org/apache/commons/functor/adapter/TestFunctionPredicate.java
265d4ab7bf8f88fc1555443893489c9501be3e5b
[ "Apache-2.0" ]
permissive
kinow/functor
e49753025465a5efa0335c24ff70f1707334eaf3
8694e0238ef9651ca12306d8d39c6cb5b1acdd87
refs/heads/master
2021-01-23T11:01:54.094626
2013-10-11T17:45:58
2013-10-11T17:45:58
2,673,900
0
0
null
null
null
null
UTF-8
Java
false
false
2,709
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.functor.adapter; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertNotNull; import static org.junit.Assert.assertNull; import static org.junit.Assert.assertTrue; import org.apache.commons.functor.BaseFunctorTest; import org.apache.commons.functor.Predicate; import org.apache.commons.functor.core.Constant; import org.junit.Test; /** * @version $Revision: 1508677 $ $Date: 2013-07-30 19:48:02 -0300 (Tue, 30 Jul 2013) $ */ public class TestFunctionPredicate extends BaseFunctorTest { // Functor Testing Framework // ------------------------------------------------------------------------ @Override protected Object makeFunctor() { return new FunctionPredicate<Object>(Constant.TRUE); } // Tests // ------------------------------------------------------------------------ @Test public void testTestWhenTrue() throws Exception { Predicate<Object> p = new FunctionPredicate<Object>(Constant.TRUE); assertTrue(p.test(null)); } @Test public void testTestWhenFalse() throws Exception { Predicate<Object> p = new FunctionPredicate<Object>(Constant.FALSE); assertTrue(!p.test(null)); } @Test public void testEquals() throws Exception { Predicate<Object> p = new FunctionPredicate<Object>(Constant.TRUE); assertEquals(p,p); assertObjectsAreEqual(p,new FunctionPredicate<Object>(Constant.TRUE)); assertObjectsAreNotEqual(p,Constant.TRUE); assertObjectsAreNotEqual(p,new FunctionPredicate<Object>(Constant.FALSE)); assertTrue(!p.equals(null)); } @Test public void testAdaptNull() throws Exception { assertNull(FunctionPredicate.adapt(null)); } @Test public void testAdapt() throws Exception { assertNotNull(FunctionPredicate.adapt(Constant.TRUE)); } }
[ "brunodepaulak@yahoo.com.br" ]
brunodepaulak@yahoo.com.br
9083405e5f44fefc4afa8456298e0f7e3ee6fde4
c5f86286bc08c66441c2f64193bbbb90629184bc
/ballcat-admin/ballcat-admin-websocket/src/main/java/com/hccake/ballcat/admin/websocket/user/UserAttributeHandshakeInterceptor.java
645b7924e01960c046d8b51bac2a67216e9b7899
[ "MIT" ]
permissive
laosandegudai/ballcat
2481412ce1bcf113e9f9d4ea2056c79df8c357cc
4a7d002f39caf7e2a1a6f73cea9c6f931aaf5e63
refs/heads/master
2023-02-17T04:49:17.697405
2021-01-13T08:38:36
2021-01-13T08:38:36
293,199,980
1
0
MIT
2021-01-13T08:38:37
2020-09-06T04:01:52
Java
UTF-8
Java
false
false
2,706
java
package com.hccake.ballcat.admin.websocket.user; import com.hccake.ballcat.admin.modules.sys.model.entity.SysUser; import com.hccake.ballcat.admin.oauth.util.SecurityUtils; import com.hccake.ballcat.admin.websocket.constant.AdminWebSocketConstants; import lombok.RequiredArgsConstructor; import org.springframework.http.server.ServerHttpRequest; import org.springframework.http.server.ServerHttpResponse; import org.springframework.http.server.ServletServerHttpRequest; import org.springframework.web.socket.WebSocketHandler; import org.springframework.web.socket.server.HandshakeInterceptor; import java.util.Map; /** * WebSocket 握手拦截器 在握手时记录下当前 session 对应的用户Id和token信息 * * @author Hccake 2021/1/4 * @version 1.0 */ @RequiredArgsConstructor public class UserAttributeHandshakeInterceptor implements HandshakeInterceptor { /** * Invoked before the handshake is processed. * @param request the current request * @param response the current response * @param wsHandler the target WebSocket handler * @param attributes the attributes from the HTTP handshake to associate with the * WebSocket session; the provided attributes are copied, the original map is not * used. * @return whether to proceed with the handshake ({@code true}) or abort * ({@code false}) */ @Override public boolean beforeHandshake(ServerHttpRequest request, ServerHttpResponse response, WebSocketHandler wsHandler, Map<String, Object> attributes) throws Exception { String accessToken = null; // 获得 accessToken if (request instanceof ServletServerHttpRequest) { ServletServerHttpRequest serverRequest = (ServletServerHttpRequest) request; accessToken = serverRequest.getServletRequest().getParameter(AdminWebSocketConstants.TOKEN_ATTR_NAME); } // 由于 WebSocket 握手是由 http 升级的,携带 token 已经被 Security 拦截验证了,所以可以直接获取到用户 SysUser sysUser = SecurityUtils.getSysUser(); attributes.put(AdminWebSocketConstants.TOKEN_ATTR_NAME, accessToken); attributes.put(AdminWebSocketConstants.USER_KEY_ATTR_NAME, sysUser.getUserId()); return true; } /** * Invoked after the handshake is done. The response status and headers indicate the * results of the handshake, i.e. whether it was successful or not. * @param request the current request * @param response the current response * @param wsHandler the target WebSocket handler * @param exception an exception raised during the handshake, or {@code null} if none */ @Override public void afterHandshake(ServerHttpRequest request, ServerHttpResponse response, WebSocketHandler wsHandler, Exception exception) { } }
[ "chengbohua@foxmail.com" ]
chengbohua@foxmail.com
cffe70a585921f4310a55c8ff8e03baacbbc20a2
a0071a9c08916968d429f9db2ed8730cac42f2d7
/src/main/java/br/gov/caixa/arqrefservices/dominio/econsig/detalharConsultaConsignacao/DetalharConsultaConsignacaoDadosREQ.java
748ec59feb0d2930b1f1d25520390708dc683627
[]
no_license
MaurilioDeveloper/arqref
a62ea7fe009941077d3778131f7cddc9d5162ea4
7f186fc3fc769e1b30d16e6339688f29b41d828a
refs/heads/master
2020-03-22T14:57:59.419703
2018-07-09T02:04:59
2018-07-09T02:04:59
140,218,663
0
0
null
null
null
null
UTF-8
Java
false
false
6,981
java
package br.gov.caixa.arqrefservices.dominio.econsig.detalharConsultaConsignacao; import java.io.Serializable; import java.util.Date; import javax.xml.bind.annotation.XmlElement; import javax.xml.bind.annotation.XmlRootElement; import javax.xml.bind.annotation.XmlSchemaType; import javax.xml.bind.annotation.XmlType; import br.gov.caixa.arqrefservices.dominio.econsig.SituacaoContrato; import br.gov.caixa.arqrefservices.dominio.econsig.SituacaoServidor; @XmlRootElement(name="hos:detalharConsultaConsignacao") @XmlType(propOrder={"cliente","convenio","usuario","senha","adeNumero","adeIdentificador","matricula","cpf","orgaoCodigo","estabelecimentoCodigo", "correspondenteCodigo","servicoCodigo","codVerba","sdvSolicitado","sdvSolicitadoNaoCadastrado","sdvSolicitadoCadastrado","sdvNaoSolicitado", "periodo","dataInclusaoInicio","dataInclusaoFim","integraFolha","codigoMargem","indice","situacaoContrato","situacaoServidor" }) public class DetalharConsultaConsignacaoDadosREQ implements Serializable { private static final long serialVersionUID = -3694150633496701565L; private String adeIdentificador; private Long adeNumero; private String cliente; private Integer codigoMargem; private String codVerba; private String convenio; private String correspondenteCodigo; private String cpf; private Date dataInclusaoFim; private Date dataInclusaoInicio; private String estabelecimentoCodigo; private String indice; private Integer integraFolha; private String matricula; private String orgaoCodigo; private Date periodo; private Boolean sdvNaoSolicitado; private Boolean sdvSolicitado; private Boolean sdvSolicitadoCadastrado; private Boolean sdvSolicitadoNaoCadastrado; private String senha; private String servicoCodigo; private SituacaoContrato situacaoContrato; private SituacaoServidor situacaoServidor; private String usuario; @XmlElement(name="hos:adeIdentificador") public String getAdeIdentificador() { return adeIdentificador; } @XmlElement(name="hos:adeNumero") public Long getAdeNumero() { return adeNumero; } @XmlElement(name="hos:cliente") public String getCliente() { return cliente; } @XmlElement(name="hos:codigoMargem") public Integer getCodigoMargem() { return codigoMargem; } @XmlElement(name="hos:codVerba") public String getCodVerba() { return codVerba; } @XmlElement(name="hos:convenio") public String getConvenio() { return convenio; } @XmlElement(name="hos:correspondenteCodigo") public String getCorrespondenteCodigo() { return correspondenteCodigo; } @XmlElement(name="hos:cpf") public String getCpf() { return cpf; } @XmlSchemaType(name="date") @XmlElement(name="hos:dataInclusaoFim") public Date getDataInclusaoFim() { return dataInclusaoFim; } @XmlSchemaType(name="date") @XmlElement(name="hos:dataInclusaoInicio") public Date getDataInclusaoInicio() { return dataInclusaoInicio; } @XmlElement(name="hos:estabelecimentoCodigo") public String getEstabelecimentoCodigo() { return estabelecimentoCodigo; } @XmlElement(name="hos:indice") public String getIndice() { return indice; } @XmlElement(name="hos:integraFolha") public Integer getIntegraFolha() { return integraFolha; } @XmlElement(name="hos:matricula") public String getMatricula() { return matricula; } @XmlElement(name="hos:orgaoCodigo") public String getOrgaoCodigo() { return orgaoCodigo; } @XmlSchemaType(name="date") @XmlElement(name="hos:periodo") public Date getPeriodo() { return periodo; } @XmlElement(name="hos:sdvNaoSolicitado") public Boolean getSdvNaoSolicitado() { return sdvNaoSolicitado; } @XmlElement(name="hos:sdvSolicitado") public Boolean getSdvSolicitado() { return sdvSolicitado; } @XmlElement(name="hos:sdvSolicitadoCadastrado") public Boolean getSdvSolicitadoCadastrado() { return sdvSolicitadoCadastrado; } @XmlElement(name="hos:sdvSolicitadoNaoCadastrado") public Boolean getSdvSolicitadoNaoCadastrado() { return sdvSolicitadoNaoCadastrado; } @XmlElement(name="hos:senha") public String getSenha() { return senha; } @XmlElement(name="hos:servicoCodigo") public String getServicoCodigo() { return servicoCodigo; } @XmlElement(name="hos:situacaoContrato") public SituacaoContrato getSituacaoContrato() { return situacaoContrato; } @XmlElement(name="hos:situacaoServidor") public SituacaoServidor getSituacaoServidor() { return situacaoServidor; } @XmlElement(name="hos:usuario") public String getUsuario() { return usuario; } public void setAdeIdentificador(String adeIdentificador) { this.adeIdentificador = adeIdentificador; } public void setAdeNumero(Long adeNumero) { this.adeNumero = adeNumero; } public void setCliente(String cliente) { this.cliente = cliente; } public void setCodigoMargem(Integer codigoMargem) { this.codigoMargem = codigoMargem; } public void setCodVerba(String codVerba) { this.codVerba = codVerba; } public void setConvenio(String convenio) { this.convenio = convenio; } public void setCorrespondenteCodigo(String correspondenteCodigo) { this.correspondenteCodigo = correspondenteCodigo; } public void setCpf(String cpf) { this.cpf = cpf; } public void setDataInclusaoFim(Date dataInclusaoFim) { this.dataInclusaoFim = dataInclusaoFim; } public void setDataInclusaoInicio(Date dataInclusaoInicio) { this.dataInclusaoInicio = dataInclusaoInicio; } public void setEstabelecimentoCodigo(String estabelecimentoCodigo) { this.estabelecimentoCodigo = estabelecimentoCodigo; } public void setIndice(String indice) { this.indice = indice; } public void setIntegraFolha(Integer integraFolha) { this.integraFolha = integraFolha; } public void setMatricula(String matricula) { this.matricula = matricula; } public void setOrgaoCodigo(String orgaoCodigo) { this.orgaoCodigo = orgaoCodigo; } public void setPeriodo(Date periodo) { this.periodo = periodo; } public void setSdvNaoSolicitado(Boolean sdvNaoSolicitado) { this.sdvNaoSolicitado = sdvNaoSolicitado; } public void setSdvSolicitado(Boolean sdvSolicitado) { this.sdvSolicitado = sdvSolicitado; } public void setSdvSolicitadoCadastrado(Boolean sdvSolicitadoCadastrado) { this.sdvSolicitadoCadastrado = sdvSolicitadoCadastrado; } public void setSdvSolicitadoNaoCadastrado(Boolean sdvSolicitadoNaoCadastrado) { this.sdvSolicitadoNaoCadastrado = sdvSolicitadoNaoCadastrado; } public void setSenha(String senha) { this.senha = senha; } public void setServicoCodigo(String servicoCodigo) { this.servicoCodigo = servicoCodigo; } public void setSituacaoContrato(SituacaoContrato situacaoContrato) { this.situacaoContrato = situacaoContrato; } public void setSituacaoServidor(SituacaoServidor situacaoServidor) { this.situacaoServidor = situacaoServidor; } public void setUsuario(String usuario) { this.usuario = usuario; } }
[ "marlonspinf@gmail.com" ]
marlonspinf@gmail.com
58cff1e980c5988e459efffae62d8a6f8f752dc9
13f6652c77abd41d4bc944887e4b94d8dff40dde
/archstudio/src/edu/uci/ics/bna/logic/ModelBoundsTrackingLogic.java
3e715baafc27c351894dca476a83e42f65b166dd
[]
no_license
isr-uci-edu/ArchStudio3
5bed3be243981d944577787f3a47c7a94c8adbd3
b8aeb7286ea00d4b6c6a229c83b0ee0d1c9b2960
refs/heads/master
2021-01-10T21:01:43.330204
2014-05-31T16:15:53
2014-05-31T16:15:53
null
0
0
null
null
null
null
UTF-8
Java
false
false
4,951
java
package edu.uci.ics.bna.logic; import edu.uci.ics.bna.*; import java.awt.Rectangle; import java.util.*; import c2.util.DelayedExecuteOnceThread; public class ModelBoundsTrackingLogic extends ThingLogicAdapter implements BoundingBoxTrackingListener{ public static final String DONT_USE_IN_MODEL_BOUNDS_COMPUTATION_PROPERTY_NAME = "#dontuseinmodelboundscomputation"; protected BoundingBoxTrackingLogic bbtl; protected Rectangle modelBounds = null; protected ShrinkUpdateThread updateThread = null; public ModelBoundsTrackingLogic(BoundingBoxTrackingLogic bbtl){ super(); this.bbtl = bbtl; } public void init(){ bbtl.addBoundingBoxTrackingListener(this); updateThread = new ShrinkUpdateThread(); updateThread.start(); recompute(); } public void destroy(){ if(updateThread != null){ updateThread.terminate(); } } protected synchronized void recompute(){ int westernBoundary = Integer.MAX_VALUE; int easternBoundary = Integer.MIN_VALUE; int northernBoundary = Integer.MAX_VALUE; int southernBoundary = Integer.MIN_VALUE; Rectangle oldModelBounds = modelBounds; Rectangle newModelBounds = new Rectangle(); BNAComponent c = getBNAComponent(); if(c != null){ BNAModel m = c.getModel(); if(m != null){ for(Iterator it = m.getThingIterator(); it.hasNext(); ){ Thing t = (Thing)it.next(); if(t instanceof IBoxBounded){ Rectangle r = ((IBoxBounded)t).getBoundingBox(); if(r.equals(BNAUtils.NONEXISTENT_RECTANGLE)) continue; if(t.getProperty(DONT_USE_IN_MODEL_BOUNDS_COMPUTATION_PROPERTY_NAME) != null) continue; System.out.println("x = " + r.x + "; t = " + t); int x1 = r.x; int y1 = r.y; int x2 = r.x + r.width; int y2 = r.y + r.height; if(x1 <= westernBoundary){ westernBoundary = x1; } if(x2 >= easternBoundary){ easternBoundary = x2; } if(y1 <= northernBoundary){ northernBoundary = y1; } if(y2 >= southernBoundary){ southernBoundary = y2; } } } newModelBounds.x = westernBoundary; newModelBounds.y = northernBoundary; newModelBounds.width = easternBoundary - westernBoundary; newModelBounds.height = southernBoundary - northernBoundary; modelBounds = newModelBounds; fireModelBoundsChangedEvent(m, oldModelBounds, newModelBounds); } } } protected Vector listeners = new Vector(); public void addModelBoundsChangedListener(ModelBoundsChangedListener l){ listeners.add(l); } public void removeModelBoundsChangedListener(ModelBoundsChangedListener l){ listeners.remove(l); } public Rectangle getModelBounds(){ return new Rectangle(modelBounds); } protected void fireModelBoundsChangedEvent(BNAModel src, Rectangle oldModelBounds, Rectangle newModelBounds){ if((oldModelBounds == null) && (newModelBounds == null)){ return; } if((oldModelBounds != null) && (newModelBounds != null)){ if(oldModelBounds.equals(newModelBounds)){ return; } } ModelBoundsChangedListener[] listenerArray = (ModelBoundsChangedListener[])listeners.toArray(new ModelBoundsChangedListener[listeners.size()]); for(int i = 0; i < listenerArray.length; i++){ listenerArray[i].modelBoundsChanged(src, oldModelBounds, newModelBounds); } } class ShrinkUpdateThread extends DelayedExecuteOnceThread{ public ShrinkUpdateThread(){ super(2000); } public void doExecute(){ recompute(); } } public synchronized void boundingBoxChanged(BoundingBoxChangedEvent evt){ Thing t = evt.getTargetThing(); if(t == null) return; Rectangle newBoundingBox = evt.getNewBoundingBox(); if(newBoundingBox != null){ if(newBoundingBox.equals(BNAUtils.NONEXISTENT_RECTANGLE)) return; if(t.getProperty(DONT_USE_IN_MODEL_BOUNDS_COMPUTATION_PROPERTY_NAME) != null) return; Rectangle oldModelBounds = modelBounds; int ox1 = modelBounds.x; int oy1 = modelBounds.y; int ox2 = modelBounds.x + modelBounds.width; int oy2 = modelBounds.y + modelBounds.height; boolean modelBoundsExpanded = false; int nx1 = ox1; int ny1 = oy1; int nx2 = ox2; int ny2 = oy2; if(newBoundingBox.x < ox1){ modelBoundsExpanded = true; nx1 = newBoundingBox.x; } if(newBoundingBox.y < oy1){ modelBoundsExpanded = true; ny1 = newBoundingBox.y; } if((newBoundingBox.x + newBoundingBox.width) > ox2){ modelBoundsExpanded = true; nx2 = newBoundingBox.x + newBoundingBox.width; } if((newBoundingBox.y + newBoundingBox.height) > oy2){ modelBoundsExpanded = true; ny2 = newBoundingBox.y + newBoundingBox.height; } if(modelBoundsExpanded){ Rectangle newModelBounds = new Rectangle(nx1, ny1, nx2 - nx1, ny2 - ny1); modelBounds = newModelBounds; fireModelBoundsChangedEvent(getBNAComponent().getModel(), oldModelBounds, newModelBounds); } } updateThread.execute(); } }
[ "sahendrickson@gmail.com" ]
sahendrickson@gmail.com
10a1264bb32275e4a70b68295b91493ad47062d8
029010881febc6c5b7e2f0dee144f20559e6bd38
/Notes/Java SE/OtherObject/src/CalendarDemo.java
e42c9332f19b5d764e0778e387fdb94bf4f11f44
[]
no_license
chuishengzhang/zcs
127d48751447d31f7e2602c0e7eeb3d84f6f459d
332d724c9c3e7c2518b169e1e7ed64419e542d61
refs/heads/master
2020-03-08T15:05:03.088784
2018-05-04T10:45:58
2018-05-04T10:45:58
null
0
0
null
null
null
null
GB18030
Java
false
false
1,366
java
import java.util.Calendar; //import java.util.GregorianCalendar; /* * Date类中过时方法被Calendar替代 * * * */ public class CalendarDemo { public static void main(String[] args) { Calendar c=Calendar.getInstance(); //可以通过Calendar的getInstance()方法获取实例 //也能通过创建Calendar的具体子类创建实例 //GregorianCalendar gc=new GregorianCalendar(); //获取年月日(获取的月是重0-11) //查表法 String[] mons={"一月","二月","三月","四月","五月","六月","七月","八月","九月","十月","十一月","十二月"}; String[] weeks={"星期日","星期一","星期二","星期三","星期四","星期五","星期六"}; int month=c.get(Calendar.MONTH); int week=c.get(Calendar.DAY_OF_WEEK)-1; System.out.println(c.get(Calendar.YEAR)+"年"); System.out.println(mons[month]); System.out.println(c.get(Calendar.DAY_OF_MONTH)+"日"); System.out.println(weeks[week]); System.out.println("***********************"); //设置时间 c.set(2019,7,1); //时间往前移或往后推 c.add(Calendar.YEAR,2);//年加两年 c.add(Calendar.MONTH,-3);//月减去三月 System.out.println(c.get(Calendar.YEAR)+"年"); System.out.println((c.get(Calendar.MONTH)+1)+"月"); System.out.println(c.get(Calendar.DAY_OF_MONTH)+"日"); System.out.println(weeks[week]); } }
[ "you@example.com" ]
you@example.com
a79edafa5859e28114f414dab5a055c047484fd0
82eff91cc55b5e1ad36628d02331c6cbfff88923
/mssc-beer-order-service/src/main/java/com/nguyenphucthienan/msscbeerorderservice/sm/action/DeallocateOrderAction.java
cf6b4f7d0a275c007f8ca29115c364353b82e719
[]
no_license
nguyenphucthienan/microservices-beginner-to-guru
602e487c110e28623acca4ff365bc67129c50e27
d5cddaaaaa1d07b4da5c66e11d08d2d21730033f
refs/heads/master
2022-09-18T15:44:09.694486
2020-06-06T08:21:49
2020-06-06T08:21:49
null
0
0
null
null
null
null
UTF-8
Java
false
false
2,144
java
package com.nguyenphucthienan.msscbeerorderservice.sm.action; import com.nguyenphucthienan.brewery.model.event.DeallocateOrderRequest; import com.nguyenphucthienan.msscbeerorderservice.config.JmsConfig; import com.nguyenphucthienan.msscbeerorderservice.domain.BeerOrder; import com.nguyenphucthienan.msscbeerorderservice.domain.BeerOrderEventEnum; import com.nguyenphucthienan.msscbeerorderservice.domain.BeerOrderStatusEnum; import com.nguyenphucthienan.msscbeerorderservice.repository.BeerOrderRepository; import com.nguyenphucthienan.msscbeerorderservice.service.BeerOrderManagerImpl; import com.nguyenphucthienan.msscbeerorderservice.web.mapper.BeerOrderMapper; import lombok.RequiredArgsConstructor; import lombok.extern.slf4j.Slf4j; import org.springframework.jms.core.JmsTemplate; import org.springframework.statemachine.StateContext; import org.springframework.statemachine.action.Action; import org.springframework.stereotype.Component; import java.util.Objects; import java.util.Optional; import java.util.UUID; @Slf4j @RequiredArgsConstructor @Component public class DeallocateOrderAction implements Action<BeerOrderStatusEnum, BeerOrderEventEnum> { private final BeerOrderRepository beerOrderRepository; private final BeerOrderMapper beerOrderMapper; private final JmsTemplate jmsTemplate; @Override public void execute(StateContext<BeerOrderStatusEnum, BeerOrderEventEnum> context) { String beerOrderId = (String) context.getMessage().getHeaders().get(BeerOrderManagerImpl.ORDER_ID_HEADER); Optional<BeerOrder> beerOrderOptional = beerOrderRepository .findById(UUID.fromString(Objects.requireNonNull(beerOrderId))); beerOrderOptional.ifPresentOrElse(beerOrder -> { jmsTemplate.convertAndSend(JmsConfig.DEALLOCATE_ORDER_QUEUE, DeallocateOrderRequest.builder() .beerOrderDTO(beerOrderMapper.beerOrderToBeerDTO(beerOrder)) .build()); log.debug("Sent deallocation request for BeerOrder ID: " + beerOrderId); }, () -> log.error("BeerOrder not found. ID: " + beerOrderId)); } }
[ "npta97@gmail.com" ]
npta97@gmail.com
45c7e9ebf48773237e48652f6a2ad126f37c4d7f
642f1f62abb026dee2d360a8b19196e3ccb859a1
/web/src/main/java/com/sun3d/why/statistics/service/impl/IndexStatisticsServiceImpl.java
3e121e75f176f09b99285b90094dfb1652e8dbad
[]
no_license
P79N6A/alibaba-1
f6dacf963d56856817b211484ca4be39f6dd9596
6ec48f26f16d51c8a493b0eee12d90775b6eaf1d
refs/heads/master
2020-05-27T08:34:26.827337
2019-05-25T07:50:12
2019-05-25T07:50:12
null
0
0
null
null
null
null
UTF-8
Java
false
false
2,146
java
package com.sun3d.why.statistics.service.impl; import com.sun3d.why.dao.IndexStatisticsMapper; import com.sun3d.why.model.IndexStatistics; import com.sun3d.why.model.SysUser; import com.sun3d.why.statistics.service.IndexStatisticsService; import org.apache.commons.lang.StringUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import java.util.List; import java.util.Map; @Service public class IndexStatisticsServiceImpl implements IndexStatisticsService{ @Autowired private IndexStatisticsMapper indexStatisticsMapper; @Override public List<IndexStatistics> queryByMap(Map map) { return indexStatisticsMapper.queryByMap(map); } @Override public int addIndexStatistics(IndexStatistics record) { return indexStatisticsMapper.addIndexStatistics(record); } @Override public int deleteInfo() { return indexStatisticsMapper.deleteInfo(); } @Override public List<IndexStatistics> queryInfoByInfo(Map map, SysUser sysUser,String area) { if (area != null && StringUtils.isNotBlank(area)) { map.put("area",area); } else { map.put("area",sysUser.getUserCounty()); } return indexStatisticsMapper.queryByMap(map); } @Override public List<IndexStatistics> queryIndexStatistics(IndexStatistics vo,SysUser sysUser) { List<IndexStatistics> list = null; if(sysUser.getUserIsManger() == 1){ //省级 vo.setActivityCity(sysUser.getUserCity().split(",")[1]); list = indexStatisticsMapper.queryIndexStatisticsByArea(vo); }else if(sysUser.getUserIsManger() == 2){ //市级 vo.setActivityCity(sysUser.getUserCity()); list = indexStatisticsMapper.queryIndexStatisticsByArea(vo); }else if(sysUser.getUserIsManger() == 3){ //区级 vo.setActivityArea(sysUser.getUserCounty()); list = indexStatisticsMapper.queryIndexStatisticsByVenue(vo); }else if(sysUser.getUserIsManger() == 4){ //场馆级 vo.setVenueDeptId(sysUser.getUserDeptId()); list = indexStatisticsMapper.queryIndexStatisticsByVenue(vo); } return list; } }
[ "comalibaba@163.com" ]
comalibaba@163.com
09c6c6658f1d7f60b25c255564d5941c6e0df9c6
c4d1992bbfe4552ad16ff35e0355b08c9e4998d6
/releases/2.0.0RC/src/contrib/src/org/apache/poi/hssf/contrib/view/SVRowHeader.java
b749e09b897fbe7651f49bd05d71ceb8e0146477
[]
no_license
BGCX261/zkpoi-svn-to-git
36f2a50d2618c73e40f24ddc2d3df5aadc8eca30
81a63fb1c06a2dccff20cab1291c7284f1687508
refs/heads/master
2016-08-04T08:42:59.622864
2015-08-25T15:19:51
2015-08-25T15:19:51
41,594,557
0
1
null
null
null
null
UTF-8
Java
false
false
3,204
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.poi.hssf.contrib.view; import java.awt.*; import javax.swing.*; import javax.swing.table.*; import org.apache.poi.hssf.usermodel.*; /** * This class presents the row header to the table. * * * @author Jason Height */ public class SVRowHeader extends JList { /** This model simply returns an integer number up to the number of rows * that are present in the sheet. * */ private class SVRowHeaderModel extends AbstractListModel { private HSSFSheet sheet; public SVRowHeaderModel(HSSFSheet sheet) { this.sheet = sheet; } public int getSize() { return sheet.getLastRowNum() + 1; } public Object getElementAt(int index) { return Integer.toString(index+1); } } /** Renderes the row number*/ private class RowHeaderRenderer extends JLabel implements ListCellRenderer { private HSSFSheet sheet; private int extraHeight; RowHeaderRenderer(HSSFSheet sheet, JTable table, int extraHeight) { this.sheet = sheet; this.extraHeight = extraHeight; JTableHeader header = table.getTableHeader(); setOpaque(true); setBorder(UIManager.getBorder("TableHeader.cellBorder")); setHorizontalAlignment(CENTER); setForeground(header.getForeground()); setBackground(header.getBackground()); setFont(header.getFont()); } public Component getListCellRendererComponent( JList list, Object value, int index, boolean isSelected, boolean cellHasFocus) { Dimension d = getPreferredSize(); HSSFRow row = sheet.getRow(index); int rowHeight; if(row == null) { rowHeight = (int)sheet.getDefaultRowHeightInPoints(); } else { rowHeight = (int)row.getHeightInPoints(); } d.height = rowHeight+extraHeight; setPreferredSize(d); setText((value == null) ? "" : value.toString()); return this; } } public SVRowHeader(HSSFSheet sheet, JTable table, int extraHeight) { ListModel lm = new SVRowHeaderModel(sheet); this.setModel(lm); setFixedCellWidth(50); setCellRenderer(new RowHeaderRenderer(sheet, table, extraHeight)); } }
[ "you@example.com" ]
you@example.com
2f366a1861209e55696599d5742d3b25bf676f4b
fa78106a6d19ecf2e237f703b1693b00aaf14e8f
/src/test/java/net/test/hasor/junit/HasorUnit.java
5e34b5f063713ace2e5067be99278653b1a9bcd0
[ "Apache-2.0" ]
permissive
peng1916/hasor
4ed57e9b55c49a8212511c7334f4b8ea97b5073b
d5c1ac28db804bb1cb1935ba888116d1266c2894
refs/heads/master
2020-12-20T06:41:25.252056
2016-09-11T15:19:00
2016-09-11T15:19:00
null
0
0
null
null
null
null
UTF-8
Java
false
false
5,579
java
/* * Copyright 2008-2009 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 net.test.hasor.junit; import java.io.PrintStream; import java.util.ArrayList; import java.util.HashMap; import java.util.LinkedHashMap; import java.util.List; import java.util.Map; import java.util.Map.Entry; import java.util.UUID; import org.more.convert.ConverterUtils; import org.more.util.BeanUtils; import org.more.util.CharUtils; import org.more.util.StringUtils; /** * * @version : 2014年7月11日 * @author 赵永春(zyc@hasor.net) */ public abstract class HasorUnit { /**代码相当于:<code>UUID.randomUUID().toString()</code>*/ public static String newID() { return UUID.randomUUID().toString(); } /**打印列表内容*/ public static <T> String printObjectList(final List<T> dataList) { return HasorUnit.printObjectList(dataList, System.out); } /**打印列表内容*/ public static String printMapList(final List<Map<String, Object>> dataList) { return HasorUnit.printMapList(dataList, System.out); } /**打印列表内容*/ public static <T> String printObjectList(final List<T> dataList, final PrintStream out) { List<Map<String, Object>> newDataList = new ArrayList<Map<String, Object>>(); for (T obj : dataList) { List<String> keys = BeanUtils.getPropertysAndFields(obj.getClass()); Map<String, Object> newObj = new HashMap<String, Object>(); for (String key : keys) { newObj.put(key, BeanUtils.readPropertyOrField(obj, key)); } // newDataList.add(newObj); } return HasorUnit.printMapList(newDataList, out); } /**打印列表内容*/ public static String printMapList(final List<Map<String, Object>> dataList, final PrintStream out) { List<Map<String, String>> newValues = new ArrayList<Map<String, String>>(); Map<String, Integer> titleConfig = new LinkedHashMap<String, Integer>(); //1.转换 for (Map<String, Object> mapItem : dataList) { Map<String, String> newVal = new HashMap<String, String>(); // for (Entry<String, Object> ent : mapItem.entrySet()) { //1.Title String key = ent.getKey(); String val = ConverterUtils.convert(ent.getValue()); val = val == null ? "" : val; Integer maxTitleLength = titleConfig.get(key); if (maxTitleLength == null) { maxTitleLength = HasorUnit.stringLength(key); } if (val.length() > maxTitleLength) { maxTitleLength = HasorUnit.stringLength(val); } titleConfig.put(key, maxTitleLength); //2.Value newVal.put(key, val); } // newValues.add(newVal); } //2.输出 StringBuffer output = new StringBuffer(); boolean first = true; int titleLength = 0; for (Map<String, String> row : newValues) { //1.Title if (first) { StringBuffer sb = new StringBuffer(""); for (Entry<String, Integer> titleEnt : titleConfig.entrySet()) { String title = StringUtils.rightPad(titleEnt.getKey(), titleEnt.getValue(), ' '); sb.append(String.format("| %s ", title)); } sb.append("|"); titleLength = sb.length(); sb.insert(0, String.format("/%s\\\n", StringUtils.center("", titleLength - 2, "-"))); first = false; output.append(sb + "\n"); output.append(String.format("|%s|\n", StringUtils.center("", titleLength - 2, "-"))); } //2.Body StringBuffer sb = new StringBuffer(""); for (String colKey : titleConfig.keySet()) { String val = row.get(colKey); String valueStr = StringUtils.rightPad(val, HasorUnit.fixLength(val, titleConfig.get(colKey)), ' '); sb.append(String.format("| %s ", valueStr)); } sb.append("|"); output.append(sb.toString() + "\n"); } output.append(String.format("\\%s/", StringUtils.center("", titleLength - 2, "-"))); if (out != null) { out.println(output); } return output.toString(); } // // // private static int stringLength(final String str) { int length = 0; for (char c : str.toCharArray()) if (CharUtils.isAscii(c)) length++; else length = length + 2; return length; } /*修正长度*/ private static int fixLength(final String str, int length) { for (char c : str.toCharArray()) if (CharUtils.isAscii(c) == false) length--; return length; } }
[ "zyc@hasor.net" ]
zyc@hasor.net
32cad29479a6a35411e080927f1a700a0e4db411
03f05a9e40d3ae9d4439b5ab492d163771cf5416
/src/com/o2o/maileseller/network/volley/NetworkResponse.java
8615d759f9ef54f5caec9ef93845ef0b1536c95f
[]
no_license
xiguofeng/MaiLeSeller
aa681659204a4d87a8cee02b16a28cec83867b04
b913b02b2b566c36b5d9babe5087b10214eaa76a
refs/heads/master
2016-09-06T13:03:39.572899
2015-06-03T01:50:00
2015-06-03T01:50:00
35,148,205
0
0
null
null
null
null
UTF-8
Java
false
false
2,016
java
/* * Copyright (C) 2011 The Android Open Source Project * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package com.o2o.maileseller.network.volley; import java.util.Collections; import java.util.Map; import org.apache.http.HttpStatus; /** * Data and headers returned from {@link Network#performRequest(Request)}. */ public class NetworkResponse { /** * Creates a new network response. * @param statusCode the HTTP status code * @param data Response body * @param headers Headers returned with this response, or null for none * @param notModified True if the server returned a 304 and the data was already in cache */ public NetworkResponse(int statusCode, byte[] data, Map<String, String> headers, boolean notModified) { this.statusCode = statusCode; this.data = data; this.headers = headers; this.notModified = notModified; } public NetworkResponse(byte[] data) { this(HttpStatus.SC_OK, data, Collections.<String, String>emptyMap(), false); } public NetworkResponse(byte[] data, Map<String, String> headers) { this(HttpStatus.SC_OK, data, headers, false); } /** The HTTP status code. */ public final int statusCode; /** Raw data from this response. */ public final byte[] data; /** Response headers. */ public final Map<String, String> headers; /** True if the server returned a 304 (Not Modified). */ public final boolean notModified; }
[ "king.xgf@gmail.com" ]
king.xgf@gmail.com
b35b9ec3ab93e27d65a547a28123ef090538d5e2
c3fd707a6b2a23d24cc76587465ae5cb86319fa7
/sally/src/main/java/com/quicksoft/sally/controller/RestController.java
8794ce5201f71854d2328e7c5d2959e86873f975
[]
no_license
JuanDanielCR/Sally
dc0968564da64ca6eeded48189b032fd2dd10769
de588e05cbb300c65851880f4aa7e0220c259d9c
refs/heads/master
2021-08-28T05:32:05.814208
2017-12-11T09:11:41
2017-12-11T09:11:41
111,438,212
0
1
null
null
null
null
UTF-8
Java
false
false
925
java
package com.quicksoft.sally.controller; import java.util.ArrayList; import java.util.List; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Qualifier; import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RequestMapping; import com.quicksoft.sally.entity.Criterio; import com.quicksoft.sally.service.PlantillaService; @org.springframework.web.bind.annotation.RestController @RequestMapping("/api") public class RestController { @Autowired @Qualifier("plantillaService") private PlantillaService plantillaService; private List<Criterio> criterios= new ArrayList(); @PostMapping("/addCriterio") public String agregarCriterio(@RequestBody List<Criterio> crit){ crit.addAll(criterios); return "Agregados correctamente"; } }
[ "castilloreyesjuan@gmail.com" ]
castilloreyesjuan@gmail.com
1cbecfd2d702089816bf7711d3cf8e8e457bbae6
751d84ec4f6834627bc4d95be6373081310d9582
/Java Fundamentals/07.StreamAPI/WeakStudents.java
6f0d84b7b558335069788ee9f98eb42f56375483
[]
no_license
AtanasYordanov/Java-Advanced
efcfac4f5e4d36956763f5ebbae727bab5aad755
1c126edaff0d8489aa64a8dbf1e2b8ce69902d57
refs/heads/master
2021-07-24T03:00:30.313958
2018-10-19T19:10:57
2018-10-19T19:10:57
133,526,065
0
1
null
null
null
null
UTF-8
Java
false
false
1,216
java
package StreamAPI; import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; import java.util.ArrayList; import java.util.LinkedHashMap; import java.util.List; import java.util.Map; public class WeakStudents { public static void main(String[] args) throws IOException { BufferedReader reader = new BufferedReader(new InputStreamReader(System.in)); Map<String, List<Integer>> studentGrades = new LinkedHashMap<>(); for (String line = reader.readLine(); !line.equals("END"); line = reader.readLine()) { String[] tokens = line.split(" "); String name = tokens[0] + " " + tokens[1]; studentGrades.putIfAbsent(name, new ArrayList<>()); for (int i = 2; i < tokens.length; i++) { int grade = Integer.parseInt(tokens[i]); studentGrades.get(name).add(grade); } } studentGrades.entrySet().stream() .filter(kvp -> kvp.getValue().stream() .filter(g -> g <= 3) .count() >= 2) .forEach(kvp -> { System.out.println(kvp.getKey()); }); } }
[ "naskoraist@gmail.com" ]
naskoraist@gmail.com
767e4fb77e201222814e6b8014c13ac18b4c6ca7
cad7bc29389fbf5d5b722ee5327ba8154e7cc952
/submissions/available/CPC/CPC-what-property/data/source/apacheDB-trunk/tck/src/main/java/org/apache/jdo/tck/api/persistencemanager/ChangingObjectIdHasNoEffectOnInstance.java
938683fe2850a594153847ac091f4ad3c6ad1a13
[ "Apache-2.0", "Unlicense" ]
permissive
XZ-X/CPC-artifact-release
f9f9f0cde79b111f47622faba02f08b85a8a5ee9
5710dc0e39509f79e42535e0b5ca5e41cbd90fc2
refs/heads/master
2022-12-20T12:30:22.787707
2020-01-27T21:45:33
2020-01-27T21:45:33
236,601,424
1
0
Unlicense
2022-12-16T04:24:27
2020-01-27T21:41:38
Java
UTF-8
Java
false
false
2,507
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.jdo.tck.api.persistencemanager; import org.apache.jdo.tck.util.BatchTestRunner; /** *<B>Title:</B> Changing ObjectId Has No Effect On Instance *<BR> *<B>Keywords:</B> identity *<BR> *<B>Assertion ID:</B> A12.5.6-13. *<BR> *<B>Assertion Description: </B> If the application makes a change to the <code>ObjectId</code> instance returned by <code>PersistenceManager.getObjectId</code>, there is no effect on the instance from which the <code>ObjectId</code> was obtained. */ public class ChangingObjectIdHasNoEffectOnInstance extends PersistenceManagerTest { /** */ private static final String ASSERTION_FAILED = "Assertion A12.5.6-13 (ChangingObjectIdHasNoEffectOnInstance) failed: "; /** * The <code>main</code> is called when the class * is directly executed from the command line. * @param args The arguments passed to the program. */ public static void main(String[] args) { BatchTestRunner.run(ChangingObjectIdHasNoEffectOnInstance.class); } /** */ public void testChangingObjectIdHasNoEffectOnInstance() throws Exception { pm = getPM(); Object oid = createPCPointInstance(pm); Object p1 = pm.getObjectById(oid, false); Object oid2 = pm.getObjectId(p1); mangleObject(oid); // now oid3 should equal oid2 even though we mangled oid Object oid3 = getPM().getObjectId(p1); if (!oid2.equals(oid3)) fail(ASSERTION_FAILED, "Changing the ObjectId returned by getObjectId has an effect on ObjectId's returned by subsequent calls of getObjectId"); pm.close(); pm = null; } }
[ "161250170@smail.nju.edu.cn" ]
161250170@smail.nju.edu.cn
3674c65137f75cfc1de4432a896a11ba94704b73
9d7a8345845e53843958263c75b618eef83327f1
/Scheduler/SchedulerManager/src/main/java/edu/kit/dama/scheduler/api/impl/QuartzAtTrigger.java
df52710e393b538a24bfdcd274b1c3918cc8e8a1
[ "Apache-2.0" ]
permissive
kit-data-manager/base
39f543b2b7824ebc2cd92f46366f7d4b82e44895
3420af44035768f5111ea9f279b285ac0e22633a
refs/heads/master
2021-07-18T07:40:27.960912
2020-06-16T05:30:20
2020-06-16T05:30:20
41,793,596
3
4
Apache-2.0
2020-07-01T20:55:08
2015-09-02T09:52:14
Java
UTF-8
Java
false
false
3,766
java
/* * Copyright 2015 Karlsruhe Institute of Technology. * * 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 edu.kit.dama.scheduler.api.impl; import edu.kit.dama.scheduler.api.trigger.AtTrigger; import java.util.Date; import javax.xml.bind.annotation.XmlAccessType; import javax.xml.bind.annotation.XmlAccessorType; import javax.xml.bind.annotation.XmlRootElement; import org.eclipse.persistence.oxm.annotations.XmlNamedAttributeNode; import org.eclipse.persistence.oxm.annotations.XmlNamedObjectGraph; import org.eclipse.persistence.oxm.annotations.XmlNamedObjectGraphs; import org.quartz.SimpleTrigger; import org.quartz.Trigger; import org.quartz.TriggerBuilder; /** * * @author wq7203 */ @XmlNamedObjectGraphs({ @XmlNamedObjectGraph( name = "simple", attributeNodes = { @XmlNamedAttributeNode(value = "id") } ), @XmlNamedObjectGraph( name = "default", attributeNodes = { @XmlNamedAttributeNode(value = "id"), @XmlNamedAttributeNode(value = "name"), @XmlNamedAttributeNode(value = "triggerGroup"), @XmlNamedAttributeNode(value = "priority"), @XmlNamedAttributeNode(value = "description"), @XmlNamedAttributeNode(value = "nextFireTime"), @XmlNamedAttributeNode(value = "startDate")} ) }) @XmlAccessorType(XmlAccessType.FIELD) @XmlRootElement public class QuartzAtTrigger extends AtTrigger { private Date nextFireTime; /** * Default constructor. */ public QuartzAtTrigger() { } /** * A constructor used to create a QuartzAtTrigger based on the provided * SimpleTrigger. * * @param simpleTrigger the simple trigger. */ public QuartzAtTrigger(SimpleTrigger simpleTrigger) { setId(simpleTrigger.getKey().toString()); setName(simpleTrigger.getKey().getName()); setTriggerGroup(simpleTrigger.getKey().getGroup()); setPriority(simpleTrigger.getPriority()); setDescription(simpleTrigger.getDescription()); setStartDate(simpleTrigger.getStartTime()); this.nextFireTime = simpleTrigger.getNextFireTime(); } @Override public Date getNextFireTime() { return (this.nextFireTime != null) ? (Date) this.nextFireTime.clone() : null; } /** * Builds a new TriggerBuilder instance based on this object. * * @return a TriggerBuilder instance based on this object. */ public TriggerBuilder<? extends Trigger> build() { TriggerBuilder<Trigger> triggerBuilder = TriggerBuilder.newTrigger(); if (getName() != null) { triggerBuilder.withIdentity(getName(), getTriggerGroup()); } if (getPriority() != null) { triggerBuilder.withPriority(getPriority()); } triggerBuilder.withDescription(getDescription()); if (getStartDate() != null) { triggerBuilder.startAt(getStartDate()); } else { triggerBuilder.startNow(); } return triggerBuilder; } }
[ "thomas.jejkal@kit.edu" ]
thomas.jejkal@kit.edu
1d0f7bdc010f97c4f738fdf4f824d2abdb3b3823
cc511ceb3194cfdd51f591e50e52385ba46a91b3
/example/source_code/7cb31bd79e8509f52d4803c74fed708f0257b546/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/operation/AddProperty.java
c2549f5be6067dbd2bfbac16d59dea55bd1dd7e9
[]
no_license
huox-lamda/testing_hw
a86cdce8d92983e31e653dd460abf38b94a647e4
d41642c1e3ffa298684ec6f0196f2094527793c3
refs/heads/master
2020-04-16T19:24:49.643149
2019-01-16T15:47:13
2019-01-16T15:47:13
165,858,365
3
3
null
null
null
null
UTF-8
Java
false
false
2,559
java
org apach jackrabbit jcr2spi oper org apach jackrabbit spi properti definit qpropertydefinit org apach jackrabbit spi qvalu org apach jackrabbit spi node nodeid org apach jackrabbit spi org apach jackrabbit jcr2spi state node state nodest javax jcr repositori except repositoryexcept javax jcr item exist except itemexistsexcept javax jcr format except valueformatexcept javax jcr access deni except accessdeniedexcept javax jcr unsupport repositori oper except unsupportedrepositoryoperationexcept javax jcr version version except versionexcept javax jcr lock lock except lockexcept javax jcr nodetyp constraint violat except constraintviolationexcept code addproperti code add properti addproperti abstract oper abstractoper node nodeid parent parentid node state nodest parent state parentst properti propertynam properti type propertytyp qvalu valu properti definit qpropertydefinit definit add properti addproperti node state nodest parent state parentst prop propnam properti type propertytyp qvalu valu properti definit qpropertydefinit definit parent parentid parent state parentst node getnodeid parent state parentst parent state parentst properti propertynam prop propnam properti type propertytyp properti type propertytyp valu valu definit definit add affect item state addaffecteditemst parent state parentst oper param visitor accept oper visitor operationvisitor visitor format except valueformatexcept lock except lockexcept constraint violat except constraintviolationexcept access deni except accessdeniedexcept item exist except itemexistsexcept unsupport repositori oper except unsupportedrepositoryoperationexcept version except versionexcept repositori except repositoryexcept visitor visit throw unsupportedoperationexcept oper persist persist unsupport oper except unsupportedoperationexcept persist implement transient modif access oper paramet node nodeid parent getparentid parent parentid node state nodest parent state getparentst parent state parentst properti getpropertynam properti propertynam properti type getpropertytyp properti type propertytyp qvalu valu getvalu valu multi valu ismultivalu definit multipl ismultipl properti definit qpropertydefinit definit getdefinit definit factori param parentst param propnam param propertytyp param def param valu return oper creat node state nodest parent state parentst prop propnam properti type propertytyp properti definit qpropertydefinit def qvalu valu add properti addproperti add properti addproperti parent state parentst prop propnam properti type propertytyp valu def
[ "huox@lamda.nju.edu.cn" ]
huox@lamda.nju.edu.cn
4d406ea065db9007d12c2975b6fb4b6dd96fa6dc
071c1f29eca575bf6b65a2df3a4e10af67cb3152
/src/com/hncboy/SingleNumberII.java
b6baba3dba8ecfeb2684b9439a439e7e884f64fa
[ "Apache-2.0" ]
permissive
hncboy/LeetCode
3b44744e589585c2c5b528136619beaf77f84759
ab66f67d0a7a6667f1b21e8f0be503eb351863bd
refs/heads/master
2022-12-14T20:45:19.210935
2022-12-08T04:58:37
2022-12-08T04:58:37
205,283,145
10
0
null
null
null
null
UTF-8
Java
false
false
1,432
java
package com.hncboy; import com.hncboy.swordreferstoofferspecial.Question004; /** * @author hncboy * @date 2021/10/27 9:41 * @description 137.只出现一次的数字 II * * 给你一个整数数组 nums ,除某个元素仅出现 一次 外,其余每个元素都恰出现 三次 。请你找出并返回那个只出现了一次的元素。 * * 示例 1: * 输入:nums = [2,2,3,2] * 输出:3 * * 示例 2: * 输入:nums = [0,1,0,1,0,1,99] * 输出:99 * * 提示: * 1 <= nums.length <= 3 * 104 * -231 <= nums[i] <= 231 - 1 * nums 中,除某个元素仅出现 一次 外,其余每个元素都恰出现 三次 * * 进阶:你的算法应该具有线性时间复杂度。 你可以不使用额外空间来实现吗? * * 来源:力扣(LeetCode) * 链接:https://leetcode-cn.com/problems/single-number-ii * 著作权归领扣网络所有。商业转载请联系官方授权,非商业转载请注明出处。 */ public class SingleNumberII { public static void main(String[] args) { Question004 q = new Question004(); System.out.println(q.singleNumber(new int[]{2, 2, 3, 2})); } public int singleNumber(int[] nums) { // 用两位表示 3 种状态 int ones = 0; int twos = 0; for (int num : nums) { ones = ones ^ num & ~twos; twos = twos ^ num & ~ones; } return ones; } }
[ "619452863@qq.com" ]
619452863@qq.com
07ff9ece7cdd2d203e42813a0a74f06f173055f1
1930d97ebfc352f45b8c25ef715af406783aabe2
/src/main/java/com/alipay/api/response/AlipayOpenMiniInnerbaseinfoBatchqueryResponse.java
df9325201b0c08f873776159703d8c83e02e3bc9
[ "Apache-2.0" ]
permissive
WQmmm/alipay-sdk-java-all
57974d199ee83518523e8d354dcdec0a9ce40a0c
66af9219e5ca802cff963ab86b99aadc59cc09dd
refs/heads/master
2023-06-28T03:54:17.577332
2021-08-02T10:05:10
2021-08-02T10:05:10
null
0
0
null
null
null
null
UTF-8
Java
false
false
977
java
package com.alipay.api.response; import java.util.List; import com.alipay.api.internal.mapping.ApiField; import com.alipay.api.internal.mapping.ApiListField; import com.alipay.api.domain.MiniAppBaseInfoQueryResponse; import com.alipay.api.AlipayResponse; /** * ALIPAY API: alipay.open.mini.innerbaseinfo.batchquery response. * * @author auto create * @since 1.0, 2020-04-23 14:18:52 */ public class AlipayOpenMiniInnerbaseinfoBatchqueryResponse extends AlipayResponse { private static final long serialVersionUID = 1715794393792913942L; /** * 小程序基本信息 */ @ApiListField("base_info_list") @ApiField("mini_app_base_info_query_response") private List<MiniAppBaseInfoQueryResponse> baseInfoList; public void setBaseInfoList(List<MiniAppBaseInfoQueryResponse> baseInfoList) { this.baseInfoList = baseInfoList; } public List<MiniAppBaseInfoQueryResponse> getBaseInfoList( ) { return this.baseInfoList; } }
[ "ben.zy@antfin.com" ]
ben.zy@antfin.com
09945ce0ec0dc19b132fe30301669e636ff8004c
3f9fd6c6675921ab1b6be85bc928fcc1a692c312
/src/main/java/com/fwtai/Launcher.java
11ef7d7bcdb41b866263f62b7706f6dab4e2c946
[]
no_license
gzstyp/zwing
58c23cc3be80535aa6cb37f28e1277edfbf410b8
d1891caccca51f3737adfa489636c1bd27822859
refs/heads/master
2023-02-04T08:42:03.044481
2020-12-26T15:17:12
2020-12-26T15:17:12
324,580,641
0
0
null
null
null
null
UTF-8
Java
false
false
283
java
package com.fwtai; import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.SpringBootApplication; @SpringBootApplication public class Launcher{ public static void main(String[] args) { SpringApplication.run(Launcher.class, args); } }
[ "444141300@qq.com" ]
444141300@qq.com
e357291cf9c0a63b6a78eddd787f98076cd3a043
88f1f670cd31deaf5186fe4d20413026ea7c076b
/language/codemap/src/test/java/dev/nimbler/language/codemap/compiler/FileReferencesTest.java
52059a85bb1167b35fdd847b1cdc0f5af9fae8d7
[]
no_license
neaterbits/compiler
499517c43bd688262391353bb87fee8e261fb352
caea422856ed72befd1c98263e861658ffe18001
refs/heads/main
2023-08-21T20:14:09.257839
2021-08-09T19:18:06
2021-08-09T19:23:57
183,889,843
0
0
null
2023-08-15T17:45:38
2019-04-28T09:53:16
Java
UTF-8
Java
false
false
2,046
java
package dev.nimbler.language.codemap.compiler; import static org.assertj.core.api.Assertions.assertThat; import static org.assertj.core.api.Assertions.fail; import org.junit.Test; import dev.nimbler.language.codemap.ArrayAllocation; public class FileReferencesTest { @Test public void addAndRemoveFile() { final FileReferences fileReferences = new FileReferences(); final int fileNo = 1; final int [] types = new int [] { 1, 2, 3 }; fileReferences.addFile(fileNo, types); assertThat(fileReferences.getTypesForFile(fileNo)).isEqualTo(types); fileReferences.removeFile(fileNo); assertThat(fileReferences.getTypesForFile(fileNo)).isNull(); } @Test public void testGetOutOfRangeThrowsException() { final FileReferences fileReferences = new FileReferences(); final int fileNo = 1; final int [] types = new int [] { 1, 2, 3 }; fileReferences.addFile(fileNo, types); try { fileReferences.getTypesForFile(ArrayAllocation.DEFAULT_LENGTH); fail("Expected exception"); } catch (IllegalArgumentException ex) { } } @Test public void testAddAlreadyAddedThrowsException() { final FileReferences fileReferences = new FileReferences(); final int fileNo = 1; final int [] types = new int [] { 1, 2, 3 }; fileReferences.addFile(fileNo, types); try { fileReferences.addFile(fileNo, types); fail("Expected exception"); } catch (IllegalStateException ex) { } } @Test public void addNullTypesReturnsEmptyArray() { final FileReferences fileReferences = new FileReferences(); final int fileNo = 1; fileReferences.addFile(fileNo, null); assertThat(fileReferences.getTypesForFile(fileNo)).isEqualTo(new int [0]); fileReferences.removeFile(fileNo); assertThat(fileReferences.getTypesForFile(fileNo)).isNull(); } }
[ "nils.lorentzen@gmail.com" ]
nils.lorentzen@gmail.com
75c40d0eecc58aa60ad6cbddc14240f8e212fd04
55e25ce39c42c78681c663cece12a2652a994dbb
/src/main/java/com/github/davidmoten/rtree/NodePosition.java
4540ef29bf2c547ea6fcb10c6039b20218d292cc
[ "Apache-2.0" ]
permissive
davidmoten/rtree
f36283e402de18f4cd45491d23703565a462dd71
b4bf255b08256a289b9bf8b3258dd8607b7d17a3
refs/heads/master
2023-08-23T20:31:40.858481
2023-08-04T11:54:55
2023-08-04T11:56:22
23,350,791
993
247
Apache-2.0
2023-08-04T11:56:23
2014-08-26T12:29:14
Java
UTF-8
Java
false
false
866
java
package com.github.davidmoten.rtree; import com.github.davidmoten.guavamini.Preconditions; import com.github.davidmoten.rtree.geometry.Geometry; final class NodePosition<T, S extends Geometry> { private final Node<T, S> node; private final int position; NodePosition(Node<T, S> node, int position) { Preconditions.checkNotNull(node); this.node = node; this.position = position; } Node<T, S> node() { return node; } int position() { return position; } NodePosition<T, S> nextPosition() { return new NodePosition<T, S>(node, position + 1); } @Override public String toString() { String builder = "NodePosition [node=" + node + ", position=" + position + "]"; return builder; } }
[ "davidmoten@gmail.com" ]
davidmoten@gmail.com
816f9645859fb732d456414f34869c8413a9abda
fa91450deb625cda070e82d5c31770be5ca1dec6
/Diff-Raw-Data/33/33_422fc81cac0e87a1e68508c2453900eae4359839/ApiProtocolSwitcher/33_422fc81cac0e87a1e68508c2453900eae4359839_ApiProtocolSwitcher_s.java
4205b0de08c261a8a80660033a1f9b10d7641d5a
[]
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,832
java
package com.kalixia.rawsag; import com.fasterxml.jackson.databind.ObjectMapper; import com.kalixia.rawsag.codecs.CORSCodec; import com.kalixia.rawsag.codecs.rest.RESTCodec; import com.kalixia.rawsag.codecs.websockets.WebSocketsApiRequestDecoder; import com.kalixia.rawsag.codecs.websockets.WebSocketsApiResponseEncoder; import com.kalixia.rawsag.codecs.websockets.WebSocketsServerProtocolUpdater; import io.netty.buffer.BufUtil; import io.netty.buffer.MessageBuf; import io.netty.channel.ChannelHandler; import io.netty.channel.ChannelHandlerContext; import io.netty.channel.ChannelPipeline; import io.netty.handler.codec.MessageToMessageDecoder; import io.netty.handler.codec.http.FullHttpRequest; import io.netty.util.concurrent.DefaultEventExecutorGroup; import io.netty.util.concurrent.DefaultThreadFactory; import io.netty.util.concurrent.EventExecutorGroup; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.slf4j.MDC; import javax.inject.Inject; import java.net.InetSocketAddress; /** * Alters the pipeline in order to cope with both HTTP REST API handlers and WebSockets handlers. */ @ChannelHandler.Sharable public class ApiProtocolSwitcher extends MessageToMessageDecoder<FullHttpRequest> { private final ObjectMapper objectMapper; private final EventExecutorGroup restEventGroup; private static final ChannelHandler webSocketsServerProtocolUpdater = new WebSocketsServerProtocolUpdater(); private static final ChannelHandler webSocketsApiResponseEncoder = new WebSocketsApiResponseEncoder(); private static final CORSCodec corsCodec = new CORSCodec(); private static final ChannelHandler restCodec = new RESTCodec(); private static final Logger LOGGER = LoggerFactory.getLogger(ApiProtocolSwitcher.class); @Inject public ApiProtocolSwitcher(ObjectMapper objectMapper) { this.objectMapper = objectMapper; // TODO: allow customization of the thread pool! this.restEventGroup = new DefaultEventExecutorGroup( Runtime.getRuntime().availableProcessors(), new DefaultThreadFactory("rest")); } @Override protected void decode(ChannelHandlerContext ctx, FullHttpRequest msg, MessageBuf<Object> out) throws Exception { ChannelPipeline pipeline = ctx.pipeline(); if (msg.getUri().equals("/websocket")) { LOGGER.debug("Switching to WebSockets pipeline..."); pipeline.addBefore("api-request-logger", "ws-protocol-updater", webSocketsServerProtocolUpdater); pipeline.addAfter("ws-protocol-updater", "api-response-encoder-ws", webSocketsApiResponseEncoder); pipeline.addAfter("api-response-encoder-ws", "api-request-decoder-ws", new WebSocketsApiRequestDecoder(objectMapper)); pipeline.remove(this); } else { LOGGER.debug("Switching to REST pipeline..."); pipeline.addBefore("api-request-logger", "cors-codec", corsCodec); pipeline.addAfter(restEventGroup, "cors-codec", "rest-codec", restCodec); pipeline.remove(this); } out.add(BufUtil.retain(msg)); } @Override public void channelActive(ChannelHandlerContext ctx) throws Exception { super.channelActive(ctx); MDC.put(MDCLogging.MDC_CLIENT_ADDR, ((InetSocketAddress) ctx.channel().remoteAddress()).getHostString()); } @Override public void channelInactive(ChannelHandlerContext ctx) throws Exception { super.channelInactive(ctx); MDC.remove(MDCLogging.MDC_CLIENT_ADDR); } @Override public void exceptionCaught(ChannelHandlerContext ctx, Throwable cause) throws Exception { LOGGER.error("Can't setup API pipeline", cause); ctx.close(); } }
[ "yuzhongxing88@gmail.com" ]
yuzhongxing88@gmail.com
6f8460579ad50ed342bd26fc01050daf12111a4b
4d273a18f377ffcf894826d96ed6731ca1c81ef6
/Module_4/11_web_service_and_restful/exercise/exercise_1/src/main/java/com/example/blog_update/model/service/ICategoryService.java
c70974283548847858c6396cb543a4db81c76699
[]
no_license
DucDoan95/C0221G1-DoanMinhDuc
069aa119d1f74f8a37e4833aab6fd22cc5bad4e9
aa077714f1d0fda45229da83f0834812ddc91330
refs/heads/master
2023-07-03T03:19:49.170061
2021-08-03T02:48:52
2021-08-03T02:48:52
342,118,376
0
0
null
null
null
null
UTF-8
Java
false
false
346
java
package com.example.blog_update.model.service; import com.example.blog_update.model.entity.Category; import org.springframework.data.domain.Page; import org.springframework.data.domain.Pageable; import java.util.List; public interface ICategoryService { Page<Category> findByAll(Pageable pageable); Category save(Category category); }
[ "you@example.com" ]
you@example.com