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
83630c98d4f5a2512150d8e318693bbe1e55200a
55dca62e858f1a44c2186774339823a301b48dc7
/code/my-app/functions/8/addPropertyChangeListeners_ColonyPanel.java
e6c3ef8014ca55a9fe710c239d18e247822caa50
[]
no_license
jwiszowata/code_reaper
4fff256250299225879d1412eb1f70b136d7a174
17dde61138cec117047a6ebb412ee1972886f143
refs/heads/master
2022-12-15T14:46:30.640628
2022-02-10T14:02:45
2022-02-10T14:02:45
84,747,455
0
0
null
2022-12-07T23:48:18
2017-03-12T18:26:11
Java
UTF-8
Java
false
false
290
java
private void addPropertyChangeListeners() { final Colony colony = getColony(); if (colony != null) { colony.addPropertyChangeListener(this); colony.getGoodsContainer().addPropertyChangeListener(this); colony.getTile().addPropertyChangeListener(this); } }
[ "wiszowata.joanna@gmail.com" ]
wiszowata.joanna@gmail.com
8ecece490f0e2a758afabd234df98ea8fa46b059
d1a6d1e511df6db8d8dd0912526e3875c7e1797d
/genny_JavaWithoutLambdas/applicationModule/src/test/java/applicationModulepackageJava0/Foo593Test.java
a1f10aeca7c5edf49ef91c84b86cefabcad57518
[]
no_license
NikitaKozlov/generated-project-for-desugaring
0bc1443ab3ddc84cd289331c726761585766aea7
81506b3711004185070ca4bb9a93482b70011d36
refs/heads/master
2020-03-20T00:35:06.996525
2018-06-12T09:30:37
2018-06-12T09:30:37
137,049,317
0
0
null
null
null
null
UTF-8
Java
false
false
481
java
package applicationModulepackageJava0; import org.junit.Test; public class Foo593Test { @Test public void testFoo0() { new Foo593().foo0(); } @Test public void testFoo1() { new Foo593().foo1(); } @Test public void testFoo2() { new Foo593().foo2(); } @Test public void testFoo3() { new Foo593().foo3(); } @Test public void testFoo4() { new Foo593().foo4(); } @Test public void testFoo5() { new Foo593().foo5(); } }
[ "nikita.e.kozlov@gmail.com" ]
nikita.e.kozlov@gmail.com
b6c6c9e5f774e08ec510dcc7835878b1e5f456e8
be73270af6be0a811bca4f1710dc6a038e4a8fd2
/crash-reproduction-moho/results/XWIKI-14556-10-30-NSGA_II-WeightedSum:TestLen:CallDiversity/com/xpn/xwiki/store/XWikiHibernateBaseStore_ESTest_scaffolding.java
e9e78fb30181ae586a5207655fbce0ac815eb3a3
[]
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
447
java
/** * Scaffolding file used to store all the setups needed to run * tests automatically generated by EvoSuite * Fri Apr 03 06:23:17 UTC 2020 */ package com.xpn.xwiki.store; import org.evosuite.runtime.annotation.EvoSuiteClassExclude; import org.junit.BeforeClass; import org.junit.Before; import org.junit.After; @EvoSuiteClassExclude public class XWikiHibernateBaseStore_ESTest_scaffolding { // Empty scaffolding for empty test suite }
[ "pouria.derakhshanfar@gmail.com" ]
pouria.derakhshanfar@gmail.com
b9c56f98e87e2e49518e8fc30a71807de3949c73
13f6652c77abd41d4bc944887e4b94d8dff40dde
/archstudio/src/c2/fw/UnsupportedBrickDescriptionException.java
8ad93479dac9f07dfd0d7b3b6c40ff855da0c3ae
[]
no_license
isr-uci-edu/ArchStudio3
5bed3be243981d944577787f3a47c7a94c8adbd3
b8aeb7286ea00d4b6c6a229c83b0ee0d1c9b2960
refs/heads/master
2021-01-10T21:01:43.330204
2014-05-31T16:15:53
2014-05-31T16:15:53
null
0
0
null
null
null
null
UTF-8
Java
false
false
1,160
java
//!!(C)!! package c2.fw; /** * Exception thrown when a <code>BrickLoader</code> is asked to load a brick * with a description it cannot process. * * @see c2.fw.BrickLoader * @author Eric M. Dashofy <A HREF="mailto:edashofy@ics.uci.edu">edashofy@ics.uci.edu</A> */ public class UnsupportedBrickDescriptionException extends java.lang.Exception{ private String message; /** * Creates a new <code>UnsupportedBrickDescriptionException</code> with no detail message. */ public UnsupportedBrickDescriptionException(){ this(""); } /** * Creates a new <code>UnsupportedBrickDescriptionException</code> with the given detail message. * @param message Detail message. */ public UnsupportedBrickDescriptionException(String message){ this.message = message; } /** * Gets the detail message for this exception. * @return Detail message. */ public String getMessage(){ return message; } /** * Gets a String representation of this error. * @return String representation of this error. */ public String toString(){ return "UnsupportedBrickDescriptionException:" + ((message == null) ? "[no message]" : message); } }
[ "sahendrickson@gmail.com" ]
sahendrickson@gmail.com
ab9fb15e05b2a9ea308a76187b04e7d4af684655
16cee9537c176c4b463d1a6b587c7417cb8e0622
/src/main/java/week15/d03/Post.java
0f5ab9c7abcffb9517ad1be828c3a2b33271b836
[]
no_license
ipp203/training-solutions
23c1b615965326e6409fee2e3b9616d6bc3818bb
8f36a831d25f1d12097ec4dfb089128aa6a02998
refs/heads/master
2023-03-17T10:01:32.154321
2021-03-04T22:54:12
2021-03-04T22:54:12
308,043,249
0
0
null
null
null
null
UTF-8
Java
false
false
1,189
java
package week15.d03; import java.time.LocalDate; public class Post { private String title; private LocalDate publishedAt; private LocalDate deletedAt; private String content; private String owner; public Post(String title, LocalDate publishedAt, LocalDate deletedAt, String content, String owner) { this.title = title; this.publishedAt = publishedAt; this.deletedAt = deletedAt; this.content = content; this.owner = owner; } public boolean isContentOrTitleNotEmpty() { return !(content.isBlank() || title.isBlank()); } public boolean isOwnPost(String user) { return this.owner.equals(user); } public boolean isEarlierThanNow() { return publishedAt.isBefore(LocalDate.now()); } public boolean isNotDeleted() { return deletedAt == null || deletedAt.isAfter(LocalDate.now()); } @Override public String toString() { return "title='" + title + '\'' + ", publishedAt=" + publishedAt + ", deletedAt=" + deletedAt + ", content='" + content + '\'' + ", owner='" + owner; } }
[ "ipp203@freemail.hu" ]
ipp203@freemail.hu
7f90ebc654b2de111527595e216d186d0e4877bd
041b673c9b18f24705fcebcbdc21f4f3c236487a
/app/src/main/java/com/homecaravan/android/consumer/consumermvp/showingmvp/GetListShowingPastPresenter.java
ba49c96861ee10ee04756b8fef872c1c6d59f502
[]
no_license
Rainy1193/HCDemo
63ed54d42e65cf17ba4873c424a7e5f27bc6519e
66498a0892e000f04aa30932b67106344a96ac8c
refs/heads/master
2021-09-04T20:08:27.932681
2018-01-22T01:55:26
2018-01-22T01:55:26
107,510,248
0
0
null
null
null
null
UTF-8
Java
false
false
1,560
java
package com.homecaravan.android.consumer.consumermvp.showingmvp; import com.homecaravan.android.R; import com.homecaravan.android.consumer.api.ServiceGeneratorConsumer; import com.homecaravan.android.consumer.api.ShowingApi; import com.homecaravan.android.consumer.model.responseapi.ResponseShowingCaravan; import retrofit2.Call; import retrofit2.Callback; import retrofit2.Response; public class GetListShowingPastPresenter { private GetListShowingPastView mView; public GetListShowingPastPresenter(GetListShowingPastView mView) { this.mView = mView; } public void getListShowingPast(String type) { ShowingApi showingApi = ServiceGeneratorConsumer.createService(ShowingApi.class); showingApi.getListShowingCaravanPast(type).enqueue(new Callback<ResponseShowingCaravan>() { @Override public void onResponse(Call<ResponseShowingCaravan> call, Response<ResponseShowingCaravan> response) { if (response.isSuccessful()) { if (response.body().getSuccess()) { mView.getShowingCaravanSuccess(response.body().getCaravanShowings()); } else { mView.getShowingCaravanFail(response.body().getMessage()); } } else { mView.getShowingCaravanFail(R.string.error_server); } } @Override public void onFailure(Call<ResponseShowingCaravan> call, Throwable t) { } }); } }
[ "daupraoc@gmail.com" ]
daupraoc@gmail.com
729b09aba0a8c43083e40508ce70833edbf0958c
e1ed5f410bba8c05310b6a7dabe65b7ef62a9322
/src/test/java/com/sda/javabyd3/migr/exg002/ex05/PalindromeCheckerTest.java
3d2f4c035f241cad1745bd6645e91c25f585b803
[]
no_license
pmkiedrowicz/javabyd3
252f70e70f0fc71e8ef9019fdd8cea5bd05ca90b
7ff8e93c041f27383b3ad31b43f014c059ef53e3
refs/heads/master
2022-01-01T08:56:08.747392
2019-07-26T19:02:50
2019-07-26T19:02:50
199,065,478
0
0
null
null
null
null
UTF-8
Java
false
false
444
java
package com.sda.javabyd3.migr.exg002.ex05; import org.junit.Assert; import org.junit.Test; public class PalindromeCheckerTest { @Test public void isPalindrome() { PalindromeChecker test = new PalindromeChecker(); Assert.assertTrue("method isPalindrome does not work correctly", test.isPalindrome("kajak")); Assert.assertTrue("method isPalindrome does not work correctly", !test.isPalindrome("dupa")); } }
[ "pmkiedrowicz@gmail.com" ]
pmkiedrowicz@gmail.com
76748eb902213927f4efc1dc1162726ab19e5d7b
c0d0f78890fb39a42a16f8a68c56a7be28037854
/netconf-server-modelnode-fwk/src/test/java/org/broadband_forum/obbaa/netconf/mn/fwk/server/model/AbstractEditConfigTestSetup.java
cda285e510ae3c95e04ad280b1b0cf0ba19a42a0
[]
no_license
z27341/obbaa-netconf-stack
a25bc78471a1a21647c3ffcaec201f6f0262a1a5
8568db13c1b36c03275cdedd22f308ad9350202a
refs/heads/master
2020-04-17T13:42:00.371366
2018-10-31T10:44:25
2018-10-31T10:44:25
null
0
0
null
null
null
null
UTF-8
Java
false
false
4,097
java
/* * Copyright 2018 Broadband Forum * * 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.broadband_forum.obbaa.netconf.mn.fwk.server.model; import static org.mockito.Mockito.mock; import org.broadband_forum.obbaa.netconf.mn.fwk.server.model.support.constraints.validation.util.DSExpressionValidator; import org.broadband_forum.obbaa.netconf.mn.fwk.server.model.yang.AbstractValidationTestSetup; import org.broadband_forum.obbaa.netconf.api.messages.StandardDataStores; import org.broadband_forum.obbaa.netconf.mn.fwk.schema.SchemaBuildException; import org.broadband_forum.obbaa.netconf.mn.fwk.schema.SchemaRegistryImpl; import org.broadband_forum.obbaa.netconf.mn.fwk.server.model.datastore.ModelNodeDataStoreManager; import org.broadband_forum.obbaa.netconf.mn.fwk.server.model.support.ModelNodeHelperRegistryImpl; import org.broadband_forum.obbaa.netconf.mn.fwk.server.model.support.RootModelNodeAggregator; import org.broadband_forum.obbaa.netconf.mn.fwk.server.model.support.RootModelNodeAggregatorImpl; import org.broadband_forum.obbaa.netconf.server.rpc.RpcPayloadConstraintParser; import org.broadband_forum.obbaa.netconf.server.util.TestUtil; import org.broadband_forum.obbaa.netconf.mn.fwk.util.NoLockService; public abstract class AbstractEditConfigTestSetup extends AbstractValidationTestSetup { protected ModelNode m_model; protected RootModelNodeAggregator m_rootModelNodeAggregator; protected NetConfServerImpl m_server; @Override public void setup() throws SchemaBuildException { m_schemaRegistry = new SchemaRegistryImpl(TestUtil.getJukeBoxYangs(), new NoLockService()); m_modelNodeHelperRegistry = new ModelNodeHelperRegistryImpl(m_schemaRegistry); m_expValidator = new DSExpressionValidator(m_schemaRegistry, m_modelNodeHelperRegistry); createServerWithNonEmptyJukeBox(); } public void createServerWithNonEmptyJukeBox() throws SchemaBuildException { m_server = new NetConfServerImpl(m_schemaRegistry, mock(RpcPayloadConstraintParser.class)); m_model = TestUtil.createJukeBoxModelWithYear(m_modelNodeHelperRegistry, m_subSystemRegistry, m_schemaRegistry); m_rootModelNodeAggregator = new RootModelNodeAggregatorImpl(m_schemaRegistry, m_modelNodeHelperRegistry, mock(ModelNodeDataStoreManager.class), m_subSystemRegistry).addModelServiceRoot(m_componentId, m_model); DataStore dataStore = new DataStore(StandardDataStores.RUNNING, m_rootModelNodeAggregator, m_subSystemRegistry); NbiNotificationHelper nbiNotificationHelper = mock(NbiNotificationHelper.class); dataStore.setNbiNotificationHelper(nbiNotificationHelper); m_server.setRunningDataStore(dataStore); } public void createEmptyServer() throws SchemaBuildException { m_server = new NetConfServerImpl(m_schemaRegistry, mock(RpcPayloadConstraintParser.class)); m_model = TestUtil.createEmptyJukeBox(m_modelNodeHelperRegistry, m_subSystemRegistry, m_schemaRegistry); m_rootModelNodeAggregator = new RootModelNodeAggregatorImpl(m_schemaRegistry, m_modelNodeHelperRegistry, mock(ModelNodeDataStoreManager.class), m_subSystemRegistry).addModelServiceRoot(m_componentId, m_model); DataStore dataStore = new DataStore(StandardDataStores.RUNNING, m_rootModelNodeAggregator, m_subSystemRegistry); NbiNotificationHelper nbiNotificationHelper = mock(NbiNotificationHelper.class); dataStore.setNbiNotificationHelper(nbiNotificationHelper); m_server.setRunningDataStore(dataStore); } }
[ "mahadevan.vcnokia.com" ]
mahadevan.vcnokia.com
fa4e4c55b05bab11d9afec9bcffc5cd97639a2a2
e3a37aaf17ec41ddc7051f04b36672db62a7863d
/business-service/control-service-project/control-service/src/main/java/com/iot/control/packagemanager/entity/PackageDeviceType.java
1eec6c0f3de909653142b2193b67067f22506183
[]
no_license
github4n/cloud
68477a7ecf81d1526b1b08876ca12cfe575f7788
7974042dca1ee25b433177e2fe6bda1de28d909a
refs/heads/master
2020-04-18T02:04:33.509889
2019-01-13T02:19:32
2019-01-13T02:19:32
null
0
0
null
null
null
null
UTF-8
Java
false
false
2,428
java
package com.iot.control.packagemanager.entity; import com.baomidou.mybatisplus.activerecord.Model; import com.baomidou.mybatisplus.annotations.TableId; import com.baomidou.mybatisplus.annotations.TableName; import com.baomidou.mybatisplus.enums.IdType; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.io.Serializable; import java.util.Date; /** * @despriction:套包支持設備類型(BOSS維護) * @author yeshiyuan * @created 2018/11/20 20:44 */ @TableName("package_device_type") @ApiModel(description = "套包支持設備類型") public class PackageDeviceType extends Model<PackageDeviceType> { @Override protected Serializable pkVal() { return id; } /** * 主键 */ @ApiModelProperty(name = "id", value = "id", dataType = "Long") @TableId(value = "id", type = IdType.AUTO) private Long id; @ApiModelProperty(name = "packageId", value = "套包id", dataType = "Long") private Long packageId; @ApiModelProperty(name = "deviceTypeId", value = "設備類型ID", dataType = "Long") private Long deviceTypeId; @ApiModelProperty(name = "createBy", value = "创建者主键", dataType = "Long") private Long createBy; @ApiModelProperty(name = "createTime", value = "创建时间", dataType = "Date") private Date createTime; public Long getId() { return id; } public void setId(Long id) { this.id = id; } public Long getPackageId() { return packageId; } public void setPackageId(Long packageId) { this.packageId = packageId; } public Long getDeviceTypeId() { return deviceTypeId; } public void setDeviceTypeId(Long deviceTypeId) { this.deviceTypeId = deviceTypeId; } public Long getCreateBy() { return createBy; } public void setCreateBy(Long createBy) { this.createBy = createBy; } public Date getCreateTime() { return createTime; } public void setCreateTime(Date createTime) { this.createTime = createTime; } public PackageDeviceType() { } public PackageDeviceType(Long packageId, Long deviceTypeId, Long createBy, Date createTime) { this.packageId = packageId; this.deviceTypeId = deviceTypeId; this.createBy = createBy; this.createTime = createTime; } }
[ "qizhiyong@LDS-Z-C5497.LEEDARSON.LOCAL" ]
qizhiyong@LDS-Z-C5497.LEEDARSON.LOCAL
b541f1467282a7c72ab6e0f6ade3725e38def734
3bab81792c722411c542596fedc8e4b1d086c1a9
/src/main/java/com/gome/maven/psi/impl/cache/impl/IndexPatternUtil.java
c0f543d2d3163c1af8bda1956afb91d50d45d195
[]
no_license
nicholas879110/maven-code-check-plugin
80d6810cc3c12a3b6c22e3eada331136e3d9a03e
8162834e19ed0a06ae5240b5e11a365c0f80d0a0
refs/heads/master
2021-04-30T07:09:42.455482
2018-03-01T03:21:21
2018-03-01T03:21:21
121,457,530
0
0
null
null
null
null
UTF-8
Java
false
false
1,645
java
/* * Copyright 2000-2011 JetBrains s.r.o. * * 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.gome.maven.psi.impl.cache.impl; import com.gome.maven.openapi.extensions.Extensions; import com.gome.maven.psi.search.IndexPattern; import com.gome.maven.psi.search.IndexPatternProvider; public class IndexPatternUtil { public static IndexPatternProvider[] getIndexPatternProviders() { return Extensions.getExtensions(IndexPatternProvider.EP_NAME); } public static int getIndexPatternCount() { int patternsCount = 0; for(IndexPatternProvider provider: getIndexPatternProviders()) { patternsCount += provider.getIndexPatterns().length; } return patternsCount; } public static IndexPattern[] getIndexPatterns() { IndexPattern[] result = new IndexPattern[getIndexPatternCount()]; int destIndex = 0; for(IndexPatternProvider provider: getIndexPatternProviders()) { for(IndexPattern pattern: provider.getIndexPatterns()) { result [destIndex++] = pattern; } } return result; } }
[ "zhangliewei@gome.com.cn" ]
zhangliewei@gome.com.cn
df9ead8438dc1b33ed6c396f23d84bb64410cdeb
c4672821f2aff60b9d1ab99ba378e266687b1b84
/webService/src/main/java/com/by/WebSecurityConfig.java
cc399cb788c7826a5ee3a35114f24486ee367b27
[]
no_license
dingjing0518/CCHCrm
e761d2f8b55ad25e7a8984cb11f380c561bcdce4
3c18a9bdea98e5e90a35f739d6454106b45f56a1
refs/heads/master
2021-01-02T00:59:40.292835
2017-08-01T02:02:27
2017-08-01T02:02:27
98,948,138
0
0
null
null
null
null
UTF-8
Java
false
false
642
java
package com.by; import org.springframework.context.annotation.Configuration; import org.springframework.security.config.annotation.web.builders.HttpSecurity; import org.springframework.security.config.annotation.web.configuration.EnableWebSecurity; import org.springframework.security.config.annotation.web.configuration.WebSecurityConfigurerAdapter; @Configuration @EnableWebSecurity public class WebSecurityConfig extends WebSecurityConfigurerAdapter { @Override protected void configure(HttpSecurity http) throws Exception { http.csrf().disable(); http.authorizeRequests().antMatchers("/cache/**").hasIpAddress("127.0.0.1"); } }
[ "13962104109@163.com" ]
13962104109@163.com
1872c9dd8416f05e47c4b209f56978127b89a1c9
c0b37a664fde6a57ae61c4af635e6dea28d7905e
/Helpful dev stuff/AeriesMobilePortal_v1.2.0_apkpure.com_source_from_JADX/kotlin/collections/IndexingIterable.java
606bc9948f36cd905eda5dd31cf8f06e7ed3c40a
[]
no_license
joshkmartinez/Grades
a21ce8ede1371b9a7af11c4011e965f603c43291
53760e47f808780d06c4fbc2f74028a2db8e2942
refs/heads/master
2023-01-30T13:23:07.129566
2020-12-07T18:20:46
2020-12-07T18:20:46
131,549,535
0
0
null
null
null
null
UTF-8
Java
false
false
1,702
java
package kotlin.collections; import java.util.Iterator; import kotlin.Metadata; import kotlin.jvm.functions.Function0; import kotlin.jvm.internal.Intrinsics; import kotlin.jvm.internal.markers.KMappedMarker; import org.jetbrains.annotations.NotNull; @Metadata(bv = {1, 0, 2}, d1 = {"\u0000\u001c\n\u0002\u0018\u0002\n\u0000\n\u0002\u0010\u001c\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0002\u0010(\n\u0002\b\u0003\b\u0000\u0018\u0000*\u0006\b\u0000\u0010\u0001 \u00012\u000e\u0012\n\u0012\b\u0012\u0004\u0012\u0002H\u00010\u00030\u0002B\u0019\u0012\u0012\u0010\u0004\u001a\u000e\u0012\n\u0012\b\u0012\u0004\u0012\u00028\u00000\u00060\u0005¢\u0006\u0002\u0010\u0007J\u0015\u0010\b\u001a\u000e\u0012\n\u0012\b\u0012\u0004\u0012\u00028\u00000\u00030\u0006H–\u0002R\u001a\u0010\u0004\u001a\u000e\u0012\n\u0012\b\u0012\u0004\u0012\u00028\u00000\u00060\u0005X‚\u0004¢\u0006\u0002\n\u0000¨\u0006\t"}, d2 = {"Lkotlin/collections/IndexingIterable;", "T", "", "Lkotlin/collections/IndexedValue;", "iteratorFactory", "Lkotlin/Function0;", "", "(Lkotlin/jvm/functions/Function0;)V", "iterator", "kotlin-stdlib"}, k = 1, mv = {1, 1, 10}) /* compiled from: Iterables.kt */ public final class IndexingIterable<T> implements Iterable<IndexedValue<? extends T>>, KMappedMarker { private final Function0<Iterator<T>> iteratorFactory; public IndexingIterable(@NotNull Function0<? extends Iterator<? extends T>> function0) { Intrinsics.checkParameterIsNotNull(function0, "iteratorFactory"); this.iteratorFactory = function0; } @NotNull public Iterator<IndexedValue<T>> iterator() { return new IndexingIterator((Iterator) this.iteratorFactory.invoke()); } }
[ "joshkmartinez@gmail.com" ]
joshkmartinez@gmail.com
d19e8ce4978a575df031f15ed093e8a960c6da77
75950d61f2e7517f3fe4c32f0109b203d41466bf
/tests/tags/ci-1.8/test-timer-implementation/src/main/java/org/fabric3/tests/timer/TransactionalTimedComponent.java
03964e167da7acbe226715187f9e0768b39b3716
[ "Apache-2.0" ]
permissive
codehaus/fabric3
3677d558dca066fb58845db5b0ad73d951acf880
491ff9ddaff6cb47cbb4452e4ddbf715314cd340
refs/heads/master
2023-07-20T00:34:33.992727
2012-10-31T16:32:19
2012-10-31T16:32:19
36,338,853
0
0
null
null
null
null
UTF-8
Java
false
false
2,528
java
/* * Fabric3 * Copyright (c) 2009 Metaform Systems * * Fabric3 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, with the * following exception: * * Linking this software statically or dynamically with other * modules is making a combined work based on this software. * Thus, the terms and conditions of the GNU General Public * License cover the whole combination. * * As a special exception, the copyright holders of this software * give you permission to link this software with independent * modules to produce an executable, regardless of the license * terms of these independent modules, and to copy and distribute * the resulting executable under terms of your choice, provided * that you also meet, for each linked independent module, the * terms and conditions of the license of that module. An * independent module is a module which is not derived from or * based on this software. If you modify this software, you may * extend this exception to your version of the software, but * you are not obligated to do so. If you do not wish to do so, * delete this exception statement from your version. * * Fabric3 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 Fabric3. * If not, see <http://www.gnu.org/licenses/>. */ package org.fabric3.tests.timer; import javax.transaction.Status; import javax.transaction.SystemException; import javax.transaction.TransactionManager; import org.oasisopen.sca.ServiceRuntimeException; import org.oasisopen.sca.annotation.Reference; import org.fabric3.api.annotation.Resource; /** * @version $Rev$ $Date$ */ public class TransactionalTimedComponent implements Runnable { @Reference protected LatchService latchService; @Resource protected TransactionManager tm; public void run() { try { if (Status.STATUS_ACTIVE != tm.getStatus()) { throw new ServiceRuntimeException("Transaction must be active"); } } catch (SystemException e) { throw new ServiceRuntimeException("Transaction must be active"); } latchService.countDown(); } }
[ "jmarino@83866bfc-822f-0410-aa35-bd5043b85eaf" ]
jmarino@83866bfc-822f-0410-aa35-bd5043b85eaf
d8f7816422b0be825ea29cc378302e0a7c3acc24
208ba847cec642cdf7b77cff26bdc4f30a97e795
/aj/ab/src/main/java/org.wp.ab/ui/media/MediaImageLoader.java
8727e4b96edab6b071224a41e67331ae5876c739
[]
no_license
kageiit/perf-android-large
ec7c291de9cde2f813ed6573f706a8593be7ac88
2cbd6e74837a14ae87c1c4d1d62ac3c35df9e6f8
refs/heads/master
2021-01-12T14:00:19.468063
2016-09-27T13:10:42
2016-09-27T13:10:42
69,685,305
0
0
null
2016-09-30T16:59:49
2016-09-30T16:59:48
null
UTF-8
Java
false
false
1,558
java
package org.wp.ab.ui.media; import android.content.Context; import com.android.volley.RequestQueue; import com.android.volley.toolbox.ImageLoader; import com.android.volley.toolbox.Volley; import org.wp.ab.WordPress; import org.wp.ab.models.Blog; import org.wp.ab.util.AppLog; import org.wp.ab.util.VolleyUtils; /** * provides the ImageLoader and backing RequestQueue for media image requests - necessary because * images in protected blogs need to be authenticated, which requires a separate RequestQueue */ class MediaImageLoader { private MediaImageLoader() { throw new AssertionError(); } static ImageLoader getInstance() { return getInstance(WordPress.getCurrentBlog()); } static ImageLoader getInstance(Blog blog) { if (blog != null && VolleyUtils.isCustomHTTPClientStackNeeded(blog)) { // use ImageLoader with authenticating request queue for protected blogs AppLog.d(AppLog.T.MEDIA, "using custom imageLoader"); Context context = WordPress.getContext(); RequestQueue authRequestQueue = Volley.newRequestQueue(context, VolleyUtils.getHTTPClientStack(context, blog)); ImageLoader imageLoader = new ImageLoader(authRequestQueue, WordPress.getBitmapCache()); imageLoader.setBatchedResponseDelay(0); return imageLoader; } else { // use default ImageLoader for all others AppLog.d(AppLog.T.MEDIA, "using default imageLoader"); return WordPress.imageLoader; } } }
[ "cedric.champeau@gmail.com" ]
cedric.champeau@gmail.com
de445e280c0675d722df1f9034837d9f735f6940
31f609157ae46137cf96ce49e217ce7ae0008b1e
/bin/ext-accelerator/acceleratorfacades/src/de/hybris/platform/acceleratorfacades/product/converters/populator/ProductVolumePricesPopulator.java
2e23837875a7f09f87a60c6aaacc089ae98b0ac0
[]
no_license
natakolesnikova/hybrisCustomization
91d56e964f96373781f91f4e2e7ca417297e1aad
b6f18503d406b65924c21eb6a414eb70d16d878c
refs/heads/master
2020-05-23T07:16:39.311703
2019-05-15T15:08:38
2019-05-15T15:08:38
186,672,599
1
0
null
null
null
null
UTF-8
Java
false
false
5,052
java
/* * [y] hybris Platform * * Copyright (c) 2018 SAP SE or an SAP affiliate company. All rights reserved. * * This software is the confidential and proprietary information of SAP * ("Confidential Information"). You shall not disclose such Confidential * Information and shall use it only in accordance with the terms of the * license agreement you entered into with SAP. */ package de.hybris.platform.acceleratorfacades.product.converters.populator; import de.hybris.platform.commercefacades.product.PriceDataFactory; import de.hybris.platform.commercefacades.product.converters.populator.AbstractProductPopulator; import de.hybris.platform.commercefacades.product.data.PriceData; import de.hybris.platform.commercefacades.product.data.PriceDataType; import de.hybris.platform.commercefacades.product.data.ProductData; import de.hybris.platform.commerceservices.util.AbstractComparator; import de.hybris.platform.core.model.product.ProductModel; import de.hybris.platform.europe1.jalo.PriceRow; import de.hybris.platform.jalo.order.price.PriceInformation; import de.hybris.platform.product.PriceService; import de.hybris.platform.servicelayer.dto.converter.ConversionException; import java.math.BigDecimal; import java.util.ArrayList; import java.util.Collections; import java.util.List; import java.util.Map; import org.apache.commons.collections.CollectionUtils; import org.springframework.beans.factory.annotation.Required; /** * Populator for product volume prices. */ public class ProductVolumePricesPopulator<SOURCE extends ProductModel, TARGET extends ProductData> extends AbstractProductPopulator<SOURCE, TARGET> { private PriceService priceService; private PriceDataFactory priceDataFactory; protected PriceService getPriceService() { return priceService; } @Required public void setPriceService(final PriceService priceService) { this.priceService = priceService; } protected PriceDataFactory getPriceDataFactory() { return priceDataFactory; } @Required public void setPriceDataFactory(final PriceDataFactory priceDataFactory) { this.priceDataFactory = priceDataFactory; } @Override public void populate(final SOURCE productModel, final TARGET productData) throws ConversionException { if (productData != null) { final List<PriceInformation> pricesInfos = getPriceService().getPriceInformationsForProduct(productModel); if (pricesInfos == null || pricesInfos.size() < 2) { productData.setVolumePrices(Collections.<PriceData> emptyList()); } else { final List<PriceData> volPrices = createPrices(productModel, pricesInfos); // Sort the list into quantity order Collections.sort(volPrices, VolumePriceComparator.INSTANCE); // Set the max quantities for (int i = 0; i < volPrices.size() - 1; i++) { volPrices.get(i).setMaxQuantity(Long.valueOf(volPrices.get(i + 1).getMinQuantity().longValue() - 1)); } productData.setVolumePrices(volPrices); } } } protected List<PriceData> createPrices(final SOURCE productModel, final List<PriceInformation> pricesInfos) { final List<PriceData> volPrices = new ArrayList<PriceData>(); final PriceDataType priceType = getPriceType(productModel);//not necessary for (final PriceInformation priceInfo : pricesInfos) { final Long minQuantity = getMinQuantity(priceInfo); if (minQuantity != null) { final PriceData volPrice = createPriceData(priceType, priceInfo); if (volPrice != null) { volPrice.setMinQuantity(minQuantity); volPrices.add(volPrice); } } } return volPrices; } protected PriceDataType getPriceType(final ProductModel productModel) { if (CollectionUtils.isEmpty(productModel.getVariants())) { return PriceDataType.BUY; } else { return PriceDataType.FROM; } } protected Long getMinQuantity(final PriceInformation priceInfo) { final Map qualifiers = priceInfo.getQualifiers(); final Object minQtdObj = qualifiers.get(PriceRow.MINQTD); if (minQtdObj instanceof Long) { return (Long) minQtdObj; } return null; } protected PriceData createPriceData(final PriceDataType priceType, final PriceInformation priceInfo) { return getPriceDataFactory().create(priceType, BigDecimal.valueOf(priceInfo.getPriceValue().getValue()), priceInfo.getPriceValue().getCurrencyIso()); } public static class VolumePriceComparator extends AbstractComparator<PriceData> { public static final VolumePriceComparator INSTANCE = new VolumePriceComparator(); @Override protected int compareInstances(final PriceData price1, final PriceData price2) { if (price1 == null || price1.getMinQuantity() == null) { return BEFORE; } if (price2 == null || price2.getMinQuantity() == null) { return AFTER; } return compareValues(price1.getMinQuantity().longValue(), price2.getMinQuantity().longValue()); } } }
[ "nataliia@spadoom.com" ]
nataliia@spadoom.com
52202305cc4658e186476e3bc18efd4bb1b315ba
2f3bb917adcc081c8ef2f7370787ef83431183c5
/src/main/java/com/igomall/entity/Admin.java
ec350fd4624a739963dfd827d06ba947f95ae53e
[]
no_license
heyewei/shopec-b2b2c
bc7aad32fc632ab20c3ed1f6a875e533d482dfa3
a03fd48250aad4315a6ff687b6d01c7e12d0f93e
refs/heads/master
2023-02-24T13:12:37.985421
2021-01-27T07:24:25
2021-01-27T07:24:25
null
0
0
null
null
null
null
UTF-8
Java
false
false
4,090
java
package com.igomall.entity; import java.util.HashSet; import java.util.Set; import javax.persistence.Entity; import javax.persistence.PrePersist; import javax.persistence.PreUpdate; import javax.persistence.Transient; import javax.validation.constraints.NotEmpty; import org.apache.commons.codec.digest.DigestUtils; import org.apache.commons.lang.StringUtils; import com.baomidou.mybatisplus.annotation.TableField; /** * Entity - 管理员 * */ @Entity public class Admin extends User { private static final long serialVersionUID = -4000007477538426L; /** * 用户名 */ @NotEmpty(groups = Save.class) private String username; /** * 密码 */ @NotEmpty(groups = Save.class) @TableField(exist = false) private String password; /** * 加密密码 */ private String encodedPassword; /** * E-mail */ @NotEmpty private String email; /** * 手机 */ @NotEmpty private String mobile; /** * 姓名 */ private String name; /** * 部门 */ private String department; /** * 角色 */ @TableField(exist=false) private Set<Role> roles = new HashSet<>(); /** * 获取用户名 * * @return 用户名 */ public String getUsername() { return username; } /** * 设置用户名 * * @param username * 用户名 */ public void setUsername(String username) { this.username = username; } /** * 获取密码 * * @return 密码 */ public String getPassword() { return password; } /** * 设置密码 * * @param password * 密码 */ public void setPassword(String password) { this.password = password; if (password != null) { setEncodedPassword(DigestUtils.md5Hex(password)); } } /** * 获取加密密码 * * @return 加密密码 */ public String getEncodedPassword() { return encodedPassword; } /** * 设置加密密码 * * @param encodedPassword * 加密密码 */ public void setEncodedPassword(String encodedPassword) { this.encodedPassword = encodedPassword; } /** * 获取E-mail * * @return E-mail */ public String getEmail() { return email; } /** * 设置E-mail * * @param email * E-mail */ public void setEmail(String email) { this.email = email; } /** * 获取手机 * * @return 手机 */ public String getMobile() { return mobile; } /** * 设置手机 * * @param mobile * 手机 */ public void setMobile(String mobile) { this.mobile = mobile; } /** * 获取姓名 * * @return 姓名 */ public String getName() { return name; } /** * 设置姓名 * * @param name * 姓名 */ public void setName(String name) { this.name = name; } /** * 获取部门 * * @return 部门 */ public String getDepartment() { return department; } /** * 设置部门 * * @param department * 部门 */ public void setDepartment(String department) { this.department = department; } /** * 获取角色 * * @return 角色 */ public Set<Role> getRoles() { return roles; } /** * 设置角色 * * @param roles * 角色 */ public void setRoles(Set<Role> roles) { this.roles = roles; } @Override @Transient public String getDisplayName() { return getUsername(); } @Override @Transient public Object getPrincipal() { return getUsername(); } @Override @Transient public Object getCredentials() { return getPassword(); } @Override @Transient public boolean isValidCredentials(Object credentials) { return credentials != null && StringUtils.equals(DigestUtils.md5Hex(credentials instanceof char[] ? String.valueOf((char[]) credentials) : String.valueOf(credentials)), getEncodedPassword()); } /** * 持久化前处理 */ @PrePersist public void prePersist() { setUsername(StringUtils.lowerCase(getUsername())); setEmail(StringUtils.lowerCase(getEmail())); } /** * 更新前处理 */ @PreUpdate public void preUpdate() { setEmail(StringUtils.lowerCase(getEmail())); } }
[ "1169794338@qq.com" ]
1169794338@qq.com
47a0a7495a5337f4dbae7b2333d6096000e1eb1f
0d4f05c9909695a166e97b8958680945ea5c1266
/src/minecraft/io/netty/handler/codec/Headers.java
c5c5910f84782abf540ad43f4d6719a5bda82610
[]
no_license
MertDundar1/ETB-0.6
31f3f42f51064ffd7facaa95cf9b50d0c2d71995
145d008fed353545157cd0e73daae8bc8d7f50b9
refs/heads/master
2022-01-15T08:42:12.762634
2019-05-15T23:37:33
2019-05-15T23:37:33
null
0
0
null
null
null
null
UTF-8
Java
false
false
5,890
java
package io.netty.handler.codec; import java.util.Iterator; import java.util.List; import java.util.Map.Entry; import java.util.Set; public abstract interface Headers<K, V, T extends Headers<K, V, T>> extends Iterable<Map.Entry<K, V>> { public abstract V get(K paramK); public abstract V get(K paramK, V paramV); public abstract V getAndRemove(K paramK); public abstract V getAndRemove(K paramK, V paramV); public abstract List<V> getAll(K paramK); public abstract List<V> getAllAndRemove(K paramK); public abstract Boolean getBoolean(K paramK); public abstract boolean getBoolean(K paramK, boolean paramBoolean); public abstract Byte getByte(K paramK); public abstract byte getByte(K paramK, byte paramByte); public abstract Character getChar(K paramK); public abstract char getChar(K paramK, char paramChar); public abstract Short getShort(K paramK); public abstract short getShort(K paramK, short paramShort); public abstract Integer getInt(K paramK); public abstract int getInt(K paramK, int paramInt); public abstract Long getLong(K paramK); public abstract long getLong(K paramK, long paramLong); public abstract Float getFloat(K paramK); public abstract float getFloat(K paramK, float paramFloat); public abstract Double getDouble(K paramK); public abstract double getDouble(K paramK, double paramDouble); public abstract Long getTimeMillis(K paramK); public abstract long getTimeMillis(K paramK, long paramLong); public abstract Boolean getBooleanAndRemove(K paramK); public abstract boolean getBooleanAndRemove(K paramK, boolean paramBoolean); public abstract Byte getByteAndRemove(K paramK); public abstract byte getByteAndRemove(K paramK, byte paramByte); public abstract Character getCharAndRemove(K paramK); public abstract char getCharAndRemove(K paramK, char paramChar); public abstract Short getShortAndRemove(K paramK); public abstract short getShortAndRemove(K paramK, short paramShort); public abstract Integer getIntAndRemove(K paramK); public abstract int getIntAndRemove(K paramK, int paramInt); public abstract Long getLongAndRemove(K paramK); public abstract long getLongAndRemove(K paramK, long paramLong); public abstract Float getFloatAndRemove(K paramK); public abstract float getFloatAndRemove(K paramK, float paramFloat); public abstract Double getDoubleAndRemove(K paramK); public abstract double getDoubleAndRemove(K paramK, double paramDouble); public abstract Long getTimeMillisAndRemove(K paramK); public abstract long getTimeMillisAndRemove(K paramK, long paramLong); public abstract boolean contains(K paramK); public abstract boolean contains(K paramK, V paramV); public abstract boolean containsObject(K paramK, Object paramObject); public abstract boolean containsBoolean(K paramK, boolean paramBoolean); public abstract boolean containsByte(K paramK, byte paramByte); public abstract boolean containsChar(K paramK, char paramChar); public abstract boolean containsShort(K paramK, short paramShort); public abstract boolean containsInt(K paramK, int paramInt); public abstract boolean containsLong(K paramK, long paramLong); public abstract boolean containsFloat(K paramK, float paramFloat); public abstract boolean containsDouble(K paramK, double paramDouble); public abstract boolean containsTimeMillis(K paramK, long paramLong); public abstract int size(); public abstract boolean isEmpty(); public abstract Set<K> names(); public abstract T add(K paramK, V paramV); public abstract T add(K paramK, Iterable<? extends V> paramIterable); public abstract T add(K paramK, V... paramVarArgs); public abstract T addObject(K paramK, Object paramObject); public abstract T addObject(K paramK, Iterable<?> paramIterable); public abstract T addObject(K paramK, Object... paramVarArgs); public abstract T addBoolean(K paramK, boolean paramBoolean); public abstract T addByte(K paramK, byte paramByte); public abstract T addChar(K paramK, char paramChar); public abstract T addShort(K paramK, short paramShort); public abstract T addInt(K paramK, int paramInt); public abstract T addLong(K paramK, long paramLong); public abstract T addFloat(K paramK, float paramFloat); public abstract T addDouble(K paramK, double paramDouble); public abstract T addTimeMillis(K paramK, long paramLong); public abstract T add(Headers<? extends K, ? extends V, ?> paramHeaders); public abstract T set(K paramK, V paramV); public abstract T set(K paramK, Iterable<? extends V> paramIterable); public abstract T set(K paramK, V... paramVarArgs); public abstract T setObject(K paramK, Object paramObject); public abstract T setObject(K paramK, Iterable<?> paramIterable); public abstract T setObject(K paramK, Object... paramVarArgs); public abstract T setBoolean(K paramK, boolean paramBoolean); public abstract T setByte(K paramK, byte paramByte); public abstract T setChar(K paramK, char paramChar); public abstract T setShort(K paramK, short paramShort); public abstract T setInt(K paramK, int paramInt); public abstract T setLong(K paramK, long paramLong); public abstract T setFloat(K paramK, float paramFloat); public abstract T setDouble(K paramK, double paramDouble); public abstract T setTimeMillis(K paramK, long paramLong); public abstract T set(Headers<? extends K, ? extends V, ?> paramHeaders); public abstract T setAll(Headers<? extends K, ? extends V, ?> paramHeaders); public abstract boolean remove(K paramK); public abstract T clear(); public abstract Iterator<Map.Entry<K, V>> iterator(); }
[ "realhcfus@gmail.com" ]
realhcfus@gmail.com
7961b6683fc1deba8760586976375574d8f5434e
6def7510eff84f1f87c3a8104d025acabe6daf72
/redisson/src/main/java/org/redisson/api/mapreduce/RReducer.java
36aed233ce42995558030f770a8571ce64336b9a
[ "Apache-2.0" ]
permissive
superhealth/redisson
3137702cd6d001efa9ea87a4d37fae8e35067dc1
09b2724c44567035c8806bfe4a79bdf355c816b8
refs/heads/master
2021-09-01T03:32:05.669015
2017-12-20T11:36:20
2017-12-20T11:36:20
115,315,003
1
0
null
2017-12-25T07:04:48
2017-12-25T07:04:48
null
UTF-8
Java
false
false
1,091
java
/** * Copyright 2016 Nikita Koksharov * * 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.redisson.api.mapreduce; import java.io.Serializable; import java.util.Iterator; /** * Reduces values mapped by key into single value. * * @author Nikita Koksharov * * @param <K> key type * @param <V> value type */ public interface RReducer<K, V> extends Serializable { /** * Invoked for each key * * @param reducedKey - key * @param iter - collection of values * @return value */ V reduce(K reducedKey, Iterator<V> iter); }
[ "abracham.mitchell@gmail.com" ]
abracham.mitchell@gmail.com
d4b5c1036411a20f4f9939dabda53093b7c578f9
f4707f2466a4397a315a659520a98ba59137d460
/src/ch/jmildner/bridge/Drawing.java
c6f0f396b74cd9a2623ab656ed3ffc349ad4563e
[]
no_license
java-akademie/java_designpatterns
5f7de12b0c829472a352516d8869bd64435f7b50
b08349d6dc3bfb9bac6da17ebb7693a58a10de68
refs/heads/master
2020-03-25T07:18:15.585758
2018-08-09T08:35:04
2018-08-09T08:35:04
143,553,159
0
0
null
null
null
null
UTF-8
Java
false
false
218
java
package ch.jmildner.bridge; public abstract class Drawing { abstract public void drawCircle(double x, double y, double r); abstract public void drawLine(double x1, double y1, double x2, double y2); }
[ "johann.mildner@balcab.ch" ]
johann.mildner@balcab.ch
b1b147eaf281538acb0d5c3573a2c11c25331feb
bbf526bca24e395fcc87ef627f6c196d30a1844f
/building-h2o/H2O.java
927559b8d809f0b9f31c08716163b062fe2baf47
[]
no_license
charles-wangkai/leetcode
864e39505b230ec056e9b4fed3bb5bcb62c84f0f
778c16f6cbd69c0ef6ccab9780c102b40731aaf8
refs/heads/master
2023-08-31T14:44:52.850805
2023-08-31T03:04:02
2023-08-31T03:04:02
25,644,039
52
18
null
2021-06-05T00:02:50
2014-10-23T15:29:44
Java
UTF-8
Java
false
false
1,290
java
import java.util.concurrent.locks.Condition; import java.util.concurrent.locks.Lock; import java.util.concurrent.locks.ReentrantLock; public class H2O { Lock lock = new ReentrantLock(); Condition canReleaseH = lock.newCondition(); Condition canReleaseO = lock.newCondition(); int hCount = 0; int oCount = 0; int releaseCount = 0; int index; public void hydrogen(Runnable releaseHydrogen) throws InterruptedException { lock.lock(); try { hCount++; if (hCount >= 2 && oCount >= 1) { releaseCount++; } while (!(index < releaseCount * 3 && index % 3 != 2)) { canReleaseH.await(); } // releaseHydrogen.run() outputs "H". Do not change or remove this line. releaseHydrogen.run(); index++; canReleaseH.signal(); canReleaseO.signal(); } finally { lock.unlock(); } } public void oxygen(Runnable releaseOxygen) throws InterruptedException { lock.lock(); try { oCount++; if (hCount >= 2 && oCount >= 1) { releaseCount++; } while (!(index < releaseCount * 3 && index % 3 == 2)) { canReleaseO.await(); } // releaseOxygen.run() outputs "H". Do not change or remove this line. releaseOxygen.run(); index++; canReleaseH.signal(); canReleaseO.signal(); } finally { lock.unlock(); } } }
[ "charles.wangkai@gmail.com" ]
charles.wangkai@gmail.com
55b22956eb703bc7892de03138c23641617796eb
5784885d3d232a1197a76a9918a5b43c514ba4fb
/jspeedtest/src/test/java/fr/bmartel/speedtest/test/server/IHttpStream.java
a2f0effbdb9048aaf67f29f86c2a780d65a81f3d
[ "MIT" ]
permissive
sherry-android/speed-test-lib
bd8177e8779682e8a6621d0984cb58f6430a37c2
882d0afdb46b8c7f86bff1d978a38727f1b1f600
refs/heads/master
2021-03-29T05:36:28.677849
2020-04-08T03:03:52
2020-04-08T03:03:52
247,923,342
0
0
MIT
2020-03-17T09:01:32
2020-03-17T09:01:31
null
UTF-8
Java
false
false
1,495
java
/* * The MIT License (MIT) * <p/> * Copyright (c) 2016-2017 Bertrand Martel * <p/> * 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: * <p/> * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * <p/> * 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 fr.bmartel.speedtest.test.server; /** * Interface for writing http data frame * * @author Bertrand Martel */ public interface IHttpStream { /** * Write http request frame * * @param data data to be written * @return 0 if OK -1 if error */ int writeHttpFrame(byte[] data); }
[ "bmartel.fr@gmail.com" ]
bmartel.fr@gmail.com
0e78add91ba4c99513a442202bfe748036ca4853
0af8b92686a58eb0b64e319b22411432aca7a8f3
/single-large-project/src/test/java/org/gradle/test/performancenull_459/Testnull_45875.java
276222ef3549b3dd56e5bc4912fa7f43a19969a5
[]
no_license
gradle/performance-comparisons
b0d38db37c326e0ce271abebdb3c91769b860799
e53dc7182fafcf9fedf07920cbbea8b40ee4eef4
refs/heads/master
2023-08-14T19:24:39.164276
2022-11-24T05:18:33
2022-11-24T05:18:33
80,121,268
17
15
null
2022-09-30T08:04:35
2017-01-26T14:25:33
null
UTF-8
Java
false
false
308
java
package org.gradle.test.performancenull_459; import static org.junit.Assert.*; public class Testnull_45875 { private final Productionnull_45875 production = new Productionnull_45875("value"); @org.junit.Test public void test() { assertEquals(production.getProperty(), "value"); } }
[ "cedric.champeau@gmail.com" ]
cedric.champeau@gmail.com
103289b539cc5650f51ad77de0e21cbaf9572889
ea38db0eaecefcbf4f7f85056eefe2e06f015dc4
/java-basic/src/main/java/bitcamp/java100/ch02/Test11_12.java
626dcedff2a6429c72b224f8ed4486b66e80477b
[]
no_license
tjr7788/bitcamp
5b8dfff352a812719b2013a8e59c72f271e3e758
89cfab1e2cc1de403a04d033db431b29dde7e361
refs/heads/master
2021-09-05T05:17:05.620145
2018-01-24T09:53:16
2018-01-24T09:53:16
104,423,411
0
1
null
null
null
null
UTF-8
Java
false
false
390
java
package bitcamp.java100.ch02; public class Test11_12 { public static void main(String[] args) { System.out.println("ABC"); System.out.println("가각간"); System.out.println("가"); System.out.println('가'); System.out.println("ABC\n가각간"); System.out.println("ABC\uAC00\uac00똘똠똥"); System.out.println(""); } }
[ "sig4213@naver.com" ]
sig4213@naver.com
ee090459e4c074154b8c3f4219a70a79b431b20f
00f9bfc3bda11e828dfee5796c811a36f3ccd617
/7.0.0-alpha03/com.android.tools.build/gradle/com/android/build/gradle/internal/plugins/DynamicFeaturePlugin.java
f781d87e72fc1bbee29cb93e4fe156e2ac5361e5
[ "Apache-2.0" ]
permissive
NirvanaNimbusa/agp-sources
c2fa758f27a628121c60a770ff046c1860cd4177
2b16dd9e08744d6e4f011fa5d0c550530c6a2c0e
refs/heads/master
2023-02-17T22:11:45.787321
2021-01-19T22:06:09
2021-01-19T22:10:26
null
0
0
null
null
null
null
UTF-8
Java
false
false
7,166
java
/* * Copyright (C) 2019 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.build.gradle.internal.plugins; import com.android.AndroidProjectTypes; import com.android.annotations.NonNull; import com.android.build.api.component.impl.TestComponentBuilderImpl; import com.android.build.api.component.impl.TestComponentImpl; import com.android.build.api.extension.DynamicFeatureAndroidComponentsExtension; import com.android.build.api.extension.impl.DynamicFeatureAndroidComponentsExtensionImpl; import com.android.build.api.extension.impl.VariantApiOperationsRegistrar; import com.android.build.api.variant.impl.DynamicFeatureVariantBuilderImpl; import com.android.build.api.variant.impl.DynamicFeatureVariantImpl; import com.android.build.gradle.BaseExtension; import com.android.build.gradle.api.BaseVariantOutput; import com.android.build.gradle.internal.ExtraModelInfo; import com.android.build.gradle.internal.dsl.BuildType; import com.android.build.gradle.internal.dsl.DefaultConfig; import com.android.build.gradle.internal.dsl.DynamicFeatureExtension; import com.android.build.gradle.internal.dsl.DynamicFeatureExtensionImpl; import com.android.build.gradle.internal.dsl.ProductFlavor; import com.android.build.gradle.internal.dsl.SigningConfig; import com.android.build.gradle.internal.scope.GlobalScope; import com.android.build.gradle.internal.services.DslServices; import com.android.build.gradle.internal.services.ProjectServices; import com.android.build.gradle.internal.tasks.DynamicFeatureTaskManager; import com.android.build.gradle.internal.variant.ComponentInfo; import com.android.build.gradle.internal.variant.DynamicFeatureVariantFactory; import com.android.build.gradle.options.BooleanOption; import com.android.builder.model.v2.ide.ProjectType; import com.google.wireless.android.sdk.stats.GradleBuildProject; import java.util.List; import javax.inject.Inject; import org.gradle.api.NamedDomainObjectContainer; import org.gradle.api.Project; import org.gradle.api.component.SoftwareComponentFactory; import org.gradle.build.event.BuildEventsListenerRegistry; import org.gradle.tooling.provider.model.ToolingModelBuilderRegistry; /** Gradle plugin class for 'application' projects, applied on an optional APK module */ public class DynamicFeaturePlugin extends AbstractAppPlugin< DynamicFeatureAndroidComponentsExtension, DynamicFeatureVariantBuilderImpl, DynamicFeatureVariantImpl> { @Inject public DynamicFeaturePlugin( ToolingModelBuilderRegistry registry, SoftwareComponentFactory componentFactory, BuildEventsListenerRegistry listenerRegistry) { super(registry, componentFactory, listenerRegistry); } @Override protected int getProjectType() { return AndroidProjectTypes.PROJECT_TYPE_DYNAMIC_FEATURE; } @Override protected ProjectType getProjectTypeV2() { return ProjectType.DYNAMIC_FEATURE; } @NonNull @Override protected GradleBuildProject.PluginType getAnalyticsPluginType() { return GradleBuildProject.PluginType.DYNAMIC_FEATURE; } @Override protected void pluginSpecificApply(@NonNull Project project) { // do nothing } @NonNull @Override protected BaseExtension createExtension( @NonNull DslServices dslServices, @NonNull GlobalScope globalScope, @NonNull DslContainerProvider<DefaultConfig, BuildType, ProductFlavor, SigningConfig> dslContainers, @NonNull NamedDomainObjectContainer<BaseVariantOutput> buildOutputs, @NonNull ExtraModelInfo extraModelInfo) { if (globalScope.getProjectOptions().get(BooleanOption.USE_NEW_DSL_INTERFACES)) { return (BaseExtension) project.getExtensions() .create( com.android.build.api.dsl.DynamicFeatureExtension.class, "android", DynamicFeatureExtension.class, dslServices, globalScope, buildOutputs, dslContainers.getSourceSetManager(), extraModelInfo, new DynamicFeatureExtensionImpl(dslServices, dslContainers)); } return project.getExtensions() .create( "android", DynamicFeatureExtension.class, dslServices, globalScope, buildOutputs, dslContainers.getSourceSetManager(), extraModelInfo, new DynamicFeatureExtensionImpl(dslServices, dslContainers)); } @NonNull @Override protected DynamicFeatureAndroidComponentsExtension createComponentExtension( @NonNull DslServices dslServices, @NonNull VariantApiOperationsRegistrar< DynamicFeatureVariantBuilderImpl, DynamicFeatureVariantImpl> variantApiOperationsRegistrar) { return project.getExtensions() .create( DynamicFeatureAndroidComponentsExtension.class, "androidComponents", DynamicFeatureAndroidComponentsExtensionImpl.class, dslServices, variantApiOperationsRegistrar); } @NonNull @Override protected DynamicFeatureTaskManager createTaskManager( @NonNull List<ComponentInfo<DynamicFeatureVariantBuilderImpl, DynamicFeatureVariantImpl>> variants, @NonNull List<ComponentInfo<TestComponentBuilderImpl, TestComponentImpl>> testComponents, boolean hasFlavors, @NonNull GlobalScope globalScope, @NonNull BaseExtension extension) { return new DynamicFeatureTaskManager( variants, testComponents, hasFlavors, globalScope, extension); } @NonNull @Override protected DynamicFeatureVariantFactory createVariantFactory( @NonNull ProjectServices projectServices, @NonNull GlobalScope globalScope) { return new DynamicFeatureVariantFactory(projectServices, globalScope); } }
[ "john.rodriguez@gmail.com" ]
john.rodriguez@gmail.com
edcb1d5f2c70a7ee25cee4e7575d9c130e040081
6f73a0d38addee468dd21aba1d5d53963be84825
/application/src/test/java/org/mifos/application/fees/struts/actionforms/FeeActionFormTest.java
95f13d189d3ed0ffd210e37b26645d41ffd90ffb
[ "LicenseRef-scancode-unknown-license-reference", "Apache-2.0" ]
permissive
mifos/1.4.x
0f157f74220e8e65cc13c4252bf597c80aade1fb
0540a4b398407b9415feca1f84b6533126d96511
refs/heads/master
2020-12-25T19:26:15.934566
2010-05-11T23:34:08
2010-05-11T23:34:08
2,946,607
0
0
null
null
null
null
UTF-8
Java
false
false
2,251
java
/* * Copyright (c) 2005-2009 Grameen Foundation USA * All rights reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or * implied. See the License for the specific language governing * permissions and limitations under the License. * * See also http://www.apache.org/licenses/LICENSE-2.0.html for an * explanation of the license and how it is applied. */ package org.mifos.application.fees.struts.actionforms; import java.util.Locale; import junit.framework.Assert; import org.apache.struts.action.ActionErrors; import org.junit.After; import org.junit.Before; import org.junit.Test; import org.mifos.framework.TestUtils; public class FeeActionFormTest { Locale locale = TestUtils.ukLocale(); FeeActionForm form; @Before public void setUp() { form = new FeeActionForm(); } @After public void tearDown() { form = null; } @Test public void testIsAmountValidWithNonNumberString() { form.setAmount("aaa"); Assert.assertFalse(isAmountValid(form)); } @Test public void testIsAmountValidWithValidString() { form.setAmount("2.5"); Assert.assertTrue(isAmountValid(form)); } @Test public void testIsAmountValidWithTooMuchPrecision() { form.setAmount("2.12345"); Assert.assertFalse(isAmountValid(form)); } @Test public void testIsAmountValidWithZero() { form.setAmount("0.0"); Assert.assertFalse(isAmountValid(form)); } @Test public void testIsAmountValidWithTooLargeANumber() { form.setAmount("12345678.5"); Assert.assertFalse(isAmountValid(form)); } private boolean isAmountValid(FeeActionForm form) { ActionErrors errors = new ActionErrors(); form.validateAmount(errors, locale); return errors.size() == 0; } }
[ "meonkeys@a8845c50-7012-0410-95d3-8e1449b9b1e4" ]
meonkeys@a8845c50-7012-0410-95d3-8e1449b9b1e4
f90006ee4a0fef0d87d4335b93f3b791bd4e8e79
0f1a73dc0329cead4fa60981c1c1eb141d758a5d
/kfs-parent/core/src/main/java/org/kuali/kfs/module/purap/businessobject/PurchasingCapitalAssetItem.java
c77f174193fc9f488a711ce1f3ad2a18ddefea8b
[]
no_license
r351574nc3/kfs-maven
20d9f1a65c6796e623c4845f6d68834c30732503
5f213604df361a874cdbba0de057d4cd5ea1da11
refs/heads/master
2016-09-06T15:07:01.034167
2012-06-01T07:40:46
2012-06-01T07:40:46
3,441,165
0
0
null
null
null
null
UTF-8
Java
false
false
2,270
java
/* * Copyright 2011 The Kuali Foundation. * * Licensed under the Educational Community License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.opensource.org/licenses/ecl2.php * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org.kuali.kfs.module.purap.businessobject; import org.kuali.kfs.integration.cab.CapitalAssetBuilderAssetTransactionType; import org.kuali.kfs.integration.purap.CapitalAssetSystem; import org.kuali.kfs.integration.purap.ItemCapitalAsset; import org.kuali.kfs.module.purap.document.PurchasingDocument; import org.kuali.rice.kns.bo.ExternalizableBusinessObject; public interface PurchasingCapitalAssetItem { public Integer getCapitalAssetItemIdentifier(); public void setCapitalAssetItemIdentifier(Integer capitalAssetItemIdentifier); public Integer getItemIdentifier(); public void setItemIdentifier(Integer itemIdentifier); public String getCapitalAssetTransactionTypeCode(); public void setCapitalAssetTransactionTypeCode(String capitalAssetTransactionTypeCode); public Integer getCapitalAssetSystemIdentifier(); public void setCapitalAssetSystemIdentifier(Integer capitalAssetSystemIdentifier); public CapitalAssetBuilderAssetTransactionType getCapitalAssetTransactionType(); public CapitalAssetSystem getPurchasingCapitalAssetSystem(); public void setPurchasingCapitalAssetSystem(CapitalAssetSystem purchasingCapitalAssetSystem); public PurchasingDocument getPurchasingDocument(); public void setPurchasingDocument(PurchasingDocument pd); public PurchasingItem getPurchasingItem(); public boolean isEmpty(); public ItemCapitalAsset getNewPurchasingItemCapitalAssetLine(); public ItemCapitalAsset getAndResetNewPurchasingItemCapitalAssetLine(); }
[ "r351574nc3@gmail.com" ]
r351574nc3@gmail.com
7a212057fe0bd6fbb59e67382e45033f179bcb56
3e470b50ca9985bac5bc69f0511509f33428bdc2
/MultiBase/src/com/hyl/hylbase/fragment/Fragment3.java
7f81ad112f3f4e2ebf9c5602a2da4c56094f4fb4
[]
no_license
czqaiwsm/Template
d99981cebdcc44e465c5a6b853c2d26175a0808d
77bba147c75c578102ab46511124a92a8146cabc
refs/heads/master
2020-05-21T04:22:03.930089
2016-06-17T15:05:38
2016-06-17T15:05:38
46,535,860
0
0
null
null
null
null
UTF-8
Java
false
false
518
java
package com.hyl.hylbase.fragment; import com.hyl.hylbase.R; import android.os.Bundle; import android.support.v4.app.Fragment; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; public class Fragment3 extends BaseFragment { private View view; @Override public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { if(view==null){ view=inflater.inflate(R.layout.fragment3, null); } return view; } }
[ "1148392049@qq.com" ]
1148392049@qq.com
5885c422e92197221afbbbab02b27a397e7df0e0
8ec379a02be629165c97f12d75551e09279e5f97
/shop-activity/src/main/java/quick/pager/shop/mapper/ExchangeActivityRuleMapper.java
db5dacc3fe1355b9a5c843d4ff98a7a4a3179fd5
[ "MIT" ]
permissive
donniezhanggit/spring-cloud-shop
73c9e99c714310cb4ecbacb2f764a452b24dfefc
aeeaba1be804d7197692fa6bef8bdcaedb2302ac
refs/heads/master
2020-06-19T14:15:02.682581
2019-10-14T06:25:38
2019-10-14T06:25:38
196,739,760
0
0
MIT
2019-10-14T06:25:40
2019-07-13T15:56:03
Java
UTF-8
Java
false
false
582
java
package quick.pager.shop.mapper; import java.util.List; import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Param; import quick.pager.shop.model.activity.ExchangeActivityRule; /** * @author siguiyang */ @Mapper public interface ExchangeActivityRuleMapper { int insertSelective(ExchangeActivityRule record); ExchangeActivityRule selectByPrimaryKey(Long id); int updateByPrimaryKeySelective(ExchangeActivityRule record); /** * 表格查询 */ List<ExchangeActivityRule> select(@Param("activityId") Long activityId); }
[ "siguiyang1992@outlook.com" ]
siguiyang1992@outlook.com
e9b1e2699f62628c4ae407a331fbe5773d0aec42
bf0fc13badc23259025922af1e79fc4f1621fb5c
/sshd-core/src/main/java/org/apache/sshd/common/TcpipForwarder.java
559445649d81b7465a5831a6c2e2a1cf305ae8da
[ "Apache-2.0" ]
permissive
Connecty/mina-sshd
f02b6ff71ee073713ff0f1af46d61ffae41740a4
b032ba05c74c834494acf602741f2c49c382bd74
refs/heads/master
2021-01-17T22:40:10.863241
2013-04-30T06:53:52
2013-04-30T06:53:52
null
0
0
null
null
null
null
UTF-8
Java
false
false
3,053
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.sshd.common; public interface TcpipForwarder { /** * Start forwarding the given local address on the client to the given address on the server. */ SshdSocketAddress startLocalPortForwarding(SshdSocketAddress local, SshdSocketAddress remote) throws Exception; /** * Stop forwarding the given local address. */ void stopLocalPortForwarding(SshdSocketAddress local) throws Exception; /** * Start forwarding tcpip from the given remote address to the * given local address. * * The remote host name is the address to bind to on the server: * <ul> * <li>"" means that connections are to be accepted on all protocol families * supported by the SSH implementation</li> * <li>"0.0.0.0" means to listen on all IPv4 addresses</li> * <li>"::" means to listen on all IPv6 addresses</li> * <li>"localhost" means to listen on all protocol families supported by the SSH * implementation on loopback addresses only, [RFC3330] and RFC3513]</li> * <li>"127.0.0.1" and "::1" indicate listening on the loopback interfaces for * IPv4 and IPv6 respectively</li> * </ul> * */ SshdSocketAddress startRemotePortForwarding(SshdSocketAddress remote, SshdSocketAddress local) throws Exception; /** * Stop forwarding of the given remote address. */ void stopRemotePortForwarding(SshdSocketAddress remote) throws Exception; /** * Retrieve the local address that the remote port is forwarded to * @param remotePort * @return */ SshdSocketAddress getForwardedPort(int remotePort); /** * Called when the other side requested a remote port forward. * @param local * @return the list of bound local addresses * @throws Exception */ SshdSocketAddress localPortForwardingRequested(SshdSocketAddress local) throws Exception; /** * Called when the other side cancelled a remote port forward. * @param local * @throws Exception */ void localPortForwardingCancelled(SshdSocketAddress local) throws Exception; /** * Close the forwarder */ void close(); }
[ "gnodet@apache.org" ]
gnodet@apache.org
5a46375e00735413c729f1d2bddb42e5673a79a0
9fcf05729b131e40eedb8bbc1b2e04dbf6f02c98
/Java/samples/org/test/SpriteSheetFontTest.java
c35be2d1799a5a52df1ccfb8689964e0287c59c0
[ "Apache-2.0" ]
permissive
choiyongwoo/LGame
68661774ca4c913e8fae8378a2f291939430fa37
f007cee4c017702d5dd3d7966cb99b3c69bec616
refs/heads/master
2020-05-29T13:39:00.447566
2019-05-28T01:30:53
2019-05-28T01:30:53
189,168,503
1
0
null
2019-05-29T06:59:15
2019-05-29T06:59:14
null
UTF-8
Java
false
false
1,291
java
package org.test; import loon.LTransition; import loon.Screen; import loon.action.sprite.SpriteSheet; import loon.action.sprite.SpriteSheetFont; import loon.canvas.LColor; import loon.event.GameTouch; import loon.opengl.GLEx; import loon.utils.timer.LTimerContext; public class SpriteSheetFontTest extends Screen { SpriteSheetFont font; public LTransition onTransition() { return LTransition.newEmpty(); } @Override public void draw(GLEx g) { if (font != null) { font.drawString(g, "FONT EXAMPLE \nTEST NEW LINES", 80, 25, LColor.red); font.drawString(g, "MORE COMPLETE LINE", 80, 100); } } @Override public void onLoad() { SpriteSheet sheet = new SpriteSheet("spriteSheetFont.png", 32, 32); font = new SpriteSheetFont(sheet, ' '); font.setFontScale(0.5f); add(MultiScreenTest.getBackButton(this,0)); } @Override public void alter(LTimerContext timer) { } @Override public void resize(int width, int height) { } @Override public void touchDown(GameTouch e) { } @Override public void touchUp(GameTouch e) { } @Override public void touchMove(GameTouch e) { } @Override public void touchDrag(GameTouch e) { } @Override public void resume() { } @Override public void pause() { } @Override public void close() { } }
[ "longwind2012@hotmail.com" ]
longwind2012@hotmail.com
38389794b406a2b5b452d13337cadba87ca13cb8
e207d34bce10118ea5ed950258c52d14a69f12eb
/src/main/java/com/sim/andon/web/core/jdbc/common/JdbcException.java
40f91d6ad09781ee18ef39de2933a2baab92c3b9
[]
no_license
yangfancoming/andon
78a4b047534f699fd4b186b62ab43fc03a4e786f
51810a351226533c041a0200531983340b6afdc8
refs/heads/master
2022-07-13T02:24:19.767818
2020-03-16T13:04:02
2020-03-16T13:04:02
247,703,908
0
0
null
2022-06-29T18:01:18
2020-03-16T13:03:46
Java
UTF-8
Java
false
false
1,281
java
package com.sim.andon.web.core.jdbc.common; /** * <br>创建日期:2015年5月18日 * <br><b>Copyright 2015 UTOUU All Rights Reserved</b> * @author jinww * @since 1.0 * @version 1.0 */ public class JdbcException extends RuntimeException{ private static final long serialVersionUID = -1956089458134530038L; private String errorCode; /** * */ public JdbcException() { super(); // TODO Auto-generated constructor stub } /** * @param errorCode 错误代码 * @param message 信息 */ public JdbcException(String errorCode, String message){ super(message); this.errorCode = errorCode; } /** * @param message 信息 * @param cause 异常 */ public JdbcException(String message, Throwable cause) { super(message, cause); // TODO Auto-generated constructor stub } /** * @param message 信息 */ public JdbcException(String message) { super(message); // TODO Auto-generated constructor stub } /** * @param cause 异常 */ public JdbcException(Throwable cause) { super(cause); // TODO Auto-generated constructor stub } /** * @since 1.0 * @return * <br><b>作者: @author jinww</b> * <br>创建时间:2015年5月18日 下午4:09:43 */ public String getErrorCode() { return errorCode; } }
[ "34465021+jwfl724168@users.noreply.github.com" ]
34465021+jwfl724168@users.noreply.github.com
eac95989d634372647be0c5582250dd731eb9100
a1d7e6df113cddc1075566768c1c152ba26c25af
/Machinetta/State/BeliefType/Probability/TableRV.java
341f4fd9137b775d156bf66b79c4e8b5aaa0055f
[ "BSD-3-Clause" ]
permissive
seanrowens/Machinetta
1c978247b4a4a72390e2f0d8fddcff327d4c715b
a67c0341b88f9f1159b260b250b685e760e17b81
refs/heads/master
2020-12-30T15:22:44.502620
2017-05-13T00:08:42
2017-05-13T00:08:42
91,138,166
1
0
null
null
null
null
UTF-8
Java
false
false
4,968
java
/******************************************************************************* * Copyright (C) 2017, Paul Scerri, Sean R Owens * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: * * 1. Redistributions of source code must retain the above copyright notice, * this list of conditions and the following disclaimer. * * 2. 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. * * 3. Neither the name of the copyright holder 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 HOLDER 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. ******************************************************************************/ /* * TableRV.java * * Created on October 14, 2002, 2:21 PM */ package Machinetta.State.BeliefType.Probability; import java.util.Hashtable; import java.util.Enumeration; /** * * @author pynadath */ public class TableRV extends RandomVariable { /** The table containing the distribution */ public Hashtable probTable = null; /** The maximum domain value, stored here for convenience */ public double maxDomainValue = Double.NEGATIVE_INFINITY; /** For auto XML */ public TableRV() {} public Machinetta.State.BeliefID makeID() { return new Machinetta.State.BeliefNameID("AnonymousRandomVariable"); } /** Creates a new instance of TableRV * NOTE: Does not support domains with negative values !!! * @param prob A hashtable specifying the distribution of this RV where P(RV=key)=value (with both key, value being of type Double) */ public TableRV(Hashtable prob) { probTable = prob; /** Let's figure out what the maximum allowed domain value is */ for (Enumeration keyList = prob.keys(); keyList.hasMoreElements(); ) { double domainValue = ((Double)keyList.nextElement()).doubleValue();; if (domainValue > maxDomainValue) maxDomainValue = domainValue; } } /** @return The largest possible domain value */ public double getMaxValue() { return maxDomainValue; } /** @return An enumeration of the domain elements */ public Enumeration getDomain() { return probTable.keys(); } /** Accesses the cumulative distribution function of this RV * @param threshold * @return For RV X, returns F_X(threshold) */ public double getProbLessThan(double threshold) { double probability = 0.0; for (Enumeration keyList = probTable.keys(); keyList.hasMoreElements(); ) { Double domainValue = (Double)keyList.nextElement(); if (domainValue.doubleValue() < threshold) { Double probValue = (Double)probTable.get(domainValue); probability = probability + probValue.doubleValue(); } } return probability; } /** Access the probability mass function of this RV * @param domainValue * @return For RV X, returns f_X(domainValue) */ public double getProbability(double domainValue) { Double probValue = (Double)probTable.get(new Double(domainValue)); if (probValue == null) return 0.0; else return probValue.doubleValue(); } public String toString() { return probTable.toString(); } /** @return The expected value of this random variable */ public double getExpectation() { double expectedValue = 0.0; for (Enumeration domain = getDomain(); domain.hasMoreElements(); ) { double domainValue = ((Double)domain.nextElement()).doubleValue(); double probValue = getProbability(domainValue); expectedValue = expectedValue + probValue*domainValue; } return expectedValue; } public static final long serialVersionUID = 1L; }
[ "seanrowens@gmail.com" ]
seanrowens@gmail.com
825d7aeee983ffc35288621ec28adbd04441134b
10378c580b62125a184f74f595d2c37be90a5769
/com/github/steveice10/netty/handler/ssl/util/ThreadLocalInsecureRandom.java
22a2f14f90733458681a1c7962761abfa59a4fe3
[]
no_license
ClientPlayground/Melon-Client
4299d7f3e8f2446ae9f225c0d7fcc770d4d48ecb
afc9b11493e15745b78dec1c2b62bb9e01573c3d
refs/heads/beta-v2
2023-04-05T20:17:00.521159
2021-03-14T19:13:31
2021-03-14T19:13:31
347,509,882
33
19
null
2021-03-14T19:13:32
2021-03-14T00:27:40
null
UTF-8
Java
false
false
1,402
java
package com.github.steveice10.netty.handler.ssl.util; import com.github.steveice10.netty.util.internal.PlatformDependent; import java.security.SecureRandom; import java.util.Random; final class ThreadLocalInsecureRandom extends SecureRandom { private static final long serialVersionUID = -8209473337192526191L; private static final SecureRandom INSTANCE = new ThreadLocalInsecureRandom(); static SecureRandom current() { return INSTANCE; } public String getAlgorithm() { return "insecure"; } public void setSeed(byte[] seed) {} public void setSeed(long seed) {} public void nextBytes(byte[] bytes) { random().nextBytes(bytes); } public byte[] generateSeed(int numBytes) { byte[] seed = new byte[numBytes]; random().nextBytes(seed); return seed; } public int nextInt() { return random().nextInt(); } public int nextInt(int n) { return random().nextInt(n); } public boolean nextBoolean() { return random().nextBoolean(); } public long nextLong() { return random().nextLong(); } public float nextFloat() { return random().nextFloat(); } public double nextDouble() { return random().nextDouble(); } public double nextGaussian() { return random().nextGaussian(); } private static Random random() { return PlatformDependent.threadLocalRandom(); } }
[ "Hot-Tutorials@users.noreply.github.com" ]
Hot-Tutorials@users.noreply.github.com
6f370e6bc21124b3f2b5fb7fe321af377a2d50fa
d593ad37a82a6396effceaf11679e70fddcabc06
/winapi/src/andexam/ver4_1/c13_advwidget/RatingBarTest.java
0189499cdad8420d00f1a278cae321baf4350255
[]
no_license
psh667/android
8a18ea22c8c977852ba2cd9361a8489586e06f05
8f7394de8e26ce5106d9828cf95eb1617afca757
refs/heads/master
2018-12-27T23:30:46.988404
2013-09-09T13:16:46
2013-09-09T13:16:46
12,700,292
3
5
null
null
null
null
UTF-8
Java
false
false
726
java
package andexam.ver4_1.c13_advwidget; import andexam.ver4_1.*; import android.app.*; import android.os.*; import android.widget.*; public class RatingBarTest extends Activity { RatingBar mRating; TextView mRateText; public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.ratingbartest); mRating = (RatingBar)findViewById(R.id.ratingbar); mRateText = (TextView)findViewById(R.id.ratetext); mRating.setOnRatingBarChangeListener(new RatingBar.OnRatingBarChangeListener() { public void onRatingChanged(RatingBar ratingBar, float rating, boolean fromUser) { mRateText.setText("Now Rate : " + rating); } }); } }
[ "paksan@daum.net" ]
paksan@daum.net
f4b153ed0de251f5f105159dc5d5d5f6b219240f
be73270af6be0a811bca4f1710dc6a038e4a8fd2
/crash-reproduction-moho/results/XWIKI-13544-62-27-MOEAD-WeightedSum:TestLen:CallDiversity/com/xpn/xwiki/web/ActionFilter_ESTest_scaffolding.java
94b125983b778eb15a34ca9fa0e499d569e86233
[]
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
434
java
/** * Scaffolding file used to store all the setups needed to run * tests automatically generated by EvoSuite * Mon Jan 20 01:42:38 UTC 2020 */ package com.xpn.xwiki.web; import org.evosuite.runtime.annotation.EvoSuiteClassExclude; import org.junit.BeforeClass; import org.junit.Before; import org.junit.After; @EvoSuiteClassExclude public class ActionFilter_ESTest_scaffolding { // Empty scaffolding for empty test suite }
[ "pouria.derakhshanfar@gmail.com" ]
pouria.derakhshanfar@gmail.com
d020c1f36b099b2f1113b3671e50b322de8cd93e
0af8b92686a58eb0b64e319b22411432aca7a8f3
/large-multiproject/project81/src/test/java/org/gradle/test/performance81_3/Test81_286.java
faac3a504bc8d943eab67afad2d0e96cf9591715
[]
no_license
gradle/performance-comparisons
b0d38db37c326e0ce271abebdb3c91769b860799
e53dc7182fafcf9fedf07920cbbea8b40ee4eef4
refs/heads/master
2023-08-14T19:24:39.164276
2022-11-24T05:18:33
2022-11-24T05:18:33
80,121,268
17
15
null
2022-09-30T08:04:35
2017-01-26T14:25:33
null
UTF-8
Java
false
false
292
java
package org.gradle.test.performance81_3; import static org.junit.Assert.*; public class Test81_286 { private final Production81_286 production = new Production81_286("value"); @org.junit.Test public void test() { assertEquals(production.getProperty(), "value"); } }
[ "cedric.champeau@gmail.com" ]
cedric.champeau@gmail.com
d95ec65802b5904f0897c916caa99a415d0f9d0d
5148293c98b0a27aa223ea157441ac7fa9b5e7a3
/Method_Scraping/xml_scraping/NicadOutputFile_t1_beam_2nd/Nicad_t1_beam_2nd828.java
fbd8cad91d4d5fe29b431530b2dfd646c5143c28
[]
no_license
ryosuke-ku/TestCodeSeacherPlus
cfd03a2858b67a05ecf17194213b7c02c5f2caff
d002a52251f5461598c7af73925b85a05cea85c6
refs/heads/master
2020-05-24T01:25:27.000821
2019-08-17T06:23:42
2019-08-17T06:23:42
187,005,399
0
0
null
null
null
null
UTF-8
Java
false
false
529
java
// clone pairs:4472:70% // 5598:beam/runners/core-java/src/main/java/org/apache/beam/runners/core/triggers/AfterProcessingTimeStateMachine.java public class Nicad_t1_beam_2nd828 { public boolean equals(Object obj) { if (this == obj) { return true; } if (!(obj instanceof AfterProcessingTimeStateMachine)) { return false; } AfterProcessingTimeStateMachine that = (AfterProcessingTimeStateMachine) obj; return Objects.equals(this.timestampMappers, that.timestampMappers); } }
[ "naist1020@gmail.com" ]
naist1020@gmail.com
79951dae7972e4f191b2a9e287b22e1ad0cd87fa
be73270af6be0a811bca4f1710dc6a038e4a8fd2
/crash-reproduction-moho/results/XWIKI-12584-1-16-MOEAD-WeightedSum:TestLen:CallDiversity/com/xpn/xwiki/store/XWikiHibernateStore_ESTest_scaffolding.java
8b257fa73eb795411005de8299250341d7eddf9b
[]
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
443
java
/** * Scaffolding file used to store all the setups needed to run * tests automatically generated by EvoSuite * Tue Apr 07 20:37:34 UTC 2020 */ package com.xpn.xwiki.store; import org.evosuite.runtime.annotation.EvoSuiteClassExclude; import org.junit.BeforeClass; import org.junit.Before; import org.junit.After; @EvoSuiteClassExclude public class XWikiHibernateStore_ESTest_scaffolding { // Empty scaffolding for empty test suite }
[ "pouria.derakhshanfar@gmail.com" ]
pouria.derakhshanfar@gmail.com
2750fc1b8dd8f15b6476aa419f501e2a3869b264
8810972d0375c0a853e3a66bd015993932be9fad
/modelicaml/kepler/org.openmodelica.modelicaml.validation/src/org/openmodelica/modelicaml/validation/rules/classes/C45_FinalStateHaveNoOutgoingTransitionsConstrainst.java
8c966638a3d152991cac155735cd6a7e4a6b476e
[]
no_license
OpenModelica/MDT
275ffe4c61162a5292d614cd65eb6c88dc58b9d3
9ffbe27b99e729114ea9a4b4dac4816375c23794
refs/heads/master
2020-09-14T03:35:05.384414
2019-11-27T22:35:04
2019-11-27T23:08:29
222,999,464
3
2
null
2019-11-27T23:08:31
2019-11-20T18:15:27
Java
WINDOWS-1252
Java
false
false
2,947
java
/* * This file is part of OpenModelica. * * Copyright (c) 1998-CurrentYear, Open Source Modelica Consortium (OSMC), * c/o Linköpings universitet, Department of Computer and Information Science, * SE-58183 Linköping, Sweden. * * All rights reserved. * * THIS PROGRAM IS PROVIDED UNDER THE TERMS OF GPL VERSION 3 LICENSE OR * THIS OSMC PUBLIC LICENSE (OSMC-PL) VERSION 1.2. * ANY USE, REPRODUCTION OR DISTRIBUTION OF THIS PROGRAM CONSTITUTES RECIPIENT'S ACCEPTANCE * OF THE OSMC PUBLIC LICENSE OR THE GPL VERSION 3, ACCORDING TO RECIPIENTS CHOICE. * * The OpenModelica software and the Open Source Modelica * Consortium (OSMC) Public License (OSMC-PL) are obtained * from OSMC, either from the above address, * from the URLs: http://www.ida.liu.se/projects/OpenModelica or * http://www.openmodelica.org, and in the OpenModelica distribution. * GNU version 3 is obtained from: http://www.gnu.org/copyleft/gpl.html. * * This program is distributed WITHOUT ANY WARRANTY; without * even the implied warranty of MERCHANTABILITY or FITNESS * FOR A PARTICULAR PURPOSE, EXCEPT AS EXPRESSLY SET FORTH * IN THE BY RECIPIENT SELECTED SUBSIDIARY LICENSE CONDITIONS OF OSMC-PL. * * See the full OSMC Public License conditions for more details. * * Main author: Wladimir Schamai, EADS Innovation Works / Linköping University, 2009-2013 * * Contributors: * Uwe Pohlmann, University of Paderborn 2009-2010, contribution to the Modelica code generation for state machine behavior, contribution to Papyrus GUI adaptations */ package org.openmodelica.modelicaml.validation.rules.classes; import org.eclipse.core.runtime.IStatus; import org.eclipse.emf.ecore.EObject; import org.eclipse.emf.validation.AbstractModelConstraint; import org.eclipse.emf.validation.EMFEventType; import org.eclipse.emf.validation.IValidationContext; import org.eclipse.uml2.uml.FinalState; import org.openmodelica.modelicaml.common.constants.Constants; /** * State Machines * * C45: * Rule : Final State may not have outgoing transitions.. * * Severity : ERROR * * Mode : Batch */ public class C45_FinalStateHaveNoOutgoingTransitionsConstrainst extends AbstractModelConstraint { public C45_FinalStateHaveNoOutgoingTransitionsConstrainst() { } /* (non-Javadoc) * @see org.eclipse.emf.validation.AbstractModelConstraint#validate(org.eclipse.emf.validation.IValidationContext) */ @Override public IStatus validate(IValidationContext ctx) { EObject eObj = ctx.getTarget(); EMFEventType eType = ctx.getEventType(); // In Batch Mode if(eType == EMFEventType.NULL) { if(eObj instanceof FinalState){ FinalState finalState = (FinalState) eObj; if(finalState.getOutgoings().size() > 0){ return ctx.createFailureStatus(new Object[] {Constants.validationKeyWord_NOT_VALID + ": Final state may not have outgoing transitions"}); } } } return ctx.createSuccessStatus(); } }
[ "wschamai" ]
wschamai
2e56b0c80b419309ae6222bbe2b9f9809ef77b7b
932480a6fa3d2e04d6fa0901c51ad14b9704430b
/jonix-onix3/src/main/java/com/tectonica/jonix/onix3/BibleTextOrganization.java
03eed3f35bc20f49dc3bec67bc2986c26de0ae05
[ "Apache-2.0" ]
permissive
hobbut/jonix
952abda58a3e9817a57ae8232a4a62ab6b3cd50f
0544feb4b1ac8fd7dfd52e34e3f84d46eae5749e
refs/heads/master
2021-01-12T08:22:58.679531
2016-05-22T15:13:53
2016-05-22T15:13:53
null
0
0
null
null
null
null
UTF-8
Java
false
false
3,111
java
/* * Copyright (C) 2012 Zach Melamed * * Latest version available online at https://github.com/zach-m/jonix * Contact me at zach@tectonica.co.il * * 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.tectonica.jonix.onix3; import java.io.Serializable; import com.tectonica.jonix.JPU; import com.tectonica.jonix.OnixElement; import com.tectonica.jonix.codelist.BibleTextOrganizations; import com.tectonica.jonix.codelist.RecordSourceTypes; /* * NOTE: THIS IS AN AUTO-GENERATED FILE, DON'T EDIT MANUALLY */ /** * <h1>Bible text organization</h1> * <p> * An ONIX code indicating the way in which the content of a Bible or selected Biblical text is organized, for example * ‘Chronological’, ‘Chain reference’. Optional and non-repeating. * </p> * <table border='1' cellpadding='3'> * <tr> * <td>Format</td> * <td>Fixed-length, three letters</td> * </tr> * <tr> * <td>Codelist</td> * <td>List 86</td> * </tr> * <tr> * <td>Reference name</td> * <td>&lt;BibleTextOrganization&gt;</td> * </tr> * <tr> * <td>Short tag</td> * <td>&lt;b355&gt;</td> * </tr> * <tr> * <td>Cardinality</td> * <td>0&#8230;1</td> * </tr> * <tr> * <td>Example</td> * <td>&lt;b355&gt;CHA&lt;/b355&gt; (Chain reference)</td> * </tr> * </table> */ public class BibleTextOrganization implements OnixElement, Serializable { private static final long serialVersionUID = 1L; public static final String refname = "BibleTextOrganization"; public static final String shortname = "b355"; // /////////////////////////////////////////////////////////////////////////////// // ATTRIBUTES // /////////////////////////////////////////////////////////////////////////////// /** * (type: dt.DateOrDateTime) */ public String datestamp; public RecordSourceTypes sourcetype; public String sourcename; // /////////////////////////////////////////////////////////////////////////////// // VALUE MEMBER // /////////////////////////////////////////////////////////////////////////////// public BibleTextOrganizations value; // /////////////////////////////////////////////////////////////////////////////// // SERVICES // /////////////////////////////////////////////////////////////////////////////// public BibleTextOrganization() {} public BibleTextOrganization(org.w3c.dom.Element element) { datestamp = JPU.getAttribute(element, "datestamp"); sourcetype = RecordSourceTypes.byCode(JPU.getAttribute(element, "sourcetype")); sourcename = JPU.getAttribute(element, "sourcename"); value = BibleTextOrganizations.byCode(JPU.getContentAsString(element)); } }
[ "zach@tectonica.co.il" ]
zach@tectonica.co.il
e3be0cb550650b39489f0457538487008c773c32
47119d527d55e9adcb08a3a5834afe9a82dd2254
/tools/apidocs/src/main/test/com/emc/difftests/ApiClassDiffTests.java
1f1dd277feb564b6729b51c7827248d5fba8e385
[]
no_license
chrisdail/coprhd-controller
1c3ddf91bb840c66e4ece3d4b336a6df421b43e4
38a063c5620135a49013aae5e078aeb6534a5480
refs/heads/master
2020-12-03T10:42:22.520837
2015-06-08T15:24:36
2015-06-08T15:24:36
null
0
0
null
null
null
null
UTF-8
Java
false
false
4,473
java
package com.emc.difftests; import com.emc.apidocs.differencing.DifferenceEngine; import com.emc.apidocs.model.ApiClass; import com.emc.apidocs.model.ApiField; import com.emc.apidocs.model.ApiMethod; import com.emc.apidocs.model.ChangeState; import com.google.common.collect.Lists; import java.util.Collections; import java.util.List; public class ApiClassDiffTests { public static void main(String[] args) throws Exception { List<ApiField> sequenceA = Lists.newArrayList(newField("A"),newField("B"),newField("P"),newField("C")); List<ApiField> sequenceB = Lists.newArrayList(newField("A"),newField("B"),newField("E"),newField("D"),newField("C")); List<ApiField> diffList = generateMergedList(sequenceA, sequenceB); System.out.println("OUTPUT : "); for (ApiField s : diffList) { switch(s.changeState) { case NOT_CHANGED: System.out.print("- "); break; case REMOVED: System.out.print("< "); break; case ADDED: System.out.print("> "); break; } System.out.println(s.name); } ApiClass apiClass = new ApiClass(); apiClass.fields = diffList; System.out.println("CONTAINS CHANGES :"+containsChanges(apiClass)); } /** * For more information on the LCS algorithm, see http://en.wikipedia.org/wiki/Longest_common_subsequence_problem */ private static int[][] computeLcs(List<ApiField> sequenceA, List<ApiField> sequenceB) { int[][] lcs = new int[sequenceA.size()+1][sequenceB.size()+1]; for (int i = 0; i < sequenceA.size(); i++) { for (int j = 0; j < sequenceB.size(); j++) { if (sequenceA.get(i).compareTo(sequenceB.get(j)) == 0) { lcs[i+1][j+1] = lcs[i][j] + 1; } else { lcs[i+1][j+1] = Math.max(lcs[i][j+1], lcs[i+1][j]); } } } return lcs; } /** * Generates a merged list with changes */ public static List<ApiField> generateMergedList(List<ApiField> sequenceA, List<ApiField> sequenceB) { int[][] lcs = computeLcs(sequenceA, sequenceB); List<ApiField> mergedFields = Lists.newArrayList(); int aPos = sequenceA.size(); int bPos = sequenceB.size(); while (aPos > 0 || bPos > 0) { if (aPos > 0 && bPos > 0 && sequenceA.get(aPos-1).compareTo(sequenceB.get(bPos-1)) == 0) { ApiField field = sequenceA.get(aPos - 1); field.changeState = ChangeState.NOT_CHANGED; mergedFields.add(field); aPos--; bPos--; } else if (bPos > 0 && (aPos == 0 || lcs[aPos][bPos-1] >= lcs[aPos-1][bPos])) { ApiField field = sequenceB.get(bPos - 1); field.changeState = ChangeState.ADDED; mergedFields.add(field); bPos--; } else { ApiField field =sequenceA.get(aPos - 1); field.changeState = ChangeState.REMOVED; mergedFields.add(field); aPos--; } } // Backtracking generates the list from back to front, // so reverse it to get front-to-back. Collections.reverse(mergedFields); return mergedFields; } /** * @return Indicates if this class contains ANY changes (directly or within a fields type) */ public static boolean containsChanges(ApiClass apiClass) { for (ApiField field : apiClass.fields) { if (field.changeState != ChangeState.NOT_CHANGED) { return true; } } for (ApiField field : apiClass.fields) { if (!field.isPrimitive()) { boolean containsChanges = containsChanges(field.type); if (containsChanges) { return true; } } } return false; } private static ApiField newField(String name) { ApiField field = new ApiField(); field.name = name; field.primitiveType = "String"; return field; } }
[ "review-coprhd@coprhd.org" ]
review-coprhd@coprhd.org
f4066d6ced96c85600271618d3cccc7fef7e28d7
dfb3f631ed8c18bd4605739f1ecb6e47d715a236
/disconnect-highcharts/src/main/java/js/lang/external/highcharts/AnnotationsElliottWaveShapeOptions.java
ca928ed0cdcd8f5d61ccfe4bef828acfca4bbfb2
[ "Apache-2.0" ]
permissive
fluorumlabs/disconnect-project
ceb788b901d1bf7cfc5ee676592f55f8a584a34e
54f4ea5e6f05265ea985e1ee615cc3d59d5842b4
refs/heads/master
2022-12-26T11:26:46.539891
2020-08-20T16:37:19
2020-08-20T16:37:19
203,577,241
6
1
Apache-2.0
2022-12-16T00:41:56
2019-08-21T12:14:42
Java
UTF-8
Java
false
false
6,525
java
package js.lang.external.highcharts; import com.github.fluorumlabs.disconnect.core.annotations.Import; import com.github.fluorumlabs.disconnect.core.annotations.NpmPackage; import java.lang.String; import javax.annotation.Nullable; import js.lang.Any; import js.lang.Unknown /* ( ColorString | GradientColorObject | PatternObject ) */; import org.teavm.jso.JSProperty; /** * (Highstock) Options for annotation's shapes. Each shape inherits options from * the shapeOptions object. An option from the shapeOptions can be overwritten * by config for a specific shape. * */ @NpmPackage( name = "highcharts", version = "^8.1.2" ) @Import( module = "highcharts/es-modules/masters/highcharts.src.js" ) public interface AnnotationsElliottWaveShapeOptions extends Any { /** * (Highstock) Name of the dash style to use for the shape's stroke. * */ @JSProperty("dashStyle") @Nullable DashStyle getDashStyle(); /** * (Highstock) Name of the dash style to use for the shape's stroke. * */ @JSProperty("dashStyle") void setDashStyle(@Nullable DashStyle value); /** * (Highstock) The color of the shape's fill. * */ @JSProperty("fill") @Nullable Unknown /* ( ColorString | GradientColorObject | PatternObject ) */ getFill(); /** * (Highstock) The color of the shape's fill. * */ @JSProperty("fill") void setFill(@Nullable PatternObject value); /** * (Highstock) The color of the shape's fill. * */ @JSProperty("fill") void setFill(@Nullable String value); /** * (Highstock) The color of the shape's fill. * */ @JSProperty("fill") void setFill(@Nullable GradientColorObject value); /** * (Highstock) The height of the shape. * */ @JSProperty("height") double getHeight(); /** * (Highstock) The height of the shape. * */ @JSProperty("height") void setHeight(double value); /** * (Highstock) The radius of the shape. * */ @JSProperty("r") double getR(); /** * (Highstock) The radius of the shape. * */ @JSProperty("r") void setR(double value); /** * (Highstock) Defines additional snapping area around an annotation making * this annotation to focus. Defined in pixels. * */ @JSProperty("snap") double getSnap(); /** * (Highstock) Defines additional snapping area around an annotation making * this annotation to focus. Defined in pixels. * */ @JSProperty("snap") void setSnap(double value); /** * (Highstock) The URL for an image to use as the annotation shape. Note, * type has to be set to <code>'image'</code>. * */ @JSProperty("src") @Nullable String getSrc(); /** * (Highstock) The URL for an image to use as the annotation shape. Note, * type has to be set to <code>'image'</code>. * */ @JSProperty("src") void setSrc(@Nullable String value); /** * (Highstock) The color of the shape's stroke. * */ @JSProperty("stroke") @Nullable String getStroke(); /** * (Highstock) The color of the shape's stroke. * */ @JSProperty("stroke") void setStroke(@Nullable String value); /** * (Highstock) The pixel stroke width of the shape. * */ @JSProperty("strokeWidth") double getStrokeWidth(); /** * (Highstock) The pixel stroke width of the shape. * */ @JSProperty("strokeWidth") void setStrokeWidth(double value); /** * (Highstock) The type of the shape, e.g. circle or rectangle. * */ @JSProperty("type") @Nullable String getType(); /** * (Highstock) The type of the shape, e.g. circle or rectangle. * */ @JSProperty("type") void setType(@Nullable String value); /** * (Highstock) The width of the shape. * */ @JSProperty("width") double getWidth(); /** * (Highstock) The width of the shape. * */ @JSProperty("width") void setWidth(double value); static Builder builder() { return new Builder(); } final class Builder { private final AnnotationsElliottWaveShapeOptions object = Any.empty(); private Builder() { } public AnnotationsElliottWaveShapeOptions build() { return object; } /** * (Highstock) Name of the dash style to use for the shape's stroke. * */ public Builder dashStyle(@Nullable DashStyle value) { object.setDashStyle(value); return this; } /** * (Highstock) The color of the shape's fill. * */ public Builder fill(@Nullable PatternObject value) { object.setFill(value); return this; } /** * (Highstock) The color of the shape's fill. * */ public Builder fill(@Nullable String value) { object.setFill(value); return this; } /** * (Highstock) The color of the shape's fill. * */ public Builder fill(@Nullable GradientColorObject value) { object.setFill(value); return this; } /** * (Highstock) The height of the shape. * */ public Builder height(double value) { object.setHeight(value); return this; } /** * (Highstock) The radius of the shape. * */ public Builder r(double value) { object.setR(value); return this; } /** * (Highstock) Defines additional snapping area around an annotation making * this annotation to focus. Defined in pixels. * */ public Builder snap(double value) { object.setSnap(value); return this; } /** * (Highstock) The URL for an image to use as the annotation shape. Note, * type has to be set to <code>'image'</code>. * */ public Builder src(@Nullable String value) { object.setSrc(value); return this; } /** * (Highstock) The color of the shape's stroke. * */ public Builder stroke(@Nullable String value) { object.setStroke(value); return this; } /** * (Highstock) The pixel stroke width of the shape. * */ public Builder strokeWidth(double value) { object.setStrokeWidth(value); return this; } /** * (Highstock) The type of the shape, e.g. circle or rectangle. * */ public Builder type(@Nullable String value) { object.setType(value); return this; } /** * (Highstock) The width of the shape. * */ public Builder width(double value) { object.setWidth(value); return this; } } }
[ "fluorumlabs@users.noreply.github.com" ]
fluorumlabs@users.noreply.github.com
6cf02d0a1833c3abb313cade002ede51addb80db
ed3cb95dcc590e98d09117ea0b4768df18e8f99e
/project_1_3/src/g/d/j/Calc_1_3_6398.java
9579268e84a49812436de1386f004f233c6fcc7a
[]
no_license
chalstrick/bigRepo1
ac7fd5785d475b3c38f1328e370ba9a85a751cff
dad1852eef66fcec200df10083959c674fdcc55d
refs/heads/master
2016-08-11T17:59:16.079541
2015-12-18T14:26:49
2015-12-18T14:26:49
48,244,030
0
0
null
null
null
null
UTF-8
Java
false
false
131
java
package g.d.j; public class Calc_1_3_6398 { /** @return the sum of a and b */ public int add(int a, int b) { return a+b; } }
[ "christian.halstrick@sap.com" ]
christian.halstrick@sap.com
1f5dd187d87a5be9698f6386b0ffefb532b022f8
5af4e82cfd03ab53fbbd74220f923c051caacaed
/classloader-pitfalls/src/test/java/com/link_intersystems/publications/blog/classloader_pitfalls/ClassCastExceptionTest.java
41b87a06465a6df831abef137e4304d60f05b457
[ "Apache-2.0" ]
permissive
szymonleyk/blog
3399cc17b8011aea78beed52256fc8714855710e
24917cbba66a0b0e7def0c622020ab5ab1b94d28
refs/heads/master
2021-05-28T16:18:26.387061
2015-05-01T15:47:23
2015-05-01T15:51:36
null
0
0
null
null
null
null
UTF-8
Java
false
false
1,813
java
package com.link_intersystems.publications.blog.classloader_pitfalls; import java.net.URL; import java.net.URLClassLoader; import org.junit.Assert; import org.junit.Test; public class ClassCastExceptionTest { /** * This test shows that a class loaded by one class loader is not equal to * the same class loaded by another class loader. * * @throws ClassNotFoundException * @throws InstantiationException * @throws IllegalAccessException */ @Test(expected = ClassCastException.class) @SuppressWarnings("unused") public void classCastExceptionWithDifferentClassLoaders() throws ClassNotFoundException, InstantiationException, IllegalAccessException { // Calculator is just a test class that I created URL[] urls = getClassLoaderClasspath(Calculator.class); URLClassLoader classLoader1 = new URLClassLoader(urls, null); URLClassLoader classLoader2 = new URLClassLoader(urls, null); String canonicalName = Calculator.class.getCanonicalName(); Class<?> calcClass1 = classLoader1.loadClass(canonicalName); Class<?> calcClass2 = classLoader2.loadClass(canonicalName); // The classes are not equal, because they are loaded by different class // loaders. Assert.assertFalse(calcClass1.equals(calcClass2)); Object calcInstance1 = calcClass1.newInstance(); Object calcInstance2 = calcClass2.newInstance(); // As the test defines we expect a ClassCastException, because an // instance of calcClass2 can not be casted to calcClass1 calcClass1.cast(calcInstance2); } private URL[] getClassLoaderClasspath(Class<?> clazz) { ClassLoader classLoader = clazz.getClassLoader(); Assert.assertTrue(classLoader instanceof URLClassLoader); URLClassLoader urlClassLoader = (URLClassLoader) classLoader; URL[] urls = urlClassLoader.getURLs(); return urls; } }
[ "rene.link@link-intersystems.com" ]
rene.link@link-intersystems.com
54ee8591caeef7a296506e063843b0282ed4ea5a
913977dba09d712f51923229fb10860fd08cf5a1
/src/leetcode/Lee792.java
daa174006f92758b21e1501e231f996ffb9257ab
[]
no_license
zsjwish/algorithm
17e5bbcef780c30e0b9ab415551a3e642bf001b8
4e21ef7398a418ea6358e67b1923ac60c98a6e4e
refs/heads/master
2021-06-21T06:37:18.566962
2019-08-17T15:27:20
2019-08-17T15:27:35
130,315,973
0
0
null
2018-04-23T09:26:15
2018-04-20T06:00:52
Java
UTF-8
Java
false
false
1,748
java
package leetcode; import java.util.HashSet; import java.util.Set; /** * created by zsj in 15:58 2018/9/25 * description:给定字符串 S 和单词字典 words, 求 words[i] 中是 S 的子序列的单词个数。 * 示例: * 输入: * S = "abcde" * words = ["a", "bb", "acd", "ace"] * 输出: 3 * 解释: 有三个是 S 的子序列的单词: "a", "acd", "ace"。 **/ public class Lee792 { public static void main(String[] args) { System.out.println(isSubsequence("abc","ahbgdc")); } public static int numMatchingSubseq(String S, String[] words) { int res = 0; Set<String> pass = new HashSet<>(); Set<String> out = new HashSet<>(); for (String tmp : words) { if (pass.contains(tmp) || out.contains(tmp)) { if (pass.contains(tmp)) { res++; } continue; } else { if (isSubsequence(tmp, S)) { pass.add(tmp); res++; } else { out.add(tmp); } } } return res; } /** * s 是 t 的子序列 * @param s * @param t * @return */ public static boolean isSubsequence(String s, String t) { if (s.length() == 0) { return true; } if (t.length() == 0) { return false; } int pos = 0; for (int i = 0; i < t.length() && pos < s.length(); i++) { if (s.charAt(pos) == t.charAt(i)) { pos++; } } if (pos == s.length()) { return true; } return false; } }
[ "zsjwish@126.com" ]
zsjwish@126.com
c170f4352912203c41f309320e2c23e9ff942b09
e01dc5993b7ac310c346763d46e900f3b2d5db5e
/jasperserver-dto/src/test/java/com/jaspersoft/jasperserver/dto/logcapture/CollectorSettingsTest.java
3946abf995d6374768b048d1fb34993a4f6da103
[]
no_license
yohnniebabe/jasperreports-server-ce
ed56548a2ee18d37511c5243ffd8e0caff2be8f7
e65ce85a5dfca8d9002fcabc172242f418104453
refs/heads/master
2023-08-26T00:01:23.634829
2021-10-22T14:15:32
2021-10-22T14:15:32
null
0
0
null
null
null
null
UTF-8
Java
false
false
4,228
java
/* * Copyright (C) 2005 - 2020 TIBCO Software Inc. All rights reserved. * http://www.jaspersoft.com. * * Unless you have purchased a commercial license agreement from Jaspersoft, * the following license terms apply: * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Affero General Public License as * published by the Free Software Foundation, either version 3 of the * License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Affero General Public License for more details. * * You should have received a copy of the GNU Affero General Public License * along with this program. If not, see <http://www.gnu.org/licenses/>. */ package com.jaspersoft.jasperserver.dto.logcapture; import com.jaspersoft.jasperserver.dto.basetests.BaseDTOPresentableTest; import org.junit.jupiter.api.Test; import java.util.Arrays; import java.util.List; import static org.junit.jupiter.api.Assertions.assertEquals; import static org.junit.jupiter.api.Assertions.assertNotSame; /** * @author Andriy Tivodar <ativodar@tibco> */ public class CollectorSettingsTest extends BaseDTOPresentableTest<CollectorSettings> { @Override protected List<CollectorSettings> prepareInstancesWithAlternativeParameters() { return Arrays.asList( createFullyConfiguredInstance().setId("id2"), createFullyConfiguredInstance().setName("name2"), createFullyConfiguredInstance().setStatus("status2"), createFullyConfiguredInstance().setVerbosity("verbosity2"), createFullyConfiguredInstance().setLogFilterParameters(new LogFilterParameters().setUserId("userId2")), // with null values createFullyConfiguredInstance().setId(null), createFullyConfiguredInstance().setName(null), createFullyConfiguredInstance().setStatus(null), createFullyConfiguredInstance().setVerbosity(null), createFullyConfiguredInstance().setLogFilterParameters(null) ); } @Override protected CollectorSettings createFullyConfiguredInstance() { CollectorSettings collectorSettings = new CollectorSettings(); collectorSettings.setId("id"); collectorSettings.setName("name"); collectorSettings.setStatus("status"); collectorSettings.setVerbosity("verbosity"); collectorSettings.setLogFilterParameters(new LogFilterParameters().setUserId("userId")); return collectorSettings; } @Override protected CollectorSettings createInstanceWithDefaultParameters() { return new CollectorSettings(); } @Override protected CollectorSettings createInstanceFromOther(CollectorSettings other) { return new CollectorSettings(other); } @Override protected void assertFieldsHaveUniqueReferences(CollectorSettings expected, CollectorSettings actual) { assertNotSame(expected.getLogFilterParameters(), actual.getLogFilterParameters()); } @Test public void exportIsNotEnabledForNullLogFilterParameters() { fullyConfiguredTestInstance.setLogFilterParameters(null); boolean result = fullyConfiguredTestInstance.exportEnabled(); assertEquals(false, result); } @Test public void exportIsEnabledWhenExportDataSnapshotDisabled() { boolean result = fullyConfiguredTestInstance.exportEnabled(); assertEquals(false, result); } @Test public void exportIsEnabledWhenExportDataSnapshotEnabled() { ResourceAndSnapshotFilter resourceAndSnapshotFilter = new ResourceAndSnapshotFilter() .setResourceUri("uri") .setIncludeDataSnapshots(true); fullyConfiguredTestInstance.setLogFilterParameters(new LogFilterParameters() .setResourceAndSnapshotFilter(resourceAndSnapshotFilter)); boolean result = fullyConfiguredTestInstance.exportEnabled(); assertEquals(true, result); } }
[ "hguntupa@tibco.com" ]
hguntupa@tibco.com
6cecae5f8151dfcb660747f6d249ebea59d15da6
53d677a55e4ece8883526738f1c9d00fa6560ff7
/com/tencent/mm/plugin/product/ui/HtmlTextView.java
8c433257e505e1b90526d79128d15538b1d679fb
[]
no_license
0jinxing/wechat-apk-source
544c2d79bfc10261eb36389c1edfdf553d8f312a
f75eefd87e9b9ecf2f76fc6d48dbba8e24afcf3d
refs/heads/master
2020-06-07T20:06:03.580028
2019-06-21T09:17:26
2019-06-21T09:17:26
193,069,132
9
4
null
null
null
null
UTF-8
Java
false
false
1,417
java
package com.tencent.mm.plugin.product.ui; import android.content.Context; import android.text.Html.ImageGetter; import android.text.Html.TagHandler; import android.util.AttributeSet; import android.widget.TextView; import com.tencent.matrix.trace.core.AppMethodBeat; import com.tencent.mm.kernel.g; import com.tencent.mm.sdk.platformtools.al; public class HtmlTextView extends TextView { Html.ImageGetter pib; Html.TagHandler pic; public HtmlTextView(Context paramContext, AttributeSet paramAttributeSet) { super(paramContext, paramAttributeSet); AppMethodBeat.i(44016); this.pib = new HtmlTextView.2(this); this.pic = new HtmlTextView.3(this); AppMethodBeat.o(44016); } public HtmlTextView(Context paramContext, AttributeSet paramAttributeSet, int paramInt) { super(paramContext, paramAttributeSet, paramInt); AppMethodBeat.i(44015); this.pib = new HtmlTextView.2(this); this.pic = new HtmlTextView.3(this); AppMethodBeat.o(44015); } public void setText(String paramString) { AppMethodBeat.i(44017); g.RS().a(new HtmlTextView.1(this, paramString)); AppMethodBeat.o(44017); } } /* Location: C:\Users\Lin\Downloads\dex-tools-2.1-SNAPSHOT\dex-tools-2.1-SNAPSHOT\classes8-dex2jar.jar * Qualified Name: com.tencent.mm.plugin.product.ui.HtmlTextView * JD-Core Version: 0.6.2 */
[ "172601673@qq.com" ]
172601673@qq.com
a2d2e348c1aa9a14c0722981284bf2cd200cc60f
68047d2f520ab586f16faa8fd3e4287ea478b26d
/android/src/main/java/com/facebook/flipper/plugins/sandbox/SandboxFlipperPlugin.java
881affcd0b5105196f7a98dbd20a9f36b1a79fe8
[ "MIT" ]
permissive
s1rius/flipper
34bf8523af1bee09a8bd28fcb61c4cf3981692ab
082daa57eadb05f9455bf62cdd832974e54348b3
refs/heads/master
2020-08-05T14:56:44.613410
2019-10-03T14:10:37
2019-10-03T14:10:37
186,237,175
3
0
MIT
2019-05-12T09:50:23
2019-05-12T09:50:22
null
UTF-8
Java
false
false
2,436
java
/* * Copyright (c) Facebook, Inc. and its affiliates. * * This source code is licensed under the MIT license found in the LICENSE * file in the root directory of this source tree. */ package com.facebook.flipper.plugins.sandbox; import com.facebook.flipper.core.FlipperArray; import com.facebook.flipper.core.FlipperConnection; import com.facebook.flipper.core.FlipperObject; import com.facebook.flipper.core.FlipperPlugin; import com.facebook.flipper.core.FlipperReceiver; import com.facebook.flipper.core.FlipperResponder; import java.util.Map; public class SandboxFlipperPlugin implements FlipperPlugin { public static final String ID = "Sandbox"; private static final String SET_METHOD_NAME = "setSandbox"; private static final String GET_METHOD_NAME = "getSandbox"; private final SandboxFlipperPluginStrategy mStrategy; public SandboxFlipperPlugin(SandboxFlipperPluginStrategy strategy) { mStrategy = strategy; } @Override public String getId() { return ID; } @Override public void onConnect(FlipperConnection connection) { connection.receive( GET_METHOD_NAME, new FlipperReceiver() { @Override public void onReceive(FlipperObject params, final FlipperResponder responder) { final FlipperArray.Builder sandboxes = new FlipperArray.Builder(); Map<String, String> knownSandboxes = mStrategy.getKnownSandboxes(); if (knownSandboxes == null) { responder.success(sandboxes.build()); return; } for (String sandboxName : knownSandboxes.keySet()) { sandboxes.put( new FlipperObject.Builder() .put("name", sandboxName) .put("value", knownSandboxes.get(sandboxName))); } responder.success(sandboxes.build()); } }); connection.receive( SET_METHOD_NAME, new FlipperReceiver() { @Override public void onReceive(FlipperObject params, FlipperResponder responder) throws Exception { String sandbox = params.getString("sandbox"); mStrategy.setSandbox(sandbox); responder.success(new FlipperObject.Builder().put("result", true).build()); } }); } @Override public void onDisconnect() {} @Override public boolean runInBackground() { return false; } }
[ "facebook-github-bot@users.noreply.github.com" ]
facebook-github-bot@users.noreply.github.com
05cfdee226f02819ca1b076ebfe319c67a80a8e7
ae124491d41fd9bbe79b982f689fd7d255061d9b
/modules/core/src/main/java/org/mycontroller/standalone/offheap/MessageQueueSleepImpl.java
c61aa01175384c4674b8c14ec2a1de1a81e3bfe9
[ "Apache-2.0" ]
permissive
nino21/mycontroller
8d1a56256fdff04c16732a00873dac73ed3f31f1
1f162e269175980d243aeaab19d34c07a31a57b1
refs/heads/development
2021-01-25T14:49:16.492198
2018-10-29T14:50:06
2018-10-29T14:50:06
123,730,094
0
0
Apache-2.0
2019-03-11T20:25:32
2018-03-03T20:48:42
Java
UTF-8
Java
false
false
2,819
java
/* * Copyright 2015-2018 Jeeva Kandasamy (jkandasa@gmail.com) * and other contributors as indicated by the @author tags. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org.mycontroller.standalone.offheap; import java.util.ArrayList; import org.mapdb.HTreeMap; import org.mycontroller.standalone.AppProperties; import org.mycontroller.standalone.message.IMessage; import lombok.extern.slf4j.Slf4j; /** * @author Jeeva Kandasamy (jkandasa) * @since 1.2.0 */ @Slf4j public class MessageQueueSleepImpl { private String _nameMap; HTreeMap<String, ArrayList<IMessage>> _map; public MessageQueueSleepImpl(String name) { _nameMap = IMap.MAP_PREFIX + "_msg_sleep_" + name; _map = OffHeapFactory.store().getHashMap(_nameMap); if (AppProperties.getInstance().getClearMessagesQueueOnStart()) { _map.clear(); } else { _logger.debug("Continuing with offline messages in the map:[{}]", _nameMap); } } public synchronized void clear() { _map.clear(); } public synchronized void delete() { OffHeapFactory.store().delete(_nameMap); } public synchronized void put(IMessage message) { // no need to handle broadcast messages if (message.getNodeEui().equalsIgnoreCase(IMessage.NODE_BROADCAST_ID)) { return; } updateEmpty(message.getNodeEui()); ArrayList<IMessage> _queue = _map.get(message.getNodeEui()); _queue.add(message); _logger.debug("Adding [key:{}, size:{}, {}] in to the map", message.getNodeEui(), _queue.size(), message); } public synchronized ArrayList<IMessage> get(String key) { updateEmpty(key); return _map.get(key); } public synchronized ArrayList<IMessage> remove(String key) { updateEmpty(key); ArrayList<IMessage> _queue = _map.remove(key); _logger.debug("Removing[key:{}, size:{}] in to the map", key, _queue.size()); return _queue; } public synchronized boolean isEmpty(String key) { updateEmpty(key); return _map.get(key).isEmpty(); } private synchronized void updateEmpty(String key) { if (_map.get(key) == null) { _map.put(key, new ArrayList<IMessage>()); } } }
[ "jkandasa@gmail.com" ]
jkandasa@gmail.com
7df80ad9d32f2613a4e8417d82934367780216c1
447698e4348550abed6a8732e42cf163d43b78e8
/app/src/main/java/KotlinAgency/XiaomingFather.java
f9b7c44e1db8750fde25a6f869fe9d6677063ffc
[]
no_license
aWhalefall/andoridkotlin
c747003e231df45f95d15063b8f4bd1d03d3110a
50eead1f5f71fe71df92782b9b09aef2ba7bdba8
refs/heads/master
2021-08-14T17:26:31.544003
2017-11-16T10:13:27
2017-11-16T10:13:27
null
0
0
null
null
null
null
UTF-8
Java
false
false
128
java
package KotlinAgency; /** * Created by weichyang on 2017/11/2. */ public interface XiaomingFather { void payMoney(); }
[ "279642707@qq.com" ]
279642707@qq.com
7b56eb22fa6f801e5470e3df9d60f7e2a8f711e8
cbdd81e6b9cf00859ce7169df36cf566417e4c8b
/3.JavaMultithreading/src/com/javarush/task/task28/task2805/MyThread_01.java
d2068ea5685aa846aa8af943ed5a1b35624daa45
[]
no_license
id2k1149/JavaRushTasks
3f13cd5d37977e38e8933e581f17fd48597f90d8
450a432649aa20608e6e9a46ada35123056480cf
refs/heads/master
2023-03-31T21:03:06.944109
2021-03-19T00:58:45
2021-03-19T00:58:45
null
0
0
null
null
null
null
UTF-8
Java
false
false
1,156
java
package com.javarush.task.task28.task2805; import java.util.concurrent.atomic.AtomicInteger; public class MyThread_01 extends Thread { private static final AtomicInteger number = new AtomicInteger(1); public MyThread_01() { if (number.get() == 11) { number.set(1); } setPriority(number.getAndIncrement()); } public MyThread_01(ThreadGroup group, String name) { if (number.get() == group.getMaxPriority() + 1) { number.set(1); } setPriority(number.getAndIncrement()); } public MyThread_01(Runnable target) { super(target); } public MyThread_01(ThreadGroup group, Runnable target) { super(group, target); } public MyThread_01(String name) { super(name); } public MyThread_01(Runnable target, String name) { super(target, name); } public MyThread_01(ThreadGroup group, Runnable target, String name) { super(group, target, name); } public MyThread_01(ThreadGroup group, Runnable target, String name, long stackSize) { super(group, target, name, stackSize); } }
[ "id2k1149@gmail.com" ]
id2k1149@gmail.com
b6543ce9cdc35c206dde8e3e71dfc3d8f7b57091
32f38cd53372ba374c6dab6cc27af78f0a1b0190
/app/src/main/java/com/ali/user/mobile/external/InSideService/LoginUserInfoService.java
a37a2d9c47faafd44ae8ca55f2b638cc4268198f
[]
no_license
shuixi2013/AmapCode
9ea7aefb42e0413f348f238f0721c93245f4eac6
1a3a8d4dddfcc5439df8df570000cca12b15186a
refs/heads/master
2023-06-06T23:08:57.391040
2019-08-29T04:36:02
2019-08-29T04:36:02
null
0
0
null
null
null
null
UTF-8
Java
false
false
1,966
java
package com.ali.user.mobile.external.InSideService; import android.os.Bundle; import com.ali.user.mobile.account.bean.UserInfo; import com.ali.user.mobile.accountbiz.extservice.AuthService; import com.ali.user.mobile.accountbiz.extservice.manager.AntExtServiceManager; import com.ali.user.mobile.accountbiz.sp.SecurityShareStore; import com.ali.user.mobile.log.AliUserLog; import com.alipay.android.phone.inside.framework.LauncherApplication; import com.alipay.android.phone.inside.framework.service.IInsideService; import com.alipay.android.phone.inside.framework.service.IInsideServiceCallback; public class LoginUserInfoService implements IInsideService<Void, Bundle> { public void start(Void voidR) throws Exception { throw new UnsupportedOperationException(); } public void start(IInsideServiceCallback<Bundle> iInsideServiceCallback, Void voidR) throws Exception { if (iInsideServiceCallback != null) { iInsideServiceCallback.onComplted(startForResult((Void) null)); } } public Bundle startForResult(Void voidR) throws Exception { Bundle bundle = new Bundle(); try { bundle.putString("loginId", SecurityShareStore.a(LauncherApplication.a(), "currentLogonId")); AuthService authService = AntExtServiceManager.getAuthService(LauncherApplication.a()); if (authService != null) { bundle.putBoolean("isLogin", authService.isLogin()); UserInfo userInfo = authService.getUserInfo(); if (userInfo != null) { bundle.putString("userId", userInfo.getUserId()); bundle.putString("nickName", userInfo.getNick()); bundle.putString("userAvatar", userInfo.getUserAvatar()); } } } catch (Throwable th) { AliUserLog.b("LoginUserInfoService", "getUserInfo error ", th); } return bundle; } }
[ "hubert.yang@nf-3.com" ]
hubert.yang@nf-3.com
09ea35f56a4fc820407e81235705ab1a4d85dce1
2fa04f21cbb7203b468f7598df6696a88b05a286
/bus-office/src/main/java/org/aoju/bus/office/provider/AbstractSourceProvider.java
5bf5e42905e2a5b758724e34378fa8827881967f
[ "MIT" ]
permissive
jingshuai5213/bus
17bb475fd76592682123488608a559abec788f81
f3ec545617acffaf2668ea78e974a05be268cfd1
refs/heads/master
2022-11-16T00:35:46.037858
2020-07-02T09:35:10
2020-07-02T09:35:10
254,873,385
0
0
MIT
2020-07-02T09:35:11
2020-04-11T13:26:50
null
UTF-8
Java
false
false
2,371
java
/********************************************************************************* * * * The MIT License (MIT) * * * * Copyright (c) 2015-2020 aoju.org 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.office.provider; import java.io.File; /** * 所有源文档规范实现的基类. * * @author Kimi Liu * @version 6.0.1 * @since JDK 1.8+ */ public abstract class AbstractSourceProvider extends AbstractDocumentProvider implements SourceDocumentProvider { protected AbstractSourceProvider(final File file) { super(file); } }
[ "839536@qq.com" ]
839536@qq.com
7d6f8df38fd440236e4d764f881f30b27e842ffc
9d755877a025b2a5b201c21439c88ba164f4ef83
/src/test/java/de/vandermeer/skb/interfaces/transformers/textformat/Test_Text_To_WrappedFormat.java
109fe60e4cf84a223a1a41ee66dd49f604d55d89
[ "Apache-2.0", "MIT" ]
permissive
andy176631/skb-java-interfaces
3caf33daaa44af4d312e60de51dc53afbbd93fd0
0ed5aafaccdf1d7203f92ee00d1eb53876f7a0eb
refs/heads/master
2021-08-31T21:31:13.097599
2017-05-02T14:07:59
2017-05-02T14:07:59
114,078,539
0
0
null
2017-12-13T05:36:09
2017-12-13T05:36:08
null
UTF-8
Java
false
false
2,269
java
/* Copyright 2016 Sven van der Meer <vdmeer.sven@mykolab.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 de.vandermeer.skb.interfaces.transformers.textformat; import static org.junit.Assert.assertEquals; import java.util.ArrayList; import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.tuple.Pair; import org.junit.Test; import de.svenjacobs.loremipsum.LoremIpsum; /** * Tests for {@link Text_To_WrappedFormat}. * * @author Sven van der Meer &lt;vdmeer.sven@mykolab.com&gt; * @version v0.0.2 build 170502 (02-May-17) for Java 1.8 * @since v0.0.1 */ public class Test_Text_To_WrappedFormat { static String LINEBREAK = "<br />"; @Test public void test_Simple(){ String words = new LoremIpsum().getWords(30); String text = words; text = StringUtils.replace(words, "dolor ", "dolor " + LINEBREAK); text = StringUtils.replace(text, "dolore ", "dolore " + LINEBREAK); Pair<ArrayList<String>, ArrayList<String>> textPair; textPair = Text_To_WrappedFormat.convert(text, 20, null); assertEquals(0, textPair.getLeft().size()); assertEquals(11, textPair.getRight().size()); assertEquals(words, StringUtils.join(textPair.getRight(), ' ')); textPair= Text_To_WrappedFormat.convert(text, 30, Pair.of(6, 10)); System.err.println(words); System.err.println(text); System.err.println("\n----[ top ]----"); System.err.println("123456789012345678901234567890"); for(String s : textPair.getLeft()){ System.err.println(s); } System.err.println("\n----[ bottom ]----"); System.err.println("123456789012345678901234567890"); for(String s : textPair.getRight()){ System.err.println(s); } } }
[ "sven@vandermeer.de" ]
sven@vandermeer.de
d7abe4f7f682cae9f4ce2189cf4e29bf7cba7e39
607aa170f1ab6070b047a9f9693e34fee280a423
/src/main/java/molab/ApplicationStartup.java
837b856cc064ae5f8caae2691ac519d92cdf1f1a
[]
no_license
cocoy2006/ibc
6b7090f43e33752c76c2e602b7dc065f156888c4
003bcb9acb62db3d7e93512adee98162c57d7236
refs/heads/master
2021-05-06T20:14:28.193724
2017-11-27T08:32:13
2017-11-27T08:32:13
111,658,245
0
0
null
null
null
null
UTF-8
Java
false
false
622
java
package molab; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.context.ApplicationListener; import org.springframework.context.event.ContextRefreshedEvent; import org.springframework.stereotype.Component; import molab.properties.WxProperties; import weixin.popular.support.TokenManager; @Component public class ApplicationStartup implements ApplicationListener<ContextRefreshedEvent> { @Autowired private WxProperties wp; @Override public void onApplicationEvent(ContextRefreshedEvent arg0) { TokenManager.init(wp.getId(), wp.getSecret()); } }
[ "yekk@molab.com" ]
yekk@molab.com
3277c7f92558f0b4b8e1f8901fb6a542905a0fe5
ca57c3651db75069fcbbb7c5190e6a328331660e
/src/com/siwuxie095/forme/designpattern/category/chapter12th/example6th/Quackologist.java
acecb9ca576f794339ba9898434445fc2e63e457
[]
no_license
gouyanzhan/HelloWorld
f915ec8eabf8878b0c01fb8ec29b869e6fd68c5f
8cd9dc117d301d10207690052f2f27de2d9b9e2c
refs/heads/master
2022-03-25T07:31:52.842092
2022-03-11T07:08:30
2022-03-11T07:08:30
164,224,001
1
1
null
2019-01-07T14:18:44
2019-01-05T14:52:23
Java
UTF-8
Java
false
false
378
java
package com.siwuxie095.forme.designpattern.category.chapter12th.example6th; /** * 呱呱叫学家(观察者) * * @author Jiajing Li * @date 2019-11-10 11:42:22 */ class Quackologist implements Observer { @Override public void update(Observable duck) { System.out.println("Quackologist: " + duck.getClass().getSimpleName() + " just quacked."); } }
[ "834879583@qq.com" ]
834879583@qq.com
cef709f66e70c697fefc4d8542f80cb5bff08303
a1826c2ed9c12cfc395fb1a14c1a2e1f097155cb
/dm-20170622/src/main/java/com/aliyun/dm20170622/models/CreateDomainResponse.java
cbf4203840da09ba0d9726d00604e13cc121aa45
[ "Apache-2.0" ]
permissive
aliyun/alibabacloud-java-sdk
83a6036a33c7278bca6f1bafccb0180940d58b0b
008923f156adf2e4f4785a0419f60640273854ec
refs/heads/master
2023-09-01T04:10:33.640756
2023-09-01T02:40:45
2023-09-01T02:40:45
288,968,318
40
45
null
2023-06-13T02:47:13
2020-08-20T09:51:08
Java
UTF-8
Java
false
false
1,336
java
// This file is auto-generated, don't edit it. Thanks. package com.aliyun.dm20170622.models; import com.aliyun.tea.*; public class CreateDomainResponse extends TeaModel { @NameInMap("headers") @Validation(required = true) public java.util.Map<String, String> headers; @NameInMap("statusCode") @Validation(required = true) public Integer statusCode; @NameInMap("body") @Validation(required = true) public CreateDomainResponseBody body; public static CreateDomainResponse build(java.util.Map<String, ?> map) throws Exception { CreateDomainResponse self = new CreateDomainResponse(); return TeaModel.build(map, self); } public CreateDomainResponse setHeaders(java.util.Map<String, String> headers) { this.headers = headers; return this; } public java.util.Map<String, String> getHeaders() { return this.headers; } public CreateDomainResponse setStatusCode(Integer statusCode) { this.statusCode = statusCode; return this; } public Integer getStatusCode() { return this.statusCode; } public CreateDomainResponse setBody(CreateDomainResponseBody body) { this.body = body; return this; } public CreateDomainResponseBody getBody() { return this.body; } }
[ "sdk-team@alibabacloud.com" ]
sdk-team@alibabacloud.com
ec59ce6d397c13a6093c19b3beb362d983c33c34
a666c798a28223f97d74d21786f9a4f4000d5acb
/edu.harvard.i2b2.ontology/gensrc/edu/harvard/i2b2/ontology/datavo/i2b2message/ConditionsType.java
4fe610adde65cc8fc42583a23c8e6df8fe535557
[]
no_license
gmacdonnell/i2b2-fsu-1704
d65239edf95aa3b25844a6ed9af599e06dcaa185
12638996fe46a7014ac827e359c40e5b0e8c1d3e
refs/heads/master
2021-01-23T07:02:31.537241
2015-01-27T15:09:33
2015-01-27T15:09:33
29,916,117
0
0
null
null
null
null
UTF-8
Java
false
false
6,289
java
// // This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vhudson-jaxb-ri-2.1-558 // See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a> // Any modifications to this file will be lost upon recompilation of the source schema. // Generated on: 2015.01.26 at 12:47:09 PM EST // package edu.harvard.i2b2.ontology.datavo.i2b2message; import java.util.ArrayList; import java.util.List; import javax.xml.bind.annotation.XmlAccessType; import javax.xml.bind.annotation.XmlAccessorType; import javax.xml.bind.annotation.XmlAttribute; import javax.xml.bind.annotation.XmlElement; import javax.xml.bind.annotation.XmlType; import javax.xml.bind.annotation.XmlValue; /** * <p>Java class for conditionsType complex type. * * <p>The following schema fragment specifies the expected content contained within this class. * * <pre> * &lt;complexType name="conditionsType"> * &lt;complexContent> * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> * &lt;sequence> * &lt;element name="condition" maxOccurs="unbounded"> * &lt;complexType> * &lt;simpleContent> * &lt;extension base="&lt;http://www.w3.org/2001/XMLSchema>string"> * &lt;attribute name="type" use="required"> * &lt;simpleType> * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}string"> * &lt;enumeration value="ERROR"/> * &lt;enumeration value="FATAL_ERROR"/> * &lt;enumeration value="WARNING"/> * &lt;enumeration value="INFO"/> * &lt;/restriction> * &lt;/simpleType> * &lt;/attribute> * &lt;attribute name="coding_system" use="required" type="{http://www.w3.org/2001/XMLSchema}string" /> * &lt;/extension> * &lt;/simpleContent> * &lt;/complexType> * &lt;/element> * &lt;/sequence> * &lt;/restriction> * &lt;/complexContent> * &lt;/complexType> * </pre> * * */ @XmlAccessorType(XmlAccessType.FIELD) @XmlType(name = "conditionsType", propOrder = { "condition" }) public class ConditionsType { @XmlElement(required = true) protected List<ConditionsType.Condition> condition; /** * Gets the value of the condition property. * * <p> * This accessor method returns a reference to the live list, * not a snapshot. Therefore any modification you make to the * returned list will be present inside the JAXB object. * This is why there is not a <CODE>set</CODE> method for the condition property. * * <p> * For example, to add a new item, do as follows: * <pre> * getCondition().add(newItem); * </pre> * * * <p> * Objects of the following type(s) are allowed in the list * {@link ConditionsType.Condition } * * */ public List<ConditionsType.Condition> getCondition() { if (condition == null) { condition = new ArrayList<ConditionsType.Condition>(); } return this.condition; } /** * <p>Java class for anonymous complex type. * * <p>The following schema fragment specifies the expected content contained within this class. * * <pre> * &lt;complexType> * &lt;simpleContent> * &lt;extension base="&lt;http://www.w3.org/2001/XMLSchema>string"> * &lt;attribute name="type" use="required"> * &lt;simpleType> * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}string"> * &lt;enumeration value="ERROR"/> * &lt;enumeration value="FATAL_ERROR"/> * &lt;enumeration value="WARNING"/> * &lt;enumeration value="INFO"/> * &lt;/restriction> * &lt;/simpleType> * &lt;/attribute> * &lt;attribute name="coding_system" use="required" type="{http://www.w3.org/2001/XMLSchema}string" /> * &lt;/extension> * &lt;/simpleContent> * &lt;/complexType> * </pre> * * */ @XmlAccessorType(XmlAccessType.FIELD) @XmlType(name = "", propOrder = { "value" }) public static class Condition { @XmlValue protected String value; @XmlAttribute(required = true) protected String type; @XmlAttribute(name = "coding_system", required = true) protected String codingSystem; /** * Gets the value of the value property. * * @return * possible object is * {@link String } * */ public String getValue() { return value; } /** * Sets the value of the value property. * * @param value * allowed object is * {@link String } * */ public void setValue(String value) { this.value = value; } /** * Gets the value of the type property. * * @return * possible object is * {@link String } * */ public String getType() { return type; } /** * Sets the value of the type property. * * @param value * allowed object is * {@link String } * */ public void setType(String value) { this.type = value; } /** * Gets the value of the codingSystem property. * * @return * possible object is * {@link String } * */ public String getCodingSystem() { return codingSystem; } /** * Sets the value of the codingSystem property. * * @param value * allowed object is * {@link String } * */ public void setCodingSystem(String value) { this.codingSystem = value; } } }
[ "gmacdonnell@fsu.edu" ]
gmacdonnell@fsu.edu
ce6bc729b2d87e300ffaf8591ddf69c1f5ee63f1
85add549bdaa78108fbfad28f7f8d0bc1d0981e3
/src/main/java/com/ning/hfind/primary/ExpressionFactory.java
1dadd38e33bc0730209409ba486f76bb7a9b72e1
[ "Apache-2.0" ]
permissive
deltaprojects/hfind
afba5161049260e9b32747183a0aac8877c2849a
49558bfafa8eefa98234cc74321bc69e7343a5fa
refs/heads/master
2020-12-31T01:02:36.214593
2014-10-29T11:14:19
2014-10-29T11:14:19
25,916,249
1
0
null
null
null
null
UTF-8
Java
false
false
3,559
java
/* * Copyright 2010 Ning, Inc. * * Ning licenses this file to you under the Apache License, version 2.0 * (the "License"); you may not use this file except in compliance with the * License. You may obtain a copy of the License at: * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the * License for the specific language governing permissions and limitations * under the License. */ package com.ning.hfind.primary; import com.ning.hfind.util.PushbackIterator; import org.apache.commons.cli.Option; import org.apache.oro.text.regex.MalformedPatternException; import java.util.ArrayList; import java.util.Arrays; import java.util.Iterator; public class ExpressionFactory { public static Expression buildExpressionFromCommandLine(PushbackIterator<Option> iterator) { if (!iterator.hasNext()) { return Expression.TRUE; } else { try { return build(iterator); } catch (MalformedPatternException e) { // from -name throw new IllegalArgumentException(e); } } } private static Expression build(PushbackIterator<Option> iterator) throws MalformedPatternException { // Extract leftmost primary from the expression Primary leftPrimary = PrimaryFactory.primaryFromOption(iterator.next()); // We ignore certain primaries if (leftPrimary == null) { return build(iterator); } if (!iterator.hasNext()) { return new Expression(leftPrimary, Primary.ALWAYS_MATCH, new AndOperand()); } // Extract operand Operand operand = OperandFactory.operandFromOption(iterator); // If it's an OR, compute // leftPrimary OR (rest of the command line) if (operand.getClass().equals(OrOperand.class)) { return new Expression(leftPrimary, build(iterator), operand); } // It's an AND, regardless if -a was explicitly specified if (!iterator.hasNext()) { throw new IllegalArgumentException("Invalid expression"); } // Extract right primary Primary rightPrimary = PrimaryFactory.primaryFromOption(iterator.next()); Expression andExpression = new Expression(leftPrimary, rightPrimary, new AndOperand()); if (!iterator.hasNext()) { return andExpression; } else { // Extract next operand operand = OperandFactory.operandFromOption(iterator); return new Expression(andExpression, build(iterator), operand); } } public static Iterator<Option> sanitizeCommandLine(Option[] options) { ArrayList<Option> optionsList = new ArrayList<Option>(Arrays.asList(options)); Iterator<Option> optionIterator = (Iterator<Option>) optionsList.iterator(); while (optionIterator.hasNext()) { Option option = optionIterator.next(); try { if (PrimaryFactory.primaryFromOption(option) == null) { optionIterator.remove(); } } catch (MalformedPatternException ignored) { } catch (IllegalArgumentException ignored) { } } return optionsList.iterator(); } }
[ "pierre@mouraf.org" ]
pierre@mouraf.org
a6b11c7d322325173545d418d230d90cd79a9328
7569f9a68ea0ad651b39086ee549119de6d8af36
/cocoon-2.1.9/src/blocks/databases/java/org/apache/cocoon/components/language/markup/xsp/PostgresEsqlQuery.java
8d35f6317511f127d2ef9cf208ffeac015a755cf
[ "Apache-2.0" ]
permissive
tpso-src/cocoon
844357890f8565c4e7852d2459668ab875c3be39
f590cca695fd9930fbb98d86ae5f40afe399c6c2
refs/heads/master
2021-01-10T02:45:37.533684
2015-07-29T18:47:11
2015-07-29T18:47:11
44,549,791
0
0
null
null
null
null
UTF-8
Java
false
false
1,961
java
/* * Copyright 1999-2004 The Apache Software Foundation. * * 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.apache.cocoon.components.language.markup.xsp; import java.sql.SQLException; import java.sql.ResultSet; import java.sql.Connection; /** * @author <a href="mailto:haul@apache.org">Christian Haul</a> * @author <a href="mailto:tcurdt@apache.org">Torsten Curdt</a> * @version CVS $Id: PostgresEsqlQuery.java 30932 2004-07-29 17:35:38Z vgritsenko $ */ final public class PostgresEsqlQuery extends AbstractEsqlQuery { public PostgresEsqlQuery(Connection connection, String query) { super(connection, query); } /** * Only newInstance may use this contructor * @param resultSet */ private PostgresEsqlQuery(ResultSet resultSet) { super(resultSet); } /** * Create a EsqlQuery of the same type * @param resultSet */ public AbstractEsqlQuery newInstance(final ResultSet resultSet) { return(new PostgresEsqlQuery(resultSet)); } public String getQueryString() throws SQLException { StringBuffer sb = new StringBuffer(super.getQueryString()); if (getMaxRows() > -1) sb.append(" LIMIT ").append(getMaxRows()+1); if (getSkipRows() > 0) sb.append(" OFFSET ").append(getSkipRows()); return(sb.toString()); } public void getResultRows() throws SQLException { setPosition(getSkipRows()); } }
[ "ms@tpso.com" ]
ms@tpso.com
4e2e29b61c38715c8a8d38e039cb7e750aafd5d5
b6ea417b48402d85b6fe90299c51411b778c07cc
/spring-beans/src/main/java/org/springframework/beans/factory/config/BeanPostProcessor.java
996daad6697f9a6307077a315495c071050809b5
[ "Apache-2.0" ]
permissive
DevHui/spring-framework
065f24e96eaaed38495b9d87bc322db82b6a046c
4a2f291e26c6f78c3875dea13432be21bb1c0ed6
refs/heads/master
2020-12-04T21:08:18.445815
2020-01-15T03:54:42
2020-01-15T03:54:42
231,526,595
1
0
Apache-2.0
2020-01-03T06:28:30
2020-01-03T06:28:29
null
UTF-8
Java
false
false
4,196
java
/* * Copyright 2002-2016 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * https://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org.springframework.beans.factory.config; import org.springframework.beans.BeansException; import org.springframework.lang.Nullable; /** * Factory hook that allows for custom modification of new bean instances, * e.g. checking for marker interfaces or wrapping them with proxies. * * <p>ApplicationContexts can autodetect BeanPostProcessor beans in their * bean definitions and apply them to any beans subsequently created. * Plain bean factories allow for programmatic registration of post-processors, * applying to all beans created through this factory. * * <p>Typically, post-processors that populate beans via marker interfaces * or the like will implement {@link #postProcessBeforeInitialization}, * while post-processors that wrap beans with proxies will normally * implement {@link #postProcessAfterInitialization}. * * @author Juergen Hoeller * @see InstantiationAwareBeanPostProcessor * @see DestructionAwareBeanPostProcessor * @see ConfigurableBeanFactory#addBeanPostProcessor * @see BeanFactoryPostProcessor * @since 10.10.2003 */ public interface BeanPostProcessor { /** * Apply this BeanPostProcessor to the given new bean instance <i>before</i> any bean * initialization callbacks (like InitializingBean's {@code afterPropertiesSet} * or a custom init-method). The bean will already be populated with property values. * The returned bean instance may be a wrapper around the original. * <p>The default implementation returns the given {@code bean} as-is. * * @param bean the new bean instance * @param beanName the name of the bean * @return the bean instance to use, either the original or a wrapped one; * if {@code null}, no subsequent BeanPostProcessors will be invoked * @throws org.springframework.beans.BeansException in case of errors * @see org.springframework.beans.factory.InitializingBean#afterPropertiesSet */ @Nullable default Object postProcessBeforeInitialization(Object bean, String beanName) throws BeansException { return bean; } /** * Apply this BeanPostProcessor to the given new bean instance <i>after</i> any bean * initialization callbacks (like InitializingBean's {@code afterPropertiesSet} * or a custom init-method). The bean will already be populated with property values. * The returned bean instance may be a wrapper around the original. * <p>In case of a FactoryBean, this callback will be invoked for both the FactoryBean * instance and the objects created by the FactoryBean (as of Spring 2.0). The * post-processor can decide whether to apply to either the FactoryBean or created * objects or both through corresponding {@code bean instanceof FactoryBean} checks. * <p>This callback will also be invoked after a short-circuiting triggered by a * {@link InstantiationAwareBeanPostProcessor#postProcessBeforeInstantiation} method, * in contrast to all other BeanPostProcessor callbacks. * <p>The default implementation returns the given {@code bean} as-is. * * @param bean the new bean instance * @param beanName the name of the bean * @return the bean instance to use, either the original or a wrapped one; * if {@code null}, no subsequent BeanPostProcessors will be invoked * @throws org.springframework.beans.BeansException in case of errors * @see org.springframework.beans.factory.InitializingBean#afterPropertiesSet * @see org.springframework.beans.factory.FactoryBean */ @Nullable default Object postProcessAfterInitialization(Object bean, String beanName) throws BeansException { return bean; } }
[ "pengshaohui@markor.com.cn" ]
pengshaohui@markor.com.cn
1bda35ce73547397a0b80502b57b04bddaee8e53
dba87418d2286ce141d81deb947305a0eaf9824f
/sources/com/iaai/android/bdt/feature/account/watchlist/PreSaleListViewModel_Factory.java
1402c7edf563d870f01ccc9d9e8999ce87d7c45e
[]
no_license
Sluckson/copyOavct
1f73f47ce94bb08df44f2ba9f698f2e8589b5cf6
d20597e14411e8607d1d6e93b632d0cd2e8af8cb
refs/heads/main
2023-03-09T12:14:38.824373
2021-02-26T01:38:16
2021-02-26T01:38:16
341,292,450
0
1
null
null
null
null
UTF-8
Java
false
false
1,431
java
package com.iaai.android.bdt.feature.account.watchlist; import com.iaai.android.bdt.feature.watchList.WatchRepository; import dagger.internal.Factory; import javax.inject.Provider; public final class PreSaleListViewModel_Factory implements Factory<PreSaleListViewModel> { private final Provider<PreSaleListRepository> repositoryProvider; private final Provider<WatchRepository> watchRepositoryProvider; public PreSaleListViewModel_Factory(Provider<PreSaleListRepository> provider, Provider<WatchRepository> provider2) { this.repositoryProvider = provider; this.watchRepositoryProvider = provider2; } public PreSaleListViewModel get() { return provideInstance(this.repositoryProvider, this.watchRepositoryProvider); } public static PreSaleListViewModel provideInstance(Provider<PreSaleListRepository> provider, Provider<WatchRepository> provider2) { return new PreSaleListViewModel(provider.get(), provider2.get()); } public static PreSaleListViewModel_Factory create(Provider<PreSaleListRepository> provider, Provider<WatchRepository> provider2) { return new PreSaleListViewModel_Factory(provider, provider2); } public static PreSaleListViewModel newPreSaleListViewModel(PreSaleListRepository preSaleListRepository, WatchRepository watchRepository) { return new PreSaleListViewModel(preSaleListRepository, watchRepository); } }
[ "lucksonsurprice94@gmail.com" ]
lucksonsurprice94@gmail.com
eb4654b30741bd03bfa38748247275c5aa43e787
96ca02a85d3702729076cb59ff15d069dfa8232b
/ADS1.0/src/java/com/avit/ads/xml/beans/GetAssetLocations.java
b82a2f4bb316b72f9ff82332268d86e485d92ebd
[]
no_license
Hurson/mysql
4a1600d9f580ac086ff9472095ed6fa58fb11830
3db53442376485a310c76ad09d6cf71143f38274
refs/heads/master
2021-01-10T17:55:50.003989
2016-03-11T11:36:15
2016-03-11T11:36:15
54,877,514
0
1
null
null
null
null
UTF-8
Java
false
false
1,040
java
/** * Copyright (c) AVIT LTD (2012). All Rights Reserved. * Welcome to <a href="www.avit.com.cn">www.avit.com.cn</a> */ package com.avit.ads.xml.beans; import javax.xml.bind.annotation.XmlAccessType; import javax.xml.bind.annotation.XmlAccessorType; import javax.xml.bind.annotation.XmlAttribute; import javax.xml.bind.annotation.XmlRootElement; /** * @Description:资产定位查询请求消息 * @author lizhiwei * @Date: 2012-5-25 * @Version: 1.0 */ @XmlAccessorType(XmlAccessType.FIELD) @XmlRootElement(name="GetAssetLocations") public class GetAssetLocations { @XmlAttribute(name="assetId", required = true) private String assetId; @XmlAttribute(name="providerID", required = true) private String providerID; public String getAssetId() { return assetId; } public void setAssetId(String assetId) { this.assetId = assetId; } public String getProviderID() { return providerID; } public void setProviderID(String providerID) { this.providerID = providerID; } }
[ "zhengguojin@d881c268-5c81-4d69-b6ac-ed4e9099e0f2" ]
zhengguojin@d881c268-5c81-4d69-b6ac-ed4e9099e0f2
ec7fab6613b9a94c6d230d83ce9b86270275c63e
5c0a5d1e3685720e5fa387a26a60dd06bb7c6e4a
/group-core/lock-core/src/main/java/com/spark/bitrade/service/RedPackManageService.java
d00e87ff8fb617bba19cebbce44fe26c752d9a4e
[]
no_license
im8s/silk-v1
5d88ccd1b5ed2370f8fba4a70298d1d14d9a175d
ff9f689443af30c815a8932899a333dfc87f6f12
refs/heads/master
2022-06-20T13:08:01.519634
2020-04-28T02:56:50
2020-04-28T02:56:50
null
0
0
null
null
null
null
UTF-8
Java
false
false
5,460
java
package com.spark.bitrade.service; import com.spark.bitrade.constant.TransactionType; import com.spark.bitrade.dao.MemberTransactionDao; import com.spark.bitrade.dao.RedPackManageDao; import com.spark.bitrade.dao.RedPackReceiveRecordDao; import com.spark.bitrade.entity.*; import com.spark.bitrade.service.Base.BaseService; import com.spark.bitrade.util.MessageResult; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; import org.springframework.util.Assert; import javax.annotation.Resource; import java.math.BigDecimal; import java.util.Date; import java.util.List; /** * <p> * 红包信息活动管理表(red_pack_manage) 服务类 * </p> * * @author qiliao * @since 2019-11-25 */ @Service public class RedPackManageService extends BaseService { @Autowired private RedPackManageDao redPackManageDao; @Autowired private ISilkDataDistService silkDataDistService; @Autowired private MemberWalletService memberWalletService; @Autowired private RedPackReceiveRecordDao redPackReceiveRecordDao; @Autowired private RedPackReceiveRecordService recordService; @Resource private MemberTransactionDao memberTransactionDao; /** * 查询最近有效的红包 * @return */ public RedPackManage findValidRedPack() { return redPackManageDao.findValidRedPack(); } public RedPackManage findById(Long id){ return redPackManageDao.findOne(id); } public RedPackManage save(RedPackManage redPackManage){ return redPackManageDao.save(redPackManage); } public int updateBalance(BigDecimal changeAmount, Long id,Integer count){ return redPackManageDao.updateBalance(changeAmount,id,count); } public List<RedPackManage> findExpireManages(){ return redPackManageDao.findExpireManages(); } @Transactional public void returnManage(RedPackManage manage) { //add by qhliao 查询出未领取的红包 boolean hasReload=false; List<RedPackReceiveRecord> beExpire = redPackReceiveRecordDao.findRecordExpireByManageId(manage.getId()); for (RedPackReceiveRecord re:beExpire){ recordService.doReturn(re); hasReload=true; } SilkDataDist silkDataDist=silkDataDistService.findByIdAndKey("RED_PACK_CONFIG","TOTAL_ACCOUNT_ID"); Assert.notNull(silkDataDist,"红包支付账户未配置,请联系管理员"); Long totalAccountId = Long.valueOf(silkDataDist.getDictVal()); //更新剩余金额为0 if(hasReload){ manage=redPackManageDao.findOne(manage.getId()); } if(manage.getRedPacketBalance().compareTo(BigDecimal.ZERO)>0){ int i = redPackManageDao.updateManageRedBalance(manage.getId(), manage.getRedPacketBalance()); Assert.isTrue(i>0,"更新剩余金额失败"); MemberWallet walletTotal = memberWalletService.findByCoinUnitAndMemberId(manage.getUnit(), totalAccountId); Assert.notNull(walletTotal,"红包支付钱包不存在,请联系管理员"); //冻结余额到可用余额 MessageResult messageResult = memberWalletService.thawBalance(walletTotal, manage.getRedPacketBalance()); Assert.isTrue(messageResult.isSuccess(),messageResult.getMessage()); //新增如果红包是 项目方红包 则需要将总账户的钱 再转移到 项目方账户 Long supportProjectMemberId = redPackManageDao.findSupportProjectMemberId(manage.getId()); if(supportProjectMemberId!=null){ //红包总账户扣款 MessageResult decreaseBalance = memberWalletService.decreaseBalance(walletTotal.getId(), manage.getRedPacketBalance()); Assert.isTrue(decreaseBalance.isSuccess(),messageResult.getMessage()); MemberTransaction m1=new MemberTransaction(); m1.setMemberId(totalAccountId); m1.setAmount(manage.getRedPacketBalance().negate()); m1.setCreateTime(new Date()); m1.setType(TransactionType.RED_PACK_RETURN); m1.setSymbol(manage.getUnit()); m1.setFee(BigDecimal.ZERO); m1.setComment("项目方红包结束剩余退还"); memberTransactionDao.save(m1); //项目方增加 MemberWallet projectWallet = memberWalletService.findByCoinUnitAndMemberId(manage.getUnit(), supportProjectMemberId); Assert.notNull(projectWallet,"项目方钱包不存在"); MessageResult increaseBalance = memberWalletService.increaseBalance(projectWallet.getId(), manage.getRedPacketBalance()); Assert.isTrue(increaseBalance.isSuccess(),increaseBalance.getMessage()); MemberTransaction m2=new MemberTransaction(); m2.setMemberId(supportProjectMemberId); m2.setAmount(manage.getRedPacketBalance()); m2.setCreateTime(new Date()); m2.setType(TransactionType.RED_PACK_RETURN); m2.setSymbol(manage.getUnit()); m2.setFee(BigDecimal.ZERO); m2.setComment("项目方红包结束剩余退还"); memberTransactionDao.save(m2); } } } }
[ "huihui123" ]
huihui123
ae8d22cd01921675aa9e18c52418189040867822
27721e886795df3e467756b8e0480f7afd6e66c4
/java/jpwr/jopg/src/GlowEventToolbar.java
531d7db92256775507f273efc712a7970d07a88c
[]
no_license
brunad-coder/proview
88722029f3614d0febc4a8e9e6dea4859cc87363
4d75b942c649b1da8797323fa40f7f20cff634f8
refs/heads/master
2020-07-15T14:52:59.275163
2020-03-02T23:40:11
2020-03-02T23:40:11
205,586,528
0
0
null
2019-08-31T19:15:34
2019-08-31T19:15:34
null
UTF-8
Java
false
false
1,803
java
/* * ProviewR Open Source Process Control. * Copyright (C) 2005-2018 SSAB EMEA AB. * * This file is part of ProviewR. * * This program 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 2 of * the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with ProviewR. If not, see <http://www.gnu.org/licenses/> * * Linking ProviewR statically or dynamically with other modules is * making a combined work based on ProviewR. Thus, the terms and * conditions of the GNU General Public License cover the whole * combination. * * In addition, as a special exception, the copyright holders of * ProviewR give you permission to, from the build function in the * ProviewR Configurator, combine ProviewR with modules generated by the * ProviewR PLC Editor to a PLC program, regardless of the license * terms of these modules. You may copy and distribute the resulting * combined work under the terms of your choice, provided that every * copy of the combined work is accompanied by a complete copy of * the source code of ProviewR (the version used to produce the * combined work), being distributed under the terms of the GNU * General Public License plus this exception. */ package jpwr.jopg; public class GlowEventToolbar extends GlowEvent { public int category; public int idx; public GlowEventToolbar() {} }
[ "claes.sjofors@proview.se" ]
claes.sjofors@proview.se
9cc5a8ab6d7bbd27f635421b4ee0737ea80eea7e
9df342b8b7ecd2a9a39a585b6b84f9c19ee1506b
/src/com/sun/corba/se/PortableActivationIDL/_ORBProxyStub.java
52507bd5dff4fcfb011bc78aecfc5c92447f5449
[]
no_license
WangXinW/jdk1.8-src
2abbf6771ec7d69eca457c635ca665c6c26980b9
112ff6c8844a205c158743afa0e94fc6ebd3d386
refs/heads/master
2020-07-28T20:46:53.809525
2019-10-09T03:47:20
2019-10-09T03:47:20
209,532,127
0
0
null
null
null
null
UTF-8
Java
false
false
2,934
java
package com.sun.corba.se.PortableActivationIDL; /** * com/sun/corba/se/PortableActivationIDL/_ORBProxyStub.java . * Generated by the IDL-to-Java compiler (portable), version "3.2" * from c:/workspace/8-2-build-windows-amd64-cygwin/jdk8u31/2394/corba/src/share/classes/com/sun/corba/se/PortableActivationIDL/activation.idl * Wednesday, December 17, 2014 9:02:20 PM PST */ /** ORB callback interface, passed to Activator in registerORB method. */ public class _ORBProxyStub extends org.omg.CORBA.portable.ObjectImpl implements com.sun.corba.se.PortableActivationIDL.ORBProxy { /** Method used to cause ORB to activate the named adapter, if possible. * This will cause the named POA to register itself with the activator as * a side effect. This should always happen before this call can complete. * This method returns true if adapter activation succeeded, otherwise it * returns false. */ public boolean activate_adapter (String[] name) { org.omg.CORBA.portable.InputStream $in = null; try { org.omg.CORBA.portable.OutputStream $out = _request ("activate_adapter", true); org.omg.PortableInterceptor.AdapterNameHelper.write ($out, name); $in = _invoke ($out); boolean $result = $in.read_boolean (); return $result; } catch (org.omg.CORBA.portable.ApplicationException $ex) { $in = $ex.getInputStream (); String _id = $ex.getId (); throw new org.omg.CORBA.MARSHAL (_id); } catch (org.omg.CORBA.portable.RemarshalException $rm) { return activate_adapter (name ); } finally { _releaseReply ($in); } } // activate_adapter // Type-specific CORBA::Object operations private static String[] __ids = { "IDL:PortableActivationIDL/ORBProxy:1.0"}; public String[] _ids () { return (String[])__ids.clone (); } private void readObject (java.io.ObjectInputStream s) throws java.io.IOException { String str = s.readUTF (); String[] args = null; java.util.Properties props = null; org.omg.CORBA.ORB orb = org.omg.CORBA.ORB.init (args, props); try { org.omg.CORBA.Object obj = orb.string_to_object (str); org.omg.CORBA.portable.Delegate delegate = ((org.omg.CORBA.portable.ObjectImpl) obj)._get_delegate (); _set_delegate (delegate); } finally { orb.destroy() ; } } private void writeObject (java.io.ObjectOutputStream s) throws java.io.IOException { String[] args = null; java.util.Properties props = null; org.omg.CORBA.ORB orb = org.omg.CORBA.ORB.init (args, props); try { String str = orb.object_to_string (this); s.writeUTF (str); } finally { orb.destroy() ; } } } // class _ORBProxyStub
[ "2763041366@qq.com" ]
2763041366@qq.com
cb80909009cc518520a7a15131a6c89e5d03d592
24995e94d4335b3fc31db463cffc9d49e7acce38
/library/src/main/java/com/github/pwittchen/reactivebeacons/library/Beacon.java
5ee06353f0096adc81e4e7f1b9eca2be5ef9838f
[ "Apache-2.0" ]
permissive
Wrywulf/ReactiveBeacons
b1bc6f10c89a2a1e6109032e9677baa3ffe591d3
ea8892452d62c4616b80da03347128761690fe87
refs/heads/master
2021-01-23T14:50:22.804881
2015-11-10T06:47:38
2015-11-10T06:47:38
44,408,898
0
0
null
2015-10-16T20:27:33
2015-10-16T20:27:32
null
UTF-8
Java
false
false
2,730
java
/* * Copyright (C) 2015 Piotr Wittchen * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package com.github.pwittchen.reactivebeacons.library; import android.bluetooth.BluetoothDevice; import java.util.Arrays; public class Beacon { public final BluetoothDevice device; public final int rssi; // Received Signal Strength Indication public final byte[] scanRecord; public final int txPower; // The Transmit Power Level characteristic in dBm public Beacon(BluetoothDevice device, int rssi, byte[] scanRecord) { this.device = device; this.rssi = rssi; this.scanRecord = scanRecord; this.txPower = -59; // default value in for Estimote and Kontakt.io beacons } public static Beacon create(BluetoothDevice device, int rssi, byte[] scanRecord) { return new Beacon(device, rssi, scanRecord); } /** * Gets distance from BLE beacon to mobile device in meters * * @return distance in meters as double */ public double getDistance() { return getDistance(rssi, txPower); } public Proximity getProximity() { double distance = getDistance(); Proximity immediate = Proximity.IMMEDIATE; Proximity near = Proximity.NEAR; if (distance < immediate.maxDistance) { return immediate; } if (distance >= near.minDistance && distance <= near.maxDistance) { return near; } return Proximity.FAR; } private double getDistance(int rssi, int txPower) { return Math.pow(10d, ((double) txPower - rssi) / (10 * 2)); } @Override public String toString() { return "Beacon{device=" + device + ", rssi=" + rssi + '}'; } @Override public boolean equals(Object o) { if (this == o) { return true; } if (o == null || getClass() != o.getClass()) { return false; } Beacon beacon = (Beacon) o; if (rssi != beacon.rssi) { return false; } if (!device.equals(beacon.device)) { return false; } return Arrays.equals(scanRecord, beacon.scanRecord); } @Override public int hashCode() { int result = device.hashCode(); result = 31 * result + rssi; result = 31 * result + (scanRecord != null ? Arrays.hashCode(scanRecord) : 0); return result; } }
[ "piotr@wittchen.biz.pl" ]
piotr@wittchen.biz.pl
3b8783eeae1b2b55d3f5bc7bd7dff1a3492848ea
4b38673dd1dda06576b68aa4677b31c71cb9518d
/src/main/java/io/github/jhipster/application/service/ProdutoService.java
2ae02f95f69cf8bb389b224016c82904cda9bdc7
[]
no_license
caioccc/jhipsterciaciment
b6f249a23a63eae32841f1c0b9b5fcf37d62d3de
d7230ca4cff42e86be56021e9a1d1f76b4cd66cb
refs/heads/master
2020-03-28T18:50:52.479613
2018-09-15T16:18:54
2018-09-15T16:18:54
148,918,414
0
0
null
2018-09-15T16:18:55
2018-09-15T16:16:40
Java
UTF-8
Java
false
false
3,441
java
package io.github.jhipster.application.service; import io.github.jhipster.application.domain.Produto; import io.github.jhipster.application.repository.ProdutoRepository; import io.github.jhipster.application.repository.search.ProdutoSearchRepository; import io.github.jhipster.application.service.dto.ProdutoDTO; import io.github.jhipster.application.service.mapper.ProdutoMapper; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.data.domain.Page; import org.springframework.data.domain.Pageable; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; import java.util.Optional; import static org.elasticsearch.index.query.QueryBuilders.*; /** * Service Implementation for managing Produto. */ @Service @Transactional public class ProdutoService { private final Logger log = LoggerFactory.getLogger(ProdutoService.class); private final ProdutoRepository produtoRepository; private final ProdutoMapper produtoMapper; private final ProdutoSearchRepository produtoSearchRepository; public ProdutoService(ProdutoRepository produtoRepository, ProdutoMapper produtoMapper, ProdutoSearchRepository produtoSearchRepository) { this.produtoRepository = produtoRepository; this.produtoMapper = produtoMapper; this.produtoSearchRepository = produtoSearchRepository; } /** * Save a produto. * * @param produtoDTO the entity to save * @return the persisted entity */ public ProdutoDTO save(ProdutoDTO produtoDTO) { log.debug("Request to save Produto : {}", produtoDTO); Produto produto = produtoMapper.toEntity(produtoDTO); produto = produtoRepository.save(produto); ProdutoDTO result = produtoMapper.toDto(produto); produtoSearchRepository.save(produto); return result; } /** * Get all the produtos. * * @param pageable the pagination information * @return the list of entities */ @Transactional(readOnly = true) public Page<ProdutoDTO> findAll(Pageable pageable) { log.debug("Request to get all Produtos"); return produtoRepository.findAll(pageable) .map(produtoMapper::toDto); } /** * Get one produto by id. * * @param id the id of the entity * @return the entity */ @Transactional(readOnly = true) public Optional<ProdutoDTO> findOne(Long id) { log.debug("Request to get Produto : {}", id); return produtoRepository.findById(id) .map(produtoMapper::toDto); } /** * Delete the produto by id. * * @param id the id of the entity */ public void delete(Long id) { log.debug("Request to delete Produto : {}", id); produtoRepository.deleteById(id); produtoSearchRepository.deleteById(id); } /** * Search for the produto corresponding to the query. * * @param query the query of the search * @param pageable the pagination information * @return the list of entities */ @Transactional(readOnly = true) public Page<ProdutoDTO> search(String query, Pageable pageable) { log.debug("Request to search for a page of Produtos for query {}", query); return produtoSearchRepository.search(queryStringQuery(query), pageable) .map(produtoMapper::toDto); } }
[ "jhipster-bot@jhipster.tech" ]
jhipster-bot@jhipster.tech
bbb44f285ffb9b4a83bfa06df79291b7c862ff1f
3f7354696e7e3b82eb1a071fb3284eaccc83c604
/kontrakter/vl-kontrakt-fp-feed/infotrygd-hendelser-feed/src/main/java/no/nav/foreldrepenger/kontrakter/feed/infotrygd/v1/InfotrygdInnvilget.java
665fd9ad0cdf5186af39dab2714ffcedeeb2ee5f
[]
no_license
navikt/spvtpmock
7beaf5a063f63f4d14996e5760d8ab2b492d51e4
87fd8437753c7f202badabfe1865f7a21d61c43b
refs/heads/master
2023-08-03T09:43:14.842580
2019-04-23T07:28:07
2019-04-23T07:28:07
169,393,710
0
0
null
null
null
null
UTF-8
Java
false
false
163
java
package no.nav.foreldrepenger.kontrakter.feed.infotrygd.v1; public class InfotrygdInnvilget extends Innhold { public InfotrygdInnvilget() { super(); } }
[ "roy.andre.gundersen@nav.no" ]
roy.andre.gundersen@nav.no
f24c2632155efc3285c57ae77410f701c5e9b71b
13c2d3db2d49c40c74c2e6420a9cd89377f1c934
/program_data/JavaProgramData/38/367.java
533ea01303721541ca333d14746615eb98b574c8
[ "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,077
java
package <missing>; public class GlobalMembers { public static int Main() { int k; int n; int i; int j; double[] s; String tempVar = ConsoleInput.scanfRead(); if (tempVar != null) { k = Integer.parseInt(tempVar); } s = new double[k]; for (i = 0;i < k;i++) { String tempVar2 = ConsoleInput.scanfRead(); if (tempVar2 != null) { n = Integer.parseInt(tempVar2); } double[] x; x = new double[n]; double a = 0; double b = 0; for (j = 0;j < n;j++) { String tempVar3 = ConsoleInput.scanfRead(); if (tempVar3 != null) { x[j] = Double.parseDouble(tempVar3); } a += x[j]; } a = a / n; for (j = 0;j < n;j++) { b += (x[j] - a) * (x[j] - a); } s[i] = (sqrt)(b / n); //C++ TO JAVA CONVERTER TODO TASK: The memory management function 'free' has no equivalent in Java: free(x); } for (i = 0;i < k;i++) { System.out.printf("%.5lf\n",s[i]); } //C++ TO JAVA CONVERTER TODO TASK: The memory management function 'free' has no equivalent in Java: free(s); return 0; } }
[ "y.yu@open.ac.uk" ]
y.yu@open.ac.uk
f44259fc45f318ab358959d439d4646c2d0b140c
b755a269f733bc56f511bac6feb20992a1626d70
/qiyun-lottery/lottery-service/src/main/java/com/qiyun/service/BasketballDataService.java
6d27a8e25288c5f57d03266773bb2425349cca31
[]
no_license
yysStar/dubbo-zookeeper-SSM
55df313b58c78ab2eaa3d021e5bb201f3eee6235
e3f85dea824159fb4c29207cc5c9ccaecf381516
refs/heads/master
2022-12-21T22:50:33.405116
2020-05-09T09:20:41
2020-05-09T09:20:41
125,301,362
2
0
null
2022-12-16T10:51:09
2018-03-15T02:27:17
Java
UTF-8
Java
false
false
800
java
package com.qiyun.service; import com.qiyun.model.BasketBallBase; import com.qiyun.model.basketball.BasketBallGame; import com.qiyun.model.basketball.BasketballDxp; import com.qiyun.model.basketball.BasketballOp; import com.qiyun.model.basketball.BasketballYp; import org.springframework.stereotype.Service; import java.util.List; @Service public interface BasketballDataService { List<BasketBallBase> findByIds(List<Integer> oddIdList); List<BasketballYp> getYpListByintTimes(String s); List<BasketballOp> getOpListByintTimes(List<String> intTimeList, String avgCompany); List<BasketballDxp> getDxpListByintTimes(String s); BasketBallGame findGameByStandardName(String matchName); void attachDirty(BasketBallGame game); void saveIfChange(BasketBallBase base); }
[ "qawsed1231010@126.com" ]
qawsed1231010@126.com
470d2245130bfedceaf52bc181542776b53cf79f
d88496bf9951bbe8177955a3ae8f904c552d9cd1
/frontgoo-orm/src/main/java/org/frontgoo/orm/hibernate/base/ResultBean.java
875d90b5293c3ad78cb7cc897c9703e912df039c
[]
no_license
sdgdsffdsfff/rep
ac034247b9b6c73d1cc7a804921a117213751291
0811ddef49c5b41064e3508993b854878cb25e6a
refs/heads/master
2020-12-25T04:37:24.360104
2015-08-12T08:15:07
2015-08-12T08:15:07
null
0
0
null
null
null
null
UTF-8
Java
false
false
5,107
java
package org.frontgoo.orm.hibernate.base; import java.io.Serializable; import java.util.Arrays; import java.util.List; /** * 业务执行结果对象 * * ResultBean * * * @version 1.0.0 * */ public class ResultBean<T> implements Serializable{ /** * */ private static final long serialVersionUID = 4329054640002077889L; private boolean success = false;// 执行结果 private T returnObject;// 执行返回结果 private List<T> returnSet;// 执行结果集 private long total;// 结果集总数 private int start;// 结果集索引开始位置 private int limit = 50;// 结果集数量限制 private String errorMessage;// 执行错误描述 private String msg;// 描述信息 private String[] msgList;// 描述信息集合 private int page;//当前页码 private int totalPage; private boolean hasNext = false; //是否有下一页 public String[] getMsgList() { return msgList; } public ResultBean<T> setMsgList(String[] msgList) { this.msgList = msgList; return this; } public List<T> getReturnSet() { return returnSet; } /** * 打印集合 * @return */ public void printReturnSet() { if(returnSet == null) return; for(T t:returnSet){ System.out.println(t); } } public ResultBean<T> setReturnSet(List<T> returnSet) { this.returnSet = returnSet; return this; } public long getTotal() { return total; } public ResultBean<T> setTotal(long total) { this.total = total; return this; } public int getStart() { return start; } public ResultBean<T> setStart(int start) { this.start = start; return this; } public int getLimit() { return limit; } public ResultBean<T> setLimit(int limit) { this.limit = limit; return this; } public Object getReturnObject() { return returnObject; } public ResultBean<T> setReturnObject(T returnObject) { this.returnObject = returnObject; return this; } public boolean isSuccess() { return success; } public ResultBean<T> setSuccess(boolean success) { this.success = success; return this; } public String getErrorMessage() { return errorMessage; } public ResultBean<T> setErrorMessage(String errorMessage) { this.errorMessage = errorMessage; return this; } public String getMsg() { return msg; } public ResultBean<T> setMsg(String msg) { this.msg = msg; return this; } public void setPage(int page) { this.page = page; } public int getPage() { return page; } public void setTotalPage(int totalPage) { this.totalPage = totalPage; } public int getTotalPage() { totalPage = (int) (total/limit); if(total%limit != 0){ totalPage++; } return totalPage; } public void setHasNext(Boolean hasNext) { this.hasNext = hasNext; } public Boolean getHasNext() { return hasNext; } @Override public String toString() { return "ResultBean [success=" + success + ", returnObject=" + returnObject + ", returnSet=" + returnSet + ", total=" + total + ", start=" + start + ", limit=" + limit + ", errorMessage=" + errorMessage + ", msg=" + msg + ", msgList=" + Arrays.toString(msgList) + "]"; } @Override public int hashCode() { final int prime = 31; int result = 1; result = prime * result + ((errorMessage == null) ? 0 : errorMessage.hashCode()); result = prime * result + (hasNext ? 1231 : 1237); result = prime * result + limit; result = prime * result + ((msg == null) ? 0 : msg.hashCode()); result = prime * result + Arrays.hashCode(msgList); result = prime * result + page; result = prime * result + ((returnObject == null) ? 0 : returnObject.hashCode()); result = prime * result + ((returnSet == null) ? 0 : returnSet.hashCode()); result = prime * result + start; result = prime * result + (success ? 1231 : 1237); result = prime * result + (int) (total ^ (total >>> 32)); result = prime * result + totalPage; return result; } @Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (getClass() != obj.getClass()) return false; ResultBean other = (ResultBean) obj; if (errorMessage == null) { if (other.errorMessage != null) return false; } else if (!errorMessage.equals(other.errorMessage)) return false; if (hasNext != other.hasNext) return false; if (limit != other.limit) return false; if (msg == null) { if (other.msg != null) return false; } else if (!msg.equals(other.msg)) return false; if (!Arrays.equals(msgList, other.msgList)) return false; if (page != other.page) return false; if (returnObject == null) { if (other.returnObject != null) return false; } else if (!returnObject.equals(other.returnObject)) return false; if (returnSet == null) { if (other.returnSet != null) return false; } else if (!returnSet.equals(other.returnSet)) return false; if (start != other.start) return false; if (success != other.success) return false; if (total != other.total) return false; if (totalPage != other.totalPage) return false; return true; } }
[ "sunhonglei01@chinatopcredit.com" ]
sunhonglei01@chinatopcredit.com
dd3a4b4c0f00e519950f85a4bd542a3ed324d619
d8c03dfc21e1b3d89ee4702430a98a4de8d841b4
/src/main/java/com/habibsweb/commons/components/event/ScrollableListItemSelectionEvent.java
abac3a896fd769f81efeb62773fb04315aba7f38
[]
no_license
lespaul361/Habib-Commons-SelectList
35948b5f2cdeb5922e4efc2dfbfec23d1fa84979
61302704a035bcc29d7ce79c3f8cbef9b57a93cf
refs/heads/master
2021-09-05T21:02:36.430978
2018-01-31T01:29:49
2018-01-31T01:29:49
114,521,788
0
0
null
null
null
null
UTF-8
Java
false
false
1,334
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 com.habibsweb.commons.components.event; import java.util.EventObject; /** * * @author Charles Hamilton */ public class ScrollableListItemSelectionEvent extends EventObject { /** * Item has been selected */ public static final int SELECTED = 1; /** * item has been unselected */ public static final int UNSELECTED = 0; private final int index; private final int mode; /** * Constructs a new <code>ScrollableListItemSelectionEvent</code> * * @param source the <code>ScrollableList</code> that created the event * @param selection the mode of selected or unselected * @param index the index of the item */ public ScrollableListItemSelectionEvent(Object source,int selection, int index) { super(source); this.index=index; this.mode=selection; } /** * Gets the index of the item * @return the index of the item */ public int getIndex() { return index; } /** * Gets the selection mode * @return the selection mode */ public int getMode() { return mode; } }
[ "lespaul36@gmail.com" ]
lespaul36@gmail.com
677b8db7a2a9bb41ed944dd924f0484e6c9e571e
6baf1fe00541560788e78de5244ae17a7a2b375a
/hollywood/com.oculus.userserver2-UserServer2/sources/X/ep.java
b2bf8a5738df99053f57eba7d25b33de7df0f107
[]
no_license
phwd/quest-tracker
286e605644fc05f00f4904e51f73d77444a78003
3d46fbb467ba11bee5827f7cae7dfeabeb1fd2ba
refs/heads/main
2023-03-29T20:33:10.959529
2021-04-10T22:14:11
2021-04-10T22:14:11
357,185,040
4
2
null
2021-04-12T12:28:09
2021-04-12T12:28:08
null
UTF-8
Java
false
false
361
java
package X; import android.net.Uri; import java.util.List; import javax.annotation.Nullable; import org.json.JSONObject; public class ep { @Nullable public List<Uri> A00; @Nullable public JSONObject A01; public ep(@Nullable JSONObject jSONObject, @Nullable List<Uri> list) { this.A01 = jSONObject; this.A00 = list; } }
[ "cyuubiapps@gmail.com" ]
cyuubiapps@gmail.com
4af82fa9c35e90913fe1df1954c911112ca2eb40
e75be673baeeddee986ece49ef6e1c718a8e7a5d
/submissions/blizzard/Corpus/eclipse.jdt.ui/5643.java
bfb058a2a937f2cfb5f364ed3faac3b3996056bd
[ "MIT" ]
permissive
zhendong2050/fse18
edbea132be9122b57e272a20c20fae2bb949e63e
f0f016140489961c9e3c2e837577f698c2d4cf44
refs/heads/master
2020-12-21T11:31:53.800358
2018-07-23T10:10:57
2018-07-23T10:10:57
null
0
0
null
null
null
null
UTF-8
Java
false
false
713
java
package p; import java.util.*; class Cell<T> { List<T> t; public void setT(AbstractList<T> t) { this.t = t; } public Collection<T> getT() { return t; } } class CellTest { public static void main(String[] args) { ArrayList booleanList = new ArrayList(); booleanList.add(Boolean.FALSE); Cell c1 = new Cell(); c1.t = booleanList; c1.setT(booleanList); Iterable t = c1.t; Iterator iter = (Iterator) c1.t.iterator(); Iterator iter2 = c1.t.iterator(); boolean bool = (Boolean) c1.t.iterator().next(); Cell c2 = new Cell(); c2.t = booleanList; } }
[ "tim.menzies@gmail.com" ]
tim.menzies@gmail.com
6afab49f9a602ae356401220f3e9f56651921f06
7c46a44f1930b7817fb6d26223a78785e1b4d779
/soap/src/java/com/zimbra/soap/admin/message/GetDomainInfoResponse.java
f543e478ecfc6be4c007b949cc086bd6d2b0fb3c
[]
no_license
Zimbra/zm-mailbox
20355a191c7174b1eb74461a6400b0329907fb02
8ef6538e789391813b65d3420097f43fbd2e2bf3
refs/heads/develop
2023-07-20T15:07:30.305312
2023-07-03T06:44:00
2023-07-06T10:09:53
85,609,847
67
128
null
2023-09-14T10:12:10
2017-03-20T18:07:01
Java
UTF-8
Java
false
false
1,659
java
/* * ***** BEGIN LICENSE BLOCK ***** * Zimbra Collaboration Suite Server * Copyright (C) 2010, 2012, 2013, 2014, 2016 Synacor, Inc. * * This program 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, * version 2 of the License. * * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * See the GNU General Public License for more details. * You should have received a copy of the GNU General Public License along with this program. * If not, see <https://www.gnu.org/licenses/>. * ***** END LICENSE BLOCK ***** */ package com.zimbra.soap.admin.message; import javax.xml.bind.annotation.XmlAccessType; import javax.xml.bind.annotation.XmlAccessorType; import javax.xml.bind.annotation.XmlElement; import javax.xml.bind.annotation.XmlRootElement; import javax.xml.bind.annotation.XmlType; import com.zimbra.common.soap.AdminConstants; import com.zimbra.soap.admin.type.DomainInfo; @XmlAccessorType(XmlAccessType.NONE) @XmlRootElement(name=AdminConstants.E_GET_DOMAIN_INFO_RESPONSE) @XmlType(propOrder = {}) public class GetDomainInfoResponse { /** * @zm-api-field-description Information about domain */ @XmlElement(name=AdminConstants.E_DOMAIN, required=false) private DomainInfo domain; public GetDomainInfoResponse() { } public void setDomain(DomainInfo domain) { this.domain = domain; } public DomainInfo getDomain() { return domain; } }
[ "shriram.vishwanathan@synacor.com" ]
shriram.vishwanathan@synacor.com
fdfe558091bbcfad6397e59714492b7570cc7070
ddd38972d2e73c464ee77024f6ba4d6e11aac97b
/platform/arcus-containers/scheduler-service/src/main/java/com/iris/service/scheduler/model/TimeOfDayScheduledCommand.java
02e043812a1bd54628790004d457e86e3a7de913
[ "Apache-2.0" ]
permissive
arcus-smart-home/arcusplatform
bc5a3bde6dc4268b9aaf9082c75482e6599dfb16
a2293efa1cd8e884e6bedbe9c51bf29832ba8652
refs/heads/master
2022-04-27T02:58:20.720270
2021-09-05T01:36:12
2021-09-05T01:36:12
168,190,985
104
50
Apache-2.0
2022-03-10T01:33:34
2019-01-29T16:49:10
Java
UTF-8
Java
false
false
6,087
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 com.iris.service.scheduler.model; import java.util.EnumSet; import java.util.Map; import java.util.Set; import org.apache.commons.lang3.StringUtils; import com.iris.common.rule.time.TimeOfDay; import com.iris.common.time.DayOfWeek; import com.iris.messages.errors.Errors; import com.iris.messages.type.TimeOfDayCommand; public class TimeOfDayScheduledCommand extends ScheduledCommand { public enum Mode { ABSOLUTE, SUNRISE, SUNSET; } public static TimeOfDayScheduledCommand fromMap(Map<String, Object> attributes) { TimeOfDayCommand raw = new TimeOfDayCommand(attributes); TimeOfDayScheduledCommand command = new TimeOfDayScheduledCommand(); command.setId(raw.getId()); command.setScheduleId(raw.getScheduleId()); if(!StringUtils.isEmpty(raw.getMessageType())) { command.setMessageType(raw.getMessageType()); } if(raw.getAttributes() != null) { command.setAttributes(raw.getAttributes()); } if(raw.getDays() != null) { command.setDays(toDays(raw.getDays())); } if(!StringUtils.isEmpty(raw.getMode())) { command.setMode(Mode.valueOf(raw.getMode())); } if(!StringUtils.isEmpty(raw.getTime())) { command.setTime(TimeOfDay.fromString(raw.getTime())); } if(raw.getOffsetMinutes() != null) { command.setOffsetMinutes(raw.getOffsetMinutes()); } return command; } private static Set<DayOfWeek> toDays(Set<String> days) { EnumSet<DayOfWeek> values = EnumSet.noneOf(DayOfWeek.class); if(days == null || days.isEmpty()) { return values; } for(String day: days) { values.add(DayOfWeek.fromAbbr(day)); } return values; } private Set<DayOfWeek> days; private Mode mode; private TimeOfDay time; private Integer offsetMinutes; public TimeOfDayScheduledCommand() { // TODO Auto-generated constructor stub } /** * @return the days */ public Set<DayOfWeek> getDays() { return days; } /** * @param days the days to set */ public void setDays(Set<DayOfWeek> days) { this.days = days; } /** * @return the mode */ public Mode getMode() { return mode; } /** * @param mode the mode to set */ public void setMode(Mode mode) { this.mode = mode; } public boolean isAbsolute() { return mode == Mode.ABSOLUTE; } /** * @return the time */ public TimeOfDay getTime() { return time; } /** * @param time the time to set */ public void setTime(TimeOfDay time) { this.time = time; } /** * @return the offsetMinutes */ public Integer getOffsetMinutes() { return offsetMinutes; } /** * @param offsetMinutes the offsetMinutes to set */ public void setOffsetMinutes(Integer offsetMinutes) { this.offsetMinutes = offsetMinutes; } public void validate() { Errors.assertRequiredParam(this.getScheduleId(), TimeOfDayCommand.ATTR_SCHEDULEID); if(this.getMode() == null || this.getMode() == Mode.ABSOLUTE) { Errors.assertRequiredParam(this.getTime(), TimeOfDayCommand.ATTR_TIME); Errors.assertValidRequest(this.getOffsetMinutes() == null || this.getOffsetMinutes() == 0, "May not specify non-zero offsetMinutes when mode is ABSOLUTE or unspecified."); } else { Errors.assertRequiredParam(this.getOffsetMinutes(), TimeOfDayCommand.ATTR_OFFSETMINUTES); Errors.assertValidRequest(this.getTime() == null, "May not specify time when mode is SUNRISE / SUNSET."); } Errors.assertRequiredParam(this.getDays(), TimeOfDayCommand.ATTR_DAYS); Errors.assertRequiredParam(this.getAttributes(), TimeOfDayCommand.ATTR_ATTRIBUTES); } /* (non-Javadoc) * @see java.lang.Object#toString() */ @Override public String toString() { return "TimeOfDayScheduledCommand [days=" + days + ", mode=" + mode + ", time=" + time + ", offsetMinutes=" + offsetMinutes + "]"; } /* (non-Javadoc) * @see java.lang.Object#hashCode() */ @Override public int hashCode() { final int prime = 31; int result = 1; result = prime * result + ((days == null) ? 0 : days.hashCode()); result = prime * result + ((mode == null) ? 0 : mode.hashCode()); result = prime * result + ((offsetMinutes == null) ? 0 : offsetMinutes.hashCode()); result = prime * result + ((time == null) ? 0 : time.hashCode()); return result; } /* (non-Javadoc) * @see java.lang.Object#equals(java.lang.Object) */ @Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (getClass() != obj.getClass()) return false; TimeOfDayScheduledCommand other = (TimeOfDayScheduledCommand) obj; if (days == null) { if (other.days != null) return false; } else if (!days.equals(other.days)) return false; if (mode != other.mode) return false; if (offsetMinutes == null) { if (other.offsetMinutes != null) return false; } else if (!offsetMinutes.equals(other.offsetMinutes)) return false; if (time == null) { if (other.time != null) return false; } else if (!time.equals(other.time)) return false; return true; } }
[ "b@yoyo.com" ]
b@yoyo.com
bd1e8ecb37750fceeb542a5999acfefde3fb4a93
7ea61ee7003c5d8e27b9f02d0fc004f0bbe44562
/lib/src/main/java/com/sd/lib/utils/FHandlerManager.java
61adc8d960badad5f67d7dc3e41073dcada042b4
[]
no_license
zj565061763/utils
c0bd1845a0255c268faa8f31733e98b71d2f0a13
3d0507184f9e4bd6f222224c73e077a9da98065c
refs/heads/master
2021-06-03T14:06:18.425693
2021-05-26T07:55:37
2021-05-26T07:55:37
114,324,750
1
2
null
null
null
null
UTF-8
Java
false
false
1,207
java
package com.sd.lib.utils; import android.os.Handler; import android.os.HandlerThread; import android.os.Looper; /** * Handler管理类 */ public class FHandlerManager { private static final HandlerThread HANDLER_THREAD = new HandlerThread("HandlerThread"); static { HANDLER_THREAD.start(); } private static final Handler MAIN_HANDLER = new Handler(Looper.getMainLooper()); private static final Handler BACKGROUND_HANDLER = new Handler(HANDLER_THREAD.getLooper()); private FHandlerManager() { } /** * 获得主线程Handler * * @return */ public final static Handler getMainHandler() { return MAIN_HANDLER; } /** * 获得后台线程Handler * * @return */ public final static Handler getBackgroundHandler() { return BACKGROUND_HANDLER; } /** * Ui线程执行 * * @param runnable */ public static void runOnUiThread(Runnable runnable) { if (runnable == null) return; if (Looper.myLooper() == Looper.getMainLooper()) runnable.run(); else MAIN_HANDLER.post(runnable); } }
[ "565061763@qq.com" ]
565061763@qq.com
2522da23063371556f13c8ebbb4290f2d31a4b94
a8c5b7b04eace88b19b5a41a45f1fb030df393e3
/projects/core/src/test/java/com/opengamma/core/convention/ConventionTypeTest.java
7b5cc06bf06d7b15f98121da85cfa1ec73a1db49
[ "Apache-2.0" ]
permissive
McLeodMoores/starling
3f6cfe89cacfd4332bad4861f6c5d4648046519c
7ae0689e06704f78fd9497f8ddb57ee82974a9c8
refs/heads/master
2022-12-04T14:02:00.480211
2020-04-28T17:22:44
2020-04-28T17:22:44
46,577,620
4
4
Apache-2.0
2022-11-24T07:26:39
2015-11-20T17:48:10
Java
UTF-8
Java
false
false
1,343
java
/** * Copyright (C) 2018 - present McLeod Moores Software Limited. All rights reserved. */ package com.opengamma.core.convention; import static org.testng.Assert.assertEquals; import static org.testng.Assert.assertNotEquals; import org.testng.annotations.Test; import com.opengamma.util.test.TestGroup; /** * Tests for {@link ConventionType}. */ @Test(groups = TestGroup.UNIT) public class ConventionTypeTest { private static final String NAME = "NAME"; /** * Tests the object. */ @Test public void test() { final ConventionType type = ConventionType.of(NAME); assertEquals(type, type); assertNotEquals(null, type); assertNotEquals(NAME, type); assertEquals(type.getName(), NAME); assertEquals(type.toString(), NAME); ConventionType other = ConventionType.of(NAME); assertEquals(type, other); assertEquals(type.hashCode(), other.hashCode()); other = ConventionType.of(NAME.substring(1)); assertNotEquals(type, other); } /** * Tests the compareTo method. */ @Test public void testCompareTo() { final ConventionType type = ConventionType.of(NAME); assertEquals(type.compareTo(ConventionType.of(NAME)), 0); assertNotEquals(type.compareTo(ConventionType.of("a" + NAME)), 0); assertNotEquals(type.compareTo(ConventionType.of("z" + NAME)), 0); } }
[ "em.mcleod@gmail.com" ]
em.mcleod@gmail.com
c5a9ade0e2e78fb2440cb255fe45e308a2daa843
fa91450deb625cda070e82d5c31770be5ca1dec6
/Diff-Raw-Data/2/2_619947c20452908a000946982f70ec8e2b948bf8/QueryLookupController/2_619947c20452908a000946982f70ec8e2b948bf8_QueryLookupController_s.java
7576f08addcdccde2acfea0585027d1e0984530e
[]
no_license
zhongxingyu/Seer
48e7e5197624d7afa94d23f849f8ea2075bcaec0
c11a3109fdfca9be337e509ecb2c085b60076213
refs/heads/master
2023-07-06T12:48:55.516692
2023-06-22T07:55:56
2023-06-22T07:55:56
259,613,157
6
2
null
2023-06-22T07:55:57
2020-04-28T11:07:49
null
UTF-8
Java
false
false
2,824
java
package com.mpower.controller; import java.util.Enumeration; import java.util.HashMap; import java.util.List; import java.util.Map; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import org.apache.commons.lang.StringUtils; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import org.springframework.beans.support.PagedListHolder; import org.springframework.web.servlet.ModelAndView; import org.springframework.web.servlet.mvc.Controller; import com.mpower.domain.QueryLookup; import com.mpower.service.QueryLookupService; import com.mpower.service.SessionServiceImpl; public class QueryLookupController implements Controller { /** Logger for this class and subclasses */ protected final Log logger = LogFactory.getLog(getClass()); private QueryLookupService queryLookupService; public void setQueryLookupService(QueryLookupService queryLookupService) { this.queryLookupService = queryLookupService; } @SuppressWarnings("unchecked") @Override public ModelAndView handleRequest(HttpServletRequest request, HttpServletResponse response) throws Exception { Map<String, String> queryParams = new HashMap<String, String>(); Enumeration<String> enu = request.getParameterNames(); while (enu.hasMoreElements()) { String param = enu.nextElement(); String paramValue = StringUtils.trimToNull(request.getParameter(param)); if (paramValue != null && !param.equalsIgnoreCase("fieldDef") && !param.equalsIgnoreCase("view")) { queryParams.put(param, paramValue); } } // List<String> displayColumns = new ArrayList<String>(); // displayColumns.add("lastName"); // displayColumns.add("firstName"); String fieldDef = StringUtils.trimToNull(request.getParameter("fieldDef")); QueryLookup queryLookup = queryLookupService.readQueryLookup(SessionServiceImpl.lookupUserSiteName(), fieldDef); List<Object> objects = queryLookupService.executeQueryLookup(SessionServiceImpl.lookupUserSiteName(), fieldDef, queryParams); ModelAndView mav = new ModelAndView("queryLookup"); mav.addObject("objects", objects); PagedListHolder pagedListHolder = new PagedListHolder(objects); pagedListHolder.setMaxLinkedPages(3); pagedListHolder.setPageSize(50); String page = request.getParameter("page"); Integer pg = 0; if (!StringUtils.isBlank(page)) { pg = Integer.valueOf(page); } pagedListHolder.setPage(pg); mav.addObject("pagedListHolder", pagedListHolder); mav.addObject("queryLookup", queryLookup); // mav.addObject("displayColumns", displayColumns); // mav.addObject("parameterMap", request.getParameterMap()); return mav; } }
[ "yuzhongxing88@gmail.com" ]
yuzhongxing88@gmail.com
143ed249ca696a512f816024c2f07fae6ba50044
421f0a75a6b62c5af62f89595be61f406328113b
/generated_tests/model_seeding/36_schemaspy-net.sourceforge.schemaspy.view.HtmlRelationshipsPage-1.0-5/net/sourceforge/schemaspy/view/HtmlRelationshipsPage_ESTest.java
a769ea711ca69f495ad4675caf3e9e8823d2aa54
[]
no_license
tigerqiu712/evosuite-model-seeding-empirical-evaluation
c78c4b775e5c074aaa5e6ca56bc394ec03c2c7c6
11a920b8213d9855082d3946233731c843baf7bc
refs/heads/master
2020-12-23T21:04:12.152289
2019-10-30T08:02:29
2019-10-30T08:02:29
null
0
0
null
null
null
null
UTF-8
Java
false
false
678
java
/* * This file was automatically generated by EvoSuite * Fri Oct 25 19:59:00 GMT 2019 */ package net.sourceforge.schemaspy.view; 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(mockJVMNonDeterminism = true, useVFS = true, useVNET = true, resetStaticState = true, separateClassLoader = true, useJEE = true) public class HtmlRelationshipsPage_ESTest extends HtmlRelationshipsPage_ESTest_scaffolding { @Test public void notGeneratedAnyTest() { // EvoSuite did not generate any tests } }
[ "pderakhshanfar@bsr01.win.tue.nl" ]
pderakhshanfar@bsr01.win.tue.nl
548dcbb691f64c2afc37d3621cc850806ed72876
0917a6cefcc3c3d6766080e58e83cd027522d0a8
/src/main/java/socket/TCPEchoClient.java
28aac640b9e3421f035d9c0af7e9dee0ff518a2e
[]
no_license
lyk4411/untitled1_intellij
19bb583c8e631c4fab5826573fe30a61dff9d2d4
7a3e9ff784faa03c04a40cfdc0ba53af3344bb09
refs/heads/master
2022-12-22T13:58:32.218291
2020-01-22T08:58:04
2020-01-22T08:58:04
62,300,156
0
0
null
2022-12-16T03:16:30
2016-06-30T09:56:05
Java
UTF-8
Java
false
false
1,686
java
package socket; /** * Created by lyk on 2016/7/8. */ import java.io.IOException; import java.io.InputStream; import java.io.OutputStream; import java.net.Socket; import java.net.SocketException; public class TCPEchoClient { public static void main(String[] args) throws IOException { if ((args.length < 2) || (args.length > 3)) // Test for correct # of args throw new IllegalArgumentException("Parameter(s): <Server> <Word> [<Port>]"); String server = args[0]; // Server name or IP address // Convert argument String to bytes using the default character encoding byte[] data = args[1].getBytes(); int servPort = (args.length == 3) ? Integer.parseInt(args[2]) : 7; // Create socket that is connected to server on specified port Socket socket = new Socket(server, servPort); System.out.println("Connected to server...sending echo string"); InputStream in = socket.getInputStream(); OutputStream out = socket.getOutputStream(); out.write(data); // Send the encoded string to the server // Receive the same string back from the server int totalBytesRcvd = 0; // Total bytes received so far int bytesRcvd; // Bytes received in last read while (totalBytesRcvd < data.length) { if ((bytesRcvd = in.read(data, totalBytesRcvd, data.length - totalBytesRcvd)) == -1) throw new SocketException("Connection closed prematurely"); totalBytesRcvd += bytesRcvd; } // data array is full System.out.println("Received: " + new String(data)); socket.close(); // Close the socket and its streams } }
[ "moneyflying_2006@hotmail.com" ]
moneyflying_2006@hotmail.com
de23eac94c1f29d6d64efe36ac1364942636e9f7
805c02a6968c5b88cca6e0c9e7af7a88e8e3ead9
/src/protocol/Chat.java
dbf29a4185a9642c06c5efba941663c8e31341aa
[]
no_license
ZolaBaksa/javachat
ca291d10a5a0dd0052c856065c31492093279e1c
2de7ac8255d8c57d8e788a086077948824ae5254
refs/heads/main
2023-01-29T03:27:44.563082
2020-12-03T02:35:37
2020-12-03T02:35:37
318,051,534
0
0
null
null
null
null
UHC
Java
false
false
174
java
package protocol; //public final static 생략가능 public interface Chat { String ALL = "ALL"; //전체 String MSG = "MSG"; //귓속말 String ID = "ID"; //아이디 }
[ "ssar@nate.com" ]
ssar@nate.com
fa39ef1bed7de9433c7ccf2d39c0a3b696420a33
88efa77e6da0b36dd85525251e9502023ea5a7a4
/src/main/java/com/andrei/accela/codingexercise/service/AddressService.java
6883cee26064fcf603db1bceae17f02b88046757
[]
no_license
abalzan/codingexercise
7faaf7f3d73f1392452850c48d93564256cb4db6
855692c5f5beed980a851f89552eb7d29f7968ad
refs/heads/master
2023-03-07T22:22:50.507241
2021-02-20T14:19:51
2021-02-20T14:19:51
340,667,957
0
0
null
null
null
null
UTF-8
Java
false
false
747
java
package com.andrei.accela.codingexercise.service; import com.andrei.accela.codingexercise.dto.AddressDto; import com.andrei.accela.codingexercise.dto.PersonDto; import com.andrei.accela.codingexercise.model.Address; import com.andrei.accela.codingexercise.model.Person; import java.util.List; import java.util.Set; import java.util.UUID; public interface AddressService { List<AddressDto> getAllAddresses(); PersonDto save(UUID personId, AddressDto addressDto); void saveAddressList(Person person, Set<AddressDto> addressDto); Address getAddressById(UUID id); AddressDto update(UUID addressId, AddressDto addressDto); void delete(UUID personId, UUID addressId); Set<Address>getAllPersonAddresses(Person person); }
[ "andreibalzan@gmail.com" ]
andreibalzan@gmail.com
849d23416bbbec63669b74618e48fe4908955966
b6eb0ecadbb70ed005d687268a0d40e89d4df73e
/feilong-lib/feilong-lib-ognl/src/main/java/com/feilong/lib/javassist/tools/reflect/Metalevel.java
689e9e2b757f28ccd800a82312b482042b8d3876
[ "Apache-2.0" ]
permissive
ifeilong/feilong
b175d02849585c7b12ed0e9864f307ed1a26e89f
a0d4efeabc29503b97caf0c300afe956a5caeb9f
refs/heads/master
2023-08-18T13:08:46.724616
2023-08-14T04:30:34
2023-08-14T04:30:34
252,767,655
97
28
Apache-2.0
2023-04-17T17:47:44
2020-04-03T15:14:35
Java
UTF-8
Java
false
false
1,268
java
/* * Javassist, a Java-bytecode translator toolkit. * Copyright (C) 1999- Shigeru Chiba. All Rights Reserved. * * The contents of this file are subject to the Mozilla Public License Version * 1.1 (the "License"); you may not use this file except in compliance with * the License. Alternatively, the contents of this file may be used under * the terms of the GNU Lesser General Public License Version 2.1 or later, * or the Apache License Version 2.0. * * Software distributed under the License is distributed on an "AS IS" basis, * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License * for the specific language governing rights and limitations under the * License. */ package com.feilong.lib.javassist.tools.reflect; /** * An interface to access a metaobject and a class metaobject. * This interface is implicitly implemented by the reflective * class. */ public interface Metalevel{ /** * Obtains the class metaobject associated with this object. */ ClassMetaobject _getClass(); /** * Obtains the metaobject associated with this object. */ Metaobject _getMetaobject(); /** * Changes the metaobject associated with this object. */ void _setMetaobject(Metaobject m); }
[ "venusdrogon@163.com" ]
venusdrogon@163.com
62a0e73999197a1acfc42b5dd27795b46a0c9d61
7731416ca9afff3e69141d5d0087c193ca3e7180
/src/CAL_Runtime/src/org/openquark/cal/internal/runtime/lecc/RTCAF.java
fe11d33548efb71bdfeb31e8445efbe33f6935d2
[]
no_license
rdwebster/Open-Quark
288d38f823e21ec2e338adb2d05f3e05b027f603
86397b53eea2518851b4995edae2aa687f8d8812
refs/heads/master
2021-01-20T15:50:03.540743
2014-07-23T18:11:37
2014-07-23T18:11:37
481,429
0
0
null
null
null
null
UTF-8
Java
false
false
2,548
java
/* * Copyright (c) 2007 BUSINESS OBJECTS SOFTWARE LIMITED * 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 Business Objects 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. */ /* * RTCAF * Created: July 29th, 2003 11:24:48 AM * By: RCypher */ package org.openquark.cal.internal.runtime.lecc; /** * @author Raymond Cypher * * This class is the base class for constant applicative forms (CAFs). * A CAF is a zero arity function that will return the same value each time * it is reduced. Currently CAFs are zero arity non-foreign CAL functions. */ public abstract class RTCAF extends RTSupercombinator { // At this point in time RTCAF is primarily a place holder. // It allows the generated code to differentiate between // constant applicative forms and general supercombinators. // This is mostly used to make freeing cached results easier. // I also allows a location for future functionality that is // specific to CAFs and not applicable to zero arity functions // in general. }
[ "luke@eversosoft.com" ]
luke@eversosoft.com
4522733fbca8753faba32fe7d6428f6e9a579262
aa6997aba1475b414c1688c9acb482ebf06511d9
/src/org/omg/IOP/CodecPackage/FormatMismatchHelper.java
db10dc22168f7179e0d372b45e4093dcb43c2963
[]
no_license
yueny/JDKSource1.8
eefb5bc88b80ae065db4bc63ac4697bd83f1383e
b88b99265ecf7a98777dd23bccaaff8846baaa98
refs/heads/master
2021-06-28T00:47:52.426412
2020-12-17T13:34:40
2020-12-17T13:34:40
196,523,101
4
2
null
null
null
null
UTF-8
Java
false
false
2,233
java
package org.omg.IOP.CodecPackage; /** * org/omg/IOP/CodecPackage/FormatMismatchHelper.java . Generated by the IDL-to-Java compiler * (portable), version "3.2" from c:/re/workspace/8-2-build-windows-amd64-cygwin/jdk8u60/4407/corba/src/share/classes/org/omg/PortableInterceptor/IOP.idl * Tuesday, August 4, 2015 11:07:53 AM PDT */ abstract public class FormatMismatchHelper { private static String _id = "IDL:omg.org/IOP/Codec/FormatMismatch:1.0"; public static void insert(org.omg.CORBA.Any a, org.omg.IOP.CodecPackage.FormatMismatch that) { org.omg.CORBA.portable.OutputStream out = a.create_output_stream(); a.type(type()); write(out, that); a.read_value(out.create_input_stream(), type()); } public static org.omg.IOP.CodecPackage.FormatMismatch extract(org.omg.CORBA.Any a) { return read(a.create_input_stream()); } private static org.omg.CORBA.TypeCode __typeCode = null; private static boolean __active = false; synchronized public static org.omg.CORBA.TypeCode type() { if (__typeCode == null) { synchronized (org.omg.CORBA.TypeCode.class) { if (__typeCode == null) { if (__active) { return org.omg.CORBA.ORB.init().create_recursive_tc(_id); } __active = true; org.omg.CORBA.StructMember[] _members0 = new org.omg.CORBA.StructMember[0]; org.omg.CORBA.TypeCode _tcOf_members0 = null; __typeCode = org.omg.CORBA.ORB.init() .create_exception_tc(org.omg.IOP.CodecPackage.FormatMismatchHelper.id(), "FormatMismatch", _members0); __active = false; } } } return __typeCode; } public static String id() { return _id; } public static org.omg.IOP.CodecPackage.FormatMismatch read( org.omg.CORBA.portable.InputStream istream) { org.omg.IOP.CodecPackage.FormatMismatch value = new org.omg.IOP.CodecPackage.FormatMismatch(); // read and discard the repository ID istream.read_string(); return value; } public static void write(org.omg.CORBA.portable.OutputStream ostream, org.omg.IOP.CodecPackage.FormatMismatch value) { // write the repository ID ostream.write_string(id()); } }
[ "yueny09@163.com" ]
yueny09@163.com
51b88d8525e95e1713c57302f810698667b0faa9
8ec2cbabd6125ceeb00e0c6192c3ce84477bdde6
/com.alcatel.as.utils/src/alcatel/tess/hometop/gateways/utils/NxTimerDurationException.java
b0db727f9c59428686c5ab568b3ccdb165bf5a7c
[ "Apache-2.0", "LicenseRef-scancode-unknown-license-reference" ]
permissive
nokia/osgi-microfeatures
2cc2b007454ec82212237e012290425114eb55e6
50120f20cf929a966364550ca5829ef348d82670
refs/heads/main
2023-08-28T12:13:52.381483
2021-11-12T20:51:05
2021-11-12T20:51:05
378,852,173
1
1
null
null
null
null
UTF-8
Java
false
false
510
java
// Copyright 2000-2021 Nokia // // Licensed under the Apache License 2.0 // SPDX-License-Identifier: Apache-2.0 // package alcatel.tess.hometop.gateways.utils; /** Exception thrown when a timer duration is out of range */ public class NxTimerDurationException extends Exception { /** Constructor without message. */ public NxTimerDurationException() { super(); } /** Constructor with user message. */ public NxTimerDurationException(String message) { super(message); } }
[ "pierre.de_rop@nokia.com" ]
pierre.de_rop@nokia.com
a50901eaadc107893af3e7a7baeaf34f86c38a48
cf70b04f98fb450687ef7ef44f7b869d63ae5a22
/FileManagementAssistant/app/src/main/java/com/example/administrator/filemanagementassistant/util/ScrollAwareFABBehavior.java
c7e37104e3eb0c9001555b6e8c94a02dfbfff500
[ "Apache-2.0" ]
permissive
haibowen/MyGraduationProject
91e1f8bbcbb0d7a8d850d8b9aed40123e8c42886
53962dd3e4b61fff91672b81a6c2636b3fefad8e
refs/heads/master
2021-06-22T04:32:51.831750
2020-12-27T02:25:45
2020-12-27T02:25:45
159,469,172
4
0
null
null
null
null
UTF-8
Java
false
false
2,320
java
package com.example.administrator.filemanagementassistant.util; import android.content.Context; import android.support.design.widget.CoordinatorLayout; import android.support.v4.view.ViewCompat; import android.support.v4.view.animation.FastOutSlowInInterpolator; import android.util.AttributeSet; import android.view.View; import android.view.animation.LinearInterpolator; import com.getbase.floatingactionbutton.FloatingActionsMenu; public class ScrollAwareFABBehavior extends CoordinatorLayout.Behavior<FloatingActionsMenu> { private static final android.view.animation.Interpolator INTERPOLATOR = new FastOutSlowInInterpolator(); private boolean mIsAnimatingOut = false; public ScrollAwareFABBehavior(Context context, AttributeSet attrs) { super(); } @Override public boolean onStartNestedScroll(CoordinatorLayout coordinatorLayout, FloatingActionsMenu child, View directTargetChild, View target, int nestedScrollAxes) { //处理垂直方向上的滚动事件 return nestedScrollAxes == ViewCompat.SCROLL_AXIS_VERTICAL || super.onStartNestedScroll(coordinatorLayout, child, directTargetChild, target, nestedScrollAxes); } @Override public void onNestedScroll(CoordinatorLayout coordinatorLayout, FloatingActionsMenu child, View target, int dxConsumed, int dyConsumed, int dxUnconsumed, int dyUnconsumed) { super.onNestedScroll(coordinatorLayout, child, target, dxConsumed, dyConsumed, dxUnconsumed, dyUnconsumed); if (dyConsumed > 0) { // 向下滑动 //如果是展开的话就先收回去 if (child.isExpanded()) { child.collapse(); } animateOut(child); } else if (dyConsumed < 0) { // 向上滑动 animateIn(child); } } private void animateOut(final FloatingActionsMenu button) { CoordinatorLayout.LayoutParams layoutParams = (CoordinatorLayout.LayoutParams) button.getLayoutParams(); int bottomMargin = layoutParams.bottomMargin; button.animate().translationY(button.getHeight() + bottomMargin).setInterpolator(new LinearInterpolator()).start(); } private void animateIn(FloatingActionsMenu button) { button.animate().translationY(0).setInterpolator(new LinearInterpolator()).start(); } }
[ "1461154748@qq.com" ]
1461154748@qq.com
dff915ddf5cfc9eab9a74020f855cad780302c2b
592eb3c39bbd5550c5406abdfd45f49c24e6fd6c
/autoweb/src/main/java/com/surveygen/struts/action/SurveyGenLoginViewAction.java
3efb7771bfbf5c5e24831bf3dcd817e8aa497d06
[]
no_license
passionblue/autoweb
f77dc89098d59fddc48a40a81f2f2cf27cd08cfb
8ea27a5b83f02f4f0b66740b22179bea4d73709e
refs/heads/master
2021-01-17T20:33:28.634291
2016-06-17T01:38:45
2016-06-17T01:38:45
60,968,206
0
0
null
null
null
null
UTF-8
Java
false
false
1,613
java
/* * Generated by MyEclipse Struts * Template path: templates/java/JavaClass.vtl */ package com.surveygen.struts.action; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpSession; import org.apache.log4j.Logger; import org.apache.struts.action.ActionForm; import org.apache.struts.action.ActionForward; import org.apache.struts.action.ActionMapping; import com.jtrend.struts.core.DefaultViewManager; import com.jtrend.struts.core.LoginViewAction; import com.jtrend.struts.core.ViewAction; import com.surveygen.app.SurveyGenAppInitiator; import com.surveygen.app.SurveyGenViewManager; import com.surveygen.db.User; import com.surveygen.ds.UserDS; import com.surveygen.struts.form.LoginForm; /** * MyEclipse Struts * Creation date: 07-14-2007 * * XDoclet definition: * @struts.action path="/loginFormSubmit" name="loginForm" input="/jsp/form/login.jsp" scope="request" validate="true" * @struts.action-forward name="default" path="/jsp/layout/layout.jsp" */ public class SurveyGenLoginViewAction extends LoginViewAction { /* public void initApp() { try { m_logger.debug("SurveyGenCoreAction.initApp()"); SurveyGenAppInitiator.init(); } catch (Exception e) { m_logger.error(e); } //m_viewManager = SurveyGenViewManager.getInstance(); m_viewManager = DefaultViewManager.getInstance(); } */ private static Logger m_logger = Logger.getLogger(SurveyGenLoginViewAction.class); }
[ "joshua@joshua-dell" ]
joshua@joshua-dell
c79496c2e5ae43a7a007e20e7067bac74e932521
bbad69822950e11b5ba9638f3d7493a16aeeaaba
/src/main/java/com/mxdl/service/NewsTypeService.java
08be1bf3d84255b7bc1ce9d33bf5829388d5687a
[]
no_license
mxdldev/spring-boot-security-oauth2-flycloud
609295df52e60bfcee1d94d6c43107e2dbc24955
369400e3d330509bc4095256817d09f3abe77dc7
refs/heads/master
2021-04-16T20:39:54.883819
2020-03-23T09:22:40
2020-03-23T09:22:40
249,383,540
0
0
null
null
null
null
UTF-8
Java
false
false
736
java
package com.mxdl.service; import com.mxdl.dao.NewsTypeDao; import com.mxdl.model.NewsType; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import java.util.List; /** * Description: <BlogService><br> * Author:    mxdl<br> * Date:     2019/2/19<br> * Version:   V1.0.0<br> * Update:     <br> */ @Service public class NewsTypeService { @Autowired NewsTypeDao newsTypeDao; public NewsType saveNewsType(NewsType newstype) { return newsTypeDao.save(newstype); } public void deleteBlog(long id) { newsTypeDao.delete(id); } public List<NewsType> findListNewsType(){ return newsTypeDao.findAll(); } }
[ "geduo_83@163.com" ]
geduo_83@163.com
2a1a77f6ec4bf238ad29c4b6abc0ad5021c61f01
995f73d30450a6dce6bc7145d89344b4ad6e0622
/MATE-20_EMUI_11.0.0/src/main/java/com/android/server/wifi/hwcoex/HiCoexChrImpl.java
68cf69f5b3f1dabefd717f53a7fdac85afff29be
[]
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
6,834
java
package com.android.server.wifi.hwcoex; import android.content.Context; import android.os.Bundle; import com.android.server.wifi.HwWifiCHRService; import com.android.server.wifi.HwWifiCHRServiceImpl; public class HiCoexChrImpl { private static final int EID_NR_STATE_INFO = 909009120; private static final int EID_NR_STATISTIC_INFO = 909009121; private static final int MILLISECOND_UNIT = 1000; private static final int MIN_TRIGGER_INTERVAL = 1000; private static final String TAG = "HiCoexChrImpl"; private static HiCoexChrImpl mHiCoexChrImpl; private int mApBand = -1; private int mApChannelCnt = 0; private int mApChannelOptimizationCnt = 0; private int mCellBw = 0; private int mCellFreq = 0; private Context mContext; private HwWifiCHRService mHwWifiCHRService; private int mNrPriority = 0; private int mNrState = 0; private int mNrTxBlockTime = 0; private int mNrTxTotalTime = 0; private int mP2pChannelCnt = 0; private int mP2pChannelOptimizationCnt = 0; private int mWifiAct = 0; private int mWifiPriorSceneId = 0; private int mWifiPriorTime = 0; private int mWifiPriorTotalTime = 0; private HiCoexChrImpl(Context context) { this.mContext = context; this.mHwWifiCHRService = HwWifiCHRServiceImpl.getInstance(); } public static void createHiCoexChrImpl(Context context) { if (mHiCoexChrImpl == null) { mHiCoexChrImpl = new HiCoexChrImpl(context); } } public static HiCoexChrImpl getInstance() { return mHiCoexChrImpl; } public void setNrState(int nrState) { this.mNrState = nrState; } public void setNrPriority(int nrPriority) { this.mNrPriority = nrPriority; } public void setCellFreq(int cellFreq) { this.mCellFreq = cellFreq; } public void setCellBw(int cellBw) { this.mCellBw = cellBw; } public void setWifiAct(int wifiAct) { this.mWifiAct = wifiAct; } public void setWifiPriorSceneId(int wifiPriorSceneId) { this.mWifiPriorSceneId = wifiPriorSceneId; } public void setApBand(int apBand) { this.mApBand = apBand; } public void updateCoexPriority(int time, int priority, int wifiScene, boolean isNrNetwork) { HiCoexUtils.logD(TAG, "updateCoexPriority:" + time + ",priority:" + priority + ",wifiScene:" + wifiScene + ",isNrNetwork:" + isNrNetwork); boolean needUpload = true; if (priority == 1) { this.mNrTxTotalTime += time; this.mWifiPriorTotalTime += time; } else if (priority == 0) { this.mWifiPriorTime += time; this.mWifiPriorTotalTime += time; this.mWifiPriorSceneId = wifiScene; } else if (priority != 2) { needUpload = false; } else if (isNrNetwork) { this.mWifiPriorTotalTime += time; } else { needUpload = false; } if (needUpload && time > 1000) { uploadHiCoexStatisticChr(); } } public void updateApChannelOptimization(int apBand, boolean isOptimized) { int i = this.mApBand; if (i == apBand || i == -1) { HiCoexUtils.logD(TAG, "updateApChannelOptimization: band:" + apBand + ", isOptimized:" + isOptimized); this.mApChannelCnt = this.mApChannelCnt + 1; if (isOptimized) { this.mApChannelOptimizationCnt++; } uploadHiCoexStatisticChr(); } } public void updateP2pChannelOptimization(boolean isOptimized) { this.mP2pChannelCnt++; if (isOptimized) { this.mP2pChannelOptimizationCnt++; } uploadHiCoexStatisticChr(); } public void updateApChannelOptimizationCnt() { this.mApChannelOptimizationCnt++; } public void updateApChannelCnt() { this.mApChannelCnt++; } public void updateP2pChannelOptimizationCnt() { this.mP2pChannelOptimizationCnt++; } public void updateP2pChannelCnt() { this.mP2pChannelCnt++; } public void updateWifiPriorTime(int wifiPriorTime) { this.mWifiPriorTime += wifiPriorTime; } public void updateWifiPriorTotalTime(int nrTime) { this.mWifiPriorTotalTime += nrTime; } public void updateNrTxBlockTime(int blockTime) { this.mNrTxBlockTime += blockTime; } public void updateNrRxTotalTime(int txTotalTime) { this.mNrTxTotalTime += txTotalTime; } public void uploadHiCoexNrStateChr() { if (this.mHwWifiCHRService != null) { HiCoexUtils.logD(TAG, "upload HiCoex NR State CHR"); this.mHwWifiCHRService.uploadDFTEvent((int) EID_NR_STATE_INFO, buildHiCoexNrStateChrBundle()); resetNrStateParameters(); } } public void uploadHiCoexStatisticChr() { if (this.mHwWifiCHRService != null) { HiCoexUtils.logD(TAG, "upload HiCoex Statistic CHR"); this.mHwWifiCHRService.uploadDFTEvent((int) EID_NR_STATISTIC_INFO, buildHiCoexStatisticChrBundle()); resetStatisticParameters(); } } private void resetNrStateParameters() { this.mNrState = 0; this.mNrPriority = 0; this.mCellFreq = 0; this.mCellBw = 0; this.mWifiAct = 0; } private void resetStatisticParameters() { this.mApChannelOptimizationCnt = 0; this.mApChannelCnt = 0; this.mP2pChannelOptimizationCnt = 0; this.mP2pChannelCnt = 0; this.mWifiPriorTime = 0; this.mWifiPriorTotalTime = 0; this.mWifiPriorSceneId = 0; this.mNrTxBlockTime = 0; this.mNrTxTotalTime = 0; } private Bundle buildHiCoexNrStateChrBundle() { Bundle data = new Bundle(); data.putInt("nrState", this.mNrState); data.putInt("nrPriority", this.mNrPriority); data.putInt("cellFreq", this.mCellFreq); data.putInt("cellBW", this.mCellBw); data.putInt("wifiAct", this.mWifiAct); return data; } private Bundle buildHiCoexStatisticChrBundle() { Bundle data = new Bundle(); data.putInt("apChanOpCnt", this.mApChannelOptimizationCnt); data.putInt("apChanCnt", this.mApChannelCnt); data.putInt("p2pChanOpCnt", this.mP2pChannelOptimizationCnt); data.putInt("p2pChanCnt", this.mP2pChannelCnt); data.putInt("wifiProrTime", this.mWifiPriorTime / 1000); data.putInt("wifiProrTotalTime", this.mWifiPriorTotalTime / 1000); data.putInt("wifiProrSce1", this.mWifiPriorSceneId); data.putInt("nrTxBlockTime", this.mNrTxBlockTime / 1000); data.putInt("nrTxTotalTime", this.mNrTxTotalTime / 1000); return data; } }
[ "dstmath@163.com" ]
dstmath@163.com
3fc22c4427087c6d237fdbcc527ecafef8e5cafa
0e3898dbcb55563c96d11f93c06e8e2a3b8b545f
/Model/src/com/pq/tracs/model/dao/ContractGuaranteeViewImpl.java
6d3664fba4d92ff5e55c13fd3aefb3c961b77631
[]
no_license
AALIYAR/PQ-TRACS
a811913cbcbe015d85c48a76447d1e01186b2f27
79a98fcb21007675d7fb083ebf21d074990f40ff
refs/heads/master
2020-04-02T10:42:16.724392
2018-10-23T13:46:16
2018-10-23T13:46:16
154,350,815
0
0
null
null
null
null
UTF-8
Java
false
false
545
java
package com.pq.tracs.model.dao; // --------------------------------------------------------------------- // --- File generated by Oracle ADF Business Components Design Time. // --- Custom code may be added to this class. // --- Warning: Do not modify method signatures of generated methods. // --------------------------------------------------------------------- public class ContractGuaranteeViewImpl extends TracsView { /**This is the default constructor (do not remove) */ public ContractGuaranteeViewImpl() { } }
[ "43814640+AALIYAR@users.noreply.github.com" ]
43814640+AALIYAR@users.noreply.github.com
863a8ed7d82cd0fe422f3534ae82d009fb3f45aa
372453ffbe9eb42364abf84a95654b1e18695ff3
/microservice2/src/main/java/com/wiproevents/services/springdata/UserPreferenceSpecification.java
ad2563b47cf95c73e7aa5f1d142b0aa8e5a918ad
[]
no_license
kinfkong/tc-attendee
ac7c033003ee9cda81418e774ac8163b38695631
8986055cf932a26b1c66373da9f57707c91dd3fc
refs/heads/master
2021-05-01T22:01:00.376276
2018-02-18T04:12:35
2018-02-18T04:12:35
120,983,934
0
0
null
null
null
null
UTF-8
Java
false
false
738
java
package com.wiproevents.services.springdata; import com.microsoft.azure.spring.data.documentdb.core.query.Query; import com.wiproevents.entities.criteria.BaseSearchCriteria; import com.wiproevents.entities.UserPreference; import com.wiproevents.utils.springdata.extensions.DocumentDbSpecification; import lombok.AllArgsConstructor; import java.util.Map; /** * The specification used to query User by criteria. */ @AllArgsConstructor public class UserPreferenceSpecification implements DocumentDbSpecification<UserPreference> { /** * The criteria. Final. */ private final BaseSearchCriteria criteria; @Override public Query toQuery(Query query, Map<String, Object> values) { return query; } }
[ "kinfkong@126.com" ]
kinfkong@126.com
ff158945ac1e40b090885943c0e90c1e6b388baa
5e3235edf3de262f4d10b9e9e1fcc3bd13d6b8b1
/Code Snippet Repository/Quartz/Quartz81.java
b282841baedf1422c8d21eb6509c3e08ee6de664
[]
no_license
saber13812002/DeepCRM
3336a244d4852a364800af3181e03e868cf6f9f5
be3e5e50e34a042d5ba7259ff5ff75c08ab32bb9
refs/heads/master
2023-03-16T00:08:06.473699
2018-04-18T05:29:50
2018-04-18T05:29:50
null
0
0
null
null
null
null
UTF-8
Java
false
false
787
java
public void addJobListener(JobListener jobListener, List<Matcher<JobKey>> matchers) { if (jobListener.getName() == null || jobListener.getName().length() == 0) { throw new IllegalArgumentException( "JobListener name cannot be empty."); } synchronized (globalJobListeners) { globalJobListeners.put(jobListener.getName(), jobListener); LinkedList<Matcher<JobKey>> matchersL = new LinkedList<Matcher<JobKey>>(); if(matchers != null && matchers.size() > 0) matchersL.addAll(matchers); else matchersL.add(EverythingMatcher.allJobs()); globalJobListenersMatchers.put(jobListener.getName(), matchersL); } }
[ "Qing.Mi@my.cityu.edu.hk" ]
Qing.Mi@my.cityu.edu.hk
0ad09101b0dcb380f15efe39e60aca2e7ad43e41
3b74874edf06141944cc2032228eef6a5cf2ab80
/src/main/java/mapTest/p01/iterator/MapTest.java
b3b433140b67321bcb5b8c8ec8e96564959e7117
[]
no_license
HomeInGuanglunshan/CodeTestMavenized
7e4797b6f7bed3715d6a5279b6971fdf1859a1df
b3a06bb5a13f39398b397e1917345d017259ef7a
refs/heads/master
2023-07-25T12:33:10.245323
2023-07-13T07:56:59
2023-07-13T07:56:59
304,035,927
0
0
null
null
null
null
UTF-8
Java
false
false
738
java
package mapTest.p01.iterator; import java.util.Collections; import java.util.HashMap; import java.util.Iterator; import java.util.Map; import java.util.Map.Entry; public class MapTest { public static void main(String[] args) { Map<String, String> map = new HashMap<String, String>(); map.put("sgsfg", "1"); map.put("safsv", "2"); map.put("3uyijy", "3"); map.put("et6jgh4", "4"); for (Iterator<Entry<String, String>> it = map.entrySet().iterator(); it.hasNext();) { Entry<String, String> entry = it.next(); System.out.println(entry.getKey() + "---" + entry.getValue()); } // Map<?, ?> emptyMap = Collections.EMPTY_MAP; // System.out.println(emptyMap); System.out.println(map.put("sgsfg", "34456")); } }
[ "2467055745@qq.com" ]
2467055745@qq.com
14c906f33d047f8e8e668885dee99f72ea239185
682082f4ea06ea438e0243c5504918cef9d6c58a
/ReviewExamen/src/smokers/agent.java
8023b49f40364e272ee90b51d65959b536177563
[]
no_license
HassenBenSlima/Thread-Java
ae7883fb14430d75ab7e31b25cf06d0dbf07d231
c113991f558deaaeda5038592fe5a49e58c28c13
refs/heads/master
2020-08-08T06:11:10.541014
2019-10-08T22:41:05
2019-10-08T22:41:05
213,749,479
0
0
null
null
null
null
UTF-8
Java
false
false
794
java
package smokers; public class agent extends Thread { private table smokingtable; public agent(table pSmokingtable) { smokingtable = pSmokingtable; } @Override public void run() { while (true) { try { Thread.sleep(5000); smokingtable.setAgentElements(); // this triggers the smoker-threads to look at the table output("The agents puts " + smokingtable.getAgentElements() + " on the table."); // pause the agent while one smoker thread is running pause(); } catch (Exception e) { } } } public synchronized void wake() { try { notify(); } catch (Exception e) { } } public synchronized void pause() { try { this.wait(); } catch (Exception e) { } } private void output(String pOutput) { System.out.println(pOutput); } }
[ "Hassen.BenSlima" ]
Hassen.BenSlima
2e41a46a36d474993055305a4ec422543795047d
a36dce4b6042356475ae2e0f05475bd6aed4391b
/2005/NRI-AppLogic/source/com/nri/exception/DuplicateKeyException.java
037783f2f1a8bcc67065d0e4bbe8e879ee5431f4
[]
no_license
ildar66/WSAD_NRI
b21dbee82de5d119b0a507654d269832f19378bb
2a352f164c513967acf04d5e74f36167e836054f
refs/heads/master
2020-12-02T23:59:09.795209
2017-07-01T09:25:27
2017-07-01T09:25:27
95,954,234
0
1
null
null
null
null
UTF-8
Java
false
false
397
java
package com.nri.exception; public class DuplicateKeyException extends MappingException { /** * Constructor for DuplicateKeyException */ public DuplicateKeyException() { super(); } /** * Constructor for DuplicateKeyException */ public DuplicateKeyException(String arg0) { super(arg0); } public DuplicateKeyException(Exception arg0, String desc) { super(arg0, desc); } }
[ "ildar66@inbox.ru" ]
ildar66@inbox.ru
d68fb4081deca0ce53385643a9ed2e78713cf0f9
1d928c3f90d4a0a9a3919a804597aa0a4aab19a3
/java/dbeaver/2018/12/JDBCObjectCache.java
bbefbac9285d5806ba8359e81f408e8395e3b286
[]
no_license
rosoareslv/SED99
d8b2ff5811e7f0ffc59be066a5a0349a92cbb845
a062c118f12b93172e31e8ca115ce3f871b64461
refs/heads/main
2023-02-22T21:59:02.703005
2021-01-28T19:40:51
2021-01-28T19:40:51
306,497,459
1
1
null
2020-11-24T20:56:18
2020-10-23T01:18:07
null
UTF-8
Java
false
false
5,984
java
/* * DBeaver - Universal Database Manager * Copyright (C) 2010-2017 Serge Rider (serge@jkiss.org) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org.jkiss.dbeaver.model.impl.jdbc.cache; import org.jkiss.code.NotNull; import org.jkiss.code.Nullable; import org.jkiss.dbeaver.DBException; import org.jkiss.dbeaver.Log; import org.jkiss.dbeaver.model.DBConstants; import org.jkiss.dbeaver.model.DBPDataSource; import org.jkiss.dbeaver.model.DBUtils; import org.jkiss.dbeaver.model.exec.jdbc.JDBCResultSet; import org.jkiss.dbeaver.model.exec.jdbc.JDBCSession; import org.jkiss.dbeaver.model.exec.jdbc.JDBCStatement; import org.jkiss.dbeaver.model.impl.AbstractObjectCache; import org.jkiss.dbeaver.model.messages.ModelMessages; import org.jkiss.dbeaver.model.runtime.DBRProgressMonitor; import org.jkiss.dbeaver.model.struct.DBSObject; import java.sql.SQLException; import java.util.*; /** * Various objects cache. * Simple cache which may read objects from database and keep them. */ public abstract class JDBCObjectCache<OWNER extends DBSObject, OBJECT extends DBSObject> extends AbstractObjectCache<OWNER, OBJECT> { public static final int DEFAULT_MAX_CACHE_SIZE = 1000000; private static final Log log = Log.getLog(JDBCObjectCache.class); // Maximum number of objects in cache private int maximumCacheSize = DEFAULT_MAX_CACHE_SIZE; protected JDBCObjectCache() { } public void setMaximumCacheSize(int maximumCacheSize) { this.maximumCacheSize = maximumCacheSize; } abstract protected JDBCStatement prepareObjectsStatement(@NotNull JDBCSession session, @NotNull OWNER owner) throws SQLException; @Nullable abstract protected OBJECT fetchObject(@NotNull JDBCSession session, @NotNull OWNER owner, @NotNull JDBCResultSet resultSet) throws SQLException, DBException; @NotNull @Override public Collection<OBJECT> getAllObjects(@NotNull DBRProgressMonitor monitor, @Nullable OWNER owner) throws DBException { if (!isFullyCached()) { loadObjects(monitor, owner); } return getCachedObjects(); } @Override public OBJECT getObject(@NotNull DBRProgressMonitor monitor, @NotNull OWNER owner, @NotNull String name) throws DBException { if (!isFullyCached()) { this.loadObjects(monitor, owner); } return getCachedObject(name); } protected synchronized void loadObjects(DBRProgressMonitor monitor, OWNER owner) throws DBException { if (isFullyCached() || monitor.isCanceled()) { return; } List<OBJECT> tmpObjectList = new ArrayList<>(); DBPDataSource dataSource = owner.getDataSource(); if (dataSource == null) { throw new DBException(ModelMessages.error_not_connected_to_database); } try { try (JDBCSession session = DBUtils.openMetaSession(monitor, owner, "Load objects from " + owner.getName())) { try (JDBCStatement dbStat = prepareObjectsStatement(session, owner)) { monitor.subTask("Load " + getCacheName()); dbStat.setFetchSize(DBConstants.METADATA_FETCH_SIZE); dbStat.executeStatement(); JDBCResultSet dbResult = dbStat.getResultSet(); if (dbResult != null) { try { while (dbResult.next()) { if (monitor.isCanceled()) { break; } OBJECT object = fetchObject(session, owner, dbResult); if (object == null) { continue; } tmpObjectList.add(object); // Do not log every object load. This overheats UI in case of long lists //monitor.subTask(object.getName()); if (tmpObjectList.size() == maximumCacheSize) { log.warn("Maximum cache size exceeded (" + maximumCacheSize + ") in " + this); break; } } } finally { dbResult.close(); } } } } catch (SQLException ex) { throw new DBException(ex, dataSource); } } catch (DBException e) { if (!handleCacheReadError(e)) { throw e; } } Comparator<OBJECT> comparator = getListOrderComparator(); if (comparator != null) { tmpObjectList.sort(comparator); } detectCaseSensitivity(owner); mergeCache(tmpObjectList); this.invalidateObjects(monitor, owner, new CacheIterator()); } protected String getCacheName() { return getClass().getSimpleName(); } // Can be implemented to provide custom cache error handler protected boolean handleCacheReadError(DBException error) { return false; } }
[ "rodrigosoaresilva@gmail.com" ]
rodrigosoaresilva@gmail.com
2681c6978abd53389e356d16c11618fe847e44ff
2797280c63fb027887ad5db57b4f1938a7fb03bb
/src/com/fantest/Off.java
05a6b9f4de0ed637e7400e74b5824916191cf799
[]
no_license
NavyaK-T/FanTest-Problem
fba774f2c33b28ca3f43482a3084ec8c55d61e38
e7dbae08c840536721b3a92418ab66ee3798ff7b
refs/heads/master
2023-04-17T13:49:42.911148
2021-04-23T21:05:19
2021-04-23T21:05:19
361,004,933
0
0
null
null
null
null
UTF-8
Java
false
false
269
java
package com.fantest; public class Off implements SpeedLevel { @Override public void pull(CeilingFanPullChain pullChain) { pullChain.setCurrentState(new SpeedLevelOne()); System.out.println("Speed level 1 with direction "+pullChain.getCurrentDirection()); } }
[ "abc@example.com" ]
abc@example.com