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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
0ed8959b4c9bd3b3cabecb4c5f4ad5e82f7aee92 | 01a23639a4edfe7ffb5330894d553de52368debe | /src/main/java/com/finlabs/finexa/repository/MasterPOMISRepository.java | bdd4171fe3f38360a3c4d7fb9c659a566095739e | [] | no_license | kaustubh-walokar/ClientService | 47943e419482524127abf536f7a293cffb9af90d | 579d8fc89b1df1f1101a75f98c92f6e5cf08f0de | refs/heads/master | 2021-05-24T16:36:28.919663 | 2020-02-28T12:53:43 | 2020-02-28T12:53:43 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 243 | java | package com.finlabs.finexa.repository;
import org.springframework.data.jpa.repository.JpaRepository;
import com.finlabs.finexa.model.MasterPOMI;
public interface MasterPOMISRepository extends JpaRepository<MasterPOMI, Integer>{
}
| [
"nayak1jeet@gmail.com"
] | nayak1jeet@gmail.com |
5a3a5a00ffc85db7bed2a8ca273493e87e5bd3a7 | 7592d4f866aec2ce6724eea8a2ef256b9f8ee2ba | /messages/src/main/java/de/unistuttgart/iaas/chor/event/messages/RegisterUndeploymentSCEInstanceIDs.java | 597149b70f64c632ca6dd05ea3190c1f39e45728 | [
"MIT"
] | permissive | chorsystem/middleware | 831a55c92c41ac726fc0c3ecc556f1a20848132e | 6d1768c5ee3f1555ffea6c2ac566a70430fdc8ba | refs/heads/master | 2021-01-20T19:33:49.903074 | 2018-01-09T19:46:47 | 2018-01-09T19:46:47 | 63,236,713 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 715 | java | package de.unistuttgart.iaas.chor.event.messages;
import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;
public class RegisterUndeploymentSCEInstanceIDs implements Serializable {
/**
*
*/
private static final long serialVersionUID = 5447621499476571239L;
private String processModelID;
private List<String> sceInstanceIDs = new ArrayList<String>();
public RegisterUndeploymentSCEInstanceIDs(String processModelID, List<String> sceInstanceIDs){
this.processModelID = processModelID;
this.sceInstanceIDs = sceInstanceIDs;
}
public String getProcessModelID() {
return processModelID;
}
public List<String> getSceInstanceIDs() {
return sceInstanceIDs;
}
}
| [
"andreas1.weiss@googlemail.com"
] | andreas1.weiss@googlemail.com |
d815f2fe700c7f5e8495a9b526eca6811d7ae006 | f19fca6ed1d0d566f04746c1063ad71291283c39 | /src/main/java/cn/v5cn/jfinal/demo/util/OperateTypeEnum.java | 365d8a8b5906f82bfb0e04f5808c94cefa030b5f | [] | no_license | zyw/jfinal-demo | f81cc094032b917a56daca6ffcd96cf573e10cbf | a2bf208ad802b49e409518c2b6685bde1a528287 | refs/heads/master | 2021-01-18T11:09:31.367031 | 2016-05-12T09:17:16 | 2016-05-12T09:17:16 | 58,122,334 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 361 | java | package cn.v5cn.jfinal.demo.util;
/**
* Created by lenovo on 2016/5/6.
*/
public enum OperateTypeEnum {
ADD("add"),
UPDATE("update"),
DELETE("delete");
private String operateType;
OperateTypeEnum(String operateType){
this.operateType = operateType;
}
public String getOperateType(){
return operateType;
}
}
| [
"zyw090111@163.com"
] | zyw090111@163.com |
a45594bf14df5df26bc91e3940027f5469505834 | 05d0a9553358fbf159e566c403626de2718e17c9 | /hadoop-tools/hadoop-azure/src/test/java/org/apache/hadoop/fs/azure/ITestContainerChecks.java | 456e4b18bda3d9dc594d354cb22c303854bd773f | [
"CC-BY-2.5",
"LGPL-2.1-only",
"LicenseRef-scancode-other-permissive",
"EPL-1.0",
"Classpath-exception-2.0",
"GCC-exception-3.1",
"BSD-3-Clause",
"CC-PDDC",
"GPL-2.0-only",
"CDDL-1.0",
"MIT",
"Apache-2.0",
"LicenseRef-scancode-public-domain",
"GPL-1.0-or-later",
"LicenseRef-scancode-jdom",
"LicenseRef-scancode-proprietary-license",
"BSD-2-Clause-Views",
"MPL-2.0-no-copyleft-exception",
"MPL-2.0",
"CC-BY-3.0",
"AGPL-3.0-only",
"LicenseRef-scancode-unknown-license-reference",
"BSD-2-Clause",
"CDDL-1.1",
"LicenseRef-scancode-protobuf",
"LGPL-2.1-or-later",
"LGPL-2.0-or-later",
"LicenseRef-scancode-oracle-bcl-javase-javafx-2012",
"LGPL-2.0-only",
"LicenseRef-scancode-unknown"
] | permissive | hopshadoop/hops | d8baaf20bc418af460e582974839a3a9a72f173a | ed0d4de3dadbde5afa12899e703954aa67db7b3b | refs/heads/master | 2023-08-31T20:36:31.212647 | 2023-08-28T15:31:37 | 2023-08-28T15:31:37 | 32,975,439 | 295 | 85 | Apache-2.0 | 2023-09-05T09:19:57 | 2015-03-27T08:31:42 | Java | UTF-8 | Java | false | false | 6,565 | java | /**
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.apache.hadoop.fs.azure;
import static org.junit.Assume.assumeNotNull;
import java.io.FileNotFoundException;
import java.util.EnumSet;
import java.util.concurrent.Callable;
import org.apache.hadoop.fs.FSDataInputStream;
import org.apache.hadoop.fs.FileSystem;
import org.apache.hadoop.fs.Path;
import org.apache.hadoop.fs.azure.AzureBlobStorageTestAccount.CreateOptions;
import org.apache.hadoop.fs.azure.integration.AzureTestUtils;
import org.apache.hadoop.test.LambdaTestUtils;
import org.junit.After;
import org.junit.Assume;
import org.junit.Before;
import org.junit.Test;
import com.microsoft.azure.storage.blob.BlobOutputStream;
import com.microsoft.azure.storage.blob.CloudBlobContainer;
import com.microsoft.azure.storage.blob.CloudBlockBlob;
/**
* Tests that WASB creates containers only if needed.
*/
public class ITestContainerChecks extends AbstractWasbTestWithTimeout {
private AzureBlobStorageTestAccount testAccount;
private boolean runningInSASMode = false;
@After
public void tearDown() throws Exception {
testAccount = AzureTestUtils.cleanup(testAccount);
}
@Before
public void setMode() {
runningInSASMode = AzureBlobStorageTestAccount.createTestConfiguration().
getBoolean(AzureNativeFileSystemStore.KEY_USE_SECURE_MODE, false);
}
@Test
public void testContainerExistAfterDoesNotExist() throws Exception {
testAccount = blobStorageTestAccount();
assumeNotNull(testAccount);
CloudBlobContainer container = testAccount.getRealContainer();
FileSystem fs = testAccount.getFileSystem();
// Starting off with the container not there
assertFalse(container.exists());
// A list shouldn't create the container and will set file system store
// state to DoesNotExist
try {
fs.listStatus(new Path("/"));
assertTrue("Should've thrown.", false);
} catch (FileNotFoundException ex) {
assertTrue("Unexpected exception: " + ex,
ex.getMessage().contains("is not found"));
}
assertFalse(container.exists());
// Create a container outside of the WASB FileSystem
container.create();
// Add a file to the container outside of the WASB FileSystem
CloudBlockBlob blob = testAccount.getBlobReference("foo");
BlobOutputStream outputStream = blob.openOutputStream();
outputStream.write(new byte[10]);
outputStream.close();
// Make sure the file is visible
assertTrue(fs.exists(new Path("/foo")));
assertTrue(container.exists());
}
protected AzureBlobStorageTestAccount blobStorageTestAccount()
throws Exception {
return AzureBlobStorageTestAccount.create("",
EnumSet.noneOf(CreateOptions.class));
}
@Test
public void testContainerCreateAfterDoesNotExist() throws Exception {
testAccount = blobStorageTestAccount();
assumeNotNull(testAccount);
CloudBlobContainer container = testAccount.getRealContainer();
FileSystem fs = testAccount.getFileSystem();
// Starting off with the container not there
assertFalse(container.exists());
// A list shouldn't create the container and will set file system store
// state to DoesNotExist
try {
assertNull(fs.listStatus(new Path("/")));
assertTrue("Should've thrown.", false);
} catch (FileNotFoundException ex) {
assertTrue("Unexpected exception: " + ex,
ex.getMessage().contains("is not found"));
}
assertFalse(container.exists());
// Create a container outside of the WASB FileSystem
container.create();
// Write should succeed
assertTrue(fs.createNewFile(new Path("/foo")));
assertTrue(container.exists());
}
@Test
public void testContainerCreateOnWrite() throws Exception {
testAccount = blobStorageTestAccount();
assumeNotNull(testAccount);
CloudBlobContainer container = testAccount.getRealContainer();
FileSystem fs = testAccount.getFileSystem();
// Starting off with the container not there
assertFalse(container.exists());
// A list shouldn't create the container.
try {
fs.listStatus(new Path("/"));
assertTrue("Should've thrown.", false);
} catch (FileNotFoundException ex) {
assertTrue("Unexpected exception: " + ex,
ex.getMessage().contains("is not found"));
}
assertFalse(container.exists());
// Neither should a read.
Path foo = new Path("/testContainerCreateOnWrite-foo");
Path bar = new Path("/testContainerCreateOnWrite-bar");
LambdaTestUtils.intercept(FileNotFoundException.class,
new Callable<String>() {
@Override
public String call() throws Exception {
fs.open(foo).close();
return "Stream to " + foo;
}
}
);
assertFalse(container.exists());
// Neither should a rename
assertFalse(fs.rename(foo, bar));
assertFalse(container.exists());
// Create a container outside of the WASB FileSystem
container.create();
// But a write should.
assertTrue(fs.createNewFile(foo));
assertTrue(container.exists());
}
@Test
public void testContainerChecksWithSas() throws Exception {
Assume.assumeFalse(runningInSASMode);
testAccount = AzureBlobStorageTestAccount.create("",
EnumSet.of(CreateOptions.UseSas));
assumeNotNull(testAccount);
CloudBlobContainer container = testAccount.getRealContainer();
FileSystem fs = testAccount.getFileSystem();
// The container shouldn't be there
assertFalse(container.exists());
// A write should just fail
try {
fs.createNewFile(new Path("/testContainerChecksWithSas-foo"));
assertFalse("Should've thrown.", true);
} catch (AzureException ex) {
}
assertFalse(container.exists());
}
}
| [
"gautier@sics.se"
] | gautier@sics.se |
da50e98b00bd5cbcfec20b09f4c512235e7675a9 | 57c09b7c86bcf6b5de3e3edf92623eef55fd71ff | /src/main/java/com/leimingtech/extend/module/payment/unionpay/pc/example/Form_6_3_ConsumeUndo.java | c7816ec627a8aa5a31943dfb39c40729195c65ee | [] | no_license | kevonz/leimingtech-payment | 81dac21d995d38646d6588f4e5e30ed5645f99d2 | d5bfd7b3b33f8574e196ef20118efe72df35a8e6 | refs/heads/master | 2021-01-15T13:13:43.234406 | 2016-08-26T02:05:03 | 2016-08-26T02:05:03 | 66,631,737 | 3 | 6 | null | 2016-08-26T08:41:26 | 2016-08-26T08:41:26 | null | UTF-8 | Java | false | false | 3,190 | java | package com.leimingtech.extend.module.payment.unionpay.pc.example;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.HashMap;
import java.util.Map;
import com.leimingtech.extend.module.payment.unionpay.pc.config.UnionpayBase;
import com.leimingtech.extend.module.payment.unionpay.pc.sdk.SDKConfig;
/**
* 名称: 第一卷 商户卷 第1\5\6部分 跳转网关支付产品\手机控件支付产品\手机网页支付产品<br>
* 功能: 6.3 消费撤销类交易 <br>
* 版本: 5.0<br>
* 日期: 2014-07<br>
* 作者: 中国银联ACP团队<br>
* 版权: 中国银联<br>
* 说明:以下代码只是为了方便商户测试而提供的样例代码,商户可以根据自己需要,按照技术文档编写。该代码仅供参考。<br>
*/
public class Form_6_3_ConsumeUndo extends UnionpayBase {
public static void main(String[] args) {
/**
* 参数初始化
* 在java main 方式运行时必须每次都执行加载
* 如果是在web应用开发里,这个方写在可使用监听的方式写入缓存,无须在这出现
*/
SDKConfig.getConfig().loadPropertiesFromSrc();// 从classpath加载acp_sdk.properties文件
/**
* 组装请求报文
*/
Map<String, String> data = new HashMap<String, String>();
// 版本号
data.put("version", "5.0.0");
// 字符集编码 默认"UTF-8"
data.put("encoding", "UTF-8");
// 签名方法 01 RSA
data.put("signMethod", "01");
// 交易类型
data.put("txnType", "31");
// 交易子类型
data.put("txnSubType", "00");
// 业务类型
data.put("bizType", "000201");
// 渠道类型,07-PC,08-手机
data.put("channelType", "08");
// 前台通知地址 ,控件接入方式无作用
data.put("frontUrl", "http://localhost:8080/ACPTest/acp_front_url.do");
// 后台通知地址
data.put("backUrl", "http://222.222.222.222:8080/ACPTest/acp_back_url.do");
// 接入类型,商户接入填0 0- 商户 , 1: 收单, 2:平台商户
data.put("accessType", "0");
// 商户号码,请改成自己的商户号
data.put("merId", "888888888888888");
//原消费的queryId,可以从查询接口或者通知接口中获取
data.put("origQryId", "201502112158205063088");
// 商户订单号,8-40位数字字母,重新产生,不同于原消费
data.put("orderId", new SimpleDateFormat("yyyyMMddHHmmss").format(new Date()));
// 订单发送时间,取系统时间
data.put("txnTime", new SimpleDateFormat("yyyyMMddHHmmss").format(new Date()));
// 交易金额,消费撤销时需和原消费一致
data.put("txnAmt", "1");
// 交易币种
data.put("currencyCode", "156");
// 请求方保留域,透传字段,查询、通知、对账文件中均会原样出现
// data.put("reqReserved", "透传信息");
data = signData(data);
// 交易请求url 从配置文件读取
String url = SDKConfig.getConfig().getBackRequestUrl();
Map<String, String> resmap = submitUrl(data, url);
System.out.println("请求报文=["+data.toString()+"]");
System.out.println("应答报文=["+resmap.toString()+"]");
}
}
| [
"271912564@qq.com"
] | 271912564@qq.com |
383a92b50056e38eaa094df68f80a806f367a410 | bcf810540a9f2f4558e2ab7016608aa25ca27fba | /showcal-contract/src/main/java/com/showcal/service/domain/UnAnswerQuestion.java | 8f7cfb2447ab9b15b1f8968d23b7565629f4596d | [] | no_license | kate2014/showcal | aea829b5a88dba2e5e00971711a731241a0c9f01 | 9693af4e256ae0ee8e2bfad8ca469b13e2763aa1 | refs/heads/master | 2021-12-06T10:54:28.479015 | 2015-11-02T08:15:04 | 2015-11-02T08:15:04 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,262 | java | package com.showcal.service.domain;
import com.alibaba.fastjson.annotation.JSONField;
import java.util.Date;
import java.util.List;
/**
* ***************************************************************
* <p/>
* <pre>
* Copyright (c) 2014 –苏州犀牛网络科技有限公司
* Title: com.showcal.service.domain
* Description:
* ***************************************************************
* 10/10 0010 V1.0 xiniu New Files for com.showcal.service.domain
* </pre>
*/
public class UnAnswerQuestion {
/**
* 问题ID
*/
private Long id;
/**
* 关键字ID
*/
private Long keywordId;
/**
* 关键字
*/
private String keyword;
/**
* 标签ID
*/
private Long tagId;
/**
* 标签
*/
private String tag;
/**
* 昵称
*/
private String nickName;
/**
* 性别
*/
private String sex;
/**
* 身高
*/
private Double height;
/**
* 体重
*/
private Double weight;
/**
* 年龄
*/
private Integer age;
@JSONField(format = "yyyy-MM-dd HH:mm:ss")
private Date createTime;
/**
* 提问人Id
*/
private Long questionUserId;
/**
* 问题消息
*/
private List<ServiceMessage> serviceMessages;
public Long getQuestionUserId() {
return questionUserId;
}
public void setQuestionUserId(Long questionUserId) {
this.questionUserId = questionUserId;
}
public String getSex() {
return sex;
}
public void setSex(String sex) {
this.sex = sex;
}
public Date getCreateTime() {
return createTime;
}
public void setCreateTime(Date createTime) {
this.createTime = createTime;
}
public List<ServiceMessage> getServiceMessages() {
return serviceMessages;
}
public void setServiceMessages(List<ServiceMessage> serviceMessages) {
this.serviceMessages = serviceMessages;
}
public Long getId() {
return id;
}
public void setId(Long id) {
this.id = id;
}
public Long getKeywordId() {
return keywordId;
}
public void setKeywordId(Long keywordId) {
this.keywordId = keywordId;
}
public String getKeyword() {
return keyword;
}
public void setKeyword(String keyword) {
this.keyword = keyword;
}
public Long getTagId() {
return tagId;
}
public void setTagId(Long tagId) {
this.tagId = tagId;
}
public String getTag() {
return tag;
}
public void setTag(String tag) {
this.tag = tag;
}
public String getNickName() {
return nickName;
}
public void setNickName(String nickName) {
this.nickName = nickName;
}
public Double getHeight() {
return height;
}
public void setHeight(Double height) {
this.height = height;
}
public Double getWeight() {
return weight;
}
public void setWeight(Double weight) {
this.weight = weight;
}
public Integer getAge() {
return age;
}
public void setAge(Integer age) {
this.age = age;
}
}
| [
"kevin@showcal.com"
] | kevin@showcal.com |
14ace698e910986e39f25a993227e16e5eb76a1d | 68ff808ae184158a4df4f6449e61621c8db72f61 | /Databases Frameworks - Hibernate & Spring Data/Exercises Spring Data Auto Mapping Objects/game-store-demo/src/main/java/softuni/gamestore/demo/seed/RoleSeedExecutor.java | 3281711f1cb533e6454d4092f09b7b366bf9bad8 | [
"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 | 1,039 | java | package softuni.gamestore.demo.seed;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import softuni.gamestore.demo.model.entity.Role;
import softuni.gamestore.demo.repository.RoleRepository;
import javax.annotation.PostConstruct;
import java.util.Arrays;
@Component
public class RoleSeedExecutor {
private final RoleRepository roleRepository;
@Autowired
public RoleSeedExecutor(RoleRepository roleRepository) {
this.roleRepository = roleRepository;
}
@PostConstruct
/** After u create instance from this class @PostConstruct will be called auto
* and this method will insert automatic our roles*/
public void insertRole() {
if (this.roleRepository.count() == 0L) {
Role adminRole = new Role();
adminRole.setName("ADMIN");
Role userRole = new Role();
userRole.setName("USER");
this.roleRepository.saveAll(Arrays.asList(adminRole, userRole));
}
}
}
| [
"valio_180@abv.bg"
] | valio_180@abv.bg |
a485448b6c39c0e5bcd6705afdca24732d905b6f | ed5159d056e98d6715357d0d14a9b3f20b764f89 | /src/irvine/oeis/a214/A214181.java | 5dd8ec741f0f013df8fc8e3e0d169cc60f8390b3 | [] | no_license | flywind2/joeis | c5753169cf562939b04dd246f8a2958e97f74558 | e5efd6971a0062ac99f4fae21a7c78c9f9e74fea | refs/heads/master | 2020-09-13T18:34:35.080552 | 2019-11-19T05:40:55 | 2019-11-19T05:40:55 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 527 | java | package irvine.oeis.a214;
// Generated by gen_pattern.pl - DO NOT EDIT here!
import irvine.oeis.GeneratingFunctionSequence;
/**
* A214181 Number of 0..6 colorings of an <code>n X 3</code> array circular in the 3 direction with new values 0..6 introduced in row major order.
* @author Georg Fischer
*/
public class A214181 extends GeneratingFunctionSequence {
/** Construct the sequence. */
public A214181() {
super(1, new long[] {0, 1, -161, 4292, -21313},
new long[] {1, -179, 6468, -59396, 94336});
}
}
| [
"sean.irvine@realtimegenomics.com"
] | sean.irvine@realtimegenomics.com |
43c02c6b44c22a254149e1cc1f92aacaf7997628 | 6392035b0421990479baf09a3bc4ca6bcc431e6e | /RefDiff2x/refdiff-c/src/main/java/refdiff/parsers/c/CPlugin.java | d5df7ae9d8dca589c4f56fd051c3032cef504b61 | [
"MIT"
] | permissive | ameyaKetkar/RMinerEvaluationTools | 4975130072bf1d4940f9aeb6583eba07d5fedd0a | 6102a69d1b78ae44c59d71168fc7569ac1ccb768 | refs/heads/master | 2020-09-26T00:18:38.389310 | 2020-05-28T17:34:39 | 2020-05-28T17:34:39 | 226,119,387 | 3 | 1 | null | null | null | null | UTF-8 | Java | false | false | 3,234 | java | package refdiff.parsers.c;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.concurrent.atomic.AtomicInteger;
import org.eclipse.cdt.core.dom.ast.ASTVisitor;
import org.eclipse.cdt.core.dom.ast.IASTTranslationUnit;
import org.eclipse.cdt.core.dom.ast.gnu.c.GCCLanguage;
import org.eclipse.cdt.core.index.IIndex;
import org.eclipse.cdt.core.parser.DefaultLogService;
import org.eclipse.cdt.core.parser.FileContent;
import org.eclipse.cdt.core.parser.IParserLogService;
import org.eclipse.cdt.core.parser.IScannerInfo;
import org.eclipse.cdt.core.parser.IncludeFileContentProvider;
import org.eclipse.cdt.core.parser.ScannerInfo;
import org.eclipse.core.runtime.CoreException;
import refdiff.core.cst.CstRoot;
import refdiff.core.cst.TokenPosition;
import refdiff.core.cst.TokenizedSource;
import refdiff.core.io.FilePathFilter;
import refdiff.core.io.SourceFile;
import refdiff.core.io.SourceFileSet;
import refdiff.parsers.LanguagePlugin;
public class CPlugin implements LanguagePlugin {
@Override
public CstRoot parse(SourceFileSet sources) throws Exception {
CstRoot root = new CstRoot();
AtomicInteger id = new AtomicInteger(1);
for (SourceFile sourceFile : sources.getSourceFiles()) {
String sourceCode = sources.readContent(sourceFile);
FileContent fileContent = FileContent.create("temp.source", sourceCode.toCharArray());
IASTTranslationUnit translationUnit = parseAST(fileContent);
// System.out.println(sourceFile.getPath());
// ASTPrinter.print(translationUnit);
ASTVisitor cCstVisitor = new CCstVisitor(root, sourceFile.getPath(), sourceCode, id);
translationUnit.accept(cCstVisitor);
root.addTokenizedFile(new TokenizedSource(sourceFile.getPath(), tokenize(sourceCode)));
}
// ObjectMapper jacksonObjectMapper = new ObjectMapper();
// String jsonInString = jacksonObjectMapper.writeValueAsString(root);
// System.out.println(jsonInString);
return root;
}
private static IASTTranslationUnit parseAST(FileContent fileContent) throws CoreException {
GCCLanguage gccLanguage = GCCLanguage.getDefault();
Map<String, String> macroDefinitions = new HashMap<String, String>();
String[] includeSearchPaths = new String[0];
IScannerInfo si = new ScannerInfo(macroDefinitions, includeSearchPaths);
IncludeFileContentProvider ifcp = IncludeFileContentProvider.getEmptyFilesProvider();
IIndex idx = null;
int options = 0;
IParserLogService log = new DefaultLogService();
return gccLanguage.getASTTranslationUnit(fileContent, si, ifcp, idx, options, log);
}
public List<TokenPosition> tokenize(String source) {
List<TokenPosition> tokens = new ArrayList<>();
ASTVisitor tokenVisitor = new TokenVisitor(tokens);
FileContent fileContent = FileContent.create("temp.source", source.toCharArray());
IASTTranslationUnit translationUnit = null;
try {
translationUnit = parseAST(fileContent);
} catch (CoreException e) {
throw new RuntimeException(e);
}
translationUnit.accept(tokenVisitor);
return tokens;
}
@Override
public FilePathFilter getAllowedFilesFilter() {
return new FilePathFilter(Arrays.asList(".c", ".h"));
}
}
| [
"ask1604@gmail.com"
] | ask1604@gmail.com |
b1973799201c4a4d09a617a7d575570c1809cbab | e7e2377031dfee7ad6a52c5c821efe759edfd10a | /suanfa/src/main/java/com/example/johnyin/suanfa/mergeSort/SortTestHelper.java | 2ab7a96e394490566af0f085491a91266cfd88ad | [] | no_license | johnYin2015/AndroidBasics | a29ef978e41f171c8a5c0a0225c6c7903cfcd158 | 3371acd869a444041850a442705bd313534dbcee | refs/heads/master | 2020-06-16T23:04:19.030874 | 2019-07-08T06:26:19 | 2019-07-08T06:26:19 | 195,727,883 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,004 | java | package com.example.johnyin.suanfa.mergeSort;
import java.lang.reflect.Method;
import java.lang.Class;
import java.util.Random;
public class SortTestHelper {
// SortTestHelper不允许产生任何实例
private SortTestHelper(){}
// 生成有n个元素的随机数组,每个元素的随机范围为[rangeL, rangeR]
public static Integer[] generateRandomArray(int n, int rangeL, int rangeR) {
assert rangeL <= rangeR;
Integer[] arr = new Integer[n];
for (int i = 0; i < n; i++)
arr[i] = new Integer((int)(Math.random() * (rangeR - rangeL + 1) + rangeL));
return arr;
}
// 生成一个近乎有序的数组
// 首先生成一个含有[0...n-1]的完全有序数组, 之后随机交换swapTimes对数据
// swapTimes定义了数组的无序程度:
// swapTimes == 0 时, 数组完全有序
// swapTimes 越大, 数组越趋向于无序
public static Integer[] generateNearlyOrderedArray(int n, int swapTimes){
Integer[] arr = new Integer[n];
for( int i = 0 ; i < n ; i ++ )
arr[i] = new Integer(i);
for( int i = 0 ; i < swapTimes ; i ++ ){
int a = (int)(Math.random() * n);
int b = (int)(Math.random() * n);
int t = arr[a];
arr[a] = arr[b];
arr[b] = t;
}
return arr;
}
// 打印arr数组的所有内容
public static void printArray(Object[] arr) {
for (int i = 0; i < arr.length; i++){
System.out.print( arr[i] );
System.out.print( ' ' );
}
System.out.println();
return;
}
// 判断arr数组是否有序
public static boolean isSorted(Comparable[] arr){
for( int i = 0 ; i < arr.length - 1 ; i ++ )
if( arr[i].compareTo(arr[i+1]) > 0 )
return false;
return true;
}
// 测试sortClassName所对应的排序算法排序arr数组所得到结果的正确性和算法运行时间
public static void testSort(String sortClassName, Comparable[] arr){
// 通过Java的反射机制,通过排序的类名,运行排序函数
try{
// 通过sortClassName获得排序函数的Class对象
Class sortClass = Class.forName(sortClassName);
// 通过排序函数的Class对象获得排序方法
Method sortMethod = sortClass.getMethod("sort",new Class[]{Comparable[].class});
// 排序参数只有一个,是可比较数组arr
Object[] params = new Object[]{arr};
long startTime = System.currentTimeMillis();
// 调用排序函数
sortMethod.invoke(null,params);
long endTime = System.currentTimeMillis();
assert isSorted( arr );
System.out.println( sortClass.getSimpleName()+ " : " + (endTime-startTime) + "ms" );
}
catch(Exception e){
e.printStackTrace();
}
}
} | [
"wit.zhaoguo@gmail.com"
] | wit.zhaoguo@gmail.com |
741c5bb4c753bda0379df77e72fab461c063a029 | 6635387159b685ab34f9c927b878734bd6040e7e | /src/azz$a.java | 72e878cbf61a90397600b1accd616f4ccc9241b4 | [] | no_license | RepoForks/com.snapchat.android | 987dd3d4a72c2f43bc52f5dea9d55bfb190966e2 | 6e28a32ad495cf14f87e512dd0be700f5186b4c6 | refs/heads/master | 2021-05-05T10:36:16.396377 | 2015-07-16T16:46:26 | 2015-07-16T16:46:26 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 193 | java | public final class azz$a
{
public azj androidModule;
public baa discoverModule;
}
/* Location:
* Qualified Name: azz.a
* Java Class Version: 6 (50.0)
* JD-Core Version: 0.7.1
*/ | [
"reverseengineeringer@hackeradmin.com"
] | reverseengineeringer@hackeradmin.com |
ec3dda8d895d69428cb04530ab2ff01cd43960bd | f238f2c3d71cd57c94fcc4a0d2066298a01e6481 | /source/Class286.java | 1487e9bd480ced04174778aed42c9cf401daff79 | [] | no_license | MeezyProductions/Virtue857-Client | 61cecd8dc4c8c5d2f91759948a71d2bb251c63d9 | 03500f26e96a3ad21f04de74e28b9db18769f8ec | refs/heads/master | 2016-08-12T17:00:11.422440 | 2015-10-27T01:58:43 | 2015-10-27T01:58:43 | 44,935,063 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 5,590 | java | /* Class286 - Decompiled by JODE
* Visit http://jode.sourceforge.net/
*/
public class Class286
{
int anInt3129;
static Class286 aClass286_3130;
static Class286 aClass286_3131;
static Class286 aClass286_3132;
static Class286 aClass286_3133;
static Class286 aClass286_3134;
static Class286 aClass286_3135;
static Class286 aClass286_3136 = new Class286(0, Class39.aClass39_443, 2);
static Class286 aClass286_3137;
static Class286 aClass286_3138;
static Class286 aClass286_3139;
static Class286 aClass286_3140;
static Class286 aClass286_3141;
static Class286 aClass286_3142;
public int anInt3143;
static Class286 aClass286_3144;
static Class286 aClass286_3145;
static Class286 aClass286_3146;
int anInt3147;
Class39 aClass39_3148;
Class39 aClass39_3149;
static Class286 aClass286_3150;
static Class286 aClass286_3151;
boolean aBool3152;
boolean aBool3153;
static Class286[] method3856(byte i) {
return (new Class286[]
{ aClass286_3136, aClass286_3132, aClass286_3131,
aClass286_3135, aClass286_3133, aClass286_3134,
aClass286_3130, aClass286_3151, aClass286_3141,
aClass286_3138, aClass286_3139, aClass286_3140,
aClass286_3137, aClass286_3142, aClass286_3144,
aClass286_3150, aClass286_3145, aClass286_3146 });
}
Class286(int i, Class39 class39, Class39 class39_0_, int i_1_, int i_2_,
boolean bool, boolean bool_3_) {
anInt3143 = 1810440555 * i;
((Class286) this).aClass39_3148 = class39;
((Class286) this).aClass39_3149 = class39_0_;
((Class286) this).anInt3129 = i_1_ * 2803303;
((Class286) this).anInt3147 = 538541279 * i_2_;
((Class286) this).aBool3152 = bool;
((Class286) this).aBool3153 = bool_3_;
}
Class286(int i, Class39 class39, Class39 class39_4_, int i_5_, int i_6_) {
this(i, class39, class39_4_, i_5_, i_6_, true, false);
}
static {
aClass286_3132 = new Class286(1, Class39.aClass39_443,
Class39.aClass39_443, 2, 3);
aClass286_3131 = new Class286(2, Class39.aClass39_443, 3);
aClass286_3135 = new Class286(3, Class39.aClass39_443,
Class39.aClass39_443, 3, 4);
aClass286_3133 = new Class286(4, Class39.aClass39_443, 4);
aClass286_3134 = new Class286(5, Class39.aClass39_443,
Class39.aClass39_443, 4, 5);
aClass286_3130 = new Class286(6, Class39.aClass39_443,
Class39.aClass39_443, 5, 98, true, true);
aClass286_3151 = new Class286(7, Class39.aClass39_443, 99);
aClass286_3141 = new Class286(8, Class39.aClass39_443, 100);
aClass286_3138 = new Class286(9, Class39.aClass39_444,
Class39.aClass39_444, 0, 92, true, true);
aClass286_3139 = new Class286(10, Class39.aClass39_444,
Class39.aClass39_444, 92, 93);
aClass286_3140 = new Class286(11, Class39.aClass39_444,
Class39.aClass39_444, 94, 95);
aClass286_3137 = new Class286(12, Class39.aClass39_444,
Class39.aClass39_444, 96, 97);
aClass286_3142 = new Class286(13, Class39.aClass39_444, 97);
aClass286_3144 = new Class286(14, Class39.aClass39_444, 97);
aClass286_3150 = new Class286(15, Class39.aClass39_444, 100);
aClass286_3145 = new Class286(16, Class39.aClass39_444, 100);
aClass286_3146 = new Class286(17, Class39.aClass39_444, 100);
}
Class286(int i, Class39 class39, int i_7_) {
this(i, class39, class39, i_7_, i_7_, true, false);
}
public static String method3857(byte i) {
return Class43.aString529;
}
static final void method3858(int i) {
if (client.anInt10978 * 2088127151 != -1) {
int i_8_ = Class95_Sub1_Sub2.aClass537_11200.method6507(30509525);
int i_9_ = Class95_Sub1_Sub2.aClass537_11200.method6504((byte) 61);
Class528_Sub33 class528_sub33
= ((Class528_Sub33)
client.aClass688_10900.method8034(1655144202));
if (null != class528_sub33) {
i_8_ = class528_sub33.method9494(-1236136691);
i_9_ = class528_sub33.method9495((byte) 3);
}
if (null != client.aClass229_11067
&& Class137.aClass229_1632 == client.aClass229_10987) {
client.aBool11041 = true;
client.anInt11073 = 0;
client.anInt11074 = 0;
client.anInt11075 = Class411.anInt4713 * 1133240187;
client.anInt11076 = 1239670945 * client.anInt6933;
}
ModeWhere.method7896(null, client.anInt10978 * 2088127151, 0, 0,
-1117838587 * Class411.anInt4713,
-2142152407 * client.anInt6933, 0, 0, i_8_,
i_9_, 618044496);
if (Class36.aClass229_335 != null)
Class13.method625(i_8_, i_9_, (byte) -99);
}
}
static final void method3859(Class648 class648, int i) {
if (-1860881523 * Class390.anInt4111 == 6)
((Class648) class648).anIntArray8394
[((((Class648) class648).anInt8395 += 1239022665) * 717927929
- 1)]
= (int) ((double) Class495.aClass283_Sub1_5578
.method3792(-16777216)
* 2607.5945876176133) >> 3;
else
((Class648) class648).anIntArray8394
[((((Class648) class648).anInt8395 += 1239022665) * 717927929
- 1)]
= (int) client.aFloat11088 >> 3;
}
static final void method3860(Class648 class648, short i) {
Class646 class646 = (((Class648) class648).aBool8418
? ((Class648) class648).aClass646_8406
: ((Class648) class648).aClass646_8392);
Class229 class229 = ((Class646) class646).aClass229_8385;
Class226 class226 = ((Class646) class646).aClass226_8384;
Class496.method6055(class229, class226, class648, -947398110);
}
}
| [
"jamiemoore7746@gmail.com"
] | jamiemoore7746@gmail.com |
d4e2e8065098a31f1fdc77ef70cfc03c5528e026 | 3659875802aec87a3ab191c09388d59b63869380 | /spring_04_jdbc/src/main/java/part01/MemDao.java | 80ab03bd1f69cbb9b5956c576c0295feb3f3d521 | [] | no_license | hongdaepyo/h1o1n1g1 | fab31dbd459dab78cb380acdec6563eb02cb2534 | 87896497a321440dff589e163cfa5a0644fad559 | refs/heads/master | 2021-06-06T17:38:46.362177 | 2016-12-20T10:47:39 | 2016-12-20T10:47:39 | 64,099,068 | 0 | 0 | null | 2021-05-07T06:13:59 | 2016-07-25T02:55:09 | Java | UTF-8 | Java | false | false | 313 | java | package part01;
import java.util.List;
public interface MemDao {
public List<MemDTO> list();
public void insertMethod(MemDTO dto);
public void updateMethod(MemDTO dto);
public void deleteMethod(int num);
public MemDTO one(int num);
public int countMethod();
}//end interface
| [
"h1o1n1g1@nate.com"
] | h1o1n1g1@nate.com |
45571e207bedc9c1cf04c426c0ee71b8c3e5e550 | 7f88fc54732250c5a16c9c958746eedbc3c62398 | /app/src/main/java/stone/tianfeng/com/stonestore/json/ClassTypeFilerEntity.java | b6f25f14a157b4e303ac717cbf2b1f1885d6422d | [] | no_license | tianfeng94666/StoneStore | ae036cb7202ce5c1444ad5c97d7f31df616a7724 | 6489649bc9ca42b6c62278307916068e018fd461 | refs/heads/master | 2021-01-01T18:15:48.165207 | 2017-09-06T03:01:08 | 2017-09-06T03:01:08 | 98,289,953 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,569 | java | package stone.tianfeng.com.stonestore.json;
import java.util.List;
public class ClassTypeFilerEntity {
/**
* mulSelect : 1
* attributeList : [{"id":"14","title":"卡地亚","value":"14","groupKey":"category"},{"id":"15","title":"天使之吻","value":"15","groupKey":"category"},{"id":"16","title":"CNC","value":"16","groupKey":"category"},{"id":"17","title":"多围一","value":"17","groupKey":"category"},{"id":"18","title":"四爪","value":"18","groupKey":"category"},{"id":"19","title":"六爪","value":"19","groupKey":"category"},{"id":"20","title":"雪花爪","value":"20","groupKey":"category"},{"id":"21","title":"水滴爪","value":"21","groupKey":"category"},{"id":"22","title":"花头","value":"22","groupKey":"category"}]
* id : 2
* sort : 200
* title : 特殊款
* groupKey : category
*/
private int mulSelect;
private List<AttributeListEntity> attributeList;
private String id;
private int sort;
private String title;
private String groupKey;
public void setMulSelect(int mulSelect) {
this.mulSelect = mulSelect;
}
public void setAttributeList(List<AttributeListEntity> attributeList) {
this.attributeList = attributeList;
}
public void setId(String id) {
this.id = id;
}
public void setSort(int sort) {
this.sort = sort;
}
public void setTitle(String title) {
this.title = title;
}
public void setGroupKey(String groupKey) {
this.groupKey = groupKey;
}
public int getMulSelect() {
return mulSelect;
}
public List<AttributeListEntity> getAttributeList() {
return attributeList;
}
public String getId() {
return id;
}
public int getSort() {
return sort;
}
public String getTitle() {
return title;
}
public String getGroupKey() {
return groupKey;
}
public class AttributeListEntity {
/**
* id : 14
* title : 卡地亚
* value : 14
* groupKey : category
*/
private String id;
private String title;
private String value;
private String groupKey;
public void setId(String id) {
this.id = id;
}
public void setTitle(String title) {
this.title = title;
}
public void setValue(String value) {
this.value = value;
}
public void setGroupKey(String groupKey) {
this.groupKey = groupKey;
}
public String getId() {
return id;
}
public String getTitle() {
return title;
}
public String getValue() {
return value;
}
public String getGroupKey() {
return groupKey;
}
@Override
public String toString() {
return "AttributeListEntity{" +
"id='" + id + '\'' +
", title='" + title + '\'' +
", value='" + value + '\'' +
", groupKey='" + groupKey + '\'' +
'}';
}
}
@Override
public String toString() {
return "ClassTypeFilerEntity{" +
"mulSelect=" + mulSelect +
", attributeList=" + attributeList +
", id='" + id + '\'' +
", sort=" + sort +
", title='" + title + '\'' +
", groupKey='" + groupKey + '\'' +
'}';
}
} | [
"tianfeng94666@gmail.com"
] | tianfeng94666@gmail.com |
0a94eb6cb6ee489c6f515bd416a2ffd3eb8be29f | 647ec12ce50f06e7380fdbfb5b71e9e2d1ac03b4 | /com.tencent.mm/classes.jar/com/tencent/mm/plugin/music/e/a/c.java | 89e31edbb87e234e4bf0f14c9b815a820d1fea2c | [] | 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 | 434 | java | package com.tencent.mm.plugin.music.e.a;
public abstract interface c
{
public abstract boolean aPe(String paramString);
public abstract String findLibPath(String paramString);
public abstract boolean load(String paramString);
}
/* Location: L:\local\mybackup\temp\qq_apk\com.tencent.mm\classes7.jar
* Qualified Name: com.tencent.mm.plugin.music.e.a.c
* JD-Core Version: 0.7.0.1
*/ | [
"98632993+tsuzcx@users.noreply.github.com"
] | 98632993+tsuzcx@users.noreply.github.com |
1968cdeca8b292db002792a13e50278498c003a5 | 451709e6462c9d0a1f648c8f780298dd52e3bfb4 | /java/ChinaSoft_njetc/javasyntax/src/com/etc/systax/HelloWorld.java | 181d1f50a639d6466571698036b940f60e18d8b6 | [] | no_license | forsunchao/forsunchao | acec1606e9550f66e2eac36c6f0ee7b8a4589778 | 75ff7c7be27b8babbc03b2d3e500b9bcf2cf3753 | refs/heads/master | 2021-01-02T22:43:51.809188 | 2013-05-28T12:36:31 | 2013-05-28T12:36:31 | 34,045,525 | 2 | 1 | null | null | null | null | UTF-8 | Java | false | false | 473 | java | package com.etc.systax;
import java.util.List;
/**
* @author wangxy
*/
public class HelloWorld {
/**
* 变量
*/
private String world = "World";
/**
* 函数
*/
public void say() {
System.out.println("Hello " + world + "!");
}
/**
* 执行入口函数
* @param args
*/
public static void main(String args[]) {
// 创建类的实例
HelloWorld inst = new HelloWorld();
// 调用函数
inst.say();
}
}
| [
"forsunchao@f3c5aaa3-ccec-8fd9-5322-fc38b0fccad4"
] | forsunchao@f3c5aaa3-ccec-8fd9-5322-fc38b0fccad4 |
44ae717ec0acc9a39a90bafc9dc817a8d9dd68ed | b214f96566446763ce5679dd2121ea3d277a9406 | /modules/base/ide-impl/src/main/java/consulo/ide/impl/idea/ide/projectView/impl/ProjectViewPaneSelectionHelper.java | 4a77c05767a234f1f6f5fd7c92570a5d8b3813bb | [
"Apache-2.0",
"LicenseRef-scancode-jgraph"
] | permissive | consulo/consulo | aa340d719d05ac6cbadd3f7d1226cdb678e6c84f | d784f1ef5824b944c1ee3a24a8714edfc5e2b400 | refs/heads/master | 2023-09-06T06:55:04.987216 | 2023-09-01T06:42:16 | 2023-09-01T06:42:16 | 10,116,915 | 680 | 54 | Apache-2.0 | 2023-06-05T18:28:51 | 2013-05-17T05:48:18 | Java | UTF-8 | Java | false | false | 2,999 | java | // Copyright 2000-2019 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
package consulo.ide.impl.idea.ide.projectView.impl;
import consulo.annotation.component.ComponentScope;
import consulo.annotation.component.ExtensionAPI;
import consulo.project.ui.view.tree.AbstractTreeNode;
import consulo.component.extension.ExtensionPointName;
import consulo.virtualFileSystem.VirtualFile;
import consulo.language.psi.PsiElement;
import consulo.ide.impl.idea.util.containers.ContainerUtil;
import jakarta.annotation.Nonnull;
import jakarta.annotation.Nullable;
import javax.swing.tree.TreePath;
import java.util.List;
/**
* Implement this extension to customise selection process in the project view.
*/
@ExtensionAPI(ComponentScope.APPLICATION)
public interface ProjectViewPaneSelectionHelper {
public static final ExtensionPointName<ProjectViewPaneSelectionHelper> EP_NAME = ExtensionPointName.create(ProjectViewPaneSelectionHelper.class);
/**
* @param selectionDescriptor information about target elements and potential {@link TreePath tree paths} for selection found by {@link AbstractProjectViewPane#createVisitor(PsiElement, VirtualFile, List)} node visitor}
* @return collection of tree paths to select in tree or null if this helper can't handle {@link SelectionDescriptor}
* @see AbstractTreeNode#canRepresent
*/
@Nullable
public abstract List<? extends TreePath> computeAdjustedPaths(@Nonnull SelectionDescriptor selectionDescriptor);
/**
* @param selectionDescriptor information about target elements and potential {@link TreePath tree paths} for selection found by {@link AbstractProjectViewPane#createVisitor(PsiElement, VirtualFile, List)} node visitor}
* @return list of {@link TreePath tree paths} to select, computed from {@code selectionDescriptor} with first suitable selection helper
* Returns {@link SelectionDescriptor#originalTreePaths original paths} by default
*/
@Nonnull
public static List<? extends TreePath> getAdjustedPaths(@Nonnull SelectionDescriptor selectionDescriptor) {
for (ProjectViewPaneSelectionHelper helper : EP_NAME.getExtensionList()) {
List<? extends TreePath> adjustedPaths = helper.computeAdjustedPaths(selectionDescriptor);
if (adjustedPaths != null) {
return adjustedPaths;
}
}
return selectionDescriptor.originalTreePaths;
}
public static class SelectionDescriptor {
@Nullable
public final PsiElement targetPsiElement;
@Nullable
public final VirtualFile targetVirtualFile;
@Nonnull
public final List<TreePath> originalTreePaths;
public SelectionDescriptor(@Nullable PsiElement targetPsiElement, @Nullable VirtualFile targetVirtualFile, @Nonnull List<TreePath> originalTreePaths) {
this.targetPsiElement = targetPsiElement;
this.targetVirtualFile = targetVirtualFile;
this.originalTreePaths = ContainerUtil.immutableList(originalTreePaths);
}
}
}
| [
"vistall.valeriy@gmail.com"
] | vistall.valeriy@gmail.com |
8333cec3c6c336affd76ce8d66a73fd4ff3771e5 | c0b312c7418f22ccbe1b1b3358667838e00b6243 | /src/com/gridscape/sep/org/zigbee/sep/CreditTypeChange.java | 74f6fc8bfebc9d4191abe7803488b66ab213eac2 | [] | no_license | rahul-me/e-ope | cb8005ad93dfe9b5b2f792379f33b678c1bc76a3 | 3b2e76c3c0109ab10eb2caf013ed541ed54fb260 | refs/heads/master | 2022-04-16T18:17:45.953574 | 2020-04-10T17:44:41 | 2020-04-10T17:44:41 | 254,696,703 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,159 | java |
package com.gridscape.sep.org.zigbee.sep;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlType;
/**
* Specifies a change to the credit type.
*
* <p>Java class for CreditTypeChange complex type.
*
* <p>The following schema fragment specifies the expected content contained within this class.
*
* <pre>
* <complexType name="CreditTypeChange">
* <complexContent>
* <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
* <sequence>
* <element name="newType" type="{http://zigbee.org/sep}CreditTypeType"/>
* <element name="startTime" type="{http://zigbee.org/sep}TimeType"/>
* </sequence>
* </restriction>
* </complexContent>
* </complexType>
* </pre>
*
*
*/
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "CreditTypeChange", propOrder = {
"newType",
"startTime"
})
public class CreditTypeChange {
@XmlElement(required = true)
protected CreditTypeType newType;
@XmlElement(required = true)
protected TimeType startTime;
/**
* Gets the value of the newType property.
*
* @return
* possible object is
* {@link CreditTypeType }
*
*/
public CreditTypeType getNewType() {
return newType;
}
/**
* Sets the value of the newType property.
*
* @param value
* allowed object is
* {@link CreditTypeType }
*
*/
public void setNewType(CreditTypeType value) {
this.newType = value;
}
/**
* Gets the value of the startTime property.
*
* @return
* possible object is
* {@link TimeType }
*
*/
public TimeType getStartTime() {
return startTime;
}
/**
* Sets the value of the startTime property.
*
* @param value
* allowed object is
* {@link TimeType }
*
*/
public void setStartTime(TimeType value) {
this.startTime = value;
}
}
| [
"crahul10101991@gmail.com"
] | crahul10101991@gmail.com |
5cf2dade278cff2e01b0155377d48528c8aab140 | 863acb02a064a0fc66811688a67ce3511f1b81af | /sources/p005cm/aptoide/p006pt/view/ActivityModule_ProvideSplashScreenManagerFactory.java | 5214f13fded5fbafb70c8aac50961585027468fd | [
"MIT"
] | permissive | Game-Designing/Custom-Football-Game | 98d33eb0c04ca2c48620aa4a763b91bc9c1b7915 | 47283462b2066ad5c53b3c901182e7ae62a34fc8 | refs/heads/master | 2020-08-04T00:02:04.876780 | 2019-10-06T06:55:08 | 2019-10-06T06:55:08 | 211,914,568 | 1 | 1 | null | null | null | null | UTF-8 | Java | false | false | 2,380 | java | package p005cm.aptoide.p006pt.view;
import org.jacoco.agent.p025rt.internal_8ff85ea.Offline;
import p005cm.aptoide.p006pt.splashscreen.SplashScreenManager;
import p318e.p319a.C13181b;
import p318e.p319a.C13182c;
/* renamed from: cm.aptoide.pt.view.ActivityModule_ProvideSplashScreenManagerFactory */
public final class ActivityModule_ProvideSplashScreenManagerFactory implements C13181b<SplashScreenManager> {
private static transient /* synthetic */ boolean[] $jacocoData;
private final ActivityModule module;
private static /* synthetic */ boolean[] $jacocoInit() {
boolean[] zArr = $jacocoData;
if (zArr != null) {
return zArr;
}
boolean[] probes = Offline.getProbes(-7578455141608415307L, "cm/aptoide/pt/view/ActivityModule_ProvideSplashScreenManagerFactory", 7);
$jacocoData = probes;
return probes;
}
public ActivityModule_ProvideSplashScreenManagerFactory(ActivityModule module2) {
boolean[] $jacocoInit = $jacocoInit();
this.module = module2;
$jacocoInit[0] = true;
}
public SplashScreenManager get() {
boolean[] $jacocoInit = $jacocoInit();
ActivityModule activityModule = this.module;
$jacocoInit[1] = true;
SplashScreenManager provideSplashScreenManager = activityModule.provideSplashScreenManager();
$jacocoInit[2] = true;
C13182c.m43111a(provideSplashScreenManager, "Cannot return null from a non-@Nullable @Provides method");
SplashScreenManager splashScreenManager = provideSplashScreenManager;
$jacocoInit[3] = true;
return splashScreenManager;
}
public static C13181b<SplashScreenManager> create(ActivityModule module2) {
boolean[] $jacocoInit = $jacocoInit();
ActivityModule_ProvideSplashScreenManagerFactory activityModule_ProvideSplashScreenManagerFactory = new ActivityModule_ProvideSplashScreenManagerFactory(module2);
$jacocoInit[4] = true;
return activityModule_ProvideSplashScreenManagerFactory;
}
public static SplashScreenManager proxyProvideSplashScreenManager(ActivityModule instance) {
boolean[] $jacocoInit = $jacocoInit();
SplashScreenManager provideSplashScreenManager = instance.provideSplashScreenManager();
$jacocoInit[5] = true;
return provideSplashScreenManager;
}
}
| [
"tusharchoudhary0003@gmail.com"
] | tusharchoudhary0003@gmail.com |
5956fc16e51387e692f4ede7f4bb91f0cea0a63e | dd566c2ff27a23500a6c6fbd41331b63dfaec026 | /src/com/ufgov/gk/client/component/button/EffectButton.java | 31a44eb0af5726d6124499a50f6293357dfd050f | [] | no_license | jielen/EB | 0e1154c476bf07f5f4a16d9915a33420bd3519e0 | ed0a3027a8e3f5998230b964ced5dc9134669a09 | refs/heads/master | 2020-04-08T00:52:30.321902 | 2015-08-29T17:25:00 | 2015-08-29T17:25:00 | 41,600,840 | 0 | 1 | null | null | null | null | WINDOWS-1252 | Java | false | false | 345 | java | package com.ufgov.gk.client.component.button;
public class EffectButton extends FuncButton {
/**
*
*/
private static final long serialVersionUID = -2564446291342163428L;
public EffectButton() {
super();
}
protected void init() {
this.funcId="feffect";
this.defaultText="Ï´ï";
super.init();
}
}
| [
"jielenzghsy1@163.com"
] | jielenzghsy1@163.com |
afabd5af09723925b2da879e4e714c5965568481 | 364e81cb0c01136ac179ff42e33b2449c491b7e5 | /spell/branches/1.5/spel-dev/org.python.pydev/src_navigator/org/python/pydev/navigator/filters/CustomFilters.java | 8bb57c22b361eeac62367f2ad95bff70fd4de536 | [] | no_license | unnch/spell-sat | 2b06d9ed62b002e02d219bd0784f0a6477e365b4 | fb11a6800316b93e22ee8c777fe4733032004a4a | refs/heads/master | 2021-01-23T11:49:25.452995 | 2014-10-14T13:04:18 | 2014-10-14T13:04:18 | 42,499,379 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,844 | java | package org.python.pydev.navigator.filters;
import java.lang.ref.WeakReference;
import org.eclipse.core.resources.IResource;
import org.eclipse.core.runtime.IAdaptable;
import org.eclipse.jface.preference.IPreferenceStore;
import org.eclipse.jface.util.IPropertyChangeListener;
import org.eclipse.jface.util.PropertyChangeEvent;
import org.eclipse.jface.viewers.Viewer;
import org.eclipse.jface.viewers.ViewerFilter;
import org.python.pydev.core.docutils.StringUtils;
import org.python.pydev.navigator.actions.PySetupCustomFilters;
import org.python.pydev.navigator.properties.StringMatcherSimple;
import org.python.pydev.plugin.PydevPlugin;
/**
* Will filter out any resource that matches a filter that the user specified.
*
* @author Fabio
*/
public class CustomFilters extends ViewerFilter{
/**
* This property listener will just store a weak reference to the custom filter that actually needs the values
* (so that it is not kept alive by registering itself in the preferences).
*
* @author Fabio
*/
private static class PropertyListener implements IPropertyChangeListener{
private WeakReference<CustomFilters> weakCustomFilter;
public PropertyListener(CustomFilters customFilter){
weakCustomFilter = new WeakReference<CustomFilters>(customFilter);
IPreferenceStore prefs = PydevPlugin.getDefault().getPreferenceStore();
prefs.addPropertyChangeListener(this);
}
public void propertyChange(PropertyChangeEvent event) {
CustomFilters customFilters = weakCustomFilter.get();
if(customFilters == null){
IPreferenceStore prefs = PydevPlugin.getDefault().getPreferenceStore();
prefs.removePropertyChangeListener(this);
}else{
String property = event.getProperty();
if(property.equals(PySetupCustomFilters.CUSTOM_FILTERS_PREFERENCE_NAME)){
customFilters.update((String)event.getNewValue());
}
}
}
}
/**
* Update the initial filters and register a listener for it.
*/
public CustomFilters(){
IPreferenceStore prefs = PydevPlugin.getDefault().getPreferenceStore();
update(prefs.getString(PySetupCustomFilters.CUSTOM_FILTERS_PREFERENCE_NAME));
new PropertyListener(this); //this is the listener that will update this filter
}
/**
* Filter things out based on the filter.
*/
@Override
public boolean select(Viewer viewer, Object parentElement, Object element) {
if(element instanceof IAdaptable){
IAdaptable adaptable = (IAdaptable) element;
Object adapted = adaptable.getAdapter(IResource.class);
if(adapted instanceof IResource){
IResource resource = (IResource) adapted;
String name = resource.getName();
StringMatcherSimple[] temp = filters;
for(int i=0; i<temp.length;i++){
if(temp[i].match(name)){
return false;
}
}
}
}
return true;
}
/**
* Holds the filters available.
*/
private StringMatcherSimple[] filters;
public void update(String customFilters) {
String[] splittedCustomFilters = StringUtils.split(customFilters, ',');
StringMatcherSimple[] temp = new StringMatcherSimple[splittedCustomFilters.length];
for (int i = 0; i < temp.length; i++) {
temp[i] = new StringMatcherSimple(splittedCustomFilters[i].trim());
}
filters = temp;
}
}
| [
"rafael.chinchilla@gmail.com"
] | rafael.chinchilla@gmail.com |
fe2b36148ed498d59464a1c8a8ce9058e865d58f | 0a5d30055138668a28d61ab3e35657c7f9ed267d | /baseutil/src/main/java/com/bumptech/glide/load/resource/bitmap/BitmapDrawableResource.java | dfc8605c46b4994829bf81017a34d943093ff84f | [] | no_license | ytempest/DayDay | 098347f98d71b0a31e403a40391895457670e2d4 | 847320f064485eb058a42563d40ab3df49ff4335 | refs/heads/master | 2020-03-06T18:31:06.871959 | 2018-03-27T15:33:37 | 2018-03-27T15:33:37 | 127,008,702 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,243 | java | package com.bumptech.glide.load.resource.bitmap;
import android.graphics.drawable.BitmapDrawable;
import com.bumptech.glide.load.engine.bitmap_recycle.BitmapPool;
import com.bumptech.glide.load.resource.drawable.DrawableResource;
import com.bumptech.glide.util.Util;
/**
* A {@link com.bumptech.glide.load.engine.Resource} that wraps an
* {@link BitmapDrawable}
*
* <p> This class ensures that every call to {@link #get()}} always returns a new
* {@link BitmapDrawable} to avoid rendering issues if used in multiple
* views and is also responsible for returning the underlying {@link android.graphics.Bitmap} to the
* given {@link BitmapPool} when the resource is
* recycled. </p>
*/
public class BitmapDrawableResource extends DrawableResource<BitmapDrawable> {
private final BitmapPool bitmapPool;
public BitmapDrawableResource(BitmapDrawable drawable, BitmapPool bitmapPool) {
super(drawable);
this.bitmapPool = bitmapPool;
}
@Override
public Class<BitmapDrawable> getResourceClass() {
return BitmapDrawable.class;
}
@Override
public int getSize() {
return Util.getBitmapByteSize(drawable.getBitmap());
}
@Override
public void recycle() {
bitmapPool.put(drawable.getBitmap());
}
}
| [
"787491096@qq.com"
] | 787491096@qq.com |
773a8e49a7de33b8ae303309e6b0024589426319 | 4ecc390ae66bbb8bad8a6bba636fd19702205d34 | /minecraft 1.8/bva.java | 6ddb6997205a487f7d675944ae20c5a1e912ce38 | [] | no_license | project-ion/Decompile-Minecraft | d9c967e57ff7d24ada8c4c49f832dac25f18bb9e | 12882633319383b7652b475b4f08b6f72acdddc4 | refs/heads/master | 2021-01-23T15:28:54.832366 | 2014-09-20T09:57:54 | 2014-09-20T09:57:54 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 685 | java | /* 1: */ public class bva
/* 2: */ extends bvf
/* 3: */ {
/* 4: */ private final boolean a;
/* 5: */
/* 6: */ public bva(int paramInt, String paramString, boolean paramBoolean1, boolean paramBoolean2)
/* 7: */ {
/* 8:455 */ super(paramInt, paramString, paramBoolean1);
/* 9:456 */ this.a = paramBoolean2;
/* 10: */ }
/* 11: */
/* 12: */ public boolean a()
/* 13: */ {
/* 14:460 */ return this.a;
/* 15: */ }
/* 16: */ }
/* Location: C:\Users\Hugo Haldi\Desktop\Decompile Minecraft\1.8.jar
* Qualified Name: bva
* JD-Core Version: 0.7.0.1
*/ | [
"projection-team@hotmail.com"
] | projection-team@hotmail.com |
a2d8fa550c86ea79a431e116db6453c54ca3983b | ed28460c5d24053259ab189978f97f34411dfc89 | /Software Engineering/Java Web/Web Development Basics/January - 2018/10. Exam Preparation/Exam Preparation 1/Solution/broccolina/src/org/softuni/broccolina/util/JarUnzipUtil.java | 6d311fa6ef8db1bec3058180a8e053fc1f382b20 | [] | no_license | Dimulski/SoftUni | 6410fa10ba770c237bac617205c86ce25c5ec8f4 | 7954b842cfe0d6f915b42702997c0b4b60ddecbc | refs/heads/master | 2023-01-24T20:42:12.017296 | 2020-01-05T08:40:14 | 2020-01-05T08:40:14 | 48,689,592 | 2 | 1 | null | 2023-01-12T07:09:45 | 2015-12-28T11:33:32 | Java | UTF-8 | Java | false | false | 1,411 | java | package org.softuni.broccolina.util;
import java.io.File;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.util.Enumeration;
import java.util.jar.JarEntry;
import java.util.jar.JarFile;
public class JarUnzipUtil {
public void unzipJar(String jarCanonicalPath) throws IOException {
JarFile jar = new JarFile(new File(jarCanonicalPath));
File outDirectiory = new File(jarCanonicalPath.replace(".jar", ""));
if(outDirectiory.exists()) outDirectiory.delete();
outDirectiory.mkdir();
Enumeration<JarEntry> entries = jar.entries();
while(entries.hasMoreElements()) {
JarEntry currentEntry = entries.nextElement();
File currentFile = new File(
outDirectiory.getCanonicalPath()
+ File.separator
+ currentEntry.getName());
if(currentEntry.isDirectory()) {
currentFile.mkdir();
continue;
}
InputStream inputStream = jar.getInputStream(currentEntry);
FileOutputStream outputStream = new FileOutputStream(currentFile);
while(inputStream.available() > 0) {
outputStream.write(inputStream.read());
}
outputStream.close();
inputStream.close();
}
jar.close();
}
}
| [
"george.dimulski@gmail.com"
] | george.dimulski@gmail.com |
cf567e5f777b4a0a72214576e13865bd0b8f7fb7 | 24d8cf871b092b2d60fc85d5320e1bc761a7cbe2 | /JabRef/rev2620-2863/base-branch-2620/java/net/sf/jabref/mods/PageNumbers.java | d31cd33b5e6c8084d462e4755ffd05303d0d6a49 | [] | no_license | joliebig/featurehouse_fstmerge_examples | af1b963537839d13e834f829cf51f8ad5e6ffe76 | 1a99c1788f0eb9f1e5d8c2ced3892d00cd9449ad | refs/heads/master | 2016-09-05T10:24:50.974902 | 2013-03-28T16:28:47 | 2013-03-28T16:28:47 | 9,080,611 | 3 | 2 | null | null | null | null | UTF-8 | Java | false | false | 1,302 | java |
package net.sf.jabref.mods;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
import org.w3c.dom.Document;
import org.w3c.dom.Element;
import org.w3c.dom.Node;
public class PageNumbers {
String freeform = null;
int start, end;
public PageNumbers(String s) {
parsePageNums(s);
}
protected void parsePageNums(String s) {
Pattern p = Pattern.compile("\\s*(\\d+)\\s*-{1,2}\\s*(\\d+)\\s*");
Matcher m = p.matcher(s);
if (m.matches()) {
start = Integer.parseInt(m.group(1));
end = Integer.parseInt(m.group(2));
}
else
freeform = s;
}
public Element getDOMrepresentation(Document d) {
Element result = d.createElement("extent");
result.setAttribute("unit","page");
if (freeform != null) {
Node t = d.createTextNode(freeform);
result.appendChild(t);
}
else {
Element start = d.createElement("start");
Element end = d.createElement("end");
start.appendChild(d.createTextNode("" + this.start));
end.appendChild(d.createTextNode("" + this.end));
result.appendChild(start);
result.appendChild(end);
}
return result;
}
public String toString(String seperator) {
if (freeform != null)
return freeform;
return (start+seperator+end);
}
public String toString() {
return toString("--");
}
}
| [
"joliebig@fim.uni-passau.de"
] | joliebig@fim.uni-passau.de |
3dfb8ba66dec7fa4f52c0f29ee8191c5e3e324ef | 3bbf23b509e9a94715aae381ca5de96af35fa588 | /HelloWorld/src/Loop3.java | b4f7583affedf74a7900a0c4ba65f75a319a8aab | [] | no_license | william0503/Fiap_JavaPlataform | 76a6457046bbc784216cadfbd4cb7227f98e5c2e | 68a301c4340fad94c7cdb4221c89678b5fb717dd | refs/heads/master | 2020-08-04T17:11:58.492084 | 2019-11-01T01:51:50 | 2019-11-01T01:51:50 | 212,215,199 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 134 | java |
public class Loop3 {
public static void main(String[] args) {
for (int i = 3; i < 100; i+=3) {
System.out.println(i);
}
}
}
| [
"logonaluno@local.com"
] | logonaluno@local.com |
d47ddb9094de3dae17ce9ebc6e9700d570910a69 | 6500848c3661afda83a024f9792bc6e2e8e8a14e | /gp_JADX/com/google/android/finsky/uninstall/v2a/ae.java | 6c70325069bb3f1d5ea56b48be13353faf6424da | [] | no_license | enaawy/gproject | fd71d3adb3784d12c52daf4eecd4b2cb5c81a032 | 91cb88559c60ac741d4418658d0416f26722e789 | refs/heads/master | 2021-09-03T03:49:37.813805 | 2018-01-05T09:35:06 | 2018-01-05T09:35:06 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 480 | java | package com.google.android.finsky.uninstall.v2a;
import android.content.Intent;
import android.view.View;
import com.google.android.play.utils.m;
final class ae implements m {
public final /* synthetic */ Intent f23716a;
public final /* synthetic */ ad f23717b;
ae(ad adVar, Intent intent) {
this.f23717b = adVar;
this.f23716a = intent;
}
public final void m21456a(View view, String str) {
this.f23717b.m580a(this.f23716a);
}
}
| [
"genius.ron@gmail.com"
] | genius.ron@gmail.com |
e157f4223f4c33109fc1f66ec8792eabeee0d37a | 37634d1ecae018b3074192ba36be568e0369d4c4 | /xml/src/test/java/org/geojsf/model/xml/geojsf/TestXmlViewPort.java | b786464c55489fd9b6475309895df2052f913483 | [] | no_license | aht-group/geojsf | 5fce26472a30576e6fde84a753e4f46121fb7c99 | e1dab2b6aae851f00ba55bb98aad539ec5ee9aa6 | refs/heads/master | 2023-08-30T15:57:16.554160 | 2023-08-28T13:38:30 | 2023-08-28T13:38:30 | 41,243,601 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,479 | java | package org.geojsf.model.xml.geojsf;
import java.io.FileNotFoundException;
import net.sf.exlp.util.xml.JaxbUtil;
import org.geojsf.model.xml.geojsf.ViewPort;
import org.geojsf.test.GeoJsfXmlTstBootstrap;
import org.junit.BeforeClass;
import org.junit.Test;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
public class TestXmlViewPort extends AbstractXmlGeojsfTest
{
final static Logger logger = LoggerFactory.getLogger(TestXmlViewPort.class);
@BeforeClass
public static void initFiles()
{
setXmlFile(dirSuffix, ViewPort.class);
}
@Test
public void test() throws FileNotFoundException
{
ViewPort actual = create(true);
ViewPort expected = JaxbUtil.loadJAXB(fXml.getAbsolutePath(), ViewPort.class);
assertJaxbEquals(expected, actual);
}
public static ViewPort create(boolean withChilds)
{
ViewPort xml = new ViewPort();
xml.setId(123);
xml.setLat(1.23);
xml.setLon(4.56);
xml.setTop(2.22);
xml.setLeft(3.33);
xml.setRight(4.44);
xml.setBottom(5.55);
if(withChilds)
{
xml.setScale(TestXmlScale.create(false));
}
return xml;
}
public void save() {save(create(true), fXml);}
public static void main(String[] args)
{
GeoJsfXmlTstBootstrap.init();
TestXmlViewPort.initFiles();
TestXmlViewPort test = new TestXmlViewPort();
test.save();
}
} | [
"t.kisner@web.de"
] | t.kisner@web.de |
0d300fc6fe7a7e5ebc218c89d314e28d727b0122 | 995f73d30450a6dce6bc7145d89344b4ad6e0622 | /P40_HarmonyOS_2.0.0_Developer_Beta1/src/main/java/huawei/android/storage/HwCustDeviceStorageMonitorServiceImpl.java | f43f379b4bdf16d3ba97b472efeb53da0cfffba8 | [] | 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 | 8,055 | java | package huawei.android.storage;
import android.app.AlertDialog;
import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.DialogInterface;
import android.content.Intent;
import android.content.IntentFilter;
import android.content.pm.ResolveInfo;
import android.os.Handler;
import android.os.Message;
import android.os.SystemClock;
import android.os.SystemProperties;
import android.util.Log;
import android.util.Slog;
import com.android.server.storage.AbsDeviceStorageMonitorService;
import java.util.List;
public class HwCustDeviceStorageMonitorServiceImpl extends HwCustDeviceStorageMonitorService {
private static final String ACTION_HWSYSTEMMANAGER_STORAGE_CLEAN = "huawei.intent.action.HSM_STORAGE_CLEANER";
private static final int CRITICAL_LOW_REMIND_INTERVAL = 600000;
private static final int CRITICAL_LOW_THRESHOLD_BYTES = 8388608;
private static final int DEVICE_MEMORY_CRITICAL_LOW = 1001;
private static final String ENCRYPTED_STATE = "encrypted";
private static final String ENCRYPTING_STATE = "trigger_restart_min_framework";
protected static final boolean HWDBG = (Log.HWLog || (Log.HWModuleLog && Log.isLoggable(TAG, 3)));
protected static final boolean HWFLOW;
protected static final boolean HWLOGW_E = true;
private static final String TAG = "HwCustDeviceStorage";
private static final String TAG_FLOW = "HwCustDeviceStorage_FLOW";
private static final String TAG_INIT = "HwCustDeviceStorage_INIT";
private boolean mConfigChanged;
private Context mContext;
private Intent mCriticalLowIntent;
private AlertDialog mDialog;
private Handler mHandler;
private boolean mHasReminded;
private BroadcastReceiver mIntentReceiver;
private long mLastShowDialogTime;
static {
boolean z = false;
if (Log.HWINFO || (Log.HWModuleLog && Log.isLoggable(TAG, 4))) {
z = true;
}
HWFLOW = z;
}
public HwCustDeviceStorageMonitorServiceImpl(AbsDeviceStorageMonitorService obj, Handler handler) {
super(obj, handler);
this.mCriticalLowIntent = null;
this.mHandler = null;
this.mContext = null;
this.mDialog = null;
this.mLastShowDialogTime = 0;
this.mConfigChanged = false;
this.mHasReminded = false;
this.mIntentReceiver = new BroadcastReceiver() {
/* class huawei.android.storage.HwCustDeviceStorageMonitorServiceImpl.AnonymousClass1 */
@Override // android.content.BroadcastReceiver
public void onReceive(Context context, Intent intent) {
if ("android.intent.action.LOCALE_CHANGED".equals(intent.getAction())) {
HwCustDeviceStorageMonitorServiceImpl.this.mConfigChanged = HwCustDeviceStorageMonitorServiceImpl.HWLOGW_E;
if (HwCustDeviceStorageMonitorServiceImpl.this.mDialog != null) {
HwCustDeviceStorageMonitorServiceImpl.this.mDialog.cancel();
}
}
}
};
this.mContext = this.mService.getContext();
IntentFilter filter = new IntentFilter();
filter.addAction("android.intent.action.LOCALE_CHANGED");
this.mContext.registerReceiver(this.mIntentReceiver, filter);
this.mCriticalLowIntent = new Intent(ACTION_HWSYSTEMMANAGER_STORAGE_CLEAN);
List<ResolveInfo> activitiesList = this.mContext.getPackageManager().queryIntentActivities(this.mCriticalLowIntent, 65536);
if (activitiesList == null || activitiesList.size() <= 0) {
this.mCriticalLowIntent = new Intent("android.intent.action.MANAGE_PACKAGE_STORAGE");
}
this.mCriticalLowIntent.setFlags(335544320);
this.mHandler = new Handler(handler.getLooper()) {
/* class huawei.android.storage.HwCustDeviceStorageMonitorServiceImpl.AnonymousClass2 */
@Override // android.os.Handler
public void handleMessage(Message msg) {
if (msg.what == HwCustDeviceStorageMonitorServiceImpl.DEVICE_MEMORY_CRITICAL_LOW) {
if (HwCustDeviceStorageMonitorServiceImpl.this.mDialog == null || HwCustDeviceStorageMonitorServiceImpl.this.mConfigChanged) {
if (HwCustDeviceStorageMonitorServiceImpl.this.mConfigChanged) {
HwCustDeviceStorageMonitorServiceImpl.this.mConfigChanged = false;
}
AlertDialog.Builder builder = new AlertDialog.Builder(HwCustDeviceStorageMonitorServiceImpl.this.mContext);
builder.setIcon(17301543);
builder.setTitle(33686006);
builder.setMessage(33686007);
builder.setNegativeButton(17039360, (DialogInterface.OnClickListener) null);
builder.setPositiveButton(17039370, new DialogInterface.OnClickListener() {
/* class huawei.android.storage.HwCustDeviceStorageMonitorServiceImpl.AnonymousClass2.AnonymousClass1 */
@Override // android.content.DialogInterface.OnClickListener
public void onClick(DialogInterface dialog, int which) {
HwCustDeviceStorageMonitorServiceImpl.this.mContext.startActivity(HwCustDeviceStorageMonitorServiceImpl.this.mCriticalLowIntent);
}
});
builder.setOnDismissListener(new DialogInterface.OnDismissListener() {
/* class huawei.android.storage.HwCustDeviceStorageMonitorServiceImpl.AnonymousClass2.AnonymousClass2 */
@Override // android.content.DialogInterface.OnDismissListener
public void onDismiss(DialogInterface dialog) {
if (HwCustDeviceStorageMonitorServiceImpl.HWFLOW) {
Slog.i(HwCustDeviceStorageMonitorServiceImpl.TAG_FLOW, "dialog is dissmiss!");
}
HwCustDeviceStorageMonitorServiceImpl.this.mLastShowDialogTime = SystemClock.elapsedRealtime();
}
});
HwCustDeviceStorageMonitorServiceImpl.this.mDialog = builder.create();
HwCustDeviceStorageMonitorServiceImpl.this.mDialog.getWindow().setType(2003);
}
long currTime = SystemClock.elapsedRealtime();
if (HwCustDeviceStorageMonitorServiceImpl.this.mDialog.isShowing()) {
return;
}
if (HwCustDeviceStorageMonitorServiceImpl.this.mHasReminded && currTime - HwCustDeviceStorageMonitorServiceImpl.this.mLastShowDialogTime <= 600000) {
return;
}
if (SystemProperties.getInt("ctsrunning", 0) == 0) {
HwCustDeviceStorageMonitorServiceImpl.this.mHasReminded = HwCustDeviceStorageMonitorServiceImpl.HWLOGW_E;
HwCustDeviceStorageMonitorServiceImpl.this.mDialog.show();
} else if (HwCustDeviceStorageMonitorServiceImpl.HWFLOW) {
Slog.i(HwCustDeviceStorageMonitorServiceImpl.TAG_FLOW, "In CTS Running,do not show the no space dailog");
}
}
}
};
}
public void clearMemoryForCritiLow() {
String decryptState = SystemProperties.get("vold.decrypt");
if (!ENCRYPTED_STATE.equals(SystemProperties.get("ro.crypto.state")) && !ENCRYPTING_STATE.equals(decryptState)) {
this.mHandler.removeMessages(DEVICE_MEMORY_CRITICAL_LOW);
Handler handler = this.mHandler;
handler.sendMessage(handler.obtainMessage(DEVICE_MEMORY_CRITICAL_LOW));
}
}
public long getCritiLowMemThreshold() {
return 8388608;
}
}
| [
"dstmath@163.com"
] | dstmath@163.com |
46e005fe2f6e2997862c87ca637b8bdb018b8a44 | cfc60fc1148916c0a1c9b421543e02f8cdf31549 | /src/testcases/CWE113_HTTP_Response_Splitting/CWE113_HTTP_Response_Splitting__connect_tcp_setHeaderServlet_54e.java | 043eb5614f5788a8c0faed510a756b322a89cb4e | [
"LicenseRef-scancode-public-domain"
] | permissive | zhujinhua/GitFun | c77c8c08e89e61006f7bdbc5dd175e5d8bce8bd2 | 987f72fdccf871ece67f2240eea90e8c1971d183 | refs/heads/master | 2021-01-18T05:46:03.351267 | 2012-09-11T16:43:44 | 2012-09-11T16:43:44 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,858 | java | /* TEMPLATE GENERATED TESTCASE FILE
Filename: CWE113_HTTP_Response_Splitting__connect_tcp_setHeaderServlet_54e.java
Label Definition File: CWE113_HTTP_Response_Splitting.label.xml
Template File: sources-sinks-54e.tmpl.java
*/
/*
* @description
* CWE: 113 HTTP Response Splitting
* BadSource: connect_tcp Read data using an outbound tcp connection
* GoodSource: A hardcoded string
* Sinks: setHeaderServlet
* GoodSink: URLEncode input
* BadSink : querystring to setHeader()
* Flow Variant: 54 Data flow: data passed as an argument from one method through three others to a fifth; all five functions are in different classes in the same package
*
* */
package testcases.CWE113_HTTP_Response_Splitting;
import testcasesupport.*;
import javax.servlet.http.*;
import java.net.URLEncoder;
public class CWE113_HTTP_Response_Splitting__connect_tcp_setHeaderServlet_54e
{
public void bad_sink(String data , HttpServletRequest request, HttpServletResponse response) throws Throwable
{
/* POTENTIAL FLAW: Input not verified before inclusion in header */
response.setHeader("Location", "/author.jsp?lang=" + data);
}
/* goodG2B() - use goodsource and badsink */
public void goodG2B_sink(String data , HttpServletRequest request, HttpServletResponse response) throws Throwable
{
/* POTENTIAL FLAW: Input not verified before inclusion in header */
response.setHeader("Location", "/author.jsp?lang=" + data);
}
/* goodB2G() - use badsource and goodsink */
public void goodB2G_sink(String data , HttpServletRequest request, HttpServletResponse response) throws Throwable
{
/* FIX: use URLEncoder.encode to hex-encode non-alphanumerics */
data = URLEncoder.encode(data, "UTF-16");
response.setHeader("Location", "/author.jsp?lang=" + data);
}
}
| [
"amitf@chackmarx.com"
] | amitf@chackmarx.com |
e76dbee13bdb5cd7cdee073af45d426ecdb7b42b | fa91450deb625cda070e82d5c31770be5ca1dec6 | /Diff-Raw-Data/22/22_0846bb65bdc0383ee7f9c4347dbe30d30069596e/TestOyster/22_0846bb65bdc0383ee7f9c4347dbe30d30069596e_TestOyster_s.java | 5726445d1917f1133e48b6edd2ef9f19d1bce0f6 | [] | no_license | zhongxingyu/Seer | 48e7e5197624d7afa94d23f849f8ea2075bcaec0 | c11a3109fdfca9be337e509ecb2c085b60076213 | refs/heads/master | 2023-07-06T12:48:55.516692 | 2023-06-22T07:55:56 | 2023-06-22T07:55:56 | 259,613,157 | 6 | 2 | null | 2023-06-22T07:55:57 | 2020-04-28T11:07:49 | null | UTF-8 | Java | false | false | 7,189 | java | package devo;
import static junit.framework.Assert.assertEquals;
import static junit.framework.Assert.fail;
import static devo.Oyster.LinkedLists.SNode.of;
import devo.Oyster.LinkedLists.SNode;
import java.util.List;
import org.junit.Test;
import com.google.common.base.Function;
import com.google.common.collect.ImmutableList;
public class TestOyster {
// Shift-Command-B, or Run | Toggle Breakpoint
// Command-F11, or Run | Debug
// F5 (step into), F6 (step over), F7 (step out), F8 (resume)
// Window | Open Perspective | Other ... | Debug
// Window | Show View | Other ... | Problem
// Control-Q to go to the last edit; Command-[, Command-]
@Test
public void testSNodeInsert() {
Oyster.LinkedLists.SNode head = Oyster.LinkedLists.SNode.insert(null, 2); // to be the one and the only node.
assertEquals(2, head.data);
assertEquals(null, head.next);
Oyster.LinkedLists.SNode head2 = Oyster.LinkedLists.SNode.insert(head, 4); // to be a tail.
assertEquals(2, head2.data);
assertEquals(4, head2.next.data);
assertEquals(null, head2.next.next);
Oyster.LinkedLists.SNode head3 = Oyster.LinkedLists.SNode.insert(head2, 3); // to be a middle man.
assertEquals(2, head3.data);
assertEquals(3, head3.next.data);
assertEquals(4, head3.next.next.data);
assertEquals(null, head3.next.next.next);
Oyster.LinkedLists.SNode head4 = Oyster.LinkedLists.SNode.insert(head2, 1); // to be a head.
assertEquals(1, head4.data);
assertEquals(2, head4.next.data);
assertEquals(3, head4.next.next.data);
assertEquals(4, head4.next.next.next.data);
assertEquals(null, head4.next.next.next.next);
}
@Test
public void testRemoveDupsInConstantSpace() {
SNode head1 = Oyster.LinkedLists.SNode.removeDupsInConstantSpace(of(1, of(2, of(2, null))));
assertEquals(1, head1.data);
assertEquals(2, head1.next.data);
assertEquals(null, head1.next.next);
}
/*
* Positive test cases:
* - {1} yields {1}.
* - {1, 2, 2} yields {2}.
* - {1, 2, 2, 3, 3, 3} yields {3}.
* - {2, 2} yields {2}.
* - {1, 1, 2, 2} yields {1, 2}.
* Negative test cases:
* - null throws NPE.
* - empty yields empty.
*/
@Test
public void testFindModesUsingMap() {
testFindModes(new Function<int[], List<Integer>>() {
public List<Integer> apply(int[] input) {
return Oyster.Arrays.findModesUsingMap(input);
};
});
}
@Test
public void testFindModesUsingArray() {
testFindModes(new Function<int[], List<Integer>>() {
public List<Integer> apply(int[] input) {
return Oyster.Arrays.findModesUsingArray(input);
};
});
}
private void testFindModes(Function<int[], List<Integer>> findModes) {
try {
findModes.apply(null);
fail("findsModes should have thrown NPE.");
} catch (AssertionError ae) {
} catch (NullPointerException npe) {
} catch (Exception e) {
fail("findsModes should have thrown NPE.");
}
assertEquals(ImmutableList.of(), findModes.apply(new int[0]));
assertEquals(ImmutableList.of(1), findModes.apply(new int[] { 1 }));
assertEquals(ImmutableList.of(2), findModes.apply(new int[] { 1, 2, 2 }));
assertEquals(ImmutableList.of(3), findModes.apply(new int[] { 1, 2, 2, 3, 3, 3 }));
assertEquals(ImmutableList.of(2), findModes.apply(new int[] { 2, 2 }));
assertEquals(ImmutableList.of(1, 2), findModes.apply(new int[] { 1, 1, 2, 2 }));
}
@Test
public void testIndexOutOfCycle() {
assertEquals(4, Oyster.Sorting.indexOutOfCycle(30, new int[] { 90, 100, 10, 20, 30, 40, 50, 60, 70, 80 }));
assertEquals(3, Oyster.Sorting.indexOutOfCycle(20, new int[] { 90, 100, 10, 20, 30, 40, 50, 60, 70, 80 }));
assertEquals(0, Oyster.Sorting.indexOutOfCycle(90, new int[] { 90, 100, 10, 20, 30, 40, 50, 60, 70, 80 }));
assertEquals(-1, Oyster.Sorting.indexOutOfCycle(95, new int[] { 90, 100, 10, 20, 30, 40, 50, 60, 70, 80 }));
assertEquals(5, Oyster.Sorting.indexOutOfCycle(40, new int[] { 90, 100, 10, 20, 30, 40, 50, 60, 70, 80 }));
assertEquals(9, Oyster.Sorting.indexOutOfCycle(80, new int[] { 90, 100, 10, 20, 30, 40, 50, 60, 70, 80 }));
assertEquals(8, Oyster.Sorting.indexOutOfCycle(70, new int[] { 90, 100, 10, 20, 30, 40, 50, 60, 70, 80 }));
assertEquals(-1, Oyster.Sorting.indexOutOfCycle(75, new int[] { 90, 100, 10, 20, 30, 40, 50, 60, 70, 80 }));
assertEquals(4, Oyster.Sorting.indexOutOfCycle(70, new int[] { 30, 40, 50, 60, 70, 80, 90, 100, 10, 20 }));
assertEquals(0, Oyster.Sorting.indexOutOfCycle(30, new int[] { 30, 40, 50, 60, 70, 80, 90, 100, 10, 20 }));
assertEquals(3, Oyster.Sorting.indexOutOfCycle(60, new int[] { 30, 40, 50, 60, 70, 80, 90, 100, 10, 20 }));
assertEquals(-1, Oyster.Sorting.indexOutOfCycle(55, new int[] { 30, 40, 50, 60, 70, 80, 90, 100, 10, 20 }));
assertEquals(5, Oyster.Sorting.indexOutOfCycle(80, new int[] { 30, 40, 50, 60, 70, 80, 90, 100, 10, 20 }));
assertEquals(9, Oyster.Sorting.indexOutOfCycle(20, new int[] { 30, 40, 50, 60, 70, 80, 90, 100, 10, 20 }));
assertEquals(8, Oyster.Sorting.indexOutOfCycle(10, new int[] { 30, 40, 50, 60, 70, 80, 90, 100, 10, 20 }));
assertEquals(-1, Oyster.Sorting.indexOutOfCycle(15, new int[] { 30, 40, 50, 60, 70, 80, 90, 100, 10, 20 }));
}
@Test
public void testFindSmallestOutOfCycle() {
try {
Oyster.Sorting.smallestOutOfCycle(null);
fail("'numbers' must be non-null.");
} catch (IllegalArgumentException e) {
}
try {
Oyster.Sorting.smallestOutOfCycle(new int[0]);
fail("'numbers' must not be empty.");
} catch (IllegalArgumentException e) {
}
assertEquals(6, Oyster.Sorting.smallestOutOfCycle(new int[] { 6 }));
assertEquals(6, Oyster.Sorting.smallestOutOfCycle(new int[] { 6, 7 }));
assertEquals(6, Oyster.Sorting.smallestOutOfCycle(new int[] { 7, 6 }));
assertEquals(6, Oyster.Sorting.smallestOutOfCycle(new int[] { 38, 40, 55, 89, 6, 13, 20, 23, 36 }));
assertEquals(6, Oyster.Sorting.smallestOutOfCycle(new int[] { 6, 13, 20, 23, 36, 38, 40, 55, 89 }));
assertEquals(6, Oyster.Sorting.smallestOutOfCycle(new int[] { 13, 20, 23, 36, 38, 40, 55, 89, 6 }));
}
@Test
public void testToAndFromExcelColumn() {
assertEquals("AB", Oyster.Recursions.toExcelColumn(28));
assertEquals("ABC", Oyster.Recursions.toExcelColumn(731));
assertEquals(28, Oyster.Recursions.fromExcelColumn(Oyster.Recursions.toExcelColumn(28)));
assertEquals(731, Oyster.Recursions.fromExcelColumn(Oyster.Recursions.toExcelColumn(731)));
}
}
| [
"yuzhongxing88@gmail.com"
] | yuzhongxing88@gmail.com |
c9195959ce6123bb3b36b4e07f2849023d120247 | b38899ac132a05bd08c0de7f47dae0a3c07516ea | /AiServiceLib/src/main/java/com/keepfun/magicindicator/MagicIndicator.java | 4db1702133efd159a66be331ba119fd578b933d4 | [] | no_license | 954347696/ServiceLib | ed1f6cdd67f6ec2383c37b4cb189e9932d26f425 | e592f5dff27d109597bd62ccc3f3af5b06b461a7 | refs/heads/main | 2023-04-19T16:45:18.704650 | 2021-05-14T09:04:13 | 2021-05-14T09:04:13 | 367,299,426 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,822 | java | package com.keepfun.magicindicator;
import android.content.Context;
import android.util.AttributeSet;
import android.view.View;
import android.widget.FrameLayout;
import com.keepfun.magicindicator.abs.IPagerNavigator;
import com.keepfun.magicindicator.abs.IPagerNavigator;
/**
* 整个框架的入口,核心
* 博客: http://hackware.lucode.net
* Created by hackware on 2016/6/26.
*/
public class MagicIndicator extends FrameLayout {
private IPagerNavigator mNavigator;
public MagicIndicator(Context context) {
super(context);
}
public MagicIndicator(Context context, AttributeSet attrs) {
super(context, attrs);
}
public void onPageScrolled(int position, float positionOffset, int positionOffsetPixels) {
if (mNavigator != null) {
mNavigator.onPageScrolled(position, positionOffset, positionOffsetPixels);
}
}
public void onPageSelected(int position) {
if (mNavigator != null) {
mNavigator.onPageSelected(position);
}
}
public void onPageScrollStateChanged(int state) {
if (mNavigator != null) {
mNavigator.onPageScrollStateChanged(state);
}
}
public IPagerNavigator getNavigator() {
return mNavigator;
}
public void setNavigator(IPagerNavigator navigator) {
if (mNavigator == navigator) {
return;
}
if (mNavigator != null) {
mNavigator.onDetachFromMagicIndicator();
}
mNavigator = navigator;
removeAllViews();
if (mNavigator instanceof View) {
LayoutParams lp = new LayoutParams(LayoutParams.MATCH_PARENT, LayoutParams.MATCH_PARENT);
addView((View) mNavigator, lp);
mNavigator.onAttachToMagicIndicator();
}
}
}
| [
"954347696@qq.com"
] | 954347696@qq.com |
63d0c23645098caea3d1c148c30105fee312bc77 | 0b577b923c9e46cf072cd3d54e8af7f084c57f10 | /Gloria/ProcureMaterialDomain/src/main/java/com/volvo/gloria/procurematerial/d/entities/status/procureline/Received.java | 9687ce5909daaf396f9e136e3b03ec19fdb77a9e | [] | no_license | perlovdinger/gloria1 | b0a9ea0e391f78f871b058a07ff8c3219ea7978f | b6a220f3c712a29289fe42be3736796a7b7a4065 | refs/heads/master | 2020-12-25T21:12:55.874655 | 2016-09-18T09:11:30 | 2016-09-18T09:11:30 | 68,508,862 | 1 | 1 | null | null | null | null | UTF-8 | Java | false | false | 1,857 | java | package com.volvo.gloria.procurematerial.d.entities.status.procureline;
import java.util.List;
import com.volvo.gloria.common.c.dto.UserDTO;
import com.volvo.gloria.common.repositories.b.TraceabilityRepository;
import com.volvo.gloria.procurematerial.b.ProcurementServices;
import com.volvo.gloria.procurematerial.c.dto.MaterialDTO;
import com.volvo.gloria.procurematerial.d.entities.Material;
import com.volvo.gloria.procurematerial.d.entities.ProcureLine;
import com.volvo.gloria.procurematerial.repositories.b.OrderRepository;
import com.volvo.gloria.procurematerial.repositories.b.ProcureLineRepository;
import com.volvo.gloria.procurematerial.repositories.b.MaterialHeaderRepository;
import com.volvo.gloria.util.GloriaApplicationException;
import com.volvo.gloria.util.c.GloriaParams;
public class Received extends ProcureLineDefaultOperations {
@Override
public void acceptRemoveMaterial(ProcureLine procureLine, ProcureLineRepository procureLineRepository, List<MaterialDTO> materialDTOs,
Material removeMaterial, MaterialHeaderRepository requestHeaderRepo, ProcurementServices procurementServices, OrderRepository orderRepository,
UserDTO userDto, TraceabilityRepository traceabilityRepository) throws GloriaApplicationException {
ProcureLineHelper.handleReceivedProcureLines(procureLine, procureLineRepository, removeMaterial, requestHeaderRepo, userDto, traceabilityRepository);
}
@Override
public boolean isRevertProcurementAllowed(ProcureLine procureLine) {
return false;
}
@Override
public String getUsageChangeAction(Material material) {
return GloriaParams.ADDITIONAL;
}
@Override
public boolean isOrderPlaced() {
return true;
}
@Override
public boolean isProcurementStarted() {
return true;
}
}
| [
"per.lovdinger@volvo.com"
] | per.lovdinger@volvo.com |
38adc4a8298946ccdcc9846435cef7ecbb36d43b | 6252c165657baa6aa605337ebc38dd44b3f694e2 | /org.eclipse.epsilon.egl.sync/Scalability-Tests/boiler-To-Generate-600-Files/boiler-To-Generate-600-Files/syncregions-600Files/BoilerActuator2267.java | 68a6af3c909b3cf008a02ce6d2d8c57cb3bfe656 | [] | no_license | soha500/EglSync | 00fc49bcc73f7f7f7fb7641d0561ca2b9a8ea638 | 55101bc781349bb14fefc178bf3486e2b778aed6 | refs/heads/master | 2021-06-23T02:55:13.464889 | 2020-12-11T19:10:01 | 2020-12-11T19:10:01 | 139,832,721 | 0 | 1 | null | 2019-05-31T11:34:02 | 2018-07-05T10:20:00 | Java | UTF-8 | Java | false | false | 263 | java | package syncregions;
public class BoilerActuator2267 {
public execute(int temperatureDifference2267, boolean boilerStatus2267) {
//sync _bfpnGUbFEeqXnfGWlV2267, behaviour
Half Change - return temperature - targetTemperature;
//endSync
}
}
| [
"sultanalmutairi@172.20.10.2"
] | sultanalmutairi@172.20.10.2 |
2aaac074d482bd07aecdada3987e641dff0f79ae | c7f278fd02d9cf2c4563c4f10cdd13905509225c | /src/hust/thread/Lock/ReentrantLock/ReentrantLockTest4.java | 450c91fe75eff221ab403f9f8b0647e459f3c545 | [] | no_license | Pengineer/MultiThread | d71c68a45b3573b3959482bf08f4a93e6771e1a0 | 99d7096ee073720aebbc46453bdf6685c376d8db | refs/heads/master | 2021-01-17T14:17:16.881015 | 2016-07-18T08:11:22 | 2016-07-18T08:11:22 | 48,994,675 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,982 | java | package hust.thread.Lock.ReentrantLock;
import java.util.concurrent.locks.Condition;
import java.util.concurrent.locks.Lock;
import java.util.concurrent.locks.ReentrantLock;
/**
* 使用Condition的await/signal实现synchronized中的wait/notify功能
*
* 来自Java API的解释:
* Condition 将 Object 监视器方法(wait、notify 和 notifyAll)分解成截然不同的对象,以便通过将这些对象与任意 Lock 实现组合使用,
* 为每个对象提供多个等待 set(wait-set)。其中,Lock 替代了 synchronized 方法和语句的使用,Condition 替代了 Object 监视器方法的
* 使用。
*
* @author 2016-01-11
*
*/
public class ReentrantLockTest4 {
public static void main(String[] args) {
try {
Service service = new Service();
MyThread t = new MyThread(service);
t.start();
Thread.sleep(2000);
service.signal();
} catch (InterruptedException e) {
e.printStackTrace();
}
}
static class Service {
private Lock lock = new ReentrantLock();
private Condition condition = lock.newCondition();
public void await() {
try {
lock.lock();
System.out.println("进入等待。。。");
condition.await(); //与synchronized的wait方法相似,condition的await方法必须在调用lock方法获取同步监视器后使用。
} catch (InterruptedException e) {
e.printStackTrace();
} finally {
lock.unlock();
}
}
public void signal() {
try {
lock.lock();
condition.signal(); //与synchronized的notify方法相似,condition的signal方法必须在调用lock方法获取同步监视器后使用。
System.out.println("。。。被唤醒");
} finally {
lock.unlock();
}
}
}
static class MyThread extends Thread {
private Service service;
public MyThread(Service service) {
this.service = service;
}
@Override
public void run() {
System.out.println("A");
service.await();
System.out.println("B");
}
}
}
| [
"990607342@qq.com"
] | 990607342@qq.com |
f15d7723e5f040c7d41df44c5fcf36f2abfa9808 | dfef02cfa575b2c0f4cbccb0216f3fef9d2fe9d1 | /src/Notes/repository/custom/CustomerRepositoryCustom.java | 1716dd46265eb40adc760ffc3b6d49d9e5dd5194 | [] | no_license | SaeidKazemi78/Complete-Spring-Security | a84943ea9f36e9557e7f52afdc2fce274b5e98c3 | d395c0e23a30a5a9fa51c07cb5a178b50bacfeb8 | refs/heads/master | 2022-12-14T10:08:31.629509 | 2020-09-14T05:34:44 | 2020-09-14T05:34:44 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,701 | java | package ir.donyapardaz.niopdc.base.repository.custom;
import ir.donyapardaz.niopdc.base.domain.Customer;
import ir.donyapardaz.niopdc.base.domain.enumeration.CustomerGroup;
import ir.donyapardaz.niopdc.base.domain.projection.CustomerSellContract;
import ir.donyapardaz.niopdc.base.service.dto.PersonCustomerInfoDTO;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import java.time.ZonedDateTime;
import java.util.List;
import java.util.Set;
public interface CustomerRepositoryCustom {
Page<Customer> findAll(String locationName, String query, Set<CustomerGroup> customerGroups, String selfCode, List<Long> customerTypeIds, Pageable pageable);
Page<Customer> findAllByAccessLocation(String locationName, String query, Set<CustomerGroup> customerGroups, List<Long> customerIds, List<Long> customerTypeIds, Pageable pageable);
List<CustomerSellContract> findAllCustomerSellContract(ZonedDateTime startDate, ZonedDateTime finishDate, String username);
Page<Customer> findAllBoundaryCustomers(String vehicleModel,
Boolean archive,
String carRfId,
String plaque,
String plaquePart1,
String plaquePart2,
String plaquePart3,
String type1,
String typeCode,
Pageable pageable);
List<PersonCustomerInfoDTO> getPersonInfo(Long customerId);
}
| [
"saeidkazemi78java@gmail.com"
] | saeidkazemi78java@gmail.com |
81e63c05a63ab25412ca99e748ba633575b7740a | 7c29eb22c9d4a55b87c1cb4c9e31b04c2a9b2b31 | /Archive/cimiss2-decode/src/main/java/cma/cimiss2/dpc/decoder/sand/DecodeAtmosphTurbidity.java | 197b65cd327a30da17db781c5e8b5235e02603b3 | [] | no_license | 523499159/kettle-web | afa9f60958c86a3119bba406edf434d63a3d3c4a | d55c8a38c572cf58d34d3fee243a9026bb4b5b69 | refs/heads/master | 2023-03-17T22:50:28.851262 | 2020-08-31T07:02:53 | 2020-08-31T07:02:53 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 7,346 | java | package cma.cimiss2.dpc.decoder.sand;
import java.io.File;
import java.io.FileNotFoundException;
import java.io.UnsupportedEncodingException;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.List;
import org.apache.commons.codec.language.bm.Rule.RPattern;
import cma.cimiss2.dpc.decoder.bean.ParseResult;
import cma.cimiss2.dpc.decoder.bean.ReportError;
import cma.cimiss2.dpc.decoder.bean.ReportInfo;
import cma.cimiss2.dpc.decoder.bean.ParseResult.ParseInfo;
import cma.cimiss2.dpc.decoder.bean.cawn.AtmosphericTurbidityData;
import cma.cimiss2.dpc.decoder.check.util.TimeCheckUtil;
import cma.cimiss2.dpc.decoder.tools.ElementValUtil;
import cma.cimiss2.dpc.decoder.tools.FileEncodeUtil;
import cma.cimiss2.dpc.decoder.tools.common.Encoding;
import cma.cimiss2.dpc.decoder.tools.utils.FileUtil;
public class DecodeAtmosphTurbidity {
/* 存放数据解析的结果集 */
private ParseResult<AtmosphericTurbidityData> parseResult = new ParseResult<AtmosphericTurbidityData>(false);
/**
* 大气浑浊度观测资料数据
* 函数名:DecodeFile
* dengyonglaing
* @param file
* 文件对象
*
* @return ParseResult<PrecipitationObservationDataReg> 解码结果包裹类
*
*/
@SuppressWarnings({ "unchecked", "rawtypes" })
public ParseResult<AtmosphericTurbidityData> DecodeFile(File file) {
if (file != null && file.exists() && file.isFile()) {
if(file.length() <= 0){
parseResult.setParseInfo(ParseInfo.EMPTY_FILE);
return parseResult;
}
try {
// get file encode
FileEncodeUtil fileEncodeUtil = new FileEncodeUtil();
String fileCode = Encoding.javaname[fileEncodeUtil.detectEncoding(file)];
fileCode = fileCode.equals("ISO8859_1") ? "GBK" : fileCode;
List<String> txtFileContent = FileUtil.getTxtFileContent(file, fileCode);
// 首先判断文件不是空的,然后需要判断最少有两行数据
if (txtFileContent != null && txtFileContent.size() >= 2) {
String head = txtFileContent.get(0);
String[] heads = head.split("\\s+");
//SandChnSoi sandChnSoi = new SandChnSoi();
if(heads.length == 6) {
String stationNumberChina = null;
String latitude = null;
String longitude = null;
String heightSeaLevel = null;
String timeInterval = null;
SimpleDateFormat sdf = new SimpleDateFormat("yyyyMMddHHmmss");
stationNumberChina = heads[0];//区站号
longitude = heads[1];//经度
latitude= heads[2];//纬度
heightSeaLevel = heads[3];//海拔高度
timeInterval= heads[5];//浊度计采样时间间隔
for(int i=1;i<txtFileContent.size();i++){
ArrayList<String> headList=new ArrayList<String>();
String data = txtFileContent.get(i);
data = data.replaceAll("\\/+", "999999");
String[] items = data.split("\\s+");
if (items.length ==7) {
AtmosphericTurbidityData turbidityBean = new AtmosphericTurbidityData();
if((!items[1].equals("999999")) || (!items[2].equals("999999"))|| (!items[3].equals("999999"))|| (!items[4].equals("999999"))|| (!items[5].equals("999999"))|| (!items[6].equals("999999"))){
try {
String observationTime=items[0];
if (items[0].substring(0, 4).compareTo("1900")<0 || observationTime.length() !=14) {
ReportError re = new ReportError();
re.setMessage("time error");
re.setSegment(head);
parseResult.put(re);
continue;
}
headList.add(stationNumberChina);
headList.add(longitude);
headList.add(latitude);
headList.add(observationTime);//将时间保存到报文表
turbidityBean.setStationNumberChina(stationNumberChina);
turbidityBean.setLongitude(Double.parseDouble(longitude));
turbidityBean.setLatitude(Double.parseDouble(latitude));
turbidityBean.setHeightOfSationGroundAboveMeanSeaLevel(Double.parseDouble(heightSeaLevel));
turbidityBean.setTimeInterval(Double.valueOf(timeInterval));
try {
turbidityBean.setObservationTime(sdf.parse(observationTime));
//2019-7-16 cuihongyan
if(!TimeCheckUtil.checkTime(turbidityBean.getObservationTime())){
ReportError reportError = new ReportError();
reportError.setMessage("time check error!");
reportError.setSegment(data);
parseResult.put(reportError);
continue;
}
}catch (ParseException e) {
ReportError reportError = new ReportError();
reportError.setMessage("File time error");
reportError.setSegment(txtFileContent.toString());
parseResult.put(reportError);
continue;
}
//数据识别码。
turbidityBean.setData_code(items[1]);
//粒子散射系数,数据单位m。
turbidityBean.setParticleScatterCoefficient(ElementValUtil.ToBeValidDouble(items[2]));
//环境温度,数据单位℃。
turbidityBean.setTemperature(ElementValUtil.ToBeValidDouble(items[3]));
//环境相对湿度,数据单位%。
turbidityBean.setHumidity(ElementValUtil.ToBeValidDouble(items[4]));
//环境气压,数据单位hPa。
turbidityBean.setPressure(ElementValUtil.ToBeValidDouble(items[5]));
//腔体温度,数据单位℃。
turbidityBean.setCavityTemperature(ElementValUtil.ToBeValidDouble(items[6]));
parseResult.put(new ReportInfo(headList,head+"\n"+data));
parseResult.put(turbidityBean);
parseResult.setSuccess(true);
} catch (NumberFormatException e) {
parseResult.put(new ReportInfo(headList,head+"\n"+data));
ReportError re = new ReportError();
re.setMessage("Digital conversion exception");
re.setSegment(data);
parseResult.put(re);
continue;
}
}else{
ReportError re = new ReportError();
re.setMessage("All the elements are missing");
re.setSegment(data);
parseResult.put(re);
continue;
}
}else{
ReportError reportError = new ReportError();
reportError.setMessage("Element length wrong");
reportError.setSegment(head+data);
parseResult.put(reportError);
}
}
}else {
ReportError reportError = new ReportError();
reportError.setMessage("report header error");
reportError.setSegment(head);
parseResult.put(reportError);
}
} else {
if (txtFileContent == null || txtFileContent.size() == 0) {
// 空文件
parseResult.setParseInfo(ParseInfo.EMPTY_FILE);
} else {
// 数据只有一行,格式不正确
parseResult.setParseInfo(ParseInfo.ILLEGAL_FORM);
}
}
} catch (UnsupportedEncodingException e) {
parseResult.setParseInfo(ParseInfo.ILLEGAL_FORM);
} catch (FileNotFoundException e) {
parseResult.setParseInfo(ParseInfo.FILE_NOT_EXSIT);
}
} else {
// file not exsit
parseResult.setParseInfo(ParseInfo.FILE_NOT_EXSIT);
}
return parseResult;
}
}
| [
"18309292271@163.com"
] | 18309292271@163.com |
0255595fb35af4535bef0b847f01bb0fa85c3a09 | 013c744f98ed140f8b751d76a372565b7a841ecf | /src/com/dosmil_e/kit/core/model/structural/meta/KitExposedStructuralFeatureMeta.java | 62ae63bade23c024a7d5f76091559189c03264a4 | [] | no_license | carrascoMDD/Kit01 | 85ac077df93f1ed1b2ece6799fc3c130e0189359 | edc0a9dcd3944f413b1206c0b834c78d8217b51b | refs/heads/master | 2020-03-14T11:53:21.408340 | 2018-04-30T13:49:34 | 2018-04-30T13:49:34 | 131,598,995 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 4,048 | java | package com.dosmil_e.kit.core.model.structural.meta;
import com.dosmil_e.modelbase.support.*;
import com.dosmil_e.modelbase.flattrx.*;
import java.lang.reflect.Field;
public class KitExposedStructuralFeatureMeta {
/****************************************************************************
* Static metainformation for Type of the EAIProject metamodel element
****************************************************************************/
public static com.dosmil_e.m3.core.ifc.M3TypeIfc vm3Type;
/****************************************************************************
* Static metainformation for Attributes of the EAIProject metamodel element
****************************************************************************/
/****************************************************************************
* Static metainformation for Relationships of the EAIProject metamodel element
****************************************************************************/
public static com.dosmil_e.m3.core.ifc.M3RelationshipIfc vm3RelExposed;
/****************************************************************************
* Initializer of metainformation the EAIProject metamodel element
* phase 1 : init all metainfo, except links to metainfo of other metamodel elements
* will be invoked from the model's metamodel root
****************************************************************************/
public static void initM3TypePhase1( EAIMMCtxtIfc theCtxt) throws EAIException {
vm3Type = (com.dosmil_e.m3.core.ifc.M3TypeIfc) theCtxt.getMMFactory("M3").createMMElementOfType( theCtxt, "Type", "core",new EAIMMName("ExposedStructuralFeature"));
vm3Type.setIsEnumeration( theCtxt, false);
vm3Type.setIsPrimitive( theCtxt, false);
vm3Type.setIsAbstract( theCtxt, false);
vm3RelExposed = (com.dosmil_e.m3.core.ifc.M3RelationshipIfc) theCtxt.getMMFactory("M3").createMMElementOfType( theCtxt, "Relationship", "core",new EAIMMName("exposed"));
vm3Type.addRelationships( theCtxt, vm3RelExposed);
vm3RelExposed.setKind( theCtxt, "References");
vm3RelExposed.setMinMult( theCtxt, "1");
vm3RelExposed.setMaxMult( theCtxt, "1");
vm3RelExposed.setIsDerived( theCtxt, false);
vm3RelExposed.setIsDummy( theCtxt, false);
}
/****************************************************************************
* Initializer of metainformation the EAIProject metamodel element
* phase 2 : init links to metainfo of other metamodel elements
* will be invoked from the model's metamodel root
****************************************************************************/
public static void initM3TypePhase2( EAIMMCtxtIfc theCtxt) throws EAIException {
vm3Type.addSuperTypes( theCtxt, com.dosmil_e.kit.core.model.structural.meta.KitStructuralFeatureMeta.vm3Type);
vm3RelExposed.setInverse( theCtxt, com.dosmil_e.kit.core.model.structural.meta.KitStructuralFeatureMeta.vm3RelExposedAs);
vm3RelExposed.setRelatedType( theCtxt, com.dosmil_e.kit.core.model.structural.meta.KitStructuralFeatureMeta.vm3Type);
}
/****************************************************************************
* Access and initialization of metainformation the metamodel element
* for initialization, delegates on the model's metamodel root, that will
* invoke metainfo initializers (phase1, phase2) on all the metamodel elements
****************************************************************************/
public static com.dosmil_e.m3.core.ifc.M3TypeIfc getStaticM3Type( EAIMMCtxtIfc theCtxt) {
if( vm3Type != null) { return vm3Type;}
com.dosmil_e.kit.meta.Kit01.initM3( theCtxt);
return vm3Type;
}
/****************************************************************************
* Serialization support
****************************************************************************/
private static final long serialVersionUID = -3331123456100000003L;
}
| [
"carrascomdd@gmail.com"
] | carrascomdd@gmail.com |
1b019ad1c7af8e1eda28b5191dd598fe561dc938 | 9b4e7ac65ca8e52ecd9b7846e8adf34b618e7dd9 | /myupdateapklibrary/src/main/java/com/trycath/myupdateapklibrary/util/StringUtils.java | be280922fd75824cdb3733b29e311d286e0cef07 | [
"Apache-2.0"
] | permissive | weileng11/MyUpdateApk-master | 6759eb45d83cd49b5875f64a2f4575a603e48557 | b0caf42f65175af87b464b068d84a8a1afaff87e | refs/heads/master | 2021-01-22T23:44:28.488840 | 2017-09-05T03:27:39 | 2017-09-05T03:27:39 | 102,429,246 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,243 | java | package com.trycath.myupdateapklibrary.util;
import java.text.DecimalFormat;
/**
* 在此写用途
*
* @author: guoyoujin
* @mail: guoyoujin123@gmail.com
* @date: 2016-09-09 15:26
* @version: V1.0 <描述当前版本功能>
*/
public class StringUtils {
private static final String TAG = "StringUtils";
public static String getHostName(String urlString) {
String head = "";
int index = urlString.indexOf("://");
if (index != -1) {
head = urlString.substring(0, index + 3);
urlString = urlString.substring(index + 3);
}
index = urlString.indexOf("/");
if (index != -1) {
urlString = urlString.substring(0, index + 1);
}
return head + urlString;
}
public static String getDataSize(long var0) {
DecimalFormat var2 = new DecimalFormat("###.00");
return var0 < 1024L ? var0 + "bytes" : (var0 < 1048576L ? var2.format((double) ((float) var0 / 1024.0F))
+ "KB" : (var0 < 1073741824L ? var2.format((double) ((float) var0 / 1024.0F / 1024.0F))
+ "MB" : (var0 < 0L ? var2.format((double) ((float) var0 / 1024.0F / 1024.0F / 1024.0F))
+ "GB" : "error")));
}
} | [
"275762645@qq.com"
] | 275762645@qq.com |
67f11b1529409cd71e47e622775b689babfe33d0 | 88252dad1b411dd2a580f1182af707d0c0981841 | /JavaWeb0417/bookstore05/src/com/atguigu/bookstore/servlet/UserServlet.java | 54cd7c548308b8c60c5e07c117cd53b849962a61 | [] | no_license | FatterXiao/myJavaLessons | 37db50d24cbcc5524e5b8060803ab08ab3b3ac0c | fa6ff208b46048527b899001561bd952f48bbe15 | refs/heads/main | 2023-04-20T09:18:06.694611 | 2021-04-29T10:18:30 | 2021-04-29T10:18:30 | 347,562,482 | 0 | 1 | null | null | null | null | UTF-8 | Java | false | false | 6,078 | java | package com.atguigu.bookstore.servlet;
import com.atguigu.bookstore.beans.User;
import com.atguigu.bookstore.service.UserService;
import com.atguigu.bookstore.service.impl.UserServiceImpl;
import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;
import java.io.IOException;
import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
/**
* @author Mr.Helianthus
* @create 2021-04-21 7:02 PM
*/
@WebServlet(name = "UserServlet", urlPatterns = "/userServlet")
public class UserServlet extends HttpServlet {
protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
String action = request.getParameter("action");
try {
// 优化代码:
// 1. 获取方法名字
// 2. 调用方法
Method declaredMethod = this.getClass().getDeclaredMethod(action, HttpServletRequest.class, HttpServletResponse.class);
// - 2.2 设置权限
declaredMethod.setAccessible(true);
// - 2.3 调用方法
declaredMethod.invoke(this,request,response);
} catch (NoSuchMethodException e) {
e.printStackTrace();
} catch (IllegalAccessException e) {
e.printStackTrace();
} catch (InvocationTargetException e) {
e.printStackTrace();
}
}
protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
doPost(request,response);
}
/**
* 用户登录
* @param request
* @param response
* @throws ServletException
* @throws IOException
*/
protected void login(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
// 1. 获取参数: 用户名 和 密码
String username = request.getParameter("username");
String password = request.getParameter("password");
User user = new User(null, username, password, null);
UserService userService = new UserServiceImpl();
User login = userService.login(user);
// 2. 验证登录
// - 2.1登录失败
if (login == null) {
// System.out.println("登录失败:" + user.toString());
// 利用request域传入登录失败的信息
request.setAttribute("loginError", "登录失败。用户名或密码不正确。");
request.getRequestDispatcher("/pages/user/login.jsp").forward(request, response);
return;
}
// - 2.2 登录成功
// 把用户信息保存到session域中
HttpSession session = request.getSession();
session.setAttribute("user",login);
response.sendRedirect(request.getContextPath() + "/pages/user/login_success.jsp");
}
/**
* 用户注销
* @param request
* @param response
* @throws ServletException
* @throws IOException
*/
protected void logout(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
// 1. 使session失效
request.getSession().invalidate();
// 2. 重定向到首页
response.sendRedirect(request.getContextPath() + "/index.jsp");
}
/**
* 用户注册
* @param request
* @param response
* @throws ServletException
* @throws IOException
*/
protected void regist(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
/*
- 校验验证码是否正确
- 获取request 报文中传来的校验码[用户输入的验证码]code1
- 获取session中的验证码[KaptchaServlet中生成并传入到session中的验证码]code2
- 校验两个验证码是否相同
*/
String inputCode = request.getParameter("code");// 用户填写的验证码
/*
KaptchaServlet传入session的验证码;
web.xml中设置了验证码传入session中的k-v键值对中的k为"code"
*/
String kaptchaCode = (String) request.getSession().getAttribute("code");
// 如果用户为输入验证码,而前端又未加限制,直接返回
if(inputCode == null){
// TODO: 记录错误日志信息
return;
}
// 如果传入的验证码不正确,则回传错误信息“验证码不正确”;并转发到注册页面
if(!inputCode.equals(kaptchaCode)){
request.setAttribute("registErrorMsg","输入的验证码不正确");
request.getRequestDispatcher("/pages/user/regist.jsp").forward(request,response);
return;
}
// - 验证码校验正确,继续其他信息的验证:
// 1. 从表单中获取参数
String username = request.getParameter("username");
String password = request.getParameter("password");
String email = request.getParameter("email");
// 2. 校验传入的参数是否正确,是否可以进行注册
UserService userService = new UserServiceImpl();
User user = new User(null, username, password, email);
boolean isRegist = userService.regist(user);
// - 2.1 注册失败
if (isRegist) {
// 注册失败时,利用request域给页面发送失败信息
request.setAttribute("registErrorMsg", "该用户名已经存在不可以注册。");
request.getRequestDispatcher("/pages/user/regist.jsp").forward(request, response);
return;
}
// - 2.2 注册成功 : 写入数据库存储,并跳转到成功页面
userService.addUser(user);
response.sendRedirect(request.getContextPath() + "/pages/user/regist_success.jsp");
}
}
| [
"xuweijunxinlan@yeah.net"
] | xuweijunxinlan@yeah.net |
711a62aaa971526b73faa6884d6523f8db3251d6 | 848c563ddecdefdb4e6d91dfb9651c67ddcbee78 | /tangminet/service-api/promotion-service-api/src/main/java/com/topaiebiz/promotion/promotionEnum/PromotionTypeEnum.java | 6189edf2e5fae90f8e439794e80be69fbd076790 | [] | no_license | liveqmock/tangxIdea | 264481ca7e087d5d8cf23854fb677b0c1376c188 | 7e780c538434638a79d50e33f45ab0be3ae90625 | refs/heads/master | 2020-04-04T14:44:18.241241 | 2018-06-29T14:51:49 | 2018-06-29T14:51:49 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,679 | java | package com.topaiebiz.promotion.promotionEnum;
import com.google.common.collect.Sets;
import java.util.Set;
/**
* 活动类型枚举类
* Created by Joe on 2018/1/9.
*/
public enum PromotionTypeEnum {
PROMOTION_TYPE_SINGLE(1, "单品折扣"),
PROMOTION_TYPE_PRICE(2, "一口价"),
PROMOTION_TYPE_REDUCE_PRICE(3, "满减"),
PROMOTION_TYPE_COUPON(4, "平台优惠券"),
PROMOTION_TYPE_COUPON_CODE(5, "平台优惠码"),
PROMOTION_TYPE_SECKILL(6, "秒杀"),
PROMOTION_TYPE_STORE_COUPON(7, "店铺优惠券"),
PROMOTION_TYPE_FREE_SHIPPING(8, "包邮"),
PROMOTION_TYPE_SEC_KILL_CARD(9, "礼卡秒杀"),
PROMOTION_TYPE_OPEN_BOX(10, "开宝箱"),
PROMOTION_TYPE_COUPON_ACTIVE(11, "优惠券活动");
private Integer code;
private String value;
private PromotionTypeEnum(Integer code, String value) {
this.code = code;
this.value = value;
}
public Integer getCode() {
return code;
}
public void setCode(Integer code) {
this.code = code;
}
public String getValue() {
return value;
}
public void setValue(String value) {
this.value = value;
}
public static PromotionTypeEnum valueOf(Integer code) {
for (PromotionTypeEnum item : values()) {
if (item.getCode().equals(code)) {
return item;
}
}
return null;
}
public static Set<Integer> singlePromotionTypes() {
return Sets.newHashSet(
PROMOTION_TYPE_SINGLE.getCode(),
PROMOTION_TYPE_PRICE.getCode(),
PROMOTION_TYPE_SECKILL.getCode()
);
}
}
| [
"207542948@qq.com"
] | 207542948@qq.com |
20c2174e0de3bac15a5a7b41f86a4e702b5f4437 | 31f043184e2839ad5c3acbaf46eb1a26408d4296 | /src/main/java/com/github/highcharts4gwt/model/highcharts/option/jso/plotoptions/solidgauge/JsoShowEvent.java | 1e2596e3a487da84453df25a0dfa8d086f0ae4fa | [] | no_license | highcharts4gwt/highchart-wrapper | 52ffa84f2f441aa85de52adb3503266aec66e0ac | 0a4278ddfa829998deb750de0a5bd635050b4430 | refs/heads/master | 2021-01-17T20:25:22.231745 | 2015-06-30T15:05:01 | 2015-06-30T15:05:01 | 24,794,406 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 539 | java |
package com.github.highcharts4gwt.model.highcharts.option.jso.plotoptions.solidgauge;
import com.github.highcharts4gwt.model.highcharts.object.api.Series;
import com.github.highcharts4gwt.model.highcharts.option.api.plotoptions.solidgauge.ShowEvent;
import com.google.gwt.dom.client.NativeEvent;
public class JsoShowEvent
extends NativeEvent
implements ShowEvent
{
protected JsoShowEvent() {
}
public final native Series series()
throws RuntimeException /*-{
return this.source;
}-*/
;
}
| [
"ronan.quillevere@gmail.com"
] | ronan.quillevere@gmail.com |
408c98d27aa903317e1843536853672a4dc4ad3d | e11a54bc56226165446568694528fbb415e406d5 | /RestEasy/jaxrs-2.0-content-negotiation/src/main/java/com/restfully/shop/services/ShoppingApplication.java | e6517d8058227b3db8fb9780974facac67acd701 | [] | no_license | siddhantaws/Maven-Projects | 5f09d4060ddebaf4734f8401c3809b2c4313b4df | 80c087aed838dcdf791f58e14a44f2337368590f | refs/heads/master | 2022-12-20T23:21:21.597144 | 2019-06-28T04:00:24 | 2019-06-28T04:00:24 | 51,756,809 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 535 | java | package com.restfully.shop.services;
import javax.ws.rs.ApplicationPath;
import javax.ws.rs.core.Application;
import java.util.HashSet;
import java.util.Set;
@ApplicationPath("/services")
public class ShoppingApplication extends Application
{
private Set<Object> singletons = new HashSet<Object>();
public ShoppingApplication()
{
singletons.add(new CustomerResource());
singletons.add(new VariantCustomerResource());
}
@Override
public Set<Object> getSingletons()
{
return singletons;
}
}
| [
"siddhantaws@gmail.com"
] | siddhantaws@gmail.com |
191bdf83491dc8feeb583e3403cbba96a29dffe6 | 340244f649995da96ea7b079c78a31b6302c4504 | /branches/org.openebiz.core.api/src/org/openebiz/core/common/cbc/LocationIDType.java | 4515efb13135874b2997c9d39affd753ad6c3a97 | [] | no_license | BackupTheBerlios/openebiz-svn | 6be3506ba0f5068a69459e6f093917699af50708 | f83946dab9371d17ffbc0ec43fe157e4544d97fe | refs/heads/master | 2020-04-18T01:46:26.607391 | 2009-03-08T17:23:20 | 2009-03-08T17:23:20 | 40,749,474 | 0 | 1 | null | null | null | null | UTF-8 | Java | false | false | 833 | java | /*******************************************************************************
* Copyright (c) 2006 Open E-Biz - http://www.openebiz.org
* Licensed Material - Property of Open E-Biz. All rights reserved.
*
* Contributors:
* Open E-Biz - initial API and implementation
*******************************************************************************/
package org.openebiz.core.common.cbc;
import org.openebiz.core.common.udt.IdentifierType;
/**
* <!-- begin-user-doc -->
* A representation of the model object '<em><b>Location ID Type</b></em>'.
* <!-- end-user-doc -->
*
*
*/
public interface LocationIDType extends IdentifierType {
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
*/
String copyright = "Open E-Biz - http://www.openebiz.org"; //$NON-NLS-1$
} // LocationIDType | [
"wukunlun@3b9d58ea-9e0c-0410-94fd-f833e57fda8f"
] | wukunlun@3b9d58ea-9e0c-0410-94fd-f833e57fda8f |
e3f4087de4ebaccca3ce07667201960e0eeaed99 | 46719835215b0c92e191a12d6adbbb115fef653d | /src/main/java/omid/springframework/converters/NotesCommandToNotes.java | 64b4e7ebaef46af8438f74b5605ef9baf0e8b83d | [] | no_license | omid-joukar/spring5-recipe-app | caba47cefe47f5c62455dc6c3ca32138e6453c41 | 97786769385f8310c47ba794373fac6e3cdd2e39 | refs/heads/master | 2023-02-13T20:42:15.289853 | 2020-12-28T22:58:40 | 2020-12-28T22:58:40 | 322,797,075 | 1 | 0 | null | 2020-12-24T10:01:53 | 2020-12-19T08:01:39 | Java | UTF-8 | Java | false | false | 726 | java | package omid.springframework.converters;
import org.springframework.lang.Nullable;
import lombok.Synchronized;
import omid.springframework.commands.NotesCommand;
import omid.springframework.domain.Notes;
import org.springframework.core.convert.converter.Converter;
import org.springframework.stereotype.Component;
@Component
public class NotesCommandToNotes implements Converter<NotesCommand, Notes> {
@Synchronized
@Nullable
@Override
public Notes convert(NotesCommand source) {
if(source == null) {
return null;
}
final Notes notes = new Notes();
notes.setId(source.getId());
notes.setRecipeNotes(source.getRecipeNotes());
return notes;
}
} | [
"joukaromid6@gmail.com"
] | joukaromid6@gmail.com |
0f6ef7c74c7c4603e45e1de3c3804d9018fd7d7f | 17537c091572a94c58975214094fdfeedb57fde1 | /core/server/project/commonGame/src/main/java/com/home/commonGame/net/request/func/item/FuncAddOneItemRequest.java | e520de5a7a4c311a3b1aa10d7538cf8b114366cf | [
"Apache-2.0"
] | permissive | mengtest/home3 | dc2e5f910bbca6e536ded94d3f749671f0ca76d5 | a15a63694918483b2e4853edab197b5cdddca560 | refs/heads/master | 2023-01-29T13:49:23.822515 | 2020-12-11T10:17:39 | 2020-12-11T10:17:39 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,094 | java | package com.home.commonGame.net.request.func.item;
import com.home.commonBase.data.item.ItemData;
import com.home.commonGame.constlist.generate.GameRequestType;
import com.home.commonGame.net.request.func.base.FuncSRequest;
import com.home.shine.bytes.BytesWriteStream;
import com.home.shine.control.BytesControl;
import com.home.shine.support.DataWriter;
import com.home.shine.support.pool.DataPool;
/** 推送添加单个物品(generated by shine) */
public class FuncAddOneItemRequest extends FuncSRequest
{
/** 数据类型ID */
public static final int dataID=GameRequestType.FuncAddOneItem;
/** 途径 */
public int way;
/** 序号 */
public int index;
/** 物品数据 */
public ItemData item;
public FuncAddOneItemRequest()
{
_dataID=GameRequestType.FuncAddOneItem;
}
@Override
protected void copyData()
{
super.copyData();
ItemData itemTemp=item;
if(itemTemp!=null)
{
this.item=(ItemData)itemTemp.clone();
}
else
{
this.item=null;
nullObjError("item");
}
}
/** 获取数据类名 */
@Override
public String getDataClassName()
{
return "FuncAddOneItemRequest";
}
/** 转文本输出 */
@Override
protected void toWriteDataString(DataWriter writer)
{
super.toWriteDataString(writer);
writer.writeTabs();
writer.sb.append("way");
writer.sb.append(':');
writer.sb.append(this.way);
writer.writeEnter();
writer.writeTabs();
writer.sb.append("index");
writer.sb.append(':');
writer.sb.append(this.index);
writer.writeEnter();
writer.writeTabs();
writer.sb.append("item");
writer.sb.append(':');
if(this.item!=null)
{
this.item.writeDataString(writer);
}
else
{
writer.sb.append("ItemData=null");
}
writer.writeEnter();
}
/** 写入字节流(完整版) */
@Override
protected void toWriteBytesFull(BytesWriteStream stream)
{
super.toWriteBytesFull(stream);
stream.startWriteObj();
stream.writeInt(this.way);
stream.writeInt(this.index);
if(this.item!=null)
{
stream.writeDataFullNotNull(this.item);
}
else
{
nullObjError("item");
}
stream.endWriteObj();
}
/** 写入字节流(简版) */
@Override
protected void toWriteBytesSimple(BytesWriteStream stream)
{
super.toWriteBytesSimple(stream);
stream.writeInt(this.way);
stream.writeInt(this.index);
if(this.item!=null)
{
stream.writeDataSimpleNotNull(this.item);
}
else
{
nullObjError("item");
}
}
/** 回池 */
@Override
protected void toRelease(DataPool pool)
{
super.toRelease(pool);
this.way=0;
this.index=0;
this.item.release(pool);
this.item=null;
}
/** 创建实例 */
public static FuncAddOneItemRequest create(int funcID,int way,int index,ItemData item)
{
FuncAddOneItemRequest re=(FuncAddOneItemRequest)BytesControl.createRequest(dataID);
re.funcID=funcID;
re.way=way;
re.index=index;
re.item=item;
return re;
}
}
| [
"359944951@qq.com"
] | 359944951@qq.com |
aa83320b1a7d77edb30eb93f6d9686c369923a32 | 48ae8e24dfe5a8e099eb1ce2d14c9a24f48975cc | /Product/Production/Adapters/General/CONNECTAdminGUI/src/main/java/gov/hhs/fha/nhinc/admingui/services/PatientCorrelationService.java | 49138b5e5eac7c9d2451dcfd287ce60ef5779808 | [
"BSD-3-Clause"
] | permissive | CONNECT-Continuum/Continuum | f12394db3cc8b794fdfcb2cb3224e4a89f23c9d5 | 23acf3ea144c939905f82c59ffeff221efd9cc68 | refs/heads/master | 2022-12-16T15:04:50.675762 | 2019-09-07T16:14:08 | 2019-09-07T16:14:08 | 206,986,335 | 0 | 0 | NOASSERTION | 2022-12-05T23:32:14 | 2019-09-07T15:18:59 | Java | UTF-8 | Java | false | false | 2,402 | java | /*
* Copyright (c) 2009-2019, United States Government, as represented by the Secretary of Health and Human Services.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
* * Redistributions of source code must retain the above
* copyright notice, this list of conditions and the following disclaimer.
* * Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
* * Neither the name of the United States Government nor the
* names of its contributors may be used to endorse or promote products
* derived from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE UNITED STATES GOVERNMENT BE LIABLE FOR ANY
* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
package gov.hhs.fha.nhinc.admingui.services;
import gov.hhs.fha.nhinc.common.nhinccommon.AssertionType;
import gov.hhs.fha.nhinc.patientdiscovery.model.PatientSearchResults;
import java.util.List;
import org.hl7.v3.II;
/**
*
* @author jassmit
*/
public interface PatientCorrelationService {
public II retrieveOrGenerateCorrelation(PatientSearchResults patientResults, AssertionType assertion);
public II getLocalPatient(PatientSearchResults patientResults);
public II getLocalPatient(List<II> correlations);
public void queryForCorrelations(PatientSearchResults patientResults, AssertionType assertion);
public II addCorrelation(PatientSearchResults patientResults, AssertionType assertion);
}
| [
"minh-hai.nguyen@cgi.com"
] | minh-hai.nguyen@cgi.com |
192319189f2c3fc1761c196816f49c005a806768 | d642578bf586a5e80aafbab765d96ead8832a513 | /permazen-main/src/test/java/io/permazen/SchemaGenerationTest.java | b5ce76fe1a2734d4101347b22b6ddf7adac8ddf4 | [
"Apache-2.0"
] | permissive | rayokota/permazen | ee750671b85bfa8be271f9ae2bb5587566492063 | ad404a211c2887c6785992da296dee4271d9ae5b | refs/heads/master | 2023-02-27T18:27:21.580269 | 2021-02-05T16:31:12 | 2021-02-05T16:31:45 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 4,140 | java |
/*
* Copyright (C) 2015 Archie L. Cobbs. All rights reserved.
*/
package io.permazen;
import io.permazen.annotation.JTransient;
import io.permazen.annotation.PermazenType;
import io.permazen.core.Database;
import io.permazen.kv.simple.SimpleKVDatabase;
import io.permazen.test.TestSupport;
import java.io.ByteArrayOutputStream;
import java.nio.charset.StandardCharsets;
import org.testng.Assert;
import org.testng.annotations.DataProvider;
import org.testng.annotations.Test;
public class SchemaGenerationTest extends TestSupport {
@Test(dataProvider = "invalidCases")
public void testBogusAbstract(Class<?>[] classes) throws Exception {
final PermazenFactory factory = new PermazenFactory();
factory.setDatabase(new Database(new SimpleKVDatabase()));
factory.setSchemaVersion(1);
factory.setModelClasses(Foo.class, BogusAbstract.class);
try {
factory.newPermazen();
assert false;
} catch (IllegalArgumentException e) {
this.log.info("got expected " + e);
}
}
@Test(dataProvider = "validCases")
public void testSchemaGeneration(String expected, Class<?>[] types) throws Exception {
final PermazenFactory factory = new PermazenFactory();
factory.setDatabase(new Database(new SimpleKVDatabase()));
factory.setSchemaVersion(1);
factory.setModelClasses(types);
final ByteArrayOutputStream buf = new ByteArrayOutputStream();
factory.newPermazen().getSchemaModel().toXML(buf, true);
final String actual = new String(buf.toByteArray(), StandardCharsets.UTF_8);
Assert.assertEquals(actual.replaceAll("\\r\\n?", "\n"), expected);
}
@DataProvider(name = "invalidCases")
public Class<?>[][][] genInvalid() {
return new Class<?>[][][] {
{ { Foo.class, BogusAbstract.class } }, // unimplemented abstract method (from interface)
{ { Foo.class, Foo2.class } }, // unimplemented abstract method (from @JTransient)
};
}
@DataProvider(name = "validCases")
public Object[][] genValid() {
return new Object[][] {
// protected setter
{ "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n"
+ "<Schema formatVersion=\"2\">\n"
+ " <ObjectType storageId=\"1\" name=\"Foo\">\n"
+ " <SimpleField storageId=\"51616\" name=\"value\" type=\"long\"/>\n"
+ " </ObjectType>\n"
+ "</Schema>\n",
new Class<?>[] { Foo.class } },
// non-abstract method with autogenNonAbstract() = true
{ "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n"
+ "<Schema formatVersion=\"2\">\n"
+ " <ObjectType storageId=\"1\" name=\"Foo\">\n"
+ " <SimpleField storageId=\"51616\" name=\"value\" type=\"long\"/>\n"
+ " </ObjectType>\n"
+ " <ObjectType storageId=\"3\" name=\"Foo3\">\n"
+ " <SimpleField storageId=\"7189\" name=\"concreteField\" type=\"int\"/>\n"
+ " <SimpleField storageId=\"51616\" name=\"value\" type=\"long\"/>\n"
+ " </ObjectType>\n"
+ "</Schema>\n",
new Class<?>[] { Foo.class, Foo3.class } },
};
}
// Model Classes
@PermazenType(storageId = 1)
public abstract static class Foo implements JObject {
protected abstract long getValue();
protected abstract void setValue(long value);
}
@PermazenType
public abstract static class BogusAbstract extends Foo implements Comparable<Foo> {
}
@PermazenType(storageId = 2)
public abstract static class Foo2 extends Foo {
@JTransient
protected abstract int getNotAField();
protected abstract void setNotAField(int x);
}
@PermazenType(storageId = 3, autogenNonAbstract = true)
public abstract static class Foo3 extends Foo {
private int x;
public int getConcreteField() {
return this.x;
}
public void setConcreteField(int x) {
this.x = x;
}
}
}
| [
"archie.cobbs@gmail.com"
] | archie.cobbs@gmail.com |
9cfc42dc0253b5a93196779f202bc516f6ceca1c | b8b5ff83bf34169f3e7c75dab3573de2bfa06a12 | /akmDoctorNew/src/main/java/cn/zsmy/akm/doctor/admissions/adapter/HospitalAdapter.java | b77aa856d9748b7bb1fe855ee3c16a3fc3970bfe | [] | no_license | wanjingyan001/akm | c889963f2c5772db8368039f095815ca7b954750 | 7d84ccc61c98ae804806fad7445a11558d96c240 | refs/heads/master | 2021-01-10T01:37:57.911792 | 2016-03-26T03:07:57 | 2016-03-26T03:07:57 | 54,759,913 | 0 | 1 | null | null | null | null | UTF-8 | Java | false | false | 2,685 | java | package cn.zsmy.akm.doctor.admissions.adapter;
import android.content.Context;
import android.graphics.Color;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.BaseAdapter;
import android.widget.LinearLayout;
import android.widget.TextView;
import java.util.List;
import cn.zsmy.doctor.R;
/**
* Created by sanz on 2015/12/17 15:38
*/
public class HospitalAdapter extends BaseAdapter {
private List<String> datas;
private Context context;
private int type;
public HospitalAdapter(List<String> datas, Context context, int type) {
this.datas = datas;
this.context = context;
this.type = type;
}
@Override
public int getCount() {
return datas.size();
}
@Override
public Object getItem(int position) {
return datas.get(position);
}
@Override
public long getItemId(int position) {
return position;
}
@Override
public View getView(int position, View convertView, ViewGroup parent) {
HoldView holdView = null;
if (convertView == null || convertView.getTag() == null) {
holdView = new HoldView();
convertView = LayoutInflater.from(context).inflate(R.layout.item_select_hospital, null);
convertView.setTag(holdView);
holdView.initializeView(convertView);
} else {
holdView = (HoldView) convertView.getTag();
}
holdView.initializeData(position);
if (type == 0) {
if (position == selectItem) {
convertView.setBackgroundColor(Color.WHITE);
} else {
convertView.setBackgroundColor(context.getResources().getColor(R.color.bg_lightgray_select));
}
}
return convertView;
}
private int selectItem;
public void setSelectItem(int selectItem) {
this.selectItem = selectItem;
}
public class HoldView {
private TextView hosName;
private LinearLayout group;
public void initializeView(View v) {
group = (LinearLayout) v.findViewById(R.id.hospital_group);
hosName = (TextView) v.findViewById(R.id.hospital_name_tex);
}
public void initializeData(int position) {
String name = datas.get(position);
hosName.setText(name);
if (type == 0) {
group.setBackgroundColor(context.getResources().getColor(R.color.windowBackground));
} else if (type == 1) {
group.setBackgroundColor(context.getResources().getColor(R.color.white));
}
}
}
}
| [
"670263921@qq.com"
] | 670263921@qq.com |
d88c5687c2d7d69dc97bead19a0920ed79f86dc5 | 3e355a798304584431e5e5a1f1bc141e16c330fc | /AL-Game/data/scripts/system/handlers/ai/ButlerAI2.java | 93951e668213c1c16f065fc411545385de33c42c | [] | no_license | webdes27/Aion-Lightning-4.6-SRC | db0b2b547addc368b7d5e3af6c95051be1df8d69 | 8899ce60aae266b849a19c3f93f47be9485c70ab | refs/heads/master | 2021-09-14T19:16:29.368197 | 2018-02-27T16:05:28 | 2018-02-27T16:05:28 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,582 | java | /**
* This file is part of Aion-Lightning <aion-lightning.org>.
*
* Aion-Lightning is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* Aion-Lightning is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details. *
* You should have received a copy of the GNU General Public License
* along with Aion-Lightning.
* If not, see <http://www.gnu.org/licenses/>.
*/
package ai;
import java.util.Map;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import com.aionemu.gameserver.ai2.AIName;
import com.aionemu.gameserver.model.DialogPage;
import com.aionemu.gameserver.model.gameobjects.Creature;
import com.aionemu.gameserver.model.gameobjects.player.Player;
import com.aionemu.gameserver.model.house.House;
import com.aionemu.gameserver.model.house.PlayerScript;
import com.aionemu.gameserver.network.aion.serverpackets.SM_DIALOG_WINDOW;
import com.aionemu.gameserver.network.aion.serverpackets.SM_HOUSE_SCRIPTS;
import com.aionemu.gameserver.utils.PacketSendUtility;
/**
* @author Rolandas
*/
@AIName("butler")
public class ButlerAI2 extends GeneralNpcAI2 {
private static final Logger log = LoggerFactory.getLogger(ButlerAI2.class);
@Override
public boolean onDialogSelect(Player player, int dialogId, int questId, int extendedRewardIndex) {
return kickDialog(player, DialogPage.getPageByAction(dialogId));
}
private boolean kickDialog(Player player, DialogPage page) {
if (page == DialogPage.NULL) {
return false;
}
PacketSendUtility.sendPacket(player, new SM_DIALOG_WINDOW(getOwner().getObjectId(), page.id()));
return true;
}
@Override
protected void handleCreatureSee(Creature creature) {
if (creature instanceof Player) {
Player player = (Player) creature;
House house = (House) getCreator();
if (player.getObjectId() == house.getOwnerId()) {
// DO SOMETHING SPECIAL
}
Map<Integer, PlayerScript> scriptMap = house.getPlayerScripts().getScripts();
try {
// protect against writing
for (int position = 0; position < 8; position++) {
scriptMap.get(position).writeLock();
}
int totalSize = 0;
int position = 0;
int from = 0;
while (position != 7) {
for (; position < 8; position++) {
PlayerScript script = scriptMap.get(position);
byte[] bytes = script.getCompressedBytes();
if (bytes == null) {
continue;
}
if (bytes.length > 8141) {
log.warn("Player " + player.getObjectId() + " has too big script at position " + position);
return;
}
if (totalSize + bytes.length > 8141) {
position--;
PacketSendUtility.sendPacket(player, new SM_HOUSE_SCRIPTS(house.getAddress().getId(), house.getPlayerScripts(), from, position));
from = position + 1;
totalSize = 0;
continue;
}
totalSize += bytes.length + 8;
}
position--;
if (totalSize > 0 || from == 0 && position == 7) {
PacketSendUtility.sendPacket(player, new SM_HOUSE_SCRIPTS(house.getAddress().getId(), house.getPlayerScripts(), from, position));
}
}
} finally {
// remove write locks finally
for (int position = 0; position < 8; position++) {
scriptMap.get(position).writeUnlock();
}
}
}
}
}
| [
"michelgorter@outlook.com"
] | michelgorter@outlook.com |
b26399077dadbe944da1659545812d9fc8c89f3a | 5370042f22ae5865e46b6e657da2f1d2db638dbd | /src/main/java/com/schinta/config/ApplicationProperties.java | ed665006921bb3e8d367f63fe98357114fce906d | [] | no_license | BulkSecurityGeneratorProject/river | 3b0c73a935af82b622eaefcb04dd0c14cb7975ee | d9a77b5edd95edbf5975243a31ea7b3fc75e0469 | refs/heads/master | 2022-12-15T09:16:42.063256 | 2018-10-25T03:22:47 | 2018-10-25T03:22:47 | 296,570,721 | 0 | 0 | null | 2020-09-18T09:06:42 | 2020-09-18T09:06:41 | null | UTF-8 | Java | false | false | 410 | java | package com.schinta.config;
import org.springframework.boot.context.properties.ConfigurationProperties;
/**
* Properties specific to River.
* <p>
* Properties are configured in the application.yml file.
* See {@link io.github.jhipster.config.JHipsterProperties} for a good example.
*/
@ConfigurationProperties(prefix = "application", ignoreUnknownFields = false)
public class ApplicationProperties {
}
| [
"jhipster-bot@jhipster.tech"
] | jhipster-bot@jhipster.tech |
744f9a1404966cba36eb66684238abee9ceec64a | 471a1d9598d792c18392ca1485bbb3b29d1165c5 | /jadx-MFP/src/main/java/com/twitter/sdk/android/core/Twitter.java | 1dfbe56c8561ff3df9bb9a4d19b6bd378f80c880 | [] | no_license | reed07/MyPreferencePal | 84db3a93c114868dd3691217cc175a8675e5544f | 365b42fcc5670844187ae61b8cbc02c542aa348e | refs/heads/master | 2020-03-10T23:10:43.112303 | 2019-07-08T00:39:32 | 2019-07-08T00:39:32 | 129,635,379 | 2 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,806 | java | package com.twitter.sdk.android.core;
import android.annotation.SuppressLint;
import android.content.Context;
import com.twitter.sdk.android.core.internal.ActivityLifecycleManager;
import com.twitter.sdk.android.core.internal.CommonUtils;
import com.twitter.sdk.android.core.internal.ExecutorUtils;
import com.twitter.sdk.android.core.internal.IdManager;
import java.io.File;
import java.util.concurrent.ExecutorService;
public class Twitter {
static final Logger DEFAULT_LOGGER = new DefaultLogger();
@SuppressLint({"StaticFieldLeak"})
static volatile Twitter instance;
private final Context context;
private final boolean debug;
private final ExecutorService executorService;
private final IdManager idManager = new IdManager(this.context);
private final ActivityLifecycleManager lifecycleManager = new ActivityLifecycleManager(this.context);
private final Logger logger;
private final TwitterAuthConfig twitterAuthConfig;
private Twitter(TwitterConfig twitterConfig) {
this.context = twitterConfig.context;
if (twitterConfig.twitterAuthConfig == null) {
this.twitterAuthConfig = new TwitterAuthConfig(CommonUtils.getStringResourceValue(this.context, "com.twitter.sdk.android.CONSUMER_KEY", ""), CommonUtils.getStringResourceValue(this.context, "com.twitter.sdk.android.CONSUMER_SECRET", ""));
} else {
this.twitterAuthConfig = twitterConfig.twitterAuthConfig;
}
if (twitterConfig.executorService == null) {
this.executorService = ExecutorUtils.buildThreadPoolExecutorService("twitter-worker");
} else {
this.executorService = twitterConfig.executorService;
}
if (twitterConfig.logger == null) {
this.logger = DEFAULT_LOGGER;
} else {
this.logger = twitterConfig.logger;
}
if (twitterConfig.debug == null) {
this.debug = false;
} else {
this.debug = twitterConfig.debug.booleanValue();
}
}
public static void initialize(TwitterConfig twitterConfig) {
createTwitter(twitterConfig);
}
static synchronized Twitter createTwitter(TwitterConfig twitterConfig) {
synchronized (Twitter.class) {
if (instance == null) {
instance = new Twitter(twitterConfig);
Twitter twitter = instance;
return twitter;
}
Twitter twitter2 = instance;
return twitter2;
}
}
static void checkInitialized() {
if (instance == null) {
throw new IllegalStateException("Must initialize Twitter before using getInstance()");
}
}
public static Twitter getInstance() {
checkInitialized();
return instance;
}
public Context getContext(String str) {
Context context2 = this.context;
StringBuilder sb = new StringBuilder();
sb.append(".TwitterKit");
sb.append(File.separator);
sb.append(str);
return new TwitterContext(context2, str, sb.toString());
}
public IdManager getIdManager() {
return this.idManager;
}
public TwitterAuthConfig getTwitterAuthConfig() {
return this.twitterAuthConfig;
}
public ExecutorService getExecutorService() {
return this.executorService;
}
public ActivityLifecycleManager getActivityLifecycleManager() {
return this.lifecycleManager;
}
public static boolean isDebug() {
if (instance == null) {
return false;
}
return instance.debug;
}
public static Logger getLogger() {
if (instance == null) {
return DEFAULT_LOGGER;
}
return instance.logger;
}
}
| [
"anon@ymous.email"
] | anon@ymous.email |
cdab42a4ab648190bfd10c686774aca675e17b32 | 1a06b41f97464b22d203fc07978d4221b6938390 | /src/main/java/com/yd/common/function/admin/controller/CIP_admin_config_logController.java | 7988411fba8e4f02841f86c155259c8553316139 | [] | no_license | un-knower/ydbigdata | 5e1849ad1f7aa5534e0ed8084d919b8195f7a6f9 | ac3cd1b8f68d859dbeff3999111e391d7503f99a | refs/heads/master | 2020-03-17T23:15:29.000521 | 2017-09-27T06:36:55 | 2017-09-27T06:36:55 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,641 | java | package com.yd.common.function.admin.controller;
import org.apache.log4j.Level;
import org.apache.log4j.Logger;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import com.yd.common.data.CIPResponseQueryMsg;
import com.yd.common.runtime.CIPErrorCode;
/**
* <p>控制层实现类</p>
* <p>Class: CIP_admin_op_logController</p>
*
* @since 2015-07-27 02:40:51
*/
@RestController
@RequestMapping(value = "/actions/admin_config_log")
public class CIP_admin_config_logController {
private static final String C_ACTION_GET_LOG = "CIP_admin_config_log_leval";
/**
* configLogLeval:配置日志的输出等级
*
* @author jh
* @param leval
* @return
* @throws Exception
* @since JDK 1.7
*/
@RequestMapping(value="/configLogLeval")
public CIPResponseQueryMsg configLogLeval(String leval){
CIPResponseQueryMsg msg = new CIPResponseQueryMsg();
Logger logger = Logger.getRootLogger();// 获取日志的级别
try {
if ("ALL".equals(leval)) {
logger.setLevel(Level.ALL);
}
if ("DEBUGE".equals(leval)) {
logger.setLevel(Level.DEBUG);
}
if ("INFO".equals(leval)) {
logger.setLevel(Level.INFO);
}
if ("WARN".equals(leval)) {
logger.setLevel(Level.WARN);
}
if ("ERROR".equals(leval)) {
logger.setLevel(Level.ERROR);
}
msg.errorCode = CIPErrorCode.CALL_SUCCESS.code;
msg.msg = CIPErrorCode.CALL_SUCCESS.name;
} catch (Exception e) {
CIPErrorCode error = new CIPErrorCode(10011,"日志级别设定失败");
msg.errorCode = error.code;
msg.msg = error.name;
}
return msg;
}
} | [
"13122163363@163.com"
] | 13122163363@163.com |
5b91355c5b8bd667980e785d145bf8027f6a9563 | 842857cb89ecc4a5f0ef0323e652aa4c90e347a4 | /pos/tcc/lawoffice/lawoffice-caixa/src/main/java/br/com/lawoffice/caixa/CaixaServiceLocal.java | dca164c6dba9be3b4b3f6578903b77dec8a63129 | [] | no_license | r3wa/my-studies | 964fde36f7c35ef7c7974f7a535a22f557344b5c | 65197c11e62189158021d00209dcc9c9ae1f482c | refs/heads/master | 2020-12-11T07:17:29.496206 | 2013-07-30T11:51:29 | 2013-07-30T11:51:29 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 202 | java | package br.com.lawoffice.caixa;
/**
*
* Interface para acesso local para os serviços dos caixa
*
* @author rduarte
*
*/
public interface CaixaServiceLocal extends CaixaService{
}
| [
"robson.o.d@e9df6f47-f091-bbda-6991-b925dddbb531"
] | robson.o.d@e9df6f47-f091-bbda-6991-b925dddbb531 |
c227f41f68780227a297749076ee590d88699ad4 | 5a3ad44e18f4d6599bca7bb1abbbef35b50ce988 | /src/java/mc/alk/arena/controllers/joining/AddToLeastFullTeam.java | e192729e525152a3b2b63ecfe9a28dfd102dc2e9 | [] | no_license | ZeaLBG/BattleArena | 830a0fdd1e6e23acc8a985665eb8770d796c8856 | a89ce2d94b92ed580f5ba177cdae040186c469fc | refs/heads/master | 2021-01-18T12:01:45.250747 | 2014-05-28T03:14:26 | 2014-05-28T03:14:26 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 5,932 | java | package mc.alk.arena.controllers.joining;
import mc.alk.arena.Defaults;
import mc.alk.arena.competition.Competition;
import mc.alk.arena.competition.events.Event.TeamSizeComparator;
import mc.alk.arena.objects.ArenaPlayer;
import mc.alk.arena.objects.ArenaSize;
import mc.alk.arena.objects.MatchParams;
import mc.alk.arena.objects.exceptions.NeverWouldJoinException;
import mc.alk.arena.objects.joining.TeamJoinObject;
import mc.alk.arena.objects.options.JoinOptions;
import mc.alk.arena.objects.options.JoinOptions.JoinOption;
import mc.alk.arena.objects.teams.ArenaTeam;
import mc.alk.arena.objects.teams.TeamFactory;
import java.util.ArrayList;
import java.util.Collection;
import java.util.Collections;
import java.util.List;
public class AddToLeastFullTeam extends AbstractJoinHandler {
public AddToLeastFullTeam(MatchParams params, Competition competition, Collection<ArenaTeam> newTeams)
throws NeverWouldJoinException{
super(params,competition);
if (minTeams == ArenaSize.MAX || maxTeams == ArenaSize.MAX)
throw new NeverWouldJoinException("If you add players by adding them to the next team in the list, there must be a finite number of players");
/// Lets add in all our teams first
if (minTeams > Defaults.MAX_TEAMS)
throw new NeverWouldJoinException("You can't make more than "+Defaults.MAX_TEAMS +" teams");
if (newTeams != null){
for (ArenaTeam at : newTeams) {
addTeam(at);
}
}
for (int i=teams.size();i<minTeams;i++){
ArenaTeam team = TeamFactory.createCompositeTeam(i, params);
addTeam(team);
}
}
@Override
public boolean switchTeams(ArenaPlayer player, Integer toTeamIndex, boolean checkSizes) {
ArenaTeam oldTeam = player.getTeam();
if (oldTeam == null || toTeamIndex >= maxTeams) // no correct team, or team out of range
return false;
if (checkSizes){
if (oldTeam.size()-1 < oldTeam.getMinPlayers())
return false;
ArenaTeam team = addToPreviouslyLeftTeam(player);
if (team != null)
return true;
/// Try to let them join their specified team if possible
team = teams.get(toTeamIndex);
if (team.size() + 1 <= team.getMaxPlayers()) {
removeFromTeam(oldTeam, player);
addToTeam(team, player);
return true;
}
return false;
} else {
ArenaTeam team = teams.get(toTeamIndex);
removeFromTeam(oldTeam, player);
addToTeam(team, player);
return true;
}
}
@Override
public TeamJoinResult joiningTeam(TeamJoinObject tqo) {
ArenaTeam team = tqo.getTeam();
if (team.size()==1){
ArenaTeam oldTeam = addToPreviouslyLeftTeam(team.getPlayers().iterator().next());
if (oldTeam != null){
team.setIndex(oldTeam.getIndex());
return new TeamJoinResult(TeamJoinStatus.ADDED_TO_EXISTING,oldTeam.getMinPlayers() - oldTeam.size(), oldTeam);
}
}
/// Try to let them join their specified team if possible
JoinOptions jo = tqo.getJoinOptions();
if (jo != null && jo.hasOption(JoinOption.TEAM)){
Integer index = (Integer) jo.getOption(JoinOption.TEAM);
if (index < maxTeams){ /// they specified a team index within range
ArenaTeam baseTeam= teams.get(index);
TeamJoinResult tjr = teamFits(baseTeam, team);
if (tjr != CANTFIT)
return tjr;
}
}
boolean hasZero = false;
for (ArenaTeam t : teams){
if (t.size() == 0){
hasZero = true;
break;
}
}
/// Since this is nearly the same as BinPack add... can we merge somehow easily?
if (!hasZero && teams.size() < maxTeams){
ArenaTeam ct = TeamFactory.createCompositeTeam(teams.size(), matchParams);
ct.setCurrentParams(tqo.getMatchParams());
ct.addPlayers(team.getPlayers());
team.setIndex(ct.getIndex());
if (ct.size() <= ct.getMaxPlayers()){
addTeam(ct);
if (ct.size() >= ct.getMinPlayers()) {
return new TeamJoinResult(TeamJoinStatus.ADDED, ct.getMinPlayers() - ct.size(), ct);
} else {
return new TeamJoinResult(TeamJoinStatus.ADDED_STILL_NEEDS_PLAYERS,
ct.getMinPlayers() - ct.size(), ct);
}
}
}
/// Try to fit them with an existing team
List<ArenaTeam> sortedBySize = new ArrayList<ArenaTeam>(teams);
Collections.sort(sortedBySize, new TeamSizeComparator());
for (ArenaTeam baseTeam : sortedBySize){
TeamJoinResult tjr = teamFits(baseTeam, team);
if (tjr != CANTFIT)
return tjr;
}
/// sorry peeps.. full up
return CANTFIT;
}
private TeamJoinResult teamFits(ArenaTeam baseTeam, ArenaTeam team) {
if ( baseTeam.size() + team.size() <= baseTeam.getMaxPlayers()){
team.setIndex(baseTeam.getIndex());
addToTeam(baseTeam, team.getPlayers());
if (baseTeam.size() == 0){
return new TeamJoinResult(TeamJoinStatus.ADDED, baseTeam.getMinPlayers() - baseTeam.size(),baseTeam);
} else {
return new TeamJoinResult(TeamJoinStatus.ADDED_TO_EXISTING,
baseTeam.getMinPlayers() - baseTeam.size(),baseTeam);
}
}
return CANTFIT;
}
@Override
public String toString(){
return "["+competition.getParams().getName() +":JH:AddToLeast]";
}
}
| [
"alkarin.v@gmail.com"
] | alkarin.v@gmail.com |
51aab97973c08ac55ee540afbee0e340c6e60d99 | 6d1b4de40f17821a4ab4269eb31a3de429ee32bb | /src/main/java/com/geekq/miaosha/domain/MiaoShaMessageInfo.java | 15dc539fe181ea7695d35d0d0380f26cf5453a5a | [] | no_license | zjwpw/miaosha | 19ee7f59f0262555dfa5cd90aa72e6a2fd8f3b01 | 52b6f60951934fe9bef3d34432d8bcd69e64bda8 | refs/heads/master | 2020-04-16T07:42:15.914827 | 2019-01-11T14:16:04 | 2019-01-11T14:16:04 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,024 | java | package com.geekq.miaosha.domain;
import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;
/**
* 消息中心主体表
*/
public class MiaoShaMessageInfo implements Serializable {
private Integer id ;
private Long messageId ;
private String content ;
private Date createTime;
private Integer status ;
private Date overTime ;
private Integer messageType ;
private Integer sendType ;
private String goodName ;
private BigDecimal price ;
public Integer getId() {
return id;
}
public void setId(Integer id) {
this.id = id;
}
public Long getMessageId() {
return messageId;
}
public void setMessageId(Long messageId) {
this.messageId = messageId;
}
public String getContent() {
return content;
}
public void setContent(String content) {
this.content = content;
}
public Date getCreateTime() {
return createTime;
}
public void setCreateTime(Date createTime) {
this.createTime = createTime;
}
public Integer getStatus() {
return status;
}
public void setStatus(Integer status) {
this.status = status;
}
public Date getOverTime() {
return overTime;
}
public void setOverTime(Date overTime) {
this.overTime = overTime;
}
public Integer getMessageType() {
return messageType;
}
public void setMessageType(Integer messageType) {
this.messageType = messageType;
}
public Integer getSendType() {
return sendType;
}
public void setSendType(Integer sendType) {
this.sendType = sendType;
}
public String getGoodName() {
return goodName;
}
public void setGoodName(String goodName) {
this.goodName = goodName;
}
public BigDecimal getPrice() {
return price;
}
public void setPrice(BigDecimal price) {
this.price = price;
}
}
| [
"qiurunze@youxin.com"
] | qiurunze@youxin.com |
a49f42ed821d1cd69a8208630a32b5617d396861 | a1f54c4fc08b70dfcde20dd3dc2e0b544850ceb9 | /Vasilev_samouchitel/src/Ch_6/ClassDemo.java | e3ec66d5fab47b8ec8ea0a01355e2abfba4c88aa | [] | no_license | smith1984/java_src_tutorial | 175d4f69e443084f82c48ab7457dcacfae3dfb23 | 50fd98e37d675f597074a6e53a9ef34824d5fcd4 | refs/heads/master | 2020-04-09T03:38:38.848665 | 2018-12-01T21:57:20 | 2018-12-01T21:57:20 | 159,990,788 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 784 | java | package Ch_6;
import javax.swing.*;
// Описание класса:
class MyClass{
int num;
char symb;
String text;
}
// Главный класс программы:
public class ClassDemo{
public static void main(String[] args){
MyClass obj=new MyClass();
// Заполнение полей объекта:
obj.num=12;
obj.symb='A';
obj.text="Текстовое поле";
// Текст для отображения в окне сообщения:
String str="Значения полей объекта:\n";
str+="num="+obj.num+"\n";
str+="symb="+obj.symb+"\n";
str+="text="+obj.text;
// Отображение окна:
JOptionPane.showMessageDialog(null,str);}
}
| [
"smith150384@gmail.com"
] | smith150384@gmail.com |
33bf690c7487af0d0dcb0d8cd8f8ff1d71984765 | 32700a354a6b6019f4e6a7ed879d42e6d2011273 | /spring-two-contexts/src/main/java/me/loki2302/client/NoteClient.java | 3bbfbf9049dd73e44c2853cc25958745a6b89d7c | [] | no_license | agibalov/spring-experiments | d2723d7cd7e8173ba9f411a16dbfcadbe3d912f3 | 01f0ee155dcba36711acf33d7b0cf2e847bbc57e | refs/heads/master | 2021-10-26T16:31:16.521163 | 2021-10-09T19:06:55 | 2021-10-09T19:06:55 | 120,969,854 | 1 | 3 | null | 2020-11-16T16:45:29 | 2018-02-10T00:20:36 | Java | UTF-8 | Java | false | false | 973 | java | package me.loki2302.client;
import me.loki2302.server.Note;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import org.springframework.web.client.RestTemplate;
@Component
public class NoteClient {
@Autowired
private RestTemplate restTemplate;
@Autowired
private ClientNoteRepository clientNoteRepository;
public long getNoteCount() {
return restTemplate.getForObject("http://localhost:8080/notes", Long.class);
}
public void createNote(String text) {
Note note = new Note();
note.text = "hello there";
restTemplate.postForObject("http://localhost:8080/notes", note, Void.class);
}
public long getClientNoteCount() {
return clientNoteRepository.count();
}
public void createClientNote(String text) {
ClientNote note = new ClientNote();
note.text = text;
clientNoteRepository.save(note);
}
}
| [
"loki2302@loki2302.me"
] | loki2302@loki2302.me |
b5ee2a76932f655b7b5059fc63327265a8d6878e | 11e91d4eb8d8a9cc18718182aab5b3d6df619248 | /src/main/java/erebus/blocks/BlockFluidJar.java | b03f722e7c2b2ebe09a4515cd11fba7c5b70ebc8 | [] | no_license | vadis365/TheErebus | 3f71eb8344aaaf3226253a2c854cbba7bf4301eb | e0cbec6c69b864b0ffde3b52232e1416a95b6109 | refs/heads/mc1.12 | 2021-06-03T07:25:53.959396 | 2021-02-21T19:26:09 | 2021-02-21T19:26:09 | 16,282,196 | 20 | 24 | null | 2023-02-20T21:58:27 | 2014-01-27T15:02:45 | Java | UTF-8 | Java | false | false | 5,024 | java | package erebus.blocks;
import java.util.List;
import java.util.Random;
import javax.annotation.Nullable;
import erebus.ModBlocks.IHasCustomItem;
import erebus.ModTabs;
import erebus.tileentity.TileEntityFluidJar;
import net.minecraft.block.BlockContainer;
import net.minecraft.block.SoundType;
import net.minecraft.block.material.Material;
import net.minecraft.block.state.IBlockState;
import net.minecraft.client.util.ITooltipFlag;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.inventory.InventoryHelper;
import net.minecraft.item.Item;
import net.minecraft.item.ItemBlock;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.BlockRenderLayer;
import net.minecraft.util.EnumBlockRenderType;
import net.minecraft.util.EnumFacing;
import net.minecraft.util.EnumHand;
import net.minecraft.util.math.BlockPos;
import net.minecraft.util.text.TextFormatting;
import net.minecraft.world.IBlockAccess;
import net.minecraft.world.World;
import net.minecraftforge.fluids.FluidStack;
import net.minecraftforge.fluids.FluidUtil;
import net.minecraftforge.fluids.capability.CapabilityFluidHandler;
import net.minecraftforge.fluids.capability.IFluidHandler;
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;
public class BlockFluidJar extends BlockContainer implements IHasCustomItem {
public BlockFluidJar() {
super(Material.GLASS);
setHardness(1.0F);
setSoundType(SoundType.GLASS);
setCreativeTab(ModTabs.BLOCKS);
}
@Override
public TileEntity createNewTileEntity(World worldIn, int meta) {
return new TileEntityFluidJar();
}
@Override
public EnumBlockRenderType getRenderType(IBlockState state) {
return EnumBlockRenderType.MODEL;
}
@Override
@SideOnly(Side.CLIENT)
public BlockRenderLayer getRenderLayer() {
return BlockRenderLayer.TRANSLUCENT;
}
@Override
@SideOnly(Side.CLIENT)
public boolean shouldSideBeRendered(IBlockState blockState, IBlockAccess blockAccess, BlockPos pos, EnumFacing side) {
return true;
}
@Override
public boolean isOpaqueCube(IBlockState state) {
return false;
}
@Nullable
@Override
public Item getItemDropped(IBlockState state, Random rand, int fortune) {
return null;
}
@Override
public void onBlockHarvested(World world, BlockPos pos, IBlockState state, EntityPlayer player) {
if (!world.isRemote && !player.capabilities.isCreativeMode) {
TileEntity tileentity = world.getTileEntity(pos);
if (tileentity instanceof TileEntityFluidJar) {
NBTTagCompound nbt = new NBTTagCompound();
tileentity.writeToNBT(nbt);
ItemStack stack = new ItemStack(Item.getItemFromBlock(this), 1, 0);
if (((TileEntityFluidJar) tileentity).tank.getFluidAmount() > 0)
stack.setTagCompound(nbt);
InventoryHelper.spawnItemStack(world, pos.getX(), pos.getY(), pos.getZ(), stack);
world.removeTileEntity(pos);
}
}
}
@Override
public void onBlockPlacedBy(World world, BlockPos pos, IBlockState state, EntityLivingBase placer, ItemStack stack) {
super.onBlockPlacedBy(world, pos, state, placer, stack);
if (!world.isRemote && stack.hasTagCompound()) {
TileEntity tileentity = world.getTileEntity(pos);
if (tileentity instanceof TileEntityFluidJar) {
if (!stack.getTagCompound().hasKey("Empty")) {
FluidStack fluid = FluidStack.loadFluidStackFromNBT(stack.getTagCompound());
((TileEntityFluidJar) tileentity).tank.fillInternal(fluid, true);
}
}
}
}
@Override
public boolean onBlockActivated(World world, BlockPos pos, IBlockState state, EntityPlayer player, EnumHand hand, EnumFacing side, float hitX, float hitY, float hitZ) {
final IFluidHandler fluidHandler = getFluidHandler(world, pos);
if (fluidHandler != null) {
FluidUtil.interactWithFluidHandler(player, hand, world, pos, side);//(heldItem, fluidHandler, player);
return FluidUtil.getFluidHandler(player.getHeldItem(hand)) != null;
}
return false;
}
@Nullable
private IFluidHandler getFluidHandler(IBlockAccess world, BlockPos pos) {
TileEntityFluidJar tileentity = (TileEntityFluidJar) world.getTileEntity(pos);
return tileentity.getCapability(CapabilityFluidHandler.FLUID_HANDLER_CAPABILITY, null);
}
@Override
public ItemBlock getItemBlock() {
ItemBlock TANK_ITEM = new ItemBlock(this) {
@Override
@SideOnly(Side.CLIENT)
public void addInformation(ItemStack stack, @Nullable World worldIn, List<String> list, ITooltipFlag flag) {
if(stack.hasTagCompound() && !stack.getTagCompound().hasKey("Empty")) {
FluidStack fluid = FluidStack.loadFluidStackFromNBT(stack.getTagCompound());
if(fluid !=null) {
list.add(TextFormatting.GREEN + "Contains: "+ fluid.getFluid().getLocalizedName(fluid));
list.add(TextFormatting.BLUE + ""+ fluid.amount +"Mb/32000Mb");
}
}
else
list.add(TextFormatting.RED + "It's Empty!");
}
};
return TANK_ITEM;
}
}
| [
"curve_linear@hotmail.com"
] | curve_linear@hotmail.com |
542fba667b3c2809485eb7eebecba1d0ea3b83d3 | 2060ca92db3afb74f391cdb8378257f5058b0be2 | /app/src/main/java/com/example/administrator/mysharedumbrella01/entivity/WechatLoginBean.java | 71c6ffc59ba03ef775f0419b528dea7b357376f6 | [] | no_license | meihuali/MySharedUmbrella | 69540bafd8bd8328ed6869fad80e282d6f46386d | 68db341a88f485b026ae935f16a8a5cc46dd4042 | refs/heads/master | 2021-08-15T18:25:14.507513 | 2017-11-18T03:19:22 | 2017-11-18T03:19:22 | 99,978,582 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 4,289 | java | package com.example.administrator.mysharedumbrella01.entivity;
import java.io.Serializable;
/**
* Created by Administrator on 2017/6/23 0023.
* //三方 微信登录 实体类
*/
public class WechatLoginBean implements Serializable{
/**
* status : 1
* data : {"r_id":"461","r_username":"啊啊啊","r_img":"20170912/9b839687c7b4b0b25f1861f73f77743f.jpg","r_appid":"17620193389","r_password":"","r_deposit":"0","r_money":"0.00","r_addtime":"0","mobilephone":"17620193389","unionid":"","is_Authentication":"2","wechat":"","qq":""}
*/
private int status;
private DataBean data;
public int getStatus() {
return status;
}
public void setStatus(int status) {
this.status = status;
}
public DataBean getData() {
return data;
}
public void setData(DataBean data) {
this.data = data;
}
public static class DataBean {
/**
* r_id : 461
* r_username : 啊啊啊
* r_img : 20170912/9b839687c7b4b0b25f1861f73f77743f.jpg
* r_appid : 17620193389
* r_password :
* r_deposit : 0
* r_money : 0.00
* r_addtime : 0
* mobilephone : 17620193389
* unionid :
* is_Authentication : 2
* wechat :
* qq :
*/
private String r_id;
private String r_username;
private String r_img;
private String r_appid;
private String r_password;
private String r_deposit;
private String r_money;
private String r_addtime;
private String mobilephone;
private String unionid;
private String is_Authentication;
private String wechat;
private String qq;
private int is_manager;
public int getIs_manager() {
return is_manager;
}
public void setIs_manager(int is_manager) {
this.is_manager = is_manager;
}
public String getR_id() {
return r_id;
}
public void setR_id(String r_id) {
this.r_id = r_id;
}
public String getR_username() {
return r_username;
}
public void setR_username(String r_username) {
this.r_username = r_username;
}
public String getR_img() {
return r_img;
}
public void setR_img(String r_img) {
this.r_img = r_img;
}
public String getR_appid() {
return r_appid;
}
public void setR_appid(String r_appid) {
this.r_appid = r_appid;
}
public String getR_password() {
return r_password;
}
public void setR_password(String r_password) {
this.r_password = r_password;
}
public String getR_deposit() {
return r_deposit;
}
public void setR_deposit(String r_deposit) {
this.r_deposit = r_deposit;
}
public String getR_money() {
return r_money;
}
public void setR_money(String r_money) {
this.r_money = r_money;
}
public String getR_addtime() {
return r_addtime;
}
public void setR_addtime(String r_addtime) {
this.r_addtime = r_addtime;
}
public String getMobilephone() {
return mobilephone;
}
public void setMobilephone(String mobilephone) {
this.mobilephone = mobilephone;
}
public String getUnionid() {
return unionid;
}
public void setUnionid(String unionid) {
this.unionid = unionid;
}
public String getIs_Authentication() {
return is_Authentication;
}
public void setIs_Authentication(String is_Authentication) {
this.is_Authentication = is_Authentication;
}
public String getWechat() {
return wechat;
}
public void setWechat(String wechat) {
this.wechat = wechat;
}
public String getQq() {
return qq;
}
public void setQq(String qq) {
this.qq = qq;
}
}
}
| [
"77299007@qq.com"
] | 77299007@qq.com |
e487c4fbb91096cd7dda01ada19028fc5cf3bbf2 | 6cef9aa8ab64a1ebed62954d99665fa2d1ee22d2 | /web/src/main/java/gr/helix/core/web/controller/HomeController.java | 04854d32c852c5bd3fc57944de87e613f1d1319b | [
"Apache-2.0"
] | permissive | HELIX-GR/core | d6dbe461db4ed528b7f4a2f34b67ae664d95425a | ea5eb701c1806e89ef2e1f89e22f0d853fe6b806 | refs/heads/master | 2023-01-06T04:39:04.768790 | 2020-06-17T11:02:07 | 2020-06-17T11:02:07 | 135,315,199 | 0 | 0 | Apache-2.0 | 2023-01-04T05:05:19 | 2018-05-29T15:19:10 | Java | UTF-8 | Java | false | false | 1,528 | java | package gr.helix.core.web.controller;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpSession;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
@Controller
public class HomeController {
private static final String clientRoutes[] = {
"/collections/",
"/datasets/",
"/error/",
"/favorites/",
"/main/",
"/news/",
"/notebooks/",
"/pages/",
"/profile/",
"/project/",
"/pubs/",
"/publications/",
};
@RequestMapping("*")
public String index(HttpSession session, HttpServletRequest request) {
// Prevent infinite redirects
if (this.isClientRoute(request.getServletPath())) {
return "index";
}
return "redirect:/main/";
}
@RequestMapping({
"/collections/**",
"/datasets/**",
"/error/**",
"/favorites/**",
"/main/**",
"/news/**",
"/notebooks/**",
"/pages/**",
"/profile/**",
"/project/**",
"/pubs/**",
"/publications/**",
})
public String reactRoutes(HttpSession session, HttpServletRequest request) {
return "index";
}
private boolean isClientRoute(String path) {
for (final String value : clientRoutes) {
if (path.toLowerCase().startsWith(value)) {
return true;
}
}
return false;
}
}
| [
"yannis.kouvaras@kupa.gr"
] | yannis.kouvaras@kupa.gr |
0d868a2991c38bcbf2e32b1bd74255ff7b6a1121 | 82a77a3e7d5b2b0e33e4aebb62a5c669b85fe396 | /src/org/redkale/convert/ext/BigDecimalSimpledCoder.java | 07aa95aa73871cf7685da226d53e095f9730ecdf | [
"Apache-2.0"
] | permissive | longye321/redkale | a69772d8ed4bded692d45852700a20e83e3f2d3d | 8b2e347e4170a68c4a016437af92571141787eb0 | refs/heads/master | 2021-01-19T18:32:51.491665 | 2019-08-28T09:00:45 | 2019-08-28T09:00:45 | 57,965,253 | 0 | 0 | Apache-2.0 | 2019-08-28T17:00:47 | 2016-05-03T11:48:13 | Java | UTF-8 | Java | false | false | 1,251 | java | /*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package org.redkale.convert.ext;
import org.redkale.convert.SimpledCoder;
import org.redkale.convert.Writer;
import org.redkale.convert.Reader;
import java.math.BigDecimal;
import org.redkale.util.Utility;
/**
* BigDecimal 的SimpledCoder实现
*
* <p>
* 详情见: https://redkale.org
*
* @author zhangjx
* @param <R> Reader输入的子类型
* @param <W> Writer输出的子类型
*/
public final class BigDecimalSimpledCoder<R extends Reader, W extends Writer> extends SimpledCoder<R, W, BigDecimal> {
public static final BigDecimalSimpledCoder instance = new BigDecimalSimpledCoder();
@Override
public void convertTo(W out, BigDecimal value) {
if (value == null) {
out.writeNull();
return;
}
out.writeSmallString(value.toString());
}
@Override
public BigDecimal convertFrom(R in) {
String value = in.readSmallString();
if (value == null) return null;
return new BigDecimal(Utility.charArray(value));
}
}
| [
"22250530@qq.com"
] | 22250530@qq.com |
b2772838f8a3c1e8c5259c80665bfb0cf401a77c | 13c2d3db2d49c40c74c2e6420a9cd89377f1c934 | /program_data/JavaProgramData/63/1988.java | 8b9b953fa659e88f16008882f43d0c4e4c1d872c | [
"MIT"
] | permissive | qiuchili/ggnn_graph_classification | c2090fefe11f8bf650e734442eb96996a54dc112 | 291ff02404555511b94a4f477c6974ebd62dcf44 | refs/heads/master | 2021-10-18T14:54:26.154367 | 2018-10-21T23:34:14 | 2018-10-21T23:34:14 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,453 | java | package <missing>;
public class GlobalMembers
{
public static int Main()
{
int m;
int n;
String tempVar = ConsoleInput.scanfRead();
if (tempVar != null)
{
m = Integer.parseInt(tempVar);
}
String tempVar2 = ConsoleInput.scanfRead(" ");
if (tempVar2 != null)
{
n = Integer.parseInt(tempVar2);
}
int[][] a = new int[120][120];
for (int i = 0;i <= m - 1;i++)
{
for (int j = 0;j <= n - 1;j++)
{
String tempVar3 = ConsoleInput.scanfRead();
if (tempVar3 != null)
{
a[i][j] = Integer.parseInt(tempVar3);
}
}
}
int p;
int q;
String tempVar4 = ConsoleInput.scanfRead();
if (tempVar4 != null)
{
p = Integer.parseInt(tempVar4);
}
String tempVar5 = ConsoleInput.scanfRead(" ");
if (tempVar5 != null)
{
q = Integer.parseInt(tempVar5);
}
int[][] b = new int[120][120];
for (int c = 0;c <= p - 1;c++)
{
for (int d = 0;d <= q - 1;d++)
{
String tempVar6 = ConsoleInput.scanfRead();
if (tempVar6 != null)
{
b[c][d] = Integer.parseInt(tempVar6);
}
}
}
int[][] e = new int[120][120];
for (int f = 0;f <= m - 1;f++)
{
for (int g = 0;g <= q - 1;g++)
{
e[f][g] = 0;
for (int h = 0;h <= n - 1;h++)
{
e[f][g] = e[f][g] + a[f][h] * b[h][g];
}
}
}
for (int k = 0;k <= m - 1;k++)
{
for (int l = 0;l <= q - 2;l++)
{
System.out.printf("%d ",e[k][l]);
}
System.out.printf("%d\n",e[k][q - 1]);
}
}
}
| [
"y.yu@open.ac.uk"
] | y.yu@open.ac.uk |
851c00081d32dbbfd8aa4314e875a10155699bff | 8de0b1a60018457c8d84c8b95f80c49b8a84ee39 | /app/src/main/java/com/haolin/animation/framework/MainActivity.java | 3112acf354fe0ef66fe7ccad101fdb90b155edc5 | [] | no_license | hunimeizi/HaoLin_AnimationFramework | 6d38148cabc89b14a47e45847d8d5469f172f146 | a989ac507ecdb06d6c20dfdccbf5960d5bce2ff8 | refs/heads/master | 2020-05-15T17:52:54.040194 | 2019-04-20T14:35:19 | 2019-04-20T14:35:19 | 182,412,828 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 343 | java | package com.haolin.animation.framework;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
public class MainActivity extends AppCompatActivity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
}
}
| [
"342161360@qq.com"
] | 342161360@qq.com |
6e2d4f74be036a52d8664e875545fc0f3c4a6b45 | 737b0fc040333ec26f50409fc16372f5c64c7df6 | /bus-gitlab/src/main/java/org/aoju/bus/gitlab/LicenseApi.java | 066887f84246bd8ae0d1a398e2bc0b3f1f25627d | [
"MIT"
] | permissive | sfg11/bus | 1714cdc6c77f0042e3b80f32e1d9b7483c154e3e | d560ba4d3abd2e0a6c5dfda9faf7075da8e8d73e | refs/heads/master | 2022-12-13T02:26:18.533039 | 2020-08-26T02:23:34 | 2020-08-26T02:23:34 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 5,909 | java | /*********************************************************************************
* *
* The MIT License (MIT) *
* *
* Copyright (c) 2015-2020 aoju.org Greg Messner and other contributors. *
* *
* Permission is hereby granted, free of charge, to any person obtaining a copy *
* of this software and associated documentation files (the "Software"), to deal *
* in the Software without restriction, including without limitation the rights *
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell *
* copies of the Software, and to permit persons to whom the Software is *
* furnished to do so, subject to the following conditions: *
* *
* The above copyright notice and this permission notice shall be included in *
* all copies or substantial portions of the Software. *
* *
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR *
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE *
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER *
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, *
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN *
* THE SOFTWARE. *
********************************************************************************/
package org.aoju.bus.gitlab;
import org.aoju.bus.gitlab.models.License;
import javax.ws.rs.core.Response;
import java.util.List;
import java.util.Optional;
import java.util.stream.Stream;
/**
* This class provides an entry point to all the GitLab API license calls.
*
* @author Kimi Liu
* @version 6.0.8
* @see <a href="https://docs.gitlab.com/ce/api/license.html">License API</a>
* @since JDK 1.8+
*/
public class LicenseApi extends AbstractApi {
public LicenseApi(GitLabApi gitLabApi) {
super(gitLabApi);
}
/**
* Retrieve information about the current license.
*
* <pre><code>GitLab Endpoint: GET /license</code></pre>
*
* @return a License instance holding info about the current license
* @throws GitLabApiException if any exception occurs
*/
public License getLicense() throws GitLabApiException {
Response response = get(Response.Status.OK, null, "license");
return (response.readEntity(License.class));
}
/**
* Retrieve information about the current license as the value of an Optional.
*
* <pre><code>GitLab Endpoint: GET /license</code></pre>
*
* @return the current license as the value of an Optional.
*/
public Optional<License> getOptionalLicense() {
try {
return (Optional.ofNullable(getLicense()));
} catch (GitLabApiException glae) {
return (GitLabApi.createOptionalFromException(glae));
}
}
/**
* Retrieve information about all licenses.
*
* <pre><code>GitLab Endpoint: GET /licenses</code></pre>
*
* @return a List of License instances
* @throws GitLabApiException if any exception occurs
*/
public List<License> getAllLicenses() throws GitLabApiException {
return (getAllLicenses(getDefaultPerPage()).all());
}
/**
* Get a Stream of all licenses.
*
* <pre><code>GitLab Endpoint: GET /licenses</code></pre>
*
* @return a Stream of License instances
* @throws GitLabApiException if any exception occurs
*/
public Stream<License> getAllLicensesStream() throws GitLabApiException {
return (getAllLicenses(getDefaultPerPage()).stream());
}
/**
* Get a Pager of all licenses.
*
* <pre><code>GitLab Endpoint: GET /licenses</code></pre>
*
* @param itemsPerPage the number of LicenseTemplate instances that will be
* fetched per page
* @return a Pager of license template
* @throws GitLabApiException if any exception occurs
*/
public Pager<License> getAllLicenses(int itemsPerPage) throws GitLabApiException {
return (new Pager<License>(this, License.class, itemsPerPage, null, "licenses"));
}
/**
* Add a new license.
*
* <pre><code>GitLab Endpoint: POST /license</code></pre>
*
* @param licenseString the license string for the license
* @return a License instance for the added license
* @throws GitLabApiException if any exception occurs
*/
public License addLicense(String licenseString) throws GitLabApiException {
GitLabApiForm formData = new GitLabApiForm().withParam("license", licenseString, true);
Response response = post(Response.Status.CREATED, formData, "license");
return (response.readEntity(License.class));
}
/**
* Deletes a license.
*
* <pre><code>GitLab Endpoint: DELETE /license/:id</code></pre>
*
* @param licenseId the ID of the license to delete
* @return a License instance for the delete license
* @throws GitLabApiException if any exception occurs
*/
public License deleteLicense(Integer licenseId) throws GitLabApiException {
Response response = delete(Response.Status.OK, null, "license", licenseId);
return (response.readEntity(License.class));
}
} | [
"839536@qq.com"
] | 839536@qq.com |
b632b24ef7c4482551a71efa14d3585be057bd24 | ee53bc9d48eef2f1cbc1a11f8915dd8c6b23fba0 | /workplace/workplace/javaBasic/src/annotaion/Test.java | c2bedac90cb0840440a72b58dad24af1282def46 | [] | no_license | xinyangyun/JavaExercise | 545d787a78ab3d60f2b37ff41c89b5cb4470a85a | 6e40c233dd43364e1fd4c265641eb0e306ec4dd8 | refs/heads/master | 2023-02-15T18:08:40.097738 | 2021-01-16T04:47:57 | 2021-01-16T04:47:57 | 330,085,976 | 0 | 0 | null | null | null | null | GB18030 | Java | false | false | 1,954 | java | package annotaion;
import java.lang.annotation.Annotation;
import java.lang.reflect.Field;
import java.lang.reflect.Method;
//@TestAnnotation
//@TestAnnotation(id = 3, msg = "hello anntation") //给注解赋值
@TestAnnotation() // 如果注解有默认值可以不用进行赋值
public class Test {
// 如果注解中只有一个参数,可以不用写value
// @Check("hi")
@Check(value = "hi")
int a;
// 如果注解中没有任何的属性,在应用注解的时候括号都可以省略
@Perform
public void testMethod() {
}
@SuppressWarnings("deprecation")
public void test1() {
Hero hero = new Hero();
hero.say();
hero.speak();
}
public static void main(String[] args) {
// 判断注解是否存在
boolean annotationPresent = Test.class.isAnnotationPresent(TestAnnotation.class);
if (annotationPresent) {
// 通过反射获取注解
TestAnnotation annotation = Test.class.getAnnotation(TestAnnotation.class);
System.out.println("id:" + annotation.id());
System.out.println("msg:" + annotation.msg());
}
try {
Field a = Test.class.getDeclaredField("a");
a.setAccessible(true);
// 获取一个成员变量上的注解
Check check = a.getAnnotation(Check.class);
if (check != null) {
System.out.println("check value:" + check.value());
}
Method testMethod = Test.class.getDeclaredMethod("testMethod");
if (testMethod != null) {
// 获取方法中的注解
Annotation[] ans = testMethod.getAnnotations();
for (int i = 0; i < ans.length; i++) {
System.out.println("method testMethod annotation:" + ans[i].annotationType().getSimpleName());
}
}
} catch (NoSuchFieldException e) {
e.printStackTrace();
System.out.println(e.getMessage());
} catch (SecurityException e) {
e.printStackTrace();
System.out.println(e.getMessage());
} catch (NoSuchMethodException e) {
e.printStackTrace();
System.out.println(e.getMessage());
}
}
}
| [
"you@example.com"
] | you@example.com |
9b67d1299e093b4f43db45b4b957bc6d07448188 | bfac99890aad5f43f4d20f8737dd963b857814c2 | /reg4/v1/xwiki-platform-core/xwiki-platform-legacy/xwiki-platform-legacy-observation/src/main/java/org/xwiki/observation/event/DocumentUpdateEvent.java | 056d4feadc7c5134cadc48c133fe8c219a8d0abd | [] | no_license | STAMP-project/dbug | 3b3776b80517c47e5cac04664cc07112ea26b2a4 | 69830c00bba4d6b37ad649aa576f569df0965c72 | refs/heads/master | 2021-01-20T03:59:39.330218 | 2017-07-12T08:03:40 | 2017-07-12T08:03:40 | 89,613,961 | 0 | 1 | null | null | null | null | UTF-8 | Java | false | false | 2,456 | java | /*
* See the NOTICE file distributed with this work for additional
* information regarding copyright ownership.
*
* This is free software; you can redistribute it and/or modify it
* under the terms of the GNU Lesser General Public License as
* published by the Free Software Foundation; either version 2.1 of
* the License, or (at your option) any later version.
*
* This software is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this software; if not, write to the Free
* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
*/
package org.xwiki.observation.event;
import org.xwiki.observation.event.filter.EventFilter;
/**
* An event triggered when an existing document is saved (updated).
*
* @version $Id: b58fd9d3ebaf2d8c08e3c396fa19a6ddc1e173ee $
* @deprecated since 2.7RC1 use {@link org.xwiki.bridge.event.DocumentUpdatedEvent} instead
*/
@Deprecated
public class DocumentUpdateEvent extends AbstractDocumentEvent
{
/**
* The version identifier for this Serializable class. Increment only if the <i>serialized</i> form of the class
* changes.
*/
private static final long serialVersionUID = 1L;
/**
* Constructor initializing the event filter with an
* {@link org.xwiki.observation.event.filter.AlwaysMatchingEventFilter}, meaning that this event will match any
* other document update event.
*/
public DocumentUpdateEvent()
{
super();
}
/**
* Constructor initializing the event filter with a {@link org.xwiki.observation.event.filter.FixedNameEventFilter},
* meaning that this event will match only update events affecting the document matching the passed document name.
*
* @param documentName the name of the updated document to match
*/
public DocumentUpdateEvent(String documentName)
{
super(documentName);
}
/**
* Constructor using a custom {@link EventFilter}.
*
* @param eventFilter the filter to use for matching events
*/
public DocumentUpdateEvent(EventFilter eventFilter)
{
super(eventFilter);
}
}
| [
"caroline.landry@inria.fr"
] | caroline.landry@inria.fr |
2e4a5db591d290aff021e8220e8c12631cf93eda | 439a420853f792fd2bbf0bad4da2e83b32bfcfe6 | /flink-addons/flink-streaming/flink-streaming-core/src/main/java/org/apache/flink/streaming/util/serialization/FunctionTypeWrapper.java | 011254b18a50d36ecf90dd72d1a7b7e8bfb3adac | [
"BSD-3-Clause",
"MIT",
"OFL-1.1",
"Apache-2.0",
"LicenseRef-scancode-unknown-license-reference"
] | permissive | physikerwelt/incubator-flink | a8398fa83b3f4a01a78725a6c5a1b68dcaa75754 | 122c9b023cc5f9fcd5cb4914bd90afde0b3c6fc0 | refs/heads/master | 2023-01-07T04:53:27.864952 | 2014-09-08T11:34:15 | 2014-09-08T14:17:47 | 23,807,100 | 0 | 0 | Apache-2.0 | 2023-01-02T21:57:09 | 2014-09-08T20:30:09 | null | UTF-8 | Java | false | false | 1,872 | java | /**
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.apache.flink.streaming.util.serialization;
import java.io.IOException;
import org.apache.flink.api.common.functions.Function;
import org.apache.flink.api.java.typeutils.TypeExtractor;
public class FunctionTypeWrapper<T> extends TypeSerializerWrapper<T> {
private static final long serialVersionUID = 1L;
private Function function;
private Class<? extends Function> functionSuperClass;
private int typeParameterNumber;
public FunctionTypeWrapper(Function function, Class<? extends Function> functionSuperClass,
int typeParameterNumber) {
this.function = function;
this.functionSuperClass = functionSuperClass;
this.typeParameterNumber = typeParameterNumber;
setTypeInfo();
}
private void readObject(java.io.ObjectInputStream in) throws IOException,
ClassNotFoundException {
in.defaultReadObject();
setTypeInfo();
}
@Override
protected void setTypeInfo() {
if (typeParameterNumber != -1) {
typeInfo = TypeExtractor.createTypeInfo(functionSuperClass, function.getClass(),
typeParameterNumber, null, null);
}
}
}
| [
"sewen@apache.org"
] | sewen@apache.org |
46ddc0c2321dede5f1ea7260ecf1f8d4a092ef34 | 3002d3954d2a05c5ee360831dc4a4d8cd62e76fa | /vxms-testing/src/test/java/org/jacpfx/kuberenetes/ResolveServicesByLAbelsWithPortNameOfflineTest.java | 256100b72cba731cea82f2bc4300b8f2904e17e3 | [
"Apache-2.0"
] | permissive | hyowong/vxms | 1f2fa0e3cf362142ef5d69a8b2ec636ebbea6858 | e13d17b86636b35f7f47e1366dfc3c0506a3d60d | refs/heads/master | 2020-07-27T00:28:29.644251 | 2018-10-31T21:00:01 | 2018-10-31T21:00:01 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 5,936 | java | /*
* Copyright [2017] [Andy Moncsek]
*
* 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.jacpfx.kuberenetes;
import io.fabric8.annotations.PortName;
import io.fabric8.annotations.ServiceName;
import io.fabric8.kubernetes.client.Config;
import io.fabric8.kubernetes.client.ConfigBuilder;
import io.fabric8.kubernetes.client.server.mock.KubernetesMockServer;
import io.vertx.core.DeploymentOptions;
import io.vertx.core.http.HttpClient;
import io.vertx.core.http.HttpClientOptions;
import io.vertx.core.http.HttpClientRequest;
import io.vertx.core.json.JsonObject;
import io.vertx.test.core.VertxTestBase;
import java.io.File;
import java.util.concurrent.CountDownLatch;
import java.util.concurrent.atomic.AtomicBoolean;
import javax.ws.rs.GET;
import javax.ws.rs.Path;
import org.jacpfx.vxms.common.ServiceEndpoint;
import org.jacpfx.vxms.k8s.annotation.K8SDiscovery;
import org.jacpfx.vxms.k8s.client.VxmsDiscoveryK8SImpl;
import org.jacpfx.vxms.rest.response.RestHandler;
import org.jacpfx.vxms.services.VxmsEndpoint;
import org.junit.Before;
import org.junit.Test;
public class ResolveServicesByLAbelsWithPortNameOfflineTest extends VertxTestBase {
public static final String SERVICE_REST_GET = "/wsService";
public static final int PORT = 9998;
private static final String HOST = "127.0.0.1";
public KubernetesMockServer server;
public Config config;
private HttpClient httpClient;
// public DefaultKubernetesClient client;
public void initKubernetes() {
ClassLoader classLoader = getClass().getClassLoader();
File ca = new File(classLoader.getResource("ca.crt").getFile());
File clientcert = new File(classLoader.getResource("client.crt").getFile());
File clientkey = new File(classLoader.getResource("client.key").getFile());
System.out.println("port: " + 0 + " host:" + 0);
config =
new ConfigBuilder()
.withMasterUrl(0 + ":" + 0)
.withNamespace(null)
.withCaCertFile(ca.getAbsolutePath())
.withClientCertFile(clientcert.getAbsolutePath())
.withClientKeyFile(clientkey.getAbsolutePath())
.build();
}
@Before
public void startVerticles() throws InterruptedException {
initKubernetes();
CountDownLatch latch2 = new CountDownLatch(1);
JsonObject conf = new JsonObject();
conf.put("service1.name", "myTestService").put("service1.port", "mytcp");
conf.put("service2.name", "myTestService2");
conf.put("kube.offline", true);
conf.put("myTestService", "tcp://192.168.1.1");
conf.put("myTestService2", "http://192.168.1.2:9080");
conf.put("mytcp", "9090");
DeploymentOptions options = new DeploymentOptions().setConfig(conf).setInstances(1);
vertx.deployVerticle(
new WsServiceOne(config),
options,
asyncResult -> {
// Deployment is asynchronous and this this handler will be called when it's complete
// (or failed)
System.out.println("start service: " + asyncResult.succeeded());
assertTrue(asyncResult.succeeded());
assertNotNull("deploymentID should not be null", asyncResult.result());
// If deployed correctly then start the tests!
// latch2.countDown();
latch2.countDown();
});
httpClient = vertx.createHttpClient(new HttpClientOptions());
awaitLatch(latch2);
}
@Test
public void testServiceByName() throws InterruptedException {
CountDownLatch latch = new CountDownLatch(1);
AtomicBoolean failed = new AtomicBoolean(false);
HttpClientOptions options = new HttpClientOptions();
options.setDefaultPort(PORT);
options.setDefaultHost(HOST);
HttpClient client = vertx.createHttpClient(options);
HttpClientRequest request =
client.get(
"/wsService/myTestService",
resp -> {
resp.bodyHandler(
body -> {
String response = body.toString();
System.out.println("Response entity '" + response + "' received.");
vertx.runOnContext(
context -> {
failed.set(
!response.equalsIgnoreCase(
"tcp://192.168.1.1:9090/http://192.168.1.2:9080"));
latch.countDown();
});
});
});
request.end();
latch.await();
assertTrue(!failed.get());
testComplete();
}
@ServiceEndpoint(name = SERVICE_REST_GET, contextRoot = SERVICE_REST_GET, port = PORT)
@K8SDiscovery
public class WsServiceOne extends VxmsEndpoint {
public Config config;
@ServiceName("${service1.name}")
@PortName("${service1.port}")
private String service1;
@ServiceName("${service2.name}")
private String service2;
public WsServiceOne(Config config) {
this.config = config;
}
public void postConstruct(final io.vertx.core.Future<Void> startFuture) {
new VxmsDiscoveryK8SImpl().initDiscovery(this, config);
startFuture.complete();
}
@Path("/myTestService")
@GET
public void rsstringGETResponse(RestHandler reply) {
System.out.println("stringResponse: " + reply);
reply
.response()
.stringResponse((future) -> future.complete(service1 + "/" + service2))
.execute();
}
}
}
| [
"amo.ahcp@gmail.com"
] | amo.ahcp@gmail.com |
5256c65c300bc2359a09a972b54cb4edea2dc8ab | a2df6764e9f4350e0d9184efadb6c92c40d40212 | /aliyun-java-sdk-arms/src/main/java/com/aliyuncs/arms/transform/v20190808/GetTraceResponseUnmarshaller.java | 89f8becfaa00530a5405dab848dc92b0275fb2db | [
"Apache-2.0"
] | permissive | warriorsZXX/aliyun-openapi-java-sdk | 567840c4bdd438d43be6bd21edde86585cd6274a | f8fd2b81a5f2cd46b1e31974ff6a7afed111a245 | refs/heads/master | 2022-12-06T15:45:20.418475 | 2020-08-20T08:37:31 | 2020-08-26T06:17:49 | 290,450,773 | 1 | 0 | NOASSERTION | 2020-08-26T09:15:48 | 2020-08-26T09:15:47 | null | UTF-8 | Java | false | false | 3,898 | java | /*
* 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.aliyuncs.arms.transform.v20190808;
import java.util.ArrayList;
import java.util.List;
import com.aliyuncs.arms.model.v20190808.GetTraceResponse;
import com.aliyuncs.arms.model.v20190808.GetTraceResponse.Span;
import com.aliyuncs.arms.model.v20190808.GetTraceResponse.Span.LogEvent;
import com.aliyuncs.arms.model.v20190808.GetTraceResponse.Span.LogEvent.TagEntry2;
import com.aliyuncs.arms.model.v20190808.GetTraceResponse.Span.TagEntry;
import com.aliyuncs.transform.UnmarshallerContext;
public class GetTraceResponseUnmarshaller {
public static GetTraceResponse unmarshall(GetTraceResponse getTraceResponse, UnmarshallerContext _ctx) {
getTraceResponse.setRequestId(_ctx.stringValue("GetTraceResponse.RequestId"));
List<Span> spans = new ArrayList<Span>();
for (int i = 0; i < _ctx.lengthValue("GetTraceResponse.Spans.Length"); i++) {
Span span = new Span();
span.setTraceID(_ctx.stringValue("GetTraceResponse.Spans["+ i +"].TraceID"));
span.setOperationName(_ctx.stringValue("GetTraceResponse.Spans["+ i +"].OperationName"));
span.setDuration(_ctx.longValue("GetTraceResponse.Spans["+ i +"].Duration"));
span.setServiceName(_ctx.stringValue("GetTraceResponse.Spans["+ i +"].ServiceName"));
span.setServiceIp(_ctx.stringValue("GetTraceResponse.Spans["+ i +"].ServiceIp"));
span.setTimestamp(_ctx.longValue("GetTraceResponse.Spans["+ i +"].Timestamp"));
span.setRpcId(_ctx.stringValue("GetTraceResponse.Spans["+ i +"].RpcId"));
span.setResultCode(_ctx.stringValue("GetTraceResponse.Spans["+ i +"].ResultCode"));
span.setHaveStack(_ctx.booleanValue("GetTraceResponse.Spans["+ i +"].HaveStack"));
span.setRpcType(_ctx.integerValue("GetTraceResponse.Spans["+ i +"].RpcType"));
List<TagEntry> tagEntryList = new ArrayList<TagEntry>();
for (int j = 0; j < _ctx.lengthValue("GetTraceResponse.Spans["+ i +"].TagEntryList.Length"); j++) {
TagEntry tagEntry = new TagEntry();
tagEntry.setKey(_ctx.stringValue("GetTraceResponse.Spans["+ i +"].TagEntryList["+ j +"].Key"));
tagEntry.setValue(_ctx.stringValue("GetTraceResponse.Spans["+ i +"].TagEntryList["+ j +"].Value"));
tagEntryList.add(tagEntry);
}
span.setTagEntryList(tagEntryList);
List<LogEvent> logEventList = new ArrayList<LogEvent>();
for (int j = 0; j < _ctx.lengthValue("GetTraceResponse.Spans["+ i +"].LogEventList.Length"); j++) {
LogEvent logEvent = new LogEvent();
logEvent.setTimestamp(_ctx.longValue("GetTraceResponse.Spans["+ i +"].LogEventList["+ j +"].Timestamp"));
List<TagEntry2> tagEntryList1 = new ArrayList<TagEntry2>();
for (int k = 0; k < _ctx.lengthValue("GetTraceResponse.Spans["+ i +"].LogEventList["+ j +"].TagEntryList.Length"); k++) {
TagEntry2 tagEntry2 = new TagEntry2();
tagEntry2.setKey(_ctx.stringValue("GetTraceResponse.Spans["+ i +"].LogEventList["+ j +"].TagEntryList["+ k +"].Key"));
tagEntry2.setValue(_ctx.stringValue("GetTraceResponse.Spans["+ i +"].LogEventList["+ j +"].TagEntryList["+ k +"].Value"));
tagEntryList1.add(tagEntry2);
}
logEvent.setTagEntryList1(tagEntryList1);
logEventList.add(logEvent);
}
span.setLogEventList(logEventList);
spans.add(span);
}
getTraceResponse.setSpans(spans);
return getTraceResponse;
}
} | [
"sdk-team@alibabacloud.com"
] | sdk-team@alibabacloud.com |
7b7b4121e1fb6ce9c84d091d5a0d2ed0c59ff4bf | 7291377a5a469f73579e946c1cd5e85ff76262f9 | /DeThiPTITLTM/De29ClientTCP/src/java/control/ClientControl.java | 15a0a0298b9431fb736f8e1b79f06695da4aca3c | [] | no_license | HrBbCi/Netbean | 487fb25b14c449fc88f34dd88ebd9f5768b0a5e5 | 1e3fdab1b43c0cb7e3f2e0b58d816a59b2f9a137 | refs/heads/master | 2020-07-11T20:42:04.057658 | 2019-08-27T06:55:35 | 2019-08-27T06:55:35 | 204,639,423 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,595 | java | /*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package control;
import java.io.IOException;
import java.io.ObjectInputStream;
import java.io.ObjectOutputStream;
import java.net.ServerSocket;
import java.net.Socket;
import java.util.logging.Level;
import java.util.logging.Logger;
import model.CoSo;
public class ClientControl {
private Socket client;
private int port = 7777;
private String serverHost = "localhost";
public ClientControl() {
}
public Socket openCon() {
try {
client = new Socket(serverHost, port);
} catch (IOException ex) {
System.out.println("Fail");
}
return client;
}
public boolean sendData(Object o) {
try {
ObjectOutputStream oos = new ObjectOutputStream(client.getOutputStream());
oos.writeObject(o);
} catch (IOException ex) {
}
return true;
}
public Object receiveData() {
String str = "";
try {
ObjectInputStream ois = new ObjectInputStream(client.getInputStream());
Object o = ois.readObject();
if (o instanceof String) {
str = (String) o;
}
} catch (IOException | ClassNotFoundException ex) {
}
return str;
}
public boolean closeCon() {
try {
client.close();
} catch (IOException ex) {
}
return true;
}
}
| [
"kienbtptit@gmail.com"
] | kienbtptit@gmail.com |
99aebb1045e25b737c6316ea13340bd7a73854e1 | 6b568c6f42c8909b30bb69e992c6527695c1fd15 | /dhis-2/dhis-api/src/main/java/org/hisp/dhis/indicator/comparator/IndicatorSortOrderComparator.java | 6465e1f0bdbf5ba3d31bada6193291e80ea027b0 | [
"BSD-3-Clause"
] | permissive | onaio/dhis2 | 7f156f2b015b7b3683527c044c9ec6fd52c9bc66 | 2b4da26297dd6b27fd75babc743cf6b3be14aec0 | refs/heads/master | 2020-04-28T15:09:21.763055 | 2013-12-20T17:13:46 | 2013-12-20T17:14:38 | 15,343,468 | 0 | 2 | null | null | null | null | UTF-8 | Java | false | false | 2,396 | java | package org.hisp.dhis.indicator.comparator;
/*
* Copyright (c) 2004-2013, University of Oslo
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
* Redistributions of source code must retain the above copyright notice, this
* list of conditions and the following disclaimer.
*
* Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
* Neither the name of the HISP project nor the names of its contributors may
* be used to endorse or promote products derived from this software without
* specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
* ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
import java.util.Comparator;
import org.hisp.dhis.indicator.Indicator;
/**
* @author Lars Helge Overland
* @version $Id$
*/
public class IndicatorSortOrderComparator
implements Comparator<Indicator>
{
public int compare( Indicator indicator0, Indicator indicator1 )
{
if ( indicator0.getSortOrder() == null || indicator0.getSortOrder() == 0 )
{
return indicator0.getName().compareTo( indicator1.getName() );
}
if ( indicator1.getSortOrder() == null || indicator1.getSortOrder() == 0 )
{
return indicator0.getName().compareTo( indicator1.getName() );
}
return indicator0.getSortOrder() - indicator1.getSortOrder();
}
}
| [
"peter@helioid.com"
] | peter@helioid.com |
e8ebb7b693c2d1ad61d5e2e85766aecdb527b7a0 | f7eb57cf3027c562764ba1242cebfcd2fb077130 | /cornea/src/main/java/arcus/cornea/controller/AlarmIncidentHistoryController.java | 33e75c4c1dfd5f1044588819128166f17ed8c0bf | [
"Apache-2.0"
] | permissive | arcus-smart-home/arcusandroid | e866ab720c7f023a8c6ed0f4bff782fb3d17a366 | 845b23b6ee913c58e009914e920242e29d0b137a | refs/heads/master | 2021-07-16T05:00:28.554875 | 2020-01-04T19:29:05 | 2020-01-05T05:45:36 | 168,191,380 | 30 | 29 | Apache-2.0 | 2020-06-14T18:27:29 | 2019-01-29T16:51:39 | Java | UTF-8 | Java | false | false | 1,549 | java | /*
* Copyright 2019 Arcus Project.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package arcus.cornea.controller;
import com.iris.client.ClientMessage;
import com.iris.client.IrisClientFactory;
import com.iris.client.event.Listener;
import com.iris.client.event.ListenerRegistration;
import com.iris.client.model.AlarmIncidentModel;
public class AlarmIncidentHistoryController {
public interface IncidentHistoryAddedListener {
void onHistoryAdded();
}
public static ListenerRegistration addIncidentHistoryAddedListener(final String address, final IncidentHistoryAddedListener listener) {
return IrisClientFactory.getClient().addMessageListener(new Listener<ClientMessage>() {
@Override
public void onEvent(ClientMessage event) {
if (address.equals(event.getSource()) && AlarmIncidentModel.HistoryAddedEvent.NAME.equals(event.getEvent().getType())) {
listener.onHistoryAdded();
}
}
});
}
}
| [
"b@yoyo.com"
] | b@yoyo.com |
4225f12ff6b44f5a50fbdae89c73868a9757d3a7 | dc1dbb7e5a4b95bf44170d2f51fd08b3814f2ac9 | /data_defect4j/preprossed_method_corpus/Chart/8/org/jfree/chart/renderer/LookupPaintScale_compareTo_94.java | c71707fe0b32f734fad4866167e1bf5eac50d7d4 | [] | 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 | 557 | java |
org jfree chart render
paint scale lookup tabl associ paint instanc
data rang
lookup paint scale lookuppaintscal
compar compareto object obj
paint item paintitem paint item paintitem obj
| [
"hvdthong@gmail.com"
] | hvdthong@gmail.com |
493c34103f80237411ccfd45e3c46c540f73b0f8 | c1a566424cbe162e99a761679185dcb76980002e | /src/main/java/com/bisket/api/service/MartialArtAcademyService.java | d8d65605d522d767e9e08cf612abbceed8f49a1c | [] | no_license | soohyeon317/bisket-api | b150d8a6ba6193eeb71606b34e399c5140ed1a56 | b882a9298aad1bf8801e6d7e64bdc7f81ab680cd | refs/heads/master | 2023-01-09T01:55:13.892140 | 2020-11-08T13:57:55 | 2020-11-08T13:57:55 | 306,935,955 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 724 | java | package com.bisket.api.service;
import com.bisket.api.repository.MartialArtAcademyRepository;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
@Service
@Transactional(readOnly = true)
@Slf4j
public class MartialArtAcademyService implements BusinessBaseService {
private final MartialArtAcademyRepository martialArtAcademyRepository;
public MartialArtAcademyService(MartialArtAcademyRepository martialArtAcademyRepository) {
this.martialArtAcademyRepository = martialArtAcademyRepository;
}
@Override
public Object getOne(Long id) {
return martialArtAcademyRepository.getOne(id);
}
}
| [
"tngus90!"
] | tngus90! |
71eb3a9ce3aa44f6a2fadaf5121c3c223162d78b | eacde2f67367fda8ebf11885e440ff178bfeb3ea | /app/src/main/java/com/msw/mesapp/activity/fragment/warehouse/FragmentProductOut1.java | 9e0aff32a776bd7efba678642d0cf42c976e3851 | [] | no_license | HNU-Microsoft-Douzi/MesApp | 6eee0f9952ae7ff23176a52fb2f325fe97162c59 | 31addba4606d214059829ace20153205a61c430e | refs/heads/master | 2020-03-21T20:23:52.558509 | 2018-06-27T07:35:21 | 2018-06-27T07:35:21 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 6,819 | java | package com.msw.mesapp.activity.fragment.warehouse;
import android.os.Bundle;
import android.support.annotation.Nullable;
import android.support.v4.app.Fragment;
import android.support.v7.widget.DefaultItemAnimator;
import android.support.v7.widget.DividerItemDecoration;
import android.support.v7.widget.LinearLayoutManager;
import android.support.v7.widget.RecyclerView;
import android.util.Log;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ImageView;
import com.miguelcatalan.materialsearchview.MaterialSearchView;
import com.msw.mesapp.R;
import com.msw.mesapp.activity.home.warehouse.MaterialOutActivityDetail1;
import com.msw.mesapp.activity.home.warehouse.ProductOutActivityDetail1;
import com.msw.mesapp.base.GlobalApi;
import com.msw.mesapp.utils.ActivityUtil;
import com.msw.mesapp.utils.ToastUtil;
import com.scwang.smartrefresh.layout.SmartRefreshLayout;
import com.scwang.smartrefresh.layout.api.RefreshLayout;
import com.scwang.smartrefresh.layout.footer.ClassicsFooter;
import com.scwang.smartrefresh.layout.listener.OnLoadmoreListener;
import com.scwang.smartrefresh.layout.listener.OnRefreshListener;
import com.zhouyou.http.EasyHttp;
import com.zhouyou.http.callback.SimpleCallBack;
import com.zhouyou.http.exception.ApiException;
import com.zhy.adapter.recyclerview.CommonAdapter;
import com.zhy.adapter.recyclerview.base.ViewHolder;
import org.json.JSONArray;
import org.json.JSONObject;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import butterknife.Bind;
import butterknife.ButterKnife;
/**
* Created by Mr.Meng on 2017/12/31.
* 成品待出库
*/
public class FragmentProductOut1 extends Fragment {
@Bind(R.id.search_view)
MaterialSearchView searchView;
@Bind(R.id.recyclerView)
RecyclerView recyclerView;
@Bind(R.id.classicsFooter)
ClassicsFooter classicsFooter;
@Bind(R.id.refreshLayout)
SmartRefreshLayout refreshLayout;
@Bind(R.id.imgsearch)
ImageView imgsearch;
private RecyclerView.Adapter adapter;
List<Map<String, Object>> list = new ArrayList<>();
int page = 0; //获取数据的第几页
int totalPages = 0; //总共几页
int totalElements = 0; //总共多少条数据
/**
* 目标项是否在最后一个可见项之后
*/
private boolean mShouldScroll;
/**
* 记录目标项位置
*/
private int mToPosition;
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
//引用创建好的xml布局
View view = inflater.inflate(R.layout.viewpaper_testchecking, container, false);
ButterKnife.bind(this, view);
initData();
initView();
return view;
}
@Override
public void onViewCreated(View view, @Nullable Bundle savedInstanceState) {
super.onViewCreated(view, savedInstanceState);
}
private void initData() {
list.clear();
EasyHttp.post(GlobalApi.WareHourse.ProductOut.getByOutStatusAndNumberLike)
.params(GlobalApi.WareHourse.outStatus, "0")
.params("number", "")
.sign(true)
.timeStamp(true)//本次请求是否携带时间戳
.execute(new SimpleCallBack<String>() {
@Override
public void onSuccess(String result) {
try {
JSONObject jsonObject = new JSONObject(result);
JSONArray data = jsonObject.optJSONArray("data");
for (int i = 0; i < data.length(); i++) {
JSONObject item = data.optJSONObject(i);
String code = item.optString("code");
String number = item.optString("number");
String createDate = item.optString("createDate");
Map map = new HashMap<>();
map.put("1", number); //出库单编号
map.put("2", createDate); //开单日期
map.put("3", code);
list.add(map);
}
adapter.notifyDataSetChanged();
} catch (Exception e) {
e.printStackTrace();
}
}
@Override
public void onError(ApiException e) {
ToastUtil.showToast(getActivity(), GlobalApi.ProgressDialog.INTERR, ToastUtil.Confusion);
}
});
}
private void initView() {
initRefreshLayout();
recyclerView.setLayoutManager(new LinearLayoutManager(getActivity()));//设置为listview的布局
recyclerView.setItemAnimator(new DefaultItemAnimator());//设置动画
recyclerView.addItemDecoration(new DividerItemDecoration(getActivity(), 0));//添加分割线
adapter = new CommonAdapter<Map<String, Object>>(getActivity(), R.layout.item_materialin, list) {
@Override
protected void convert(ViewHolder holder, final Map s, final int position) {
holder.setOnClickListener(R.id.item, new View.OnClickListener() {
@Override
public void onClick(View view) {
Map<String, Object> map = new HashMap<>();
map.put("code", s.get("3").toString());
ActivityUtil.switchTo(getActivity(), ProductOutActivityDetail1.class, map);
}
});
holder.setText(R.id.tv1, s.get("1").toString());
holder.setText(R.id.tv2, s.get("2").toString());
}
};
recyclerView.setAdapter(adapter);
}
/**
* 初始化滑动列表
*/
private void initRefreshLayout() {
refreshLayout.setOnRefreshListener(new OnRefreshListener() {
@Override
public void onRefresh(RefreshLayout refreshlayout) {
refreshlayout.finishRefresh(1500);
initData();
classicsFooter.setLoadmoreFinished(false);
}
});
refreshLayout.setOnLoadmoreListener(new OnLoadmoreListener() {
@Override
public void onLoadmore(RefreshLayout refreshlayout) {
refreshlayout.finishLoadmore(1000/*,false*/);//传入false表示加载失
}
});
}
@Override
public void onDestroyView() {
super.onDestroyView();
ButterKnife.unbind(this);
}
} | [
"2712220318@qq.com"
] | 2712220318@qq.com |
1f415119b035d2faa92415e64e3347d5710b0c50 | ed4e98d7e9db183f6dc8e1991c6808ebbd7d30f9 | /gchr-security-core/src/main/java/com/gchr/security/core/validate/code/ValidateCodeException.java | 2c1a7ed0308ddb0975796a1bc035b299f05bf27d | [] | no_license | gongchunru/security | b941f6c0a52527a1db92e392e61aa0925876b792 | e27f965635c468326e7ab7c8ea08c0247e268591 | refs/heads/master | 2021-08-22T13:45:56.778443 | 2017-11-30T10:23:37 | 2017-11-30T10:23:37 | 110,221,100 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 442 | java | package com.gchr.security.core.validate.code;
import org.springframework.security.core.AuthenticationException;
/**
* @author gongchunru
* Date:2017/11/18.
* Time:9:26
*/
public class ValidateCodeException extends AuthenticationException {
/**
*
*/
private static final long serialVersionUID = -7285211528095468156L;
public ValidateCodeException(String msg) {
super(msg);
}
}
| [
"gongchunru@163.com"
] | gongchunru@163.com |
eff63998cb23680fb2b730e9848331fc34a3c3f9 | 9f5fcbf93a1772b4efd5b57bd4735921408b50ad | /runtime/src/com/exedio/cope/ActivationParameters.java | 7546d0f37911e60e035890438589c3fb0512377e | [] | no_license | exedio/persistence | 0a99c5f5c6c4bf52e2976fddf533ef3857be5319 | 1e122e105f3ed3837b09828315525c708e754b95 | refs/heads/master | 2023-08-18T01:09:07.221399 | 2023-08-15T10:32:32 | 2023-08-15T10:32:32 | 32,997,177 | 8 | 2 | null | 2022-12-08T13:10:29 | 2015-03-27T16:31:03 | Java | UTF-8 | Java | false | false | 1,252 | java | /*
* Copyright (C) 2004-2015 exedio GmbH (www.exedio.com)
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
package com.exedio.cope;
/**
* A parameter class for activation constructors.
*
* @author Ralf Wiebicke
*/
public final class ActivationParameters
{
final Type<?> type;
final long pk;
ActivationParameters(final Type<?> type, final long pk)
{
this.type = type;
this.pk = pk;
}
/**
* This method is equivalent to {@link Item#toString()}.
*/
@Override
public String toString()
{
return type.id + Item.ID_SEPARATOR + pk;
}
}
| [
"ralf.wiebicke@exedio.com"
] | ralf.wiebicke@exedio.com |
5f16f85c9684275d857f8a87b08136c70e6c9b64 | 7016cec54fb7140fd93ed805514b74201f721ccd | /src/java/com/echothree/model/control/tag/common/transfer/TagScopeTransfer.java | bcaa6d85e95c503b274db0c014be30c997634556 | [
"MIT",
"Apache-1.1",
"Apache-2.0"
] | permissive | echothreellc/echothree | 62fa6e88ef6449406d3035de7642ed92ffb2831b | bfe6152b1a40075ec65af0880dda135350a50eaf | refs/heads/master | 2023-09-01T08:58:01.429249 | 2023-08-21T11:44:08 | 2023-08-21T11:44:08 | 154,900,256 | 5 | 1 | null | null | null | null | UTF-8 | Java | false | false | 2,724 | java | // --------------------------------------------------------------------------------
// Copyright 2002-2023 Echo Three, LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
// --------------------------------------------------------------------------------
package com.echothree.model.control.tag.common.transfer;
import com.echothree.util.common.transfer.CopyableTransfer;
import com.echothree.util.common.transfer.BaseTransfer;
import com.echothree.util.common.transfer.ListWrapper;
public class TagScopeTransfer
extends BaseTransfer
implements CopyableTransfer<TagScopeTransfer> {
private String tagScopeName;
private Boolean isDefault;
private Integer sortOrder;
private String description;
private ListWrapper<TagTransfer> tags;
/** Creates a new instance of TagScopeTransfer */
public TagScopeTransfer(String tagScopeName, Boolean isDefault, Integer sortOrder, String description) {
this.tagScopeName = tagScopeName;
this.isDefault = isDefault;
this.sortOrder = sortOrder;
this.description = description;
}
public String getTagScopeName() {
return tagScopeName;
}
public void setTagScopeName(String tagScopeName) {
this.tagScopeName = tagScopeName;
}
public Boolean getIsDefault() {
return isDefault;
}
public void setIsDefault(Boolean isDefault) {
this.isDefault = isDefault;
}
public Integer getSortOrder() {
return sortOrder;
}
public void setSortOrder(Integer sortOrder) {
this.sortOrder = sortOrder;
}
public String getDescription() {
return description;
}
public void setDescription(String description) {
this.description = description;
}
public ListWrapper<TagTransfer> getTags() {
return tags;
}
public void setTags(ListWrapper<TagTransfer> tags) {
this.tags = tags;
}
@Override
public TagScopeTransfer copy() {
TagScopeTransfer tagScope = new TagScopeTransfer(tagScopeName, isDefault, sortOrder, description);
tagScope.setTags(tags);
return tagScope;
}
}
| [
"rich@echothree.com"
] | rich@echothree.com |
de602fbfd20d453303bffcca13b756e444f38ba5 | 2f1a9177b5816e80dbbb897fb909606a8f77c3eb | /DOTS/com.ibm.dots/src/com/ibm/dots/tasklet/events/IDotsEventParam.java | 65bf76fac374cdf4464cdabfa04500e65e0f1deb | [] | no_license | residori/xspstarterkit | 76caa60ecc3cd7780a3cff2433e671c0f84354d5 | 7d6fcce101edd35a5fe3c6df99c894f9570023a1 | refs/heads/master | 2020-12-26T09:50:59.653003 | 2014-06-16T19:47:34 | 2014-06-16T19:47:34 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 159 | java | /**
*
*/
package com.ibm.dots.tasklet.events;
/**
* @author nfreeman
*
*/
public interface IDotsEventParam {
public Class<?> getType();
}
| [
"nathan.freeman@redpilldevelopment.com"
] | nathan.freeman@redpilldevelopment.com |
7e934e1661405b2ad223e567ae4c4af4b662c2e7 | 679fee84558e55b5521bf48abbf2047d4996f745 | /study/src/main/java/com/study/day24/Ball.java | 69c807562305f229dd95169eb6f6078f61e55b9c | [] | no_license | vincenttuan/Java20210726 | aa540f23cac85af7c681469e7bee838dbc6a2f4e | 62539b5cb351604eff671c28508a1cdeba213a61 | refs/heads/master | 2023-07-09T04:11:46.284334 | 2021-08-12T04:04:06 | 2021-08-12T04:04:06 | 389,519,486 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 843 | java | package com.study.day24;
public class Ball { // data class
private String color;
private int price;
public Ball() {
}
public Ball(String color, int price) {
this.color = color;
this.price = price;
}
public String getColor() {
return color;
}
public void setColor(String color) {
this.color = color;
}
public int getPrice() {
return price;
}
public void setPrice(int price) {
this.price = price;
}
@Override
public boolean equals(Object obj) {
// 顏色與價格一樣視為相同
Ball b2 = (Ball)obj;
if(price == b2.price && color.equals(b2.color)) {
return true;
} else {
return false;
}
}
@Override
public int hashCode() {
return 7 * 11 * price + color.hashCode();
}
@Override
public String toString() {
return "Ball [color=" + color + ", price=" + price + "]";
}
}
| [
"vincentjava@yahoo.com.tw"
] | vincentjava@yahoo.com.tw |
7bd6dff53ed7bb33b9a7decf3f0e27a74c9b2e68 | ee1aad57dec5c6017659a9f77d13a4cf99e8e238 | /app/src/main/java/fitness_equipment/test/com/fitness_equipment/JarPhoto/TestPicActivity.java | 275c5d32597e6ec75026a95815d640e75231ac89 | [] | no_license | WangZhouA/jianshenqicai | b7649e79c6b4ed163c18b6506fe3f4bd7c6b6797 | 95bdddca5a5671a1faef0b73ebc4a334105fd046 | refs/heads/master | 2020-03-30T19:27:46.690477 | 2018-10-04T08:57:03 | 2018-10-04T08:57:03 | 151,544,014 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,053 | java | package fitness_equipment.test.com.fitness_equipment.JarPhoto;
import android.app.Activity;
import android.content.Intent;
import android.graphics.Bitmap;
import android.graphics.BitmapFactory;
import android.os.Bundle;
import android.view.View;
import android.widget.AdapterView;
import android.widget.AdapterView.OnItemClickListener;
import android.widget.GridView;
import android.widget.TextView;
import java.io.Serializable;
import java.util.List;
import fitness_equipment.test.com.fitness_equipment.R;
public class TestPicActivity extends Activity {
// ArrayList<Entity> dataList;//用来装载数据源的列表
List<ImageBucket> dataList;
GridView gridView;
ImageBucketAdapter adapter;// 自定义的适配器
AlbumHelper helper;
public static final String EXTRA_IMAGE_LIST = "imagelist";
public static Bitmap bimap;
private TextView quXiao;
@Override
protected void onCreate(Bundle savedInstanceState) {
// TODO Auto-generated method stub
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_image_bucket);
helper = AlbumHelper.getHelper();
helper.init(getApplicationContext());
initData();
initView();
}
/**
* 初始化数据
*/
private void initData() {
// /**
// * 这里,我们假设已经从网络或者本地解析好了数据,所以直接在这里模拟了10个实体类,直接装进列表中
// */
// dataList = new ArrayList<Entity>();
// for(int i=-0;i<10;i++){
// Entity entity = new Entity(R.drawable.picture, false);
// dataList.add(entity);
// }
dataList = helper.getImagesBucketList(false);
bimap=BitmapFactory.decodeResource(
getResources(),
R.mipmap.add_images);
}
/**
* 初始化view视图
*/
private void initView() {
quXiao= (TextView) findViewById(R.id.quXiao);
quXiao.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
finish();
}
});
gridView = (GridView) findViewById(R.id.gridview);
adapter = new ImageBucketAdapter(TestPicActivity.this, dataList);
gridView.setAdapter(adapter);
gridView.setOnItemClickListener(new OnItemClickListener() {
@Override
public void onItemClick(AdapterView<?> parent, View view,
int position, long id) {
/**
* 根据position参数,可以获得跟GridView的子View相绑定的实体类,然后根据它的isSelected状态,
* 来判断是否显示选中效果。 至于选中效果的规则,下面适配器的代码中会有说明
*/
// if(dataList.get(position).isSelected()){
// dataList.get(position).setSelected(false);
// }else{
// dataList.get(position).setSelected(true);
// }
/**
* 通知适配器,绑定的数据发生了改变,应当刷新视图
*/
// adapter.notifyDataSetChanged();
Intent intent = new Intent(TestPicActivity.this,
ImageGridActivity.class);
intent.putExtra(TestPicActivity.EXTRA_IMAGE_LIST,
(Serializable) dataList.get(position).imageList);
startActivity(intent);
finish();
}
});
}
}
| [
"514077686@qq.com"
] | 514077686@qq.com |
533f8617cfa8591ef8b4ea01275a29ad64d96902 | 61439caa59f8eb505275b9ce17ceb2b1e2093863 | /app/src/main/java/myteam/com/model/Lesson.java | 7c08146fc4b543a3cff669f69cf8bb53c76c7ee5 | [] | no_license | popmusicfan1992/AppKhoaHocHoanChinh | e58a3453eb7ebec5c5b15eda4bd4e1271a305459 | da2aaa27815062646f9a7009e44acb2b1490f9a7 | refs/heads/master | 2023-06-16T07:09:25.858598 | 2021-07-09T21:02:15 | 2021-07-09T21:02:15 | 384,548,960 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,228 | java | package myteam.com.model;
public class Lesson {
private String duration;
private String title;
private String decription;
private String turorial;
private String videoId;
public Lesson(String title, String decription, String turorial, String videoId, String duration) {
this.title = title;
this.decription = decription;
this.turorial = turorial;
this.videoId = videoId;
this.duration = duration;
}
public String getTitle() {
return title;
}
public void setTitle(String title) {
this.title = title;
}
public String getDecription() {
return decription;
}
public void setDecription(String decription) {
this.decription = decription;
}
public String getTurorial() {
return turorial;
}
public void setTurorial(String turorial) {
this.turorial = turorial;
}
public String getVideoId() {
return videoId;
}
public void setVideoId(String videoId) {
this.videoId = videoId;
}
public String getDuration() {
return duration;
}
public void setDuration(String duration) {
this.duration = duration;
}
}
| [
"="
] | = |
8d72a921ca4bf4eee6935cb1370602df05ff60e7 | 297620e2dd570107c6257c8c091fb3644207963d | /customheartshaped/src/main/java/com/hgz/test/customheartshaped/MainActivity.java | b3806c731b74b9f10129ea16dc9b9b7a9d5cc2d0 | [] | no_license | AHGZ/CustomView | 717956b3049ac0be63299d9d381b7e6c131e4d9b | ce020a75eaaa3248b0b8275b21f384b85c27c901 | refs/heads/master | 2021-01-20T23:09:37.679205 | 2017-10-19T12:22:29 | 2017-10-19T12:22:29 | 101,842,952 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 715 | java | package com.hgz.test.customheartshaped;
import android.graphics.Bitmap;
import android.graphics.BitmapFactory;
import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import com.hgz.test.customheartshaped.custom.CustomHeartShaped;
public class MainActivity extends AppCompatActivity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
CustomHeartShaped customHeartShaped = (CustomHeartShaped) findViewById(R.id.customHeartShaped);
Bitmap bitmap = BitmapFactory.decodeResource(getResources(), R.drawable.aaa);
customHeartShaped.setBitmap(bitmap);
}
}
| [
"18911005030@163.com"
] | 18911005030@163.com |
1b685f7aa5c24664db5ce0ca75baaf37358cfd0c | fa91450deb625cda070e82d5c31770be5ca1dec6 | /Diff-Raw-Data/19/19_8e34ceae8c1caec0e1762fc62ef321ab096a83ae/InvalidAcksBase/19_8e34ceae8c1caec0e1762fc62ef321ab096a83ae_InvalidAcksBase_s.java | 76b1aec2b3a11ecd2844435ef6f15b9917cbb0bd | [] | no_license | zhongxingyu/Seer | 48e7e5197624d7afa94d23f849f8ea2075bcaec0 | c11a3109fdfca9be337e509ecb2c085b60076213 | refs/heads/master | 2023-07-06T12:48:55.516692 | 2023-06-22T07:55:56 | 2023-06-22T07:55:56 | 259,613,157 | 6 | 2 | null | 2023-06-22T07:55:57 | 2020-04-28T11:07:49 | null | UTF-8 | Java | false | false | 1,222 | java | package com.rabbitmq.client.test.functional;
import com.rabbitmq.client.AMQP;
import com.rabbitmq.client.test.BrokerTestCase;
import java.io.IOException;
/**
* See bug 21846:
* Basic.Ack is now required to signal a channel error immediately upon
* detecting an invalid deliveryTag, even if the channel is (Tx-)transacted.
*
* Specifically, a client MUST not acknowledge the same message more than once.
*/
public abstract class InvalidAcksBase extends BrokerTestCase {
protected abstract void select() throws IOException;
protected abstract void commit() throws IOException;
public void testDoubleAck()
throws IOException
{
select();
String q = channel.queueDeclare().getQueue();
basicPublishVolatile(q);
commit();
long tag = channel.basicGet(q, false).getEnvelope().getDeliveryTag();
channel.basicAck(tag, false);
channel.basicAck(tag, false);
expectChannelError(AMQP.PRECONDITION_FAILED);
}
public void testCrazyAck()
throws IOException
{
select();
channel.basicAck(123456, false);
expectChannelError(AMQP.PRECONDITION_FAILED);
}
}
| [
"yuzhongxing88@gmail.com"
] | yuzhongxing88@gmail.com |
d25e27217d37ecf6c7c761fc5331b85a46703b07 | e3e02faa6a14152da28f8ad34f52c39ed3e08783 | /src/main/java/org/jenkinsci/plugins/p4/workspace/Workspace.java | 21f250c52fc9a078cccb5003e3ea58d417d78829 | [
"BSD-2-Clause"
] | permissive | Ajrew/p4-plugin | 3c699f4144420051839fc837dfd3bede479159a5 | fd7d5bd3a829ac378821a444e2848230667ed7ed | refs/heads/master | 2021-01-20T09:03:24.829072 | 2017-02-01T09:48:27 | 2017-02-01T09:48:27 | 68,470,679 | 0 | 0 | null | 2016-09-17T18:27:11 | 2016-09-17T18:27:11 | null | UTF-8 | Java | false | false | 2,924 | java | package org.jenkinsci.plugins.p4.workspace;
import com.perforce.p4java.client.IClient;
import com.perforce.p4java.server.IOptionsServer;
import hudson.DescriptorExtensionList;
import hudson.ExtensionPoint;
import hudson.model.Describable;
import jenkins.model.Jenkins;
import java.io.Serializable;
import java.util.Map;
public abstract class Workspace implements Cloneable, ExtensionPoint, Describable<Workspace>, Serializable {
private static final long serialVersionUID = 1L;
private String charset;
private boolean pinHost;
private String rootPath;
private String hostname;
private Expand expand;
public Workspace(String charset, boolean pinHost) {
this.charset = charset;
this.pinHost = pinHost;
}
public abstract WorkspaceType getType();
/**
* Returns the client workspace name as defined in the configuration. This
* may include ${tag} that have not been expanded.
*
* @return Client name
*/
public abstract String getName();
public String getCharset() {
return charset;
}
public boolean isPinHost() {
return pinHost;
}
/**
* Setup/Create a Perforce workspace for this mode.
*
* @param connection Server connection
* @param user Perforce user
* @return Perforce client
* @throws Exception push up stack
*/
public abstract IClient setClient(IOptionsServer connection, String user) throws Exception;
public WorkspaceDescriptor getDescriptor() {
Jenkins j = Jenkins.getInstance();
if (j != null) {
return (WorkspaceDescriptor) j.getDescriptor(getClass());
}
return null;
}
public static DescriptorExtensionList<Workspace, WorkspaceDescriptor> all() {
Jenkins j = Jenkins.getInstance();
if (j != null) {
return j.<Workspace, WorkspaceDescriptor>getDescriptorList(Workspace.class);
}
return null;
}
public String getRootPath() {
return rootPath;
}
public void setHostName(String hostname) {
this.hostname = hostname;
}
public String getHostName() {
return hostname;
}
public void setRootPath(String rootPath) {
this.rootPath = rootPath;
}
public void setExpand(Map<String, String> map) {
expand = new Expand(map);
}
public Expand getExpand() {
return expand;
}
/**
* Returns the fully expanded client workspace name.
*
* @return Client name
*/
public String getFullName() {
// expands Workspace name if formatters are used.
String clientName = expand.format(getName(), false);
// replace restricted characters with "-" as per the old plugin
clientName = clientName.replaceAll(" ", "_");
clientName = clientName.replaceAll(",", "-");
clientName = clientName.replaceAll("=", "-");
clientName = clientName.replaceAll("/", "-");
// store full name in expand options for use in view
expand.set("P4_CLIENT", clientName);
return clientName;
}
public Object clone() {
try {
return super.clone();
} catch (CloneNotSupportedException e) {
return null;
}
}
}
| [
"pallen@perforce.com"
] | pallen@perforce.com |
83221325bb000dfb35d068ac5ffa6c770e11be94 | be73270af6be0a811bca4f1710dc6a038e4a8fd2 | /crash-reproduction-moho/results/XRENDERING-418-19-30-PESA_II-WeightedSum:TestLen:CallDiversity/org/xwiki/rendering/internal/parser/xhtml/wikimodel/XWikiCommentHandler_ESTest.java | 698145389ef00c3687b12e1932cfb501badf42aa | [] | no_license | STAMP-project/Botsing-multi-objectivization-using-helper-objectives-application | cf118b23ecb87a8bf59643e42f7556b521d1f754 | 3bb39683f9c343b8ec94890a00b8f260d158dfe3 | refs/heads/master | 2022-07-29T14:44:00.774547 | 2020-08-10T15:14:49 | 2020-08-10T15:14:49 | 285,804,495 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 596 | java | /*
* This file was automatically generated by EvoSuite
* Fri Apr 03 03:32:54 UTC 2020
*/
package org.xwiki.rendering.internal.parser.xhtml.wikimodel;
import org.junit.Test;
import static org.junit.Assert.*;
import org.evosuite.runtime.EvoRunner;
import org.evosuite.runtime.EvoRunnerParameters;
import org.junit.runner.RunWith;
@RunWith(EvoRunner.class) @EvoRunnerParameters(useVFS = true, useJEE = true)
public class XWikiCommentHandler_ESTest extends XWikiCommentHandler_ESTest_scaffolding {
@Test
public void notGeneratedAnyTest() {
// EvoSuite did not generate any tests
}
}
| [
"pouria.derakhshanfar@gmail.com"
] | pouria.derakhshanfar@gmail.com |
284a12482c94f85c465839a51f8515f00b8c2c4d | 7c56958f066b0eb89aa8651016b2fe84c6b4e81a | /core/metamodel/src/main/java/org/apache/isis/core/progmodel/facets/object/mask/MaskEvaluator.java | e2245d97c07e74208ad2f488723706233b38a47b | [
"Apache-2.0"
] | permissive | monolithic/isis | f12db939b0f4c4c59e9d24ea84c3d71a98103ea7 | 8b6cab67d440cbff244367abc8b4f5fabff26627 | refs/heads/master | 2020-12-24T15:22:56.589033 | 2014-07-04T14:52:28 | 2014-07-04T14:52:28 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,327 | java | /*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
package org.apache.isis.core.progmodel.facets.object.mask;
import java.util.ArrayList;
import java.util.List;
import java.util.regex.Pattern;
public class MaskEvaluator {
interface Converter {
void convert(String str, StringBuilder buf);
}
static class RegExConverter implements Converter {
private final String mask;
private final String regex;
public RegExConverter(final String mask, final String regex) {
this.mask = mask;
this.regex = regex;
}
public String getMask() {
return mask;
}
public String getRegex() {
return regex;
}
@Override
public void convert(final String str, final StringBuilder buf) {
final String convert = str.replace(mask, regex);
if (!convert.equals(str)) {
buf.append(convert);
}
}
}
@SuppressWarnings("serial")
private static List<Converter> converters = new ArrayList<Converter>() {
{
add("#", "[0-9]");
// add(".", "[\\" +
// DecimalFormatSymbols.getInstance().getDecimalSeparator()+"]");
// add(",",
// "["+DecimalFormatSymbols.getInstance().getGroupingSeparator()+"]");
add("&", "[A-Za-z]");
add("?", "[A-Za-z]");
add("A", "[A-Za-z0-9]");
add("a", "[ A-Za-z0-9]");
add("9", "[ 0-9]");
add("U", "[A-Z]");
add("L", "[a-z]");
add(new Converter() {
@Override
public void convert(final String str, final StringBuilder buf) {
if (buf.length() == 0) {
buf.append(str);
}
}
});
}
public void add(final String mask, final String regex) {
add(new RegExConverter(mask, regex));
}
};
private final Pattern pattern;
public MaskEvaluator(final String mask) {
final StringBuilder buf = new StringBuilder();
for (int i = 0; i < mask.length(); i++) {
final String charAt = "" + mask.charAt(i);
for (final Converter converter : converters) {
converter.convert(charAt, buf);
}
}
pattern = Pattern.compile(buf.toString());
}
public boolean evaluate(final String str) {
return pattern.matcher(str).matches();
}
}
| [
"danhaywood@apache.org"
] | danhaywood@apache.org |
6acc2cf139ecdf5339634e98ee8667396fe69864 | 574afb819e32be88d299835d42c067d923f177b0 | /src/net/minecraft/world/gen/feature/WorldGenFire.java | b68e6eb63aea7d230a87407f4ca7aaec50f1f2e4 | [] | no_license | SleepyKolosLolya/WintWare-Before-Zamorozka | 7a474afff4d72be355e7a46a38eb32376c79ee76 | 43bff58176ec7422e826eeaf3ab8e868a0552c56 | refs/heads/master | 2022-07-30T04:20:18.063917 | 2021-04-25T18:16:01 | 2021-04-25T18:16:01 | 361,502,972 | 6 | 0 | null | null | null | null | UTF-8 | Java | false | false | 732 | java | package net.minecraft.world.gen.feature;
import java.util.Random;
import net.minecraft.init.Blocks;
import net.minecraft.util.math.BlockPos;
import net.minecraft.world.World;
public class WorldGenFire extends WorldGenerator {
public boolean generate(World worldIn, Random rand, BlockPos position) {
for(int i = 0; i < 64; ++i) {
BlockPos blockpos = position.add(rand.nextInt(8) - rand.nextInt(8), rand.nextInt(4) - rand.nextInt(4), rand.nextInt(8) - rand.nextInt(8));
if (worldIn.isAirBlock(blockpos) && worldIn.getBlockState(blockpos.down()).getBlock() == Blocks.NETHERRACK) {
worldIn.setBlockState(blockpos, Blocks.FIRE.getDefaultState(), 2);
}
}
return true;
}
}
| [
"ask.neverhide@gmail.com"
] | ask.neverhide@gmail.com |
21c9fbfa505c430fc141a6bbc46ff5ae9fe7ee65 | 0529524c95045b3232f6553d18a7fef5a059545e | /app/src/androidTest/java/TestCase_608924B6393224547B305940BB04163D06411A8F8E12BBC0CCD9F084906135A6__657979951.java | 95b138817cd60030a34cd1219fd20b92c08aa49e | [] | no_license | sunxiaobiu/BasicUnitAndroidTest | 432aa3e10f6a1ef5d674f269db50e2f1faad2096 | fed24f163d21408ef88588b8eaf7ce60d1809931 | refs/heads/main | 2023-02-11T21:02:03.784493 | 2021-01-03T10:07:07 | 2021-01-03T10:07:07 | 322,577,379 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 858 | java | import android.app.Activity;
import androidx.test.rule.ActivityTestRule;
import androidx.test.runner.AndroidJUnit4;
import com.example.android.testing.unittesting.basicunitandroidtest.MyActivity;
import org.junit.Rule;
import org.junit.Test;
import org.junit.runner.RunWith;
@RunWith(AndroidJUnit4.class)
public class TestCase_608924B6393224547B305940BB04163D06411A8F8E12BBC0CCD9F084906135A6__657979951 {
@Rule
public ActivityTestRule mActivityRule;
@Test
public void testCase() throws Exception {
ActivityTestRule var1 = this.mActivityRule;
Activity var2 = var1.getActivity();
var2.setContentView(2131492921);
}
public TestCase_608924B6393224547B305940BB04163D06411A8F8E12BBC0CCD9F084906135A6__657979951() {
ActivityTestRule var1 = new ActivityTestRule(MyActivity.class);
this.mActivityRule = var1;
}
}
| [
"sunxiaobiu@gmail.com"
] | sunxiaobiu@gmail.com |
a076df53c09ce15f3ef15e3b24af9f785c64a161 | bfe4cc4bb945ab7040652495fbf1e397ae1b72f7 | /providers/bluelock-vcloud-vcenterprise/src/test/java/org/jclouds/bluelock/vcloud/vcenterprise/compute/BluelockVCloudEnterpriseComputeServiceLiveTest.java | 6fed45edb3cbb694f55e8ca6bae8f3cf5c994056 | [
"Apache-2.0"
] | permissive | dllllb/jclouds | 348d8bebb347a95aa4c1325590c299be69804c7d | fec28774da709e2189ba563fc3e845741acea497 | refs/heads/master | 2020-12-25T11:42:31.362453 | 2011-07-30T22:32:07 | 2011-07-30T22:32:07 | 1,571,863 | 2 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,282 | java | /**
*
* Copyright (C) 2011 Cloud Conscious, LLC. <info@cloudconscious.com>
*
* ====================================================================
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* ====================================================================
*/
package org.jclouds.bluelock.vcloud.vcenterprise.compute;
import static org.jclouds.compute.util.ComputeServiceUtils.getCores;
import static org.testng.Assert.assertEquals;
import org.jclouds.compute.domain.ExecResponse;
import org.jclouds.compute.domain.Image;
import org.jclouds.compute.domain.NodeMetadata;
import org.jclouds.compute.domain.OsFamily;
import org.jclouds.compute.domain.Template;
import org.jclouds.compute.domain.TemplateBuilder;
import org.jclouds.compute.predicates.OperatingSystemPredicates;
import org.jclouds.vcloud.compute.VCloudComputeServiceLiveTest;
import org.testng.annotations.Test;
/**
*
*
* @author Adrian Cole
*/
@Test(groups = "live", enabled = true, singleThreaded = true, testName = "BluelockVCloudEnterpriseComputeServiceLiveTest")
public class BluelockVCloudEnterpriseComputeServiceLiveTest extends VCloudComputeServiceLiveTest {
public BluelockVCloudEnterpriseComputeServiceLiveTest() {
provider = "bluelock-vcloud-vcenterprise";
// vcloud requires instantiate before deploy, which takes longer than 30 seconds
nonBlockDurationSeconds = 300;
}
@Override
public void setServiceDefaults() {
group = "director";
}
@Test
public void testTemplateBuilder() {
Template defaultTemplate = client.templateBuilder().build();
assertEquals(defaultTemplate.getImage().getOperatingSystem().is64Bit(), true);
assert OperatingSystemPredicates.supportsApt().apply(defaultTemplate.getImage().getOperatingSystem());
assertEquals(defaultTemplate.getImage().getOperatingSystem().getFamily(), OsFamily.UBUNTU);
assertEquals(defaultTemplate.getImage().getOperatingSystem().getDescription(), "Ubuntu Linux (64-bit)");
assert defaultTemplate.getLocation().getId() != null : defaultTemplate.getLocation();
assertEquals(getCores(defaultTemplate.getHardware()), 1.0d);
System.out.println(defaultTemplate.getHardware());
}
@Override
protected Template buildTemplate(TemplateBuilder templateBuilder) {
Template template = super.buildTemplate(templateBuilder);
Image image = template.getImage();
assert image.getDefaultCredentials().credential != null : image;
return template;
}
protected void checkResponseEqualsHostname(ExecResponse execResponse, NodeMetadata node1) {
// hostname is not completely predictable based on node metadata
assert execResponse.getOutput().trim().equals("Ubuntu1004") : execResponse + ": " + node1;
}
}
| [
"adrian@jclouds.org"
] | adrian@jclouds.org |
d1222787870057b527954cbed8149e9679af7f3f | c1b386cc68d24650e75a2358ee0ead2fae0673cc | /airport/airport-web-ui/src/main/java/jhou/common/StandardMessages.java | eca28da7ddbd110dcc7b70fc9b51ff3c4f19b2e8 | [] | no_license | jhou-pro/tg-demo | e7fc1449df54819f09b8e5b4eaa8a42b1cff93b1 | 0cd7c029c86fd154f6194fb6055d768df7210b6b | refs/heads/develop | 2022-01-24T02:14:39.078684 | 2019-11-01T08:59:14 | 2019-11-01T08:59:14 | 215,961,638 | 0 | 0 | null | 2022-01-21T23:32:25 | 2019-10-18T07:04:22 | JavaScript | UTF-8 | Java | false | false | 564 | java | package jhou.common;
/**
* This is an enum representing a collection of standard application messages. It should be used in favor of string values anywhere in the application, and extended with new values
* where required.
*
* @author Generated
*
*/
public enum StandardMessages {
DELETE_CONFIRMATION("Please confirm whether the selected entities should be deleted?");
public final String msg;
private StandardMessages(final String msg) {
this.msg = msg;
}
@Override
public String toString() {
return msg;
}
}
| [
"jhou.pro@gmail.com"
] | jhou.pro@gmail.com |
e1c2a557047661f0d48865e22c02a29bd5b6dc50 | 30c783b4f3d71bd45d182bee2e482f3cd2878e52 | /jbgen/src/main/java/org/vpc/neormf/jbgen/java/types/JavaAbstractChoiceTypeGen.java | d0b188ecf2d70927bac7acc2b84b5dd696cfbaff | [] | no_license | thevpc/neormf | fd1f965f45f0ce5d2bdd760b568d66a8049bb8b0 | 12597b4501114bda607ad898988fbeca94780efe | refs/heads/master | 2021-07-10T13:17:59.614932 | 2020-08-22T12:12:58 | 2020-08-22T12:12:58 | 202,869,816 | 0 | 0 | null | 2020-10-13T15:24:22 | 2019-08-17T10:59:12 | HTML | UTF-8 | Java | false | false | 1,039 | java | package org.vpc.neormf.jbgen.java.types;
import org.vpc.neormf.commons.types.AbstractChoiceType;
import org.vpc.neormf.commons.types.DataType;
/**
* class presentation
*
* @author taha BEN SALAH (tbensalah)
* @version 1.0
* @copyrights (c) 2004, Vpc Open Source Foundary
* @project New Entreprise Object Relational Mapping Framework (neormf)
* @creation on Date: 1 avr. 2004 Time: 22:26:31
* @modification on ---- by -----
* @modification on ---- by -----
* @modification on ---- by -----
*/
public abstract class JavaAbstractChoiceTypeGen implements JavaDataTypeGen {
public String toCode(DataType type) {
AbstractChoiceType him=(AbstractChoiceType) type;
StringBuilder sb = new StringBuilder();
sb.append("new ").append(him.getClass().getName()).append("(").append(him.isNullable());
sb.append(",");
sb.append(JavaDataTypeGenManager.getDatatypeGenerator(him.getElementType().getClass()).toCode(him.getElementType()));
sb.append(")");
return sb.toString();
}
}
| [
"taha.bensalah@gmail.com"
] | taha.bensalah@gmail.com |
c003dfc55bf2e4d60edfcc5042d35771b893ed97 | c3384b209697f87310299431479f9e7d88f2dcde | /src/net/neferett/linaris/sheepwars/booster/RegenerationBooster.java | 81a1e7245d3eef0e88fe6d59d944d90b01b149c1 | [] | no_license | jordanbonaldi/Linaris-SheepWars | fd33d4e564c8badf9003aef8256ab0df0c9eb24d | 6d410483ec3ef2696a07606ccd00d08dbf7b9904 | refs/heads/master | 2020-04-13T03:08:42.460703 | 2018-12-23T20:52:04 | 2018-12-23T20:52:04 | 162,923,121 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 950 | java | package net.neferett.linaris.sheepwars.booster;
import org.bukkit.entity.Player;
import org.bukkit.event.Event;
import org.bukkit.potion.PotionEffect;
import org.bukkit.potion.PotionEffectType;
import net.neferett.linaris.sheepwars.handler.Booster;
import net.neferett.linaris.sheepwars.handler.Team;
import net.neferett.linaris.sheepwars.handler.Booster.BoosterAction;
import net.neferett.linaris.sheepwars.handler.Booster.TriggerAction;
public class RegenerationBooster implements BoosterAction {
@Override
public boolean onStart(final Player player, final Team team, final Booster booster) {
for (final Player teamPlayer : team.getOnlinePlayers()) {
teamPlayer.addPotionEffect(new PotionEffect(PotionEffectType.REGENERATION, 140, 1));
}
return true;
}
@Override
public boolean onEvent(final Player player, final Event event, final TriggerAction trigger) {
return false;
}
}
| [
"30388371+jordanbonaldi@users.noreply.github.com"
] | 30388371+jordanbonaldi@users.noreply.github.com |
8af580f09b9b6b3f3b2d421f7cbe943b0bb0cd85 | 460f7bb7cb72613752381c3d70d78984ac3afdec | /litho-intellij-plugin/src/main/java/com/facebook/litho/intellij/file/ComponentFinder.java | bc38a187d8bf7cbf19c704965803931028a5709b | [
"Apache-2.0"
] | permissive | 1322877721/litho | 18ac428a9ddda4b8810f2d9d3b973e549fc1c33f | f042ea6b5e667c1c6622a8f4d1f28326df64bde5 | refs/heads/master | 2022-11-14T03:06:57.115252 | 2020-07-08T21:35:49 | 2020-07-08T21:37:24 | 278,250,508 | 1 | 0 | Apache-2.0 | 2020-07-09T03:13:33 | 2020-07-09T03:13:32 | null | UTF-8 | Java | false | false | 2,845 | java | /*
* Copyright (c) Facebook, Inc. and 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 com.facebook.litho.intellij.file;
import com.facebook.litho.intellij.services.ComponentsCacheService;
import com.intellij.openapi.project.Project;
import com.intellij.openapi.util.text.StringUtil;
import com.intellij.openapi.vfs.VirtualFile;
import com.intellij.psi.PsiClass;
import com.intellij.psi.PsiElementFinder;
import com.intellij.psi.PsiPackage;
import com.intellij.psi.search.GlobalSearchScope;
import java.util.Arrays;
import org.jetbrains.annotations.Nullable;
/** Locates Litho component by full-qualified name, or null if it wasn't found. */
public class ComponentFinder extends PsiElementFinder {
private final Project project;
private final VirtualFile dummyFile;
ComponentFinder(Project project) {
this.project = project;
this.dummyFile = ComponentScope.createDummyFile(project);
}
@Override
public PsiClass[] findClasses(String qualifiedName, GlobalSearchScope scope) {
final PsiClass component = findClassInternal(qualifiedName, scope, project);
if (component == null) {
return PsiClass.EMPTY_ARRAY;
}
return new PsiClass[] {component};
}
@Nullable
@Override
public PsiClass findClass(String qualifiedName, GlobalSearchScope scope) {
return findClassInternal(qualifiedName, scope, project);
}
@Override
public PsiClass[] getClasses(PsiPackage psiPackage, GlobalSearchScope scope) {
if (!scope.contains(dummyFile)) return PsiClass.EMPTY_ARRAY;
// We don't create own package, but provide additional classes to existing one
final String packageQN = psiPackage.getQualifiedName();
return Arrays.stream(ComponentsCacheService.getInstance(project).getAllComponents())
.filter(cls -> StringUtil.getPackageName(cls.getQualifiedName()).equals(packageQN))
.toArray(PsiClass[]::new);
}
@Nullable
private PsiClass findClassInternal(
String qualifiedName, GlobalSearchScope scope, Project project) {
if (!scope.contains(dummyFile)) return null;
if (!StringUtil.isJavaIdentifier(StringUtil.getShortName(qualifiedName))) return null;
final PsiClass componentFromCache =
ComponentsCacheService.getInstance(project).getComponent(qualifiedName);
return componentFromCache;
}
}
| [
"facebook-github-bot@users.noreply.github.com"
] | facebook-github-bot@users.noreply.github.com |
3053ec2fa2804b595dda39716aca025549f00b51 | eec047d50d823186610d37bca40d96cf7e0262f7 | /src/java/com/wings/web/struts/actions/UpdatePerkiraanAction.java | d4af16ee0bccdbb366e93ea78686b20d5a941bb0 | [] | no_license | husainahmad/wings | d62cbf74abbf6f39c60ec687c2a9fbce0367bb75 | 6c8dbd4feb8b05b1b515e342fe1335416f0025f0 | refs/heads/master | 2021-04-29T01:03:34.665312 | 2017-07-05T16:01:46 | 2017-07-05T16:01:46 | 77,786,458 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,226 | java | package com.wings.web.struts.actions;
import com.wings.web.struts.forms.PerkiraanForm;
import java.io.IOException;
import java.util.HashMap;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;
import org.apache.struts.action.Action;
import org.apache.struts.action.ActionForm;
import org.apache.struts.action.ActionForward;
import org.apache.struts.action.ActionMapping;
public final class UpdatePerkiraanAction extends Action {
public ActionForward execute (
ActionMapping mapping,
ActionForm form,
HttpServletRequest request,
HttpServletResponse response
)
throws IOException, ServletException {
PerkiraanForm perkiraanForm = (PerkiraanForm)form;
try {
perkiraanForm = com.wings.adapter.StrutsPerkiraanDelegate.update(perkiraanForm);
request.setAttribute("perkiraan", perkiraanForm);
} catch (Exception e) {
getServlet().log("Find error", e);
request.setAttribute("name", "Perkiraan");
return mapping.findForward("ejb-finder-exception");
}
return mapping.findForward("view");
}
}
| [
"husainahmad@gmail.com"
] | husainahmad@gmail.com |
8d5e2138472da6d9d047e05aa42457ea58f4cbbb | 7991248e6bccacd46a5673638a4e089c8ff72a79 | /base/config/src/test/java/org/artifactory/descriptor/repo/RemoteRepoDescriptorTest.java | d02d0945690096206fab43d23ca6f28d73eb331b | [] | no_license | theoriginalshaheedra/artifactory-oss | 69b7f6274cb35c79db3a3cd613302de2ae019b31 | 415df9a9467fee9663850b4b8b4ee5bd4c23adeb | refs/heads/master | 2023-04-23T15:48:36.923648 | 2021-05-05T06:15:24 | 2021-05-05T06:15:24 | 364,455,815 | 1 | 0 | null | 2021-05-05T07:11:40 | 2021-05-05T03:57:33 | Java | UTF-8 | Java | false | false | 2,817 | java | /*
*
* Artifactory is a binaries repository manager.
* Copyright (C) 2018 JFrog Ltd.
*
* Artifactory 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.
*
* Artifactory 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 Artifactory. If not, see <http://www.gnu.org/licenses/>.
*
*/
package org.artifactory.descriptor.repo;
import org.testng.annotations.Test;
import static org.testng.Assert.*;
/**
* Tests the RemoteRepoDescriptor class.
*
* @author Yossi Shaul
*/
@Test
public class RemoteRepoDescriptorTest {
public void defaultConstructor() {
RemoteRepoDescriptor remote = new RemoteRepoDescriptor() {
};
assertNull(remote.getKey());
assertEquals(remote.getIncludesPattern(), "**/*");
assertNull(remote.getExcludesPattern());
assertNull(remote.getDescription());
assertNull(remote.getRepoLayout());
assertEquals(remote.getAssumedOfflinePeriodSecs(), 300);
assertEquals(remote.getMaxUniqueSnapshots(), 0);
assertEquals(remote.getMaxUniqueTags(), 0);
assertEquals(remote.getMissedRetrievalCachePeriodSecs(), 1800);
assertEquals(remote.getRetrievalCachePeriodSecs(), 7200);
assertEquals(remote.getChecksumPolicyType(), ChecksumPolicyType.GEN_IF_ABSENT);
assertNull(remote.getUrl());
assertNull(remote.getRemoteRepoLayout());
assertFalse(remote.isOffline());
assertFalse(remote.isBlackedOut());
assertFalse(remote.isCache());
assertFalse(remote.isLocal());
assertFalse(remote.isHardFail());
assertTrue(remote.isStoreArtifactsLocally());
assertFalse(remote.isFetchJarsEagerly());
assertFalse(remote.isFetchSourcesEagerly());
assertTrue(remote.isSuppressPomConsistencyChecks(),
"Default should not supress pom consistency checks");
assertEquals(remote.getUnusedArtifactsCleanupPeriodHours(), 0);
assertFalse(remote.isShareConfiguration());
assertNotNull(remote.getPropertySets(), "Property sets list should not be null");
assertFalse(remote.isRejectInvalidJars());
assertNotEquals(remote.getType(), RepoType.NuGet, "NuGet should be off by default.");
assertEquals(remote.getDockerApiVersion(), DockerApiVersion.V2, "Docker API version should be V2 by default.");
}
}
| [
"david.monichi@gmail.com"
] | david.monichi@gmail.com |
a8f91e5afd488428ce197b8cc39f863e000c197a | fa91450deb625cda070e82d5c31770be5ca1dec6 | /Diff-Raw-Data/9/9_377f4b04400d998019c2ea284864419619374e9d/OEMultiT/9_377f4b04400d998019c2ea284864419619374e9d_OEMultiT_s.java | fa2fb8b928c5f43da241e4cab6a88ee20260c7d1 | [] | 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 | 4,211 | java |
import java.awt.*;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.io.File;
import javax.swing.*;
@SuppressWarnings("serial")
public class OEMultiT extends JPanel implements ActionListener {
//fields
static private final String newline = "\n";
static File inputPath;
JButton chooseFolderButton, runButton;
static JTextArea log;
JFileChooser fc;
//constructor
public OEMultiT () {
super (new BorderLayout());
//Create the log first, because the action listeners
log = new JTextArea(15,50);
log.setMargin(new Insets(5,5,5,5));
log.setEditable(false);
JScrollPane logScrollPane = new JScrollPane(log);
//Create a file chooser
fc = new JFileChooser();
fc.setFileSelectionMode(JFileChooser.DIRECTORIES_ONLY);
//Create the choose folder button
chooseFolderButton = new JButton ("Select Source Folder...");
chooseFolderButton.addActionListener(this);
//Create the choose folder button
runButton = new JButton ("Run");
runButton.addActionListener(this);
//For layout purposes, put the buttons in a separate panel
JPanel buttonPanel = new JPanel(); //use FlowLayout
buttonPanel.add(chooseFolderButton);
buttonPanel.add(runButton);
//Add the buttons and the log to this panel.
add(buttonPanel, BorderLayout.PAGE_START);
add(logScrollPane, BorderLayout.CENTER);
}
@Override
public void actionPerformed(ActionEvent ev) {
//Handle choose folder button action.
if (ev.getSource() == chooseFolderButton) {
int returnVal = fc.showOpenDialog(OEMultiT.this);
if (returnVal == JFileChooser.APPROVE_OPTION) {
inputPath = fc.getSelectedFile();
if (!inputPath.getName().equalsIgnoreCase("moinho")) {
log.append("Please select folder </Users/username/Desktop/moinho/>" + newline);
inputPath = null;
} else {
log.append("Selecting Source Folder: " + inputPath.getName() +"/" + newline);
}
} else {
log.append("Select Source Foulder cancelled by user." + newline);
}
log.setCaretPosition(log.getDocument().getLength());
//Handle run button action.
} else if (ev.getSource() == runButton) {
if (inputPath != null) {
if (inputPath.list().length < 2) {
log.append("Source Folder is empty!" + newline);
} else {
log.append("running..." + newline);
try {
Thread t = new Thread( new Runnable () {
public void run() {
FolderReader.main(inputPath);
}
});
t.start();
} catch (Exception e) {
log.append("Exception! Unable to complete." + newline);
} finally {
//do nothing
}
}
} else {
log.append("Select Source Folder first." + newline);
}
log.setCaretPosition(log.getDocument().getLength());
}
}
private static void createAndShowGUI () {
//create the window
JFrame frame = new JFrame ("OE Multi Thread");
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
//add content
frame.add(new OEMultiT());
//display the window
frame.pack();
frame.setVisible(true);
}
public static void doneMessage () {
log.append("Done! Check if all files were processed correctly." + newline);
}
public static void noValidSkuMessage (String order) {
log.append("No Valid SKU found on PO " + order + newline);
}
public static void invalidSoldShipMessage (String soldTo, String shipTo) {
log.append("Invalid Sold-To or Ship-To " + soldTo + ", " + shipTo + newline);
}
public static void main(String[] args) {
SwingUtilities.invokeLater(new Runnable() {
public void run () {
createAndShowGUI();
}
});
}
}
| [
"yuzhongxing88@gmail.com"
] | yuzhongxing88@gmail.com |
a02c9b7892ae85ed768a8d1a98e61e0f690112b8 | 180e78725121de49801e34de358c32cf7148b0a2 | /dataset/protocol1/mapstruct/testing/91/Experimental.java | 42538ec20cd2b08112ba42f3c295af6429eca1c9 | [] | no_license | ASSERT-KTH/synthetic-checkstyle-error-dataset | 40e8d1e0a7ebe7f7711def96a390891a6922f7bd | 40c057e1669584bfc6fecf789b5b2854660222f3 | refs/heads/master | 2023-03-18T12:50:55.410343 | 2019-01-25T09:54:39 | 2019-01-25T09:54:39 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 538 | java | /*
* Copyright MapStruct Authors.
*
* Licensed under the Apache License version 2.0, available at http://www.apache.org/licenses/LICENSE-2.0
*/
package org.mapstruct.util;
import java.lang.annotation.Documented;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
/**
* Features that are marked with this annotation are considered <em>experimental</em>.
*
* @author Andreas Gudian
*/
@Documented
@Retention(RetentionPolicy.SOURCE)
public @interface Experimental {
String value() default "";
}
| [
"bloriot97@gmail.com"
] | bloriot97@gmail.com |
43f35e2c22a9661ccf918abb78b8853fd9b5dc60 | d6629b3a69f3f360583ee3ae04ba12857d77cabc | /com/android/camera/ListPreference.java | 6b1bffa8689aa3e185b18abeba1c5232f1e0548a | [] | no_license | AndroidSDKSources/android-sdk-sources-for-api-level-9 | 5cbb5d655e2e3e9de798bdeceb00fc4061c4db71 | 1ec9ed9c2714d0d1425f5784a31cf87e18eb9425 | refs/heads/master | 2021-01-23T03:13:30.277856 | 2015-07-03T10:19:21 | 2015-07-03T10:19:21 | 38,486,795 | 4 | 1 | null | null | null | null | UTF-8 | Java | false | false | 4,017 | java | /*
* Copyright (C) 2009 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.android.camera;
import android.content.Context;
import android.content.SharedPreferences;
import android.content.res.TypedArray;
import android.util.AttributeSet;
import com.android.camera.R;
import java.util.ArrayList;
import java.util.List;
/**
* A type of <code>CameraPreference</code> whose number of possible values
* is limited.
*/
public class ListPreference extends CameraPreference {
private final String mKey;
private String mValue;
private final String mDefaultValue;
private CharSequence[] mEntries;
private CharSequence[] mEntryValues;
private boolean mLoaded = false;
public ListPreference(Context context, AttributeSet attrs) {
super(context, attrs);
TypedArray a = context.obtainStyledAttributes(
attrs, R.styleable.ListPreference, 0, 0);
mKey = Util.checkNotNull(
a.getString(R.styleable.ListPreference_key));
mDefaultValue = a.getString(R.styleable.ListPreference_defaultValue);
setEntries(a.getTextArray(R.styleable.ListPreference_entries));
setEntryValues(a.getTextArray(
R.styleable.ListPreference_entryValues));
a.recycle();
}
public String getKey() {
return mKey;
}
public CharSequence[] getEntries() {
return mEntries;
}
public CharSequence[] getEntryValues() {
return mEntryValues;
}
public void setEntries(CharSequence entries[]) {
mEntries = entries == null ? new CharSequence[0] : entries;
}
public void setEntryValues(CharSequence values[]) {
mEntryValues = values == null ? new CharSequence[0] : values;
}
public String getValue() {
if (!mLoaded) {
mValue = getSharedPreferences().getString(mKey, mDefaultValue);
mLoaded = true;
}
return mValue;
}
public void setValue(String value) {
if (findIndexOfValue(value) < 0) throw new IllegalArgumentException();
mValue = value;
persistStringValue(value);
}
public void setValueIndex(int index) {
setValue(mEntryValues[index].toString());
}
public int findIndexOfValue(String value) {
for (int i = 0, n = mEntryValues.length; i < n; ++i) {
if (Util.equals(mEntryValues[i], value)) return i;
}
return -1;
}
public String getEntry() {
return mEntries[findIndexOfValue(getValue())].toString();
}
protected void persistStringValue(String value) {
SharedPreferences.Editor editor = getSharedPreferences().edit();
editor.putString(mKey, value);
editor.apply();
}
@Override
public void reloadValue() {
this.mLoaded = false;
}
public void filterUnsupported(List<String> supported) {
ArrayList<CharSequence> entries = new ArrayList<CharSequence>();
ArrayList<CharSequence> entryValues = new ArrayList<CharSequence>();
for (int i = 0, len = mEntryValues.length; i < len; i++) {
if (supported.indexOf(mEntryValues[i].toString()) >= 0) {
entries.add(mEntries[i]);
entryValues.add(mEntryValues[i]);
}
}
int size = entries.size();
mEntries = entries.toArray(new CharSequence[size]);
mEntryValues = entryValues.toArray(new CharSequence[size]);
}
}
| [
"root@ifeegoo.com"
] | root@ifeegoo.com |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.