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
|
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
a8b6fd9c9992a24625deabce7feeedcd6d21cba4
|
1ec37f324566d809732b120b172876d9ab2e1606
|
/android/app/src/debug/java/com/todosapp/ReactNativeFlipper.java
|
ad007ec9a5d075c69c630d396369b5f4cc9c31c8
|
[] |
no_license
|
harpreet-appinventiv/TodosApp
|
de303db3a54673106eebf5f95620d42466802274
|
497aad9b8c4c9390f96d1df4756cb5caa53d9b19
|
refs/heads/master
| 2023-02-22T14:54:26.922659
| 2021-01-25T15:24:32
| 2021-01-25T15:24:32
| 331,977,329
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 3,263
|
java
|
/**
* Copyright (c) Facebook, Inc. and its affiliates.
*
* <p>This source code is licensed under the MIT license found in the LICENSE file in the root
* directory of this source tree.
*/
package com.todosapp;
import android.content.Context;
import com.facebook.flipper.android.AndroidFlipperClient;
import com.facebook.flipper.android.utils.FlipperUtils;
import com.facebook.flipper.core.FlipperClient;
import com.facebook.flipper.plugins.crashreporter.CrashReporterPlugin;
import com.facebook.flipper.plugins.databases.DatabasesFlipperPlugin;
import com.facebook.flipper.plugins.fresco.FrescoFlipperPlugin;
import com.facebook.flipper.plugins.inspector.DescriptorMapping;
import com.facebook.flipper.plugins.inspector.InspectorFlipperPlugin;
import com.facebook.flipper.plugins.network.FlipperOkhttpInterceptor;
import com.facebook.flipper.plugins.network.NetworkFlipperPlugin;
import com.facebook.flipper.plugins.react.ReactFlipperPlugin;
import com.facebook.flipper.plugins.sharedpreferences.SharedPreferencesFlipperPlugin;
import com.facebook.react.ReactInstanceManager;
import com.facebook.react.bridge.ReactContext;
import com.facebook.react.modules.network.NetworkingModule;
import okhttp3.OkHttpClient;
public class ReactNativeFlipper {
public static void initializeFlipper(Context context, ReactInstanceManager reactInstanceManager) {
if (FlipperUtils.shouldEnableFlipper(context)) {
final FlipperClient client = AndroidFlipperClient.getInstance(context);
client.addPlugin(new InspectorFlipperPlugin(context, DescriptorMapping.withDefaults()));
client.addPlugin(new ReactFlipperPlugin());
client.addPlugin(new DatabasesFlipperPlugin(context));
client.addPlugin(new SharedPreferencesFlipperPlugin(context));
client.addPlugin(CrashReporterPlugin.getInstance());
NetworkFlipperPlugin networkFlipperPlugin = new NetworkFlipperPlugin();
NetworkingModule.setCustomClientBuilder(
new NetworkingModule.CustomClientBuilder() {
@Override
public void apply(OkHttpClient.Builder builder) {
builder.addNetworkInterceptor(new FlipperOkhttpInterceptor(networkFlipperPlugin));
}
});
client.addPlugin(networkFlipperPlugin);
client.start();
// Fresco Plugin needs to ensure that ImagePipelineFactory is initialized
// Hence we run if after all native modules have been initialized
ReactContext reactContext = reactInstanceManager.getCurrentReactContext();
if (reactContext == null) {
reactInstanceManager.addReactInstanceEventListener(
new ReactInstanceManager.ReactInstanceEventListener() {
@Override
public void onReactContextInitialized(ReactContext reactContext) {
reactInstanceManager.removeReactInstanceEventListener(this);
reactContext.runOnNativeModulesQueueThread(
new Runnable() {
@Override
public void run() {
client.addPlugin(new FrescoFlipperPlugin());
}
});
}
});
} else {
client.addPlugin(new FrescoFlipperPlugin());
}
}
}
}
|
[
"admin@Admins-MacBook-Pro.local"
] |
admin@Admins-MacBook-Pro.local
|
bf05b9b8c06d51979345c9c63dcbfea19171a9e2
|
fa91450deb625cda070e82d5c31770be5ca1dec6
|
/Diff-Raw-Data/20/20_769b262e8d049c567b715bfee4e2b51f99eb83f3/RateType/20_769b262e8d049c567b715bfee4e2b51f99eb83f3_RateType_t.java
|
8afbcb7186f7915361b0700374fdb7159e669e04
|
[] |
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
| 971
|
java
|
package org.strangeforest.currencywatch.rest;
import java.math.*;
import java.util.*;
import javax.xml.bind.annotation.*;
import org.strangeforest.currencywatch.core.*;
@XmlRootElement(name = "rate")
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "rate", propOrder = {"date", "bid", "ask", "middle"})
public class RateType {
@XmlAttribute(required=true) private Date date;
@XmlAttribute(required=true) private BigDecimal bid;
@XmlAttribute(required=true) private BigDecimal ask;
@XmlAttribute(required=true) private BigDecimal middle;
public RateType() {}
public RateType(Date date, RateValue rate) {
this.date = date;
this.bid = rate.getBid();
this.ask = rate.getAsk();
this.middle = rate.getMiddle();
}
public Date getDate() {
return date;
}
public BigDecimal getBid() {
return bid;
}
public BigDecimal getAsk() {
return ask;
}
public BigDecimal getMiddle() {
return middle;
}
}
|
[
"yuzhongxing88@gmail.com"
] |
yuzhongxing88@gmail.com
|
18ec03f5b610c9e5d1d707cefb708e4d6cac2878
|
66e2f35b7b56865552616cf400e3a8f5928d12a2
|
/src/main/java/com/alipay/api/response/AlipayMobileCodeCreateResponse.java
|
4c923dd053d743286306e9b427f836196c60077a
|
[
"Apache-2.0"
] |
permissive
|
xiafaqi/alipay-sdk-java-all
|
18dc797400847c7ae9901566e910527f5495e497
|
606cdb8014faa3e9125de7f50cbb81b2db6ee6cc
|
refs/heads/master
| 2022-11-25T08:43:11.997961
| 2020-07-23T02:58:22
| 2020-07-23T02:58:22
| null | 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 3,838
|
java
|
package com.alipay.api.response;
import java.util.Date;
import com.alipay.api.internal.mapping.ApiField;
import com.alipay.api.AlipayResponse;
/**
* ALIPAY API: alipay.mobile.code.create response.
*
* @author auto create
* @since 1.0, 2019-05-22 09:51:30
*/
public class AlipayMobileCodeCreateResponse extends AlipayResponse {
private static final long serialVersionUID = 7155647825453415837L;
/**
* 业务关联的id,如订单号,userId
*/
@ApiField("biz_linked_id")
private String bizLinkedId;
/**
* 业务类型,类型产品名称
*/
@ApiField("biz_type")
private String bizType;
/**
* 码值状态,
init:初始
normal:正常
pause:暂停
stop:停止
*/
@ApiField("code_status")
private String codeStatus;
/**
* 发码接口传入的扩展参数,业务自定义,码平台不用理解。
*/
@ApiField("context_str")
private String contextStr;
/**
* 动态生成图片地址
*/
@ApiField("dynamic_img_url")
private String dynamicImgUrl;
/**
* 编码失效时间(yyyy-MM-dd hh:mm:ss)
*/
@ApiField("expire_date")
private String expireDate;
/**
* 如果是true,则扫一扫下发跳转地址直接取自BizLinkedId
否则,从路由信息里取跳转地址
*/
@ApiField("is_direct")
private String isDirect;
/**
* 备注信息字段
*/
@ApiField("memo")
private String memo;
/**
* 业务用到的码值
*/
@ApiField("qr_code")
private String qrCode;
/**
* 原始码值
*/
@ApiField("qr_token")
private String qrToken;
/**
* 发码来源,业务自定义
*/
@ApiField("source_id")
private String sourceId;
/**
* 编码启动时间(yyy-MM-dd hh:mm:ss),为空表示立即启用
*/
@ApiField("start_date")
private Date startDate;
/**
* 发码请求中带的支付宝用户id
*/
@ApiField("user_id")
private String userId;
public void setBizLinkedId(String bizLinkedId) {
this.bizLinkedId = bizLinkedId;
}
public String getBizLinkedId( ) {
return this.bizLinkedId;
}
public void setBizType(String bizType) {
this.bizType = bizType;
}
public String getBizType( ) {
return this.bizType;
}
public void setCodeStatus(String codeStatus) {
this.codeStatus = codeStatus;
}
public String getCodeStatus( ) {
return this.codeStatus;
}
public void setContextStr(String contextStr) {
this.contextStr = contextStr;
}
public String getContextStr( ) {
return this.contextStr;
}
public void setDynamicImgUrl(String dynamicImgUrl) {
this.dynamicImgUrl = dynamicImgUrl;
}
public String getDynamicImgUrl( ) {
return this.dynamicImgUrl;
}
public void setExpireDate(String expireDate) {
this.expireDate = expireDate;
}
public String getExpireDate( ) {
return this.expireDate;
}
public void setIsDirect(String isDirect) {
this.isDirect = isDirect;
}
public String getIsDirect( ) {
return this.isDirect;
}
public void setMemo(String memo) {
this.memo = memo;
}
public String getMemo( ) {
return this.memo;
}
public void setQrCode(String qrCode) {
this.qrCode = qrCode;
}
public String getQrCode( ) {
return this.qrCode;
}
public void setQrToken(String qrToken) {
this.qrToken = qrToken;
}
public String getQrToken( ) {
return this.qrToken;
}
public void setSourceId(String sourceId) {
this.sourceId = sourceId;
}
public String getSourceId( ) {
return this.sourceId;
}
public void setStartDate(Date startDate) {
this.startDate = startDate;
}
public Date getStartDate( ) {
return this.startDate;
}
public void setUserId(String userId) {
this.userId = userId;
}
public String getUserId( ) {
return this.userId;
}
}
|
[
"ben.zy@antfin.com"
] |
ben.zy@antfin.com
|
eaed06e13f895076fc705e7278f417ef541ba79e
|
c885ef92397be9d54b87741f01557f61d3f794f3
|
/tests-without-trycatch/Compress-44/org.apache.commons.compress.utils.ChecksumCalculatingInputStream/BBC-F0-opt-70/6/org/apache/commons/compress/utils/ChecksumCalculatingInputStream_ESTest_scaffolding.java
|
11df6202444f2282ccd41ea39605c8170288182f
|
[
"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
| 4,208
|
java
|
/**
* Scaffolding file used to store all the setups needed to run
* tests automatically generated by EvoSuite
* Wed Oct 13 21:39:30 GMT 2021
*/
package org.apache.commons.compress.utils;
import org.evosuite.runtime.annotation.EvoSuiteClassExclude;
import org.junit.BeforeClass;
import org.junit.Before;
import org.junit.After;
import org.junit.AfterClass;
import org.evosuite.runtime.sandbox.Sandbox;
import org.evosuite.runtime.sandbox.Sandbox.SandboxMode;
import static org.evosuite.shaded.org.mockito.Mockito.*;
@EvoSuiteClassExclude
public class ChecksumCalculatingInputStream_ESTest_scaffolding {
@org.junit.Rule
public org.evosuite.runtime.vnet.NonFunctionalRequirementRule nfr = new org.evosuite.runtime.vnet.NonFunctionalRequirementRule();
private static final java.util.Properties defaultProperties = (java.util.Properties) java.lang.System.getProperties().clone();
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.compress.utils.ChecksumCalculatingInputStream";
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();
try { initMocksToAvoidTimeoutsInTheTests(); } catch(ClassNotFoundException e) {}
}
@AfterClass
public static void clearEvoSuiteFramework(){
Sandbox.resetDefaultSecurityManager();
java.lang.System.setProperties((java.util.Properties) defaultProperties.clone());
}
@Before
public void initTestCase(){
threadStopper.storeCurrentThreads();
threadStopper.startRecordingTime();
org.evosuite.runtime.jvm.ShutdownHookHandler.getInstance().initHandler();
org.evosuite.runtime.sandbox.Sandbox.goingToExecuteSUTCode();
setSystemProperties();
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() {
java.lang.System.setProperties((java.util.Properties) defaultProperties.clone());
java.lang.System.setProperty("user.dir", "/experiment");
}
private static void initializeClasses() {
org.evosuite.runtime.classhandling.ClassStateSupport.initializeClasses(ChecksumCalculatingInputStream_ESTest_scaffolding.class.getClassLoader() ,
"org.apache.commons.compress.utils.ChecksumCalculatingInputStream"
);
}
private static void initMocksToAvoidTimeoutsInTheTests() throws ClassNotFoundException {
mock(Class.forName("java.util.Enumeration", false, ChecksumCalculatingInputStream_ESTest_scaffolding.class.getClassLoader()));
}
private static void resetClasses() {
org.evosuite.runtime.classhandling.ClassResetter.getInstance().setClassLoader(ChecksumCalculatingInputStream_ESTest_scaffolding.class.getClassLoader());
org.evosuite.runtime.classhandling.ClassStateSupport.resetClasses(
"org.apache.commons.compress.utils.ChecksumCalculatingInputStream"
);
}
}
|
[
"pouria.derakhshanfar@gmail.com"
] |
pouria.derakhshanfar@gmail.com
|
ffaa15b9bc6d449699c31424e3273e46766255d8
|
bace31aab2aa164a0249c271f7cf7ba9a1503d04
|
/app/src/main/java/com/tiendas3b/almacen/db/dao/ReceiptExpressLogDao.java
|
f621ea098b56e303b1f601c253346c7a4b35f87e
|
[] |
no_license
|
opelayoa/Project
|
a8fab2a6f759f076fd52989e8917f2c02915096b
|
43788f12e3c7ea39a8bab8e35e85b74ff6c9f9fa
|
refs/heads/master
| 2020-04-10T07:33:17.768276
| 2019-01-04T22:02:31
| 2019-01-04T22:02:31
| 160,883,293
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 6,755
|
java
|
package com.tiendas3b.almacen.db.dao;
import android.database.Cursor;
import android.database.sqlite.SQLiteDatabase;
import android.database.sqlite.SQLiteStatement;
import de.greenrobot.dao.AbstractDao;
import de.greenrobot.dao.Property;
import de.greenrobot.dao.internal.DaoConfig;
import com.tiendas3b.almacen.db.dao.ReceiptExpressLog;
// THIS CODE IS GENERATED BY greenDAO, DO NOT EDIT.
/**
* DAO for table "RECEIPT_EXPRESS_LOG".
*/
public class ReceiptExpressLogDao extends AbstractDao<ReceiptExpressLog, Void> {
public static final String TABLENAME = "RECEIPT_EXPRESS_LOG";
/**
* Properties of entity ReceiptExpressLog.<br/>
* Can be used for QueryBuilder and for referencing column names.
*/
public static class Properties {
public final static Property IdAlmacen = new Property(0, String.class, "idAlmacen", false, "ID_ALMACEN");
public final static Property IdProveedor = new Property(1, Long.class, "idProveedor", false, "ID_PROVEEDOR");
public final static Property Odc = new Property(2, Integer.class, "odc", false, "ODC");
public final static Property Date = new Property(3, String.class, "date", false, "DATE");
public final static Property Time = new Property(4, String.class, "time", false, "TIME");
public final static Property IdOrden = new Property(5, Integer.class, "idOrden", false, "ID_ORDEN");
public final static Property IdProcess = new Property(6, Integer.class, "idProcess", false, "ID_PROCESS");
public final static Property Description = new Property(7, String.class, "description", false, "DESCRIPTION");
public final static Property User = new Property(8, String.class, "user", false, "USER");
};
public ReceiptExpressLogDao(DaoConfig config) {
super(config);
}
public ReceiptExpressLogDao(DaoConfig config, DaoSession daoSession) {
super(config, daoSession);
}
/** Creates the underlying database table. */
public static void createTable(SQLiteDatabase db, boolean ifNotExists) {
String constraint = ifNotExists? "IF NOT EXISTS ": "";
db.execSQL("CREATE TABLE " + constraint + "\"RECEIPT_EXPRESS_LOG\" (" + //
"\"ID_ALMACEN\" TEXT," + // 0: idAlmacen
"\"ID_PROVEEDOR\" INTEGER," + // 1: idProveedor
"\"ODC\" INTEGER," + // 2: odc
"\"DATE\" TEXT," + // 3: date
"\"TIME\" TEXT," + // 4: time
"\"ID_ORDEN\" INTEGER," + // 5: idOrden
"\"ID_PROCESS\" INTEGER," + // 6: idProcess
"\"DESCRIPTION\" TEXT," + // 7: description
"\"USER\" TEXT);"); // 8: user
}
/** Drops the underlying database table. */
public static void dropTable(SQLiteDatabase db, boolean ifExists) {
String sql = "DROP TABLE " + (ifExists ? "IF EXISTS " : "") + "\"RECEIPT_EXPRESS_LOG\"";
db.execSQL(sql);
}
/** @inheritdoc */
@Override
protected void bindValues(SQLiteStatement stmt, ReceiptExpressLog entity) {
stmt.clearBindings();
String idAlmacen = entity.getIdAlmacen();
if (idAlmacen != null) {
stmt.bindString(1, idAlmacen);
}
Long idProveedor = entity.getIdProveedor();
if (idProveedor != null) {
stmt.bindLong(2, idProveedor);
}
Integer odc = entity.getOdc();
if (odc != null) {
stmt.bindLong(3, odc);
}
String date = entity.getDate();
if (date != null) {
stmt.bindString(4, date);
}
String time = entity.getTime();
if (time != null) {
stmt.bindString(5, time);
}
Integer idOrden = entity.getIdOrden();
if (idOrden != null) {
stmt.bindLong(6, idOrden);
}
Integer idProcess = entity.getIdProcess();
if (idProcess != null) {
stmt.bindLong(7, idProcess);
}
String description = entity.getDescription();
if (description != null) {
stmt.bindString(8, description);
}
String user = entity.getUser();
if (user != null) {
stmt.bindString(9, user);
}
}
/** @inheritdoc */
@Override
public Void readKey(Cursor cursor, int offset) {
return null;
}
/** @inheritdoc */
@Override
public ReceiptExpressLog readEntity(Cursor cursor, int offset) {
ReceiptExpressLog entity = new ReceiptExpressLog( //
cursor.isNull(offset + 0) ? null : cursor.getString(offset + 0), // idAlmacen
cursor.isNull(offset + 1) ? null : cursor.getLong(offset + 1), // idProveedor
cursor.isNull(offset + 2) ? null : cursor.getInt(offset + 2), // odc
cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3), // date
cursor.isNull(offset + 4) ? null : cursor.getString(offset + 4), // time
cursor.isNull(offset + 5) ? null : cursor.getInt(offset + 5), // idOrden
cursor.isNull(offset + 6) ? null : cursor.getInt(offset + 6), // idProcess
cursor.isNull(offset + 7) ? null : cursor.getString(offset + 7), // description
cursor.isNull(offset + 8) ? null : cursor.getString(offset + 8) // user
);
return entity;
}
/** @inheritdoc */
@Override
public void readEntity(Cursor cursor, ReceiptExpressLog entity, int offset) {
entity.setIdAlmacen(cursor.isNull(offset + 0) ? null : cursor.getString(offset + 0));
entity.setIdProveedor(cursor.isNull(offset + 1) ? null : cursor.getLong(offset + 1));
entity.setOdc(cursor.isNull(offset + 2) ? null : cursor.getInt(offset + 2));
entity.setDate(cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3));
entity.setTime(cursor.isNull(offset + 4) ? null : cursor.getString(offset + 4));
entity.setIdOrden(cursor.isNull(offset + 5) ? null : cursor.getInt(offset + 5));
entity.setIdProcess(cursor.isNull(offset + 6) ? null : cursor.getInt(offset + 6));
entity.setDescription(cursor.isNull(offset + 7) ? null : cursor.getString(offset + 7));
entity.setUser(cursor.isNull(offset + 8) ? null : cursor.getString(offset + 8));
}
/** @inheritdoc */
@Override
protected Void updateKeyAfterInsert(ReceiptExpressLog entity, long rowId) {
// Unsupported or missing PK type
return null;
}
/** @inheritdoc */
@Override
public Void getKey(ReceiptExpressLog entity) {
return null;
}
/** @inheritdoc */
@Override
protected boolean isEntityUpdateable() {
return true;
}
}
|
[
"od.pelayo@gmail.com"
] |
od.pelayo@gmail.com
|
6c8b524c9d98db0ff4ce3cd9454816acdcac80e4
|
129f58086770fc74c171e9c1edfd63b4257210f3
|
/src/testcases/CWE113_HTTP_Response_Splitting/CWE113_HTTP_Response_Splitting__Property_addCookieServlet_74a.java
|
d6e426a4e7b1a754cd62e1df5bbbbbb9f4c15120
|
[] |
no_license
|
glopezGitHub/Android23
|
1bd0b6a6c7ce3c7439a74f1e4dcef2c4c0fac4ba
|
6215d0684c4fbdc7217ccfbedfccfca69824cc5e
|
refs/heads/master
| 2023-03-07T15:14:59.447795
| 2023-02-06T13:59:49
| 2023-02-06T13:59:49
| 6,856,387
| 0
| 3
| null | 2023-02-06T18:38:17
| 2012-11-25T22:04:23
|
Java
|
UTF-8
|
Java
| false
| false
| 3,317
|
java
|
/* TEMPLATE GENERATED TESTCASE FILE
Filename: CWE113_HTTP_Response_Splitting__Property_addCookieServlet_74a.java
Label Definition File: CWE113_HTTP_Response_Splitting.label.xml
Template File: sources-sinks-74a.tmpl.java
*/
/*
* @description
* CWE: 113 HTTP Response Splitting
* BadSource: Property Read data from a system property
* GoodSource: A hardcoded string
* Sinks: addCookieServlet
* GoodSink: URLEncode input
* BadSink : querystring to addCookie()
* Flow Variant: 74 Data flow: data passed in a HashMap from one method to another in different source files in the same package
*
* */
package testcases.CWE113_HTTP_Response_Splitting;
import testcasesupport.*;
import java.util.HashMap;
import javax.servlet.http.*;
public class CWE113_HTTP_Response_Splitting__Property_addCookieServlet_74a extends AbstractTestCaseServlet
{
public void bad(HttpServletRequest request, HttpServletResponse response) throws Throwable
{
String data;
/* get system property user.home */
/* POTENTIAL FLAW: Read data from a system property */
data = System.getProperty("user.home");
HashMap<Integer,String> data_hashmap = new HashMap<Integer,String>();
data_hashmap.put(0, data);
data_hashmap.put(1, data);
data_hashmap.put(2, data);
(new CWE113_HTTP_Response_Splitting__Property_addCookieServlet_74b()).bad_sink(data_hashmap , request, response );
}
public void good(HttpServletRequest request, HttpServletResponse response) throws Throwable
{
goodG2B(request, response);
goodB2G(request, response);
}
/* goodG2B() - use GoodSource and BadSink */
private void goodG2B(HttpServletRequest request, HttpServletResponse response) throws Throwable
{
String data;
/* FIX: Use a hardcoded string */
data = "foo";
HashMap<Integer,String> data_hashmap = new HashMap<Integer,String>();
data_hashmap.put(0, data);
data_hashmap.put(1, data);
data_hashmap.put(2, data);
(new CWE113_HTTP_Response_Splitting__Property_addCookieServlet_74b()).goodG2B_sink(data_hashmap , request, response );
}
/* goodB2G() - use BadSource and GoodSink */
private void goodB2G(HttpServletRequest request, HttpServletResponse response) throws Throwable
{
String data;
/* get system property user.home */
/* POTENTIAL FLAW: Read data from a system property */
data = System.getProperty("user.home");
HashMap<Integer,String> data_hashmap = new HashMap<Integer,String>();
data_hashmap.put(0, data);
data_hashmap.put(1, data);
data_hashmap.put(2, data);
(new CWE113_HTTP_Response_Splitting__Property_addCookieServlet_74b()).goodB2G_sink(data_hashmap , request, response );
}
/* Below is the main(). It is only used when building this testcase on
its own for testing or for building a binary to use in testing binary
analysis tools. It is not used when compiling all the testcases as one
application, which is how source code analysis tools are tested. */
public static void main(String[] args) throws ClassNotFoundException,
InstantiationException, IllegalAccessException
{
mainFromParent(args);
}
}
|
[
"guillermo.pando@gmail.com"
] |
guillermo.pando@gmail.com
|
9930d5b11c2b09e7f9bb16997ec1ee05f6b81dcf
|
ea8dddf3fe1ff80df149b200536c4db921569e38
|
/src/com/mss/shtoone/persistence/TopRealEnvironmentViewDAO.java
|
20b54383e0accb43d70a47f50a607f0cb7797827
|
[] |
no_license
|
Time-Boat/SW-LQAppInterface
|
98cded50d91866c85cea76df67a2e618b0eb0691
|
ff884caba2b9bc495e0d16ca1b5b2acf37acc783
|
refs/heads/master
| 2020-05-24T00:45:11.369987
| 2017-04-06T10:30:52
| 2017-04-06T10:30:52
| 84,807,264
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 257
|
java
|
package com.mss.shtoone.persistence;
import org.springframework.stereotype.Repository;
import com.mss.shtoone.domain.TopRealEnvironmentView;
@Repository
public interface TopRealEnvironmentViewDAO extends GenericDAO<TopRealEnvironmentView, Integer> {
}
|
[
"770164810@qq.com"
] |
770164810@qq.com
|
eb03c024ffe6b3b01da0621c70ea1bdaa07dd2ba
|
20eb62855cb3962c2d36fda4377dfd47d82eb777
|
/newEvaluatedBugs/Jsoup_24_buggy/mutated/659/Attributes.java
|
e8feeb936b9593cb5fbc81aab4c1175d4652f9fe
|
[] |
no_license
|
ozzydong/CapGen
|
356746618848065cce4e253e5d3c381baa85044a
|
0ba0321b6b1191443276021f1997833342f02515
|
refs/heads/master
| 2023-03-18T20:12:02.923428
| 2020-08-21T03:08:28
| 2020-08-21T03:08:28
| null | 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 8,085
|
java
|
package org.jsoup.nodes;
import org.jsoup.helper.Validate;
import java.util.*;
/**
* The attributes of an Element.
* <p>
* Attributes are treated as a map: there can be only one value associated with an attribute key.
* </p>
* <p>
* Attribute key and value comparisons are done case insensitively, and keys are normalised to
* lower-case.
* </p>
*
* @author Jonathan Hedley, jonathan@hedley.net
*/
public class Attributes implements Iterable<Attribute>, Cloneable {
protected static final String dataPrefix = "data-";
private LinkedHashMap<String, Attribute> attributes = null;
// linked hash map to preserve insertion order.
// null be default as so many elements have no attributes -- saves a good chunk of memory
/**
Get an attribute value by key.
@param key the attribute key
@return the attribute value if set; or empty string if not set.
@see #hasKey(String)
*/
public String get(String key) {
Validate.notEmpty(key);
if (attributes == null)
return "";
Attribute attr = attributes.get(key.toLowerCase());
return attr != null ? attr.getValue() : "";
}
/**
Set a new attribute, or replace an existing one by key.
@param key attribute key
@param value attribute value
*/
public void put(String key, String value) {
Attribute attr = new Attribute(key, value);
put(attr);
}
/**
Set a new attribute, or replace an existing one by key.
@param attribute attribute
*/
public void put(Attribute attribute) {
Validate.notNull(attribute);
if ((attributes) == null) return "";
if (attributes == null)
attributes = new LinkedHashMap<String, Attribute>(2);
attributes.put(attribute.getKey(), attribute);
}
/**
Remove an attribute by key.
@param key attribute key to remove
*/
public void remove(String key) {
Validate.notEmpty(key);
if (attributes == null)
return;
attributes.remove(key.toLowerCase());
}
/**
Tests if these attributes contain an attribute with this key.
@param key key to check for
@return true if key exists, false otherwise
*/
public boolean hasKey(String key) {
return attributes != null && attributes.containsKey(key.toLowerCase());
}
/**
Get the number of attributes in this set.
@return size
*/
public int size() {
if (attributes == null)
return 0;
return attributes.size();
}
/**
Add all the attributes from the incoming set to this set.
@param incoming attributes to add to these attributes.
*/
public void addAll(Attributes incoming) {
if (incoming.size() == 0)
return;
if (attributes == null)
attributes = new LinkedHashMap<String, Attribute>(incoming.size());
attributes.putAll(incoming.attributes);
}
public Iterator<Attribute> iterator() {
return asList().iterator();
}
/**
Get the attributes as a List, for iteration. Do not modify the keys of the attributes via this view, as changes
to keys will not be recognised in the containing set.
@return an view of the attributes as a List.
*/
public List<Attribute> asList() {
if (attributes == null)
return Collections.emptyList();
List<Attribute> list = new ArrayList<Attribute>(attributes.size());
for (Map.Entry<String, Attribute> entry : attributes.entrySet()) {
list.add(entry.getValue());
}
return Collections.unmodifiableList(list);
}
/**
* Retrieves a filtered view of attributes that are HTML5 custom data attributes; that is, attributes with keys
* starting with {@code data-}.
* @return map of custom data attributes.
*/
public Map<String, String> dataset() {
return new Dataset();
}
/**
Get the HTML representation of these attributes.
@return HTML
*/
public String html() {
StringBuilder accum = new StringBuilder();
html(accum, (new Document("")).outputSettings()); // output settings a bit funky, but this html() seldom used
return accum.toString();
}
void html(StringBuilder accum, Document.OutputSettings out) {
if (attributes == null)
return;
for (Map.Entry<String, Attribute> entry : attributes.entrySet()) {
Attribute attribute = entry.getValue();
accum.append(" ");
attribute.html(accum, out);
}
}
@Override
public String toString() {
return html();
}
/**
* Checks if these attributes are equal to another set of attributes, by comparing the two sets
* @param o attributes to compare with
* @return if both sets of attributes have the same content
*/
@Override
public boolean equals(Object o) {
if (this == o) return true;
if (!(o instanceof Attributes)) return false;
Attributes that = (Attributes) o;
return !(attributes != null ? !attributes.equals(that.attributes) : that.attributes != null);
}
/**
* Calculates the hashcode of these attributes, by iterating all attributes and summing their hashcodes.
* @return calculated hashcode
*/
@Override
public int hashCode() {
return attributes != null ? attributes.hashCode() : 0;
}
@Override
public Attributes clone() {
if (attributes == null)
return new Attributes();
Attributes clone;
try {
clone = (Attributes) super.clone();
} catch (CloneNotSupportedException e) {
throw new RuntimeException(e);
}
clone.attributes = new LinkedHashMap<String, Attribute>(attributes.size());
for (Attribute attribute: this)
clone.attributes.put(attribute.getKey(), attribute.clone());
return clone;
}
private class Dataset extends AbstractMap<String, String> {
private Dataset() {
if (attributes == null)
attributes = new LinkedHashMap<String, Attribute>(2);
}
@Override
public Set<Entry<String, String>> entrySet() {
return new EntrySet();
}
@Override
public String put(String key, String value) {
String dataKey = dataKey(key);
String oldValue = hasKey(dataKey) ? attributes.get(dataKey).getValue() : null;
Attribute attr = new Attribute(dataKey, value);
attributes.put(dataKey, attr);
return oldValue;
}
private class EntrySet extends AbstractSet<Map.Entry<String, String>> {
@Override
public Iterator<Map.Entry<String, String>> iterator() {
return new DatasetIterator();
}
@Override
public int size() {
int count = 0;
Iterator iter = new DatasetIterator();
while (iter.hasNext())
count++;
return count;
}
}
private class DatasetIterator implements Iterator<Map.Entry<String, String>> {
private Iterator<Attribute> attrIter = attributes.values().iterator();
private Attribute attr;
public boolean hasNext() {
while (attrIter.hasNext()) {
attr = attrIter.next();
if (attr.isDataAttribute()) return true;
}
return false;
}
public Entry<String, String> next() {
return new Attribute(attr.getKey().substring(dataPrefix.length()), attr.getValue());
}
public void remove() {
attributes.remove(attr.getKey());
}
}
}
private static String dataKey(String key) {
return dataPrefix + key;
}
}
|
[
"justinwm@163.com"
] |
justinwm@163.com
|
aa974a955f0ac19f3570c9e8cd7c747e87b4549e
|
57653c870d15158b2d9c30dfd48d490258b75c1c
|
/mango-client-base/src/io/pelle/mango/client/base/modules/dictionary/model/controls/HierarchicalControlModel.java
|
31282785bc373f7accd35fbf814be915c7353cae
|
[] |
no_license
|
pellepelster/mango
|
edf3938a80edf336e17f4079db3bf7aa638a74ce
|
ecd09e877eb59630feb449fb260574eb8705bc3b
|
refs/heads/master
| 2016-09-15T19:43:24.564927
| 2015-12-18T17:04:39
| 2015-12-18T17:04:39
| 20,863,367
| 5
| 2
| null | 2015-07-13T20:38:13
| 2014-06-15T19:26:57
|
Java
|
UTF-8
|
Java
| false
| false
| 935
|
java
|
package io.pelle.mango.client.base.modules.dictionary.model.controls;
import io.pelle.mango.client.base.db.vos.IHierarchicalVO;
import io.pelle.mango.client.base.modules.dictionary.controls.IHierarchicalControl;
import io.pelle.mango.client.base.modules.dictionary.model.IBaseModel;
public class HierarchicalControlModel extends BaseControlModel<IHierarchicalControl> implements IHierarchicalControlModel
{
private static final long serialVersionUID = -947831635255212542L;
private String hierarchicalId;
public HierarchicalControlModel(String name, IBaseModel parent)
{
super(name, parent);
}
@Override
public String getHierarchicalId()
{
return this.hierarchicalId;
}
public void setHierarchicalId(String hierarchicalId)
{
this.hierarchicalId = hierarchicalId;
}
@Override
public String getAttributePath() {
return IHierarchicalVO.FIELD_PARENT.getAttributeName();
}
}
|
[
"pelle@pelle.io"
] |
pelle@pelle.io
|
a6461434c5998cfbb6b23f223811ba22273015e0
|
d6fcbf4c5fd3adac8702f5e57530329e7144efd7
|
/corejava/ch3/labs/Lab489.java
|
efa66c3c4b8d93c464197b72773a809b651fe731
|
[] |
no_license
|
prabhatsingh2408/jlc
|
6d46c5556a999c9a83aec869a6381bf723ee867a
|
213bf35bb25cff69bc03bb4f488723678ccfd784
|
refs/heads/master
| 2021-01-20T18:58:06.596400
| 2016-07-04T09:04:13
| 2016-07-04T09:04:13
| 62,547,129
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 149
|
java
|
class Lab489{
public static void main(String[] args){
A oa=new A();
oa.show();
}
}
class A{
private int x;
void show(){
System.out.println(x);
}
}
|
[
"prabhatsingh2408@gmail.com"
] |
prabhatsingh2408@gmail.com
|
a2a69d68d39fb6c8c4ca6695a3d3219e7f468958
|
fa35677bbd17951536702ac9eed3c12b4722a2dc
|
/dynatrace/src/main/java/de/tsystems/mms/apm/performancesignature/dynatracesaas/rest/env2/model/MetricDefaultAggregation.java
|
4496300f51726e54af44aaa031e91ddfd6c3ee70
|
[
"Apache-2.0"
] |
permissive
|
andreaslind01/performance-signature-dynatrace-plugin
|
936de479f52ef91e9d28ca1445f0cc2ac58aab0c
|
76f70ae9973533aefc10b6ec9198142034de6831
|
refs/heads/master
| 2023-08-07T15:03:29.198416
| 2023-06-28T11:19:11
| 2023-06-28T11:19:11
| 157,521,029
| 0
| 0
|
Apache-2.0
| 2023-03-08T10:05:21
| 2018-11-14T09:06:51
|
Java
|
UTF-8
|
Java
| false
| false
| 5,201
|
java
|
/*
* Dynatrace Environment API
* Documentation of the Dynatrace Environment API v2. Resources here generally supersede those in v1. Migration of resources from v1 is in progress. If you miss a resource, consider using the Dynatrace Environment API v1. To read about use cases and examples, see [Dynatrace Documentation](https://dt-url.net/2u23k1k) . Notes about compatibility: * Operations marked as early adopter or preview may be changed in non-compatible ways, although we try to avoid this. * We may add new enum constants without incrementing the API version; thus, clients need to handle unknown enum constants gracefully.
*
* The version of the OpenAPI document: 2.0
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
package de.tsystems.mms.apm.performancesignature.dynatracesaas.rest.env2.model;
import com.google.gson.TypeAdapter;
import com.google.gson.annotations.JsonAdapter;
import com.google.gson.annotations.SerializedName;
import com.google.gson.stream.JsonReader;
import com.google.gson.stream.JsonWriter;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import java.io.IOException;
import java.util.Objects;
/**
* The default aggregation of a metric.
*/
@ApiModel(description = "The default aggregation of a metric.")
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen")
public class MetricDefaultAggregation {
public static final String SERIALIZED_NAME_PARAMETER = "parameter";
public static final String SERIALIZED_NAME_TYPE = "type";
@SerializedName(SERIALIZED_NAME_TYPE)
private TypeEnum type;
@SerializedName(SERIALIZED_NAME_PARAMETER)
private Double parameter;
public MetricDefaultAggregation type(TypeEnum type) {
this.type = type;
return this;
}
/**
* The type of default aggregation.
*
* @return type
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "The type of default aggregation.")
public TypeEnum getType() {
return type;
}
public void setType(TypeEnum type) {
this.type = type;
}
public MetricDefaultAggregation parameter(Double parameter) {
this.parameter = parameter;
return this;
}
/**
* The percentile to be delivered. Valid values are between `0` and `100`. Applicable only to the `percentile` aggregation type.
*
* @return parameter
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "The percentile to be delivered. Valid values are between `0` and `100`. Applicable only to the `percentile` aggregation type.")
public Double getParameter() {
return parameter;
}
public void setParameter(Double parameter) {
this.parameter = parameter;
}
@Override
public boolean equals(Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
MetricDefaultAggregation metricDefaultAggregation = (MetricDefaultAggregation) o;
return Objects.equals(this.type, metricDefaultAggregation.type) &&
Objects.equals(this.parameter, metricDefaultAggregation.parameter);
}
@Override
public int hashCode() {
return Objects.hash(type, parameter);
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("class MetricDefaultAggregation {\n");
sb.append(" type: ").append(toIndentedString(type)).append("\n");
sb.append(" parameter: ").append(toIndentedString(parameter)).append("\n");
sb.append("}");
return sb.toString();
}
/**
* Convert the given object to string with each line indented by 4 spaces
* (except the first line).
*/
private String toIndentedString(Object o) {
if (o == null) {
return "null";
}
return o.toString().replace("\n", "\n ");
}
/**
* The type of default aggregation.
*/
@JsonAdapter(TypeEnum.Adapter.class)
public enum TypeEnum {
AUTO("auto"),
AVG("avg"),
COUNT("count"),
MAX("max"),
MEDIAN("median"),
MIN("min"),
PERCENTILE("percentile"),
SUM("sum"),
VALUE("value");
private String value;
TypeEnum(String value) {
this.value = value;
}
public static TypeEnum fromValue(String value) {
for (TypeEnum b : TypeEnum.values()) {
if (b.value.equals(value)) {
return b;
}
}
throw new IllegalArgumentException("Unexpected value '" + value + "'");
}
public String getValue() {
return value;
}
@Override
public String toString() {
return String.valueOf(value);
}
public static class Adapter extends TypeAdapter<TypeEnum> {
@Override
public void write(final JsonWriter jsonWriter, final TypeEnum enumeration) throws IOException {
jsonWriter.value(enumeration.getValue());
}
@Override
public TypeEnum read(final JsonReader jsonReader) throws IOException {
String value = jsonReader.nextString();
return TypeEnum.fromValue(value);
}
}
}
}
|
[
"Raphael.Pionke@t-systems.com"
] |
Raphael.Pionke@t-systems.com
|
3427f7a04c08abe186777a61cc62658eab2b972c
|
f6366238ce2e51836c03851bcad2182ec60211ce
|
/extensions/wisdom-monitor/src/main/java/org/wisdom/monitor/extensions/logger/LoggerModel.java
|
92c109b625fb5e170100f4bd5519bc2de27399b9
|
[
"Apache-2.0"
] |
permissive
|
sauthieg/wisdom
|
24e9ffb83eca8e0b31a3bf5c2eda04cefcc53c21
|
53349e05618441c9ea96ed75dc73ea6166796868
|
refs/heads/master
| 2021-01-18T09:12:00.051604
| 2014-07-24T07:40:13
| 2014-07-24T07:44:24
| null | 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 1,485
|
java
|
/*
* #%L
* Wisdom-Framework
* %%
* Copyright (C) 2013 - 2014 Wisdom Framework
* %%
* 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.
* #L%
*/
package org.wisdom.monitor.extensions.logger;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
/**
* Represents a logger.
*/
public class LoggerModel {
private String name;
private String level;
public LoggerModel(Logger logger) {
this.name = logger.getName();
if (logger instanceof ch.qos.logback.classic.Logger) {
this.level = ((ch.qos.logback.classic.Logger) logger).getEffectiveLevel().toString();
} else {
level = "unknown";
}
}
public String getName() {
return name;
}
public String getLevel() {
return level;
}
@Override
public String toString() {
return "Logger{" +
"name='" + name + '\'' +
", level='" + level + '\'' +
'}';
}
}
|
[
"clement.escoffier@gmail.com"
] |
clement.escoffier@gmail.com
|
27d091eef7ff562a0fce1298c6236759aebb09a5
|
656ce78b903ef3426f8f1ecdaee57217f9fbc40e
|
/src/com/localytics/android/MigrationDatabaseHelper$UploadBlobEventsDbColumns.java
|
dc91e7d400f959f6234c19f9bcab24d29cff7155
|
[] |
no_license
|
zhuharev/periscope-android-source
|
51bce2c1b0b356718be207789c0b84acf1e7e201
|
637ab941ed6352845900b9d465b8e302146b3f8f
|
refs/heads/master
| 2021-01-10T01:47:19.177515
| 2015-12-25T16:51:27
| 2015-12-25T16:51:27
| 48,586,306
| 8
| 10
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 694
|
java
|
// Decompiled by Jad v1.5.8e. Copyright 2001 Pavel Kouznetsov.
// Jad home page: http://www.geocities.com/kpdus/jad.html
// Decompiler options: braces fieldsfirst space lnc
package com.localytics.android;
import android.provider.BaseColumns;
// Referenced classes of package com.localytics.android:
// MigrationDatabaseHelper
static final class
implements BaseColumns
{
static final String EVENTS_KEY_REF = "events_key_ref";
static final String TABLE_NAME = "upload_blob_events";
static final String UPLOAD_BLOBS_KEY_REF = "upload_blobs_key_ref";
private ()
{
throw new UnsupportedOperationException("This class is non-instantiable");
}
}
|
[
"hostmaster@zhuharev.ru"
] |
hostmaster@zhuharev.ru
|
93afb0c19a04e3c821a656d60cac49c766d3506c
|
ec7de98baac05bb32e759d28039703675b3a58ee
|
/samples/dddsample/ops4j/qi4j/libraries/swing/binding/src/main/java/org/qi4j/lib/swing/binding/adapters/StringToTextFieldAdapterService.java
|
d82597fa33f9e4e972d5b8062cbd067e08a7da1d
|
[
"Apache-2.0"
] |
permissive
|
ehartmann/qi4j-sdk
|
b1e9ae973e01435b80373b356f6dd4067866e2ee
|
de8e46c99db814ddc5552529b7c3dcbf4ea28d3a
|
refs/heads/master
| 2021-01-21T00:52:21.954982
| 2011-08-05T08:18:01
| 2011-08-05T08:18:01
| null | 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 4,203
|
java
|
/*
* Copyright 2008 Niclas Hedhman. 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 org.qi4j.lib.swing.binding.adapters;
import org.qi4j.lib.swing.binding.SwingAdapter;
import javax.swing.JComponent;
import javax.swing.JLabel;
import javax.swing.JTextArea;
import javax.swing.JTextField;
import javax.swing.text.JTextComponent;
import org.qi4j.composite.Concerns;
import org.qi4j.composite.Mixins;
import org.qi4j.composite.NoopMixin;
import org.qi4j.composite.ConcernOf;
import org.qi4j.property.Property;
import org.qi4j.service.ServiceComposite;
import org.qi4j.entity.association.Association;
import org.qi4j.entity.association.SetAssociation;
import org.qi4j.entity.association.ListAssociation;
import java.util.Set;
import java.util.HashSet;
@Concerns( StringToTextFieldAdapterService.StringToTextFieldAdapterConcern.class )
@Mixins( NoopMixin.class )
public interface StringToTextFieldAdapterService extends SwingAdapter, ServiceComposite
{
class StringToTextFieldAdapterConcern extends ConcernOf<SwingAdapter>
implements SwingAdapter
{
private HashSet<Capabilities> canHandle;
public StringToTextFieldAdapterConcern()
{
canHandle = new HashSet<Capabilities>();
canHandle.add( new Capabilities( JTextArea.class, String.class, true, false, false, false ) );
canHandle.add( new Capabilities( JTextField.class, String.class, true, false, false, false ) );
canHandle.add( new Capabilities( JLabel.class, String.class, true, false, false, false ) );
}
public Set<Capabilities> canHandle()
{
return canHandle;
}
public void fromSwingToProperty( JComponent component, Property property )
{
if( property == null )
{
return;
}
if( component instanceof JTextComponent )
{
JTextComponent textComponent = (JTextComponent) component;
property.set( textComponent.getText() );
}
else
{
JLabel labelComponent = (JLabel) component;
property.set( labelComponent.getText() );
}
}
public void fromPropertyToSwing( JComponent component, Property<?> property )
{
String value;
if( property == null )
{
value = "";
}
else
{
value = (String) property.get();
}
if( component instanceof JTextComponent )
{
JTextComponent textComponent = (JTextComponent) component;
textComponent.setText( value );
}
else
{
JLabel labelComponent = (JLabel) component;
labelComponent.setText( value );
}
}
public void fromSwingToAssociation( JComponent component, Association<?> association )
{
}
public void fromAssociationToSwing( JComponent component, Association<?> association )
{
}
public void fromSwingToSetAssociation( JComponent component, SetAssociation<?> setAssociation )
{
}
public void fromSetAssociationToSwing( JComponent component, SetAssociation<?> setAssociation )
{
}
public void fromSwingToListAssociation( JComponent component, ListAssociation<?> listAssociation )
{
}
public void fromListAssociationToSwing( JComponent component, ListAssociation<?> listAssociation )
{
}
}
}
|
[
"niclas@hedhman.org"
] |
niclas@hedhman.org
|
e032dfc70f1ea918966afceb1f588dd40818d018
|
416ed26975cc93982e9895da5f2f447383bc5d9f
|
/main/boofcv-geo/test/boofcv/alg/geo/h/CommonHomographyInducedPlane.java
|
f46b7313482b3f37a02c49f89464a79b8776f583
|
[
"LicenseRef-scancode-takuya-ooura",
"Apache-2.0"
] |
permissive
|
jmankhan/BoofCV
|
4cb99fbe19afcd35197003fc967c998e9c4875de
|
afbb6b1bf360092b3ee6e3ed5d0d2f9710d0e2da
|
refs/heads/SNAPSHOT
| 2021-01-20T03:29:46.088886
| 2017-05-06T18:13:40
| 2017-05-06T18:13:40
| 89,549,111
| 1
| 0
| null | 2017-04-27T02:54:45
| 2017-04-27T02:54:45
| null |
UTF-8
|
Java
| false
| false
| 2,828
|
java
|
/*
* Copyright (c) 2011-2017, Peter Abeles. All Rights Reserved.
*
* This file is part of BoofCV (http://boofcv.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 boofcv.alg.geo.h;
import boofcv.alg.geo.MultiViewOps;
import boofcv.alg.geo.PerspectiveOps;
import boofcv.struct.geo.AssociatedPair;
import boofcv.struct.geo.PairLineNorm;
import georegression.geometry.GeometryMath_F64;
import georegression.struct.point.Point2D_F64;
import georegression.struct.point.Point3D_F64;
import georegression.struct.se.Se3_F64;
import org.ejml.data.DMatrixRMaj;
import static org.junit.Assert.assertTrue;
/**
* @author Peter Abeles
*/
public class CommonHomographyInducedPlane {
public DMatrixRMaj K = PerspectiveOps.calibrationMatrix(500, 520, 0.1, 400, 450);
public Se3_F64 rightToLeft = new Se3_F64();
public Se3_F64 leftToRight;
public Point3D_F64 X1 = new Point3D_F64(1,0,5);
public Point3D_F64 X2 = new Point3D_F64(1,1,5);
public Point3D_F64 X3 = new Point3D_F64(2,-2,5);
public Point3D_F64 X4 = new Point3D_F64(-1,3,5);
public AssociatedPair p1,p2,p3,p4;
public DMatrixRMaj E,F;
// epipole in second image
public Point3D_F64 e2 = new Point3D_F64();
public CommonHomographyInducedPlane() {
rightToLeft.getT().set(10,0,0);
Se3_F64 leftToRight = rightToLeft.invert(null);
p1 = render(leftToRight,K,X1);
p2 = render(leftToRight,K,X2);
p3 = render(leftToRight,K,X3);
p4 = render(leftToRight,K,X4);
E = MultiViewOps.createEssential(leftToRight.getR(), leftToRight.getT());
F = MultiViewOps.createFundamental(E,K);
MultiViewOps.extractEpipoles(F,new Point3D_F64(),e2);
}
public void checkHomography( DMatrixRMaj H ) {
Point2D_F64 found = new Point2D_F64();
GeometryMath_F64.mult(H,p4.p1,found);
assertTrue(found.isIdentical(p4.p2, 1e-8));
}
public static AssociatedPair render( Se3_F64 leftToRight , DMatrixRMaj K , Point3D_F64 X1 ) {
AssociatedPair ret = new AssociatedPair();
ret.p1 = PerspectiveOps.renderPixel(new Se3_F64(),K,X1);
ret.p2 = PerspectiveOps.renderPixel(leftToRight,K,X1);
return ret;
}
public static PairLineNorm convert( AssociatedPair x1 , AssociatedPair x2 ) {
PairLineNorm ret = new PairLineNorm();
GeometryMath_F64.cross(x1.p1, x2.p1, ret.l1);
GeometryMath_F64.cross(x1.p2,x2.p2,ret.l2);
return ret;
}
}
|
[
"peter.abeles@gmail.com"
] |
peter.abeles@gmail.com
|
fe52d3531a23cc7b8d5387bc81e56cb947ae414e
|
3b91ed788572b6d5ac4db1bee814a74560603578
|
/com/tencent/mm/openim/c/h.java
|
b88cb34c6da000461a35470664cd0837293494ae
|
[] |
no_license
|
linsir6/WeChat_java
|
a1deee3035b555fb35a423f367eb5e3e58a17cb0
|
32e52b88c012051100315af6751111bfb6697a29
|
refs/heads/master
| 2020-05-31T05:40:17.161282
| 2018-08-28T02:07:02
| 2018-08-28T02:07:02
| null | 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 1,165
|
java
|
package com.tencent.mm.openim.c;
import com.tencent.mm.kernel.g;
import com.tencent.mm.openim.a.a;
import com.tencent.mm.plugin.messenger.foundation.a.i;
public final class h implements a {
public final void io(String str) {
((i) g.l(i.class)).FQ().b(new g(str, 1));
}
public final void ip(String str) {
((i) g.l(i.class)).FQ().b(new g(str, 2));
}
public final void iq(String str) {
((i) g.l(i.class)).FQ().b(new f(str, 1));
}
public final void ir(String str) {
((i) g.l(i.class)).FQ().b(new f(str, 2));
}
public final void is(String str) {
((i) g.l(i.class)).FQ().b(new e(str, 1));
}
public final void it(String str) {
((i) g.l(i.class)).FQ().b(new e(str, 2));
}
public final void Q(String str, String str2) {
((i) g.l(i.class)).FQ().b(new d(str, str2));
}
public final void iu(String str) {
((i) g.l(i.class)).FQ().b(new b(str, 1));
}
public final void iv(String str) {
((i) g.l(i.class)).FQ().b(new b(str, 2));
}
public final void oB(String str) {
((i) g.l(i.class)).FQ().b(new a(str));
}
}
|
[
"707194831@qq.com"
] |
707194831@qq.com
|
83987760487fe673de203381a8e920ea4da4f13d
|
2a65f56f322f1c84112d53b89d02dc0820bb946c
|
/test02_demo/src/main/java/com/example/test02_demo/Fragment01.java
|
75c8ab488db6282c5989afad5ebb828c2b6fdf8a
|
[] |
no_license
|
Tianyu1512r/1512
|
28815aeb76f474eb15adb4077da70b105ba69e72
|
a87bacca674dde80f035b1f5d38da3c070a2bb2b
|
refs/heads/master
| 2020-03-09T21:33:11.192260
| 2018-04-11T01:31:03
| 2018-04-11T01:31:03
| 129,012,000
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 1,656
|
java
|
package com.example.test02_demo;
import android.os.Bundle;
import android.support.annotation.Nullable;
import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentManager;
import android.support.v4.app.FragmentPagerAdapter;
import android.support.v4.view.ViewPager;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import java.util.ArrayList;
/**
* author:Created by WangZhiQiang on 2018/1/30.
*/
public class Fragment01 extends android.support.v4.app.Fragment {
private ViewPager view_pager;
private ArrayList<Fragment> list;
@Nullable
@Override
public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
View view = inflater.inflate(R.layout.fragment01, container, false);
view_pager = view.findViewById(R.id.view_pager);
return view;
}
@Override
public void onViewCreated(View view, @Nullable Bundle savedInstanceState) {
super.onViewCreated(view, savedInstanceState);
list = new ArrayList<>();
list.add(new ChildFragment01());
list.add(new ChildFragment02());
view_pager.setAdapter(new MyAdapter(getChildFragmentManager()));
}
private class MyAdapter extends FragmentPagerAdapter {
public MyAdapter(FragmentManager childFragmentManager) {
super(childFragmentManager);
}
@Override
public Fragment getItem(int position) {
return list.get(position);
}
@Override
public int getCount() {
return list.size();
}
}
}
|
[
"you@example.com"
] |
you@example.com
|
3a8d9def900b21ff8cd5e88d983a0f3b4d3fc004
|
4d0f2d62d1c156d936d028482561585207fb1e49
|
/Ma nguon/zcs-8.0.2_GA_5570-src/ZimbraServer/src/java/com/zimbra/cs/account/ProvisioningExt.java
|
5d1bddc38a159dbc78b69b92e815027f15b1adef
|
[] |
no_license
|
vuhung/06-email-captinh
|
e3f0ff2e84f1c2bc6bdd6e4167cd7107ec42c0bd
|
af828ac73fc8096a3cc096806c8080e54d41251f
|
refs/heads/master
| 2020-07-08T09:09:19.146159
| 2013-05-18T12:57:24
| 2013-05-18T12:57:24
| 32,319,083
| 0
| 2
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 1,192
|
java
|
package com.zimbra.cs.account;
import java.util.ArrayList;
import com.zimbra.common.service.ServiceException;
import com.zimbra.cs.util.Zimbra;
public abstract class ProvisioningExt {
public static abstract class ProvExt {
public abstract boolean serverOnly();
public boolean enabled() {
// skip if the listener needs to run inside the server
// and we are not inside the server
return !(serverOnly() && !Zimbra.started());
}
}
public static abstract class PostCreateAccountListener extends ProvExt {
public abstract void handle(Account acct) throws ServiceException;
}
private static final ArrayList<PostCreateAccountListener>
postCreateAccountListeners = new ArrayList<PostCreateAccountListener>();
public static void addPostCreateAccountListener(PostCreateAccountListener listener) {
synchronized (postCreateAccountListeners) {
postCreateAccountListeners.add(listener);
}
}
public static ArrayList<PostCreateAccountListener> getPostCreateAccountListeners() {
return postCreateAccountListeners;
}
}
|
[
"vuhung16plus@gmail.com@ec614674-f94a-24a8-de76-55dc00f2b931"
] |
vuhung16plus@gmail.com@ec614674-f94a-24a8-de76-55dc00f2b931
|
accbfc432d4f6862482d00cec046b3c67b136579
|
a1826c2ed9c12cfc395fb1a14c1a2e1f097155cb
|
/cnip-20201201/src/main/java/com/aliyun/cnip20201201/models/DeployEnvironmentProductRequest.java
|
918aa6481f9220c51048822a077cd50d031b970c
|
[
"Apache-2.0"
] |
permissive
|
aliyun/alibabacloud-java-sdk
|
83a6036a33c7278bca6f1bafccb0180940d58b0b
|
008923f156adf2e4f4785a0419f60640273854ec
|
refs/heads/master
| 2023-09-01T04:10:33.640756
| 2023-09-01T02:40:45
| 2023-09-01T02:40:45
| 288,968,318
| 40
| 45
| null | 2023-06-13T02:47:13
| 2020-08-20T09:51:08
|
Java
|
UTF-8
|
Java
| false
| false
| 726
|
java
|
// This file is auto-generated, don't edit it. Thanks.
package com.aliyun.cnip20201201.models;
import com.aliyun.tea.*;
public class DeployEnvironmentProductRequest extends TeaModel {
// 部署包uid
@NameInMap("packageUID")
public String packageUID;
public static DeployEnvironmentProductRequest build(java.util.Map<String, ?> map) throws Exception {
DeployEnvironmentProductRequest self = new DeployEnvironmentProductRequest();
return TeaModel.build(map, self);
}
public DeployEnvironmentProductRequest setPackageUID(String packageUID) {
this.packageUID = packageUID;
return this;
}
public String getPackageUID() {
return this.packageUID;
}
}
|
[
"sdk-team@alibabacloud.com"
] |
sdk-team@alibabacloud.com
|
be705b591f6329fa63e50c633839292b33ac63d6
|
f7e817caa22c45493e182bf6d698145e8cb3e005
|
/src/com/yz/manager/custom/bean/customArea.java
|
f105ebbb2521d22e7c98a408018780d9d26085fb
|
[] |
no_license
|
wingjoy/yzmanager
|
40fc3fbd6ffc6170094643e334306ee8fcbfcf21
|
f54b1d0272431ba1cabea851d95daf8c0a0b82dc
|
refs/heads/master
| 2021-03-12T23:07:51.797956
| 2013-11-07T16:37:35
| 2013-11-07T16:37:35
| 13,990,442
| 0
| 1
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 819
|
java
|
/**
*
*/
package com.yz.manager.custom.bean;
import java.io.Serializable;
/**
* @author lihaifeng
*
* 2012
* Nov 23, 2012
* 10:11:34 PM
*/
public class customArea implements Serializable {
private static final long serialVersionUID = 28944359498169516L;
public customArea() {
}
private int id;
private String areaName;
private String department;
public int getId() {
return id;
}
public String getAreaName() {
return areaName;
}
public void setAreaName(String areaName) {
this.areaName = areaName;
}
public String getDepartment() {
return department;
}
public void setDepartment(String department) {
this.department = department;
}
public void setId(int id) {
this.id = id;
}
public static long getSerialVersionUID() {
return serialVersionUID;
}
}
|
[
"swbyzx@gmail.com"
] |
swbyzx@gmail.com
|
fa1d1060333664f0ac53af1641efab4b26ff8177
|
83964a56c3d3fff94d0ff0e52386552d193aca03
|
/src/main/java/com/github/fge/jsonschema/library/digest/DraftV3DigesterDictionary.java
|
b271b7f3f2d92a8b9a3abec452cc8807081bdd6e
|
[] |
no_license
|
onurtokat/hal-streaming
|
9a0da5c050b9dd79984427a2594ef8726cae270a
|
63063991e94698d6588c1cf2170965f3991c78e3
|
refs/heads/master
| 2020-04-30T23:19:24.625158
| 2019-03-22T13:02:57
| 2019-03-22T13:02:57
| 177,141,138
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 1,969
|
java
|
//
// Decompiled by Procyon v0.5.30
//
package com.github.fge.jsonschema.library.digest;
import com.github.fge.jsonschema.core.util.DictionaryBuilder;
import com.github.fge.jsonschema.keyword.digest.helpers.NullDigester;
import com.github.fge.jackson.NodeType;
import com.github.fge.jsonschema.keyword.digest.helpers.DraftV3TypeKeywordDigester;
import com.github.fge.jsonschema.keyword.digest.draftv3.DraftV3DependenciesDigester;
import com.github.fge.jsonschema.keyword.digest.draftv3.DraftV3PropertiesDigester;
import com.github.fge.jsonschema.keyword.digest.draftv3.DivisibleByDigester;
import com.github.fge.jsonschema.keyword.digest.Digester;
import com.github.fge.jsonschema.core.util.Dictionary;
public final class DraftV3DigesterDictionary
{
private static final Dictionary<Digester> DICTIONARY;
public static Dictionary<Digester> get() {
return DraftV3DigesterDictionary.DICTIONARY;
}
static {
final DictionaryBuilder<Digester> builder = Dictionary.newBuilder();
builder.addAll(CommonDigesterDictionary.get());
String keyword = "divisibleBy";
Digester digester = DivisibleByDigester.getInstance();
builder.addEntry(keyword, digester);
keyword = "properties";
digester = DraftV3PropertiesDigester.getInstance();
builder.addEntry(keyword, digester);
keyword = "dependencies";
digester = DraftV3DependenciesDigester.getInstance();
builder.addEntry(keyword, digester);
keyword = "type";
digester = new DraftV3TypeKeywordDigester(keyword);
builder.addEntry(keyword, digester);
keyword = "disallow";
digester = new DraftV3TypeKeywordDigester(keyword);
builder.addEntry(keyword, digester);
keyword = "extends";
digester = new NullDigester(keyword, NodeType.ARRAY, NodeType.values());
builder.addEntry(keyword, digester);
DICTIONARY = builder.freeze();
}
}
|
[
"onurtkt@gmail.com"
] |
onurtkt@gmail.com
|
b3cb7eb18926d13ca71910917c5e360a8ce8b0bb
|
8fa221482da055f4c8105b590617a27595826cc3
|
/sources/com/google/android/gms/games/internal/api/zzv.java
|
4204eb07817baf148bf0042d0656807341858b21
|
[] |
no_license
|
TehVenomm/sauceCodeProject
|
4ed2f12393e67508986aded101fa2db772bd5c6b
|
0b4e49a98d14b99e7d144a20e4c9ead408694d78
|
refs/heads/master
| 2023-03-15T16:36:41.544529
| 2018-10-08T03:44:58
| 2018-10-08T03:44:58
| null | 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 478
|
java
|
package com.google.android.gms.games.internal.api;
import com.google.android.gms.common.api.GoogleApiClient;
import com.google.android.gms.common.api.Result;
import com.google.android.gms.common.api.Status;
import com.google.android.gms.games.Games.zza;
abstract class zzv extends zza<Result> {
private zzv(GoogleApiClient googleApiClient) {
super(googleApiClient);
}
public final Result zzb(Status status) {
return new zzw(this, status);
}
}
|
[
"gabrielbrazs@gmail.com"
] |
gabrielbrazs@gmail.com
|
6585da79c9eab4a5c7f548010ad77f904e0e22c2
|
96c25d08043708ffb08df16947ba06c537ae3207
|
/src/main/java/org/diorite/impl/connection/packets/login/out/PacketLoginOut.java
|
250a494efa5cb8f9f94fd1cb683602b14f168cd4
|
[
"MIT"
] |
permissive
|
TheMolkaPL/Diorite-Core
|
f758ad1b409507d85cb6965c1ad235c6095d299f
|
635f55e49d936b32a9f080e152c50801d5f46505
|
refs/heads/master
| 2021-01-16T22:14:04.986799
| 2015-06-20T19:14:30
| 2015-06-20T19:14:30
| null | 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 256
|
java
|
package org.diorite.impl.connection.packets.login.out;
import org.diorite.impl.connection.packets.Packet;
import org.diorite.impl.connection.packets.login.PacketLoginOutListener;
public interface PacketLoginOut extends Packet<PacketLoginOutListener>
{
}
|
[
"bartlomiejkmazur@gmail.com"
] |
bartlomiejkmazur@gmail.com
|
375c0b9b9a612569ab45cc539bb5febb9f542ec7
|
d2984ba2b5ff607687aac9c65ccefa1bd6e41ede
|
/src/net/datenwerke/rs/incubator/client/jasperutils/JasperUtilsDao.java
|
3d999c68715a5aaf346ec05544a0e97906ebfa15
|
[] |
no_license
|
bireports/ReportServer
|
da979eaf472b3e199e6fbd52b3031f0e819bff14
|
0f9b9dca75136c2bfc20aa611ebbc7dc24cfde62
|
refs/heads/master
| 2020-04-18T10:18:56.181123
| 2019-01-25T00:45:14
| 2019-01-25T00:45:14
| 167,463,795
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 2,070
|
java
|
/*
* ReportServer
* Copyright (c) 2018 InfoFabrik GmbH
* http://reportserver.net/
*
*
* This file is part of ReportServer.
*
* ReportServer is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package net.datenwerke.rs.incubator.client.jasperutils;
import java.util.List;
import net.datenwerke.gxtdto.client.dtomanager.Dao;
import net.datenwerke.rs.base.client.jasperutils.dto.JasperParameterProposalDto;
import net.datenwerke.rs.base.client.reportengines.jasper.dto.JasperReportDto;
import net.datenwerke.rs.incubator.client.jasperutils.rpc.JasperUtilsRpcServiceAsync;
import com.google.gwt.user.client.rpc.AsyncCallback;
import com.google.inject.Inject;
public class JasperUtilsDao extends Dao {
private final JasperUtilsRpcServiceAsync rpcService;
@Inject
public JasperUtilsDao(
JasperUtilsRpcServiceAsync rpcService
){
this.rpcService = rpcService;
}
public void proposeParametersFor(JasperReportDto jasperReportDto,
AsyncCallback<List<JasperParameterProposalDto>> callback){
rpcService.proposeParametersFor(jasperReportDto, transformAndKeepCallback(callback));
}
public void addParametersFor(JasperReportDto jasperReportDto,
List<JasperParameterProposalDto> proposalDtos,
AsyncCallback<JasperReportDto> callback){
rpcService.addParametersFor(jasperReportDto, (List<JasperParameterProposalDto>) unproxy(proposalDtos), transformDtoCallback(callback));
}
}
|
[
"srbala@gmail.com"
] |
srbala@gmail.com
|
43937eb341b0d51ee951cc57bc170ae2444c0467
|
0af8b92686a58eb0b64e319b22411432aca7a8f3
|
/single-large-project/src/test/java/org/gradle/test/performancenull_461/Testnull_46027.java
|
5fa5924fb0f1476eea4ec4c5d2caa5cbb01ed280
|
[] |
no_license
|
gradle/performance-comparisons
|
b0d38db37c326e0ce271abebdb3c91769b860799
|
e53dc7182fafcf9fedf07920cbbea8b40ee4eef4
|
refs/heads/master
| 2023-08-14T19:24:39.164276
| 2022-11-24T05:18:33
| 2022-11-24T05:18:33
| 80,121,268
| 17
| 15
| null | 2022-09-30T08:04:35
| 2017-01-26T14:25:33
| null |
UTF-8
|
Java
| false
| false
| 308
|
java
|
package org.gradle.test.performancenull_461;
import static org.junit.Assert.*;
public class Testnull_46027 {
private final Productionnull_46027 production = new Productionnull_46027("value");
@org.junit.Test
public void test() {
assertEquals(production.getProperty(), "value");
}
}
|
[
"cedric.champeau@gmail.com"
] |
cedric.champeau@gmail.com
|
49b1d5d62a3c2e7e64811e34cf6153be206af7d8
|
575c19e81594666f51cceb55cb1ab094b218f66b
|
/octopusconsortium/src/main/java/OctopusConsortium/Core/InvalidMessageException.java
|
3e5a0814b07b9baf49b091377eeca1ef2fabdc96
|
[
"Apache-2.0"
] |
permissive
|
uk-gov-mirror/111online.ITK-MessagingEngine
|
62b702653ea716786e2684e3d368898533e77534
|
011e8cbe0bcb982eedc2204318d94e2bb5d4adb2
|
refs/heads/master
| 2023-01-22T17:47:54.631879
| 2020-12-01T14:18:05
| 2020-12-01T14:18:05
| null | 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 587
|
java
|
/**
*
*/
package OctopusConsortium.Core;
/**
* @author stuart.yeates
*
*/
public class InvalidMessageException extends Exception {
/**
*
*/
private static final long serialVersionUID = -9189024312828850059L;
protected String _serviceMessage = "";
public InvalidMessageException()
{
}
public InvalidMessageException(String message)
{
this(message, "");
}
public InvalidMessageException(String message ,String serviceMessage)
{
super(message);
_serviceMessage = serviceMessage;
}
public String getServiceMessage()
{
return _serviceMessage;
}
}
|
[
"tom.axworthy@nhs.net"
] |
tom.axworthy@nhs.net
|
2052a25d899224e4ea4367c095098cfdc5573657
|
74d6190633fbbc11805d6f665bacc692a30f1de0
|
/src/com/emitrom/ti4j/desktop/client/network/ReadCallback.java
|
b8a99a8b703a2cbab3d587f04be5c16cb580bfa2
|
[
"Apache-2.0"
] |
permissive
|
sksastry/titanium4j
|
82c9d34fecb8555dda22f11abaf5453855c64f8a
|
0147de71a8746be60b3170f1258da62014281664
|
refs/heads/master
| 2021-01-18T04:34:01.384587
| 2014-02-02T21:31:40
| 2014-02-02T21:31:40
| 13,526,003
| 1
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 919
|
java
|
/************************************************************************
* ReadCallback.java is part of Ti4j 3.1.0 Copyright 2013 Emitrom LLC
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may not
* use this file except in compliance with the License. You may obtain a copy of
* the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
* License for the specific language governing permissions and limitations under
* the License.
**************************************************************************/
package com.emitrom.ti4j.desktop.client.network;
public interface ReadCallback {
public void onRead(Object data);
}
|
[
"jazzmatadazz@gmail.com"
] |
jazzmatadazz@gmail.com
|
264378dbe1c894fe2c4233fc3b12b5da17a8199e
|
31a0d244f395bced09deab0308bc526c94ed22cd
|
/src/main/java/info/openmods/calc/types/bool/BoolPrinter.java
|
ebf3320996e4d158e3090172348d67f349170414
|
[
"MIT"
] |
permissive
|
boq/OpenCalc
|
aa8fb572425306abc7ac5465f2bcceb8b3380e0f
|
417263680874b4b59efff4fca505146e64bc841b
|
refs/heads/master
| 2021-01-20T04:50:15.124899
| 2017-11-11T21:24:29
| 2017-11-11T21:24:29
| 89,741,005
| 2
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 447
|
java
|
package info.openmods.calc.types.bool;
import info.openmods.calc.IValuePrinter;
import info.openmods.calc.utils.config.ConfigProperty;
public class BoolPrinter implements IValuePrinter<Boolean> {
@ConfigProperty
public boolean numeric = false;
@Override
public String str(Boolean value) {
if (numeric) return value? "1" : "0";
return value.toString();
}
@Override
public String repr(Boolean value) {
return value.toString();
}
}
|
[
"bartek.bok@gmail.com"
] |
bartek.bok@gmail.com
|
de46e618ed7b5c6993885059d7e0df286e131d97
|
1dc29ddd9fb5ea2864e59d06f66471ddce59e16a
|
/anteros-social-android-twitter/src/main/java/br/com/anteros/social/twitter/entities/TwitterAgeRange.java
|
1dff230c615f9377520bf40a3c80c6c4abe51783
|
[] |
no_license
|
anterostecnologia/anterossocialandroid
|
d3c3e86d820c278f87518f2618e6342e1edb4eba
|
2d894cca6b45f27743308ffee34691d2c83c7b07
|
refs/heads/master
| 2021-01-18T21:11:43.426367
| 2016-05-17T20:29:12
| 2016-05-17T20:29:12
| 55,105,976
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 1,348
|
java
|
/*
* ******************************************************************************
* * Copyright 2016 Anteros Tecnologia
* *
* * 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 br.com.anteros.social.twitter.entities;
import br.com.anteros.social.core.AgeRange;
/**
* Created by edson on 25/03/16.
*/
public class TwitterAgeRange implements AgeRange {
private String min;
private String max;
public TwitterAgeRange(String min, String max) {
this.min = min;
this.max = max;
}
public String getMin() {
return min;
}
public String getMax() {
return max;
}
@Override
public String toString() {
return min+" to "+max;
}
}
|
[
"edsonmartins2005@gmail.com"
] |
edsonmartins2005@gmail.com
|
48de3daf17a300b858232670e1de3620f103d752
|
78cc0dff55fb2ade8b776390f83a79188157cf57
|
/src/main/java/com/dingtalk/api/request/OapiImpaasConversationOpencidGetRequest.java
|
36f4c5221a83abb0155f9d4c181168db4ace05e7
|
[] |
no_license
|
carlvine500/taobao-sdk-java
|
e6b3c0f20dd6e7f0d1895d0e2f569046777d71f9
|
4a49208e4a11d23e9c0a7ca132437671bce0325f
|
refs/heads/master
| 2021-07-15T00:15:03.905983
| 2021-06-28T09:35:41
| 2021-06-28T09:35:41
| 247,893,296
| 0
| 0
| null | 2020-03-17T06:12:14
| 2020-03-17T06:12:14
| null |
UTF-8
|
Java
| false
| false
| 3,084
|
java
|
package com.dingtalk.api.request;
import com.taobao.api.internal.mapping.ApiField;
import com.taobao.api.TaobaoObject;
import java.util.Map;
import java.util.List;
import com.taobao.api.ApiRuleException;
import com.taobao.api.BaseTaobaoRequest;
import com.dingtalk.api.DingTalkConstants;
import com.taobao.api.Constants;
import com.taobao.api.internal.util.TaobaoHashMap;
import com.taobao.api.internal.util.TaobaoUtils;
import com.taobao.api.internal.util.json.JSONWriter;
import com.dingtalk.api.response.OapiImpaasConversationOpencidGetResponse;
/**
* TOP DingTalk-API: dingtalk.oapi.impaas.conversation.opencid.get request
*
* @author top auto create
* @since 1.0, 2020.09.24
*/
public class OapiImpaasConversationOpencidGetRequest extends BaseTaobaoRequest<OapiImpaasConversationOpencidGetResponse> {
/**
* 基础会话对象
*/
private String model;
public void setModel(String model) {
this.model = model;
}
public void setModel(CrossDomainBaseConversationModel model) {
this.model = new JSONWriter(false,false,true).write(model);
}
public String getModel() {
return this.model;
}
public String getApiMethodName() {
return "dingtalk.oapi.impaas.conversation.opencid.get";
}
private String topResponseType = Constants.RESPONSE_TYPE_DINGTALK_OAPI;
public String getTopResponseType() {
return this.topResponseType;
}
public void setTopResponseType(String topResponseType) {
this.topResponseType = topResponseType;
}
public String getTopApiCallType() {
return DingTalkConstants.CALL_TYPE_OAPI;
}
private String topHttpMethod = DingTalkConstants.HTTP_METHOD_POST;
public String getTopHttpMethod() {
return this.topHttpMethod;
}
public void setTopHttpMethod(String topHttpMethod) {
this.topHttpMethod = topHttpMethod;
}
public void setHttpMethod(String httpMethod) {
this.setTopHttpMethod(httpMethod);
}
public Map<String, String> getTextParams() {
TaobaoHashMap txtParams = new TaobaoHashMap();
txtParams.put("model", this.model);
if(this.udfParams != null) {
txtParams.putAll(this.udfParams);
}
return txtParams;
}
public Class<OapiImpaasConversationOpencidGetResponse> getResponseClass() {
return OapiImpaasConversationOpencidGetResponse.class;
}
public void check() throws ApiRuleException {
}
/**
* 基础会话对象
*
* @author top auto create
* @since 1.0, null
*/
public static class CrossDomainBaseConversationModel extends TaobaoObject {
private static final long serialVersionUID = 1615366722352688814L;
/**
* 会话id
*/
@ApiField("cid")
private String cid;
/**
* 会话类型
*/
@ApiField("conversation_type")
private Long conversationType;
public String getCid() {
return this.cid;
}
public void setCid(String cid) {
this.cid = cid;
}
public Long getConversationType() {
return this.conversationType;
}
public void setConversationType(Long conversationType) {
this.conversationType = conversationType;
}
}
}
|
[
"tingfeng.liu@successchannel.com"
] |
tingfeng.liu@successchannel.com
|
c0e7751f62512b3f6998e9013f82dd6394fdf254
|
a66a4d91639836e97637790b28b0632ba8d0a4f9
|
/src/generators/compression/huffman/utils/ProbabilityFormatter.java
|
a6df05fa90a85b50d48b438d1422199d00661b42
|
[] |
no_license
|
roessling/animal-av
|
7d0ba53dda899b052a6ed19992fbdfbbc62cf1c9
|
043110cadf91757b984747750aa61924a869819f
|
refs/heads/master
| 2021-07-13T05:31:42.223775
| 2020-02-26T14:47:31
| 2020-02-26T14:47:31
| 206,062,707
| 0
| 2
| null | 2020-10-13T15:46:14
| 2019-09-03T11:37:11
|
Java
|
UTF-8
|
Java
| false
| false
| 1,076
|
java
|
package generators.compression.huffman.utils;
import java.math.RoundingMode;
import java.text.NumberFormat;
import java.util.Locale;
public class ProbabilityFormatter {
private static ProbabilityFormatter probFormatter = new ProbabilityFormatter();
private static NumberFormat probablityFormat;
private ProbabilityFormatter() {
probablityFormat = NumberFormat.getInstance(new Locale("en"));
probablityFormat.setMaximumFractionDigits(3);
probablityFormat.setMinimumFractionDigits(3);
probablityFormat.setRoundingMode(RoundingMode.HALF_UP);
}
public static String format(float probability) {
return probFormatter.formatProbability(probability);
}
public String formatProbability(float probability) {
return probablityFormat.format(probability);
}
public static void setLocale(Locale locale) {
probablityFormat = NumberFormat.getInstance(locale);
probablityFormat.setMaximumFractionDigits(3);
probablityFormat.setMinimumFractionDigits(3);
probablityFormat.setRoundingMode(RoundingMode.HALF_UP);
}
}
|
[
"guido@tk.informatik.tu-darmstadt.de"
] |
guido@tk.informatik.tu-darmstadt.de
|
6603aeb6bcbf2d43e822309df64b6f2a14b3853f
|
0ea271177f5c42920ac53cd7f01f053dba5c14e4
|
/5.3.5/sources/com/google/android/gms/wearable/internal/zzco.java
|
4e643c745fa7956c3f7fc3c0145f86fb8d1f5eab
|
[] |
no_license
|
alireza-ebrahimi/telegram-talaeii
|
367a81a77f9bc447e729b2ca339f9512a4c2860e
|
68a67e6f104ab8a0888e63c605e8bbad12c4a20e
|
refs/heads/master
| 2020-03-21T13:44:29.008002
| 2018-12-09T10:30:29
| 2018-12-09T10:30:29
| 138,622,926
| 12
| 1
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 423
|
java
|
package com.google.android.gms.wearable.internal;
import com.google.android.gms.common.api.Result;
import com.google.android.gms.common.internal.zzbo;
import com.google.android.gms.wearable.DataItemBuffer;
final /* synthetic */ class zzco implements zzbo {
static final zzbo zzgui = new zzco();
private zzco() {
}
public final Object zzb(Result result) {
return (DataItemBuffer) result;
}
}
|
[
"alireza.ebrahimi2006@gmail.com"
] |
alireza.ebrahimi2006@gmail.com
|
028ce1dfde2ff10a5b3a9365e1fc0bc140b87c4e
|
86ca3b3e8a012e4a551941d6830c580193cdefad
|
/UnknownGame/dev_resources/minecraft_src/minecraft/net/minecraft/src/EntityMinecartEmpty.java
|
ec21dd9444180c61eaf9106da432b58bbb395821
|
[] |
no_license
|
Tmuch/UnknownGame
|
b162201694b2435fa8a13091e4681a7cb04a1be4
|
7927c7f14c97d9c8910b01dc3fe80c6d6f3bd0d6
|
refs/heads/master
| 2021-01-10T20:54:55.382058
| 2013-08-05T22:24:33
| 2013-08-05T22:24:33
| null | 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 990
|
java
|
package net.minecraft.src;
public class EntityMinecartEmpty extends EntityMinecart
{
public EntityMinecartEmpty(World par1World)
{
super(par1World);
}
public EntityMinecartEmpty(World par1World, double par2, double par4, double par6)
{
super(par1World, par2, par4, par6);
}
public boolean func_130002_c(EntityPlayer par1EntityPlayer)
{
if (this.riddenByEntity != null && this.riddenByEntity instanceof EntityPlayer && this.riddenByEntity != par1EntityPlayer)
{
return true;
}
else if (this.riddenByEntity != null && this.riddenByEntity != par1EntityPlayer)
{
return false;
}
else
{
if (!this.worldObj.isRemote)
{
par1EntityPlayer.mountEntity(this);
}
return true;
}
}
public int getMinecartType()
{
return 0;
}
}
|
[
"tyler.much@marquette.edu"
] |
tyler.much@marquette.edu
|
c56997648a48b7706a6f107844496c074363c091
|
55aae8f429f194565e3472e2d5309106e9e41287
|
/plugins/org.fusesource.ide.fabric/src/org/fusesource/ide/fabric/actions/jclouds/CloudDetailsTable.java
|
04bc6a2fb7419cf831276383150b5c7d147c87d7
|
[] |
no_license
|
deepakjacob/fuseide
|
cba98d4e22d8fe16ac45ef14ca066ab08847e746
|
892695870fd545519f7f0e10f9781a02cc49e40b
|
refs/heads/master
| 2020-12-25T03:21:10.095278
| 2012-11-24T00:01:33
| 2012-11-24T00:01:33
| null | 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 5,407
|
java
|
package org.fusesource.ide.fabric.actions.jclouds;
import org.eclipse.core.databinding.observable.ChangeEvent;
import org.eclipse.core.databinding.observable.IChangeListener;
import org.eclipse.jface.action.Action;
import org.eclipse.jface.viewers.ArrayContentProvider;
import org.eclipse.jface.viewers.ISelectionChangedListener;
import org.eclipse.jface.viewers.IStructuredContentProvider;
import org.eclipse.jface.viewers.SelectionChangedEvent;
import org.eclipse.jface.viewers.StructuredSelection;
import org.eclipse.swt.SWT;
import org.eclipse.swt.layout.GridData;
import org.eclipse.swt.layout.RowLayout;
import org.eclipse.swt.widgets.Button;
import org.eclipse.swt.widgets.Composite;
import org.fusesource.ide.commons.ui.Selections;
import org.fusesource.ide.commons.ui.Widgets;
import org.fusesource.ide.commons.ui.config.ConfigurationDetails;
import org.fusesource.ide.commons.ui.views.TableViewSupport;
import org.fusesource.ide.commons.util.Function1;
public class CloudDetailsTable extends TableViewSupport {
private Button addButton;
private Button editButton;
private Button deleteButton;
private Action editAction;
private final IChangeListener changeListener = new IChangeListener() {
@Override
public void handleChange(ChangeEvent event) {
Widgets.refresh(getViewer());
}
};
private CloudDetailsAddAction addAction;
private CloudDetailsDeleteAction deleteAction;
private CloudDetails selectedCloud;
public CloudDetailsTable() {
setShowSearchBox(false);
}
@Override
public void dispose() {
CloudDetails.getCloudDetailList().removeChangeListener(changeListener);
super.dispose();
}
@Override
protected void createColumns() {
clearColumns();
int bounds = 150;
int column = 0;
Function1 function = new Function1() {
@Override
public Object apply(Object element) {
CloudDetails exchange = CloudDetails.asCloudDetails(element);
if (exchange != null) {
return exchange.getName();
}
return null;
}
};
column = addColumnFunction(bounds, column, function, "Name");
function = new Function1() {
@Override
public Object apply(Object element) {
CloudDetails exchange = CloudDetails.asCloudDetails(element);
if (exchange != null) {
return exchange.getProviderName();
}
return null;
}
};
column = addColumnFunction(bounds, column, function, "Provider");
function = new Function1() {
@Override
public Object apply(Object element) {
CloudDetails exchange = CloudDetails.asCloudDetails(element);
if (exchange != null) {
return exchange.getIdentity();
}
return null;
}
};
column = addColumnFunction(bounds, column, function, "Identity");
}
@Override
public void createPartControl(Composite parent) {
super.createPartControl(parent);
getViewer().addSelectionChangedListener(new ISelectionChangedListener() {
@Override
public void selectionChanged(SelectionChangedEvent event) {
selectedCloud = CloudDetails.asCloudDetails(Selections.getFirstSelection(event.getSelection()));
selectionUpdated();
}
});
Composite buttonBar = new Composite(parent, SWT.NONE);
GridData gridData = new GridData();
gridData.horizontalSpan = 2;
gridData.grabExcessHorizontalSpace = true;
gridData.grabExcessVerticalSpace = false;
gridData.horizontalAlignment = SWT.CENTER;
buttonBar.setLayoutData(gridData);
RowLayout layout = new RowLayout();
layout.center = true;
buttonBar.setLayout(layout);
addAction = new CloudDetailsAddAction() {
@Override
protected void onCloudDetailsAdded(ConfigurationDetails details) {
getViewer().setSelection(new StructuredSelection(details));
}
};
editAction = new CloudDetailsEditAction() {
@Override
protected CloudDetails getSelectedCloudDetails() {
return getSelectedCloud();
}
@Override
protected void onCloudDetailsEdited(Object found) {
if (found != null) {
getViewer().setSelection(new StructuredSelection(found));
}
}
};
setDoubleClickAction(editAction);
deleteAction = new CloudDetailsDeleteAction() {
@Override
protected CloudDetails getSelectedCloudDetails() {
return getSelectedCloud();
}
};
addButton = Widgets.createActionButton(buttonBar, addAction);
editButton = Widgets.createActionButton(buttonBar, editAction);
deleteButton = Widgets.createActionButton(buttonBar, deleteAction);
selectionUpdated();
CloudDetails.getCloudDetailList().addChangeListener(changeListener);
}
@Override
protected void configureViewer() {
// load the current cloud details...
reload();
}
public void reload() {
getViewer().setInput(CloudDetails.getCloudDetailList());
}
@Override
protected IStructuredContentProvider createContentProvider() {
return ArrayContentProvider.getInstance();
}
@Override
protected String getHelpID() {
return getClass().getName();
}
public CloudDetails getSelectedCloud() {
return this.selectedCloud;
}
protected void selectionUpdated() {
boolean selected = getSelectedCloud() != null;
editAction.setEnabled(selected);
editButton.setEnabled(selected);
deleteAction.setEnabled(selected);
deleteButton.setEnabled(selected);
}
}
|
[
"james.strachan@gmail.com"
] |
james.strachan@gmail.com
|
058daf4a7261e79f7cab6228dd3a1b643111d270
|
42fd07a7d60736d321c19c35eba4ddea6fcd81aa
|
/modules/product/src/test/java/com/opengamma/strata/product/swap/type/ThreeLegBasisSwapTemplateTest.java
|
87470366a104261bc71cadb5bc48922d702fc15a
|
[
"Apache-2.0"
] |
permissive
|
SemanticBeeng/Strata
|
4a0320fff3d4120361f0f9e037116d5c67ee0097
|
a40c607cc4b2a96836c562f8ae6dd4c18af32972
|
refs/heads/master
| 2021-01-21T07:20:08.150677
| 2016-05-20T10:35:10
| 2016-05-20T10:35:10
| null | 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 5,077
|
java
|
/**
* Copyright (C) 2015 - present by OpenGamma Inc. and the OpenGamma group of companies
*
* Please see distribution for license.
*/
package com.opengamma.strata.product.swap.type;
import static com.opengamma.strata.basics.BuySell.BUY;
import static com.opengamma.strata.basics.PayReceive.PAY;
import static com.opengamma.strata.basics.PayReceive.RECEIVE;
import static com.opengamma.strata.basics.currency.Currency.USD;
import static com.opengamma.strata.basics.date.BusinessDayConventions.FOLLOWING;
import static com.opengamma.strata.basics.date.DayCounts.ACT_360;
import static com.opengamma.strata.basics.date.HolidayCalendarIds.GBLO;
import static com.opengamma.strata.basics.date.Tenor.TENOR_10Y;
import static com.opengamma.strata.basics.date.Tenor.TENOR_2Y;
import static com.opengamma.strata.basics.index.IborIndices.USD_LIBOR_1M;
import static com.opengamma.strata.basics.index.IborIndices.USD_LIBOR_3M;
import static com.opengamma.strata.basics.index.IborIndices.USD_LIBOR_6M;
import static com.opengamma.strata.basics.schedule.Frequency.P6M;
import static com.opengamma.strata.collect.TestHelper.assertSerialization;
import static com.opengamma.strata.collect.TestHelper.assertThrowsIllegalArg;
import static com.opengamma.strata.collect.TestHelper.coverBeanEquals;
import static com.opengamma.strata.collect.TestHelper.coverImmutableBean;
import static com.opengamma.strata.collect.TestHelper.date;
import static org.testng.Assert.assertEquals;
import java.time.LocalDate;
import java.time.Period;
import java.util.Optional;
import org.testng.annotations.Test;
import com.opengamma.strata.basics.date.BusinessDayAdjustment;
import com.opengamma.strata.basics.market.ReferenceData;
import com.opengamma.strata.product.swap.Swap;
import com.opengamma.strata.product.swap.SwapTrade;
/**
* Test {@link ThreeLegBasisSwapTemplate}.
*/
@Test
public class ThreeLegBasisSwapTemplateTest {
private static final ReferenceData REF_DATA = ReferenceData.standard();
private static final double NOTIONAL_2M = 2_000_000d;
private static final BusinessDayAdjustment BDA_FOLLOW = BusinessDayAdjustment.of(FOLLOWING, GBLO);
private static final FixedRateSwapLegConvention FIXED =
FixedRateSwapLegConvention.of(USD, ACT_360, P6M, BDA_FOLLOW);
private static final IborRateSwapLegConvention IBOR1M = IborRateSwapLegConvention.of(USD_LIBOR_1M);
private static final IborRateSwapLegConvention IBOR3M = IborRateSwapLegConvention.of(USD_LIBOR_3M);
private static final IborRateSwapLegConvention IBOR6M = IborRateSwapLegConvention.of(USD_LIBOR_6M);
private static final ThreeLegBasisSwapConvention CONV =
ImmutableThreeLegBasisSwapConvention.of("USD-Swap", FIXED, IBOR3M, IBOR6M);
private static final ThreeLegBasisSwapConvention CONV2 =
ImmutableThreeLegBasisSwapConvention.of("USD-Swap2", FIXED, IBOR1M, IBOR3M);
//-------------------------------------------------------------------------
public void test_of_spot() {
ThreeLegBasisSwapTemplate test = ThreeLegBasisSwapTemplate.of(TENOR_10Y, CONV);
assertEquals(test.getPeriodToStart(), Period.ZERO);
assertEquals(test.getTenor(), TENOR_10Y);
assertEquals(test.getConvention(), CONV);
}
public void test_of() {
ThreeLegBasisSwapTemplate test = ThreeLegBasisSwapTemplate.of(Period.ofMonths(3), TENOR_10Y, CONV);
assertEquals(test.getPeriodToStart(), Period.ofMonths(3));
assertEquals(test.getTenor(), TENOR_10Y);
assertEquals(test.getConvention(), CONV);
}
//-------------------------------------------------------------------------
public void test_builder_notEnoughData() {
assertThrowsIllegalArg(() -> ThreeLegBasisSwapTemplate.builder()
.tenor(TENOR_2Y)
.build());
}
//-------------------------------------------------------------------------
public void test_createTrade() {
ThreeLegBasisSwapTemplate base = ThreeLegBasisSwapTemplate.of(Period.ofMonths(3), TENOR_10Y, CONV);
LocalDate tradeDate = LocalDate.of(2015, 5, 5);
LocalDate startDate = date(2015, 8, 7);
LocalDate endDate = date(2025, 8, 7);
SwapTrade test = base.createTrade(tradeDate, BUY, NOTIONAL_2M, 0.25d, REF_DATA);
Swap expected = Swap.of(
FIXED.toLeg(startDate, endDate, PAY, NOTIONAL_2M, 0.25d),
IBOR3M.toLeg(startDate, endDate, PAY, NOTIONAL_2M),
IBOR6M.toLeg(startDate, endDate, RECEIVE, NOTIONAL_2M));
assertEquals(test.getInfo().getTradeDate(), Optional.of(tradeDate));
assertEquals(test.getProduct(), expected);
}
//-------------------------------------------------------------------------
public void coverage() {
ThreeLegBasisSwapTemplate test = ThreeLegBasisSwapTemplate.of(Period.ofMonths(3), TENOR_10Y, CONV);
coverImmutableBean(test);
ThreeLegBasisSwapTemplate test2 = ThreeLegBasisSwapTemplate.of(Period.ofMonths(2), TENOR_2Y, CONV2);
coverBeanEquals(test, test2);
}
public void test_serialization() {
ThreeLegBasisSwapTemplate test = ThreeLegBasisSwapTemplate.of(Period.ofMonths(3), TENOR_10Y, CONV);
assertSerialization(test);
}
}
|
[
"stephen@opengamma.com"
] |
stephen@opengamma.com
|
c1cd8300c3d51f86a63e6e9f4ecee90b44821a71
|
19989ad71f45ee2e1d182183a78a93530acc49b7
|
/Java Web/Spring MVC/Spring Essentials/EXODIA/src/main/java/org/softuni/springessentialsintro/service/UserService.java
|
f31e9ebae334ee7f891e7392ce8f17f0e5ca483e
|
[] |
no_license
|
goldenEAGL3/SoftUni
|
b811c070192e317492acc113d80443e58570f2d4
|
ba60411d4deea3d999af20ea10be9c015b899c4a
|
refs/heads/master
| 2023-08-09T10:04:45.414043
| 2020-03-21T18:45:44
| 2020-03-21T18:45:44
| 175,472,191
| 0
| 2
| null | 2023-07-21T17:50:00
| 2019-03-13T17:54:34
|
Java
|
UTF-8
|
Java
| false
| false
| 550
|
java
|
package org.softuni.springessentialsintro.service;
import org.softuni.springessentialsintro.domain.model.binding.UserLoginBindingModel;
import org.softuni.springessentialsintro.domain.model.binding.UserRegisterBindingModel;
import org.softuni.springessentialsintro.domain.model.service.UserServiceModel;
public interface UserService {
boolean registerUser(UserRegisterBindingModel userRegisterBindingModel);
UserServiceModel findByUsername(String username);
UserServiceModel loginUser(UserLoginBindingModel userLoginBindingModel);
}
|
[
"48495509+goldenEAGL3@users.noreply.github.com"
] |
48495509+goldenEAGL3@users.noreply.github.com
|
6ec6ea9607b59b146d9938cdb1474ea6e45676df
|
02e403ffd4fa6148071520e17cd02287b6df1a47
|
/src/main/java/tacos/security/UserRepositoryUserDetailsService.java
|
533011994de43f2c2c68db52bdd76e64bcf777d0
|
[] |
no_license
|
mavy0313/spring-in-action-taco-cloud
|
78912c48506d113e8d56a8e4f899acc3b37edc1b
|
16a1a61c243698f7a9ef364639dc514ed914afc4
|
refs/heads/master
| 2020-06-19T15:10:14.827456
| 2020-04-29T06:47:33
| 2020-04-29T06:47:33
| 196,756,784
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 937
|
java
|
package tacos.security;
import org.springframework.beans.factory.annotation.Autowired;
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.Service;
import tacos.User;
import tacos.data.UserRepository;
@Service
public class UserRepositoryUserDetailsService implements UserDetailsService {
private UserRepository userRepo;
@Autowired
public UserRepositoryUserDetailsService(UserRepository userRepo) {
this.userRepo = userRepo;
}
@Override
public UserDetails loadUserByUsername(String username) throws UsernameNotFoundException {
User user = userRepo.findByUsername(username);
if (user != null) {
return user;
}
throw new UsernameNotFoundException("User '" + username + "' not found");
}
}
|
[
"vypoff@gmail.com"
] |
vypoff@gmail.com
|
bbcff9d7da72ae4a15151c22bbafd63606a35ad8
|
d1a6d1e511df6db8d8dd0912526e3875c7e1797d
|
/genny_JavaWithoutLambdas/applicationModule/src/test/java/applicationModulepackageJava13/Foo92Test.java
|
7cd4f8a4da9943405ecb2f2f89e8d131f5067f65
|
[] |
no_license
|
NikitaKozlov/generated-project-for-desugaring
|
0bc1443ab3ddc84cd289331c726761585766aea7
|
81506b3711004185070ca4bb9a93482b70011d36
|
refs/heads/master
| 2020-03-20T00:35:06.996525
| 2018-06-12T09:30:37
| 2018-06-12T09:30:37
| 137,049,317
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 475
|
java
|
package applicationModulepackageJava13;
import org.junit.Test;
public class Foo92Test {
@Test
public void testFoo0() {
new Foo92().foo0();
}
@Test
public void testFoo1() {
new Foo92().foo1();
}
@Test
public void testFoo2() {
new Foo92().foo2();
}
@Test
public void testFoo3() {
new Foo92().foo3();
}
@Test
public void testFoo4() {
new Foo92().foo4();
}
@Test
public void testFoo5() {
new Foo92().foo5();
}
}
|
[
"nikita.e.kozlov@gmail.com"
] |
nikita.e.kozlov@gmail.com
|
c716452c9bee143ccb5baee2e69a1e607ac133b3
|
647ec12ce50f06e7380fdbfb5b71e9e2d1ac03b4
|
/com.tencent.mobileqqi/classes.jar/com/tencent/protofile/coupon/CouponProto$GetCouponsDetailReq.java
|
124a48b6339772c3603933f017e18dbddade859f
|
[] |
no_license
|
tsuzcx/qq_apk
|
0d5e792c3c7351ab781957bac465c55c505caf61
|
afe46ef5640d0ba6850cdefd3c11badbd725a3f6
|
refs/heads/main
| 2022-07-02T10:32:11.651957
| 2022-02-01T12:41:38
| 2022-02-01T12:41:38
| 453,860,108
| 36
| 9
| null | 2022-01-31T09:46:26
| 2022-01-31T02:43:22
|
Java
|
UTF-8
|
Java
| false
| false
| 1,263
|
java
|
package com.tencent.protofile.coupon;
import com.tencent.mobileqq.pb.MessageMicro;
import com.tencent.mobileqq.pb.MessageMicro.FieldMap;
import com.tencent.mobileqq.pb.PBField;
import com.tencent.mobileqq.pb.PBRepeatField;
import com.tencent.mobileqq.pb.PBUInt32Field;
public final class CouponProto$GetCouponsDetailReq
extends MessageMicro
{
public static final int BIDS_FIELD_NUMBER = 1;
public static final int CIDS_FIELD_NUMBER = 2;
public static final int SOURCE_IDS_FIELD_NUMBER = 3;
static final MessageMicro.FieldMap __fieldMap__ = MessageMicro.initFieldMap(new int[] { 8, 16, 24 }, new String[] { "bids", "cids", "source_ids" }, new Object[] { Integer.valueOf(0), Integer.valueOf(0), Integer.valueOf(0) }, GetCouponsDetailReq.class);
public final PBRepeatField bids = PBField.initRepeat(PBUInt32Field.__repeatHelper__);
public final PBRepeatField cids = PBField.initRepeat(PBUInt32Field.__repeatHelper__);
public final PBRepeatField source_ids = PBField.initRepeat(PBUInt32Field.__repeatHelper__);
}
/* Location: L:\local\mybackup\temp\qq_apk\com.tencent.mobileqqi\classes2.jar
* Qualified Name: com.tencent.protofile.coupon.CouponProto.GetCouponsDetailReq
* JD-Core Version: 0.7.0.1
*/
|
[
"98632993+tsuzcx@users.noreply.github.com"
] |
98632993+tsuzcx@users.noreply.github.com
|
0900e4830d87d3c4d25a486618040519fcdb7cb0
|
cd0ee0fc473ade6b6bbae7bf92f550ce802934ac
|
/src/stack/concept/MyDynamicStack.java
|
502ab47a7bba38090ab087f35859229f0b74c188
|
[] |
no_license
|
nitinguptamca/DataStructurSearchSortTricky
|
9b9b3d70c123dcce5d1046ee0e5d2d234b0e9586
|
9db4a6f7465c56ff48af9db089d1849037790e75
|
refs/heads/master
| 2020-03-26T02:25:18.566002
| 2018-10-04T17:08:02
| 2018-10-04T17:08:02
| 144,409,391
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 3,208
|
java
|
package stack.concept;
public class MyDynamicStack {
private int stackSize;
private int[] stackArr;
private int top;
/**
* constructor to create stack with size
*
* @param size
*/
public MyDynamicStack(int size) {
this.stackSize = size;
this.stackArr = new int[stackSize];
this.top = -1;
}
/**
* This method adds new entry to the top of the stack
*
* @param entry
* @throws Exception
*/
public void push(int entry) {
if (this.isStackFull()) {
System.out.println(("Stack is full. Increasing the capacity."));
this.increaseStackCapacity();
}
System.out.println("Adding: " + entry);
this.stackArr[++top] = entry;
}
/**
* This method removes an entry from the top of the stack.
*
* @return
* @throws Exception
*/
public int pop() throws Exception {
if (this.isStackEmpty()) {
throw new Exception("Stack is empty. Can not remove element.");
}
int entry = this.stackArr[top--];
System.out.println("Removed entry: " + entry);
return entry;
}
/**
* This method returns top of the stack without removing it.
*
* @return
*/
public long peek() {
return stackArr[top];
}
private void increaseStackCapacity() {
int[] newStack = new int[this.stackSize * 2];
/*for (int i = 0; i < stackSize; i++) {
newStack[i] = this.stackArr[i];
}*/
this.stackArr = newStack;
this.stackSize = this.stackSize * 2;
}
/**
* This method returns true if the stack is empty
*
* @return
*/
public boolean isStackEmpty() {
return (top == -1);
}
/**
* This method returns true if the stack is full
*
* @return
*/
public boolean isStackFull() {
return (top == stackSize - 1);
}
public static void main1(String[] args) {
MyDynamicStack stack = new MyDynamicStack(2);
for (int i = 1; i < 10; i++) {
stack.push(i);
}
for (int i = 1; i < 4; i++) {
try {
stack.pop();
} catch (Exception e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
}
/******************************************************************************
* However a queue can be implemented using two stacks. Algorithm is as follows
* *****************************************************************************
*
* Create two stacks : 's' and 'tmp' as in the program given below For insert
* operation : if size of s = 0 then push value into s else push all popped
* elements from s to tmp push value into s push all popped elements from tmp to
* s
*
* For remove operation : if size of s = 0 then throw 'underflow' exception else
* return pop element from s
*
* @param args
* @throws Exception
*/
public static void main(String[] args) throws Exception {
MyDynamicStack stack = new MyDynamicStack(2);
MyDynamicStack tmp=new MyDynamicStack(2);
for (int i = 1; i < 5; i++) {
stack.push(i);
}
while(stack.isStackEmpty()==false) {
tmp.push(stack.pop());
}
while(tmp.isStackEmpty() == false) {
stack.push(tmp.pop());
}
while(stack.isStackEmpty()==false) {
System.out.println(stack.pop());
}
}
}
|
[
"nitinguptamca@gmail.com"
] |
nitinguptamca@gmail.com
|
e1b1dea939aeb9f50cd10df661a61847b89e8584
|
fe94bb01bbaf452ab1752cb3c1d1e4ecf297b9be
|
/src/main/java/com/opencart/design/ModelDesignLayoutDaoImpl.java
|
51d3d7a4df9325ab542f64faaf5a02f68cb4989d
|
[] |
no_license
|
gmai2006/opencart
|
9d3b037f09294973112bafbadd22d5edd8457de5
|
dba44adabf4b8eab3bdb07062c887ba0a2a5405f
|
refs/heads/master
| 2020-12-31T06:13:33.113098
| 2018-01-24T07:35:45
| 2018-01-24T07:35:45
| 80,637,392
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 2,708
|
java
|
/*************************************************************************
*
* DATASCIENCE9 LLC CONFIDENTIAL
* __________________
*
* [2018] Datascience9 LLC
* All Rights Reserved.
*
* NOTICE: All information contained herein is, and remains
* the property of Datascience9 LLC and its suppliers,
* if any. The intellectual and technical concepts contained
* herein are proprietary to Datascience9 LLC
* and its suppliers and may be covered by U.S. and Foreign Patents,
* patents in process, and are protected by trade secret or copyright law.
* Dissemination of this information or reproduction of this material
* is strictly forbidden unless prior written permission is obtained
* from Datascience9 LLC.
* @author Paul Mai - Datascience9 LLC
*/
package com.opencart.design;
import java.util.List;
import javax.inject.Inject;
import static java.util.Objects.requireNonNull;
import javax.persistence.EntityManager;
import javax.persistence.Query;
import com.opencart.entity.*;
import com.google.inject.Provider;
import java.util.stream.Collectors;
import com.opencart.util.DaoUtils;
/**
* auto generated from SQL
*/
public class ModelDesignLayoutDaoImpl implements ModelDesignLayoutDao {
private final Provider<EntityManager> entityManagerProvider;
@Inject
protected ModelDesignLayoutDaoImpl(final Provider<EntityManager> entityManagerProvider) {
requireNonNull(entityManagerProvider);
this.entityManagerProvider = entityManagerProvider;
}
/* *
* ModelDesignLayout.getLayout.getLayout
* SELECT a FROM oc_layout_route a WHERE 'param0' LIKE route AND store_id = 'param1' ORDER BY route DESC LIMIT 1
*/
@Override
public List<OcLayoutRoute> getLayout(Integer store_id) {
final EntityManager em = entityManagerProvider.get();
final String queryName = DaoUtils.getQuery("ModelDesignLayout.getLayout.getLayout");
final Query query = em.createNativeQuery(queryName, OcLayoutRoute.class);
query.setParameter("store_id", store_id);
return query.getResultList();
}
/* *
* ModelDesignLayout.getLayoutModules.getLayoutModules
* SELECT a FROM oc_layout_module a WHERE layout_id = 'param0' AND position = 'param1' ORDER BY sort_order
*/
@Override
public List<OcLayoutModule> getLayoutModules(Integer layout_id,String position) {
final EntityManager em = entityManagerProvider.get();
final String queryName = DaoUtils.getQuery("ModelDesignLayout.getLayoutModules.getLayoutModules");
final Query query = em.createNativeQuery(queryName, OcLayoutModule.class);
query.setParameter("layout_id", layout_id);
query.setParameter("position", position);
return query.getResultList();
}
}
|
[
"gmai2006@gmail.com"
] |
gmai2006@gmail.com
|
efee7c4a63928fedbb7de582cce516da3c20e32c
|
3f954c0b777cecfff80623c87bd4291292167afc
|
/src/workbench/db/sqltemplates/FkTemplate.java
|
52b32973fe6fcbc5d2b2fe4899780cb50dc453a5
|
[] |
no_license
|
zippy1981/SqlWorkbenchJ
|
67ba4dca04fb9ee69ca0992032c6ddfb69614f60
|
7b246fb0dadd6b5c47900dcbb2298cc5f0143b77
|
refs/heads/master
| 2021-01-10T01:47:54.963813
| 2016-02-14T23:14:10
| 2016-02-14T23:14:10
| 45,090,119
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 1,782
|
java
|
/*
* FkTemplate.java
*
* This file is part of SQL Workbench/J, http://www.sql-workbench.net
*
* Copyright 2002-2016, Thomas Kellerer
*
* Licensed under a modified Apache License, Version 2.0
* that restricts the use for certain governments.
* You may not use this file except in compliance with the License.
* You may obtain a copy of the License at.
*
* http://sql-workbench.net/manual/license.html
*
* 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.
*
* To contact the author please send an email to: support@sql-workbench.net
*
*/
package workbench.db.sqltemplates;
/**
*
* @author Thomas Kellerer
*/
public class FkTemplate
extends TemplateHandler
{
private final String defaultSQL =
"ALTER TABLE %table_name%\n" +
" ADD CONSTRAINT %constraint_name% FOREIGN KEY (%columnlist%)\n" +
" REFERENCES %targettable% (%targetcolumnlist%)\n" +
" %fk_update_rule%\n" +
" %fk_delete_rule%\n" +
" %deferrable%";
private final String defaultInlineSQL =
"CONSTRAINT %constraint_name% FOREIGN KEY (%columnlist%) REFERENCES %targettable% (%targetcolumnlist%)\n" +
" %fk_update_rule%%fk_delete_rule% %deferrable%";
private String sql;
public FkTemplate(String dbid, boolean forInlineUse)
{
if (forInlineUse)
{
this.sql = getStringProperty("workbench.db." + dbid + ".fk.inline.sql", defaultInlineSQL);
}
else
{
this.sql = getStringProperty("workbench.db." + dbid + ".fk.sql", defaultSQL);
}
}
public String getSQLTemplate()
{
return sql;
}
}
|
[
"tkellerer@6c36a7f0-0884-4472-89c7-80b7fa7b7f28"
] |
tkellerer@6c36a7f0-0884-4472-89c7-80b7fa7b7f28
|
22a8fc76f3006d7891c1bd205b8a160007172918
|
6bcae0ccde174ecd90db7574eb89e641bf33966c
|
/src/main/java/eu/mihosoft/ext/j3d/javax/media/j3d/BehaviorScheduler.java
|
d1759787ae724b12f3821b3c8e6238ed619da83e
|
[] |
no_license
|
miho/ExtJ3D
|
addf6cc4f3b49af2bbb7deed42abc4d6c2ad067c
|
87a1fce815e656dba4d3ee3744d35365932e622c
|
refs/heads/master
| 2021-01-10T06:31:07.107446
| 2016-02-17T18:49:00
| 2016-02-17T18:49:07
| 51,943,509
| 1
| 1
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 6,997
|
java
|
/*
* Copyright 1997-2008 Sun Microsystems, Inc. All Rights Reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Sun designates this
* particular file as subject to the "Classpath" exception as provided
* by Sun in the LICENSE file that accompanied this code.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
* CA 95054 USA or visit www.sun.com if you need additional information or
* have any questions.
*
*/
package eu.mihosoft.ext.j3d.javax.media.j3d;
import java.util.logging.Level;
class BehaviorScheduler extends J3dThread {
/**
* The virtual universe that owns this BehaviorScheduler
*/
VirtualUniverse univ = null;
// reference to behaviourStructure processList
UnorderList processList[];
// reference to scheduleList;
IndexedUnorderSet scheduleList;
// reference to universe.behaviorStructure
BehaviorStructure behaviorStructure;
// A count for BehaviorScheduler start/stop
int stopCount = -1;
/**
* These are used for start/stop BehaviorScheduler
*/
long lastStartTime;
long lastStopTime;
// lock to ensure consistency of interval values read
Object intervalTimeLock = new Object();
/**
* Some variables used to name threads correctly
*/
private static int numInstances = 0;
private int instanceNum = -1;
private synchronized int newInstanceNum() {
return (++numInstances);
}
@Override
int getInstanceNum() {
if (instanceNum == -1)
instanceNum = newInstanceNum();
return instanceNum;
}
BehaviorScheduler(ThreadGroup t, VirtualUniverse universe) {
super(t);
setName("J3D-BehaviorScheduler-" + getInstanceNum());
this.univ = universe;
behaviorStructure = universe.behaviorStructure;
scheduleList = behaviorStructure.scheduleList;
processList = behaviorStructure.processList;
type = J3dThread.BEHAVIOR_SCHEDULER;
}
void stopBehaviorScheduler(long[] intervalTime) {
stopCount = 2;
VirtualUniverse.mc.sendRunMessage(univ, J3dThread.BEHAVIOR_SCHEDULER);
while (!userStop ) {
MasterControl.threadYield();
}
synchronized (intervalTimeLock) {
intervalTime[0] = lastStartTime;
intervalTime[1] = lastStopTime;
}
}
void startBehaviorScheduler() {
// don't allow scheduler start until intervalTime is read
synchronized (intervalTimeLock) {
stopCount = -1;
userStop = false;
VirtualUniverse.mc.setWork();
}
}
void deactivate() {
active = false;
if (stopCount >= 0) {
userStop = true;
}
}
/**
* The main loop for the Behavior Scheduler.
* Main method for firing off vector of satisfied conditions that
* are contained in the condMet vector. Method is synchronized
* because it is modifying the current wakeup vectors in the
* clean (emptying out satisfied conditions) and processStimulus
* (adding conditions again if wakeupOn called) calls.
*/
@Override
void doWork(long referenceTime) {
BehaviorRetained arr[];
UnorderList list;
int i, size, interval;
lastStartTime = J3dClock.currentTimeMillis();
if (stopCount >= 0) {
VirtualUniverse.mc.sendRunMessage(univ, J3dThread.BEHAVIOR_SCHEDULER);
if (--stopCount == 0) {
userStop = true;
}
}
for (interval = 0;
interval < BehaviorRetained.NUM_SCHEDULING_INTERVALS;
interval++) {
list = processList[interval];
if (list.isEmpty()) {
continue;
}
arr = (BehaviorRetained []) list.toArray(false);
size = list.arraySize();
for (i = 0; i < size ; i++) {
BehaviorRetained behavret = arr[i];
synchronized (behavret) {
Behavior behav = (Behavior) behavret.source;
if (!behav.isLive() ||
!behavret.conditionSet ||
(behavret.wakeupCondition == null)) {
continue;
}
if (behavret.wakeupCondition.trigEnum == null) {
behavret.wakeupCondition.trigEnum =
new WakeupCriteriaEnumerator(behavret.wakeupCondition,
WakeupCondition.TRIGGERED_ELEMENTS);
} else {
behavret.wakeupCondition.trigEnum.reset(
behavret.wakeupCondition,
WakeupCondition.TRIGGERED_ELEMENTS);
}
// BehaviorRetained now cache the old
// wakeupCondition in order to
// reuse it without the heavyweight cleanTree()
// behavret.wakeupCondition.cleanTree();
behavret.conditionSet = false;
WakeupCondition wakeupCond = behavret.wakeupCondition;
synchronized (behavret) {
behavret.inCallback = true;
univ.inBehavior = true;
try {
behav.processStimulus(wakeupCond.trigEnum);
}
catch (RuntimeException e) {
// Force behavior condition to be unset
// Issue 21: don't call cleanTree here
behavret.conditionSet = false;
System.err.println("Exception occurred during Behavior execution:");
e.printStackTrace();
}
catch (Error e) {
// Force behavior condition to be unset
// Fix for issue 264
behavret.conditionSet = false;
System.err.println("Error occurred during Behavior execution:");
e.printStackTrace();
}
univ.inBehavior = false;
behavret.inCallback = false;
}
// note that if the behavior wasn't reset, we need to make the
// wakeupcondition equal to null
if (behavret.conditionSet == false) {
if (wakeupCond != null) {
wakeupCond.cleanTree(behaviorStructure);
}
behavret.wakeupCondition = null;
behavret.active = false;
scheduleList.remove(behavret);
} else {
behavret.handleLastWakeupOn(wakeupCond,
behaviorStructure);
}
}
}
list.clear();
}
behaviorStructure.handleAWTEvent();
behaviorStructure.handleBehaviorPost();
lastStopTime = J3dClock.currentTimeMillis();
if (MasterControl.isStatsLoggable(Level.FINE)) {
VirtualUniverse.mc.recordTime(MasterControl.TimeType.BEHAVIOR, (lastStopTime-lastStartTime)*1000000);
}
}
void free() {
behaviorStructure = null;
getThreadData(null, null).thread = null;
univ = null;
for (int i=BehaviorRetained.NUM_SCHEDULING_INTERVALS-1;
i >= 0; i--) {
processList[i].clear();
}
scheduleList.clear();
}
}
|
[
"info@michaelhoffer.de"
] |
info@michaelhoffer.de
|
aee0e27ee16be336ee579427de96be4a818052d9
|
86af6ce0c18700ad52fc2d46cefcf006a00f4631
|
/src/test/java/com/gok/ambulanceactivity/web/rest/errors/ExceptionTranslatorIT.java
|
e4fa705a8d00a0176090327c236ca3d3abc0de55
|
[] |
no_license
|
ArkapravoNath/ambulance-activity-
|
a4edecd4e8d86e3e25f5955b97af442757bdd88e
|
7f4f60996ff194a75a911a11090809216b252090
|
refs/heads/master
| 2022-12-05T19:10:09.446720
| 2020-08-27T03:21:56
| 2020-08-27T03:21:56
| 290,663,590
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 5,664
|
java
|
package com.gok.ambulanceactivity.web.rest.errors;
import com.gok.ambulanceactivity.AmbulanceactivityApp;
import com.gok.ambulanceactivity.config.TestSecurityConfiguration;
import org.junit.jupiter.api.Test;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.security.test.context.support.WithMockUser;
import org.springframework.boot.test.autoconfigure.web.servlet.AutoConfigureMockMvc;
import org.springframework.http.MediaType;
import org.springframework.test.web.servlet.MockMvc;
import static org.springframework.security.test.web.servlet.request.SecurityMockMvcRequestPostProcessors.csrf;
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.
*/
@WithMockUser
@AutoConfigureMockMvc
@SpringBootTest(classes = {AmbulanceactivityApp.class, TestSecurityConfiguration.class})
public class ExceptionTranslatorIT {
@Autowired
private MockMvc mockMvc;
@Test
public void testConcurrencyFailure() throws Exception {
mockMvc.perform(get("/api/exception-translator-test/concurrency-failure").with(csrf()))
.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("/api/exception-translator-test/method-argument").content("{}").contentType(MediaType.APPLICATION_JSON).with(csrf()))
.andExpect(status().isBadRequest())
.andExpect(content().contentType(MediaType.APPLICATION_PROBLEM_JSON))
.andExpect(jsonPath("$.message").value(ErrorConstants.ERR_VALIDATION))
.andExpect(jsonPath("$.fieldErrors.[0].objectName").value("test"))
.andExpect(jsonPath("$.fieldErrors.[0].field").value("test"))
.andExpect(jsonPath("$.fieldErrors.[0].message").value("NotNull"));
}
@Test
public void testMissingServletRequestPartException() throws Exception {
mockMvc.perform(get("/api/exception-translator-test/missing-servlet-request-part").with(csrf()))
.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("/api/exception-translator-test/missing-servlet-request-parameter").with(csrf()))
.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("/api/exception-translator-test/access-denied").with(csrf()))
.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("/api/exception-translator-test/unauthorized").with(csrf()))
.andExpect(status().isUnauthorized())
.andExpect(content().contentType(MediaType.APPLICATION_PROBLEM_JSON))
.andExpect(jsonPath("$.message").value("error.http.401"))
.andExpect(jsonPath("$.path").value("/api/exception-translator-test/unauthorized"))
.andExpect(jsonPath("$.detail").value("test authentication failed!"));
}
@Test
public void testMethodNotSupported() throws Exception {
mockMvc.perform(post("/api/exception-translator-test/access-denied").with(csrf()))
.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("/api/exception-translator-test/response-status").with(csrf()))
.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("/api/exception-translator-test/internal-server-error").with(csrf()))
.andExpect(status().isInternalServerError())
.andExpect(content().contentType(MediaType.APPLICATION_PROBLEM_JSON))
.andExpect(jsonPath("$.message").value("error.http.500"))
.andExpect(jsonPath("$.title").value("Internal Server Error"));
}
}
|
[
"nrko96@gmail.com"
] |
nrko96@gmail.com
|
7a18686d74ff57a457244803e885db332b021cd4
|
6f26913ae138e39a003f6dcc2b98f97f17f0da3b
|
/wffweb/src/main/java/com/webfirmframework/wffweb/server/page/AttributeAddListenerImpl.java
|
9f65785b154e304c977a913bf8f3cd93d554766b
|
[
"Apache-2.0"
] |
permissive
|
gitter-badger/wff
|
6264516af60736e21e4c17075d0ec3ecc3b1b01b
|
108a76bf18407d264d1b40b7a7e9cb188fb62fd2
|
refs/heads/master
| 2021-01-24T21:19:19.226465
| 2016-09-18T05:15:02
| 2016-09-18T05:15:02
| null | 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 3,866
|
java
|
/*
* Copyright 2014-2016 Web Firm Framework
*
* 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.webfirmframework.wffweb.server.page;
import com.webfirmframework.wffweb.tag.html.AbstractHtml;
import com.webfirmframework.wffweb.tag.html.attribute.core.AbstractAttribute;
import com.webfirmframework.wffweb.tag.html.listener.AttributeAddListener;
import com.webfirmframework.wffweb.util.WffBinaryMessageUtil;
import com.webfirmframework.wffweb.util.data.NameValue;
public class AttributeAddListenerImpl implements AttributeAddListener {
private static final long serialVersionUID = 1L;
private BrowserPage browserPage;
@SuppressWarnings("unused")
private AttributeAddListenerImpl() {
throw new AssertionError();
}
AttributeAddListenerImpl(final BrowserPage browserPage) {
this.browserPage = browserPage;
}
@Override
public void addedAttributes(final AddEvent event) {
// should always be taken from browserPage as it could be changed
final WebSocketPushListener wsListener = browserPage.getWsListener();
try {
if (wsListener != null) {
//@formatter:off
// removed attribute task format :-
// { "name": task_byte, "values" : [ADDED_ATTRIBUTES_byte_from_Task_enum]}, { "name": MANY_TO_ONE_byte, "values" : [ tagName, its_data-wff-id, attribute_name=value1, attribute_name2=value2 ]}
// { "name": 2, "values" : [[1]]}, { "name":[2], "values" : ["div", "C55", "style=color:green", "name=hello"]}
//@formatter:on
final NameValue task = Task.ADDED_ATTRIBUTES.getTaskNameValue();
final NameValue nameValue = new NameValue();
// many attributes to one tag
nameValue.setName(Task.MANY_TO_ONE.getValueByte());
final AbstractHtml addedToTag = event.getAddedToTag();
final byte[][] tagNameAndWffId = DataWffIdUtil
.getTagNameAndWffId(addedToTag);
final AbstractAttribute[] addedAttributes = event
.getAddedAttributes();
final int totalValues = addedAttributes.length + 2;
final byte[][] values = new byte[totalValues][0];
values[0] = tagNameAndWffId[0];
values[1] = tagNameAndWffId[1];
for (int i = 2; i < totalValues; i++) {
// should be name=somevalue
String attrNameValue = addedAttributes[i - 2]
.toHtmlString("UTF-8").replaceFirst("[=][\"]", "=");
if (attrNameValue
.charAt(attrNameValue.length() - 1) == '"') {
attrNameValue = attrNameValue.substring(0,
attrNameValue.length() - 1);
}
values[i] = attrNameValue.getBytes("UTF-8");
}
nameValue.setValues(values);
final byte[] wffBinaryMessageBytes = WffBinaryMessageUtil.VERSION_1
.getWffBinaryMessageBytes(task, nameValue);
wsListener.push(wffBinaryMessageBytes);
}
} catch (final Exception e) {
e.printStackTrace();
}
}
}
|
[
"webfirm.framework@gmail.com"
] |
webfirm.framework@gmail.com
|
b7004ef1be428057822e2f19030bc4c19db921ef
|
d93296f4b95e00c8a77c0141624bd85f47cb82dd
|
/nifty-controls-illarion/src/org/illarion/nifty/controls/MerchantListEntry.java
|
33d8b5bdbeb06b558ec4491fed6ca1254a064a33
|
[] |
no_license
|
odaymichael/Illarion-Java
|
cdfcbccc7758f91de04b805979a4916253e53cf1
|
4f050b153e683798b29f68ef0a6cddb0ada46c30
|
refs/heads/master
| 2021-01-24T00:24:38.889474
| 2013-09-29T06:39:49
| 2013-09-29T06:39:49
| 13,225,207
| 1
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 2,003
|
java
|
/*
* This file is part of the Illarion Nifty-GUI Controls.
*
* Copyright © 2012 - Illarion e.V.
*
* The Illarion Nifty-GUI Controls is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* The Illarion Nifty-GUI Controls is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with the Illarion Nifty-GUI Controls. If not, see <http://www.gnu.org/licenses/>.
*/
package org.illarion.nifty.controls;
import de.lessvoid.nifty.render.NiftyImage;
import illarion.common.types.ItemCount;
import illarion.common.types.Money;
import javax.annotation.Nonnull;
/**
* This interfaces defines a entry in the merchant dialog that contains one item to buy.
*
* @author Martin Karing <nitram@illarion.org>
*/
public interface MerchantListEntry {
/**
* Get the image that is supposed to be displayed in the entry.
*
* @return the nifty image to display
*/
@Nonnull
NiftyImage getItemImage();
/**
* Get the name of the item.
*
* @return the name of the item
*/
@Nonnull
String getName();
/**
* Get the price of the item.
*
* @return the price of the item
*/
@Nonnull
Money getPrice();
/**
* Get the bundle size of the item. This is only required for items that are sold by the NPC.
*
* @return the amount of items bought at once
*/
@Nonnull
ItemCount getBundleSize();
/**
* The index of the merchant item in the list as it was transferred from the server.
*
* @return the index
*/
int getIndex();
}
|
[
"nitram@illarion.org"
] |
nitram@illarion.org
|
2a9f83ac2a2c2f054c069dc5ff0da9a7f938dbca
|
ea96ec3f86907c89a3f6dc5d32d996eaa8a5f3e0
|
/MeettingSports/src/com/ms/service/impl/UserRoleServiceImpl.java
|
c49358e32240bb906ebbc74e7049843396f9678a
|
[] |
no_license
|
songp172009/MeettingSports
|
5474846496e62cc81f46b1248484189f88394f3c
|
62cbf9a6e092a71c3a88dd17bbec44585bc09b9f
|
refs/heads/master
| 2020-09-06T12:10:07.419493
| 2016-12-08T08:39:10
| 2016-12-08T08:39:10
| null | 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 134
|
java
|
package com.ms.service.impl;
import com.ms.service.UserRoleService;
public class UserRoleServiceImpl implements UserRoleService{
}
|
[
"jia_chao23@126.com"
] |
jia_chao23@126.com
|
d2846baa20f8b485f9e39db6a8ad204b7fbe20b5
|
c972865d316461eb6f9614758215ba95aebc596c
|
/blog-common/src/main/java/com/dragon/common/exception/file/FileNameLengthLimitExceededException.java
|
979ad6ab72f4f1b16540c652ecd5ec3705c34f12
|
[
"MIT"
] |
permissive
|
wenMN1994/my_blog
|
1863300650854cd964a59e7c62937fad661c5219
|
59ae75cf8d7392448e77799f9491618911479510
|
refs/heads/master
| 2023-05-31T00:07:44.475910
| 2023-05-07T06:56:27
| 2023-05-07T06:56:27
| 176,249,613
| 14
| 4
|
MIT
| 2023-02-23T03:03:59
| 2019-03-18T09:42:27
|
Java
|
UTF-8
|
Java
| false
| false
| 411
|
java
|
package com.dragon.common.exception.file;
/**
* 文件名称超长限制异常类
*
* @author dragon
*/
public class FileNameLengthLimitExceededException extends FileException {
private static final long serialVersionUID = 1L;
public FileNameLengthLimitExceededException(int defaultFileNameLength) {
super("upload.filename.exceed.length", new Object[] { defaultFileNameLength });
}
}
|
[
"18475536452@163.com"
] |
18475536452@163.com
|
d93931888f87c647d55116c66eddafe9fc018eee
|
28956a0d004113afc8312f729018b0529ad8294d
|
/jbpm-workitems/src/test/java/org/jbpm/process/workitem/parser/ParserWorkItemHandlerTest.java
|
8f2cc9b505a274ef42a377727a0c8f2655d2f87b
|
[
"Apache-2.0"
] |
permissive
|
marianbuenosayres/jbpm
|
ffeb41b604a403863c9524bb5097186c7debd8b0
|
708ea506daa5042493087ed3145bef0539b194cf
|
refs/heads/master
| 2021-01-12T13:10:57.025668
| 2016-10-26T14:26:21
| 2016-10-26T14:26:21
| 1,756,768
| 9
| 1
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 3,918
|
java
|
/*
* Copyright 2015 Red Hat, Inc. and/or its affiliates.
*
* 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.jbpm.process.workitem.parser;
import static org.junit.Assert.assertEquals;
import java.util.Map;
import org.drools.core.process.instance.impl.WorkItemImpl;
import org.junit.Before;
import org.junit.Test;
import org.kie.api.runtime.process.WorkItem;
import org.kie.api.runtime.process.WorkItemHandler;
import org.kie.api.runtime.process.WorkItemManager;
public class ParserWorkItemHandlerTest {
final int AGE = 27;
final String NAME = "William";
final String PERSON_XML = "<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?><person><age>"
+ AGE + "</age><name>" + NAME + "</name></person>";
final String PERSON_JSON = "{\"name\":\"" + NAME + "\",\"age\":" + AGE
+ "}";
ParserWorkItemHandler handler;
@Before
public void init() {
handler = new ParserWorkItemHandler();
}
@Test
public void testXmlToObject() {
WorkItemImpl workItem = new WorkItemImpl();
workItem.setParameter(ParserWorkItemHandler.INPUT, PERSON_XML);
workItem.setParameter(ParserWorkItemHandler.FORMAT, ParserWorkItemHandler.XML);
workItem.setParameter(ParserWorkItemHandler.TYPE,
"org.jbpm.process.workitem.parser.Person");
handler.executeWorkItem(workItem, new TestWorkItemManager(workItem));
Person result = (Person) workItem.getResult(ParserWorkItemHandler.RESULT);
assertEquals(AGE, result.getAge());
assertEquals(NAME, result.getName());
}
@Test
public void testObjectToXml() {
Person p = new Person(NAME, AGE);
WorkItemImpl workItem = new WorkItemImpl();
workItem.setParameter(ParserWorkItemHandler.INPUT, p);
workItem.setParameter(ParserWorkItemHandler.FORMAT, ParserWorkItemHandler.XML);
handler.executeWorkItem(workItem, new TestWorkItemManager(workItem));
String result = (String) workItem.getResult(ParserWorkItemHandler.RESULT);
assertEquals(PERSON_XML, result);
}
@Test
public void testJsonToObject() {
WorkItemImpl workItem = new WorkItemImpl();
workItem.setParameter(ParserWorkItemHandler.INPUT, PERSON_JSON);
workItem.setParameter(ParserWorkItemHandler.FORMAT, ParserWorkItemHandler.JSON);
workItem.setParameter(ParserWorkItemHandler.TYPE,
"org.jbpm.process.workitem.parser.Person");
handler.executeWorkItem(workItem, new TestWorkItemManager(workItem));
Person result = (Person) workItem.getResult(ParserWorkItemHandler.RESULT);
assertEquals(AGE, result.getAge());
assertEquals(NAME, result.getName());
}
@Test
public void testObjectToJson() {
Person p = new Person(NAME, AGE);
WorkItemImpl workItem = new WorkItemImpl();
workItem.setParameter(ParserWorkItemHandler.INPUT, p);
workItem.setParameter(ParserWorkItemHandler.FORMAT, ParserWorkItemHandler.JSON);
handler.executeWorkItem(workItem, new TestWorkItemManager(workItem));
String result = (String) workItem.getResult(ParserWorkItemHandler.RESULT);
assertEquals(PERSON_JSON, result);
}
private class TestWorkItemManager implements WorkItemManager {
private WorkItem workItem;
TestWorkItemManager(WorkItem workItem) {
this.workItem = workItem;
}
public void completeWorkItem(long id, Map<String, Object> results) {
((WorkItemImpl) workItem).setResults(results);
}
public void abortWorkItem(long id) {
}
public void registerWorkItemHandler(String workItemName,
WorkItemHandler handler) {
}
}
}
|
[
"mswiders@redhat.com"
] |
mswiders@redhat.com
|
e96155e620d83d292377335bc5d35696cd9124ea
|
a672792f32dbfd8ff405193e8d850244e795e17e
|
/modules/utils/src/main/java/org/springside/modules/utils/base/BooleanUtil.java
|
bc6ac32327c16e4a10377fe89d8c5c3aa4473340
|
[
"Apache-2.0"
] |
permissive
|
starcloudmountain/springside4
|
4822255fc33efd75fa332db285e8547267aaab12
|
ef0c820b143fe43f050129d3780cf197deaa3aae
|
refs/heads/master
| 2021-01-17T17:37:38.205821
| 2019-04-28T15:35:48
| 2019-04-28T15:35:48
| 95,531,304
| 1
| 0
|
Apache-2.0
| 2019-04-28T15:35:49
| 2017-06-27T07:40:24
|
Java
|
UTF-8
|
Java
| false
| false
| 1,882
|
java
|
package org.springside.modules.utils.base;
import org.apache.commons.lang3.BooleanUtils;
/**
* 1. 从String(true/false, yes/no),转换为Boolean或boolean
*
* 2. 逻辑运算:取反,多个boolean的and,or 计算
*
* 封装 {@code org.apache.commons.lang3.BooleanUtils}
*/
public class BooleanUtil {
/**
* 使用标准JDK,只分析是否忽略大小写的"true", str为空时返回false
*/
public static boolean toBoolean(String str) {
return Boolean.parseBoolean(str);
}
/**
* 使用标准JDK,只分析是否忽略大小写的"true", str为空时返回null
*/
public static Boolean toBooleanObject(String str) {
return str != null ? Boolean.valueOf(str) : null;
}
/**
* 使用标准JDK,只分析是否忽略大小写的"true", str为空时返回defaultValue
*/
public static Boolean toBooleanObject(String str, Boolean defaultValue) {
return str != null ? Boolean.valueOf(str) : defaultValue;
}
/**
* 支持true/false, on/off, y/n, yes/no的转换, str为空或无法分析时返回null
*/
public static Boolean parseGeneralString(String str) {
return BooleanUtils.toBooleanObject(str);
}
/**
* 支持true/false,on/off, y/n, yes/no的转换, str为空或无法分析时返回defaultValue
*/
public static Boolean parseGeneralString(String str, Boolean defaultValue) {
return BooleanUtils.toBooleanDefaultIfNull(BooleanUtils.toBooleanObject(str), defaultValue);
}
/**
* 取反
*/
public static boolean negate(final boolean bool) {
return !bool;
}
/**
* 取反
*/
public static Boolean negate(final Boolean bool) {
return BooleanUtils.negate(bool);
}
/**
* 多个值的and
*/
public static boolean and(final boolean... array) {
return BooleanUtils.and(array);
}
/**
* 多个值的or
*/
public static boolean or(final boolean... array) {
return BooleanUtils.or(array);
}
}
|
[
"calvin.xiao@vipshop.com"
] |
calvin.xiao@vipshop.com
|
42bf4103ce0bb71577e2665a734ff3535bfbaf51
|
1415496f94592ba4412407b71dc18722598163dd
|
/doc/libjitisi/sources/org/jitsi/bouncycastle/pkcs/PKCS10CertificationRequestBuilder.java
|
5221ac12b502dc414328ab8259d3c0df2e6b7b99
|
[
"Apache-2.0"
] |
permissive
|
lhzheng880828/VOIPCall
|
ad534535869c47b5fc17405b154bdc651b52651b
|
a7ba25debd4bd2086bae2a48306d28c614ce0d4a
|
refs/heads/master
| 2021-07-04T17:25:21.953174
| 2020-09-29T07:29:42
| 2020-09-29T07:29:42
| 183,576,020
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 3,129
|
java
|
package org.jitsi.bouncycastle.pkcs;
import java.io.IOException;
import java.io.OutputStream;
import java.util.ArrayList;
import java.util.List;
import org.jitsi.bouncycastle.asn1.ASN1Encodable;
import org.jitsi.bouncycastle.asn1.ASN1EncodableVector;
import org.jitsi.bouncycastle.asn1.ASN1ObjectIdentifier;
import org.jitsi.bouncycastle.asn1.DERBitString;
import org.jitsi.bouncycastle.asn1.DERSet;
import org.jitsi.bouncycastle.asn1.pkcs.Attribute;
import org.jitsi.bouncycastle.asn1.pkcs.CertificationRequest;
import org.jitsi.bouncycastle.asn1.pkcs.CertificationRequestInfo;
import org.jitsi.bouncycastle.asn1.x500.X500Name;
import org.jitsi.bouncycastle.asn1.x509.SubjectPublicKeyInfo;
import org.jitsi.bouncycastle.operator.ContentSigner;
public class PKCS10CertificationRequestBuilder {
private List attributes = new ArrayList();
private boolean leaveOffEmpty = false;
private SubjectPublicKeyInfo publicKeyInfo;
private X500Name subject;
public PKCS10CertificationRequestBuilder(X500Name x500Name, SubjectPublicKeyInfo subjectPublicKeyInfo) {
this.subject = x500Name;
this.publicKeyInfo = subjectPublicKeyInfo;
}
public PKCS10CertificationRequestBuilder addAttribute(ASN1ObjectIdentifier aSN1ObjectIdentifier, ASN1Encodable aSN1Encodable) {
this.attributes.add(new Attribute(aSN1ObjectIdentifier, new DERSet(aSN1Encodable)));
return this;
}
public PKCS10CertificationRequestBuilder addAttribute(ASN1ObjectIdentifier aSN1ObjectIdentifier, ASN1Encodable[] aSN1EncodableArr) {
this.attributes.add(new Attribute(aSN1ObjectIdentifier, new DERSet(aSN1EncodableArr)));
return this;
}
public PKCS10CertificationRequest build(ContentSigner contentSigner) {
CertificationRequestInfo certificationRequestInfo;
if (this.attributes.isEmpty()) {
certificationRequestInfo = this.leaveOffEmpty ? new CertificationRequestInfo(this.subject, this.publicKeyInfo, null) : new CertificationRequestInfo(this.subject, this.publicKeyInfo, new DERSet());
} else {
ASN1EncodableVector aSN1EncodableVector = new ASN1EncodableVector();
for (Object instance : this.attributes) {
aSN1EncodableVector.add(Attribute.getInstance(instance));
}
certificationRequestInfo = new CertificationRequestInfo(this.subject, this.publicKeyInfo, new DERSet(aSN1EncodableVector));
}
try {
OutputStream outputStream = contentSigner.getOutputStream();
outputStream.write(certificationRequestInfo.getEncoded("DER"));
outputStream.close();
return new PKCS10CertificationRequest(new CertificationRequest(certificationRequestInfo, contentSigner.getAlgorithmIdentifier(), new DERBitString(contentSigner.getSignature())));
} catch (IOException e) {
throw new IllegalStateException("cannot produce certification request signature");
}
}
public PKCS10CertificationRequestBuilder setLeaveOffEmptyAttributes(boolean z) {
this.leaveOffEmpty = z;
return this;
}
}
|
[
"lhzheng@grandstream.cn"
] |
lhzheng@grandstream.cn
|
c9e711c93e768c2859c23e58c854c95669e41da2
|
2e29864b60d1101a879e646b9a4164f41cbfd9eb
|
/src/main/java/biomes/ColdDesert.java
|
9944dd5216339acb0d23d904b2460e4a12b81da5
|
[] |
no_license
|
alphawolf918/Mega-Biomes
|
7e07331e895c85751d3884305a9a5edcc0da115c
|
11910b2a006b48f069afa4e30c12de36704387db
|
refs/heads/master
| 2021-01-25T08:55:24.271271
| 2014-09-06T18:42:51
| 2014-09-06T18:42:51
| null | 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 1,109
|
java
|
package biomemod.biomes;
import net.minecraft.world.biome.BiomeGenBase;
import biomemod.blocks.Blocks;
public class ColdDesert extends BiomeGenBase {
public ColdDesert(int par1){
super(par1);
this.waterColorMultiplier = 0x0099ff;
this.setBiomeName("Cold Desert");
this.setColor(Biomes.biomeColor);
this.setEnableSnow();
this.temperature = 0F;
this.rainfall = 0.5F;
this.spawnableCreatureList.clear();
this.spawnableMonsterList.clear();
this.theBiomeDecorator.generateLakes = true;
this.theBiomeDecorator.sandPerChunk = -999;
this.theBiomeDecorator.sandPerChunk2 = -999;
this.theBiomeDecorator.mushroomsPerChunk = -999;
this.theBiomeDecorator.clayPerChunk = -999;
this.theBiomeDecorator.deadBushPerChunk = -999;
this.theBiomeDecorator.cactiPerChunk = -999;
this.theBiomeDecorator.mushroomsPerChunk = -999;
this.theBiomeDecorator.grassPerChunk = -999;
this.theBiomeDecorator.flowersPerChunk = -999;
this.theBiomeDecorator.treesPerChunk = -999;
this.topBlock = (byte) Blocks.coldSandBlock.blockID;
this.fillerBlock = (byte) Blocks.coldSandSmoothBlock.blockID;
}
}
|
[
"ferrariman91890@gmail.com"
] |
ferrariman91890@gmail.com
|
71890f916b1436b819d2bf56eeca3d21c9eb8f36
|
5d886e65dc224924f9d5ef4e8ec2af612529ab93
|
/sources/com/android/keyguard/clock/ClockManager_Factory.java
|
fe5444ae5a8edc8760693886bd6f7da3f69b7fd0
|
[] |
no_license
|
itz63c/SystemUIGoogle
|
99a7e4452a8ff88529d9304504b33954116af9ac
|
f318b6027fab5deb6a92e255ea9b26f16e35a16b
|
refs/heads/master
| 2022-05-27T16:12:36.178648
| 2020-04-30T04:21:56
| 2020-04-30T04:21:56
| 260,112,526
| 3
| 1
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 2,759
|
java
|
package com.android.keyguard.clock;
import android.content.Context;
import com.android.systemui.broadcast.BroadcastDispatcher;
import com.android.systemui.colorextraction.SysuiColorExtractor;
import com.android.systemui.dock.DockManager;
import com.android.systemui.shared.plugins.PluginManager;
import com.android.systemui.util.InjectionInflationController;
import dagger.internal.Factory;
import javax.inject.Provider;
public final class ClockManager_Factory implements Factory<ClockManager> {
private final Provider<BroadcastDispatcher> broadcastDispatcherProvider;
private final Provider<SysuiColorExtractor> colorExtractorProvider;
private final Provider<Context> contextProvider;
private final Provider<DockManager> dockManagerProvider;
private final Provider<InjectionInflationController> injectionInflaterProvider;
private final Provider<PluginManager> pluginManagerProvider;
public ClockManager_Factory(Provider<Context> provider, Provider<InjectionInflationController> provider2, Provider<PluginManager> provider3, Provider<SysuiColorExtractor> provider4, Provider<DockManager> provider5, Provider<BroadcastDispatcher> provider6) {
this.contextProvider = provider;
this.injectionInflaterProvider = provider2;
this.pluginManagerProvider = provider3;
this.colorExtractorProvider = provider4;
this.dockManagerProvider = provider5;
this.broadcastDispatcherProvider = provider6;
}
public ClockManager get() {
return provideInstance(this.contextProvider, this.injectionInflaterProvider, this.pluginManagerProvider, this.colorExtractorProvider, this.dockManagerProvider, this.broadcastDispatcherProvider);
}
public static ClockManager provideInstance(Provider<Context> provider, Provider<InjectionInflationController> provider2, Provider<PluginManager> provider3, Provider<SysuiColorExtractor> provider4, Provider<DockManager> provider5, Provider<BroadcastDispatcher> provider6) {
ClockManager clockManager = new ClockManager((Context) provider.get(), (InjectionInflationController) provider2.get(), (PluginManager) provider3.get(), (SysuiColorExtractor) provider4.get(), (DockManager) provider5.get(), (BroadcastDispatcher) provider6.get());
return clockManager;
}
public static ClockManager_Factory create(Provider<Context> provider, Provider<InjectionInflationController> provider2, Provider<PluginManager> provider3, Provider<SysuiColorExtractor> provider4, Provider<DockManager> provider5, Provider<BroadcastDispatcher> provider6) {
ClockManager_Factory clockManager_Factory = new ClockManager_Factory(provider, provider2, provider3, provider4, provider5, provider6);
return clockManager_Factory;
}
}
|
[
"itz63c@statixos.com"
] |
itz63c@statixos.com
|
3823fcdc9d8fdccbb03698956cfd70f472b2ab2a
|
35cba28238fbedb9e8c1edb44ab265fc2d9e0ecd
|
/android/support/v4/app/SuperNotCalledException.java
|
722d8210f982e46c4d4902470ec3a52e323c0ab6
|
[] |
no_license
|
delco225/Djassa
|
27bcd7139b06a2a46d9c09f7b2fd9e5df3fd2349
|
0434c26fd5b9039f2e0a4bf8c023c6a8b5024341
|
refs/heads/master
| 2016-09-06T18:12:17.167100
| 2015-02-08T14:24:33
| 2015-02-08T14:24:33
| 30,485,109
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 475
|
java
|
package android.support.v4.app;
import android.util.AndroidRuntimeException;
final class SuperNotCalledException
extends AndroidRuntimeException
{
public SuperNotCalledException(String paramString)
{
super(paramString);
}
}
/* Location: C:\Users\delco\Desktop\projet_S4\test\src\dex2jar-0.0.7.7-SNAPSHOT\classes_dex2jar.jar
* Qualified Name: android.support.v4.app.SuperNotCalledException
* JD-Core Version: 0.7.0.1
*/
|
[
"ahoussi.say@telecom-bretagne.eu"
] |
ahoussi.say@telecom-bretagne.eu
|
e4c55926a7c1641eb67ebf0f3440579a23777115
|
800fe8fecebe32268f6f6492ed4856f0d539d7ea
|
/src/main/java/au/gov/nehta/model/cda/common/code/SNOMEDCode.java
|
5edbeb4b81f03e52da61b12c254e483ae5cf531b
|
[
"LicenseRef-scancode-unknown-license-reference",
"Apache-2.0",
"BSD-2-Clause"
] |
permissive
|
AuDigitalHealth/clinical-document-library-java
|
6c1199a287cd8701a21bfa81a1f56e44d3bdca74
|
217483c9a2dc18aa7aa262bb22a7175888550839
|
refs/heads/master
| 2021-07-25T04:32:21.870575
| 2021-07-19T06:08:05
| 2021-07-19T06:08:05
| 197,092,272
| 6
| 5
|
NOASSERTION
| 2021-02-04T03:12:55
| 2019-07-16T00:37:05
|
XSLT
|
UTF-8
|
Java
| false
| false
| 887
|
java
|
package au.gov.nehta.model.cda.common.code;
public class SNOMEDCode extends CodeImpl implements Code {
public static final String SNOMED_CODE_SYSTEM = "2.16.840.1.113883.6.96" ;
public static final String SNOMED_CODE_SYSTEM_NAME = "SNOMED CT" ;
// public static final String SNOMED_CODE_SYSTEM_VERSION = "20101130" ;
private String codeSystemVersion;
public SNOMEDCode(String code, String displayName){
super(code);
setCodeSystem( SNOMED_CODE_SYSTEM );
setCodeSystemName( SNOMED_CODE_SYSTEM_NAME );
setDisplayName( displayName );
}
public SNOMEDCode(String code){
this(code, null);
}
public String getCodeSystemVersion() {
return codeSystemVersion;
}
public void setCodeSystemVersion( String codeSystemVersion ) {
this.codeSystemVersion = codeSystemVersion;
}
}
|
[
"philip.wilford@digitalhealth.gov.au"
] |
philip.wilford@digitalhealth.gov.au
|
65dfca0fde688d0a576cf21257daa048bc2e9338
|
ad03831bf431ed73f01b35abd088f36d0dc821e5
|
/app/src/main/java/com/example/roomwordsamplejavaapi28/WordViewModel.java
|
c94bdbb69ad73dc1e0220eca6f26860688dff437
|
[] |
no_license
|
qq343852323/RoomWordSampleJavaAPI28
|
36620546c582fca298a5ceb5140c262025b46b88
|
77179190136afcf9b31cf23cbf519930e503fdf6
|
refs/heads/master
| 2023-06-17T12:17:09.798190
| 2021-06-24T21:06:23
| 2021-06-24T21:06:23
| 380,050,286
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 650
|
java
|
package com.example.roomwordsamplejavaapi28;
import android.app.Application;
import androidx.lifecycle.AndroidViewModel;
import androidx.lifecycle.LiveData;
import java.util.List;
public class WordViewModel extends AndroidViewModel {
private WordRepository mRepository;
private final LiveData<List<Word>> mAllWords;
public WordViewModel (Application application) {
super(application);
mRepository = new WordRepository(application);
mAllWords = mRepository.getAllWords();
}
LiveData<List<Word>> getAllWords() { return mAllWords; }
public void insert(Word word) { mRepository.insert(word); }
}
|
[
"-"
] |
-
|
1fdd15b7e60c94e7a7b0441aaa930dd2dc0fe71c
|
8ca8e680781b5684de6fdcc280d7581185beb8c9
|
/hx-ngt-dev/src/main/java/com/huaxing/vo/MeterreadingMissionVO.java
|
820ac38ba36145db5281b19cd0b6a356670cf2d4
|
[] |
no_license
|
zhao2198/sale
|
ceca6390ac6ff989e80b02af0e1be90d7255021b
|
883b5060301ccaaeb3d8b33610661ca1979870dc
|
refs/heads/master
| 2020-05-19T12:05:46.934562
| 2019-05-05T09:22:17
| 2019-05-05T09:22:17
| 185,006,541
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 2,136
|
java
|
package com.huaxing.vo;
import java.math.BigDecimal;
import java.util.Date;
import com.huaxing.bean.MeterreadingMission;
import com.huaxing.common.web.transfer.TransferObject;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
/**
* 抄表任务表; InnoDB free: 8192 kB
*
* @author zhao wei
* @date 2018-07-18 09:07:19
*/
@ApiModel(value = "抄表任务表; InnoDB free: 8192 kB")
@Data
@EqualsAndHashCode(callSuper = false)
public class MeterreadingMissionVO extends TransferObject<MeterreadingMission> {
private static final long serialVersionUID = 1L;
//主键
@ApiModelProperty(value = "主键", required = false)
private String id;
//表计ID
@ApiModelProperty(value = "表计ID", required = false)
private String meterId;
//时间点(从0000-1230前面两位代表整点,后面两位00代表整点30代表整半)
@ApiModelProperty(value = "时间点(从0000-1230前面两位代表整点,后面两位00代表整点30代表整半)", required = false)
private String time;
//所属日期
@ApiModelProperty(value = "所属日期", required = false)
private Date day;
//表数
@ApiModelProperty(value = "表数", required = false)
private BigDecimal value;
//抄表人ID
@ApiModelProperty(value = "抄表人ID", required = false)
private String handlerId;
//抄表人员IDS
@ApiModelProperty(value = "抄表人员IDS", required = false)
private String handlerIds;
//状态位(0等待填写数据 1已经填写数据等待提交 2已经提交)
@ApiModelProperty(value = "状态位(0等待填写数据 1已经填写数据等待提交 2已经提交)", required = false)
private String state;
//创建者
@ApiModelProperty(value = "创建者", required = false)
private String createBy;
//创建时间
@ApiModelProperty(value = "创建时间", required = false)
private Date createDate;
//更新时间
@ApiModelProperty(value = "更新时间", required = false)
private Date updateDate;
//备注信息
@ApiModelProperty(value = "备注信息", required = false)
private String memo;
}
|
[
"zhaowei@sancaijia.com"
] |
zhaowei@sancaijia.com
|
b63837d68c04da58677b266f28848335b7a96915
|
e77f871556aae705662d2461faf8d5f71712a07c
|
/spring-cloud/lesson-8/spring-cloud-lesson-8/user-service-provider/src/main/java/com/segumentfault/spring/cloud/lesson8/user/service/web/controller/UserServiceProviderController.java
|
941f9dd5c16e368799614f4e3476b82af3f9a0a5
|
[] |
no_license
|
jaycekon/segmentfault-lessons
|
9225bdc2a262bb630e44643f8e6e51c24d742453
|
eaad5ccc631839ec534264adaccf59c3a0c3c9cd
|
refs/heads/master
| 2021-05-07T03:07:21.386398
| 2019-05-17T08:14:27
| 2019-05-17T08:14:27
| 110,628,668
| 1
| 1
| null | 2019-05-17T08:14:29
| 2017-11-14T02:17:24
|
Java
|
UTF-8
|
Java
| false
| false
| 2,110
|
java
|
package com.segumentfault.spring.cloud.lesson8.user.service.web.controller;
import com.netflix.hystrix.contrib.javanica.annotation.HystrixCommand;
import com.netflix.hystrix.contrib.javanica.annotation.HystrixProperty;
import com.segumentfault.spring.cloud.lesson8.api.UserService;
import com.segumentfault.spring.cloud.lesson8.domain.User;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;
import java.util.Collection;
import java.util.Collections;
import java.util.Random;
/**
* 用户服务提供方 Controller
*
* @author <a href="mailto:mercyblitz@gmail.com">Mercy</a>
* @since 0.0.1
*/
@RestController
public class UserServiceProviderController {
@Autowired
private UserService userService;
private final static Random random = new Random();
@PostMapping("/user/save")
public boolean saveUser(@RequestBody User user) {
return userService.saveUser(user);
}
/**
* 获取所有用户列表
*
* @return
*/
@HystrixCommand(
commandProperties = { // Command 配置
// 设置操作时间为 100 毫秒
@HystrixProperty(name = "execution.isolation.thread.timeoutInMilliseconds", value = "100")
},
fallbackMethod = "fallbackForGetUsers" // 设置 fallback 方法
)
@GetMapping("/user/list")
public Collection<User> getUsers() throws InterruptedException {
long executeTime = random.nextInt(200);
// 通过休眠来模拟执行时间
System.out.println("Execute Time : " + executeTime + " ms");
Thread.sleep(executeTime);
return userService.findAll();
}
/**
* {@link #getUsers()} 的 fallback 方法
*
* @return 空集合
*/
public Collection<User> fallbackForGetUsers() {
return Collections.emptyList();
}
}
|
[
"mercyblitz@gmail.com"
] |
mercyblitz@gmail.com
|
6e289da6e6c80b09d1d494b0f3e38ad309408acc
|
f2b6d20a53b6c5fb451914188e32ce932bdff831
|
/src/com/google/android/gms/internal/zzsq.java
|
70dd4caa0af35e9436342254d0b7997e3d260b54
|
[] |
no_license
|
reverseengineeringer/com.linkedin.android
|
08068c28267335a27a8571d53a706604b151faee
|
4e7235e12a1984915075f82b102420392223b44d
|
refs/heads/master
| 2021-04-09T11:30:00.434542
| 2016-07-21T03:54:43
| 2016-07-21T03:54:43
| 63,835,028
| 3
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 3,713
|
java
|
package com.google.android.gms.internal;
public final class zzsq
implements Cloneable
{
static final zzsr zzbum = new zzsr();
int mSize;
boolean zzbun = false;
int[] zzbuo;
zzsr[] zzbup;
zzsq()
{
this(10);
}
private zzsq(int paramInt)
{
paramInt = idealIntArraySize(paramInt);
zzbuo = new int[paramInt];
zzbup = new zzsr[paramInt];
mSize = 0;
}
static int idealIntArraySize(int paramInt)
{
int j = paramInt * 4;
paramInt = 4;
for (;;)
{
int i = j;
if (paramInt < 32)
{
if (j <= (1 << paramInt) - 12) {
i = (1 << paramInt) - 12;
}
}
else {
return i / 4;
}
paramInt += 1;
}
}
public final boolean equals(Object paramObject)
{
if (paramObject == this) {}
label71:
label93:
label131:
label138:
label141:
for (;;)
{
return true;
if (!(paramObject instanceof zzsq)) {
return false;
}
paramObject = (zzsq)paramObject;
if (size() != ((zzsq)paramObject).size()) {
return false;
}
Object localObject = zzbuo;
int[] arrayOfInt = zzbuo;
int j = mSize;
int i = 0;
if (i < j) {
if (localObject[i] != arrayOfInt[i])
{
i = 0;
if (i != 0)
{
localObject = zzbup;
paramObject = zzbup;
j = mSize;
i = 0;
if (i >= j) {
break label138;
}
if (localObject[i].equals(paramObject[i])) {
break label131;
}
}
}
}
for (i = 0;; i = 1)
{
if (i != 0) {
break label141;
}
return false;
i += 1;
break;
i = 1;
break label71;
i += 1;
break label93;
}
}
}
final void gc()
{
int m = mSize;
int[] arrayOfInt = zzbuo;
zzsr[] arrayOfzzsr = zzbup;
int i = 0;
int k;
for (int j = 0; i < m; j = k)
{
zzsr localzzsr = arrayOfzzsr[i];
k = j;
if (localzzsr != zzbum)
{
if (i != j)
{
arrayOfInt[j] = arrayOfInt[i];
arrayOfzzsr[j] = localzzsr;
arrayOfzzsr[i] = null;
}
k = j + 1;
}
i += 1;
}
zzbun = false;
mSize = j;
}
public final int hashCode()
{
if (zzbun) {
gc();
}
int j = 17;
int i = 0;
while (i < mSize)
{
j = (j * 31 + zzbuo[i]) * 31 + zzbup[i].hashCode();
i += 1;
}
return j;
}
public final boolean isEmpty()
{
return size() == 0;
}
final int size()
{
if (zzbun) {
gc();
}
return mSize;
}
public final zzsq zzJq()
{
int i = 0;
int j = size();
zzsq localzzsq = new zzsq(j);
System.arraycopy(zzbuo, 0, zzbuo, 0, j);
while (i < j)
{
if (zzbup[i] != null) {
zzbup[i] = zzbup[i].zzJr();
}
i += 1;
}
mSize = j;
return localzzsq;
}
final zzsr zzmG(int paramInt)
{
if (zzbun) {
gc();
}
return zzbup[paramInt];
}
final int zzmH(int paramInt)
{
int j = mSize;
int i = 0;
j -= 1;
while (i <= j)
{
int k = i + j >>> 1;
int m = zzbuo[k];
if (m < paramInt)
{
i = k + 1;
}
else
{
j = k;
if (m <= paramInt) {
return j;
}
j = k - 1;
}
}
j = i ^ 0xFFFFFFFF;
return j;
}
}
/* Location:
* Qualified Name: com.google.android.gms.internal.zzsq
* Java Class Version: 6 (50.0)
* JD-Core Version: 0.7.1
*/
|
[
"reverseengineeringer@hackeradmin.com"
] |
reverseengineeringer@hackeradmin.com
|
5343558953743866c9818bb9e1c9d553ae909d76
|
50285f056832e096d3c6ebbdd74c937d3e013e46
|
/2.JavaCore/src/com/codegym/task/task20/task2019/Solution.java
|
aa8a8fc820921bdf7c537a2fa71f1603e77391e4
|
[] |
no_license
|
KorwinBieniek/CodeGymTasks
|
e3001cc31f52b91f9ff444ffa0f1edcaeb1116d9
|
edcc22ddc544d6bb5a588f514c80fe959e641884
|
refs/heads/master
| 2023-06-05T18:11:34.801760
| 2021-06-19T06:29:54
| 2021-06-19T06:29:54
| 343,900,386
| 1
| 1
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 1,223
|
java
|
package com.codegym.task.task20.task2019;
import java.io.*;
import java.util.HashMap;
import java.util.Map;
/*
Correct the mistake. Serialization
*/
public class Solution implements Serializable {
public static void main(String args[]) throws Exception {
FileOutputStream fileOutput = new FileOutputStream("your.file.name");
ObjectOutputStream outputStream = new ObjectOutputStream(fileOutput);
Solution solution = new Solution();
outputStream.writeObject(solution);
fileOutput.close();
outputStream.close();
// Loading
FileInputStream fiStream = new FileInputStream("your.file.name");
ObjectInputStream objectStream = new ObjectInputStream(fiStream);
Solution loadedObject = (Solution) objectStream.readObject();
fiStream.close();
objectStream.close();
// Attention!!
System.out.println(loadedObject.size());
}
private Map<String, String> m = new HashMap<>();
public Map<String, String> getMap() {
return m;
}
public Solution() {
m.put("Mickey", "Mouse");
m.put("Mickey", "Mantle");
}
public int size() {
return m.size();
}
}
|
[
"korwin-bieniek@wp.pl"
] |
korwin-bieniek@wp.pl
|
7f6390a1d15a87f997b425256ba191724c4b6971
|
45f87afc7fe493a3739885d39f9eb0184c96e0c9
|
/services/vserver/src/main/java/com/ncloud/vserver/model/GetMemberServerImageInstanceDetailResponse.java
|
9180444fb83a17b8c2903443e5b88483c7f5595f
|
[
"MIT"
] |
permissive
|
NaverCloudPlatform/ncloud-sdk-java
|
6635639835ed19dc82e4605c554f894a14645004
|
bb692dab5f00f94f36c1fcc622bec6d2f2c88d28
|
refs/heads/master
| 2023-05-03T07:21:03.219343
| 2023-04-19T10:56:17
| 2023-04-19T10:56:17
| 210,761,909
| 7
| 6
|
MIT
| 2023-04-19T10:56:52
| 2019-09-25T05:23:36
|
Java
|
UTF-8
|
Java
| false
| false
| 5,185
|
java
|
/*
* vserver
* VPC Compute 관련 API<br/>https://ncloud.apigw.ntruss.com/vserver/v2
*
* NBP corp.
*
* NOTE: This class is auto generated by the swagger code generator program.
* https://github.com/swagger-api/swagger-codegen.git
* Do not edit the class manually.
*/
package com.ncloud.vserver.model;
import java.util.Objects;
import com.ncloud.vserver.model.MemberServerImageInstance;
import java.util.ArrayList;
import java.util.List;
/**
* GetMemberServerImageInstanceDetailResponse
*/
public class GetMemberServerImageInstanceDetailResponse {
private String requestId = null;
private String returnCode = null;
private String returnMessage = null;
private Integer totalRows = null;
private List<MemberServerImageInstance> memberServerImageInstanceList = null;
public GetMemberServerImageInstanceDetailResponse requestId(String requestId) {
this.requestId = requestId;
return this;
}
/**
* Get requestId
* @return requestId
**/
public String getRequestId() {
return requestId;
}
public void setRequestId(String requestId) {
this.requestId = requestId;
}
public GetMemberServerImageInstanceDetailResponse returnCode(String returnCode) {
this.returnCode = returnCode;
return this;
}
/**
* Get returnCode
* @return returnCode
**/
public String getReturnCode() {
return returnCode;
}
public void setReturnCode(String returnCode) {
this.returnCode = returnCode;
}
public GetMemberServerImageInstanceDetailResponse returnMessage(String returnMessage) {
this.returnMessage = returnMessage;
return this;
}
/**
* Get returnMessage
* @return returnMessage
**/
public String getReturnMessage() {
return returnMessage;
}
public void setReturnMessage(String returnMessage) {
this.returnMessage = returnMessage;
}
public GetMemberServerImageInstanceDetailResponse totalRows(Integer totalRows) {
this.totalRows = totalRows;
return this;
}
/**
* Get totalRows
* @return totalRows
**/
public Integer getTotalRows() {
return totalRows;
}
public void setTotalRows(Integer totalRows) {
this.totalRows = totalRows;
}
public GetMemberServerImageInstanceDetailResponse memberServerImageInstanceList(List<MemberServerImageInstance> memberServerImageInstanceList) {
this.memberServerImageInstanceList = memberServerImageInstanceList;
return this;
}
public GetMemberServerImageInstanceDetailResponse addMemberServerImageInstanceListItem(MemberServerImageInstance memberServerImageInstanceListItem) {
if (this.memberServerImageInstanceList == null) {
this.memberServerImageInstanceList = new ArrayList<MemberServerImageInstance>();
}
this.memberServerImageInstanceList.add(memberServerImageInstanceListItem);
return this;
}
/**
* Get memberServerImageInstanceList
* @return memberServerImageInstanceList
**/
public List<MemberServerImageInstance> getMemberServerImageInstanceList() {
return memberServerImageInstanceList;
}
public void setMemberServerImageInstanceList(List<MemberServerImageInstance> memberServerImageInstanceList) {
this.memberServerImageInstanceList = memberServerImageInstanceList;
}
@Override
public boolean equals(java.lang.Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
GetMemberServerImageInstanceDetailResponse getMemberServerImageInstanceDetailResponse = (GetMemberServerImageInstanceDetailResponse) o;
return Objects.equals(this.requestId, getMemberServerImageInstanceDetailResponse.requestId) &&
Objects.equals(this.returnCode, getMemberServerImageInstanceDetailResponse.returnCode) &&
Objects.equals(this.returnMessage, getMemberServerImageInstanceDetailResponse.returnMessage) &&
Objects.equals(this.totalRows, getMemberServerImageInstanceDetailResponse.totalRows) &&
Objects.equals(this.memberServerImageInstanceList, getMemberServerImageInstanceDetailResponse.memberServerImageInstanceList);
}
@Override
public int hashCode() {
return Objects.hash(requestId, returnCode, returnMessage, totalRows, memberServerImageInstanceList);
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("class GetMemberServerImageInstanceDetailResponse {\n");
sb.append(" requestId: ").append(toIndentedString(requestId)).append("\n");
sb.append(" returnCode: ").append(toIndentedString(returnCode)).append("\n");
sb.append(" returnMessage: ").append(toIndentedString(returnMessage)).append("\n");
sb.append(" totalRows: ").append(toIndentedString(totalRows)).append("\n");
sb.append(" memberServerImageInstanceList: ").append(toIndentedString(memberServerImageInstanceList)).append("\n");
sb.append("}");
return sb.toString();
}
/**
* Convert the given object to string with each line indented by 4 spaces
* (except the first line).
*/
private String toIndentedString(java.lang.Object o) {
if (o == null) {
return "null";
}
return o.toString().replace("\n", "\n ");
}
}
|
[
"lee.yongtak@navercorp.com"
] |
lee.yongtak@navercorp.com
|
3b7e4f4163baf1679b9ec2e5ea6b0a53c9c47c5b
|
e1e5bd6b116e71a60040ec1e1642289217d527b0
|
/H5/Fandc_Ro/Fandc_Ro_2018_11_04/java/l2f/gameserver/network/clientpackets/RequestDismissAlly.java
|
5815619ae5660ae6fd0c3fef4f0cd8559d5dd953
|
[] |
no_license
|
serk123/L2jOpenSource
|
6d6e1988a421763a9467bba0e4ac1fe3796b34b3
|
603e784e5f58f7fd07b01f6282218e8492f7090b
|
refs/heads/master
| 2023-03-18T01:51:23.867273
| 2020-04-23T10:44:41
| 2020-04-23T10:44:41
| null | 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 1,169
|
java
|
package l2f.gameserver.network.clientpackets;
import l2f.gameserver.model.Player;
import l2f.gameserver.model.pledge.Alliance;
import l2f.gameserver.model.pledge.Clan;
import l2f.gameserver.network.serverpackets.components.SystemMsg;
import l2f.gameserver.tables.ClanTable;
public class RequestDismissAlly extends L2GameClientPacket
{
@Override
protected void readImpl()
{}
@Override
protected void runImpl()
{
Player activeChar = getClient().getActiveChar();
if (activeChar == null)
return;
Clan clan = activeChar.getClan();
if (clan == null)
{
activeChar.sendActionFailed();
return;
}
Alliance alliance = clan.getAlliance();
if (alliance == null)
{
activeChar.sendPacket(SystemMsg.YOU_ARE_NOT_CURRENTLY_ALLIED_WITH_ANY_CLANS);
return;
}
if (!activeChar.isAllyLeader())
{
activeChar.sendPacket(SystemMsg.THIS_FEATURE_IS_ONLY_AVAILABLE_TO_ALLIANCE_LEADERS);
return;
}
if (alliance.getMembersCount() > 1)
{
activeChar.sendPacket(SystemMsg.YOU_HAVE_FAILED_TO_DISSOLVE_THE_ALLIANCE);
return;
}
ClanTable.getInstance().dissolveAlly(activeChar);
}
}
|
[
"64197706+L2jOpenSource@users.noreply.github.com"
] |
64197706+L2jOpenSource@users.noreply.github.com
|
6c32a6d9969cb0b85a2e8100383cf0c2a1e4c7c5
|
661103ae6ed7e22a21182c30bd76f10def5fd07a
|
/iaas-common/src/main/java/io/github/cloudiator/messaging/NodeMessageRepository.java
|
efdf4142de99b3d167bc045fdb780e55889656c3
|
[] |
no_license
|
cloudiator/orchestration
|
8cf2edfae0b7b7a487bd0465075d63fb7fa52e7d
|
6d8bb5a841f921401b2faf21e4ea0e87605253a3
|
refs/heads/master
| 2022-06-26T18:57:26.887344
| 2020-01-13T12:07:52
| 2020-01-13T12:07:52
| 79,246,172
| 0
| 6
| null | 2022-05-20T21:01:39
| 2017-01-17T16:17:02
|
Java
|
UTF-8
|
Java
| false
| false
| 3,560
|
java
|
/*
* Copyright (c) 2014-2018 University of Ulm
*
* See the NOTICE file distributed with this work for additional information
* regarding copyright ownership. Licensed under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
package io.github.cloudiator.messaging;
import static com.google.common.base.Preconditions.checkArgument;
import static com.google.common.base.Preconditions.checkState;
import com.google.common.base.Strings;
import com.google.inject.Inject;
import de.uniulm.omi.cloudiator.util.StreamUtil;
import io.github.cloudiator.domain.Node;
import java.util.List;
import java.util.concurrent.Future;
import java.util.stream.Collectors;
import javax.annotation.Nullable;
import org.cloudiator.messages.Node.NodeDeleteMessage;
import org.cloudiator.messages.Node.NodeDeleteResponseMessage;
import org.cloudiator.messages.Node.NodeQueryMessage;
import org.cloudiator.messaging.ResponseException;
import org.cloudiator.messaging.SettableFutureResponseCallback;
import org.cloudiator.messaging.services.NodeService;
public class NodeMessageRepository implements MessageRepository<Node> {
private final NodeService nodeService;
private static final NodeToNodeMessageConverter NODE_MESSAGE_CONVERTER = NodeToNodeMessageConverter.INSTANCE;
@Inject
public NodeMessageRepository(NodeService nodeService) {
this.nodeService = nodeService;
}
@Nullable
@Override
public Node getById(String userId, String id) {
final NodeQueryMessage nodeQueryMessage = NodeQueryMessage.newBuilder().setUserId(userId)
.setNodeId(id)
.build();
try {
return nodeService.queryNodes(nodeQueryMessage).getNodesList().stream().map(
NODE_MESSAGE_CONVERTER::applyBack).collect(StreamUtil.getOnly()).orElse(null);
} catch (ResponseException e) {
throw new IllegalStateException("Could not retrieve nodes.", e);
}
}
@Override
public List<Node> getAll(String userId) {
final NodeQueryMessage nodeQueryMessage = NodeQueryMessage.newBuilder().setUserId(userId)
.build();
try {
return nodeService.queryNodes(nodeQueryMessage).getNodesList().stream()
.map(NODE_MESSAGE_CONVERTER::applyBack).collect(Collectors
.toList());
} catch (ResponseException e) {
throw new IllegalStateException("Could not retrieve nodes.", e);
}
}
public Future<?> delete(String userId, String nodeId) {
checkArgument(!Strings.isNullOrEmpty(userId), "userId is null or empty");
checkArgument(!Strings.isNullOrEmpty(nodeId), "nodeId is null or empty");
checkState(getById(userId, nodeId) != null,
String.format("Node with id %s does not exist for user %s.", nodeId, userId));
SettableFutureResponseCallback<NodeDeleteResponseMessage, NodeDeleteResponseMessage> futureResponseCallback = SettableFutureResponseCallback
.create();
nodeService
.deleteNodeAsync(NodeDeleteMessage.newBuilder().setNodeId(nodeId).setUserId(userId).build(),
futureResponseCallback);
return futureResponseCallback;
}
}
|
[
"daniel.baur@uni-ulm.de"
] |
daniel.baur@uni-ulm.de
|
db80543d63d1e0279773da3a2be20a977430fd4b
|
44d225841fca1a0ddbb05498c3247599b1838756
|
/Later/Java_Later/Java_Util_package/Arrays/9_stream/4/ArraysDemo/src/ArraysDemo2.java
|
5e8f5e75700232173ebe14f7fdb81a4e6d2c2689
|
[] |
no_license
|
pavanganeshbhagathi/Java_Spring_2019
|
a33df6379e02e7804e8238acdef5137681ee0d8a
|
4607a94a455cbc858690ffb11d408006f9798e93
|
refs/heads/master
| 2020-12-06T23:40:37.396996
| 2020-01-08T13:35:10
| 2020-01-08T13:35:10
| 232,581,578
| 2
| 0
| null | 2020-01-08T14:26:35
| 2020-01-08T14:26:34
| null |
UTF-8
|
Java
| false
| false
| 720
|
java
|
import java.util.Arrays;
import java.util.stream.Stream;
public class ArraysDemo2
{
public static void main(String[] args)
{
Integer[] integerArray = new Integer[] { 5, 15, 25, 35, 45 };
/*
* Returns a sequential IntegerStream with the specified range of
* the specified array as its source.
*
* Parameters:
*
* array - the array, assumed to be unmodified during use
*
* startInclusive - the first index to cover, inclusive
*
* endExclusive - index immediately past the last index to
* cover
*
* Returns:
*
* an IntegerStream for the array range
*/
Stream<Integer> stream = Arrays.stream(integerArray, 1, 3);
stream.forEach(System.out::println);
}
}
|
[
"ramram_43210@yahoo.com"
] |
ramram_43210@yahoo.com
|
21b99c303d96703289e776ce0e9e2713081eada8
|
545a30d7261d5212a6ce0d715bbf81601ac939e8
|
/src/winkhouse/dao/GDataDAO.java
|
51fdf6a8455f6f1475d08c1d6ea8c949563619f0
|
[] |
no_license
|
mlavoratornovo/winkhouse
|
333f00dcf7cbeb125ec345fde695c1dd3e3fa2eb
|
edc4084da52bc4c3776950f5c33925942f890c5b
|
refs/heads/master
| 2022-05-13T04:42:13.118839
| 2022-05-01T16:25:21
| 2022-05-01T16:25:21
| 77,863,256
| 1
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 3,425
|
java
|
package winkhouse.dao;
import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.sql.Statement;
import winkhouse.db.ConnectionManager;
import winkhouse.vo.GDataVO;
public class GDataDAO extends BaseDAO {
public final static String GOOGLE_DATA_BY_ID = "GOOGLE_DATA_BY_ID";
public final static String GOOGLE_DATA_BY_CODCONTATTO = "GOOGLE_DATA_BY_CODCONTATTO";
public final static String GOOGLE_DATA_SAVE = "GOOGLE_DATA_SAVE";
public final static String GOOGLE_DATA_UPDATE = "GOOGLE_DATA_UPDATE";
public final static String GOOGLE_DATA_DELETE = "GOOGLE_DATA_DELETE";
public final static String GOOGLE_DATA_LIST = "GOOGLE_DATA_LIST";
public final static String UPDATE_GOOGLE_DATA_AGENTEUPDATE = "UPDATE_GOOGLE_DATA_AGENTE_UPDATE";
public GDataDAO() {
super();
}
public Object getGoogleDataById(String classType, Integer codGData){
return super.getObjectById(classType, GOOGLE_DATA_BY_ID, codGData);
}
public Object getGoogleDataByCodContatto(String classType, Integer codContatto){
return super.getObjectById(classType, GOOGLE_DATA_BY_CODCONTATTO, codContatto);
}
public boolean deleteGoogleDataByCodContatto(Integer codContatto,Connection con, boolean doCommit){
return super.deleteObjectById(GOOGLE_DATA_DELETE, codContatto, con, doCommit);
}
public Object getGoogleDataList(String className){
return super.list(className, GOOGLE_DATA_LIST);
}
public boolean saveUpdate(GDataVO gdVO, Connection connection, Boolean doCommit){
boolean returnValue = false;
boolean generatedkey = false;
ResultSet rs = null;
Connection con = (connection == null)
? ConnectionManager.getInstance().getConnection()
: connection;
PreparedStatement ps = null;
String query = ((gdVO.getCodGData() == null) || (gdVO.getCodGData() == 0))
? getQuery(GOOGLE_DATA_SAVE)
: getQuery(GOOGLE_DATA_UPDATE);
try{
ps = con.prepareStatement(query,Statement.RETURN_GENERATED_KEYS);
if (gdVO.getCodContatto() == null) {
ps.setInt(1, java.sql.Types.INTEGER);
} else {
ps.setInt(1, gdVO.getCodContatto());
}
ps.setString(2, gdVO.getPwsKey());
ps.setString(3, gdVO.getDescrizione());
if ((gdVO.getCodGData() != null) &&
(gdVO.getCodGData() != 0)){
ps.setInt(4, gdVO.getCodGData());
}
ps.executeUpdate();
if ((gdVO.getCodGData() == null) ||
(gdVO.getCodGData() == 0)){
rs = ps.getGeneratedKeys();
while (rs.next()){
Integer key = rs.getInt("");
gdVO.setCodGData(key);
generatedkey = true;
break;
}
}
returnValue = true;
if (doCommit){
con.commit();
}
}catch(SQLException sql){
sql.printStackTrace();
}finally{
try {
if (generatedkey){
rs.close();
}
} catch (SQLException e) {
rs = null;
}
try {
ps.close();
} catch (SQLException e) {
ps = null;
}
try {
if (doCommit){
con.close();
}
} catch (SQLException e) {
con = null;
}
}
return returnValue;
}
public boolean updateGoogleDataAgenteUpdate(Integer codAgenteOld, Integer codAgenteNew, Connection con, Boolean doCommit){
return super.updateByIdWhereId(UPDATE_GOOGLE_DATA_AGENTEUPDATE, codAgenteNew, codAgenteOld, con, doCommit);
}
}
|
[
"m.lavoratornovo@gmail.com"
] |
m.lavoratornovo@gmail.com
|
aa1937d44ee21221b823cd47fa7e37d0a5dd8418
|
dc1dbb7e5a4b95bf44170d2f51fd08b3814f2ac9
|
/data_defect4j/preprossed_method_corpus/Lang/12/org/apache/commons/lang3/time/FastDateParser_FastDateParser_94.java
|
6c436932e101257fae6e37b003b6031b5e6d0dfc
|
[] |
no_license
|
hvdthong/NetML
|
dca6cf4d34c5799b400d718e0a6cd2e0b167297d
|
9bb103da21327912e5a29cbf9be9ff4d058731a5
|
refs/heads/master
| 2021-06-30T15:03:52.618255
| 2020-10-07T01:58:48
| 2020-10-07T01:58:48
| 150,383,588
| 1
| 1
| null | 2018-09-26T07:08:45
| 2018-09-26T07:08:44
| null |
UTF-8
|
Java
| false
| false
| 1,722
|
java
|
org apach common lang3 time
fast date parser fastdatepars fast thread safe version
link java text simpl date format simpledateformat
direct replac
code simpl date format simpledateformat code pars situat
multi thread server environ
code simpl date format simpledateformat code thread safe jdk version
sun close
href http bug sun bugdatabas view bug bug bug rfe
pars support pattern compat
simpl date format simpledateformat
time test fast simpl date format simpledateformat
singl thread applic faster multi thread applic
fast date parser fastdatepars date parser datepars serializ
construct fast date parser fastdatepars
param pattern link java text simpl date format simpledateformat compat
pattern
param time zone timezon time zone
param local local
fast date parser fastdatepars string pattern time zone timezon time zone timezon local local
pattern pattern
time zone timezon time zone timezon
local local
init
|
[
"hvdthong@gmail.com"
] |
hvdthong@gmail.com
|
f592aa8b7eadc25d2ac7a38dd79842598ddd4433
|
f5d730d93587b410f971f59e8bddf2597e95b101
|
/src/org/dav/learn/corejavabook/AboutDialog.java
|
952985bea4b2040da0269c4eb0b6bd9175372973
|
[] |
no_license
|
ADolodarenko/CoreJavaBookAddit
|
fb3e87e3d8b529dc1d6737f4f4a34d7dc064d18c
|
50aaf06e1f0d35ce94a37fe81afe3e47325a7a5b
|
refs/heads/master
| 2020-04-13T23:49:23.386666
| 2018-12-29T20:49:28
| 2018-12-29T20:49:28
| 163,516,464
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 784
|
java
|
package org.dav.learn.corejavabook;
import javax.swing.*;
import java.awt.*;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
public class AboutDialog extends JDialog
{
public AboutDialog(JFrame owner)
{
super(owner, "About", true);
add(new JLabel("<html><h1><i>Java Core</i></h1><hr>By me!</html>"), BorderLayout.CENTER);
JButton buttonOK = new JButton("OK");
buttonOK.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent e)
{
setVisible(false);
}
});
JPanel panelCommand = new JPanel();
panelCommand.add(buttonOK);
add(panelCommand, BorderLayout.SOUTH);
pack();
}
}
|
[
"adolodar@gmail.com"
] |
adolodar@gmail.com
|
e6de11e72591a25d9329ec9157f536bf062df8a8
|
a0c680b5f17882de7ca58e1d742e5a1829907ca3
|
/TxMgmtProj4(Anno-Distributed Tx mgmt)/src/test/ClientApp.java
|
ec7ed7f0a4e130280729b99bb6b09cf03b07f34d
|
[] |
no_license
|
aakulasaikiran/Spring_Ntsp47
|
ed72cf795a77dfb55e0054b627244a18fbfa776f
|
0b1a9cfb9e75e465eca8f1c39eb1690caefea91e
|
refs/heads/master
| 2020-03-23T15:24:15.955366
| 2018-07-20T18:39:45
| 2018-07-20T18:39:45
| 141,745,936
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 840
|
java
|
package test;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.FileSystemXmlApplicationContext;
import com.nt.service.AccountService;
public class ClientApp {
public static void main(String[] args) {
ApplicationContext ctx=null;
AccountService proxy=null;
boolean status=false;
//create IOC container
ctx=new FileSystemXmlApplicationContext("src/com/nt/cfgs/applicationContext.xml");
// get bean
proxy=ctx.getBean("accountService",AccountService.class);
//Call b.method
try{
status=proxy.transferMoney(1004,1003 ,2000);
if(status){
System.out.println("Money Transfered(Tx committed)");
}
else{
System.out.println("Money not Transfered(Tx rolledback)");
}
}//try
catch(Exception se){
se.printStackTrace();
}
}//main
}//class
|
[
"aakulasaikiran@gmail.com"
] |
aakulasaikiran@gmail.com
|
1bd59b14b3b496b82cce788b3a0b0523c50bd8c4
|
68ff808ae184158a4df4f6449e61621c8db72f61
|
/Databases Frameworks - Hibernate & Spring Data/Databases Frameworks Exam - Oct 2017 - Exam prep 2/src/main/java/app/exam/io/ConsoleIOImpl.java
|
3d611e13a46e4fa40e4e36f3048ba64bed57a458
|
[
"Apache-2.0"
] |
permissive
|
Valentin9003/Java
|
eb2ee75468091136b49e5f0b902159bbb8276eca
|
9d263063685ba60ab75dc9efd25554b715a7980a
|
refs/heads/master
| 2020-04-02T13:28:24.713200
| 2019-11-13T10:30:05
| 2019-11-13T10:30:05
| 154,482,638
| 1
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 268
|
java
|
package app.exam.io;
import app.exam.io.interfaces.ConsoleIO;
import org.springframework.stereotype.Component;
@Component
public class ConsoleIOImpl implements ConsoleIO {
@Override
public void write(String line) {
System.out.println(line);
}
}
|
[
"valio_180@abv.bg"
] |
valio_180@abv.bg
|
6ad0f24e338789c3135573c0ee745e95f2b527ee
|
f72c5c691cb38114393ac5d06bc9d5e8194bdeb6
|
/Sturts2/src/main/java/com/ht/action/ServletContextAction.java
|
23203558ad8578d9e801150c93924130c5f07565
|
[] |
no_license
|
ZedZhouZiBin/Javaweb
|
a3cb6a47c99b2f5fd6766b5579ad4f2e5c55cae8
|
0169feedc23522e27e7c4448a87846515b59c369
|
refs/heads/master
| 2021-09-09T13:03:36.237337
| 2018-03-16T11:49:54
| 2018-03-16T11:49:54
| null | 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 871
|
java
|
package com.ht.action;
import javax.servlet.ServletContext;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;
import org.apache.struts2.ServletActionContext;
import com.opensymphony.xwork2.ActionSupport;
public class ServletContextAction extends ActionSupport{
HttpServletRequest request;
HttpSession session;
ServletContext application;
HttpServletResponse response;
@Override
public String execute() throws Exception {
request = ServletActionContext.getRequest();
session = request.getSession();
application = ServletActionContext.getServletContext();
response = ServletActionContext.getResponse();
request.setAttribute("username", "admin3333");
session.setAttribute("username", "administrator444");
application.setAttribute("count", 1819);
return INPUT;
}
}
|
[
"1729340612@qq.com"
] |
1729340612@qq.com
|
69a1f4eb63ab1cf1d6db4e4806ca71a7b8bb5599
|
2977d049607c093471f48b7089b741590f7a7399
|
/MySnake/src/MainFrame.java
|
10769dd6e9580a51c751aa5dc2605eec97a98697
|
[] |
no_license
|
Silocean/JustForFun
|
dfc78f815e1ceeef0c2d485bd1718ae9b53c9e2b
|
185b6dd815ebeba786c479fd9e40a3c9e5d3ef74
|
refs/heads/master
| 2021-01-11T06:06:02.830713
| 2019-01-21T13:13:08
| 2019-01-21T13:13:08
| 71,687,465
| 1
| 1
| null | null | null | null |
GB18030
|
Java
| false
| false
| 3,790
|
java
|
import java.applet.Applet;
import java.applet.AudioClip;
import java.awt.BorderLayout;
import java.awt.Choice;
import java.awt.GridLayout;
import java.awt.Toolkit;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import javax.swing.BorderFactory;
import javax.swing.Icon;
import javax.swing.ImageIcon;
import javax.swing.JButton;
import javax.swing.JFrame;
import javax.swing.JLabel;
import javax.swing.JPanel;
import javax.swing.UIManager;
import javax.swing.UnsupportedLookAndFeelException;
@SuppressWarnings("serial")
public class MainFrame extends JFrame implements ActionListener {
public static final int WINDWO_WIDTH = 800 - 4;
public static final int WINDWO_HEIGHT = 600 - 10;
public static final int BLOCK_SIZE = 15;
Icon startIcon = new ImageIcon(MainFrame.class.getClassLoader()
.getResource("images/start.png"));
Icon pause_1 = new ImageIcon(MainFrame.class.getClassLoader().getResource(
"images/pause-1.png"));
Icon pause_2 = new ImageIcon(MainFrame.class.getClassLoader().getResource(
"images/pause-2.png"));
Icon reStart = new ImageIcon(MainFrame.class.getClassLoader().getResource(
"images/reStart.png"));
AudioClip ac = Applet.newAudioClip(this.getClass().getResource(
"music/Nujabes - Aruarian Dance.wav"));
public static int score = 0;
Yard yard = new Yard(this);
JPanel pRight = new JPanel();
JPanel p1 = new JPanel();
JPanel p2 = new JPanel();
JLabel labelScore = new JLabel("得分:", JLabel.CENTER);
JLabel labelState = new JLabel("(*∩_∩*)", JLabel.CENTER);
Choice difficultChoice = new Choice();
JButton bStart = new JButton(startIcon);
JButton bPause = new JButton(pause_2);
JButton bRestart = new JButton(reStart);
public void launch() {
ac.loop();
difficultChoice.add("简单");
difficultChoice.add("中等");
difficultChoice.add("巨难");
p1.setLayout(new GridLayout(2, 1));
p1.add(labelScore);
p1.add(labelState);
p1.setBorder(BorderFactory.createRaisedSoftBevelBorder());
p2.setLayout(new GridLayout(3, 1));
// p2.add(difficultChoice);
p2.add(bStart);
p2.add(bPause);
p2.add(bRestart);
bRestart.setEnabled(false);
bPause.setEnabled(false);
bStart.addActionListener(this);
bPause.addActionListener(this);
bRestart.addActionListener(this);
p2.setBorder(BorderFactory.createRaisedSoftBevelBorder());
pRight.setLayout(new GridLayout(2, 1));
pRight.add(p1);
pRight.add(p2);
this.add(yard, BorderLayout.CENTER);
this.add(pRight, BorderLayout.EAST);
this.setTitle("`(*∩_∩*)′");
this.setIconImage(Toolkit.getDefaultToolkit()
.getImage(
MainFrame.class.getClassLoader().getResource(
"images/icon.png")));
this.setSize(MainFrame.WINDWO_WIDTH, MainFrame.WINDWO_HEIGHT);
this.setLocationRelativeTo(null);
this.setResizable(false);
this.setVisible(true);
yard.requestFocus(); // 注意不能写在setVisible()之前
this.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
System.out.println(yard.getSize());
}
public static void main(String[] args) {
// TODO Auto-generated method stub
try {
UIManager
.setLookAndFeel("com.sun.java.swing.plaf.windows.WindowsLookAndFeel");
// SwingUtilities.updateComponentTreeUI(this);
} catch (ClassNotFoundException e) {
// TODO Auto-generated catch block
e.printStackTrace();
} catch (InstantiationException e) {
// TODO Auto-generated catch block
e.printStackTrace();
} catch (IllegalAccessException e) {
// TODO Auto-generated catch block
e.printStackTrace();
} catch (UnsupportedLookAndFeelException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
new MainFrame().launch();
}
@Override
public void actionPerformed(ActionEvent e) {
// TODO Auto-generated method stub
yard.actionPerformed(e);
}
}
|
[
"silenceocean@live.com"
] |
silenceocean@live.com
|
6a22c37c7953b530dbb8354cd5a0e2abefa2228d
|
8aa49217903691e6cfbd804407c078b922dfaa6f
|
/src/test/java/com/github/perscholas/service/courseservice/GetAllCoursesTest.java
|
fdf4686bf8d10dfc2391b3720feb63c22f65a9cd
|
[] |
no_license
|
StevenS125/sba.jpa_school-management-system
|
19eb3270913b26bac68bb99e1803da0676a5c7ca
|
eb19e66684bb514ac7ff949a75702ddfd78b14bb
|
refs/heads/master
| 2022-12-18T08:19:45.837406
| 2020-09-09T01:14:55
| 2020-09-09T01:14:55
| 291,801,393
| 1
| 0
| null | 2020-09-09T01:14:56
| 2020-08-31T19:05:53
|
Java
|
UTF-8
|
Java
| false
| false
| 1,310
|
java
|
package com.github.perscholas.service.courseservice;
import com.github.perscholas.JdbcConfigurator;
import com.github.perscholas.utils.DirectoryReference;
import org.junit.Before;
import java.io.File;
/**
* @author leonhunter
* @created 02/12/2020 - 8:26 PM
*/
public class GetAllCoursesTest {
@Before // TODO (OPTIONAL) - Use files to execute SQL commands
public void setup() {
DirectoryReference directoryReference = DirectoryReference.RESOURCE_DIRECTORY;
File coursesSchemaFile = directoryReference.getFileFromDirectory("courses.create-table.sql");
File studentsSchemaFile = directoryReference.getFileFromDirectory("students.create-table.sql");
File coursesPopulatorFile = directoryReference.getFileFromDirectory("courses.populate-table.sql");
File studentsPopulatorFile = directoryReference.getFileFromDirectory("students.populate-table.sql");
File[] filesToExecute = new File[]{
coursesSchemaFile,
studentsSchemaFile,
coursesPopulatorFile,
studentsPopulatorFile
};
}
// given
private void test() {
JdbcConfigurator.initialize();
// when
// TODO - define `when` clause
// then
// TODO - define `then` clause
}
}
|
[
"xleonhunter@gmail.com"
] |
xleonhunter@gmail.com
|
26b2e5f9b8b0085e24986212c31443784525f384
|
0af8b92686a58eb0b64e319b22411432aca7a8f3
|
/single-large-project/src/main/java/org/gradle/test/performancenull_475/Productionnull_47445.java
|
ec7ad0514840909fd2304f79b1cb869e794b195e
|
[] |
no_license
|
gradle/performance-comparisons
|
b0d38db37c326e0ce271abebdb3c91769b860799
|
e53dc7182fafcf9fedf07920cbbea8b40ee4eef4
|
refs/heads/master
| 2023-08-14T19:24:39.164276
| 2022-11-24T05:18:33
| 2022-11-24T05:18:33
| 80,121,268
| 17
| 15
| null | 2022-09-30T08:04:35
| 2017-01-26T14:25:33
| null |
UTF-8
|
Java
| false
| false
| 588
|
java
|
package org.gradle.test.performancenull_475;
public class Productionnull_47445 {
private final String property;
public Productionnull_47445(String param) {
this.property = param;
}
public String getProperty() {
return property;
}
private String prop0;
public String getProp0() {
return prop0;
}
public void setProp0(String value) {
prop0 = value;
}
private String prop1;
public String getProp1() {
return prop1;
}
public void setProp1(String value) {
prop1 = value;
}
}
|
[
"cedric.champeau@gmail.com"
] |
cedric.champeau@gmail.com
|
9667e4b0dfe75083a514ed3defacf0e8af82588e
|
84125a032c2b2e150f62616c15f0089016aca05d
|
/src/com/leet/algo/Prob730.java
|
14f3da4f3ce140dbaa7adf7f2f2efca36a3e3ea6
|
[] |
no_license
|
achowdhury80/leetcode
|
c577acc1bc8bce3da0c99e12d6d447c74fbed5c3
|
5ec97794cc5617cd7f35bafb058ada502ee7d802
|
refs/heads/master
| 2023-02-06T01:08:49.888440
| 2023-01-22T03:23:37
| 2023-01-22T03:23:37
| 115,574,715
| 1
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 1,303
|
java
|
package com.leet.algo;
public class Prob730 {
/**
* https://leetcode.com/problems/count-different-palindromic-subsequences/solution/
*/
public int countPalindromicSubsequences(String S) {
int n = S.length();
int mod = 1000000007;
int[][][] dp = new int[4][n][n];
for (int i = n-1; i >= 0; --i) {
for (int j = i; j < n; ++j) {
for (int k = 0; k < 4; ++k) {
char c = (char) ('a' + k);
if (j == i) {
if (S.charAt(i) == c) dp[k][i][j] = 1;
else dp[k][i][j] = 0;
} else { // j > i
if (S.charAt(i) != c) dp[k][i][j] = dp[k][i+1][j];
else if (S.charAt(j) != c) dp[k][i][j] = dp[k][i][j-1];
else { // S[i] == S[j] == c
if (j == i+1) dp[k][i][j] = 2; // "aa" : {"a", "aa"}
else { // length is > 2
dp[k][i][j] = 2;
for (int m = 0; m < 4; ++m) { // count each one within subwindows [i+1][j-1]
dp[k][i][j] += dp[m][i+1][j-1];
dp[k][i][j] %= mod;
}
}
}
}
}
}
}
int ans = 0;
for (int k = 0; k < 4; ++k) {
ans += dp[k][0][n-1];
ans %= mod;
}
return ans;
}
}
|
[
"aychowdh@microsoft.com"
] |
aychowdh@microsoft.com
|
aadf8f39e2bf3044bc3d8b6d75f75264421a7f0b
|
efb703b715120cb34c6a44db0106db50d8e66b6f
|
/core/src/test/java/com/elastisys/autoscaler/core/monitoring/impl/standard/TestSystemHistorianCreator.java
|
a848f5a7cb33f818e5149e8b0f5693c796f39340
|
[
"Apache-2.0"
] |
permissive
|
muskanmahajan486/autoscaler_cloud
|
40e0af1191c78e9feec776b635dfb4ece15d99de
|
d0bc218cc547bd5dcc7522b14be6779f3dd06fcc
|
refs/heads/master
| 2023-03-17T00:40:12.690825
| 2019-05-08T13:56:41
| 2019-05-08T13:57:40
| null | 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 6,098
|
java
|
package com.elastisys.autoscaler.core.monitoring.impl.standard;
import static org.hamcrest.CoreMatchers.is;
import static org.junit.Assert.assertThat;
import static org.junit.Assert.assertTrue;
import static org.junit.Assert.fail;
import java.io.File;
import java.util.UUID;
import java.util.concurrent.Executors;
import java.util.concurrent.ScheduledExecutorService;
import javax.inject.Inject;
import javax.inject.Named;
import org.junit.Before;
import org.junit.Test;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import com.elastisys.autoscaler.core.monitoring.impl.standard.config.SystemHistorianAlias;
import com.elastisys.autoscaler.core.monitoring.impl.standard.config.SystemHistorianConfig;
import com.elastisys.autoscaler.core.monitoring.metricstreamer.api.MetricStreamer;
import com.elastisys.autoscaler.core.monitoring.systemhistorian.api.SystemHistorian;
import com.elastisys.autoscaler.core.monitoring.systemhistorian.impl.noop.NoOpSystemHistorian;
import com.elastisys.scale.commons.eventbus.EventBus;
import com.elastisys.scale.commons.eventbus.impl.SynchronousEventBus;
import com.google.gson.JsonObject;
/**
* Verifies the behavior of the {@link MonitoringComponentCreator} - that it can
* instantiate and wire up {@link MetricStreamer} and {@link SystemHistorian}
* implementations.
*/
public class TestSystemHistorianCreator {
private static final UUID autoScalerUuid = UUID.randomUUID();
private static final String autoScalerId = "autoscalerId";
private static final Logger logger = LoggerFactory.getLogger(TestSystemHistorianCreator.class);
private static final EventBus eventBus = new SynchronousEventBus(logger);
private static final ScheduledExecutorService executor = Executors.newScheduledThreadPool(1);
private static final File storageDir = new File("target/");
/** Object under test. */
private SystemHistorianCreator creator;
@Before
public void beforeTestMethod() {
this.creator = new SystemHistorianCreator(autoScalerUuid, autoScalerId, logger, eventBus, executor, storageDir);
}
/**
* Instantiate and wire up a {@link SystemHistorian} by its full class name.
*/
@Test
public void createSystemHistorianFromFullyQualifiedClass() throws ClassNotFoundException {
// create
Class<DummySystemHistorian> implClass = DummySystemHistorian.class;
SystemHistorian<?> systemHistorian = this.creator
.createSystemHistorian(new SystemHistorianConfig(implClass.getName(), new JsonObject()));
assertThat(systemHistorian.getClass().getName(), is(implClass.getName()));
DummySystemHistorian instance = DummySystemHistorian.class.cast(systemHistorian);
assertThat(instance.autoScalerUuid, is(autoScalerUuid));
assertThat(instance.autoScalerId, is(autoScalerId));
assertThat(instance.logger, is(logger));
assertThat(instance.eventBus, is(eventBus));
assertThat(instance.executor, is(executor));
assertThat(instance.storageDir, is(storageDir));
}
/**
* It should be possible to specify one of the supported
* {@link SystemHistorianAlias}es, when building a {@link SystemHistorian}.
*/
@Test
public void createSystemHistorianFromAlias() {
// The creation is expected to fail since OpenTsdbSystemHistorian class
// is not on the classpath in autoscaler.core. However, if an attempt
// has been made to load the class by its full name, that is evidence
// enough that the alias worked.
try {
this.creator.createSystemHistorian(new SystemHistorianConfig("OpenTsdbSystemHistorian", new JsonObject()));
fail("expected to fail");
} catch (ClassNotFoundException e) {
assertTrue(e.getMessage().contains(SystemHistorianAlias.OpenTsdbSystemHistorian.getQualifiedClassName()));
}
}
/**
* Creation from a null config should fail.
*/
@Test(expected = IllegalArgumentException.class)
public void createSystemHistorianFromNullConfig() throws ClassNotFoundException {
this.creator.createSystemHistorian(null);
}
/**
* Creation from a null type name should fail.
*/
@Test(expected = IllegalArgumentException.class)
public void createSystemHistorianFromNullType() throws ClassNotFoundException {
this.creator.createSystemHistorian(new SystemHistorianConfig(null, new JsonObject()));
}
/**
* Creation from an empty type name should fail.
*/
@Test(expected = IllegalArgumentException.class)
public void createSystemHistorianFromEmptyType() throws ClassNotFoundException {
this.creator.createSystemHistorian(new SystemHistorianConfig("", new JsonObject()));
}
/**
* Creation from an unknown type should fail.
*/
@Test(expected = ClassNotFoundException.class)
public void createSystemHistorianFromUnknownType() throws ClassNotFoundException {
this.creator.createSystemHistorian(new SystemHistorianConfig("unknown.ClassName", new JsonObject()));
}
/**
* Dummy implementation that will have its dependencies wired by the
* {@link MonitoringComponentCreator}.
*/
private static class DummySystemHistorian extends NoOpSystemHistorian {
final UUID autoScalerUuid;
final String autoScalerId;
final Logger logger;
final EventBus eventBus;
final ScheduledExecutorService executor;
final File storageDir;
@Inject
public DummySystemHistorian(Logger logger, @Named("Uuid") UUID autoScalerUuid,
@Named("AutoScalerId") String autoScalerId, EventBus eventBus, ScheduledExecutorService executor,
@Named("StorageDir") File storageDir) {
super(logger);
this.autoScalerUuid = autoScalerUuid;
this.autoScalerId = autoScalerId;
this.logger = logger;
this.eventBus = eventBus;
this.executor = executor;
this.storageDir = storageDir;
}
}
}
|
[
"peter.gardfjall.work@gmail.com"
] |
peter.gardfjall.work@gmail.com
|
84043acedf5130ed77ab562496dc2713c9fac18f
|
b2e8aba8ad86eea5e3ecc29921d8cf0c46168cef
|
/src/main/java/com/townmc/utils/jackson/core/format/MatchStrength.java
|
31f930ea9b636376cc59c5a41e9aae102dd736ba
|
[] |
no_license
|
fatalwing/utils
|
9a25b95b96595abcd16cac79faef072645e1f49a
|
9548c86bd73f353c908187aa27d9b59c264a0cac
|
refs/heads/master
| 2022-12-12T17:39:32.392441
| 2021-02-12T02:47:41
| 2021-02-12T02:47:41
| 97,003,764
| 0
| 0
| null | 2022-12-05T23:29:23
| 2017-07-12T12:14:34
|
Java
|
UTF-8
|
Java
| false
| false
| 2,585
|
java
|
package com.townmc.utils.jackson.core.format;
/**
* Enumeration used to indicate strength of match between data format
* and piece of data (typically beginning of a data file).
* Values are in increasing match strength; and detectors should return
* "strongest" value: that is, it should start with strongest match
* criteria, and downgrading if criteria is not fulfilled.
*/
public enum MatchStrength
{
/**
* Value that indicates that given data can not be in given format.
*/
NO_MATCH,
/**
* Value that indicates that detector can not find out whether could
* be a match or not.
* This can occur for example for textual data formats t
* when there are so many leading spaces that detector can not
* find the first data byte (because detectors typically limit lookahead
* to some smallish value).
*/
INCONCLUSIVE,
/**
* Value that indicates that given data could be of specified format (i.e.
* it can not be ruled out). This can occur for example when seen data
* is both not in canonical formats (for example: JSON data should be a JSON Array or Object
* not a scalar value, as per JSON specification) and there are known use case
* where a format detected is actually used (plain JSON Strings are actually used, even
* though specification does not indicate that as valid usage: as such, seeing a leading
* double-quote could indicate a JSON String, which plausibly <b>could</b> indicate
* non-standard JSON usage).
*/
WEAK_MATCH,
/**
* Value that indicates that given data conforms to (one of) canonical form(s) of
* the data format.
*<p>
* For example, when testing for XML data format,
* seeing a less-than character ("<") alone (with possible leading spaces)
* would be a strong indication that data could
* be in xml format (but see below for {@link #FULL_MATCH} description for more)
*/
SOLID_MATCH,
/**
* Value that indicates that given data contains a signature that is deemed
* specific enough to uniquely indicate data format used.
*<p>
* For example, when testing for XML data format,
* seing "<xml" as the first data bytes ("XML declaration", as per XML specification)
* could give full confidence that data is indeed in XML format.
* Not all data formats have unique leading identifiers to allow full matches; for example,
* JSON only has heuristic matches and can have at most {@link #SOLID_MATCH}) match.
*/
FULL_MATCH
;
}
|
[
"liumengying@juniuo.com"
] |
liumengying@juniuo.com
|
fa6cc83f3eb87a65a0a0f7cccfae1fef0d14cdef
|
3f39734c097fdbe7b0d6a0178205c67c3dd9a84d
|
/domain/src/main/java/vn/linh/domain/scheduler/SchedulerProvider.java
|
e75fc7f6a4cba5ebb3a0b61d90b10386ce6877ce
|
[] |
no_license
|
PhanVanLinh/Tracker
|
473e972d995eb698d101623a38294546035694fe
|
6586609c9474d5cdec6e5a63338c93670856f945
|
refs/heads/master
| 2020-03-23T19:06:07.488683
| 2018-10-25T07:44:04
| 2018-10-25T07:44:04
| 141,953,104
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 177
|
java
|
package vn.linh.domain.scheduler;
import io.reactivex.Scheduler;
public interface SchedulerProvider {
Scheduler ui();
Scheduler computation();
Scheduler io();
}
|
[
"phanvanlinh.94vn@gmail.com"
] |
phanvanlinh.94vn@gmail.com
|
e9efcd8f4c2d7ae436776f90d122ccb856b050c6
|
105ff2705396d603b30760cb6e393e2e80e30793
|
/internet_Architec/message_queue/rocketmq/source/RocketMQ-master/rocketmq-client/src/main/java/com/alibaba/rocketmq/client/MQAdmin.java
|
cc7444082fe422ba31bfb297dacfd5b1c87a0f38
|
[
"Apache-2.0"
] |
permissive
|
clonegod/x01-lang-java
|
cfa878ccc0e86cace906d47b9c2a3085732fc835
|
640bdd04a47abf97189e761acd020f7d5a0f55e6
|
refs/heads/master
| 2020-03-13T15:00:36.761781
| 2018-06-06T16:03:32
| 2018-06-06T16:03:32
| 131,169,227
| 2
| 2
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 3,856
|
java
|
/**
* Copyright (C) 2010-2013 Alibaba Group Holding Limited
*
* 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.alibaba.rocketmq.client;
import com.alibaba.rocketmq.client.exception.MQBrokerException;
import com.alibaba.rocketmq.client.exception.MQClientException;
import com.alibaba.rocketmq.common.message.MessageExt;
import com.alibaba.rocketmq.common.message.MessageQueue;
import com.alibaba.rocketmq.remoting.exception.RemotingException;
/**
* Base interface for MQ management
*
* @author shijia.wxr<vintage.wang@gmail.com>
* @since 2013-7-24
*/
public interface MQAdmin {
/**
* Creates an topic
*
* @param key accesskey
* @param newTopic topic name
* @param queueNum topic's queue number
* @throws MQClientException
*/
void createTopic(final String key, final String newTopic, final int queueNum)
throws MQClientException;
/**
* Creates an topic
*
* @param key accesskey
* @param newTopic topic name
* @param queueNum topic's queue number
* @param topicSysFlag topic system flag
* @throws MQClientException
*/
void createTopic(String key, String newTopic, int queueNum, int topicSysFlag)
throws MQClientException;
/**
* Gets the message queue offset according to some time in milliseconds<br>
* be cautious to call because of more IO overhead
*
* @param mq Instance of MessageQueue
* @param timestamp from when in milliseconds.
* @return offset
* @throws MQClientException
*/
long searchOffset(final MessageQueue mq, final long timestamp) throws MQClientException;
/**
* Gets the max offset
*
* @param mq Instance of MessageQueue
* @return the max offset
* @throws MQClientException
*/
long maxOffset(final MessageQueue mq) throws MQClientException;
/**
* Gets the minimum offset
*
* @param mq Instance of MessageQueue
* @return the minimum offset
* @throws MQClientException
*/
long minOffset(final MessageQueue mq) throws MQClientException;
/**
* Gets the earliest stored message time
*
* @param mq Instance of MessageQueue
* @return the time in microseconds
* @throws MQClientException
*/
long earliestMsgStoreTime(final MessageQueue mq) throws MQClientException;
/**
* Query message according tto message id
*
* @param msgId message id
* @return message
* @throws InterruptedException
* @throws MQBrokerException
* @throws RemotingException
* @throws MQClientException
*/
MessageExt viewMessage(final String msgId) throws RemotingException, MQBrokerException,
InterruptedException, MQClientException;
/**
* Query messages
*
* @param topic message topic
* @param key message key index word
* @param maxNum max message number
* @param begin from when
* @param end to when
* @return Instance of QueryResult
* @throws MQClientException
* @throws InterruptedException
*/
QueryResult queryMessage(final String topic, final String key, final int maxNum, final long begin,
final long end) throws MQClientException, InterruptedException;
}
|
[
"asynclife@163.com"
] |
asynclife@163.com
|
5dc7221bf597a63754f5beab711b8a1cc310fbf3
|
1f1352a19528084b924988c56ef68ae9ce40aac0
|
/dorado/dorado-common/src/test/java/com/meituan/dorado/common/util/CommonUtilTest.java
|
3b9a51a813c5d7667599a9ab90cba742963c1f37
|
[
"Apache-2.0"
] |
permissive
|
jcanchen/octo-rpc
|
6c1c2febee4df31cf8b984ab2ecae76b78d1c463
|
3423af57f7007e98073e70fdf09c64764eb6bcb1
|
refs/heads/master
| 2020-04-17T08:10:14.026762
| 2018-12-20T06:49:46
| 2018-12-28T10:17:17
| 166,401,020
| 1
| 0
| null | 2019-01-18T12:22:51
| 2019-01-18T12:22:51
| null |
UTF-8
|
Java
| false
| false
| 1,432
|
java
|
/*
* Copyright 2018 Meituan Dianping. 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.meituan.dorado.common.util;
import org.junit.Assert;
import org.junit.Test;
import java.util.HashMap;
import java.util.Map;
public class CommonUtilTest {
@Test
public void testParseUrlParams() {
String emptyUrl = "";
Map<String, String> params = CommonUtil.parseUrlParams(emptyUrl);
Assert.assertEquals(params, new HashMap<String, String>());
String noParamsUrl = "123456";
params = CommonUtil.parseUrlParams(noParamsUrl);
Assert.assertEquals(params, new HashMap<String, String>());
String url = "abc&a=1&b=3";
params = CommonUtil.parseUrlParams(url);
Map<String, String> result = new HashMap<>();
result.put("a", "1");
result.put("b", "3");
Assert.assertEquals(params, result);
}
}
|
[
"huixiangbo@meituan.com"
] |
huixiangbo@meituan.com
|
d7b3667193633e283806f148f49096f9dc7dfd47
|
5f67a36915a67c07fda935215883517d933d8021
|
/src/cf573d1/C.java
|
1e765d8b5a78ce7f2c3d19787f5d943f04850434
|
[] |
no_license
|
joedurie/java
|
79679ea3b3e2da979fe85e3e3fec2e0a7e06ff83
|
9abb2d86a8a4b7a2ff0e933e0b1ba81b758cb311
|
refs/heads/master
| 2020-07-27T14:04:31.261585
| 2019-09-17T18:07:14
| 2019-09-17T18:07:14
| 209,116,065
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 1,166
|
java
|
package cf573d1;
import java.io.*;
import java.util.*;
public class C {
// ------------------------
public static void main(String[] args) {
MyScanner sc = new MyScanner();
out = new PrintWriter(new BufferedOutputStream(System.out));
// ------------------------
// ------------------------
out.close();
}
//------------------------
public static PrintWriter out;
public static class MyScanner {
BufferedReader br;
StringTokenizer st;
public MyScanner() {
br = new BufferedReader(new InputStreamReader(System.in));
}
String next() {
while (st == null || !st.hasMoreElements()) {
try {
st = new StringTokenizer(br.readLine());
} catch (IOException e) {
e.printStackTrace();
}
}
return st.nextToken();
}
int nextInt() {
return Integer.parseInt(next());
}
long nextLong() {
return Long.parseLong(next());
}
double nextDouble() {
return Double.parseDouble(next());
}
String nextLine() {
String str = "";
try {
str = br.readLine();
} catch (IOException e) {
e.printStackTrace();
}
return str;
}
}
}
|
[
"45380849+joedurie@users.noreply.github.com"
] |
45380849+joedurie@users.noreply.github.com
|
4ed3fd3d60f5f6ecf53441ee6cf5b20663c5f7ca
|
499c60119cd6e1423fccfc8a94c7ad556c47b297
|
/samples-and-tests/unit-tests/app/models/WithOutCache.java
|
0e8eb43ca6ab5653e849c45e390e95496a392b6e
|
[
"LicenseRef-scancode-unknown-license-reference",
"Apache-2.0"
] |
permissive
|
kapilpendse/play-morphia
|
121f5b1b60c35ec650631c0c230cd3898a32c331
|
5d89d558d433726e382fc6023de2d77ac44309b7
|
refs/heads/master
| 2021-01-14T12:40:46.969111
| 2014-01-17T09:25:08
| 2014-01-17T09:25:08
| null | 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 890
|
java
|
package models;
import com.google.code.morphia.annotations.Entity;
import play.jobs.Job;
import play.jobs.OnApplicationStart;
import play.modules.morphia.CacheEntity;
import java.util.ArrayList;
import java.util.List;
/**
* Created with IntelliJ IDEA.
* User: luog
* Date: 29/11/12
* Time: 11:40 AM
* To change this template use File | Settings | File Templates.
*/
@Entity
public class WithOutCache extends CacheTestModel {
@OnApplicationStart
public static class Initializer extends Job {
@Override
public void doJob() throws Exception {
WithOutCache.deleteAll();
List<WithOutCache> entities = new ArrayList<WithOutCache>(1000);
for (int i = 0; i < 1000; ++i) {
entities.add(new WithOutCache());
}
WithOutCache.insert(entities);
}
}
}
|
[
"greenlaw110@gmail.com"
] |
greenlaw110@gmail.com
|
001b9ffef5407c32fba61d2192aba7e65620502c
|
139960e2d7d55e71c15e6a63acb6609e142a2ace
|
/mobile_app1/module437/src/main/java/module437packageJava0/Foo3.java
|
ddc1e35f54bf8dc12b7b9c893357a1fd1ed65373
|
[
"Apache-2.0"
] |
permissive
|
uber-common/android-build-eval
|
448bfe141b6911ad8a99268378c75217d431766f
|
7723bfd0b9b1056892cef1fef02314b435b086f2
|
refs/heads/master
| 2023-02-18T22:25:15.121902
| 2023-02-06T19:35:34
| 2023-02-06T19:35:34
| 294,831,672
| 83
| 7
|
Apache-2.0
| 2021-09-24T08:55:30
| 2020-09-11T23:27:37
|
Java
|
UTF-8
|
Java
| false
| false
| 606
|
java
|
package module437packageJava0;
import java.lang.Integer;
public class Foo3 {
Integer int0;
Integer int1;
Integer int2;
public void foo0() {
new module437packageJava0.Foo2().foo10();
}
public void foo1() {
foo0();
}
public void foo2() {
foo1();
}
public void foo3() {
foo2();
}
public void foo4() {
foo3();
}
public void foo5() {
foo4();
}
public void foo6() {
foo5();
}
public void foo7() {
foo6();
}
public void foo8() {
foo7();
}
public void foo9() {
foo8();
}
public void foo10() {
foo9();
}
}
|
[
"oliviern@uber.com"
] |
oliviern@uber.com
|
45d7574d76d31e67c9f483153c24fa8d8d1a033e
|
e2f1b18cd6ca38adc2e286354e01cbe4d4423fd9
|
/src/com/javarush/test/level14/lesson08/bonus02/Solution.java
|
99d2d4db7948c3f952a27290c6f5eb9cb3e1d49e
|
[] |
no_license
|
Polurival/JRHW
|
092ab6d034d6e46dd99d57b67910ca4a7749f602
|
6f08a005d5b444f6ad00df80aa0eac645b662831
|
refs/heads/master
| 2020-04-10T10:12:38.467016
| 2016-05-09T11:47:33
| 2016-05-09T11:47:33
| 50,867,434
| 7
| 14
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 978
|
java
|
package com.javarush.test.level14.lesson08.bonus02;
/* НОД
Наибольший общий делитель (НОД).
Ввести с клавиатуры 2 целых положительных числа.
Вывести в консоль наибольший общий делитель.
*/
import java.io.BufferedReader;
import java.io.InputStreamReader;
public class Solution
{
public static void main(String[] args) throws Exception
{
BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
int n1 = Integer.parseInt(reader.readLine());
int n2 = Integer.parseInt(reader.readLine());
int max = n1 > n2 ? n1 : n2;
int min;
if (max == n1) min = n2; else min = n1;
int i = max;
while (true)
{
if ((max % i == 0) && (min % i == 0))
{
System.out.println(i);
break;
}
i--;
}
}
}
|
[
"polurival@gmail.com"
] |
polurival@gmail.com
|
fe10e48cbaa57d8fc04552df9cb0db5a87d1c19d
|
995f73d30450a6dce6bc7145d89344b4ad6e0622
|
/Mate20-9.0/src/main/java/sun/nio/fs/LinuxFileSystem.java
|
2ec6d8f5d9978590915e859027ddc3b0451df359
|
[] |
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
| 2,536
|
java
|
package sun.nio.fs;
import java.io.IOException;
import java.nio.file.FileStore;
import java.nio.file.WatchService;
import java.util.ArrayList;
import java.util.Collections;
import java.util.HashSet;
import java.util.Set;
class LinuxFileSystem extends UnixFileSystem {
private static class SupportedFileFileAttributeViewsHolder {
static final Set<String> supportedFileAttributeViews = supportedFileAttributeViews();
private SupportedFileFileAttributeViewsHolder() {
}
private static Set<String> supportedFileAttributeViews() {
Set<String> result = new HashSet<>();
result.addAll(UnixFileSystem.standardFileAttributeViews());
result.add("dos");
result.add("user");
return Collections.unmodifiableSet(result);
}
}
LinuxFileSystem(UnixFileSystemProvider provider, String dir) {
super(provider, dir);
}
public WatchService newWatchService() throws IOException {
return new LinuxWatchService(this);
}
public Set<String> supportedFileAttributeViews() {
return SupportedFileFileAttributeViewsHolder.supportedFileAttributeViews;
}
/* access modifiers changed from: package-private */
public void copyNonPosixAttributes(int ofd, int nfd) {
LinuxUserDefinedFileAttributeView.copyExtendedAttributes(ofd, nfd);
}
/* access modifiers changed from: package-private */
public Iterable<UnixMountEntry> getMountEntries(String fstab) {
long fp;
ArrayList<UnixMountEntry> entries = new ArrayList<>();
try {
fp = LinuxNativeDispatcher.setmntent(Util.toBytes(fstab), Util.toBytes("r"));
while (true) {
UnixMountEntry entry = new UnixMountEntry();
if (LinuxNativeDispatcher.getmntent(fp, entry) < 0) {
break;
}
entries.add(entry);
}
LinuxNativeDispatcher.endmntent(fp);
} catch (UnixException e) {
} catch (Throwable th) {
LinuxNativeDispatcher.endmntent(fp);
throw th;
}
return entries;
}
/* access modifiers changed from: package-private */
public Iterable<UnixMountEntry> getMountEntries() {
return getMountEntries("/proc/mounts");
}
/* access modifiers changed from: package-private */
public FileStore getFileStore(UnixMountEntry entry) throws IOException {
return new LinuxFileStore(this, entry);
}
}
|
[
"dstmath@163.com"
] |
dstmath@163.com
|
f7bfe13e06af48132003934bf443fdf3747d610b
|
73d87fd42cf2d2cc92ba541ee9d4e07d9677911e
|
/src/main/java/net/malisis/doors/renderer/animation/transformation/ITransformable.java
|
79c4aa858110883da9989ab40ac2838ce339df1b
|
[
"MIT"
] |
permissive
|
ferreusveritas/MalisisDoorsLean
|
8f2f050bc6e99251d8cd4daec0a47ffb9789694b
|
e062ff00a08f54933aa2c15332287ca4559f7043
|
refs/heads/main
| 2023-01-22T16:12:21.250827
| 2020-11-26T04:22:26
| 2020-11-26T04:22:26
| 316,119,873
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 2,489
|
java
|
/*
* The MIT License (MIT)
*
* Copyright (c) 2014 Ordinastie
*
* 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 net.malisis.doors.renderer.animation.transformation;
import net.malisis.doors.util.EnumFacingUtils;
import net.minecraft.util.EnumFacing;
/**
* @author Ordinastie
*
*/
public interface ITransformable
{
public static interface Translate extends ITransformable
{
public void translate(float x, float y, float z);
}
public static interface Rotate extends ITransformable
{
public void rotate(float angle, float x, float y, float z, float offsetX, float offsetY, float offsetZ);
public default void rotate(EnumFacing direction)
{
if (direction == EnumFacing.SOUTH)
return;
rotate(90 * EnumFacingUtils.getRotationCount(direction), 0, 1, 0, 0, 0, 0);
}
}
public static interface Scale extends ITransformable
{
public void scale(float x, float y, float z, float offsetX, float offsetY, float offsetZ);
}
public static interface Color extends ITransformable
{
public void setColor(int color);
}
public static interface Alpha extends ITransformable
{
public void setAlpha(int alpha);
}
public static interface Brightness extends ITransformable
{
public void setBrightness(int brightness);
}
public interface Position<T> extends ITransformable
{
public T setPosition(int x, int y);
}
public interface Size<T> extends ITransformable
{
public T setSize(int width, int height);
}
}
|
[
"ferreusveritas@gmail.com"
] |
ferreusveritas@gmail.com
|
5efc265c4872832fc67171d96f69ce1eead2926f
|
8144109825c42ea7d1aac99e059e2e3cd4831faf
|
/Advjava/Lab20/src/com/jlcindia/servlet/HelloServlet.java
|
0b50215d716b503f6d03606c7e654c26cfc13c83
|
[] |
no_license
|
binodjava/JavaPractice
|
bf39eba39390dff0fc2aa4b427f65d4c889a50eb
|
3c0a774749eed6804d8e85298d2053b191e9c9b2
|
refs/heads/master
| 2021-05-10T21:20:48.779486
| 2018-01-25T06:37:41
| 2018-01-25T06:37:41
| 118,221,132
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 736
|
java
|
package com.jlcindia.servlet;
import java.io.IOException;
import java.io.Writer;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
/**
* Servlet implementation class HelloServlet
*/
public class HelloServlet extends HttpServlet {
private static final long serialVersionUID = 1L;
@Override
protected void service(HttpServletRequest req, HttpServletResponse res)
throws ServletException, IOException {
System.out.println(" HelloServlet class service()");
Writer out = res.getWriter();
out.write("<h1>Verify the server console");
System.out.println("HelloServlet class service() Completed");
}
}
|
[
"binodk.java@gmail.com"
] |
binodk.java@gmail.com
|
dfcad80ece9aa4f643231a0d1c8e55df19bfd9a8
|
ce038793e39acb67002643935b858e7fe75283a7
|
/Themes/38. Tree/src/ru/itis/Main.java
|
5dddd8ada89518dce33d8afd77fff76d0ee609f1
|
[] |
no_license
|
MarselSidikov/11-802
|
1add06cc48683469d6a710e5603008c223e2a897
|
c4580078e0d056803b20c68a7c1ab6c47f27b9f5
|
refs/heads/master
| 2020-03-27T21:52:46.784136
| 2019-04-16T10:30:13
| 2019-04-16T10:30:13
| 147,183,087
| 2
| 2
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 323
|
java
|
package ru.itis;
public class Main {
public static void main(String[] args) {
int array[] = {5, 4, 8, 2, 5, 6, 10, 1, 3, 6, 7, 4};
Tree<Integer> tree = new TreeBstImpl<>();
for (int i = 0; i < array.length; i++) {
tree.insert(array[i]);
}
tree.print();
}
}
|
[
"sidikov.marsel@gmail.com"
] |
sidikov.marsel@gmail.com
|
7104507025762e8a950e21a173722fb7d54eb93f
|
332e1134d1085c356e2615c10249e6c65f6867f7
|
/src/com/cos/keep/action/Action.java
|
0bd96d0b26144a511e86f653fe2d969eb835c838
|
[] |
no_license
|
star1606/Keep-Project
|
6f5a7b7b821393daca11dacecbe32a019d886994
|
8e1888e5bdc315203f03cda413436674cc91636a
|
refs/heads/master
| 2022-12-13T17:03:18.454152
| 2020-09-09T10:21:35
| 2020-09-09T10:21:35
| 274,087,125
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 333
|
java
|
package com.cos.keep.action;
import java.io.IOException;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
public interface Action {
void execute(HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException;
}
|
[
"you@example.com"
] |
you@example.com
|
47e3f5cf6b4f9434d7611d7ae5c3b712c587c7e2
|
da75f7294ae1a08fc40dd0f542deef05eafdf23f
|
/src/test/java/com/school/app/service/UserServiceIT.java
|
98b07013e0b8dc582429693f1f411b096d210f3d
|
[] |
no_license
|
ppavan895/school-management-application
|
63b22f463e2ce630d88be7a679adbab89c9c8e35
|
fa7c799a417eb2691842dcd63a7b7aede3f3c09d
|
refs/heads/master
| 2022-05-05T18:21:02.282521
| 2020-03-11T07:50:49
| 2020-03-11T07:50:49
| 246,507,488
| 0
| 0
| null | 2022-03-08T21:18:51
| 2020-03-11T07:50:32
|
Java
|
UTF-8
|
Java
| false
| false
| 7,699
|
java
|
package com.school.app.service;
import static org.assertj.core.api.Assertions.assertThat;
import static org.mockito.Mockito.when;
import com.school.app.SchoolManagementApplication2020App;
import com.school.app.config.Constants;
import com.school.app.domain.User;
import com.school.app.repository.UserRepository;
import com.school.app.service.dto.UserDTO;
import io.github.jhipster.security.RandomUtil;
import java.time.Instant;
import java.time.LocalDateTime;
import java.time.temporal.ChronoUnit;
import java.util.List;
import java.util.Optional;
import org.apache.commons.lang3.RandomStringUtils;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import org.mockito.Mock;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.data.auditing.AuditingHandler;
import org.springframework.data.auditing.DateTimeProvider;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.PageRequest;
import org.springframework.transaction.annotation.Transactional;
/**
* Integration tests for {@link UserService}.
*/
@SpringBootTest(classes = SchoolManagementApplication2020App.class)
@Transactional
public class UserServiceIT {
private static final String DEFAULT_LOGIN = "johndoe";
private static final String DEFAULT_EMAIL = "johndoe@localhost";
private static final String DEFAULT_FIRSTNAME = "john";
private static final String DEFAULT_LASTNAME = "doe";
private static final String DEFAULT_IMAGEURL = "http://placehold.it/50x50";
private static final String DEFAULT_LANGKEY = "dummy";
@Autowired
private UserRepository userRepository;
@Autowired
private UserService userService;
@Autowired
private AuditingHandler auditingHandler;
@Mock
private DateTimeProvider dateTimeProvider;
private User user;
@BeforeEach
public void init() {
user = new User();
user.setLogin(DEFAULT_LOGIN);
user.setPassword(RandomStringUtils.random(60));
user.setActivated(true);
user.setEmail(DEFAULT_EMAIL);
user.setFirstName(DEFAULT_FIRSTNAME);
user.setLastName(DEFAULT_LASTNAME);
user.setImageUrl(DEFAULT_IMAGEURL);
user.setLangKey(DEFAULT_LANGKEY);
when(dateTimeProvider.getNow()).thenReturn(Optional.of(LocalDateTime.now()));
auditingHandler.setDateTimeProvider(dateTimeProvider);
}
@Test
@Transactional
public void assertThatUserMustExistToResetPassword() {
userRepository.saveAndFlush(user);
Optional<User> maybeUser = userService.requestPasswordReset("invalid.login@localhost");
assertThat(maybeUser).isNotPresent();
maybeUser = userService.requestPasswordReset(user.getEmail());
assertThat(maybeUser).isPresent();
assertThat(maybeUser.orElse(null).getEmail()).isEqualTo(user.getEmail());
assertThat(maybeUser.orElse(null).getResetDate()).isNotNull();
assertThat(maybeUser.orElse(null).getResetKey()).isNotNull();
}
@Test
@Transactional
public void assertThatOnlyActivatedUserCanRequestPasswordReset() {
user.setActivated(false);
userRepository.saveAndFlush(user);
Optional<User> maybeUser = userService.requestPasswordReset(user.getLogin());
assertThat(maybeUser).isNotPresent();
userRepository.delete(user);
}
@Test
@Transactional
public void assertThatResetKeyMustNotBeOlderThan24Hours() {
Instant daysAgo = Instant.now().minus(25, ChronoUnit.HOURS);
String resetKey = RandomUtil.generateResetKey();
user.setActivated(true);
user.setResetDate(daysAgo);
user.setResetKey(resetKey);
userRepository.saveAndFlush(user);
Optional<User> maybeUser = userService.completePasswordReset("johndoe2", user.getResetKey());
assertThat(maybeUser).isNotPresent();
userRepository.delete(user);
}
@Test
@Transactional
public void assertThatResetKeyMustBeValid() {
Instant daysAgo = Instant.now().minus(25, ChronoUnit.HOURS);
user.setActivated(true);
user.setResetDate(daysAgo);
user.setResetKey("1234");
userRepository.saveAndFlush(user);
Optional<User> maybeUser = userService.completePasswordReset("johndoe2", user.getResetKey());
assertThat(maybeUser).isNotPresent();
userRepository.delete(user);
}
@Test
@Transactional
public void assertThatUserCanResetPassword() {
String oldPassword = user.getPassword();
Instant daysAgo = Instant.now().minus(2, ChronoUnit.HOURS);
String resetKey = RandomUtil.generateResetKey();
user.setActivated(true);
user.setResetDate(daysAgo);
user.setResetKey(resetKey);
userRepository.saveAndFlush(user);
Optional<User> maybeUser = userService.completePasswordReset("johndoe2", user.getResetKey());
assertThat(maybeUser).isPresent();
assertThat(maybeUser.orElse(null).getResetDate()).isNull();
assertThat(maybeUser.orElse(null).getResetKey()).isNull();
assertThat(maybeUser.orElse(null).getPassword()).isNotEqualTo(oldPassword);
userRepository.delete(user);
}
@Test
@Transactional
public void assertThatNotActivatedUsersWithNotNullActivationKeyCreatedBefore3DaysAreDeleted() {
Instant now = Instant.now();
when(dateTimeProvider.getNow()).thenReturn(Optional.of(now.minus(4, ChronoUnit.DAYS)));
user.setActivated(false);
user.setActivationKey(RandomStringUtils.random(20));
User dbUser = userRepository.saveAndFlush(user);
dbUser.setCreatedDate(now.minus(4, ChronoUnit.DAYS));
userRepository.saveAndFlush(user);
List<User> users = userRepository.findAllByActivatedIsFalseAndActivationKeyIsNotNullAndCreatedDateBefore(
now.minus(3, ChronoUnit.DAYS)
);
assertThat(users).isNotEmpty();
userService.removeNotActivatedUsers();
users = userRepository.findAllByActivatedIsFalseAndActivationKeyIsNotNullAndCreatedDateBefore(now.minus(3, ChronoUnit.DAYS));
assertThat(users).isEmpty();
}
@Test
@Transactional
public void assertThatNotActivatedUsersWithNullActivationKeyCreatedBefore3DaysAreNotDeleted() {
Instant now = Instant.now();
when(dateTimeProvider.getNow()).thenReturn(Optional.of(now.minus(4, ChronoUnit.DAYS)));
user.setActivated(false);
User dbUser = userRepository.saveAndFlush(user);
dbUser.setCreatedDate(now.minus(4, ChronoUnit.DAYS));
userRepository.saveAndFlush(user);
List<User> users = userRepository.findAllByActivatedIsFalseAndActivationKeyIsNotNullAndCreatedDateBefore(
now.minus(3, ChronoUnit.DAYS)
);
assertThat(users).isEmpty();
userService.removeNotActivatedUsers();
Optional<User> maybeDbUser = userRepository.findById(dbUser.getId());
assertThat(maybeDbUser).contains(dbUser);
}
@Test
@Transactional
public void assertThatAnonymousUserIsNotGet() {
user.setLogin(Constants.ANONYMOUS_USER);
if (!userRepository.findOneByLogin(Constants.ANONYMOUS_USER).isPresent()) {
userRepository.saveAndFlush(user);
}
final PageRequest pageable = PageRequest.of(0, (int) userRepository.count());
final Page<UserDTO> allManagedUsers = userService.getAllManagedUsers(pageable);
assertThat(allManagedUsers.getContent().stream().noneMatch(user -> Constants.ANONYMOUS_USER.equals(user.getLogin()))).isTrue();
}
}
|
[
"jhipster-bot@jhipster.tech"
] |
jhipster-bot@jhipster.tech
|
42f73c89582f0bca532ecc91e22cdac7ec0d94dd
|
9b272499778b3e727f792b655b5767231184302f
|
/swarmic-modules/web-spi/src/main/java/org/swarmic/web/spi/WebServerConfiguration.java
|
f4f1a9294ca832b4756fafb792bbcd6cb270f067
|
[
"Apache-2.0"
] |
permissive
|
cybernetics/swarmic
|
d073e85def29b2daece3a05c128ce8db1c39b3c2
|
62fb76d1042f49ffd05183f0ff010c7d1938005d
|
refs/heads/master
| 2020-12-01T09:31:35.609318
| 2016-06-27T16:10:22
| 2016-06-27T16:10:22
| null | 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 1,161
|
java
|
/*
* JBoss, Home of Professional Open Source
* Copyright 2016, Red Hat, Inc., and individual contributors
* by the @authors tag.
*
* 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.swarmic.web.spi;
import org.apache.tamaya.inject.api.Config;
import javax.enterprise.inject.Vetoed;
@Vetoed
public class WebServerConfiguration {
@Config(value = "webserver.port", defaultValue = "8080")
private int webserverPort;
@Config(value = "file.dir", defaultValue = "/tmp")
private String fileDir;
public int getWebserverPort() {
return webserverPort;
}
public String getFileDir() {
return fileDir;
}
}
|
[
"antoine@sabot-durand.net"
] |
antoine@sabot-durand.net
|
17d0d9e3614c51d9ebfcfc7b555c039d5d154252
|
53d677a55e4ece8883526738f1c9d00fa6560ff7
|
/com/tencent/mm/plugin/appbrand/ui/recents/c.java
|
d7a627a5e2df7fdd4a530f26538db4cadb232bf8
|
[] |
no_license
|
0jinxing/wechat-apk-source
|
544c2d79bfc10261eb36389c1edfdf553d8f312a
|
f75eefd87e9b9ecf2f76fc6d48dbba8e24afcf3d
|
refs/heads/master
| 2020-06-07T20:06:03.580028
| 2019-06-21T09:17:26
| 2019-06-21T09:17:26
| 193,069,132
| 9
| 4
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 2,757
|
java
|
package com.tencent.mm.plugin.appbrand.ui.recents;
import a.f.b.j;
import a.l;
import android.app.Activity;
import android.content.Context;
import android.content.Intent;
import android.view.View;
import android.view.ViewGroup;
import com.tencent.matrix.trace.core.AppMethodBeat;
import com.tencent.mm.plugin.appbrand.app.f;
import com.tencent.mm.plugin.appbrand.appusage.LocalUsageInfo;
import com.tencent.mm.plugin.appbrand.appusage.w;
import com.tencent.mm.plugin.appbrand.ui.AppBrandLauncherFolderUI;
import com.tencent.mm.plugin.appbrand.ui.AppBrandLauncherFolderUI.a;
import com.tencent.mm.plugin.appbrand.widget.AppBrandNearbyShowcaseView;
import java.util.List;
@l(dWo={1, 1, 13}, dWp={""}, dWq={"Lcom/tencent/mm/plugin/appbrand/ui/recents/AppBrandLauncherHeaderRecentsEntrance;", "Lcom/tencent/mm/plugin/appbrand/ui/recents/AppBrandLauncherListHeaderFolderEntrance;", "Lcom/tencent/mm/plugin/appbrand/appusage/AppBrandUsageStorage;", "activity", "Landroid/app/Activity;", "viewGroup", "Landroid/view/ViewGroup;", "(Landroid/app/Activity;Landroid/view/ViewGroup;)V", "getTitle", "", "onClick", "", "v", "Landroid/view/View;", "queryList", "", "Lcom/tencent/mm/plugin/appbrand/appusage/LocalUsageInfo;", "shouldShowcaseEnableSwitch", "show", "", "plugin-appbrand-integration_release"})
public final class c extends d<w>
{
public c(Activity paramActivity, ViewGroup paramViewGroup)
{
super(w.class, paramActivity, paramViewGroup);
}
protected final List<? extends LocalUsageInfo> aNk()
{
AppMethodBeat.i(135130);
List localList = (List)((w)f.E(w.class)).nD(this.iMb);
AppMethodBeat.o(135130);
return localList;
}
public final void eH(boolean paramBoolean)
{
AppMethodBeat.i(135129);
this.iMd.post((Runnable)new c.a(this, paramBoolean));
AppMethodBeat.o(135129);
}
protected final String getTitle()
{
AppMethodBeat.i(135131);
String str = getActivity().getString(2131296800);
j.o(str, "activity.getString(com.t…eader_recent_tag_wording)");
AppMethodBeat.o(135131);
return str;
}
public final void onClick(View paramView)
{
AppMethodBeat.i(135132);
paramView = AppBrandLauncherFolderUI.iGG;
paramView = getActivity();
j.o(paramView, "activity");
Context localContext = (Context)paramView;
paramView = new Intent();
paramView.putExtra("extra_get_usage_reason", 3);
AppBrandLauncherFolderUI.a.o(localContext, paramView);
AppMethodBeat.o(135132);
}
}
/* Location: C:\Users\Lin\Downloads\dex-tools-2.1-SNAPSHOT\dex-tools-2.1-SNAPSHOT\classes-dex2jar.jar
* Qualified Name: com.tencent.mm.plugin.appbrand.ui.recents.c
* JD-Core Version: 0.6.2
*/
|
[
"172601673@qq.com"
] |
172601673@qq.com
|
d80fa7a2afbb1d1c748f5370d5c3200b931f1e5f
|
ab52bb58aab8104c26db2a6690ec1986ac37dd62
|
/main6/diplomat/dev/src/java/com/globalsight/cxe/entity/filterconfiguration/POFilter.java
|
1bafe6629e757ee326f0e4a86ba6c3095dd03772
|
[] |
no_license
|
tingley/globalsight
|
32ae49ac08c671d9166bd0d6cdaa349d9e6b4438
|
47d95929f4e9939ba8bbbcb5544de357fef9aa8c
|
refs/heads/master
| 2021-01-19T07:23:33.073276
| 2020-10-19T19:42:22
| 2020-10-19T19:42:22
| 14,053,692
| 7
| 6
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 4,979
|
java
|
/**
* Copyright 2009 Welocalize, 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.globalsight.cxe.entity.filterconfiguration;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.Locale;
import java.util.Map;
import com.globalsight.everest.util.comparator.FilterComparator;
import com.globalsight.persistence.hibernate.HibernateUtil;
import com.globalsight.util.SortUtil;
public class POFilter implements Filter
{
private long id;
private String filterName;
private String filterDescription;
private long secondFilterId = -2;
private String secondFilterTableName = null;
private long companyId;
@SuppressWarnings("unchecked")
public ArrayList<Filter> getFilters(long companyId)
{
ArrayList<Filter> filters = null;
filters = new ArrayList<Filter>();
String hql = "from POFilter f where f.companyId=" + companyId;
try
{
filters = (ArrayList<Filter>) HibernateUtil.search(hql);
}
catch (Exception e)
{
e.printStackTrace();
}
SortUtil.sort(filters, new FilterComparator(Locale.getDefault()));
return filters;
}
public boolean checkExistsNew(String filterName, long companyId)
{
String hql = "from POFilter f " + "where f.filterName =:filterName "
+ "and f.companyId =:companyId";
Map map = new HashMap();
map.put("filterName", filterName);
map.put("companyId", companyId);
return HibernateUtil.search(hql, map).size() > 0;
}
public boolean checkExistsEdit(long filterId, String filterName, long companyId)
{
String hql = "from POFilter f " + "where f.id <>:filterId " + "and f.filterName =:filterName "
+ "and f.companyId =:companyId";
Map map = new HashMap();
map.put("filterId", filterId);
map.put("filterName", filterName);
map.put("companyId", companyId);
return HibernateUtil.search(hql, map).size() > 0;
}
public String getFilterTableName()
{
return FilterConstants.PO_TABLENAME;
}
public String toJSON(long companyId)
{
long baseFilterId = BaseFilterManager.getBaseFilterIdByMapping(id,
getFilterTableName());
StringBuilder sb = new StringBuilder();
sb.append("{");
sb.append("\"filterTableName\":")
.append("\"" + getFilterTableName() + "\"").append(",");
sb.append("\"id\":").append(id).append(",");
sb.append("\"filterName\":").append("\"")
.append(FilterHelper.escape(filterName)).append("\"")
.append(",");
sb.append("\"filterDescription\":").append("\"")
.append(FilterHelper.escape(filterDescription)).append("\"")
.append(",");
sb.append("\"companyId\":").append(companyId).append(",");
sb.append("\"secondFilterId\":").append(secondFilterId).append(",");
sb.append("\"secondFilterTableName\":").append("\"")
.append(FilterHelper.escape(secondFilterTableName))
.append("\"").append(",");
sb.append("\"baseFilterId\":").append("\"").append(baseFilterId)
.append("\"");
sb.append("}");
return sb.toString();
}
public long getId()
{
return id;
}
public void setId(long id)
{
this.id = id;
}
public String getFilterName()
{
return filterName;
}
public void setFilterName(String filterName)
{
this.filterName = filterName;
}
public String getFilterDescription()
{
return filterDescription;
}
public void setFilterDescription(String filterDescription)
{
this.filterDescription = filterDescription;
}
public long getCompanyId()
{
return companyId;
}
public void setCompanyId(long companyId)
{
this.companyId = companyId;
}
public void setSecondFilterId(long secondFilterId)
{
this.secondFilterId = secondFilterId;
}
public long getSecondFilterId()
{
return this.secondFilterId;
}
public void setSecondFilterTableName(String secondFilterTableName)
{
this.secondFilterTableName = secondFilterTableName;
}
public String getSecondFilterTableName()
{
return this.secondFilterTableName;
}
}
|
[
"kenny.jiang@welocalize.com"
] |
kenny.jiang@welocalize.com
|
958981d724090550d5dc669f1a365bd469f75517
|
59ca721ca1b2904fbdee2350cd002e1e5f17bd54
|
/aliyun-java-sdk-jaq/src/main/java/com/aliyuncs/jaq/model/v20161123/OtherPreventionRequest.java
|
c3998361239f4f7d80d3c63fb96ed284bee41308
|
[
"Apache-2.0"
] |
permissive
|
longtx/aliyun-openapi-java-sdk
|
8fadfd08fbcf00c4c5c1d9067cfad20a14e42c9c
|
7a9ab9eb99566b9e335465a3358553869563e161
|
refs/heads/master
| 2020-04-26T02:00:35.360905
| 2019-02-28T13:47:08
| 2019-02-28T13:47:08
| 173,221,745
| 2
| 0
|
NOASSERTION
| 2019-03-01T02:33:35
| 2019-03-01T02:33:35
| null |
UTF-8
|
Java
| false
| false
| 7,186
|
java
|
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
package com.aliyuncs.jaq.model.v20161123;
import com.aliyuncs.RpcAcsRequest;
/**
* @author auto create
* @version
*/
public class OtherPreventionRequest extends RpcAcsRequest<OtherPreventionResponse> {
public OtherPreventionRequest() {
super("jaq", "2016-11-23", "OtherPrevention");
}
private String callerName;
private String ip;
private String protocolVersion;
private Integer source;
private String phoneNumber;
private String email;
private String userId;
private Integer idType;
private String currentUrl;
private String agent;
private String cookie;
private String sessionId;
private String macAddress;
private String referer;
private String userName;
private String companyName;
private String address;
private String iDNumber;
private String bankCardNumber;
private String registerIp;
private Long registerDate;
private String loginIp;
private Long loginDate;
private String extendData;
private String passwordHash;
private String jsToken;
private String sDKToken;
public String getCallerName() {
return this.callerName;
}
public void setCallerName(String callerName) {
this.callerName = callerName;
putQueryParameter("CallerName", callerName);
}
public String getIp() {
return this.ip;
}
public void setIp(String ip) {
this.ip = ip;
putQueryParameter("Ip", ip);
}
public String getProtocolVersion() {
return this.protocolVersion;
}
public void setProtocolVersion(String protocolVersion) {
this.protocolVersion = protocolVersion;
putQueryParameter("ProtocolVersion", protocolVersion);
}
public Integer getSource() {
return this.source;
}
public void setSource(Integer source) {
this.source = source;
putQueryParameter("Source", source);
}
public String getPhoneNumber() {
return this.phoneNumber;
}
public void setPhoneNumber(String phoneNumber) {
this.phoneNumber = phoneNumber;
putQueryParameter("PhoneNumber", phoneNumber);
}
public String getEmail() {
return this.email;
}
public void setEmail(String email) {
this.email = email;
putQueryParameter("Email", email);
}
public String getUserId() {
return this.userId;
}
public void setUserId(String userId) {
this.userId = userId;
putQueryParameter("UserId", userId);
}
public Integer getIdType() {
return this.idType;
}
public void setIdType(Integer idType) {
this.idType = idType;
putQueryParameter("IdType", idType);
}
public String getCurrentUrl() {
return this.currentUrl;
}
public void setCurrentUrl(String currentUrl) {
this.currentUrl = currentUrl;
putQueryParameter("CurrentUrl", currentUrl);
}
public String getAgent() {
return this.agent;
}
public void setAgent(String agent) {
this.agent = agent;
putQueryParameter("Agent", agent);
}
public String getCookie() {
return this.cookie;
}
public void setCookie(String cookie) {
this.cookie = cookie;
putQueryParameter("Cookie", cookie);
}
public String getSessionId() {
return this.sessionId;
}
public void setSessionId(String sessionId) {
this.sessionId = sessionId;
putQueryParameter("SessionId", sessionId);
}
public String getMacAddress() {
return this.macAddress;
}
public void setMacAddress(String macAddress) {
this.macAddress = macAddress;
putQueryParameter("MacAddress", macAddress);
}
public String getReferer() {
return this.referer;
}
public void setReferer(String referer) {
this.referer = referer;
putQueryParameter("Referer", referer);
}
public String getUserName() {
return this.userName;
}
public void setUserName(String userName) {
this.userName = userName;
putQueryParameter("UserName", userName);
}
public String getCompanyName() {
return this.companyName;
}
public void setCompanyName(String companyName) {
this.companyName = companyName;
putQueryParameter("CompanyName", companyName);
}
public String getAddress() {
return this.address;
}
public void setAddress(String address) {
this.address = address;
putQueryParameter("Address", address);
}
public String getIDNumber() {
return this.iDNumber;
}
public void setIDNumber(String iDNumber) {
this.iDNumber = iDNumber;
putQueryParameter("IDNumber", iDNumber);
}
public String getBankCardNumber() {
return this.bankCardNumber;
}
public void setBankCardNumber(String bankCardNumber) {
this.bankCardNumber = bankCardNumber;
putQueryParameter("BankCardNumber", bankCardNumber);
}
public String getRegisterIp() {
return this.registerIp;
}
public void setRegisterIp(String registerIp) {
this.registerIp = registerIp;
putQueryParameter("RegisterIp", registerIp);
}
public Long getRegisterDate() {
return this.registerDate;
}
public void setRegisterDate(Long registerDate) {
this.registerDate = registerDate;
putQueryParameter("RegisterDate", registerDate);
}
public String getLoginIp() {
return this.loginIp;
}
public void setLoginIp(String loginIp) {
this.loginIp = loginIp;
putQueryParameter("LoginIp", loginIp);
}
public Long getLoginDate() {
return this.loginDate;
}
public void setLoginDate(Long loginDate) {
this.loginDate = loginDate;
putQueryParameter("LoginDate", loginDate);
}
public String getExtendData() {
return this.extendData;
}
public void setExtendData(String extendData) {
this.extendData = extendData;
putQueryParameter("ExtendData", extendData);
}
public String getPasswordHash() {
return this.passwordHash;
}
public void setPasswordHash(String passwordHash) {
this.passwordHash = passwordHash;
putQueryParameter("PasswordHash", passwordHash);
}
public String getJsToken() {
return this.jsToken;
}
public void setJsToken(String jsToken) {
this.jsToken = jsToken;
putQueryParameter("JsToken", jsToken);
}
public String getSDKToken() {
return this.sDKToken;
}
public void setSDKToken(String sDKToken) {
this.sDKToken = sDKToken;
putQueryParameter("SDKToken", sDKToken);
}
@Override
public Class<OtherPreventionResponse> getResponseClass() {
return OtherPreventionResponse.class;
}
}
|
[
"ling.wu@alibaba-inc.com"
] |
ling.wu@alibaba-inc.com
|
6903eafb945a71802ec4bdb6858d17ae92c8b375
|
09d0ddd512472a10bab82c912b66cbb13113fcbf
|
/TestApplications/privacy-friendly-netmonitor-2.0/DecompiledCode/Procyon/src/main/java/android/support/v7/widget/ScrollbarHelper.java
|
de65b24fd0860f66a779d71a9d764c513e2c1ba5
|
[] |
no_license
|
sgros/activity_flow_plugin
|
bde2de3745d95e8097c053795c9e990c829a88f4
|
9e59f8b3adacf078946990db9c58f4965a5ccb48
|
refs/heads/master
| 2020-06-19T02:39:13.865609
| 2019-07-08T20:17:28
| 2019-07-08T20:17:28
| null | 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 2,538
|
java
|
//
// Decompiled by Procyon v0.5.34
//
package android.support.v7.widget;
import android.view.View;
class ScrollbarHelper
{
static int computeScrollExtent(final RecyclerView.State state, final OrientationHelper orientationHelper, final View view, final View view2, final RecyclerView.LayoutManager layoutManager, final boolean b) {
if (layoutManager.getChildCount() == 0 || state.getItemCount() == 0 || view == null || view2 == null) {
return 0;
}
if (!b) {
return Math.abs(layoutManager.getPosition(view) - layoutManager.getPosition(view2)) + 1;
}
return Math.min(orientationHelper.getTotalSpace(), orientationHelper.getDecoratedEnd(view2) - orientationHelper.getDecoratedStart(view));
}
static int computeScrollOffset(final RecyclerView.State state, final OrientationHelper orientationHelper, final View view, final View view2, final RecyclerView.LayoutManager layoutManager, final boolean b, final boolean b2) {
if (layoutManager.getChildCount() == 0 || state.getItemCount() == 0 || view == null || view2 == null) {
return 0;
}
final int min = Math.min(layoutManager.getPosition(view), layoutManager.getPosition(view2));
final int max = Math.max(layoutManager.getPosition(view), layoutManager.getPosition(view2));
int n;
if (b2) {
n = Math.max(0, state.getItemCount() - max - 1);
}
else {
n = Math.max(0, min);
}
if (!b) {
return n;
}
return Math.round(n * (Math.abs(orientationHelper.getDecoratedEnd(view2) - orientationHelper.getDecoratedStart(view)) / (float)(Math.abs(layoutManager.getPosition(view) - layoutManager.getPosition(view2)) + 1)) + (orientationHelper.getStartAfterPadding() - orientationHelper.getDecoratedStart(view)));
}
static int computeScrollRange(final RecyclerView.State state, final OrientationHelper orientationHelper, final View view, final View view2, final RecyclerView.LayoutManager layoutManager, final boolean b) {
if (layoutManager.getChildCount() == 0 || state.getItemCount() == 0 || view == null || view2 == null) {
return 0;
}
if (!b) {
return state.getItemCount();
}
return (int)((orientationHelper.getDecoratedEnd(view2) - orientationHelper.getDecoratedStart(view)) / (float)(Math.abs(layoutManager.getPosition(view) - layoutManager.getPosition(view2)) + 1) * state.getItemCount());
}
}
|
[
"crash@home.home.hr"
] |
crash@home.home.hr
|
4ef96e4cbf0821a27114dc217f9f751e54a864a2
|
3aae807a46494cdc9441c016a91447c6197f2af5
|
/src/main/java/uk/ac/ebi/pride/toolsuite/gui/component/sequence/PeptideAnnotation.java
|
1f4efdc51dd519b6c740cd9c8795770dd8d98683
|
[
"Apache-2.0"
] |
permissive
|
PRIDE-Toolsuite/pride-inspector
|
8d69720124dfc2d501ab0505738f1273d574cde0
|
fe6934d9f308f1441a7cc04d0bbc0c9e7eb903de
|
refs/heads/master
| 2022-09-18T09:15:47.598364
| 2022-08-11T19:13:48
| 2022-08-11T19:13:48
| 23,613,833
| 20
| 23
| null | 2022-08-11T19:13:49
| 2014-09-03T09:11:28
|
Java
|
UTF-8
|
Java
| false
| false
| 2,415
|
java
|
package uk.ac.ebi.pride.toolsuite.gui.component.sequence;
import java.util.ArrayList;
import java.util.List;
/**
* Annotation to describe a peptide
*
* @author: rwang
* Date: 08/06/11
* Time: 13:52
*/
public class PeptideAnnotation {
private int start = -1;
private int end = -1;
/**
* peptide sequence
*/
private String sequence;
/**
* optional, ptm annotations
*/
private final List<PTMAnnotation> ptmAnnotations;
public PeptideAnnotation() {
this(null, -1 , -1);
}
public PeptideAnnotation(String sequence, int start, int end) {
this.start = start;
this.end = end;
this.sequence = sequence == null ? null : sequence.toUpperCase();
this.ptmAnnotations = new ArrayList<>();
}
public int getStart() {
return start;
}
public void setStart(int start) {
this.start = start;
}
public int getEnd() {
return end;
}
public void setEnd(int end) {
this.end = end;
}
public String getSequence() {
return sequence;
}
public void setSequence(String sequence) {
this.sequence = (sequence == null ? sequence : sequence.toUpperCase());
}
public List<PTMAnnotation> getPtmAnnotations() {
return new ArrayList<>(ptmAnnotations);
}
public void addPtmAnnotation(PTMAnnotation ptm) {
ptmAnnotations.add(ptm);
}
public void removePtmAnnotation(PTMAnnotation ptm) {
ptmAnnotations.remove(ptm);
}
@Override
public boolean equals(Object o) {
if (this == o) return true;
if (!(o instanceof PeptideAnnotation)) return false;
PeptideAnnotation that = (PeptideAnnotation) o;
if (end != that.end) return false;
return start == that.start && !(ptmAnnotations != null ? !ptmAnnotations.equals(that.ptmAnnotations) : that.ptmAnnotations != null) && !(sequence != null ? !sequence.equals(that.sequence) : that.sequence != null);
}
@Override
public int hashCode() {
int result = start;
result = 31 * result + end;
result = 31 * result + (sequence != null ? sequence.hashCode() : 0);
result = 31 * result + (ptmAnnotations != null ? ptmAnnotations.hashCode() : 0);
return result;
}
}
|
[
"ypriverol@gmail.com"
] |
ypriverol@gmail.com
|
f961e6b5e7f0f3ec42f733a6772f73499ab78e87
|
6e8e213290ead44719713752e05eb62c6f696bd9
|
/src/main/java/p455w0rd/morphtweaks/client/particle/ParticlePortal2.java
|
b670a1153ead421c9acd58ae66472a19b3c1e7d8
|
[
"MIT"
] |
permissive
|
p455w0rd/MorphTweaks
|
0b69499c4d174ec8eab44fc7d814985573f4d3bb
|
465cf0ac435fdbe437e1866dc5d8b8c82143ef4c
|
refs/heads/master
| 2018-11-23T21:19:31.114952
| 2018-09-04T15:43:24
| 2018-09-04T15:43:24
| 116,668,183
| 0
| 1
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 3,798
|
java
|
/*
* This file is part of Wireless Crafting Terminal. Copyright (c) 2017, p455w0rd
* (aka TheRealp455w0rd), All rights reserved unless otherwise stated.
*
* Wireless Crafting Terminal is free software: you can redistribute it and/or
* modify it under the terms of the MIT License.
*
* Wireless Crafting Terminal 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 MIT License for
* more details.
*
* You should have received a copy of the MIT License along with Wireless
* Crafting Terminal. If not, see <https://opensource.org/licenses/MIT>.
*/
package p455w0rd.morphtweaks.client.particle;
import net.minecraft.client.particle.IParticleFactory;
import net.minecraft.client.particle.Particle;
import net.minecraft.client.renderer.BufferBuilder;
import net.minecraft.entity.Entity;
import net.minecraft.world.World;
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;
/**
* @author p455w0rd
*
*/
public class ParticlePortal2 extends Particle {
private final float portalParticleScale;
private final double portalPosX;
private final double portalPosY;
private final double portalPosZ;
public ParticlePortal2(World worldIn, double xCoordIn, double yCoordIn, double zCoordIn, double xSpeedIn, double ySpeedIn, double zSpeedIn) {
super(worldIn, xCoordIn, yCoordIn, zCoordIn, xSpeedIn, ySpeedIn, zSpeedIn);
motionX = xSpeedIn;
motionY = ySpeedIn;
motionZ = zSpeedIn;
posX = xCoordIn;
posY = yCoordIn;
posZ = zCoordIn;
portalPosX = posX;
portalPosY = posY;
portalPosZ = posZ;
float f = rand.nextFloat() * 0.6F + 0.4F;
particleScale = rand.nextFloat() * 0.2F + 0.5F;
portalParticleScale = particleScale;
particleRed = f * 0.1F;
particleGreen = f * 1.0F;
particleBlue = f * 0.2F;
particleMaxAge = (int) (Math.random() * 10.0D) + 40;
setParticleTextureIndex((int) (Math.random() * 8.0D));
}
@Override
public void move(double x, double y, double z) {
setBoundingBox(getBoundingBox().offset(x, y, z));
resetPositionToBB();
}
/**
* Renders the particle
*/
@Override
public void renderParticle(BufferBuilder worldRendererIn, Entity entityIn, float partialTicks, float rotationX, float rotationZ, float rotationYZ, float rotationXY, float rotationXZ) {
float f = (particleAge + partialTicks) / particleMaxAge;
f = 1.0F - f;
f = f * f;
f = 1.0F - f;
particleScale = portalParticleScale * f;
super.renderParticle(worldRendererIn, entityIn, partialTicks, rotationX, rotationZ, rotationYZ, rotationXY, rotationXZ);
}
@Override
public int getBrightnessForRender(float brightness) {
int i = super.getBrightnessForRender(brightness);
float f = (float) particleAge / (float) particleMaxAge;
f = f * f;
f = f * f;
int j = i & 255;
int k = i >> 16 & 255;
k = k + (int) (f * 15.0F * 16.0F);
if (k > 240) {
k = 240;
}
return j | k << 16;
}
@Override
public void onUpdate() {
prevPosX = posX;
prevPosY = posY;
prevPosZ = posZ;
float f = (float) particleAge / (float) particleMaxAge;
float f1 = -f + f * f * 2.0F;
float f2 = 1.0F - f1;
posX = portalPosX + motionX * f2;
posY = portalPosY + motionY * f2 + (1.0F - f);
posZ = portalPosZ + motionZ * f2;
if (particleAge++ >= particleMaxAge) {
setExpired();
}
}
@SideOnly(Side.CLIENT)
public static class Factory implements IParticleFactory {
@Override
public Particle createParticle(int particleID, World worldIn, double xCoordIn, double yCoordIn, double zCoordIn, double xSpeedIn, double ySpeedIn, double zSpeedIn, int... p_178902_15_) {
return new ParticlePortal2(worldIn, xCoordIn, yCoordIn, zCoordIn, xSpeedIn, ySpeedIn, zSpeedIn);
}
}
}
|
[
"p455w0rd@gmail.com"
] |
p455w0rd@gmail.com
|
f7a1902da6ef64f033fb3be5de42ad072abc0d5a
|
b88bbd316177c73faa0c06b5902119e0353c02df
|
/SubServers.Client/Bukkit/src/net/ME1312/SubServers/Client/Bukkit/Network/Packet/PacketEditServer.java
|
c4b888040b5acf96d34e93abd7e05e709106ba6a
|
[
"Apache-2.0"
] |
permissive
|
DuckCaller/SubServers-2
|
90b2100b442a90d135f60ccfde33096ccf36cc99
|
0a1c469df254c4431276d8908356851744776c8d
|
refs/heads/master
| 2020-09-03T19:10:53.351701
| 2020-07-10T16:34:01
| 2020-07-10T16:34:01
| 129,326,674
| 1
| 0
|
Apache-2.0
| 2018-04-13T00:37:57
| 2018-04-13T00:37:57
| null |
UTF-8
|
Java
| false
| false
| 2,260
|
java
|
package net.ME1312.SubServers.Client.Bukkit.Network.Packet;
import net.ME1312.Galaxi.Library.Callback.Callback;
import net.ME1312.Galaxi.Library.Map.ObjectMap;
import net.ME1312.Galaxi.Library.Util;
import net.ME1312.SubData.Client.Protocol.PacketObjectIn;
import net.ME1312.SubData.Client.Protocol.PacketObjectOut;
import net.ME1312.SubData.Client.SubDataSender;
import java.util.HashMap;
import java.util.UUID;
/**
* Edit Server Packet
*/
public class PacketEditServer implements PacketObjectIn<Integer>, PacketObjectOut<Integer> {
private static HashMap<UUID, Callback<ObjectMap<Integer>>[]> callbacks = new HashMap<UUID, Callback<ObjectMap<Integer>>[]>();
private UUID player;
private String server;
private ObjectMap<String> edit;
private boolean perma;
private UUID tracker;
/**
* New PacketEditServer (In)
*/
public PacketEditServer() {}
/**
* New PacketEditServer (Out)
*
* @param player Player Editing
* @param server Server
* @param edit Edits
* @param perma Save Changes
* @param callback Callbacks
*/
@SafeVarargs
public PacketEditServer(UUID player, String server, ObjectMap<String> edit, boolean perma, Callback<ObjectMap<Integer>>... callback) {
if (Util.isNull(server, callback)) throw new NullPointerException();
this.player = player;
this.server = server;
this.edit = edit;
this.perma = perma;
this.tracker = Util.getNew(callbacks.keySet(), UUID::randomUUID);
callbacks.put(tracker, callback);
}
@Override
public ObjectMap<Integer> send(SubDataSender client) {
ObjectMap<Integer> data = new ObjectMap<Integer>();
data.set(0x0000, tracker);
data.set(0x0001, server);
data.set(0x0002, edit);
data.set(0x0003, perma);
if (player != null) data.set(0x0004, player.toString());
return data;
}
@Override
public void receive(SubDataSender client, ObjectMap<Integer> data) {
for (Callback<ObjectMap<Integer>> callback : callbacks.get(data.getUUID(0x0000))) callback.run(data);
callbacks.remove(data.getUUID(0x0000));
}
@Override
public int version() {
return 0x0001;
}
}
|
[
"admin@me1312.net"
] |
admin@me1312.net
|
f8d6fbe84f464432fb9597ba79d2c7d3839b5eb8
|
83f3086a3842a892added91953facfc6fd7ff037
|
/microservices/clients/contestproposal-client/src/main/java/org/xcolab/client/contest/pojo/templates/ProposalTemplateSection.java
|
084a7695dbc18707be107d6e6ecc4641077ef9cc
|
[
"MIT"
] |
permissive
|
solmedo13/XCoLab
|
c89629dfc54f6263de3b5551c96b6f14533c2f83
|
4fbc0219460d5c0d15c96bcbee8505104fd76dbd
|
refs/heads/master
| 2020-04-11T21:45:29.673213
| 2018-11-27T15:23:19
| 2018-11-27T15:23:19
| null | 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 534
|
java
|
package org.xcolab.client.contest.pojo.templates;
import org.xcolab.util.http.client.enums.ServiceNamespace;
public class ProposalTemplateSection extends AbstractProposalTemplateSection {
public ProposalTemplateSection() {}
public ProposalTemplateSection(ProposalTemplateSection value) {
super(value);
}
public ProposalTemplateSection(AbstractProposalTemplateSection abstractProposalTemplateSection,
ServiceNamespace serviceNamespace) {
super(abstractProposalTemplateSection);
}
}
|
[
"jobachhu@mit.edu"
] |
jobachhu@mit.edu
|
9353b161dda59d508ca373a685ccffcce52808bf
|
36fea8025460bd257c753a93dd3f27472892b4bc
|
/root/prj/sol/projects/renew2.5source/renew2.5/src/Gui/src/de/renew/gui/TokenFigureCreator.java
|
44053623e411a25ed089206054147d4cef8a34d6
|
[] |
no_license
|
Glost/db_nets_renew_plugin
|
ac84461e7779926b7ad70b2c7724138dc0d7242f
|
def4eaf7e55d79b9093bd59c5266804b345e8595
|
refs/heads/master
| 2023-05-05T00:02:12.504536
| 2021-05-25T22:36:13
| 2021-05-25T22:36:13
| 234,759,037
| 0
| 0
| null | 2021-05-04T23:37:39
| 2020-01-18T15:59:33
|
Java
|
UTF-8
|
Java
| false
| false
| 2,211
|
java
|
package de.renew.gui;
import CH.ifa.draw.figures.ImageFigure;
import CH.ifa.draw.framework.Figure;
import de.renew.remote.ObjectAccessor;
import de.renew.remote.ObjectAccessorImpl;
import java.awt.Image;
import java.awt.Point;
import java.awt.Toolkit;
import java.awt.image.ImageProducer;
import java.io.IOException;
import java.net.URL;
import java.rmi.RemoteException;
/**
* Delegates the figure representation for {@link Token} implementations.
*
* @author Frank Wienberg
* @author Joern Schumacher
* @author Michael Duvigneau
**/
class TokenFigureCreator implements FigureCreator {
public Figure getTokenFigure(ObjectAccessor tokenAccessor, boolean expanded)
throws RemoteException {
Object token = ((ObjectAccessorImpl) tokenAccessor).getObject();
token = ((Token) token).getTokenRepresentation(expanded);
// URLs are only handled specially in the context
// of Token tokens.
if (token instanceof URL) {
try {
token = ((URL) token).getContent();
} catch (IOException e) {
token = "UNLOADABLE IMAGE";
}
}
// Images are only handled specially in the context
// of Token tokens.
if (token instanceof ImageProducer) {
token = Toolkit.getDefaultToolkit()
.createImage((ImageProducer) token);
}
if (token instanceof Image) {
Image image = (Image) token;
ImageFigure figure = new ImageFigure(image, null, new Point());
figure.displayBox(new Point(),
new Point(image.getWidth(null),
image.getHeight(null)));
return figure;
}
// If a figure is returned
if (token instanceof Figure) {
return (Figure) token;
}
// No image. Fall back to the ordinary visualization.
return null;
}
public boolean canCreateFigure(ObjectAccessor token, boolean expanded)
throws RemoteException {
return token instanceof ObjectAccessorImpl
&& token.isInstanceOf(Token.class);
}
}
|
[
"anton19979@yandex.ru"
] |
anton19979@yandex.ru
|
9b966e1c2d651deafcbfb72f66cc04bee21443bd
|
0fdbf8670494569ddb30437c0a653e8ffa22632d
|
/src/main/java/shift/sextiarysector/tileentity/TileEntityMagicFurnace.java
|
385be183604f32d466521edd8ce6c194d468b77c
|
[] |
no_license
|
Mazdallier/SextiarySector2
|
27c0f0c35b433b13d9f6026fc310cd604ba58cb9
|
577a4701d55706a99aef7d46c9310def70f1e517
|
refs/heads/master
| 2021-01-14T12:25:42.168033
| 2014-12-23T05:22:45
| 2014-12-23T05:22:45
| 28,388,569
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 6,975
|
java
|
package shift.sextiarysector.tileentity;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.init.Items;
import net.minecraft.inventory.ISidedInventory;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.network.NetworkManager;
import net.minecraft.network.play.server.S35PacketUpdateTileEntity;
import shift.sextiarysector.SSRecipes;
import shift.sextiarysector.api.machine.item.GearForceItem;
import shift.sextiarysector.container.ItemBox;
public class TileEntityMagicFurnace extends TileEntityDirection implements ISidedInventory{
protected static final int[] slots_top = new int[] { 0 };
protected static final int[] slots_bottom = new int[] { 2, 1 };
protected static final int[] slots_sides = new int[] { 1 };
//0 素材 ,1 燃料 ,2 完成品
protected ItemBox items = new ItemBox("Base", 3);
//作業の進捗
public int machineWorkProgressTime;
//作業の進捗の最大値 この数字になると完了する
public int machineMaxProgressTime = 200;
//燃料と投入されている燃料のマックス状態の量
public int fuel;
public int fuelMax;
@Override
public void updateEntity()
{
super.updateEntity();
if (this.worldObj.isRemote) {
this.updateClientEntity();
} else {
this.updateServerEntity();
}
}
public void updateClientEntity()
{
}
public void updateServerEntity()
{
if(fuel>0){
fuel--;
if(fuel==0){
this.fuelMax=0;
this.worldObj.markBlockForUpdate(xCoord, yCoord, zCoord);
}
}else{
if(this.canWork()){
this.chargeFuel();
}
}
if(this.isFuel() && this.canWork()){
machineWorkProgressTime++;
if(machineWorkProgressTime>=machineMaxProgressTime){
this.workItem();
machineWorkProgressTime=0;
}
}
}
private void chargeFuel(){
if(this.isItemFuel(this.items.getStackInSlot(1))){
this.fuel = this.fuelMax = this.getItemMagicTime(this.items.getStackInSlot(1));
this.worldObj.markBlockForUpdate(xCoord, yCoord, zCoord);
}
}
public boolean isFuel()
{
return this.fuel > 0;
}
public boolean canWork()
{
if (this.items.getStackInSlot(0) == null)
{
return false;
}
else
{
ItemStack itemstack = this.getResult(this.items.getStackInSlot(0));
if (itemstack == null) return false;
return this.checkItem(itemstack) ;
}
}
private boolean checkItem(ItemStack itemstack){
if (this.items.getStackInSlot(2) == null || itemstack == null) return true;
if (!this.items.getStackInSlot(2).isItemEqual(itemstack)) return false;
int result = this.items.getStackInSlot(2).stackSize + itemstack.stackSize;
return (result <= getInventoryStackLimit() && result <= itemstack.getMaxStackSize());
}
public void workItem()
{
if (this.canWork())
{
ItemStack itemstack = this.getResult(this.items.getStackInSlot(0));
//item
if (this.items.getStackInSlot(2) == null)
{
this.setInventorySlotContents(2, itemstack.copy());
}
else if (this.items.getStackInSlot(2).isItemEqual(itemstack))
{
this.items.getStackInSlot(2).stackSize += itemstack.stackSize;
}
this.items.reduceStackSize(0, 1);
this.markDirty();
this.worldObj.markBlockForUpdate(xCoord, yCoord, zCoord);
}
}
private ItemStack getResult(ItemStack stackInSlot) {
return SSRecipes.magicFurnace.getResult(stackInSlot);
}
public static int getItemMagicTime(ItemStack p_145952_0_)
{
if (p_145952_0_ == null)
{
return 0;
}
else
{
return SSRecipes.magicFuel.getResult(p_145952_0_);
}
}
public static boolean isItemFuel(ItemStack p_145954_0_)
{
return getItemMagicTime(p_145954_0_) > 0;
}
//GUI
public int getWorkProgressScaled(int par1)
{
return this.machineWorkProgressTime / (machineMaxProgressTime / par1);
}
public int getEnergyProgressScaled(int par1)
{
return (int) (this.fuel / (this.fuelMax / par1));
}
//IInventory関係
@Override
public int getSizeInventory() {
return items.getSizeInventory();
}
@Override
public ItemStack getStackInSlot(int i) {
return items.getStackInSlot(i);
}
@Override
public ItemStack decrStackSize(int i, int j) {
return items.decrStackSize(i, j);
}
@Override
public ItemStack getStackInSlotOnClosing(int i) {
return items.getStackInSlotOnClosing(i);
}
@Override
public void setInventorySlotContents(int i, ItemStack itemstack) {
items.setInventorySlotContents(i, itemstack);
}
@Override
public String getInventoryName() {
return "gui.ss.magic_furnace";//+SimpleMachine.values()[this.worldObj.getBlockMetadata(xCoord, yCoord, zCoord)].icon+".name";
}
@Override
public boolean hasCustomInventoryName() {
return false;
}
@Override
public int getInventoryStackLimit() {
return items.getInventoryStackLimit();
}
@Override
public void markDirty(){
super.markDirty();
items.onInventoryChanged();
}
@Override
public boolean isUseableByPlayer(EntityPlayer entityplayer) {
return this.worldObj.getTileEntity(this.xCoord, this.yCoord, this.zCoord) != this ? false : entityplayer
.getDistanceSq(this.xCoord + 0.5D, this.yCoord + 0.5D, this.zCoord + 0.5D) <= 64.0D;
}
@Override
public void openInventory() {
}
@Override
public void closeInventory() {
}
@Override
public boolean isItemValidForSlot(int i, ItemStack itemstack) {
if (i == 1) {
return GearForceItem.manager.isGearForceItem(itemstack);
}
return i != 2;
}
//ISidedInventory関係
@Override
public int[] getAccessibleSlotsFromSide(int var1) {
return var1 == 0 ? slots_bottom : (var1 == 1 ? slots_top : slots_sides);
}
@Override
public boolean canInsertItem(int i, ItemStack itemstack, int j) {
return this.isItemValidForSlot(i, itemstack);
}
@Override
public boolean canExtractItem(int p_102008_1_, ItemStack p_102008_2_, int p_102008_3_)
{
return p_102008_3_ != 0 || p_102008_1_ != 1 || p_102008_2_.getItem() == Items.bucket;
}
//NBT関係
@Override
public void readFromNBT(NBTTagCompound nbt) {
super.readFromNBT(nbt);
items.readFromNBT(nbt);
this.machineWorkProgressTime = nbt.getShort("WorkTime");
this.fuel = nbt.getInteger("fuel");
this.fuelMax = nbt.getInteger("fuelMax");
}
@Override
public void writeToNBT(NBTTagCompound nbt) {
super.writeToNBT(nbt);
items.writeToNBT(nbt);
nbt.setShort("WorkTime", (short)this.machineWorkProgressTime);
nbt.setInteger("fuel", this.fuel);
nbt.setInteger("fuelMax", this.fuelMax);
}
@Override
public void onDataPacket(NetworkManager net, S35PacketUpdateTileEntity pkt){
this.readFromNBT(pkt.func_148857_g());
this.worldObj.markBlockForUpdate(xCoord, yCoord, zCoord);
}
}
|
[
"shift02ss@gmail.com"
] |
shift02ss@gmail.com
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.