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
5aed7b77b2c25b9cc1140326d8d30fe351869fad
d40c78fa2a79be54bb2f81447d556cf3bbb4acac
/src/org/calminfotech/system/forms/CategoryItemUnitForm.java
25c33818a7a6424ee3dddfc49e370e3d9acfb783
[]
no_license
ibrowiz/Hospital-Management-System
0e3e900aad62cf70e43fb1561a531bd97b3c987f
055f08dc7366601fba8b814fcbccecbd64e09b11
refs/heads/master
2020-04-13T13:29:53.493357
2018-12-27T09:28:14
2018-12-27T09:28:14
163,232,553
0
0
null
null
null
null
UTF-8
Java
false
false
607
java
package org.calminfotech.system.forms; public class CategoryItemUnitForm { private Integer itemUnitId; private Integer unit; private Integer categoryItem; //Getters and Setters public Integer getItemUnitId() { return itemUnitId; } public void setItemUnitId(Integer itemUnitId) { this.itemUnitId = itemUnitId; } public Integer getUnit() { return unit; } public void setUnit(Integer unit) { this.unit = unit; } public Integer getCategoryItem() { return categoryItem; } public void setCategoryItem(Integer categoryItem) { this.categoryItem = categoryItem; } }
[ "ibrahimayakpat@gmail.com" ]
ibrahimayakpat@gmail.com
eb651af6b6efa2bd16ecf9fb167f31347e97c8dd
95a54e3f3617bf55883210f0b5753b896ad48549
/java_src/android/support/design/circularreveal/coordinatorlayout/CircularRevealCoordinatorLayout.java
7de682fd85f8e172ccccc8c68070f95015671526
[]
no_license
aidyk/TagoApp
ffc5a8832fbf9f9819f7f8aa7af29149fbab9ea5
e31a528c8f931df42075fc8694754be146eddc34
refs/heads/master
2022-12-22T02:20:58.486140
2021-05-16T07:42:02
2021-05-16T07:42:02
325,695,453
3
1
null
2022-12-16T00:32:10
2020-12-31T02:34:45
Smali
UTF-8
Java
false
false
3,346
java
package android.support.design.circularreveal.coordinatorlayout; import android.content.Context; import android.graphics.Canvas; import android.graphics.drawable.Drawable; import android.support.annotation.ColorInt; import android.support.annotation.Nullable; import android.support.design.circularreveal.CircularRevealHelper; import android.support.design.circularreveal.CircularRevealWidget; import android.support.design.widget.CoordinatorLayout; import android.util.AttributeSet; public class CircularRevealCoordinatorLayout extends CoordinatorLayout implements CircularRevealWidget { private final CircularRevealHelper helper; public CircularRevealCoordinatorLayout(Context context) { this(context, null); } public CircularRevealCoordinatorLayout(Context context, AttributeSet attributeSet) { super(context, attributeSet); this.helper = new CircularRevealHelper(this); } @Override // android.support.design.circularreveal.CircularRevealWidget public void buildCircularRevealCache() { this.helper.buildCircularRevealCache(); } @Override // android.support.design.circularreveal.CircularRevealWidget public void destroyCircularRevealCache() { this.helper.destroyCircularRevealCache(); } @Override // android.support.design.circularreveal.CircularRevealWidget public void setRevealInfo(@Nullable CircularRevealWidget.RevealInfo revealInfo) { this.helper.setRevealInfo(revealInfo); } @Override // android.support.design.circularreveal.CircularRevealWidget @Nullable public CircularRevealWidget.RevealInfo getRevealInfo() { return this.helper.getRevealInfo(); } @Override // android.support.design.circularreveal.CircularRevealWidget public void setCircularRevealScrimColor(@ColorInt int i) { this.helper.setCircularRevealScrimColor(i); } @Override // android.support.design.circularreveal.CircularRevealWidget public int getCircularRevealScrimColor() { return this.helper.getCircularRevealScrimColor(); } @Override // android.support.design.circularreveal.CircularRevealWidget @Nullable public Drawable getCircularRevealOverlayDrawable() { return this.helper.getCircularRevealOverlayDrawable(); } @Override // android.support.design.circularreveal.CircularRevealWidget public void setCircularRevealOverlayDrawable(@Nullable Drawable drawable) { this.helper.setCircularRevealOverlayDrawable(drawable); } @Override // android.support.design.circularreveal.CircularRevealWidget public void draw(Canvas canvas) { if (this.helper != null) { this.helper.draw(canvas); } else { super.draw(canvas); } } @Override // android.support.design.circularreveal.CircularRevealHelper.Delegate public void actualDraw(Canvas canvas) { super.draw(canvas); } @Override // android.support.design.circularreveal.CircularRevealWidget public boolean isOpaque() { if (this.helper != null) { return this.helper.isOpaque(); } return super.isOpaque(); } @Override // android.support.design.circularreveal.CircularRevealHelper.Delegate public boolean actualIsOpaque() { return super.isOpaque(); } }
[ "ai@AIs-MacBook-Pro.local" ]
ai@AIs-MacBook-Pro.local
745004da24eab326f4499301007cc3dbb8ec7970
e1c277b814905c63dd2b891bc7038f88038ff884
/src/main/java/org/concordion/internal/BrowserStyleWhitespaceComparator.java
0b2dde400268c84bfefdb6e2bd3b33ae6cc21f21
[ "Apache-2.0" ]
permissive
concordion/concordion
7d7dcd08422b3c14942b2948e7db2db601a0a798
e33063384806d0b51d57d687d4459f7c00e829ab
refs/heads/master
2023-07-19T05:01:33.431940
2023-07-16T09:27:53
2023-07-16T09:27:53
9,136,067
208
69
NOASSERTION
2023-07-16T09:27:54
2013-03-31T20:42:48
Java
UTF-8
Java
false
false
764
java
package org.concordion.internal; import java.util.Comparator; import org.concordion.internal.util.Check; public class BrowserStyleWhitespaceComparator implements Comparator<Object> { private ChainOfExpectationCheckers chainOfCheckers = new ChainOfExpectationCheckers(); public BrowserStyleWhitespaceComparator() { chainOfCheckers.add(new BooleanExpectationChecker()); chainOfCheckers.add(new CatchAllExpectationChecker()); } public int compare(Object o1, Object o2) { Check.isTrue(o2 instanceof String, "This comparator only supports comparisons with String objects"); if (chainOfCheckers.isAcceptable(o1, (String) o2)) { return 0; } return -1; } }
[ "nigel.charman.nz@gmail.com" ]
nigel.charman.nz@gmail.com
9c6391eeac44647d1140e8cfbe80e51846140257
fc6c869ee0228497e41bf357e2803713cdaed63e
/weixin6519android1140/src/sourcecode/com/tencent/mm/plugin/appbrand/jsapi/aw.java
5806289cc09b20c8d48f0cd2e6193189ee26399a
[]
no_license
hyb1234hi/reverse-wechat
cbd26658a667b0c498d2a26a403f93dbeb270b72
75d3fd35a2c8a0469dbb057cd16bca3b26c7e736
refs/heads/master
2020-09-26T10:12:47.484174
2017-11-16T06:54:20
2017-11-16T06:54:20
null
0
0
null
null
null
null
UTF-8
Java
false
false
1,565
java
package com.tencent.mm.plugin.appbrand.jsapi; import android.content.Intent; import com.tencent.gmtrace.GMTrace; import com.tencent.mm.plugin.appbrand.j; import com.tencent.mm.sdk.platformtools.bg; import org.json.JSONObject; public final class aw extends a { public static final int CTRL_INDEX = 247; public static final String NAME = "openDeliveryList"; public aw() { GMTrace.i(16369999413248L, 121966); GMTrace.o(16369999413248L, 121966); } public final void a(j paramj, JSONObject paramJSONObject, int paramInt) { GMTrace.i(16370133630976L, 121967); paramJSONObject = paramJSONObject.optString("query"); if (bg.nm(paramJSONObject)) { paramj.v(paramInt, d("fail", null)); GMTrace.o(16370133630976L, 121967); return; } Intent localIntent = new Intent(); localIntent.putExtra("rawUrl", "https://mp.weixin.qq.com/bizmall/expressentry" + paramJSONObject); localIntent.putExtra("show_native_web_view", true); localIntent.putExtra("KRightBtn", true); if (paramj.mContext != null) { com.tencent.mm.bj.d.b(paramj.mContext, "webview", ".ui.tools.WebViewUI", localIntent); paramj.v(paramInt, d("ok", null)); GMTrace.o(16370133630976L, 121967); return; } paramj.v(paramInt, d("fail", null)); GMTrace.o(16370133630976L, 121967); } } /* Location: D:\tools\apktool\weixin6519android1140\jar\classes2-dex2jar.jar!\com\tencent\mm\plugin\appbrand\jsapi\aw.class * Java compiler version: 6 (50.0) * JD-Core Version: 0.7.1 */
[ "robert0825@gmail.com" ]
robert0825@gmail.com
f0ad0eadb5824c69d6463947e1f88d31d1791a52
7b1c8f10e7d83a72f6f6a34637d33c0977d72dbd
/handler/url/src/test/java/io/wcm/handler/url/impl/UrlHandlerImplWithoutRequestPageTest.java
429791eaf055a15ba7f69cb06154b66a01b9f441
[ "Apache-2.0" ]
permissive
npeltier/wcm-io
12cb28118350286aa8965fb954903f707cebbbd8
656ef0968fa7ec16ce00fb933360eb0442183042
refs/heads/master
2021-01-15T16:14:36.562151
2014-10-06T13:29:50
2014-10-06T13:29:50
null
0
0
null
null
null
null
UTF-8
Java
false
false
998
java
/* * #%L * wcm.io * %% * Copyright (C) 2014 wcm.io * %% * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * #L% */ package io.wcm.handler.url.impl; import org.apache.sling.api.adapter.Adaptable; /** * Test {@link UrlHandlerImpl} methods with current request and current page null. */ public class UrlHandlerImplWithoutRequestPageTest extends UrlHandlerImplTest { @Override protected Adaptable adaptable() { return context.request().getResource(); } }
[ "sseifert@pro-vision.de" ]
sseifert@pro-vision.de
3e765cbaa46fecfc6d4595ac4a901571c3f927a1
630e08722bec5ab15acc30ae072b8f037b9e4740
/modules/lib-sip/src/main/java/javax/sip/TransportNotSupportedException.java
9d99811344e90862ed74bfa3c868164dfba34d96
[ "Apache-2.0" ]
permissive
fhg-fokus-nubomedia/signaling-plane
f54feef2b77cca498501523bbd06fd203dedeba1
2ab48dfde4556bd6920d6cbaa1d80a8646ba737f
refs/heads/master
2021-01-10T11:28:03.998041
2016-01-08T11:44:57
2016-01-29T21:41:18
49,268,585
1
0
null
null
null
null
UTF-8
Java
false
false
1,998
java
/** * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ * Unpublished - rights reserved under the Copyright Laws of the United States. * Copyright © 2003 Sun Microsystems, Inc. All rights reserved. * Copyright © 2005 BEA Systems, Inc. All rights reserved. * * Use is subject to license terms. * * This distribution may include materials developed by third parties. * * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ * * Module Name : JSIP Specification * File Name : TransportNotSupportedException.java * Author : Phelim O'Doherty * * HISTORY * Version Date Author Comments * 1.1 08/10/2002 Phelim O'Doherty Initial version *~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ */ package javax.sip; /** * The TransportNotSupportedException indicates that a specific transport is * not supported by a vendor's implementation of this specification. * * @author BEA Systems, NIST * @version 1.2 */ public class TransportNotSupportedException extends SipException { /** * Constructs a new <code>TransportNotSupportedException</code>. */ public TransportNotSupportedException() { super(); } /** * Constructs a new <code>TransportNotSupportedException</code> with * the specified error message. * * @param message the error message of this Exception. */ public TransportNotSupportedException(String message) { super(message); } /** * Constructs a new <code>TransportNotSupportedException</code> with the * specified error message and specialized cause that triggered this error * condition. * * @param message the detail of the error message * @param cause the specialized cause that triggered this exception */ public TransportNotSupportedException(String message, Throwable cause) { super(message, cause); } }
[ "alice.cheambe@fokus.fraunhofer.de" ]
alice.cheambe@fokus.fraunhofer.de
ce6d128a7a1e36ebd718af8319edc6df133c4076
cf67b9b50230935695abb45a4ba9cedb8c55005f
/src/main/java/com/lakitchen/LA/Kitchen/api/dto/RateDTO.java
149569e8019d22a1569269cc067cee678bf796e8
[]
no_license
albertkur145/LAKitchen_Backend
c9cbc9945338fe3143ffcc4105a2a3cfdb1cc5a9
7dbea62e737ff7c6ea201c7d4c6dbd81d25ec711
refs/heads/main
2023-03-20T00:46:49.128301
2021-03-10T15:35:26
2021-03-10T15:35:26
325,999,094
1
0
null
null
null
null
UTF-8
Java
false
false
238
java
package com.lakitchen.LA.Kitchen.api.dto; import lombok.AllArgsConstructor; import lombok.Data; @Data @AllArgsConstructor public class RateDTO { Integer five; Integer four; Integer three; Integer two; Integer one; }
[ "=" ]
=
686861ac09f014d71ca8721fa25229b06386139d
37278ea984120d20661bd568a8908d696c0062f7
/javamalls/base/security/support/ShopAuthenticationProvider.java
6bef21bf5a33d07bf553b19cc499995308e78aa0
[]
no_license
cjp472/dinghuobao
412f13b142e57b5868d609fdced51b9ee707ddb7
1d36ef79282955d308c07482e6443648202eb243
refs/heads/master
2020-03-19T09:48:21.018770
2018-05-05T07:18:48
2018-05-05T07:18:48
136,318,589
2
3
null
2018-06-06T11:23:23
2018-06-06T11:23:23
null
UTF-8
Java
false
false
4,799
java
package com.javamalls.base.security.support; import org.springframework.dao.DataAccessException; import org.springframework.security.AuthenticationException; import org.springframework.security.AuthenticationServiceException; import org.springframework.security.BadCredentialsException; import org.springframework.security.providers.UsernamePasswordAuthenticationToken; import org.springframework.security.providers.dao.AbstractUserDetailsAuthenticationProvider; import org.springframework.security.providers.dao.SaltSource; import org.springframework.security.providers.encoding.Md5PasswordEncoder; import org.springframework.security.providers.encoding.PasswordEncoder; import org.springframework.security.userdetails.UserDetails; import org.springframework.security.userdetails.UserDetailsService; import org.springframework.util.Assert; /** * 认证管理器,实现用户认证的入口 * @author Administrator */ public class ShopAuthenticationProvider extends AbstractUserDetailsAuthenticationProvider { private PasswordEncoder passwordEncoder = new Md5PasswordEncoder(); private SaltSource saltSource; private UserDetailsService userDetailsService; private boolean includeDetailsObject = true; protected void additionalAuthenticationChecks(UserDetails userDetails, UsernamePasswordAuthenticationToken authentication) throws AuthenticationException { Object salt = null; if (this.saltSource != null) { salt = this.saltSource.getSalt(userDetails); } if (authentication.getCredentials() == null) { throw new BadCredentialsException(this.messages.getMessage( "AbstractUserDetailsAuthenticationProvider.badCredentials", "Bad credentials"), this.includeDetailsObject ? userDetails : null); } String presentedPassword = authentication.getCredentials().toString(); if (presentedPassword.indexOf("jm_thid_login_") >= 0) { presentedPassword = presentedPassword.substring("jm_thid_login_".length()); if (!presentedPassword.equals(userDetails.getPassword())) { throw new BadCredentialsException(this.messages.getMessage( "AbstractUserDetailsAuthenticationProvider.badCredentials", "Bad credentials"), this.includeDetailsObject ? userDetails : null); } } else if (!this.passwordEncoder.isPasswordValid(userDetails.getPassword(), presentedPassword, salt)) { throw new BadCredentialsException(this.messages.getMessage( "AbstractUserDetailsAuthenticationProvider.badCredentials", "Bad credentials"), this.includeDetailsObject ? userDetails : null); } } protected void doAfterPropertiesSet() throws Exception { Assert.notNull(this.userDetailsService, "A UserDetailsService must be set"); } protected final UserDetails retrieveUser(String username, UsernamePasswordAuthenticationToken authentication) throws AuthenticationException { UserDetails loadedUser; try { loadedUser = getUserDetailsService().loadUserByUsername(username); } catch (DataAccessException repositoryProblem) { throw new AuthenticationServiceException(repositoryProblem.getMessage(), repositoryProblem); } if (loadedUser == null) { throw new AuthenticationServiceException( "UserDetailsService returned null, which is an interface contract violation"); } return loadedUser; } public void setPasswordEncoder(PasswordEncoder passwordEncoder) { this.passwordEncoder = passwordEncoder; } protected PasswordEncoder getPasswordEncoder() { return this.passwordEncoder; } public void setSaltSource(SaltSource saltSource) { this.saltSource = saltSource; } protected SaltSource getSaltSource() { return this.saltSource; } public void setUserDetailsService(UserDetailsService userDetailsService) { this.userDetailsService = userDetailsService; } protected UserDetailsService getUserDetailsService() { return this.userDetailsService; } protected boolean isIncludeDetailsObject() { return this.includeDetailsObject; } public void setIncludeDetailsObject(boolean includeDetailsObject) { this.includeDetailsObject = includeDetailsObject; } }
[ "huyang3868@163.com" ]
huyang3868@163.com
edcb8645b47c79d24cc12ee12696954aab810924
180e78725121de49801e34de358c32cf7148b0a2
/dataset/protocol1/neo4j/learning/1582/ErrorReporterTest.java
a75d3df207befb8bbf46bd15e757ff75ddeba34d
[]
no_license
ASSERT-KTH/synthetic-checkstyle-error-dataset
40e8d1e0a7ebe7f7711def96a390891a6922f7bd
40c057e1669584bfc6fecf789b5b2854660222f3
refs/heads/master
2023-03-18T12:50:55.410343
2019-01-25T09:54:39
2019-01-25T09:54:39
null
0
0
null
null
null
null
UTF-8
Java
false
false
3,643
java
/* * Copyright (c) 2002-2018 "Neo4j," * Neo4j Sweden AB [http://neo4j.com] * * This file is part of Neo4j. * * Neo4j 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. * * 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 <http://www.gnu.org/licenses/>. */ package org.neo4j.bolt.v1.runtime; import org.junit.Test; import java.util.UUID; import org.neo4j.bolt.runtime.Neo4jError; import org.neo4j.kernel.api.exceptions.Status; import org.neo4j.logging.AssertableLogProvider; import org.neo4j.logging.LogProvider; import static org.mockito.Mockito.mock; import static org.mockito.Mockito.when; public class ErrorReporterTest { @Test public void onlyDatabaseErrorsAreLogged() { AssertableLogProvider userLog = new AssertableLogProvider(); AssertableLogProvider internalLog = new AssertableLogProvider(); ErrorReporter reporter = newErrorReporter( userLog, internalLog ); for ( Status.Classification classification : Status.Classification.values() ) { if ( classification != Status.Classification.DatabaseError ) { Status.Code code = newStatusCode( classification ); Neo4jError error = Neo4jError.from( () -> code, "Database error" ); reporter.report( error ); userLog.assertNoLoggingOccurred(); internalLog.assertNoLoggingOccurred(); } } } @Test public void databaseErrorShouldLogFullMessageInDebugLogAndHelpfulPointerInUserLog() { // given AssertableLogProvider userLog = new AssertableLogProvider(); AssertableLogProvider internalLog = new AssertableLogProvider(); ErrorReporter reporter = newErrorReporter( userLog, internalLog ); Neo4jError error = Neo4jError.fatalFrom( new TestDatabaseError() ); UUID reference = error.reference(); // when reporter.report( error ); // then userLog.assertContainsLogCallContaining( "Client triggered an unexpected error" ); userLog.assertContainsLogCallContaining( reference.toString() ); userLog.assertContainsLogCallContaining( "Database error" ); internalLog.assertContainsLogCallContaining( reference.toString() ); internalLog.assertContainsLogCallContaining( "Database error" ); } private static ErrorReporter newErrorReporter( LogProvider userLog, LogProvider internalLog ) { return new ErrorReporter( userLog.getLog( "userLog" ), internalLog.getLog( "internalLog" ) ); } private static Status.Code newStatusCode( Status.Classification classification ) { Status.Code code = mock( Status.Code.class ); when( code.classification() ).thenReturn( classification ); return code; } private static class TestDatabaseError extends RuntimeException implements Status.HasStatus { TestDatabaseError() { super( "Database error" ); } @Override public Status status() { return () -> newStatusCode( Status.Classification.DatabaseError ); } } }
[ "bloriot97@gmail.com" ]
bloriot97@gmail.com
c0207127ed78380fac7e1d5142117ed83b44e470
779d886f8e5d566346c4c63a52e8ee2d886538cd
/src/main/java/com/zhym/iterator/Department.java
d035a5e3e2671a34e2b7fe479e8edddde98025cb
[]
no_license
zhyming/design-module
e455bfd86956cbc4a2fa97ea4f397a3763505fe5
eb37c31051a0fa9af84ad1038ecc1ecb1c6a88a8
refs/heads/master
2022-12-27T07:43:25.376915
2020-10-10T16:53:35
2020-10-10T16:53:35
301,182,769
0
0
null
2020-10-09T01:21:31
2020-10-04T17:10:59
Java
UTF-8
Java
false
false
533
java
package com.zhym.iterator; /** * @author zhym * @description * @crate 2020/10/6 22:30 */ public class Department { private String name; private String des; public Department(String name, String des) { this.name = name; this.des = des; } public String getName() { return name; } public void setName(String name) { this.name = name; } public String getDes() { return des; } public void setDes(String des) { this.des = des; } }
[ "123@163.com" ]
123@163.com
cc21c51fb26e3c2c067fdb541168bbf48e07b7cd
b2041ed2001f1db327e3991cd77575b12cb7372a
/TrainCar_Student_v2.0/src/main/java/com/guugoo/jiapeistudent/Data/Recommend.java
282ebc450ae8b3df6ff77b5edafc8e68b2622749
[]
no_license
LFengYe/WorkProject_v3.3
4de58fc49c24a53b8be0c77f01669ebb86651c8f
59cc45cc07d2477957ba0cc124f00e5ea1217df7
refs/heads/master
2021-01-19T18:35:51.562958
2017-08-01T07:15:26
2017-08-01T07:15:28
88,365,855
1
1
null
null
null
null
UTF-8
Java
false
false
2,405
java
package com.guugoo.jiapeistudent.Data; /** * Created by Administrator on 2016/8/13. */ public class Recommend { private static final String TAG = "Recommend"; /** * HeadPortrait : 头像 * Nmae : 姓名 * Tel : 电话 * Type : 类型 * InvitePeopleBonusAmount : 学员奖励的数量 * InvitePeopleIsCash : 是否已经奖励 * InvitePeopleRewarType : 奖励的类型(1表示现金奖励,2表示学时券奖励) */ private String HeadPortrait; private String Nmae; private String Tel; private String Type; private float InvitePeopleBonusAmount; private boolean InvitePeopleIsCash; private int InvitePeopleRewarType; public Recommend() { } public Recommend(String headPortrait, String nmae, String tel, String type, int invitePeopleBonusAmount, boolean invitePeopleIsCash, int invitePeopleRewarType) { HeadPortrait = headPortrait; Nmae = nmae; Tel = tel; Type = type; InvitePeopleBonusAmount = invitePeopleBonusAmount; InvitePeopleIsCash = invitePeopleIsCash; InvitePeopleRewarType = invitePeopleRewarType; } public String getHeadPortrait() { return HeadPortrait; } public void setHeadPortrait(String HeadPortrait) { this.HeadPortrait = HeadPortrait; } public String getNmae() { return Nmae; } public void setNmae(String Nmae) { this.Nmae = Nmae; } public String getTel() { return Tel; } public void setTel(String Tel) { this.Tel = Tel; } public String getType() { return Type; } public void setType(String Type) { this.Type = Type; } public float getInvitePeopleBonusAmount() { return InvitePeopleBonusAmount; } public void setInvitePeopleBonusAmount(float invitePeopleBonusAmount) { InvitePeopleBonusAmount = invitePeopleBonusAmount; } public boolean isInvitePeopleIsCash() { return InvitePeopleIsCash; } public void setInvitePeopleIsCash(boolean invitePeopleIsCash) { InvitePeopleIsCash = invitePeopleIsCash; } public int getInvitePeopleRewarType() { return InvitePeopleRewarType; } public void setInvitePeopleRewarType(int invitePeopleRewarType) { InvitePeopleRewarType = invitePeopleRewarType; } }
[ "xiaofengcanyue2009@163.com" ]
xiaofengcanyue2009@163.com
74d3263d6cd5b4bfeab54c7320e453e99905fa83
1b8a226a3f15c3459f819ebe752d6165e1522a93
/Treinamento_Java_debug/AULA-4/src/br/com/listavip/ConvidadoService.java
e0feacb86e08ff69a35b55b2db88ff1392cf5c8b
[]
no_license
alexandreximenes/java
832d4e708dd3122c1fbf0ab9e4007f2f8c38d509
5cef77703bda6a5106734abc32093c0abb29bd5b
refs/heads/master
2022-12-23T21:48:56.717760
2021-04-14T05:19:36
2021-04-14T05:19:36
128,485,600
1
0
null
2022-12-16T04:26:13
2018-04-07T01:16:29
JavaScript
UTF-8
Java
false
false
324
java
package br.com.listavip; import java.sql.SQLException; import java.util.List; public class ConvidadoService { public List<Convidado> obterTodos(){ return new ConvidadoRepository().obterTodos(); } public void salvar(Convidado convidado) throws SQLException{ new ConvidadoRepository().salvar(convidado); } }
[ "xyymenes@gmail.com" ]
xyymenes@gmail.com
4f26c66e6166ed5b6d5898e28f834a019d2864c6
c577f5380b4799b4db54722749cc33f9346eacc1
/BugSwarm/Azure-azure-sdk-for-java-134840154/buggy_files/azure-batch/src/main/java/com/microsoft/azure/batch/protocol/models/PoolStopResizeOptions.java
7cd77b5ddb1c5f4262b2fdb8fa466aff7ea9491a
[]
no_license
tdurieux/BugSwarm-dissection
55db683fd95f071ff818f9ca5c7e79013744b27b
ee6b57cfef2119523a083e82d902a6024e0d995a
refs/heads/master
2020-04-30T17:11:52.050337
2019-05-09T13:42:03
2019-05-09T13:42:03
176,972,414
1
0
null
null
null
null
UTF-8
Java
false
false
6,489
java
/** * Copyright (c) Microsoft Corporation. All rights reserved. * Licensed under the MIT License. See License.txt in the project root for * license information. */ package com.microsoft.azure.batch.protocol.models; import com.microsoft.rest.DateTimeRfc1123; import org.joda.time.DateTime; import com.fasterxml.jackson.annotation.JsonProperty; /** * Additional parameters for the Pool_StopResize operation. */ public class PoolStopResizeOptions { /** * The maximum time that the server can spend processing the request, in * seconds. The default is 30 seconds. */ @JsonProperty(value = "") private Integer timeout; /** * The caller-generated request identity, in the form of a GUID with no * decoration such as curly braces, e.g. * 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. */ @JsonProperty(value = "") private String clientRequestId; /** * Whether the server should return the client-request-id identifier in * the response. */ @JsonProperty(value = "") private Boolean returnClientRequestId; /** * The time the request was issued. If not specified, this header will be * automatically populated with the current system clock time. */ @JsonProperty(value = "") private DateTimeRfc1123 ocpDate; /** * An ETag is specified. Specify this header to perform the operation only * if the resource's ETag is an exact match as specified. */ @JsonProperty(value = "") private String ifMatch; /** * An ETag is specified. Specify this header to perform the operation only * if the resource's ETag does not match the specified ETag. */ @JsonProperty(value = "") private String ifNoneMatch; /** * Specify this header to perform the operation only if the resource has * been modified since the specified date/time. */ @JsonProperty(value = "") private DateTimeRfc1123 ifModifiedSince; /** * Specify this header to perform the operation only if the resource has * not been modified since the specified date/time. */ @JsonProperty(value = "") private DateTimeRfc1123 ifUnmodifiedSince; /** * Get the timeout value. * * @return the timeout value */ public Integer timeout() { return this.timeout; } /** * Set the timeout value. * * @param timeout the timeout value to set * @return the PoolStopResizeOptions object itself. */ public PoolStopResizeOptions withTimeout(Integer timeout) { this.timeout = timeout; return this; } /** * Get the clientRequestId value. * * @return the clientRequestId value */ public String clientRequestId() { return this.clientRequestId; } /** * Set the clientRequestId value. * * @param clientRequestId the clientRequestId value to set * @return the PoolStopResizeOptions object itself. */ public PoolStopResizeOptions withClientRequestId(String clientRequestId) { this.clientRequestId = clientRequestId; return this; } /** * Get the returnClientRequestId value. * * @return the returnClientRequestId value */ public Boolean returnClientRequestId() { return this.returnClientRequestId; } /** * Set the returnClientRequestId value. * * @param returnClientRequestId the returnClientRequestId value to set * @return the PoolStopResizeOptions object itself. */ public PoolStopResizeOptions withReturnClientRequestId(Boolean returnClientRequestId) { this.returnClientRequestId = returnClientRequestId; return this; } /** * Get the ocpDate value. * * @return the ocpDate value */ public DateTime ocpDate() { if (this.ocpDate == null) { return null; } return this.ocpDate.getDateTime(); } /** * Set the ocpDate value. * * @param ocpDate the ocpDate value to set * @return the PoolStopResizeOptions object itself. */ public PoolStopResizeOptions withOcpDate(DateTime ocpDate) { this.ocpDate = new DateTimeRfc1123(ocpDate); return this; } /** * Get the ifMatch value. * * @return the ifMatch value */ public String ifMatch() { return this.ifMatch; } /** * Set the ifMatch value. * * @param ifMatch the ifMatch value to set * @return the PoolStopResizeOptions object itself. */ public PoolStopResizeOptions withIfMatch(String ifMatch) { this.ifMatch = ifMatch; return this; } /** * Get the ifNoneMatch value. * * @return the ifNoneMatch value */ public String ifNoneMatch() { return this.ifNoneMatch; } /** * Set the ifNoneMatch value. * * @param ifNoneMatch the ifNoneMatch value to set * @return the PoolStopResizeOptions object itself. */ public PoolStopResizeOptions withIfNoneMatch(String ifNoneMatch) { this.ifNoneMatch = ifNoneMatch; return this; } /** * Get the ifModifiedSince value. * * @return the ifModifiedSince value */ public DateTime ifModifiedSince() { if (this.ifModifiedSince == null) { return null; } return this.ifModifiedSince.getDateTime(); } /** * Set the ifModifiedSince value. * * @param ifModifiedSince the ifModifiedSince value to set * @return the PoolStopResizeOptions object itself. */ public PoolStopResizeOptions withIfModifiedSince(DateTime ifModifiedSince) { this.ifModifiedSince = new DateTimeRfc1123(ifModifiedSince); return this; } /** * Get the ifUnmodifiedSince value. * * @return the ifUnmodifiedSince value */ public DateTime ifUnmodifiedSince() { if (this.ifUnmodifiedSince == null) { return null; } return this.ifUnmodifiedSince.getDateTime(); } /** * Set the ifUnmodifiedSince value. * * @param ifUnmodifiedSince the ifUnmodifiedSince value to set * @return the PoolStopResizeOptions object itself. */ public PoolStopResizeOptions withIfUnmodifiedSince(DateTime ifUnmodifiedSince) { this.ifUnmodifiedSince = new DateTimeRfc1123(ifUnmodifiedSince); return this; } }
[ "durieuxthomas@hotmail.com" ]
durieuxthomas@hotmail.com
e5005be02e0f77563479cf75cea83b9a475ff948
fa8fbf36201131a1e401784eb348252b88dee967
/patterns/src/dk/via/crud/BookReader.java
433e90a946e7df90fb9d0cf7099bb382b343d795
[]
no_license
olehougaard/swe-s20
fec32046731803391dbde562e5729ca98cf453b9
d28ac48e36e3121831009d10f044abb26915e75c
refs/heads/master
2022-07-03T06:59:38.153698
2020-05-12T08:18:41
2020-05-12T08:18:41
250,202,967
0
0
null
null
null
null
UTF-8
Java
false
false
648
java
package dk.via.crud; import dk.via.book.Book; import java.sql.*; import java.util.ArrayList; import java.util.List; public class BookReader { public List<Book> readAll() throws SQLException { try(Connection connection = DriverManager.getConnection("jdbc:postgresql://localhost/")) { PreparedStatement statement = connection.prepareStatement("SELECT * FROM Book"); ResultSet rs = statement.executeQuery(); ArrayList<Book> result = new ArrayList<>(); while(rs.next()) { result.add(ObjectFactory.createBook(rs)); } return result; } } }
[ "=" ]
=
38ca0ee8975273f38c65085f18d946278651ec4b
b6ea417b48402d85b6fe90299c51411b778c07cc
/spring-jms/src/test/java/org/springframework/jms/support/converter/MarshallingMessageConverterTests.java
e31a2d0a844d2572600ada821410c030336b795e
[ "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
3,485
java
/* * Copyright 2002-2017 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.jms.support.converter; import org.junit.Before; import org.junit.Test; import org.springframework.oxm.Marshaller; import org.springframework.oxm.Unmarshaller; import javax.jms.BytesMessage; import javax.jms.Session; import javax.jms.TextMessage; import javax.xml.transform.Result; import javax.xml.transform.Source; import static org.junit.Assert.assertEquals; import static org.mockito.BDDMockito.eq; import static org.mockito.BDDMockito.given; import static org.mockito.BDDMockito.isA; import static org.mockito.BDDMockito.mock; import static org.mockito.BDDMockito.verify; /** * @author Arjen Poutsma */ public class MarshallingMessageConverterTests { private MarshallingMessageConverter converter; private Marshaller marshallerMock; private Unmarshaller unmarshallerMock; private Session sessionMock; @Before public void setup() throws Exception { marshallerMock = mock(Marshaller.class); unmarshallerMock = mock(Unmarshaller.class); sessionMock = mock(Session.class); converter = new MarshallingMessageConverter(marshallerMock, unmarshallerMock); } @Test public void toBytesMessage() throws Exception { BytesMessage bytesMessageMock = mock(BytesMessage.class); Object toBeMarshalled = new Object(); given(sessionMock.createBytesMessage()).willReturn(bytesMessageMock); converter.toMessage(toBeMarshalled, sessionMock); verify(marshallerMock).marshal(eq(toBeMarshalled), isA(Result.class)); verify(bytesMessageMock).writeBytes(isA(byte[].class)); } @Test public void fromBytesMessage() throws Exception { BytesMessage bytesMessageMock = mock(BytesMessage.class); Object unmarshalled = new Object(); given(bytesMessageMock.getBodyLength()).willReturn(10L); given(bytesMessageMock.readBytes(isA(byte[].class))).willReturn(0); given(unmarshallerMock.unmarshal(isA(Source.class))).willReturn(unmarshalled); Object result = converter.fromMessage(bytesMessageMock); assertEquals("Invalid result", result, unmarshalled); } @Test public void toTextMessage() throws Exception { converter.setTargetType(MessageType.TEXT); TextMessage textMessageMock = mock(TextMessage.class); Object toBeMarshalled = new Object(); given(sessionMock.createTextMessage(isA(String.class))).willReturn(textMessageMock); converter.toMessage(toBeMarshalled, sessionMock); verify(marshallerMock).marshal(eq(toBeMarshalled), isA(Result.class)); } @Test public void fromTextMessage() throws Exception { TextMessage textMessageMock = mock(TextMessage.class); Object unmarshalled = new Object(); String text = "foo"; given(textMessageMock.getText()).willReturn(text); given(unmarshallerMock.unmarshal(isA(Source.class))).willReturn(unmarshalled); Object result = converter.fromMessage(textMessageMock); assertEquals("Invalid result", result, unmarshalled); } }
[ "pengshaohui@markor.com.cn" ]
pengshaohui@markor.com.cn
5e09448cb544f51e85bb9eb6816b259ed891ce4d
b50782a86abb5d24282777fb0885a789f6412d31
/study/study_03/eureka-server/src/main/java/com/scott/study/EurekaApplication.java
4b6d3372e922182130be2ce1bfe23b4ad52c62bc
[]
no_license
wikerx/SpringCloud
e53006172f956f96b4da123170a9cfa4b45032ee
1da85d1ced395b1e5552bd6b65964aebf078d3fe
refs/heads/master
2022-12-15T10:48:38.452805
2019-06-01T05:06:26
2019-06-01T05:06:26
171,824,177
0
0
null
2022-12-09T02:42:07
2019-02-21T07:42:06
JavaScript
UTF-8
Java
false
false
589
java
package com.scott.study; import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.SpringBootApplication; import org.springframework.cloud.netflix.eureka.server.EnableEurekaServer; /** * @CLASSNAME :com.scott.study.EurekaApplication * @Description :注册中心 * @Author :Mr.薛 * @Data :2019/2/21 0021 12:05 * @Version :V1.0 * @Status : 编写 **/ @EnableEurekaServer @SpringBootApplication public class EurekaApplication { public static void main(String[] args) { SpringApplication.run(EurekaApplication.class,args); } }
[ "18772101110@163.com" ]
18772101110@163.com
ab37d2b835329184bbf16ea29e56890e7d5ed2d2
828b5327357d0fb4cb8f3b4472f392f3b8b10328
/flink-runtime/src/test/java/org/apache/flink/runtime/io/network/partition/consumer/InputChannelBuilder.java
05d0f4b62f78a52d7a68523d9d58b0cc8ac6c744
[ "CC-BY-3.0", "LicenseRef-scancode-unknown-license-reference", "Unlicense", "ISC", "MIT-0", "GPL-2.0-only", "BSD-2-Clause-Views", "OFL-1.1", "Apache-2.0", "LicenseRef-scancode-jdom", "GCC-exception-3.1", "MPL-2.0", "CC-PDDC", "AGPL-3.0-only", "MPL-2.0-no-copyleft-exception", "LicenseRef-scancode-public-domain", "LGPL-2.1-only", "BSD-2-Clause", "CDDL-1.1", "CDDL-1.0", "LicenseRef-scancode-other-permissive", "LicenseRef-scancode-proprietary-license", "BSD-3-Clause", "MIT", "EPL-1.0", "LicenseRef-scancode-warranty-disclaimer", "LicenseRef-scancode-free-unknown", "CC0-1.0", "Classpath-exception-2.0", "CC-BY-2.5" ]
permissive
Romance-Zhang/flink_tpc_ds_game
7e82d801ebd268d2c41c8e207a994700ed7d28c7
8202f33bed962b35c81c641a05de548cfef6025f
refs/heads/master
2022-11-06T13:24:44.451821
2019-09-27T09:22:29
2019-09-27T09:22:29
211,280,838
0
1
Apache-2.0
2022-10-06T07:11:45
2019-09-27T09:11:11
Java
UTF-8
Java
false
false
5,613
java
/* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org.apache.flink.runtime.io.network.partition.consumer; import org.apache.flink.core.memory.MemorySegmentProvider; import org.apache.flink.runtime.io.network.ConnectionID; import org.apache.flink.runtime.io.network.ConnectionManager; import org.apache.flink.runtime.io.network.LocalConnectionManager; import org.apache.flink.runtime.io.network.NettyShuffleEnvironment; import org.apache.flink.runtime.io.network.TaskEventDispatcher; import org.apache.flink.runtime.io.network.TaskEventPublisher; import org.apache.flink.runtime.io.network.metrics.InputChannelMetrics; import org.apache.flink.runtime.io.network.partition.InputChannelTestUtils; import org.apache.flink.runtime.io.network.partition.ResultPartitionID; import org.apache.flink.runtime.io.network.partition.ResultPartitionManager; import java.net.InetSocketAddress; /** * Builder for various {@link InputChannel} types. */ public class InputChannelBuilder { public static final ConnectionID STUB_CONNECTION_ID = new ConnectionID(new InetSocketAddress("localhost", 5000), 0); private int channelIndex = 0; private ResultPartitionID partitionId = new ResultPartitionID(); private ConnectionID connectionID = STUB_CONNECTION_ID; private ResultPartitionManager partitionManager = new ResultPartitionManager(); private TaskEventPublisher taskEventPublisher = new TaskEventDispatcher(); private ConnectionManager connectionManager = new LocalConnectionManager(); private int initialBackoff = 0; private int maxBackoff = 0; private InputChannelMetrics metrics = InputChannelTestUtils.newUnregisteredInputChannelMetrics(); private MemorySegmentProvider memorySegmentProvider = InputChannelTestUtils.StubMemorySegmentProvider.getInstance(); public static InputChannelBuilder newBuilder() { return new InputChannelBuilder(); } public InputChannelBuilder setChannelIndex(int channelIndex) { this.channelIndex = channelIndex; return this; } public InputChannelBuilder setPartitionId(ResultPartitionID partitionId) { this.partitionId = partitionId; return this; } public InputChannelBuilder setPartitionManager(ResultPartitionManager partitionManager) { this.partitionManager = partitionManager; return this; } InputChannelBuilder setTaskEventPublisher(TaskEventPublisher taskEventPublisher) { this.taskEventPublisher = taskEventPublisher; return this; } public InputChannelBuilder setConnectionManager(ConnectionManager connectionManager) { this.connectionManager = connectionManager; return this; } public InputChannelBuilder setInitialBackoff(int initialBackoff) { this.initialBackoff = initialBackoff; return this; } public InputChannelBuilder setMaxBackoff(int maxBackoff) { this.maxBackoff = maxBackoff; return this; } public InputChannelBuilder setMetrics(InputChannelMetrics metrics) { this.metrics = metrics; return this; } public InputChannelBuilder setMemorySegmentProvider(MemorySegmentProvider memorySegmentProvider) { this.memorySegmentProvider = memorySegmentProvider; return this; } InputChannelBuilder setupFromNettyShuffleEnvironment(NettyShuffleEnvironment network) { this.partitionManager = network.getResultPartitionManager(); this.connectionManager = network.getConnectionManager(); this.initialBackoff = network.getConfiguration().partitionRequestInitialBackoff(); this.maxBackoff = network.getConfiguration().partitionRequestMaxBackoff(); this.memorySegmentProvider = network.getNetworkBufferPool(); return this; } UnknownInputChannel buildUnknownAndSetToGate(SingleInputGate inputGate) { UnknownInputChannel channel = new UnknownInputChannel( inputGate, channelIndex, partitionId, partitionManager, taskEventPublisher, connectionManager, initialBackoff, maxBackoff, metrics, memorySegmentProvider); inputGate.setInputChannel(partitionId.getPartitionId(), channel); return channel; } public LocalInputChannel buildLocalAndSetToGate(SingleInputGate inputGate) { LocalInputChannel channel = new LocalInputChannel( inputGate, channelIndex, partitionId, partitionManager, taskEventPublisher, initialBackoff, maxBackoff, metrics); inputGate.setInputChannel(partitionId.getPartitionId(), channel); return channel; } public RemoteInputChannel buildRemoteAndSetToGate(SingleInputGate inputGate) { RemoteInputChannel channel = new RemoteInputChannel( inputGate, channelIndex, partitionId, connectionID, connectionManager, initialBackoff, maxBackoff, metrics, memorySegmentProvider); inputGate.setInputChannel(partitionId.getPartitionId(), channel); return channel; } }
[ "1003761104@qq.com" ]
1003761104@qq.com
6c49ab286555050263a6a73e379248fcce343068
342f4fb9fede1cde073c8a55885200cd94f631e3
/runtime/citrus-testng/src/test/java/com/consol/citrus/integration/container/CustomContainerJavaIT.java
6424447c32d57d1fb46218ddd9009dbcb19f059a
[ "Apache-2.0" ]
permissive
chokdee/citrus
f2b835006a17282f4fb67c32420ed9da45bf5a2b
ceb9e6865bbfdaa3bd3aebc7014e6cc663cbc480
refs/heads/main
2022-10-06T11:28:34.577786
2022-09-27T09:12:06
2022-09-27T09:12:06
478,950,626
0
0
Apache-2.0
2022-04-07T11:17:04
2022-04-07T11:17:03
null
UTF-8
Java
false
false
2,018
java
/* * Copyright 2006-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 * * 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.consol.citrus.integration.container; import com.consol.citrus.TestActionContainerBuilder; import com.consol.citrus.annotations.CitrusTest; import com.consol.citrus.container.AbstractActionContainer; import com.consol.citrus.context.TestContext; import com.consol.citrus.testng.spring.TestNGCitrusSpringSupport; import org.testng.annotations.Test; import static com.consol.citrus.AbstractTestContainerBuilder.container; import static com.consol.citrus.actions.CreateVariablesAction.Builder.createVariable; import static com.consol.citrus.actions.EchoAction.Builder.echo; /** * @author Christoph Deppisch * @since 2.6 */ @Test public class CustomContainerJavaIT extends TestNGCitrusSpringSupport { @CitrusTest public void shouldExecuteReverseContainer() { run(reverse().actions( echo("${text}"), echo("Does it work?"), createVariable("text", "Yes it works!") )); } public TestActionContainerBuilder<ReverseActionContainer, ?> reverse() { return container(new ReverseActionContainer()); } private static class ReverseActionContainer extends AbstractActionContainer { @Override public void doExecute(TestContext context) { for (int i = getActions().size(); i > 0; i--) { executeAction(getActions().get(i - 1), context); } } } }
[ "cdeppisch@redhat.com" ]
cdeppisch@redhat.com
f4c27334a3ebd0be7d85f082c79c69ed5e8054fc
4a10dc8955f9d4479b783d37155c73634f069a79
/app/src/main/java/com/itislevel/lyl/mvp/ui/main/dynamic/childfragment/message/MessageContract.java
9bd808a6742d31c505ca3f5f5c04bcfb20dc38b7
[]
no_license
hyb1234hi/yby1
41f2eb123d96f8a55728b11aeaf42271e782cc08
5f106784715ee616ea6bb0e93a5ed214ad5b1352
refs/heads/master
2020-06-19T10:58:08.674182
2018-07-11T11:22:21
2018-07-11T11:22:21
null
0
0
null
null
null
null
UTF-8
Java
false
false
593
java
package com.itislevel.lyl.mvp.ui.main.dynamic.childfragment.message; import com.itislevel.lyl.base.BasePresenter; import com.itislevel.lyl.base.BaseView; import com.itislevel.lyl.mvp.model.bean.MessageBean; /** * Created by Administrator on 2018\6\15 0015. */ public interface MessageContract { interface View extends BaseView { void myDyPushList(MessageBean action); void clearMyDyPushList(String action); } interface Presenter extends BasePresenter<View> { void myDyPushList(String data); void clearMyDyPushList(String data); } }
[ "1363826037@qq.com" ]
1363826037@qq.com
2f902ae107c18a703842966b77195f2daf07fa65
b29f8299ea8a717cd68b792015a8f75b916c3c81
/app/src/main/java/com/coolweather/android/gson/Basic.java
7587bb2c2e3e51301803afc5a18410d9341787be
[ "Apache-2.0" ]
permissive
Dewuoduo/coolweather
04233749cc23ed6fa4418747b3f82c85fda235da
0453cc043041b47c9c2ca9ff85704ce8d589ed71
refs/heads/master
2020-03-25T16:58:51.369182
2018-08-09T06:22:44
2018-08-09T06:22:44
143,957,249
0
0
null
null
null
null
UTF-8
Java
false
false
390
java
package com.coolweather.android.gson; import com.google.gson.annotations.SerializedName; /** * Created by dw on 2018/8/8. */ public class Basic { @SerializedName("city") public String cityName; @SerializedName("id") public String weatherId; public Update update; public class Update { @SerializedName("loc") public String updateTime; } }
[ "tony@gmail.com" ]
tony@gmail.com
5ebef708055936013c68c16d38eda25d75289cc1
6b2a8dd202fdce77c971c412717e305e1caaac51
/solutions_5686275109552128_0/java/twds/Main.java
7e2774ccaf60e088321a58d0946ce8270abc794a
[]
no_license
alexandraback/datacollection
0bc67a9ace00abbc843f4912562f3a064992e0e9
076a7bc7693f3abf07bfdbdac838cb4ef65ccfcf
refs/heads/master
2021-01-24T18:27:24.417992
2017-05-23T09:23:38
2017-05-23T09:23:38
84,313,442
2
4
null
null
null
null
UTF-8
Java
false
false
1,973
java
import java.io.BufferedReader; import java.io.InputStream; import java.io.InputStreamReader; import java.util.InputMismatchException; import java.util.StringTokenizer; public class Main { public static void main(String[] args) throws Exception { FastScanner scan = new FastScanner(System.in); int taskCount = scan.nextInt(); for (int taskIndex = 1; taskIndex <= taskCount; ++taskIndex) { int D = scan.nextInt(); int[] arr = new int[D]; for (int i = 0; i < D; ++i) { arr[i] = scan.nextInt(); } int res = Integer.MAX_VALUE; for (int eat = 1; eat <= 1000; ++eat) { int temp = eat; for (int num : arr) { temp += (num + eat - 1) / eat - 1; } res = Math.min(res, temp); } System.out.println(String.format("Case #%d: %d", taskIndex, res)); } } } class FastScanner { BufferedReader in; StringTokenizer tok; public FastScanner(InputStream in) { this.in = new BufferedReader(new InputStreamReader(in)); tok = new StringTokenizer(""); } private String tryReadNextLine() { try { return in.readLine(); } catch (Exception e) { throw new InputMismatchException(); } } public String nextToken() { while (!tok.hasMoreTokens()) { tok = new StringTokenizer(nextLine()); } return tok.nextToken(); } public String nextLine() { String newLine = tryReadNextLine(); if (newLine == null) throw new InputMismatchException(); return newLine; } public int nextInt() { return Integer.parseInt(nextToken()); } public long nextLong() { return Long.parseLong(nextToken()); } }
[ "eewestman@gmail.com" ]
eewestman@gmail.com
d384e4b34ff2c20c6813dbb716787a8104921b84
75b91f4c4df2b6df361426b3c547c44053b86943
/jfw-core/src/main/java/org/jfw/core/code/generator/annotations/orm/UpdateSql.java
e33264d74d58d2f253e02c2ad8bff563ed37dedf
[ "Apache-2.0" ]
permissive
saga810203/jfw
764cf3e8430c2756f7e02b62e91c967913bade8c
5e9fe09f69539add1ba0bec74d3a8dd1ae97a15c
refs/heads/master
2021-01-17T13:33:45.680800
2016-04-14T06:20:13
2016-04-14T06:20:13
41,295,741
0
0
null
null
null
null
UTF-8
Java
false
false
696
java
package org.jfw.core.code.generator.annotations.orm; import java.lang.annotation.ElementType; import java.lang.annotation.Retention; import java.lang.annotation.RetentionPolicy; import java.lang.annotation.Target; import org.jfw.core.code.MethodCodeGenerator; import org.jfw.core.code.generator.annotations.handler.orm.UpdateSqlMG; @Target(ElementType.METHOD) @Retention(RetentionPolicy.RUNTIME) public @interface UpdateSql { String value(); SqlVal[] sqlvalue() default {}; SqlVal[] where() default{}; boolean dynamicWhere() default false; boolean bulidMehtod() default true; Class<? extends MethodCodeGenerator> buildHandleClass() default UpdateSqlMG.class; }
[ "pengjia@isoftstone.com" ]
pengjia@isoftstone.com
a55646738b0841502e5425293b63fe3c6021573e
81c48ccdb639908df63cd5f90b4cb49449f30e1d
/haox-kerb/kerb-server/src/main/java/org/apache/kerberos/kerb/server/replay/RequestRecord.java
4f1dd846a2ac9edaba77625afc45a1be3b3c9437
[ "Apache-2.0" ]
permissive
HazelChen/directory-kerberos
595e70f652a695278018ac8b4ebee30d37232fdc
5e7a14455c8184bf1590fc2865345a2ff98431fe
refs/heads/master
2020-12-30T14:56:29.674154
2015-01-15T08:36:03
2015-01-15T08:36:03
29,284,549
0
0
null
null
null
null
UTF-8
Java
false
false
2,141
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.kerberos.kerb.server.replay; public class RequestRecord { private String clientPrincipal; private String serverPrincipal; private long requestTime; private int microseconds; public RequestRecord(String clientPrincipal, String serverPrincipal, long requestTime, int microseconds) { this.clientPrincipal = clientPrincipal; this.serverPrincipal = serverPrincipal; this.requestTime = requestTime; this.microseconds = microseconds; } @Override public boolean equals(Object o) { if (this == o) return true; if (o == null || getClass() != o.getClass()) return false; RequestRecord that = (RequestRecord) o; if (microseconds != that.microseconds) return false; if (requestTime != that.requestTime) return false; if (!clientPrincipal.equals(that.clientPrincipal)) return false; if (!serverPrincipal.equals(that.serverPrincipal)) return false; return true; } @Override public int hashCode() { int result = clientPrincipal.hashCode(); result = 31 * result + serverPrincipal.hashCode(); result = 31 * result + (int) (requestTime ^ (requestTime >>> 32)); result = 31 * result + microseconds; return result; } }
[ "drankye@gmail.com" ]
drankye@gmail.com
8db7a738ad1969dd535a2e816b19f558b160210f
7ab92409f96c6069b1273ef5bc2edd051db035d5
/app/src/main/java/com/yydcdut/note/service/CheckService.java
399748dd925167280d628ff1e14d8ada9cf510b9
[ "LicenseRef-scancode-warranty-disclaimer", "Apache-2.0" ]
permissive
pranavlathigara/PhotoNoter
3cb1873fefe84ce76c249726226449e6d42c3c20
15ee22e79e4e03377e18fc96584949eee8efcfc0
refs/heads/master
2021-01-17T07:36:19.857810
2015-11-18T06:46:54
2015-11-18T06:46:54
46,425,807
1
2
null
2015-11-18T14:57:44
2015-11-18T14:57:44
null
UTF-8
Java
false
false
4,343
java
package com.yydcdut.note.service; import android.app.Service; import android.content.Intent; import android.os.Handler; import android.os.IBinder; import android.os.Message; import android.support.annotation.Nullable; import com.yydcdut.note.NoteApplication; import com.yydcdut.note.bean.Category; import com.yydcdut.note.bean.PhotoNote; import com.yydcdut.note.model.CategoryDBModel; import com.yydcdut.note.model.PhotoNoteDBModel; import com.yydcdut.note.utils.Const; import com.yydcdut.note.utils.FilePathUtils; import java.util.List; import java.util.concurrent.atomic.AtomicInteger; /** * Created by yuyidong on 15/7/17. */ public class CheckService extends Service { private static final int QUITE = 2; private static final int ADD = 1; private AtomicInteger mNumber = new AtomicInteger(0); @Nullable @Override public IBinder onBind(Intent intent) { return null; } private Handler mHandler = new Handler() { @Override public void handleMessage(Message msg) { switch (msg.what) { case ADD: stopService(mNumber.incrementAndGet()); break; } } }; @Override public void onCreate() { super.onCreate(); NoteApplication.getInstance().getExecutorPool().execute(new Runnable() { @Override public void run() { checkCategoryPhotoNumber(); checkBigAndSmallPhoto(); } }); } /** * 判断category中的pootonumber是否正确 */ private void checkCategoryPhotoNumber() { List<Category> categoryList = CategoryDBModel.getInstance().findAll(); boolean isChanged = false; for (Category category : categoryList) { List<PhotoNote> photoNoteList = PhotoNoteDBModel.getInstance().findByCategoryLabel(category.getLabel(), -1); if (category.getPhotosNumber() != photoNoteList.size()) { category.setPhotosNumber(photoNoteList.size()); isChanged = true; } } if (isChanged) { CategoryDBModel.getInstance().updateCategoryListInService(categoryList); } mHandler.sendEmptyMessage(ADD); } /** * 判断大图片和小图片是否同时存在 */ private void checkBigAndSmallPhoto() { //大图不在&小图在&数据库在,说明可能是人为删除的,所以同时把小图和数据库中的数据删除 //小图不在&大图在&数据库在,说明可能是系统删除的,所以生成一张小图 //数据库不在&大图小图都在,删除大图小图 List<Category> categoryList = CategoryDBModel.getInstance().findAll(); for (Category category : categoryList) { List<PhotoNote> photoNoteList = PhotoNoteDBModel.getInstance().findByCategoryLabel(category.getLabel(), -1); for (int i = 0; i < photoNoteList.size(); i++) { PhotoNote photoNote = photoNoteList.get(i); int result = FilePathUtils.isFileExist(photoNote.getPhotoName()); switch (result) { case FilePathUtils.ALL_NOT_EXIST: case FilePathUtils.BIG_PHOTO_NOT_EXIST: // java.util.ConcurrentModificationException PhotoNoteDBModel.getInstance().delete(photoNote); FilePathUtils.deleteAllFiles(photoNote.getPhotoName()); break; case FilePathUtils.SMALL_PHOTO_NOT_EXIST: FilePathUtils.saveSmallPhotoFromBigPhoto(photoNote); break; case FilePathUtils.ALL_EXIST: default: break; } } } mHandler.sendEmptyMessage(ADD); } /** * 退出 * * @param number 当值满足为QUITE的时候退出 */ private void stopService(int number) { if (number == QUITE) { Intent intent = new Intent(); intent.setAction(Const.BROADCAST_PHOTONOTE_UPDATE); intent.putExtra(Const.TARGET_BROADCAST_SERVICE, true); sendBroadcast(intent); stopSelf(); } } }
[ "378040621@qq.com" ]
378040621@qq.com
c6f00646207e66b3b8e2d17faa2987932e2a5027
1ca86d5d065372093c5f2eae3b1a146dc0ba4725
/core-java-modules/core-java-9-new-features/src/modules/com.baeldung.httpclient/com/surya/httpclient/HttpClientExample.java
a3521abad5369f85c347ae87310ea5f3e7fcf03d
[]
no_license
Suryakanta97/DemoExample
1e05d7f13a9bc30f581a69ce811fc4c6c97f2a6e
5c6b831948e612bdc2d9d578a581df964ef89bfb
refs/heads/main
2023-08-10T17:30:32.397265
2021-09-22T16:18:42
2021-09-22T16:18:42
391,087,435
0
1
null
null
null
null
UTF-8
Java
false
false
3,472
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.surya.httpclient; import java.io.File; import java.io.IOException; import java.net.URI; import java.net.URISyntaxException; import java.nio.file.Paths; import java.util.Arrays; import java.util.List; import java.util.concurrent.CompletableFuture; import java.util.stream.Collectors; import jdk.incubator.http.HttpClient; import jdk.incubator.http.HttpRequest; import jdk.incubator.http.HttpRequest.BodyProcessor; import jdk.incubator.http.HttpResponse; import jdk.incubator.http.HttpResponse.BodyHandler; /** * * @author pkaria */ public class HttpClientExample { public static void main(String[] args) throws Exception { httpGetRequest(); httpPostRequest(); asynchronousRequest(); asynchronousMultipleRequests(); } public static void httpGetRequest() throws URISyntaxException, IOException, InterruptedException { HttpClient client = HttpClient.newHttpClient(); URI httpURI = new URI("http://jsonplaceholder.typicode.com/posts/1"); HttpRequest request = HttpRequest.newBuilder(httpURI).GET() .headers("Accept-Enconding", "gzip, deflate").build(); HttpResponse<String> response = client.send(request, HttpResponse.BodyHandler.asString()); String responseBody = response.body(); int responseStatusCode = response.statusCode(); System.out.println(responseBody); } public static void httpPostRequest() throws URISyntaxException, IOException, InterruptedException { HttpClient client = HttpClient .newBuilder() .build(); HttpRequest request = HttpRequest .newBuilder(new URI("http://jsonplaceholder.typicode.com/posts")) .POST(BodyProcessor.fromString("Sample Post Request")) .build(); HttpResponse<String> response = client.send(request, HttpResponse.BodyHandler.asString()); String responseBody = response.body(); System.out.println(responseBody); } public static void asynchronousRequest() throws URISyntaxException { HttpClient client = HttpClient.newHttpClient(); URI httpURI = new URI("http://jsonplaceholder.typicode.com/posts/1"); HttpRequest request = HttpRequest.newBuilder(httpURI).GET().build(); CompletableFuture<HttpResponse<String>> futureResponse = client.sendAsync(request, HttpResponse.BodyHandler.asString()); } public static void asynchronousMultipleRequests() throws URISyntaxException { List<URI> targets = Arrays.asList(new URI("http://jsonplaceholder.typicode.com/posts/1"), new URI("http://jsonplaceholder.typicode.com/posts/2")); HttpClient client = HttpClient.newHttpClient(); List<CompletableFuture<File>> futures = targets .stream() .map(target -> client .sendAsync( HttpRequest.newBuilder(target) .GET() .build(), BodyHandler.asFile(Paths.get("base", target.getPath()))) .thenApply(response -> response.body()) .thenApply(path -> path.toFile())) .collect(Collectors.toList()); } }
[ "suryakanta97@github.com" ]
suryakanta97@github.com
9694ce7038114665afde238be2822ba228199d00
536f53c182c706cee53e1c8fe117351f512c2e58
/core/src/main/java/com/toan_itc/data/libs/reactivenetwork/Connectivity.java
3da4523a261f812afb5b31d974fa19ff90a2ddfd
[]
no_license
AndroidProject24/BaoOnline
9711115f3dd09b48ef7626f6969902bdff8598d6
88f7485f8ca00be8a7e379bb0827264ef4e55847
refs/heads/master
2020-04-03T22:07:16.953494
2017-05-14T04:57:57
2017-05-14T04:57:57
58,562,362
2
0
null
null
null
null
UTF-8
Java
false
false
7,819
java
/* * Copyright (C) 2016 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.toan_itc.data.libs.reactivenetwork; import android.content.Context; import android.net.ConnectivityManager; import android.net.NetworkInfo; /** * Connectivity class represents current connectivity status. It wraps NetworkInfo object. */ public class Connectivity { private NetworkInfo.State state; private NetworkInfo.DetailedState detailedState; private int type; private int subType; private boolean available; private boolean failover; private boolean roaming; private String typeName; private String subTypeName; private String reason; private String extraInfo; public static Connectivity create() { return new Builder().build(); } public static Connectivity create(Context context) { Preconditions.checkNotNull(context, "context == null"); final NetworkInfo networkInfo = getNetworkInfo(context); return (networkInfo == null) ? create() : create(networkInfo); } private static Connectivity create(NetworkInfo networkInfo) { return new Builder().state(networkInfo.getState()) .detailedState(networkInfo.getDetailedState()) .type(networkInfo.getType()) .subType(networkInfo.getSubtype()) .available(networkInfo.isAvailable()) .failover(networkInfo.isFailover()) .roaming(networkInfo.isRoaming()) .typeName(networkInfo.getTypeName()) .subTypeName(networkInfo.getSubtypeName()) .reason(networkInfo.getReason()) .extraInfo(networkInfo.getExtraInfo()) .build(); } protected Connectivity() { } protected Connectivity(Builder builder) { state = builder.state; detailedState = builder.detailedState; type = builder.type; subType = builder.subType; available = builder.available; failover = builder.failover; roaming = builder.roaming; typeName = builder.typeName; subTypeName = builder.subTypeName; reason = builder.reason; extraInfo = builder.extraInfo; } private static NetworkInfo getNetworkInfo(final Context context) { final String service = Context.CONNECTIVITY_SERVICE; final ConnectivityManager manager = (ConnectivityManager) context.getSystemService(service); return manager.getActiveNetworkInfo(); } public NetworkInfo.State getState() { return state; } public NetworkInfo.DetailedState getDetailedState() { return detailedState; } public int getType() { return type; } public int getSubType() { return subType; } public boolean isAvailable() { return available; } public boolean isFailover() { return failover; } public boolean isRoaming() { return roaming; } public String getTypeName() { return typeName; } public String getSubTypeName() { return subTypeName; } public String getReason() { return reason; } public String getExtraInfo() { return extraInfo; } @Override public boolean equals(Object o) { if (this == o) { return true; } if (o == null || getClass() != o.getClass()) { return false; } Connectivity that = (Connectivity) o; if (type != that.type) { return false; } if (subType != that.subType) { return false; } if (available != that.available) { return false; } if (failover != that.failover) { return false; } if (roaming != that.roaming) { return false; } if (state != that.state) { return false; } if (detailedState != that.detailedState) { return false; } if (!typeName.equals(that.typeName)) { return false; } if (subTypeName != null ? !subTypeName.equals(that.subTypeName) : that.subTypeName != null) { return false; } if (reason != null ? !reason.equals(that.reason) : that.reason != null) { return false; } return extraInfo != null ? extraInfo.equals(that.extraInfo) : that.extraInfo == null; } @Override public int hashCode() { int result = state.hashCode(); result = 31 * result + (detailedState != null ? detailedState.hashCode() : 0); result = 31 * result + type; result = 31 * result + subType; result = 31 * result + (available ? 1 : 0); result = 31 * result + (failover ? 1 : 0); result = 31 * result + (roaming ? 1 : 0); result = 31 * result + typeName.hashCode(); result = 31 * result + (subTypeName != null ? subTypeName.hashCode() : 0); result = 31 * result + (reason != null ? reason.hashCode() : 0); result = 31 * result + (extraInfo != null ? extraInfo.hashCode() : 0); return result; } @Override public String toString() { return "Connectivity{" + "state=" + state + ", detailedState=" + detailedState + ", type=" + type + ", subType=" + subType + ", available=" + available + ", failover=" + failover + ", roaming=" + roaming + ", typeName='" + typeName + '\'' + ", subTypeName='" + subTypeName + '\'' + ", reason='" + reason + '\'' + ", extraInfo='" + extraInfo + '\'' + '}'; } public static class Builder { // disabling PMD for builder class attributes // because we want to have the same method names as names of the attributes for builder private NetworkInfo.State state = NetworkInfo.State.DISCONNECTED; // NOPMD private NetworkInfo.DetailedState detailedState = NetworkInfo.DetailedState.IDLE; // NOPMD private int type = -1; // NOPMD private int subType = -1; // NOPMD private boolean available = false; // NOPMD private boolean failover = false; // NOPMD private boolean roaming = false; // NOPMD private String typeName = "NONE"; // NOPMD private String subTypeName = "NONE"; // NOPMD private String reason = ""; // NOPMD private String extraInfo = ""; // NOPMD public Builder state(NetworkInfo.State state) { this.state = state; return this; } public Builder detailedState(NetworkInfo.DetailedState detailedState) { this.detailedState = detailedState; return this; } public Builder type(int type) { this.type = type; return this; } public Builder subType(int subType) { this.subType = subType; return this; } public Builder available(boolean available) { this.available = available; return this; } public Builder failover(boolean failover) { this.failover = failover; return this; } public Builder roaming(boolean roaming) { this.roaming = roaming; return this; } public Builder typeName(String name) { this.typeName = name; return this; } public Builder subTypeName(String subTypeName) { this.subTypeName = subTypeName; return this; } public Builder reason(String reason) { this.reason = reason; return this; } public Builder extraInfo(String extraInfo) { this.extraInfo = extraInfo; return this; } public Connectivity build() { return new Connectivity(this); } } }
[ "huynhvantoan.itc@gmail.com" ]
huynhvantoan.itc@gmail.com
c1019e6930ea760ef52460b01b44d256e59ce86a
f766baf255197dd4c1561ae6858a67ad23dcda68
/app/src/main/java/com/tencent/mm/plugin/webview/ui/tools/jsapi/a.java
2e821c109c952aae36e599211ade8b402b5a9883
[]
no_license
jianghan200/wxsrc6.6.7
d83f3fbbb77235c7f2c8bc945fa3f09d9bac3849
eb6c56587cfca596f8c7095b0854cbbc78254178
refs/heads/master
2020-03-19T23:40:49.532494
2018-06-12T06:00:50
2018-06-12T06:00:50
137,015,278
4
2
null
null
null
null
UTF-8
Java
false
false
429
java
package com.tencent.mm.plugin.webview.ui.tools.jsapi; import java.util.HashSet; import java.util.Set; public final class a { public static final Set<String> qgW = new HashSet() {}; } /* Location: /Users/Han/Desktop/wxall/微信反编译/反编译 6.6.7/dex2jar-2.0/classes5-dex2jar.jar!/com/tencent/mm/plugin/webview/ui/tools/jsapi/a.class * Java compiler version: 6 (50.0) * JD-Core Version: 0.7.1 */
[ "526687570@qq.com" ]
526687570@qq.com
656dbe3d6935504d275e7876ac0261db3dffb09e
1be6e27b6ad97d3b3559d815140426018335dcc1
/gajigaksek-backend/src/main/java/com/gjgs/gjgs/modules/utils/response/SuccessResponse.java
923d85b925965ee43f7c02a46165b10e3d734c14
[]
no_license
JoeCP17/gjgs
0711cff1f19193e07a5500891a4d65410e504834
5c5365de794e9bfc20257dc436161b8bd42ce119
refs/heads/master
2023-08-29T04:55:38.010327
2021-11-08T08:08:13
2021-11-08T08:08:13
null
0
0
null
null
null
null
UTF-8
Java
false
false
1,166
java
package com.gjgs.gjgs.modules.utils.response; import lombok.*; import org.springframework.http.HttpStatus; import java.time.LocalDateTime; @Getter @Setter @NoArgsConstructor(access = AccessLevel.PROTECTED) @AllArgsConstructor @Builder public class SuccessResponse<T> { private static final String SUCCESS = "SUCCESS"; private LocalDateTime time; private int status; private String message; private T data; public static SuccessResponse of() { return getSuccessResponse(); } private static SuccessResponse getSuccessResponse() { return SuccessResponse.builder() .status(HttpStatus.OK.value()) .message(SUCCESS) .time(LocalDateTime.now()) .build(); } public static <T> SuccessResponse of(T dto) { return getSuccessResponse(dto); } private static <T> SuccessResponse getSuccessResponse(T dto) { return SuccessResponse.builder() .status(HttpStatus.OK.value()) .message(SUCCESS) .time(LocalDateTime.now()) .data(dto) .build(); } }
[ "cjs1863@gmail.com" ]
cjs1863@gmail.com
a4f35ed23b2d726dec1d511782c50296dbf87d3e
801ea23bf1e788dee7047584c5c26d99a4d0b2e3
/com/planet_ink/coffee_mud/Abilities/Prayers/Prayer_Annul.java
7419ebd3d9d2040d01cb57d458b4f32409a625e0
[ "Apache-2.0" ]
permissive
Tearstar/CoffeeMud
61136965ccda651ff50d416b6c6af7e9a89f5784
bb1687575f7166fb8418684c45f431411497cef9
refs/heads/master
2021-01-17T20:23:57.161495
2014-10-18T08:03:37
2014-10-18T08:03:37
null
0
0
null
null
null
null
UTF-8
Java
false
false
3,655
java
package com.planet_ink.coffee_mud.Abilities.Prayers; import com.planet_ink.coffee_mud.core.interfaces.*; import com.planet_ink.coffee_mud.core.*; import com.planet_ink.coffee_mud.core.collections.*; import com.planet_ink.coffee_mud.Abilities.interfaces.*; import com.planet_ink.coffee_mud.Areas.interfaces.*; import com.planet_ink.coffee_mud.Behaviors.interfaces.*; import com.planet_ink.coffee_mud.CharClasses.interfaces.*; import com.planet_ink.coffee_mud.Commands.interfaces.*; import com.planet_ink.coffee_mud.Common.interfaces.*; import com.planet_ink.coffee_mud.Exits.interfaces.*; import com.planet_ink.coffee_mud.Items.interfaces.*; import com.planet_ink.coffee_mud.Libraries.interfaces.*; import com.planet_ink.coffee_mud.Locales.interfaces.*; import com.planet_ink.coffee_mud.MOBS.interfaces.*; import com.planet_ink.coffee_mud.Races.interfaces.*; import java.util.*; /* Copyright 2004-2014 Bo Zimmerman 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. */ @SuppressWarnings("rawtypes") public class Prayer_Annul extends Prayer { @Override public String ID() { return "Prayer_Annul"; } private final static String localizedName = CMLib.lang().L("Annul"); @Override public String name() { return localizedName; } @Override public int classificationCode(){return Ability.ACODE_PRAYER|Ability.DOMAIN_NEUTRALIZATION;} @Override public long flags(){return Ability.FLAG_HOLY|Ability.FLAG_UNHOLY;} @Override public int abstractQuality(){return Ability.QUALITY_OK_OTHERS;} @Override public boolean invoke(MOB mob, Vector commands, Physical givenTarget, boolean auto, int asLevel) { final MOB target=getTarget(mob,commands,givenTarget); if(target==null) return false; if(!target.isMarriedToLiege()) { mob.tell(L("@x1 is not married!",target.name(mob))); return false; } if(target.fetchItem(null,Wearable.FILTER_WORNONLY,"wedding band")!=null) { mob.tell(L("@x1 must remove the wedding band first.",target.name(mob))); return false; } if(!super.invoke(mob,commands,givenTarget,auto,asLevel)) return false; final boolean success=proficiencyCheck(mob,0,auto); if(success) { final CMMsg msg=CMClass.getMsg(mob,target,this,verbalCastCode(mob,target,auto),auto?"":L("^S<S-NAME> annul(s) the marriage between <T-NAMESELF> and @x1.^?",target.getLiegeID())); if(mob.location().okMessage(mob,msg)) { if((!target.isMonster())&&(target.soulMate()==null)) CMLib.coffeeTables().bump(target,CoffeeTableRow.STAT_DIVORCES); mob.location().send(mob,msg); final List<String> channels=CMLib.channels().getFlaggedChannelNames(ChannelsLibrary.ChannelFlag.DIVORCES); for(int i=0;i<channels.size();i++) CMLib.commands().postChannel(channels.get(i),mob.clans(),target.name()+" and "+target.getLiegeID()+" just had their marriage annulled.",true); final MOB M=CMLib.players().getPlayer(target.getLiegeID()); if(M!=null) M.setLiegeID(""); target.setLiegeID(""); } } else beneficialWordsFizzle(mob,target,L("<S-NAME> clear(s) <S-HIS-HER> throat.")); return success; } }
[ "bo@zimmers.net" ]
bo@zimmers.net
78dfb922436735383515a3a46b3b3a7f21976a0b
fa91450deb625cda070e82d5c31770be5ca1dec6
/Diff-Raw-Data/2/2_03299688a58537346545d550a1ca9ed6790a72ac/JSValidatedTextField/2_03299688a58537346545d550a1ca9ed6790a72ac_JSValidatedTextField_t.java
491ea9b2a8e124c8360d9a629775b1bd53183f9d
[]
no_license
zhongxingyu/Seer
48e7e5197624d7afa94d23f849f8ea2075bcaec0
c11a3109fdfca9be337e509ecb2c085b60076213
refs/heads/master
2023-07-06T12:48:55.516692
2023-06-22T07:55:56
2023-06-22T07:55:56
259,613,157
6
2
null
2023-06-22T07:55:57
2020-04-28T11:07:49
null
UTF-8
Java
false
false
4,082
java
package js.incomplete; import java.awt.Color; import java.awt.event.FocusEvent; import java.awt.event.FocusListener; import javax.swing.JLabel; import javax.swing.JTextField; public class JSValidatedTextField extends JTextField implements FocusListener { private static final int PRESENCE_CHECK = 0; private static final int LENGTH_CHECK = 1; private static final int RANGE_CHECK = 2; private static final int FORMAT_CHECK = 3; private int type; private int minLength; private int maxLength; private double minValue; private double maxValue; private String pattern; private boolean auto; private String error; private String name; private JSPopover popover; JSValidatedTextField() { addFocusListener(this); } public static JSValidatedTextField createPresenceCheckField() { JSValidatedTextField field = new JSValidatedTextField(); field.type = PRESENCE_CHECK; return field; } public static JSValidatedTextField createLengthCheckField(int min, int max) { JSValidatedTextField field = new JSValidatedTextField(); field.type = LENGTH_CHECK; field.minLength = min; field.maxLength = max; return field; } public static JSValidatedTextField createRangeCheckField(double min, double max) { JSValidatedTextField field = new JSValidatedTextField(); field.type = RANGE_CHECK; field.minValue = min; field.maxValue = max; return field; } public static JSValidatedTextField createFormatCheckField(String regex) { JSValidatedTextField field = new JSValidatedTextField(); field.type = FORMAT_CHECK; field.pattern = regex; return field; } public void validate() { String text = getText(); boolean failed = false; switch (type) { case PRESENCE_CHECK: if (text.length() == 0) { error = " is required."; failed = true; } break; case LENGTH_CHECK: if (text.length() < minLength) { failed = true; error = " must contain at least " + minLength + " characters."; } else if (text.length() > maxLength) { error = " must contain " + maxLength + " characters or less."; failed = true; } break; case RANGE_CHECK: try { double number = Double.parseDouble(text); if (number < minValue) { error = " must be at least " + minValue + "."; failed = true; } else if (number > maxValue) { error = " must be " + maxValue + " or less."; failed = true; } } catch (NumberFormatException e) { error = " must contain a number."; failed = true; } break; case FORMAT_CHECK: if (! text.matches(pattern)) { error = " is not in the correct format."; failed = true; } break; } if (failed) { if (name != null && name.length() > 0) error = name + error; else error = "This field" + error; } else error = ""; } public boolean passedValidation() { return error.length() == 0; } public void setName(String name) { this.name = name; } public String getName() { return name; } public String getErrorMessage() { return error; } public void setAutoValidationEnabled(boolean state) { auto = state; } public boolean isAutoValidationEnabled() { return auto; } public void focusGained(FocusEvent e) { if (auto && popover != null && popover.isShowing()) popover.setVisible(false); } public void focusLost(FocusEvent e) { if (auto) { validate(); if (! passedValidation()) { popover = new JSPopover(JSPopover.HORIZONTAL); popover.setSize(225, 75); popover.setStrokeColor(new Color(255, 55, 55)); JLabel label = new JLabel(); label.setVerticalAlignment(JLabel.CENTER); label.setVerticalTextPosition(JLabel.CENTER); label.setBounds(5, 5, 205, 45); label.setText("<html>" + error + "</html>"); popover.add(label); popover.setLocation(getLocationOnScreen().x + getWidth(), getLocationOnScreen().y + (getHeight() / 2)); popover.setVisible(true); } } } }
[ "yuzhongxing88@gmail.com" ]
yuzhongxing88@gmail.com
c7fd72dafde34860ff485e73fa82633b1dcce0f9
180e78725121de49801e34de358c32cf7148b0a2
/dataset/protocol1/java-design-patterns/learning/4897/FrontControllerTest.java
d10fe646e268a19421eef2813338d11d2ac963cd
[]
no_license
ASSERT-KTH/synthetic-checkstyle-error-dataset
40e8d1e0a7ebe7f7711def96a390891a6922f7bd
40c057e1669584bfc6fecf789b5b2854660222f3
refs/heads/master
2023-03-18T12:50:55.410343
2019-01-25T09:54:39
2019-01-25T09:54:39
null
0
0
null
null
null
null
UTF-8
Java
false
false
2,620
java
/** * The MIT License * Copyright (c) 2014-2016 Ilkka Seppälä * * 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 com.iluwatar.front.controller; import com.iluwatar.front.controller.utils.InMemoryAppender; import org.junit.jupiter.api.AfterEach; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.params.ParameterizedTest; import org.junit.jupiter.params.provider.MethodSource; import java.util.ArrayList; import java.util.List; import static org.junit.jupiter.api.Assertions.assertEquals; /** * Date: 12/13/15 - 1:39 PM * * @author Jeroen Meulemeester */ public class FrontControllerTest { private InMemoryAppender appender; @BeforeEach public void setUp() { appender = new InMemoryAppender(); } @AfterEach public void tearDown() { appender.stop(); } static List<Object[]> dataProvider() { final List<Object[]> parameters = new ArrayList<>(); parameters.add(new Object[]{new ArcherCommand(), "Displaying archers"}); parameters.add( new Object[]{new CatapultCommand(), "Displaying catapults"}); parameters.add(new Object[]{new UnknownCommand(), "Error 500"}); return parameters; } /** * @param command The command that's been tested * @param displayMessage The expected display message */ @ParameterizedTest @MethodSource("dataProvider") public void testDisplay(Command command, String displayMessage) { assertEquals(0, appender.getLogSize()); command.process(); assertEquals(displayMessage, appender.getLastMessage()); assertEquals(1, appender.getLogSize()); } }
[ "bloriot97@gmail.com" ]
bloriot97@gmail.com
0841485f525afed2004d2722e856cc5ae5ba8063
7ad527bad3bd0d7eb94d1d8a0fe08df67aa26c3e
/软件学院/高级语言程序设计(Java)/答案/Exercise20_10.java
4c433488c0fe2fc3fa1af4b2c8e0edfa4c13f40b
[]
no_license
SCUTMSC/SCUT-Course
67e67ac494aef7fc73de17f61b7fab8450f17952
90f884a9032e951ebc9421cc88ca807b9ec211da
refs/heads/master
2020-07-16T22:22:53.359477
2019-09-07T08:28:09
2019-09-07T08:28:09
205,880,291
10
6
null
null
null
null
UTF-8
Java
false
false
1,000
java
import java.util.*; public class Exercise20_10 { public static void main(String[] args) { PriorityQueue<String> queue1 = new PriorityQueue<String>(Arrays.asList( new String[]{"George", "Jim", "John", "Blake", "Kevin", "Michael"})); PriorityQueue<String> queue2 = new PriorityQueue<String>(Arrays.asList( new String[] {"George", "Katie", "Kevin", "Michelle", "Ryan"})); queue1.addAll(queue2); System.out.println("The union of the two priority queue is " + queue1); queue1 = new PriorityQueue<String>(Arrays.asList( new String[]{"George", "Jim", "John", "Blake", "Kevin", "Michael"})); queue1.removeAll(queue2); System.out.println("The difference of the two priority queue is " + queue1); queue1 = new PriorityQueue<String>(Arrays.asList( new String[]{"George", "Jim", "John", "Blake", "Kevin", "Michael"})); queue1.retainAll(queue2); System.out.println("The intersection of the two priority queue is " + queue1); } }
[ "LotteWong21@gmail.com" ]
LotteWong21@gmail.com
6f6a5a065790123c54bf403d0e019344e8eaf7f3
991839be0130fa34b7b42abd58c531d9bbf25fe0
/rest-json-quickstart/src/test/java/org/acme/rest/json/FruitResourceTest.java
0349477693c44c9c38aac038b8a36e75ba068ce8
[ "Apache-2.0" ]
permissive
rongfengliang/graalvm-native-demo
30ed27d010192a3661ab089d57c498b615e01349
97f2550557f31e6c4bfce9bbce05a64d62017fc6
refs/heads/master
2022-09-03T00:27:56.168006
2019-11-20T06:41:24
2019-11-20T06:41:24
222,704,284
3
0
Apache-2.0
2022-08-30T20:50:06
2019-11-19T13:36:28
Java
UTF-8
Java
false
false
1,644
java
package org.acme.rest.json; import static io.restassured.RestAssured.given; import static org.hamcrest.CoreMatchers.is; import static org.hamcrest.Matchers.containsInAnyOrder; import javax.ws.rs.core.MediaType; import org.junit.jupiter.api.Test; import io.quarkus.test.junit.QuarkusTest; @QuarkusTest public class FruitResourceTest { @Test public void testList() { given() .when().get("/fruits") .then() .statusCode(200) .body("$.size()", is(2), "name", containsInAnyOrder("Apple", "Pineapple"), "description", containsInAnyOrder("Winter fruit", "Tropical fruit")); } @Test public void testAdd() { given() .body("{\"name\": \"Pear\", \"description\": \"Winter fruit\"}") .header("Content-Type", MediaType.APPLICATION_JSON) .when() .post("/fruits") .then() .statusCode(200) .body("$.size()", is(3), "name", containsInAnyOrder("Apple", "Pineapple", "Pear"), "description", containsInAnyOrder("Winter fruit", "Tropical fruit", "Winter fruit")); given() .body("{\"name\": \"Pear\", \"description\": \"Winter fruit\"}") .header("Content-Type", MediaType.APPLICATION_JSON) .when() .delete("/fruits") .then() .statusCode(200) .body("$.size()", is(2), "name", containsInAnyOrder("Apple", "Pineapple"), "description", containsInAnyOrder("Winter fruit", "Tropical fruit")); } }
[ "guillaume.smet@gmail.com" ]
guillaume.smet@gmail.com
1b45a35df7f7b822addadb46c8b5ecdd377da804
569ce95bb1554b653468a86e0a8a9450a4215287
/observer/src/main/java/com/luo/core/Event.java
2a39934a2041688a3282c71bbb3df91a0114c0c7
[]
no_license
RononoaZoro/archer-pattern
bf2449a96e77caae289b51efb0f3575d6549727d
2bb352dcf571892686c3b3e354739b47cd5472a4
refs/heads/master
2022-07-30T21:43:44.248197
2019-11-07T07:47:22
2019-11-07T07:47:22
201,577,210
0
0
null
null
null
null
UTF-8
Java
false
false
1,586
java
package com.luo.core; import java.lang.reflect.Method; /** * 事件 * * @author luoxuzheng * @create 2019-08-13 20:43 **/ public class Event { //事件源 private Object source; //通知对象 private Object target; //回调 private Method callback; //触发 private String trigger; //时间 private long time; public Event(Object target, Method callback) { this.target = target; this.callback = callback; } public Object getSource() { return source; } public Event setSource(Object source) { this.source = source; return this; } public Object getTarget() { return target; } public Event setTarget(Object target) { this.target = target; return this; } public Method getCallback() { return callback; } public void setCallback(Method callback) { this.callback = callback; } public String getTrigger() { return trigger; } public Event setTrigger(String trigger) { this.trigger = trigger; return this; } public long getTime() { return time; } public Event setTime(long time) { this.time = time; return this; } @Override public String toString() { return "Event{" + "\n\tsource=" + source + ",\n" + "\ttarget=" + target + ",\n" + "\tcallback=" + callback + ",\n" + "\ttrigger='" + trigger + '\'' + "\n" + '}'; } }
[ "352907839@qq.com" ]
352907839@qq.com
1c48ad351a9d22b093083a6fa8e12950ca15091e
26a837b93cf73e6c372830f9a7a316c01081a4ea
/core/src/main/java/arez/annotations/package-info.java
fcaadb5706257058f592ba0436e29306ad218700
[ "Apache-2.0" ]
permissive
arez/arez
033b27f529b527c747b2a93f3c2c553c41c32acd
df68d72a69d3af1123e7d7c424f77b74f13f8052
refs/heads/master
2023-06-08T00:09:56.319223
2023-06-05T02:12:14
2023-06-05T02:12:14
96,367,327
13
4
Apache-2.0
2022-12-10T20:29:35
2017-07-05T22:50:24
Java
UTF-8
Java
false
false
183
java
/** * This package contains annotations used by the annotation processor to generate model elements. */ @OmitPattern package arez.annotations; import grim.annotations.OmitPattern;
[ "peter@realityforge.org" ]
peter@realityforge.org
c61f6f5b2a24824f9165b16a5cbc9e843176892d
00e51f2de904cd91f1154b28b2f415488d93916c
/src/leet/_251_300/_252_Meeting_Room.java
e2c89b53a1578ffa9cb49a9d79b0905bc0743291
[]
no_license
LiFangCoding/Leet
1701d8ba44278980eb2c4d758cb3e8cc53e1abef
fe4a31d7ddc9523dba5c0eb9857a2ddc05534bbe
refs/heads/master
2021-06-16T15:41:20.443028
2021-04-14T13:12:39
2021-04-14T13:12:39
189,739,892
0
0
null
null
null
null
UTF-8
Java
false
false
1,012
java
package leet._251_300; import java.util.Arrays; import java.util.Comparator; /** * Given an array of meeting time intervals consisting of start and end times [[s1,e1],[s2,e2],...] (si < ei), determine if a person could attend all meetings. * <p> * Example 1: * <p> * Input: [[0,30],[5,10],[15,20]] * Output: false * Example 2: * <p> * Input: [[7,10],[2,4]] * Output: true * NOTE: input types have been changed on April 15, 2019. Please reset to default code definition to get new method signature. */ public class _252_Meeting_Room { public boolean canAttendMeetings(int[][] intervals) { if (intervals == null || intervals.length == 0) { return true; } Arrays.sort(intervals, Comparator.comparingInt(i -> i[0])); for (int i = 1; i < intervals.length; i++) { if (intervals[i][0] >= intervals[i - 1][1]) { continue; } else { return false; } } return true; } }
[ "fanglihust@gmail.com" ]
fanglihust@gmail.com
9f062895e0d613a3f90f36c729e40b2447d71e23
82bda3ed7dfe2ca722e90680fd396935c2b7a49d
/app-meipai/src/main/java/c/a/a/a/a/i/d.java
e5dfa01f5ae7263c0444aae2ea6a49a2800c20c6
[]
no_license
cvdnn/PanoramaApp
86f8cf36d285af08ba15fb32348423af7f0b7465
dd6bbe0987a46f0b4cfb90697b38f37f5ad47cfc
refs/heads/master
2023-03-03T11:15:40.350476
2021-01-29T09:14:06
2021-01-29T09:14:06
332,968,433
1
1
null
null
null
null
UTF-8
Java
false
false
452
java
package c.a.a.a.a.i; import com.arashivision.insta360.basecamera.camera.BaseCameraController.C0154OooOo0; /* compiled from: lambda */ public final /* synthetic */ class d implements C0154OooOo0 { /* renamed from: a reason: collision with root package name */ private final /* synthetic */ n f1131a; public /* synthetic */ d(n nVar) { this.f1131a = nVar; } public final void OooO00o() { this.f1131a.b(); } }
[ "cvvdnn@gmail.com" ]
cvvdnn@gmail.com
bf5a6cef42dbba9f7546c90338250b4e4cb947e5
967502523508f5bb48fdaac93b33e4c4aca20a4b
/aws-java-sdk-logs/src/main/java/com/amazonaws/services/logs/model/transform/DescribeLogStreamsRequestMarshaller.java
26e27490e0c7ad516915e2780e3809b816a5c933
[ "Apache-2.0", "JSON" ]
permissive
hanjk1234/aws-sdk-java
3ac0d8a9bf6f7d9bf1bc5db8e73a441375df10c0
07da997c6b05ae068230401921860f5e81086c58
refs/heads/master
2021-01-17T18:25:34.913778
2015-10-23T03:20:07
2015-10-23T03:20:07
44,951,249
1
0
null
2015-10-26T06:53:25
2015-10-26T06:53:24
null
UTF-8
Java
false
false
4,263
java
/* * Copyright 2010-2015 Amazon.com, Inc. or its affiliates. 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. * A copy of the License is located at * * http://aws.amazon.com/apache2.0 * * or in the "license" file accompanying this file. This file 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.amazonaws.services.logs.model.transform; import static com.amazonaws.util.StringUtils.UTF8; import static com.amazonaws.util.StringUtils.COMMA_SEPARATOR; import java.io.ByteArrayInputStream; import java.io.ByteArrayOutputStream; import java.io.OutputStreamWriter; import java.io.StringWriter; import java.io.Writer; import java.util.Collections; import java.util.HashMap; import java.util.Map; import java.util.List; import java.util.regex.Pattern; import com.amazonaws.AmazonClientException; import com.amazonaws.Request; import com.amazonaws.DefaultRequest; import com.amazonaws.http.HttpMethodName; import com.amazonaws.services.logs.model.*; import com.amazonaws.transform.Marshaller; import com.amazonaws.util.BinaryUtils; import com.amazonaws.util.StringUtils; import com.amazonaws.util.StringInputStream; import com.amazonaws.util.json.*; /** * DescribeLogStreamsRequest Marshaller */ public class DescribeLogStreamsRequestMarshaller implements Marshaller<Request<DescribeLogStreamsRequest>, DescribeLogStreamsRequest> { public Request<DescribeLogStreamsRequest> marshall( DescribeLogStreamsRequest describeLogStreamsRequest) { if (describeLogStreamsRequest == null) { throw new AmazonClientException( "Invalid argument passed to marshall(...)"); } Request<DescribeLogStreamsRequest> request = new DefaultRequest<DescribeLogStreamsRequest>( describeLogStreamsRequest, "AWSLogs"); request.addHeader("X-Amz-Target", "Logs_20140328.DescribeLogStreams"); request.setHttpMethod(HttpMethodName.POST); request.setResourcePath(""); try { StringWriter stringWriter = new StringWriter(); JSONWriter jsonWriter = new JSONWriter(stringWriter); jsonWriter.object(); if (describeLogStreamsRequest.getLogGroupName() != null) { jsonWriter.key("logGroupName").value( describeLogStreamsRequest.getLogGroupName()); } if (describeLogStreamsRequest.getLogStreamNamePrefix() != null) { jsonWriter.key("logStreamNamePrefix").value( describeLogStreamsRequest.getLogStreamNamePrefix()); } if (describeLogStreamsRequest.getOrderBy() != null) { jsonWriter.key("orderBy").value( describeLogStreamsRequest.getOrderBy()); } if (describeLogStreamsRequest.getDescending() != null) { jsonWriter.key("descending").value( describeLogStreamsRequest.getDescending()); } if (describeLogStreamsRequest.getNextToken() != null) { jsonWriter.key("nextToken").value( describeLogStreamsRequest.getNextToken()); } if (describeLogStreamsRequest.getLimit() != null) { jsonWriter.key("limit").value( describeLogStreamsRequest.getLimit()); } jsonWriter.endObject(); String snippet = stringWriter.toString(); byte[] content = snippet.getBytes(UTF8); request.setContent(new StringInputStream(snippet)); request.addHeader("Content-Length", Integer.toString(content.length)); request.addHeader("Content-Type", "application/x-amz-json-1.1"); } catch (Throwable t) { throw new AmazonClientException( "Unable to marshall request to JSON: " + t.getMessage(), t); } return request; } }
[ "aws@amazon.com" ]
aws@amazon.com
592f6a3d49ef6c3ca45e8f82e0679fbe62a73b3f
4da9097315831c8639a8491e881ec97fdf74c603
/src/StockIT-v2-release_source_from_JADX/sources/com/google/android/gms/internal/ads/zzagr.java
38e86c615ca2a2131e580fa11fe9576692ef2271
[ "Apache-2.0" ]
permissive
atul-vyshnav/2021_IBM_Code_Challenge_StockIT
5c3c11af285cf6f032b7c207e457f4c9a5b0c7e1
25c26a4cc59a3f3e575f617b59acc202ee6ee48a
refs/heads/main
2023-08-11T06:17:05.659651
2021-10-01T08:48:06
2021-10-01T08:48:06
410,595,708
1
1
null
null
null
null
UTF-8
Java
false
false
663
java
package com.google.android.gms.internal.ads; import com.google.android.gms.ads.formats.UnifiedNativeAd; /* compiled from: com.google.android.gms:play-services-ads-lite@@19.4.0 */ public final class zzagr extends zzagc { private final UnifiedNativeAd.UnconfirmedClickListener zzden; public zzagr(UnifiedNativeAd.UnconfirmedClickListener unconfirmedClickListener) { this.zzden = unconfirmedClickListener; } public final void onUnconfirmedClickReceived(String str) { this.zzden.onUnconfirmedClickReceived(str); } public final void onUnconfirmedClickCancelled() { this.zzden.onUnconfirmedClickCancelled(); } }
[ "57108396+atul-vyshnav@users.noreply.github.com" ]
57108396+atul-vyshnav@users.noreply.github.com
5d4a92bd4e2ca478b81a588d7367508a26514d93
e5cc6d4c8aed7c41dbcebf0bdafec4ada85b3a1f
/src/Mohamed/company/Ticket.java
86112a7b36ce9606cc8d3500242e3396e750b19e
[]
no_license
mash4peace/updatedTicketGUI
e12243825879cc210a96e9bbfd1892add3b0871d
106f9d7f7cfafbbd1b30e25a5475fe11fddd0242
refs/heads/master
2021-01-19T14:42:43.660890
2017-03-30T02:24:14
2017-03-30T02:24:14
86,649,671
0
0
null
null
null
null
UTF-8
Java
false
false
1,638
java
package Mohamed.company; import java.util.Date; /** * Created by tq1499vg on 3/29/2017. */ public class Ticket { protected int priority; protected String reporter; //Stores person or department who reported issue protected String description; protected Date dateReported; //TODO Problem 1: explain the role of ticketIdCounter and ticketID //STATIC Counter - one variable, shared by all Ticket objects. //If any Ticket object modifies this counter, all Ticket objects will have the modified value //Make it private - only Ticket objects should have access private static int ticketIdCounter = 1; //The ID for each ticket - an instance variable. Each Ticket will have it's own ticketID variable protected int ticketID; // TODO problem 6: tickets need to store the resolution date and a string describing the resolution // Either add them to this class or create another class called ResolvedTicket - which // do you think is the better approach? public Ticket(String desc, int p, String rep, Date date) { this.description = desc; this.priority = p; this.reporter = rep; this.dateReported = date; this.ticketID = ticketIdCounter; ticketIdCounter++; } protected int getPriority() { return priority; } public int getTicketID() { return ticketID; } public String toString(){ return("ID: " + this.ticketID + " Issue: " + this.description + " Priority: " + this.priority + " Reported by: " + this.reporter + " Reported on: " + this.dateReported); } }
[ "email@email.com" ]
email@email.com
b37e27baa7b4c2049d3f38e56f81b9660d99d35d
a00ef4174806abe4c4bb0ba89dfc44a8362e1741
/jaxrs2-async-pubsub-example/src/main/java/org/jboss/resteasy/example/pubsub/PubSubApplication.java
84bc94f30794cc16bfc620ca6d78d5ae34c96c42
[ "Apache-2.0" ]
permissive
davidromero/resteasy-examples
0bb7f76953d9235098836b6d6f52dfd1fa202da6
64303f18fca021c78c2369eb359650e140f878a0
refs/heads/master
2022-12-11T08:38:54.536332
2020-08-25T23:24:05
2020-08-25T23:24:05
290,343,805
1
0
Apache-2.0
2020-08-25T23:14:01
2020-08-25T23:14:00
null
UTF-8
Java
false
false
524
java
package org.jboss.resteasy.example.pubsub; import javax.ws.rs.core.Application; import java.util.HashSet; import java.util.Set; /** * @author <a href="mailto:bill@burkecentral.com">Bill Burke</a> * @version $Revision: 1 $ */ public class PubSubApplication extends Application { protected Set<Object> singletons = new HashSet<Object>(); public PubSubApplication() { singletons.add(new SubscriptionResource()); } @Override public Set<Object> getSingletons() { return singletons; } }
[ "asoldano@redhat.com" ]
asoldano@redhat.com
cf01efe84bda775e45e4f9030822467f73b6de1c
69cf52c31cbe6f55503efcd4e73627d91bf478cd
/src/main/java/com/pim/foreignexchange/config/StaticResourcesWebConfiguration.java
3e1b9bd861b63d3dcf6a64e408265e302a2ed082
[]
no_license
dankogaric/foreign-exchange
69b72d4212cdb0d80cdedb046df181f901b89c1f
652addeb4677a9566178864a29a0ecff5e5950d0
refs/heads/main
2023-01-23T07:23:39.806778
2020-11-23T15:46:42
2020-11-23T15:46:42
315,363,067
0
0
null
null
null
null
UTF-8
Java
false
false
2,166
java
package com.pim.foreignexchange.config; import io.github.jhipster.config.JHipsterConstants; import io.github.jhipster.config.JHipsterProperties; import java.util.concurrent.TimeUnit; import org.springframework.context.annotation.Configuration; import org.springframework.context.annotation.Profile; import org.springframework.http.CacheControl; import org.springframework.web.servlet.config.annotation.ResourceHandlerRegistration; import org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry; import org.springframework.web.servlet.config.annotation.WebMvcConfigurer; @Configuration @Profile({ JHipsterConstants.SPRING_PROFILE_PRODUCTION }) public class StaticResourcesWebConfiguration implements WebMvcConfigurer { protected static final String[] RESOURCE_LOCATIONS = new String[] { "classpath:/static/app/", "classpath:/static/content/", "classpath:/static/i18n/", }; protected static final String[] RESOURCE_PATHS = new String[] { "/app/*", "/content/*", "/i18n/*" }; private final JHipsterProperties jhipsterProperties; public StaticResourcesWebConfiguration(JHipsterProperties jHipsterProperties) { this.jhipsterProperties = jHipsterProperties; } @Override public void addResourceHandlers(ResourceHandlerRegistry registry) { ResourceHandlerRegistration resourceHandlerRegistration = appendResourceHandler(registry); initializeResourceHandler(resourceHandlerRegistration); } protected ResourceHandlerRegistration appendResourceHandler(ResourceHandlerRegistry registry) { return registry.addResourceHandler(RESOURCE_PATHS); } protected void initializeResourceHandler(ResourceHandlerRegistration resourceHandlerRegistration) { resourceHandlerRegistration.addResourceLocations(RESOURCE_LOCATIONS).setCacheControl(getCacheControl()); } protected CacheControl getCacheControl() { return CacheControl.maxAge(getJHipsterHttpCacheProperty(), TimeUnit.DAYS).cachePublic(); } private int getJHipsterHttpCacheProperty() { return jhipsterProperties.getHttp().getCache().getTimeToLiveInDays(); } }
[ "jhipster-bot@jhipster.tech" ]
jhipster-bot@jhipster.tech
70cc28fa390842ae326913c2457301c6637a57e9
132ef19f6dbfd8dcb2c0680421b53a4182c96b7e
/工具/Picturepark.SDK.Playground-master/Picturepark.SDK.Playground-master/playground/ar/test/models/DuplicateRightException.java
03b1127e5e1a28555b5f2a8a2164b96939234acc
[]
no_license
weedkiller/CommonPlatform2
0f6ea0cf4055cb67fdfcab0a024acf9631bf483a
eb5114a6ea019b98b3a5e41f38ba3621c4da43d0
refs/heads/master
2023-02-24T14:56:35.260089
2019-05-31T08:16:31
2019-05-31T08:16:31
null
0
0
null
null
null
null
UTF-8
Java
false
false
1,269
java
/** * Code generated by Microsoft (R) AutoRest Code Generator. * Changes may cause incorrect behavior and will be lost if the code is * regenerated. */ package picturepark.models; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonTypeInfo; import com.fasterxml.jackson.annotation.JsonTypeName; /** * The DuplicateRightException model. */ @JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "kind") @JsonTypeName("DuplicateRightException") public class DuplicateRightException extends PictureparkBusinessException { /** * The permissionSetId property. */ @JsonProperty(value = "permissionSetId") private String permissionSetId; /** * Get the permissionSetId value. * * @return the permissionSetId value */ public String permissionSetId() { return this.permissionSetId; } /** * Set the permissionSetId value. * * @param permissionSetId the permissionSetId value to set * @return the DuplicateRightException object itself. */ public DuplicateRightException withPermissionSetId(String permissionSetId) { this.permissionSetId = permissionSetId; return this; } }
[ "a6818162@163.com" ]
a6818162@163.com
d8cb273f347a931d8057ec17b1b4ff520600447a
862f8509b973a8c81adc10ba29d840a4ba70a815
/Back to Basics Approach 3rd Edition/Chapter_1_Intro/Ex1_15_EggStop.java
d172a31575ba23721041b0d06164afbcd4e503b5
[ "MIT" ]
permissive
Alex-Golub/various-books-exercise-solutions
183ad2a48ef3ac368549b5f92c9aa87a5a9044f0
2d61e3e2593cec549fe14ef21f675fdd14c906d9
refs/heads/master
2023-07-23T14:34:40.393166
2023-07-21T20:23:25
2023-07-22T09:49:48
273,867,210
7
4
null
null
null
null
UTF-8
Java
false
false
723
java
package Chapter_1_Intro; /** * Created by ag on 17-Oct-20 12:23 AM */ class Ex1_15_EggStop { public static void main(String[] args) { upper(); lower(); System.out.println(); upper(); lower(); table(); System.out.println(); upper(); stop(); lower(); table(); } public static void upper() { System.out.println(" ______ "); System.out.println(" / \\"); System.out.println("/ \\"); } public static void lower() { System.out.println("\\ /"); System.out.println(" \\______/"); } public static void table() { System.out.println("+--------+"); } public static void stop() { System.out.println("| STOP |"); } }
[ "55350522+Alex-Golub@users.noreply.github.com" ]
55350522+Alex-Golub@users.noreply.github.com
165b65b9f8853735429e7573d7a5ac8395b54376
15a86f80b93afe3fcca8b6eb70c622c2d3b7bd9a
/src/com/peixiao/adapter/objectadapter/VoltageAdapter.java
0872456929f211b3c637f7122866421380f492b9
[]
no_license
ZhaoPeixiao/DesignPattern
22abed93b33819e1be2208009e0b84c93b584567
167940dc01a709eeea3593d93e4e6c99b0198056
refs/heads/master
2023-06-02T07:21:13.102909
2021-06-13T11:59:55
2021-06-13T11:59:55
283,210,887
0
0
null
null
null
null
UTF-8
Java
false
false
729
java
package com.peixiao.adapter.objectadapter; /** * @Author: Peixiao Zhao */ public class VoltageAdapter implements IVoltage5V { private Voltage220V voltage220V; // 关联关系中的聚合关系 public VoltageAdapter(Voltage220V voltage220V) { this.voltage220V = voltage220V; } @Override public int output5V() { // 获取到220V电压 int dst = 0; if (voltage220V != null) { int src = voltage220V.output220V(); System.out.println("使用对象适配器进行适配"); dst = src / 44; System.out.println("适配完成, 输出电压为 " + dst + "V"); } return dst; } }
[ "u6935249@anu.edu.au" ]
u6935249@anu.edu.au
28b0f80aba5c53bbdef76cf7ae74ae2aed18f57f
4a93f26f8299aa7f01d5a1432beea419a9ee2285
/jstarcraft-ai-model/src/main/java/com/jstarcraft/ai/model/neuralnetwork/optimization/StochasticGradientOptimizer.java
3308815297fa34a8b97f4f2d7a138cbfb369bc87
[ "Apache-2.0" ]
permissive
zzdzzdzzdzzd/jstarcraft-ai
32eeff98a84543309cf19a6a7bb99a143e12197f
e59181f52a560885c9beadd9542ec2af6f3297f1
refs/heads/master
2020-07-06T19:19:38.468285
2019-08-17T09:53:51
2019-08-17T09:53:51
null
0
0
null
null
null
null
UTF-8
Java
false
false
1,483
java
package com.jstarcraft.ai.model.neuralnetwork.optimization; import java.util.Map; import java.util.concurrent.Callable; import com.jstarcraft.ai.math.structure.matrix.MathMatrix; import com.jstarcraft.ai.model.neuralnetwork.condition.Condition; import com.jstarcraft.ai.model.neuralnetwork.step.NegativeGradientStepFunction; import com.jstarcraft.ai.model.neuralnetwork.step.StepFunction; /** * Stochastic Gradient Descent优化器 * * <pre> * 参考Deeplearning4j团队 * </pre> * * @author Birdy * */ public class StochasticGradientOptimizer extends AbstractOptimizer { protected Map<String, MathMatrix> gradients, parameters; protected StochasticGradientOptimizer() { } public StochasticGradientOptimizer(Condition... conditions) { this(new NegativeGradientStepFunction(), conditions); } public StochasticGradientOptimizer(StepFunction stepFunction, Condition... terminationConditions) { super(stepFunction, terminationConditions); } @Override public void doCache(Callable<Float> scorer, Map<String, MathMatrix> gradients, Map<String, MathMatrix> parameters) { this.gradients = gradients; this.parameters = parameters; } @Override public boolean optimize(float score) { oldScore = newScore; newScore = score; // 使用梯度更新参数 stepFunction.step(1F, gradients, parameters); for (Condition condition : conditions) { if (condition.stop(newScore, oldScore, gradients)) { return true; } } return false; } }
[ "Birdy@LAPTOP-QRG8T75T" ]
Birdy@LAPTOP-QRG8T75T
267f255eb610a428f0bd70c1a8b1b2f292d85258
37bc004c71c94b2be17bc220fb3daaacae0a6e77
/Project XI/src/Loops/PrintEachChar.java
fad5531aad01fa01caae9900ef28b20b5a7029f7
[]
no_license
bbogush72/Bee007BasicJava
69ee060c0322728cfdefa9b29922000323450f3a
b671753a179eede7daaecf5f5ee1e04e8139277b
refs/heads/master
2022-04-23T16:41:31.229518
2020-03-15T00:20:08
2020-03-15T00:20:08
164,767,738
0
0
null
null
null
null
UTF-8
Java
false
false
885
java
package Loops; public class PrintEachChar { public static void main(String[] args) { String word = "CybertekSchool "; //using for loop, print each char one by one for(int i = 0; i < word.length(); i++) { System.out.print(word.charAt(i)); } //using for loop, print only vowel (a,e,o,i,u) for(int i = 0; i < word.length(); i++) { char letter = word.toLowerCase().charAt(i); if(letter == 'a' || letter == 'e' || letter == 'o' || letter == 'i' || letter == 'u' ) { System.out.print(letter + ", "); } } System.out.println(); //using for loop, print only consonants for(int i = 0; i < word.length(); i++) { char letter = word.toLowerCase().charAt(i); if( !(letter == 'a' || letter == 'e' || letter == 'o' || letter == 'i' || letter == 'u') ) { System.out.print(letter + ", "); } } } }
[ "Bbogush@192.168.0.18" ]
Bbogush@192.168.0.18
dd06be1a5438367e58ed13af2a0b7d88d4d44d37
9d50126d5ba9c8bcc8fe5b897868250146a5665b
/src/java/sessions/CompteutilisateurFacade.java
31edfe81058c06874bb19c6376e3f54adb2b3a92
[]
no_license
kenne12/PDSD
d8c69e061b2dd7cc25e72dcb301124449543732e
db906814f38a3d5c0a463f194588f9051af1848c
refs/heads/master
2021-06-12T12:40:17.463165
2021-02-03T07:56:08
2021-02-03T07:56:08
82,689,867
0
0
null
null
null
null
UTF-8
Java
false
false
2,224
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 sessions; import entities.Compteutilisateur; import java.util.List; import javax.ejb.Stateless; import javax.persistence.EntityManager; import javax.persistence.PersistenceContext; import javax.persistence.Query; /** * * @author kenne */ @Stateless public class CompteutilisateurFacade extends AbstractFacade<Compteutilisateur> implements CompteutilisateurFacadeLocal { @PersistenceContext(unitName = "PDSDPU") private EntityManager em; @Override protected EntityManager getEntityManager() { return em; } public CompteutilisateurFacade() { super(Compteutilisateur.class); } @Override public int nextId() { try { Query query = em.createQuery("SELECT MAX(c.idcompte) FROM Compteutilisateur c"); List listObj = query.getResultList(); if (!listObj.isEmpty()) { return ((Integer) listObj.get(0)) + 1; } else { return 1; } } catch (Exception e) { return 1; } } @Override public Compteutilisateur login(String login, String password) { Compteutilisateur compteutilisateur = null; try { Query query = em.createQuery("SELECT c FROM Compteutilisateur c WHERE c.login=:login AND c.password=:password"); query.setParameter("login", login); query.setParameter("password", password); compteutilisateur = (Compteutilisateur) query.getSingleResult(); } catch (Exception e) { e.getCause(); e.getMessage(); } return compteutilisateur; } @Override public List<Compteutilisateur> findAll(Boolean etat) throws Exception { List<Compteutilisateur> compteutilisateurs = null; Query query = em.createQuery("SELECT c FROM Compteutilisateur c WHERE c.etat=:etat"); query.setParameter("etat", etat); compteutilisateurs = query.getResultList(); return compteutilisateurs; } }
[ "kenne_gervais@yahoo.fr" ]
kenne_gervais@yahoo.fr
d9151304019573e82eaac0a2f3e5c09023d1c3b8
24d8cf871b092b2d60fc85d5320e1bc761a7cbe2
/jEdit/rev16588-17316/base-branch-16588/org/gjt/sp/jedit/gui/TipOfTheDay.java
b9ae3a1d343528b0b61dec9cd026dce8df43404a
[]
no_license
joliebig/featurehouse_fstmerge_examples
af1b963537839d13e834f829cf51f8ad5e6ffe76
1a99c1788f0eb9f1e5d8c2ced3892d00cd9449ad
refs/heads/master
2016-09-05T10:24:50.974902
2013-03-28T16:28:47
2013-03-28T16:28:47
9,080,611
3
2
null
null
null
null
UTF-8
Java
false
false
3,218
java
package org.gjt.sp.jedit.gui; import javax.swing.border.EmptyBorder; import javax.swing.*; import java.awt.event.*; import java.awt.*; import java.io.*; import java.util.Random; import org.gjt.sp.jedit.*; import org.gjt.sp.util.Log; public class TipOfTheDay extends EnhancedDialog { public TipOfTheDay(View view) { super(view,jEdit.getProperty("tip.title"),false); JPanel content = new JPanel(new BorderLayout(12,12)); content.setBorder(new EmptyBorder(12,12,12,12)); setContentPane(content); JLabel label = new JLabel(jEdit.getProperty("tip.caption")); label.setFont(new Font("SansSerif",Font.PLAIN,24)); label.setForeground(UIManager.getColor("Button.foreground")); content.add(BorderLayout.NORTH,label); tipText = new JEditorPane(); tipText.setEditable(false); tipText.setContentType("text/html"); nextTip(); JScrollPane scroller = new JScrollPane(tipText); scroller.setPreferredSize(new Dimension(150,150)); content.add(BorderLayout.CENTER,scroller); ActionHandler actionHandler = new ActionHandler(); Box buttons = new Box(BoxLayout.X_AXIS); showNextTime = new JCheckBox(jEdit.getProperty("tip.show-next-time"), jEdit.getBooleanProperty("tip.show")); showNextTime.addActionListener(actionHandler); buttons.add(showNextTime); buttons.add(Box.createHorizontalStrut(6)); buttons.add(Box.createGlue()); nextTip = new JButton(jEdit.getProperty("tip.next-tip")); nextTip.addActionListener(actionHandler); buttons.add(nextTip); buttons.add(Box.createHorizontalStrut(6)); close = new JButton(jEdit.getProperty("common.close")); close.addActionListener(actionHandler); buttons.add(close); content.getRootPane().setDefaultButton(close); Dimension dim = nextTip.getPreferredSize(); dim.width = Math.max(dim.width,close.getPreferredSize().width); nextTip.setPreferredSize(dim); close.setPreferredSize(dim); content.add(BorderLayout.SOUTH,buttons); setDefaultCloseOperation(DISPOSE_ON_CLOSE); pack(); setLocationRelativeTo(view); setVisible(true); } public void ok() { dispose(); } public void cancel() { dispose(); } private JCheckBox showNextTime; private JButton nextTip, close; private JEditorPane tipText; private int currentTip = -1; private void nextTip() { File[] tips = new File(MiscUtilities.constructPath( jEdit.getJEditHome(),"doc","tips")).listFiles(); if(tips == null || tips.length == 0) { tipText.setText(jEdit.getProperty("tip.not-found")); return; } int count = tips.length; int tipToShow = currentTip; while(tipToShow == currentTip || !tips[tipToShow].getName().endsWith(".html")) tipToShow = (new Random().nextInt(Integer.MAX_VALUE)) % count; try { tipText.setPage(tips[tipToShow].toURI().toURL()); } catch(Exception e) { Log.log(Log.ERROR,this,e); } } class ActionHandler implements ActionListener { public void actionPerformed(ActionEvent evt) { Object source = evt.getSource(); if(source == showNextTime) { jEdit.setBooleanProperty("tip.show",showNextTime .isSelected()); } else if(source == nextTip) nextTip(); else if(source == close) dispose(); } } }
[ "joliebig@fim.uni-passau.de" ]
joliebig@fim.uni-passau.de
c19693306734ce96f938b72649636990121c15be
13cdd0ddb1e5ed977ea9fabe8e1ac0b917b3bf5d
/src/main/java/com/anl/user/persistence/mapper/MiPushMapper.java
1ade0b086db301742a75705cbf12f9e7fea0630b
[]
no_license
kpdtd/card_service
30bfd5d00d2cb55c6b12fa75d137878cfe39d212
e596f59459d4e9f839a9daaa7c57d79fef4e7547
refs/heads/master
2020-03-22T23:45:07.195325
2018-09-26T09:18:37
2018-09-26T09:18:37
140,826,810
0
0
null
null
null
null
UTF-8
Java
false
false
271
java
package com.anl.user.persistence.mapper; import com.anl.user.persistence.mapper.BaseMapper; import com.anl.user.persistence.po.MiPush; /** * 类名: MiPush * 创建日期: * 功能描述: */ public interface MiPushMapper extends BaseMapper<MiPush> { }
[ "yqyanghn@126.com" ]
yqyanghn@126.com
bc878c8b4a24da2ae2636c0263d50af27dec8f1b
4af034492bad7e1ad6cdcc589701dddeda915b27
/src/main/java/org/apache/ibatis/type/SqlTimestampTypeHandler.java
4250eb0ed141a916723278a2f4f4579935b71480
[ "Apache-2.0", "BSD-3-Clause" ]
permissive
gm504117608/guomin-mybatis
7b3d013a26e20595c6058148a3e2eca2fb076ea3
5917d9d5d6876e19b15090026ab84ddd71a641bb
refs/heads/master
2021-01-20T12:31:00.307088
2017-03-09T10:10:17
2017-03-09T10:10:17
82,660,102
0
1
null
null
null
null
UTF-8
Java
false
false
1,647
java
/** * Copyright 2009-2015 the original author or authors. * <p/> * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * <p/> * http://www.apache.org/licenses/LICENSE-2.0 * <p/> * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org.apache.ibatis.type; import java.sql.CallableStatement; import java.sql.PreparedStatement; import java.sql.ResultSet; import java.sql.SQLException; import java.sql.Timestamp; /** * @author Clinton Begin */ public class SqlTimestampTypeHandler extends BaseTypeHandler<Timestamp> { @Override public void setNonNullParameter(PreparedStatement ps, int i, Timestamp parameter, JdbcType jdbcType) throws SQLException { ps.setTimestamp(i, parameter); } @Override public Timestamp getNullableResult(ResultSet rs, String columnName) throws SQLException { return rs.getTimestamp(columnName); } @Override public Timestamp getNullableResult(ResultSet rs, int columnIndex) throws SQLException { return rs.getTimestamp(columnIndex); } @Override public Timestamp getNullableResult(CallableStatement cs, int columnIndex) throws SQLException { return cs.getTimestamp(columnIndex); } }
[ "504117608@qq.com" ]
504117608@qq.com
d17d0861c0580d7722b48e0f031f509b52ed58f8
ddd38972d2e73c464ee77024f6ba4d6e11aac97b
/common/arcus-billing/src/main/java/com/iris/billing/client/model/request/SubscriptionRequest.java
c8ff638d1139113dcdf825115dd9729ee6663783
[ "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
5,710
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.billing.client.model.request; import java.text.SimpleDateFormat; import java.util.Collections; import java.util.Date; import java.util.HashMap; import java.util.Map; import java.util.TimeZone; import com.iris.billing.client.model.Plan; import com.iris.billing.client.model.RecurlyModel; import com.iris.billing.client.model.RecurlyModels; import com.iris.billing.client.model.Subscription; import com.iris.billing.client.model.SubscriptionAddon; import com.iris.billing.client.model.SubscriptionAddons; public class SubscriptionRequest extends RecurlyModel { // totalBillingCycles; // firstRenewalDate; // vatReverseChargeNotes; // collectionMethod; // couponCode; // unitAmountInCents // trialEndsAt; // startsAt; private String subscriptionID; private String planCode; private SubscriptionAddons subscriptionAddons = new SubscriptionAddons(); private String currency; private Integer quantity; private Boolean isBulk; private String customerNotes; private Date trialEndsAt; private SubscriptionTimeframe timeframe; private Integer unitAmountInCents; public enum SubscriptionTimeframe { NOW, RENEWAL } private Map<String, Object> mappings = new HashMap<String, Object>(); /** * This constructor makes sure there always is a subscription_add_ons tag as without it the addons * will not be deleted from recurly, per there API. */ public SubscriptionRequest(){ mappings.put(Subscription.Tags.SUBSCRIPTION_ADD_ONS, subscriptionAddons); } public final String getPlanCode() { return planCode; } public final void setPlanCode(String planCode) { this.planCode = planCode; mappings.put(Plan.Tags.PLAN_CODE, planCode); } public final String getSubscriptionID() { return subscriptionID; } /** * Required if updating a subscription. * * @param subscriptionID */ public final void setSubscriptionID(String subscriptionID) { this.subscriptionID = subscriptionID; } public final SubscriptionAddons getSubscriptionAddons() { return subscriptionAddons; } public final void setSubscriptionAddons(SubscriptionAddons subscriptionAddons) { if(subscriptionAddons == null) { subscriptionAddons = new SubscriptionAddons(); } this.subscriptionAddons = subscriptionAddons; mappings.put(Subscription.Tags.SUBSCRIPTION_ADD_ONS, subscriptionAddons); } public final void addSubscriptionAddon(SubscriptionAddon subscriptionAddon) { this.subscriptionAddons.add(subscriptionAddon); mappings.put(Subscription.Tags.SUBSCRIPTION_ADD_ONS, subscriptionAddons); } public final String getCurrency() { return currency; } public final void setCurrency(String currency) { this.currency = currency; mappings.put(Subscription.Tags.CURRENCY, currency); } public final Integer getQuantity() { return quantity; } public final void setQuantity(Integer quantity) { this.quantity = quantity; mappings.put(Subscription.Tags.QUANTITY, quantity); } public final Integer getUnitAmountInCents() { return this.unitAmountInCents; } public final void setUnitAmountInCents(Integer amountInCents) { this.unitAmountInCents = amountInCents; mappings.put(Subscription.Tags.UNIT_AMOUNT_IN_CENTS, this.unitAmountInCents); } public final Boolean getIsBulk() { return isBulk; } public final void setIsBulk(Boolean isBulk) { this.isBulk = isBulk; mappings.put("bulk", isBulk); } public final String getCustomerNotes() { return customerNotes; } public final void setCustomerNotes(String customerNotes) { this.customerNotes = customerNotes; mappings.put(Subscription.Tags.CUSTOMER_NOTES, customerNotes); } public final SubscriptionTimeframe getTimeframe() { return this.timeframe; } public final void setTimeframe(SubscriptionTimeframe timeframe) { this.timeframe = timeframe; if (timeframe.equals(SubscriptionTimeframe.RENEWAL)) { mappings.put(Subscription.Tags.TIMEFRAME, "renewal"); } else { mappings.put(Subscription.Tags.TIMEFRAME, "now"); } } public final Date getTrialEndsAt() { return trialEndsAt; } public final void setTrialEndsAt(Date trialEndsAt) { this.trialEndsAt = trialEndsAt; if(trialEndsAt != null) { mappings.put(Subscription.Tags.TRIAL_ENDS_AT, formatDate(trialEndsAt)); } } private String formatDate(Date d) { SimpleDateFormat sdf = new SimpleDateFormat("yyyy-M-d'T'HH:mm:ss"); sdf.setTimeZone(TimeZone.getTimeZone("UTC")); return sdf.format(d); } @Override public Map<String, Object> getXMLMappings() { return Collections.unmodifiableMap(mappings); } @Override public String getTagName() { return Subscription.Tags.TAG_NAME; } @Override public RecurlyModels<?> createContainer() { // There is no container for Subscription Request. return null; } }
[ "b@yoyo.com" ]
b@yoyo.com
280cb27b2416a5c7bbc0a1c35e3a0efa10569d5a
e5e048f1716e5d8e92023b6a9d4f80d9e6bd366b
/src/main/java/com/opengamma/analytics/util/timeseries/zdt/ZonedDateTimeToLongConverter.java
5d665b19506d604552935bd568574968481e19f2
[ "Apache-2.0" ]
permissive
jerome79/Analytics
e4dd03ae9d95a67f7ff36fb75bd5e268b87f2547
71ab1c7a88ed851c50a8de87af000155666f4894
refs/heads/master
2020-04-09T17:24:30.623733
2015-08-17T10:01:27
2015-08-17T10:01:27
42,441,934
1
0
null
2015-09-14T10:19:57
2015-09-14T10:19:56
null
UTF-8
Java
false
false
2,314
java
/** * Copyright (C) 2009 - present by OpenGamma Inc. and the OpenGamma group of companies * * Please see distribution for license. */ package com.opengamma.analytics.util.timeseries.zdt; import java.time.Instant; import java.time.LocalDateTime; import java.time.ZoneId; import java.time.ZonedDateTime; /** * An encoder between {@code ZonedDateTime} and {@code long}. * <p> * Any far future or maximum instant must be converted to {@code Long.MAX_VALUE}. * Any far past or minimum instant must be converted to {@code Long.MIN_VALUE}. * Other values are encoded as the number of nanoseconds from 1970-01-01, with * a range of +-292 years. */ public final class ZonedDateTimeToLongConverter { /** * Restricted constructor. */ private ZonedDateTimeToLongConverter() { } //------------------------------------------------------------------------- /** * Converts a {@code ZonedDateTime} to a {@code long}. * <p> * See the class Javadoc for the format of the {@code long}. * * @param instant the instant to convert, not null * @return the {@code long} equivalent * @throws IllegalArgumentException if the instant is too large */ public static long convertToLong(ZonedDateTime instant) { if (instant.getYear() >= 1_000_000) { return Long.MAX_VALUE; } if (instant.getYear() <= -1_000_000) { return Long.MIN_VALUE; } try { long secs = Math.multiplyExact(instant.toEpochSecond(), 1_000_000_000); return Math.addExact(secs, instant.getNano()); } catch (RuntimeException ex) { throw new IllegalArgumentException("ZonedDateTime is too large/small: " + instant); } } /** * Converts a {@code long} to an {@code ZonedDateTime}. * <p> * See the class Javadoc for the format of the {@code long}. * * @param instant the {@code long} nanos to convert, not null * @param zone the zone to use, not null * @return the {@code ZonedDateTime} equivalent, not null */ public static ZonedDateTime convertToZonedDateTime(long instant, ZoneId zone) { if (instant == Long.MAX_VALUE) { return LocalDateTime.MAX.atZone(zone); } if (instant == Long.MIN_VALUE) { return LocalDateTime.MIN.atZone(zone); } return Instant.ofEpochSecond(0, instant).atZone(zone); } }
[ "stephen@opengamma.com" ]
stephen@opengamma.com
43822836e8ca6b09a6e28f0d906216a730e76677
4ec91fe5abdd4345524159b9c4a6b66f2941ec2e
/gws-wsdl/src/main/java/org/ow2/easywsdl/wsdl/org/xmlsoap/schemas/wsdl/http/UrlReplacement.java
c55f46312aebed5307a421eaf6e67085e46e028d
[]
no_license
antonschelokov/siu
3cbfa40e79a81c087ee62bd7b9d4b79083ecf2c0
788d67c0181a10bf34a52417243ec2d4a0603619
refs/heads/master
2021-06-07T04:45:27.672278
2015-09-08T08:40:11
2015-09-08T08:40:11
null
0
0
null
null
null
null
UTF-8
Java
false
false
3,500
java
// // This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vhudson-jaxb-ri-2.1-792 // 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: 2010.02.16 at 03:46:51 PM CET // package org.ow2.easywsdl.wsdl.org.xmlsoap.schemas.wsdl.http; import javax.xml.bind.annotation.XmlAccessType; import javax.xml.bind.annotation.XmlAccessorType; import javax.xml.bind.annotation.XmlRootElement; import javax.xml.bind.annotation.XmlType; import org.ow2.easywsdl.u.builder.EqualsBuilder; import org.ow2.easywsdl.u.builder.HashCodeBuilder; import org.ow2.easywsdl.u.builder.ToStringBuilder; import org.jvnet.jaxb2_commons.lang.CopyTo; import org.jvnet.jaxb2_commons.lang.Copyable; import org.jvnet.jaxb2_commons.lang.Equals; import org.jvnet.jaxb2_commons.lang.HashCode; import org.jvnet.jaxb2_commons.lang.ToString; import org.jvnet.jaxb2_commons.lang.builder.CopyBuilder; import org.jvnet.jaxb2_commons.lang.builder.JAXBCopyBuilder; import org.jvnet.jaxb2_commons.lang.builder.JAXBEqualsBuilder; import org.jvnet.jaxb2_commons.lang.builder.JAXBHashCodeBuilder; import org.jvnet.jaxb2_commons.lang.builder.JAXBToStringBuilder; /** * <p>Java class for anonymous complex type. * * <p>The following schema fragment specifies the expected content contained within this class. * * <pre> * &lt;complexType> * &lt;complexContent> * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> * &lt;/restriction> * &lt;/complexContent> * &lt;/complexType> * </pre> * * */ @XmlAccessorType(XmlAccessType.FIELD) @XmlType(name = "") @XmlRootElement(name = "urlReplacement") public class UrlReplacement implements CopyTo, Copyable, Equals, HashCode, ToString { public void toString(ToStringBuilder toStringBuilder) { } public String toString() { final ToStringBuilder toStringBuilder = new JAXBToStringBuilder(this); toString(toStringBuilder); return toStringBuilder.toString(); } public void equals(Object object, EqualsBuilder equalsBuilder) { if (!(object instanceof UrlReplacement)) { equalsBuilder.appendSuper(false); return ; } if (this == object) { return ; } final UrlReplacement that = ((UrlReplacement) object); } public boolean equals(Object object) { if (!(object instanceof UrlReplacement)) { return false; } if (this == object) { return true; } final EqualsBuilder equalsBuilder = new JAXBEqualsBuilder(); equals(object, equalsBuilder); return equalsBuilder.isEquals(); } public void hashCode(HashCodeBuilder hashCodeBuilder) { } public int hashCode() { final HashCodeBuilder hashCodeBuilder = new JAXBHashCodeBuilder(); hashCode(hashCodeBuilder); return hashCodeBuilder.toHashCode(); } public Object copyTo(Object target, CopyBuilder copyBuilder) { final UrlReplacement copy = ((target == null)?((UrlReplacement) createCopy()):((UrlReplacement) target)); return copy; } public Object copyTo(Object target) { final CopyBuilder copyBuilder = new JAXBCopyBuilder(); return copyTo(target, copyBuilder); } public Object createCopy() { return new UrlReplacement(); } }
[ "maxim.zaytsev@codeinside.ru" ]
maxim.zaytsev@codeinside.ru
37d3f47840bde366808f01223fc2ae979af1b771
07f4bd3ac0228a06f0e6470dd09867d31069b0c8
/rule-engine-web/src/main/java/com/engine/web/service/impl/RulePublishServiceImpl.java
c51747d55f1a3e7e4607d27c6d8031f41ee17439
[ "Apache-2.0" ]
permissive
landscape-Melo/rule-engine
e65d0c2966ed6ad671a7a26cb6cae4419051d425
46335c3d23a432cb46a35716bbeb1752bd6b0368
refs/heads/master
2023-01-13T09:14:57.389058
2020-11-18T16:51:05
2020-11-18T16:51:05
null
0
0
null
null
null
null
UTF-8
Java
false
false
1,707
java
package com.engine.web.service.impl; import com.engine.core.rule.Rule; import com.engine.web.enums.RuleStatus; import com.engine.web.service.RulePublishService; import com.engine.web.store.entity.RuleEngineRulePublish; import com.engine.web.store.manager.RuleEngineRulePublishManager; import org.springframework.stereotype.Service; import javax.annotation.Resource; import java.util.ArrayList; import java.util.List; /** * 〈一句话功能简述〉<br> * 〈〉 * * @author dingqianwen * @date 2020/9/4 * @since 1.0.0 */ @Service public class RulePublishServiceImpl implements RulePublishService { @Resource private RuleEngineRulePublishManager ruleEngineRulePublishManager; /** * 根据规则code,查询发布规则 * * @param ruleCode 规则code * @return 规则 */ @Override public Rule getPublishRuleByCode(String ruleCode) { RuleEngineRulePublish rulePublish = this.ruleEngineRulePublishManager.lambdaQuery() .eq(RuleEngineRulePublish::getRuleCode, ruleCode) .one(); Rule rule = new Rule(); rule.fromJson(rulePublish.getData()); return rule; } /** * 获取所有的已发布规则 * * @return rule */ @Override public List<Rule> getAllPublishRule() { List<RuleEngineRulePublish> rulePublishList = this.ruleEngineRulePublishManager.lambdaQuery() .list(); List<Rule> rules = new ArrayList<>(); for (RuleEngineRulePublish publish : rulePublishList) { Rule rule = new Rule(); rule.fromJson(publish.getData()); rules.add(rule); } return rules; } }
[ "761945125@qq.com" ]
761945125@qq.com
e6b6235dd791ea92999ed962090dbcb22fd6197a
f30cf54300ed241eafa4757cb1d8cb0704cec032
/src/main/java/ru/gopstop/bot/telegram/internal/Emoji.java
dfb0dd7f1584e13755ce086ea09a77ea60bd0602
[]
no_license
muzis-git/gopstopbot
b8a0cd0be6c796d7dfdd63165e8fcc47f5cf3e1f
2397d165044e9c3f682e922912451096f3b82cec
refs/heads/master
2021-01-18T12:36:44.179167
2016-07-31T09:35:56
2016-07-31T09:35:56
null
0
0
null
null
null
null
UTF-8
Java
false
false
7,079
java
package ru.gopstop.bot.telegram.internal; public enum Emoji { // Emoticones group GRINNING_FACE_WITH_SMILING_EYES('\uD83D', '\uDE01'), FACE_WITH_TEARS_OF_JOY('\uD83D', '\uDE02'), SMILING_FACE_WITH_OPEN_MOUTH('\uD83D', '\uDE03'), SMILING_FACE_WITH_OPEN_MOUTH_AND_SMILING_EYES('\uD83D', '\uDE04'), SMILING_FACE_WITH_OPEN_MOUTH_AND_COLD_SWEAT('\uD83D', '\uDE05'), SMILING_FACE_WITH_OPEN_MOUTH_AND_TIGHTLY_CLOSED_EYES('\uD83D', '\uDE06'), WINKING_FACE('\uD83D', '\uDE09'), SMILING_FACE_WITH_SMILING_EYES('\uD83D', '\uDE0A'), FACE_SAVOURING_DELICIOUS_FOOD('\uD83D', '\uDE0B'), RELIEVED_FACE('\uD83D', '\uDE0C'), SMILING_FACE_WITH_HEART_SHAPED_EYES('\uD83D', '\uDE0D'), SMIRKING_FACE('\uD83D', '\uDE0F'), UNAMUSED_FACE('\uD83D', '\uDE12'), FACE_WITH_COLD_SWEAT('\uD83D', '\uDE13'), PENSIVE_FACE('\uD83D', '\uDE14'), CONFOUNDED_FACE('\uD83D', '\uDE16'), FACE_THROWING_A_KISS('\uD83D', '\uDE18'), KISSING_FACE_WITH_CLOSED_EYES('\uD83D', '\uDE1A'), FACE_WITH_STUCK_OUT_TONGUE_AND_WINKING_EYE('\uD83D', '\uDE1C'), FACE_WITH_STUCK_OUT_TONGUE_AND_TIGHTLY_CLOSED_EYES('\uD83D', '\uDE1D'), DISAPPOINTED_FACE('\uD83D', '\uDE1E'), ANGRY_FACE('\uD83D', '\uDE20'), POUTING_FACE('\uD83D', '\uDE21'), CRYING_FACE('\uD83D', '\uDE22'), PERSEVERING_FACE('\uD83D', '\uDE23'), FACE_WITH_LOOK_OF_TRIUMPH('\uD83D', '\uDE24'), DISAPPOINTED_BUT_RELIEVED_FACE('\uD83D', '\uDE25'), FEARFUL_FACE('\uD83D', '\uDE28'), WEARY_FACE('\uD83D', '\uDE29'), SLEEPY_FACE('\uD83D', '\uDE2A'), TIRED_FACE('\uD83D', '\uDE2B'), LOUDLY_CRYING_FACE('\uD83D', '\uDE2D'), FACE_WITH_OPEN_MOUTH_AND_COLD_SWEAT('\uD83D', '\uDE30'), FACE_SCREAMING_IN_FEAR('\uD83D', '\uDE31'), ASTONISHED_FACE('\uD83D', '\uDE32'), FLUSHED_FACE('\uD83D', '\uDE33'), DIZZY_FACE('\uD83D', '\uDE35'), FACE_WITH_MEDICAL_MASK('\uD83D', '\uDE37'), GRINNING_CAT_FACE_WITH_SMILING_EYES('\uD83D', '\uDE38'), CAT_FACE_WITH_TEARS_OF_JOY('\uD83D', '\uDE39'), SMILING_CAT_FACE_WITH_OPEN_MOUTH('\uD83D', '\uDE3A'), SMILING_CAT_FACE_WITH_HEART_SHAPED_EYES('\uD83D', '\uDE3B'), CAT_FACE_WITH_WRY_SMILE('\uD83D', '\uDE3C'), KISSING_CAT_FACE_WITH_CLOSED_EYES('\uD83D', '\uDE3D'), POUTING_CAT_FACE('\uD83D', '\uDE3E'), CRYING_CAT_FACE('\uD83D', '\uDE3F'), WEARY_CAT_FACE('\uD83D', '\uDE40'), FACE_WITH_NO_GOOD_GESTURE('\uD83D', '\uDE45'), FACE_WITH_OK_GESTURE('\uD83D', '\uDE46'), PERSON_BOWING_DEEPLY('\uD83D', '\uDE47'), SEE_NO_EVIL_MONKEY('\uD83D', '\uDE48'), HEAR_NO_EVIL_MONKEY('\uD83D', '\uDE49'), SPEAK_NO_EVIL_MONKEY('\uD83D', '\uDE4A'), HAPPY_PERSON_RAISING_ONE_HAND('\uD83D', '\uDE4B'), PERSON_RAISING_BOTH_HANDS_IN_CELEBRATION('\uD83D', '\uDE4C'), PERSON_FROWNING('\uD83D', '\uDE4D'), PERSON_WITH_POUTING_FACE('\uD83D', '\uDE4E'), PERSON_WITH_FOLDED_HANDS('\uD83D', '\uDE4F'), // Dingbats group BLACK_SCISSORS(null, '\u2702'), WHITE_HEAVY_CHECK_MARK(null, '\u2705'), AIRPLANE(null, '\u2708'), ENVELOPE(null, '\u2709'), RAISED_FIST(null, '\u270A'), RAISED_HAND(null, '\u270B'), VICTORY_HAND(null, '\u270C'), PENCIL(null, '\u270F'), BLACK_NIB(null, '\u2712'), HEAVY_CHECK_MARK(null, '\u2714'), HEAVY_MULTIPLICATION_X(null, '\u2716'), SPARKLES(null, '\u2728'), EIGHT_SPOKED_ASTERISK(null, '\u2733'), EIGHT_POINTED_BLACK_STAR(null, '\u2734'), SNOWFLAKE(null, '\u2744'), SPARKLE(null, '\u2747'), CROSS_MARK(null, '\u274C'), NEGATIVE_SQUARED_CROSS_MARK(null, '\u274E'), BLACK_QUESTION_MARK_ORNAMENT(null, '\u2753'), WHITE_QUESTION_MARK_ORNAMENT(null, '\u2754'), WHITE_EXCLAMATION_MARK_ORNAMENT(null, '\u2755'), HEAVY_EXCLAMATION_MARK_SYMBOL(null, '\u2757'), HEAVY_BLACK_HEART(null, '\u2764'), HEAVY_PLUS_SIGN(null, '\u2795'), HEAVY_MINUS_SIGN(null, '\u2796'), HEAVY_DIVISION_SIGN(null, '\u2797'), BLACK_RIGHTWARDS_ARROW(null, '\u27A1'), CURLY_LOOP(null, '\u27B0'), // Transport and map symbols Group ROCKET('\uD83D', '\uDE80'), RAILWAY_CAR('\uD83D', '\uDE83'), HIGH_SPEED_TRAIN('\uD83D', '\uDE84'), HIGH_SPEED_TRAIN_WITH_BULLET_NOSE('\uD83D', '\uDE85'), METRO('\uD83D', '\uDE87'), STATION('\uD83D', '\uDE89'), BUS('\uD83D', '\uDE8C'), BUS_STOP('\uD83D', '\uDE8F'), AMBULANCE('\uD83D', '\uDE91'), FIRE_ENGINE('\uD83D', '\uDE92'), POLICE_CAR('\uD83D', '\uDE93'), TAXI('\uD83D', '\uDE95'), AUTOMOBILE('\uD83D', '\uDE97'), RECREATIONAL_VEHICLE('\uD83D', '\uDE99'), DELIVERY_TRUCK('\uD83D', '\uDE9A'), SHIP('\uD83D', '\uDEA2'), SPEEDBOAT('\uD83D', '\uDEA4'), HORIZONTAL_TRAFFIC_LIGHT('\uD83D', '\uDEA5'), CONSTRUCTION_SIGN('\uD83D', '\uDEA7'), POLICE_CARS_REVOLVING_LIGHT('\uD83D', '\uDEA8'), TRIANGULAR_FLAG_ON_POST('\uD83D', '\uDEA9'), DOOR('\uD83D', '\uDEAA'), NO_ENTRY_SIGN('\uD83D', '\uDEAB'), SMOKING_SYMBOL('\uD83D', '\uDEAC'), NO_SMOKING_SYMBOL('\uD83D', '\uDEAD'), BICYCLE('\uD83D', '\uDEB2'), PEDESTRIAN('\uD83D', '\uDEB6'), MENS_SYMBOL('\uD83D', '\uDEB9'), WOMENS_SYMBOL('\uD83D', '\uDEBA'), RESTROOM('\uD83D', '\uDEBB'), BABY_SYMBOL('\uD83D', '\uDEBC'), TOILET('\uD83D', '\uDEBD'), WATER_CLOSET('\uD83D', '\uDEBE'), BATH('\uD83D', '\uDEC0'), // Weather UMBRELLA_WITH_RAIN_DROPS(null, '\u2614'), HIGH_VOLTAGE_SIGN(null, '\u26A1'), SNOWMAN_WITHOUT_SNOW(null, '\u26C4'), SUN_BEHIND_CLOUD(null, '\u26C5'), CLOSED_UMBRELLA('\uD83C', '\uDF02'), SUN_WITH_FACE('\uD83C', '\uDF1E'), FOGGY('\uD83C', '\uDF01'), CLOUD(null, '\u2601'), // Others LEFT_RIGHT_ARROW(null, '\u2194'), ALARM_CLOCK(null, '\u23F0'), SOON_WITH_RIGHTWARDS_ARROW_ABOVE('\uD83D', '\uDD1C'), EARTH_GLOBE_EUROPE_AFRICA('\uD83C', '\uDF0D'), GLOBE_WITH_MERIDIANS('\uD83C', '\uDF10'), STRAIGHT_RULER('\uD83D', '\uDCCF'), INFORMATION_SOURCE(null, '\u2139'), BLACK_RIGHT_POINTING_DOUBLE_TRIANGLE(null, '\u23E9'), BLACK_RIGHT_POINTING_TRIANGLE(null, '\u25B6'), BACK_WITH_LEFTWARDS_ARROW_ABOVE('\uD83D', '\uDD19'), WRENCH('\uD83D', '\uDD27'), DIGIT_THREE(null, '\u0033'), CLIPBOARD('\uD83D', '\uDCCB'), THUMBS_UP_SIGN('\uD83D', '\uDC4D'), WHITE_RIGHT_POINTING_BACKHAND_INDEX('\uD83D', '\uDC49'), TEAR_OFF_CALENDAR('\uD83D', '\uDCC6'), LARGE_ORANGE_DIAMOND('\uD83D', '\uDD36'), HUNDRED_POINTS_SYMBOL('\uD83D', '\uDCAF'), ROUND_PUSHPIN('\uD83D', '\uDCCD'), WAVING_HAND_SIGN('\uD83D', '\uDC4B'); Character firstChar; Character secondChar; Emoji(Character firstChar, Character secondChar) { this.firstChar = firstChar; this.secondChar = secondChar; } @Override public String toString() { StringBuilder sb = new StringBuilder(); if (this.firstChar != null) { sb.append(this.firstChar); } if (this.secondChar != null) { sb.append(this.secondChar); } return sb.toString(); } }
[ "samvimes@yandex.ru" ]
samvimes@yandex.ru
d8754beb5cebbf0cc27f459271fb400dff115cd6
679a32a72f8727e66cf9d07edbff1098022ffee0
/Kin-Hadoop/kin-hadoop-core/src/main/java/org/kin/hadoop/common/writable/MapWritable.java
9d01b020fbad2f7a012595c53e863ac9063005ec
[]
no_license
didiaode18/BigData
3153a56a3cc5e30f0718cb01dce23039938e837c
d861ee25676365fe22e5d91de45a60a7ce2f3cf6
refs/heads/master
2020-05-27T19:48:12.547100
2019-04-30T07:20:29
2019-04-30T07:20:29
null
0
0
null
null
null
null
UTF-8
Java
false
false
6,277
java
package org.kin.hadoop.common.writable; import org.apache.hadoop.io.WritableComparable; import org.kin.framework.utils.ClassUtils; import java.io.DataInput; import java.io.DataOutput; import java.io.IOException; import java.util.*; /** * Created by huangjianqin on 2017/9/4. * 写入顺序size(int), [keyBytes, valueBytes]....... * <p> * 不能写入null * equal hashcode是对比实例引用 * compareTo以key类型和key实例为基准 * <p> * 本质上是基类 * Comparator实现需先根据map长度判断,再对比key */ public class MapWritable<K extends WritableComparable, V extends WritableComparable> implements WritableComparable<MapWritable<K, V>>, Map<K, V> { private final Class<K> keyClass; private final Class<V> valueClass; private Map<K, V> map = new HashMap<>(); public MapWritable(Class<K> keyClass, Class<V> valueClass) { this.keyClass = keyClass; this.valueClass = valueClass; } public MapWritable(Class<K> keyClass, Class<V> valueClass, Map<K, V> map, boolean isOverwrite) { this.keyClass = keyClass; this.valueClass = valueClass; if (isOverwrite) { this.map = map; } else { putAll(map); } } public String mkString(String separator) { if (separator == null || separator.equals("")) { separator = ","; } if (map.size() > 0) { StringBuilder sb = new StringBuilder(); for (Entry<K, V> entry : map.entrySet()) { sb.append("(" + entry.getKey() + ", " + entry.getValue() + ")" + separator); } sb.replace(sb.length() - separator.length(), sb.length(), ""); return sb.toString(); } return ""; } @Override public int compareTo(MapWritable o) { if (o == null) { return 1; } Integer thisSize = map.size(); Integer thatsize = o.map.size(); Integer lCmd = thisSize.compareTo(thatsize); if (lCmd != 0) { return lCmd; } Iterator<K> thisIterator = map.keySet().iterator(); Iterator<K> thatIterator = o.map.keySet().iterator(); while (thisIterator.hasNext() && thatIterator.hasNext()) { K thisWC = thisIterator.next(); K thatWC = thatIterator.next(); Integer cmd = thisWC.compareTo(thatWC); if (cmd != 0) { return cmd; } } return 0; } @Override public void write(DataOutput dataOutput) throws IOException { dataOutput.writeInt(map.size()); for (Entry<K, V> entry : map.entrySet()) { entry.getKey().write(dataOutput); entry.getValue().write(dataOutput); } } @Override public void readFields(DataInput dataInput) throws IOException { int size = dataInput.readInt(); for (int i = 0; i < size; i++) { K key = ClassUtils.instance(keyClass); V value = ClassUtils.instance(valueClass); key.readFields(dataInput); value.readFields(dataInput); map.put(key, value); } } @Override public int size() { return map.size(); } @Override public boolean isEmpty() { return map.isEmpty(); } @Override public boolean containsKey(Object key) { return map.containsKey(key); } @Override public boolean containsValue(Object value) { return map.containsValue(value); } @Override public V get(Object key) { return (V) map.get(key); } @Override public V getOrDefault(Object key, V defaultValue) { if (map.containsKey(key)) { return (V) map.get(key); } return defaultValue; } @Override public V put(K key, V value) { if (key == null || value == null) { throw new IllegalArgumentException("key or value can't be null"); } return (V) map.put(key, value); } @Override public V putIfAbsent(K key, V value) { if (!map.containsKey(key)) { map.put(key, value); return value; } return null; } @Override public V remove(Object key) { if (keyClass.isAssignableFrom(key.getClass())) { return (V) map.remove(key); } return null; } @Override public void putAll(Map<? extends K, ? extends V> map) { if (map.containsKey(null) || map.containsValue(null)) { throw new IllegalArgumentException("key or value can't be null"); } this.map.putAll(map); } @Override public void clear() { map.clear(); } @Override public Set<K> keySet() { return (Set<K>) map.keySet(); } @Override public Collection<V> values() { return (Collection<V>) map.values(); } @Override public Set<Entry<K, V>> entrySet() { Set<Entry<K, V>> result = new HashSet<>(); for (Entry<K, V> entry : map.entrySet()) { result.add((Entry<K, V>) entry); } return result; } @Override public boolean equals(Object o) { if (this == o) return true; if (!(o instanceof MapWritable)) return false; MapWritable<?, ?> that = (MapWritable<?, ?>) o; if (keyClass != null ? !keyClass.equals(that.keyClass) : that.keyClass != null) return false; if (valueClass != null ? !valueClass.equals(that.valueClass) : that.valueClass != null) return false; return map != null ? map.equals(that.map) : that.map == null; } @Override public int hashCode() { int result = keyClass != null ? keyClass.hashCode() : 0; result = 31 * result + (valueClass != null ? valueClass.hashCode() : 0); result = 31 * result + (map != null ? map.hashCode() : 0); return result; } @Override public String toString() { return mkString(","); } public Class<K> getKeyClass() { return keyClass; } public Class<V> getValueClass() { return valueClass; } }
[ "18814127639@163.com" ]
18814127639@163.com
276e520d99316414bc58f8be97460669b1a37c5f
a03ddb4111faca852088ea25738bc8b3657e7b5c
/TestTransit/src/jp/co/yahoo/android/apps/transit/timer/api/RevGeocoder.java
a9421f94691d9ae194bc1d36d4adfb8833381358
[]
no_license
randhika/TestMM
5f0de3aee77b45ca00f59cac227450e79abc801f
4278b34cfe421bcfb8c4e218981069a7d7505628
refs/heads/master
2020-12-26T20:48:28.446555
2014-09-29T14:37:51
2014-09-29T14:37:51
24,874,176
2
0
null
null
null
null
UTF-8
Java
false
false
1,464
java
// Decompiled by Jad v1.5.8e. Copyright 2001 Pavel Kouznetsov. // Jad home page: http://www.geocities.com/kpdus/jad.html // Decompiler options: braces fieldsfirst space lnc package jp.co.yahoo.android.apps.transit.timer.api; import android.content.Context; import android.os.Bundle; import java.util.HashMap; import jp.co.yahoo.android.yolp.common.YolpApiBase; import org.json.JSONArray; import org.json.JSONException; import org.json.JSONObject; public class RevGeocoder extends YolpApiBase { public RevGeocoder(Context context) { super(context); setUri(context.getString(0x7f0d004b)); setAppid(context.getString(0x7f0d004c)); } protected void analyze() { JSONArray jsonarray = getFeature(); String as[] = new String[jsonarray.length()]; int i = 0; while (i < jsonarray.length()) { try { as[i] = jsonarray.getJSONObject(i).getJSONObject("Property").getString("Address"); } catch (JSONException jsonexception) { } i++; } Bundle bundle = new Bundle(); bundle.putStringArray(context.getString(0x7f0d01a2), as); setResult(bundle); } public void setDatum(String s) { param.put("datum", s); } public void setLat(String s) { param.put("lat", s); } public void setLon(String s) { param.put("lon", s); } }
[ "metromancn@gmail.com" ]
metromancn@gmail.com
d81f4f51f3edd0feddb40639b763634d0125ca82
89c66bf8e3708b5ea372ee0af39c56213d90094a
/web-service/src/test/java/org/adarrivi/writer/ws/integration/IntegrationTestHttpRequest.java
d7b39150f5af200806b0e7831f622141ce97a99c
[]
no_license
adarrivi/writers-ws
60af78089a730e54679b6560821cfcccfa8d6494
6c33039c02d95314ec4334c16834175b1d8471da
refs/heads/master
2020-05-20T05:05:12.095305
2015-03-09T20:38:02
2015-03-09T20:38:02
31,920,542
1
0
null
null
null
null
UTF-8
Java
false
false
2,787
java
package org.adarrivi.writer.ws.integration; import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.get; import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.post; import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.status; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.http.MediaType; import org.springframework.test.web.servlet.MockMvc; import org.springframework.test.web.servlet.ResultActions; public class IntegrationTestHttpRequest { private static final Logger LOGGER = LoggerFactory.getLogger(IntegrationTestHttpRequest.class); private MockMvc mockMvc; private ResultActions resultActions; public IntegrationTestHttpRequest(MockMvc mockMvc) { this.mockMvc = mockMvc; } public void performJsonGet(String url, JsonDto<?> dto) { try { resultActions = mockMvc.perform(get(url).contentType(MediaType.APPLICATION_JSON).content(dto.toJsonString())); } catch (Exception ex) { throw new AssertionError(ex); } } public void performGet(String url) { try { resultActions = mockMvc.perform(get(url)); } catch (Exception ex) { throw new AssertionError(ex); } } public void performJsonPost(String url, JsonDto<?> dto) { try { resultActions = mockMvc.perform(post(url).contentType(MediaType.APPLICATION_JSON).content(dto.toJsonString())); } catch (Exception ex) { throw new AssertionError(ex); } } public void assertHttpOkResponse() { try { resultActions.andExpect(status().isOk()); } catch (Exception ex) { throw new AssertionError(ex); } } public void assertBadRequestResponse() { try { resultActions.andExpect(status().isBadRequest()); } catch (Exception ex) { throw new AssertionError(ex); } } public void assertNotFoundResponse() { try { resultActions.andExpect(status().isNotFound()); } catch (Exception ex) { throw new AssertionError(ex); } } public String getResponseAsString() { try { return resultActions.andReturn().getResponse().getContentAsString(); } catch (Exception ex) { throw new AssertionError(ex); } } public <T extends Object> T getResponseAsJsonObject(Class<T> jsonObjectClass) { JsonDto<T> response = new JsonDto<T>(getResponseAsString(), jsonObjectClass); return response.toJsonObject(); } public void logResponse() { LOGGER.debug("Response: {}", getResponseAsString()); } }
[ "adarrivi@gmail.com" ]
adarrivi@gmail.com
e659418215decef2d6cbdb317bb28e4a21364378
bccc159c3063829cbd66d845c9f0e12aa93cb5f2
/Exercise6/src/GSON/Client.java
1a547360a14c8e76ff85b7baca195df181b31a54
[]
no_license
11michi11/SDJ2
012e60437376f04e708643ac7fc1a91eba24fb4f
46138e29290465f789961eb4f0d3b9625b0b6b1b
refs/heads/master
2018-09-07T12:53:47.265852
2018-06-09T16:35:19
2018-06-09T16:35:19
120,578,391
0
1
null
null
null
null
UTF-8
Java
false
false
165
java
package GSON; public class Client { public static void main(String[] args) { ChatClient client = new ChatClient("25.0.70.31", 2910); client.execute(); } }
[ "11michi11@gmail.com" ]
11michi11@gmail.com
abb3ba6142b692a2928f7c4cca954f0634a34ffc
f695ffad9aacddd7628ec41bb8250890a36734c8
/ecp-server/ecp-server-admin/src/main/java/com/everwing/server/admin/controller/AppPkgController.java
e6961990a9825551f3ead145b0221cd3818cae93
[]
no_license
zouyuanfa/Everwing-Cloud-Platform
9dea7e324f9447250b1b033509f17f7c8a0921be
f195dfe95f0addde56221d5c1b066290ad7ba62f
refs/heads/master
2020-04-13T18:22:36.731469
2018-12-28T06:18:37
2018-12-28T06:18:37
163,372,146
0
4
null
null
null
null
UTF-8
Java
false
false
2,276
java
package com.everwing.server.admin.controller; import com.everwing.coreservice.common.admin.util.PageBean; import com.everwing.coreservice.common.platform.entity.generated.AppPkg; import com.everwing.coreservice.common.platform.entity.generated.UploadFile; import org.apache.commons.codec.digest.DigestUtils; import org.springframework.stereotype.Controller; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.ResponseBody; import org.springframework.web.multipart.MultipartFile; import java.util.Date; @Controller @RequestMapping("/appPkg") public class AppPkgController extends BaseController { @GetMapping("/main") public String index() { return toAdminView("app_pkg"); } @GetMapping("/list") public @ResponseBody String list(PageBean pageBean) { addParamToPageBean(pageBean, "version", "timeStart", "type", "timeEnd"); return renderAdminJson(commonAdminApi.listAppPkgByPage(pageBean)); } @GetMapping("/delete") public @ResponseBody String delete(String id) { return renderApiJson(commonAdminApi.deleteAppPkgByPrimaryKey(id)); } @GetMapping("/update") public @ResponseBody String update(AppPkg appPkg) { if (appPkg.getStatus() !=null && appPkg.getStatus() == 1) { //先禁用同类型所有数据 commonAdminApi.banAllPkgByType(appPkg.getType()); appPkg.setAvailableTime(new Date()); appPkg.setAvailableAccountId(getCurrUser().getAccountId()); } return renderApiJson(commonAdminApi.updateAppPkgByPrimaryKeySelective(appPkg)); } @PostMapping("/save") public @ResponseBody String save(AppPkg appPkg, MultipartFile uploadFile) throws Exception { //保存到文件系统 UploadFile file = getModel(fastDFSApi.uploadFile(uploadFile)); String fileId = file.getUploadFileId(); // 插入升级包数据 appPkg.setMd5(DigestUtils.md5Hex(uploadFile.getInputStream())); appPkg.setStatus(0); appPkg.setAppPkgId(fileId); appPkg.setUploadTime(new Date()); appPkg.setUploadAccountId(getCurrUser().getAccountId()); appPkg.setPkgFileId(fileId); handleResult(commonAdminApi.addAppPkg(appPkg)); return renderSuccess(); } }
[ "17711642361@163.com" ]
17711642361@163.com
51a1b112295c5632c8974729e1562cd054ac7ca6
306d6a7aa91f3f93465f5466a7843c2171a0bbfa
/notification-service/src/main/java/cm/g2s/notification/exception/ConflictException.java
feae400299d8242c828198e05e0a17ef7d38467b
[]
no_license
briceamk/gmoney-ms
9ce45f86261f9c725b5ce7d741f2155607801f8e
bae4ee696317792ad28614380843b4ca29fca2d8
refs/heads/master
2023-01-14T18:49:24.087676
2020-11-19T16:54:03
2020-11-19T16:54:03
262,711,838
0
0
null
null
null
null
UTF-8
Java
false
false
502
java
package cm.g2s.notification.exception; import org.springframework.http.HttpStatus; import org.springframework.web.bind.annotation.ResponseStatus; @ResponseStatus(HttpStatus.CONFLICT) public class ConflictException extends RuntimeException { public ConflictException(String message) { super(message); } public ConflictException(Throwable cause) { super(cause); } public ConflictException(String message, Throwable cause) { super(message, cause); } }
[ "ambiandji@gmail.com" ]
ambiandji@gmail.com
45149b260dfe04c1e3657aafb8c714b93c35bc76
b9559e00a99cc08ee72efb30d3a04166054651e2
/Java/AHEAD/syntax/AST_FieldDeclElem.java
505a8d4712d698efc5427a4fef0d86aa78342511
[]
no_license
joliebig/featurehouse_fstcomp_examples
d4dd7d90a77ae3b20b6118677a17001fdb53ee93
20dd7dc9a807ec0c20939eb5c6e00fcc1ce19d20
refs/heads/master
2021-01-19T08:08:37.797995
2013-01-29T13:48:20
2013-01-29T13:48:20
null
0
0
null
null
null
null
UTF-8
Java
false
false
468
java
// Automatically generated code. Edit at your own risk! // Generated by bali2jak v2002.09.03. public class AST_FieldDeclElem extends AstListNode { public ClassBodyDeclaration getClassBodyDeclaration () { return (ClassBodyDeclaration) arg [0] ; } public AST_FieldDeclElem setParms (ClassBodyDeclaration arg0) { super.setParms (arg0) ; /* ClassBodyDeclaration */ return (AST_FieldDeclElem) this ; } }
[ "apel" ]
apel
d0fffaed5d3fb6af4ff879a9502981470587a728
482c9f4123a19e8164203edd92fc32033b78e17b
/MGB code/WestLB_RMSC_MGB/Java Source/de/westlb/mgb/struts_client/action/TraderResponseAction.java
d22116fa0416528b8b58fd1238ba7072e0e841d5
[]
no_license
Dilip96407/Dilip
54b405f29dd4f78fc653202e9c709cc96c1ac72a
feb245229e90195776b0113bc62ed5da2422d321
refs/heads/master
2022-12-22T13:27:19.320244
2019-11-13T09:37:12
2019-11-13T09:37:12
218,457,904
0
0
null
2022-12-14T05:26:38
2019-10-30T06:27:45
HTML
UTF-8
Java
false
false
2,160
java
/* * Created on Jan 16, 2004 * * To change the template for this generated file go to * Window&gt;Preferences&gt;Java&gt;Code Generation&gt;Code and Comments */ package de.westlb.mgb.struts_client.action; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import org.apache.struts.action.ActionForm; import org.apache.struts.action.ActionForward; import org.apache.struts.action.ActionMapping; import de.westlb.mgb.client.server.Mgb; import de.westlb.mgb.client.server.vo.MailVo; import de.westlb.mgb.client.server.vo.TradeOverviewVo; import de.westlb.mgb.model.definition.MailTypeDef; import de.westlb.mgb.struts_client.RequestKeys; /** * @author WSY4148 * */ public class TraderResponseAction extends MgbAction { /** * */ public TraderResponseAction() { super(); } /* (Kein Javadoc) * @see org.apache.struts.action.Action#execute(org.apache.struts.action.ActionMapping, org.apache.struts.action.ActionForm, javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse) */ @Override public ActionForward execute(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws Exception { String userId = assertNtlmAuthentication(request, response); Mgb mgb = getMgbService(request, response, null); String mailId = request.getParameter("mailId"); MailVo mailVo = mgb.getMail(Long.parseLong(mailId)); TradeOverviewVo tradeVo = mgb.getTradeOverview(mailVo.getTradeId()); MailVo[] mailChildList = mgb.getChildMails(mailVo.getId(), false, new String[] { MailTypeDef.TRADER_RESPONSE} ); if (Boolean.TRUE.equals(tradeVo.getReclamationIsClosed())) { return mapping.findForward("reclamationClosed"); } else if (!mgb.isTradeAccessGranted(mailVo.getTradeId(), userId)){ return mapping.findForward("tradeAccessDenied"); } request.setAttribute(RequestKeys.MAIL_VO, mailVo); request.setAttribute(RequestKeys.TRADE_VO, tradeVo); request.setAttribute(RequestKeys.MAIL_CHILD_LIST, mailChildList); return mapping.findForward("success"); } }
[ "dgagre15@in.ibm.com" ]
dgagre15@in.ibm.com
9869a7e15afa11d6d4c7d7b0247ec044a6ca2469
6b90a6d1f629187840508653a4cd023bd9b11490
/core/src/main/java/com/orientechnologies/orient/core/db/record/ORecordLazyMultiValue.java
93e26144e3fc32934f5cf991cb7eebc5dd5bc051
[ "BSD-3-Clause", "CDDL-1.0", "Apache-2.0" ]
permissive
Param999/orientdb
6e4db65853aecda6df65d66a95ea28a7545a357b
54b1dffef622ce98fc446dd3441f1cd6acf153b9
refs/heads/develop
2020-06-14T16:12:00.437691
2020-01-28T14:05:05
2020-01-28T14:05:05
195,048,140
0
0
Apache-2.0
2020-01-28T14:05:07
2019-07-03T12:21:50
Java
UTF-8
Java
false
false
1,468
java
/* * * * Copyright 2010-2016 OrientDB LTD (http://orientdb.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. * * * * For more information: http://orientdb.com * */ package com.orientechnologies.orient.core.db.record; import com.orientechnologies.common.util.OSizeable; import java.util.Iterator; public interface ORecordLazyMultiValue extends OAutoConvertToRecord, ODetachable, OSizeable { Iterator<OIdentifiable> rawIterator(); /** * Browse all the set to convert all the items into records. * * It converts only items that already loaded into memory from storage. To convert records that will be fetched from disk later * use {@link #setAutoConvertToRecord(boolean)} */ void convertLinks2Records(); /** * Browse all the set to convert all the items into links. * * @return */ boolean convertRecords2Links(); }
[ "lomakin.andrey@gmail.com" ]
lomakin.andrey@gmail.com
f764387e67cc3d4e01920759f8ec796cba1399b7
be73270af6be0a811bca4f1710dc6a038e4a8fd2
/crash-reproduction-moho/results/TIME-10b-2-9-SPEA2-WeightedSum:TestLen:CallDiversity/org/joda/time/field/PreciseDurationDateTimeField_ESTest_scaffolding.java
c97f2eb70c426e643b5dccf34fe64704563e2125
[]
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
2,996
java
/** * Scaffolding file used to store all the setups needed to run * tests automatically generated by EvoSuite * Sun Jan 19 04:42:40 UTC 2020 */ package org.joda.time.field; import org.evosuite.runtime.annotation.EvoSuiteClassExclude; import org.junit.BeforeClass; import org.junit.Before; import org.junit.After; @EvoSuiteClassExclude public class PreciseDurationDateTimeField_ESTest_scaffolding { @org.junit.Rule public org.evosuite.runtime.vnet.NonFunctionalRequirementRule nfr = new org.evosuite.runtime.vnet.NonFunctionalRequirementRule(); private org.evosuite.runtime.thread.ThreadStopper threadStopper = new org.evosuite.runtime.thread.ThreadStopper (org.evosuite.runtime.thread.KillSwitchHandler.getInstance(), 3000); @BeforeClass public static void initEvoSuiteFramework() { org.evosuite.runtime.RuntimeSettings.className = "org.joda.time.field.PreciseDurationDateTimeField"; org.evosuite.runtime.GuiSupport.initialize(); org.evosuite.runtime.RuntimeSettings.maxNumberOfIterationsPerLoop = 10000; org.evosuite.runtime.RuntimeSettings.mockSystemIn = true; org.evosuite.runtime.Runtime.getInstance().resetRuntime(); } @Before public void initTestCase(){ threadStopper.storeCurrentThreads(); threadStopper.startRecordingTime(); org.evosuite.runtime.GuiSupport.setHeadless(); org.evosuite.runtime.Runtime.getInstance().resetRuntime(); org.evosuite.runtime.agent.InstrumentingAgent.activate(); } @After public void doneWithTestCase(){ threadStopper.killAndJoinClientThreads(); org.evosuite.runtime.agent.InstrumentingAgent.deactivate(); org.evosuite.runtime.GuiSupport.restoreHeadlessMode(); } private static void initializeClasses() { org.evosuite.runtime.classhandling.ClassStateSupport.initializeClasses(PreciseDurationDateTimeField_ESTest_scaffolding.class.getClassLoader() , "org.joda.time.field.BaseDateTimeField", "org.joda.time.field.TestPreciseDurationDateTimeField$MockPreciseDurationDateTimeField", "org.joda.time.DurationField", "org.joda.time.field.TestPreciseDurationDateTimeField$MockCountingDurationField", "org.joda.time.field.PreciseDurationDateTimeField", "org.joda.time.IllegalFieldValueException", "org.joda.time.field.TestPreciseDurationDateTimeField$MockZeroDurationField", "org.joda.time.field.TestPreciseDurationDateTimeField", "org.joda.time.DurationFieldType", "org.joda.time.ReadablePartial", "org.joda.time.DateTimeField", "org.joda.time.DateTimeFieldType", "org.joda.time.DurationFieldType$StandardDurationFieldType", "org.joda.time.field.FieldUtils", "org.joda.time.field.TestPreciseDurationDateTimeField$MockImpreciseDurationField", "org.joda.time.field.BaseDurationField", "org.joda.time.field.TestPreciseDurationDateTimeField$MockStandardBaseDateTimeField", "org.joda.time.DateTimeFieldType$StandardDateTimeFieldType" ); } }
[ "pouria.derakhshanfar@gmail.com" ]
pouria.derakhshanfar@gmail.com
7994517f3dac2ea56d4a939d95e86df2e5aa57c1
8a98577c5995449677ede2cbe1cc408c324efacc
/Big_Clone_Bench_files_used/bcb_reduced/3/selected/897974.java
17e2bc743cf8c2990925b2b0fb0664ed9a183b3b
[ "MIT" ]
permissive
pombredanne/lsh-for-source-code
9363cc0c9a8ddf16550ae4764859fa60186351dd
fac9adfbd98a4d73122a8fc1a0e0cc4f45e9dcd4
refs/heads/master
2020-08-05T02:28:55.370949
2017-10-18T23:57:08
2017-10-18T23:57:08
null
0
0
null
null
null
null
UTF-8
Java
false
false
1,074
java
package cz.softinel.uaf.util; import java.io.UnsupportedEncodingException; import java.net.URLEncoder; import java.security.MessageDigest; import java.security.NoSuchAlgorithmException; public final class EncryptionHelper { private static final String MD5_HASH_ALGORITHM = "MD5"; private static final String URL_ENCODING = "UTF-8"; private EncryptionHelper() { } public static String md5(String text) { if (text == null) { return null; } try { MessageDigest md = MessageDigest.getInstance(MD5_HASH_ALGORITHM); byte digest[] = md.digest(text.getBytes()); return ArrayHelper.toHexString(digest); } catch (NoSuchAlgorithmException e) { throw new RuntimeException(e); } } public static String urlEncode(String url) { try { return URLEncoder.encode(url, URL_ENCODING); } catch (UnsupportedEncodingException e) { throw new RuntimeException("Unexpected exception: " + e.getMessage(), e); } } }
[ "nishima@mymail.vcu.edu" ]
nishima@mymail.vcu.edu
ac6b8aa8be11d9bc1a94694878423dec2b8f6861
52f6f72c7574c7b2c0f1f93d40127ab3fbddf483
/gmall-api/src/main/java/cn/leolam10/gmall/pms/entity/ProductCategoryAttributeRelation.java
a8daa0503dd39428869c98980cb52115cd2faebe
[]
no_license
LeoLam10/gmall
b457436d50e37e2a7cd54e9feda28f19f4098e9a
c8051fbd720cc1c66f973227afe7dab18f393a1a
refs/heads/master
2023-03-11T17:08:50.765302
2021-03-02T14:32:33
2021-03-02T14:32:33
281,711,065
0
0
null
2020-07-31T15:14:57
2020-07-22T15:13:48
Java
UTF-8
Java
false
false
1,214
java
package cn.leolam10.gmall.pms.entity; import com.baomidou.mybatisplus.annotation.TableName; import com.baomidou.mybatisplus.annotation.IdType; import com.baomidou.mybatisplus.annotation.TableId; import com.baomidou.mybatisplus.annotation.TableField; import java.io.Serializable; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import lombok.Data; import lombok.EqualsAndHashCode; import lombok.experimental.Accessors; /** * <p> * 产品的分类和属性的关系表,用于设置分类筛选条件 * </p> * * @author Leo * @since 2020-08-16 */ @Data @EqualsAndHashCode(callSuper = false) @Accessors(chain = true) @TableName("pms_product_category_attribute_relation") @ApiModel(value="ProductCategoryAttributeRelation对象", description="产品的分类和属性的关系表,用于设置分类筛选条件") public class ProductCategoryAttributeRelation implements Serializable { private static final long serialVersionUID = 1L; @TableId(value = "id", type = IdType.AUTO) private Long id; @TableField("product_category_id") private Long productCategoryId; @TableField("product_attribute_id") private Long productAttributeId; }
[ "LeoLam101010@gmail.com" ]
LeoLam101010@gmail.com
496888f99d80eaa89a020f3c9fb0994a0999aa83
8f149248c4ee03ca3bd602ad98d434a8e954460d
/graph/src/test/java/com/mastfrog/graph/IntPathTest.java
9638af47ab2024a3afdf6ab4d17c6f54d81c5884
[]
no_license
anshulg5/util
893ccc5c3aa4c56ab8a8df5e8f540754424bb441
d60eb317db85daeda55d6a9246653589d25408d3
refs/heads/master
2023-01-03T09:19:08.743527
2020-10-16T17:46:05
2020-10-16T17:46:05
null
0
0
null
null
null
null
UTF-8
Java
false
false
8,043
java
package com.mastfrog.graph; import java.util.ArrayList; import java.util.List; import static org.junit.jupiter.api.Assertions.*; import org.junit.jupiter.api.Test; /** * * @author Tim Boudreau */ public class IntPathTest { @Test public void testParse() { IntPath a = IntPath.of(32, 31, 33, 32, 35, 34, 102); IntPath b = IntPath.parse(a.toString()); assertEquals(a, b); } @Test public void testCreationMethodsAndGeneralFunctionality() { int[] vals = new int[10]; List<Integer> ints = new ArrayList<>(vals.length); IntPath.Builder bldr = IntPath.builder(); for (int i = 50; i < 60; i++) { vals[i - 50] = i; bldr.add(i); ints.add(i); } IntPath exp = IntPath.of(50, 51, 52, 53, 54, 55, 56, 57, 58, 59); assertEquals(vals.length, exp.size(), "Sanity check - size wrong"); for (int i = 0; i < exp.size(); i++) { assertEquals(i + 50, exp.get(i), "Sanity check failed"); } IntPath a = IntPath.of(vals); IntPath b = IntPath.of(ints); IntPath c = bldr.build(); IntPath d = IntPath.builder(50).add(51, 52, 53, 54, 55, 56, 57, 58, 59).build(); assertEquals(exp, a, "Created-from-array path mismatch"); assertEquals(exp, b, "Created-from-collection path mismatch"); assertEquals(exp, c, "Created-from-builder path mismatch"); assertEquals(exp, d, "Created-from-builder-with-bulk-add mismatch"); IntPath e = a.prepending(49); assertNotSame(e, a); assertEquals(vals.length + 1, e.size()); for (int i = 0; i < 11; i++) { assertEquals(49 + i, e.get(i)); } IntPath f = e.appending(60); for (int i = 0; i < 12; i++) { assertEquals(49 + i, f.get(i)); } IntPath g = f.appending(IntPath.of(61, 62)); assertEquals(14, g.size()); for (int i = 0; i < 14; i++) { assertEquals(49 + i, g.get(i)); } IntPath parents = g.copy(); assertEquals(g, parents); IntPath kids = g.copy(); assertEquals(g, parents); for (int i = 0; i < 14; i++) { int sz = parents.size(); assertEquals(sz, kids.size()); parents = parents.parentPath(); kids = kids.childPath(); assertEquals(sz - 1, kids.size()); assertEquals(sz - 1, parents.size()); if (i < 13) { int expChild = g.get(i + 1); assertEquals(expChild, kids.get(0)); assertEquals(g.get(g.size() - 1), kids.get(kids.size() - 1)); int expPar = g.get(g.size() - (2 + i)); assertEquals(expPar, parents.get(parents.size() - 1)); assertEquals(g.get(0), parents.get(0)); } } for (int i = 0; i < g.size(); i++) { for (int j = g.size()-1; j > i; j--) { IntPath sub = g.subPath(i, j); for (int k = 0; k < sub.size(); k++) { assertEquals(g.get(i+k), sub.get(k)); } } } } @Test public void testCopy() { IntPath a = new IntPath(5).add(2).add(4).add(6).add(8).add(10).add(12).add(14); IntPath b = a.copy(); assertEquals(a.size(), b.size()); assertNotSame(a, b); assertEquals(a, b); } @Test public void testCombine() { IntPath a = new IntPath(5).add(2).add(4).add(6).add(8).add(10).add(12).add(14); IntPath b = new IntPath(5).add(1).add(3).add(5).add(7).add(9).add(11).add(13); IntPath e = new IntPath(5).add(2).add(4).add(6).add(8).add(10).add(12).add(14).add(1).add(3).add(5).add(7).add(9).add(11).add(13); assertEquals(7, a.size()); a.append(b); assertEquals(14, a.size()); assertEquals(e, a); IntPath replacement = new IntPath().add(3).add(4).add(5).add(6).add(7); IntPath exp = new IntPath().add(2).add(3).add(4).add(5).add(6).add(7); a.replaceFrom(1, replacement); assertEquals(exp, a); IntPath expRev = new IntPath().add(7).add(6).add(5).add(4).add(3).add(2); assertEquals(expRev, exp.reversed()); } @Test public void testSimpleMethods() { IntPath a = new IntPath(5).add(2).add(4).add(6).add(8).add(10).add(12).add(14); IntPath b = new IntPath(5).add(2).add(4).add(6).add(8).add(10).add(12).add(14); assertEquals(a, b); assertEquals(a, a.copy()); assertNotSame(a, a.copy()); assertEquals(a.hashCode(), b.hashCode()); assertTrue(a.contains(b)); assertFalse(a.contains(new IntPath(1).add(3))); assertFalse(a.isEmpty()); for (int i = 0; i < a.size(); i++) { assertEquals(i, a.indexOf(a.get(i))); } for (int i = 1; i < a.size(); i++) { IntPath test = new IntPath(); for (int j = 0; j < i; j++) { test.add(a.get(j)); } IntPath up = test.copy(); do { assertTrue(a.contains(up), "Should contain " + up); up = up.parentPath(); } while (!up.isEmpty()); IntPath down = test.copy(); do { assertTrue(a.contains(down), "Should contain " + down); down = down.childPath(); } while (!down.isEmpty()); } } @Test public void testContains() { IntPath pth = IntPath.of(0, 1, 2, 5, 6); assertContains(pth, IntPath.of(5, 6)); assertContains(pth, IntPath.of(2, 5, 6)); assertContains(pth, IntPath.of(1, 2, 5, 6)); assertContains(pth, IntPath.of(0, 1, 2, 5, 6)); assertContains(pth, IntPath.of(1, 2, 5, 6)); assertContains(pth, IntPath.of(1, 2, 5)); assertContains(pth, IntPath.of(1, 2, 5, 6)); assertContains(pth, IntPath.of(0, 1, 2, 5)); assertNotContains(pth, IntPath.of(2, 6)); assertContains(pth, IntPath.of(0)); assertContains(pth, IntPath.of(1)); assertContains(pth, IntPath.of(2)); assertContains(pth, IntPath.of(5)); assertContains(pth, IntPath.of(6)); } @Test public void testArrayEquals() { int[] ints = new int[]{0, 1, 2, 5, 6}; assertTrue(IntPath.arraysEquals(ints, 3, 5, new int[]{5, 6}, 0, 2)); } private void assertContains(IntPath container, IntPath contained) { assertTrue(container.contains(contained), container + " claims not to contain " + contained); } private void assertNotContains(IntPath container, IntPath contained) { assertFalse(container.contains(contained), container + " claims not to contain " + contained); } @Test public void testStartEnd() { IntPath a = new IntPath(true, new int[]{1, 2, 3, 4, 5}); IntPath b = new IntPath(true, new int[]{1, 2, 3, 4}); IntPath empty = IntPath.of(); IntPath tail = IntPath.of(3, 4, 5); IntPath five = IntPath.of(5); IntPath four = IntPath.of(5); IntPath twoThree = IntPath.of(2, 3); IntPath twoFour = IntPath.of(2, 4); assertTrue(a.startsWith(b)); assertFalse(b.startsWith(a)); assertTrue(a.endsWith(tail)); assertFalse(b.endsWith(tail)); assertFalse(tail.endsWith(b)); assertTrue(a.endsWith(five)); assertFalse(b.endsWith(five)); assertFalse(a.startsWith(five)); assertFalse(b.startsWith(five)); assertTrue(a.contains(b)); assertFalse(b.contains(a)); assertTrue(a.contains(twoThree)); assertTrue(b.contains(twoThree)); assertTrue(empty.isNotAPath()); assertTrue(five.isNotAPath()); assertTrue(four.isNotAPath()); assertFalse(a.startsWith(empty)); assertFalse(b.startsWith(empty)); assertFalse(empty.startsWith(a)); assertFalse(empty.startsWith(b)); } }
[ "tim@timboudreau.com" ]
tim@timboudreau.com
45968887459bfe9c1562eafcb98517943ea1402a
3f849df8d95b611d25d9143bfddda1c401c5e03c
/demo/src/main/java/io/xream/x7/demo/bean/CatMouse.java
819532fecc2d4bc0b85c459d6a062e49d8103587
[ "Apache-2.0" ]
permissive
slater1998/x7
694f91e7a8425921532c827c8f5402cb930968cf
51d43131d6d9a7a0dda4be1a022af9089373c07c
refs/heads/master
2020-12-05T06:24:20.083882
2020-06-24T13:15:02
2020-06-24T13:15:02
232,033,606
0
0
Apache-2.0
2020-06-24T13:15:03
2020-01-06T05:54:26
Java
UTF-8
Java
false
false
781
java
package io.xream.x7.demo.bean; import io.xream.x7.common.repository.X; public class CatMouse { @X.Key private long id; private long catId; private long mouseId; public long getId() { return id; } public void setId(long id) { this.id = id; } public long getCatId() { return catId; } public void setCatId(long catId) { this.catId = catId; } public long getMouseId() { return mouseId; } public void setMouseId(long mouseId) { this.mouseId = mouseId; } @Override public String toString() { return "CatMouse{" + "id=" + id + ", catId=" + catId + ", mouseId=" + mouseId + '}'; } }
[ "cooperation@qq.com" ]
cooperation@qq.com
b113a87de165dd473661ce2518075d4eba5d0811
148100c6a5ac58980e43aeb0ef41b00d76dfb5b3
/sources/com/google/android/exoplayer2/extractor/flv/C4019d.java
3985054e56928af7b4cc8651216fdf1382c66bb0
[]
no_license
niravrathod/car_details
f979de0b857f93efe079cd8d7567f2134755802d
398897c050436f13b7160050f375ec1f4e05cdf8
refs/heads/master
2020-04-13T16:36:29.854057
2018-12-27T19:03:46
2018-12-27T19:03:46
163,325,703
0
0
null
null
null
null
UTF-8
Java
false
false
2,782
java
package com.google.android.exoplayer2.extractor.flv; import com.google.android.exoplayer2.Format; import com.google.android.exoplayer2.extractor.C2267n; import com.google.android.exoplayer2.extractor.flv.TagPayloadReader.UnsupportedFormatException; import com.google.android.exoplayer2.p126c.C2173i; import com.google.android.exoplayer2.p126c.C2175k; import com.google.android.exoplayer2.video.C2375a; /* renamed from: com.google.android.exoplayer2.extractor.flv.d */ final class C4019d extends TagPayloadReader { /* renamed from: b */ private final C2175k f16169b = new C2175k(C2173i.f6727a); /* renamed from: c */ private final C2175k f16170c = new C2175k(4); /* renamed from: d */ private int f16171d; /* renamed from: e */ private boolean f16172e; /* renamed from: f */ private int f16173f; public C4019d(C2267n c2267n) { super(c2267n); } /* renamed from: a */ protected boolean mo1621a(C2175k c2175k) { c2175k = c2175k.m7986g(); int i = (c2175k >> 4) & 15; c2175k &= 15; if (c2175k == 7) { this.f16173f = i; return i != 5 ? true : null; } else { StringBuilder stringBuilder = new StringBuilder(); stringBuilder.append("Video format not supported: "); stringBuilder.append(c2175k); throw new UnsupportedFormatException(stringBuilder.toString()); } } /* renamed from: a */ protected void mo1620a(C2175k c2175k, long j) { int g = c2175k.m7986g(); long k = j + (((long) c2175k.m7990k()) * 1000); if (g == 0 && !this.f16172e) { C2175k c2175k2 = new C2175k(new byte[c2175k.m7976b()]); c2175k.m7975a(c2175k2.f6735a, 0, c2175k.m7976b()); c2175k = C2375a.m8712a(c2175k2); this.f16171d = c2175k.f7540b; this.a.mo1606a(Format.m7737a(null, "video/avc", null, -1, -1, c2175k.f7541c, c2175k.f7542d, -1.0f, c2175k.f7539a, -1, c2175k.f7543e, null)); this.f16172e = true; } else if (g == 1 && this.f16172e) { byte[] bArr = this.f16170c.f6735a; bArr[0] = (byte) 0; bArr[1] = (byte) 0; bArr[2] = (byte) 0; g = 4 - this.f16171d; int i = 0; while (c2175k.m7976b() > 0) { c2175k.m7975a(this.f16170c.f6735a, g, this.f16171d); this.f16170c.m7979c(0); int t = this.f16170c.m7999t(); this.f16169b.m7979c(0); this.a.mo1607a(this.f16169b, 4); i += 4; this.a.mo1607a(c2175k, t); i += t; } this.a.mo1605a(k, this.f16173f == 1 ? 1 : 0, i, 0, null); } } }
[ "niravrathod473@gmail.com" ]
niravrathod473@gmail.com
3817908d2145055f6e43578e80f1225be80b4ac8
c885ef92397be9d54b87741f01557f61d3f794f3
/results/Cli-31/org.apache.commons.cli.OptionBuilder/BBC-F0-opt-70/tests/19/org/apache/commons/cli/OptionBuilder_ESTest.java
9c0eb5da53713b7da8679387c9179abf1f082df8
[ "CC-BY-4.0", "MIT" ]
permissive
pderakhshanfar/EMSE-BBC-experiment
f60ac5f7664dd9a85f755a00a57ec12c7551e8c6
fea1a92c2e7ba7080b8529e2052259c9b697bbda
refs/heads/main
2022-11-25T00:39:58.983828
2022-04-12T16:04:26
2022-04-12T16:04:26
309,335,889
0
1
null
2021-11-05T11:18:43
2020-11-02T10:30:38
null
UTF-8
Java
false
false
8,033
java
/* * This file was automatically generated by EvoSuite * Thu Oct 21 08:22:28 GMT 2021 */ package org.apache.commons.cli; import org.junit.Test; import static org.junit.Assert.*; import static org.evosuite.runtime.EvoAssertions.*; import org.apache.commons.cli.Option; import org.apache.commons.cli.OptionBuilder; 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) public class OptionBuilder_ESTest extends OptionBuilder_ESTest_scaffolding { @Test(timeout = 4000) public void test00() throws Throwable { OptionBuilder.isRequired(); Option option0 = OptionBuilder.create((String) null); assertTrue(option0.isRequired()); assertEquals((-1), option0.getArgs()); } @Test(timeout = 4000) public void test01() throws Throwable { OptionBuilder.withValueSeparator('N'); Option option0 = OptionBuilder.create(""); assertEquals('N', option0.getValueSeparator()); assertEquals((-1), option0.getArgs()); } @Test(timeout = 4000) public void test02() throws Throwable { OptionBuilder.hasArgs(); Option option0 = OptionBuilder.create(""); assertEquals((-2), option0.getArgs()); } @Test(timeout = 4000) public void test03() throws Throwable { OptionBuilder.withArgName(""); Option option0 = OptionBuilder.create(""); assertEquals((-1), option0.getArgs()); } @Test(timeout = 4000) public void test04() throws Throwable { OptionBuilder.withLongOpt("0)=jFJD$W2^FkXu=19>"); Option option0 = OptionBuilder.create((String) null); assertEquals((-1), option0.getArgs()); } @Test(timeout = 4000) public void test05() throws Throwable { OptionBuilder.hasArgs(0); Option option0 = OptionBuilder.create((String) null); assertEquals(0, option0.getArgs()); } @Test(timeout = 4000) public void test06() throws Throwable { OptionBuilder.isRequired(); Option option0 = OptionBuilder.create('d'); assertTrue(option0.isRequired()); assertEquals(100, option0.getId()); assertEquals((-1), option0.getArgs()); } @Test(timeout = 4000) public void test07() throws Throwable { OptionBuilder.hasOptionalArgs((-1)); Option option0 = OptionBuilder.create('d'); assertEquals((-1), option0.getArgs()); assertEquals(100, option0.getId()); assertTrue(option0.hasOptionalArg()); } @Test(timeout = 4000) public void test08() throws Throwable { OptionBuilder.withLongOpt(" [ARG]"); Option option0 = OptionBuilder.create('b'); assertEquals(98, option0.getId()); assertEquals((-1), option0.getArgs()); } @Test(timeout = 4000) public void test09() throws Throwable { OptionBuilder.withArgName(""); Option option0 = OptionBuilder.create('t'); assertEquals((-1), option0.getArgs()); assertEquals(116, option0.getId()); } @Test(timeout = 4000) public void test10() throws Throwable { OptionBuilder.hasArgs(0); Option option0 = OptionBuilder.create('P'); assertEquals(0, option0.getArgs()); assertEquals(80, option0.getId()); } @Test(timeout = 4000) public void test11() throws Throwable { OptionBuilder.withLongOpt(" [ARG]"); OptionBuilder.withValueSeparator(); Option option0 = OptionBuilder.create(); assertEquals((-1), option0.getArgs()); assertEquals('=', option0.getValueSeparator()); } @Test(timeout = 4000) public void test12() throws Throwable { OptionBuilder.withLongOpt(" [ARG]"); OptionBuilder.withArgName(""); Option option0 = OptionBuilder.create(); assertEquals((-1), option0.getArgs()); } @Test(timeout = 4000) public void test13() throws Throwable { OptionBuilder.hasOptionalArgs(0); OptionBuilder.withLongOpt("WK{&+"); Option option0 = OptionBuilder.create(); assertTrue(option0.hasOptionalArg()); assertEquals(0, option0.getArgs()); } @Test(timeout = 4000) public void test14() throws Throwable { try { OptionBuilder.create("fk}(vivZTRdW"); fail("Expecting exception: IllegalArgumentException"); } catch(IllegalArgumentException e) { // // The option 'fk}(vivZTRdW' contains an illegal character : '}' // verifyException("org.apache.commons.cli.OptionValidator", e); } } @Test(timeout = 4000) public void test15() throws Throwable { try { OptionBuilder.create('*'); fail("Expecting exception: IllegalArgumentException"); } catch(IllegalArgumentException e) { // // Illegal option name '*' // verifyException("org.apache.commons.cli.OptionValidator", e); } } @Test(timeout = 4000) public void test16() throws Throwable { try { OptionBuilder.create(); fail("Expecting exception: IllegalArgumentException"); } catch(IllegalArgumentException e) { // // must specify longopt // verifyException("org.apache.commons.cli.OptionBuilder", e); } } @Test(timeout = 4000) public void test17() throws Throwable { OptionBuilder.hasArg(true); OptionBuilder.withLongOpt(" :: "); Option option0 = OptionBuilder.create(); assertEquals(1, option0.getArgs()); } @Test(timeout = 4000) public void test18() throws Throwable { OptionBuilder optionBuilder0 = OptionBuilder.hasArg(false); assertNotNull(optionBuilder0); } @Test(timeout = 4000) public void test19() throws Throwable { OptionBuilder optionBuilder0 = OptionBuilder.withDescription("rzOhm"); assertNotNull(optionBuilder0); } @Test(timeout = 4000) public void test20() throws Throwable { OptionBuilder optionBuilder0 = OptionBuilder.hasOptionalArgs(); assertNotNull(optionBuilder0); } @Test(timeout = 4000) public void test21() throws Throwable { OptionBuilder.hasArgs(); OptionBuilder.withLongOpt(" [ARG]"); Option option0 = OptionBuilder.create(); assertEquals((-2), option0.getArgs()); } @Test(timeout = 4000) public void test22() throws Throwable { OptionBuilder.hasOptionalArg(); Option option0 = OptionBuilder.create((String) null); assertTrue(option0.hasOptionalArg()); assertEquals(1, option0.getArgs()); } @Test(timeout = 4000) public void test23() throws Throwable { OptionBuilder.withValueSeparator(); Option option0 = OptionBuilder.create('w'); assertEquals('=', option0.getValueSeparator()); assertEquals((-1), option0.getArgs()); assertEquals("w", option0.getOpt()); } @Test(timeout = 4000) public void test24() throws Throwable { OptionBuilder optionBuilder0 = OptionBuilder.isRequired(true); assertNotNull(optionBuilder0); } @Test(timeout = 4000) public void test25() throws Throwable { OptionBuilder optionBuilder0 = OptionBuilder.hasArg(); assertNotNull(optionBuilder0); } @Test(timeout = 4000) public void test26() throws Throwable { OptionBuilder.isRequired(); OptionBuilder.withLongOpt("WK{&+"); Option option0 = OptionBuilder.create(); assertTrue(option0.isRequired()); assertEquals((-1), option0.getArgs()); } @Test(timeout = 4000) public void test27() throws Throwable { Object object0 = new Object(); OptionBuilder optionBuilder0 = OptionBuilder.withType(object0); assertNotNull(optionBuilder0); } @Test(timeout = 4000) public void test28() throws Throwable { OptionBuilder.hasArgs(61); Option option0 = OptionBuilder.create('P'); assertEquals(61, option0.getArgs()); assertEquals("P", option0.getOpt()); } }
[ "pderakhshanfar@serg2.ewi.tudelft.nl" ]
pderakhshanfar@serg2.ewi.tudelft.nl
32c27cc9916b07d70b07243bc07a244f277dc79b
35cba28238fbedb9e8c1edb44ab265fc2d9e0ecd
/org/apache/http/auth/UsernamePasswordCredentials.java
33c9690aec48614d2145f95fb9d319a08e0620bd
[]
no_license
delco225/Djassa
27bcd7139b06a2a46d9c09f7b2fd9e5df3fd2349
0434c26fd5b9039f2e0a4bf8c023c6a8b5024341
refs/heads/master
2016-09-06T18:12:17.167100
2015-02-08T14:24:33
2015-02-08T14:24:33
30,485,109
0
0
null
null
null
null
UTF-8
Java
false
false
2,241
java
package org.apache.http.auth; import java.io.Serializable; import java.security.Principal; import org.apache.http.annotation.Immutable; import org.apache.http.util.Args; import org.apache.http.util.LangUtils; @Immutable public class UsernamePasswordCredentials implements Credentials, Serializable { private static final long serialVersionUID = 243343858802739403L; private final String password; private final BasicUserPrincipal principal; public UsernamePasswordCredentials(String paramString) { Args.notNull(paramString, "Username:password string"); int i = paramString.indexOf(':'); if (i >= 0) { this.principal = new BasicUserPrincipal(paramString.substring(0, i)); this.password = paramString.substring(i + 1); return; } this.principal = new BasicUserPrincipal(paramString); this.password = null; } public UsernamePasswordCredentials(String paramString1, String paramString2) { Args.notNull(paramString1, "Username"); this.principal = new BasicUserPrincipal(paramString1); this.password = paramString2; } public boolean equals(Object paramObject) { if (this == paramObject) {} UsernamePasswordCredentials localUsernamePasswordCredentials; do { return true; if (!(paramObject instanceof UsernamePasswordCredentials)) { break; } localUsernamePasswordCredentials = (UsernamePasswordCredentials)paramObject; } while (LangUtils.equals(this.principal, localUsernamePasswordCredentials.principal)); return false; } public String getPassword() { return this.password; } public String getUserName() { return this.principal.getName(); } public Principal getUserPrincipal() { return this.principal; } public int hashCode() { return this.principal.hashCode(); } public String toString() { return this.principal.toString(); } } /* Location: C:\Users\delco\Desktop\projet_S4\test\src\dex2jar-0.0.7.7-SNAPSHOT\classes_dex2jar.jar * Qualified Name: org.apache.http.auth.UsernamePasswordCredentials * JD-Core Version: 0.7.0.1 */
[ "ahoussi.say@telecom-bretagne.eu" ]
ahoussi.say@telecom-bretagne.eu
b58585c8a99ccb17991bf3d5a8be406b097fcdd7
fa91450deb625cda070e82d5c31770be5ca1dec6
/Diff-Raw-Data/16/16_f0336ce77a9771853c1926e66309ff4d0562db8a/WARProductEditor/16_f0336ce77a9771853c1926e66309ff4d0562db8a_WARProductEditor_s.java
2100e1874d182678b4d92f49624fcc54f2d7f763
[]
no_license
zhongxingyu/Seer
48e7e5197624d7afa94d23f849f8ea2075bcaec0
c11a3109fdfca9be337e509ecb2c085b60076213
refs/heads/master
2023-07-06T12:48:55.516692
2023-06-22T07:55:56
2023-06-22T07:55:56
259,613,157
6
2
null
2023-06-22T07:55:57
2020-04-28T11:07:49
null
UTF-8
Java
false
false
7,009
java
/******************************************************************************* * Copyright (c) 2010, 2011 EclipseSource and others. All rights reserved. This * program and the accompanying materials are made available under the terms of * the Eclipse Public License v1.0 which accompanies this distribution, and is * available at http://www.eclipse.org/legal/epl-v10.html * * Contributors: * Holger Staudacher - initial API and implementation *******************************************************************************/ package org.eclipse.libra.warproducts.ui.editor; import java.io.File; import java.util.Map; import org.eclipse.core.filesystem.EFS; import org.eclipse.core.filesystem.IFileStore; import org.eclipse.core.resources.*; import org.eclipse.core.runtime.CoreException; import org.eclipse.jface.action.IToolBarManager; import org.eclipse.jface.dialogs.MessageDialog; import org.eclipse.jface.resource.ImageDescriptor; import org.eclipse.libra.warproducts.core.IWARProduct; import org.eclipse.libra.warproducts.ui.Messages; import org.eclipse.libra.warproducts.ui.WARProductConstants; import org.eclipse.libra.warproducts.ui.validation.*; import org.eclipse.pde.internal.core.iproduct.IProduct; import org.eclipse.pde.internal.core.iproduct.IProductModel; import org.eclipse.pde.internal.ui.PDEPlugin; import org.eclipse.pde.internal.ui.editor.*; import org.eclipse.pde.internal.ui.editor.context.InputContextManager; import org.eclipse.pde.internal.ui.editor.product.ProductEditor; import org.eclipse.swt.widgets.Shell; import org.eclipse.ui.*; import org.eclipse.ui.ide.FileStoreEditorInput; import org.eclipse.ui.part.FileEditorInput; import org.eclipse.ui.plugin.AbstractUIPlugin; public class WARProductEditor extends ProductEditor implements IValidationListener { private static final String PRODUCT_EDITOR_IMAGE = "icons/exp_product.gif"; private static final String WARPRODUCT_FILE_EXTENSION = ".warproduct"; //$NON-NLS-1$ private WARProductExportAction exportAction; protected void addEditorPages() { try { addPage( new OverviewPage( this ) ); addPage( new ConfigurationPage( this, useFeatures() ) ); } catch( final PartInitException e ) { PDEPlugin.logException( e ); } addSourcePage( WebXMLInputContext.CONTEXT_ID ); } protected PDESourcePage createSourcePage( final PDEFormEditor editor, final String title, final String name, final String contextId ) { PDESourcePage result = null; if( contextId.equals( WebXMLInputContext.CONTEXT_ID ) ) { result = new WebXMLSourcePage( editor, title, name ); } else { result = super.createSourcePage( editor, title, name, contextId ); } return result; } public String getContextIDForSaveAs() { return WARProductInputContext.CONTEXT_ID; } protected String getEditorID() { return WARProductConstants.EDITOR_ID; } public void contributeToToolbar( final IToolBarManager manager ) { IProductModel model = ( IProductModel )getAggregateModel(); IProduct product = model.getProduct(); WARProductValidateAction validationAction = new WARProductValidateAction( ( IWARProduct )product ); validationAction.addValidationListener( this ); manager.add( validationAction ); manager.add( getExportAction() ); } private WARProductExportAction getExportAction() { if( exportAction == null ) { exportAction = new WARProductExportAction( this ); exportAction.setToolTipText( Messages.editorExport ); String pluginId = WARProductConstants.PLUGIN_ID; String imagePath = PRODUCT_EDITOR_IMAGE; //$NON-NLS-1$ ImageDescriptor descExportProductTool = AbstractUIPlugin.imageDescriptorFromPlugin( pluginId, imagePath ); exportAction.setImageDescriptor( descExportProductTool ); } return exportAction; } protected InputContextManager createInputContextManager() { return new WARProductInputContextManager( this ); } protected void createSystemFileContexts( final InputContextManager manager, final FileStoreEditorInput input ) { File file = new File( input.getURI() ); String name = file.getName(); if( name.endsWith( WARPRODUCT_FILE_EXTENSION ) ) { //$NON-NLS-1$ IFileStore store; try { store = EFS.getStore( file.toURI() ); IEditorInput in = new FileStoreEditorInput( store ); manager.putContext( in, new WARProductInputContext( this, in, true ) ); } catch( final CoreException e ) { PDEPlugin.logException( e ); } } } protected void createStorageContexts( final InputContextManager manager, final IStorageEditorInput input ) { if( input.getName().endsWith( WARPRODUCT_FILE_EXTENSION ) ) { //$NON-NLS-1$ WARProductInputContext context = new WARProductInputContext( this, input, true ); manager.putContext( input, context ); } } protected void createResourceContexts( final InputContextManager manager, final IFileEditorInput input ) { WARProductInputContext context = new WARProductInputContext( this, input, true ); manager.putContext( input, context ); manager.monitorFile( input.getFile() ); IWorkspaceRoot root = ResourcesPlugin.getWorkspace().getRoot(); IProductModel model = ( IProductModel )getAggregateModel(); IWARProduct product = ( IWARProduct )model.getProduct(); IFile webXml = root.getFile( product.getWebXml() ); IEditorInput webXmlInput = new FileEditorInput( webXml ); WebXMLInputContext webXmlContext = new WebXMLInputContext( this, webXmlInput, false ); manager.putContext( webXmlInput, webXmlContext ); manager.monitorFile( webXml ); } public boolean useFeatures() { return false; } protected ISortableContentOutlinePage createContentOutline() { return new WARProductOutlinePage( this ); } public void validationFinished( final Map errors ) { Shell shell = PDEPlugin.getActiveWorkbenchShell(); if( !errors.isEmpty() ) { PluginStatusDialog dialog = new PluginStatusDialog( shell ); dialog.setInput( errors ); dialog.open(); } else { String pluginValidationMessage = Messages.Validation; String noProblemsMessage = Messages.noProblems; MessageDialog.openInformation( shell, pluginValidationMessage, noProblemsMessage ); } } protected String computeInitialPageId() { return OverviewPage.PAGE_ID; } }
[ "yuzhongxing88@gmail.com" ]
yuzhongxing88@gmail.com
188f8e04e04cdf826c7ad714c472675579ba06c3
e977c424543422f49a25695665eb85bfc0700784
/benchmark/icse15/596983/buggy-version/db/derby/code/trunk/java/client/org/apache/derby/client/net/NaiveTrustManager.java
3b21663a2fdc856d009b2fbee7b165858fbc6067
[]
no_license
amir9979/pattern-detector-experiment
17fcb8934cef379fb96002450d11fac62e002dd3
db67691e536e1550245e76d7d1c8dced181df496
refs/heads/master
2022-02-18T10:24:32.235975
2019-09-13T15:42:55
2019-09-13T15:42:55
null
0
0
null
null
null
null
UTF-8
Java
false
false
3,544
java
/* Derby - Class org.apache.derby.client.net.NaiveTrustManager 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.derby.client.net; import javax.net.SocketFactory; import javax.net.ssl.SSLContext; import javax.net.ssl.TrustManager; import javax.net.ssl.X509TrustManager; import java.security.cert.X509Certificate; import java.security.cert.CertificateException; /** * This is a naive trust manager we use when we don't want server * authentication. Any certificate will be accepted. **/ public class NaiveTrustManager implements X509TrustManager { /** * We don't want more than one instence of this TrustManager */ private NaiveTrustManager() { } static private TrustManager[] thisManager = null; /** * Generate a socket factory with this trust manager. Derby * Utility routine which is not part of the X509TrustManager * interface. **/ public static SocketFactory getSocketFactory() throws java.security.NoSuchAlgorithmException, java.security.KeyManagementException { if (thisManager == null) { thisManager = new TrustManager [] {new NaiveTrustManager()}; } SSLContext ctx = SSLContext.getInstance("SSL"); ctx.init(null, // Use default key manager thisManager, null); // Use default random source return ctx.getSocketFactory(); } /** * Checks wether the we trust the client. Since this trust manager * is just for the Derby clients, this routine is actually never * called, but need to be here when we implement X509TrustManager. * @param chain The client's certificate chain * @param authType authorization type (e.g. "RSA" or "DHE_DSS") **/ public void checkClientTrusted(X509Certificate[] chain, String authType) throws CertificateException { // Reject all attemtpts to truts a client. We should never end // up here. throw new CertificateException(); } /** * Checks wether the we trust the server, which we allways will. * @param chain The server's certificate chain * @param authType authorization type (e.g. "RSA" or "DHE_DSS") **/ public void checkServerTrusted(X509Certificate[] chain, String authType) throws CertificateException { // Do nothing. We trust everyone. } /** * Return an array of certificate authority certificates which are * trusted for authenticating peers. Not relevant for this trust * manager. */ public X509Certificate[] getAcceptedIssuers() { return new X509Certificate[0]; } }
[ "durieuxthomas@hotmail.com" ]
durieuxthomas@hotmail.com
c0001606bc4f86f39e53cdc8b6320cae890d9bbf
5aaebaafeb75c7616689bcf71b8dd5ab2c89fa3b
/src/ANXGallery/sources/com/miui/gallery/picker/helper/PickerItemHolder.java
dbfb76187487e0c1d57115ecfc944040bbf2a91c
[]
no_license
gitgeek4dx/ANXGallery9
9bf2b4da409ab16492e64340bde4836d716ea7ec
af2e3c031d1857fa25636ada923652b66a37ff9e
refs/heads/master
2022-01-15T05:23:24.065872
2019-07-25T17:34:35
2019-07-25T17:34:35
null
0
0
null
null
null
null
UTF-8
Java
false
false
1,835
java
package com.miui.gallery.picker.helper; import android.database.Cursor; import android.view.View; import android.view.View.OnClickListener; import android.widget.ListAdapter; import com.miui.gallery.R; import com.miui.gallery.adapter.CheckableAdapter; import com.miui.gallery.util.ScalableTouchDelegate; public class PickerItemHolder implements OnClickListener { private ListAdapter mAdapter; private PickerItemCheckedListener mCheckListener; private int mPosition; public PickerItemHolder(View view, ListAdapter listAdapter, PickerItemCheckedListener pickerItemCheckedListener) { this.mAdapter = listAdapter; this.mCheckListener = pickerItemCheckedListener; if (listAdapter instanceof CheckableAdapter) { View checkableView = ((CheckableAdapter) listAdapter).getCheckableView(view); if (checkableView != null) { checkableView.setOnClickListener(this); view.setTouchDelegate(new ScalableTouchDelegate(1.8f, view, checkableView)); } } } public static void bindView(int i, View view, ListAdapter listAdapter, PickerItemCheckedListener pickerItemCheckedListener) { PickerItemHolder pickerItemHolder = (PickerItemHolder) view.getTag(R.id.tag_picker_item_holder); if (pickerItemHolder == null) { pickerItemHolder = new PickerItemHolder(view, listAdapter, pickerItemCheckedListener); view.setTag(R.id.tag_picker_item_holder, pickerItemHolder); } pickerItemHolder.setPosition(i); } public void onClick(View view) { if (this.mCheckListener != null) { this.mCheckListener.onItemChecked((Cursor) this.mAdapter.getItem(this.mPosition), view); } } public void setPosition(int i) { this.mPosition = i; } }
[ "sv.xeon@gmail.com" ]
sv.xeon@gmail.com
8e4ab69ece65b657559e9e9262914b6364d87877
ddad0f5dc82be49494ad558c6990d88cbfce5d44
/spring/gdcp_spring_test/src/main/java/cn/gdcp/dao/RoleDao.java
07ec39e90208cea33bfd2bd9214a19a404800be9
[]
no_license
lcz-sys/javaProject
f234558fae4885d4a8f3a992a37e65193638bb0b
c4891a485b35ee378f51ebb03b94269ac7b1aca1
refs/heads/master
2023-04-10T05:42:24.725486
2021-04-17T07:25:24
2021-04-17T07:25:24
358,810,404
1
0
null
null
null
null
UTF-8
Java
false
false
205
java
package cn.gdcp.dao; import cn.gdcp.domain.Role; import java.util.List; public interface RoleDao { List<Role> findAll(); void save(Role role); List<Role> findRoleByUserId(Long userId); }
[ "212065370@qq.com" ]
212065370@qq.com
690a615125fd6bc18b0d312f1d6f2df49145d1fe
fa91450deb625cda070e82d5c31770be5ca1dec6
/Diff-Raw-Data/27/27_22e031ba47ecfbfed5d1e136ba4c35e29d19eb29/SqlTimestampTest/27_22e031ba47ecfbfed5d1e136ba4c35e29d19eb29_SqlTimestampTest_s.java
fc56287145327ccda3993e490c1e9a4f4ee6ca05
[]
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
6,608
java
/* * Copyright 2008 Google Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not * use this file except in compliance with the License. You may obtain a copy of * the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the * License for the specific language governing permissions and limitations under * the License. */ package com.google.gwt.emultest.java.sql; import com.google.gwt.core.client.GWT; import com.google.gwt.junit.client.GWTTestCase; import java.sql.Timestamp; import java.util.Date; /** * Tests {@link java.sql.Timestamp}. We assume that the underlying * {@link java.util.Date} implementation is correct and concentrate only on the * differences between the two. */ @SuppressWarnings("deprecation") public class SqlTimestampTest extends GWTTestCase { /** * Sets module name so that javascript compiler can operate. */ @Override public String getModuleName() { return "com.google.gwt.emultest.EmulSuite"; } /** * Timestamps have some non-obvious comparison semantics when compared to * dates. */ public void testDateComparison() { long now = System.currentTimeMillis(); Date d = new Date(now); Timestamp t = new Timestamp(d.getTime()); if (now % 1000 == 0) { t.setNanos(1000001); } else { t.setNanos(1); } // Timestamps are stored at second-level precision Date d2 = new Date(t.getTime()); assertFalse("d.equals(t)", d.equals(t)); assertEquals("d2, t", d2, t); assertEquals("hashcode", d2.hashCode(), t.hashCode()); assertFalse("t.equals(d2)", t.equals(d2)); if (GWT.isScript()) { // It looks like not all JVMs will throw the CCE, just check web mode. try { t.compareTo(d2); fail("Should throw ClassCastException"); } catch (ClassCastException e) { // Correct } } Timestamp t2 = new Timestamp(d.getTime()); t2.setNanos(t.getNanos() + 1); assertFalse("t.equals(t2)", t.equals(t2)); assertEquals("hashcode2", t.hashCode(), t2.hashCode()); } public void testNanosAffectTime() { long now = System.currentTimeMillis(); int millis = (int) (now % 1000); Timestamp t = new Timestamp(now); assertEquals(now, t.getTime()); assertEquals(millis * 1000000, t.getNanos()); t.setNanos(0); assertEquals(now - millis, t.getTime()); t.setNanos(999999999); assertEquals(now - millis + 999, t.getTime()); } public void testNanosComparison() { long now = System.currentTimeMillis(); Timestamp t = new Timestamp(now); t.setNanos(0); Timestamp t2 = new Timestamp(t.getTime()); t2.setNanos(0); assertEquals(t, t2); assertEquals(0, t.compareTo(t2)); assertFalse(t.before(t2)); assertFalse(t.after(t2)); t2.setNanos(1); assertFalse(t.equals(t2)); assertTrue(t.compareTo(t2) < 0); assertTrue(t2.compareTo(t) > 0); assertTrue(t.before(t2)); assertTrue(t2.after(t)); } public void testNanosRange() { long now = System.currentTimeMillis(); Timestamp t = new Timestamp(now); assertEquals(now, t.getTime()); assertEquals((now % 1000) * 1000000, t.getNanos()); try { t.setNanos(-1); fail("Should have thrown IllegalArgumentException"); } catch (IllegalArgumentException e) { // Correct } t.setNanos(0); try { t.setNanos(1000000000); fail("Should have thrown IllegalArgumentException"); } catch (IllegalArgumentException e) { // Correct } t.setNanos(999999999); } public void testTimeAffectsNanos() { // A value 5 millis past the current second long now = (System.currentTimeMillis() / 1000) * 1000 + 5; Timestamp t = new Timestamp(now); assertEquals(5000000, t.getNanos()); t.setTime(now + 1); assertEquals(6000000, t.getNanos()); } public void testToString() { Timestamp ts = new Timestamp(2000 - 1900, 1 - 1, 1, 12, 34, 56, 123456789); assertEquals("2000-01-01 12:34:56.123456789", ts.toString()); } public void testValueOf() { try { Timestamp.valueOf(""); fail("Should have thrown IllegalArgumentException"); } catch (IllegalArgumentException e) { // Correct } try { Timestamp.valueOf("asdfg"); fail("Should have thrown IllegalArgumentException"); } catch (IllegalArgumentException e) { // Correct } Timestamp expected = new Timestamp(2000 - 1900, 1 - 1, 1, 12, 34, 56, 123456789); Timestamp actual = Timestamp.valueOf("2000-01-01 12:34:56.123456789"); assertEquals(expected, actual); expected = new Timestamp(2000 - 1900, 1 - 1, 1, 12, 34, 56, 0); actual = Timestamp.valueOf("2000-01-01 12:34:56"); assertEquals(expected, actual); expected = new Timestamp(2000 - 1900, 1 - 1, 1, 12, 34, 56, 100000000); actual = Timestamp.valueOf("2000-01-01 12:34:56.1"); assertEquals(expected, actual); expected = new Timestamp(2000 - 1900, 1 - 1, 1, 12, 34, 56, 120000000); actual = Timestamp.valueOf("2000-01-01 12:34:56.12"); assertEquals(expected, actual); expected = new Timestamp(2000 - 1900, 1 - 1, 1, 12, 34, 56, 123000000); actual = Timestamp.valueOf("2000-01-01 12:34:56.123"); assertEquals(expected, actual); expected = new Timestamp(2000 - 1900, 1 - 1, 1, 12, 34, 56, 123400000); actual = Timestamp.valueOf("2000-01-01 12:34:56.1234"); assertEquals(expected, actual); expected = new Timestamp(2000 - 1900, 1 - 1, 1, 12, 34, 56, 123450000); actual = Timestamp.valueOf("2000-01-01 12:34:56.12345"); assertEquals(expected, actual); expected = new Timestamp(2000 - 1900, 1 - 1, 1, 12, 34, 56, 123456000); actual = Timestamp.valueOf("2000-01-01 12:34:56.123456"); assertEquals(expected, actual); expected = new Timestamp(2000 - 1900, 1 - 1, 1, 12, 34, 56, 123456700); actual = Timestamp.valueOf("2000-01-01 12:34:56.1234567"); assertEquals(expected, actual); expected = new Timestamp(2000 - 1900, 1 - 1, 1, 12, 34, 56, 123456780); actual = Timestamp.valueOf("2000-01-01 12:34:56.12345678"); } }
[ "yuzhongxing88@gmail.com" ]
yuzhongxing88@gmail.com
8bacdf8a8e5694dce6423564d9da0e882d0904d7
3aa4eb3a19a4b1154d9c7d2445feedd100943958
/nvwa-xmemcached/src/test/java/net/rubyeye/xmemcached/test/unittest/commands/binary/BinaryStoreCommandUnitTest.java
c1d1d56e2d4eb7a2b665ff1a403d8639aba31a69
[]
no_license
big-mouth-cn/nvwa
de367065600d6e751cb432df660f377b57052654
6a460cf62c65ed70478a6e9ef3b5a142e8775d19
refs/heads/master
2020-04-12T02:25:02.566820
2018-01-15T04:34:33
2018-01-15T04:34:33
57,180,498
20
26
null
null
null
null
UTF-8
Java
false
false
3,712
java
package net.rubyeye.xmemcached.test.unittest.commands.binary; import java.nio.ByteBuffer; import net.rubyeye.xmemcached.command.Command; import net.rubyeye.xmemcached.command.binary.OpCode; import net.rubyeye.xmemcached.utils.ByteUtils; public class BinaryStoreCommandUnitTest extends BaseBinaryCommandUnitTest { String key = "hello"; byte[] keyBytes = ByteUtils.getBytes(this.key); String value = "world"; boolean noreply = false; public void testAddEncodeAndDecode() { Command command = this.commandFactory.createAddCommand(this.key, this.keyBytes, 0, this.value, this.noreply, this.transcoder); command.encode(); ByteBuffer encodeBuffer = command.getIoBuffer().buf(); assertNotNull(encodeBuffer); assertEquals(42, encodeBuffer.capacity()); byte opCode = encodeBuffer.get(1); assertEquals(OpCode.ADD.fieldValue(), opCode); ByteBuffer buffer = constructResponse(OpCode.ADD.fieldValue(), (short) 0, (byte) 0, (byte) 0, (short) 0, 0, 0, 1L, null, null, null); assertTrue(command.decode(null, buffer)); assertTrue((Boolean) command.getResult()); assertEquals(0, buffer.remaining()); buffer = constructResponse(OpCode.ADD.fieldValue(), (short) 0, (byte) 0, (byte) 0, (short) 0x0005, 0, 0, 1L, null, null, null); command = this.commandFactory.createAddCommand(this.key, this.keyBytes, 0, this.value, this.noreply, this.transcoder); assertTrue(command.decode(null, buffer)); assertFalse((Boolean) command.getResult()); assertEquals(0, buffer.remaining()); } public void testReplaceEncodeAndDecode() { Command command = this.commandFactory.createReplaceCommand(this.key, this.keyBytes, 0, this.value, this.noreply, this.transcoder); command.encode(); ByteBuffer encodeBuffer = command.getIoBuffer().buf(); assertNotNull(encodeBuffer); assertEquals(42, encodeBuffer.capacity()); byte opCode = encodeBuffer.get(1); assertEquals(OpCode.REPLACE.fieldValue(), opCode); ByteBuffer buffer = constructResponse(OpCode.REPLACE.fieldValue(), (short) 0, (byte) 0, (byte) 0, (short) 0, 0, 0, 1L, null, null, null); assertTrue(command.decode(null, buffer)); assertTrue((Boolean) command.getResult()); assertEquals(0, buffer.remaining()); buffer = constructResponse(OpCode.REPLACE.fieldValue(), (short) 0, (byte) 0, (byte) 0, (short) 0x0005, 0, 0, 1L, null, null, null); command = this.commandFactory.createReplaceCommand(this.key, this.keyBytes, 0, this.value, this.noreply, this.transcoder); assertTrue(command.decode(null, buffer)); assertFalse((Boolean) command.getResult()); assertEquals(0, buffer.remaining()); } public void testSetEncodeAndDecode() { Command command = this.commandFactory.createSetCommand(this.key, this.keyBytes, 0, this.value, this.noreply, this.transcoder); command.encode(); ByteBuffer encodeBuffer = command.getIoBuffer().buf(); assertNotNull(encodeBuffer); assertEquals(42, encodeBuffer.capacity()); byte opCode = encodeBuffer.get(1); assertEquals(OpCode.SET.fieldValue(), opCode); ByteBuffer buffer = constructResponse(OpCode.SET.fieldValue(), (short) 0, (byte) 0, (byte) 0, (short) 0, 0, 0, 1L, null, null, null); assertTrue(command.decode(null, buffer)); assertTrue((Boolean) command.getResult()); assertEquals(0, buffer.remaining()); buffer = constructResponse(OpCode.SET.fieldValue(), (short) 0, (byte) 0, (byte) 0, (short) 0x0005, 0, 0, 1L, null, null, null); command = this.commandFactory.createSetCommand(this.key, this.keyBytes, 0, this.value, this.noreply, this.transcoder); assertTrue(command.decode(null, buffer)); assertFalse((Boolean) command.getResult()); assertEquals(0, buffer.remaining()); } }
[ "huxiao.mail@qq.com" ]
huxiao.mail@qq.com
6e1182a8b4c6211997fefecc9837bfdd89dbef4f
b5a1e01b51098d52992c898045c2fc800b4a14df
/aliyun-java-sdk-bssopenapi/src/main/java/com/aliyuncs/bssopenapi/transform/v20171214/QuerySavingsPlansDiscountResponseUnmarshaller.java
32df6fa7215727c5029e56b1ecc0c379aba4b974
[ "Apache-2.0" ]
permissive
lingluo-hub/aliyun-openapi-java-sdk
c2a761524e2042c4d26ce088e9eb42da21db6971
6b3274e33ff5816d8bddbe72da989eb54a41e33b
refs/heads/master
2023-04-07T23:34:32.220685
2023-04-02T02:44:37
2023-04-02T02:44:37
233,382,102
0
0
NOASSERTION
2023-03-09T22:01:22
2020-01-12T11:32:35
Java
UTF-8
Java
false
false
3,466
java
/* * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package com.aliyuncs.bssopenapi.transform.v20171214; import java.util.ArrayList; import java.util.List; import com.aliyuncs.bssopenapi.model.v20171214.QuerySavingsPlansDiscountResponse; import com.aliyuncs.bssopenapi.model.v20171214.QuerySavingsPlansDiscountResponse.Data; import com.aliyuncs.bssopenapi.model.v20171214.QuerySavingsPlansDiscountResponse.Data.SavingsPlansDiscountResponse; import com.aliyuncs.transform.UnmarshallerContext; public class QuerySavingsPlansDiscountResponseUnmarshaller { public static QuerySavingsPlansDiscountResponse unmarshall(QuerySavingsPlansDiscountResponse querySavingsPlansDiscountResponse, UnmarshallerContext _ctx) { querySavingsPlansDiscountResponse.setRequestId(_ctx.stringValue("QuerySavingsPlansDiscountResponse.RequestId")); querySavingsPlansDiscountResponse.setMessage(_ctx.stringValue("QuerySavingsPlansDiscountResponse.Message")); querySavingsPlansDiscountResponse.setCode(_ctx.stringValue("QuerySavingsPlansDiscountResponse.Code")); querySavingsPlansDiscountResponse.setSuccess(_ctx.booleanValue("QuerySavingsPlansDiscountResponse.Success")); Data data = new Data(); data.setHostId(_ctx.stringValue("QuerySavingsPlansDiscountResponse.Data.HostId")); List<SavingsPlansDiscountResponse> items = new ArrayList<SavingsPlansDiscountResponse>(); for (int i = 0; i < _ctx.lengthValue("QuerySavingsPlansDiscountResponse.Data.Items.Length"); i++) { SavingsPlansDiscountResponse savingsPlansDiscountResponse = new SavingsPlansDiscountResponse(); savingsPlansDiscountResponse.setCommodityName(_ctx.stringValue("QuerySavingsPlansDiscountResponse.Data.Items["+ i +"].CommodityName")); savingsPlansDiscountResponse.setModuleName(_ctx.stringValue("QuerySavingsPlansDiscountResponse.Data.Items["+ i +"].ModuleName")); savingsPlansDiscountResponse.setSpnType(_ctx.stringValue("QuerySavingsPlansDiscountResponse.Data.Items["+ i +"].SpnType")); savingsPlansDiscountResponse.setPayMode(_ctx.stringValue("QuerySavingsPlansDiscountResponse.Data.Items["+ i +"].PayMode")); savingsPlansDiscountResponse.setCycle(_ctx.stringValue("QuerySavingsPlansDiscountResponse.Data.Items["+ i +"].Cycle")); savingsPlansDiscountResponse.setRegion(_ctx.stringValue("QuerySavingsPlansDiscountResponse.Data.Items["+ i +"].Region")); savingsPlansDiscountResponse.setSpec(_ctx.stringValue("QuerySavingsPlansDiscountResponse.Data.Items["+ i +"].Spec")); savingsPlansDiscountResponse.setDiscountRate(_ctx.stringValue("QuerySavingsPlansDiscountResponse.Data.Items["+ i +"].DiscountRate")); savingsPlansDiscountResponse.setContractDiscountRate(_ctx.stringValue("QuerySavingsPlansDiscountResponse.Data.Items["+ i +"].ContractDiscountRate")); items.add(savingsPlansDiscountResponse); } data.setItems(items); querySavingsPlansDiscountResponse.setData(data); return querySavingsPlansDiscountResponse; } }
[ "sdk-team@alibabacloud.com" ]
sdk-team@alibabacloud.com
aa2593acdd393255c3e66988bb3ba5fc77a0bd25
b95ee8022eab9c6671a12b0313cb7e0e7aa5f36c
/z-utils/src/main/java/com/hz/entity/Person.java
122b7ff30d33d0e5fa57603a9b36de3df7628dfa
[]
no_license
mp2930696631/newStart
c10f399a8e1ae04404d806ed9a5249b68cfa09a1
bc3a05c52081826af099201a4434d44190e81937
refs/heads/main
2023-03-14T13:23:44.439150
2021-03-08T07:44:52
2021-03-08T07:44:52
306,849,648
1
1
null
null
null
null
UTF-8
Java
false
false
470
java
package com.hz.entity; /** * @author zehua * @date 2021/2/22 8:31 */ public class Person { private String name; public Person() { } public Person(String name) { this.name = name; } @Override protected void finalize() throws Throwable { System.out.println("destroy..."); } @Override public String toString() { return "Person{" + "name='" + name + '\'' + '}'; } }
[ "891393221@qq.com" ]
891393221@qq.com
b2e036f018b9f6a9785e4c77634ea22547b06faf
3ebaee3a565d5e514e5d56b44ebcee249ec1c243
/assetBank 3.77 decomplied fixed/src/java/com/bright/assetbank/ecommerce/form/CommercialOrderForm.java
05e3c11a5931126336dad4cd8d64a1469c2e1662
[]
no_license
webchannel-dev/Java-Digital-Bank
89032eec70a1ef61eccbef6f775b683087bccd63
65d4de8f2c0ce48cb1d53130e295616772829679
refs/heads/master
2021-10-08T19:10:48.971587
2017-11-07T09:51:17
2017-11-07T09:51:17
null
0
0
null
null
null
null
UTF-8
Java
false
false
2,230
java
/* */ package com.bright.assetbank.ecommerce.form; /* */ /* */ import com.bright.assetbank.ecommerce.bean.CommercialOptionPurchase; /* */ import java.util.Vector; /* */ /* */ public class CommercialOrderForm extends OrderForm /* */ { /* 25 */ private Vector m_commercialOptionsList = null; /* */ /* 27 */ private CommercialOptionPurchase m_commercialOptionPurchase = null; /* */ /* 29 */ private long m_lPriceBandId = 0L; /* 30 */ private long m_lOrderId = 0L; /* 31 */ private long m_lAssetId = 0L; /* */ /* */ public Vector getCommercialOptionsList() /* */ { /* 38 */ return this.m_commercialOptionsList; /* */ } /* */ /* */ public void setCommercialOptionsList(Vector a_sCommercialOptionsList) /* */ { /* 47 */ this.m_commercialOptionsList = a_sCommercialOptionsList; /* */ } /* */ /* */ public CommercialOptionPurchase getCommercialOptionPurchase() /* */ { /* 56 */ return this.m_commercialOptionPurchase; /* */ } /* */ /* */ public void setCommercialOptionPurchase(CommercialOptionPurchase a_sCommercialOptionPurchase) /* */ { /* 65 */ this.m_commercialOptionPurchase = a_sCommercialOptionPurchase; /* */ } /* */ /* */ public long getAssetId() /* */ { /* 74 */ return this.m_lAssetId; /* */ } /* */ /* */ public void setAssetId(long a_lAssetId) /* */ { /* 83 */ this.m_lAssetId = a_lAssetId; /* */ } /* */ /* */ public long getOrderId() /* */ { /* 92 */ return this.m_lOrderId; /* */ } /* */ /* */ public void setOrderId(long a_lOrderId) /* */ { /* 101 */ this.m_lOrderId = a_lOrderId; /* */ } /* */ /* */ public long getPriceBandId() /* */ { /* 110 */ return this.m_lPriceBandId; /* */ } /* */ /* */ public void setPriceBandId(long a_lPriceBandId) /* */ { /* 119 */ this.m_lPriceBandId = a_lPriceBandId; /* */ } /* */ } /* Location: C:\Users\mamatha\Desktop\com.zip * Qualified Name: com.bright.assetbank.ecommerce.form.CommercialOrderForm * JD-Core Version: 0.6.0 */
[ "42003122+code7885@users.noreply.github.com" ]
42003122+code7885@users.noreply.github.com
bebf872b559f3b25d1789ef316da2e3ad5e5ca35
8a3b9fbc0b6cb52ac64bea9386c659059ba26bee
/src/LovelyPalindromesTest.java
872717951cfbd0e5db61b37a9466538258bb5edc
[]
no_license
william123456/YUP-PALINDROME-THINGS
b8026710152d7e63d0e7ac76d321e528ac17f9c4
849963c03e518b0009d6f474f6ce82c4d08e513c
refs/heads/master
2021-04-03T09:11:51.598501
2016-06-17T02:55:47
2016-06-17T02:55:47
61,341,255
0
0
null
null
null
null
UTF-8
Java
false
false
742
java
import org.junit.Test; import static org.junit.Assert.assertFalse; import static org.junit.Assert.assertTrue; /** * Lovely Palindromes * * This recipe tests understanding of string functions by requiring the identification of a palindrome. * * Creation date: 5/27/2016. * Author: Stephen * * Copyright 2016, The League of Amazing Programmers */ public class LovelyPalindromesTest { // 1. Test if a word is a palindrome @Test public void testIsPalindrome() { assertTrue(LovelyPalindromes.isPalindrome("racecar")); assertFalse(LovelyPalindromes.isPalindrome("firetruck")); assertTrue(LovelyPalindromes.isPalindrome("racecar")); assertFalse(LovelyPalindromes.isPalindrome(null)); } }
[ "titaniumsapphire32@gmail.com" ]
titaniumsapphire32@gmail.com
28ee0804988b8938a0e5332c72db4dc5f351c3d0
80c42c517e14de983604cbba65008934c70d98cc
/beige-common/src/main/java/org/beigesoft/service/ISrvHandleRequest.java
fe6170aba2c2bbfa61517204799a467837eb777c
[]
no_license
rudyENgithub/beige-software.
fbd3f3e30d71246d6fda3adb37b254a664ac237a
76684e39db198693f3cd9bbf83ef1d098fe89d24
refs/heads/master
2021-01-11T22:31:07.277529
2016-12-24T09:59:33
2016-12-24T09:59:33
78,980,508
0
0
null
null
null
null
UTF-8
Java
false
false
742
java
package org.beigesoft.service; /* * Beigesoft ™ * * Licensed under the Apache License, Version 2.0 * * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 */ import org.beigesoft.model.IRequestData; /** * <p>Abstraction of business service for handle request. * It is usually transactional service. * It based on abstraction of request data (get/set param, attribute) * that usually wrap HttpServletRequest(parameters/attributes).</p> * * @author Yury Demidenko */ public interface ISrvHandleRequest { /** * <p>Handle request.</p> * @param pRequestData Request Data * @throws Exception - an exception */ void handleRequest(IRequestData pRequestData) throws Exception; }
[ "demidenko05@gmail.com" ]
demidenko05@gmail.com
abe827b7b9438cbbef053e8947f361059fdd1d47
5d6c374a2518d469d674a1327d21d8e0cf2b54f7
/modules/plugin/postgis/src/test/java/org/geotools/data/postgis/PostgisFeatureReaderOnlineTest.java
b7cdfc28e616bc342bc98ff9b63d7b16424b59c1
[]
no_license
HGitMaster/geotools-osgi
648ebd9343db99a1e2688d9aefad857f6521898d
09f6e327fb797c7e0451e3629794a3db2c55c32b
refs/heads/osgi
2021-01-19T08:33:56.014532
2014-03-19T18:04:03
2014-03-19T18:04:03
4,750,321
3
0
null
2014-03-19T13:50:54
2012-06-22T11:21:01
Java
UTF-8
Java
false
false
5,917
java
/* * GeoTools - The Open Source Java GIS Toolkit * http://geotools.org * * (C) 2006-2008, Open Source Geospatial Foundation (OSGeo) * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; * version 2.1 of the License. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. */ package org.geotools.data.postgis; import java.sql.Statement; import org.geotools.data.DefaultQuery; import org.geotools.data.FeatureReader; import org.geotools.data.FeatureWriter; import org.geotools.data.Query; import org.geotools.data.Transaction; import org.geotools.data.postgis.fidmapper.PostgisFIDMapperFactory; import org.opengis.feature.simple.SimpleFeature; import org.opengis.feature.simple.SimpleFeatureType; /** * Hits a PostGIS database with a feature reader. * * @author Cory Horner, Refractions Research * * @source $URL: http://svn.osgeo.org/geotools/tags/2.6.5/modules/plugin/postgis/src/test/java/org/geotools/data/postgis/PostgisFeatureReaderOnlineTest.java $ */ public class PostgisFeatureReaderOnlineTest extends AbstractPostgisOnlineTestCase { protected void createTables(Statement st) throws Exception { createTable1(st); createTable2(st); createTable3(st); //advance the sequence to larger values st.execute("SELECT setval('"+table1+"_fid_seq', 2000000000);"); st.execute("SELECT setval('"+table3+"_fid_seq', 6000000000);"); //put some data in there String[] keys = new String[] {"name", "the_geom"}; String[] values = new String[] {"'f1'", "GeomFromText('POINT(1294523.17592358 469418.897140173)',4326)"}; addFeatureManual(table1, keys, values); values[0] = "'f2'"; values[1] = "GeomFromText('POINT(1281485.7108 459444.7332)',4326)"; addFeatureManual(table2, keys, values); values[0] = "'f3'"; values[1] = "GeomFromText('POINT(1271185.71084336 454376.774827237)',4326)"; addFeatureManual(table3, keys, values); } protected void setupGeometryColumns(Statement st) throws Exception { String preSql = "INSERT INTO geometry_columns (f_table_catalog, f_table_schema, f_table_name, f_geometry_column, coord_dimension, srid, type) VALUES ('',"; String postSql = ", 'the_geom', 2, 4326, 'POINT')"; //table1: no entry //table2: geometry_columns f_table_schema = '' String sql = preSql + "'', '" + table2 + "'" + postSql; st.execute(sql); // table3: geometry_columns f_table_schema = 'public' sql = preSql + "'public', '" + table3 + "'" + postSql; st.execute(sql); } /** * Make sure that both large integer and long values are acceptable and valid. * @throws Exception */ public void testReadFid() throws Exception { if ( ((PostgisFIDMapperFactory) ds.getFIDMapperFactory() ).isReturningTypedFIDMapper() ) { assertEquals(table1+".2000000001",attemptRead(table1)); //int is signed :( assertEquals(table3+".6000000001",attemptRead(table3)); } else { assertEquals("2000000001",attemptRead(table1)); //int is signed :( assertEquals("6000000001",attemptRead(table3)); } } /** * Adds a feature so we have something to read. */ protected boolean addFeature(String table) throws Exception { FeatureWriter<SimpleFeatureType, SimpleFeature> writer = ds.getFeatureWriter(table, Transaction.AUTO_COMMIT); SimpleFeature feature; while (writer.hasNext()) { feature = (SimpleFeature) writer.next(); } feature = (SimpleFeature) writer.next(); feature.setAttribute(0, "test"); //feature.setAttribute(1, val); writer.write(); String id = feature.getID(); return id != null; } protected void addFeatureManual(String table, String[] keys, String[] values) throws Exception { Statement st = ds.getDataSource().getConnection().createStatement(); StringBuffer sql = new StringBuffer(); sql.append("INSERT INTO \""); sql.append(table); sql.append("\" ("); for (int i = 0; i < keys.length; i++) { if (i > 0) { sql.append(","); } sql.append(keys[i]); } sql.append(") VALUES ("); for (int i = 0; i < values.length; i++) { if (i > 0) { sql.append(","); } sql.append(values[i]); } sql.append(")"); st.execute(sql.toString()); st.close(); } protected String attemptRead(String table) throws Exception { //addFeature(table); Query query = new DefaultQuery(table); FeatureReader<SimpleFeatureType, SimpleFeature> fr = ds.getFeatureReader(query, Transaction.AUTO_COMMIT); assertTrue(fr.hasNext()); SimpleFeature feature = fr.next(); String id = feature.getID(); fr.close(); return id; } public void testGetSchema() throws Exception { //test that getSchema works when a entry does not exist in the geometry_columns table SimpleFeatureType schema; schema = ds.getSchema(table1); assertNotNull(schema); //test that getSchema works when geometry_columns f_table_schema = public schema = ds.getSchema(table2); assertNotNull(schema); //test that getSchema works when geometry_columns f_table_schema = '' schema = ds.getSchema(table3); assertNotNull(schema); } }
[ "devnull@localhost" ]
devnull@localhost
c3f7174d49d65b24540bbc20c15bea49b403c791
8496752c51c318943b16c091ba92cb60b7980336
/Java/JavaSE/OpenGL/source/core/src/loon/core/graphics/component/LPad.java
3f9ac1dc108eb691c1a3d1027d7c90d4770dff00
[ "Apache-2.0" ]
permissive
terayang/LGame
e06f4adea9975b55918e6a05cde748eb29cdee31
2406f8feb0d9e451c8338e6a802150f09076ff9e
refs/heads/master
2021-05-26T16:53:28.825052
2013-01-20T07:15:08
2013-01-20T07:15:08
null
0
0
null
null
null
null
UTF-8
Java
false
false
5,778
java
/** * Copyright 2008 - 2012 * * 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. * * @project loon * @author cping * @email:javachenpeng@yahoo.com * @version 0.3.3 */ package loon.core.graphics.component; import loon.core.LSystem; import loon.core.graphics.LComponent; import loon.core.graphics.opengl.GLEx; import loon.core.graphics.opengl.LTexture; import loon.core.graphics.opengl.LTexturePack; import loon.core.graphics.opengl.LTexture.Format; import loon.core.input.LInputFactory.Touch; import loon.utils.MathUtils; public class LPad extends LComponent { private boolean isLeft, isRight, isUp, isDown, isClick; public static interface ClickListener { public void up(); public void down(); public void left(); public void right(); public void other(); } public ClickListener listener; private float centerX, centerY; private float offsetX, offsetY; private int dotWidth, dotHeight; private int angle; private int baseWidth, baseHeight; private int backWidth, backHeight; private LTexturePack pack; private float scale_pad; public LPad(int x, int y) { this(x, y, 1.2f); } public LPad(int x, int y, float scale) { this(x, y, LSystem.FRAMEWORK_IMG_NAME + "pad_ui.xml", scale); } public LPad(int x, int y, String config, float scale) { this(x, y, new LTexturePack(config), scale); } public LPad(int x, int y, LTexturePack p, float scale) { super(x, y, (int) (p.getEntry("fore").width() * scale), (int) (p .getEntry("fore").height() * scale)); this.offsetX = 6 * scale; this.offsetY = 6 * scale; this.pack = p; this.dotWidth = (int) (p.getEntry("dot").width() * scale); this.dotHeight = (int) (p.getEntry("dot").height() * scale); this.baseWidth = (int) (p.getEntry("fore").width() * scale); this.baseHeight = (int) (p.getEntry("fore").height() * scale); this.backWidth = (int) (p.getEntry("back").width() * scale); this.backHeight = (int) (p.getEntry("back").height() * scale); this.centerX = (baseWidth - dotWidth) / 2 + offsetX; this.centerY = (baseHeight - dotHeight) / 2 + offsetY; this.scale_pad = scale; p.setFormat(Format.LINEAR); } public float getScale() { return scale_pad; } void freeClick() { this.isLeft = false; this.isRight = false; this.isDown = false; this.isUp = false; this.isClick = false; if (listener != null) { listener.other(); } } protected void processTouchReleased() { freeClick(); } protected void processTouchPressed() { final float x = MathUtils.bringToBounds(0, baseWidth, Touch.getX() - getScreenX()) / baseWidth - 0.5f; final float y = MathUtils.bringToBounds(0, baseHeight, Touch.getY() - getScreenY()) / baseHeight - 0.5f; if (x == 0 && y == 0) { return; } if (MathUtils.abs(x) > MathUtils.abs(y)) { if (x > 0) { this.isRight = true; this.isClick = true; this.centerX = offsetX + x + (baseWidth - dotWidth) / 2 + dotWidth * 0.75f; this.centerY = offsetY + y + (baseHeight - dotHeight) / 2; if (listener != null) { listener.right(); } } else if (x < 0) { this.isLeft = true; this.isClick = true; this.centerX = offsetX + x + (baseWidth - dotWidth) / 2 - dotWidth * 0.75f; this.centerY = offsetY + y + (baseHeight - dotHeight) / 2; if (listener != null) { listener.left(); } } else if (x == 0) { freeClick(); } } else { if (y > 0) { this.isDown = true; this.isClick = true; this.centerX = offsetX + x + (baseWidth - dotWidth) / 2 - 1; this.centerY = offsetY + y + (baseHeight - dotHeight) / 2 + dotHeight * 0.75f; if (listener != null) { listener.down(); } } else if (y < 0) { this.isUp = true; this.isClick = true; this.centerX = offsetX + x + (baseWidth - dotWidth) / 2 - 1; this.centerY = offsetY + y + (baseHeight - dotHeight) / 2 - dotHeight * 0.75f; if (listener != null) { listener.up(); } } else if (y == 0) { freeClick(); } } } public void createUI(GLEx g, int x, int y, LComponent component, LTexture[] buttonImage) { if (Touch.isUp()) { freeClick(); } pack.glBegin(); pack.draw(0, x, y, backWidth, backHeight); if (isClick) { if (angle < 360) { angle += 1; } else { angle = 0; } pack.draw(2, x + centerX, y + centerY, dotWidth, dotHeight, angle, null); } pack.draw(1, x + (backWidth - baseWidth) * 0.5f, y + (backHeight - baseHeight) * 0.5f, baseWidth, baseHeight); pack.glEnd(); } public boolean isLeft() { return isLeft; } public boolean isRight() { return isRight; } public boolean isUp() { return isUp; } public boolean isDown() { return isDown; } public boolean isClick() { return isClick; } public ClickListener getListener() { return listener; } public void setListener(ClickListener listener) { this.listener = listener; } public float getOffsetX() { return offsetX; } public void setOffsetX(float offsetX) { this.offsetX = offsetX; } public float getOffsetY() { return offsetY; } public void setOffsetY(float offsetY) { this.offsetY = offsetY; } public String getUIName() { return "Pad"; } public void dispose() { if (pack != null) { pack.dispose(); } } }
[ "longwind2012@hotmail.com" ]
longwind2012@hotmail.com
435e44d7169b5b1952b6347950b6c1cfb3e4d346
7390adf2ecf832331be2a3d2f3ead5c57110abbf
/src/javawebStage/jDBC/c3p0/C3p0Test.java
de975e30d79385ebd693ed3ec9a7a43fa1c5cd17
[]
no_license
Wmt-Monica/Javaweb
e30ea924d04f1ec7df4531c565b25a7ec1c50ae7
25a0fb2dade89a0228146358f445a2ab07270680
refs/heads/master
2023-02-28T06:06:57.391727
2021-01-27T14:54:02
2021-01-27T14:54:02
317,706,136
0
0
null
null
null
null
UTF-8
Java
false
false
2,369
java
package javawebStage.jDBC.c3p0; import com.mchange.v2.c3p0.ComboPooledDataSource; import javawebStage.jDBC.c3p0.util.C3p0Util; import org.junit.Test; import java.sql.Connection; import java.sql.PreparedStatement; import java.sql.SQLException; /** * 注意:c3p0-config.xml 配置文件需要添加在 src 路径下面,否则创建 Connection 连接对象失败 */ public class C3p0Test { // 使用 C3p0Util 工具类来获取连接对象 @Test public void test2(){ Connection conn = null; PreparedStatement pre = null; // 创建 SQL 语句 String sql = "insert into animal(animal_id, animal_name) values(11, '燔猴子')"; try { // 根据 c3p0 外来连接池创建连接对象 conn = new C3p0Util().getConnection(); // 根据连接对象创建执行 SQL 语句的 PreparedStatement 对象 pre = conn.prepareStatement(sql); // 执行 SQL 语句 pre.execute(); } catch (SQLException e) { e.printStackTrace(); }finally { try { pre.close(); conn.close(); } catch (SQLException e) { e.printStackTrace(); } System.out.println("SQL 语句执行完毕......"); } } @Test public void test1(){ Connection conn = null; PreparedStatement pre = null; // 以下不传入参数默认时创建配置文件中默认的数据库对象 ComboPooledDataSource dataSource = new ComboPooledDataSource(); // 创建 SQL 语句 String sql = "insert into animal(animal_id, animal_name) values(22, '燔猴子')"; try { // 根据 c3p0 外来连接池创建连接对象 conn = dataSource.getConnection(); // 根据连接对象创建执行 SQL 语句的 PreparedStatement 对象 pre = conn.prepareStatement(sql); // 执行 SQL 语句 pre.execute(); } catch (SQLException e) { e.printStackTrace(); }finally { try { pre.close(); conn.close(); } catch (SQLException e) { e.printStackTrace(); } System.out.println("SQL 语句执行完毕......"); } } }
[ "3040988158@qq.com" ]
3040988158@qq.com
e8e56dae6b92344f4a5a8861e289064d31b917d9
46058529be3de9d3188bf1fbb9abe7185ce874b6
/forms/src/org/riotfamily/forms/event/JavaScriptEvent.java
e68e07526ccf3b1c918037df3b80f5d4a5b08077
[ "Apache-2.0" ]
permissive
evgeniy-fitsner/riot
6d2cacb80f79cfdddf4d743d8390cbff15d1d881
1107e587af0e646599a5b5ed39f422ee524ac88a
refs/heads/9.1.x
2021-01-12T21:28:56.337194
2014-07-17T07:39:38
2014-07-17T07:42:51
29,406,556
0
1
null
2015-01-17T21:38:48
2015-01-17T21:38:48
null
UTF-8
Java
false
false
1,526
java
/* Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org.riotfamily.forms.event; import javax.servlet.http.HttpServletRequest; /** * Serverside representation of a clientside JavaScript event. */ public class JavaScriptEvent { public static final int NONE = 0; public static final int ON_CLICK = 1; public static final int ON_CHANGE = 2; private int type; private String value; private String[] values; public JavaScriptEvent(HttpServletRequest request) { String submittedType = request.getParameter("event.type"); if (submittedType.equals("click")) { this.type = ON_CLICK; } if (submittedType.equals("change")) { this.type = ON_CHANGE; } this.values = request.getParameterValues("source.value"); this.value = request.getParameter("source.value"); } public int getType() { return type; } public String getValue() { return value; } public String[] getValues() { return this.values; } public void setValues(String[] values) { this.values = values; } }
[ "felix.gnass@riotfamily.org" ]
felix.gnass@riotfamily.org
5ed82ac6ad7b39217b63f8420073560019c4380d
8767bf1de1c46bfbc8c2cc01aba9d3d4de130eee
/test/level16/lesson13/home07/Solution.java
2da2fdb7e0d80104d610acef4be677685bf4bbf2
[]
no_license
nenya-alex/javarush
8070e682c31f6b74164d26872a5927ac0e6e8703
eac49e3c0edcdaa1790ab2fbbc3425ad7ef7ddac
refs/heads/master
2016-09-02T01:41:22.197290
2015-09-05T14:55:51
2015-09-05T14:55:51
41,964,779
1
1
null
null
null
null
UTF-8
Java
false
false
9,050
java
package com.javarush.test.level16.lesson13.home07; import java.util.ArrayList; import java.util.List; /* Поиграем? Три человека играют в игру. Каждый игрок(Gamer) характеризуется двумя параметрами: фамилией(name) и количеством действий в секунду (rating). Нужно вывести в консоль ход игры и определить победителя и проигравших. Итак... 1. Разберись, что делает программа. 1.1. List<String> steps хранит последовательность действий, которое каждый игрок выполняет от 0 до последнего. 1.2. isWinnerFound показывает, найден победитель или нет. 1.3. метод sleep выбрасывает InterruptedException и принимает параметр типа long. 1.4. Игорки играют независимо друг от друга. 2. Реализуйте логику метода run так, чтобы для каждого игрока: 2.1. за 1 секунду через равные интервалы времени выводилось в консоль rating описанных в steps действий. 2.2. Любой текст должен начинаться с фамилии игрока (метод getName()), потом следовать двоеточие, а затем сам текст. Пример: [Ivanov:Начало игры]. 2.3. Когда игрок выполнит все действия из steps, то он считается победителем. Выведите [getName() + ":победитель!"]. 2.4. Когда найден победитель, то игра останавливается, и остальные игроки считаются побежденными. Выведите для них [getName() + ":проиграл"]. */ // хорошая задача // способ 1 - работает, но не принимается //public class Solution { // public static void main(String[] args) throws InterruptedException { // OnlineGame onlineGame = new OnlineGame(); // onlineGame.start(); // } // // public static class OnlineGame extends Thread { // public static volatile boolean isWinnerFound = false; // // public static List<String> steps = new ArrayList<String>(); // // static { // steps.add("Начало игры"); // steps.add("Сбор ресурсов"); // steps.add("Рост экономики"); // steps.add("Убийство врагов"); // } // // protected Gamer gamer1 = new Gamer("Ivanov", 3); // protected Gamer gamer2 = new Gamer("Petrov", 1); // protected Gamer gamer3 = new Gamer("Sidorov", 5); // // public void run() { // gamer1.start(); // gamer2.start(); // gamer3.start(); // // while (!isWinnerFound) { // } // gamer1.interrupt(); // gamer2.interrupt(); // gamer3.interrupt(); // } // } // // public static class Gamer extends Thread { // private int rating; // // public Gamer(String name, int rating) { // super(name); // this.rating = rating; // } // // @Override // public void run() { // //Add your code here - добавь код тут // List<String> st = OnlineGame.steps; // int k=0; // for (int i = 0; i < st.size(); i++) // { // if (i+1 <= rating) // { // k++; // System.out.println(this.getName()+":"+st.get(i)); // try // { // Thread.sleep((long)1000 / st.size()); // } // catch (InterruptedException e) // { // // } // } //// // // } // if (k == st.size()) // { // System.out.println(this.getName() + ":победитель!"); // // } // else // { // try // { // long b = 1000-(1000 / st.size())*k+1; // // sleep(b); // // } // catch (InterruptedException e) // { // // } // } // if (k < st.size()) // { // // System.out.println(this.getName() + ":проиграл"); // OnlineGame.isWinnerFound = true; // // } // } // // // } //} // способ 2. public class Solution { public static void main(String[] args) throws InterruptedException { OnlineGame onlineGame = new OnlineGame(); onlineGame.start(); } public static class OnlineGame extends Thread { public static volatile boolean isWinnerFound = false; public static List<String> steps = new ArrayList<String>(); static { steps.add("Начало игры"); steps.add("Сбор ресурсов"); steps.add("Рост экономики"); steps.add("Убийство врагов"); } protected Gamer gamer1 = new Gamer("Ivanov", 3); protected Gamer gamer2 = new Gamer("Petrov", 1); protected Gamer gamer3 = new Gamer("Sidorov", 5); public void run() { gamer1.start(); gamer2.start(); gamer3.start(); while (!isWinnerFound) { } gamer1.interrupt(); gamer2.interrupt(); gamer3.interrupt(); } } public static class Gamer extends Thread { private int rating; public Gamer(String name, int rating) { super(name); this.rating = rating; } @Override // мое решение, не принимает, но условия все выполнены // public void run() { // //Add your code here - добавь код тут // List<String> st = OnlineGame.steps; // int k=0, n=0; // int i =0; // while (k<1000) // { // if (i<st.size()) // { // System.out.println(this.getName() + ":" + st.get(i)); // try // { // Thread.sleep((long) 1000 / rating); // } // catch (InterruptedException e) // { // e.getMessage(); // } // k = k + 1000 / rating + 1; // i++; // n++; // //System.out.println(this.getName()+" "+n+" "+k); // if (n == st.size()) // { // //System.out.println(this.getName() + ":победитель!"); // break; // //OnlineGame.isWinnerFound = true; // } // } // //System.out.println(this.getName()+" "+n+" "+k); // } // //System.out.println(this.getName()+" "+n); // if (n == st.size()) // { // System.out.println(this.getName() + ":победитель!"); // // } // else // { // System.out.println(this.getName() + ":проиграл"); // OnlineGame.isWinnerFound = true; // } //// if (k < st.size()) //// { //// //// System.out.println(this.getName() + ":проиграл"); //// OnlineGame.isWinnerFound = true; //// //// } // } // принимает этот списаный выриант public void run() { //Add your code here - добавь код тут try{ while (!OnlineGame.isWinnerFound) { int iterator; int endCount = OnlineGame.steps.size(); for (iterator = 0; iterator < OnlineGame.steps.size(); iterator++) { System.out.println(getName() + ":" + OnlineGame.steps.get(iterator)); Thread.sleep(1000/rating); } if (iterator == endCount) { System.out.println(getName() + ":победитель!"); OnlineGame.isWinnerFound = true; } } }catch (InterruptedException e) { System.out.println(getName() + ":проиграл"); } } } }
[ "alexni@ukr.net" ]
alexni@ukr.net
038dbafca0d122f8cf9fa84212fe819ab7f40e01
f1e685c60a1f7a2cb988aec6325f3a34d9049cce
/src/main/java/io/openmessaging/demo/DefaultProducer.java
43ea4e4549b8aaf75f603d817f9d798c6b5cc12e
[]
no_license
IceSeaOnly/QiongQi
6d5441361e3f1248b0c08974a02de6d39d041f55
a7a5138f5da8b6baa813d483da2f31279e841ee6
refs/heads/master
2021-01-19T22:05:38.734130
2017-05-23T05:52:05
2017-05-23T05:52:05
88,752,472
0
0
null
null
null
null
UTF-8
Java
false
false
6,243
java
package io.openmessaging.demo; import io.openmessaging.BatchToPartition; import io.openmessaging.BytesMessage; import io.openmessaging.KeyValue; import io.openmessaging.Message; import io.openmessaging.MessageFactory; import io.openmessaging.MessageHeader; import io.openmessaging.Producer; import io.openmessaging.Promise; import java.util.ArrayList; import java.util.HashMap; import java.util.Iterator; import java.util.Map; import java.util.concurrent.LinkedBlockingDeque; import static java.lang.Thread.sleep; public class DefaultProducer implements Producer,MessageFactory { private static final int MAXSIZE_EACH_FILE = 5000; private FileSaveThread fileSaveThread; private LinkedBlockingDeque<DataPackage> dataPackages; private KeyValue properties; //这里包含文件存放路径 private String FILEPATH = null; // private Map<String,Integer> dataCounter; // 文件存储计数器 private ArrayList<String> topicInitedNameList; // topic计数器初始化标志器 private ArrayList<String> queueInitedNameList; // queue计数器初始化标志器 private Map<String,ArrayList<Message>> queues; private Map<String,ArrayList<Message>> topics; public DefaultProducer(KeyValue properties) { this.properties = properties; FILEPATH = properties.getString("STORE_PATH"); if(!FILEPATH.endsWith("/")) FILEPATH += "/"; dataPackages = new LinkedBlockingDeque<>(); dataCounter = new HashMap<>(); queues = new HashMap<>(); topics = new HashMap<>(); topicInitedNameList = new ArrayList<>(); queueInitedNameList = new ArrayList<>(); fileSaveThread = new FileSaveThread(dataPackages); fileSaveThread.start(); } @Override public BytesMessage createBytesMessageToTopic(String topic, byte[] body) { ISMessage defaultBytesMessage = new ISMessage(body); defaultBytesMessage.putHeaders(MessageHeader.TOPIC, topic); return defaultBytesMessage; } @Override public BytesMessage createBytesMessageToQueue(String queue, byte[] body) { ISMessage defaultBytesMessage = new ISMessage(body); defaultBytesMessage.putHeaders(MessageHeader.QUEUE, queue); return defaultBytesMessage; } @Override public void send(Message message) { if (message == null) throw new ClientOMSException("Message should not be null"); String topic = message.headers().getString(MessageHeader.TOPIC); String queue = message.headers().getString(MessageHeader.QUEUE); if ((topic == null && queue == null) || (topic != null && queue != null)) { throw new ClientOMSException(String.format("Queue:%s Topic:%s should put one and only one", true, queue)); } // 重写存储逻辑,高效存储 if(topic == null){ // to queue if(!queueInitedNameList.contains(queue)){ queueInitedNameList.add(queue); queues.put(queue,new ArrayList<>()); dataCounter.put(queue,0); } queues.get(queue).add(message); if(queues.get(queue).size() > MAXSIZE_EACH_FILE){ int index = dataCounter.get(queue); dataCounter.put(queue,index+1); dataPackages.add(new DataPackage(0,FILEPATH+"q/",queue+"-"+index,queues.get(queue))); queues.put(queue,new ArrayList<>()); } }else{ // to topic if(!topicInitedNameList.contains(topic)){ topicInitedNameList.add(topic); topics.put(topic,new ArrayList<>()); dataCounter.put(topic,0); } topics.get(topic).add(message); if(topics.get(topic).size() > MAXSIZE_EACH_FILE){ int index = dataCounter.get(topic); dataCounter.put(topic,index+1); dataPackages.add(new DataPackage(1,FILEPATH+"t/",topic+"-"+index,topics.get(topic))); topics.put(topic,new ArrayList<>()); } } } @Override public void flush() { for (int i = 0; i < topicInitedNameList.size(); i++) { String topic = topicInitedNameList.get(i); if(topics.get(topic).size() > 0){ int index = dataCounter.get(topic); dataPackages.add(new DataPackage(1,FILEPATH+"t/",topic+"-"+index,topics.get(topic))); } } for (int i = 0; i < queueInitedNameList.size(); i++) { String queue = queueInitedNameList.get(i); if(queues.get(queue).size() > 0){ int index = dataCounter.get(queue); dataPackages.add(new DataPackage(0,FILEPATH+"q/",queue+"-"+index,queues.get(queue))); } } while (!dataPackages.isEmpty()){ try { sleep(50); } catch (InterruptedException e) { e.printStackTrace(); } } } @Override public void send(Message message, KeyValue properties) { throw new UnsupportedOperationException("Unsupported"); } @Override public Promise<Void> sendAsync(Message message) { throw new UnsupportedOperationException("Unsupported"); } @Override public Promise<Void> sendAsync(Message message, KeyValue properties) { throw new UnsupportedOperationException("Unsupported"); } @Override public void sendOneway(Message message) { throw new UnsupportedOperationException("Unsupported"); } @Override public void sendOneway(Message message, KeyValue properties) { throw new UnsupportedOperationException("Unsupported"); } @Override public BatchToPartition createBatchToPartition(String partitionName) { throw new UnsupportedOperationException("Unsupported"); } @Override public BatchToPartition createBatchToPartition(String partitionName, KeyValue properties) { throw new UnsupportedOperationException("Unsupported"); } @Override public void start() { } @Override public void shutdown() { } @Override public KeyValue properties() { return properties; } }
[ "1041414957@qq.com" ]
1041414957@qq.com
2615569fde8dbed2365930e26654fee2f5709e0c
821ed0666d39420d2da9362d090d67915d469cc5
/apps/cpman/app/src/test/java/org/onosproject/cpman/impl/message/ControlMessageServiceAdaptor.java
34b02ef491296c1ecc1798d09a28413ddb8608af
[ "Apache-2.0" ]
permissive
LenkayHuang/Onos-PNC-for-PCEP
03b67dcdd280565169f2543029279750da0c6540
bd7d201aba89a713f5ba6ffb473aacff85e4d38c
refs/heads/master
2021-01-01T05:19:31.547809
2016-04-12T07:25:13
2016-04-12T07:25:13
56,041,394
1
0
null
null
null
null
UTF-8
Java
false
false
1,111
java
/* * Copyright 2016 Open Networking Laboratory * * 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.onosproject.cpman.impl.message; import org.onosproject.cpman.message.ControlMessageListener; import org.onosproject.cpman.message.ControlMessageService; /** * Test adapter for control message service. */ public class ControlMessageServiceAdaptor implements ControlMessageService { @Override public void addListener(ControlMessageListener listener) { } @Override public void removeListener(ControlMessageListener listener) { } }
[ "826080529@qq.com" ]
826080529@qq.com
b142fa2a4639c5c381de24987e1b9e3cb8698439
13ea5da0b7b8d4ba87d622a5f733dcf6b4c5f1e3
/crash-reproduction-new-fitness/results/MATH-3b-1-9-Single_Objective_GGA-IntegrationSingleObjective-/org/apache/commons/math3/util/MathArrays_ESTest_scaffolding.java
bcde781110b537ca1665920651582146260879d2
[ "MIT", "CC-BY-4.0" ]
permissive
STAMP-project/Botsing-basic-block-coverage-application
6c1095c6be945adc0be2b63bbec44f0014972793
80ea9e7a740bf4b1f9d2d06fe3dcc72323b848da
refs/heads/master
2022-07-28T23:05:55.253779
2022-04-20T13:54:11
2022-04-20T13:54:11
285,771,370
0
0
null
null
null
null
UTF-8
Java
false
false
4,550
java
/** * Scaffolding file used to store all the setups needed to run * tests automatically generated by EvoSuite * Sat May 16 22:13:51 UTC 2020 */ package org.apache.commons.math3.util; import org.evosuite.runtime.annotation.EvoSuiteClassExclude; import org.junit.BeforeClass; import org.junit.Before; import org.junit.After; @EvoSuiteClassExclude public class MathArrays_ESTest_scaffolding { @org.junit.Rule public org.evosuite.runtime.vnet.NonFunctionalRequirementRule nfr = new org.evosuite.runtime.vnet.NonFunctionalRequirementRule(); private org.evosuite.runtime.thread.ThreadStopper threadStopper = new org.evosuite.runtime.thread.ThreadStopper (org.evosuite.runtime.thread.KillSwitchHandler.getInstance(), 3000); @BeforeClass public static void initEvoSuiteFramework() { org.evosuite.runtime.RuntimeSettings.className = "org.apache.commons.math3.util.MathArrays"; org.evosuite.runtime.GuiSupport.initialize(); org.evosuite.runtime.RuntimeSettings.maxNumberOfIterationsPerLoop = 10000; org.evosuite.runtime.RuntimeSettings.mockSystemIn = true; org.evosuite.runtime.Runtime.getInstance().resetRuntime(); } @Before public void initTestCase(){ threadStopper.storeCurrentThreads(); threadStopper.startRecordingTime(); org.evosuite.runtime.GuiSupport.setHeadless(); org.evosuite.runtime.Runtime.getInstance().resetRuntime(); org.evosuite.runtime.agent.InstrumentingAgent.activate(); } @After public void doneWithTestCase(){ threadStopper.killAndJoinClientThreads(); org.evosuite.runtime.agent.InstrumentingAgent.deactivate(); org.evosuite.runtime.GuiSupport.restoreHeadlessMode(); } private static void initializeClasses() { org.evosuite.runtime.classhandling.ClassStateSupport.initializeClasses(MathArrays_ESTest_scaffolding.class.getClassLoader() , "org.apache.commons.math3.fraction.BigFractionField", "org.apache.commons.math3.dfp.DfpField", "org.apache.commons.math3.util.Precision", "org.apache.commons.math3.exception.util.ExceptionContextProvider", "org.apache.commons.math3.dfp.DfpField$RoundingMode", "org.apache.commons.math3.fraction.BigFraction", "org.apache.commons.math3.util.MathArrays", "org.apache.commons.math3.util.MathArrays$1", "org.apache.commons.math3.util.MathArrays$2", "org.apache.commons.math3.util.MathArrays$3", "org.apache.commons.math3.fraction.FractionField", "org.apache.commons.math3.exception.util.ArgUtils", "org.apache.commons.math3.exception.MathArithmeticException", "org.apache.commons.math3.util.MathArrays$OrderDirection", "org.apache.commons.math3.complex.Complex", "org.apache.commons.math3.exception.NumberIsTooSmallException", "org.apache.commons.math3.fraction.FractionField$1", "org.apache.commons.math3.util.BigRealField", "org.apache.commons.math3.exception.NotPositiveException", "org.apache.commons.math3.exception.MathInternalError", "org.apache.commons.math3.exception.MathIllegalStateException", "org.apache.commons.math3.dfp.Dfp", "org.apache.commons.math3.exception.NonMonotonicSequenceException", "org.apache.commons.math3.RealFieldElement", "org.apache.commons.math3.exception.MathIllegalArgumentException", "org.apache.commons.math3.complex.ComplexField", "org.apache.commons.math3.exception.MathIllegalNumberException", "org.apache.commons.math3.util.Pair", "org.apache.commons.math3.exception.util.LocalizedFormats", "org.apache.commons.math3.util.Decimal64Field", "org.apache.commons.math3.util.BigRealField$1", "org.apache.commons.math3.util.FastMath", "org.apache.commons.math3.exception.DimensionMismatchException", "org.apache.commons.math3.FieldElement", "org.apache.commons.math3.exception.util.Localizable", "org.apache.commons.math3.fraction.BigFractionField$1", "org.apache.commons.math3.util.BigReal", "org.apache.commons.math3.util.Decimal64", "org.apache.commons.math3.exception.NotStrictlyPositiveException", "org.apache.commons.math3.fraction.Fraction", "org.apache.commons.math3.complex.ComplexField$1", "org.apache.commons.math3.exception.util.ExceptionContext", "org.apache.commons.math3.exception.NullArgumentException", "org.apache.commons.math3.exception.NoDataException", "org.apache.commons.math3.Field", "org.apache.commons.math3.util.MathArrays$Function" ); } }
[ "pouria.derakhshanfar@gmail.com" ]
pouria.derakhshanfar@gmail.com
73f2e2fd248d82d1af135bf44668373b91f20afd
0205999a193bf670cd9d6e5b37e342b75f4e15b8
/spring-web/src/test/java/org/springframework/web/cors/CorsUtilsTests.java
269ac62eade0e46d77e69d82e5768068af61b973
[ "Apache-2.0" ]
permissive
leaderli/spring-source
18aa9a8c7c5e22d6faa6167e999ff88ffa211ba0
0edd75b2cedb00ad1357e7455a4fe9474b3284da
refs/heads/master
2022-02-18T16:34:19.625966
2022-01-29T08:56:48
2022-01-29T08:56:48
204,468,286
0
0
null
null
null
null
UTF-8
Java
false
false
2,286
java
/* * Copyright 2002-2019 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.web.cors; import org.junit.Test; import org.springframework.http.HttpHeaders; import org.springframework.http.HttpMethod; import org.springframework.mock.web.test.MockHttpServletRequest; import static org.assertj.core.api.Assertions.assertThat; /** * Test case for {@link CorsUtils}. * * @author Sebastien Deleuze */ public class CorsUtilsTests { @Test public void isCorsRequest() { MockHttpServletRequest request = new MockHttpServletRequest(); request.addHeader(HttpHeaders.ORIGIN, "https://domain.com"); assertThat(CorsUtils.isCorsRequest(request)).isTrue(); } @Test public void isNotCorsRequest() { MockHttpServletRequest request = new MockHttpServletRequest(); assertThat(CorsUtils.isCorsRequest(request)).isFalse(); } @Test public void isPreFlightRequest() { MockHttpServletRequest request = new MockHttpServletRequest(); request.setMethod(HttpMethod.OPTIONS.name()); request.addHeader(HttpHeaders.ORIGIN, "https://domain.com"); request.addHeader(HttpHeaders.ACCESS_CONTROL_REQUEST_METHOD, "GET"); assertThat(CorsUtils.isPreFlightRequest(request)).isTrue(); } @Test public void isNotPreFlightRequest() { MockHttpServletRequest request = new MockHttpServletRequest(); assertThat(CorsUtils.isPreFlightRequest(request)).isFalse(); request = new MockHttpServletRequest(); request.setMethod(HttpMethod.OPTIONS.name()); request.addHeader(HttpHeaders.ORIGIN, "https://domain.com"); assertThat(CorsUtils.isPreFlightRequest(request)).isFalse(); } }
[ "429243408@qq.com" ]
429243408@qq.com
b647df656cb68951277656cd546a4b2c49a4fe1b
df95e42764c99c8c9ab722a04c4ccb4f554b703b
/common-parent/edu-service/src/main/java/com/yuxiu/edu/service/base/BaseServiceImpl.java
d8a154f6f91995b0680e10911faca196913802c0
[]
no_license
githubwxq/EduProject
36377906cf708f3c4239fcc951201a29463df56c
926abf6641623cbecd81624f7bce7ac31a5f27f8
refs/heads/master
2020-04-28T03:30:13.156704
2019-03-22T05:57:43
2019-03-22T05:57:43
174,940,264
0
0
null
null
null
null
UTF-8
Java
false
false
286
java
package com.yuxiu.edu.service.base; import com.yuxiu.edu.mapper.UserMapper; import org.springframework.beans.factory.annotation.Autowired; public abstract class BaseServiceImpl<T> implements IBaseService<T> { // 《自动注入》 @Autowired protected UserMapper userMapper; }
[ "805380422@qq.com" ]
805380422@qq.com
f628bb7008744a14b5dfe3c83703b97d95cbc8c9
58755aa473aca837e635dd67d5c3bd1cbf68f93d
/src/org/a807966224/xicp/demo0_2.java
fb701b878d9fbb163baa59e4e3b21643bbab5280
[]
no_license
a807966224/DesignPatterns
8edc6c088ed93eb032731a0726b04e97430b6900
42642f3d093313747adef2a4344da2a9c476f84e
refs/heads/master
2021-06-30T20:57:24.477230
2017-09-20T13:44:44
2017-09-20T13:44:44
null
0
0
null
null
null
null
UTF-8
Java
false
false
3,224
java
package org.a807966224.xicp; class Data2Producer2 implements Runnable{ private Data2 Data2;//获取数据中心依赖 public Data2Producer2(Data2 Data2) { this.Data2 = Data2; } @Override public void run() { for(int i=0;i<20;i++) { if(i%2 == 0) { this.Data2.set("zx", 25, "male"); }else { this.Data2.set("wjj", 24, "female"); } } } } class Data2Consumer2 implements Runnable{ private Data2 Data2;//获取数据中心依赖 public Data2Consumer2(Data2 Data2) { this.Data2 = Data2; } @Override public void run() { for(int i=0;i<20;i++) { this.Data2.get(); } } } class Data2{ private String name; private int age; private String sex; //添加标志位: true 代表可以生产 不可以取走 // false 代表可以取走 不可以生产 private boolean flag = true; public synchronized void set(String name,int age,String sex) { if(this.flag == false) { try { this.wait(); } catch (InterruptedException e) { e.printStackTrace(); } } this.name = name; this.age = age; try { Thread.sleep(200); } catch (InterruptedException e) { e.printStackTrace(); } this.sex = sex; this.flag = false; super.notify(); } public synchronized void get() { try { Thread.sleep(200); } catch (InterruptedException e) { e.printStackTrace(); } if(this.flag == true) { try { this.wait(); } catch (InterruptedException e) { e.printStackTrace(); } } System.out.println(this.toString()); this.flag = true; super.notify(); } public String getName() { return name; } public void setName(String name) { this.name = name; } public int getAge() { return age; } public void setAge(int age) { this.age = age; } public String getSex() { return sex; } public void setSex(String sex) { this.sex = sex; } @Override public String toString() { return "Data2 [name=" + name + ", age=" + age + ", sex=" + sex + "]"; } } /** * 生产者/消费者 基础模型 * @author zhaoxin * 本例代码:解决由于网络延迟带来的数据不同步问题,但是 出现了 获取数据的重复问题 * 为了解决数据重复的问题 我们需要去 找寻 Object类为我们提供的关于线程的方法 * public final void wait() throws InterruptedException 实现线程等待机制 * public final void notify() 唤醒当前第一个线程 * public final void notifyAll() 唤醒所有休眠的线程 * * 总结: * 首先需要明白的是 这些问题的发生 是由于线程的先后顺序无法确定的原因 * 想要实现 供给关系 * 必须做到一个线程进来设置后 另一个线程才可取走 * 代码块或方法体上上锁(synchornized修饰) 只是能保证 一个线程进入 但是并不能保证 交替的两个线程的顺序 * 所以 我们需要 加上 标志位 配合上object类提供的线程休眠与唤醒机制 用来处理线程的先后顺序 达到最后的供给关系 * */ public class demo0_2 { public static void main(String[] args) { Data2 Data2 = new Data2(); new Thread(new Data2Producer2(Data2)).start(); new Thread(new Data2Consumer2(Data2)).start(); } }
[ "807966224@qq.com" ]
807966224@qq.com
78029997055940df49b20b0cc264dd59544eddf5
cecca027e6d0e400e466f41107ffcb1b00e1024f
/api_manage_service/src/test/java/com/king/yyl/security/OAuth2TokenMockUtil.java
81f91f10a3aefacf01396dec14001aa6184b1349
[]
no_license
AprilPark1012/TestPlatformDemo
543d7e3f14017642cb49a03be0d332878241df41
5d9452f74e8c8a3ca35695b2943f18005747f10a
refs/heads/master
2021-07-26T00:37:31.306224
2017-11-02T09:44:11
2017-11-02T09:44:11
109,205,980
1
0
null
2017-11-02T02:05:42
2017-11-02T02:05:42
null
UTF-8
Java
false
false
3,357
java
package com.king.yyl.security; import org.springframework.boot.test.mock.mockito.MockBean; import org.springframework.mock.web.MockHttpServletRequest; import org.springframework.security.authentication.UsernamePasswordAuthenticationToken; import org.springframework.security.core.Authentication; import org.springframework.security.core.GrantedAuthority; import org.springframework.security.core.authority.SimpleGrantedAuthority; import org.springframework.security.core.userdetails.User; import org.springframework.security.oauth2.common.DefaultOAuth2AccessToken; import org.springframework.security.oauth2.provider.OAuth2Authentication; import org.springframework.security.oauth2.provider.OAuth2Request; import org.springframework.security.oauth2.provider.token.ResourceServerTokenServices; import org.springframework.stereotype.Component; import org.springframework.test.web.servlet.request.RequestPostProcessor; import java.util.Collections; import java.util.List; import java.util.Set; import java.util.UUID; import java.util.stream.Collectors; import static org.mockito.BDDMockito.given; /** * A bean providing simple mocking of OAuth2 access tokens for security integration tests. */ @Component public class OAuth2TokenMockUtil { @MockBean private ResourceServerTokenServices tokenServices; private OAuth2Authentication createAuthentication(String username, Set<String> scopes, Set<String> roles) { List<GrantedAuthority> authorities = roles.stream() .map(SimpleGrantedAuthority::new) .collect(Collectors.toList()); User principal = new User(username, "test", true, true, true, true, authorities); Authentication authentication = new UsernamePasswordAuthenticationToken(principal, principal.getPassword(), principal.getAuthorities()); // Create the authorization request and OAuth2Authentication object OAuth2Request authRequest = new OAuth2Request(null, "testClient", null, true, scopes, null, null, null, null); return new OAuth2Authentication(authRequest, authentication); } public RequestPostProcessor oauth2Authentication(String username, Set<String> scopes, Set<String> roles) { String uuid = String.valueOf(UUID.randomUUID()); given(tokenServices.loadAuthentication(uuid)) .willReturn(createAuthentication(username, scopes, roles)); given(tokenServices.readAccessToken(uuid)).willReturn(new DefaultOAuth2AccessToken(uuid)); return new OAuth2PostProcessor(uuid); } public RequestPostProcessor oauth2Authentication(String username, Set<String> scopes) { return oauth2Authentication(username, scopes, Collections.emptySet()); } public RequestPostProcessor oauth2Authentication(String username) { return oauth2Authentication(username, Collections.emptySet()); } public static class OAuth2PostProcessor implements RequestPostProcessor { private String token; public OAuth2PostProcessor(String token) { this.token = token; } @Override public MockHttpServletRequest postProcessRequest(MockHttpServletRequest mockHttpServletRequest) { mockHttpServletRequest.addHeader("Authorization", "Bearer " + token); return mockHttpServletRequest; } } }
[ "king.yu@vipshop.com" ]
king.yu@vipshop.com
0d9164a9a04929f0e21f1d9da0773f143ea31550
527e6c527236f7a1f49800667a9331dc52c7eefa
/src/main/java/it/csi/siac/siacconsultazioneentitaapp/frontend/ui/util/datainfo/PianoDeiContiDataInfo.java
19cd0a3397c23d1673f872ff5c993a69c4d0a976
[]
no_license
unica-open/siacbilapp
4953a8519a839c997798c3d39e220f61c0bce2b6
bf2bf7d5609fe32cee2409057b811e5a6fa47a76
refs/heads/master
2021-01-06T14:57:26.105285
2020-03-03T17:01:19
2020-03-03T17:01:19
241,366,496
0
0
null
null
null
null
UTF-8
Java
false
false
653
java
/* *SPDX-FileCopyrightText: Copyright 2020 | CSI Piemonte *SPDX-License-Identifier: EUPL-1.2 */ package it.csi.siac.siacconsultazioneentitaapp.frontend.ui.util.datainfo; /** * @author Pro Logic */ public class PianoDeiContiDataInfo extends PopoverDataInfo { /** * @param name il nome della colonna * @param dataPlacement il posizionamento del popover * @param codicePDC il codice del PDC * @param descrizionePDC la descrizione del PDC */ public PianoDeiContiDataInfo(String name, String dataPlacement, String codicePDC, String descrizionePDC) { super(name, "{1}", dataPlacement, "Descrizione", "{0}", codicePDC, descrizionePDC); } }
[ "michele.perdono@csi.it" ]
michele.perdono@csi.it
928ed99a99e5dd1317a857d3090cebbe4ed0afc4
7df40f6ea2209b7d48979465fd8081ec2ad198cc
/TOOLS/server/org/apache/http/protocol/RequestTargetHost.java
b28c80696b0997a5b03922cbeb6c4b13e4276dfc
[ "IJG" ]
permissive
warchiefmarkus/WurmServerModLauncher-0.43
d513810045c7f9aebbf2ec3ee38fc94ccdadd6db
3e9d624577178cd4a5c159e8f61a1dd33d9463f6
refs/heads/master
2021-09-27T10:11:56.037815
2021-09-19T16:23:45
2021-09-19T16:23:45
252,689,028
0
0
null
2021-09-19T16:53:10
2020-04-03T09:33:50
Java
UTF-8
Java
false
false
3,137
java
/* */ package org.apache.http.protocol; /* */ /* */ import java.io.IOException; /* */ import java.net.InetAddress; /* */ import org.apache.http.HttpConnection; /* */ import org.apache.http.HttpException; /* */ import org.apache.http.HttpHost; /* */ import org.apache.http.HttpInetConnection; /* */ import org.apache.http.HttpRequest; /* */ import org.apache.http.HttpRequestInterceptor; /* */ import org.apache.http.HttpVersion; /* */ import org.apache.http.ProtocolException; /* */ import org.apache.http.ProtocolVersion; /* */ import org.apache.http.annotation.Immutable; /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ @Immutable /* */ public class RequestTargetHost /* */ implements HttpRequestInterceptor /* */ { /* */ public void process(HttpRequest request, HttpContext context) throws HttpException, IOException { /* 59 */ if (request == null) { /* 60 */ throw new IllegalArgumentException("HTTP request may not be null"); /* */ } /* 62 */ if (context == null) { /* 63 */ throw new IllegalArgumentException("HTTP context may not be null"); /* */ } /* */ /* 66 */ ProtocolVersion ver = request.getRequestLine().getProtocolVersion(); /* 67 */ String method = request.getRequestLine().getMethod(); /* 68 */ if (method.equalsIgnoreCase("CONNECT") && ver.lessEquals((ProtocolVersion)HttpVersion.HTTP_1_0)) { /* */ return; /* */ } /* */ /* 72 */ if (!request.containsHeader("Host")) { /* 73 */ HttpHost targethost = (HttpHost)context.getAttribute("http.target_host"); /* */ /* 75 */ if (targethost == null) { /* 76 */ HttpConnection conn = (HttpConnection)context.getAttribute("http.connection"); /* */ /* 78 */ if (conn instanceof HttpInetConnection) { /* */ /* */ /* 81 */ InetAddress address = ((HttpInetConnection)conn).getRemoteAddress(); /* 82 */ int port = ((HttpInetConnection)conn).getRemotePort(); /* 83 */ if (address != null) { /* 84 */ targethost = new HttpHost(address.getHostName(), port); /* */ } /* */ } /* 87 */ if (targethost == null) { /* 88 */ if (ver.lessEquals((ProtocolVersion)HttpVersion.HTTP_1_0)) { /* */ return; /* */ } /* 91 */ throw new ProtocolException("Target host missing"); /* */ } /* */ } /* */ /* 95 */ request.addHeader("Host", targethost.toHostString()); /* */ } /* */ } /* */ } /* Location: C:\Users\leo\Desktop\server.jar!\org\apache\http\protocol\RequestTargetHost.class * Java compiler version: 5 (49.0) * JD-Core Version: 1.1.3 */
[ "warchiefmarkus@gmail.com" ]
warchiefmarkus@gmail.com
48c93715ee927b27797c3f72fc8d2d80befcd679
822647817ef254115b65678f0d6aabbaa7235055
/flamingo/src/main/java/org/pushingpixels/flamingo/api/ribbon/synapse/model/RibbonDefaultComboBoxContentModel.java
2b6f47ae6f5fc5bc9110d3c91875d64611006617
[ "BSD-3-Clause" ]
permissive
dyorgio/radiance
3117646c4630046ee7ceac5374f8c67b769bbe3b
6a525917ba37cb137afa06ca827675a8b01e0852
refs/heads/master
2020-04-27T09:18:08.465188
2019-03-11T13:13:39
2019-03-11T13:13:39
174,209,062
0
0
BSD-3-Clause
2019-03-06T19:40:49
2019-03-06T19:40:49
null
UTF-8
Java
false
false
4,575
java
/* * Copyright (c) 2005-2019 Flamingo Kirill Grouchnikov. All Rights Reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: * * o Redistributions of source code must retain the above copyright notice, * this list of conditions and the following disclaimer. * * o 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. * * o Neither the name of Flamingo Kirill Grouchnikov 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. */ package org.pushingpixels.flamingo.api.ribbon.synapse.model; import org.pushingpixels.flamingo.api.common.RichTooltip; import org.pushingpixels.neon.icon.*; import javax.swing.*; import java.beans.*; public class RibbonDefaultComboBoxContentModel<E> extends DefaultComboBoxModel<E> implements RibbonComboBoxContentModel<E> { private boolean isEnabled; private ResizableIcon.Factory iconFactory; private String caption; private RichTooltip richTooltip; private final PropertyChangeSupport pcs = new PropertyChangeSupport(this); public static <E> Builder<E> builder() { return new Builder<>(); } private RibbonDefaultComboBoxContentModel(E[] items) { super(items); } @Override public void addPropertyChangeListener(PropertyChangeListener pcl) { this.pcs.addPropertyChangeListener(pcl); } @Override public void removePropertyChangeListener(PropertyChangeListener pcl) { this.pcs.removePropertyChangeListener(pcl); } @Override public boolean isEnabled() { return this.isEnabled; } @Override public void setEnabled(boolean enabled) { if (this.isEnabled != enabled) { this.isEnabled = enabled; this.pcs.firePropertyChange("enabled", !this.isEnabled, this.isEnabled); } } @Override public ResizableIcon.Factory getIconFactory() { return this.iconFactory; } @Override public String getCaption() { return this.caption; } @Override public RichTooltip getRichTooltip() { return this.richTooltip; } public static class Builder<E> { private boolean isEnabled = true; private E[] items; private ResizableIcon.Factory iconFactory; private String caption; private RichTooltip richTooltip; public Builder<E> setItems(E[] items) { this.items = items; return this; } public Builder<E> setEnabled(boolean enabled) { this.isEnabled = enabled; return this; } public Builder<E> setIconFactory(ResizableIcon.Factory iconFactory) { this.iconFactory = iconFactory; return this; } public Builder<E> setCaption(String caption) { this.caption = caption; return this; } public Builder<E> setRichTooltip(RichTooltip richTooltip) { this.richTooltip = richTooltip; return this; } public RibbonDefaultComboBoxContentModel<E> build() { RibbonDefaultComboBoxContentModel<E> model = new RibbonDefaultComboBoxContentModel<E>(this.items); model.isEnabled = this.isEnabled; model.iconFactory = this.iconFactory; model.caption = this.caption; model.richTooltip = this.richTooltip; return model; } } }
[ "kirill.grouchnikov@gmail.com" ]
kirill.grouchnikov@gmail.com
8c3d367c982d5a7442ebee4aa3c11f93395a43a8
dad0468f377590bbd9149e795e88314e9f45dd36
/src/main/java/com/krukovska/vaccinationsystem/service/DoctorService.java
f571e5b9ba51245088d6efdec0d5d0f5fe909474
[]
no_license
YanaKrukovska/vaccination-system
2ba96ef1c50b2cb282e32cc2c0d58ceaa1f8ed0a
4ea1d01ea07003ec1d99dea85f4375e312d907d9
refs/heads/master
2023-04-05T08:31:15.431620
2021-04-19T17:23:12
2021-04-19T17:23:12
340,670,103
0
0
null
null
null
null
UTF-8
Java
false
false
666
java
package com.krukovska.vaccinationsystem.service; import com.krukovska.vaccinationsystem.persistence.model.Doctor; import com.krukovska.vaccinationsystem.persistence.repository.DoctorRepository; import org.springframework.stereotype.Service; import java.util.List; @Service public class DoctorService { private final DoctorRepository doctorRepository; public DoctorService(DoctorRepository doctorRepository) { this.doctorRepository = doctorRepository; } public Doctor findById(Long doctorId){ return doctorRepository.getById(doctorId); } public List<Doctor> findAll() { return doctorRepository.findAll(); } }
[ "jana.krua@gmail.com" ]
jana.krua@gmail.com