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
|
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
db8547e61d00df0944f047cbc202350e35f62d19
|
650612dc6eb7adb4725589b735e97c22e238688d
|
/APPGestionLogistica/src/com/oscasistemas/appgestionlogistica/Expediciones/ConsultaClientes.java
|
d5bfe1313cf6eda2441e3a7ba6ba350919a7cd6c
|
[] |
no_license
|
josnick93/AppLogisticaAlmacen
|
4ca94d8be6060a80b70c7889b008682ec485f548
|
b036505c6fd5a4c46a558ebafb86bb408f2e1df9
|
refs/heads/master
| 2021-09-08T07:16:09.536015
| 2018-03-08T09:02:50
| 2018-03-08T09:02:50
| 124,035,564
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 2,247
|
java
|
package com.oscasistemas.appgestionlogistica.Expediciones;
import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.sql.Statement;
import java.util.ArrayList;
import java.util.LinkedHashMap;
import android.app.Activity;
import android.os.AsyncTask;
import android.widget.ArrayAdapter;
import android.widget.Spinner;
public class ConsultaClientes extends AsyncTask<String, Void, String> {
private Spinner ClienteSpinner;
private Activity activity;
private LinkedHashMap<String,Integer> clientes;
public ConsultaClientes(Activity act,Spinner ClienteSpinner) {
// TODO Auto-generated constructor stub
this.ClienteSpinner = ClienteSpinner;
this.activity=act;
this.clientes=new LinkedHashMap<String,Integer>();
}
@Override
protected String doInBackground(String... params) {
Connection conn = null;
Statement st = null;
ResultSet rs = null;
/**
* Info Articulo
*/
try {
/**
* Codigo
*/
Class.forName("com.mysql.jdbc.Driver");
conn = DriverManager.getConnection("jdbc:mysql://192.168.2.2:3306/erp_osca", "usuario", "osca-SiStEmAs");
st = conn.createStatement();
st.addBatch("USE erp_osca");
rs = st.executeQuery("SELECT * FROM Cliente c WHERE c.Nombre Like '"+params[0]+"%'" + " ORDER BY c.Nombre ASC" );
while(rs.next())
this.clientes.put(rs.getString("c.Nombre"), rs.getInt("c.Cliente"));
/**
* Depuracion errores
*/
} catch (ClassNotFoundException e) {
// TODO Auto-generated catch block
e.printStackTrace();
} catch (SQLException e) {
// TODO Auto-generated catch block
e.printStackTrace();
} finally {
try {
rs.close();
st.close();
conn.close();
} catch (SQLException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
return "";
}
public LinkedHashMap<String, Integer> getClientes() {
return clientes;
}
@Override
protected void onPostExecute(String result) {
// TODO Auto-generated method stub
super.onPostExecute(result);
ClienteSpinner.setAdapter(new ArrayAdapter<String>(activity,
android.R.layout.simple_spinner_dropdown_item, new ArrayList<String>(clientes.keySet())));
}
}
|
[
"josecaudevilla93@gmail.com"
] |
josecaudevilla93@gmail.com
|
353b45dca83e1cebcab4854d908bb27b0d4b1db7
|
f40f1e11a415cfbb36b9c8d47cfe8a789e798276
|
/plugin/src/test/java/com/stratio/cassandra/lucene/schema/mapping/builder/BigDecimalMapperBuilderTest.java
|
4238a981da04d04aee067b9e15e0ad0f921a3ac6
|
[
"Apache-2.0"
] |
permissive
|
forumjava/cassandra-lucene-index
|
f326688ac559b130a99c4f925bde00b424051e7b
|
d592f460061811d875c4096cc9ea084657a1cfaa
|
refs/heads/master
| 2021-01-21T23:58:09.714058
| 2015-07-15T07:42:00
| 2015-07-15T07:42:00
| null | 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 3,108
|
java
|
/*
* Copyright 2015, Stratio.
*
* 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.stratio.cassandra.lucene.schema.mapping.builder;
import com.stratio.cassandra.lucene.schema.mapping.BigDecimalMapper;
import com.stratio.cassandra.lucene.schema.mapping.Mapper;
import org.junit.Test;
import static org.junit.Assert.*;
/**
* Class for testing {@link BigDecimalMapperBuilder}.
*
* @author Andres de la Pena {@literal <adelapena@stratio.com>}
*/
public class BigDecimalMapperBuilderTest extends AbstractMapperBuilderTest {
@Test
public void testBuild() {
BigDecimalMapperBuilder builder = new BigDecimalMapperBuilder().indexed(false)
.sorted(false)
.integerDigits(6)
.decimalDigits(8);
BigDecimalMapper mapper = builder.build("field");
assertNotNull(mapper);
assertFalse(mapper.isIndexed());
assertFalse(mapper.isSorted());
assertEquals("field", mapper.getName());
assertEquals(6, mapper.getIntegerDigits());
assertEquals(8, mapper.getDecimalDigits());
}
@Test
public void testBuildDefaults() {
BigDecimalMapperBuilder builder = new BigDecimalMapperBuilder();
BigDecimalMapper mapper = builder.build("field");
assertNotNull(mapper);
assertEquals(Mapper.DEFAULT_INDEXED, mapper.isIndexed());
assertEquals(Mapper.DEFAULT_SORTED, mapper.isSorted());
assertEquals("field", mapper.getName());
assertEquals(BigDecimalMapper.DEFAULT_INTEGER_DIGITS, mapper.getIntegerDigits());
assertEquals(BigDecimalMapper.DEFAULT_DECIMAL_DIGITS, mapper.getDecimalDigits());
}
@Test
public void testJsonSerialization() {
BigDecimalMapperBuilder builder = new BigDecimalMapperBuilder().indexed(false)
.sorted(false)
.integerDigits(6)
.decimalDigits(8);
testJsonSerialization(builder,
"{type:\"bigdec\",indexed:false,sorted:false,integer_digits:6,decimal_digits:8}");
}
@Test
public void testJsonSerializationDefaults() {
BigDecimalMapperBuilder builder = new BigDecimalMapperBuilder();
testJsonSerialization(builder, "{type:\"bigdec\"}");
}
}
|
[
"a.penya.garcia@gmail.com"
] |
a.penya.garcia@gmail.com
|
d8d8cfdd6ce26d43d9c44bb09933b46ed8e30728
|
bab3327562d43f1a8082cf30888409163cc7601c
|
/src/main/java/com/sissi/protocol/iq/vcard/field/muc/Activate.java
|
bc4a79f8522800cfbddb56b46e5e931bf1a094d5
|
[
"Apache-2.0"
] |
permissive
|
wzl4022561/sissi
|
e451386447ff79e3963aa4a749b3e0f60e3316d6
|
7b3a2bb73c8da058dd8118811b4ad76d93b89d33
|
refs/heads/master
| 2021-01-13T15:18:39.560354
| 2015-05-21T01:22:51
| 2015-05-21T01:22:51
| null | 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 969
|
java
|
package com.sissi.protocol.iq.vcard.field.muc;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlValue;
import com.sissi.field.Field;
import com.sissi.field.Fields;
import com.sissi.io.read.Metadata;
import com.sissi.protocol.iq.vcard.VCard;
/**
* @author kim 2014年2月10日
*/
@Metadata(uri = VCard.XMLNS, localName = Activate.NAME)
@XmlRootElement(name = Activate.NAME)
public class Activate implements Field<String> {
public final static String NAME = "ACTIVATE";
private String value;
public Activate() {
super();
}
public Activate(String text) {
super();
this.value = text;
}
@XmlValue
public String getValue() {
return value.toString();
}
public Activate setText(String text) {
this.value = text;
return this;
}
@Override
public String getName() {
return NAME;
}
@Override
public Fields getChildren() {
return null;
}
@Override
public boolean hasChild() {
return false;
}
}
|
[
"sjw_job@126.com"
] |
sjw_job@126.com
|
8d04f4f5e2555f5d0bf005b3af0d48f6fe56411d
|
13c2d3db2d49c40c74c2e6420a9cd89377f1c934
|
/program_data/JavaProgramData/34/2683.java
|
ee084620fdf31e95540bb6fd856a297105c5cd0d
|
[
"MIT"
] |
permissive
|
qiuchili/ggnn_graph_classification
|
c2090fefe11f8bf650e734442eb96996a54dc112
|
291ff02404555511b94a4f477c6974ebd62dcf44
|
refs/heads/master
| 2021-10-18T14:54:26.154367
| 2018-10-21T23:34:14
| 2018-10-21T23:34:14
| null | 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 631
|
java
|
package <missing>;
public class GlobalMembers
{
///#include<string.h>
public static int change(int n)
{
int x;
if (n == 1)
{
x = 1;
}
else
{
if ((n % 2) == 0)
{
x = n / 2;
System.out.printf("%d/2=%d\n",n,x);
}
else
{
x = n * 3 + 1;
System.out.printf("%d*3+1=%d\n",n,x);
}
}
return (x);
}
public static void Main()
{
int n;
int k = 0;
String tempVar = ConsoleInput.scanfRead();
if (tempVar != null)
{
n = Integer.parseInt(tempVar);
}
//if(n==1) printf("End");
k = change(n);
while (k != 1)
{
k = change(k);
}
System.out.print("End");
}
}
|
[
"y.yu@open.ac.uk"
] |
y.yu@open.ac.uk
|
f33e6818bc376073fdc8b347dbea93c9fba4768e
|
65e8643b58205f92cd56fad16d421115a188a1a3
|
/com.mymoney/src/qm.java
|
558f12c4bcc7fffa6ad19950411cf390b1e29f60
|
[] |
no_license
|
goodev/liudongbaoproject
|
f2b0b0a22a1fd8c2ab5611ad0279e26b998c4e3d
|
72e585884d0a6f5765383f20f388303b11a1f0ad
|
refs/heads/master
| 2021-01-10T10:47:33.250578
| 2012-06-03T10:11:51
| 2012-06-03T10:11:51
| 50,891,250
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 1,531
|
java
|
import android.os.AsyncTask;
import android.widget.TextView;
import com.mymoney.ui.setting.CategoryListViewAdapter;
import com.mymoney.ui.setting.SettingFirstLevelCategoryActivity;
import java.util.List;
public class qm extends AsyncTask
{
List a;
public qm(SettingFirstLevelCategoryActivity paramSettingFirstLevelCategoryActivity)
{
}
protected Object doInBackground(Object[] paramArrayOfObject)
{
int i = SettingFirstLevelCategoryActivity.b(this.b);
int j = SettingFirstLevelCategoryActivity.c;
if (i == j)
{
List localList1 = SettingFirstLevelCategoryActivity.a(this.b).b();
this.a = localList1;
}
while (true)
{
return null;
int k = SettingFirstLevelCategoryActivity.b(this.b);
int m = SettingFirstLevelCategoryActivity.d;
if (k != m)
continue;
List localList2 = SettingFirstLevelCategoryActivity.a(this.b).a();
this.a = localList2;
}
}
protected void onPostExecute(Object paramObject)
{
if (SettingFirstLevelCategoryActivity.c(this.b).getVisibility() == 0)
SettingFirstLevelCategoryActivity.c(this.b).setVisibility(8);
CategoryListViewAdapter localCategoryListViewAdapter = SettingFirstLevelCategoryActivity.d(this.b);
List localList = this.a;
localCategoryListViewAdapter.a(localList);
}
}
/* Location: F:\soft\android\soft\dex2jar-0.0.7.10-SNAPSHOT\classes.dex.dex2jar.jar
* Qualified Name: qm
* JD-Core Version: 0.6.0
*/
|
[
"liudongbaollz@gmail.com"
] |
liudongbaollz@gmail.com
|
7cf64fad92c59a7b63764324e737ca541520f91c
|
d8b52a783f9b225461893126ba8ecd8f181ff224
|
/src/com/gargoylesoftware/htmlunit/attachment/Attachment.java
|
7a5bde2304520fd18950e9a29ddf6ed56240df6d
|
[] |
no_license
|
dawenzi80/test
|
8df7478a03692d98503f4d493a7a8a280a158634
|
3748f0bc73841807654e9e7aee3526c4b410bedb
|
refs/heads/master
| 2016-08-11T12:37:10.652652
| 2016-01-26T09:53:25
| 2016-01-26T09:53:25
| 50,418,503
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 2,961
|
java
|
/*
* Copyright (c) 2002-2013 Gargoyle Software 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.gargoylesoftware.htmlunit.attachment;
import com.gargoylesoftware.htmlunit.Page;
import com.gargoylesoftware.htmlunit.WebResponse;
/**
* An attachment represents a page received from the server which contains a
* {@code Content-Disposition=attachment} header.
*
* @version $Revision: 1.1 $
* @author Bruce Chapman
* @author Sudhan Moghe
* @author Daniel Gredler
*/
public class Attachment {
/** The attached page. */
private final Page page_;
/**
* Creates a new attachment for the specified page.
* @param page the attached page
*/
public Attachment(final Page page) {
page_ = page;
}
/**
* Returns the attached page.
* @return the attached page
*/
public Page getPage() {
return page_;
}
/**
* Returns the attachment's filename, as suggested by the <tt>Content-Disposition</tt>
* header, or <tt>null</tt> if no filename was suggested.
* @return the attachment's suggested filename, or <tt>null</tt> if none was suggested
*/
public String getSuggestedFilename() {
final WebResponse response = page_.getWebResponse();
final String disp = response.getResponseHeaderValue("Content-Disposition");
int start = disp.indexOf("filename=");
if (start == -1) {
return null;
}
start += "filename=".length();
int end = disp.indexOf(';', start);
if (end == -1) {
end = disp.length();
}
if (disp.charAt(start) == '"' && disp.charAt(end - 1) == '"') {
start++;
end--;
}
return disp.substring(start, end);
}
/**
* Returns <tt>true</tt> if the specified response represents an attachment.
* @param response the response to check
* @return <tt>true</tt> if the specified response represents an attachment, <tt>false</tt> otherwise
* @see <a href="http://www.ietf.org/rfc/rfc2183.txt">RFC 2183</a>
*/
public static boolean isAttachment(final WebResponse response) {
final String disp = response.getResponseHeaderValue("Content-Disposition");
if (disp == null) {
return false;
}
return disp.startsWith("attachment");
}
}
|
[
"liuxw@liuxw-PC-win7"
] |
liuxw@liuxw-PC-win7
|
ce2295e797a5a2f8872d6e3c9f5e5801eef04804
|
e0e2b50412bdc5742af17607688df722f2359891
|
/7.2/tutorials/CustomerProjectType/src/org/customer/project/samples/customer3/CustomerSample3WizardIterator.java
|
40cc8213fe13da509c901abffa2a3976e4f40124
|
[] |
no_license
|
redporrot/nbp-resources
|
faf4b4662779d038bc8770d3cea38b4f1653d70c
|
ef8a41ae6ab18dd1cd1460fa99a52757bf98916b
|
refs/heads/master
| 2020-04-01T17:24:22.481434
| 2015-06-12T21:37:01
| 2015-06-12T21:37:01
| null | 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 8,068
|
java
|
/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package org.customer.project.samples.customer3;
import java.awt.Component;
import java.io.ByteArrayInputStream;
import java.io.ByteArrayOutputStream;
import java.io.File;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.text.MessageFormat;
import java.util.Enumeration;
import java.util.LinkedHashSet;
import java.util.NoSuchElementException;
import java.util.Set;
import java.util.zip.ZipEntry;
import java.util.zip.ZipInputStream;
import javax.swing.JComponent;
import javax.swing.event.ChangeListener;
import org.netbeans.api.project.ProjectManager;
import org.netbeans.api.templates.TemplateRegistration;
import org.netbeans.spi.project.ui.support.ProjectChooser;
import org.netbeans.spi.project.ui.templates.support.Templates;
import org.openide.WizardDescriptor;
import org.openide.filesystems.FileObject;
import org.openide.filesystems.FileUtil;
import org.openide.util.Exceptions;
import org.openide.util.NbBundle;
import org.openide.util.NbBundle.Messages;
import org.openide.xml.XMLUtil;
import org.w3c.dom.Document;
import org.w3c.dom.Element;
import org.w3c.dom.NodeList;
import org.xml.sax.InputSource;
// TODO define position attribute
@TemplateRegistration(folder = "Project/Customers", displayName = "#CustomerSample3_displayName", description = "CustomerSample3Description.html", iconBase = "org/customer/project/samples/customer3/CustomerSample3.png", content = "CustomerSample3Project.zip")
@Messages("CustomerSample3_displayName=Customer Sample 3")
public class CustomerSample3WizardIterator implements WizardDescriptor./*Progress*/InstantiatingIterator {
private int index;
private WizardDescriptor.Panel[] panels;
private WizardDescriptor wiz;
public CustomerSample3WizardIterator() {
}
public static CustomerSample3WizardIterator createIterator() {
return new CustomerSample3WizardIterator();
}
private WizardDescriptor.Panel[] createPanels() {
return new WizardDescriptor.Panel[]{
new CustomerSample3WizardPanel(),};
}
private String[] createSteps() {
return new String[]{
NbBundle.getMessage(CustomerSample3WizardIterator.class, "LBL_CreateProjectStep")
};
}
public Set/*<FileObject>*/ instantiate(/*ProgressHandle handle*/) throws IOException {
Set<FileObject> resultSet = new LinkedHashSet<FileObject>();
File dirF = FileUtil.normalizeFile((File) wiz.getProperty("projdir"));
dirF.mkdirs();
FileObject template = Templates.getTemplate(wiz);
FileObject dir = FileUtil.toFileObject(dirF);
unZipFile(template.getInputStream(), dir);
// Always open top dir as a project:
resultSet.add(dir);
// Look for nested projects to open as well:
Enumeration<? extends FileObject> e = dir.getFolders(true);
while (e.hasMoreElements()) {
FileObject subfolder = e.nextElement();
if (ProjectManager.getDefault().isProject(subfolder)) {
resultSet.add(subfolder);
}
}
File parent = dirF.getParentFile();
if (parent != null && parent.exists()) {
ProjectChooser.setProjectsFolder(parent);
}
return resultSet;
}
public void initialize(WizardDescriptor wiz) {
this.wiz = wiz;
index = 0;
panels = createPanels();
// Make sure list of steps is accurate.
String[] steps = createSteps();
for (int i = 0; i < panels.length; i++) {
Component c = panels[i].getComponent();
if (steps[i] == null) {
// Default step name to component name of panel.
// Mainly useful for getting the name of the target
// chooser to appear in the list of steps.
steps[i] = c.getName();
}
if (c instanceof JComponent) { // assume Swing components
JComponent jc = (JComponent) c;
// Step #.
// TODO if using org.openide.dialogs >= 7.8, can use WizardDescriptor.PROP_*:
jc.putClientProperty("WizardPanel_contentSelectedIndex", new Integer(i));
// Step name (actually the whole list for reference).
jc.putClientProperty("WizardPanel_contentData", steps);
}
}
}
public void uninitialize(WizardDescriptor wiz) {
this.wiz.putProperty("projdir", null);
this.wiz.putProperty("name", null);
this.wiz = null;
panels = null;
}
public String name() {
return MessageFormat.format("{0} of {1}",
new Object[]{new Integer(index + 1), new Integer(panels.length)});
}
public boolean hasNext() {
return index < panels.length - 1;
}
public boolean hasPrevious() {
return index > 0;
}
public void nextPanel() {
if (!hasNext()) {
throw new NoSuchElementException();
}
index++;
}
public void previousPanel() {
if (!hasPrevious()) {
throw new NoSuchElementException();
}
index--;
}
public WizardDescriptor.Panel current() {
return panels[index];
}
// If nothing unusual changes in the middle of the wizard, simply:
public final void addChangeListener(ChangeListener l) {
}
public final void removeChangeListener(ChangeListener l) {
}
private static void unZipFile(InputStream source, FileObject projectRoot) throws IOException {
try {
ZipInputStream str = new ZipInputStream(source);
ZipEntry entry;
while ((entry = str.getNextEntry()) != null) {
if (entry.isDirectory()) {
FileUtil.createFolder(projectRoot, entry.getName());
} else {
FileObject fo = FileUtil.createData(projectRoot, entry.getName());
if ("nbproject/project.xml".equals(entry.getName())) {
// Special handling for setting name of Ant-based projects; customize as needed:
filterProjectXML(fo, str, projectRoot.getName());
} else {
writeFile(str, fo);
}
}
}
} finally {
source.close();
}
}
private static void writeFile(ZipInputStream str, FileObject fo) throws IOException {
OutputStream out = fo.getOutputStream();
try {
FileUtil.copy(str, out);
} finally {
out.close();
}
}
private static void filterProjectXML(FileObject fo, ZipInputStream str, String name) throws IOException {
try {
ByteArrayOutputStream baos = new ByteArrayOutputStream();
FileUtil.copy(str, baos);
Document doc = XMLUtil.parse(new InputSource(new ByteArrayInputStream(baos.toByteArray())), false, false, null, null);
NodeList nl = doc.getDocumentElement().getElementsByTagName("name");
if (nl != null) {
for (int i = 0; i < nl.getLength(); i++) {
Element el = (Element) nl.item(i);
if (el.getParentNode() != null && "data".equals(el.getParentNode().getNodeName())) {
NodeList nl2 = el.getChildNodes();
if (nl2.getLength() > 0) {
nl2.item(0).setNodeValue(name);
}
break;
}
}
}
OutputStream out = fo.getOutputStream();
try {
XMLUtil.write(doc, out, "UTF-8");
} finally {
out.close();
}
} catch (Exception ex) {
Exceptions.printStackTrace(ex);
writeFile(str, fo);
}
}
}
|
[
"doriancuentas@gmail.com"
] |
doriancuentas@gmail.com
|
6530aa9821da39e5bbd1a6aafb5ad775c7489887
|
a52d6bb42e75ef0678cfcd291e5696a9e358fc4d
|
/af_webapp/src/main/java/org/kuali/kfs/vnd/batch/VendorMatchStep.java
|
ebaf5fa59b19b9d2f2c2d24c4639e79631fc6d5d
|
[] |
no_license
|
Ariah-Group/Finance
|
894e39cfeda8f6fdb4f48a4917045c0bc50050c5
|
ca49930ca456799f99aad57e1e974453d8fe479d
|
refs/heads/master
| 2021-01-21T12:11:40.987504
| 2016-03-24T14:22:40
| 2016-03-24T14:22:40
| 26,879,430
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 1,208
|
java
|
/*
* Copyright 2011 The Kuali Foundation.
*
* Licensed under the Educational Community 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.opensource.org/licenses/ecl2.php
*
* 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.kuali.kfs.vnd.batch;
import java.util.Date;
import org.kuali.kfs.sys.batch.AbstractStep;
import org.kuali.kfs.vnd.batch.service.VendorExcludeService;
public class VendorMatchStep extends AbstractStep {
VendorExcludeService vendorExcludeService;
@Override
public boolean execute(String jobName, Date jobRunDate) throws InterruptedException {
return vendorExcludeService.matchVendors();
}
public void setVendorExcludeService(VendorExcludeService vendorExcludeService) {
this.vendorExcludeService = vendorExcludeService;
}
}
|
[
"code@ariahgroup.org"
] |
code@ariahgroup.org
|
dcbce5a11d43d0acd43a0f72d1611de0b3483033
|
8f098a9d289e492e5737537aada45e792de6ea9f
|
/src/com/example/nationstyle/ViewDualCards.java
|
4726d61092a72578d8e04b586cfff3630caf628d
|
[] |
no_license
|
goouttoplayno/Planning
|
c1867978f237f6608ac39e95cd437da66e2dd6de
|
98ff8d63064ede02754b79d2b3ab87a2c21c159a
|
refs/heads/master
| 2020-05-02T12:50:30.954429
| 2019-03-27T10:40:06
| 2019-03-27T10:40:06
| 177,968,852
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 5,220
|
java
|
package com.example.nationstyle;
/*
Copyright 2012 Aphid Mobile
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.
*/
import android.graphics.Bitmap;
import android.view.View;
import com.example.nationstyle.TextureUtils;
import com.example.nationstyle.UI;
import java.lang.ref.WeakReference;
import javax.microedition.khronos.opengles.GL10;
import static com.example.nationstyle.FlipRenderer.checkError;
public class ViewDualCards {
private int index = -1;
private WeakReference<View> viewRef;
private Texture texture;
private Bitmap screenshot;
private Card topCard = new Card();
private Card bottomCard = new Card();
private boolean orientationVertical = true;
public ViewDualCards(boolean orientationVertical) {
topCard.setOrientation(orientationVertical);
bottomCard.setOrientation(orientationVertical);
this.orientationVertical = orientationVertical;
}
public int getIndex() {
return index;
}
public View getView() {
return viewRef != null ? viewRef.get() : null;
}
synchronized void resetWithIndex(int index) {
this.index = index;
viewRef = null;
recycleScreenshot();
recycleTexture();
}
synchronized boolean loadView(int index, View view, Bitmap.Config format) {
UI.assertInMainThread();
if (this.index == index && getView() == view
&& (screenshot != null || TextureUtils.isValidTexture(texture))) {
return false;
}
this.index = index;
viewRef = null;
recycleTexture();
if (view != null) {
viewRef = new WeakReference<View>(view);
recycleScreenshot();
screenshot = GrabIt.takeScreenshot(view, format);
} else {
recycleScreenshot();
}
return true;
}
public Texture getTexture() {
return texture;
}
public Bitmap getScreenshot() {
return screenshot;
}
public Card getTopCard() {
return topCard;
}
public Card getBottomCard() {
return bottomCard;
}
public synchronized void buildTexture(FlipRenderer renderer, GL10 gl) {
if (screenshot != null) {
if (texture != null) {
texture.destroy(gl);
}
texture = Texture.createTexture(screenshot, renderer, gl);
recycleScreenshot();
topCard.setTexture(texture);
bottomCard.setTexture(texture);
final float viewHeight = texture.getContentHeight();
final float viewWidth = texture.getContentWidth();
final float textureHeight = texture.getHeight();
final float textureWidth = texture.getWidth();
if (orientationVertical) {
topCard.setCardVertices(new float[] { 0f, viewHeight, 0f, // top
// left
0f, viewHeight / 2.0f, 0f, // bottom left
viewWidth, viewHeight / 2f, 0f, // bottom right
viewWidth, viewHeight, 0f // top right
});
topCard.setTextureCoordinates(new float[] { 0f, 0f, 0f,
viewHeight / 2f / textureHeight,
viewWidth / textureWidth,
viewHeight / 2f / textureHeight,
viewWidth / textureWidth, 0f });
bottomCard.setCardVertices(new float[] { 0f, viewHeight / 2f,
0f, // top left
0f, 0f, 0f, // bottom left
viewWidth, 0f, 0f, // bottom right
viewWidth, viewHeight / 2f, 0f // top right
});
bottomCard.setTextureCoordinates(new float[] { 0f,
viewHeight / 2f / textureHeight, 0f,
viewHeight / textureHeight, viewWidth / textureWidth,
viewHeight / textureHeight, viewWidth / textureWidth,
viewHeight / 2f / textureHeight });
} else {
topCard.setCardVertices(new float[] { 0f, viewHeight, 0f, // top
// left
0f, 0f, 0f, // bottom left
viewWidth / 2f, 0f, 0f, // bottom right
viewWidth / 2f, viewHeight, 0f // top right
});
topCard.setTextureCoordinates(new float[] { 0f, 0f, 0f,
viewHeight / textureHeight,
viewWidth / 2f / textureWidth,
viewHeight / textureHeight,
viewWidth / 2f / textureWidth, 0f });
bottomCard.setCardVertices(new float[] { viewWidth / 2f,
viewHeight, 0f, // top left
viewWidth / 2f, 0f, 0f, // bottom left
viewWidth, 0f, 0f, // bottom right
viewWidth, viewHeight, 0f // top right
});
bottomCard.setTextureCoordinates(new float[] {
viewWidth / 2f / textureWidth, 0f,
viewWidth / 2f / textureWidth,
viewHeight / textureHeight, viewWidth / textureWidth,
viewHeight / textureHeight, viewWidth / textureWidth,
0f });
}
checkError(gl);
}
}
public synchronized void abandonTexture() {
texture = null;
}
@Override
public String toString() {
return "ViewDualCards: (" + index + ", view: " + getView() + ")";
}
private void recycleScreenshot() {
UI.recycleBitmap(screenshot);
screenshot = null;
}
private void recycleTexture() {
if (texture != null) {
texture.postDestroy();
texture = null;
}
}
}
|
[
"you@example.com"
] |
you@example.com
|
b88d08b4bb7e6dc89c23a565bd7a8a6e33c92068
|
f567f3e0c50cc174d2ed3c48066d23867b19d3b6
|
/app/src/main/java/com/example/sid_fu/blecentral/utils/BitmapUtils.java
|
a8ea4de30b70e922e7d40082c194b0e22723eaab
|
[] |
no_license
|
zhoumcu/BleCentral
|
e5f0e127f318470d4d8da661b7a4660b095d9daf
|
161e9e5754129b59e21f58d3e4770173dee37ec7
|
refs/heads/master
| 2021-01-20T20:28:49.079227
| 2016-08-23T09:42:53
| 2016-08-23T09:42:53
| 65,785,591
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 4,023
|
java
|
package com.example.sid_fu.blecentral.utils;
import android.content.Context;
import android.content.res.AssetManager;
import android.graphics.Bitmap;
import android.graphics.BitmapFactory;
import android.graphics.drawable.BitmapDrawable;
import android.graphics.drawable.Drawable;
import android.widget.ImageView;
import java.io.BufferedInputStream;
import java.io.BufferedOutputStream;
import java.io.ByteArrayOutputStream;
import java.io.File;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.net.URL;
/**
* Created by Administrator on 2016/7/1.
*/
public class BitmapUtils {
/**
* 从Assets中读取图片
*/
public static Bitmap getImageFromAssetsFile(Context mContext, String fileName)
{
Bitmap image = null;
AssetManager am = mContext.getResources().getAssets();
try
{
InputStream is = am.open(fileName);
image = BitmapFactory.decodeStream(is);
is.close();
}
catch (IOException e)
{
e.printStackTrace();
}
return image;
}
/**
* 从sd卡中读取图片
* @param pathString
* @return
*/
public static Bitmap getDiskBitmap(String pathString)
{
Logger.e(pathString);
Bitmap bitmap = null;
try
{
File file = new File(pathString);
if(file.exists())
{
bitmap = BitmapFactory.decodeFile(pathString);
}
} catch (Exception e)
{
// TODO: handle exception
}
return bitmap;
}
/**
* 得到本地或者网络上的bitmap url - 网络或者本地图片的绝对路径,比如:
*
* A.网络路径: url="http://blog.foreverlove.us/girl2.png" ;
*
* B.本地路径:url="file://mnt/sdcard/photo/image.png";
*
* C.支持的图片格式 ,png, jpg,bmp,gif等等
*
* @param url
* @return
*/
public static Bitmap GetLocalOrNetBitmap(String url)
{
Bitmap bitmap = null;
InputStream in = null;
BufferedOutputStream out = null;
try
{
in = new BufferedInputStream(new URL(url).openStream(), 1024);
final ByteArrayOutputStream dataStream = new ByteArrayOutputStream();
out = new BufferedOutputStream(dataStream,1024);
copy(in, out);
out.flush();
byte[] data = dataStream.toByteArray();
bitmap = BitmapFactory.decodeByteArray(data, 0, data.length);
data = null;
return bitmap;
}
catch (IOException e)
{
e.printStackTrace();
return null;
}
}
private static void copy(InputStream in, OutputStream out)
throws IOException {
byte[] b = new byte[1024];
int read;
while ((read = in.read(b)) != -1) {
out.write(b, 0, read);
}
}
/**
* 以最省内存的方式读取本地资源的图片
*@param resId
* @return
*/
public static Bitmap readBitMap(Context context,int resId){
BitmapFactory.Options opt = new BitmapFactory.Options();
opt.inPreferredConfig = Bitmap.Config.RGB_565;
opt.inPurgeable = true;
opt.inInputShareable = true;
//获取资源图片
InputStream is = context.getResources().openRawResource(resId);
return BitmapFactory.decodeStream(is,null,opt);
}
public static void releaseImageViewResouce(ImageView imageView) {
if (imageView == null) return;
Drawable drawable = imageView.getDrawable();
if (drawable != null && drawable instanceof BitmapDrawable) {
BitmapDrawable bitmapDrawable = (BitmapDrawable) drawable;
Bitmap bitmap = bitmapDrawable.getBitmap();
if (bitmap != null && !bitmap.isRecycled()) {
bitmap.recycle();
}
}
}
}
|
[
"1032324589@qq.com"
] |
1032324589@qq.com
|
f6dec974839fd4ef0537b592d87724cb15cc5181
|
97386b00aa112044a46b55db632c6be1195ed79d
|
/src/main/java/com/adpf/PageDemo/entity/monitoringTrack.java
|
18af14b155dcd6533d9e891d904bebdf141a347b
|
[] |
no_license
|
mayongcan/adpf
|
8f1a036c05afdb8978730eebaa5860b5bc56219e
|
69d3be034e4270501f56da5a3ac3a82825c4aac9
|
refs/heads/master
| 2022-07-09T21:57:35.733201
| 2020-01-20T07:04:48
| 2020-01-20T07:04:48
| 255,856,674
| 0
| 0
| null | 2022-06-29T18:04:31
| 2020-04-15T08:43:22
|
Java
|
UTF-8
|
Java
| false
| false
| 1,367
|
java
|
/*
* Copyright(c) 2018 gimplatform(通用信息管理平台) All rights reserved.
*/
package com.adpf.PageDemo.entity;
import java.io.Serializable;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.Table;
import javax.persistence.TableGenerator;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
/**
* MonitoringData数据库映射实体类
* @version 1.0
* @author
*/
@Data
@NoArgsConstructor
@AllArgsConstructor
@Entity
@Table(name = "monitoring_track")
public class monitoringTrack implements Serializable {
private static final long serialVersionUID = 1L;
// 标识
@Id
@GeneratedValue(strategy = GenerationType.TABLE, generator = "monitoringTrackIdGenerator")
@TableGenerator(name = "monitoringTrackIdGenerator", table = "sys_tb_generator", pkColumnName = "GEN_NAME", valueColumnName = "GEN_VALUE", pkColumnValue = "MONITORING_TRACK_PK", allocationSize = 1)
@Column(name = "id", unique = true, nullable = false, precision = 10, scale = 0)
private Long id;
@Column(name = "device_code", length = 50)
private String deviceCode;
@Column(name = "tv_number", length = 250)
private String tvNumber;
}
|
[
"1571638094@qq.com"
] |
1571638094@qq.com
|
df208ebfbed296488bc1e966d92f8f5eb37bc8ae
|
455da884cdbaa9c09f5b9d6a7a010a6611415bba
|
/java/com/zd/vpn/checker/CheckTerminalStatusPost.java
|
16a4d6ff5c9b8fee650c5c5485407c9390b54a96
|
[] |
no_license
|
zhanght86/ics-sslvpn-android-sm2
|
51480ca4878966ae7cd60e2cf2f0ca576eaf51ab
|
611a581b86a24d1f4b97f09f4054fcbdb1198bce
|
refs/heads/master
| 2021-06-13T08:24:31.586688
| 2017-03-20T02:47:07
| 2017-03-20T02:47:07
| null | 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 7,703
|
java
|
package com.zd.vpn.checker;
import android.content.Context;
import android.os.Handler;
import android.util.Log;
import com.zd.vpn.util.ReturnObject;
import org.apache.commons.httpclient.HttpClient;
import org.apache.commons.httpclient.methods.PostMethod;
import org.apache.commons.httpclient.params.HttpMethodParams;
import org.json.JSONException;
import org.json.JSONObject;
import java.io.IOException;
/**
* 三码接口绑定提交接口
* <p/>
* Created by yf on 2014-12-26.
*/
public class CheckTerminalStatusPost {
private Handler handler;
private String ip;
private String port;
private String imei;
private String sim;
private String sn;
private Context context;
public CheckTerminalStatusPost(Context context, String ip, String port, String imei, String sim, String sn) {
handler = new Handler(context.getMainLooper());
this.context = context;
this.ip = ip;
this.port = port;
this.imei = imei;
this.sim = sim;
this.sn = sn;
}
public CheckTerminalStatusPost() {
}
public interface OnThreeYardsPostListener {
public void onThreeYardsPostOk(String msg);
public void onThreeYardsPostErr(String msg);
}
public void postData( final OnThreeYardsPostListener listener) {
new Thread(new Runnable() {
@Override
public void run() {
String[][] params = new String[][]{
{"serial", sn},
{"simId", sim},
{"terminalId", imei}
};
String pathUrl = "http://" + ip + ":" + port + PropertiesUtils.CHECK_TERMINAL;
HttpClient client = new HttpClient();
client.getHttpConnectionManager().getParams().setConnectionTimeout(1 * 1000 * 60);
client.getHttpConnectionManager().getParams().setSoTimeout(1 * 1000 * 60);
PostMethod post = new PostMethod(pathUrl);
post.getParams().setParameter(HttpMethodParams.SO_TIMEOUT, 1 * 1000 * 60);
post.addRequestHeader("Content-Type", "application/x-www-form-urlencoded;charset=utf-8");
for (String[] param : params) {
post.addParameter(param[0], param[1]);
}
int statusCode = 0;
try {
statusCode = client.executeMethod(post);
} catch (IOException e) {
e.printStackTrace();
}
if (statusCode == 200) {
//取出回应字串
String data = null;
try {
byte[] bytes = post.getResponseBody();
if(bytes!=null&&bytes.length>0)
data = new String(bytes, "utf-8");
} catch (IOException e) {
e.printStackTrace();
}
boolean flag = false;
String msg = "";
try {
JSONObject result = new JSONObject(data);//转换为JSONObject
flag = result.getBoolean("success");
msg = result.getString("msg");
} catch (JSONException e) {
e.printStackTrace();
}
if (flag) {
final String finalCode = msg;
handler.post(new Runnable() {
@Override
public void run() {
listener.onThreeYardsPostOk(finalCode);
}
});
} else {
if (!"".equals(msg) && msg != null) {
final String finalData = msg;
handler.post(new Runnable() {
@Override
public void run() {
listener.onThreeYardsPostErr(finalData);
}
});
} else {
handler.post(new Runnable() {
@Override
public void run() {
String msg = "客户端绑定信息校验失败";
listener.onThreeYardsPostErr(msg);
}
});
}
}
} else {
Log.v("vpn", "Error Response" + statusCode);
handler.post(new Runnable() {
@Override
public void run() {
String msg = "客户端绑定信息校验失败";
listener.onThreeYardsPostErr(String.valueOf(msg));
}
});
}
}
}).start();
}
public ReturnObject postData() {
String[][] params = new String[][]{
{"serial", sn},
{"simId", sim},
{"terminalId", imei}
};
String pathUrl = "http://" + ip + ":" + port + PropertiesUtils.CHECK_TERMINAL;
HttpClient client = new HttpClient();
client.getHttpConnectionManager().getParams().setConnectionTimeout(1 * 1000 * 60);
client.getHttpConnectionManager().getParams().setSoTimeout(1 * 1000 * 60);
PostMethod post = new PostMethod(pathUrl);
post.getParams().setParameter(HttpMethodParams.SO_TIMEOUT, 1 * 1000 * 60);
post.addRequestHeader("Content-Type", "application/x-www-form-urlencoded;charset=utf-8");
for (String[] param : params) {
post.addParameter(param[0], param[1]);
}
int statusCode = 0;
try {
statusCode = client.executeMethod(post);
} catch (IOException e) {
e.printStackTrace();
}
if (statusCode == 200) {
//取出回应字串
String data = null;
try {
byte[] bytes = post.getResponseBody();
if(bytes!=null&&bytes.length>0)
data = new String(bytes, "utf-8");
} catch (IOException e) {
e.printStackTrace();
}
boolean flag = false;
String msg = "";
try {
JSONObject result = new JSONObject(data);//转换为JSONObject
flag = result.getBoolean("success");
msg = result.getString("msg");
} catch (JSONException e) {
e.printStackTrace();
}
if (flag) {
return new ReturnObject(true, msg);
} else {
if (!"".equals(msg) && msg != null) {
return new ReturnObject(false, msg);
} else {
return new ReturnObject(false, "客户端绑定信息校验失败");
}
}
} else {
Log.v("vpn", "Error Response" + statusCode);
return new ReturnObject(false, "客户端绑定信息校验失败");
}
}
}
|
[
"465805947@QQ.com"
] |
465805947@QQ.com
|
443a5bfc3577365609b368360ce5dd3fd1cc0e16
|
482c9f4123a19e8164203edd92fc32033b78e17b
|
/MGB code/WestLB_RMSC_MGB/Java Source/de/westlb/mgb/client/mask/model/shared/NewInstrumentInfoModel.java
|
579f0f5ff33fff7ab33e649b80f499799fe97d5e
|
[] |
no_license
|
Dilip96407/Dilip
|
54b405f29dd4f78fc653202e9c709cc96c1ac72a
|
feb245229e90195776b0113bc62ed5da2422d321
|
refs/heads/master
| 2022-12-22T13:27:19.320244
| 2019-11-13T09:37:12
| 2019-11-13T09:37:12
| 218,457,904
| 0
| 0
| null | 2022-12-14T05:26:38
| 2019-10-30T06:27:45
|
HTML
|
UTF-8
|
Java
| false
| false
| 2,207
|
java
|
package de.westlb.mgb.client.mask.model.shared;
import java.rmi.RemoteException;
import de.westlb.mgb.client.server.MgbServiceFactory;
import de.westlb.mgb.client.server.vo.InstrumentSearchResultEntryVo;
import de.westlb.mgb.client.ui.tablemodel.TableModel;
import de.westlb.mgb.client.ui.tablemodel.TableModelFactory;
import de.westlb_systems.xaf.swing.SDataModel;
/**
* Gui model for the dialog which informs about new instruments.
*
* @author Manfred Boerner
*/
public class NewInstrumentInfoModel extends AbstractModel {
public static final String P_TABLE_MODEL = "TableModel";
private TableModel instrumentTableModel = null;
private InstrumentSearchResultEntryVo[] searchResult;
/** Definition of all properties provided by the model to the view */
private final String[] propertyNames = new String[] {
P_TABLE_MODEL,
};
/**
* Default constructor to create an empty model
*/
public NewInstrumentInfoModel() {
setPropertyNames(propertyNames);
fillModel();
}
public Long getInstrumentId(int row) {
if (searchResult == null || row >= searchResult.length) {
return null;
}
return searchResult[row].getId();
}
/**
* Return the table model of the new instruments.
*/
public SDataModel getDataModel() {
// This method is used to check if the mask is to be displayed, so initialize
// the model if it has not already been done.
if (instrumentTableModel == null) {
fillModel();
}
return instrumentTableModel;
}
/**
* Fills the model from the business model.
*/
private void fillModel() {
searchResult = new InstrumentSearchResultEntryVo[0];
try {
searchResult = MgbServiceFactory.getService().findNewInstruments();
if (searchResult.length > 0) {
instrumentTableModel = TableModelFactory.createTableModel("InstrumentTable", searchResult);
setProperty(P_TABLE_MODEL, instrumentTableModel);
}
} catch (RemoteException e) {
handleRemoteException(e);
}
}
@Override
public void reload() {
fillModel();
}
public int getSize() {
return searchResult == null ? 0 : searchResult.length;
}
}
|
[
"dgagre15@in.ibm.com"
] |
dgagre15@in.ibm.com
|
1921467054051f537d49db7336538544de4f95bb
|
37183c5b978cc28004514542b622e3e90be58a95
|
/Items/ItemSlide.java
|
ccef7fe5ffd239033c96e32149bd35ce2b19aa33
|
[] |
no_license
|
ruki260/RotaryCraft
|
4ae81ce65396965fbab641f054d2f275fb1f0e68
|
9fa1cbd03bbe2a0793d8a28d8d41de77b1b16fb4
|
refs/heads/master
| 2021-01-22T01:50:55.229160
| 2013-11-16T07:07:01
| 2013-11-16T07:07:01
| null | 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 1,300
|
java
|
/*******************************************************************************
* @author Reika Kalseki
*
* Copyright 2013
*
* All rights reserved.
* Distribution of the software in any form is only allowed with
* explicit, prior permission from the owner.
******************************************************************************/
package Reika.RotaryCraft.Items;
import java.util.List;
import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.item.ItemStack;
import Reika.RotaryCraft.RotaryCraft;
import Reika.RotaryCraft.Base.ItemBasic;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
public class ItemSlide extends ItemBasic {
public ItemSlide(int ID, int index) {
super(ID, index);
maxStackSize = 1;
hasSubtypes = true;
this.setCreativeTab(RotaryCraft.tabRotaryItems);
this.setIndex(index);
}
@Override
@SideOnly(Side.CLIENT)
public void getSubItems(int par1, CreativeTabs par2CreativeTabs, List par3List) //Adds the metadata blocks to the creative inventory
{
for (int i = 0; i < 24; i++) {
ItemStack item = new ItemStack(par1, 1, i);
par3List.add(item);
}
}
@Override
public String getUnlocalizedName(ItemStack is)
{
int d = is.getItemDamage();
return super.getUnlocalizedName() + "." + d;
}
}
|
[
"reikasminecraft@gmail.com"
] |
reikasminecraft@gmail.com
|
019e2f83426ecbf6b3221a9fcda305d9d2e02e6a
|
8f4ac74a4a678c460d3be4c41c670e96cd0b8e65
|
/src/main/java/com/shevtsou/system/service/impl/CountryServiceImpl.java
|
cbb19875a4855eae3c630600f66fc0d642cdd0ca
|
[] |
no_license
|
shevtsou/system-projects-3
|
6dca8da09140e3258ade21210b8706a4f2f8a9b9
|
3d83d8f1113162d5ff96477fac446506280406fe
|
refs/heads/master
| 2020-05-02T20:44:59.374602
| 2019-03-28T12:45:49
| 2019-03-28T12:45:49
| 178,200,722
| 0
| 0
| null | 2019-03-28T12:45:50
| 2019-03-28T12:38:39
|
Java
|
UTF-8
|
Java
| false
| false
| 1,822
|
java
|
package com.shevtsou.system.service.impl;
import com.shevtsou.system.service.CountryService;
import com.shevtsou.system.domain.Country;
import com.shevtsou.system.repository.CountryRepository;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Service;
import java.util.List;
import java.util.Optional;
/**
* Service Implementation for managing Country.
*/
@Service
public class CountryServiceImpl implements CountryService {
private final Logger log = LoggerFactory.getLogger(CountryServiceImpl.class);
private final CountryRepository countryRepository;
public CountryServiceImpl(CountryRepository countryRepository) {
this.countryRepository = countryRepository;
}
/**
* Save a country.
*
* @param country the entity to save
* @return the persisted entity
*/
@Override
public Country save(Country country) {
log.debug("Request to save Country : {}", country);
return countryRepository.save(country);
}
/**
* Get all the countries.
*
* @return the list of entities
*/
@Override
public List<Country> findAll() {
log.debug("Request to get all Countries");
return countryRepository.findAll();
}
/**
* Get one country by id.
*
* @param id the id of the entity
* @return the entity
*/
@Override
public Optional<Country> findOne(String id) {
log.debug("Request to get Country : {}", id);
return countryRepository.findById(id);
}
/**
* Delete the country by id.
*
* @param id the id of the entity
*/
@Override
public void delete(String id) {
log.debug("Request to delete Country : {}", id);
countryRepository.deleteById(id);
}
}
|
[
"jhipster-bot@jhipster.tech"
] |
jhipster-bot@jhipster.tech
|
874ef5bb6e04a07bad8605456538dd4666958d6c
|
b66bdee811ed0eaea0b221fea851f59dd41e66ec
|
/src/com/grubhub/AppBaseLibrary/android/order/cart/GHSCartFragment$4.java
|
ba4a3ca37db7b33c2882a0bb46ade4161de4fdd5
|
[] |
no_license
|
reverseengineeringer/com.grubhub.android
|
3006a82613df5f0183e28c5e599ae5119f99d8da
|
5f035a4c036c9793483d0f2350aec2997989f0bb
|
refs/heads/master
| 2021-01-10T05:08:31.437366
| 2016-03-19T20:41:23
| 2016-03-19T20:41:23
| 54,286,207
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 645
|
java
|
package com.grubhub.AppBaseLibrary.android.order.cart;
import android.support.v4.app.q;
import com.grubhub.AppBaseLibrary.android.GHSBaseActivity;
import com.grubhub.AppBaseLibrary.android.dataServices.a.i;
class GHSCartFragment$4
implements i
{
GHSCartFragment$4(GHSCartFragment paramGHSCartFragment) {}
public void a()
{
GHSCartFragment.d(a, false);
q localq = a.getActivity();
if (localq != null) {
((GHSBaseActivity)localq).a(true);
}
}
}
/* Location:
* Qualified Name: com.grubhub.AppBaseLibrary.android.order.cart.GHSCartFragment.4
* Java Class Version: 6 (50.0)
* JD-Core Version: 0.7.1
*/
|
[
"reverseengineeringer@hackeradmin.com"
] |
reverseengineeringer@hackeradmin.com
|
6c28e48ddaa7ccef544e52af7d95b76aa59eed48
|
2ba768606b826e66abc77c438b0bfeadf730e002
|
/org.xtext.example.fml.parent/org.xtext.example.fml.idea/src-gen/org/xtext/example/mydsl/idea/AbstractFmlIdeaModule.java
|
f08427718b9b989982ce912a8d655c568da527e6
|
[] |
no_license
|
FAMILIAR-project/familiar-language
|
f700e7794543bc5db407b02b7187a9d4223af649
|
6a5804ea1c98d199bc4e88c8d7c2c1b352a715d8
|
refs/heads/master
| 2023-05-23T08:50:42.610348
| 2021-10-19T12:12:39
| 2021-10-19T12:12:39
| 8,090,870
| 3
| 3
| null | 2020-10-13T07:21:02
| 2013-02-08T09:36:18
|
Java
|
UTF-8
|
Java
| false
| false
| 3,929
|
java
|
/*
* generated by Xtext 2.9.1
*/
package org.xtext.example.mydsl.idea;
import com.google.inject.Binder;
import com.google.inject.name.Names;
import com.intellij.facet.FacetTypeId;
import com.intellij.lang.ParserDefinition;
import com.intellij.lang.PsiParser;
import org.eclipse.xtext.ide.LexerIdeBindings;
import org.eclipse.xtext.ide.editor.contentassist.antlr.IContentAssistParser;
import org.eclipse.xtext.idea.DefaultIdeaModule;
import org.eclipse.xtext.idea.facet.AbstractFacetConfiguration;
import org.eclipse.xtext.idea.lang.IElementTypeProvider;
import org.eclipse.xtext.idea.parser.TokenTypeProvider;
import org.eclipse.xtext.parser.antlr.IAntlrTokenFileProvider;
import org.eclipse.xtext.parser.antlr.Lexer;
import org.eclipse.xtext.parser.antlr.LexerBindings;
import org.eclipse.xtext.service.SingletonBinding;
import org.xtext.example.mydsl.ide.contentassist.antlr.FmlParser;
import org.xtext.example.mydsl.ide.contentassist.antlr.internal.InternalFmlLexer;
import org.xtext.example.mydsl.idea.facet.FmlFacetConfiguration;
import org.xtext.example.mydsl.idea.facet.FmlFacetType;
import org.xtext.example.mydsl.idea.lang.FmlElementTypeProvider;
import org.xtext.example.mydsl.idea.lang.parser.FmlParserDefinition;
import org.xtext.example.mydsl.idea.lang.parser.FmlPsiParser;
import org.xtext.example.mydsl.idea.lang.parser.FmlTokenTypeProvider;
import org.xtext.example.mydsl.idea.lang.parser.antlr.FmlAntlrTokenFileProvider;
import org.xtext.example.mydsl.idea.parser.antlr.internal.PsiInternalFmlLexer;
/**
* Manual modifications go to {@link FmlIdeaModule}.
*/
@SuppressWarnings("all")
public abstract class AbstractFmlIdeaModule extends DefaultIdeaModule {
// contributed by org.eclipse.xtext.xtext.generator.idea.IdeaPluginGenerator
public Class<? extends IAntlrTokenFileProvider> bindIAntlrTokenFileProvider() {
return FmlAntlrTokenFileProvider.class;
}
// contributed by org.eclipse.xtext.xtext.generator.idea.IdeaPluginGenerator
public Class<? extends Lexer> bindLexer() {
return PsiInternalFmlLexer.class;
}
// contributed by org.eclipse.xtext.xtext.generator.idea.IdeaPluginGenerator
public void configureRuntimeLexer(Binder binder) {
binder.bind(Lexer.class)
.annotatedWith(Names.named(LexerBindings.RUNTIME))
.to(PsiInternalFmlLexer.class);
}
// contributed by org.eclipse.xtext.xtext.generator.idea.IdeaPluginGenerator
public Class<? extends PsiParser> bindPsiParser() {
return FmlPsiParser.class;
}
// contributed by org.eclipse.xtext.xtext.generator.idea.IdeaPluginGenerator
public Class<? extends TokenTypeProvider> bindTokenTypeProvider() {
return FmlTokenTypeProvider.class;
}
// contributed by org.eclipse.xtext.xtext.generator.idea.IdeaPluginGenerator
public Class<? extends ParserDefinition> bindParserDefinition() {
return FmlParserDefinition.class;
}
// contributed by org.eclipse.xtext.xtext.generator.idea.IdeaPluginGenerator
@SingletonBinding
public Class<? extends IElementTypeProvider> bindIElementTypeProvider() {
return FmlElementTypeProvider.class;
}
// contributed by org.eclipse.xtext.xtext.generator.idea.IdeaPluginGenerator
public Class<? extends AbstractFacetConfiguration> bindAbstractFacetConfiguration() {
return FmlFacetConfiguration.class;
}
// contributed by org.eclipse.xtext.xtext.generator.idea.IdeaPluginGenerator
public FacetTypeId bindFacetTypeIdToInstance() {
return FmlFacetType.TYPEID;
}
// contributed by org.eclipse.xtext.xtext.generator.idea.IdeaPluginGenerator
public Class<? extends IContentAssistParser> bindIContentAssistParser() {
return FmlParser.class;
}
// contributed by org.eclipse.xtext.xtext.generator.idea.IdeaPluginGenerator
public void configureContentAssistLexer(Binder binder) {
binder.bind(org.eclipse.xtext.ide.editor.contentassist.antlr.internal.Lexer.class).annotatedWith(Names.named(LexerIdeBindings.CONTENT_ASSIST)).to(InternalFmlLexer.class);
}
}
|
[
"mathieu.acher@irisa.fr"
] |
mathieu.acher@irisa.fr
|
e1a99dc4c3fae0e8254d65aeca7f2a33a00df17f
|
269bce0bf0e23f5e5f7b5d31167c8a804b62ae52
|
/comparator-tools/modagame/MODAGAME_hppc_0.6.1/src.main.java/com/carrotsearch/hppc/CharIndexedContainer.java
|
3e9b8c01d15180dea49e5d2c1ec5568f0dd85d95
|
[] |
no_license
|
acapulco-spl/acapulco_replication_package
|
5c4378b7662d6aa10f11f52a9fa8793107b34d6d
|
7de4d9a96c11977f0cd73d761a4f8af1e0e064e0
|
refs/heads/master
| 2023-04-15T17:40:14.003166
| 2022-04-13T08:37:11
| 2022-04-13T08:37:11
| 306,005,002
| 3
| 1
| null | 2022-04-11T17:35:06
| 2020-10-21T11:39:59
|
Java
|
UTF-8
|
Java
| false
| false
| 3,805
|
java
|
package com.carrotsearch.hppc;
import java.util.List;
import java.util.RandomAccess;
/**
* An indexed container provides random access to elements based on an
* <code>index</code>. Indexes are zero-based.
*/
@javax.annotation.Generated(date = "2014-09-08T10:42:29+0200", value = "HPPC generated from: CharIndexedContainer.java")
public interface CharIndexedContainer extends CharCollection, RandomAccess
{
/**
* Removes the first element that equals <code>e1</code>, returning its
* deleted position or <code>-1</code> if the element was not found.
*/
public int removeFirstOccurrence(char e1);
/**
* Removes the last element that equals <code>e1</code>, returning its
* deleted position or <code>-1</code> if the element was not found.
*/
public int removeLastOccurrence(char e1);
/**
* Returns the index of the first occurrence of the specified element in this list,
* or -1 if this list does not contain the element.
*/
public int indexOf(char e1);
/**
* Returns the index of the last occurrence of the specified element in this list,
* or -1 if this list does not contain the element.
*/
public int lastIndexOf(char e1);
/**
* Adds an element to the end of this container (the last index is incremented by one).
*/
public void add(char e1);
/**
* Inserts the specified element at the specified position in this list.
*
* @param index The index at which the element should be inserted, shifting
* any existing and subsequent elements to the right.
*/
public void insert(int index, char e1);
/**
* Replaces the element at the specified position in this list
* with the specified element.
*
* @return Returns the previous value in the list.
*/
public char set(int index, char e1);
/**
* @return Returns the element at index <code>index</code> from the list.
*/
public char get(int index);
/**
* Removes the element at the specified position in this list and returns it.
*
* <p><b>Careful.</b> Do not confuse this method with the overridden signature in
* Java Collections ({@link List#remove(Object)}). Use: {@link #removeAll},
* {@link #removeFirstOccurrence} or {@link #removeLastOccurrence} depending
* on the actual need.</p>
*/
public char remove(int index);
/**
* Removes from this list all of the elements whose index is between
* <code>fromIndex</code>, inclusive, and <code>toIndex</code>, exclusive.
*/
public void removeRange(int fromIndex, int toIndex);
/**
* Compares the specified object with this container for equality. Returns
* <tt>true</tt> if and only if the specified object is also a
* {@link CharIndexedContainer}, both have the same size, and all corresponding
* pairs of elements at the same index are <i>equal</i>. In other words, two indexed
* containers are defined to be equal if they contain the same elements in the same
* order.
* <p>
* Note that, unlike in {@link List}, containers may be of different types and still
* return <code>true</code> from {@link #equals}. This may be dangerous if you use
* different hash functions in two containers, but don't override the default
* implementation of {@link #equals}. It is the programmer's responsibility to
* enforcing these contracts properly.
* </p>
*/
public boolean equals(Object obj);
/**
* @return A hash code of elements stored in the container. The hash code
* is defined identically to {@link List#hashCode()} (should be implemented
* with the same algorithm).
*/
public int hashCode();
}
|
[
"daniel_str@gmx.de"
] |
daniel_str@gmx.de
|
a388d528e961ee674bea1f7fabccbc63bb0afa50
|
829cb3e438f4b7a5c7e6649bab30a40df115d267
|
/cmon-app-portlet/docroot/WEB-INF/service/org/oep/cmon/dao/report/model/Role2TTHCModel.java
|
5d291b2d5188d693ab04d0f20b3ec6a8ebbdbcc1
|
[
"Apache-2.0"
] |
permissive
|
doep-manual/CMON-App
|
643bc726ca55a268fb7e44e80b181642224b2b67
|
17007602673b0ecffbf844ad78a276d953e791a7
|
refs/heads/master
| 2020-12-29T00:29:01.395897
| 2015-06-29T08:00:58
| 2015-06-29T08:00:58
| 38,224,623
| 0
| 0
| null | 2015-06-29T02:56:41
| 2015-06-29T02:56:41
| null |
UTF-8
|
Java
| false
| false
| 4,293
|
java
|
/**
* Copyright (c) 2000-2011 Liferay, Inc. All rights reserved.
*
* This library is free software; you can redistribute it and/or modify it under
* the terms of the GNU Lesser General Public License as published by the Free
* Software Foundation; either version 2.1 of the License, or (at your option)
* any later version.
*
* This library is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
* FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
* details.
*/
package org.oep.cmon.dao.report.model;
import com.liferay.portal.model.BaseModel;
import com.liferay.portal.model.CacheModel;
import com.liferay.portal.service.ServiceContext;
import com.liferay.portlet.expando.model.ExpandoBridge;
import java.io.Serializable;
/**
* The base model interface for the Role2TTHC service. Represents a row in the "CMON_RPROLE2THUTUCHANHCHINH" database table, with each column mapped to a property of this class.
*
* <p>
* This interface and its corresponding implementation {@link org.oep.cmon.dao.report.model.impl.Role2TTHCModelImpl} exist only as a container for the default property accessors generated by ServiceBuilder. Helper methods and all application logic should be put in {@link org.oep.cmon.dao.report.model.impl.Role2TTHCImpl}.
* </p>
*
* @author VIENPN
* @see Role2TTHC
* @see org.oep.cmon.dao.report.model.impl.Role2TTHCImpl
* @see org.oep.cmon.dao.report.model.impl.Role2TTHCModelImpl
* @generated
*/
public interface Role2TTHCModel extends BaseModel<Role2TTHC> {
/*
* NOTE FOR DEVELOPERS:
*
* Never modify or reference this interface directly. All methods that expect a role2 t t h c model instance should use the {@link Role2TTHC} interface instead.
*/
/**
* Returns the primary key of this role2 t t h c.
*
* @return the primary key of this role2 t t h c
*/
public long getPrimaryKey();
/**
* Sets the primary key of this role2 t t h c.
*
* @param primaryKey the primary key of this role2 t t h c
*/
public void setPrimaryKey(long primaryKey);
/**
* Returns the i d of this role2 t t h c.
*
* @return the i d of this role2 t t h c
*/
public long getID();
/**
* Sets the i d of this role2 t t h c.
*
* @param ID the i d of this role2 t t h c
*/
public void setID(long ID);
/**
* Returns the r p d a n h m u c r o l e i d of this role2 t t h c.
*
* @return the r p d a n h m u c r o l e i d of this role2 t t h c
*/
public long getRPDANHMUCROLEID();
/**
* Sets the r p d a n h m u c r o l e i d of this role2 t t h c.
*
* @param RPDANHMUCROLEID the r p d a n h m u c r o l e i d of this role2 t t h c
*/
public void setRPDANHMUCROLEID(long RPDANHMUCROLEID);
/**
* Returns the r p d a n h m u c b a o c a o i d of this role2 t t h c.
*
* @return the r p d a n h m u c b a o c a o i d of this role2 t t h c
*/
public long getRPDANHMUCBAOCAOID();
/**
* Sets the r p d a n h m u c b a o c a o i d of this role2 t t h c.
*
* @param RPDANHMUCBAOCAOID the r p d a n h m u c b a o c a o i d of this role2 t t h c
*/
public void setRPDANHMUCBAOCAOID(long RPDANHMUCBAOCAOID);
/**
* Returns the t h u t u c h a n h c h i n h i d of this role2 t t h c.
*
* @return the t h u t u c h a n h c h i n h i d of this role2 t t h c
*/
public long getTHUTUCHANHCHINHID();
/**
* Sets the t h u t u c h a n h c h i n h i d of this role2 t t h c.
*
* @param THUTUCHANHCHINHID the t h u t u c h a n h c h i n h i d of this role2 t t h c
*/
public void setTHUTUCHANHCHINHID(long THUTUCHANHCHINHID);
public boolean isNew();
public void setNew(boolean n);
public boolean isCachedModel();
public void setCachedModel(boolean cachedModel);
public boolean isEscapedModel();
public Serializable getPrimaryKeyObj();
public void setPrimaryKeyObj(Serializable primaryKeyObj);
public ExpandoBridge getExpandoBridge();
public void setExpandoBridgeAttributes(ServiceContext serviceContext);
public Object clone();
public int compareTo(Role2TTHC role2TTHC);
public int hashCode();
public CacheModel<Role2TTHC> toCacheModel();
public Role2TTHC toEscapedModel();
public String toString();
public String toXmlString();
}
|
[
"giang@dtt.vn"
] |
giang@dtt.vn
|
93b3497a21c8345123be961fe15e30f84763cc47
|
55e396a43a0ac8e97d5140eb74c6b5293db99088
|
/factory-method/src/main/java/org/ko/factorymethod/FEVideoFactory.java
|
a1d5a8b88807ab301c836d90094c953e953f9aea
|
[] |
no_license
|
exmyth/design-pattern
|
c0a6b3ac894213999abc09cd0ed2ce2c143597fd
|
8628b943e22609e4e40a9dcf2748ac9783440686
|
refs/heads/master
| 2020-08-31T13:40:56.189977
| 2019-10-21T13:51:42
| 2019-10-21T13:51:42
| 218,702,595
| 0
| 1
| null | 2019-10-31T06:51:39
| 2019-10-31T06:51:37
| null |
UTF-8
|
Java
| false
| false
| 166
|
java
|
package org.ko.factorymethod;
public class FEVideoFactory extends VideoFactory {
@Override
public FEVideo getVideo() {
return new FEVideo();
}
}
|
[
"ko.shen@hotmail.com"
] |
ko.shen@hotmail.com
|
42efdea470ccc1bd7cf5a6218b30dcba14925749
|
c856326a42e5a46494f6f8e1199de214053ae8f8
|
/src/UpTo300/Problem280.java
|
d95bd692b397e5bf98aadb876a38343b868d871f
|
[] |
no_license
|
siyile/leetcode
|
548f3a3ad3cf2590bd271c0f2b5977287793f87c
|
8d2ec581f9966b0ca19eec20e86b77c39eb1e840
|
refs/heads/master
| 2021-06-16T21:30:46.303987
| 2021-02-19T03:50:35
| 2021-02-19T03:50:35
| 165,610,794
| 1
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 582
|
java
|
package UpTo300;
import java.util.Arrays;
public class Problem280 {
public void wiggleSort(int[] nums) {
for (int i = 1; i < nums.length; i++) {
if (i % 2 == 1) {
if (nums[i - 1] > nums[i]) {
swap(nums, i - 1, i);
}
} else {
if (nums[i] < nums[i]) {
swap(nums, i - 1, i);
}
}
}
}
private void swap(int[] nums, int i, int j) {
int tmp = nums[i];
nums[i] = nums[j];
nums[j] = tmp;
}
}
|
[
"seayahh@outlook.com"
] |
seayahh@outlook.com
|
d05ddcd0da6121ef064d41d9c448a47dc8367407
|
ebfcf186b788ec7502e1cc9bad5c08f4224b26e0
|
/releases/broadleaf/static/BroadleafCommerce-broadleaf-1.5.3-GA/admin/broadleaf-open-admin-platform/src/main/java/org/broadleafcommerce/openadmin/server/service/persistence/datasource/SandBoxDataSource.java
|
a87077198af7d5c0728907628519ac5f5da766d6
|
[] |
no_license
|
klagithub1/static_antipattern_analyzer
|
06eb3bf0b15faa392a7d815d928ac6d4b18afd20
|
a8764b307b6531b8ad715e8f621e1a5c8c6f951b
|
refs/heads/master
| 2023-01-13T21:13:36.703932
| 2017-05-07T06:03:07
| 2017-05-07T06:03:07
| 90,512,339
| 0
| 0
| null | 2023-01-02T21:53:08
| 2017-05-07T06:02:38
|
Java
|
UTF-8
|
Java
| false
| false
| 7,170
|
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 org.broadleafcommerce.openadmin.server.service.persistence.datasource;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.apache.commons.pool.PoolableObjectFactory;
import org.apache.commons.pool.impl.GenericObjectPool;
import org.hsqldb.Server;
import org.hsqldb.persist.HsqlProperties;
import org.hsqldb.server.ServerAcl.AclFormatException;
import javax.sql.DataSource;
import java.io.IOException;
import java.io.PrintWriter;
import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.SQLException;
import java.util.UUID;
public class SandBoxDataSource implements DataSource {
private static final Log LOG = LogFactory.getLog(SandBoxDataSource.class);
public static final String DRIVERNAME = "org.hsqldb.jdbcDriver";
public static final int DEFAULTPORT = 40025;
public static final String DEFAULTADDRESS = "localhost";
public static Server server;
protected PrintWriter logWriter;
protected int loginTimeout = 5;
protected GenericObjectPool sandboxDataBasePool;
protected int port = DEFAULTPORT;
protected String address = DEFAULTADDRESS;
protected String uuid;
public SandBoxDataSource() {
synchronized (this) {
if (server == null) {
try {
Class.forName(DRIVERNAME);
} catch (ClassNotFoundException e) {
throw new RuntimeException(e);
}
try {
HsqlProperties p = new HsqlProperties();
p.setProperty("server.remote_open",true);
server = new Server();
server.setAddress(address);
server.setPort(port);
server.setProperties(p);
server.setLogWriter(logWriter==null?new PrintWriter(System.out):logWriter);
server.setErrWriter(logWriter==null?new PrintWriter(System.out):logWriter);
server.start();
} catch (IOException e) {
throw new RuntimeException(e);
} catch (AclFormatException e) {
throw new RuntimeException(e);
}
}
}
uuid = UUID.randomUUID().toString();
sandboxDataBasePool = new GenericObjectPool(new PoolableSandBoxDataBaseFactory());
}
public void close() {
try {
sandboxDataBasePool.close();
} catch (Exception e) {
e.printStackTrace();
}
}
public int getPort() {
return port;
}
public void setPort(int port) {
this.port = port;
}
public String getAddress() {
return address;
}
public void setAddress(String address) {
this.address = address;
}
//GenericKeyedObjectPool methods
public void returnObject(Object obj) throws Exception {
sandboxDataBasePool.returnObject(obj);
}
public int getMaxActive() {
return sandboxDataBasePool.getMaxActive();
}
public void setMaxActive(int maxActive) {
sandboxDataBasePool.setMaxActive(maxActive);
}
public byte getWhenExhaustedAction() {
return sandboxDataBasePool.getWhenExhaustedAction();
}
public void setWhenExhaustedAction(byte whenExhaustedAction) {
sandboxDataBasePool.setWhenExhaustedAction(whenExhaustedAction);
}
public long getMaxWait() {
return sandboxDataBasePool.getMaxWait();
}
public void setMaxWait(long maxWait) {
sandboxDataBasePool.setMaxWait(maxWait);
}
public int getMaxIdle() {
return sandboxDataBasePool.getMaxIdle();
}
public void setMaxIdle(int maxIdle) {
sandboxDataBasePool.setMaxIdle(maxIdle);
}
public void setMinIdle(int poolSize) {
sandboxDataBasePool.setMinIdle(poolSize);
}
public int getMinIdle() {
return sandboxDataBasePool.getMinIdle();
}
public long getTimeBetweenEvictionRunsMillis() {
return sandboxDataBasePool.getTimeBetweenEvictionRunsMillis();
}
public void setTimeBetweenEvictionRunsMillis(
long timeBetweenEvictionRunsMillis) {
sandboxDataBasePool
.setTimeBetweenEvictionRunsMillis(timeBetweenEvictionRunsMillis);
}
public long getMinEvictableIdleTimeMillis() {
return sandboxDataBasePool.getMinEvictableIdleTimeMillis();
}
public void setMinEvictableIdleTimeMillis(long minEvictableIdleTimeMillis) {
sandboxDataBasePool
.setMinEvictableIdleTimeMillis(minEvictableIdleTimeMillis);
}
//DataSource methods
@Override
public PrintWriter getLogWriter() throws SQLException {
return logWriter;
}
@Override
public void setLogWriter(PrintWriter out) throws SQLException {
this.logWriter = out;
}
@Override
public void setLoginTimeout(int seconds) throws SQLException {
this.loginTimeout = seconds;
}
@Override
public int getLoginTimeout() throws SQLException {
return loginTimeout;
}
@Override
public <T> T unwrap(Class<T> iface) throws SQLException {
return null;
}
@Override
public boolean isWrapperFor(Class<?> iface) throws SQLException {
return false;
}
@Override
public Connection getConnection() throws SQLException {
try {
return (Connection) sandboxDataBasePool.borrowObject();
} catch (Exception e) {
throw new SQLException(e);
}
}
@Override
public Connection getConnection(String username, String password) throws SQLException {
throw new SQLException("Not Supported");
}
private class PoolableSandBoxDataBaseFactory implements PoolableObjectFactory {
@Override
public Object makeObject() throws Exception {
String jdbcUrl = getJDBCUrl();
Connection connection = DriverManager.getConnection(jdbcUrl, "SA", "");
SandBoxConnection blcConnection = new SandBoxConnection(connection, sandboxDataBasePool);
LOG.info("Opening sandbox connection at: " + jdbcUrl);
return blcConnection;
}
@Override
public void destroyObject(Object obj) throws Exception {
Connection c = (Connection) obj;
try {
c.prepareStatement("SHUTDOWN").execute();
} catch (Exception e) {
e.printStackTrace();
} finally {
LOG.info("Closing sandbox database at: " + getJDBCUrl());
}
}
@Override
public boolean validateObject(Object obj) {
//TODO add a generic connection validation
return true;
}
@Override
public void activateObject(Object obj) throws Exception {
//do nothing
}
@Override
public void passivateObject(Object obj) throws Exception {
//do nothing
}
}
public String getJDBCUrl() {
String jdbcUrl = "jdbc:hsqldb:hsql://localhost:40025/broadleaf_"+uuid+";mem:broadleaf_"+uuid;
return jdbcUrl;
}
}
|
[
"klajdi@live.ca"
] |
klajdi@live.ca
|
b185432b479802c0fc35721cd81267e9b80539e3
|
138c5dd54e57f498380c4c59e3ddabf939f1964a
|
/lcloud-reader/lcloud-lendbuy-service/src/main/java/com/szcti/lcloud/lendbuy/repository/LendBuyDao.java
|
f86365c2114220b2ea123b9f73d6c13c9676266a
|
[] |
no_license
|
JIANLAM/zt-project
|
4d249f4b504789395a335df21fcf1cf009e07d78
|
50318c9296485d3a97050e307b3a8ab3e12510e7
|
refs/heads/master
| 2020-03-31T12:40:36.269261
| 2018-10-09T09:42:36
| 2018-10-09T09:42:36
| 152,225,516
| 1
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 4,595
|
java
|
package com.szcti.lcloud.lendbuy.repository;
import com.szcti.lcloud.lendbuy.entity.vo.LendBuyBookVO;
import com.szcti.lcloud.lendbuy.entity.vo.LendBuyOrderVO;
import org.apache.ibatis.annotations.CacheNamespace;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import java.util.List;
/**
* @Title: 借购信息DAO
* @Description: 处理借购操作
* @author: fengda
* @date: 2018/5/16 8:43
*/
@Mapper
@CacheNamespace(implementation = com.szcti.lcloud.common.utils.RedisCache.class)
public interface LendBuyDao {
/**
* 根据条件查找用户的借购书籍信息
* @param lendBuyBookVO
* @return List<LendBuyBookVO>
*/
List<LendBuyBookVO> findBooksInOrder(LendBuyBookVO lendBuyBookVO);
/**
* 根据条件查找用户的购物书车
* @param lendBuyBookVO
* @return List<LendBuyBookVO>
*/
List<LendBuyBookVO> findBooks(LendBuyBookVO lendBuyBookVO);
/**
* 根据条件查找用户的借购订单信息
* @param lendBuyOrderVO
* @return List<LendBuyOrderVO>
*/
List<LendBuyOrderVO> findOrders(LendBuyOrderVO lendBuyOrderVO);
/**
* 更新订单状态
* @param lendBuyOrderId
* @param status
* @param staffId 操作员 为空则值不变
* @param sendTime 发货时间 为空则值不变
* @param takedTime 收货时间 为空则值不变
*/
void updateOrderStatus(@Param("lendBuyOrderId") Long lendBuyOrderId,
@Param("status") Integer status,
@Param("staffId") Long staffId,
@Param("sendTime") String sendTime,
@Param("takedTime") String takedTime);
/**
* 更新订单金额
* @param lendBuyOrderId
* @param totalMoney
*/
void updateTotalMoney(@Param("lendBuyOrderId") Long lendBuyOrderId,@Param("totalMoney") Float totalMoney);
/**
* 借购书车中的书籍加入但订单,或从订单张回到借购书车
* @param idArray
* @param isSubmit
* @param lendBuyOrderId
*/
void book2Order(@Param("idArray") Long[] idArray,@Param("isSubmit") Integer isSubmit,@Param("lendBuyOrderId") Long lendBuyOrderId);
/**
* 设置被成功借购的书籍的应还日期
* @param idArray
* @param dueBackTime
*/
void setDueBackTime(@Param("idArray") Long[] idArray,@Param("dueBackTime") String dueBackTime);
/**
* 取消订单后,订单中的书籍也被取消借购状态,可再次被同一读者借购
* @param idArray 借购书籍的主键
*/
void cancelBook(@Param("idArray") Long[] idArray);
/**
* 查询单个订单
* @param lendBuyOrderId
* @return LendBuyOrderVO
*/
LendBuyOrderVO getOrder(Long lendBuyOrderId);
/**
* 新增一条借购订单
* @param lendBuyOrderVO
*/
void insertOrder(LendBuyOrderVO lendBuyOrderVO);
/**
* 根据图书主键和读者主键查询单个借购书籍
* @param preBookId
* @param readerId
* @return
*/
List<LendBuyBookVO> findRepeatBooks(@Param("preBookId") Long preBookId,@Param("readerId")Long readerId);
/**
* 根据借购图书的主键ID查询单个借购书籍
* @param id
* @return
*/
LendBuyBookVO getBookById(@Param("id") Long id);
/**
* 根据多本借购书籍的ID查询借购的书籍
* @param idArray
* @return
*/
List<LendBuyBookVO> findBooksByIds(@Param("idArray") Long[] idArray);
/**
* 根据ISBN编号查询被借购的书
* @param isbn
* @param readerId
* @return
*/
List<LendBuyBookVO> findBooksByISBN(@Param("isbn") String isbn,@Param("readerId") Long readerId);
/**
* 根据ISBN编号查询已被提交借购单的书
* @param isbn
* @param libId
* @return
*/
List<LendBuyBookVO> findReadyBooks(@Param("isbn") String isbn,@Param("libId") Long libId);
/**
* 新增一条借购书籍
* @param lendBuyBookVO
*/
void insertBook(LendBuyBookVO lendBuyBookVO);
/**
* 批量删除荐购书车里的书籍
* @param idArray
*/
void deleteBooks(@Param("idArray") Long[] idArray);
/**
* 获取订单中所有书籍的总价
* @param idArray
* @return Float
*/
Float getOrderPrice(@Param("idArray") Long[] idArray);
/**
* 根据读者id获取读者类型
* @param id
* @return Integer
*/
Integer getReaderTypeById(Long id);
}
|
[
"mrkinlam@163.com"
] |
mrkinlam@163.com
|
e84f0bbe0790c363e3c98eab9bcf07214f6469a8
|
2fcf003ad28385752ea8c2efdc60f6e3d606c360
|
/src/test/java/io/github/carrillo/accounting/web/rest/errors/ExceptionTranslatorIT.java
|
8749638596d344a8497ceba82ce722e4bc9ff2c3
|
[] |
no_license
|
BulkSecurityGeneratorProject/carrillo-smart-accounting-gateway
|
65c6a5fb07a6e102a3438f7d8d3186e3aafdd85d
|
cc246484a9ab4d669d003a2cf63e2bfc15b85690
|
refs/heads/master
| 2022-12-16T13:36:43.671342
| 2019-07-29T19:55:21
| 2019-07-29T19:55:21
| null | 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 5,568
|
java
|
package io.github.carrillo.accounting.web.rest.errors;
import io.github.carrillo.accounting.SmartaccountinggatewayApp;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.http.MediaType;
import org.springframework.http.converter.json.MappingJackson2HttpMessageConverter;
import org.springframework.test.web.servlet.MockMvc;
import org.springframework.test.web.servlet.setup.MockMvcBuilders;
import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.get;
import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.post;
import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.content;
import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.jsonPath;
import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.status;
/**
* Integration tests {@link ExceptionTranslator} controller advice.
*/
@SpringBootTest(classes = SmartaccountinggatewayApp.class)
public class ExceptionTranslatorIT {
@Autowired
private ExceptionTranslatorTestController controller;
@Autowired
private ExceptionTranslator exceptionTranslator;
@Autowired
private MappingJackson2HttpMessageConverter jacksonMessageConverter;
private MockMvc mockMvc;
@BeforeEach
public void setup() {
mockMvc = MockMvcBuilders.standaloneSetup(controller)
.setControllerAdvice(exceptionTranslator)
.setMessageConverters(jacksonMessageConverter)
.build();
}
@Test
public void testConcurrencyFailure() throws Exception {
mockMvc.perform(get("/test/concurrency-failure"))
.andExpect(status().isConflict())
.andExpect(content().contentType(MediaType.APPLICATION_PROBLEM_JSON))
.andExpect(jsonPath("$.message").value(ErrorConstants.ERR_CONCURRENCY_FAILURE));
}
@Test
public void testMethodArgumentNotValid() throws Exception {
mockMvc.perform(post("/test/method-argument").content("{}").contentType(MediaType.APPLICATION_JSON))
.andExpect(status().isBadRequest())
.andExpect(content().contentType(MediaType.APPLICATION_PROBLEM_JSON))
.andExpect(jsonPath("$.message").value(ErrorConstants.ERR_VALIDATION))
.andExpect(jsonPath("$.fieldErrors.[0].objectName").value("testDTO"))
.andExpect(jsonPath("$.fieldErrors.[0].field").value("test"))
.andExpect(jsonPath("$.fieldErrors.[0].message").value("NotNull"));
}
@Test
public void testMissingServletRequestPartException() throws Exception {
mockMvc.perform(get("/test/missing-servlet-request-part"))
.andExpect(status().isBadRequest())
.andExpect(content().contentType(MediaType.APPLICATION_PROBLEM_JSON))
.andExpect(jsonPath("$.message").value("error.http.400"));
}
@Test
public void testMissingServletRequestParameterException() throws Exception {
mockMvc.perform(get("/test/missing-servlet-request-parameter"))
.andExpect(status().isBadRequest())
.andExpect(content().contentType(MediaType.APPLICATION_PROBLEM_JSON))
.andExpect(jsonPath("$.message").value("error.http.400"));
}
@Test
public void testAccessDenied() throws Exception {
mockMvc.perform(get("/test/access-denied"))
.andExpect(status().isForbidden())
.andExpect(content().contentType(MediaType.APPLICATION_PROBLEM_JSON))
.andExpect(jsonPath("$.message").value("error.http.403"))
.andExpect(jsonPath("$.detail").value("test access denied!"));
}
@Test
public void testUnauthorized() throws Exception {
mockMvc.perform(get("/test/unauthorized"))
.andExpect(status().isUnauthorized())
.andExpect(content().contentType(MediaType.APPLICATION_PROBLEM_JSON))
.andExpect(jsonPath("$.message").value("error.http.401"))
.andExpect(jsonPath("$.path").value("/test/unauthorized"))
.andExpect(jsonPath("$.detail").value("test authentication failed!"));
}
@Test
public void testMethodNotSupported() throws Exception {
mockMvc.perform(post("/test/access-denied"))
.andExpect(status().isMethodNotAllowed())
.andExpect(content().contentType(MediaType.APPLICATION_PROBLEM_JSON))
.andExpect(jsonPath("$.message").value("error.http.405"))
.andExpect(jsonPath("$.detail").value("Request method 'POST' not supported"));
}
@Test
public void testExceptionWithResponseStatus() throws Exception {
mockMvc.perform(get("/test/response-status"))
.andExpect(status().isBadRequest())
.andExpect(content().contentType(MediaType.APPLICATION_PROBLEM_JSON))
.andExpect(jsonPath("$.message").value("error.http.400"))
.andExpect(jsonPath("$.title").value("test response status"));
}
@Test
public void testInternalServerError() throws Exception {
mockMvc.perform(get("/test/internal-server-error"))
.andExpect(status().isInternalServerError())
.andExpect(content().contentType(MediaType.APPLICATION_PROBLEM_JSON))
.andExpect(jsonPath("$.message").value("error.http.500"))
.andExpect(jsonPath("$.title").value("Internal Server Error"));
}
}
|
[
"jhipster-bot@jhipster.tech"
] |
jhipster-bot@jhipster.tech
|
88d719717ccda56e3225903bb787c4a4bb7e1c55
|
141e2c950f1585fbd185aa225d6e673309d4919d
|
/Day1/.metadata/.plugins/org.eclipse.core.resources/.history/a6/f09b6d6dceb100191d54a3b3dd964fb8
|
3eec257878bf4a48d0534fe816482a064caa041b
|
[] |
no_license
|
priyas35/Mode1-Training
|
bf619f34c7758c0d9cbac39f68c521fae4e52395
|
ac9c50ecd95beaab957626d0dcdce7b4073552da
|
refs/heads/master
| 2022-12-31T20:10:30.751017
| 2019-09-27T06:52:23
| 2019-09-27T06:52:23
| 212,010,111
| 0
| 0
| null | 2022-12-15T23:31:07
| 2019-10-01T04:08:36
|
JavaScript
|
UTF-8
|
Java
| false
| false
| 361
|
package com.hcl.java;
public class Prime {
public void check(int n){
boolean flag=true;
int i=2;
while(i < n/2){
if(n%i==0){
flag=false;
}
i++;
}
if(flag==true){
System.out.println("Prime..");
}else{
System.out.println("Not Prime..");
}
}
public static void main(String[] args) {
int n=5;
new Prime().check(n);
}
}
|
[
"priyaharisubi@gmail.com"
] |
priyaharisubi@gmail.com
|
|
602ed8c94a0eaeb636fb40badc324faf44df728e
|
635162ba17786e6f366f712cb8c31ffb42633554
|
/project/securities-manager/src/main/java/cn/hzstk/securities/member/mapper/AuthRealnameMapper.java
|
565279be053c8cc45b7a71e329f55e9eadd595d3
|
[] |
no_license
|
macrogoal/wwh.stock
|
19aeed117f57acc1f22f3ed0caf34e481f00eb9c
|
8847a4bc6707dd881ea28133b621cf81431d845b
|
refs/heads/master
| 2020-04-17T05:51:47.771160
| 2018-04-04T06:21:15
| 2018-04-04T06:21:15
| null | 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 263
|
java
|
package cn.hzstk.securities.member.mapper;
import cn.hzstk.securities.member.domain.AuthRealname;
import tk.mybatis.mapper.common.Mapper;
/**
* @description:
* @author: autoCode
* @history:
*/
public interface AuthRealnameMapper extends Mapper<AuthRealname>{
}
|
[
"wwzero@hotmail.com"
] |
wwzero@hotmail.com
|
94320b82bc369e99750d91899a5c7a6b825665bb
|
eace11a5735cfec1f9560e41a9ee30a1a133c5a9
|
/AMT/experiment/lab/ERS/Mutant/ExpenseReimbursementSystem(old,unusable)/traditional_mutants/double_calculateReimbursementAmount(java.lang.String,double,double,double,double)/ROR_4/ExpenseReimbursementSystem.java
|
82b6cb91bf7f36a5ca30406e1bf1a663d22e4731
|
[] |
no_license
|
phantomDai/mypapers
|
eb2fc0fac5945c5efd303e0206aa93d6ac0624d0
|
e1aa1236bbad5d6d3b634a846cb8076a1951485a
|
refs/heads/master
| 2021-07-06T18:27:48.620826
| 2020-08-19T12:17:03
| 2020-08-19T12:17:03
| 162,563,422
| 0
| 1
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 3,699
|
java
|
// This is a mutant program.
// Author : ysma
import java.util.Scanner;
public class ExpenseReimbursementSystem
{
private java.lang.String levelOfSalesStaff;
private double allowableMileage;
private double costPerKilometer;
public double calculateReimbursementAmount( java.lang.String stafflevel, double actualmonthlymileage, double monthlysalesamount, double airfareamount, double otherexpensesamount )
{
double feeForOverUseOfCar;
double airfareReimbursement;
double reimbursementsOtherThanAirfare;
if (stafflevel.equals( "seniormanager" )) {
allowableMileage = 4000;
costPerKilometer = 5;
if (actualmonthlymileage == allowableMileage) {
actualmonthlymileage = allowableMileage;
}
} else {
if (stafflevel.equals( "manager" )) {
allowableMileage = 3000;
costPerKilometer = 8;
if (actualmonthlymileage < allowableMileage) {
actualmonthlymileage = allowableMileage;
}
} else {
if (stafflevel.equals( "supervisor" )) {
allowableMileage = 0;
costPerKilometer = 0;
} else {
new java.io.IOException( "Invalid stafflevel" );
}
}
}
feeForOverUseOfCar = costPerKilometer * (actualmonthlymileage - allowableMileage);
if (stafflevel.equals( "seniormanager" )) {
airfareReimbursement = airfareamount;
} else {
if (stafflevel.equals( "manager" )) {
if (monthlysalesamount > 50000) {
airfareReimbursement = airfareamount;
} else {
airfareReimbursement = 0;
}
} else {
if (stafflevel.equals( "supervisor" )) {
if (monthlysalesamount > 80000) {
airfareReimbursement = airfareamount;
} else {
airfareReimbursement = 0;
}
} else {
new java.io.IOException( "Invalid stafflevel" );
airfareReimbursement = 0;
}
}
}
if (monthlysalesamount > 100000) {
reimbursementsOtherThanAirfare = otherexpensesamount;
} else {
reimbursementsOtherThanAirfare = 0;
}
double totalReimbursementAmount = -feeForOverUseOfCar + airfareReimbursement + reimbursementsOtherThanAirfare;
return totalReimbursementAmount;
}
public static void main( java.lang.String[] args )
{
java.util.Scanner s = new java.util.Scanner( System.in );
java.lang.String stafflevel = null;
System.out.println( "please enter stafflevel:" );
stafflevel = s.next();
System.out.println( "please enter actual monthly mileage:" );
double actualmonthlymileage = s.nextDouble();
System.out.println( "please enter monthly sales amount:" );
double monthlysalesamount = s.nextDouble();
System.out.println( "please enter airfare:" );
double airfare = s.nextDouble();
System.out.println( "please enter other expenses:" );
double otherexpenses = s.nextDouble();
ExpenseReimbursementSystem sys = new ExpenseReimbursementSystem();
double amount = sys.calculateReimbursementAmount( stafflevel, actualmonthlymileage, monthlysalesamount, airfare, otherexpenses );
System.out.println( "total reimbursement amount: " + String.valueOf( amount ) );
}
}
|
[
"daihepeng@sina.cn"
] |
daihepeng@sina.cn
|
c22750866b0d624939456f34b32536aa7acb4252
|
354da9c86e852ce170280acaad5581b0a3698614
|
/Reflection/src/com/wuhen/java/NewInstanceTest.java
|
d606e3e8b714c489ed7bc5e1f6aaaf47ecb9626c
|
[] |
no_license
|
291663174/JavaSeniors
|
dc035e9cf4d1d30da642c54115cadc6e4056d211
|
13ff59983833949e5a31ae9687777c2bd5842d4e
|
refs/heads/master
| 2023-01-30T12:31:42.137400
| 2020-12-09T14:48:05
| 2020-12-09T14:48:05
| 304,288,629
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 2,294
|
java
|
package com.wuhen.java;
import com.wuhen.java1.Person;
import org.junit.Test;
import java.util.Random;
/**
* @author Wuhen
* @Description 通过发射创建对应的运行时类的对象
* @date 2020-10-13 16:22
**/
public class NewInstanceTest {
@Test
public void test1() throws IllegalAccessException, InstantiationException {
Class<Person> clazz = Person.class;
/**
* newInstance():调用此方法,创建对应的运行时类的对象,内部调用了运行时类的空参的构造器
* 要想此方法正常的创建运行时类的对象,要求:
* 1.运行时类必须提供空参的构造器。
* 2.空参的构造器的访问权限得够。通常设置为public
* 在javabean中要求提供一个public的空参构造器,原因
* 1.便于通过反射,创建运行时类的对象
* 2.便于子类继承此运行时类时,默认名调用super()时,保证父类有此构造器
**/
Person obj = clazz.newInstance();
System.out.println(obj);
}
@Test
public void test2(){
for (int i = 0; i < 100;i++) {
//0,1,2
int num = new Random().nextInt(3);
String classPath = "";
switch (num){
case 0:
classPath = "java.util.Date";
break;
case 1:
classPath = "java.lang.Object";
break;
case 2:
classPath = "Person";
break;
}
try {
Object obj = getInstance(classPath);
System.out.println(obj);
} catch (ClassNotFoundException e) {
e.printStackTrace();
} catch (IllegalAccessException e) {
e.printStackTrace();
} catch (InstantiationException e) {
e.printStackTrace();
}
}
}
/**
* 创建一个指定类的对象
**/
public Object getInstance(String classpath) throws ClassNotFoundException, IllegalAccessException, InstantiationException {
Class clazz = Class.forName(classpath);
return clazz.newInstance();
}
}
|
[
"email@example.com"
] |
email@example.com
|
fed9d86b01a3778cc6b5e277b4f5d6adaf2776e3
|
ec2bd4ec310a4f9fbf0b61e427ef50b6686b18b5
|
/guanglian/gl-core/src/main/java/com/kekeinfo/core/business/last/dao/MonitLastDao.java
|
ebc7ccf37231a802b9d4e40f637b4229b52d1d77
|
[] |
no_license
|
kingc0000/privatefirst
|
58d0089a91f2fb26e615bf00f5c072d9036c8ab3
|
72b37f40d0f16b69466127b60434fbccfc5a6b50
|
refs/heads/master
| 2020-03-15T21:22:08.487027
| 2018-05-16T15:41:56
| 2018-05-16T15:41:56
| 132,353,516
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 312
|
java
|
package com.kekeinfo.core.business.last.dao;
import java.util.List;
import com.kekeinfo.core.business.generic.dao.KekeinfoEntityDao;
import com.kekeinfo.core.business.last.model.MonitLast;
public interface MonitLastDao extends KekeinfoEntityDao<Long, MonitLast> {
List<MonitLast> getByUserID(long userid);
}
|
[
"v_xubiao@baidu.com"
] |
v_xubiao@baidu.com
|
11785aec1418b5952869f20deacc6ebfccc62476
|
a2188e295eea25ab083805896cf9cfce9351a539
|
/model/DeviceDefinitionSpecialization.java
|
ed79e5b410145d5828901a613c2606ec70a15703
|
[] |
no_license
|
tkalatz/hl7_FHIR_entity_objects
|
f10f2b4cdeead51251c74a5aa0de408c8ec5931f
|
d9fd5b699be03fad71e6cf376620351f23f1025c
|
refs/heads/main
| 2023-02-23T06:30:37.743094
| 2021-01-10T18:03:23
| 2021-01-10T18:03:23
| 320,611,784
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 2,560
|
java
|
//
// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.8-b130911.1802
// 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.12.11 at 03:47:56 PM EET
//
package org.hl7.fhir;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlType;
/**
* The characteristics, operational status and capabilities of a medical-related component of a medical device.
*
* <p>Java class for DeviceDefinition.Specialization complex type.
*
* <p>The following schema fragment specifies the expected content contained within this class.
*
* <pre>
* <complexType name="DeviceDefinition.Specialization">
* <complexContent>
* <extension base="{http://hl7.org/fhir}BackboneElement">
* <sequence>
* <element name="systemType" type="{http://hl7.org/fhir}string"/>
* <element name="version" type="{http://hl7.org/fhir}string" minOccurs="0"/>
* </sequence>
* </extension>
* </complexContent>
* </complexType>
* </pre>
*
*
*/
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "DeviceDefinition.Specialization", propOrder = {
"systemType",
"version"
})
public class DeviceDefinitionSpecialization
extends BackboneElement
{
@XmlElement(required = true)
protected String systemType;
protected String version;
/**
* Gets the value of the systemType property.
*
* @return
* possible object is
* {@link String }
*
*/
public String getSystemType() {
return systemType;
}
/**
* Sets the value of the systemType property.
*
* @param value
* allowed object is
* {@link String }
*
*/
public void setSystemType(String value) {
this.systemType = value;
}
/**
* Gets the value of the version property.
*
* @return
* possible object is
* {@link String }
*
*/
public String getVersion() {
return version;
}
/**
* Sets the value of the version property.
*
* @param value
* allowed object is
* {@link String }
*
*/
public void setVersion(String value) {
this.version = value;
}
}
|
[
"tkalatz@gmail.com"
] |
tkalatz@gmail.com
|
b8e82fc02853696b65432885c7417e22cc6e2b70
|
7a6651b2b33875bbff96a939b15d10576750a4c5
|
/common-parent/tuple/src/test/java/com/speedment/common/tuple/TuplesOfNullablesExtraTest.java
|
5d16225e6b8ed1e76b214bce5565f48707818ee2
|
[
"Apache-2.0",
"LicenseRef-scancode-generic-cla",
"LicenseRef-scancode-unknown-license-reference"
] |
permissive
|
moomdate/speedment
|
c6947c53a3d050c1d9ab51335dbae66e3a7ff17d
|
bba2363d9457c4592ac8cc58289162e05dc6d904
|
refs/heads/master
| 2021-02-10T00:33:59.111532
| 2020-02-24T20:54:28
| 2020-02-24T20:54:28
| null | 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 2,268
|
java
|
/*
*
* Copyright (c) 2006-2019, Speedment, Inc. All Rights Reserved.
*
* 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.speedment.common.tuple;
import com.speedment.common.tuple.getter.TupleGetter;
import com.speedment.common.tuple.nullable.Tuple3OfNullables;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.params.ParameterizedTest;
import org.junit.jupiter.params.provider.ValueSource;
import java.util.NoSuchElementException;
import java.util.Optional;
import java.util.stream.IntStream;
import static com.speedment.common.tuple.TuplesTestUtil.SIZE;
import static org.junit.jupiter.api.Assertions.assertEquals;
/**
* @author Emil Forslund
* @since 1.0.5
*/
final class TuplesOfNullablesExtraTest {
@Test
void ofArray() {
IntStream.range(0, SIZE).forEach(i -> {
final TupleOfNullables tuple = TuplesTestUtil.createTupleOfNullableFilled(i);
assertEquals(i, tuple.degree());
final Integer[] array = TuplesTestUtil.array(i);
for (int j = 0; j < i; j++) {
final Integer expected = array[j];
final Integer actual = (Integer) tuple.get(j).orElseThrow(NoSuchElementException::new);
assertEquals(expected, actual);
}
});
}
@ParameterizedTest
@ValueSource(ints = {0, 1, 2})
void getter(int index) {
final Tuple3OfNullables<Integer, Integer, Integer> tuple = TuplesOfNullables.ofNullables(0, 1, 2);
final TupleGetter<Tuple3OfNullables<Integer, Integer, Integer>, Optional<Integer>> getter = TupleOfNullables.getter(index);
assertEquals(index, getter.index());
assertEquals(index, getter.apply(tuple).orElseThrow(NoSuchElementException::new));
}
}
|
[
"minborg@speedment.com"
] |
minborg@speedment.com
|
0b03faf4d7a4f486948811908b0b7c0b67ff940f
|
7d31ae3dec88240b4c5209c3381a897d873caf03
|
/papabear-product-service/src/main/java/com/papabear/product/dao/ProductCommentPicDao.java
|
da339219692121fc080a89c08914e9d617fe66ed
|
[] |
no_license
|
hansq-rokey/h5
|
1ce063f730a7631c333130ceb2028d1443d8dbc1
|
8235dc4649ac9b31603a9da766c20f6b34972d00
|
refs/heads/master
| 2021-01-18T03:38:53.628069
| 2017-03-22T08:32:48
| 2017-03-22T08:32:48
| 85,803,330
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 788
|
java
|
package com.papabear.product.dao;
import java.util.List;
import org.apache.ibatis.annotations.Param;
import com.papabear.product.entity.ProductCommentPic;
public interface ProductCommentPicDao {
int deleteByPrimaryKey(Long id);
int insert(ProductCommentPic record);
Long insertSelective(ProductCommentPic record);
ProductCommentPic selectByPrimaryKey(Long id);
int updateByPrimaryKeySelective(ProductCommentPic record);
int updateByPrimaryKey(ProductCommentPic record);
int updateCommentPic(@Param("userId")Long userId, @Param("commentId")Long commentId);
int updateCommentPicByUserId(ProductCommentPic pic);
List<ProductCommentPic> queryListByCommentIdAndUserId(@Param("userId")Long userId,@Param("commentId")Long commentId);
}
|
[
"hanshuaiqi@ibaixiong.com"
] |
hanshuaiqi@ibaixiong.com
|
f7198aeb34e2a66cd10ea82162c4bb4bb77ef858
|
1900a47a03dc0bfb3e533b318d1c86305dd0d55a
|
/src/main/java/com/adanac/tool/rageon/service/sfunc/IdCardImpl.java
|
5785cc4758255060aa3eae529cc5e7b07dd7bfd0
|
[] |
no_license
|
adanac/rageon-service
|
e8e8dd3bf0e026820f7ed80dca4c21f5e1d64488
|
2e532c77c321f4d024a02801bbeb589925d5b1a9
|
refs/heads/master
| 2020-05-29T16:39:19.490239
| 2016-09-07T09:18:35
| 2016-09-07T09:18:35
| 58,634,658
| 0
| 1
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 3,909
|
java
|
package com.adanac.tool.rageon.service.sfunc;
import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.FileReader;
import java.io.FileWriter;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.net.HttpURLConnection;
import java.net.URL;
import java.net.URLEncoder;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Service;
import com.adanac.tool.rageon.sfunc.intf.IdCardService;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
/**
* 查询身份信息
*/
@Service
public class IdCardImpl implements IdCardService {
@Value("${baiDU_apiKey}")
private String apiKey;
/**
* 将查询结果写入到文件中
* @param src
* @param dest
* @param flag
* @throws IOException
*/
public void rwTxtFile(String src, String dest, Integer flag) throws IOException {
BufferedReader br = new BufferedReader(new FileReader(src));
BufferedWriter bw = new BufferedWriter(new FileWriter(dest));
String line;
while ((line = br.readLine()) != null) {
if (flag == 0) {// 根据name和cardno查询
String[] split = line.split("-");
String name = split[0];
String cardno = split[1];
JSONObject jsonObj = queryByNameAndCardno(name, cardno);
String content = jsonObj.toJSONString();
bw.write(line + "--" + content);// 把原有内容和查询结果写入目标文件
} else if (flag == 1) {// 根据cardno查询
String cardno = line.trim();
JSONObject paramMap = queryByCardno(cardno);
if (paramMap.getInteger("errNum") != -1) {
JSONObject jsonObj = (JSONObject) paramMap.get("retData");
bw.write("id:" + line.trim() + "," + "sex:" + jsonObj.getString("sex") + "," + "address:"
+ jsonObj.getString("address") + "," + "birthday:" + jsonObj.getString("birthday") + ","
+ "retMsg:" + paramMap.getString("retMsg"));// 把原有内容和查询结果写入目标文件
} else {
bw.write("id:" + line.trim() + "," + "retMsg:" + paramMap.getString("retMsg"));
}
}
bw.newLine();
}
br.close();
bw.close();
}
/**
* @param urlAll
* :请求接口
* @param httpArg
* :参数
* @return 返回结果
*/
public String request(String httpUrl, String httpArg) {
BufferedReader reader = null;
String result = null;
StringBuffer sbf = new StringBuffer();
httpUrl = httpUrl + "?" + httpArg;
try {
URL url = new URL(httpUrl);
HttpURLConnection connection = (HttpURLConnection) url.openConnection();
connection.setRequestMethod("GET");
// 填入apikey到HTTP header
connection.setRequestProperty("apikey", apiKey);
connection.connect();
InputStream is = connection.getInputStream();
reader = new BufferedReader(new InputStreamReader(is, "UTF-8"));
String strRead = null;
while ((strRead = reader.readLine()) != null) {
sbf.append(strRead);
sbf.append("\r\n");
}
reader.close();
result = sbf.toString();
} catch (Exception e) {
e.printStackTrace();
}
return result;
}
@Override
public JSONObject queryByCardno(String cardno) {
String httpUrl = "http://apis.baidu.com/apistore/idservice/id";
String httpArg = "id=" + cardno;
String jsonResult = request(httpUrl, httpArg);
System.out.println(jsonResult);
JSONObject jsonObj = JSON.parseObject(jsonResult);
return jsonObj;
}
@SuppressWarnings("deprecation")
@Override
public JSONObject queryByNameAndCardno(String name, String cardno) {
String ename = URLEncoder.encode(name);
String httpUrl = "http://apis.baidu.com/apix/idauth/idauth";
String httpArg = "name=" + ename + "&cardno=" + cardno;
String jsonResult = request(httpUrl, httpArg);
System.out.println(jsonResult);
JSONObject paramMap = JSON.parseObject(jsonResult);
JSONObject jsonObj = (JSONObject) paramMap.get("data");
return jsonObj;
}
}
|
[
"adanac@sina.com"
] |
adanac@sina.com
|
fb9a06045e34a00e5f77d282d63b32fefa31980e
|
0a39a02f8896be931d135cebdf6deaf44fa7d2f8
|
/src/org/dmfs/tasks/EditTaskActivity.java
|
8e51bd353fdd60bdd88d7ddf20a0ecfd5964b442
|
[
"Apache-2.0",
"LicenseRef-scancode-unknown-license-reference"
] |
permissive
|
nixprosoft/tasks
|
bff2a0a3c835513afd9e964625ce37a916184451
|
eed79983090f42884e6e1edc8a6b51f73bdd4f33
|
refs/heads/master
| 2021-01-20T22:04:46.919071
| 2013-08-15T12:28:38
| 2013-08-15T12:28:38
| 12,398,613
| 2
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 2,818
|
java
|
/*
* Copyright (C) 2013 Marten Gajda <marten@dmfs.org>
*
* 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.dmfs.tasks;
import android.annotation.TargetApi;
import android.app.ActionBar;
import android.os.Bundle;
import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentActivity;
import android.support.v4.app.NavUtils;
import android.view.Menu;
import android.view.MenuItem;
/**
* Activity to edit a task.
*
* @author Arjun Naik <arjun@arjunnaik.in>
* @author Marten Gajda <marten@dmfs.org>
*/
public class EditTaskActivity extends FragmentActivity
{
private EditTaskFragment mEditFragment;
@TargetApi(11)
@Override
protected void onCreate(Bundle savedInstanceState)
{
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_task_editor);
if (android.os.Build.VERSION.SDK_INT >= 11)
{
// hide up button in action bar
ActionBar actionBar = getActionBar();
actionBar.setDisplayShowHomeEnabled(false);
actionBar.setDisplayHomeAsUpEnabled(false);
// actionBar.setDisplayShowTitleEnabled(false);
}
if (savedInstanceState == null)
{
Bundle arguments = new Bundle();
arguments.putParcelable(EditTaskFragment.PARAM_TASK_URI, getIntent().getData());
EditTaskFragment fragment = new EditTaskFragment();
fragment.setArguments(arguments);
getSupportFragmentManager().beginTransaction().add(R.id.add_task_container, fragment).commit();
}
}
@Override
public void onAttachFragment(Fragment fragment)
{
super.onAttachFragment(fragment);
if (fragment instanceof EditTaskFragment)
{
mEditFragment = (EditTaskFragment) fragment;
}
else
{
throw new IllegalArgumentException("Invalid fragment attached: " + fragment.getClass().getCanonicalName());
}
}
@Override
public boolean onCreateOptionsMenu(Menu menu)
{
getMenuInflater().inflate(R.menu.edit_task_activity_menu, menu);
return true;
}
@Override
public void onBackPressed()
{
super.onBackPressed();
if (mEditFragment != null)
{
mEditFragment.saveAndExit();
}
}
@Override
public boolean onOptionsItemSelected(MenuItem item)
{
switch (item.getItemId())
{
case android.R.id.home:
NavUtils.navigateUpFromSameTask(this);
return true;
}
return super.onOptionsItemSelected(item);
}
}
|
[
"marten@dmfs.org"
] |
marten@dmfs.org
|
c24ccec44682c579b567f23c03a86ab1cd34c407
|
5e6abc6bca67514b4889137d1517ecdefcf9683a
|
/Server/src/main/java/plugin/activity/zulrah/ZulrahCombatSwingHandler.java
|
a6856e5d5ecb38c0949c8aee1649f1a56967e08e
|
[] |
no_license
|
dginovker/RS-2009-317
|
88e6d773d6fd6814b28bdb469f6855616c71fc26
|
9d285c186656ace48c2c67cc9e4fb4aeb84411a4
|
refs/heads/master
| 2022-12-22T18:47:47.487468
| 2019-09-20T21:24:34
| 2019-09-20T21:24:34
| 208,949,111
| 2
| 2
| null | 2022-12-15T23:55:43
| 2019-09-17T03:15:17
|
Java
|
UTF-8
|
Java
| false
| false
| 1,095
|
java
|
package plugin.activity.zulrah;
import org.gielinor.game.node.entity.combat.CombatStyle;
import org.gielinor.game.node.entity.combat.CombatSwingHandler;
/**
* Represents the {@link org.gielinor.game.node.entity.combat.CombatSwingHandler} for the Zulrah NPC.
*
* @author <a href="https://Gielinor.org">Gielinor Logan G.</a>
*/
public abstract class ZulrahCombatSwingHandler extends CombatSwingHandler {
/**
* The {@link plugin.activity.zulrah.ZulrahNPC}.
*/
private ZulrahNPC zulrahNPC;
/**
* Constructs a new <code>ZulrahCombatSwingHandler</code>.
*/
public ZulrahCombatSwingHandler(CombatStyle combatStyle) {
super(combatStyle);
}
/**
* Gets the <code>ZulrahNPC</code>.
*
* @return The Zulrah npc.
*/
public ZulrahNPC getZulrahNPC() {
return zulrahNPC;
}
/**
* Sets the <code>ZulrahNPC</code>.
*
* @param zulrahNPC The Zulrah npc.
*/
public void setZulrahNPC(ZulrahNPC zulrahNPC) {
this.zulrahNPC = zulrahNPC;
}
}
|
[
"dcress01@uoguelph.ca"
] |
dcress01@uoguelph.ca
|
273d9bde48128656b6f33d85c0463d64b3c258ba
|
b755a269f733bc56f511bac6feb20992a1626d70
|
/model/model-util/src/main/java/com/qiyun/type/ChaseType.java
|
b3dae6f7ad83be3b753e2722931f98800366dc3e
|
[] |
no_license
|
yysStar/dubbo-zookeeper-SSM
|
55df313b58c78ab2eaa3d021e5bb201f3eee6235
|
e3f85dea824159fb4c29207cc5c9ccaecf381516
|
refs/heads/master
| 2022-12-21T22:50:33.405116
| 2020-05-09T09:20:41
| 2020-05-09T09:20:41
| 125,301,362
| 2
| 0
| null | 2022-12-16T10:51:09
| 2018-03-15T02:27:17
|
Java
|
UTF-8
|
Java
| false
| false
| 877
|
java
|
package com.qiyun.type;
import com.qiyun.hibernate.IntegerBeanLabelItem;
import java.util.ArrayList;
import java.util.List;
public class ChaseType extends IntegerBeanLabelItem {
protected ChaseType(String name, int value) {
super(ChaseType.class.getName(), name, value);
}
public static ChaseType getItem(int value) {
return (ChaseType) ChaseType.getResult(ChaseType.class.getName(), value);
}
public static final ChaseType ALL = new ChaseType("所有", -1);
public static final ChaseType SELF_CHOOSE = new ChaseType("自选追号", 1);
public static final ChaseType MACHINE_CHOOSE = new ChaseType("机选追号", 2);
public static final ChaseType DIANDAN_CHOOSE = new ChaseType("定胆追号", 3);
public static List list = new ArrayList();
static {
list.add(ALL);
list.add(SELF_CHOOSE);
list.add(MACHINE_CHOOSE);
list.add(DIANDAN_CHOOSE);
}
}
|
[
"qawsed1231010@126.com"
] |
qawsed1231010@126.com
|
803a7f9a21e94ba0a251e8ffd7d8f78b77b558a6
|
afc11731cc963f28984323d8ea308a0d7afa6f86
|
/src/main/java/io/github/templatejhipster/application/security/DomainUserDetailsService.java
|
b6a308708de43f65170b00b8af10603e1bf9df77
|
[] |
no_license
|
amadoux/template-jhipster
|
c5cb0fb2485a308563f9e5a9ff0c15cc5219fd8e
|
ebc906e08d2937c7f1e9f010cb39e3ba29e20711
|
refs/heads/master
| 2022-12-22T07:25:00.662784
| 2019-07-25T16:22:48
| 2019-07-25T16:22:48
| 198,865,371
| 0
| 0
| null | 2022-12-16T05:02:28
| 2019-07-25T16:22:34
|
Java
|
UTF-8
|
Java
| false
| false
| 2,730
|
java
|
package io.github.templatejhipster.application.security;
import io.github.templatejhipster.application.domain.User;
import io.github.templatejhipster.application.repository.UserRepository;
import org.hibernate.validator.internal.constraintvalidators.hv.EmailValidator;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.security.core.GrantedAuthority;
import org.springframework.security.core.authority.SimpleGrantedAuthority;
import org.springframework.security.core.userdetails.UserDetails;
import org.springframework.security.core.userdetails.UserDetailsService;
import org.springframework.security.core.userdetails.UsernameNotFoundException;
import org.springframework.stereotype.Component;
import org.springframework.transaction.annotation.Transactional;
import java.util.*;
import java.util.stream.Collectors;
/**
* Authenticate a user from the database.
*/
@Component("userDetailsService")
public class DomainUserDetailsService implements UserDetailsService {
private final Logger log = LoggerFactory.getLogger(DomainUserDetailsService.class);
private final UserRepository userRepository;
public DomainUserDetailsService(UserRepository userRepository) {
this.userRepository = userRepository;
}
@Override
@Transactional
public UserDetails loadUserByUsername(final String login) {
log.debug("Authenticating {}", login);
if (new EmailValidator().isValid(login, null)) {
return userRepository.findOneWithAuthoritiesByEmail(login)
.map(user -> createSpringSecurityUser(login, user))
.orElseThrow(() -> new UsernameNotFoundException("User with email " + login + " was not found in the database"));
}
String lowercaseLogin = login.toLowerCase(Locale.ENGLISH);
return userRepository.findOneWithAuthoritiesByLogin(lowercaseLogin)
.map(user -> createSpringSecurityUser(lowercaseLogin, user))
.orElseThrow(() -> new UsernameNotFoundException("User " + lowercaseLogin + " was not found in the database"));
}
private org.springframework.security.core.userdetails.User createSpringSecurityUser(String lowercaseLogin, User user) {
if (!user.getActivated()) {
throw new UserNotActivatedException("User " + lowercaseLogin + " was not activated");
}
List<GrantedAuthority> grantedAuthorities = user.getAuthorities().stream()
.map(authority -> new SimpleGrantedAuthority(authority.getName()))
.collect(Collectors.toList());
return new org.springframework.security.core.userdetails.User(user.getLogin(),
user.getPassword(),
grantedAuthorities);
}
}
|
[
"jhipster-bot@jhipster.tech"
] |
jhipster-bot@jhipster.tech
|
0edec70a1215acf7c18409a7126e405c34e4d4b8
|
39f2dc7f250cf6d9e132cda8a328e62f1ebd61fd
|
/offer_java_basis/src/main/java/cn/offer2020/pbj/javabasis/java/basis1/java5_27/TestForeach.java
|
12b0353372ab281d5d10d0ae92be60530799c540
|
[
"Apache-2.0"
] |
permissive
|
peng4444/offer2020
|
0c51a93202383ef8063cc624d96ab0b26ddc8189
|
372f8d072698acbb03e1bb569a20e6cda957e1af
|
refs/heads/master
| 2021-05-17T07:33:28.950090
| 2020-11-17T13:21:14
| 2020-11-17T13:21:14
| 250,697,652
| 7
| 0
|
Apache-2.0
| 2021-03-31T21:57:55
| 2020-03-28T02:32:57
|
Java
|
UTF-8
|
Java
| false
| false
| 408
|
java
|
package cn.offer2020.pbj.javabasis.java.basis1.java5_27;
//Java新特性,foreach循环
public class TestForeach {
public static void main(String[] args) {
int data[] = new int[] {1,2,3,4,5};
for(int x : data) {//循环次数由数组长度决定
//每一次循环实际上都表示数组的角标增长,会取得一个数组的内容,并且将其设置给x
System.out.println(x);
}
}
}
|
[
"pbj@qq.com"
] |
pbj@qq.com
|
06bdc500d4b6c12e49a3cd9b934f3a89a99c4663
|
5d5cab801692913205cd51705154723f695dc9ba
|
/xultimate-toolkit/xultimate-context/src/main/java/org/danielli/xultimate/context/chardet/cpdetector/InputStreamCharsetDetector.java
|
a89cf853c290fa56c7b55e70d958eca88492f452
|
[] |
no_license
|
RenMingNeng/xultimate-resource
|
2463caedbf211087b4e3fb27bf4318f3f7786c59
|
63604eb3ebe1114a916b47c2a2463bd13c0ee8f0
|
refs/heads/master
| 2021-08-31T13:17:26.274512
| 2017-12-18T03:28:31
| 2017-12-18T03:28:31
| 114,590,216
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 1,691
|
java
|
package org.danielli.xultimate.context.chardet.cpdetector;
//import info.monitorenter.cpdetector.io.ASCIIDetector;
//import info.monitorenter.cpdetector.io.ByteOrderMarkDetector;
//import info.monitorenter.cpdetector.io.CodepageDetectorProxy;
//import info.monitorenter.cpdetector.io.JChardetFacade;
//import info.monitorenter.cpdetector.io.ParsingDetector;
//import info.monitorenter.cpdetector.io.UnicodeDetector;
//import java.io.BufferedInputStream;
import java.io.InputStream;
import java.nio.charset.Charset;
import java.util.HashSet;
import java.util.Set;
import org.danielli.xultimate.context.chardet.CharsetDetector;
import org.danielli.xultimate.context.chardet.CharsetDetectorException;
/**
* 输入流字符集检测器。此实现是基于cpdetector框架。
*
* @author Danie Li
* @since 18 Jun 2013
* @see CharsetDetector
*/
public class InputStreamCharsetDetector implements CharsetDetector<InputStream> {
@Override
public Set<Charset> detect(InputStream source) throws CharsetDetectorException {
Set<Charset> set = new HashSet<Charset>();
// CodepageDetectorProxy detector = CodepageDetectorProxy.getInstance();
// detector.add(new ByteOrderMarkDetector());
// detector.add(new ParsingDetector(false));
// detector.add(JChardetFacade.getInstance());
// detector.add(ASCIIDetector.getInstance());
// detector.add(UnicodeDetector.getInstance());
// try {
// source = new BufferedInputStream(source);
// Charset charset = detector.detectCodepage(source, source.available());
// if (charset != null) {
// set.add(charset);
// }
// } catch (Exception e) {
// throw new CharsetDetectorException(e.getMessage(), e);
// }
return set;
}
}
|
[
"395841246@qq.com"
] |
395841246@qq.com
|
8c1061a065b1d54c951690d9849e1a6b0d0ab625
|
38883d3e5d0f88730a2154d1da4faa4409eabe7b
|
/metamer/ftest/src/test/java/org/richfaces/tests/metamer/ftest/a4jCommandLink/TestResetValues.java
|
615381c184848d5ff494ee7251e26733849e62a3
|
[] |
no_license
|
VRDate/richfaces-qa
|
fe32c428d02c19c5dd021bf5b1ae0df8449debc8
|
b17722025b0f8ff0ab83c3a16a5442abbc2d443e
|
refs/heads/master
| 2020-06-14T00:21:56.022194
| 2016-07-07T13:57:53
| 2016-07-07T13:58:25
| null | 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 2,131
|
java
|
/*
* JBoss, Home of Professional Open Source
* Copyright 2010-2016, Red Hat, Inc. and individual contributors
* by the @authors tag. See the copyright.txt in the distribution for a
* full listing of individual contributors.
*
* This 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 software 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 software; if not, write to the Free
* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
*/
package org.richfaces.tests.metamer.ftest.a4jCommandLink;
import org.richfaces.tests.metamer.ftest.abstractions.AbstractResetValuesTest;
import org.richfaces.tests.metamer.ftest.annotations.IssueTracking;
import org.richfaces.tests.metamer.ftest.extension.attributes.coverage.annotations.CoversAttributes;
import org.richfaces.tests.metamer.ftest.extension.configurator.skip.On;
import org.richfaces.tests.metamer.ftest.extension.configurator.skip.annotation.Skip;
import org.richfaces.tests.metamer.ftest.extension.configurator.templates.annotation.Templates;
import org.testng.annotations.Test;
/**
* @author <a href="mailto:jstefek@redhat.com">Jiri Stefek</a>
*/
@Templates("plain")
@IssueTracking("https://issues.jboss.org/browse/RF-13532")
public class TestResetValues extends AbstractResetValuesTest {
@Override
public String getComponentTestPagePath() {
return "a4jCommandLink/rf-13532.xhtml";
}
@Test
@Skip(On.JSF.VersionLowerThan22.class)// feature introduced in JSF 2.2
@CoversAttributes("resetValues")
public void testResetValues() {
checkResetValues();
}
}
|
[
"jstefek@redhat.com"
] |
jstefek@redhat.com
|
517f6fb6d35575044e91d1c61723294d02af7cf2
|
69a4f2d51ebeea36c4d8192e25cfb5f3f77bef5e
|
/methods/Method_55480.java
|
e04eef90b9904d59d0c9ff512aba73b4c5e6be76
|
[] |
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
| 307
|
java
|
/**
* Ensures that the specified pointer is not {@code NULL} (0L).
* @param pointer the pointer to check
* @throws NullPointerException if {@code pointer} is {@code NULL}
*/
public static long check(long pointer){
if (pointer == NULL) {
throw new NullPointerException();
}
return pointer;
}
|
[
"sonnguyen@utdallas.edu"
] |
sonnguyen@utdallas.edu
|
8ff384112c229a2724a5c78085b98a97c0d8ae43
|
83665baa7232e7ce23c5d3dcd8985fa8a979e855
|
/effective-java/src/main/java/com/effective/java/chapter2/item2/hierarchicalbuilder/PizzaTest.java
|
d32c2a076bba53a716e94bf0fe1e8d8a1f869485
|
[] |
no_license
|
hippalus/effective-java-3
|
32820dd09bfec56298ed7acd7a056d0256c304eb
|
321470147ba13a5aebed74be15c100b13f5c9511
|
refs/heads/master
| 2020-07-07T09:19:17.209943
| 2019-08-21T11:41:18
| 2019-08-21T11:41:18
| null | 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 661
|
java
|
package com.effective.java.chapter2.item2.hierarchicalbuilder;
import static com.effective.java.chapter2.item2.hierarchicalbuilder.NyPizza.Size.SMALL;
import static com.effective.java.chapter2.item2.hierarchicalbuilder.Pizza.Topping.*;
// Using the hierarchical builder (Page 16)
public class PizzaTest {
public static void main(String[] args) {
NyPizza pizza = new NyPizza.Builder(SMALL)
.addTopping(SAUSAGE).addTopping(ONION).build();
Calzone calzone = new Calzone.Builder()
.addTopping(HAM).sauceInside().build();
System.out.println(pizza);
System.out.println(calzone);
}
}
|
[
"habiphakan.isler@gmail.com"
] |
habiphakan.isler@gmail.com
|
0749d69ad738efe42032b75713cf81d12c4d47cc
|
e5a3b0a88097e40b844000fb06e8fac3c8da453e
|
/src/main/java/org/neo4j/ogm/benchmark/entityscan/entities/SimpleEntity846.java
|
f01b060decec443f31c5fdb0b2e7911cadfa6c1f
|
[] |
no_license
|
nmervaillie/neo4j-ogm-jmh-performance-benchmark
|
473fba908aec8df71b397b65170f15ee2189210b
|
d85281080e0495143da4f3bd98199ff40f094612
|
refs/heads/master
| 2020-12-30T14:44:23.214665
| 2017-10-06T07:50:15
| 2017-10-06T07:50:15
| 91,077,827
| 0
| 1
| null | 2017-10-06T07:50:16
| 2017-05-12T09:59:17
|
Java
|
UTF-8
|
Java
| false
| false
| 940
|
java
|
package org.neo4j.ogm.benchmark.entityscan.entities;
import java.util.List;
import org.neo4j.ogm.annotation.NodeEntity;
import org.neo4j.ogm.annotation.Relationship;
/**
* Template for single entity
*
* Run src/main/resouces.copy.sh to create copies in sources directory.
*
* @author Frantisek Hartman
*/
@NodeEntity
public class SimpleEntity846 {
Long id;
String name;
@Relationship(type = "REL")
List<SimpleEntity846> entities;
public SimpleEntity846() {
}
public SimpleEntity846(String name) {
this.name = name;
}
public Long getId() {
return id;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public List<SimpleEntity846> getEntities() {
return entities;
}
public void setEntities(List<SimpleEntity846> entities) {
this.entities = entities;
}
}
|
[
"frant.hartm@gmail.com"
] |
frant.hartm@gmail.com
|
f71c1cc5b092a3e5fdd33228f44c4a391a1d0196
|
2cf9cbafdfd5df582a9a46dcf85e5162901ef337
|
/ocl-core/src/main/java/uk/ac/kent/cs/ocl20/semantics/model/types/TypeType.java
|
edc2cac8f3e9d465a1e8c246acc1cf35deb29c9d
|
[
"Apache-2.0"
] |
permissive
|
opatrascoiu/jmf
|
918303cf7ff6a5428157ea5deedc863386f457fb
|
be597da51fa5964f07ee74213640894af8fff535
|
refs/heads/master
| 2022-02-28T08:57:39.220759
| 2019-10-17T08:48:14
| 2019-10-17T08:48:14
| 110,419,420
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 805
|
java
|
/**
*
* Class TypeType.java
*
* Generated by KMFStudio at 09 May 2003 17:47:13
* Visit http://www.cs.ukc.ac.uk/kmf
*
*/
package uk.ac.kent.cs.ocl20.semantics.model.types;
import uk.ac.kent.cs.ocl20.semantics.SemanticsElement;
import uk.ac.kent.cs.ocl20.semantics.bridge.Classifier;
public interface TypeType
extends
SemanticsElement,
uk.ac.kent.cs.ocl20.semantics.bridge.Primitive,
OclAnyType,
uk.ac.kent.cs.ocl20.semantics.bridge.DataType,
uk.ac.kent.cs.ocl20.semantics.bridge.Classifier,
uk.ac.kent.cs.ocl20.semantics.bridge.Namespace,
uk.ac.kent.cs.ocl20.semantics.bridge.ModelElement
{
/** Get the Classifier */
public Classifier getClassifier();
/** Override the toString */
public String toString();
/** Clone the object */
public Object clone();
}
|
[
"opatrascoiu@yahoo.com"
] |
opatrascoiu@yahoo.com
|
a7fe758fdacd04671283a940557759bf2c63108c
|
7b82d70ba5fef677d83879dfeab859d17f4809aa
|
/_part2/bboss-rpc/src-jgroups/bboss/org/jgroups/blocks/GridInputStream.java
|
acd01aeb1a285c3a12b5e89988d355c0981376a9
|
[
"Apache-2.0"
] |
permissive
|
apollowesley/jun_test
|
fb962a28b6384c4097c7a8087a53878188db2ebc
|
c7a4600c3f0e1b045280eaf3464b64e908d2f0a2
|
refs/heads/main
| 2022-12-30T20:47:36.637165
| 2020-10-13T18:10:46
| 2020-10-13T18:10:46
| null | 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 4,004
|
java
|
package bboss.org.jgroups.blocks;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.io.InputStream;
import bboss.org.jgroups.annotations.Experimental;
import bboss.org.jgroups.logging.Log;
import bboss.org.jgroups.logging.LogFactory;
/**
* @author Bela Ban
* @version $Id: GridInputStream.java,v 1.8 2010/01/08 16:41:12 belaban Exp $
*/
@Experimental
public class GridInputStream extends InputStream {
final ReplCache<String,byte[]> cache;
final int chunk_size;
final String name;
protected final GridFile file; // file representing this input stream
int index=0; // index into the file for writing
int local_index=0;
byte[] current_buffer=null;
boolean end_reached=false;
final static Log log=LogFactory.getLog(GridInputStream.class);
GridInputStream(GridFile file, ReplCache<String, byte[]> cache, int chunk_size) throws FileNotFoundException {
this.file=file;
this.name=file.getPath();
this.cache=cache;
this.chunk_size=chunk_size;
}
public int read() throws IOException {
int bytes_remaining_to_read=getBytesRemainingInChunk();
if(bytes_remaining_to_read == 0) {
if(end_reached)
return -1;
current_buffer=fetchNextChunk();
local_index=0;
if(current_buffer == null)
return -1;
else if(current_buffer.length < chunk_size)
end_reached=true;
bytes_remaining_to_read=getBytesRemainingInChunk();
}
int retval=current_buffer[local_index++];
index++;
return retval;
}
public int read(byte[] b) throws IOException {
return read(b, 0, b.length);
}
public int read(byte[] b, int off, int len) throws IOException {
int bytes_read=0;
while(len > 0) {
int bytes_remaining_to_read=getBytesRemainingInChunk();
if(bytes_remaining_to_read == 0) {
if(end_reached)
return bytes_read > 0? bytes_read : -1;
current_buffer=fetchNextChunk();
local_index=0;
if(current_buffer == null)
return bytes_read > 0? bytes_read : -1;
else if(current_buffer.length < chunk_size)
end_reached=true;
bytes_remaining_to_read=getBytesRemainingInChunk();
}
int bytes_to_read=Math.min(len, bytes_remaining_to_read);
// bytes_to_read=Math.min(bytes_to_read, current_buffer.length - local_index);
System.arraycopy(current_buffer, local_index, b, off, bytes_to_read);
local_index+=bytes_to_read;
off+=bytes_to_read;
len-=bytes_to_read;
bytes_read+=bytes_to_read;
index+=bytes_to_read;
}
return bytes_read;
}
public long skip(long n) throws IOException {
throw new UnsupportedOperationException();
}
public int available() throws IOException {
throw new UnsupportedOperationException();
}
public void close() throws IOException {
local_index=index=0;
end_reached=false;
}
private int getBytesRemainingInChunk() {
// return chunk_size - local_index;
return current_buffer == null? 0 : current_buffer.length - local_index;
}
private byte[] fetchNextChunk() {
int chunk_number=getChunkNumber();
String key=name + ".#" + chunk_number;
byte[] val= cache.get(key);
if(log.isTraceEnabled())
log.trace("fetching index=" + index + ", key=" + key +": " + (val != null? val.length + " bytes" : "null"));
return val;
}
private int getChunkNumber() {
return index / chunk_size;
}
}
|
[
"wujun728@hotmail.com"
] |
wujun728@hotmail.com
|
8d246b7494630803ad59f014d09c1e619b1cb3b2
|
9d41d6a281058f00554e94cf5b438dd32297d886
|
/fillringbutton/src/main/java/com/anwesome/ui/fillringbutton/MovementController.java
|
68d8aa9ab721d8737e70c045fa8aec81c52659d7
|
[] |
no_license
|
pranavlathigara/AmazingCustomWidgets
|
cfab0b44b9e23cbb676698d71ecb67402458466e
|
4036c53630287f0816fc6da79cf2c5e964f7215b
|
refs/heads/master
| 2020-03-28T16:57:49.867044
| 2017-07-21T12:32:35
| 2017-07-21T12:33:22
| 148,745,387
| 2
| 0
| null | 2018-09-14T06:28:46
| 2018-09-14T06:28:47
| null |
UTF-8
|
Java
| false
| false
| 1,401
|
java
|
package com.anwesome.ui.fillringbutton;
/**
* Created by anweshmishra on 23/04/17.
*/
public class MovementController {
private int mode = 0;
private float l = 0,a = 0,deg = 0,dir = 0,finalL;
public MovementController(float w) {
this.finalL = w/Constants.L_SCALE;
}
public float getL() {
return l;
}
public float getA() {
return a;
}
public float getDeg() {
return deg;
}
public void update() {
switch (mode) {
case 0:
l+= finalL/5*dir;
if(l<=0) {
l = 0;
dir = 0;
}
if(l>=finalL) {
l = finalL;
mode += dir;
}
break;
case 1:
a+=30*dir;
if(a<=0 || a>=360) {
mode += dir;
}
break;
case 2:
deg+=dir*18;
if(deg>=90) {
deg = 90;
dir = 0;
}
if(deg<=0) {
mode += dir;
}
break;
default:
break;
}
}
public void startUpdating() {
dir = deg == 0?1:-1;
}
public boolean stopped() {
return dir == 0;
}
}
|
[
"anweshthecool0@gmail.com"
] |
anweshthecool0@gmail.com
|
bdee6b37425e3c16ac7193a4853d9828e9d3d705
|
36ab1307d1d1573f5bfb87b687ae1d52015ee418
|
/src/main/java/com/tfsc/ilabs/selfservice/action/models/ActionType.java
|
b11a98592f0563965b378e36c2defc0e1b8a97fb
|
[] |
no_license
|
Girish027/assist-selfserve-be
|
84f83f158c7871b719f2125b66e609f0c9094c67
|
f3df20349acf665e52815a62723b6e0bcc2b2c41
|
refs/heads/main
| 2023-08-25T18:00:51.006117
| 2021-10-18T21:04:47
| 2021-10-18T21:04:47
| 418,667,318
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 138
|
java
|
package com.tfsc.ilabs.selfservice.action.models;
/**
* Created by ravi.b on 31-05-2019.
*/
public enum ActionType {
REST,KAFKA
}
|
[
"41387899+Girish027@users.noreply.github.com"
] |
41387899+Girish027@users.noreply.github.com
|
eec244d63c73c2bdb1a20636cfc8af3297df0186
|
daab099e44da619b97a7a6009e9dee0d507930f3
|
/rt/jdk/internal/org/xml/sax/SAXNotSupportedException.java
|
96a9a646d94a6e22216732ea0701a33d2fb2e6b4
|
[] |
no_license
|
xknower/source-code-jdk-8u211
|
01c233d4f498d6a61af9b4c34dc26bb0963d6ce1
|
208b3b26625f62ff0d1ff6ee7c2b7ee91f6c9063
|
refs/heads/master
| 2022-12-28T17:08:25.751594
| 2020-10-09T03:24:14
| 2020-10-09T03:24:14
| 278,289,426
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 1,211
|
java
|
/* */ package jdk.internal.org.xml.sax;
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */ public class SAXNotSupportedException
/* */ extends SAXException
/* */ {
/* */ static final long serialVersionUID = -1422818934641823846L;
/* */
/* */ public SAXNotSupportedException() {}
/* */
/* */ public SAXNotSupportedException(String paramString) {
/* 72 */ super(paramString);
/* */ }
/* */ }
/* Location: D:\tools\env\Java\jdk1.8.0_211\rt.jar!\jdk\internal\org\xml\sax\SAXNotSupportedException.class
* Java compiler version: 8 (52.0)
* JD-Core Version: 1.1.3
*/
|
[
"xknower@126.com"
] |
xknower@126.com
|
8f76ac9a8e29205b70711dd64f64e4245b6071d6
|
0f5124795d0a7e16040c9adfc0f562326f17a767
|
/netty-restful-server/src/main/java/com/steven/netty/demo/bo/AlbumInfo.java
|
29fa54a8e29f383855fa50215a19f0d3acfe40df
|
[] |
no_license
|
frank-mumu/steven-parent
|
b0fd7d52dfe5bab6f33c752efa132862f46cea54
|
faca8295aac1da943bd4d4dd992debef6d537be7
|
refs/heads/master
| 2023-05-27T00:17:44.996281
| 2019-10-24T05:59:35
| 2019-10-24T05:59:35
| null | 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 445
|
java
|
package com.steven.netty.demo.bo;
import com.steven.netty.demo.entity.Album;
import com.steven.netty.nettyrest.response.Info;
/**
* Created by zhoumengkang on 5/1/16.
*/
public class AlbumInfo extends Info {
private Album album;
public Album getAlbum() {
return album;
}
public void setAlbum(Album album) {
this.album = album;
}
public AlbumInfo(Album album) {
this.album = album;
}
}
|
[
"918273244@qq.com"
] |
918273244@qq.com
|
1965e2f2f85c424d6082672719b6c02ccf44d92f
|
8af1164bac943cef64e41bae312223c3c0e38114
|
/results-java/apache--cassandra/a991b64811f4d6adb6c7b31c0df52288eb06cf19/after/SetSerializer.java
|
921a4ee47282a22785c65bea8288dc71261bfec7
|
[] |
no_license
|
fracz/refactor-extractor
|
3ae45c97cc63f26d5cb8b92003b12f74cc9973a9
|
dd5e82bfcc376e74a99e18c2bf54c95676914272
|
refs/heads/master
| 2021-01-19T06:50:08.211003
| 2018-11-30T13:00:57
| 2018-11-30T13:00:57
| 87,353,478
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 3,895
|
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.cassandra.serializers;
import java.nio.BufferUnderflowException;
import java.nio.ByteBuffer;
import java.util.*;
public class SetSerializer<T> extends CollectionSerializer<Set<T>>
{
// interning instances
private static final Map<TypeSerializer<?>, SetSerializer> instances = new HashMap<TypeSerializer<?>, SetSerializer>();
public final TypeSerializer<T> elements;
public static synchronized <T> SetSerializer<T> getInstance(TypeSerializer<T> elements)
{
SetSerializer<T> t = instances.get(elements);
if (t == null)
{
t = new SetSerializer<T>(elements);
instances.put(elements, t);
}
return t;
}
private SetSerializer(TypeSerializer<T> elements)
{
this.elements = elements;
}
public List<ByteBuffer> serializeValues(Set<T> values)
{
List<ByteBuffer> buffers = new ArrayList<>(values.size());
for (T value : values)
buffers.add(elements.serialize(value));
return buffers;
}
public int getElementCount(Set<T> value)
{
return value.size();
}
public void validateForNativeProtocol(ByteBuffer bytes, int version)
{
try
{
ByteBuffer input = bytes.duplicate();
int n = readCollectionSize(input, version);
for (int i = 0; i < n; i++)
elements.validate(readValue(input, version));
if (input.hasRemaining())
throw new MarshalException("Unexpected extraneous bytes after set value");
}
catch (BufferUnderflowException e)
{
throw new MarshalException("Not enough bytes to read a set");
}
}
public Set<T> deserializeForNativeProtocol(ByteBuffer bytes, int version)
{
try
{
ByteBuffer input = bytes.duplicate();
int n = readCollectionSize(input, version);
Set<T> l = new LinkedHashSet<T>(n);
for (int i = 0; i < n; i++)
{
ByteBuffer databb = readValue(input, version);
elements.validate(databb);
l.add(elements.deserialize(databb));
}
if (input.hasRemaining())
throw new MarshalException("Unexpected extraneous bytes after set value");
return l;
}
catch (BufferUnderflowException e)
{
throw new MarshalException("Not enough bytes to read a set");
}
}
public String toString(Set<T> value)
{
StringBuilder sb = new StringBuilder();
sb.append('{');
boolean isFirst = true;
for (T element : value)
{
if (isFirst)
{
isFirst = false;
}
else
{
sb.append(", ");
}
sb.append(elements.toString(element));
}
sb.append('}');
return sb.toString();
}
public Class<Set<T>> getType()
{
return (Class) Set.class;
}
}
|
[
"fraczwojciech@gmail.com"
] |
fraczwojciech@gmail.com
|
3082b536f6e6452baaf983bb3259a944fddadd48
|
fdd4cc6f8b5a473c0081af5302cb19c34433a0cf
|
/src/modules/agrega/auditoria/src/main/java/es/pode/auditoria/negocio/servicios/pool/PoolBuscarException.java
|
e336641b3520b2aa0f29dec2e5f8401cab704035
|
[] |
no_license
|
nwlg/Colony
|
0170b0990c1f592500d4869ec8583a1c6eccb786
|
07c908706991fc0979e4b6c41d30812d861776fb
|
refs/heads/master
| 2021-01-22T05:24:40.082349
| 2010-12-23T14:49:00
| 2010-12-23T14:49:00
| null | 0
| 0
| null | null | null | null |
WINDOWS-1252
|
Java
| false
| false
| 1,789
|
java
|
/* Agrega es una federación de repositorios de objetos digitales educativos formada por todas las Comunidades Autónomas propiedad de Red.es. Este código ha sido desarrollado por la Entidad Pública Empresarial red.es adscrita al Ministerio de Industria,Turismo y Comercio a través de la Secretaría de Estado de Telecomunicaciones y para la Sociedad de la Información, dentro del Programa Internet en el Aula, que se encuadra dentro de las actuaciones previstas en el Plan Avanza (Plan 2006-2010 para el desarrollo de la Sociedad de la Información y de Convergencia con Europa y entre Comunidades Autónomas y Ciudades Autónomas) y ha sido cofinanciado con fondos FEDER del Programa Operativo FEDER 2000-2006 “Sociedad de la Información”
This program is free software: you can redistribute it and/or modify it under the terms of the European Union Public Licence (EUPL v.1.0). 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 European Union Public Licence (EUPL v.1.0). You should have received a copy of the EUPL licence along with this program. If not, see http://ec.europa.eu/idabc/en/document/7330.
*/
package es.pode.auditoria.negocio.servicios.pool;
public class PoolBuscarException extends RuntimeException {
public PoolBuscarException() {
super();
}
public PoolBuscarException(String message) {
super(message);
}
public PoolBuscarException(String message, Throwable cause) {
super(message, cause);
}
public PoolBuscarException(Throwable cause) {
super(cause);
}
public final Throwable getInitialCause() {
return super.getCause();
}
}
|
[
"build@zeno.siriusit.co.uk"
] |
build@zeno.siriusit.co.uk
|
06f4d4a479be9936fa9a96587b725213efeefbdd
|
a836fb4715396f82f91a919effc644c873e9b8b2
|
/skWeiChatBaidu/src/main/java/com/vkzwbim/chat/bean/EventRoomNotice.java
|
538b87759b0909740b4cd371381d0b2dca305c0c
|
[] |
no_license
|
iuvei/zhongixn
|
a4a459cca817a748189efb13f7d8b03ddce0bbf0
|
c3953350d2d30b16361a87ba06cb1d83ef8fc68f
|
refs/heads/master
| 2023-03-17T12:59:11.192586
| 2020-08-13T07:34:43
| 2020-08-13T07:34:43
| null | 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 223
|
java
|
package com.vkzwbim.chat.bean;
public class EventRoomNotice {
private String text;
public EventRoomNotice(String text) {
this.text = text;
}
public String getText() {
return text;
}
}
|
[
"cheng3099@126.com"
] |
cheng3099@126.com
|
887b6fbe4d3dcd201299c7f101c97c3b26e15e9b
|
83d56024094d15f64e07650dd2b606a38d7ec5f1
|
/sicc_druida/fuentes/java/RecParamNmperTransactionQuery.java
|
2a693f534b5dc71b156e1fbdfc2e6c249578967f
|
[] |
no_license
|
cdiglesias/SICC
|
bdeba6af8f49e8d038ef30b61fcc6371c1083840
|
72fedb14a03cb4a77f62885bec3226dbbed6a5bb
|
refs/heads/master
| 2021-01-19T19:45:14.788800
| 2016-04-07T16:20:51
| 2016-04-07T16:20:51
| null | 0
| 0
| null | null | null | null |
ISO-8859-1
|
Java
| false
| false
| 6,156
|
java
|
/*
INDRA/CAR/mmg
$Id: RecParamNmperTransactionQuery.java,v 1.1 2009/12/03 18:39:43 pecbazalar Exp $
DESC
*/
import java.util.*;
import es.indra.utils.*;
import es.indra.druida.belcorp.MMGDruidaHelper;
import es.indra.druida.belcorp.MMGDruidaTransaction;
import es.indra.druida.belcorp.MMGException;
import es.indra.druida.belcorp.MMGNoSessionException;
import es.indra.druida.DruidaConector;
import es.indra.mare.common.dto.MareDTO;
import es.indra.mare.common.dto.IMareDTO;
import es.indra.mare.common.mln.MareBusinessID;
import es.indra.sicc.util.UtilidadesSession;
import es.indra.belcorp.mso.*;
// Definicion de la clase
public class RecParamNmperTransactionQuery extends MMGDruidaTransaction {
//Constante que determina el atributo chocice de la entidada
//Constantes usadas en la clase. Simplemente representan
//los nombre de conectore y de logicas de negocio
public static final String BUSINESSID_QUERY = "MMGRecParamNmperQueryFromToUserPage";
public static final String CONECTOR_QUERY_LIST = "RecParamNmperConectorQueryList";
// Definicion del constructor
public RecParamNmperTransactionQuery(){
super();
}
// Definicion del metodo abstracto ejecucion
public void ejecucion() throws Exception {
try{
//Ejecutamos las acciones comunes
super.ejecucion();
//Metemos en la sesión la query de la busqueda en formato param1|param2|....|paramN(para el tema de volver a la
//pagina anterior y ,mantener los últimos resultados)
conectorParametroSesion(SESSION_ATTRIBUTE_LAST_QUERY,
conectorParametroSesion(SESSION_ATTRIBUTE_LAST_QUERY));
traza("MMG:: LLegao a transaction Query de entidad RecParamNmper");
String ticlOidTipoClie = (String)getEntrada("ticlOidTipoClie");
traza("MMG:: Valor de atributo ticlOidTipoClie: " + ticlOidTipoClie);
String pperOidPrecPerd = (String)getEntrada("pperOidPrecPerd");
traza("MMG:: Valor de atributo pperOidPrecPerd: " + pperOidPrecPerd);
String valPorcReca = (String)getEntrada("valPorcReca");
traza("MMG:: Valor de atributo valPorcReca: " + valPorcReca);
String indParaModi = (String)getEntrada("indParaModi");
traza("MMG:: Valor de atributo indParaModi: " + indParaModi);
//Construimos los MSOs (from y to) con los elementos de la búsqueda
RecParamNmperData recParamNmperFrom =new RecParamNmperData();
RecParamNmperData recParamNmperTo = new RecParamNmperData();
//Construimos el from. Los campos que no sean de intervalo ponemos
//el mismo valor que el from. y los que si sen de intervalo ponemos el valor
//corespondiente
es.indra.belcorp.mso.MaeTipoClienData ticlOidTipoClieData = null;
if(ticlOidTipoClie != null && !ticlOidTipoClie.trim().equals("")){
ticlOidTipoClieData = new es.indra.belcorp.mso.MaeTipoClienData();
ticlOidTipoClieData.setId(new Long(ticlOidTipoClie));
}
recParamNmperFrom.setTiclOidTipoClie(ticlOidTipoClieData);
es.indra.belcorp.mso.RecPreciPerdiData pperOidPrecPerdData = null;
if(pperOidPrecPerd != null && !pperOidPrecPerd.trim().equals("")){
pperOidPrecPerdData = new es.indra.belcorp.mso.RecPreciPerdiData();
pperOidPrecPerdData.setId(new Long(pperOidPrecPerd));
}
recParamNmperFrom.setPperOidPrecPerd(pperOidPrecPerdData);
recParamNmperFrom.setValPorcReca(
(java.lang.Double)FormatUtils.parseObject(valPorcReca, "java.lang.Double",
MMGDruidaHelper.getUserDecimalFormatPattern(this)
, MMGDruidaHelper.getUserDecimalFormatSymbols(this)));
recParamNmperFrom.setIndParaModi(
(java.lang.Long)FormatUtils.parseObject(indParaModi, "java.lang.Long",
MMGDruidaHelper.getUserDecimalFormatPattern(this)
, MMGDruidaHelper.getUserDecimalFormatSymbols(this)));
//Construimos el to
recParamNmperTo = (RecParamNmperData)recParamNmperFrom.clone();
//Metemos tanto el fromo como el to como últimos mso con parámetros de búsqueda
conectorParametroSesion(SESSION_ATTRIBUTE_LAST_QUERY_OBJ_FROM, recParamNmperFrom);
conectorParametroSesion(SESSION_ATTRIBUTE_LAST_QUERY_OBJ_TO, recParamNmperTo);
//Sacamos los datos de paginación
Integer pageCount = new Integer((String)getEntrada("pageCount"));
Integer pageSize = new Integer((String)getEntrada("pageSize"));
//Creamos el dto y el bussines id correspondientes a la acción de realiza una query
Vector datos = new Vector();
MareDTO dto = new MareDTO();
dto.addProperty("recParamNmperFrom", recParamNmperFrom);
dto.addProperty("recParamNmperTo", recParamNmperTo);
dto.addProperty("pageCount", pageCount);
dto.addProperty("pageSize", pageSize);
dto.addProperty("userProperties", MMGDruidaHelper.getUserProperties(this));
datos.add(dto);
datos.add(new MareBusinessID(BUSINESSID_QUERY));
//Ejecutamos la acción de prequery
cmdPreQuery(recParamNmperFrom, recParamNmperTo);
//Invocamos la lógica de negocio
traza("MMG:: Iniciada ejecución Query de entidad RecParamNmper");
DruidaConector conectorQuery = conectar(CONECTOR_QUERY_LIST, datos);
traza("MMG:: Finalizada ejecución Query de entidad RecParamNmper");
//Ejecutamos la acción de postquery
cmdPostQuery(recParamNmperFrom, recParamNmperTo, conectorQuery);
//Definimos el resultado del conector
setConector(conectorQuery);
}catch(Exception e){
handleException(e);
}
}
public void cmdPreQuery(RecParamNmperData recParamNmperFrom, RecParamNmperData recParamNmperTo) throws Exception{
SegPaisViewData paisOculto = new SegPaisViewData(); paisOculto.setId(new Long(MMGDruidaHelper.getUserDefaultCountry(this)));
recParamNmperFrom.setPaisOidPais(paisOculto); recParamNmperTo.setPaisOidPais((SegPaisViewData)paisOculto.clone());
}
public void cmdPostQuery(RecParamNmperData recParamNmperFrom, RecParamNmperData recParamNmperTo, DruidaConector result) throws Exception{
SegPaisViewData paisOculto = new SegPaisViewData(); paisOculto.setId(new Long(MMGDruidaHelper.getUserDefaultCountry(this)));
recParamNmperFrom.setPaisOidPais(paisOculto); recParamNmperTo.setPaisOidPais((SegPaisViewData)paisOculto.clone());
}
}
|
[
"hp.vega@hotmail.com"
] |
hp.vega@hotmail.com
|
5081d947dd69fcb6a840b852f64b5706ef32b04f
|
e5bb4c1c5cb3a385a1a391ca43c9094e746bb171
|
/WeiXin/trunk/zhaocaixing/src/main/java/com/hzfh/weixin/facade/customer/ActivityExperienceGoldFacade.java
|
33532829282471ad346b7b6e5c4d3c445207aa2a
|
[] |
no_license
|
FashtimeDotCom/huazhen
|
397143967ebed9d50073bfa4909c52336a883486
|
6484bc9948a29f0611855f84e81b0a0b080e2e02
|
refs/heads/master
| 2021-01-22T14:25:04.159326
| 2016-01-11T09:52:40
| 2016-01-11T09:52:40
| null | 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 2,550
|
java
|
package com.hzfh.weixin.facade.customer;
import com.hzfh.api.customer.model.ActivityCondition;
import com.hzfh.api.customer.model.ActivityExperienceGold;
import com.hzfh.api.customer.model.query.ActivityExperienceGoldCondition;
import com.hzfh.api.customer.service.ActivityExperienceGoldService;
import com.hzframework.contract.PagedList;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;
import java.util.List;
public class ActivityExperienceGoldFacade {
private static ApplicationContext context = new ClassPathXmlApplicationContext("spring/hessian-customer.xml");
public static PagedList<ActivityExperienceGold> getPagingList(ActivityExperienceGoldCondition activityExperienceGoldCondition) {
ActivityExperienceGoldService activityExperienceGoldService = (ActivityExperienceGoldService) context.getBean("activityExperienceGoldService");
return activityExperienceGoldService.getPagingList(activityExperienceGoldCondition);
}
public static int add(ActivityExperienceGold activityExperienceGold){
ActivityExperienceGoldService activityExperienceGoldService = (ActivityExperienceGoldService) context.getBean("activityExperienceGoldService");
return activityExperienceGoldService.add(activityExperienceGold);
}
public static int update(ActivityExperienceGold activityExperienceGold){
ActivityExperienceGoldService activityExperienceGoldService = (ActivityExperienceGoldService) context.getBean("activityExperienceGoldService");
return activityExperienceGoldService.update(activityExperienceGold);
}
public static List<ActivityExperienceGold> getList(){
ActivityExperienceGoldService activityExperienceGoldService = (ActivityExperienceGoldService) context.getBean("activityExperienceGoldService");
return activityExperienceGoldService.getList();
}
public static ActivityExperienceGold getInfo(int id){
ActivityExperienceGoldService activityExperienceGoldService = (ActivityExperienceGoldService) context.getBean("activityExperienceGoldService");
return activityExperienceGoldService.getInfo(id);
}
public static List<ActivityExperienceGold> getActExperienceGoldModelByActId(int parseInt) {
ActivityExperienceGoldService activityExperienceGoldService = (ActivityExperienceGoldService) context.getBean("activityExperienceGoldService");
return activityExperienceGoldService.getActExperienceGoldModelByActId(parseInt);
}
}
|
[
"ulei0343@163.com"
] |
ulei0343@163.com
|
76ccd3414ce44c1422c227d5aae35244dfa9942f
|
79f38f93cfcd47711fe9db76b2b56ef37f18bf92
|
/telegraph/cq/core-app/core-app-commons/src/main/java/uk/co/telegraph/core/commons/travel/apollo/impl/api/DefaultApolloHotelService.java
|
ad3406ec8ff27c9405edbd1fda0044a71f50cb21
|
[] |
no_license
|
jsdelivrbot/ionic4-angular6
|
3a6361bce9db129fbc841ee31fc029abe14ea273
|
0c67b344397c1ce276a808388f602ea68becaf2e
|
refs/heads/master
| 2020-04-10T13:58:48.155725
| 2018-12-09T12:53:32
| 2018-12-09T12:53:32
| null | 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 1,613
|
java
|
package uk.co.telegraph.core.commons.travel.apollo.impl.api;
import java.util.List;
import com.google.common.cache.LoadingCache;
import org.apache.felix.scr.annotations.Component;
import org.apache.felix.scr.annotations.Properties;
import org.apache.felix.scr.annotations.Property;
import org.apache.felix.scr.annotations.Reference;
import org.apache.felix.scr.annotations.Service;
import org.osgi.framework.Constants;
import uk.co.telegraph.core.commons.travel.api.models.HotelModelData;
import uk.co.telegraph.core.commons.travel.apollo.ApolloHotelService;
/**
* Service for getting {@link HotelModelData} objects using Guava {@link LoadingCache}
*/
@Component(immediate = true, metatype = true, label = "TMG - Travel Apollo Hotel Interface", description = "")
@Service
@Properties({@Property(name = Constants.SERVICE_VENDOR, value = "Telegraph Media Group"),
@Property(name = Constants.SERVICE_DESCRIPTION, value = ""),
@Property(name = "allowBlank", description = "Allow the service to return an blank response", boolValue = true)
})
public class DefaultApolloHotelService extends AbstractApolloProductService<HotelModelData> implements ApolloHotelService {
@Reference(target = "(cache.name=hotel)")
private LoadingCache<String, HotelModelData> cache;
@Override
protected LoadingCache<String, HotelModelData> getCache() {
return cache;
}
@Override
public HotelModelData getHotelByFlakeId(final String flakeId) {
return getProductData(flakeId);
}
@Override
public List<HotelModelData> getHotelsByFlakeIds(final Iterable<String> flakeIds) {
return getProductData(flakeIds);
}
}
|
[
"d15_1_89@msn.com"
] |
d15_1_89@msn.com
|
07fd2a7c05433a78eb1b738350f24cea04ecf135
|
55821b09861478c6db214d808f12f493f54ff82a
|
/trunk/java.prj/ITSMCSharp2Java/Fusion.Foundation/Fusion/IPromptSettings.java
|
18191363123a2637e99d4232b4c644b1b161b465
|
[] |
no_license
|
SiteView/ECC8.13
|
ede526a869cf0cb076cd9695dbc16075a1cf9716
|
bced98372138b09140dc108b33bb63f33ef769fe
|
refs/heads/master
| 2016-09-05T13:57:21.282048
| 2012-06-12T08:54:40
| 2012-06-12T08:54:40
| null | 0
| 0
| null | null | null | null |
WINDOWS-1252
|
Java
| false
| false
| 967
|
java
|
package Fusion;
/**
* @author Administrator
* @version 1.0
* @created 20-ËÄÔÂ-2010 14:33:53
*/
public interface IPromptSettings {
/**
*
* @param strQueryPromptId
*/
public void ClearQueryPromptSettings(String strQueryPromptId);
/**
*
* @param strQueryPromptId
* @param strQueryPromptName
*/
public boolean Contains(String strQueryPromptId, String strQueryPromptName);
/**
*
* @param strQueryPromptId
* @param bDeleteChilds
*/
public void DeleteQueryPromptSetting(String strQueryPromptId, boolean bDeleteChilds);
/**
*
* @param strQueryPromptId
*/
public void FlushQueryPromptSetting(String strQueryPromptId);
/**
*
* @param strQueryPromptId
*/
public List GetQueryPromptSettings(String strQueryPromptId);
/**
*
* @param strQueryPromptId
* @param QueryPrompts
*/
public void SetQueryPromptSettings(String strQueryPromptId, List QueryPrompts);
}
|
[
"136122085@163.com"
] |
136122085@163.com
|
6e7e46bf0f25b48581f1d292e514921e47c10ed7
|
4192d19e5870c22042de946f211a11c932c325ec
|
/j-hi-20110703/src/org/hi/i18n/model/original/LanguageStrAbstract.java
|
71ab20d89bd9c5c66ff3656ec55c1d89746c46b4
|
[] |
no_license
|
arthurxiaohz/ic-card
|
1f635d459d60a66ebda272a09ba65e616d2e8b9e
|
5c062faf976ebcffd7d0206ad650f493797373a4
|
refs/heads/master
| 2021-01-19T08:15:42.625340
| 2013-02-01T06:57:41
| 2013-02-01T06:57:41
| 39,082,049
| 2
| 1
| null | null | null | null |
GB18030
|
Java
| false
| false
| 4,586
|
java
|
package org.hi.i18n.model.original;
import java.io.Serializable;
import java.sql.Timestamp;
import java.util.Date;
import java.util.List;
import org.hi.framework.model.BaseObject;
import org.apache.commons.lang.builder.ToStringBuilder;
import org.apache.commons.lang.builder.HashCodeBuilder;
import org.apache.commons.lang.builder.ToStringStyle;
import org.hi.i18n.model.LanguageStr;
import org.hi.i18n.model.Language;
import org.hi.base.organization.model.HiUser;
public abstract class LanguageStrAbstract extends BaseObject implements Serializable{
/**
* 主键id
*/
protected Integer id;
/**
* 版本控制version
*/
protected Integer version;
/**
* language
*/
protected Language language;
/**
* 语言代码
*/
protected String languageCode;
/**
* 值
*/
protected String value;
/**
* 创建人
*/
protected HiUser creator = org.hi.framework.security.context.UserContextHelper.getUser();
public Integer getId() {
return this.id;
}
public void setId(Integer id) {
if((id != null && this.id == null) ||
this.id != null && (!this.id.equals(id) || id == null)){
this.setDirty(true);
this.oldValues.put("id", this.id);
}
this.id = id;
}
public Integer getVersion() {
return this.version;
}
public void setVersion(Integer version) {
if((version != null && this.version == null) ||
this.version != null && (!this.version.equals(version) || version == null)){
this.setDirty(true);
this.oldValues.put("version", this.version);
}
this.version = version;
}
public Language getLanguage() {
return this.language;
}
public void setLanguage(Language language) {
if((language != null && this.language == null) ||
this.language != null && (!this.language.equals(language) || language == null)){
this.setDirty(true);
this.oldValues.put("language", this.language);
}
this.language = language;
}
public BaseObject getParentEntity(){
return this.language;
}
public void setParentEntity(BaseObject parent){
this.language = (Language)parent;
}
public String getLanguageCode() {
return this.languageCode;
}
public void setLanguageCode(String languageCode) {
if((languageCode != null && this.languageCode == null) ||
this.languageCode != null && (!this.languageCode.equals(languageCode) || languageCode == null)){
this.setDirty(true);
this.oldValues.put("languageCode", this.languageCode);
}
this.languageCode = languageCode;
}
public String getValue() {
return this.value;
}
public void setValue(String value) {
if((value != null && this.value == null) ||
this.value != null && (!this.value.equals(value) || value == null)){
this.setDirty(true);
this.oldValues.put("value", this.value);
}
this.value = value;
}
public HiUser getCreator() {
return this.creator;
}
public void setCreator(HiUser creator) {
if((creator != null && this.creator == null) ||
this.creator != null && (!this.creator.equals(creator) || creator == null)){
this.setDirty(true);
this.oldValues.put("creator", this.creator);
}
this.creator = creator;
}
public boolean equals(Object other) {
if ( (this == other ) ) return true;
if ( (other == null ) ) return false;
if ( !(other instanceof LanguageStr) ) return false;
LanguageStr castOther = ( LanguageStr ) other;
return ( (this.getId()==castOther.getId()) || ( this.getId()!=null && castOther.getId()!=null && this.getId().equals(castOther.getId()) ) );
}
public int hashCode() {
HashCodeBuilder hcb = new HashCodeBuilder(17, 37);
hcb.append(getId());
hcb.append("LanguageStr".hashCode());
return hcb.toHashCode();
}
public String toString() {
ToStringBuilder sb = new ToStringBuilder(this, ToStringStyle.DEFAULT_STYLE);
sb.append("id", this.id)
.append("languageCode", this.languageCode)
.append("value", this.value);
return sb.toString();
}
public Serializable getPrimarykey(){
return id;
}
}
|
[
"Angi.Wang.AFE@gmail.com"
] |
Angi.Wang.AFE@gmail.com
|
f8242543bd438c44b293e52faa24c815d72433d8
|
995f73d30450a6dce6bc7145d89344b4ad6e0622
|
/Honor5C-7.0/src/main/java/dalvik/bytecode/OpcodeInfo.java
|
f2af7c1c1333ae060ed10f7e17be362c75938a34
|
[] |
no_license
|
morningblu/HWFramework
|
0ceb02cbe42585d0169d9b6c4964a41b436039f5
|
672bb34094b8780806a10ba9b1d21036fd808b8e
|
refs/heads/master
| 2023-07-29T05:26:14.603817
| 2021-09-03T05:23:34
| 2021-09-03T05:23:34
| null | 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 1,646
|
java
|
package dalvik.bytecode;
public final class OpcodeInfo {
public static final int MAXIMUM_PACKED_VALUE = 0;
public static final int MAXIMUM_VALUE = 0;
static {
/* JADX: method processing error */
/*
Error: jadx.core.utils.exceptions.DecodeException: Load method exception in method: dalvik.bytecode.OpcodeInfo.<clinit>():void
at jadx.core.dex.nodes.MethodNode.load(MethodNode.java:113)
at jadx.core.dex.nodes.ClassNode.load(ClassNode.java:256)
at jadx.core.ProcessClass.process(ProcessClass.java:34)
at jadx.api.JadxDecompiler.processClass(JadxDecompiler.java:281)
at jadx.api.JavaClass.decompile(JavaClass.java:59)
at jadx.api.JadxDecompiler$1.run(JadxDecompiler.java:161)
Caused by: jadx.core.utils.exceptions.DecodeException: in method: dalvik.bytecode.OpcodeInfo.<clinit>():void
at jadx.core.dex.instructions.InsnDecoder.decodeInsns(InsnDecoder.java:46)
at jadx.core.dex.nodes.MethodNode.load(MethodNode.java:98)
... 5 more
Caused by: java.lang.IllegalArgumentException: bogus opcode: 0073
at com.android.dx.io.OpcodeInfo.get(OpcodeInfo.java:1197)
at com.android.dx.io.OpcodeInfo.getFormat(OpcodeInfo.java:1212)
at com.android.dx.io.instructions.DecodedInstruction.decode(DecodedInstruction.java:72)
at jadx.core.dex.instructions.InsnDecoder.decodeInsns(InsnDecoder.java:43)
... 6 more
*/
/*
// Can't load method instructions.
*/
throw new UnsupportedOperationException("Method not decompiled: dalvik.bytecode.OpcodeInfo.<clinit>():void");
}
public static boolean isInvoke(int packedOpcode) {
return false;
}
private OpcodeInfo() {
}
}
|
[
"dstmath@163.com"
] |
dstmath@163.com
|
adc9fab33cfebf494bbc13d0b537703f9cfa6aef
|
750d26eef421463a1f8e8cb4e825808d419adb21
|
/bakk/OOP WS08/src/aufgabe5/flo/List.java
|
f9a4d45fe94e91299ae65f692a9846797860e3fa
|
[
"Apache-2.0"
] |
permissive
|
dzena/tuwien
|
d5e47e8441058e4845f39cac019dff3024b670c9
|
80bfb4cf2f3ee2cc1761930465b776a0befccd4b
|
refs/heads/master
| 2021-01-18T17:20:13.376444
| 2013-11-01T19:45:39
| 2013-11-01T19:45:39
| 59,845,669
| 28
| 0
| null | 2016-05-27T15:43:56
| 2016-05-27T15:43:56
| null |
UTF-8
|
Java
| false
| false
| 1,020
|
java
|
package aufgabe5.flo;
/**
* @author GEMEH, FLRAU, PAFAV
*
* Creates a simple List
*
*/
public class List<A> implements Collection<A> {
protected Node head = null;
protected Node tail = null;
/**
* Subclass Node
*/
protected class Node {
A elem;
Node next = null;
Node (A elem) {this.elem = elem;}
}
/**
* Subclass Iterator
*/
protected class ListIter implements Iterator<A>{
protected Node p = head;
public ListIter() {
// Iterator begins with head
p = head;
}
public boolean hasNext() {
// true if there is a next Element
return p != null;
}
public A next(){
// returns the next Element
if (p == null) return null;
A elem = p.elem;
p = p.next;
return elem;
}
}
public void add(A x) {
// Expects an Element x and inserts it into the list
if (head == null) tail = head = new Node(x);
else tail = tail.next = new Node(x);
}
public Iterator<A> iterator() {
// returns the iterator of the list
return new ListIter();
}
}
|
[
"patrick.favrebulle@gmail.com"
] |
patrick.favrebulle@gmail.com
|
a3adf8188f73d2057170e8eeb9598069a765dbe4
|
d5c5cfe894ae5833918bd396c5bd01fc8a1a8ffa
|
/bump-fitlibrary-eclipse-workspace/FitLibrary20091020/src/fitlibrary/specify/exception/NoNullaryConstructor.java
|
08cc8d96f7d178d6a69db956e163c53786533132
|
[] |
no_license
|
afamee/DbFit-deps
|
80db2fc3919c30b900c01012788d293ea5e1c07c
|
2610dfc6f4573e3eda3a8c68369d23b4571547da
|
refs/heads/master
| 2020-04-02T18:28:37.519147
| 2015-07-11T13:55:42
| 2015-07-11T13:55:42
| null | 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 322
|
java
|
/*
* Copyright (c) 2006 Rick Mugridge, www.RimuResearch.com
* Released under the terms of the GNU General Public License version 2 or later.
* Written: 19/08/2006
*/
package fitlibrary.specify.exception;
public class NoNullaryConstructor {
@SuppressWarnings("unused")
public NoNullaryConstructor(int i) {
//
}
}
|
[
"mark_matten@hotmail.com"
] |
mark_matten@hotmail.com
|
aea00ddbdcbc7b3393b5898aaec3d560a42af786
|
2cb5bc6510e3b16b220015cd044168f955a8f49d
|
/src/Server.java
|
fa84b18ddc74bc2aa7b3ff2966b0b8c574e05795
|
[] |
no_license
|
religious23/MyTomcat
|
fd363e4688dd54740970974b98d4de6a0bc3a8b6
|
8011c21be999fe2f9ca43e886feaed8deee95a6f
|
refs/heads/master
| 2023-04-24T04:10:19.260415
| 2021-05-07T11:33:15
| 2021-05-07T11:33:15
| 312,271,960
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 2,635
|
java
|
//import filter.FilterChain;
import filter_upgrade.FilterChain;
import io.Request;
import io.Response;
import servlet.Servlet;
import java.io.InputStream;// 磁盘IO
import java.io.OutputStream;// 网络IO BIO --NIO AIO
import java.net.ServerSocket;
import java.net.Socket;
/**
* @author 王文
* @date 2020/11/13
* @motto 恢弘志士之气,不宜妄自菲薄
*/
public class Server {
/**
* 启动
*/
public static void startServer(int port) throws Exception {
// 服务端套接字
ServerSocket serverSocket = new ServerSocket(port);
while (true) {
System.out.println("==== ==== ====");
Socket socket = serverSocket.accept();
// 获取输入输出流
InputStream inputStream = socket.getInputStream();
OutputStream outputStream = socket.getOutputStream();
Request request = new Request(inputStream);
Response response = new Response(outputStream);
// 执行servlet操作
String url = request.getRequestUrl();
String className = Mapping.getClassNameByUrl(url);
// 这一步 为了测试spring Dispatcher 固定写死 --> 改进 逻辑封装进方法里
// String className = "servlet.DispatcherServlet";
// System.out.println(url + "-" + className);// servlet.MyServlet
if (className != null) {
// String className = "servlet.DispatcherServlet";
// 多态
Class<Servlet> clazz = (Class<Servlet>) Class.forName(className);
// 根据类创建对象
Servlet servlet = clazz.newInstance();// MyServlet
// 执行过滤器操作
//filterExec(request);
filterUpgradeExec(servlet, request, response);// 最终版
// 通过过滤器条件来调用service
// servlet.service(request, response);
} else {
// mapping 不存在
response.write("Route doesn't exist:" + url);
}
response.close();
}
}
/**
* 做过滤器内容
*/
/* public static void filterExec(Request request) {
final FilterChain filterChain = new FilterChain();
filterChain.doFilter(request);
}*/
public static void filterUpgradeExec(Servlet servlet, Request request, Response response) {
final FilterChain filterChain = new FilterChain(servlet);
//filterChain.doFilter(request, response, filterChain);
filterChain.doFilter(request, response);
}
}
|
[
"myqq@qq.com"
] |
myqq@qq.com
|
7a40c87140e9c6b8e384dbd76c711784328e4301
|
642057b61201fedcf895584175e47572bc6f53fd
|
/src/main/java/io/geekshop/types/search/SinglePrice.java
|
0a411b8dae73adf5c46e5485382145823f7741b1
|
[
"MIT"
] |
permissive
|
jjnnzb/geekshop
|
cd27eb6c42cbad3225f5c0582b0b25cfd944029e
|
1cbc352b78de89f3a1db9e9c730b82dff850ea93
|
refs/heads/main
| 2023-02-12T15:59:49.326677
| 2021-01-12T10:01:38
| 2021-01-12T10:01:38
| null | 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 287
|
java
|
/*
* Copyright (c) 2020 GeekXYZ.
* All rights reserved.
*/
package io.geekshop.types.search;
import lombok.Data;
/**
* The price value where the result has a single price
*
* Created on Nov, 2020 by @author bobo
*/
@Data
public class SinglePrice {
private Integer value;
}
|
[
"bobo@spring2go.com"
] |
bobo@spring2go.com
|
5dffcda7e1d6cc9d6469bc3708556e85a082c20a
|
97fd02f71b45aa235f917e79dd68b61c62b56c1c
|
/src/main/java/com/tencentcloudapi/tcss/v20201101/models/ResetSecLogTopicConfigRequest.java
|
df2a6438b8e93547d681cd72e063d27e3ff2468f
|
[
"Apache-2.0"
] |
permissive
|
TencentCloud/tencentcloud-sdk-java
|
7df922f7c5826732e35edeab3320035e0cdfba05
|
09fa672d75e5ca33319a23fcd8b9ca3d2afab1ec
|
refs/heads/master
| 2023-09-04T10:51:57.854153
| 2023-09-01T03:21:09
| 2023-09-01T03:21:09
| 129,837,505
| 537
| 317
|
Apache-2.0
| 2023-09-13T02:42:03
| 2018-04-17T02:58:16
|
Java
|
UTF-8
|
Java
| false
| false
| 2,698
|
java
|
/*
* Copyright (c) 2017-2018 THL A29 Limited, a Tencent company. All Rights Reserved.
*
* 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.tencentcloudapi.tcss.v20201101.models;
import com.tencentcloudapi.common.AbstractModel;
import com.google.gson.annotations.SerializedName;
import com.google.gson.annotations.Expose;
import java.util.HashMap;
public class ResetSecLogTopicConfigRequest extends AbstractModel{
/**
* 配置类型(ckafka/cls)
*/
@SerializedName("ConfigType")
@Expose
private String ConfigType;
/**
* 日志类型
*/
@SerializedName("LogType")
@Expose
private String LogType;
/**
* Get 配置类型(ckafka/cls)
* @return ConfigType 配置类型(ckafka/cls)
*/
public String getConfigType() {
return this.ConfigType;
}
/**
* Set 配置类型(ckafka/cls)
* @param ConfigType 配置类型(ckafka/cls)
*/
public void setConfigType(String ConfigType) {
this.ConfigType = ConfigType;
}
/**
* Get 日志类型
* @return LogType 日志类型
*/
public String getLogType() {
return this.LogType;
}
/**
* Set 日志类型
* @param LogType 日志类型
*/
public void setLogType(String LogType) {
this.LogType = LogType;
}
public ResetSecLogTopicConfigRequest() {
}
/**
* NOTE: Any ambiguous key set via .set("AnyKey", "value") will be a shallow copy,
* and any explicit key, i.e Foo, set via .setFoo("value") will be a deep copy.
*/
public ResetSecLogTopicConfigRequest(ResetSecLogTopicConfigRequest source) {
if (source.ConfigType != null) {
this.ConfigType = new String(source.ConfigType);
}
if (source.LogType != null) {
this.LogType = new String(source.LogType);
}
}
/**
* Internal implementation, normal users should not use it.
*/
public void toMap(HashMap<String, String> map, String prefix) {
this.setParamSimple(map, prefix + "ConfigType", this.ConfigType);
this.setParamSimple(map, prefix + "LogType", this.LogType);
}
}
|
[
"tencentcloudapi@tencent.com"
] |
tencentcloudapi@tencent.com
|
37fe70738ff40b6c7b640ab8bc0622f07c70b305
|
0fd72486b3997aba7aeb915e78787e6af3ecf7e3
|
/app/src/main/java/com/tapc/platform/model/tcp/ClientOutputThread.java
|
a909696ad0e896dfb1573329ec53f697b4fc00cd
|
[] |
no_license
|
dylan-zwl/device
|
f99c70ec2850c473645aeea344d8ad491678626b
|
36d4f67021fce49b09f5c52fa19bb13fb9ad9a3f
|
refs/heads/master
| 2021-01-21T12:50:23.656339
| 2018-06-29T11:00:40
| 2018-06-29T11:00:40
| 102,101,101
| 1
| 1
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 1,512
|
java
|
package com.tapc.platform.model.tcp;
import android.util.Log;
import java.io.IOException;
import java.io.OutputStream;
import java.net.Socket;
public class ClientOutputThread extends Thread {
private Socket mSocket;
private OutputStream mOutputStream;
private boolean isStart = true;
private byte[] mDataBuffer;
public ClientOutputThread(Socket socket) {
this.mSocket = socket;
try {
mOutputStream = socket.getOutputStream();
} catch (IOException e) {
e.printStackTrace();
}
}
public void setStart(boolean isStart) {
this.isStart = isStart;
if (!isStart) {
synchronized (this) {
notifyAll();
}
}
}
public void sendMsg(byte[] dataBuffer) {
this.mDataBuffer = dataBuffer;
synchronized (this) {
notifyAll();
}
}
@Override
public void run() {
try {
while (isStart) {
if (mDataBuffer != null) {
mOutputStream.write(mDataBuffer);
mOutputStream.flush();
synchronized (this) {
wait();
}
}
}
mOutputStream.close();
} catch (InterruptedException e) {
e.printStackTrace();
} catch (IOException e) {
e.printStackTrace();
}
Log.d("tcp net", "clientOutputThread close");
}
}
|
[
"294598356@qq.com"
] |
294598356@qq.com
|
9c7ae89b9387b1e0006436d5c78ef79081d4f1da
|
eaadbbf75cefd3896ed93c45f23c30d9c4b80ff9
|
/sources/android/support/coreui/C0004R.java
|
3f8c790af5f5fb48af012674e0482cc2174afabb
|
[] |
no_license
|
Nicholas1771/Mighty_Monkey_Android_Game
|
2bd4db2951c6d491f38da8e5303e3c004b4331c7
|
042601e568e0c22f338391c06714fa104dba9a5b
|
refs/heads/master
| 2023-03-09T00:06:01.492150
| 2021-02-27T04:02:42
| 2021-02-27T04:02:42
| 342,766,422
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 6,963
|
java
|
package android.support.coreui;
import com.Azzuri.MightyMonkey.C0174R;
/* renamed from: android.support.coreui.R */
public final class C0004R {
/* renamed from: android.support.coreui.R$attr */
public static final class attr {
public static final int buttonSize = 2130771971;
public static final int circleCrop = 2130771970;
public static final int colorScheme = 2130771972;
public static final int imageAspectRatio = 2130771969;
public static final int imageAspectRatioAdjust = 2130771968;
public static final int scopeUris = 2130771973;
}
/* renamed from: android.support.coreui.R$color */
public static final class color {
public static final int common_google_signin_btn_text_dark = 2131034120;
public static final int common_google_signin_btn_text_dark_default = 2131034112;
public static final int common_google_signin_btn_text_dark_disabled = 2131034113;
public static final int common_google_signin_btn_text_dark_focused = 2131034114;
public static final int common_google_signin_btn_text_dark_pressed = 2131034115;
public static final int common_google_signin_btn_text_light = 2131034121;
public static final int common_google_signin_btn_text_light_default = 2131034116;
public static final int common_google_signin_btn_text_light_disabled = 2131034117;
public static final int common_google_signin_btn_text_light_focused = 2131034118;
public static final int common_google_signin_btn_text_light_pressed = 2131034119;
public static final int common_google_signin_btn_tint = 2131034122;
}
/* renamed from: android.support.coreui.R$drawable */
public static final class C0005drawable {
public static final int app_icon = 2130837504;
public static final int common_full_open_on_phone = 2130837505;
public static final int common_google_signin_btn_icon_dark = 2130837506;
public static final int common_google_signin_btn_icon_dark_focused = 2130837507;
public static final int common_google_signin_btn_icon_dark_normal = 2130837508;
public static final int common_google_signin_btn_icon_dark_normal_background = 2130837509;
public static final int common_google_signin_btn_icon_disabled = 2130837510;
public static final int common_google_signin_btn_icon_light = 2130837511;
public static final int common_google_signin_btn_icon_light_focused = 2130837512;
public static final int common_google_signin_btn_icon_light_normal = 2130837513;
public static final int common_google_signin_btn_icon_light_normal_background = 2130837514;
public static final int common_google_signin_btn_text_dark = 2130837515;
public static final int common_google_signin_btn_text_dark_focused = 2130837516;
public static final int common_google_signin_btn_text_dark_normal = 2130837517;
public static final int common_google_signin_btn_text_dark_normal_background = 2130837518;
public static final int common_google_signin_btn_text_disabled = 2130837519;
public static final int common_google_signin_btn_text_light = 2130837520;
public static final int common_google_signin_btn_text_light_focused = 2130837521;
public static final int common_google_signin_btn_text_light_normal = 2130837522;
public static final int common_google_signin_btn_text_light_normal_background = 2130837523;
public static final int googleg_disabled_color_18 = 2130837524;
public static final int googleg_standard_color_18 = 2130837525;
}
/* renamed from: android.support.coreui.R$id */
public static final class C0006id {
public static final int adjust_height = 2131165184;
public static final int adjust_width = 2131165185;
public static final int auto = 2131165190;
public static final int dark = 2131165191;
public static final int icon_only = 2131165187;
public static final int light = 2131165192;
public static final int none = 2131165186;
public static final int standard = 2131165188;
public static final int wide = 2131165189;
}
/* renamed from: android.support.coreui.R$integer */
public static final class integer {
public static final int google_play_services_version = 2130903040;
}
/* renamed from: android.support.coreui.R$string */
public static final class string {
public static final int app_name = 2130968593;
public static final int common_google_play_services_enable_button = 2130968577;
public static final int common_google_play_services_enable_text = 2130968578;
public static final int common_google_play_services_enable_title = 2130968579;
public static final int common_google_play_services_install_button = 2130968580;
public static final int common_google_play_services_install_text = 2130968581;
public static final int common_google_play_services_install_title = 2130968582;
public static final int common_google_play_services_notification_ticker = 2130968583;
public static final int common_google_play_services_unknown_issue = 2130968576;
public static final int common_google_play_services_unsupported_text = 2130968584;
public static final int common_google_play_services_update_button = 2130968585;
public static final int common_google_play_services_update_text = 2130968586;
public static final int common_google_play_services_update_title = 2130968587;
public static final int common_google_play_services_updating_text = 2130968588;
public static final int common_google_play_services_wear_update_text = 2130968589;
public static final int common_open_on_phone = 2130968590;
public static final int common_signin_button_text = 2130968591;
public static final int common_signin_button_text_long = 2130968592;
}
/* renamed from: android.support.coreui.R$style */
public static final class style {
public static final int UnityThemeSelector = 2131099648;
}
/* renamed from: android.support.coreui.R$styleable */
public static final class styleable {
public static final int[] LoadingImageView = {C0174R.attr.imageAspectRatioAdjust, C0174R.attr.imageAspectRatio, C0174R.attr.circleCrop};
public static final int LoadingImageView_circleCrop = 2;
public static final int LoadingImageView_imageAspectRatio = 1;
public static final int LoadingImageView_imageAspectRatioAdjust = 0;
public static final int[] SignInButton = {C0174R.attr.buttonSize, C0174R.attr.colorScheme, C0174R.attr.scopeUris};
public static final int SignInButton_buttonSize = 0;
public static final int SignInButton_colorScheme = 1;
public static final int SignInButton_scopeUris = 2;
}
}
|
[
"nicholasiozzo17@gmail.com"
] |
nicholasiozzo17@gmail.com
|
ee27a154ea7b8dbb6c3a7b4d64f97155617c93b2
|
ac72641cacd2d68bd2f48edfc511f483951dd9d6
|
/opscloud-service/src/main/java/com/baiyi/opscloud/mapper/jumpserver/PermsAssetpermissionMapper.java
|
8b301e1cdfd179d45826f2d666753847ad30f644
|
[] |
no_license
|
fx247562340/opscloud-demo
|
6afe8220ce6187ac4cc10602db9e14374cb14251
|
b608455cfa5270c8c021fbb2981cb8c456957ccb
|
refs/heads/main
| 2023-05-25T03:33:22.686217
| 2021-06-08T03:17:32
| 2021-06-08T03:17:32
| 373,446,042
| 1
| 1
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 248
|
java
|
package com.baiyi.opscloud.mapper.jumpserver;
import com.baiyi.opscloud.domain.generator.jumpserver.PermsAssetpermission;
import tk.mybatis.mapper.common.Mapper;
public interface PermsAssetpermissionMapper extends Mapper<PermsAssetpermission> {
}
|
[
"fanxin01@longfor.com"
] |
fanxin01@longfor.com
|
c2e10e7891708bb4df7fe414a4f60c09064bec94
|
37abbb3bc912370c88a6aec26b433421437a6e65
|
/fucai/japp_ticket_winning/src/main/java/com/cqfc/ticketwinning/testClient/RestartCalBDPrizeTest.java
|
6bd485cb1db25611523db550efe1fc3288f8deb4
|
[] |
no_license
|
ca814495571/javawork
|
cb931d2c4ff5a38cdc3e3023159a276b347b7291
|
bdfd0243b7957263ab7ef95a2a8f33fa040df721
|
refs/heads/master
| 2021-01-22T08:29:17.760092
| 2017-06-08T16:52:42
| 2017-06-08T16:52:42
| 92,620,274
| 3
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 766
|
java
|
package com.cqfc.ticketwinning.testClient;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;
import com.cqfc.common.zookeeper.InitZooKeeperBean;
import com.cqfc.ticketwinning.service.impl.RestartCalPrizeServiceImpl;
public class RestartCalBDPrizeTest {
public static void main(String[] args) {
InitZooKeeperBean zookeeper = new InitZooKeeperBean();
zookeeper.setHasDb(true);
zookeeper.start();
ApplicationContext applicationContext = new ClassPathXmlApplicationContext(
"spring.xml");
RestartCalPrizeServiceImpl taskService = applicationContext.getBean("restartCalPrizeServiceImpl", RestartCalPrizeServiceImpl.class);
taskService.restartCalBDPrizeAll(args[0]);
}
}
|
[
"an__chen@163.com"
] |
an__chen@163.com
|
26e16592566bb4d5a32ac0deaf1185197bcaa1b7
|
eb2921775c53c0ee2ddc89e8f744242d9d9f6793
|
/EBC_SoftwareEngineeringProject/src/example/calc/controller/ExitApplicationController.java
|
8d73281e4a91b7fa9d300f00185c60ef03e43edb
|
[] |
no_license
|
heineman/ebc-example
|
adcbc878ba03eec74c98775864a574754101dfd9
|
c29c1caf12d84f8048ec7f1b5aff54996bb85475
|
refs/heads/master
| 2023-09-05T03:31:40.506099
| 2021-11-10T16:00:42
| 2021-11-10T16:00:42
| 289,161,797
| 3
| 1
| null | 2020-12-08T13:30:48
| 2020-08-21T02:48:46
|
Java
|
UTF-8
|
Java
| false
| false
| 481
|
java
|
package example.calc.controller;
import javax.swing.JOptionPane;
import javax.swing.JFrame;
/**
* Controller to confirm request to exist application.
*/
public class ExitApplicationController {
JFrame app;
public ExitApplicationController(JFrame app) {
this.app = app;
}
public void process() {
int c = JOptionPane.showConfirmDialog (app, "Do you wish to exit Application?");
if (c == JOptionPane.OK_OPTION) {
app.setVisible(false);
app.dispose();
}
}
}
|
[
"heineman@cs.wpi.edu"
] |
heineman@cs.wpi.edu
|
1b01ef1c69a997d76d63502355057fab0314bc4a
|
634ca91ae18cb0bb3268e40779ad34c18cf365a9
|
/runescape-client/src/main/java/class231.java
|
92a7152b269801045def537c3cef7022a1ad607c
|
[
"BSD-2-Clause"
] |
permissive
|
Adam200214/runelite
|
bbb1426cab7a321263408d3043eace0b95363ed5
|
d13bc058d53b4f3e2e7d99c0a0839fe969acedef
|
refs/heads/master
| 2022-12-24T21:36:33.911880
| 2020-10-01T16:04:22
| 2020-10-01T16:04:22
| null | 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 3,416
|
java
|
import net.runelite.mapping.Export;
import net.runelite.mapping.ObfuscatedName;
import net.runelite.mapping.ObfuscatedSignature;
@ObfuscatedName("hm")
public class class231 {
@ObfuscatedName("o")
@ObfuscatedSignature(
descriptor = "Lic;"
)
@Export("ItemDefinition_archive")
static AbstractArchive ItemDefinition_archive;
@ObfuscatedName("ft")
@ObfuscatedSignature(
descriptor = "(IIIIZI)V",
garbageValue = "1537075351"
)
@Export("setViewportShape")
static final void setViewportShape(int var0, int var1, int var2, int var3, boolean var4) {
if (var2 < 1) { // L: 4175
var2 = 1;
}
if (var3 < 1) { // L: 4176
var3 = 1;
}
int var5 = var3 - 334; // L: 4177
int var6;
if (var5 < 0) { // L: 4179
var6 = Client.field769;
} else if (var5 >= 100) { // L: 4180
var6 = Client.field928;
} else {
var6 = (Client.field928 - Client.field769) * var5 / 100 + Client.field769; // L: 4181
}
int var7 = var3 * var6 * 512 / (var2 * 334); // L: 4182
int var8;
int var9;
short var18;
if (var7 < Client.field938) { // L: 4183
var18 = Client.field938; // L: 4184
var6 = var18 * var2 * 334 / (var3 * 512); // L: 4185
if (var6 > Client.field932) { // L: 4186
var6 = Client.field932; // L: 4187
var8 = var3 * var6 * 512 / (var18 * 334); // L: 4188
var9 = (var2 - var8) / 2; // L: 4189
if (var4) { // L: 4190
Rasterizer2D.Rasterizer2D_resetClip(); // L: 4191
Rasterizer2D.Rasterizer2D_fillRectangle(var0, var1, var9, var3, -16777216); // L: 4192
Rasterizer2D.Rasterizer2D_fillRectangle(var0 + var2 - var9, var1, var9, var3, -16777216); // L: 4193
}
var0 += var9; // L: 4195
var2 -= var9 * 2; // L: 4196
}
} else if (var7 > Client.field934) { // L: 4199
var18 = Client.field934; // L: 4200
var6 = var18 * var2 * 334 / (var3 * 512); // L: 4201
if (var6 < Client.field931) { // L: 4202
var6 = Client.field931; // L: 4203
var8 = var18 * var2 * 334 / (var6 * 512); // L: 4204
var9 = (var3 - var8) / 2; // L: 4205
if (var4) { // L: 4206
Rasterizer2D.Rasterizer2D_resetClip(); // L: 4207
Rasterizer2D.Rasterizer2D_fillRectangle(var0, var1, var2, var9, -16777216); // L: 4208
Rasterizer2D.Rasterizer2D_fillRectangle(var0, var3 + var1 - var9, var2, var9, -16777216); // L: 4209
}
var1 += var9; // L: 4211
var3 -= var9 * 2; // L: 4212
}
}
Client.viewportZoom = var3 * var6 / 334; // L: 4215
if (var2 != Client.viewportWidth || var3 != Client.viewportHeight) { // L: 4216
int[] var17 = new int[9]; // L: 4218
for (var9 = 0; var9 < var17.length; ++var9) { // L: 4219
int var10 = var9 * 32 + 15 + 128; // L: 4220
int var11 = var10 * 3 + 600; // L: 4223
int var13 = Rasterizer3D.Rasterizer3D_sine[var10]; // L: 4226
int var15 = var3 - 334; // L: 4229
if (var15 < 0) { // L: 4230
var15 = 0;
} else if (var15 > 100) { // L: 4231
var15 = 100;
}
int var16 = (Client.zoomWidth - Client.zoomHeight) * var15 / 100 + Client.zoomHeight; // L: 4232
int var14 = var11 * var16 / 256; // L: 4233
var17[var9] = var13 * var14 >> 16; // L: 4236
}
Scene.Scene_buildVisiblityMap(var17, 500, 800, var2 * 334 / var3, 334); // L: 4238
}
Client.viewportOffsetX = var0; // L: 4241
Client.viewportOffsetY = var1; // L: 4242
Client.viewportWidth = var2; // L: 4243
Client.viewportHeight = var3; // L: 4244
} // L: 4245
}
|
[
"thatgamerblue@gmail.com"
] |
thatgamerblue@gmail.com
|
be33138d572118a7a068daadf6fdfb36d02d8d8d
|
ee1fc12feef20f8ebe734911acdd02b1742e417c
|
/android_sourcecode/app/src/main/java/com/ak/pt/bean/AreaStudyBean.java
|
13b5ac34e8d4495c13a8dada9f5f77cb1394e9fb
|
[
"MIT"
] |
permissive
|
xiaozhangxin/test
|
aee7aae01478a06741978e7747614956508067ed
|
aeda4d6958f8bf7af54f87bc70ad33d81545c5b3
|
refs/heads/master
| 2021-07-15T21:52:28.171542
| 2020-03-09T14:30:45
| 2020-03-09T14:30:45
| 126,810,840
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 7,198
|
java
|
package com.ak.pt.bean;
import java.io.Serializable;
import java.util.List;
/**
* Created by admin on 2019/5/27.
*/
public class AreaStudyBean implements Serializable{
/**
* study_id : 2
* study_no : QYPX2019052789332
* staff_id : 113
* staff_name : 二哥
* department_name : 南方营销中心
* group_no : 001001
* address : 上海市静安区好几家
* content : 潘总
* remark : 投了
* study_state : wait_audit
* is_delete : 0
* study_time : 2019-05-27
* create_time : 2019-05-27 16:33:17
* update_time : 2019-05-27 16:33:17
* fileList : [{"file_id":2,"study_id":2,"file_name":"","file_url":"/images/area/20190527/15589459969651443153278.jpg","create_time":"2019-05-27 16:33:17"},{"file_id":3,"study_id":2,"file_name":"","file_url":"/images/area/20190527/15589459969662073297356.jpg","create_time":"2019-05-27 16:33:17"},{"file_id":4,"study_id":2,"file_name":"","file_url":"/images/area/20190527/1558945996967601976406.jpg","create_time":"2019-05-27 16:33:17"}]
* recordList : []
* job_name_list : []
* study_state_show : 待审阅
* job_name : 外部水工
* start_time :
* end_time :
* staff_uuid :
* group_parent_uuid :
*/
private String study_id;
private String study_no;
private String staff_id;
private String staff_name;
private String department_name;
private String group_no;
private String address;
private String content;
private String remark;
private String study_state;
private String is_delete;
private String study_time;
private String create_time;
private String update_time;
private String study_state_show;
private String job_name;
private String start_time;
private String end_time;
private String staff_uuid;
private String group_parent_uuid;
private List<FixFileBean> fileList;
private List<RecordBean> recordList;
private List<?> job_name_list;
public String getStudy_id() {
return study_id;
}
public void setStudy_id(String study_id) {
this.study_id = study_id;
}
public String getStudy_no() {
return study_no;
}
public void setStudy_no(String study_no) {
this.study_no = study_no;
}
public String getStaff_id() {
return staff_id;
}
public void setStaff_id(String staff_id) {
this.staff_id = staff_id;
}
public String getStaff_name() {
return staff_name;
}
public void setStaff_name(String staff_name) {
this.staff_name = staff_name;
}
public String getDepartment_name() {
return department_name;
}
public void setDepartment_name(String department_name) {
this.department_name = department_name;
}
public String getGroup_no() {
return group_no;
}
public void setGroup_no(String group_no) {
this.group_no = group_no;
}
public String getAddress() {
return address;
}
public void setAddress(String address) {
this.address = address;
}
public String getContent() {
return content;
}
public void setContent(String content) {
this.content = content;
}
public String getRemark() {
return remark;
}
public void setRemark(String remark) {
this.remark = remark;
}
public String getStudy_state() {
return study_state;
}
public void setStudy_state(String study_state) {
this.study_state = study_state;
}
public String getIs_delete() {
return is_delete;
}
public void setIs_delete(String is_delete) {
this.is_delete = is_delete;
}
public String getStudy_time() {
return study_time;
}
public void setStudy_time(String study_time) {
this.study_time = study_time;
}
public String getCreate_time() {
return create_time;
}
public void setCreate_time(String create_time) {
this.create_time = create_time;
}
public String getUpdate_time() {
return update_time;
}
public void setUpdate_time(String update_time) {
this.update_time = update_time;
}
public String getStudy_state_show() {
return study_state_show;
}
public void setStudy_state_show(String study_state_show) {
this.study_state_show = study_state_show;
}
public String getJob_name() {
return job_name;
}
public void setJob_name(String job_name) {
this.job_name = job_name;
}
public String getStart_time() {
return start_time;
}
public void setStart_time(String start_time) {
this.start_time = start_time;
}
public String getEnd_time() {
return end_time;
}
public void setEnd_time(String end_time) {
this.end_time = end_time;
}
public String getStaff_uuid() {
return staff_uuid;
}
public void setStaff_uuid(String staff_uuid) {
this.staff_uuid = staff_uuid;
}
public String getGroup_parent_uuid() {
return group_parent_uuid;
}
public void setGroup_parent_uuid(String group_parent_uuid) {
this.group_parent_uuid = group_parent_uuid;
}
public List<FixFileBean> getFileList() {
return fileList;
}
public void setFileList(List<FixFileBean> fileList) {
this.fileList = fileList;
}
public List<RecordBean> getRecordList() {
return recordList;
}
public void setRecordList(List<RecordBean> recordList) {
this.recordList = recordList;
}
public List<?> getJob_name_list() {
return job_name_list;
}
public void setJob_name_list(List<?> job_name_list) {
this.job_name_list = job_name_list;
}
public static class FileListBean {
/**
* file_id : 2
* study_id : 2
* file_name :
* file_url : /images/area/20190527/15589459969651443153278.jpg
* create_time : 2019-05-27 16:33:17
*/
private String file_id;
private String study_id;
private String file_name;
private String file_url;
private String create_time;
public String getFile_id() {
return file_id;
}
public void setFile_id(String file_id) {
this.file_id = file_id;
}
public String getStudy_id() {
return study_id;
}
public void setStudy_id(String study_id) {
this.study_id = study_id;
}
public String getFile_name() {
return file_name;
}
public void setFile_name(String file_name) {
this.file_name = file_name;
}
public String getFile_url() {
return file_url;
}
public void setFile_url(String file_url) {
this.file_url = file_url;
}
public String getCreate_time() {
return create_time;
}
public void setCreate_time(String create_time) {
this.create_time = create_time;
}
}
}
|
[
"xiaozhangxin@shifuhelp.com"
] |
xiaozhangxin@shifuhelp.com
|
0846702d064cb3445f1f550725c02d32fd78b3ac
|
fa91450deb625cda070e82d5c31770be5ca1dec6
|
/Diff-Raw-Data/13/13_9e16ebf272525781586990994c4f11e5c4357460/MenuBar/13_9e16ebf272525781586990994c4f11e5c4357460_MenuBar_s.java
|
a10a4c843de4117f2e1bc8b4666be072f0964a92
|
[] |
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
| 614
|
java
|
package jDistsim.ui;
import jDistsim.ui.form.DesignerForm;
import javax.swing.*;
/**
* Author: Jirka Pénzeš
* Date: 24.9.12
* Time: 21:22
*/
public class MenuBar extends JMenuBar {
private DesignerForm designerForm;
public MenuBar() {
this(null);
}
public MenuBar(DesignerForm designerForm) {
this.designerForm = designerForm;
JMenu menu;
JMenuItem menuItem;
menu = new JMenu("File");
menuItem = new JMenuItem("New model");
menu.add(menuItem);
add(menu);
}
}
|
[
"yuzhongxing88@gmail.com"
] |
yuzhongxing88@gmail.com
|
25e2b9a4b45698ff554f3c566f7ef8c4b9836425
|
3171702d22be1ea7c5a84b09aa9e89a8b035ceae
|
/no.hal.learning/no.hal.sharing.parent/no.hal.sharing/src/no/hal/sharing/AbstractSharingTransport.java
|
e461704ec242c173cef957b3da55445b0f21a919
|
[] |
no_license
|
hallvard/jexercise
|
345b728a84b89e43632eb95d825e9d86ea4cec58
|
0e6a911ea31d8f7f7dc0f288122214e239d9d5eb
|
refs/heads/master
| 2021-05-25T09:19:30.421067
| 2020-12-14T15:57:44
| 2020-12-14T15:57:44
| 1,203,162
| 5
| 17
| null | 2020-10-13T10:16:03
| 2010-12-28T15:06:53
|
Java
|
UTF-8
|
Java
| false
| false
| 2,439
|
java
|
package no.hal.sharing;
import java.util.ArrayList;
import java.util.Collection;
import java.util.HashMap;
import java.util.Map;
import org.eclipse.emf.ecore.resource.ResourceSet;
import no.hal.sharing.util.Util;
public abstract class AbstractSharingTransport implements SharingTransport {
private Map<String, Collection<Subscriber>> subscribers = new HashMap<String, Collection<Subscriber>>();
private String WILD_CARD = "*";
protected String getKey(String from, String to) {
return (from != null ? from : WILD_CARD) + "->" + (to != null ? to : WILD_CARD);
}
@Override
public void subscribe(Subscriber subscriber, String from, String to) {
String key = getKey(from, to);
Collection<Subscriber> col = subscribers.get(key);
if (col == null) {
col = new ArrayList<SharingTransport.Subscriber>();
subscribers.put(key, col);
}
if (! col.contains(subscriber)) {
col.add(subscriber);
}
}
@Override
public void unsubscribe(Subscriber subscriber, String from, String to) {
String key = getKey(from, to);
Collection<Subscriber> col = subscribers.get(key);
if (col != null && col.remove(subscriber) && col.isEmpty()) {
subscribers.remove(key);
}
}
protected void fireReceived(SharedResource shared) {
Collection<Subscriber> notified = new ArrayList<SharingTransport.Subscriber>();
fireReceived(subscribers.get(getKey(shared.from, shared.to)), shared, notified);
fireReceived(subscribers.get(getKey(null, shared.to)), shared, notified);
fireReceived(subscribers.get(getKey(shared.from, null)), shared, notified);
fireReceived(subscribers.get(getKey(null, null)), shared, notified);
}
private void fireReceived(Collection<Subscriber> subscribers, SharedResource shared, Collection<Subscriber> notified) {
if (subscribers != null) {
for (Subscriber subscriber : subscribers) {
if (! notified.contains(subscriber)) {
notified.add(subscriber);
subscriber.receivedResource(shared);
}
}
}
}
protected SharedResource decodePayload(SharedResource sharedResource) {
if (sharedResource instanceof SharedBytes) {
ResourceSet resourceSet = Util.fromByteArray(sharedResource.getPath().lastSegment(), sharedResource.getContents());
if (resourceSet != null) {
sharedResource = new SharedEmfResourceSet(sharedResource.key, sharedResource.from, sharedResource.to, sharedResource.getPath(), resourceSet);
}
}
return sharedResource;
}
}
|
[
"hal@ntnu.no"
] |
hal@ntnu.no
|
cdf2a53c4951ce162f534441ff070327ecf3ceaa
|
adddfae434c0280a3aa959b0bf0eb9b309eebbea
|
/sl-mall/slmall-module/slmall-portal/src/main/java/com/cycloneboy/springcloud/slmall/module/portal/controller/UserController.java
|
dfe169193dc66bf123dc6c83eb9ce87e410c1010
|
[] |
no_license
|
CycloneBoy/springcloud-learn
|
957ec212d05e1aa281354f10d25ec23fa26132da
|
821815806c36d2936c8ba40631bd685938e416ef
|
refs/heads/master
| 2022-06-28T02:51:16.648319
| 2020-01-22T07:45:52
| 2020-01-22T07:45:52
| 224,870,793
| 1
| 0
| null | 2022-06-17T02:44:05
| 2019-11-29T14:37:07
|
JavaScript
|
UTF-8
|
Java
| false
| false
| 1,530
|
java
|
package com.cycloneboy.springcloud.slmall.module.portal.controller;
import com.cycloneboy.springcloud.common.domain.BaseResponse;
import com.cycloneboy.springcloud.slmall.common.base.BaseXCloudController;
import com.cycloneboy.springcloud.slmall.module.portal.entity.User;
import com.cycloneboy.springcloud.slmall.module.portal.service.UserService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
/**
* @author Exrickx
*/
@Slf4j
@RestController
@Api(description = "管理员接口")
@RequestMapping("/user")
public class UserController extends BaseXCloudController<User, Long> {
@Autowired
private UserService userService;
@Override
public UserService getService() {
return userService;
}
@GetMapping(value = "/getUserByUsername")
@ApiOperation("通过用户名获取用户")
public BaseResponse getUserByUsername(@RequestParam String username) {
log.info("{}", username);
User u = userService.findUserByUsername(username);
log.info("{}", u.getUsername());
return new BaseResponse(u);
}
@GetMapping("/test")
public String test() {
return "test";
}
}
|
[
"xuanfeng1992@gmail.com"
] |
xuanfeng1992@gmail.com
|
4f98516a8af96099353034fbe91d3f925019fb61
|
c24272aa5e6c367ec8694126657d5fa8410ae1b0
|
/src/test/java/com/mindberry/javaapp/security/jwt/JWTFilterTest.java
|
466f211e5732b2ac910adf88c8010c2a9e37262c
|
[] |
no_license
|
dharasudipta/MyBackendApp
|
3ce1aad4dcd7b031ccd75cf81ca9c60217614afa
|
9733f52623fd2fdc451432ad2cf9284a1b2586f3
|
refs/heads/main
| 2023-05-13T07:02:52.148277
| 2021-05-31T18:48:30
| 2021-05-31T18:48:30
| 372,600,934
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 5,583
|
java
|
package com.mindberry.javaapp.security.jwt;
import static org.assertj.core.api.Assertions.assertThat;
import com.mindberry.javaapp.security.AuthoritiesConstants;
import io.jsonwebtoken.io.Decoders;
import io.jsonwebtoken.security.Keys;
import java.util.Collections;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import org.springframework.http.HttpStatus;
import org.springframework.mock.web.MockFilterChain;
import org.springframework.mock.web.MockHttpServletRequest;
import org.springframework.mock.web.MockHttpServletResponse;
import org.springframework.security.authentication.UsernamePasswordAuthenticationToken;
import org.springframework.security.core.authority.SimpleGrantedAuthority;
import org.springframework.security.core.context.SecurityContextHolder;
import org.springframework.test.util.ReflectionTestUtils;
import tech.jhipster.config.JHipsterProperties;
class JWTFilterTest {
private TokenProvider tokenProvider;
private JWTFilter jwtFilter;
@BeforeEach
public void setup() {
JHipsterProperties jHipsterProperties = new JHipsterProperties();
String base64Secret = "fd54a45s65fds737b9aafcb3412e07ed99b267f33413274720ddbb7f6c5e64e9f14075f2d7ed041592f0b7657baf8";
jHipsterProperties.getSecurity().getAuthentication().getJwt().setBase64Secret(base64Secret);
tokenProvider = new TokenProvider(jHipsterProperties);
ReflectionTestUtils.setField(tokenProvider, "key", Keys.hmacShaKeyFor(Decoders.BASE64.decode(base64Secret)));
ReflectionTestUtils.setField(tokenProvider, "tokenValidityInMilliseconds", 60000);
jwtFilter = new JWTFilter(tokenProvider);
SecurityContextHolder.getContext().setAuthentication(null);
}
@Test
void testJWTFilter() throws Exception {
UsernamePasswordAuthenticationToken authentication = new UsernamePasswordAuthenticationToken(
"test-user",
"test-password",
Collections.singletonList(new SimpleGrantedAuthority(AuthoritiesConstants.USER))
);
String jwt = tokenProvider.createToken(authentication, false);
MockHttpServletRequest request = new MockHttpServletRequest();
request.addHeader(JWTFilter.AUTHORIZATION_HEADER, "Bearer " + jwt);
request.setRequestURI("/api/test");
MockHttpServletResponse response = new MockHttpServletResponse();
MockFilterChain filterChain = new MockFilterChain();
jwtFilter.doFilter(request, response, filterChain);
assertThat(response.getStatus()).isEqualTo(HttpStatus.OK.value());
assertThat(SecurityContextHolder.getContext().getAuthentication().getName()).isEqualTo("test-user");
assertThat(SecurityContextHolder.getContext().getAuthentication().getCredentials()).hasToString(jwt);
}
@Test
void testJWTFilterInvalidToken() throws Exception {
String jwt = "wrong_jwt";
MockHttpServletRequest request = new MockHttpServletRequest();
request.addHeader(JWTFilter.AUTHORIZATION_HEADER, "Bearer " + jwt);
request.setRequestURI("/api/test");
MockHttpServletResponse response = new MockHttpServletResponse();
MockFilterChain filterChain = new MockFilterChain();
jwtFilter.doFilter(request, response, filterChain);
assertThat(response.getStatus()).isEqualTo(HttpStatus.OK.value());
assertThat(SecurityContextHolder.getContext().getAuthentication()).isNull();
}
@Test
void testJWTFilterMissingAuthorization() throws Exception {
MockHttpServletRequest request = new MockHttpServletRequest();
request.setRequestURI("/api/test");
MockHttpServletResponse response = new MockHttpServletResponse();
MockFilterChain filterChain = new MockFilterChain();
jwtFilter.doFilter(request, response, filterChain);
assertThat(response.getStatus()).isEqualTo(HttpStatus.OK.value());
assertThat(SecurityContextHolder.getContext().getAuthentication()).isNull();
}
@Test
void testJWTFilterMissingToken() throws Exception {
MockHttpServletRequest request = new MockHttpServletRequest();
request.addHeader(JWTFilter.AUTHORIZATION_HEADER, "Bearer ");
request.setRequestURI("/api/test");
MockHttpServletResponse response = new MockHttpServletResponse();
MockFilterChain filterChain = new MockFilterChain();
jwtFilter.doFilter(request, response, filterChain);
assertThat(response.getStatus()).isEqualTo(HttpStatus.OK.value());
assertThat(SecurityContextHolder.getContext().getAuthentication()).isNull();
}
@Test
void testJWTFilterWrongScheme() throws Exception {
UsernamePasswordAuthenticationToken authentication = new UsernamePasswordAuthenticationToken(
"test-user",
"test-password",
Collections.singletonList(new SimpleGrantedAuthority(AuthoritiesConstants.USER))
);
String jwt = tokenProvider.createToken(authentication, false);
MockHttpServletRequest request = new MockHttpServletRequest();
request.addHeader(JWTFilter.AUTHORIZATION_HEADER, "Basic " + jwt);
request.setRequestURI("/api/test");
MockHttpServletResponse response = new MockHttpServletResponse();
MockFilterChain filterChain = new MockFilterChain();
jwtFilter.doFilter(request, response, filterChain);
assertThat(response.getStatus()).isEqualTo(HttpStatus.OK.value());
assertThat(SecurityContextHolder.getContext().getAuthentication()).isNull();
}
}
|
[
"jhipster-bot@jhipster.tech"
] |
jhipster-bot@jhipster.tech
|
194892c3502a56653218c71e6ae14a1ffa7ef153
|
b530af769bb496cdbadb4d1c14b81d6c53e2e36f
|
/oracledbStorage/src/test/java/io/github/factoryfx/factory/datastorage/oracle/DatabaseTest.java
|
6fa9b3a988fe87d4f277bdfe0f76aeceae15a999
|
[
"Apache-2.0"
] |
permissive
|
factoryfx/factoryfx
|
ab366d3144a27fd07bbf4098b9dc82e3bab1181f
|
08bab85ecd5ab30b26fa57d852c7fac3fb5ce312
|
refs/heads/master
| 2023-07-09T05:20:02.320970
| 2023-07-04T15:11:52
| 2023-07-04T15:11:52
| 59,744,695
| 12
| 3
|
Apache-2.0
| 2023-03-02T15:11:26
| 2016-05-26T11:22:59
|
Java
|
UTF-8
|
Java
| false
| false
| 1,712
|
java
|
package io.github.factoryfx.factory.datastorage.oracle;
import io.github.factoryfx.factory.jackson.ObjectMapperBuilder;
import io.github.factoryfx.factory.storage.migration.MigrationManager;
import io.github.factoryfx.factory.testfactories.ExampleFactoryA;
import org.h2.tools.Server;
import org.junit.jupiter.api.AfterEach;
import org.junit.jupiter.api.BeforeEach;
import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.PreparedStatement;
import java.sql.SQLException;
import java.util.function.Supplier;
public class DatabaseTest {
Server server;
Supplier<Connection> connectionSupplier;
@BeforeEach
public void setup(){
try {
server = Server.createTcpServer("-tcpAllowOthers").start();
Class.forName("org.h2.Driver");
connectionSupplier= () -> {
try {
return DriverManager.getConnection("jdbc:h2:mem:test;DB_CLOSE_DELAY=-1;MODE=Oracle", "sa", "");
} catch (SQLException e) {
throw new RuntimeException(e);
}
};
} catch (Exception e) {
throw new RuntimeException(e);
}
}
@AfterEach
public void shutdown() throws SQLException {
try (Connection connection= connectionSupplier.get()){
try (PreparedStatement preparedStatement= connection.prepareStatement("DROP ALL OBJECTS")){
preparedStatement.execute();
}
}
server.stop();
}
protected MigrationManager<ExampleFactoryA> createMigrationManager(){
return new MigrationManager<>(ExampleFactoryA.class, ObjectMapperBuilder.build(), (root, d) -> { });
}
}
|
[
"henning.brackmann@scoop-software.de"
] |
henning.brackmann@scoop-software.de
|
02bcc8d4fd49a8095aa40c4a0f29ca8994abd309
|
adc596a481ab7eeb589942ddb0d38eb026a92f92
|
/src/edu/stanford/smi/protegex/owl/model/OWLIntersectionClass.java
|
decf1d929293aedb88a91100576c720921f38a40
|
[] |
no_license
|
SteveChe/protege-owl-src-3.4.8
|
dadfddd8c8d9269decc05de47084c7425509ac7e
|
f56d3400345725991a6164d3678a9717d4c8456e
|
refs/heads/master
| 2016-09-08T01:54:33.269768
| 2013-06-28T06:11:09
| 2013-06-28T06:11:09
| null | 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 1,348
|
java
|
/*
* The contents of this file are subject to the Mozilla Public License
* Version 1.1 (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.mozilla.org/MPL/
*
* Software distributed under the License is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License for
* the specific language governing rights and limitations under the License.
*
* The Original Code is Protege-2000.
*
* The Initial Developer of the Original Code is Stanford University. Portions
* created by Stanford University are Copyright (C) 2007. All Rights Reserved.
*
* Protege was developed by Stanford Medical Informatics
* (http://www.smi.stanford.edu) at the Stanford University School of Medicine
* with support from the National Library of Medicine, the National Science
* Foundation, and the Defense Advanced Research Projects Agency. Current
* information about Protege can be obtained at http://protege.stanford.edu.
*
*/
package edu.stanford.smi.protegex.owl.model;
/**
* A OWLLogicalClass that represents an intersection of its operands.
*
* @author Holger Knublauch <holger@knublauch.com>
*/
public interface OWLIntersectionClass extends OWLNAryLogicalClass {
}
|
[
"chexinshuai669@gmail.com"
] |
chexinshuai669@gmail.com
|
d51041ea7937f83122e67478f9d9557ca09db3f0
|
6baf1fe00541560788e78de5244ae17a7a2b375a
|
/hollywood/com.oculus.environment.prod.bubbles-EnvironmentBubbles/sources/android/support/v7/view/menu/MenuPopup.java
|
9eae386f6bdd9db31956372222dc2061dce23936
|
[] |
no_license
|
phwd/quest-tracker
|
286e605644fc05f00f4904e51f73d77444a78003
|
3d46fbb467ba11bee5827f7cae7dfeabeb1fd2ba
|
refs/heads/main
| 2023-03-29T20:33:10.959529
| 2021-04-10T22:14:11
| 2021-04-10T22:14:11
| 357,185,040
| 4
| 2
| null | 2021-04-12T12:28:09
| 2021-04-12T12:28:08
| null |
UTF-8
|
Java
| false
| false
| 4,447
|
java
|
package android.support.v7.view.menu;
import android.content.Context;
import android.graphics.Rect;
import android.support.annotation.NonNull;
import android.support.annotation.Nullable;
import android.view.MenuItem;
import android.view.View;
import android.view.ViewGroup;
import android.widget.AdapterView;
import android.widget.FrameLayout;
import android.widget.HeaderViewListAdapter;
import android.widget.ListAdapter;
import android.widget.PopupWindow;
/* access modifiers changed from: package-private */
public abstract class MenuPopup implements ShowableListMenu, MenuPresenter, AdapterView.OnItemClickListener {
private Rect mEpicenterBounds;
public abstract void addMenu(MenuBuilder menuBuilder);
/* access modifiers changed from: protected */
public boolean closeMenuOnSubMenuOpened() {
return true;
}
@Override // android.support.v7.view.menu.MenuPresenter
public boolean collapseItemActionView(MenuBuilder menuBuilder, MenuItemImpl menuItemImpl) {
return false;
}
@Override // android.support.v7.view.menu.MenuPresenter
public boolean expandItemActionView(MenuBuilder menuBuilder, MenuItemImpl menuItemImpl) {
return false;
}
@Override // android.support.v7.view.menu.MenuPresenter
public int getId() {
return 0;
}
@Override // android.support.v7.view.menu.MenuPresenter
public void initForMenu(@NonNull Context context, @Nullable MenuBuilder menuBuilder) {
}
public abstract void setAnchorView(View view);
public abstract void setForceShowIcon(boolean z);
public abstract void setGravity(int i);
public abstract void setHorizontalOffset(int i);
public abstract void setOnDismissListener(PopupWindow.OnDismissListener onDismissListener);
public abstract void setShowTitle(boolean z);
public abstract void setVerticalOffset(int i);
MenuPopup() {
}
public void setEpicenterBounds(Rect rect) {
this.mEpicenterBounds = rect;
}
public Rect getEpicenterBounds() {
return this.mEpicenterBounds;
}
@Override // android.support.v7.view.menu.MenuPresenter
public MenuView getMenuView(ViewGroup viewGroup) {
throw new UnsupportedOperationException("MenuPopups manage their own views");
}
@Override // android.widget.AdapterView.OnItemClickListener
public void onItemClick(AdapterView<?> adapterView, View view, int i, long j) {
ListAdapter listAdapter = (ListAdapter) adapterView.getAdapter();
toMenuAdapter(listAdapter).mAdapterMenu.performItemAction((MenuItem) listAdapter.getItem(i), this, closeMenuOnSubMenuOpened() ? 0 : 4);
}
protected static int measureIndividualMenuWidth(ListAdapter listAdapter, ViewGroup viewGroup, Context context, int i) {
int makeMeasureSpec = View.MeasureSpec.makeMeasureSpec(0, 0);
int makeMeasureSpec2 = View.MeasureSpec.makeMeasureSpec(0, 0);
int count = listAdapter.getCount();
ViewGroup viewGroup2 = viewGroup;
int i2 = 0;
int i3 = 0;
View view = null;
for (int i4 = 0; i4 < count; i4++) {
int itemViewType = listAdapter.getItemViewType(i4);
if (itemViewType != i3) {
view = null;
i3 = itemViewType;
}
if (viewGroup2 == null) {
viewGroup2 = new FrameLayout(context);
}
view = listAdapter.getView(i4, view, viewGroup2);
view.measure(makeMeasureSpec, makeMeasureSpec2);
int measuredWidth = view.getMeasuredWidth();
if (measuredWidth >= i) {
return i;
}
if (measuredWidth > i2) {
i2 = measuredWidth;
}
}
return i2;
}
protected static MenuAdapter toMenuAdapter(ListAdapter listAdapter) {
if (listAdapter instanceof HeaderViewListAdapter) {
return (MenuAdapter) ((HeaderViewListAdapter) listAdapter).getWrappedAdapter();
}
return (MenuAdapter) listAdapter;
}
protected static boolean shouldPreserveIconSpacing(MenuBuilder menuBuilder) {
int size = menuBuilder.size();
for (int i = 0; i < size; i++) {
MenuItem item = menuBuilder.getItem(i);
if (item.isVisible() && item.getIcon() != null) {
return true;
}
}
return false;
}
}
|
[
"cyuubiapps@gmail.com"
] |
cyuubiapps@gmail.com
|
d59f095c763aaa148b24699afe4942d1c500225d
|
4edce2a17e0c0800cdfeaa4b111e0c2fbea4563b
|
/net/minecraft/src/GuiScreenPendingInvitationINNER3.java
|
a56d533d0a0baf8ea160d9f5769b2dea9f900e9f
|
[] |
no_license
|
zaices/minecraft
|
da9b99abd99ac56e787eef1b6fecbd06b2d4cd51
|
4a99d8295e7ce939663e90ba8f1899c491545cde
|
refs/heads/master
| 2021-01-10T20:20:38.388578
| 2013-10-06T00:16:11
| 2013-10-06T00:18:48
| 13,142,359
| 2
| 1
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 946
|
java
|
package net.minecraft.src;
class GuiScreenPendingInvitationINNER3 extends Thread
{
final GuiScreenPendingInvitation field_130131_a;
GuiScreenPendingInvitationINNER3(GuiScreenPendingInvitation par1GuiScreenPendingInvitation)
{
this.field_130131_a = par1GuiScreenPendingInvitation;
}
public void run()
{
try
{
McoClient var1 = new McoClient(GuiScreenPendingInvitation.func_130046_h(this.field_130131_a).func_110432_I());
var1.func_130107_a(((PendingInvite)GuiScreenPendingInvitation.func_130042_e(this.field_130131_a).get(GuiScreenPendingInvitation.func_130049_d(this.field_130131_a))).field_130094_a);
GuiScreenPendingInvitation.func_130040_f(this.field_130131_a);
}
catch (ExceptionMcoService var2)
{
GuiScreenPendingInvitation.func_130055_i(this.field_130131_a).getLogAgent().logSevere(var2.toString());
}
}
}
|
[
"chlumanog@gmail.com"
] |
chlumanog@gmail.com
|
7d94d82e990ed7190dc0fde6f4d98a108c201a6c
|
88252dad1b411dd2a580f1182af707d0c0981841
|
/JavaSE210301/day14/src/com/atguigu/java3/USBTest.java
|
9b2eb90aec5a3983b0c68a8de3c961aa985d556e
|
[] |
no_license
|
FatterXiao/myJavaLessons
|
37db50d24cbcc5524e5b8060803ab08ab3b3ac0c
|
fa6ff208b46048527b899001561bd952f48bbe15
|
refs/heads/main
| 2023-04-20T09:18:06.694611
| 2021-04-29T10:18:30
| 2021-04-29T10:18:30
| 347,562,482
| 0
| 1
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 1,156
|
java
|
package com.atguigu.java3;
/**
*
* 体会接口的规范!
*
* 接口,也存在多态性!
*
* @author shkstart
* @create 16:42
*/
public class USBTest {
public static void main(String[] args) {
Printer printer = new Printer();
operate(printer);
operate(new KeyBoard());
}
public static void operate(USB usb){ //USB usb = new Printer();
System.out.println("========检测外部设备=========");
usb.start();
System.out.println("==========具体的数据传输过程===========");
usb.stop();
}
}
interface USB{
//常量:定义的USB的尺寸等
void start();
void stop();
}
class Printer implements USB{//打印机
@Override
public void start() {
System.out.println("打印机开始工作");
}
@Override
public void stop() {
System.out.println("打印机结束工作");
}
}
class KeyBoard implements USB{
@Override
public void start() {
System.out.println("键盘开始工作");
}
@Override
public void stop() {
System.out.println("键盘结束工作");
}
}
|
[
"xuweijunxinlan@yeah.net"
] |
xuweijunxinlan@yeah.net
|
a9bb53f1ce450c9c54832c12183cb7ef870c26c8
|
c885ef92397be9d54b87741f01557f61d3f794f3
|
/tests-without-trycatch/Cli-36/org.apache.commons.cli.OptionGroup/BBC-F0-opt-90/15/org/apache/commons/cli/OptionGroup_ESTest_scaffolding.java
|
1305baa9d347bb3526f655d4befcab018633a7c9
|
[
"CC-BY-4.0",
"MIT"
] |
permissive
|
pderakhshanfar/EMSE-BBC-experiment
|
f60ac5f7664dd9a85f755a00a57ec12c7551e8c6
|
fea1a92c2e7ba7080b8529e2052259c9b697bbda
|
refs/heads/main
| 2022-11-25T00:39:58.983828
| 2022-04-12T16:04:26
| 2022-04-12T16:04:26
| 309,335,889
| 0
| 1
| null | 2021-11-05T11:18:43
| 2020-11-02T10:30:38
| null |
UTF-8
|
Java
| false
| false
| 3,704
|
java
|
/**
* Scaffolding file used to store all the setups needed to run
* tests automatically generated by EvoSuite
* Wed Oct 20 23:28:35 GMT 2021
*/
package org.apache.commons.cli;
import org.evosuite.runtime.annotation.EvoSuiteClassExclude;
import org.junit.BeforeClass;
import org.junit.Before;
import org.junit.After;
import org.evosuite.runtime.sandbox.Sandbox;
import org.evosuite.runtime.sandbox.Sandbox.SandboxMode;
@EvoSuiteClassExclude
public class OptionGroup_ESTest_scaffolding {
@org.junit.Rule
public org.evosuite.runtime.vnet.NonFunctionalRequirementRule nfr = new org.evosuite.runtime.vnet.NonFunctionalRequirementRule();
private org.evosuite.runtime.thread.ThreadStopper threadStopper = new org.evosuite.runtime.thread.ThreadStopper (org.evosuite.runtime.thread.KillSwitchHandler.getInstance(), 3000);
@BeforeClass
public static void initEvoSuiteFramework() {
org.evosuite.runtime.RuntimeSettings.className = "org.apache.commons.cli.OptionGroup";
org.evosuite.runtime.GuiSupport.initialize();
org.evosuite.runtime.RuntimeSettings.maxNumberOfThreads = 100;
org.evosuite.runtime.RuntimeSettings.maxNumberOfIterationsPerLoop = 10000;
org.evosuite.runtime.RuntimeSettings.mockSystemIn = true;
org.evosuite.runtime.RuntimeSettings.sandboxMode = org.evosuite.runtime.sandbox.Sandbox.SandboxMode.RECOMMENDED;
org.evosuite.runtime.sandbox.Sandbox.initializeSecurityManagerForSUT();
org.evosuite.runtime.classhandling.JDKClassResetter.init();
setSystemProperties();
initializeClasses();
org.evosuite.runtime.Runtime.getInstance().resetRuntime();
}
@Before
public void initTestCase(){
threadStopper.storeCurrentThreads();
threadStopper.startRecordingTime();
org.evosuite.runtime.jvm.ShutdownHookHandler.getInstance().initHandler();
org.evosuite.runtime.sandbox.Sandbox.goingToExecuteSUTCode();
org.evosuite.runtime.GuiSupport.setHeadless();
org.evosuite.runtime.Runtime.getInstance().resetRuntime();
org.evosuite.runtime.agent.InstrumentingAgent.activate();
}
@After
public void doneWithTestCase(){
threadStopper.killAndJoinClientThreads();
org.evosuite.runtime.jvm.ShutdownHookHandler.getInstance().safeExecuteAddedHooks();
org.evosuite.runtime.classhandling.JDKClassResetter.reset();
resetClasses();
org.evosuite.runtime.sandbox.Sandbox.doneWithExecutingSUTCode();
org.evosuite.runtime.agent.InstrumentingAgent.deactivate();
org.evosuite.runtime.GuiSupport.restoreHeadlessMode();
}
public static void setSystemProperties() {
/*No java.lang.System property to set*/
}
private static void initializeClasses() {
org.evosuite.runtime.classhandling.ClassStateSupport.initializeClasses(OptionGroup_ESTest_scaffolding.class.getClassLoader() ,
"org.apache.commons.cli.Option$1",
"org.apache.commons.cli.AlreadySelectedException",
"org.apache.commons.cli.ParseException",
"org.apache.commons.cli.OptionValidator",
"org.apache.commons.cli.OptionGroup",
"org.apache.commons.cli.Option$Builder",
"org.apache.commons.cli.Option"
);
}
private static void resetClasses() {
org.evosuite.runtime.classhandling.ClassResetter.getInstance().setClassLoader(OptionGroup_ESTest_scaffolding.class.getClassLoader());
org.evosuite.runtime.classhandling.ClassStateSupport.resetClasses(
"org.apache.commons.cli.OptionGroup",
"org.apache.commons.cli.Option",
"org.apache.commons.cli.OptionValidator",
"org.apache.commons.cli.Option$Builder",
"org.apache.commons.cli.ParseException",
"org.apache.commons.cli.AlreadySelectedException"
);
}
}
|
[
"pouria.derakhshanfar@gmail.com"
] |
pouria.derakhshanfar@gmail.com
|
21063501ffbfdf77f3cdb60f5af1588dc361c561
|
e68539b0251bda9573c35ffe875b92db16e8a682
|
/phoss-smp-backend/src/main/java/com/helger/phoss/smp/smlhook/IRegistrationHook.java
|
713c8f04595a6e2a79c9b7d0b5c28ee864fb037b
|
[] |
no_license
|
phax/phoss-smp
|
d8f42782b6d30e5b2701abc76bd44f7b86f94917
|
df21195224520298658e6300c9920001fb159f53
|
refs/heads/master
| 2023-08-27T20:40:54.072704
| 2023-08-25T13:42:28
| 2023-08-25T13:42:28
| 32,790,911
| 73
| 21
| null | 2023-04-29T15:26:27
| 2015-03-24T10:11:42
|
Java
|
UTF-8
|
Java
| false
| false
| 1,884
|
java
|
/*
* Copyright (C) 2015-2023 Philip Helger and contributors
* philip[at]helger[dot]com
*
* The Original Code is Copyright The Peppol project (http://www.peppol.eu)
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
*/
package com.helger.phoss.smp.smlhook;
import javax.annotation.Nonnull;
import com.helger.peppolid.IParticipantIdentifier;
/**
* Base interface for the callback to modify the SML.
*
* @author PEPPOL.AT, BRZ, Philip Helger
*/
public interface IRegistrationHook
{
/**
* Create a participant in the SML.
*
* @param aPI
* The participant to be created
* @throws RegistrationHookException
* If something goes wrong.
*/
void createServiceGroup (@Nonnull IParticipantIdentifier aPI) throws RegistrationHookException;
/**
* Delete a participant in the SML because the internal adding in the SMP
* failed
*
* @param aPI
* The participant to be deleted
* @throws RegistrationHookException
* If something goes wrong.
*/
void undoCreateServiceGroup (@Nonnull IParticipantIdentifier aPI) throws RegistrationHookException;
/**
* Delete a participant in the SML.
*
* @param aPI
* The participant to be deleted
* @throws RegistrationHookException
* If something goes wrong.
*/
void deleteServiceGroup (@Nonnull IParticipantIdentifier aPI) throws RegistrationHookException;
/**
* Create a participant in the SML because the deletion.
*
* @param aPI
* The participant to be re-created
* @throws RegistrationHookException
* If something goes wrong.
*/
void undoDeleteServiceGroup (@Nonnull IParticipantIdentifier aPI) throws RegistrationHookException;
}
|
[
"philip@helger.com"
] |
philip@helger.com
|
d49609b6ac7b42e2aeba1a2a151582c3c158cd7d
|
aa375b3e62405c8d8407c491dcb2ea0132c2673c
|
/test/src/main/java/hooq/SignUp.java
|
9c0bb5528066359e27e8ec53490627f20d40b9db
|
[] |
no_license
|
canrosinabutar/QA_Engineer_Test
|
836e63320c2fad82cfd81f66bb2d27061acbe5be
|
8b13cce894fb7e997586281976d358b863a24ea4
|
refs/heads/master
| 2020-03-18T00:24:08.532033
| 2018-11-12T14:59:21
| 2018-11-12T14:59:21
| 134,092,032
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 4,947
|
java
|
package hooq;
import basepage.BasePage;
import io.qameta.allure.Step;
import org.openqa.selenium.By;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.WebElement;
import org.openqa.selenium.support.ui.Select;
public class SignUp extends BasePage {
public SignUp(WebDriver webDriver) {
super(webDriver);
}
@Step("Sign Up by Select Sign In Button")
public void selectSignIn() {
WebElement webElement = webDriver.findElement(By.cssSelector(".login"));
webElement.getText();
webElement.click();
}
public void selectSignOut() {
WebElement webElement = webDriver.findElement(By.cssSelector(".logout"));
webElement.getText();
webElement.click();
}
@Step("Input email create: {email}")
public void inputEmailCreate(String email) {
WebElement webElement = webDriver.findElement(By.id("email_create"));
webElement.clear();
webElement.sendKeys(email);
}
//@Step("Click Submit")
public void clickSubmit() {
webDriver.findElement(By.id("SubmitCreate")).click();
}
// @Step("Select Gender")
public void selectGenderM() {
webDriver.findElement(By.cssSelector(".page-subheading")).getText();
webDriver.findElement(By.id("id_gender1")).click();
//System.out.println(webDriver.findElement(By.xpath("//*[@id=\"id_gender1\"]")).toString());
}
// @Step("Select Gender")
public void selectGenderF() {
webDriver.findElement(By.xpath("//*[@id=\"id_gender2\"]")).click();
}
// @Step("Input First Name : {firstName}")
public void inputCustomerFirstName(String firstName) throws InterruptedException {
Thread.sleep(1000);
WebElement webElement = webDriver.findElement(By.xpath("//*[@id=\"customer_firstname\"]"));
webElement.clear();
webElement.sendKeys(firstName);
}
// @Step("Input First Name : {customerLastname}")
public void inputCustomerLastname(String customerLastname) {
WebElement webElement = webDriver.findElement(By.xpath("//*[@id=\"customer_lastname\"]"));
webElement.clear();
webElement.sendKeys(customerLastname);
}
// @Step("Input First Name : {password}")
public void inputPasswords(String password) {
WebElement webElement = webDriver.findElement(By.id("passwd"));
webElement.clear();
webElement.sendKeys(password);
}
// @Step("Input Select Date")
public void SelectDate() {
Select dropdownDay = new Select(webDriver.findElement(By.id("days")));
dropdownDay.selectByValue("12");
}
public void SelectMonths() {
Select dropdownMonth = new Select(webDriver.findElement(By.xpath("//*[@id=\"months\"]")));
dropdownMonth.selectByIndex(2);
}
public void SelectYear() {
Select dropdownYear = new Select(webDriver.findElement(By.id("years")));
dropdownYear.selectByValue("2000");
}
public void checkNewsletter() {
WebElement webElement = webDriver.findElement(By.xpath("//*[@id=\"newsletter\"]"));
webElement.click();
}
public void checkOffers() {
WebElement webElement = webDriver.findElement(By.xpath("//*[@id=\"optin\"]"));
webElement.click();
}
public void inputCompany(String Company) {
WebElement webElement = webDriver.findElement(By.id("company"));
webElement.clear();
webElement.sendKeys(Company);
}
public void inputAddress(String Address) {
WebElement webElement = webDriver.findElement(By.id("address1"));
webElement.clear();
webElement.sendKeys(Address);
}
public void inputAddress2(String Address2) {
WebElement webElement = webDriver.findElement(By.id("address2"));
webElement.clear();
webElement.sendKeys(Address2);
}
public void inputCity(String City) {
WebElement webElement = webDriver.findElement(By.xpath("//*[@id=\"city\"]"));
webElement.clear();
webElement.sendKeys(City);
}
public void inputState(String State) {
Select dropdownState = new Select(webDriver.findElement(By.id("id_state")));
dropdownState.selectByIndex(4);
}
public void inputPostcode(String postcode) {
WebElement webElement = webDriver.findElement(By.id("postcode"));
webElement.clear();
webElement.sendKeys(postcode);
}
public void selectIDCountry() {
Select dropdownState = new Select(webDriver.findElement(By.id("id_country")));
dropdownState.selectByIndex(5);
}
public void inputOther(String Other) {
WebElement webElement = webDriver.findElement(By.id("other"));
webElement.clear();
webElement.sendKeys(Other);
}
public void inputPhone(String phone) {
WebElement webElement = webDriver.findElement(By.id("phone"));
webElement.clear();
webElement.sendKeys(phone);
}
public void inputPhone_mobile(String phone_mobile) {
WebElement webElement = webDriver.findElement(By.id("phone_mobile"));
webElement.clear();
webElement.sendKeys(phone_mobile);
}
public void inputAlias(String alias) {
WebElement webElement = webDriver.findElement(By.id("alias"));
webElement.clear();
webElement.sendKeys(alias);
}
public void selectSubmitAccount(){
WebElement webElement = webDriver.findElement(By.id("submitAccount"));
webElement.click();
}
}
|
[
"john@sample.com"
] |
john@sample.com
|
81ec766f72375d024115d3651a99d0fbbefcad82
|
fe6ecbf29b0130662ae415d3b66af97af7094a70
|
/Code/Work/FF/Decomp/C_100500_abe.java
|
10287f56df723fdd14ca1e8e8ad513623df4794a
|
[] |
no_license
|
joshuacoles/MineCraft-Patch-On-Launch-Client-old
|
272db752d5bc94b02bb14c012276c92047b0b0c4
|
28055c66ecf3d3236155521e988acc3b7f0b08e6
|
refs/heads/master
| 2016-09-05T21:03:36.361801
| 2012-11-17T07:42:26
| 2012-11-17T07:42:26
| null | 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 1,954
|
java
|
import java.util.Random;
public class C_100500_abe extends C_100562_aan {
private int field_107973_a;
public C_100500_abe(int var1) {
this.field_107973_a = var1;
}
public boolean func_107965_a(C_100873_xe var1, Random var2, int var3, int var4, int var5) {
if(var1.func_109352_c(var3, var4, var5) && var1.func_109349_a(var3, var4 - 1, var5) == this.field_107973_a) {
int var6 = var2.nextInt(32) + 6;
int var7 = var2.nextInt(4) + 1;
int var8;
int var9;
int var10;
int var11;
for(var8 = var3 - var7; var8 <= var3 + var7; ++var8) {
for(var9 = var5 - var7; var9 <= var5 + var7; ++var9) {
var10 = var8 - var3;
var11 = var9 - var5;
if(var10 * var10 + var11 * var11 <= var7 * var7 + 1 && var1.func_109349_a(var8, var4 - 1, var9) != this.field_107973_a) {
return false;
}
}
}
for(var8 = var4; var8 < var4 + var6 && var8 < 128; ++var8) {
for(var9 = var3 - var7; var9 <= var3 + var7; ++var9) {
for(var10 = var5 - var7; var10 <= var5 + var7; ++var10) {
var11 = var9 - var3;
int var12 = var10 - var5;
if(var11 * var11 + var12 * var12 <= var7 * var7 + 1) {
var1.func_109422_e(var9, var8, var10, C_100451_alf.field_106210_as.field_106162_cm);
}
}
}
}
C_100563_ox var13 = new C_100563_ox(var1);
var13.func_103055_b((double)((float)var3 + 0.5F), (double)(var4 + var6), (double)((float)var5 + 0.5F), var2.nextFloat() * 360.0F, 0.0F);
var1.func_109513_d(var13);
var1.func_109422_e(var3, var4 + var6, var5, C_100451_alf.field_106077_C.field_106162_cm);
return true;
} else {
return false;
}
}
}
|
[
"josh@coles.to"
] |
josh@coles.to
|
e3bced78523e321151f95221415be180e166856a
|
fa91450deb625cda070e82d5c31770be5ca1dec6
|
/Diff-Raw-Data/17/17_596199b8c62f51abf0b1970d846053243b12c4b0/FlexResourceStore/17_596199b8c62f51abf0b1970d846053243b12c4b0_FlexResourceStore_s.java
|
9314b73dd4001dacb32d10d454e23a964a283a5d
|
[] |
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
| 7,552
|
java
|
package org.archive.wayback.resourcestore;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.io.InputStream;
import java.util.ArrayList;
import java.util.List;
import java.util.logging.Level;
import java.util.logging.Logger;
import org.archive.format.gzip.zipnum.ZipNumBlockLoader;
import org.archive.io.ArchiveReader;
import org.archive.io.ArchiveReaderFactory;
import org.archive.io.arc.ARCReader;
import org.archive.io.arc.ARCRecord;
import org.archive.io.warc.WARCReader;
import org.archive.io.warc.WARCRecord;
import org.archive.util.binsearch.SeekableLineReader;
import org.archive.util.binsearch.SortedTextFile;
import org.archive.util.iterator.CloseableIterator;
import org.archive.wayback.ResourceStore;
import org.archive.wayback.core.CaptureSearchResult;
import org.archive.wayback.core.Resource;
import org.archive.wayback.exception.ResourceNotAvailableException;
import org.archive.wayback.resourcestore.resourcefile.ArcResource;
import org.archive.wayback.resourcestore.resourcefile.WarcResource;
public class FlexResourceStore implements ResourceStore {
final static String[] EMPTY_STRINGS = new String[0];
private final static Logger LOGGER = Logger.getLogger(FlexResourceStore.class.getName());
protected ZipNumBlockLoader blockLoader;
protected String customHeader;
protected List<SourceResolver> sources;
protected boolean failOnFirstUnavailable = false;
public ZipNumBlockLoader getBlockLoader() {
return blockLoader;
}
public void setBlockLoader(ZipNumBlockLoader blockLoader) {
this.blockLoader = blockLoader;
}
public String getCustomHeader() {
return customHeader;
}
public void setCustomHeader(String customHeader) {
this.customHeader = customHeader;
}
public List<SourceResolver> getSources() {
return sources;
}
public void setSources(List<SourceResolver> sources) {
this.sources = sources;
}
public boolean isFailOnFirstUnavailable() {
return failOnFirstUnavailable;
}
public void setFailOnFirstUnavailable(boolean failOnFirstUnavailable) {
this.failOnFirstUnavailable = failOnFirstUnavailable;
}
interface SourceResolver
{
String[] lookupPath(String filename) throws IOException;
}
public static class PathIndex implements SourceResolver
{
final static String DELIMITER = "\t";
protected SortedTextFile pathIndex;
protected String path;
protected String prefixPath;
public void setPathIndex(String path) throws IOException
{
this.path = path;
this.pathIndex = new SortedTextFile(path, false);
}
public String getPathIndex()
{
return path;
}
public String getPrefixPath() {
return prefixPath;
}
public void setPrefixPath(String prefixPath) {
this.prefixPath = prefixPath;
}
@Override
public String[] lookupPath(String filename) throws IOException {
CloseableIterator<String> iter = null;
List<String> paths = new ArrayList<String>();
try {
String prefix = filename + DELIMITER;
iter = pathIndex.getRecordIterator(prefix);
while (iter.hasNext()) {
String line = iter.next();
if (line.startsWith(prefix)) {
String path = line.substring(prefix.length());
if (prefixPath != null) {
paths.add(prefixPath + path);
} else {
paths.add(path);
}
} else {
break;
}
}
} finally {
if (iter != null) {
try {
iter.close();
} catch (IOException e) {
LOGGER.warning(e.toString());
}
}
}
if (paths.isEmpty()) {
return EMPTY_STRINGS;
}
String[] pathsArray = new String[paths.size()];
return paths.toArray(pathsArray);
}
}
public static class PrefixLookup implements SourceResolver
{
String prefix;
String includeFilter;
public String getPrefix() {
return prefix;
}
public void setPrefix(String prefix) {
this.prefix = prefix;
}
public String getIncludeFilter() {
return includeFilter;
}
public void setIncludeFilter(String includeFilter) {
this.includeFilter = includeFilter;
}
@Override
public String[] lookupPath(String filename) {
if (includeFilter != null) {
if (!filename.contains(includeFilter)) {
return EMPTY_STRINGS;
}
}
return new String[]{prefix + filename};
}
}
@Override
public Resource retrieveResource(CaptureSearchResult result)
throws ResourceNotAvailableException {
String filename = result.getFile();
if (filename == null || filename.isEmpty()) {
throw new ResourceNotAvailableException("No ARC/WARC name in search result...", filename);
}
Resource resource = null;
boolean breakOnErr = false;
StringBuilder excMsg = new StringBuilder();
IOException lastExc = null;
for (SourceResolver resolver : sources) {
String[] paths = null;
try {
paths = resolver.lookupPath(filename);
} catch (IOException io) {
if (excMsg.length() > 0) {
excMsg.append(" ");
}
excMsg.append(io.getMessage());
lastExc = io;
if (failOnFirstUnavailable) {
breakOnErr = true;
break;
}
}
if (paths.length == 0) {
continue;
}
for (String path : paths) {
try {
resource = getResource(path, result);
if (resource != null) {
return resource;
}
} catch (IOException io) {
if (excMsg.length() > 0) {
excMsg.append(" ");
}
excMsg.append(io.getMessage());
lastExc = io;
if (failOnFirstUnavailable) {
breakOnErr = true;
break;
}
}
}
if (breakOnErr) {
break;
}
}
if (lastExc == null) {
lastExc = new FileNotFoundException(filename);
excMsg.append("File not Found: " + filename);
}
ResourceNotAvailableException rnae = new ResourceNotAvailableException(excMsg.toString(), filename, lastExc);
throw rnae;
}
public Resource getResource(String path, CaptureSearchResult result) throws IOException, ResourceNotAvailableException
{
Resource r = null;
long offset = result.getOffset();
int length = (int)result.getCompressedLength();
if (LOGGER.isLoggable(Level.INFO)) {
LOGGER.info("Loading " + path + " - " + offset + ":" + length);
}
boolean success = false;
SeekableLineReader slr = blockLoader.attemptLoadBlock(path, offset, length, false, false);
if (slr == null) {
return null;
}
try {
InputStream is = slr.getInputStream();
r = loadResource(path, is);
r.parseHeaders();
success = true;
} finally {
if (!success) {
if (slr != null) {
slr.close();
}
}
}
return r;
}
protected Resource loadResource(String path, InputStream is) throws IOException, ResourceNotAvailableException
{
ArchiveReader archiveReader = ArchiveReaderFactory.get(path, is, false);
if (archiveReader instanceof ARCReader) {
return new ArcResource((ARCRecord)archiveReader.get(), archiveReader);
} else if (archiveReader instanceof WARCReader) {
return new WarcResource((WARCRecord)archiveReader.get(), archiveReader);
} else {
throw new IOException("Unknown ArchiveReader");
}
}
@Override
public void shutdown() throws IOException {
blockLoader.close();
}
}
|
[
"yuzhongxing88@gmail.com"
] |
yuzhongxing88@gmail.com
|
7279037cc6e619c26f117f5ad723a3f679de9c74
|
b857c0a9f29b7ff8d3aa177734526e97d3358f38
|
/app/src/main/java/com/lxyg/app/customer/activity/LoginActivity.java
|
510a5cce1ab69ccf7dd640e2921fb3607508ae91
|
[] |
no_license
|
mirror5821/LXYG
|
a133d68b93901a375d1fef47710683c9c93cc953
|
d2be2366b41b5301d1d5c6bba6e0c5bbb25521e5
|
refs/heads/master
| 2021-01-21T13:41:20.864539
| 2016-05-05T06:50:58
| 2016-05-05T06:50:58
| 47,088,931
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 8,238
|
java
|
package com.lxyg.app.customer.activity;
import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import android.content.IntentFilter;
import android.net.Uri;
import android.os.Bundle;
import android.os.Handler;
import android.telephony.SmsMessage;
import android.text.TextUtils;
import android.view.View;
import android.widget.Button;
import android.widget.EditText;
import com.lxyg.app.customer.R;
import com.lxyg.app.customer.app.AppContext;
import com.lxyg.app.customer.bean.User;
import com.lxyg.app.customer.utils.AppAjaxCallback;
import com.lxyg.app.customer.utils.AppAjaxParam;
import com.lxyg.app.customer.utils.AppHttpClient;
import com.lxyg.app.customer.utils.SharePreferencesUtil;
import org.json.JSONException;
import org.json.JSONObject;
import java.util.Set;
import java.util.Timer;
import java.util.TimerTask;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
import cn.jpush.android.api.JPushInterface;
import cn.jpush.android.api.TagAliasCallback;
import dev.mirror.library.utils.JsonUtils;
public class LoginActivity extends BaseActivity {
private EditText mETPhone,mETCode;
private Button mButtonResend,mButtonSub;
private BroadcastReceiver smsReceiver;
private IntentFilter filter2;
private Handler handler;
private String strContent;
private final String patternCoder = "(?<!\\d)\\d{6}(?!\\d)";
// private int mIntentId;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_login);
setBack();
setTitleText("登陆");
// mIntentId = getIntent().getExtras().getInt(INTENT_ID);
mETPhone = (EditText)findViewById(R.id.phone);
mETCode = (EditText)findViewById(R.id.code);
mButtonResend = (Button)findViewById(R.id.btn_code);
mButtonResend.setOnClickListener(this);
mButtonSub = (Button)findViewById(R.id.sub);
mButtonSub.setOnClickListener(this);
handler = new Handler() {
@Override
public void handleMessage(android.os.Message msg) {
mETCode.setText(strContent);
mCode = strContent;
sub(phone);
};
};
filter2 = new IntentFilter();
filter2.addAction("android.provider.Telephony.SMS_RECEIVED");
filter2.setPriority(Integer.MAX_VALUE);
smsReceiver = new BroadcastReceiver() {
@Override
public void onReceive(Context context, Intent intent) {
Object[] objs = (Object[]) intent.getExtras().get("pdus");
for (Object obj : objs) {
byte[] pdu = (byte[]) obj;
SmsMessage sms = SmsMessage.createFromPdu(pdu);
// 短信的内容
String message = sms.getMessageBody();
// 短息的手机号。。+86开头?
String from = sms.getOriginatingAddress();
if (!TextUtils.isEmpty(from)) {
String code = patternCode(message);
if (!TextUtils.isEmpty(code)) {
strContent = code;
handler.sendEmptyMessage(1);
}
}
}
}
};
getActivity().registerReceiver(smsReceiver, filter2);
}
/**
* 匹配短信中间的6个数字(验证码等)
*
* @param patternContent
* @return
*/
private String patternCode(String patternContent) {
if (TextUtils.isEmpty(patternContent)) {
return null;
}
Pattern p = Pattern.compile(patternCoder);
Matcher matcher = p.matcher(patternContent);
if (matcher.find()) {
return matcher.group();
}
return null;
}
private String phone;
@Override
public void onClick(View v) {
super.onClick(v);
//监测手机号码
phone = mETPhone.getText().toString().trim();
if(TextUtils.isEmpty(phone)){
showToast("请输入电话号码!");
return;
}
//貌似有缓存 放到Appcontext死活不起作用
Pattern p = Pattern.compile("^0?(13[0-9]|15[012356789]|17[678]|18[0-9]|14[57])[0-9]{8}$");
Matcher m = p.matcher(phone);
if(!m.matches()){
showToast("请输入正确的手机号码");
return;
}
switch (v.getId()) {
case R.id.sub:
if(TextUtils.isEmpty(mCode)){
showToast("请先验证手机号码!");
return;
}
String code = mETCode.getText().toString();
if(TextUtils.isEmpty(code)){
showToast("请输入验证码!");
return;
}
if(!code.equals(mCode)){
showToast("验证码不正确!");
return;
}
sub(phone);
break;
case R.id.btn_code:
startCountDown();
getCode(phone);
break;
}
}
/**
* 以下内容为设置推送消息
*/
private final TagAliasCallback mAliasCallback = new TagAliasCallback() {
@Override
public void gotResult(int code, String alias, Set<String> tags) {
switch (code) {
case 0:
break;
case 6002:
mHandler.sendMessageDelayed(mHandler.obtainMessage(MSG_SET_ALIAS, alias), 1000 * 60);
break;
}
}
};
private final TagAliasCallback mTagsCallback = new TagAliasCallback() {
@Override
public void gotResult(int code, String alias, Set<String> tags) {
switch (code) {
case 0:
break;
case 6002:
mHandler.sendMessageDelayed(mHandler.obtainMessage(MSG_SET_TAGS, tags), 1000 * 60);
break;
}
}
};
private static final int MSG_SET_ALIAS = 1001;
private static final int MSG_SET_TAGS = 1002;
private final Handler mHandler = new Handler() {
@SuppressWarnings("unchecked")
@Override
public void handleMessage(android.os.Message msg) {
super.handleMessage(msg);
switch (msg.what) {
case MSG_SET_ALIAS:
JPushInterface.setAliasAndTags(getApplicationContext(), (String) msg.obj, null, mAliasCallback);
break;
case MSG_SET_TAGS:
JPushInterface.setAliasAndTags(getApplicationContext(), null, (Set<String>) msg.obj, mTagsCallback);
break;
}
}
};
/**
* 提交数据
* @param phone
*/
private void sub(final String phone){
JSONObject jb = new JSONObject();
try {
jb.put("phone", phone);
jb.put("code", mCode);
jb.put("lat", AppContext.Latitude);
jb.put("lng", AppContext.Longitude);
jb.put("version",WECHAT_VALUE);
} catch (JSONException e) {
e.printStackTrace();
}
mBaseHttpClient.postData1(USER_LOGIN, jb, new AppAjaxCallback.onResultListener() {
@Override
public void onResult(String data, String msg) {
SharePreferencesUtil.saveUserInfo(getApplicationContext(), data);
showToast(msg);
AppContext.USER_ID = JsonUtils.parse(data, User.class).getUuid();
AppContext.IS_LOGIN = true;
//告知首页登录成功 并切换登录绑定的店铺数据
AppContext.SHOP_CHANGE = 1;
mHandler.sendMessage(mHandler.obtainMessage(MSG_SET_ALIAS, phone));
Uri uri = Uri.parse("Login_scuess");
Intent intent = new Intent(null, uri);
setResult(RESULT_OK, intent);
finish();
}
@Override
public void onError(String error) {
showToast(error);
}
});
}
private String mCode;
private void getCode(String phone){
JSONObject jb = new JSONObject();
try {
jb.put("phone", phone);
} catch (JSONException e) {
e.printStackTrace();
}
mBaseHttpClient.postData1(GET_CODE, jb, new AppAjaxCallback.onResultListener() {
@Override
public void onResult(String data, String msg) {
JSONObject jb;
try {
jb = new JSONObject(data);
mCode = jb.getString("code");
} catch (JSONException e) {
e.printStackTrace();
}
showToast(msg);
}
@Override
public void onError(String error) {
showToast(error);
}
});
}
private int mSeconds = 60;
private Timer mTimer;
private TimerTask mTimerTask;
private void startCountDown() {
mSeconds = 60;
stop();
mButtonResend.setEnabled(false);
mTimer = new Timer();
mTimerTask = new TimerTask() {
@Override
public void run() {
mSeconds--;
mHandler.post(new Runnable() {
@Override
public void run() {
if (mSeconds > 0) {
mButtonResend.setText(mSeconds + "秒\n后重发");
} else {
mButtonResend.setText("重发");
mButtonResend.setEnabled(true);
stop();
}
}
});
}
};
mTimer.schedule(mTimerTask, 0, 1000);
}
@Override
protected void onDestroy() {
super.onDestroy();
getActivity().unregisterReceiver(smsReceiver);
stop();
}
private void stop() {
if (mTimer != null) {
mTimer.cancel();
}
if (mTimerTask != null) {
mTimerTask.cancel();
}
}
}
|
[
"mirror5821@163.com"
] |
mirror5821@163.com
|
9cde770ffe1687263053d3d10a6b20f51e13b900
|
d40231597f41daf3315fe2b3963c9fe3edb3fca8
|
/Open Access Room/pki/modules/ejbca-ejb-cli/src/org/ejbca/ui/cli/keybind/BaseInternalKeyBindingCommand.java
|
35c75271bf625608c9b1f4647e87bf5a993169c8
|
[] |
no_license
|
bopopescu/code-1
|
15cf1778849773ab5250f9863ccd9f31e141ae67
|
8def42ea30b989407e5d71204d2a135a645e0e41
|
refs/heads/master
| 2021-05-27T21:14:50.544894
| 2014-09-29T09:46:04
| 2014-09-29T09:46:04
| null | 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 7,487
|
java
|
/*************************************************************************
* *
* EJBCA: The OpenSource Certificate Authority *
* *
* This software 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 any later version. *
* *
* See terms of license at gnu.org. *
* *
*************************************************************************/
package org.ejbca.ui.cli.keybind;
import java.io.Serializable;
import java.util.Map;
import java.util.Map.Entry;
import org.cesecore.authentication.tokens.AuthenticationToken;
import org.cesecore.authorization.AuthorizationDeniedException;
import org.cesecore.certificates.util.AlgorithmConstants;
import org.cesecore.certificates.util.AlgorithmTools;
import org.cesecore.keybind.InternalKeyBindingFactory;
import org.cesecore.keybind.InternalKeyBindingMgmtSessionRemote;
import org.cesecore.keybind.InternalKeyBindingProperty;
import org.cesecore.keybind.InternalKeyBindingPropertyValidationWrapper;
import org.cesecore.keybind.InternalKeyBindingStatus;
import org.ejbca.ui.cli.BaseCommand;
import org.ejbca.ui.cli.CliUsernameException;
import org.ejbca.ui.cli.ErrorAdminCommandException;
/**
* Base class for the InternalKeyBinding API access.
*
* @version $Id: BaseInternalKeyBindingCommand.java 18264 2013-12-10 18:01:49Z mikekushner $
*/
public abstract class BaseInternalKeyBindingCommand extends BaseCommand {
@Override
public String getMainCommand() {
return "keybind";
}
@Override
public String[] getMainCommandAliases() {
return new String[]{};
}
@Override
public String[] getSubCommandAliases() {
return new String[]{};
}
/**
* Overridable InternalKeyBinding-specific execution methods that will parse and interpret the first parameter
* (when present) as the name of a InternalKeyBinding and lookup its InternalKeyBindingId.
*/
public abstract void executeCommand(Integer internalKeyBindingId, String[] args) throws AuthorizationDeniedException, Exception;
@Override
public void execute(String[] args) throws ErrorAdminCommandException {
try {
args = parseUsernameAndPasswordFromArgs(args);
} catch (CliUsernameException e) {
return;
}
Integer internalKeyBindingId = null;
if (failIfInternalKeyBindIsMissing() && args.length>=2) {
final String internalKeyBindingName = args[1];
internalKeyBindingId = ejb.getRemoteSession(InternalKeyBindingMgmtSessionRemote.class).getIdFromName(internalKeyBindingName);
if (internalKeyBindingId==null) {
getLogger().info("Unknown InternalKeyBinding: " + internalKeyBindingName);
return;
}
}
try {
executeCommand(internalKeyBindingId, args);
} catch (AuthorizationDeniedException e) {
getLogger().info(e.getMessage());
} catch (Exception e) {
getLogger().info("Operation failed: " + e.getMessage());
getLogger().debug("", e);
}
}
/** Lists available types and their properties */
protected void showTypesProperties() {
final InternalKeyBindingMgmtSessionRemote internalKeyBindingMgmtSession = ejb.getRemoteSession(InternalKeyBindingMgmtSessionRemote.class);
Map<String, Map<String, InternalKeyBindingProperty<? extends Serializable>>> typesAndProperties = internalKeyBindingMgmtSession.getAvailableTypesAndProperties();
getLogger().info("Registered implementation types and implemention specific properties:");
for (Entry<String, Map<String, InternalKeyBindingProperty<? extends Serializable>>> entry : typesAndProperties.entrySet()) {
final StringBuilder sb = new StringBuilder();
sb.append(" ").append(entry.getKey()).append(" {");
for (InternalKeyBindingProperty<? extends Serializable> property : entry.getValue().values()) {
sb.append(property.getName()).append(",");
}
if (sb.charAt(sb.length()-1) == ',') {
sb.deleteCharAt(sb.length()-1);
}
sb.append("}");
getLogger().info(sb.toString());
}
}
protected void showStatuses() {
final StringBuilder sb = new StringBuilder("Status is one of ");
for (InternalKeyBindingStatus internalKeyBindingStatus : InternalKeyBindingStatus.values()) {
sb.append(internalKeyBindingStatus.name()).append(",");
}
sb.deleteCharAt(sb.length()-1);
getLogger().info(sb.toString());
}
protected void showSigAlgs() {
final StringBuilder sbAlg = new StringBuilder("Signature algorithm is one of ");
for (final String algorithm : AlgorithmConstants.AVAILABLE_SIGALGS) {
if (AlgorithmTools.isSigAlgEnabled(algorithm)) {
sbAlg.append(algorithm).append(',');
}
}
sbAlg.deleteCharAt(sbAlg.length()-1);
getLogger().info(sbAlg.toString());
}
protected boolean failIfInternalKeyBindIsMissing() {
return true;
}
/** @return the EJB CLI admin */
protected AuthenticationToken getAdmin() {
return getAuthenticationToken(cliUserName, cliPassword);
}
protected Map<String, Serializable> validateProperties(String type, Map<String, String> dataMap) {
InternalKeyBindingPropertyValidationWrapper validatedProperties = InternalKeyBindingFactory.INSTANCE.validateProperties(type, dataMap);
if (!validatedProperties.arePropertiesValid()) {
StringBuffer stringBuffer = new StringBuffer();
stringBuffer.append("\n");
stringBuffer.append("ERROR: Could not parse properties\n");
stringBuffer.append("\n");
if (validatedProperties.getUnknownProperties().size() > 0) {
stringBuffer.append("The following properties were unknown for the type: " + type + "\n");
for (String propertyName : validatedProperties.getUnknownProperties()) {
stringBuffer.append(" * '" + propertyName + "'\n");
}
stringBuffer.append("\n");
}
if (validatedProperties.getInvalidValues().size() > 0) {
stringBuffer.append("The following values were invalid:\n");
for (Entry<String, Class<?>> entry : validatedProperties.getInvalidValues().entrySet()) {
stringBuffer.append("Value '" + dataMap.get(entry.getKey()) + "' for property '" + entry.getKey() + "' was not of type "
+ entry.getValue().getSimpleName()+ "\n");
}
stringBuffer.append("\n");
}
getLogger().error(stringBuffer);
return null;
}
return validatedProperties.getPropertiesCopy();
}
}
|
[
"Panagiotis.Hasapis@intrasoft-intl.com"
] |
Panagiotis.Hasapis@intrasoft-intl.com
|
f331281b31aab1ca2fccbdead32a2d9e84ed0379
|
3c2d2c06d85abb9c7a1a84fefe9b72399c201f85
|
/phloc-css/src/main/java/com/phloc/css/decl/CSSKeyframesRule.java
|
e24ca6d090895bdb05b9daeb337c990a70f14c68
|
[] |
no_license
|
phlocbg/phloc-css
|
2240754f778d06fa95be411abf21544ecb0ac768
|
215a945f4ec585b0d24d65a5f39666fb8a67e124
|
refs/heads/master
| 2022-07-16T02:04:41.954879
| 2019-08-22T23:10:14
| 2019-08-22T23:10:14
| 41,243,652
| 1
| 0
| null | 2022-07-01T22:17:57
| 2015-08-23T09:27:32
|
Java
|
UTF-8
|
Java
| false
| false
| 7,554
|
java
|
/**
* Copyright (C) 2006-2015 phloc systems
* http://www.phloc.com
* office[at]phloc[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.phloc.css.decl;
import java.util.ArrayList;
import java.util.List;
import javax.annotation.Nonnegative;
import javax.annotation.Nonnull;
import javax.annotation.Nullable;
import javax.annotation.concurrent.NotThreadSafe;
import com.phloc.commons.ValueEnforcer;
import com.phloc.commons.annotations.Nonempty;
import com.phloc.commons.annotations.ReturnsMutableCopy;
import com.phloc.commons.collections.ContainerHelper;
import com.phloc.commons.hash.HashCodeGenerator;
import com.phloc.commons.state.EChange;
import com.phloc.commons.string.StringHelper;
import com.phloc.commons.string.ToStringGenerator;
import com.phloc.css.CSSSourceLocation;
import com.phloc.css.ECSSVersion;
import com.phloc.css.ICSSSourceLocationAware;
import com.phloc.css.ICSSVersionAware;
import com.phloc.css.ICSSWriterSettings;
/**
* Represents a single @keyframes rule.<br>
* Example:<br>
* <code>@keyframes identifier {
0% { top: 0; left: 0; }
30% { top: 50px; }
}</code>
*
* @author Philip Helger
*/
@NotThreadSafe
public class CSSKeyframesRule implements ICSSTopLevelRule, ICSSVersionAware, ICSSSourceLocationAware
{
private final String m_sDeclaration;
private final String m_sAnimationName;
private final List <CSSKeyframesBlock> m_aBlocks = new ArrayList <CSSKeyframesBlock> ();
private CSSSourceLocation m_aSourceLocation;
public static boolean isValidDeclaration (@Nonnull @Nonempty final String sDeclaration)
{
return StringHelper.startsWith (sDeclaration, '@') && StringHelper.endsWithIgnoreCase (sDeclaration, "keyframes");
}
public CSSKeyframesRule (@Nonnull @Nonempty final String sDeclaration, @Nonnull @Nonempty final String sAnimationName)
{
if (!isValidDeclaration (sDeclaration))
throw new IllegalArgumentException ("declaration");
m_sDeclaration = sDeclaration;
m_sAnimationName = sAnimationName;
}
/**
* @return The rule declaration string used in the CSS. Neither
* <code>null</code> nor empty. Always starting with <code>@</code>
* and ending with <code>keyframes</code>.
*/
@Nonnull
@Nonempty
public String getDeclaration ()
{
return m_sDeclaration;
}
@Nonnull
@Nonempty
public String getAnimationName ()
{
return m_sAnimationName;
}
public boolean hasBlocks ()
{
return !m_aBlocks.isEmpty ();
}
@Nonnegative
public int getBlockCount ()
{
return m_aBlocks.size ();
}
@Nonnull
public CSSKeyframesRule addBlock (@Nonnull final CSSKeyframesBlock aKeyframesBlock)
{
ValueEnforcer.notNull (aKeyframesBlock, "KeyframesBlock");
m_aBlocks.add (aKeyframesBlock);
return this;
}
@Nonnull
public CSSKeyframesRule addBlock (@Nonnegative final int nIndex, @Nonnull final CSSKeyframesBlock aKeyframesBlock)
{
ValueEnforcer.isGE0 (nIndex, "Index");
ValueEnforcer.notNull (aKeyframesBlock, "KeyframesBlock");
if (nIndex >= getBlockCount ())
m_aBlocks.add (aKeyframesBlock);
else
m_aBlocks.add (nIndex, aKeyframesBlock);
return this;
}
@Nonnull
public EChange removeBlock (@Nonnull final CSSKeyframesBlock aKeyframesBlock)
{
return EChange.valueOf (m_aBlocks.remove (aKeyframesBlock));
}
@Nonnull
public EChange removeBlock (@Nonnegative final int nBlockIndex)
{
if (nBlockIndex < 0 || nBlockIndex >= m_aBlocks.size ())
return EChange.UNCHANGED;
return EChange.valueOf (m_aBlocks.remove (nBlockIndex) != null);
}
/**
* Remove all blocks.
*
* @return {@link EChange#CHANGED} if any block was removed,
* {@link EChange#UNCHANGED} otherwise. Never <code>null</code>.
* @since 3.7.3
*/
@Nonnull
public EChange removeAllBlocks ()
{
if (m_aBlocks.isEmpty ())
return EChange.UNCHANGED;
m_aBlocks.clear ();
return EChange.CHANGED;
}
@Nullable
public CSSKeyframesBlock getBlockAtIndex (@Nonnegative final int nBlockIndex)
{
if (nBlockIndex < 0 || nBlockIndex >= m_aBlocks.size ())
return null;
return m_aBlocks.get (nBlockIndex);
}
@Nonnull
@ReturnsMutableCopy
public List <CSSKeyframesBlock> getAllBlocks ()
{
return ContainerHelper.newList (m_aBlocks);
}
@Nonnull
@Nonempty
public String getAsCSSString (@Nonnull final ICSSWriterSettings aSettings, @Nonnegative final int nIndentLevel)
{
aSettings.checkVersionRequirements (this);
// Always ignore keyframes rules?
if (!aSettings.isWriteKeyframesRules ())
return "";
if (aSettings.isRemoveUnnecessaryCode () && m_aBlocks.isEmpty ())
return "";
final boolean bOptimizedOutput = aSettings.isOptimizedOutput ();
final StringBuilder aSB = new StringBuilder (m_sDeclaration);
aSB.append (' ').append (m_sAnimationName).append (bOptimizedOutput ? "{" : " {");
if (!bOptimizedOutput)
aSB.append ('\n');
// Add all blocks
for (final CSSKeyframesBlock aBlock : m_aBlocks)
{
final String sBlockCSS = aBlock.getAsCSSString (aSettings, nIndentLevel + 1);
if (StringHelper.hasText (sBlockCSS))
{
if (!bOptimizedOutput)
aSB.append (aSettings.getIndent (nIndentLevel + 1));
aSB.append (sBlockCSS);
if (!bOptimizedOutput)
aSB.append ('\n');
}
}
if (!bOptimizedOutput)
aSB.append (aSettings.getIndent (nIndentLevel));
aSB.append ('}');
if (!bOptimizedOutput)
aSB.append ('\n');
return aSB.toString ();
}
@Nonnull
public ECSSVersion getMinimumCSSVersion ()
{
return ECSSVersion.CSS30;
}
public void setSourceLocation (@Nullable final CSSSourceLocation aSourceLocation)
{
m_aSourceLocation = aSourceLocation;
}
@Nullable
public CSSSourceLocation getSourceLocation ()
{
return m_aSourceLocation;
}
@Override
public boolean equals (final Object o)
{
if (o == this)
return true;
if (o == null || !getClass ().equals (o.getClass ()))
return false;
final CSSKeyframesRule rhs = (CSSKeyframesRule) o;
return m_sDeclaration.equals (rhs.m_sDeclaration) &&
m_sAnimationName.equals (rhs.m_sAnimationName) &&
m_aBlocks.equals (rhs.m_aBlocks);
}
@Override
public int hashCode ()
{
return new HashCodeGenerator (this).append (m_sDeclaration)
.append (m_sAnimationName)
.append (m_aBlocks)
.getHashCode ();
}
@Override
public String toString ()
{
return new ToStringGenerator (this).append ("declaration", m_sDeclaration)
.append ("animationName", m_sAnimationName)
.append ("blocks", m_aBlocks)
.appendIfNotNull ("sourceLocation", m_aSourceLocation)
.toString ();
}
}
|
[
"bg@phloc.com"
] |
bg@phloc.com
|
ce75f1544a170db8cd7435ab570e174ba4c03192
|
8af1164bac943cef64e41bae312223c3c0e38114
|
/results-java/nostra13--Android-Universal-Image-Loader/73bbec14113cec378905978f18b66b960661e27f/after/ImageDecoder.java
|
cd52497fc09ac7694eb9ac1e465d94be75758471
|
[] |
no_license
|
fracz/refactor-extractor
|
3ae45c97cc63f26d5cb8b92003b12f74cc9973a9
|
dd5e82bfcc376e74a99e18c2bf54c95676914272
|
refs/heads/master
| 2021-01-19T06:50:08.211003
| 2018-11-30T13:00:57
| 2018-11-30T13:00:57
| 87,353,478
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 3,219
|
java
|
package com.nostra13.universalimageloader.core;
import java.io.IOException;
import java.io.InputStream;
import java.net.URL;
import android.graphics.Bitmap;
import android.graphics.BitmapFactory;
import android.graphics.BitmapFactory.Options;
import com.nostra13.universalimageloader.core.assist.DecodingType;
import com.nostra13.universalimageloader.core.assist.ImageSize;
import com.nostra13.universalimageloader.core.download.ImageDownloader;
/**
* Decodes images to {@link Bitmap}
*
* @author Sergey Tarasevich (nostra13[at]gmail[dot]com)
* @see DecodingType
*/
class ImageDecoder {
private final URL imageUrl;
private final ImageDownloader imageDownloader;
private final ImageSize targetSize;
private final DecodingType decodingType;
/**
* @param imageUrl
* Image URL (<b>i.e.:</b> "http://site.com/image.png", "file:///mnt/sdcard/image.png")
* @param imageDownloader
* Image downloader
* @param targetImageSize
* Image size to scale to during decoding
* @param decodingType
* {@link DecodingType Decoding type}
*/
ImageDecoder(URL imageUrl, ImageDownloader imageDownloader, ImageSize targetImageSize, DecodingType decodingType) {
this.imageUrl = imageUrl;
this.imageDownloader = imageDownloader;
this.targetSize = targetImageSize;
this.decodingType = decodingType;
}
/**
* Decodes image from URL into {@link Bitmap}. Image is scaled close to incoming {@link ImageSize image size} during
* decoding. Initial image size is reduced by the power of 2 (according Android recommendations)
*
* @return Decoded bitmap
* @throws IOException
*/
public Bitmap decode() throws IOException {
Options decodeOptions = getBitmapOptionsForImageDecoding();
InputStream imageStream = imageDownloader.getStream(imageUrl);
try {
return BitmapFactory.decodeStream(imageStream, null, decodeOptions);
} finally {
imageStream.close();
}
}
private Options getBitmapOptionsForImageDecoding() throws IOException {
Options options = new Options();
options.inSampleSize = computeImageScale();
return options;
}
private int computeImageScale() throws IOException {
int width = targetSize.getWidth();
int height = targetSize.getHeight();
// decode image size
Options options = new Options();
options.inJustDecodeBounds = true;
InputStream imageStream = imageDownloader.getStream(imageUrl);
try {
BitmapFactory.decodeStream(imageStream, null, options);
} finally {
imageStream.close();
}
int scale = 1;
switch (decodingType) {
default:
case FAST:
// Find the correct scale value. It should be the power of 2.
int width_tmp = options.outWidth;
int height_tmp = options.outHeight;
while (true) {
if (width_tmp / 2 < width || height_tmp / 2 < height) break;
width_tmp /= 2;
height_tmp /= 2;
scale *= 2;
}
break;
case MEMORY_SAVING:
int widthScale = (int) (Math.floor(((double) options.outWidth) / width));
int heightScale = (int) (Math.floor(((double) options.outHeight) / height));
int minScale = Math.min(widthScale, heightScale);
if (minScale > 1) {
scale = minScale;
}
break;
}
return scale;
}
}
|
[
"fraczwojciech@gmail.com"
] |
fraczwojciech@gmail.com
|
08a8544d78400455c8be5ae6ba2f8b986b2a8e9a
|
32f0d9e3ea7e4c753c8d0b5ded5902ab08fa42bb
|
/oldataservice/src/main/java/com/sbm/module/partner/tianyancha/rest/baseinfo/domain/BaseInfo.java
|
78e07e441913232f67228dc9bb53efd2f58eb695
|
[] |
no_license
|
superbrandmall/oldataservice
|
8c30a746369b636c3f700109b35cfbe01f5e59f0
|
8749b32973300bff2f0aac1ef50c067923936f41
|
refs/heads/master
| 2018-12-25T01:06:23.913911
| 2018-10-18T01:25:42
| 2018-10-18T01:25:42
| 115,701,195
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 1,093
|
java
|
package com.sbm.module.partner.tianyancha.rest.baseinfo.domain;
/*****************************************************************************/
/**
* Project Name:onlineleasing<br/>
* Package Name:com.sbm.module.partner.tianyancha.rest.baseinfo.domain<br/>
* File Name:BaseInfoVo.java<br/>
*
* 作成日 :2017-8-30 上午9:23:20 <br/>
*
* @author :junkai.zhang
*/
public class BaseInfo {
private String uri;
/**
* 错误代码
*/
private Integer error_code;
/**
* 错误原因
*/
private String reason;
/**
* 返回内容
*/
private BaseInfoResult result;
public Integer getError_code() {
return error_code;
}
public void setError_code(Integer error_code) {
this.error_code = error_code;
}
public String getReason() {
return reason;
}
public void setReason(String reason) {
this.reason = reason;
}
public BaseInfoResult getResult() {
return result;
}
public void setResult(BaseInfoResult result) {
this.result = result;
}
public String getUri() {
return uri;
}
public void setUri(String uri) {
this.uri = uri;
}
}
|
[
"295322187@qq.com"
] |
295322187@qq.com
|
c6aceb9030b8ebad51ffde9b65969b961d964d1c
|
3a65b8241586fda0c2fee4256d38918d8ee5ee8f
|
/java-basic/src/main/java/bitcamp/java100/ch11/ex1/Test1.java
|
09076c582ae7ea34c2477e52119985bb21901670
|
[] |
no_license
|
KIMMIAE/bitcamp
|
1319f49df3cc3c4e8c5af6655b554d116d9c8678
|
ea9d17c38a889ad79b5eae2529457a259bcb4e14
|
refs/heads/master
| 2021-10-21T17:52:06.080521
| 2019-03-05T12:58:09
| 2019-03-05T12:58:09
| 104,423,475
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 258
|
java
|
// 상속 : specialization
package bitcamp.java100.ch11.ex1;
public class Test1 {
public static void main(String[] args) {
Car c = new Car();
c.model = "티코";
c.cc = 900;
c.run();
c.stop();
}
}
|
[
"kma613@naver.com"
] |
kma613@naver.com
|
736f9ebf94b3fdd86ca4ccccbc5bb684e20842ee
|
1043c01b7637098d046fbb9dba79b15eefbad509
|
/entity-view/testsuite/src/test/java/com/blazebit/persistence/view/testsuite/collections/subview/model/variations/PersonForCollectionsMapListSetMasterView.java
|
a3bab7b5034bd7a758f99e7edcef981d1d77e840
|
[
"Apache-2.0",
"LicenseRef-scancode-unknown-license-reference"
] |
permissive
|
ares3/blaze-persistence
|
45c06a3ec25c98236a109ab55a3205fc766734ed
|
2258e9d9c44bb993d41c5295eccbc894f420f263
|
refs/heads/master
| 2020-10-01T16:13:01.380347
| 2019-12-06T01:24:34
| 2019-12-09T09:29:49
| null | 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 1,239
|
java
|
/*
* Copyright 2014 - 2019 Blazebit.
*
* 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.blazebit.persistence.view.testsuite.collections.subview.model.variations;
import java.util.Set;
import com.blazebit.persistence.view.EntityView;
import com.blazebit.persistence.view.testsuite.collections.entity.simple.PersonForCollections;
import com.blazebit.persistence.view.testsuite.collections.subview.model.SubviewDocumentMapListSetView;
/**
*
* @author Christian Beikov
* @since 1.0.0
*/
@EntityView(PersonForCollections.class)
public interface PersonForCollectionsMapListSetMasterView extends PersonForCollectionsMasterView {
@Override
public Set<SubviewDocumentMapListSetView> getOwnedDocuments();
}
|
[
"christian.beikov@gmail.com"
] |
christian.beikov@gmail.com
|
57b5dfcea5bcc26c2bf0d895575371944eaae095
|
82a0c3f367d274a2c5a791945f320fc29f971e31
|
/src/main/java/com/somoplay/artonexpress/fedex/Rate/SmartPostShipmentProcessingOptionType.java
|
1743419abd2083dec3b841a0c5e0255127cda6e6
|
[] |
no_license
|
zl20072008zl/arton_nov
|
a21e682e40a2ee4d9e1b416565942c8a62a8951f
|
c3571a7b31c561691a785e3d2640ea0b5ab770a7
|
refs/heads/master
| 2020-03-19T02:22:35.567584
| 2018-05-20T14:16:43
| 2018-05-20T14:16:43
| 135,623,385
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 2,911
|
java
|
/**
* SmartPostShipmentProcessingOptionType.java
*
* This file was auto-generated from WSDL
* by the Apache Axis 1.4 Apr 22, 2006 (06:55:48 PDT) WSDL2Java emitter.
*/
package com.somoplay.artonexpress.fedex.Rate;
public class SmartPostShipmentProcessingOptionType implements java.io.Serializable {
private java.lang.String _value_;
private static java.util.HashMap _table_ = new java.util.HashMap();
// Constructor
protected SmartPostShipmentProcessingOptionType(java.lang.String value) {
_value_ = value;
_table_.put(_value_,this);
}
public static final java.lang.String _GROUND_TRACKING_NUMBER_REQUESTED = "GROUND_TRACKING_NUMBER_REQUESTED";
public static final SmartPostShipmentProcessingOptionType GROUND_TRACKING_NUMBER_REQUESTED = new SmartPostShipmentProcessingOptionType(_GROUND_TRACKING_NUMBER_REQUESTED);
public java.lang.String getValue() { return _value_;}
public static SmartPostShipmentProcessingOptionType fromValue(java.lang.String value)
throws java.lang.IllegalArgumentException {
SmartPostShipmentProcessingOptionType enumeration = (SmartPostShipmentProcessingOptionType)
_table_.get(value);
if (enumeration==null) throw new java.lang.IllegalArgumentException();
return enumeration;
}
public static SmartPostShipmentProcessingOptionType fromString(java.lang.String value)
throws java.lang.IllegalArgumentException {
return fromValue(value);
}
public boolean equals(java.lang.Object obj) {return (obj == this);}
public int hashCode() { return toString().hashCode();}
public java.lang.String toString() { return _value_;}
public java.lang.Object readResolve() throws java.io.ObjectStreamException { return fromValue(_value_);}
public static org.apache.axis.encoding.Serializer getSerializer(
java.lang.String mechType,
java.lang.Class _javaType,
javax.xml.namespace.QName _xmlType) {
return
new org.apache.axis.encoding.ser.EnumSerializer(
_javaType, _xmlType);
}
public static org.apache.axis.encoding.Deserializer getDeserializer(
java.lang.String mechType,
java.lang.Class _javaType,
javax.xml.namespace.QName _xmlType) {
return
new org.apache.axis.encoding.ser.EnumDeserializer(
_javaType, _xmlType);
}
// Type metadata
private static org.apache.axis.description.TypeDesc typeDesc =
new org.apache.axis.description.TypeDesc(SmartPostShipmentProcessingOptionType.class);
static {
typeDesc.setXmlType(new javax.xml.namespace.QName("http://fedex.com/ws/rate/v22", "SmartPostShipmentProcessingOptionType"));
}
/**
* Return type metadata object
*/
public static org.apache.axis.description.TypeDesc getTypeDesc() {
return typeDesc;
}
}
|
[
"lmywilks@hotmail.com"
] |
lmywilks@hotmail.com
|
1e84576f1fa1822a708567e9539a1995009e9fb5
|
fa91450deb625cda070e82d5c31770be5ca1dec6
|
/Diff-Raw-Data/35/35_fc46fa539e026713b5655bc046cd106d53e002b7/AsyncReplTest/35_fc46fa539e026713b5655bc046cd106d53e002b7_AsyncReplTest_s.java
|
907d05aeb840195f2457eb5c2b75a8ac3e9e702a
|
[] |
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,322
|
java
|
/*
*
* JBoss, the OpenSource J2EE webOS
*
* Distributable under LGPL license.
* See terms of license at gnu.org.
*/
package org.infinispan.replication;
import org.infinispan.Cache;
import org.infinispan.commands.write.PutKeyValueCommand;
import org.infinispan.config.Configuration;
import org.infinispan.test.MultipleCacheManagersTest;
import org.infinispan.test.TestingUtil;
import static org.testng.AssertJUnit.assertEquals;
import org.testng.annotations.Test;
import javax.transaction.TransactionManager;
@Test(groups = "functional", testName = "replication.AsyncReplTest")
public class AsyncReplTest extends MultipleCacheManagersTest {
protected void createCacheManagers() throws Throwable {
Configuration asyncConfiguration = getDefaultClusteredConfig(Configuration.CacheMode.REPL_ASYNC, true);
createClusteredCaches(2, "asyncRepl", asyncConfiguration);
}
public void testWithNoTx() throws Exception {
Cache cache1 = cache(0,"asyncRepl");
Cache cache2 = cache(1,"asyncRepl");
String key = "key";
replListener(cache2).expect(PutKeyValueCommand.class);
cache1.put(key, "value1");
// allow for replication
replListener(cache2).waitForRpc();
assertEquals("value1", cache1.get(key));
assertEquals("value1", cache2.get(key));
replListener(cache2).expect(PutKeyValueCommand.class);
cache1.put(key, "value2");
assertEquals("value2", cache1.get(key));
replListener(cache2).waitForRpc();
assertEquals("value2", cache1.get(key));
assertEquals("value2", cache2.get(key));
}
public void testWithTx() throws Exception {
Cache cache1 = cache(0,"asyncRepl");
Cache cache2 = cache(1,"asyncRepl");
String key = "key";
replListener(cache2).expect(PutKeyValueCommand.class);
cache1.put(key, "value1");
// allow for replication
replListener(cache2).waitForRpc();
assertNotLocked(cache1, key);
assertEquals("value1", cache1.get(key));
assertEquals("value1", cache2.get(key));
TransactionManager mgr = TestingUtil.getTransactionManager(cache1);
mgr.begin();
replListener(cache2).expectWithTx(PutKeyValueCommand.class);
cache1.put(key, "value2");
assertEquals("value2", cache1.get(key));
assertEquals("value1", cache2.get(key));
mgr.commit();
replListener(cache2).waitForRpc();
assertNotLocked(cache1, key);
assertEquals("value2", cache1.get(key));
assertEquals("value2", cache2.get(key));
mgr.begin();
cache1.put(key, "value3");
assertEquals("value3", cache1.get(key));
assertEquals("value2", cache2.get(key));
mgr.rollback();
assertEquals("value2", cache1.get(key));
assertEquals("value2", cache2.get(key));
assertNotLocked(cache1, key);
}
public void simpleTest() throws Exception {
Cache cache1 = cache(0,"asyncRepl");
Cache cache2 = cache(1,"asyncRepl");
String key = "key";
TransactionManager mgr = TestingUtil.getTransactionManager(cache1);
mgr.begin();
cache1.put(key, "value3");
mgr.rollback();
assertNotLocked(cache1, key);
}
}
|
[
"yuzhongxing88@gmail.com"
] |
yuzhongxing88@gmail.com
|
3f795112c7e62c74524853ccd54de9fc8690f5ec
|
4de728352967dc4f5ccf7ce2f9412ac3f458e6f4
|
/tests/org.jboss.tools.modeshape.ui.bot.test/src/org/jboss/tools/modeshape/ui/bot/test/suite/ModeshapeSuite.java
|
54511f9451cf7b3fef31a4fd445492b65b882f59
|
[] |
no_license
|
lfabriko/jbosstools-integration-stack-tests
|
5df872459fef7e120dde297d3e0e9f3ad1b4e25a
|
36ff22e62c8b00d16093431b26429e321b76472b
|
refs/heads/master
| 2020-11-30T11:54:44.742082
| 2014-05-05T08:35:45
| 2014-05-05T08:35:45
| null | 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 5,376
|
java
|
package org.jboss.tools.modeshape.ui.bot.test.suite;
import java.io.File;
import java.io.FileNotFoundException;
import java.io.FileReader;
import java.io.IOException;
import java.util.Properties;
import org.jboss.reddeer.junit.runner.RedDeerSuite;
import org.eclipse.swtbot.eclipse.finder.SWTWorkbenchBot;
import org.jboss.tools.modeshape.reddeer.view.ServerPreferencePage;
import org.jboss.tools.modeshape.reddeer.wizard.ServerWizard;
import org.junit.runners.model.InitializationError;
import org.junit.runners.model.RunnerBuilder;
/**
* ModeShape Test Suite
*
* @author apodhrad
*
*/
public class ModeshapeSuite extends RedDeerSuite {
public static final String PROPERTIES_FILE = "swtbot.test.properties.file";
private static String serverName;
private static String serverPath;
private static final String TEIID_DRIVER_PATH_sinceDV6 ="/dataVirtualization/jdbc/";
public ModeshapeSuite(Class<?> clazz, RunnerBuilder builder) throws InitializationError {
super(clazz, foo(builder));
}
private static RunnerBuilder foo(RunnerBuilder builder) {
Properties props = loadSWTBotProperties();
addServer(props.getProperty("SERVER"));
closeWelcome();
return builder;
}
public static String getServerName() {
return serverName;
}
public static String getServerPath() {
return serverPath;
}
public static String getModeshapeRepository() {
Properties props = loadSWTBotProperties();
return props.getProperty("MODESHAPE");
}
private static void closeWelcome() {
try {
new SWTWorkbenchBot().viewByTitle("Welcome").close();
} catch (Exception ex) {
// ok
}
}
private static Properties loadSWTBotProperties() {
Properties props = new Properties();
String propsFile = System.getProperty(PROPERTIES_FILE);
if (propsFile != null) {
try {
props.load(new FileReader(propsFile));
} catch (FileNotFoundException e) {
e.printStackTrace();
throw new RuntimeException("Couldn't find properties file!");
} catch (IOException e) {
e.printStackTrace();
throw new RuntimeException("I/O excpetion during reading properties file!");
}
}
return props;
}
private static void addServer(String serverConfig) {
if (serverConfig == null) {
return;
}
String[] param = serverConfig.split(",");
if (param.length < 4) {
throw new RuntimeException("Bad format of SERVER config");
}
String type = param[0];
String version = param[1];
String path = new File(param[3]).getAbsolutePath();
serverName = type + "-" + version;
serverPath = path;
ServerPreferencePage serverPP = new ServerPreferencePage();
serverPP.open();
serverPP.addServerRuntime(serverName, path, getServerRuntime(type, version));
serverPP.ok();
ServerWizard serverWizard = new ServerWizard();
serverWizard.setType(getServerType(type, version));
serverWizard.setName(serverName);
serverWizard.execute();
}
private static String[] getServerType(String type, String version) {
String[] serverType = new String[2];
if (type.equals("EAP")) {
serverType[0] = "JBoss Enterprise Middleware";
if (version.startsWith("6.0")) {
serverType[1] = "JBoss Enterprise Application Platform 6.0";
}
if (version.startsWith("6.1")) {
serverType[1] = "JBoss Enterprise Application Platform 6.1";
}
} else if (type.equals("SOA")) {
serverType[0] = "JBoss Enterprise Middleware";
if (version.startsWith("5")) {
serverType[1] = "JBoss Enterprise Application Platform 5.x";
} if (version.startsWith("6")) {
serverType[1] = "JBoss Enterprise Application Platform 6.1";
}
} else if (type.equals("AS")) {
serverType[0] = "JBoss Community";
serverType[1] = "JBoss AS " + version;
} else {
throw new RuntimeException("You have to specify if it is AS or SOA or EAP");
}
return serverType;
}
private static String[] getServerRuntime(String type, String version) {
String[] serverRuntime = new String[2];
if (type.equals("EAP")) {
serverRuntime[0] = "JBoss Enterprise Middleware";
if (version.startsWith("6.0")) {
serverRuntime[1] = "JBoss Enterprise Application Platform 6.0 Runtime";
}
if (version.startsWith("6.1")) {
serverRuntime[1] = "JBoss Enterprise Application Platform 6.1 Runtime";
}
} else if (type.equals("SOA")) {
serverRuntime[0] = "JBoss Enterprise Middleware";
if (version.startsWith("5")) {
serverRuntime[1] = "JBoss Enterprise Application Platform 5.x Runtime";
} else if (version.startsWith("6")) {
serverRuntime[1] = "JBoss Enterprise Application Platform 6.1 Runtime";
}
} else if (type.equals("AS")) {
serverRuntime[0] = "JBoss Community";
serverRuntime[1] = "JBoss " + version + " Runtime";
} else {
throw new RuntimeException("You have to specify if it is AS or SOA or EAP");
}
return serverRuntime;
}
public static String getDriverPath(String serverPath){
String driverName = "";
File dir = new File(serverPath + TEIID_DRIVER_PATH_sinceDV6);
for(File file : dir.listFiles()) {
if(file.getName().startsWith("teiid-") && file.getName().endsWith(".jar")){
driverName = file.getName();
break;
}
}
return TEIID_DRIVER_PATH_sinceDV6 + driverName;
}
}
|
[
"vpakan@redhat.com"
] |
vpakan@redhat.com
|
a64d987666514e599a2ee3e34a8360fe94e084bb
|
e3162d976b3a665717b9a75c503281e501ec1b1a
|
/src/main/java/com/alipay/api/response/AlipayOpenMiniInneraccountPidQueryResponse.java
|
cc9fb1c5790ee9ac87325db18539f62bec4acb36
|
[
"Apache-2.0"
] |
permissive
|
sunandy3/alipay-sdk-java-all
|
16b14f3729864d74846585796a28d858c40decf8
|
30e6af80cffc0d2392133457925dc5e9ee44cbac
|
refs/heads/master
| 2020-07-30T14:07:34.040692
| 2019-09-20T09:35:20
| 2019-09-20T09:35:20
| null | 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 611
|
java
|
package com.alipay.api.response;
import com.alipay.api.internal.mapping.ApiField;
import com.alipay.api.AlipayResponse;
/**
* ALIPAY API: alipay.open.mini.inneraccount.pid.query response.
*
* @author auto create
* @since 1.0, 2019-01-07 20:51:15
*/
public class AlipayOpenMiniInneraccountPidQueryResponse extends AlipayResponse {
private static final long serialVersionUID = 4841349931333997236L;
/**
* 虚拟PID
*/
@ApiField("pid")
private String pid;
public void setPid(String pid) {
this.pid = pid;
}
public String getPid( ) {
return this.pid;
}
}
|
[
"ben.zy@antfin.com"
] |
ben.zy@antfin.com
|
272e8666284ffedf647b04c0f063960c368c2936
|
98e5b3aec60935f6768cb4e2a24b21da0b528b6d
|
/applayer/tactics/src/main/java/com/waben/stock/applayer/tactics/security/jwt/JWTAuthenticationFilter.java
|
741d7205ba98268caa2cba2aac24692cf8360685
|
[] |
no_license
|
sunliang123/zhongbei-zhonghang-zhongzi-yidian
|
3eb95a77658d7ad9de1cdf9c3f85714ee007a871
|
54fed94b9784f5e392b4b9517cb5fe19c1b34443
|
refs/heads/master
| 2020-03-29T05:26:02.515289
| 2018-09-20T09:11:48
| 2018-09-20T09:11:48
| 149,582,090
| 1
| 5
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 4,749
|
java
|
package com.waben.stock.applayer.tactics.security.jwt;
import java.io.IOException;
import java.util.Date;
import java.util.List;
import java.util.Map;
import javax.servlet.FilterChain;
import javax.servlet.ServletException;
import javax.servlet.ServletRequest;
import javax.servlet.ServletResponse;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import org.springframework.http.HttpStatus;
import org.springframework.security.authentication.UsernamePasswordAuthenticationToken;
import org.springframework.security.core.GrantedAuthority;
import org.springframework.security.core.authority.AuthorityUtils;
import org.springframework.security.core.context.SecurityContextHolder;
import org.springframework.web.filter.GenericFilterBean;
import com.waben.stock.applayer.tactics.security.CustomUserDetails;
import com.waben.stock.applayer.tactics.security.WebSecurityConfig;
import com.waben.stock.applayer.tactics.service.RedisCache;
import com.waben.stock.interfaces.enums.RedisCacheKeyType;
public class JWTAuthenticationFilter extends GenericFilterBean {
private RedisCache redisCache;
private static final String BLACKUSER_REDISKEY = "BLACKUSER";
private boolean isNoneAuthPath(String url) {
boolean isMatch = false;
for (String noneAuthPath : WebSecurityConfig.noneAuthPaths) {
if (noneAuthPath.indexOf("**") > 0) {
noneAuthPath = noneAuthPath.replaceAll("\\*\\*", "");
}
if (url.indexOf(noneAuthPath) > 0) {
isMatch = true;
break;
}
}
return isMatch;
}
@Override
public void doFilter(ServletRequest request, ServletResponse response, FilterChain filterChain)
throws IOException, ServletException {
HttpServletRequest httpRequest = (HttpServletRequest) request;
// 获取请求中的token
String token = httpRequest.getHeader(JWTTokenUtil.HEADER_STRING);
if (token != null && !"".equals(token)) {
// 获取token中的信息
try {
Map<String, Object> tokenInfo = JWTTokenUtil.getTokenInfo(token);
String username = (String) tokenInfo.get("sub");
Long userId = new Long((Integer) tokenInfo.get("userId"));
String isBlack = redisCache.get(BLACKUSER_REDISKEY + "_" + String.valueOf(userId));
// 判断该用户是否为黑名单用户
if (isBlack != null && "true".equals(isBlack)) {
String url = httpRequest.getRequestURL().toString();
if (!isNoneAuthPath(url)) {
httpRequest.getSession().invalidate();
HttpServletResponse httpResponse = (HttpServletResponse) response;
httpResponse.setStatus(409);
if (SecurityContextHolder.getContext().getAuthentication() != null) {
SecurityContextHolder.getContext().getAuthentication().setAuthenticated(false);
}
return;
}
} else {
// 判断该token是否为最新登陆的token
String cacheToken = redisCache.get(String.format(RedisCacheKeyType.AppToken.getKey(), username));
if (cacheToken != null && !"".equals(cacheToken) && !cacheToken.equals(token)) {
String url = httpRequest.getRequestURL().toString();
if (!isNoneAuthPath(url)) {
httpRequest.getSession().invalidate();
HttpServletResponse httpResponse = (HttpServletResponse) response;
httpResponse.setStatus(HttpStatus.FORBIDDEN.value());
if(SecurityContextHolder.getContext().getAuthentication() != null) {
SecurityContextHolder.getContext().getAuthentication().setAuthenticated(false);
}
}
} else {
// 判断username是否存在,以及token是否过期
String serialCode = (String) tokenInfo.get("serialCode");
if (username != null && !"".equals(username)) {
Date exp = (Date) tokenInfo.get("exp");
if (exp != null && exp.getTime() * 1000 > System.currentTimeMillis()) {
// 如果为正确的token,将身份验证放入上下文中
List<GrantedAuthority> authorities = AuthorityUtils
.commaSeparatedStringToAuthorityList((String) tokenInfo.get("authorities"));
CustomUserDetails userDeatails = new CustomUserDetails(userId, serialCode, username,
null, authorities);
UsernamePasswordAuthenticationToken authentication = new UsernamePasswordAuthenticationToken(
username, null, authorities);
authentication.setDetails(userDeatails);
SecurityContextHolder.getContext().setAuthentication(authentication);
}
}
}
}
} catch (Exception ex) {
ex.printStackTrace();
HttpServletResponse httpResponse = (HttpServletResponse) response;
httpResponse.setStatus(HttpStatus.FORBIDDEN.value());
}
}
filterChain.doFilter(request, response);
}
public void setJedisCache(RedisCache redisCache) {
this.redisCache = redisCache;
}
}
|
[
"sunliang_s666@163.com"
] |
sunliang_s666@163.com
|
f974af5b79092f9138098674316422851c14b11c
|
bbdd6382b7a5b321dd4820894695476703b98444
|
/yuimarl-lib/src/main/java/jp/yuimarl/qualifiers/ValidDate.java
|
1d805217a217c44f4a67000f6426318222abb1b9
|
[
"MIT"
] |
permissive
|
making/yuimarl
|
61bac162e67327e548e1f8b45b0375dc51f4cdaf
|
52727f59633473849a1974769c31270f8611fabd
|
refs/heads/master
| 2021-01-18T19:22:06.195448
| 2014-11-27T04:05:10
| 2014-11-27T04:05:10
| null | 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 3,280
|
java
|
/*
* The MIT License (MIT)
*
* Copyright (c) 2014 BitFarm Corporation
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/
package jp.yuimarl.qualifiers;
import java.lang.annotation.Documented;
import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.regex.Matcher;
import javax.validation.Constraint;
import javax.validation.ConstraintValidator;
import javax.validation.ConstraintValidatorContext;
import javax.validation.Payload;
import jp.yuimarl.qualifiers.ValidDate.DateValidator2;
/**
*
* @author Masahiro Nitta
*/
@Constraint(validatedBy = {DateValidator2.class})
@Documented
@Target({ElementType.METHOD,
ElementType.FIELD,
ElementType.ANNOTATION_TYPE,
ElementType.CONSTRUCTOR,
ElementType.PARAMETER})
@Retention(RetentionPolicy.RUNTIME)
public @interface ValidDate {
String message() default "{invalid.date}";
Class<?>[] groups() default {};
Class<? extends Payload>[] payload() default {};
@Target({ElementType.METHOD,
ElementType.FIELD,
ElementType.ANNOTATION_TYPE,
ElementType.CONSTRUCTOR,
ElementType.PARAMETER})
@Retention(RetentionPolicy.RUNTIME)
@Documented
@interface List {
ValidDate[] value();
}
class DateValidator2 implements ConstraintValidator<ValidDate, String> {
private SimpleDateFormat sdf1;
@Override
public void initialize(ValidDate date) {
sdf1 = new SimpleDateFormat("yyyy/MM/dd");
}
@Override
public boolean isValid(String date, ConstraintValidatorContext context) {
if (date == null || date.equals("")) {
return true;
}
java.util.regex.Pattern p = java.util.regex.Pattern.compile("^\\d{4}/\\d{2}/\\d{2}$");
Matcher m = p.matcher(date);
if (m.find() == false) {
return false;
}
try {
sdf1.parse(date);
} catch (ParseException e) {
return false;
}
return true;
}
}
}
|
[
"makingx@gmail.com"
] |
makingx@gmail.com
|
354ad26bf5797fd0463d61469c33f3ba767a26c7
|
53bdf2073b1907a2d8e34eb631ac8258f62fe89b
|
/src/main/java/science/mengxin/jhipster/application/web/rest/UserJWTController.java
|
85c255c35c04938e4ad089399d945afe1e574182
|
[] |
no_license
|
xmeng1/jhipsterSampleApplication
|
e020a7ea84d3464d4840a83029b2b2ac105a22dd
|
aa78364b0fa42b31151be38d8ba20243d6ef5fc8
|
refs/heads/master
| 2020-03-21T10:49:55.879435
| 2018-06-24T10:39:26
| 2018-06-24T10:39:26
| 138,349,097
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 2,610
|
java
|
package science.mengxin.jhipster.application.web.rest;
import science.mengxin.jhipster.application.security.jwt.JWTConfigurer;
import science.mengxin.jhipster.application.security.jwt.TokenProvider;
import science.mengxin.jhipster.application.web.rest.vm.LoginVM;
import com.codahale.metrics.annotation.Timed;
import com.fasterxml.jackson.annotation.JsonProperty;
import org.springframework.http.HttpStatus;
import org.springframework.http.HttpHeaders;
import org.springframework.http.ResponseEntity;
import org.springframework.security.authentication.AuthenticationManager;
import org.springframework.security.authentication.UsernamePasswordAuthenticationToken;
import org.springframework.security.core.Authentication;
import org.springframework.security.core.context.SecurityContextHolder;
import org.springframework.web.bind.annotation.*;
import javax.validation.Valid;
/**
* Controller to authenticate users.
*/
@RestController
@RequestMapping("/api")
public class UserJWTController {
private final TokenProvider tokenProvider;
private final AuthenticationManager authenticationManager;
public UserJWTController(TokenProvider tokenProvider, AuthenticationManager authenticationManager) {
this.tokenProvider = tokenProvider;
this.authenticationManager = authenticationManager;
}
@PostMapping("/authenticate")
@Timed
public ResponseEntity<JWTToken> authorize(@Valid @RequestBody LoginVM loginVM) {
UsernamePasswordAuthenticationToken authenticationToken =
new UsernamePasswordAuthenticationToken(loginVM.getUsername(), loginVM.getPassword());
Authentication authentication = this.authenticationManager.authenticate(authenticationToken);
SecurityContextHolder.getContext().setAuthentication(authentication);
boolean rememberMe = (loginVM.isRememberMe() == null) ? false : loginVM.isRememberMe();
String jwt = tokenProvider.createToken(authentication, rememberMe);
HttpHeaders httpHeaders = new HttpHeaders();
httpHeaders.add(JWTConfigurer.AUTHORIZATION_HEADER, "Bearer " + jwt);
return new ResponseEntity<>(new JWTToken(jwt), httpHeaders, HttpStatus.OK);
}
/**
* Object to return as body in JWT Authentication.
*/
static class JWTToken {
private String idToken;
JWTToken(String idToken) {
this.idToken = idToken;
}
@JsonProperty("id_token")
String getIdToken() {
return idToken;
}
void setIdToken(String idToken) {
this.idToken = idToken;
}
}
}
|
[
"jhipster-bot@users.noreply.github.com"
] |
jhipster-bot@users.noreply.github.com
|
d2e13c5df55ed290fe635b0b3b3cda9f5d145790
|
13176999a9a384eb29cf3da235ebca8fd7ef0dea
|
/server-spi/src/main/java/org/keycloak/policy/NotUsernamePasswordPolicyProvider.java
|
54634e670c1cf69fe9a3c578fa17aea455299f05
|
[
"Apache-2.0"
] |
permissive
|
imransashraf/keycloak
|
521314c4602f00507598ae768ec143f684a43e79
|
d138b19adb51418f81d2f60b04297eeefef7612a
|
refs/heads/master
| 2023-08-17T14:25:30.598407
| 2016-08-24T07:53:29
| 2016-08-24T07:53:29
| 66,573,949
| 0
| 0
|
NOASSERTION
| 2023-06-28T04:02:24
| 2016-08-25T16:14:29
|
Java
|
UTF-8
|
Java
| false
| false
| 1,703
|
java
|
/*
* Copyright 2016 Red Hat, Inc. and/or its affiliates
* and other contributors as indicated by the @author tags.
*
* 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.keycloak.policy;
import org.keycloak.models.KeycloakContext;
import org.keycloak.models.UserModel;
/**
* @author <a href="mailto:sthorger@redhat.com">Stian Thorgersen</a>
*/
public class NotUsernamePasswordPolicyProvider implements PasswordPolicyProvider {
private static final String ERROR_MESSAGE = "invalidPasswordNotUsernameMessage";
private KeycloakContext context;
public NotUsernamePasswordPolicyProvider(KeycloakContext context) {
this.context = context;
}
@Override
public PolicyError validate(String username, String password) {
if (username == null) {
return null;
}
return username.equals(password) ? new PolicyError(ERROR_MESSAGE) : null;
}
@Override
public PolicyError validate(UserModel user, String password) {
return validate(user.getUsername(), password);
}
@Override
public Object parseConfig(String value) {
return null;
}
@Override
public void close() {
}
}
|
[
"stianst@gmail.com"
] |
stianst@gmail.com
|
150c46e0a8bac33929d294b5e135ffaa6d209206
|
0b4844d550c8e77cd93940e4a1d8b06d0fbeabf7
|
/JavaSource/dream/asset/loc/goal/dao/oraImpl/MaLnGoalListDAOOraImpl.java
|
669e2a92beca017893b179a72259fa8041d06699
|
[] |
no_license
|
eMainTec-DREAM/DREAM
|
bbf928b5c50dd416e1d45db3722f6c9e35d8973c
|
05e3ea85f9adb6ad6cbe02f4af44d941400a1620
|
refs/heads/master
| 2020-12-22T20:44:44.387788
| 2020-01-29T06:47:47
| 2020-01-29T06:47:47
| 236,912,749
| 0
| 0
| null | null | null | null |
UHC
|
Java
| false
| false
| 4,490
|
java
|
package dream.asset.loc.goal.dao.oraImpl;
import java.util.List;
import common.bean.User;
import common.spring.BaseJdbcDaoSupportOra;
import common.util.QueryBuffer;
import dream.asset.loc.goal.dao.MaLnGoalListDAO;
import dream.asset.loc.goal.dto.MaLnGoalCommonDTO;
/**
* 목록 dao
* @author
* @version $Id: $
* @since 1.0
* @spring.bean id="maLnGoalListDAOTarget"
* @spring.txbn id="maLnGoalListDAO"
* @spring.property name="dataSource" ref="dataSource"
*/
public class MaLnGoalListDAOOraImpl extends BaseJdbcDaoSupportOra implements MaLnGoalListDAO
{
/**
* grid find
* @author
* @version $Id: $
* @since 1.0
*
* @param maLnGoalCommonDTO
* @return List
*/
public List findList(MaLnGoalCommonDTO maLnGoalCommonDTO, User loginUser)
{
QueryBuffer query = new QueryBuffer();
query.append("SELECT ");
query.append(" '' seqNo, ");
query.append(" '' isDelCheck, ");
query.append(" SFAPLANTTODESC(comp_no, plant) plant, ");
query.append(" SUBSTR(yyyymm, 0, 4)||'-'||SUBSTR(yyyymm, 5, 2) yyyymm, ");
query.append(" (SELECT x.full_desc ");
query.append(" FROM TAEQLOC x ");
query.append(" WHERE x.eqloc_id = a.eqloc_id) eqlocId, ");
query.append(" mtlnpoint, ");
query.append(" SFACODE_TO_DESC(mtlnpoint,'MTLNPOINT','SYS','','"+loginUser.getLangId()+"') mtpointDesc, ");
query.append(" pvalue, ");
query.append(" remark, ");
query.append(" mtLnPoint_id mtLnPointId ");
query.append("FROM TAMTLNPOINT a ");
query.append("WHERE 1=1 ");
query.append(this.getWhere(maLnGoalCommonDTO, loginUser));
query.append("ORDER BY comp_no, plant, yyyymm, eqloc_id, mtlnpoint ");
return getJdbcTemplate().queryForList(query.toString());
}
/**
* Filter 조건
* @author ssong
* @version $Id: $
* @since 1.0
*
* @param maLnGoalCommonDTO
* @return
* @throws Exception
*/
private String getWhere(MaLnGoalCommonDTO maLnGoalCommonDTO, User loginUser)
{
QueryBuffer query = new QueryBuffer();
if (!"".equals(maLnGoalCommonDTO.getMtLnPointId()))
{
query.getAndQuery("mtLnPoint_id", maLnGoalCommonDTO.getMtLnPointId());
return query.toString();
}
query.getCodeLikeQuery("plant", "SFAPLANTTODESC(comp_no, plant)", maLnGoalCommonDTO.getPlant(), maLnGoalCommonDTO.getPlantDesc());
//위치
query.getEqLocLevelQuery("eqloc_id", maLnGoalCommonDTO.getEqlocId(), maLnGoalCommonDTO.getEqlocIdDesc(), loginUser.getCompNo());
query.getAndDateQuery("yyyymm", maLnGoalCommonDTO.getStartYyyymm(), maLnGoalCommonDTO.getEndYyyymm());
query.getAndQuery("mtlnpoint", maLnGoalCommonDTO.getGoalItem());
return query.toString();
}
/**
* 삭제
* @author ssong
* @version $Id: $
* @since 1.0
*
* @param compNo
* @param partId
* @return
*/
public int deleteHeader(String key, User loginUser)
{
QueryBuffer query = new QueryBuffer();
query.append("DELETE TAMTLNPOINT ");
query.append("WHERE comp_no = ? ");
query.append(" and mtLnPoint_id = ? ");
Object[] objects = new Object[] {
loginUser.getCompNo(),
key
};
return this.getJdbcTemplate().update(query.toString(), objects);
}
}
|
[
"HN4741@10.31.0.185"
] |
HN4741@10.31.0.185
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.