blob_id
stringlengths
40
40
directory_id
stringlengths
40
40
path
stringlengths
7
410
content_id
stringlengths
40
40
detected_licenses
listlengths
0
51
license_type
stringclasses
2 values
repo_name
stringlengths
5
132
snapshot_id
stringlengths
40
40
revision_id
stringlengths
40
40
branch_name
stringlengths
4
80
visit_date
timestamp[us]
revision_date
timestamp[us]
committer_date
timestamp[us]
github_id
int64
5.85k
684M
star_events_count
int64
0
209k
fork_events_count
int64
0
110k
gha_license_id
stringclasses
22 values
gha_event_created_at
timestamp[us]
gha_created_at
timestamp[us]
gha_language
stringclasses
132 values
src_encoding
stringclasses
34 values
language
stringclasses
1 value
is_vendor
bool
1 class
is_generated
bool
2 classes
length_bytes
int64
3
9.45M
extension
stringclasses
28 values
content
stringlengths
3
9.45M
authors
listlengths
1
1
author_id
stringlengths
0
352
58dd014ef0a625f83770544f95edf21b7655da32
492a2b8ab7edd4e3f3f4c5621ba641a7ea00c3c7
/src/main/java/com/migu/resume/persistence/role/module/Role.java
f36ac41631d7ff90f160fbd6e178dbc7b07a14a3
[]
no_license
ejshi/resume
4b0c36ee103ad723056e4f68282ffd8687bce7dd
4b2c782a833d97d0130bfc0cfe1475f45e90c926
refs/heads/master
2020-12-03T08:23:48.000803
2018-10-18T02:36:09
2018-10-18T02:36:09
67,294,718
0
0
null
null
null
null
UTF-8
Java
false
false
576
java
package com.migu.resume.persistence.role.module; public class Role { private Long id; private String name; private String type; public Long getId() { return id; } public void setId(Long id) { this.id = id; } public String getName() { return name; } public void setName(String name) { this.name = name == null ? null : name.trim(); } public String getType() { return type; } public void setType(String type) { this.type = type == null ? null : type.trim(); } }
[ "1737778174@qq.com" ]
1737778174@qq.com
137894d41bc7b2a11cbbc079ae002454577d8e90
591d2bcea1ad48c4c50f1fb1697f2bf5dc7232d4
/app/src/test/java/cn/edu/gdmec/s07150843/dialog/ExampleUnitTest.java
ebd0d9535442f4e243597e7f76a5551c44936adb
[]
no_license
gdmec07150843/Dialogdemo
c615c07b7895313fc2e02740810afdb4cf3806ad
0d84e3161ec4d84efa52b31e66fe19c75e2aef0b
refs/heads/master
2021-01-11T11:40:39.329267
2016-12-19T02:13:11
2016-12-19T02:13:11
null
0
0
null
null
null
null
UTF-8
Java
false
false
322
java
package cn.edu.gdmec.s07150843.dialog; import org.junit.Test; import static org.junit.Assert.*; /** * To work on unit tests, switch the Test Artifact in the Build Variants view. */ public class ExampleUnitTest { @Test public void addition_isCorrect() throws Exception { assertEquals(4, 2 + 2); } }
[ "854178884@qq.com" ]
854178884@qq.com
32af4026cdf3f93a5a5c9087faad0bda7a746d44
eb949b74ea51a8095fafa5c9ce67371db62d896a
/src/main/java/hnwj/jetty/web/GreetingMessageController.java
bfee5389d0461b09014a93826b47907a847f0d19
[ "MIT" ]
permissive
hisnamewasjaan/test-spring-boot-jetty-sample
5f7cf66f177555b23549f31e004428bb89d3ffe8
abde145005e9712f99dc6087c03ddc9a6991d373
refs/heads/master
2021-04-12T08:09:17.004939
2018-06-30T10:01:41
2018-06-30T10:04:50
65,129,119
1
0
null
null
null
null
UTF-8
Java
false
false
1,195
java
package hnwj.jetty.web; import hnwj.jetty.domain.Greeting; import hnwj.jetty.domain.HelloMessage; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.messaging.handler.annotation.MessageMapping; import org.springframework.messaging.handler.annotation.SendTo; import org.springframework.stereotype.Controller; /** * Mappings for the STOMP end point. */ @Controller public class GreetingMessageController { final Logger log = LoggerFactory.getLogger(this.getClass()); @MessageMapping("/hello") @SendTo("/topic/greetings") public Greeting greeting(HelloMessage message) throws InterruptedException { log.info(String.format("Received a greeting message: %s", message.getName())); Thread.sleep(3000L); return new Greeting(1L, String.format("Hello, %s!", message.getName())); } @MessageMapping("/bye") @SendTo("/topic/goodbyes") public Greeting bye(HelloMessage message) throws InterruptedException { log.info(String.format("Received a goodbye message: %s", message.getName())); Thread.sleep(3000L); return new Greeting(1L, String.format("Bye, %s!", message.getName())); } }
[ "jbe@nineconsult.dk" ]
jbe@nineconsult.dk
ed1ebc628ddc0504b72c5c5036278b180b888214
8700fa500c760a8049c65df590632783cd64940a
/testjava/TIJ4-code/strings/ReFlags.java
07c276d9484d60c392597d41cc14c221d2d5d44e
[ "MIT", "LicenseRef-scancode-unknown-license-reference" ]
permissive
SrikanthParsha14/test
8ebac746f31d450b39eca1001525961497d962ba
8cee69e09c8557d53d8d30382cec8ea5c1f82f6e
refs/heads/master
2020-06-05T06:54:36.274446
2017-08-03T08:39:43
2017-08-03T08:39:43
192,351,172
1
0
MIT
2019-06-17T13:20:39
2019-06-17T13:20:38
null
UTF-8
Java
false
false
536
java
//: strings/ReFlags.java package strings; /* Added by Eclipse.py */ import java.util.regex.*; public class ReFlags { public static void main(String[] args) { Pattern p = Pattern.compile("^java", Pattern.CASE_INSENSITIVE | Pattern.MULTILINE); Matcher m = p.matcher( "java has regex\nJava has regex\n" + "JAVA has pretty good regular expressions\n" + "Regular expressions are in Java"); while(m.find()) System.out.println(m.group()); } } /* Output: java Java JAVA *///:~
[ "quchunguang@gmail.com" ]
quchunguang@gmail.com
f4b5d51b4dd96a7b84705fd23c3db4e393a5914d
a9d6af3d61b62fbf0761fa13677f4f39dc3c4866
/src/test/java/us/vicentini/hackerrank/java/exceptions/JavaExceptionHandlingTryCatchTest.java
256af7e91697b644db89f7b7e3ae115e226bf946
[ "Apache-2.0" ]
permissive
Shulander/hackerrank
6b76a8c2e63cef2ec6db106fd6ae8502a5fc8b19
17a5ac27d257bf215b6b3aae82cc9402304552c3
refs/heads/master
2021-01-17T10:19:47.464358
2020-09-20T02:14:26
2020-09-20T02:14:26
56,815,515
0
0
null
null
null
null
UTF-8
Java
false
false
1,553
java
package us.vicentini.hackerrank.java.exceptions; import org.junit.jupiter.api.Test; import us.vicentini.hackerrank.BaseSystemStreamOverride; import java.io.ByteArrayInputStream; import java.io.InputStream; class JavaExceptionHandlingTryCatchTest extends BaseSystemStreamOverride { @Test public void testCase01() { provideInput("10\n3"); InputStream expectedStream = new ByteArrayInputStream("3".getBytes()); JavaExceptionHandlingTryCatch.main(new String[0]); assertInputStreams(expectedStream, getOutputAsInputStream()); } @Test public void testCase02() { provideInput("10\nHello"); InputStream expectedStream = new ByteArrayInputStream("java.util.InputMismatchException".getBytes()); JavaExceptionHandlingTryCatch.main(new String[0]); assertInputStreams(expectedStream, getOutputAsInputStream()); } @Test public void testCase03() { provideInput("10\n0"); InputStream expectedStream = new ByteArrayInputStream("java.lang.ArithmeticException: / by zero".getBytes()); JavaExceptionHandlingTryCatch.main(new String[0]); assertInputStreams(expectedStream, getOutputAsInputStream()); } @Test public void testCase04() { provideInput("23.323\n0"); InputStream expectedStream = new ByteArrayInputStream("java.util.InputMismatchException".getBytes()); JavaExceptionHandlingTryCatch.main(new String[0]); assertInputStreams(expectedStream, getOutputAsInputStream()); } }
[ "henrique@vicentini.us" ]
henrique@vicentini.us
d2e5ea6a28a4a47e0abac7eb06c6e8ca1a8c9e5c
3a8358f009f6c5151053ff3d04e42a3878c530ad
/src/main/java/it/aldi/app/service/register/impl/UserTypeRegistrationServiceImpl.java
62790ce33c94031dc6c8f342fa8628bbaf325c60
[ "Apache-2.0" ]
permissive
cbot59/search-bimbel
76adde919794e429dbd64e9f101ad79d638f2966
d1c3f5212fd83547ff24d30a6c19f29644a007a4
refs/heads/master
2023-07-22T17:11:51.001354
2023-06-17T10:27:55
2023-06-17T10:27:55
172,324,061
0
1
NOASSERTION
2023-07-07T21:46:24
2019-02-24T10:28:26
Java
UTF-8
Java
false
false
3,311
java
package it.aldi.app.service.register.impl; import it.aldi.app.domain.*; import it.aldi.app.service.domain.*; import it.aldi.app.service.register.UserTypeRegistrationService; import it.aldi.app.util.RoleConstant; import org.springframework.stereotype.Service; import java.util.Optional; @Service public class UserTypeRegistrationServiceImpl implements UserTypeRegistrationService { private final OrganizationService organizationService; private final OwnerService ownerService; private final StudentService studentService; private final TutorService tutorService; private final ChairmanService chairmanService; public UserTypeRegistrationServiceImpl(OrganizationService organizationService, OwnerService ownerService, StudentService studentService, TutorService tutorService, ChairmanService chairmanService) { this.organizationService = organizationService; this.ownerService = ownerService; this.studentService = studentService; this.tutorService = tutorService; this.chairmanService = chairmanService; } @Override public void registerUserType(BimbelUser bimbelUser) { switch (bimbelUser.getBimbelUserType().getName()) { case RoleConstant.OWNER: registerOwner(bimbelUser); break; case RoleConstant.STUDENT: registerStudent(bimbelUser); break; case RoleConstant.TUTOR: registerTutor(bimbelUser); break; default: throw new IllegalStateException("Unexpected userType: " + bimbelUser.getBimbelUserType()); } } private void registerOwner(BimbelUser bimbelUser) { Optional<Owner> owner = ownerService.findByUserId(bimbelUser.getId()); if (owner.isPresent()) { throw new IllegalArgumentException("Owner already exists: " + owner.get()); } Organization organization = organizationService.save(Organization.createDefault(bimbelUser.getName())); Chairman chairman = chairmanService.save(new Chairman().organization(organization)); ownerService.save(Owner.initialize(bimbelUser).chairman(chairman)); } private void registerStudent(BimbelUser bimbelUser) { Optional<Student> student = studentService.findByUserId(bimbelUser.getId()); if (student.isPresent()) { throw new IllegalArgumentException("Student already exists: " + student.get()); } studentService.save(Student.initialize(bimbelUser)); } private void registerTutor(BimbelUser bimbelUser) { Optional<Tutor> tutor = tutorService.findByUserId(bimbelUser.getId()); if (tutor.isPresent()) { throw new IllegalArgumentException("Tutor already exists: " + tutor.get()); } Organization organization = organizationService.save(Organization.createDefault(bimbelUser.getName())); Chairman chairman = chairmanService.save(new Chairman().organization(organization)); tutorService.save(Tutor.initialize(bimbelUser).chairman(chairman)); } }
[ "rivaldi.saputra@jurnal.id" ]
rivaldi.saputra@jurnal.id
80bc476fb7dd680c4dacd0d852c8ff306b2a3ba9
478d57913d246b148a6d41b01bc5368c69e1fab4
/src/src1/12:多態性/ex12/Q1/Plant.java
884dc87f85cbafecac8cf6baf035bb334158384d
[]
no_license
yuuu1654/Java
63c402089b949bad4d333a1d4162f397f5941fda
7a61d80638e96213f650c055ec76f4a4b54a65ac
refs/heads/master
2023-05-15T10:58:01.818493
2021-06-13T09:25:35
2021-06-13T09:25:35
374,274,869
0
0
null
null
null
null
UTF-8
Java
false
false
598
java
public abstract class Plant implements Creature { /** * 抽象クラス * Creatureインターフェースを実装 * 普通の抽象クラスではpublic abstract省略不可 */ //フィールド String name; String color; //コンストラクタ public Plant(String name, String color){ this.name = name; this.color = color; } //抽象メソッド(生きる) public abstract void live(); //実装メソッド(花を咲かせる) public void makeFlowers(){ System.out.println(this.name + "は" + this.color + "の花を咲かせる"); } }
[ "qgp36fg3qfelabaz@gmail.com" ]
qgp36fg3qfelabaz@gmail.com
600d989fe4ecb944536985329c5a7de7721d60b3
9be7a8876fa7bbe84301e9fc92503fc408ac0133
/homework04/homework04/src/main/java/com/kubrafelek/homework04/dto/PermanentInstructorDTO.java
6a2b57425ef2ed07571c884084108ec109496a5f
[ "MIT" ]
permissive
kubrafelek/Gittigidiyor-Spring-Bootcamp
c320f4be1ce6042e696a85039ee9c3ab82798022
bde2f49d3b6cf3eae0b4efaf99f8a75efa20dd06
refs/heads/main
2023-08-04T16:56:48.057130
2021-09-15T16:42:08
2021-09-15T16:42:08
405,196,875
1
0
null
null
null
null
UTF-8
Java
false
false
579
java
package com.kubrafelek.homework04.dto; import io.swagger.annotations.ApiModelProperty; import lombok.AllArgsConstructor; import lombok.Data; import lombok.RequiredArgsConstructor; import org.springframework.format.annotation.NumberFormat; import javax.validation.constraints.NotNull; @Data @AllArgsConstructor @RequiredArgsConstructor public class PermanentInstructorDTO extends InstructorDTO{ @ApiModelProperty(example = "5000.0") @NotNull(message = "Fixed Salary is mandatory") @NumberFormat(style = NumberFormat.Style.NUMBER) private double fixedSalary; }
[ "kbr.flk@hotmail.com" ]
kbr.flk@hotmail.com
1774866361e1d55c81c9a2340e662c666180a552
21d88cebdcf7408e5b39d0ae00d59be07ccb261e
/Project7_20/src/com/Edmund/_7_20/HomeWork_test6_7_20.java
050fefc9e920448adbb794d13215b516398382a3
[]
no_license
Edmund-Hu/HistoryDemo
7a93291310585b1f061b6a56f52415bc1370ffc8
4d67bf5ced188119fc82be478b2b8fb0b8d27114
refs/heads/master
2021-08-16T08:49:35.170795
2017-11-19T10:13:40
2017-11-19T10:14:19
111,284,234
0
0
null
null
null
null
GB18030
Java
false
false
312
java
package com.Edmund._7_20; public class HomeWork_test6_7_20 { public static void main(String[] args){ int a=1, b=2 ; String c = "3"; System.out.println(a + b + c );//+两边只要有一个是字符串,两边都会变成字符串; System.out.println(c + a + b); System.out.println(a + c + b); } }
[ "vhudp@163.com" ]
vhudp@163.com
960da0f67b00b106cfb625ccb28bde5d3ad6e974
4768478d425851f27479cabbe6609e42b316a053
/app/src/androidTest/java/com/example/colorpsy/ExampleInstrumentedTest.java
d2bff61b2fc5e4e481d5187bdddc6bb45692a8e2
[]
no_license
francisco50/ColorPsy
dc05bad7aaf55540355092710d1fdaa4513c41c9
9d4f42a636825c3a57da1843e4a36090de77473d
refs/heads/master
2023-01-18T17:04:26.927529
2020-11-19T00:43:13
2020-11-19T00:43:13
314,092,818
0
0
null
null
null
null
UTF-8
Java
false
false
754
java
package com.example.colorpsy; import android.content.Context; import androidx.test.platform.app.InstrumentationRegistry; import androidx.test.ext.junit.runners.AndroidJUnit4; import org.junit.Test; import org.junit.runner.RunWith; import static org.junit.Assert.*; /** * Instrumented test, which will execute on an Android device. * * @see <a href="http://d.android.com/tools/testing">Testing documentation</a> */ @RunWith(AndroidJUnit4.class) public class ExampleInstrumentedTest { @Test public void useAppContext() { // Context of the app under test. Context appContext = InstrumentationRegistry.getInstrumentation().getTargetContext(); assertEquals("com.example.colorpsy", appContext.getPackageName()); } }
[ "franciscodeasis50@gmail.com" ]
franciscodeasis50@gmail.com
67360977c0d9d06cfe219964ab3352bb8d2f7521
df0d105e3bc11190c9f75b68014356d631094710
/src/main/java/com/zj/study/designpattern/pattern/behavioral/chainofresponsibility/ArticleApprover.java
4c5cbf1bc18f5a34ead385c4b36e139ab5419344
[]
no_license
zhaojian770627/javastudy
411109670f099be23142748e97346ccd62057c41
ca2613fbfc24bfc68254f3733b0d1409aecf3c94
refs/heads/master
2023-01-11T10:36:25.977810
2022-01-09T14:06:01
2022-01-09T14:06:01
162,666,475
0
0
null
2022-12-27T14:50:49
2018-12-21T04:40:01
Java
UTF-8
Java
false
false
507
java
package com.zj.study.designpattern.pattern.behavioral.chainofresponsibility; import org.apache.commons.lang3.StringUtils; public class ArticleApprover extends Approver { @Override public void deploy(Course course) { if (StringUtils.isNotEmpty(course.getArticle())) { System.out.println(course.getName() + "含有手记,批准"); if (approver != null) approver.deploy(course); } else { System.out.println(course.getName() + "不含有手记,不批准"); } } }
[ "zhaojian770627@163.com" ]
zhaojian770627@163.com
a5fa39933503309a3ebbc50d5003b1a654b29852
105847ffded2c75e77f4621730a6b06430b06aad
/DoAnRapPhim/app/src/main/java/com/example/doanrapphim/dangnhap/DangkyFragment.java
bdbf6580169743deadc1fe4b9e1133cc183f9c6c
[]
no_license
PhanMinhTri-CDTH18PMC/my-first-project
0831e20d92f7f33e21db3ebb11d98e5a59536184
5a2b5532873779c796470f5b1ea14de45c8b696f
refs/heads/master
2023-02-18T17:59:16.422296
2021-01-09T03:59:55
2021-01-09T03:59:55
311,878,208
0
0
null
null
null
null
UTF-8
Java
false
false
4,093
java
package com.example.doanrapphim.dangnhap; import android.app.ProgressDialog; import android.content.SharedPreferences; import android.os.Bundle; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; import android.widget.Button; import android.widget.EditText; import android.widget.TextView; import android.widget.Toast; import androidx.fragment.app.Fragment; import com.android.volley.AuthFailureError; import com.android.volley.Request; import com.android.volley.RequestQueue; import com.android.volley.toolbox.StringRequest; import com.android.volley.toolbox.Volley; import com.example.doanrapphim.R; import com.example.doanrapphim.ketnoi.Constant; import org.json.JSONException; import org.json.JSONObject; import java.util.HashMap; import java.util.Map; public class DangkyFragment extends Fragment { private EditText edtgmail; private EditText edtMK,resetMK; private Button btndangky; private TextView tvM; private ProgressDialog dialog; View view; @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); } @Override public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { // Inflate the layout for this fragment view = inflater.inflate(R.layout.fragment_dangky, container, false); init(); return view; } private void init(){ edtgmail = view.findViewById(R.id.dangky_username); edtMK = view.findViewById(R.id.dangky_matkhau); resetMK = view.findViewById(R.id.dangky_rematkhau); btndangky = view.findViewById(R.id.dangky); tvM = view.findViewById(R.id.tvmessage); dialog = new ProgressDialog(getContext()); dialog.setCancelable(false); btndangky.setOnClickListener(v -> { if (validate()) { dangky(); } }); } private boolean validate() { if(edtgmail.getText().toString().isEmpty()){ tvM.setText("Chưa nhập email"); return false; } if(edtMK.getText().toString().length() <6){ tvM.setText("password lớn hơn 5"); return false; } if(!resetMK.getText().toString().equals(edtMK.getText().toString())){ tvM.setText("Chưa nhập password"); return false; } return true; } private void dangky() { dialog.setMessage("Đang đăng ký"); dialog.show(); StringRequest request = new StringRequest(Request.Method.POST , Constant.DANGKY , response -> { try { JSONObject jsonObject = new JSONObject(response); if(jsonObject.getBoolean("success")){ JSONObject user = jsonObject.getJSONObject("user"); SharedPreferences userPref = getActivity().getApplicationContext().getSharedPreferences("user",getContext().MODE_PRIVATE); SharedPreferences.Editor editor = userPref.edit(); editor.putString("token", jsonObject.getString("token")); editor.putString("name", user.getString("name")); editor.apply(); Toast.makeText(getContext(), "Đăng ký thành công", Toast.LENGTH_SHORT).show(); } }catch (JSONException e){ e.printStackTrace(); } dialog.dismiss(); },error -> { error.printStackTrace(); dialog.dismiss(); }){ @Override protected Map<String, String> getParams() throws AuthFailureError { HashMap<String,String> map = new HashMap<>(); map.put("email" , edtgmail.getText().toString().trim()); map.put("password",edtMK.getText().toString()); return map; } }; RequestQueue queue = Volley.newRequestQueue(getContext()); queue.add(request); } }
[ "74286663+PhanMinhTri-CDTH18PMC@users.noreply.github.com" ]
74286663+PhanMinhTri-CDTH18PMC@users.noreply.github.com
198742df81c99c64daeaa12f9a0675f9531be638
ee87b535d9fcb38ca7fc221fc06bb7dec9142300
/src/main/java/vendor/google/common/collect/ImmutableSortedMapFauxverideShim.java
44371e02ed5a5c9cc304af46bd114d275d97d1a3
[]
no_license
ovlad32/AstraHUDF
39a19e24bd8110128e17824ceb971f3bc6a17e31
f341171e203a683d9c5b47c72cf3b35c5ff9ea48
refs/heads/master
2020-05-21T09:03:13.896576
2019-05-10T12:58:14
2019-05-10T12:58:14
185,988,433
0
0
null
null
null
null
UTF-8
Java
false
false
6,427
java
/* * Copyright (C) 2009 The Guava 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 vendor.google.common.collect; import vendor.google.common.annotations.GwtIncompatible; import java.util.function.BinaryOperator; import java.util.function.Function; import java.util.stream.Collector; /** * "Overrides" the {@link ImmutableMap} static methods that lack {@link ImmutableSortedMap} * equivalents with deprecated, exception-throwing versions. See {@link * ImmutableSortedSetFauxverideShim} for details. * * @author Chris Povirk */ @GwtIncompatible abstract class ImmutableSortedMapFauxverideShim<K, V> extends ImmutableMap<K, V> { /** * Not supported. Use {@link ImmutableSortedMap#toImmutableSortedMap}, which offers better * type-safety, instead. This method exists only to hide {@link ImmutableMap#toImmutableMap} from * consumers of {@code ImmutableSortedMap}. * * @throws UnsupportedOperationException always * @deprecated Use {@link ImmutableSortedMap#toImmutableSortedMap}. */ @Deprecated public static <T, K, V> Collector<T, ?, ImmutableMap<K, V>> toImmutableMap( Function<? super T, ? extends K> keyFunction, Function<? super T, ? extends V> valueFunction) { throw new UnsupportedOperationException(); } /** * Not supported. Use {@link ImmutableSortedMap#toImmutableSortedMap}, which offers better * type-safety, instead. This method exists only to hide {@link ImmutableMap#toImmutableMap} from * consumers of {@code ImmutableSortedMap}. * * @throws UnsupportedOperationException always * @deprecated Use {@link ImmutableSortedMap#toImmutableSortedMap}. */ @Deprecated public static <T, K, V> Collector<T, ?, ImmutableMap<K, V>> toImmutableMap( Function<? super T, ? extends K> keyFunction, Function<? super T, ? extends V> valueFunction, BinaryOperator<V> mergeFunction) { throw new UnsupportedOperationException(); } /** * Not supported. Use {@link ImmutableSortedMap#naturalOrder}, which offers better type-safety, * instead. This method exists only to hide {@link ImmutableMap#builder} from consumers of {@code * ImmutableSortedMap}. * * @throws UnsupportedOperationException always * @deprecated Use {@link ImmutableSortedMap#naturalOrder}, which offers better type-safety. */ @Deprecated public static <K, V> ImmutableSortedMap.Builder<K, V> builder() { throw new UnsupportedOperationException(); } /** * Not supported for ImmutableSortedMap. * * @throws UnsupportedOperationException always * @deprecated Not supported for ImmutableSortedMap. */ @Deprecated public static <K, V> ImmutableSortedMap.Builder<K, V> builderWithExpectedSize(int expectedSize) { throw new UnsupportedOperationException(); } /** * Not supported. <b>You are attempting to create a map that may contain a non-{@code Comparable} * key.</b> Proper calls will resolve to the version in {@code ImmutableSortedMap}, not this dummy * version. * * @throws UnsupportedOperationException always * @deprecated <b>Pass a key of type {@code Comparable} to use {@link * ImmutableSortedMap#of(Comparable, Object)}.</b> */ @Deprecated public static <K, V> ImmutableSortedMap<K, V> of(K k1, V v1) { throw new UnsupportedOperationException(); } /** * Not supported. <b>You are attempting to create a map that may contain non-{@code Comparable} * keys.</b> Proper calls will resolve to the version in {@code ImmutableSortedMap}, not this * dummy version. * * @throws UnsupportedOperationException always * @deprecated <b>Pass keys of type {@code Comparable} to use {@link * ImmutableSortedMap#of(Comparable, Object, Comparable, Object)}.</b> */ @Deprecated public static <K, V> ImmutableSortedMap<K, V> of(K k1, V v1, K k2, V v2) { throw new UnsupportedOperationException(); } /** * Not supported. <b>You are attempting to create a map that may contain non-{@code Comparable} * keys.</b> Proper calls to will resolve to the version in {@code ImmutableSortedMap}, not this * dummy version. * * @throws UnsupportedOperationException always * @deprecated <b>Pass keys of type {@code Comparable} to use {@link * ImmutableSortedMap#of(Comparable, Object, Comparable, Object, Comparable, Object)}.</b> */ @Deprecated public static <K, V> ImmutableSortedMap<K, V> of(K k1, V v1, K k2, V v2, K k3, V v3) { throw new UnsupportedOperationException(); } /** * Not supported. <b>You are attempting to create a map that may contain non-{@code Comparable} * keys.</b> Proper calls will resolve to the version in {@code ImmutableSortedMap}, not this * dummy version. * * @throws UnsupportedOperationException always * @deprecated <b>Pass keys of type {@code Comparable} to use {@link * ImmutableSortedMap#of(Comparable, Object, Comparable, Object, Comparable, Object, * Comparable, Object)}.</b> */ @Deprecated public static <K, V> ImmutableSortedMap<K, V> of(K k1, V v1, K k2, V v2, K k3, V v3, K k4, V v4) { throw new UnsupportedOperationException(); } /** * Not supported. <b>You are attempting to create a map that may contain non-{@code Comparable} * keys.</b> Proper calls will resolve to the version in {@code ImmutableSortedMap}, not this * dummy version. * * @throws UnsupportedOperationException always * @deprecated <b>Pass keys of type {@code Comparable} to use {@link * ImmutableSortedMap#of(Comparable, Object, Comparable, Object, Comparable, Object, * Comparable, Object, Comparable, Object)}.</b> */ @Deprecated public static <K, V> ImmutableSortedMap<K, V> of( K k1, V v1, K k2, V v2, K k3, V v3, K k4, V v4, K k5, V v5) { throw new UnsupportedOperationException(); } // No copyOf() fauxveride; see ImmutableSortedSetFauxverideShim. }
[ "vladymyr.orlovskiy@io-tahoe.com" ]
vladymyr.orlovskiy@io-tahoe.com
cc74f0b90bcd3defd9ea64dfb0166883b214331f
811758bdcd7354eab2fb7ba8d51247e06c646fdf
/src/main/java/com/baizhi/rlt/dao/impl/UserDaoImpl.java
ff5bc3435f6377d51d0f858a881b0a9677727821
[]
no_license
A1521585727/Spring_AOP
7c3beeb2257f1a5ad99a87fc9be30cae172887e3
2e3690884e0dbdc50122f0f73627be7e14ef8477
refs/heads/master
2022-12-28T01:09:40.621920
2019-11-15T12:52:31
2019-11-15T12:52:31
221,923,518
0
0
null
2022-12-16T03:13:47
2019-11-15T12:52:03
Java
UTF-8
Java
false
false
260
java
package com.baizhi.rlt.dao.impl; import com.baizhi.rlt.dao.UserDao; import com.baizhi.rlt.entity.User; public class UserDaoImpl implements UserDao { @Override public void insert(User user) { System.out.println("This in UserDao...."); } }
[ "1521585727@qq.com" ]
1521585727@qq.com
2f2b7c19d9a977bae89a021783eef4bd17cfdf0f
3fe8e5db53dc425afdb24303f2f6926cade14f04
/user/ezt_hall/src/main/java/com/eztcn/user/hall/fragment/dragonCard/MyPrivilegeGuideNumFragment.java
45a1e6b54ab37fc7dee763832e353e7335db0f89
[]
no_license
llorch19/ezt_user_code
087a9474a301d8d8fef7bd1172d6c836373c2faf
ee82f4bfbbd14c81976be1275dcd4fc49f6b1753
refs/heads/master
2021-06-01T09:40:19.437831
2016-08-10T02:33:35
2016-08-10T02:33:35
null
0
0
null
null
null
null
UTF-8
Java
false
false
3,279
java
package com.eztcn.user.hall.fragment.dragonCard; import android.content.Intent; import android.os.Bundle; import android.os.Handler; import android.support.v7.widget.LinearLayoutManager; import android.support.v7.widget.RecyclerView; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; import com.eztcn.user.R; import com.eztcn.user.hall.activity.SelectAppointmentTimeActivity; import com.eztcn.user.hall.adapter.BaseRvAdapter; import com.eztcn.user.hall.fragment.BaseFragment; import com.eztcn.user.hall.utils.ToastUtils; import com.eztcn.user.hall.views.RecycleViewDivider; import java.util.ArrayList; import java.util.List; /** * @Author: lizhipeng * @Data: 16/6/7 上午10:16 * @Description: 指导挂号 */ public class MyPrivilegeGuideNumFragment extends BaseFragment { private RecyclerView mRecyclerView; private BaseRvAdapter mAdapter; private List<String> mDatas; public static MyPrivilegeGuideNumFragment newInstance() { MyPrivilegeGuideNumFragment fragment = new MyPrivilegeGuideNumFragment(); return fragment; } @Override public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { View view = inflater.inflate(R.layout.new_fragment_my_privilege, container, false); mRecyclerView = (RecyclerView) view.findViewById(R.id.new_my_privilege_fragment_list_view); mAdapter = new BaseRvAdapter(mRecyclerView.getContext(),R.layout.new_item_privilege_guide_num_rv, mDatas); LinearLayoutManager linearLayoutManager = new LinearLayoutManager(mRecyclerView.getContext()); linearLayoutManager.setOrientation(LinearLayoutManager.VERTICAL); mRecyclerView.setLayoutManager(linearLayoutManager); mRecyclerView.addItemDecoration(new RecycleViewDivider(getContext(), LinearLayoutManager.VERTICAL, 20)); mRecyclerView.setAdapter(mAdapter); //禁用上层ScrollView的滑动事件,解决嵌套冲突 mRecyclerView.setNestedScrollingEnabled(false); mInitOver = true; return view; } @Override public void onActivityCreated(Bundle savedInstanceState) { super.onActivityCreated(savedInstanceState); } @Override protected void onFragmentFirstResume() { showProgressDialog(""); new Handler().postDelayed(new Runnable() { public void run() { if (mInitOver) { mDatas = new ArrayList<>(); for (int i = 0; i < 100; i++) { mDatas.add("这是第====" + i + "====条"); } mAdapter.notifyDataSetChanged(mDatas); dismissProgressDialog(); //item 点击监听 mAdapter.setOnItemClickLitener(new BaseRvAdapter.OnItemClickLitener() { @Override public void onItemClick(View view, int position) { ToastUtils.shortToast(mContext,"咨询详情页面没写"); } }); } } }, 1000); //延迟1秒 } @Override public void onResume() { super.onResume(); } }
[ "liangxing@eztcn.com" ]
liangxing@eztcn.com
c21467b7ce5cd66b1aa71a28ec6e2bf094cd36af
59b62899bacc0aed8ffd7c74160f091d795a1760
/CT25-GameServer/java/ct25/xtreme/gameserver/model/quest/Event.java
eb96cf95979f11a940bc35a8afd6f54fba8bca73
[]
no_license
l2jmaximun/RenerFreya
2f8d303942a80cb3d9c7381e54af049a0792061b
c0c13f48003b96b38012d20539b35aba09e25ac7
refs/heads/master
2021-08-31T19:39:30.116727
2017-12-22T15:20:03
2017-12-22T15:20:03
114,801,613
0
0
null
null
null
null
UTF-8
Java
false
false
1,190
java
/* * This program is free software: you can redistribute it and/or modify it under * the terms of the GNU General Public License as published by the Free Software * Foundation, either version 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 ct25.xtreme.gameserver.model.quest; import ct25.xtreme.gameserver.model.actor.instance.L2PcInstance; /** ** @author JIV ** */ public abstract class Event extends Quest { /** * @param questId * @param name * @param descr */ public Event(int questId, String name, String descr) { super(questId, name, descr); } public abstract boolean eventStart(); public abstract boolean eventStop(); public abstract boolean eventBypass(L2PcInstance activeChar, String bypass); }
[ "Rener@Rener-PC" ]
Rener@Rener-PC
7c4010b1c8de2f497b5fb287277aa029df6a6782
84ef7747ee97068bc4336cafde1bffd4f0d346fd
/sdk/src/main/java/org/zstack/sdk/DeleteVRouterRouteTableAction.java
d198a9d7ce8327b034f34f272a350824f6460b76
[ "Apache-2.0" ]
permissive
phillip2019/zstack
f6048a4705cf8c44facea69339a83b52260f2250
4ed707a1dc376f9289b56a0058b3cd86eeb993c6
refs/heads/master
2021-08-24T02:42:16.343643
2017-12-07T08:42:27
2017-12-07T08:42:27
null
0
0
null
null
null
null
UTF-8
Java
false
false
2,317
java
package org.zstack.sdk; import java.util.HashMap; import java.util.Map; public class DeleteVRouterRouteTableAction extends AbstractAction { private static final HashMap<String, Parameter> parameterMap = new HashMap<>(); public static class Result { public ErrorCode error; public DeleteVRouterRouteTableResult value; public Result throwExceptionIfError() { if (error != null) { throw new ApiException( String.format("error[code: %s, description: %s, details: %s]", error.code, error.description, error.details) ); } return this; } } @Param(required = true, nonempty = false, nullElements = false, emptyString = true, noTrim = false) public java.lang.String uuid; @Param(required = false) public java.lang.String deleteMode = "Permissive"; @Param(required = false) public java.util.List systemTags; @Param(required = false) public java.util.List userTags; @Param(required = true) public String sessionId; public long timeout; public long pollingInterval; private Result makeResult(ApiResult res) { Result ret = new Result(); if (res.error != null) { ret.error = res.error; return ret; } DeleteVRouterRouteTableResult value = res.getResult(DeleteVRouterRouteTableResult.class); ret.value = value == null ? new DeleteVRouterRouteTableResult() : value; return ret; } public Result call() { ApiResult res = ZSClient.call(this); return makeResult(res); } public void call(final Completion<Result> completion) { ZSClient.call(this, new InternalCompletion() { @Override public void complete(ApiResult res) { completion.complete(makeResult(res)); } }); } Map<String, Parameter> getParameterMap() { return parameterMap; } RestInfo getRestInfo() { RestInfo info = new RestInfo(); info.httpMethod = "DELETE"; info.path = "/vrouter-route-tables/{uuid}"; info.needSession = true; info.needPoll = true; info.parameterName = ""; return info; } }
[ "wei.wang@zstack.io" ]
wei.wang@zstack.io
a31c82922d3c2e34e2ee400b2c707fc65b54a761
b22268c751b327b9a62988997d2a2e19c3c14ae5
/src/test/java/TC001.java
1d00d0a1e6f8484d1c22dec51d838474bc7bfd7a
[]
no_license
saquibhafeez/GroupProjectX
265110106bb43621ed5f55caf3ba1c3d0c94ba0f
b233cfb4c5248efa3dd6bf13d0ee975ca5d25dc2
refs/heads/master
2023-08-13T17:39:06.264868
2021-09-26T07:31:42
2021-09-26T07:31:42
410,476,967
0
0
null
2021-09-26T07:31:42
2021-09-26T07:04:54
Java
UTF-8
Java
false
false
65
java
public class TC001 { //tc001 //part 1 //part 2 //completed }
[ "saquib1212@gmail.com" ]
saquib1212@gmail.com
1d7ffe2474d796af85557e59ad8c9156a76c73e5
647ec12ce50f06e7380fdbfb5b71e9e2d1ac03b4
/com.tencent.mm/classes.jar/com/tencent/mm/modelvideo/aa$2.java
5a998a2ac177761c575deb20acf533aa431a6d0a
[]
no_license
tsuzcx/qq_apk
0d5e792c3c7351ab781957bac465c55c505caf61
afe46ef5640d0ba6850cdefd3c11badbd725a3f6
refs/heads/main
2022-07-02T10:32:11.651957
2022-02-01T12:41:38
2022-02-01T12:41:38
453,860,108
36
9
null
2022-01-31T09:46:26
2022-01-31T02:43:22
Java
UTF-8
Java
false
false
13,749
java
package com.tencent.mm.modelvideo; final class aa$2 implements Runnable { aa$2(aa paramaa, String paramString1, String paramString2, String paramString3) {} /* Error */ public final void run() { // Byte code: // 0: ldc 35 // 2: invokestatic 41 com/tencent/matrix/trace/core/AppMethodBeat:i (I)V // 5: invokestatic 47 com/tencent/mm/sdk/platformtools/Util:nowMilliSecond ()J // 8: lstore 8 // 10: aload_0 // 11: getfield 23 com/tencent/mm/modelvideo/aa$2:pbx Ljava/lang/String; // 14: invokestatic 53 com/tencent/mm/vfs/y:bEl (Ljava/lang/String;)J // 17: l2i // 18: istore 5 // 20: aload_0 // 21: getfield 25 com/tencent/mm/modelvideo/aa$2:pby Ljava/lang/String; // 24: invokestatic 53 com/tencent/mm/vfs/y:bEl (Ljava/lang/String;)J // 27: l2i // 28: istore 6 // 30: ldc 55 // 32: ldc 57 // 34: iconst_5 // 35: anewarray 4 java/lang/Object // 38: dup // 39: iconst_0 // 40: lload 8 // 42: invokestatic 63 java/lang/Long:valueOf (J)Ljava/lang/Long; // 45: aastore // 46: dup // 47: iconst_1 // 48: iload 5 // 50: invokestatic 68 java/lang/Integer:valueOf (I)Ljava/lang/Integer; // 53: aastore // 54: dup // 55: iconst_2 // 56: iload 6 // 58: invokestatic 68 java/lang/Integer:valueOf (I)Ljava/lang/Integer; // 61: aastore // 62: dup // 63: iconst_3 // 64: aload_0 // 65: getfield 23 com/tencent/mm/modelvideo/aa$2:pbx Ljava/lang/String; // 68: aastore // 69: dup // 70: iconst_4 // 71: aload_0 // 72: getfield 25 com/tencent/mm/modelvideo/aa$2:pby Ljava/lang/String; // 75: aastore // 76: invokestatic 73 com/tencent/mm/sdk/platformtools/Log:i (Ljava/lang/String;Ljava/lang/String;[Ljava/lang/Object;)V // 79: iload 6 // 81: iload 5 // 83: if_icmpeq +126 -> 209 // 86: iload 6 // 88: ifgt +111 -> 199 // 91: bipush 10 // 93: istore_1 // 94: iload 5 // 96: ifgt +108 -> 204 // 99: bipush 20 // 101: istore_2 // 102: getstatic 79 com/tencent/mm/plugin/report/service/h:OAn Lcom/tencent/mm/plugin/report/service/h; // 105: sipush 12696 // 108: iconst_5 // 109: anewarray 4 java/lang/Object // 112: dup // 113: iconst_0 // 114: iload_2 // 115: iload_1 // 116: bipush 106 // 118: iadd // 119: iadd // 120: invokestatic 68 java/lang/Integer:valueOf (I)Ljava/lang/Integer; // 123: aastore // 124: dup // 125: iconst_1 // 126: aload_0 // 127: getfield 27 com/tencent/mm/modelvideo/aa$2:pbz Ljava/lang/String; // 130: aastore // 131: dup // 132: iconst_2 // 133: ldc 81 // 135: aastore // 136: dup // 137: iconst_3 // 138: ldc 81 // 140: aastore // 141: dup // 142: iconst_4 // 143: iload 6 // 145: invokestatic 68 java/lang/Integer:valueOf (I)Ljava/lang/Integer; // 148: aastore // 149: invokevirtual 84 com/tencent/mm/plugin/report/service/h:b (I[Ljava/lang/Object;)V // 152: ldc 55 // 154: ldc 86 // 156: iconst_4 // 157: anewarray 4 java/lang/Object // 160: dup // 161: iconst_0 // 162: iload 5 // 164: invokestatic 68 java/lang/Integer:valueOf (I)Ljava/lang/Integer; // 167: aastore // 168: dup // 169: iconst_1 // 170: iload 6 // 172: invokestatic 68 java/lang/Integer:valueOf (I)Ljava/lang/Integer; // 175: aastore // 176: dup // 177: iconst_2 // 178: aload_0 // 179: getfield 23 com/tencent/mm/modelvideo/aa$2:pbx Ljava/lang/String; // 182: aastore // 183: dup // 184: iconst_3 // 185: aload_0 // 186: getfield 25 com/tencent/mm/modelvideo/aa$2:pby Ljava/lang/String; // 189: aastore // 190: invokestatic 89 com/tencent/mm/sdk/platformtools/Log:e (Ljava/lang/String;Ljava/lang/String;[Ljava/lang/Object;)V // 193: ldc 35 // 195: invokestatic 92 com/tencent/matrix/trace/core/AppMethodBeat:o (I)V // 198: return // 199: iconst_0 // 200: istore_1 // 201: goto -107 -> 94 // 204: iconst_0 // 205: istore_2 // 206: goto -104 -> 102 // 209: iconst_0 // 210: istore 4 // 212: iconst_0 // 213: istore_1 // 214: iconst_0 // 215: istore_3 // 216: aconst_null // 217: astore 11 // 219: aconst_null // 220: astore 13 // 222: aload 13 // 224: astore 10 // 226: iload 4 // 228: istore_2 // 229: aload_0 // 230: getfield 23 com/tencent/mm/modelvideo/aa$2:pbx Ljava/lang/String; // 233: invokestatic 96 com/tencent/mm/vfs/y:Lh (Ljava/lang/String;)Ljava/io/InputStream; // 236: astore 12 // 238: aload 13 // 240: astore 10 // 242: aload 12 // 244: astore 11 // 246: iload 4 // 248: istore_2 // 249: aload_0 // 250: getfield 25 com/tencent/mm/modelvideo/aa$2:pby Ljava/lang/String; // 253: invokestatic 96 com/tencent/mm/vfs/y:Lh (Ljava/lang/String;)Ljava/io/InputStream; // 256: astore 13 // 258: aload 13 // 260: astore 10 // 262: aload 12 // 264: astore 11 // 266: iload 4 // 268: istore_2 // 269: sipush 4096 // 272: newarray byte // 274: astore 14 // 276: aload 13 // 278: astore 10 // 280: aload 12 // 282: astore 11 // 284: iload 4 // 286: istore_2 // 287: sipush 4096 // 290: newarray byte // 292: astore 15 // 294: aload 13 // 296: astore 10 // 298: aload 12 // 300: astore 11 // 302: iload_1 // 303: istore_2 // 304: aload 12 // 306: aload 14 // 308: invokevirtual 102 java/io/InputStream:read ([B)I // 311: istore 7 // 313: aload 13 // 315: astore 10 // 317: aload 12 // 319: astore 11 // 321: iload_1 // 322: istore_2 // 323: aload 13 // 325: aload 15 // 327: invokevirtual 102 java/io/InputStream:read ([B)I // 330: istore 4 // 332: iload_3 // 333: istore_2 // 334: iload 7 // 336: iload 4 // 338: if_icmpeq +5 -> 343 // 341: iconst_1 // 342: istore_2 // 343: iload 7 // 345: iconst_m1 // 346: if_icmpeq +45 -> 391 // 349: iconst_0 // 350: istore_3 // 351: iload_3 // 352: iload 7 // 354: if_icmpge +32 -> 386 // 357: iload_1 // 358: istore 4 // 360: aload 14 // 362: iload_3 // 363: baload // 364: aload 15 // 366: iload_3 // 367: baload // 368: if_icmpeq +8 -> 376 // 371: iload_1 // 372: iconst_1 // 373: iadd // 374: istore 4 // 376: iload_3 // 377: iconst_1 // 378: iadd // 379: istore_3 // 380: iload 4 // 382: istore_1 // 383: goto -32 -> 351 // 386: iload_2 // 387: istore_3 // 388: goto -94 -> 294 // 391: iload_1 // 392: istore_3 // 393: aload 12 // 395: astore 11 // 397: aload 13 // 399: astore 10 // 401: iload_2 // 402: istore_1 // 403: aload 10 // 405: invokevirtual 105 java/io/InputStream:close ()V // 408: aload 11 // 410: invokevirtual 105 java/io/InputStream:close ()V // 413: iload_1 // 414: ifeq +106 -> 520 // 417: ldc 55 // 419: ldc 107 // 421: iconst_4 // 422: anewarray 4 java/lang/Object // 425: dup // 426: iconst_0 // 427: iload 5 // 429: invokestatic 68 java/lang/Integer:valueOf (I)Ljava/lang/Integer; // 432: aastore // 433: dup // 434: iconst_1 // 435: iload 6 // 437: invokestatic 68 java/lang/Integer:valueOf (I)Ljava/lang/Integer; // 440: aastore // 441: dup // 442: iconst_2 // 443: aload_0 // 444: getfield 23 com/tencent/mm/modelvideo/aa$2:pbx Ljava/lang/String; // 447: aastore // 448: dup // 449: iconst_3 // 450: aload_0 // 451: getfield 25 com/tencent/mm/modelvideo/aa$2:pby Ljava/lang/String; // 454: aastore // 455: invokestatic 89 com/tencent/mm/sdk/platformtools/Log:e (Ljava/lang/String;Ljava/lang/String;[Ljava/lang/Object;)V // 458: getstatic 79 com/tencent/mm/plugin/report/service/h:OAn Lcom/tencent/mm/plugin/report/service/h; // 461: sipush 12696 // 464: iconst_2 // 465: anewarray 4 java/lang/Object // 468: dup // 469: iconst_0 // 470: bipush 107 // 472: invokestatic 68 java/lang/Integer:valueOf (I)Ljava/lang/Integer; // 475: aastore // 476: dup // 477: iconst_1 // 478: aload_0 // 479: getfield 27 com/tencent/mm/modelvideo/aa$2:pbz Ljava/lang/String; // 482: aastore // 483: invokevirtual 84 com/tencent/mm/plugin/report/service/h:b (I[Ljava/lang/Object;)V // 486: ldc 35 // 488: invokestatic 92 com/tencent/matrix/trace/core/AppMethodBeat:o (I)V // 491: return // 492: astore 12 // 494: ldc 55 // 496: ldc 109 // 498: iconst_1 // 499: anewarray 4 java/lang/Object // 502: dup // 503: iconst_0 // 504: aload 12 // 506: invokestatic 113 com/tencent/mm/sdk/platformtools/Util:stackTraceToString (Ljava/lang/Throwable;)Ljava/lang/String; // 509: aastore // 510: invokestatic 89 com/tencent/mm/sdk/platformtools/Log:e (Ljava/lang/String;Ljava/lang/String;[Ljava/lang/Object;)V // 513: iconst_1 // 514: istore_1 // 515: iload_2 // 516: istore_3 // 517: goto -114 -> 403 // 520: lload 8 // 522: invokestatic 117 com/tencent/mm/sdk/platformtools/Util:milliSecondsToNow (J)J // 525: lstore 8 // 527: getstatic 79 com/tencent/mm/plugin/report/service/h:OAn Lcom/tencent/mm/plugin/report/service/h; // 530: sipush 12696 // 533: iconst_4 // 534: anewarray 4 java/lang/Object // 537: dup // 538: iconst_0 // 539: sipush 400 // 542: invokestatic 68 java/lang/Integer:valueOf (I)Ljava/lang/Integer; // 545: aastore // 546: dup // 547: iconst_1 // 548: aload_0 // 549: getfield 27 com/tencent/mm/modelvideo/aa$2:pbz Ljava/lang/String; // 552: aastore // 553: dup // 554: iconst_2 // 555: iload_3 // 556: invokestatic 122 java/lang/String:valueOf (I)Ljava/lang/String; // 559: aastore // 560: dup // 561: iconst_3 // 562: lload 8 // 564: invokestatic 63 java/lang/Long:valueOf (J)Ljava/lang/Long; // 567: aastore // 568: invokevirtual 84 com/tencent/mm/plugin/report/service/h:b (I[Ljava/lang/Object;)V // 571: ldc 55 // 573: ldc 124 // 575: iconst_4 // 576: anewarray 4 java/lang/Object // 579: dup // 580: iconst_0 // 581: lload 8 // 583: invokestatic 63 java/lang/Long:valueOf (J)Ljava/lang/Long; // 586: aastore // 587: dup // 588: iconst_1 // 589: iload_3 // 590: invokestatic 68 java/lang/Integer:valueOf (I)Ljava/lang/Integer; // 593: aastore // 594: dup // 595: iconst_2 // 596: aload_0 // 597: getfield 23 com/tencent/mm/modelvideo/aa$2:pbx Ljava/lang/String; // 600: aastore // 601: dup // 602: iconst_3 // 603: aload_0 // 604: getfield 25 com/tencent/mm/modelvideo/aa$2:pby Ljava/lang/String; // 607: aastore // 608: invokestatic 73 com/tencent/mm/sdk/platformtools/Log:i (Ljava/lang/String;Ljava/lang/String;[Ljava/lang/Object;)V // 611: ldc 35 // 613: invokestatic 92 com/tencent/matrix/trace/core/AppMethodBeat:o (I)V // 616: return // 617: astore 10 // 619: goto -211 -> 408 // 622: astore 10 // 624: goto -211 -> 413 // Local variable table: // start length slot name signature // 0 627 0 this 2 // 93 422 1 i int // 101 415 2 j int // 215 375 3 k int // 210 171 4 m int // 18 410 5 n int // 28 408 6 i1 int // 311 44 7 i2 int // 8 574 8 l long // 224 180 10 localInputStream1 java.io.InputStream // 617 1 10 localException1 java.lang.Exception // 622 1 10 localException2 java.lang.Exception // 217 192 11 localObject Object // 236 158 12 localInputStream2 java.io.InputStream // 492 13 12 localException3 java.lang.Exception // 220 178 13 localInputStream3 java.io.InputStream // 274 87 14 arrayOfByte1 byte[] // 292 73 15 arrayOfByte2 byte[] // Exception table: // from to target type // 229 238 492 java/lang/Exception // 249 258 492 java/lang/Exception // 269 276 492 java/lang/Exception // 287 294 492 java/lang/Exception // 304 313 492 java/lang/Exception // 323 332 492 java/lang/Exception // 403 408 617 java/lang/Exception // 408 413 622 java/lang/Exception } } /* Location: L:\local\mybackup\temp\qq_apk\com.tencent.mm\classes.jar * Qualified Name: com.tencent.mm.modelvideo.aa.2 * JD-Core Version: 0.7.0.1 */
[ "98632993+tsuzcx@users.noreply.github.com" ]
98632993+tsuzcx@users.noreply.github.com
7ead9e19d4df5c46fe6562518adbddb695a3f097
129f58086770fc74c171e9c1edfd63b4257210f3
/src/testcases/CWE129_Improper_Validation_of_Array_Index/CWE129_Improper_Validation_of_Array_Index__connect_tcp_array_read_check_min_73a.java
2703a950a0987f743dcf6d532577f97fa20f293a
[]
no_license
glopezGitHub/Android23
1bd0b6a6c7ce3c7439a74f1e4dcef2c4c0fac4ba
6215d0684c4fbdc7217ccfbedfccfca69824cc5e
refs/heads/master
2023-03-07T15:14:59.447795
2023-02-06T13:59:49
2023-02-06T13:59:49
6,856,387
0
3
null
2023-02-06T18:38:17
2012-11-25T22:04:23
Java
UTF-8
Java
false
false
8,214
java
/* TEMPLATE GENERATED TESTCASE FILE Filename: CWE129_Improper_Validation_of_Array_Index__connect_tcp_array_read_check_min_73a.java Label Definition File: CWE129_Improper_Validation_of_Array_Index.label.xml Template File: sources-sinks-73a.tmpl.java */ /* * @description * CWE: 129 Improper Validation of Array Index * BadSource: connect_tcp Read data using an outbound tcp connection * GoodSource: A hardcoded non-zero, non-min, non-max, even number * Sinks: array_read_check_min * GoodSink: Read from array after verifying that data is at least 0 and less than array.length * BadSink : Read from array after verifying that data is at least 0 (but not verifying that data less than array.length) * Flow Variant: 73 Data flow: data passed in a LinkedList from one method to another in different source files in the same package * * */ package testcases.CWE129_Improper_Validation_of_Array_Index; import testcasesupport.*; import java.util.LinkedList; import java.sql.*; import javax.servlet.http.*; import java.io.BufferedReader; import java.io.InputStreamReader; import java.io.IOException; import java.net.Socket; import java.util.logging.Level; import java.util.logging.Logger; public class CWE129_Improper_Validation_of_Array_Index__connect_tcp_array_read_check_min_73a extends AbstractTestCase { public void bad() throws Throwable { int data; data = Integer.MIN_VALUE; /* Initialize data */ /* Read data using an outbound tcp connection */ { Socket sock = null; BufferedReader buffread = null; InputStreamReader instrread = null; try { /* Read data using an outbound tcp connection */ sock = new Socket("host.example.org", 39544); /* read input from socket */ instrread = new InputStreamReader(sock.getInputStream(), "UTF-8"); buffread = new BufferedReader(instrread); /* POTENTIAL FLAW: Read data using an outbound tcp connection */ String s_data = buffread.readLine(); if (s_data != null) // avoid NPD incidental warnings { try { data = Integer.parseInt(s_data.trim()); } catch(NumberFormatException nfe) { IO.logger.log(Level.WARNING, "Number format exception parsing data from string", nfe); } } } catch( IOException ioe ) { IO.logger.log(Level.WARNING, "Error with stream reading", ioe); } finally { /* clean up stream reading objects */ try { if( buffread != null ) { buffread.close(); } } catch( IOException ioe ) { IO.logger.log(Level.WARNING, "Error closing BufferedReader", ioe); } try { if( instrread != null ) { instrread.close(); } } catch( IOException ioe ) { IO.logger.log(Level.WARNING, "Error closing InputStreamReader", ioe); } /* clean up socket objects */ try { if( sock != null ) { sock.close(); } } catch( IOException e ) { IO.logger.log(Level.WARNING, "Error closing Socket", e); } } } LinkedList<Integer> data_linkedlist = new LinkedList<Integer>(); data_linkedlist.add(0, data); data_linkedlist.add(1, data); data_linkedlist.add(2, data); (new CWE129_Improper_Validation_of_Array_Index__connect_tcp_array_read_check_min_73b()).bad_sink(data_linkedlist ); } public void good() throws Throwable { goodG2B(); goodB2G(); } /* goodG2B() - use GoodSource and BadSink */ private void goodG2B() throws Throwable { int data; /* FIX: Use a hardcoded number that won't cause underflow, overflow, divide by zero, or loss-of-precision issues */ data = 2; LinkedList<Integer> data_linkedlist = new LinkedList<Integer>(); data_linkedlist.add(0, data); data_linkedlist.add(1, data); data_linkedlist.add(2, data); (new CWE129_Improper_Validation_of_Array_Index__connect_tcp_array_read_check_min_73b()).goodG2B_sink(data_linkedlist ); } /* goodB2G() - use BadSource and GoodSink */ private void goodB2G() throws Throwable { int data; data = Integer.MIN_VALUE; /* Initialize data */ /* Read data using an outbound tcp connection */ { Socket sock = null; BufferedReader buffread = null; InputStreamReader instrread = null; try { /* Read data using an outbound tcp connection */ sock = new Socket("host.example.org", 39544); /* read input from socket */ instrread = new InputStreamReader(sock.getInputStream(), "UTF-8"); buffread = new BufferedReader(instrread); /* POTENTIAL FLAW: Read data using an outbound tcp connection */ String s_data = buffread.readLine(); if (s_data != null) // avoid NPD incidental warnings { try { data = Integer.parseInt(s_data.trim()); } catch(NumberFormatException nfe) { IO.logger.log(Level.WARNING, "Number format exception parsing data from string", nfe); } } } catch( IOException ioe ) { IO.logger.log(Level.WARNING, "Error with stream reading", ioe); } finally { /* clean up stream reading objects */ try { if( buffread != null ) { buffread.close(); } } catch( IOException ioe ) { IO.logger.log(Level.WARNING, "Error closing BufferedReader", ioe); } try { if( instrread != null ) { instrread.close(); } } catch( IOException ioe ) { IO.logger.log(Level.WARNING, "Error closing InputStreamReader", ioe); } /* clean up socket objects */ try { if( sock != null ) { sock.close(); } } catch( IOException e ) { IO.logger.log(Level.WARNING, "Error closing Socket", e); } } } LinkedList<Integer> data_linkedlist = new LinkedList<Integer>(); data_linkedlist.add(0, data); data_linkedlist.add(1, data); data_linkedlist.add(2, data); (new CWE129_Improper_Validation_of_Array_Index__connect_tcp_array_read_check_min_73b()).goodB2G_sink(data_linkedlist ); } /* Below is the main(). It is only used when building this testcase on its own for testing or for building a binary to use in testing binary analysis tools. It is not used when compiling all the testcases as one application, which is how source code analysis tools are tested. */ public static void main(String[] args) throws ClassNotFoundException, InstantiationException, IllegalAccessException { mainFromParent(args); } }
[ "guillermo.pando@gmail.com" ]
guillermo.pando@gmail.com
7a050f52bdd8bcf83c1eb9516b6031002497763b
dce13b5d530e5c438c77909542a81529e0c627bb
/Templates/Java/src/swingame/emulator/EmulatedInput.java
a9e5e11f83314b5b38adc7b2ffc7f458d28e55eb
[]
no_license
macite/swingame
3918787b8d28749bfe8d6b67413210ddc43e18ce
73f3fe2e90ba086ce713ee79fd636bc93372262f
refs/heads/develop
2020-04-06T06:58:15.628207
2019-04-17T00:20:50
2019-04-17T00:20:50
9,490,099
25
18
null
2016-08-30T23:06:32
2013-04-17T05:37:13
Pascal
UTF-8
Java
false
false
1,090
java
/* * To change this template, choose Tools | Templates * and open the template in the editor. */ package swingame.emulator; import java.awt.Point; import swingame.InputAdapter; /** * * @author acain */ public class EmulatedInput implements InputAdapter { public Point mousePosition() { return EmulatedGraphics.getWindow().getMousePoint(); } public boolean mouseClicked(int button) { return EmulatedGraphics.getWindow().mouseClicked(button); } public boolean mouseDown(int button) { return EmulatedGraphics.getWindow().mouseDown(button); } public boolean keyTyped(int key) { return EmulatedGraphics.getWindow().keyTyped(key); } public boolean keyDown(int key) { return EmulatedGraphics.getWindow().keyDown(key); } public boolean windowCloseRequested() { return false == EmulatedGraphics.getWindow().isVisible(); } public void processEvents() { EmulatedGraphics.getWindow().processEvents(); } }
[ "macite@gmail.com" ]
macite@gmail.com
be72cdb5c035790eea18377024d3207b27f3beb4
810873bc64fd3daa082e8636a1b182e46a023638
/drools-core/src/main/java/org/drools/reteoo/Rete.java
bd9e75fb3ac7ea7928fa5b98b80ec6953f4e53d2
[ "Apache-2.0" ]
permissive
pymma/drools47jdk8
7456d4cd54c20ba87ab7ae4e3ce38be7a7f9a11a
b532d45ac47806bef8c3a6cf1ac671c73ed4ea09
refs/heads/master
2022-07-29T17:25:35.788215
2021-11-23T09:39:10
2021-11-23T09:39:10
426,141,147
0
0
null
null
null
null
UTF-8
Java
false
false
27,987
java
package org.drools.reteoo; /* * Copyright 2005 JBoss 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. */ import java.io.IOException; import java.io.ObjectInputStream; import java.io.Serializable; import java.util.ArrayList; import java.util.Collection; import java.util.List; import java.util.Map; import org.drools.FactException; import org.drools.RuleBaseConfiguration; import org.drools.RuntimeDroolsException; import org.drools.base.ClassObjectType; import org.drools.base.DroolsQuery; import org.drools.base.ShadowProxy; import org.drools.base.ShadowProxyFactory; import org.drools.common.BaseNode; import org.drools.common.DroolsObjectInputStream; import org.drools.common.InternalFactHandle; import org.drools.common.InternalRuleBase; import org.drools.common.InternalWorkingMemory; import org.drools.common.NodeMemory; import org.drools.facttemplates.Fact; import org.drools.facttemplates.FactTemplate; import org.drools.facttemplates.FactTemplateObjectType; import org.drools.objenesis.instantiator.ObjectInstantiator; import org.drools.reteoo.builder.BuildContext; import org.drools.reteoo.builder.PatternBuilder; import org.drools.spi.ObjectType; import org.drools.spi.PropagationContext; import org.drools.util.FactEntry; import org.drools.util.FactHashTable; import org.drools.util.Iterator; import org.drools.util.ObjectHashMap; import org.drools.util.ObjectHashMap.ObjectEntry; /** * The Rete-OO network. * * The Rete class is the root <code>Object</code>. All objects are asserted into * the Rete node where it propagates to all matching ObjectTypeNodes. * * The first time an instance of a Class type is asserted it does a full * iteration of all ObjectTyppeNodes looking for matches, any matches are * then cached in a HashMap which is used for future assertions. * * While Rete extends ObjectSource nad implements ObjectSink it nulls the * methods attach(), remove() and updateNewNode() as this is the root node * they are no applicable * * @see ObjectTypeNode * * @author <a href="mailto:mark.proctor@jboss.com">Mark Proctor</a> * @author <a href="mailto:bob@werken.com">Bob McWhirter</a> */ public class Rete extends ObjectSource implements Serializable, ObjectSink, NodeMemory { // ------------------------------------------------------------ // Instance members // ------------------------------------------------------------ /** * */ private static final long serialVersionUID = 400L; /** The <code>Map</code> of <code>ObjectTypeNodes</code>. */ private final ObjectHashMap objectTypeNodes; private transient InternalRuleBase ruleBase; // ------------------------------------------------------------ // Constructors // ------------------------------------------------------------ public Rete(InternalRuleBase ruleBase) { super( 0 ); this.objectTypeNodes = new ObjectHashMap(); this.ruleBase = ruleBase; } private void readObject(ObjectInputStream stream) throws IOException, ClassNotFoundException { stream.defaultReadObject(); this.ruleBase = ((DroolsObjectInputStream) stream).getRuleBase(); } // ------------------------------------------------------------ // Instance methods // ------------------------------------------------------------ /** * This is the entry point into the network for all asserted Facts. Iterates a cache * of matching <code>ObjectTypdeNode</code>s asserting the Fact. If the cache does not * exist it first iteraes and builds the cache. * * @param handle * The FactHandle of the fact to assert * @param context * The <code>PropagationContext</code> of the <code>WorkingMemory</code> action * @param workingMemory * The working memory session. */ public void assertObject(final InternalFactHandle handle, final PropagationContext context, final InternalWorkingMemory workingMemory) { final ObjectHashMap memory = (ObjectHashMap) workingMemory.getNodeMemory( this ); Object object = handle.getObject(); ObjectTypeConf ojectTypeConf; if ( object instanceof Fact ) { String key = ((Fact) object).getFactTemplate().getName(); ojectTypeConf = (ObjectTypeConf) memory.get( key ); if ( ojectTypeConf == null ) { ojectTypeConf = new FactTemplateTypeConf( ((Fact) object).getFactTemplate(), this.ruleBase ); memory.put( key, ojectTypeConf, false ); } object = key; } else { Class cls = null; if ( object instanceof ShadowProxy ) { cls = ((ShadowProxy) object).getShadowedObject().getClass(); } else { cls = object.getClass(); } ojectTypeConf = (ObjectTypeConf) memory.get( cls ); if ( ojectTypeConf == null ) { ojectTypeConf = new ClassObjectTypeConf( cls, this.ruleBase ); memory.put( cls, ojectTypeConf, false ); } // checks if shadow is enabled if ( ojectTypeConf.isShadowEnabled() ) { // need to improve this if ( !(handle.getObject() instanceof ShadowProxy) ) { // replaces the actual object by its shadow before propagating handle.setObject( ojectTypeConf.getShadow( handle.getObject() ) ); handle.setShadowFact( true ); } else { ((ShadowProxy) handle.getObject()).updateProxy(); } } } ObjectTypeNode[] cachedNodes = ojectTypeConf.getObjectTypeNodes(); for ( int i = 0, length = cachedNodes.length; i < length; i++ ) { cachedNodes[i].assertObject( handle, context, workingMemory ); } } /** * Retract a fact object from this <code>RuleBase</code> and the specified * <code>WorkingMemory</code>. * * @param handle * The handle of the fact to retract. * @param workingMemory * The working memory session. */ public void retractObject(final InternalFactHandle handle, final PropagationContext context, final InternalWorkingMemory workingMemory) { final ObjectHashMap memory = (ObjectHashMap) workingMemory.getNodeMemory( this ); final Object object = handle.getObject(); ObjectTypeConf objectTypeConf; if ( object instanceof Fact ) { String key = ((Fact) object).getFactTemplate().getName(); objectTypeConf = (ObjectTypeConf) memory.get( key ); } else if ( object instanceof ShadowProxy ) { objectTypeConf = (ObjectTypeConf) memory.get( ((ShadowProxy) object).getShadowedObject().getClass() ); } else { objectTypeConf = (ObjectTypeConf) memory.get( object.getClass() ); } ObjectTypeNode[] cachedNodes = objectTypeConf.getObjectTypeNodes(); if ( cachedNodes == null ) { // it is possible that there are no ObjectTypeNodes for an object being retracted return; } for ( int i = 0; i < cachedNodes.length; i++ ) { cachedNodes[i].retractObject( handle, context, workingMemory ); } } /** * Adds the <code>TupleSink</code> so that it may receive * <code>Tuples</code> propagated from this <code>TupleSource</code>. * * @param tupleSink * The <code>TupleSink</code> to receive propagated * <code>Tuples</code>. */ protected void addObjectSink(final ObjectSink objectSink) { final ObjectTypeNode node = (ObjectTypeNode) objectSink; this.objectTypeNodes.put( node.getObjectType(), node, true ); } protected void removeObjectSink(final ObjectSink objectSink) { final ObjectTypeNode node = (ObjectTypeNode) objectSink; this.objectTypeNodes.remove( node.getObjectType() ); } public void attach() { throw new UnsupportedOperationException( "cannot call attach() from the root Rete node" ); } public void attach(final InternalWorkingMemory[] workingMemories) { throw new UnsupportedOperationException( "cannot call attach() from the root Rete node" ); } public void remove(final RuleRemovalContext context, final BaseNode node, final InternalWorkingMemory[] workingMemories) { final ObjectTypeNode objectTypeNode = (ObjectTypeNode) node; removeObjectSink( objectTypeNode ); for ( int i = 0; i < workingMemories.length; i++ ) { // clear the node memory for each working memory. workingMemories[i].clearNodeMemory( (NodeMemory) node ); } } public ObjectHashMap getObjectTypeNodes() { return this.objectTypeNodes; } public Object createMemory(final RuleBaseConfiguration config) { return new ObjectHashMap(); } public InternalRuleBase getRuleBase() { return this.ruleBase; } public int hashCode() { return this.objectTypeNodes.hashCode(); } public boolean equals(final Object object) { if ( object == this ) { return true; } if ( object == null || !(object instanceof Rete) ) { return false; } final Rete other = (Rete) object; return this.objectTypeNodes.equals( other.objectTypeNodes ); } public void updateSink(final ObjectSink sink, final PropagationContext context, final InternalWorkingMemory workingMemory) { // JBRULES-612: the cache MUST be invalidated when a new node type is added to the network, so iterate and reset all caches. final ObjectHashMap memory = (ObjectHashMap) workingMemory.getNodeMemory( this ); Iterator it = memory.iterator(); final ObjectTypeNode node = (ObjectTypeNode) sink; ObjectType newObjectType = node.getObjectType(); for ( ObjectEntry entry = (ObjectEntry) it.next(); entry != null; entry = (ObjectEntry) it.next() ) { ObjectTypeConf objectTypeConf = (ObjectTypeConf) entry.getValue(); if ( newObjectType.isAssignableFrom( objectTypeConf.getConcreteObjectTypeNode().getObjectType() ) ) { objectTypeConf.resetCache(); ObjectTypeNode sourceNode = objectTypeConf.getConcreteObjectTypeNode(); FactHashTable table = (FactHashTable) workingMemory.getNodeMemory( sourceNode ); Iterator factIter = table.iterator(); for ( FactEntry factEntry = (FactEntry) factIter.next(); factEntry != null; factEntry = (FactEntry) factIter.next() ) { sink.assertObject( factEntry.getFactHandle(), context, workingMemory ); } } } // ObjectType // this.c // final ObjectTypeNode node = (ObjectTypeNode) sink; // it = workingMemory.getFactHandleMap().iterator(); // for ( ObjectEntry entry = (ObjectEntry) it.next(); entry != null; entry = (ObjectEntry) it.next() ) { // final InternalFactHandle handle = (InternalFactHandle) entry.getValue(); // if ( node.matches( handle.getObject() ) ) { // node.assertObject( handle, // context, // workingMemory ); // } // } } public boolean isObjectMemoryEnabled() { throw new UnsupportedOperationException( "Rete has no Object memory" ); } public void setObjectMemoryEnabled(boolean objectMemoryEnabled) { throw new UnsupportedOperationException( "ORete has no Object memory" ); } public static interface ObjectTypeConf { public ObjectTypeNode[] getObjectTypeNodes(); public boolean isShadowEnabled(); public Object getShadow(final Object fact) throws RuntimeDroolsException; public ObjectTypeNode getConcreteObjectTypeNode(); public void resetCache(); public boolean isAssignableFrom(Object object); public boolean isActive(); } public static class FactTemplateTypeConf implements ObjectTypeConf, Serializable { private InternalRuleBase ruleBase; private FactTemplate factTemplate; private ObjectTypeNode concreteObjectTypeNode; private transient ObjectTypeNode[] cache; public FactTemplateTypeConf(FactTemplate factTemplate, InternalRuleBase ruleBase) { this.ruleBase = ruleBase; this.factTemplate = factTemplate; ObjectType objectType = new FactTemplateObjectType( factTemplate ); this.concreteObjectTypeNode = (ObjectTypeNode) ruleBase.getRete().getObjectTypeNodes().get( objectType ); if ( this.concreteObjectTypeNode == null ) { BuildContext context = new BuildContext( ruleBase, ((ReteooRuleBase) ruleBase.getRete().getRuleBase()).getReteooBuilder().getIdGenerator() ); if ( context.getRuleBase().getConfiguration().isSequential() ) { // We are in sequential mode, so no nodes should have memory context.setTupleMemoryEnabled( false ); context.setObjectTypeNodeMemoryEnabled( false ); context.setTerminalNodeMemoryEnabled( false ); } else { context.setTupleMemoryEnabled( true ); context.setObjectTypeNodeMemoryEnabled( true ); context.setTerminalNodeMemoryEnabled( true ); } // there must exist an ObjectTypeNode for this concrete class this.concreteObjectTypeNode = PatternBuilder.attachObjectTypeNode( context, objectType ); } this.cache = new ObjectTypeNode[]{this.concreteObjectTypeNode}; } public ObjectTypeNode getConcreteObjectTypeNode() { return this.concreteObjectTypeNode; } public ObjectTypeNode[] getObjectTypeNodes() { if ( this.cache == null ) { this.cache = new ObjectTypeNode[]{this.concreteObjectTypeNode}; } return this.cache; } public Object getShadow(Object fact) throws RuntimeDroolsException { return null; } public boolean isShadowEnabled() { return false; } public boolean isAssignableFrom(Object object) { return this.factTemplate.equals( object ); } public void resetCache() { this.cache = null; } public boolean isActive() { return true; } } public static class ClassObjectTypeConf implements ObjectTypeConf, Serializable { private final Class cls; private transient InternalRuleBase ruleBase; private transient ObjectTypeNode[] objectTypeNodes; protected boolean shadowEnabled; protected Class shadowClass; protected transient ObjectInstantiator instantiator; private transient ObjectTypeNode concreteObjectTypeNode; private ObjectType objectType; public ClassObjectTypeConf(Class clazz, InternalRuleBase ruleBase) { this.cls = clazz; this.ruleBase = ruleBase; objectType = new ClassObjectType( clazz ); this.concreteObjectTypeNode = (ObjectTypeNode) ruleBase.getRete().getObjectTypeNodes().get( objectType ); // JBRULES-1315: do not add OTN dynamically anymore if ( this.concreteObjectTypeNode == null ) { BuildContext context = new BuildContext( ruleBase, ((ReteooRuleBase) ruleBase.getRete().getRuleBase()).getReteooBuilder().getIdGenerator() ); if ( DroolsQuery.class == clazz ) { context.setTupleMemoryEnabled( false ); context.setObjectTypeNodeMemoryEnabled( false ); context.setTerminalNodeMemoryEnabled( false ); } else if ( context.getRuleBase().getConfiguration().isSequential() ) { // We are in sequential mode, so no nodes should have memory context.setTupleMemoryEnabled( false ); context.setObjectTypeNodeMemoryEnabled( false ); context.setTerminalNodeMemoryEnabled( false ); } else { context.setTupleMemoryEnabled( true ); context.setObjectTypeNodeMemoryEnabled( true ); context.setTerminalNodeMemoryEnabled( true ); } // there must exist an ObjectTypeNode for this concrete class this.concreteObjectTypeNode = PatternBuilder.attachObjectTypeNode( context, objectType ); } defineShadowProxyData( clazz ); } public boolean isAssignableFrom(Object object) { return this.cls.isAssignableFrom( (Class) object ); } public ObjectTypeNode getConcreteObjectTypeNode() { return this.concreteObjectTypeNode; } public void setConcreteObjectTypeNode(ObjectTypeNode node) { this.concreteObjectTypeNode = node; } private void defineShadowProxyData(Class clazz) { Rete rete = this.ruleBase.getRete(); if ( !ruleBase.getConfiguration().isShadowProxy() || clazz == null || !ruleBase.getConfiguration().isShadowed( clazz.getName() ) ) { this.shadowEnabled = false; this.shadowClass = null; this.instantiator = null; return; } //String pkgName = (pkg != null) ? pkg.getName() : ""; String pkgName = getPackageName( clazz, clazz.getPackage() ); if ( "org.drools.reteoo".equals( pkgName ) || "org.drools.base".equals( pkgName ) ) { // We don't shadow internal classes this.shadowEnabled = false; this.shadowClass = null; this.instantiator = null; return; } // try to generate proxy for the actual class Class shadowClass = loadOrGenerateProxy( clazz, rete ); if ( shadowClass == null ) { // if it failed, try to find a parent class ObjectTypeNode[] nodes = this.getMatchingObjectTypes( clazz ); Class shadowClassRoot = clazz; while ( shadowClass == null && (shadowClassRoot = this.findAFeasibleSuperclassOrInterface( nodes, shadowClassRoot )) != null ) { shadowClass = loadOrGenerateProxy( shadowClassRoot, rete ); } } if ( shadowClass != null ) { this.shadowClass = shadowClass; this.shadowEnabled = true; setInstantiator(); } } /** * This will return the package name - if the package is null, it will * work it out from the class name (this is in cases where funky classloading is used). */ public static String getPackageName(Class clazz, Package pkg) { String pkgName = ""; if ( pkg == null ) { int index = clazz.getName().lastIndexOf( '.' ); if ( index != -1 ) pkgName = clazz.getName().substring( 0, index ); } else { pkgName = pkg.getName(); } return pkgName; } private Class loadOrGenerateProxy(Class clazz, Rete rete) { Class shadowClass = null; final String shadowProxyName = ShadowProxyFactory.getProxyClassNameForClass( clazz ); try { // if already loaded shadowClass = rete.getRuleBase().getMapBackedClassLoader().loadClass( shadowProxyName ); } catch ( final ClassNotFoundException cnfe ) { // otherwise, create and load final byte[] proxyBytes = ShadowProxyFactory.getProxyBytes( clazz ); if ( proxyBytes != null ) { rete.getRuleBase().getMapBackedClassLoader().addClass( shadowProxyName, proxyBytes ); try { shadowClass = rete.getRuleBase().getMapBackedClassLoader().loadClass( shadowProxyName ); } catch ( ClassNotFoundException e ) { throw new RuntimeException( "Unable to find or generate the ShadowProxy implementation for '" + clazz + "'" ); } } } return shadowClass; } private Class findAFeasibleSuperclassOrInterface(ObjectTypeNode[] nodes, Class clazz) { // check direct superclass Class ret = clazz.getSuperclass(); boolean isOk = ret != null && ret != Object.class; // we don't want to shadow java.lang.Object if ( isOk ) { for ( int i = 0; isOk && ret != null && i < nodes.length; i++ ) { isOk = nodes[i].getSinkPropagator().size() == 0 || nodes[i].isAssignableFrom( ret ); } } if ( !isOk ) { // try the interfaces now... Class[] interfaces = clazz.getInterfaces(); boolean notFound = true; isOk = interfaces.length > 0; for ( int i = 0; notFound && i < interfaces.length; i++ ) { ret = interfaces[i]; isOk = interfaces[i] != Serializable.class && interfaces[i] != Cloneable.class && interfaces[i] != Comparable.class; for ( int j = 0; isOk && j < nodes.length; j++ ) { isOk = nodes[j].getSinkPropagator().size() == 0 || nodes[j].isAssignableFrom( ret ); } notFound = !isOk; } if ( notFound ) { ret = null; } } // ret now contains a superclass/interface that can be shadowed or null if none return ret; } private void readObject(ObjectInputStream stream) throws IOException, ClassNotFoundException { stream.defaultReadObject(); this.ruleBase = ((DroolsObjectInputStream) stream).getRuleBase(); this.concreteObjectTypeNode = (ObjectTypeNode) ruleBase.getRete().getObjectTypeNodes().get( objectType ); } /** * */ private void setInstantiator() { this.instantiator = ruleBase.getObjenesis().getInstantiatorOf( this.shadowClass ); } public Object getShadow(final Object fact) throws RuntimeDroolsException { ShadowProxy proxy = null; if ( isShadowEnabled() ) { try { if ( Collection.class.isAssignableFrom( this.shadowClass ) || Map.class.isAssignableFrom( this.shadowClass ) ) { // if it is a collection, try to instantiate using constructor try { proxy = (ShadowProxy) this.shadowClass.getConstructor( new Class[]{cls} ).newInstance( new Object[]{fact} ); } catch ( Exception e ) { // not possible to instantiate using constructor } } if ( proxy == null ) { if ( this.instantiator == null ) { this.setInstantiator(); } proxy = (ShadowProxy) this.instantiator.newInstance(); } proxy.setShadowedObject( fact ); } catch ( final Exception e ) { throw new RuntimeDroolsException( "Error creating shadow fact for object: " + fact, e ); } } return proxy; } public boolean isShadowEnabled() { return this.shadowEnabled; } public void resetCache() { this.objectTypeNodes = null; defineShadowProxyData( cls ); } public ObjectTypeNode[] getObjectTypeNodes() { if ( this.objectTypeNodes == null ) { this.objectTypeNodes = getMatchingObjectTypes( this.cls ); } return this.objectTypeNodes; } private ObjectTypeNode[] getMatchingObjectTypes(final Class clazz) throws FactException { final List cache = new ArrayList(); final Iterator it = ruleBase.getRete().getObjectTypeNodes().newIterator(); for ( ObjectEntry entry = (ObjectEntry) it.next(); entry != null; entry = (ObjectEntry) it.next() ) { final ObjectTypeNode node = (ObjectTypeNode) entry.getValue(); if ( node.isAssignableFrom( clazz ) ) { cache.add( node ); } } return (ObjectTypeNode[]) cache.toArray( new ObjectTypeNode[cache.size()] ); } public boolean isActive() { return getConcreteObjectTypeNode().getSinkPropagator().getSinks().length > 0; } } }
[ "nicolas.heron@pymma-software.cop" ]
nicolas.heron@pymma-software.cop
4255ab0618ed32f7d4becd94c8b73cace1a773f4
f2b2590b521ddc733b8127f6a8c6139388631788
/src/test/java/calypte/server/util/ArraysUtilCopyTestHelper.java
2d7edd9a3c9f142d136959562451f5ceca11ea95
[]
no_license
ribeiro2008/scalypte
ab4bff0514322628f8c8507a3a92e69fe4632f76
dff874a9804b5b6fc6259dfe9e9ebe79f4fce158
refs/heads/master
2020-05-28T00:05:31.711653
2019-02-14T13:39:28
2019-02-14T13:39:28
null
0
0
null
null
null
null
UTF-8
Java
false
false
1,684
java
/* * Calypte http://calypte.uoutec.com.br/ * Copyright (C) 2018 UoUTec. (calypte@uoutec.com.br) * * 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 calypte.server.util; import java.lang.reflect.Field; import sun.misc.Unsafe; @SuppressWarnings("restriction") public class ArraysUtilCopyTestHelper { private static final Unsafe UNSAFE; private static final long BYTE_ARRAY_OFFSET; static { try { Field theUnsafe = Unsafe.class.getDeclaredField("theUnsafe"); theUnsafe.setAccessible(true); UNSAFE = (Unsafe) theUnsafe.get(null); BYTE_ARRAY_OFFSET = UNSAFE.arrayBaseOffset(byte[].class); } catch (Exception e) { throw new RuntimeException(e); } } public static void copy1(byte[] src, int srcPos, byte[] dest, int destPos, int length){ UNSAFE.copyMemory(src, BYTE_ARRAY_OFFSET + srcPos, dest, BYTE_ARRAY_OFFSET + destPos, length); } public static void copy2(byte[] src, int srcPos, byte[] dest, int destPos, int length){ System.arraycopy(src, srcPos, dest, destPos, length); } }
[ "ribeiro@uoutec.com.br" ]
ribeiro@uoutec.com.br
e50f4b7f297a9fc3864bacc182053702f961cc78
a797de5ee2ab7972ab24b26b16b0c4926ebac05a
/src/main/java/lintcode/_9.java
a538f41295d2f616903a3a187a03b31ea731d417
[]
no_license
sundayong/lintcode-leetcode
c4a90fb61eeea14d48e6ed83f8d8db4569581a26
59d66ef394aa7609a7a888217ee7d961976ab294
refs/heads/master
2022-07-24T03:48:54.259291
2020-08-18T06:30:07
2020-08-18T06:30:07
185,147,357
1
0
null
2022-06-29T18:17:53
2019-05-06T07:39:53
Java
UTF-8
Java
false
false
617
java
package lintcode;; import java.util.ArrayList; import java.util.List; public class _9 { public static List<String> fizzBuzz(int n) { List<String> str = new ArrayList<>(); for (int i = 1; i <= n; i++) { if (i % 3 == 0 && i % 5 == 0) { str.add("fizz buzz"); } else if (i % 5 == 0) { str.add("buzz"); } else if (i % 3 == 0) { str.add("fizz"); } else { str.add(String.valueOf(i)); } } return str; } public static void main(String[] args) { } }
[ "1137353877@qq.com" ]
1137353877@qq.com
c9a5d90d3b1f326219cfe8922184cd751302aa3c
5636e23ca013f1c6d1b88e1715ec038035013f12
/org.osgi.test.cases.component/src/org/osgi/test/cases/component/tb32/ConditionReferenceImpl.java
7efe448573ad6b8982108e10b5233d1222e4fe1f
[ "EPL-1.0", "Apache-2.0", "EPL-2.0", "CPL-1.0" ]
permissive
osgi/osgi
b897163557738fb40d03c368a3259b5e670a7d5a
0ec08abcda0a75a8efc99b5f4a178497f73f143c
refs/heads/main
2023-08-31T11:29:00.133907
2023-08-02T15:55:38
2023-08-02T15:55:38
255,701,604
76
36
Apache-2.0
2023-09-06T23:45:13
2020-04-14T19:09:53
Java
UTF-8
Java
false
false
2,049
java
/******************************************************************************* * Copyright (c) Contributors to the Eclipse Foundation * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * * SPDX-License-Identifier: Apache-2.0 *******************************************************************************/ package org.osgi.test.cases.component.tb32; import java.util.Dictionary; import java.util.Hashtable; import java.util.Optional; import org.osgi.service.component.ComponentContext; import org.osgi.service.condition.Condition; import org.osgi.test.cases.component.service.BaseService; public class ConditionReferenceImpl implements BaseService { private final Condition serviceParam; private volatile Condition serviceField; private volatile Condition serviceComponent; public ConditionReferenceImpl() { this(null); } public ConditionReferenceImpl(Condition serviceParam) { this.serviceParam = serviceParam; } @SuppressWarnings("unused") private void activate(ComponentContext context) { this.serviceComponent = context .locateService("osgi.ds.satisfying.condition"); } public Dictionary<String,Object> getProperties() { final Dictionary<String,Object> props = new Hashtable<>(); Optional.ofNullable(serviceParam) .ifPresent(local -> props.put("serviceParam", local)); Optional.ofNullable(serviceField) .ifPresent(local -> props.put("serviceField", local)); Optional.ofNullable(serviceComponent) .ifPresent(local -> props.put("serviceComponent", local)); return props; } }
[ "hargrave@us.ibm.com" ]
hargrave@us.ibm.com
74844dc793492e1b925d8304858f1a981b1903c2
1f7828cf9976883b6c6c23eef6a3b852ce243b81
/StudentWork/code/spring-hotel-reservation-client/solution-code/src/main/java/com/hotel/reservation/client/ReservationServiceFacadeImpl.java
775178e59c8a2439487501cb1d4a78dc98dda73e
[]
no_license
hulkhogan82/springbootlabs
0189f9e6f379d1f80c9aa31b92093a6a72e52af5
59e0348f2376c26c734c638964db04d7d55e68ff
refs/heads/master
2022-12-15T19:51:25.296443
2020-08-30T12:40:39
2020-08-30T12:40:39
290,239,981
0
0
null
null
null
null
UTF-8
Java
false
false
2,619
java
package com.hotel.reservation.client; import java.util.List; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Value; import org.springframework.core.ParameterizedTypeReference; import org.springframework.http.HttpMethod; import org.springframework.http.ResponseEntity; import org.springframework.stereotype.Component; import org.springframework.web.bind.annotation.PathVariable; import org.springframework.web.client.RestTemplate; import com.hotel.reservation.client.model.HotelReservation; /** * <p> * This component and its source code representation are copyright protected and * proprietary to Trivera Technologies, LLC., Worldwide * * This component and source code may be used for instructional and evaluation * purposes only. No part of this component or its source code may be sold, * transferred, or publicly posted, nor may it be used in a commercial or * production environment, without the express written consent of the Trivera * Technologies, Inc. * * Copyright (c) 2020 Trivera Technologies, LLC. http://www.triveratech.com * </p> * * @author The Trivera Tech Team. */ @Component public class ReservationServiceFacadeImpl implements ReservationServiceFacade { @Value("${base.url}") private String baseURL; @Autowired private RestTemplate restTemplate; public List<HotelReservation> getAllReservations() { String URL = baseURL + "/reservations"; ParameterizedTypeReference<List<HotelReservation>> type = new ParameterizedTypeReference<List<HotelReservation>>() { }; ResponseEntity<List<HotelReservation>> response = restTemplate.exchange(URL, HttpMethod.GET, null, type); return response.getBody(); } public HotelReservation getReservationByReservationNumber(Integer reservationNumber) { String URL = baseURL + "/reservations/{reservationNumber}"; return restTemplate.getForObject(URL, HotelReservation.class, reservationNumber); } public HotelReservation makeReservation(HotelReservation reservation) { String URL = baseURL + "/reservations"; return restTemplate.postForObject(URL, reservation, HotelReservation.class); } public void updateReservation(Integer reservatioNumber, HotelReservation reservation) { String URL = baseURL + "/reservations/{reservationNumber}"; restTemplate.put(URL, reservation, reservatioNumber); } void cancelReservation(@PathVariable Integer reservationNumber) { String URL = baseURL + "/reservations/{reservationNumber}"; restTemplate.delete(URL, reservationNumber); } }
[ "thehulkhogan@yahoo.com" ]
thehulkhogan@yahoo.com
fcdd68d09c2fb145bec711df8c333f5e0bd2b15e
0541b72beb2b5093dfaf21f8119ac0aeace7798a
/app/src/main/java/com/acrs/buddies/MainActivity.java
f23a87c1266f875cf375484841b69c67a8240b63
[]
no_license
sreelallalu/ARCS-BUDDY
96c763d339822f9a36a2c82ea5eb8bb15f6550fa
ed1c609ec0f47c90e33bb547823b1a2993b5c957
refs/heads/master
2020-03-27T20:25:46.751631
2018-09-05T07:36:53
2018-09-05T07:36:53
147,068,874
0
0
null
null
null
null
UTF-8
Java
false
false
329
java
package com.acrs.buddies; import android.os.Bundle; import android.support.v7.app.AppCompatActivity; public class MainActivity extends AppCompatActivity { @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); } }
[ "Sreelal8026@gmail.com" ]
Sreelal8026@gmail.com
31982980155a78366041d5fa17b459fbee32ebe2
c0bdadb7c00d256b184a53a3e60827ad09e87006
/app/src/main/java/com/lbs/cheng/lbscampus/MyApplication.java
7b099b057e9a36cdd25105f00ad68782df7b6dfd
[]
no_license
LT015/LBScampus
5b0e348a6ae9cd743bb6c715eaa5caf525da2fd9
a0b108c8baf0064269aee441a7b770eaaa3576ee
refs/heads/master
2020-07-14T08:05:11.386835
2019-11-15T11:59:18
2019-11-15T11:59:18
205,279,755
0
0
null
null
null
null
UTF-8
Java
false
false
869
java
package com.lbs.cheng.lbscampus; import android.app.Application; import android.content.Context; import com.alibaba.android.arouter.launcher.ARouter; import org.litepal.LitePal; public class MyApplication extends Application { private static Context context; @Override public void onCreate() { super.onCreate(); context = getApplicationContext(); if (true) { // 这两行必须写在init之前,否则这些配置在init过程中将无效 ARouter.openLog(); // 打印日志 //ARouter.openDebug(); // 开启调试模式(如果在InstantRun模式下运行,必须开启调试模式!线上版本需要关闭,否则有安全风险) } ARouter.init(this); LitePal.initialize(context); } public static Context getContext(){ return context; } }
[ "1342436308@qq.com" ]
1342436308@qq.com
2fe4a94b383252c9096c9df64e3de02dd95e50f7
80af2b36709e6c7027908f82022af5463a9f813b
/kscWebProject/test/junitExam/Calculator.java
bbd0373635743f980916189bfe6b5f07e5935860
[]
no_license
sncap21/kscWebProject
a33526cf673113327e0c9658b12ca99c0adaf84f
0c387a5d95f78f0040c0c51f9813e62865035d64
refs/heads/master
2020-03-22T10:49:15.652066
2018-07-09T02:54:06
2018-07-09T02:54:06
139,928,958
0
0
null
null
null
null
UTF-8
Java
false
false
166
java
package junitExam; public class Calculator { public int add(int a, int b) { return a+b; } public int minus(int a, int b) { return a-b; } }
[ "40551530+sncap21@users.noreply.github.com" ]
40551530+sncap21@users.noreply.github.com
2a6295a01bfc4fd210a50a7626fd01e70f0e2185
60cf13afc293b0724150930c1532d8ce02a227d0
/mc-deployer/src/main/java/org/jboss/switchboard/mc/deployer/EJBEnvironmentENCOperatorDeployer.java
69734675c3753d9f9eee8f8f41900d3a52c48301
[]
no_license
alesj/jboss-switchboard
5217c3dc25b967ee9719f33f87ae34d2948d3395
f2b4f38a1404aa1aaab113aeb0de9b568954625d
refs/heads/master
2021-01-17T06:05:03.811721
2010-10-04T11:36:55
2010-10-04T11:36:55
null
0
0
null
null
null
null
UTF-8
Java
false
false
2,974
java
/* * JBoss, Home of Professional Open Source. * Copyright 2009, Red Hat Middleware LLC, and individual contributors * as indicated by the @author tags. See the copyright.txt file in the * distribution for a full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.switchboard.mc.deployer; import java.util.ArrayList; import java.util.Collection; import org.jboss.beans.metadata.spi.BeanMetaData; import org.jboss.deployers.spi.DeploymentException; import org.jboss.deployers.structure.spi.DeploymentUnit; import org.jboss.metadata.ejb.jboss.JBossEnterpriseBeanMetaData; import org.jboss.metadata.ejb.jboss.JBossMetaData; import org.jboss.metadata.ejb.spec.InterceptorMetaData; import org.jboss.metadata.ejb.spec.InterceptorsMetaData; import org.jboss.metadata.javaee.spec.Environment; import org.jboss.reloaded.naming.deployers.javaee.JavaEEComponentInformer; /** * EJBEnvironmentENCOperatorDeployer * * @author Jaikiran Pai * @version $Revision: $ */ public class EJBEnvironmentENCOperatorDeployer extends AbstractENCOperatorDeployer { public EJBEnvironmentENCOperatorDeployer(JavaEEComponentInformer informer) { super(informer); setComponentsOnly(true); setInput(JBossEnterpriseBeanMetaData.class); setOutput(BeanMetaData.class); } @Override protected void internalDeploy(DeploymentUnit unit) throws DeploymentException { JBossEnterpriseBeanMetaData beanMetaData = unit.getAttachment(JBossEnterpriseBeanMetaData.class); if (beanMetaData == null) { return; } // We only work for EJB 3.x session beans if (!beanMetaData.getJBossMetaData().isEJB3x()) { return; } Collection<Environment> environments = new ArrayList<Environment>(); environments.add(beanMetaData); // interceptors InterceptorsMetaData interceptors = JBossMetaData.getInterceptors(beanMetaData.getEjbName(), beanMetaData.getJBossMetaData()); if (interceptors != null) { for (InterceptorMetaData interceptor : interceptors) { environments.add(interceptor); } } this.process(unit, environments); } }
[ "jaikiran.pai@gmail.com" ]
jaikiran.pai@gmail.com
713c73b3e645b50a61795c42f4c21b2412805093
20eb62855cb3962c2d36fda4377dfd47d82eb777
/newEvaluatedBugs/Mockito_30_buggy/mutated/106/StackTraceFilter.java
0b388b7f1d1de7e4223e74387bb37805b4a01785
[]
no_license
ozzydong/CapGen
356746618848065cce4e253e5d3c381baa85044a
0ba0321b6b1191443276021f1997833342f02515
refs/heads/master
2023-03-18T20:12:02.923428
2020-08-21T03:08:28
2020-08-21T03:08:28
null
0
0
null
null
null
null
UTF-8
Java
false
false
2,174
java
/* * Copyright (c) 2007 Mockito contributors * This program is made available under the terms of the MIT License. */ package org.mockito.internal.exceptions.base; import java.io.Serializable; import java.util.ArrayList; import java.util.Arrays; import java.util.LinkedList; import java.util.List; public class StackTraceFilter implements Serializable { static final long serialVersionUID = -5499819791513105700L; public boolean isBad(StackTraceElement e) { boolean fromMockObject = e.getClassName().contains("$$EnhancerByMockitoWithCGLIB$$"); boolean fromOrgMockito = e.getClassName().startsWith("org.mockito."); boolean isRunner = e.getClassName().startsWith("org.mockito.runners."); boolean isInternalRunner = e.getClassName().startsWith("org.mockito.internal.runners."); return !isInternalRunner; } /** * Example how the filter works (+/- means good/bad): * [a+, b+, c-, d+, e+, f-, g+] -> [a+, b+, g+] * Basically removes all bad from the middle. If any good are in the middle of bad those are also removed. */ public StackTraceElement[] filter(StackTraceElement[] target, boolean keepTop) { //TODO: after 1.8 profile List<StackTraceElement> unfilteredStackTrace = Arrays.asList(target); int lastBad = -1; int firstBad = -1; for (int i = 0; i < unfilteredStackTrace.size(); i++) { if (!this.isBad(unfilteredStackTrace.get(i))) { continue; } lastBad = i; if (firstBad == -1) { firstBad = i; } } List<StackTraceElement> top; if (keepTop && firstBad != -1) { top = unfilteredStackTrace.subList(0, firstBad); } else { top = new LinkedList<StackTraceElement>(); } List<StackTraceElement> bottom = unfilteredStackTrace.subList(lastBad + 1, unfilteredStackTrace.size()); List<StackTraceElement> filtered = new ArrayList<StackTraceElement>(top); filtered.addAll(bottom); return filtered.toArray(new StackTraceElement[]{}); } }
[ "justinwm@163.com" ]
justinwm@163.com
9cc00ebe1615af735d59503c0eba1cc26fc71d24
41fab79642bf3a1600d72a98864719eca8f16748
/web-trade-admin/src/main/java/com/seamwhole/webtradeadmin/info/GoodsSpecification.java
20f371f7e1002c5a5623e2691a53443bb72bc3e7
[]
no_license
HuangRicher/ieshop
ad1a3f9bb0d9797b871efbbf2009dc7f53f71eb0
b2fa4887a235a63f9368421ec70a1c59cdc47d7b
refs/heads/master
2020-04-30T15:59:38.229048
2019-05-18T10:02:45
2019-05-18T10:02:45
176,936,000
1
1
null
null
null
null
UTF-8
Java
false
false
1,032
java
package com.seamwhole.webtradeadmin.info; public class GoodsSpecification { private Integer id; private Integer goodsId; private Integer specificationId; private String value; private String picUrl; public Integer getId() { return id; } public void setId(Integer id) { this.id = id; } public Integer getGoodsId() { return goodsId; } public void setGoodsId(Integer goodsId) { this.goodsId = goodsId; } public Integer getSpecificationId() { return specificationId; } public void setSpecificationId(Integer specificationId) { this.specificationId = specificationId; } public String getValue() { return value; } public void setValue(String value) { this.value = value == null ? null : value.trim(); } public String getPicUrl() { return picUrl; } public void setPicUrl(String picUrl) { this.picUrl = picUrl == null ? null : picUrl.trim(); } }
[ "huangweibiao@instoms.cn" ]
huangweibiao@instoms.cn
8a11c289c3ced48c0cd5596bd46365f82f096d86
4627d514d6664526f58fbe3cac830a54679749cd
/results/evosuite5/time-org.joda.time.chrono.IslamicChronology-9/org/joda/time/chrono/IslamicChronology_ESTest.java
62cf3b8d9ffab6c26092bdcbb6621ee6363e4bd6
[]
no_license
STAMP-project/Cling-application
c624175a4aa24bb9b29b53f9b84c42a0f18631bd
0ff4d7652b434cbfd9be8d8bb38cfc8d8eaa51b5
refs/heads/master
2022-07-27T09:30:16.423362
2022-07-19T12:01:46
2022-07-19T12:01:46
254,310,667
2
2
null
2021-07-12T12:29:50
2020-04-09T08:11:35
null
UTF-8
Java
false
false
661
java
/* * This file was automatically generated by EvoSuite * Wed Jul 24 00:37:53 GMT 2019 */ package org.joda.time.chrono; import org.junit.Test; import static org.junit.Assert.*; import org.evosuite.runtime.EvoRunner; import org.evosuite.runtime.EvoRunnerParameters; import org.junit.runner.RunWith; @RunWith(EvoRunner.class) @EvoRunnerParameters(mockJVMNonDeterminism = true, useVFS = true, useVNET = true, resetStaticState = true, separateClassLoader = false, useJEE = true) public class IslamicChronology_ESTest extends IslamicChronology_ESTest_scaffolding { @Test public void notGeneratedAnyTest() { // EvoSuite did not generate any tests } }
[ "pouria.derakhshanfar@gmail.com" ]
pouria.derakhshanfar@gmail.com
897aff10f5acfdb7aa75d8e3afea5bcaa706d0c1
2d3466787dd1dc96b3d7336ada96f71cf1b56898
/online/src/main/java/com/bing/vo/CartOrderItemVO.java
20c8d6f6457d8d646b69418d94469378abe02e84
[]
no_license
LIMYOONA90yun/FY2016-JAVA02
eb7ab316074486a3ae95810835dd57d63854184c
22ada1532c3f8da1a877275ec62d4743c9528ee5
refs/heads/master
2022-11-20T23:04:22.786677
2019-06-13T00:46:40
2019-06-13T00:46:40
176,681,099
0
0
null
2022-11-16T10:31:44
2019-03-20T07:45:07
Java
UTF-8
Java
false
false
772
java
package com.bing.vo; import java.math.BigDecimal; import java.util.List; public class CartOrderItemVO { private List<OrderItemVO> orderItemVOList; private String imageHost; private BigDecimal totalPrice; public List<OrderItemVO> getOrderItemVOList() { return orderItemVOList; } public void setOrderItemVOList(List<OrderItemVO> orderItemVOList) { this.orderItemVOList = orderItemVOList; } public String getImageHost() { return imageHost; } public void setImageHost(String imageHost) { this.imageHost = imageHost; } public BigDecimal getTotalPrice() { return totalPrice; } public void setTotalPrice(BigDecimal totalPrice) { this.totalPrice = totalPrice; } }
[ "13180526919@163.com" ]
13180526919@163.com
2538d10eb6c0d2a9a329a54d13c8878df5dd7101
fa91450deb625cda070e82d5c31770be5ca1dec6
/Diff-Raw-Data/4/4_57c5050322afacad71c8155df974582190543022/package-info/4_57c5050322afacad71c8155df974582190543022_package-info_t.java
106f1816e73e4812f45f5a0f031c3591e13286da
[]
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
302
java
/* * Generated by src/saveVersion.sh */ @HadoopVersionAnnotation(version="1.2.2-SNAPSHOT", revision="", user="johnugeorge", date="Thu Jan 9 19:51:22 CST 2014", url="", srcChecksum="d8ebe93cabd61ff9c827aa9e9fba3e6c") package org.apache.hadoop;
[ "yuzhongxing88@gmail.com" ]
yuzhongxing88@gmail.com
57c3554dad9fb3f8970b70498c360ec0e7b0c56c
5d9d82379bacfe53e38738a230256ebcdf0cb36f
/src/lf/user/dao/DaoFactory.java
1fd3e70ba635c29e79bd22850183abda5025873e
[]
no_license
llifei/Regist-Login
a1ab39eead10d7d84fbfdec9e8f3b129013d9e3d
071daf0615f5da5affd4ed01fc56316ec23f7779
refs/heads/master
2020-05-26T01:19:53.434521
2019-05-22T14:49:20
2019-05-22T14:49:20
188,033,978
0
0
null
null
null
null
UTF-8
Java
false
false
1,177
java
package lf.user.dao; import lf.user.domain.User; import java.io.InputStream; import java.util.Properties; public class DaoFactory { private static Properties props=null; static{ //加载配置文件内容到props对象中 try { InputStream in=DaoFactory.class.getClassLoader().getResourceAsStream("dao.properties"); props=new Properties(); props.load(in); }catch (Exception e){ throw new RuntimeException(e); } } /** * 返回一个具体UseDao的实现类对象 * @return */ public static UserDao getUserDao() { /** * 给出一个配置文件,文件中给出UserDao接口的实现类名称 * 这个方法获取实现类的类名,通过反射完成创建对象 */ String daoClassName=props.getProperty("lf.user.dao.UserDao"); /** * 通过反射来创建实现类的对象 */ try { Class clazz = Class.forName(daoClassName); return (UserDao) clazz.newInstance(); }catch (Exception e){ throw new RuntimeException(e); } } }
[ "1103177608@qq.com" ]
1103177608@qq.com
e06b45675888a32b357731aed1702a9a724b35e9
ac2cfb0e101917274974bb614adea3cbc2813aaa
/ProyectoAYDAdminVic/src/mx/uam/ayd/proyecto/negocio/ServicioAlmacenImpl.java
636d70eba71ed7ae806360924d717f63760d7ffe
[]
no_license
ErickESC/AdmInVic
b64b90bd8f49ec5c7b4265ec439b6a13c356426a
29c480221f7483060b8cfe569b796787e406ff33
refs/heads/master
2021-06-30T10:53:41.657968
2021-02-24T19:17:38
2021-02-24T19:17:38
223,452,474
0
3
null
2021-02-24T19:19:08
2019-11-22T17:24:39
Java
UTF-8
Java
false
false
4,626
java
/** * */ package mx.uam.ayd.proyecto.negocio; import java.sql.Date; import java.sql.Timestamp; import java.time.LocalDate; import java.time.LocalTime; import java.util.ArrayList; import java.util.Calendar; import java.util.HashMap; import com.sun.javafx.collections.MappingChange.Map; import mx.uam.ayd.proyecto.datos.DAOArticulo; import mx.uam.ayd.proyecto.datos.DAOArticuloEnAlmacen; import mx.uam.ayd.proyecto.negocio.dominio.Articulo; import mx.uam.ayd.proyecto.negocio.dominio.ArticuloEnAlmacen; /** * @author erick * */ public class ServicioAlmacenImpl implements ServicioAlmacen { private DAOArticuloEnAlmacen daoAlmacen; private DAOArticulo daoArticulo; public ServicioAlmacenImpl(DAOArticuloEnAlmacen dao, DAOArticulo daoArticulo) { // Creamos conexion al DAO this.daoAlmacen = dao; this.daoArticulo=daoArticulo; } /** * Recupera un ArticuloEnAlmacen a partir de su nombre * * @param nombre * @return ArticuloEnAlmacen o null */ @Override public ArticuloEnAlmacen buscaArticuloEnAlmacen(String id) { return daoAlmacen.recupera(id); } /** * Permite agregar un ArticuloEnAlmacen mientras no exista ya un ArticuloEnAlmacen con el mismo id * * @param id * @return true si se agrego correctamente, false si no */ @Override public boolean agregaArticuloEnAlmacen(String id, Date fechaRegistro, Timestamp fechaPartida, int articulosTotales) { // Regla de negocio: RN-01 no puede haber dos libros con el mismo nombre if(daoAlmacen.recupera(id) != null) return false; ArticuloEnAlmacen articulo=new ArticuloEnAlmacen(id, fechaRegistro, fechaPartida, articulosTotales); daoAlmacen.crea(articulo); return true; } /** * Permite eliminar un ArticuloEnAlmacen * * @param id * @return true si se elimino correctamente, false si no */ @Override public boolean eliminaArticuloEnAlmacen(String id) { Date k = null; Timestamp t = null; ArticuloEnAlmacen articulo=new ArticuloEnAlmacen(id, k, t, 1); if(daoAlmacen.borra(articulo) == true) return true; return false; } /** * Permite actualizar un ArticuloEnAlmacen mientras exista ya un ArticuloEnAlmacen con el mismo id * * @param id * @return true si se actualizo correctamente, false si no */ @Override public boolean atualizaArticuloEnAlmacen(String id, Date fechaRegistro, Timestamp fechaPartida, int articulosTotales) { if(daoAlmacen.recupera(id) != null) return false; ArticuloEnAlmacen articulo=new ArticuloEnAlmacen(id, fechaRegistro, fechaPartida, articulosTotales); daoAlmacen.crea(articulo); return true; } /** * Permite recuperar los ArticuloEnAlmacen * * @return arreglo con ArticuloEnAlmacen */ @Override public ArrayList<ArticuloEnAlmacen> dameArticuloEnAlmacen() { ArrayList<ArticuloEnAlmacen> lista=daoAlmacen.recuperaTodos(); return lista; } /** * Permite recuperar los ArticuloEnAlmacen registrados dentro de un lapso * * @return arreglo con ArticuloEnAlmacen */ @Override public java.util.Map<Articulo, String> consultaRezago(Date max, Date min) { ArrayList<ArticuloEnAlmacen> lapso=daoAlmacen.recuperaLapso(max, min); ArrayList<Articulo> articulos=new ArrayList<Articulo>(); java.util.Map <Articulo, String> descuento=new HashMap <Articulo, String>(); //Llamamos a DAOArticulo para conocer los precios de los articulos requeridos //Llenamos un arreglo de articulos para poder realizar la logica de negocio for(int i=0; i<lapso.size();i++) { articulos.add(daoArticulo.recupera(lapso.get(i).getIdArticulo())); } for(int i=0; i<articulos.size();i++) { LocalDate hoy = LocalDate.now(); hoy.getMonthValue(); int desc=hoy.getMonthValue()-lapso.get(i).getFechaLlegada().getMonth(); int anio=hoy.getYear()-lapso.get(i).getFechaLlegada().getYear(); /* * Logica de negocio que obedece la regla NO-6 */ if(desc<5) { if(desc<0) { desc=desc+(-1); }//considerando si checas en enero y registraste algo en diciembre double porcentaje=desc*0.05; double precio=articulos.get(i).getPrecioVenta(); double precioDesc = precio-(precio*porcentaje); String descuentoHecho=Double.toString(precioDesc); descuento.put(articulos.get(i), descuentoHecho); }else { double porcentaje=0.4; double precio=articulos.get(i).getPrecioVenta(); double precioDesc = precio-(precio*porcentaje); String descuentoHecho=Double.toString(precioDesc); descuento.put(articulos.get(i), descuentoHecho); } } return descuento; } }
[ "erick@jarvis" ]
erick@jarvis
8f745544f506e443d871e25c87b80e6eaf14fba6
50c937c8a203a5ca3a26f70980173a5a898da9e3
/l2gw-core/highfive/gameserver/java/ru/l2gw/gameserver/model/ClanWarehouse.java
0eb6ae75e189da83e5d9ad8b14baa729dc963cb7
[]
no_license
gokusgit/hi5
b336cc8bf96b74cbd9419253444cf0a7df71a2fb
0345266a3cb3059b3e4e5ec31b59690af36e07fd
refs/heads/master
2020-07-10T23:33:14.500298
2019-08-26T07:41:18
2019-08-26T07:41:18
204,398,114
0
1
null
null
null
null
UTF-8
Java
false
false
1,016
java
package ru.l2gw.gameserver.model; import ru.l2gw.gameserver.model.instances.L2ItemInstance.ItemLocation; public final class ClanWarehouse extends Warehouse { private L2Clan _clan; public ClanWarehouse(L2Clan clan) { _clan = clan; } @Override public int getOwnerId() { return _clan.getClanId(); } @Override public L2Character getOwner() { return _clan.getLeader().getPlayer(); } @Override public ItemLocation getLocationType() { return ItemLocation.CLANWH; } @Override protected ItemLocation getBaseLocation() { return ItemLocation.CLANWH; } @Override protected ItemLocation getEquipLocation() { return ItemLocation.CLANWH; } @Override public String getLocationId() { return "0"; } @Override public byte getLocationId(@SuppressWarnings("unused") boolean dummy) { return 0; } @Override public void setLocationId(@SuppressWarnings("unused") L2Player dummy) {} @Override public final WarehouseType getWarehouseType() { return WarehouseType.CLAN; } }
[ "46629361+gokusgit@users.noreply.github.com" ]
46629361+gokusgit@users.noreply.github.com
a363ba7c42ac224522699111d0241b6c53f1738a
6374c09fa57dd32d50461c7f1a802f7314b59efa
/3 Tercero/ASDM/MDD/Clase_0106/src/Clase_0106/impl/ConexionImpl.java
a4d886408d63017cdbffa7f762d46501a6c84865
[]
no_license
PeterBanning/ETSIcode
7e2a9e0e37a84973b1dc60824287a0330dbf8b6a
477d3e8bf5fd5dc6057623f2e7320f029e19952d
refs/heads/master
2023-08-29T22:08:06.660843
2021-11-15T19:38:45
2021-11-15T19:38:45
null
0
0
null
null
null
null
UTF-8
Java
false
false
9,658
java
/** */ package Clase_0106.impl; import Clase_0106.Clase_0106Package; import Clase_0106.Conexion; import Clase_0106.Nodo; import org.eclipse.emf.common.notify.Notification; import org.eclipse.emf.common.notify.NotificationChain; import org.eclipse.emf.ecore.EClass; import org.eclipse.emf.ecore.InternalEObject; import org.eclipse.emf.ecore.impl.ENotificationImpl; import org.eclipse.emf.ecore.impl.EObjectImpl; /** * <!-- begin-user-doc --> * An implementation of the model object '<em><b>Conexion</b></em>'. * <!-- end-user-doc --> * <p> * The following features are implemented: * </p> * <ul> * <li>{@link Clase_0106.impl.ConexionImpl#getNombre <em>Nombre</em>}</li> * <li>{@link Clase_0106.impl.ConexionImpl#getOrigen <em>Origen</em>}</li> * <li>{@link Clase_0106.impl.ConexionImpl#getDestino <em>Destino</em>}</li> * </ul> * * @generated */ public class ConexionImpl extends EObjectImpl implements Conexion { /** * The default value of the '{@link #getNombre() <em>Nombre</em>}' attribute. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @see #getNombre() * @generated * @ordered */ protected static final String NOMBRE_EDEFAULT = null; /** * The cached value of the '{@link #getNombre() <em>Nombre</em>}' attribute. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @see #getNombre() * @generated * @ordered */ protected String nombre = NOMBRE_EDEFAULT; /** * The cached value of the '{@link #getOrigen() <em>Origen</em>}' reference. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @see #getOrigen() * @generated * @ordered */ protected Nodo origen; /** * The cached value of the '{@link #getDestino() <em>Destino</em>}' reference. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @see #getDestino() * @generated * @ordered */ protected Nodo destino; /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ protected ConexionImpl() { super(); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ @Override protected EClass eStaticClass() { return Clase_0106Package.Literals.CONEXION; } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public String getNombre() { return nombre; } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public void setNombre(String newNombre) { String oldNombre = nombre; nombre = newNombre; if (eNotificationRequired()) eNotify(new ENotificationImpl(this, Notification.SET, Clase_0106Package.CONEXION__NOMBRE, oldNombre, nombre)); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public Nodo getOrigen() { if (origen != null && origen.eIsProxy()) { InternalEObject oldOrigen = (InternalEObject)origen; origen = (Nodo)eResolveProxy(oldOrigen); if (origen != oldOrigen) { if (eNotificationRequired()) eNotify(new ENotificationImpl(this, Notification.RESOLVE, Clase_0106Package.CONEXION__ORIGEN, oldOrigen, origen)); } } return origen; } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public Nodo basicGetOrigen() { return origen; } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public NotificationChain basicSetOrigen(Nodo newOrigen, NotificationChain msgs) { Nodo oldOrigen = origen; origen = newOrigen; if (eNotificationRequired()) { ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, Clase_0106Package.CONEXION__ORIGEN, oldOrigen, newOrigen); if (msgs == null) msgs = notification; else msgs.add(notification); } return msgs; } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public void setOrigen(Nodo newOrigen) { if (newOrigen != origen) { NotificationChain msgs = null; if (origen != null) msgs = ((InternalEObject)origen).eInverseRemove(this, Clase_0106Package.NODO__SALIENTE, Nodo.class, msgs); if (newOrigen != null) msgs = ((InternalEObject)newOrigen).eInverseAdd(this, Clase_0106Package.NODO__SALIENTE, Nodo.class, msgs); msgs = basicSetOrigen(newOrigen, msgs); if (msgs != null) msgs.dispatch(); } else if (eNotificationRequired()) eNotify(new ENotificationImpl(this, Notification.SET, Clase_0106Package.CONEXION__ORIGEN, newOrigen, newOrigen)); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public Nodo getDestino() { if (destino != null && destino.eIsProxy()) { InternalEObject oldDestino = (InternalEObject)destino; destino = (Nodo)eResolveProxy(oldDestino); if (destino != oldDestino) { if (eNotificationRequired()) eNotify(new ENotificationImpl(this, Notification.RESOLVE, Clase_0106Package.CONEXION__DESTINO, oldDestino, destino)); } } return destino; } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public Nodo basicGetDestino() { return destino; } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public NotificationChain basicSetDestino(Nodo newDestino, NotificationChain msgs) { Nodo oldDestino = destino; destino = newDestino; if (eNotificationRequired()) { ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, Clase_0106Package.CONEXION__DESTINO, oldDestino, newDestino); if (msgs == null) msgs = notification; else msgs.add(notification); } return msgs; } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public void setDestino(Nodo newDestino) { if (newDestino != destino) { NotificationChain msgs = null; if (destino != null) msgs = ((InternalEObject)destino).eInverseRemove(this, Clase_0106Package.NODO__ENTRANTE, Nodo.class, msgs); if (newDestino != null) msgs = ((InternalEObject)newDestino).eInverseAdd(this, Clase_0106Package.NODO__ENTRANTE, Nodo.class, msgs); msgs = basicSetDestino(newDestino, msgs); if (msgs != null) msgs.dispatch(); } else if (eNotificationRequired()) eNotify(new ENotificationImpl(this, Notification.SET, Clase_0106Package.CONEXION__DESTINO, newDestino, newDestino)); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ @Override public NotificationChain eInverseAdd(InternalEObject otherEnd, int featureID, NotificationChain msgs) { switch (featureID) { case Clase_0106Package.CONEXION__ORIGEN: if (origen != null) msgs = ((InternalEObject)origen).eInverseRemove(this, Clase_0106Package.NODO__SALIENTE, Nodo.class, msgs); return basicSetOrigen((Nodo)otherEnd, msgs); case Clase_0106Package.CONEXION__DESTINO: if (destino != null) msgs = ((InternalEObject)destino).eInverseRemove(this, Clase_0106Package.NODO__ENTRANTE, Nodo.class, msgs); return basicSetDestino((Nodo)otherEnd, msgs); } return super.eInverseAdd(otherEnd, featureID, msgs); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ @Override public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) { switch (featureID) { case Clase_0106Package.CONEXION__ORIGEN: return basicSetOrigen(null, msgs); case Clase_0106Package.CONEXION__DESTINO: return basicSetDestino(null, msgs); } return super.eInverseRemove(otherEnd, featureID, msgs); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ @Override public Object eGet(int featureID, boolean resolve, boolean coreType) { switch (featureID) { case Clase_0106Package.CONEXION__NOMBRE: return getNombre(); case Clase_0106Package.CONEXION__ORIGEN: if (resolve) return getOrigen(); return basicGetOrigen(); case Clase_0106Package.CONEXION__DESTINO: if (resolve) return getDestino(); return basicGetDestino(); } return super.eGet(featureID, resolve, coreType); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ @Override public void eSet(int featureID, Object newValue) { switch (featureID) { case Clase_0106Package.CONEXION__NOMBRE: setNombre((String)newValue); return; case Clase_0106Package.CONEXION__ORIGEN: setOrigen((Nodo)newValue); return; case Clase_0106Package.CONEXION__DESTINO: setDestino((Nodo)newValue); return; } super.eSet(featureID, newValue); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ @Override public void eUnset(int featureID) { switch (featureID) { case Clase_0106Package.CONEXION__NOMBRE: setNombre(NOMBRE_EDEFAULT); return; case Clase_0106Package.CONEXION__ORIGEN: setOrigen((Nodo)null); return; case Clase_0106Package.CONEXION__DESTINO: setDestino((Nodo)null); return; } super.eUnset(featureID); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ @Override public boolean eIsSet(int featureID) { switch (featureID) { case Clase_0106Package.CONEXION__NOMBRE: return NOMBRE_EDEFAULT == null ? nombre != null : !NOMBRE_EDEFAULT.equals(nombre); case Clase_0106Package.CONEXION__ORIGEN: return origen != null; case Clase_0106Package.CONEXION__DESTINO: return destino != null; } return super.eIsSet(featureID); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ @Override public String toString() { if (eIsProxy()) return super.toString(); StringBuilder result = new StringBuilder(super.toString()); result.append(" (nombre: "); result.append(nombre); result.append(')'); return result.toString(); } } //ConexionImpl
[ "borjainlive@gmail.com" ]
borjainlive@gmail.com
fa360bd677d73ad73982d8146327963dc1018b3e
7db1bedbde6a63fb6669f8da089ca21e119ac989
/src/com/yuntongxun/ecdemo/ui/chatting/view/SmileyPanel.java
1111482ebb6ab01d40d30eeddc2a6d5f941a8ad1
[ "Apache-2.0" ]
permissive
hairlun/radix-android
31ef4551d03fb7df7b269e5b4823014edbe26a72
fd9c0206c689ad5d274582f2513f481bc4a9364c
refs/heads/master
2020-05-21T20:09:28.453871
2016-12-22T02:49:17
2016-12-22T02:49:17
60,959,762
0
1
null
null
null
null
UTF-8
Java
false
false
8,200
java
/* * Copyright (c) 2013 The CCP project authors. All Rights Reserved. * * Use of this source code is governed by a Beijing Speedtong Information Technology Co.,Ltd license * that can be found in the LICENSE file in the root of the web site. * * http://www.yuntongxun.com * * An additional intellectual property rights grant can be found * in the file PATENTS. All contributing project authors may * be found in the AUTHORS file in the root of the source tree. */ package com.yuntongxun.ecdemo.ui.chatting.view; import android.content.Context; import android.content.res.Configuration; import android.text.TextUtils; import android.util.AttributeSet; import android.view.Display; import android.view.View; import android.view.WindowManager; import android.widget.LinearLayout; import com.patr.radix.R; import com.yuntongxun.ecdemo.common.CCPAppManager; import com.yuntongxun.ecdemo.common.base.CCPDotView; import com.yuntongxun.ecdemo.common.base.CCPFlipper; import com.yuntongxun.ecdemo.common.utils.DensityUtil; import com.yuntongxun.ecdemo.common.utils.EmoticonUtil; import com.yuntongxun.ecdemo.common.utils.LogUtil; import java.util.ArrayList; import java.util.Iterator; /** * @author Jorstin Chan@容联•云通讯 * @date 2014-12-10 * @version 4.0 */ public class SmileyPanel extends ChatFooterPanel implements CCPFlipper.OnFlipperPageListener, CCPFlipper.OnCCPFlipperMeasureListener { private static int APP_PANEL_HEIGHT_LANDSCAPE = 122; private static int APP_PANEL_HEIGHT_PORTRAIT = 179; private int mDefaultVerticalSpacing = DensityUtil.fromDPToPix(CCPAppManager.getContext(), 48); /** * default App panel emoji. */ public static String APP_PANEL_NAME_DEFAULT = "emoji"; private Context mContext; private int mEmojiPanelHeight = -1 ; private WindowManager mWindowManager; private CCPFlipper mFlipper; private CCPDotView mDotView; private ArrayList<EmojiGrid> mArrayList; private boolean mInitPanelHeight; /** * @param context * @param attrs */ public SmileyPanel(Context context, AttributeSet attrs) { super(context, attrs); mContext = context; inflate(context, R.layout.ccp_smile_panel, this); mFlipper = ((CCPFlipper) findViewById(R.id.smiley_panel_flipper)); mDotView = ((CCPDotView) findViewById(R.id.smiley_panel_dot)); initEmojiPanel(); } /** * init {@link com.yuntongxun.ecdemo.ui.chatting.view.SmileyPanel} Child View * {@link EmojiGrid} */ private void initEmojiPanel(){ LogUtil.d(LogUtil.getLogUtilsTag(getClass()), "initEmojiPanel"); mFlipper.removeAllViews(); mFlipper.setOnFlipperListner(this); mFlipper.setOnCCPFlipperMeasureListener(this); mInitPanelHeight = true; View smileyPanelDisplayView = findViewById(R.id.smiley_panel_display_view); LinearLayout.LayoutParams layoutParams = (LayoutParams) smileyPanelDisplayView.getLayoutParams(); if(getWindowDisplayMode() == 2) { layoutParams.height = DensityUtil.getMetricsDensity(getContext(), APP_PANEL_HEIGHT_LANDSCAPE); } else { int panelHeight = DensityUtil.getMetricsDensity(getContext(), APP_PANEL_HEIGHT_PORTRAIT); if(mEmojiPanelHeight > 0) { panelHeight = mEmojiPanelHeight; } layoutParams.height = panelHeight; } smileyPanelDisplayView.setLayoutParams(layoutParams); if(mArrayList != null && mArrayList.size() > 0) { Iterator<EmojiGrid> iterator = mArrayList.iterator(); while (iterator.hasNext()) { EmojiGrid emojiGrid = (EmojiGrid) iterator.next(); if(emojiGrid != null) emojiGrid.releaseEmojiView(); } mArrayList.clear(); } } private int getWindowDisplayMode() { if(mWindowManager == null ) { mWindowManager = (WindowManager) mContext.getSystemService(Context.WINDOW_SERVICE); } Display localDisplay = mWindowManager.getDefaultDisplay(); return localDisplay.getWidth() < localDisplay.getHeight() ? Configuration.ORIENTATION_PORTRAIT : Configuration.ORIENTATION_LANDSCAPE; } public void swicthToPanel(String panelName) { LogUtil.d("AppPanel.swicthToPanel panelName: " + panelName); setVisibility(View.VISIBLE); if(TextUtils.isEmpty(panelName)) { return ; } if(mArrayList == null) { mArrayList = new ArrayList<EmojiGrid>(); } if(APP_PANEL_NAME_DEFAULT.equals(panelName)) { doEmoji(mArrayList); } } private int getSmileyPanelVerticalSpacing() { if(getWindowDisplayMode() != 2) { return (mEmojiPanelHeight - (3 * mDefaultVerticalSpacing)) / (4); } return (APP_PANEL_HEIGHT_LANDSCAPE - (2 * mDefaultVerticalSpacing)) / (3); } /** * @param mArrayList */ private void doEmoji(ArrayList<EmojiGrid> mArrayList) { mFlipper.removeAllViews(); if(mArrayList == null || mArrayList.size() <= 0) { doEmoji(); return; } Iterator<EmojiGrid> iterator = mArrayList.iterator(); while (iterator.hasNext()) { EmojiGrid emojiGrid = (EmojiGrid) iterator.next(); mFlipper.addView(emojiGrid, new LinearLayout.LayoutParams( LinearLayout.LayoutParams.MATCH_PARENT, LinearLayout.LayoutParams.MATCH_PARENT)); emojiGrid.setOnEmojiItemClickListener(mItemClickListener); } if(mArrayList.size() <= 1) { mDotView.setVisibility(View.INVISIBLE); return; } mDotView.setVisibility(View.VISIBLE); mDotView.setDotCount(mArrayList.size()); mDotView.setSelectedDot(mFlipper.getVisiableIndex()); } private void doEmoji() { mFlipper.removeAllViews(); int pageCount = (int) Math.ceil(EmoticonUtil.getInstace().getEmojiSize() / 20 + 0.1); LogUtil.d("AppPanel.doEmoji emoji total pageCount :" + pageCount ); for (int i = 0; i < pageCount; i++) { EmojiGrid emojiGrid = new EmojiGrid(getContext()); emojiGrid.initEmojiGrid(20, i, pageCount, i + 1, 7, getWidth()); emojiGrid.setOnEmojiItemClickListener(mItemClickListener); mFlipper.addView(emojiGrid, new LinearLayout.LayoutParams( LinearLayout.LayoutParams.MATCH_PARENT, LinearLayout.LayoutParams.MATCH_PARENT)); mFlipper.setInterceptTouchEvent(true); //int smileyPanelVerticalSpacing = getSmileyPanelVerticalSpacing(); //emojiGrid.setVerticalSpacing(smileyPanelVerticalSpacing); mArrayList.add(emojiGrid); } if(mArrayList.size() <= 1) { mDotView.setVisibility(View.INVISIBLE); return; } mDotView.setVisibility(View.VISIBLE); mDotView.setDotCount(pageCount); mDotView.setSelectedDot(0); } /** * Change the height of the panel * @param height */ public final void setPanelHeight(int height) { if(mEmojiPanelHeight == height) { return; } mEmojiPanelHeight = height; mInitPanelHeight = true; } /** * @param visibility */ public void setPanelGone() { mFlipper.removeAllViews(); mDotView.removeAllViews(); doChatTools(); } public void doChatTools() { setVisibility(View.GONE); } /** * release SmileyPanel view. */ public void releaseSmileyPanel() { setPanelGone(); mFlipper.setOnFlipperListner(null); mFlipper.setOnCCPFlipperMeasureListener(null); if(mArrayList != null && mArrayList.size() > 0) { Iterator<EmojiGrid> iterator = mArrayList.iterator(); while (iterator.hasNext()) { EmojiGrid emojiGrid = (EmojiGrid) iterator.next(); if(emojiGrid != null) emojiGrid.releaseEmojiView(); } mArrayList.clear(); } mFlipper = null; mDotView = null; } @Override public void onPause() { } @Override public void onResume() { swicthToPanel(APP_PANEL_NAME_DEFAULT); } /* (non-Javadoc) * @see com.hisun.cas.ui.base.im.ChatFooterPanel#onDestroy() */ @Override public void onDestroy() { super.onDestroy(); releaseSmileyPanel(); } @Override public void reset() { } @Override public void onCCPFlipperMeasure(int widthMeasureSpec, int heightMeasureSpec) { } @Override public void onFlipperPage(int startIndex, int finalIndex) { if(mDotView == null) { return; } if(finalIndex > mDotView.getDotCount()) { finalIndex = mDotView.getDotCount(); } mDotView.setSelectedDot(finalIndex); } /* (non-Javadoc) * @see com.hisun.cas.ui.base.im.ChatFooterPanel#setChatFooterPanelHeight(int) */ @Override public void setChatFooterPanelHeight(int height) { } }
[ "hairlun@qq.com" ]
hairlun@qq.com
77bd2b94754beb8b79a4682fb18cd868aaed859e
c891e0e7877ee9cc539f87233239d83f033167eb
/src/main/java/true_exam/alibaba/Solution1.java
f2fccfd7314770841f5c4cca29050b56653b2002
[]
no_license
DaveAimee/algorithm-learning
f1677a628e88911cf5425645225a53afe69e6316
ab14fea553443a5f1d44592cd36fc27dbb9b0d77
refs/heads/master
2023-07-27T23:40:11.044441
2021-09-07T05:21:18
2021-09-07T05:21:18
380,929,576
0
0
null
null
null
null
UTF-8
Java
false
false
764
java
package true_exam.alibaba; import java.util.Arrays; public class Solution1 { public static int[] solve(int[] nums,int target) { int size = nums.length; int[] prefixSum = new int[size+1]; for(int i=0;i<size;i++) { prefixSum[i+1] = nums[i] + prefixSum[i]; } for(int i=0;i<size;i++) { for(int j=i;j<size;j++) { int sum = prefixSum[j+1] - prefixSum[i]; if(sum == target) { int [] resultArray = Arrays.copyOfRange(nums, i, j+1); return resultArray; } } } return null; } public static void main(String[] args) { solve(new int[] {9,5,4,8,9,1}, 17).toString(); } }
[ "LotusRe@outlook.com" ]
LotusRe@outlook.com
e19d0a99a76425096f8434183222766416f7438e
4287d744962a434c1d42d70d8ed293069dc3e11c
/ArrayGenerator.java
527cd545abb6db5ad52610939e1236a5317ed6ad
[]
no_license
ProjAlg/Algo1
48226bfb647eb3c58bd8d580bd406852a8a75208
c660de425df7cad53daf01eba3ab1e0846be7f6a
refs/heads/master
2020-04-04T06:50:30.778915
2014-09-12T16:16:19
2014-09-12T16:16:19
null
0
0
null
null
null
null
UTF-8
Java
false
false
518
java
import java.util.Arrays; import java.util.List; import java.util.Random; /** * Created by caynan on 9/6/14. */ public class ArrayGenerator { public int[] arrayGen(int size) { int[] A = new int[size]; Random rand = new Random(); // Generate and inserts n elements into out array (n == size) for(int i = 0; i < size; i++) { A[i] = rand.nextInt(size); } // Sort array A Arrays.sort(A); // return sorted array return A; } }
[ "caynanvls@gmail.com" ]
caynanvls@gmail.com
969e36437d2fe93fa8386cb69cd0aa32a6eb30cd
7991e1b0e9043c51eef66ec5cb246d4b93b27a0d
/core-it-suite/src/test/java/org/apache/maven/it/MavenIT0135EjbLifecycleTest.java
bfa13d31d89db037f29b167c74bfc63bb6779883
[ "Apache-2.0" ]
permissive
srdo/maven-integration-testing
5d10dc6e532b3b883685296129294116243be8fa
5f320156b2af268e368cb95e54eadb0045ebea66
refs/heads/master
2020-08-12T01:57:23.897953
2019-08-23T21:42:19
2019-08-23T21:42:19
214,666,987
0
0
null
2019-10-12T15:07:49
2019-10-12T15:07:49
null
UTF-8
Java
false
false
2,236
java
package org.apache.maven.it; /* * 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. */ import org.apache.maven.it.Verifier; import org.apache.maven.it.util.ResourceExtractor; import java.io.File; /** * * @author Benjamin Bentmann * @version $Id$ */ public class MavenIT0135EjbLifecycleTest extends AbstractMavenIntegrationTestCase { public MavenIT0135EjbLifecycleTest() { super( "[2.0.0,)" ); } /** * Test default binding of goals for "ejb" lifecycle. */ public void testit0135() throws Exception { File testDir = ResourceExtractor.simpleExtractResources( getClass(), "/it0135" ); Verifier verifier = newVerifier( testDir.getAbsolutePath() ); verifier.deleteDirectory( "target" ); verifier.setAutoclean( false ); verifier.executeGoal( "deploy" ); verifier.assertFilePresent( "target/resources-resources.txt" ); verifier.assertFilePresent( "target/compiler-compile.txt" ); verifier.assertFilePresent( "target/resources-test-resources.txt" ); verifier.assertFilePresent( "target/compiler-test-compile.txt" ); verifier.assertFilePresent( "target/surefire-test.txt" ); verifier.assertFilePresent( "target/ejb-ejb.txt" ); verifier.assertFilePresent( "target/install-install.txt" ); verifier.assertFilePresent( "target/deploy-deploy.txt" ); verifier.verifyErrorFreeLog(); verifier.resetStreams(); } }
[ "bentmann@apache.org" ]
bentmann@apache.org
442ec4789808098e2ac0404d57da30f5aeed74f5
303486c21f25b5a418f0b3f2191e60a82b7c17ec
/gateway_server/src/test/java/com/faceit/cv_microservices/gateway_server/GatewayServerApplicationTests.java
be7552a799ad22a0260e52d7639f7d132151f47a
[]
no_license
AlexanderSV91/cv_microservices
8e10003ada39f67860db73e695dff2a425b3401e
b7c8f484ce45cd9a5659800dc3dc2a464deb63ca
refs/heads/master
2023-07-31T02:59:56.081384
2021-09-23T08:22:32
2021-09-23T08:22:32
355,939,638
2
0
null
null
null
null
UTF-8
Java
false
false
250
java
package com.faceit.cv_microservices.gateway_server; import org.junit.jupiter.api.Test; import org.springframework.boot.test.context.SpringBootTest; @SpringBootTest class GatewayServerApplicationTests { @Test void contextLoads() { } }
[ "alex.shalamov4@gmail.com" ]
alex.shalamov4@gmail.com
494fe3dbd3718fb6c744ba4579a5ced6de125055
198e91603595e06bab4dbc21666ab47d6aabc66b
/aws-java-sdk-resourcegroups/src/main/java/com/amazonaws/services/resourcegroups/model/BadRequestException.java
13ee12c33401168993d120fbedc2eb0463b4ee40
[ "Apache-2.0" ]
permissive
tkroman/aws-sdk-java
bf43d9d0b871a50703a2d62bc697d433f4b96823
83f1a7c1bef7bab8f809f5123275848678fb807b
refs/heads/master
2022-11-14T23:34:03.618136
2020-07-09T21:25:24
2020-07-09T21:25:24
279,563,375
0
0
Apache-2.0
2020-07-14T11:13:13
2020-07-14T11:13:12
null
UTF-8
Java
false
false
1,268
java
/* * Copyright 2015-2020 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.resourcegroups.model; import javax.annotation.Generated; /** * <p> * The request does not comply with validation rules that are defined for the request parameters. * </p> */ @Generated("com.amazonaws:aws-java-sdk-code-generator") public class BadRequestException extends com.amazonaws.services.resourcegroups.model.AWSResourceGroupsException { private static final long serialVersionUID = 1L; /** * Constructs a new BadRequestException with the specified error message. * * @param message * Describes the error encountered. */ public BadRequestException(String message) { super(message); } }
[ "" ]
51219983801df225e9eb421d8620e6f8efe7a8ef
43391a97aaf2f17c5fef94f1d6e6bf48274a1127
/gluxen-common/src/main/java/com/gluxen/common/base/BaseServiceMock.java
ed64caa6a032f0c618eeb5856a30e51cbee91fa3
[]
no_license
xihashao/gluxen-master
e40e41e1b50ecdcb9992f3bee882dad03263f89c
82cda93e036524db26df9ae403b4ee67c4b2c7e9
refs/heads/master
2021-01-01T18:47:05.565516
2017-07-26T15:14:54
2017-07-26T15:14:54
98,436,971
0
0
null
null
null
null
UTF-8
Java
false
false
2,391
java
package com.gluxen.common.base; import org.apache.ibatis.annotations.Param; import java.util.List; /** * 降级实现BaseService抽象类 * Created by ZhangShuzheng on 2017/02/14. */ public abstract class BaseServiceMock<Mapper, Record, Example> implements BaseService<Record, Example> { @Override public int countByExample(Example example) { return -1; } @Override public int deleteByExample(Example example) { return -1; } @Override public int deleteByPrimaryKey(Integer id) { return -1; } @Override public int insert(Record record) { return -1; } @Override public int insertSelective(Record record) { return -1; } @Override public List<Record> selectByExampleWithBLOBs(Example example) { return null; } @Override public List<Record> selectByExample(Example example) { return null; } @Override public List<Record> selectByExampleWithBLOBsForStartPage(Example example, Integer pageNum, Integer pageSize) { return null; } @Override public List<Record> selectByExampleForStartPage(Example example, Integer pageNum, Integer pageSize) { return null; } @Override public List<Record> selectByExampleWithBLOBsForOffsetPage(Example example, Integer offset, Integer limit) { return null; } @Override public List<Record> selectByExampleForOffsetPage(Example example, Integer offset, Integer limit) { return null; } @Override public Record selectFirstByExample(Example example) { return null; } @Override public Record selectFirstByExampleWithBLOBs(Example example) { return null; } @Override public Record selectByPrimaryKey(Integer id) { return null; } @Override public int updateByExampleSelective(@Param("record") Record record, @Param("example") Example example) { return -1; } @Override public int updateByExampleWithBLOBs(@Param("record") Record record, @Param("example") Example example) { return -1; } @Override public int updateByExample(@Param("record") Record record, @Param("example") Example example) { return -1; } @Override public int updateByPrimaryKeySelective(Record record) { return -1; } @Override public int updateByPrimaryKeyWithBLOBs(Record record) { return -1; } @Override public int updateByPrimaryKey(Record record) { return -1; } @Override public int deleteByPrimaryKeys(String ids) { return -1; } @Override public void initMapper() {} }
[ "xihashao@icloud.com" ]
xihashao@icloud.com
a359aa924a2256d18e762ca54625d2ac71d69c56
c518b60e072242816d5689aee99edcec8ddd8f1b
/java_service/src/main/java/gr/iti/mklab/reveal/util/Configuration.java
c0bfcd59e4a8b609212445c70cbb873f84ca07a7
[ "Apache-2.0" ]
permissive
jgera/image-forensics
60ea2398d3b24ad5b17b6d5562a21fb1c5c550d3
8a462e3231a8c44a0ec0b47102eb108e868db05f
refs/heads/master
2021-01-19T14:11:07.451014
2017-02-20T16:49:33
2017-02-20T16:49:33
88,132,679
1
0
null
2017-04-13T06:31:21
2017-04-13T06:31:21
null
UTF-8
Java
false
false
1,988
java
package gr.iti.mklab.reveal.util; import org.apache.commons.configuration.ConfigurationException; import org.apache.commons.configuration.PropertiesConfiguration; import java.io.IOException; import java.io.InputStream; import java.util.Properties; /** * Created by kandreadou on 2/2/15. */ public class Configuration { public static String INDEX_SERVICE_HOST; public static String MONGO_HOST; public static boolean ADD_SOCIAL_MEDIA; public static String MANIPULATION_REPORT_PATH; public static boolean PUBLISH_RABBITMQ; public static int NUM_TOTAL_THREADS; public static int NUM_GHOST_THREADS; public static long FORENSIC_PROCESS_TIMEOUT; public static int MAX_GHOST_IMAGE_SMALL_DIM; public static String HTTP_HOST; public static String MONGO_USER; public static String MONGO_PASS; public static String MONGO_URI; public static void load(InputStream stream) throws ConfigurationException, IOException { Properties conf = new Properties(); conf.load(stream); INDEX_SERVICE_HOST = conf.getProperty("indexServiceHost"); MONGO_HOST = conf.getProperty("mongoHost"); ADD_SOCIAL_MEDIA = Boolean.valueOf(conf.getProperty("getSocialMedia")); MANIPULATION_REPORT_PATH = conf.getProperty("manipulationReportPath"); PUBLISH_RABBITMQ = Boolean.parseBoolean(conf.getProperty("publish")); NUM_TOTAL_THREADS=Integer.parseInt(conf.getProperty("numTotalThreads")); NUM_GHOST_THREADS=Integer.parseInt(conf.getProperty("numGhostThreads")); FORENSIC_PROCESS_TIMEOUT=Long.parseLong(conf.getProperty("ForensicProcessTimeout")); MAX_GHOST_IMAGE_SMALL_DIM=Integer.parseInt(conf.getProperty("MaxGhostImageSmallDimension")); HTTP_HOST=conf.getProperty("httpHost"); MONGO_USER=conf.getProperty("mongouser"); MONGO_PASS=conf.getProperty("mongopass"); MONGO_URI="mongodb://"+MONGO_USER+":"+MONGO_PASS+"@"+MONGO_HOST+"/"; } }
[ "markzampoglou@gmail.com" ]
markzampoglou@gmail.com
87f5e20f0e2e05739b7ef5be803c4138e92fed3f
41780fef8c5b9445669f86a160760e47288cc552
/1-7-0 RELEASE/GraphicsDemo/src/graphics/demo/framework/implementation/AndroidPixmap.java
c6e20c1580bec085c4f51bdb355b88a01cc565d4
[]
no_license
BouncingSquaresNew/BouncingSquaresRepo
c9a6b19c3dcccd9295eca538868a0303d0e833a5
7305d56262c6069810d6c7f27e521eebb27766dd
refs/heads/master
2016-09-05T20:38:45.934270
2014-12-11T22:16:47
2014-12-11T22:16:47
27,877,308
0
0
null
2014-12-11T22:16:47
2014-12-11T15:15:31
Java
UTF-8
Java
false
false
770
java
package graphics.demo.framework.implementation; import graphics.demo.framework.Pixmap; import graphics.demo.framework.Graphics.PixmapFormat; import android.graphics.Bitmap; /* * With author's permission this framework was taken from Mario Zechner's * book "Beginning Android Games" */ public class AndroidPixmap implements Pixmap { Bitmap bitmap; PixmapFormat format; public AndroidPixmap(Bitmap bitmap, PixmapFormat format) { this.bitmap = bitmap; this.format = format; } @Override public int getWidth() { return bitmap.getWidth(); } @Override public int getHeight() { return bitmap.getHeight(); } @Override public PixmapFormat getFormat() { return format; } @Override public void dispose() { bitmap.recycle(); } }
[ "benedict.winchester@gmail.com" ]
benedict.winchester@gmail.com
12fe18003fb58722b78de243bb2dee1fa0261800
fe2e1899d4386118190ea958c4595b007a236814
/app/src/androidTest/java/com/man/toiletapp/ExampleInstrumentedTest.java
ed6497836c44dc72868e999a6de7f7630deaa3ec
[]
no_license
Qunfong/ToiletApp
3558f16487bb63218dca9f2de4c55f5417a816e6
55d1e1726b909c41e5da2c60c79052b78bd24cb3
refs/heads/master
2020-04-28T11:56:37.531227
2019-03-13T23:05:51
2019-03-13T23:05:51
175,259,803
0
0
null
null
null
null
UTF-8
Java
false
false
704
java
package com.man.toiletapp; import android.content.Context; import androidx.test.InstrumentationRegistry; import androidx.test.runner.AndroidJUnit4; import org.junit.Test; import org.junit.runner.RunWith; import static org.junit.Assert.*; /** * Instrumented test, which will execute on an Android device. * * @see <a href="http://d.android.com/tools/testing">Testing documentation</a> */ @RunWith(AndroidJUnit4.class) public class ExampleInstrumentedTest { @Test public void useAppContext() { // Context of the app under test. Context appContext = InstrumentationRegistry.getTargetContext(); assertEquals("com.man.toiletapp", appContext.getPackageName()); } }
[ "qunfong@live.nl" ]
qunfong@live.nl
c699eda675356b63555edeb807585179cf19fb2c
b257bd38aab844d059b1409022f5b1b6be304188
/online-common/src/main/java/com/online/edu/common/vo/R.java
5493064a8cdd2e3be434fe4017a156e88e0699c4
[]
no_license
cs4224485/OlineEdu
d5dc3ad453fc4b929e7d50cee71a47bf98141fae
d090880503ae39062482ab8bd959c1ee02701ea4
refs/heads/master
2023-02-05T10:02:14.314864
2020-04-28T09:49:16
2020-04-28T09:49:16
241,795,345
0
0
null
2023-01-26T19:38:28
2020-02-20T04:45:23
Vue
UTF-8
Java
false
false
1,926
java
package com.online.edu.common.vo; import com.online.edu.common.constants.ResultCodeEnum; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import lombok.Data; import java.util.HashMap; import java.util.Map; @Data @ApiModel(value = "全局统一返回结果") public class R { @ApiModelProperty(value = "是否成功") private Boolean success; @ApiModelProperty(value = "返回码") private Integer code; @ApiModelProperty(value = "返回消息") private String message; @ApiModelProperty(value = "返回数据") private Map<String, Object> data = new HashMap<String, Object>(); public static R ok(){ R r = new R(); r.setSuccess(ResultCodeEnum.SUCCESS.getSuccess()); r.setCode(ResultCodeEnum.SUCCESS.getCode()); r.setMessage(ResultCodeEnum.SUCCESS.getMessage()); return r; } public static R error() { R r = new R(); r.setSuccess(ResultCodeEnum.UNKNOWN_REASON.getSuccess()); r.setCode(ResultCodeEnum.UNKNOWN_REASON.getCode()); r.setMessage(ResultCodeEnum.UNKNOWN_REASON.getMessage()); return r; } public static R setResult(ResultCodeEnum resultCodeEnum){ R r = new R(); r.setSuccess(resultCodeEnum.getSuccess()); r.setCode(resultCodeEnum.getCode()); r.setMessage(resultCodeEnum.getMessage()); return r; } public R success(Boolean success){ this.setSuccess(success); return this; } public R message(String message){ this.setMessage(message); return this; } public R code(Integer code){ this.setCode(code); return this; } public R data(String key, Object value){ this.data.put(key, value); return this; } public R data(Map<String, Object> map){ this.setData(map); return this; } }
[ "414804000@qq.com" ]
414804000@qq.com
cbb76456205832e77b31c1cd0ff0bb0d3948e95a
0b0cc171457f32b5259ac2e0891d617abdfc0e47
/src/org/apache/commons/io/FileCleaningTracker.java
966493d83694b162f318fd18838d18b4032500b0
[]
no_license
bobolicener/star-rod
24b403447b4bd82af1bca734c63ac38785748824
59235901ab024c5af267daebf92344b20538251a
refs/heads/master
2020-07-01T20:12:10.960817
2019-08-08T14:54:46
2019-08-08T14:54:46
null
0
0
null
null
null
null
UTF-8
Java
false
false
3,468
java
package org.apache.commons.io; import java.io.File; import java.lang.ref.PhantomReference; import java.lang.ref.ReferenceQueue; import java.util.ArrayList; import java.util.Collection; import java.util.Collections; import java.util.HashSet; import java.util.List; public class FileCleaningTracker { ReferenceQueue<Object> q; final Collection<Tracker> trackers; final List<String> deleteFailures; volatile boolean exitWhenFinished; Thread reaper; public FileCleaningTracker() { q = new ReferenceQueue(); trackers = Collections.synchronizedSet(new HashSet()); deleteFailures = Collections.synchronizedList(new ArrayList()); exitWhenFinished = false; } public void track(File file, Object marker) { track(file, marker, (FileDeleteStrategy)null); } public void track(File file, Object marker, FileDeleteStrategy deleteStrategy) { if (file == null) { throw new NullPointerException("The file must not be null"); } addTracker(file.getPath(), marker, deleteStrategy); } public void track(String path, Object marker) { track(path, marker, (FileDeleteStrategy)null); } public void track(String path, Object marker, FileDeleteStrategy deleteStrategy) { if (path == null) { throw new NullPointerException("The path must not be null"); } addTracker(path, marker, deleteStrategy); } private synchronized void addTracker(String path, Object marker, FileDeleteStrategy deleteStrategy) { if (exitWhenFinished) { throw new IllegalStateException("No new trackers can be added once exitWhenFinished() is called"); } if (reaper == null) { reaper = new Reaper(); reaper.start(); } trackers.add(new Tracker(path, deleteStrategy, marker, q)); } public int getTrackCount() { return trackers.size(); } public List<String> getDeleteFailures() { return deleteFailures; } public synchronized void exitWhenFinished() { exitWhenFinished = true; if (reaper != null) { synchronized (reaper) { reaper.interrupt(); } } } private final class Reaper extends Thread { Reaper() { super(); setPriority(10); setDaemon(true); } public void run() { while ((!exitWhenFinished) || (trackers.size() > 0)) { try { FileCleaningTracker.Tracker tracker = (FileCleaningTracker.Tracker)q.remove(); trackers.remove(tracker); if (!tracker.delete()) { deleteFailures.add(tracker.getPath()); } tracker.clear(); } catch (InterruptedException e) {} } } } private static final class Tracker extends PhantomReference<Object> { private final String path; private final FileDeleteStrategy deleteStrategy; Tracker(String path, FileDeleteStrategy deleteStrategy, Object marker, ReferenceQueue<? super Object> queue) { super(queue); this.path = path; this.deleteStrategy = (deleteStrategy == null ? FileDeleteStrategy.NORMAL : deleteStrategy); } public String getPath() { return path; } public boolean delete() { return deleteStrategy.deleteQuietly(new File(path)); } } }
[ "gregory.degruy@gmail.com" ]
gregory.degruy@gmail.com
f1854846966e50cf6d6b1018987e58d7c1296616
a7cd09d987b24986e11c6332e6aa26e224379ed2
/qpid-jms-client/src/test/java/org/apache/qpid/jms/provider/failover/FailoverProviderClosedTest.java
d77b5d40ce0c756474f4ff9b11a8d05dfe0c22c9
[ "Apache-2.0" ]
permissive
zjpjohn/qpid-jms
a8009da9e7e9501dd4afd75cc41f3946aec60666
823dcdcde87147c872da99b7318cdb0daaea2a87
refs/heads/master
2021-01-15T13:33:17.827224
2016-08-11T17:07:16
2016-08-11T17:07:16
65,984,197
1
0
null
2016-08-18T09:27:55
2016-08-18T09:27:54
null
UTF-8
Java
false
false
5,514
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.qpid.jms.provider.failover; import java.io.IOException; import java.net.URI; import org.apache.qpid.jms.message.JmsInboundMessageDispatch; import org.apache.qpid.jms.message.JmsOutboundMessageDispatch; import org.apache.qpid.jms.meta.JmsConnectionInfo; import org.apache.qpid.jms.meta.JmsConsumerInfo; import org.apache.qpid.jms.meta.JmsSessionInfo; import org.apache.qpid.jms.meta.JmsTransactionId; import org.apache.qpid.jms.meta.JmsTransactionInfo; import org.apache.qpid.jms.provider.ProviderConstants.ACK_TYPE; import org.apache.qpid.jms.provider.ProviderFuture; import org.junit.Before; import org.junit.Test; /** * Test that methods of FailoverProvider all fail immediately when it is closed. */ public class FailoverProviderClosedTest extends FailoverProviderTestSupport { private FailoverProvider provider; private JmsConnectionInfo connection; private JmsSessionInfo session; private JmsConsumerInfo consumer; @Override @Before public void setUp() throws Exception { super.setUp(); provider = (FailoverProvider) FailoverProviderFactory.create(new URI("failover:(mock://localhost)")); provider.close(); connection = createConnectionInfo(); session = createSessionInfo(connection); consumer = createConsumerInfo(session); } @Test(timeout=30000) public void testMultipleCloseCalls() { provider.close(); } @Test(timeout=30000, expected=IOException.class) public void testConnect() throws Exception { provider.connect(); } @Test(timeout=30000, expected=IOException.class) public void testStart() throws Exception { provider.start(); } @Test(timeout=30000, expected=IOException.class) public void testCreateResource() throws Exception { ProviderFuture request = new ProviderFuture(); provider.create(connection, request); } @Test(timeout=30000, expected=IOException.class) public void testStartResource() throws Exception { ProviderFuture request = new ProviderFuture(); provider.start(session, request); } @Test(timeout=30000, expected=IOException.class) public void testStopResource() throws Exception { ProviderFuture request = new ProviderFuture(); provider.stop(session, request); } @Test(timeout=30000, expected=IOException.class) public void testDestroyResource() throws Exception { ProviderFuture request = new ProviderFuture(); provider.destroy(session, request); } @Test(timeout=30000, expected=IOException.class) public void testSend() throws Exception { ProviderFuture request = new ProviderFuture(); provider.send(new JmsOutboundMessageDispatch(), request); } @Test(timeout=30000, expected=IOException.class) public void testSessionAcknowledge() throws Exception { ProviderFuture request = new ProviderFuture(); provider.acknowledge(session.getId(), ACK_TYPE.ACCEPTED, request); } @Test(timeout=30000, expected=IOException.class) public void testAcknowledgeMessage() throws Exception { ProviderFuture request = new ProviderFuture(); provider.acknowledge(new JmsInboundMessageDispatch(1), ACK_TYPE.ACCEPTED, request); } @Test(timeout=30000, expected=IOException.class) public void testCommit() throws Exception { ProviderFuture request = new ProviderFuture(); JmsTransactionId txId = new JmsTransactionId(connection.getId(), 1); JmsTransactionInfo txInfo = new JmsTransactionInfo(session.getId(), txId); provider.commit(txInfo, request); } @Test(timeout=30000, expected=IOException.class) public void testRollback() throws Exception { ProviderFuture request = new ProviderFuture(); JmsTransactionId txId = new JmsTransactionId(connection.getId(), 1); JmsTransactionInfo txInfo = new JmsTransactionInfo(session.getId(), txId); provider.rollback(txInfo, request); } @Test(timeout=30000, expected=IOException.class) public void testRecover() throws Exception { ProviderFuture request = new ProviderFuture(); provider.recover(session.getId(), request); } @Test(timeout=30000, expected=IOException.class) public void testUnsubscribe() throws Exception { ProviderFuture request = new ProviderFuture(); provider.unsubscribe("subscription-name", request); } @Test(timeout=30000, expected=IOException.class) public void testMessagePull() throws Exception { ProviderFuture request = new ProviderFuture(); provider.pull(consumer.getId(), 1, request); } }
[ "tabish121@gmail.com" ]
tabish121@gmail.com
21d83e91377342050ab0766b4ed874e104f13d0d
1334b5e20fc50937144d65067f7a178785ed891d
/plugin_common/src/main/java/com/fengxing/mobile/plugin/common/utils/ColorTools.java
41ea376b45b4ae13bbca8f6507676cc6e034b774
[]
no_license
lovzc/CommonUtils
60e90361b85ae01dadb054d887ddfa66f6aa2d98
89266a87736cc8c744bd6680bb23904ce1de2e47
refs/heads/master
2021-03-29T10:09:16.190455
2019-03-14T05:21:16
2019-03-14T05:21:16
null
0
0
null
null
null
null
UTF-8
Java
false
false
949
java
package com.fengxing.mobile.plugin.common.utils; import android.graphics.Color; import android.support.annotation.ColorInt; import android.support.v4.graphics.ColorUtils; public class ColorTools { /** * 判断颜色是否是亮色 * https://stackoverflow.com/questions/24260853/check-if-color-is-dark-or-light-in-android * 判断颜色的亮暗 * * @param color * @return */ public static boolean isColorDark(int color) { double darkness = 1 - (0.299 * Color.red(color) + 0.587 * Color.green(color) + 0.114 * Color.blue(color)) / 255; if (darkness < 0.5) { return false; // It's a light color } else { return true; // It's a dark color } } /** * 同上 * * @param color * @return */ public static boolean isLightColor(@ColorInt int color) { return ColorUtils.calculateLuminance(color) >= 0.5; } }
[ "f296016140@gmail.com" ]
f296016140@gmail.com
57ec7bbd1416729decdd6b8f8178a9ffb34651de
e9b6a262250e7f42cc005dcec06a6b5bb38dae89
/src/main/java/com/mcb/creditfactory/dto/CarDto.java
b0c1e9a47fd252f830377aaf597b58500326171f
[]
no_license
puzatin/test-task
538d6fe57a5c31f9663b5015b6f8c7675dbec0f5
eed4ccbd7362413c78ff6eb09d5b153e96d68a21
refs/heads/master
2022-09-16T07:56:51.892502
2020-05-24T19:35:47
2020-05-24T19:35:47
266,126,331
0
0
null
null
null
null
UTF-8
Java
false
false
519
java
package com.mcb.creditfactory.dto; import com.fasterxml.jackson.annotation.JsonTypeName; import com.mcb.creditfactory.model.Assessment; import lombok.AllArgsConstructor; import lombok.Data; import lombok.NoArgsConstructor; import java.util.Set; @Data @NoArgsConstructor @AllArgsConstructor @JsonTypeName("car") public class CarDto implements Collateral { private Long id; private String brand; private String model; private Double power; private Short year; private Set<Assessment> values; }
[ "puzatin@gmail.com" ]
puzatin@gmail.com
fbcd00aa6eb6eb5f3317f7b812030f64cc5bd17b
2bc2eadc9b0f70d6d1286ef474902466988a880f
/tags/mule-2.0.0-M2/transports/jms/src/test/java/org/mule/providers/jms/JmsConnectorTestCase.java
55c6df48bbf2c845ea607c9819c1810fa16db0d5
[]
no_license
OrgSmells/codehaus-mule-git
085434a4b7781a5def2b9b4e37396081eaeba394
f8584627c7acb13efdf3276396015439ea6a0721
refs/heads/master
2022-12-24T07:33:30.190368
2020-02-27T19:10:29
2020-02-27T19:10:29
243,593,543
0
0
null
2022-12-15T23:30:00
2020-02-27T18:56:48
null
UTF-8
Java
false
false
3,160
java
/* * $Id$ * -------------------------------------------------------------------------------------- * Copyright (c) MuleSource, Inc. All rights reserved. http://www.mulesource.com * * The software in this package is published under the terms of the CPAL v1.0 * license, a copy of which has been included with this distribution in the * LICENSE.txt file. */ package org.mule.providers.jms; import org.mule.tck.providers.AbstractConnectorTestCase; import org.mule.umo.provider.UMOConnector; import org.mule.util.object.SingletonObjectFactory; import com.mockobjects.dynamic.C; import com.mockobjects.dynamic.Mock; import javax.jms.Connection; import javax.jms.ConnectionFactory; import javax.jms.ExceptionListener; import javax.jms.TextMessage; import org.apache.commons.collections.IteratorUtils; public class JmsConnectorTestCase extends AbstractConnectorTestCase { /* * (non-Javadoc) * * @see org.mule.tck.providers.AbstractConnectorTestCase#getConnectorName() */ // @Override public UMOConnector createConnector() throws Exception { JmsConnector newConnector = new JmsConnector(); newConnector.setName("TestConnector"); newConnector.setSpecification(JmsConstants.JMS_SPECIFICATION_11); Mock connectionFactory = new Mock(ConnectionFactory.class); Mock connection = new Mock(Connection.class); connectionFactory.expectAndReturn("createConnection", connection.proxy()); connection.expect("setExceptionListener", C.isA(ExceptionListener.class)); connection.expect("close"); connection.expect("start"); connection.expect("stop"); connection.expect("stop"); connection.expect("setClientID", "mule.TestConnector"); newConnector.setConnectionFactory(new SingletonObjectFactory(connectionFactory.proxy())); return newConnector; } public String getTestEndpointURI() { return "jms://test.queue"; } public Object getValidMessage() throws Exception { return getMessage(); } public static Object getMessage() throws Exception { Mock message = new Mock(TextMessage.class); message.expectAndReturn("getText", "Test JMS Message"); message.expectAndReturn("getText", "Test JMS Message"); message.expectAndReturn("getJMSCorrelationID", null); message.expectAndReturn("getJMSMessageID", "1234567890"); message.expectAndReturn("getJMSDeliveryMode", new Integer(1)); message.expectAndReturn("getJMSDestination", null); message.expectAndReturn("getJMSPriority", new Integer(4)); message.expectAndReturn("getJMSRedelivered", Boolean.FALSE); message.expectAndReturn("getJMSReplyTo", null); message.expectAndReturn("getJMSExpiration", new Long(0)); message.expectAndReturn("getJMSTimestamp", new Long(0)); message.expectAndReturn("getJMSType", null); message.expect("toString"); message.expectAndReturn("getPropertyNames", IteratorUtils.asEnumeration(IteratorUtils.emptyIterator())); return message.proxy(); } }
[ "tcarlson@bf997673-6b11-0410-b953-e057580c5b09" ]
tcarlson@bf997673-6b11-0410-b953-e057580c5b09
1c22947547a45dca41bf9fdae4999adabf9c48f7
665c396e5abd655c4c850596d3e31539dbefb531
/springboot/Network-notepad-master/src/main/java/com/notepad/error/InvalidPasswordException.java
acac6c06d275270f3581a61a616d20e3d3c5206c
[]
no_license
cscsb/ppssii.com
79ceff750cb69a4853c84af2f927d795b7812962
f94e5e2b42e109a61a6e1440e48131f056942475
refs/heads/master
2023-02-17T05:38:05.903150
2020-07-23T12:39:20
2020-07-23T12:39:20
221,639,038
0
5
null
2023-02-02T12:00:38
2019-11-14T07:39:19
PHP
UTF-8
Java
false
false
388
java
package com.notepad.error; import org.zalando.problem.AbstractThrowableProblem; import org.zalando.problem.Status; public class InvalidPasswordException extends AbstractThrowableProblem { private static final long serialVersionUID = 1L; public InvalidPasswordException() { super(ErrorConstants.INVALID_PASSWORD_TYPE, "Incorrect password", Status.BAD_REQUEST); } }
[ "packiiinnn@protonmail.ch" ]
packiiinnn@protonmail.ch
62a7053bd759ac194f0fc81aebc5ed293e679518
34195967bf7f705d483166ec5e9b5a3ad09dc9de
/Strategy_LoanCalculator/src/Start/UnusedRiskFactors.java
fa61e9ae82fa514cd2a49fd3796c35767007e749
[]
no_license
zhanglin2018/code_design1
7a74a8ea0319fc5270e7505e4f3fca22100ef78d
2ee072dd2128aeea36982148c96fdbf24e0f87e1
refs/heads/master
2020-06-24T21:37:08.579143
2019-07-30T01:48:10
2019-07-30T01:48:10
199,098,009
0
0
null
null
null
null
UTF-8
Java
false
false
121
java
package Start; public class UnusedRiskFactors { public static Factor getFactors() { return new Factor(); } }
[ "893330264@qq.com" ]
893330264@qq.com
ec626e612725ab9f598273c06b547e1c9c7f2fd8
e8305bd5a38bf2e7c6a80585be59a51de978d585
/dependencymanager/org.apache.felix.dependencymanager.runtime/src/org/apache/felix/dm/runtime/Log.java
c41b956a64ae8ef4f1522e8c239b617caf9a552b
[ "Apache-2.0" ]
permissive
apache/felix-dev
f266ea8f7d34aa18e0bc168a13106c52358d9670
d3b8b7984d04129d44018676cce615578275c84c
refs/heads/master
2023-09-04T08:09:33.449135
2023-09-02T10:14:18
2023-09-02T10:14:18
242,854,622
112
134
Apache-2.0
2023-09-06T05:06:54
2020-02-24T22:09:29
Java
UTF-8
Java
false
false
2,970
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.felix.dm.runtime; import org.osgi.service.log.LogService; /** * This class logs some formattable strings into the OSGi Log Service. * * @author <a href="mailto:dev@felix.apache.org">Felix Project Team</a> */ public class Log { /** The wrap log service which is actually used (Injected by Activator) */ private volatile LogService m_logService; /** Log INFO/DEBUG only if logs are enabled, else only log ERROR/WARN messages */ private volatile boolean m_logEnabled; /** Our sole instance */ private static Log m_instance = new Log(); public static Log instance() { return m_instance; } public void enableLogs(boolean logEnabled) { m_logEnabled = logEnabled; } public void error(String format, Object ... args) { m_logService.log(LogService.LOG_ERROR, String.format(format, args)); } public void error(String format, Throwable t, Object ... args) { m_logService.log(LogService.LOG_ERROR, String.format(format, args), t); } public void warn(String format, Object ... args) { m_logService.log(LogService.LOG_WARNING, String.format(format, args)); } public void warn(String format, Throwable t, Object ... args) { m_logService.log(LogService.LOG_WARNING, String.format(format, args), t); } public void info(String format, Object ... args) { if (m_logEnabled) m_logService.log(LogService.LOG_INFO, String.format(format, args)); } public void info(String format, Throwable t, Object ... args) { if (m_logEnabled) m_logService.log(LogService.LOG_INFO, String.format(format, args), t); } public void debug(String format, Object ... args) { if (m_logEnabled) m_logService.log(LogService.LOG_DEBUG, String.format(format, args)); } public void debug(String format, Throwable t, Object ... args) { if (m_logEnabled) m_logService.log(LogService.LOG_DEBUG, String.format(format, args), t); } }
[ "pderop@apache.org" ]
pderop@apache.org
052fef6de9b639ce2ea149e978d7b27ba057e366
911998c581f2da85895db8ee176e3e8ddde62a5a
/src/main/java/com/level11data/databricks/cluster/S3StorageInfo.java
cc893432060d99e2972454a2b9266b75e7ca720b
[ "Apache-2.0", "LicenseRef-scancode-unknown-license-reference" ]
permissive
shaipraj/databricks-client-java
8476f0b35455168f45ea4dd4ef3c9296a81787e5
720f680a3c7fd8cd4174aa412f2608de1816bec3
refs/heads/master
2020-07-24T03:47:33.411913
2019-09-18T16:39:42
2019-09-18T16:39:42
207,792,591
0
0
Apache-2.0
2019-09-11T11:11:19
2019-09-11T11:11:18
null
UTF-8
Java
false
false
828
java
package com.level11data.databricks.cluster; public class S3StorageInfo extends AbstractStorageInfo { public final String Destination; public final String Region; public final String Endpoint; public final Boolean EnableEncryption; public final String EncryptionType; public final String KmsKey; public final String CannedAcl; public S3StorageInfo(String destination, String region, String endpoint, Boolean enableEncryption, String encryptionType, String kmsKey, String cannedAcl) { Destination = destination; Region = region; Endpoint = endpoint; EnableEncryption = enableEncryption; EncryptionType = encryptionType; KmsKey = kmsKey; CannedAcl = cannedAcl; } }
[ "jason@databricks.com" ]
jason@databricks.com
4fa99f807da2ba71aee7d72cd594d329c43c90b7
03cc1381e4b6621f46e3b3e2052b611335d8204c
/sdk/src/main/java/org/zstack/sdk/GetVmNumaResult.java
6006b21ead6e8b1bd09d86ee701fb4f8e673428c
[ "Apache-2.0" ]
permissive
shaohan0228/zstack
4592960aa98b8d9f25d885f98061adfc6ec7415d
85200a1e2b14e3e34622214866404145c1721fbb
refs/heads/master
2022-07-08T20:30:02.666082
2022-06-13T01:48:29
2022-06-13T01:48:29
239,920,158
0
0
Apache-2.0
2020-02-12T03:38:57
2020-02-12T03:38:57
null
UTF-8
Java
false
false
235
java
package org.zstack.sdk; public class GetVmNumaResult { public boolean enable; public void setEnable(boolean enable) { this.enable = enable; } public boolean getEnable() { return this.enable; } }
[ "mingmin.wen@zstack.io" ]
mingmin.wen@zstack.io
d1cca9f4b64f00afdd4091d49204e3b4e5dc14fb
ab7f571b420b8addf5a66e3d33f863317962bd53
/SpringBatch_App/trunk/src/main/java/com/mic/exp/batch/integration/IntegrationTest.java
cf77810eebda85cc531d938725d78db4683a124c
[]
no_license
TieniChuh/NT_Franch
9cafa5cadcccc569dcc451f04d61d194133aee6b
41f22767055d5c6821f6a327ba2636ba11d708e1
refs/heads/master
2020-12-30T11:52:41.508617
2017-07-18T08:06:48
2017-07-18T08:06:48
91,434,476
0
0
null
null
null
null
UTF-8
Java
false
false
2,405
java
/* * Creation : 16 juin 2015 */ package com.mic.exp.batch.integration; import java.io.File; import java.io.FileOutputStream; import java.io.IOException; import java.io.OutputStream; import java.net.URL; import java.util.HashMap; import java.util.Map; import java.util.Properties; import org.apache.commons.collections.MapUtils; import org.apache.commons.lang.StringUtils; /** * The Class IntegrationTest. */ public class IntegrationTest { /** The map properties. */ private Map<String, Properties> mapProperties = new HashMap<String, Properties>(); /** * Creates the new properties. * * @param keyMap the key map * @return true, if successful */ public boolean createNewProperties(final String keyMap) { boolean res = false; if (StringUtils.isNotBlank(keyMap)) { this.mapProperties.put(keyMap, new Properties()); res = true; } return res; } /** * Adds the new key value. * * @param keyMap the key map * @param key the key * @param value the value * @return true, if successful */ public boolean addNewKeyValue(final String keyMap, final String key, final String value) { boolean res = false; if (MapUtils.isNotEmpty(this.mapProperties) && this.mapProperties.containsKey(keyMap)) { this.mapProperties.get(keyMap).setProperty(key, value); res = true; } return res; } /** * Persist properties. * * @param keyMap the key map * @param propertiesFileName the properties file name. This file must present in the classpath loaded by the classPathLoader * @return true, if successful * @throws IOException Signals that an I/O exception has occurred. */ public boolean persistProperties(final String keyMap, final String propertiesFileName) throws IOException { boolean res = false; if (MapUtils.isNotEmpty(this.mapProperties) && this.mapProperties.containsKey(keyMap) && StringUtils.isNotBlank(propertiesFileName)) { URL urlProp = this.getClass().getClassLoader().getResource(propertiesFileName); File f = new File(urlProp.getPath()); OutputStream out = new FileOutputStream(f); this.mapProperties.get(keyMap).store(out, ""); res = true; } return res; } }
[ "kinsyndy@163.com" ]
kinsyndy@163.com
87ec0b342078b27a7f7a5515fd99d632e05c71c2
aa0e09091d217d5ec564c8acfa2add4febfbd598
/sintaxe-basica/src/TestaLacos.java
d4a37a7f08ffb44c915cd3879cb8812ceb05ac7d
[]
no_license
vanialadev/formacao-java
dfab6a152ff2b35d53f0ce838bdd966169e52b6e
39566762cb58828e3d6bece9b4d1898b438132f7
refs/heads/master
2020-03-21T03:55:55.571533
2018-08-28T05:15:07
2018-08-28T05:15:07
138,077,827
0
0
null
null
null
null
UTF-8
Java
false
false
368
java
public class TestaLacos { public static void main(String[] args) { for(int multiplicador = 1; multiplicador <= 10; multiplicador++) { for(int contador = 0; contador <= 10; contador++) { System.out.print(multiplicador * contador); System.out.print(" "); } System.out.println(); } } }
[ "vanialadev@gmail.com" ]
vanialadev@gmail.com
cfeb4d94b7558b3bb8d977351183ec3574eeced0
606ad2817ac451559b3f7182a579529a520d97d5
/api-utils/src/main/java/com/waheedtechblog/apiutils/controller/EncodeController.java
8b0aa608d2f2b116f592bf06fb2d23198eadfd8b
[]
no_license
abdulwaheed18/spring-boot-tutorial
e3a1b73e9c4e04cc1fe603b6da107f4c8ad7b333
66daa1d185d6c02646df7c371046caa35e9a2a24
refs/heads/master
2020-07-15T20:16:07.626778
2019-10-05T16:43:36
2019-10-05T16:43:36
205,641,380
1
0
null
null
null
null
UTF-8
Java
false
false
3,695
java
/** * */ package com.waheedtechblog.apiutils.controller; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.http.ResponseEntity; import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RequestParam; import org.springframework.web.bind.annotation.RestController; import org.springframework.web.multipart.MultipartFile; import com.waheedtechblog.apiutils.service.EncoderService; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiResponse; import io.swagger.annotations.ApiResponses; /** * Encoder Decoder Endpoint * * @author AbdulWaheed18@gmail.com * */ @RestController @Api(value = "Endpoint for BASE64 Encoding Decoding message or files") public class EncodeController { @Autowired private EncoderService encodeService; @PostMapping("/encodeMessage") @ApiOperation(value = "returns the encoded message", response = String.class, produces = "text/plain", consumes = "text/plain") @ApiResponses(value = { @ApiResponse(code = 200, message = "Encoded message"), @ApiResponse(code = 400, message = "Invalid or Empty Input") }) public ResponseEntity<String> getEncodedString(@RequestBody String message) { return ResponseEntity.ok(encodeService.getEncodedMessgae(message)); } @PostMapping("/decodeMessage") @ApiOperation(value = "returns the decoded message", response = String.class, produces = "text/plain", consumes = "text/plain") @ApiResponses(value = { @ApiResponse(code = 200, message = "Decoded message"), @ApiResponse(code = 400, message = "Invalid or Empty Input") }) public ResponseEntity<String> getDecodedString(@RequestBody String message) { return ResponseEntity.ok(encodeService.getDecodedMessage(message)); } @PostMapping("/encodeUrl") @ApiOperation(value = "returns the encoded URL", response = String.class, produces = "text/plain", consumes = "text/plain") @ApiResponses(value = { @ApiResponse(code = 200, message = "Encoded url"), @ApiResponse(code = 400, message = "Invalid or Empty Input") }) public ResponseEntity<String> getEncodedUrl(@RequestBody String message) { return ResponseEntity.ok(encodeService.getEncodedUrl(message)); } @PostMapping("/decodeUrl") @ApiOperation(value = "returns the decoded URL", response = String.class, produces = "text/plain", consumes = "text/plain") @ApiResponses(value = { @ApiResponse(code = 200, message = "Decoded URL"), @ApiResponse(code = 400, message = "Invalid or Empty Input") }) public ResponseEntity<String> getDecodedUrl(@RequestBody String message) { return ResponseEntity.ok(encodeService.getDecodedUrl(message)); } @PostMapping("/decodeJwt") @ApiOperation(value = "returns the payload of JWT", response = String.class, produces = "text/plain", consumes = "text/plain") @ApiResponses(value = { @ApiResponse(code = 200, message = "Decoded Payload of JWT"), @ApiResponse(code = 400, message = "Invalid or Empty Input") }) public ResponseEntity<String> getJwtPayload(@RequestBody String message) { return ResponseEntity.ok(encodeService.getJwtPayload(message)); } @PostMapping("/encodeFile") @ApiOperation(value = "returns the encoded value of File", response = String.class, produces = "text/plain", consumes = "text/plain") @ApiResponses(value = { @ApiResponse(code = 200, message = "Encoded Value of File"), @ApiResponse(code = 400, message = "Invalid or Empty Input") }) public ResponseEntity<String> getEncodeValueForFile(@RequestParam("file") MultipartFile file) { return ResponseEntity.ok(encodeService.getEncodedFile(file)); } }
[ "abdulwaheed18@gmail.com" ]
abdulwaheed18@gmail.com
1da62c8a74f03e95b302e882cace0a7995860e6b
95f4b7b861e2ba693b5a5a3adb4e683c7cadddf4
/src/main/java/proxy/BoyProxy.java
d7bfde55cd511c61f62d97b195d1f9ed24ba14f5
[]
no_license
xujia233/FirstTest
0ad0faf530d97bd6bb0a8f72634b124015b742b7
e6ee13cec7974fce92bc2fa7d3c9af3e7c541d97
refs/heads/master
2022-12-25T17:50:17.104211
2020-02-12T02:31:52
2020-02-12T02:31:52
170,642,644
0
0
null
2022-12-16T04:01:36
2019-02-14T06:54:38
Java
UTF-8
Java
false
false
3,255
java
package proxy; import com.google.common.collect.Lists; import entity.User; import impl.Boy; import org.junit.Test; import org.springframework.util.CollectionUtils; import java.lang.reflect.Proxy; import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Map; /** * 静态代理 需与代理类实现相同的接口 * 优点:可以做到在符合开闭原则时对目标对象进行功能扩展 * 缺点:1、需要为每个服务都创建一个代理类,工作量太大 * 2、同时一旦目标接口发生改变,代理类也得相应修改 * Created by xujia on 2019/4/17 */ public class BoyProxy implements People { private Boy boy; @Override public void say() { boy = new Boy(); System.out.println("before say"); boy.say(); } @Test public void test0() { // 静态代理 People people = new BoyProxy(); people.say(); } @Test public void test () { // 下面演示jdk动态代理 People dynamicProxy = (People) Proxy.newProxyInstance(Thread.currentThread().getContextClassLoader(), new Class[]{People.class}, ((proxy, method, args) -> { People boy = new Boy(); System.out.println("before say"); Object o = method.invoke(boy, args); System.out.println("after say"); return o; })); dynamicProxy.say(); } @Test public void test02() { // 下面演示Cjlib动态代理 People boy = new Boy(); People proxy = (Boy) new CglibProxy().getInstance(boy); proxy.say(); } @Test public void test03() { Map<String, Object> map = new HashMap<>(); List<User> users = (List<User>) map.getOrDefault("list", null); System.out.println(users); } @Test public void test04() { List<String> userIds = Lists.newArrayList("1", "2", "3", "4"); userIds = filter(userIds); System.out.println(userIds); } @Test public void test05() { User user = new User(); System.out.println(user.getCan()); } private List<String> filter(List<String> userId) { userId.removeIf(s -> "1".equals(s)); return userId; } /** * 测试强转 */ @Test public void test06() { Map<String, Object> map = new HashMap<>(); map.put("key", new ArrayList<>()); map = (Map<String, Object>) map.put("key", new ArrayList<>()); System.out.println(map); } @Test public void test07() { Map<String, Object> map = new HashMap<>(); List<String> list = new ArrayList<>(); TestList testList = new TestList(); //map = (Map<String, Object>) testList.transfer(list); System.out.println(map); } @Test public void test08() { String t = null; List<String> s = Lists.newArrayList(t); if (!CollectionUtils.isEmpty(s)) System.out.println(s); } @Test public void test09() { String a = "Test"; String b = "Test"; a = "b"; "Test".toUpperCase(); System.out.println("Test".toUpperCase() + "," + a + "," + b); } }
[ "xuj_java@163.com" ]
xuj_java@163.com
57d585f96e4768c117c72cd28120da2393c44084
79dbcbe32ea0839c5ba95b06dfc70b60f36b46db
/src/main/java/org/apache/ibatis/annotations/Results.java
53166f0b084c97e4b1032b1eb7f523d8f5f9965a
[ "Apache-2.0", "BSD-3-Clause" ]
permissive
Yhongwu/mybatis-3.4-src
4df26684c056eb1bb9f5f192425888feaef8d5e7
18150d1538f420614953e11527e95830c5e93bab
refs/heads/master
2022-06-30T13:06:56.394448
2019-10-28T08:57:33
2019-10-28T08:57:33
213,336,726
0
0
Apache-2.0
2022-06-29T19:33:11
2019-10-07T08:54:52
Java
UTF-8
Java
false
false
1,143
java
/** * Copyright ${license.git.copyrightYears} 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.annotations; import java.lang.annotation.Documented; import java.lang.annotation.ElementType; import java.lang.annotation.Retention; import java.lang.annotation.RetentionPolicy; import java.lang.annotation.Target; /** * @author Clinton Begin */ @Documented @Retention(RetentionPolicy.RUNTIME) @Target(ElementType.METHOD) public @interface Results { /** * The name of the result map. */ String id() default ""; Result[] value() default {}; }
[ "hongwu39028@163.com" ]
hongwu39028@163.com
74fafa62616a9dd91d48b2db759a5d324d39608a
34c88837c913d4d92aa88857ba4e5d89b43df13f
/easypoi-web/src/main/java/cn/afterturn/easypoi/entity/vo/BigExcelConstants.java
10911a7bb173924fc8c7d5b47f04eac99bd54422
[]
no_license
Walkinwindy/easypoiShow
7aad2d140fbe90c0b7406f662143ac253b7f1164
c0f9393858a032f506922c346e2107d071599fd2
refs/heads/master
2022-12-23T00:59:02.664195
2019-10-24T05:27:34
2019-10-24T05:27:34
217,217,875
0
0
null
2022-12-16T00:40:17
2019-10-24T05:25:12
Java
UTF-8
Java
false
false
1,118
java
/** * Copyright 2013-2015 JueYue (qrb.jueyue@gmail.com) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package cn.afterturn.easypoi.entity.vo; /** * 正常导出Excel * @author JueYue on 14-3-8. * 静态常量 */ public interface BigExcelConstants extends BasePOIConstants { /** * 单Sheet导出 */ public final static String EASYPOI_BIG_EXCEL_VIEW = "easypoiBigExcelView"; /** * 查询参数 */ public final static String DATA_PARAMS = "dataParams"; /** * 查询函数 */ public final static String DATA_INTER = "dataInterf"; }
[ "374179376@qq.com" ]
374179376@qq.com
0682f10eeebd44de759eaa8894648bb95feb03f7
33b779232fe78bdde8a7c39cf14a9701b8786f45
/lab5_3/src/exception/ClientConnectionException.java
1807f5f329ddd05a1d71f712a5b29682546ce2bd
[]
no_license
MoonLory/Web_5sem
2f0fe5b1c2c77e589d9d0397cc1e3270e1e26fe1
69dc389184ad8cba2665a62ce583574e42ec0e0f
refs/heads/master
2023-02-09T14:30:44.511294
2021-01-08T09:43:23
2021-01-08T09:43:23
327,418,248
0
0
null
null
null
null
UTF-8
Java
false
false
658
java
package exception; public class ClientConnectionException extends Exception{ /** * Constructor with specified string * @param message string */ public ClientConnectionException(String message) { super(message); } /** * Constructor with specified string and exception * @param message string * @param e error covered */ public ClientConnectionException(String message, Throwable e){ super(message, e); } @Override public String getMessage() { return super.getMessage(); } @Override public void printStackTrace() { super.printStackTrace(); } }
[ "grishkinandrei@gmail.com" ]
grishkinandrei@gmail.com
8226f582e8a70b87d9c4ce46c02f7dd28bf7247a
c6bc61beb26d218cd87377c118cd8d6276c2ed67
/src/main/java/com/css/business/web/sysManage/bean/SysDictionary.java
bf0867caabbdb19f2ff208c1d160f1c20fcf9f27
[]
no_license
ronglang/qidongmes
040330f1136020490ca8b975c179dca88b195ae5
3a3e4c9d655f97089837c6174e2b0bfa57e32a8b
refs/heads/master
2021-08-30T19:11:01.553230
2017-12-19T03:06:31
2017-12-19T03:06:31
114,708,873
0
2
null
null
null
null
UTF-8
Java
false
false
2,661
java
package com.css.business.web.sysManage.bean; import java.util.Date; import javax.persistence.Column; import javax.persistence.Entity; import javax.persistence.GeneratedValue; import javax.persistence.GenerationType; import javax.persistence.Id; import javax.persistence.Table; import javax.persistence.Temporal; import javax.persistence.TemporalType; import javax.persistence.Transient; import org.springframework.format.annotation.DateTimeFormat; import com.css.common.util.JsonDateSerializer; import com.css.common.web.syscommon.bean.BaseEntity; import com.fasterxml.jackson.databind.annotation.JsonSerialize; @Entity @Table(name = "sys_dictionary") public class SysDictionary implements BaseEntity{ @Transient private static final long serialVersionUID = -6093394488232648605L; private Integer id; @Column(name = "code") private String code; @Column(name = "value") private String value; @Column(name = "remark") private String remark; @Column(name = "pcode") private String pcode; @Column(name = "CREATE_BY") private String createBy; @Column(name = "CREATE_DATE") @Temporal(TemporalType.TIMESTAMP) @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") @JsonSerialize(using = JsonDateSerializer.class) private Date createDate; @Column(name = "type") private String type; @Column(name = "is_parent") private String isParent; @Id @Column(name = "id") @GeneratedValue(strategy = GenerationType.IDENTITY) public Integer getId() { return id; } public void setId(Integer id) { this.id = id; } public String getCode() { return code; } public void setCode(String code) { this.code = code; } public String getValue() { return value; } public void setValue(String value) { this.value = value; } public String getRemark() { return remark; } public void setRemark(String remark) { this.remark = remark; } public String getPcode() { return pcode; } public void setPcode(String pcode) { this.pcode = pcode; } public String getCreateBy() { return createBy; } public void setCreateBy(String createBy) { this.createBy = createBy; } public Date getCreateDate() { return createDate; } public void setCreateDate(Date createDate) { this.createDate = createDate; } /** * @return type */ public String getType() { return type; } /** * @param type 要设置的 type * */ public void setType(String type) { this.type = type; } /** * @return isParent */ public String getIsParent() { return isParent; } /** * @param isParent 要设置的 isParent * */ public void setIsParent(String isParent) { this.isParent = isParent; } }
[ "405992015@qq.com" ]
405992015@qq.com
bd957b5c1cfb1016e4c5b574d898d44a62800d9a
6fc7c5fd727c321c707a9f7bc4046077af3ea752
/src/com/slr/training/swp/db/AccountModel.java
397bc10b3a69495815bb5bf91d7af424149fd156
[]
no_license
goffity/DatabaseWorkshop
b17286ae78635e3de878ce66521347ccdd6c141c
49fe66d99a3ac8458cdc7d5eef9aa216cad56261
refs/heads/master
2020-04-04T01:58:22.678272
2011-08-25T07:19:31
2011-08-25T07:19:31
2,266,489
0
0
null
null
null
null
UTF-8
Java
false
false
253
java
package com.slr.training.swp.db; import java.io.Serializable; public class AccountModel implements Serializable{ private static final long serialVersionUID = -6122689443407479929L; int id; String name; String accountNo; String bank; }
[ "goffity@gmail.com" ]
goffity@gmail.com
fafb904c0e02c08cc074e7d4baba66913823cda9
764ae8f5e0b4dfe807c81c2a350faed1d70def06
/app/src/main/java/com/sharingame/sharg/LoginActivity.java
b960ca30f9563ba4aec04c19ef8cf03055ba6a77
[]
no_license
sandratra/NFC_TPT_ITU_DOUDA
7ce5fce328ecf198d5cdb8bedeb1cfe7ab9393dc
4bfe038592a1131ba6ee190538d4b3765a474789
refs/heads/master
2020-04-23T07:06:35.817375
2019-03-14T05:19:44
2019-03-14T05:19:44
170,996,691
0
0
null
null
null
null
UTF-8
Java
false
false
3,854
java
package com.sharingame.sharg; import android.app.Activity; import android.content.Intent; import android.nfc.NfcAdapter; import android.os.Bundle; import android.support.v7.widget.AppCompatButton; import android.view.View; import android.widget.EditText; import android.widget.FrameLayout; import com.sharingame.data.MStorage; import com.sharingame.entity.User; import com.sharingame.utility.DialogHelper; import com.sharingame.utility.LocalDB; import com.sharingame.utility.NameValuePair; import com.sharingame.utility.ObjectUtils; import com.sharingame.utility.ShargWS; import java.util.ArrayList; import java.util.concurrent.ExecutionException; public class LoginActivity extends Activity { private LocalDB dbHelper; EditText user_name; EditText password; AppCompatButton btn_login; private FrameLayout progressBar; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.login_activity); progressBar = findViewById(R.id.loadingPanel); dbHelper = new LocalDB(this); initComponents(); } @Override protected void onStart() { super.onStart(); NfcAdapter nfcAdapter = NfcAdapter.getDefaultAdapter(this); if (!nfcAdapter.isNdefPushEnabled()){ new DialogHelper(this).showDialog(R.layout.popup_layer, DialogHelper.DIALOG_INFO, "Veuillez activer NFC, l'application peut toujours fonctionner mais avec des fonctionalités réduites.", null); } } private void initComponents(){ user_name = findViewById(R.id.input_login); password = findViewById(R.id.input_pwd); btn_login = findViewById(R.id.btn_login); btn_login.setOnClickListener(on_login); } public View.OnClickListener on_login = new View.OnClickListener(){ public void onClick(View v){ progressBar.setVisibility(View.VISIBLE); String user_name_text = user_name.getText().toString(); String password_text = password.getText().toString(); if(user_name_text.isEmpty() || password_text.isEmpty()) { new DialogHelper(LoginActivity.this).showDialog(R.layout.popup_layer, DialogHelper.DIALOG_WARNING, "Veuillez vérifier que tous les champs ne sont pas vide.", null); progressBar.setVisibility(View.GONE); return; } else { String target_api = "user/auth/signin"; ArrayList<NameValuePair> prm = new ArrayList<>(); prm.add(new NameValuePair("name", user_name_text)); prm.add(new NameValuePair("password", password_text)); ShargWS ws_test = new ShargWS("POST", target_api, prm, null); try { String res = ws_test.execute().get(); if (res == null){ new DialogHelper(LoginActivity.this).showDialog(R.layout.popup_layer, DialogHelper.DIALOG_ERROR, "Erreur d'identification ou de mot de passe. Vérifiez que tous les champs soient valides.", null); progressBar.setVisibility(View.GONE); return ; } else { User user = ObjectUtils.FromJsonSimple(User.class, res); MStorage.MySelf.setProfile(user); Intent myIntent = new Intent(LoginActivity.this, ShargActivity.class); startActivity(myIntent); progressBar.setVisibility(View.GONE); } } catch (ExecutionException | InterruptedException e) { e.printStackTrace(); } progressBar.setVisibility(View.GONE); } } }; }
[ "sandratraniaina@gmail.com" ]
sandratraniaina@gmail.com
44776c2f635758ba7022d57826fd7a38aeb22d58
d5ee590f0e5297ac299f750ff1473ad084ea5c1c
/shop/src/main/java/org/vicrul/shop/Run.java
dda652a4632028e2973003eb8b02d5c17a332492
[]
no_license
VicRul/Shop-Analytics
95a76ccb8415c58da8767b44b724678b0289270d
0d5dd76afb0c50bb45a6351ff495be04b7e48a8d
refs/heads/master
2022-12-13T18:22:59.409010
2020-09-07T06:33:05
2020-09-07T06:33:05
292,586,702
0
0
null
null
null
null
UTF-8
Java
false
false
845
java
package org.vicrul.shop; import org.vicrul.shop.util.Operation; public class Run { public static void main(String[] args) { String inputCommand = "", inputFilePath = "", outputFilePath = ""; try { inputCommand = args[0]; inputFilePath = args[1]; outputFilePath = args[2]; } catch (ArrayIndexOutOfBoundsException e) { System.out.println("Указаны не все входные параметры при запуске.\n " + "Необходимо ввести операцию [search или stat], файл с критериями [*.json], файл для записи [*.json].."); } switch (inputCommand) { case "search": new Operation().search(inputFilePath, outputFilePath); break; case "stat": new Operation().stat(inputFilePath, outputFilePath); break; default: break; } } }
[ "victor@victor-PC" ]
victor@victor-PC
d5eecf3307d818d2735dd3d84812a8698c051d2f
810099d087ddbe965a507bf39208109930fc76cc
/webinvoice/WebInvoice/src/main/java/com/glassbox/webinvoice/server/service/ClientServiceImpl.java
3968ffd12c50cf2030a9daf501b816d79aaf6875
[]
no_license
kloseking7/Development
4d42254cfe559c0f3c583fb0586f6cb2c8a8cbc4
e9d1ac236ade037a93fc6c336454f7f86a3c02f3
refs/heads/master
2021-01-15T23:40:54.331573
2013-06-14T05:41:37
2013-06-14T05:41:37
null
0
0
null
null
null
null
UTF-8
Java
false
false
704
java
///* // * To change this template, choose Tools | Templates // * and open the template in the editor. // */ //package com.glassbox.webinvoice.server.service; // //import com.glassbox.webinvoice.client.service.ClientService; //import com.glassbox.webinvoice.shared.entity.Client; //import com.google.gwt.user.server.rpc.RemoteServiceServlet; //import java.util.List; // ///** // * // * @author mon2 // */ //public class ClientServiceImpl extends RemoteServiceServlet implements // ClientService { // // public List<Client> getClients() { // throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates. // } // //}
[ "wayf128@hotmail.com" ]
wayf128@hotmail.com
1861c303941c6646befb302c85ca86e3b917fbc9
902635bbcefff75ea365e26e26117437ff05dd38
/src/si/formias/gentian/xml/messages/MessagesReply.java
3db429e4d805621786b9646c21aacdb2c8b75775
[]
no_license
mihapirnat/gentiandroid
dc548f0f16ed29db84046cf4404e6a8bd54775e5
8b104592816abc99fa3b261829e83908de96f1c6
refs/heads/master
2016-09-06T12:02:45.292384
2013-08-15T12:36:07
2013-08-15T12:36:07
3,248,733
0
0
null
null
null
null
UTF-8
Java
false
false
639
java
package si.formias.gentian.xml.messages; import java.util.ArrayList; import java.util.List; import org.xml.sax.Attributes; import org.xml.sax.SAXException; import si.formias.gentian.tab.Messages; import si.formias.gentian.xml.Node; public class MessagesReply extends Node { public final List<Message> messages = new ArrayList<Message>(); public MessagesReply(Attributes attributes) throws SAXException { super("MessagesReply", attributes); } @Override public void add(Node n) { super.add(n); if (n instanceof Message) { messages.add((Message) n); } } public void setUser(String user) { set("user", user); } }
[ "miha@formias.si" ]
miha@formias.si
0613b66b2819bf2d6b85a3d5c38fb40630f72f91
0f129d55733bac87f43edaede084b67abac9bca1
/webside/src/test/java/com/redsun/platf/unit/dao/HibernateUtilsTest.java
dc6dea7c06216588d4572f6e947bbd7cb648558f
[]
no_license
jhone/android-untils
dd145b1207c359aa3091d2068543d19ed70de7c2
0b87bd9a100ea31598ff5e81128cca004bf8e011
refs/heads/master
2020-04-06T07:04:08.122827
2013-09-05T02:49:15
2013-09-05T02:49:15
2,262,072
0
0
null
null
null
null
UTF-8
Java
false
false
753
java
package com.redsun.platf.unit.dao; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertTrue; import java.util.List; import org.junit.Test; import com.google.common.collect.Lists; import com.redsun.platf.dao.HibernateUtils; import com.redsun.platf.entity.account.User; public class HibernateUtilsTest { @Test public void mergeByCheckedIds() { User a = new User(); a.setId(1L); User b = new User(); b.setId(1L); List<User> srcList = Lists.newArrayList(a, b); List<Long> idList = Lists.newArrayList(1L, 3L); HibernateUtils.mergeByCheckedIds(srcList, idList, User.class); assertEquals(2, srcList.size()); assertTrue(1L == srcList.get(0).getId()); assertTrue(3L == srcList.get(1).getId()); } }
[ "joker_pan@163.com" ]
joker_pan@163.com
e4de2341a079da18b68c77e27b92ac595c9b6e81
5a9d5a5c36d7d9a3cfeab24cc33ce8862dd524d3
/OOPDevelopmentIOFiles.08/src/info/sjd/service/ServerSessionsService.java
f9f4a4a293a8fc47248dd96e94c7515a9606649d
[]
no_license
trommo/OOPDevIOFiles.08
fbae8b0741e373681750c5208dffc86573867e2d
1146706e01595c2698d11a6dfa447b881b75dd1b
refs/heads/master
2020-04-06T15:04:52.557453
2018-12-10T11:46:39
2018-12-10T11:46:39
157,565,065
0
0
null
null
null
null
UTF-8
Java
false
false
647
java
package info.sjd.service; import java.util.Date; import java.util.Random; public class ServerSessionsService { public static int sessionID() { Random random = new Random(); return 100000000 + random.nextInt(900000000); } public static long sessionStartTime() { Date date = new Date(System.currentTimeMillis()); return date.getTime(); } public static String sessionIP() { Random random = new Random(); return String.valueOf(random.nextInt(255)) + "." + String.valueOf(random.nextInt(255)) + "." + String.valueOf(random.nextInt(255)) + "." + String.valueOf(random.nextInt(255)); } }
[ "ot3@ukr.net" ]
ot3@ukr.net
324e6e1fb887cf00accaef977792ee0c0db94e17
e95de3306902c87b19ddb5cbce77a5602d98ace8
/jingle-server/src/main/java/xz/util/Const.java
d93d5c03b19a65e4374f7d98f6bcf34270815685
[]
no_license
Jingle-seven/demos
04d4805c557450109ba56c7b092c74154c5ee7b1
e5dbc941329842dfdb2199e8e3b71aa1f4a79ae1
refs/heads/master
2021-01-17T01:11:35.908502
2018-11-14T06:21:33
2018-11-14T06:21:33
57,200,394
0
0
null
null
null
null
UTF-8
Java
false
false
249
java
package xz.util; import org.springframework.stereotype.Component; /** * Created by Jinhua on 2017/6/8 15:17. */ @Component public class Const { public static final long NOT_EXIST_ID = -1L; public static final String BLANK_STRING = ""; }
[ "xiong_jinhua@foxmail.com" ]
xiong_jinhua@foxmail.com
98c053bbd637f31b00a610989653e22d650b77ea
d6144fd6571c7c7fa6843892520017dc04317bbb
/src/main/java/io/confluent/connect/elasticsearch/Key.java
f5a81753fed0a0e91572f6768affb6bf31c36039
[ "Apache-2.0" ]
permissive
wirecardBrasil/kafka-connect-elasticsearch
02df38b675f714cf2a06fcd5f7545658f5910a6d
50d33319082e631cb2b335d5603de9d0a2f91826
refs/heads/master
2022-01-10T20:06:19.493003
2018-03-07T16:37:58
2018-03-07T16:37:58
92,126,155
1
0
null
null
null
null
UTF-8
Java
false
false
1,421
java
/** * Copyright 2016 Confluent 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 io.confluent.connect.elasticsearch; import java.util.Objects; public class Key { public final String index; public final String type; public final String id; public Key(String index, String type, String id) { this.index = index; this.type = type; this.id = id; } @Override public boolean equals(Object o) { if (this == o) { return true; } if (o == null || getClass() != o.getClass()) { return false; } Key that = (Key) o; return Objects.equals(index, that.index) && Objects.equals(type, that.type) && Objects.equals(id, that.id); } @Override public int hashCode() { return Objects.hash(index, type, id); } @Override public String toString() { return String.format("Key{%s/%s/%s}", index, type, id); } }
[ "shikhar@confluent.io" ]
shikhar@confluent.io
2ad363c46e5d777517ebdb6b5f7d415808554268
fa91450deb625cda070e82d5c31770be5ca1dec6
/Diff-Raw-Data/14/14_691da3c0e2153a9a1ffa4c8c390f94062ea594cb/AbstractCloudifyWidgetTest/14_691da3c0e2153a9a1ffa4c8c390f94062ea594cb_AbstractCloudifyWidgetTest_t.java
e1982ea1700baf90cad8eef724d13fc59ce6a9cc
[]
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,714
java
package org.cloudifysource.widget.test; import com.google.common.base.Predicate; import org.cloudifysource.widget.beans.JCloudsContext; import org.cloudifysource.widget.beans.TestContext; import org.junit.AfterClass; import org.junit.Assert; import org.junit.Before; import org.junit.BeforeClass; import org.openqa.selenium.*; import org.openqa.selenium.support.ui.FluentWait; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import java.util.Set; import java.util.concurrent.TimeUnit; import java.util.concurrent.atomic.AtomicBoolean; import java.util.concurrent.atomic.AtomicInteger; /** * User: sagib * Date: 06/01/13 * Time: 16:33 */ public class AbstractCloudifyWidgetTest { public static final int NUM_OF_SUITES = 2; protected static WebDriver webDriver; public static final String HOST = context().getTestConf().getHost(); private static AtomicInteger counter = new AtomicInteger(0); private static final int random = (int)(Math.random() * 1000); protected static String PASSWORD = "testTest1" + random + counter.get(); protected static String EMAIL = "test@test" + random + counter.get() + ".com"; protected static String NAME = "test" + random + counter.get(); private static Logger logger = LoggerFactory.getLogger(AbstractCloudifyWidgetTest.class); @BeforeClass public static void before(){ int i = counter.incrementAndGet(); logger.info("before class - starting webDriver counter is at: " + i); webDriver = context().getWebDriver(); webDriver.manage().timeouts().implicitlyWait(10, TimeUnit.SECONDS); webDriver.get(HOST); dropSession(); if(i == 1) subscribe(EMAIL, PASSWORD, NAME); } @Before public void beforeMethod(){ logger.info("before method - log in if not logged in"); if(!isLoggedIn(EMAIL)){ String signinUrl = HOST + "/admin/signin"; if(!signinUrl.equals(webDriver.getCurrentUrl())) { webDriver.get(signinUrl); } logger.info("driver at " + webDriver.getCurrentUrl() + "trying to sign in"); login(EMAIL, PASSWORD); } } @AfterClass public static void after(){ logger.info("after class - counter at: " + counter.get()); if(counter.get() >= NUM_OF_SUITES) { logger.info("after class - closing webDriver"); webDriver.close(); } } protected void waitForElement(final By by) { logger.info("driver at " + webDriver.getCurrentUrl() + " waiting for " + by); FluentWait<By> fw = new FluentWait<By>(by); fw.withTimeout(30, TimeUnit.SECONDS); try{ fw.until(new Predicate<By>(){ @Override public boolean apply(By input) { try{ return webDriver.findElement(by).isDisplayed(); }catch(NoSuchElementException e){ return false; } } }); }catch (TimeoutException e){ logger.error("couldn't find " + by + " at " + webDriver.getCurrentUrl(), e); throw e; } } public static TestContext context(){ return TestContext.get(); } protected void login(String username, String password) { logger.info("driver at " + webDriver.getCurrentUrl() + " trying to login with " + username + ":" + password); dropSession(); By email = By.name("email"); By passwordElem = By.name("password"); By button = By.className("btn-primary"); waitForElement(email); waitForElement(passwordElem); waitForElement(button); webDriver.findElement(email).sendKeys(username); webDriver.findElement(passwordElem).sendKeys(password); logger.info("about to login cookies are : {}", webDriver.manage().getCookies()); webDriver.findElement(button).click(); } protected static void subscribe(String user, String password, String name) { webDriver.get(HOST + "/admin/signup"); logger.info("driver at " + webDriver.getCurrentUrl() + " trying to subscribe with " + user + ":" + password + " and " + name); webDriver.findElement(By.name("email")).sendKeys(user); webDriver.findElement(By.name("firstname")).sendKeys(name); webDriver.findElement(By.name("lastname")).sendKeys(name); webDriver.findElement(By.name("password")).sendKeys(password); webDriver.findElement(By.name("passwordConfirmation")).sendKeys(password); webDriver.findElement(By.className("btn-primary")).click(); } protected void logout() { logger.info("driver at " + webDriver.getCurrentUrl() + " trying to logout"); By logoutBy = By.id("logout"); waitForElement(logoutBy); webDriver.findElement(logoutBy).click(); } protected void assertUserIsLoggedIn() { assertUserIsLoggedIn(30); } protected void assertUserIsLoggedIn(int seconds) { logger.info("driver at " + webDriver.getCurrentUrl() + " asserting logged in"); FluentWait<By> fw = new FluentWait<By>(By.id("username")); fw.withTimeout(seconds, TimeUnit.SECONDS); try{ fw.until(new Predicate<By>() { @Override public boolean apply(By input) { try { return isLoggedIn(EMAIL); } catch (NoSuchElementException e) { return false; } } }); }catch (TimeoutException e){ logger.error("couldn't find username at " + webDriver.getCurrentUrl(), e); throw e; } } protected boolean isLoggedIn(String email) { WebElement username = webDriver.findElement(By.id("username")); return username != null && username.isDisplayed() && email!= null && email.equals(username.getText()); } protected void assertLoggedOut() { webDriver.get(HOST); logger.info("driver at " + webDriver.getCurrentUrl() + " asserting logged out"); Set<Cookie> cookies = null; try{ cookies = webDriver.manage().getCookies(); }catch (IllegalArgumentException e){} if(cookies != null){ Assert.assertFalse("authToken cookie is still defined", cookies.contains("authToken")); Assert.assertFalse("\"PLAY_SESSION cookie is still defined\"", cookies.contains("PLAY_SESSION")); } } protected String changePassword(String password, String newPassword) { logger.info("driver at " + webDriver.getCurrentUrl() + " trying to change password from: " + password + "to " + newPassword); webDriver.findElement(By.id("account")).click(); logger.info("driver at " + webDriver.getCurrentUrl()); waitForElement(By.id("oldPassword")); webDriver.findElement(By.id("oldPassword")).sendKeys(password); webDriver.findElement(By.id("newPassword")).sendKeys(newPassword); webDriver.findElement(By.id("confirmPassword")).sendKeys(newPassword); webDriver.findElement(By.className("btn-primary")).click(); waitForElement(By.className("alert-success")); return newPassword; } protected static void dropSession(){ webDriver.manage().deleteAllCookies(); } }
[ "yuzhongxing88@gmail.com" ]
yuzhongxing88@gmail.com
b362ce359edeea368623e57087a090b9f74474de
4e62695d85812320f1484bee7e73b596002e682b
/src/main/java/codingbatpractice/logic1/DateFashion.java
52e43067d234b076142ed61455d7e82a89bcb55d
[]
no_license
antaramimi/java-problem
9d9fb541938ba6784d30437f306b6c7b6bb6bcbb
d225f2f40a8bde26ec971a814af48639bc6a2228
refs/heads/master
2022-12-20T06:53:54.423524
2020-09-28T14:13:29
2020-09-28T14:13:29
254,904,937
0
0
null
2020-10-13T23:10:29
2020-04-11T16:08:35
Java
UTF-8
Java
false
false
386
java
package codingbatpractice.logic1; public class DateFashion { public static void main(String[] args) { dateFashion(5, 10); } public static int dateFashion(int you, int date) { if (you <= 2 || date <= 2){ return 0; } if(you >= 8 || date >= 8) { return 2; } else { return 1; } } }
[ "antaramimi@gmail.com" ]
antaramimi@gmail.com
440589a0d62752b756a9b205306d3f1ea7aeb09e
04597f2acead47021b4f3fe38884a6651af875c5
/microservices/SpringCloudExamples/spring-cloud-config-bus-rabbitMQ/spring-cloud-eureka-provider-2/src/main/java/io/ymq/example/eureka/provider/EurekaProviderApplication.java
628c43b7c1174aa2ec5e441d7d4353c3adcd320c
[]
no_license
sckocn/Arduino
b0ab77f615ccb5253c1a425b3ee713969f92d078
f2c7091915f6694a9456540adcc6bb5be2a087e5
refs/heads/main
2023-05-07T23:31:41.490354
2021-05-07T12:34:38
2021-05-07T12:34:38
null
0
0
null
null
null
null
UTF-8
Java
false
false
943
java
package io.ymq.example.eureka.provider; import org.springframework.beans.factory.annotation.Value; import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.SpringBootApplication; import org.springframework.cloud.context.config.annotation.RefreshScope; import org.springframework.cloud.netflix.eureka.EnableEurekaClient; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RestController; @RefreshScope @RestController @EnableEurekaClient @SpringBootApplication public class EurekaProviderApplication { @Value("${content}") String content; @Value("${server.port}") String port; @RequestMapping("/") public String home() { return "Hello world ,port:" + port+",content="+content; } public static void main(String[] args) { SpringApplication.run(EurekaProviderApplication.class, args); } }
[ "47933514+bluedot42@users.noreply.github.com" ]
47933514+bluedot42@users.noreply.github.com
68c372c41c581f4928873fc8885f2ef651eadd43
6dde7dea1f0f38da1d9ede3775b6476b201e3c76
/src/game/text/ActionContinued.java
f3f47ba347f8ccfa5f066ff48ba8c3560dfc1ad6
[]
no_license
creekfish/JavaVampire
e438fe377625766c6d80f2f74c9433942592e5e6
56edfa8833262db6fc2ee8405bd52072ddadbdcb
refs/heads/master
2021-01-19T17:48:14.955154
2020-03-21T17:22:03
2020-03-21T17:22:03
3,586,893
2
1
null
null
null
null
UTF-8
Java
false
false
207
java
package game.text; public abstract class ActionContinued extends ActionGeneric { public ActionContinued(String name) { super(name); } abstract public Result execute(Actor actor, String feedback); }
[ "arcreekfish@gmail.com" ]
arcreekfish@gmail.com
063985a311cea3d77a4b32e551914db17bc553e9
ac1d2cd44e3ac4a05d8bdf524f2b5980f2e2bb81
/EjemplosMpj/src/daoc/mpj/HolaMundo.java
e48d0eb47b8aa16a841f498b16058d88db6f0dbc
[]
no_license
daoc-distrapp/MPJ-Ejemplos
50e8b6acbae43c78a213c30e0a41e20d8482724f
4423839fe920b65696a8741e0dbaf484cefab7bb
refs/heads/master
2023-06-25T19:20:22.768295
2021-07-28T17:35:01
2021-07-28T17:35:01
null
0
0
null
null
null
null
UTF-8
Java
false
false
301
java
package daoc.mpj; import mpi.MPI; public class HolaMundo { public static void main(String[] args) { MPI.Init(args); int rank = MPI.COMM_WORLD.Rank(); int size = MPI.COMM_WORLD.Size(); System.out.println("Hola # " + rank + " de " + size); MPI.Finalize(); } }
[ "diego.ordonez@gmail.com" ]
diego.ordonez@gmail.com
b63a68ae81771fdfe41c0ce875f6c850b9bbe4bf
a4a51084cfb715c7076c810520542af38a854868
/src/main/java/com/shopee/app/instagram/h.java
fb2471eb559d2665ba09e4c9fb586eaf237423d7
[]
no_license
BharathPalanivelu/repotest
ddaf56a94eb52867408e0e769f35bef2d815da72
f78ae38738d2ba6c9b9b4049f3092188fabb5b59
refs/heads/master
2020-09-30T18:55:04.802341
2019-12-02T10:52:08
2019-12-02T10:52:08
null
0
0
null
null
null
null
UTF-8
Java
false
false
1,148
java
package com.shopee.app.instagram; public class h { /* renamed from: a reason: collision with root package name */ private String f17763a; /* renamed from: b reason: collision with root package name */ private String f17764b; /* renamed from: c reason: collision with root package name */ private String f17765c; /* renamed from: d reason: collision with root package name */ private int f17766d; /* renamed from: e reason: collision with root package name */ private int f17767e; public int a() { return this.f17766d; } public void a(int i) { this.f17766d = i; } public int b() { return this.f17767e; } public void b(int i) { this.f17767e = i; } public String c() { return this.f17763a; } public void a(String str) { this.f17763a = str; } public String d() { return this.f17765c; } public void b(String str) { this.f17765c = str; } public String e() { return this.f17764b; } public void c(String str) { this.f17764b = str; } }
[ "noiz354@gmail.com" ]
noiz354@gmail.com
479df15c93989cb747a51e10f05e97f0eb389d0d
45473f913823f02ff26f2b6f96dbdbb046ca8837
/AJP/Assignment4/src/de/uniba/wiai/dsg/ajp/assignment4/issuetracking/logic/Project.java
9631df01be158080136592871a5351bbe9ad7223
[]
no_license
Arosares/studies
4e3c7bf38fa9995e093d98fd57319749d419fd78
5c969199fdd769a21e5b78cf50165b531c91ebce
refs/heads/master
2021-01-17T13:09:44.318574
2018-10-10T21:34:01
2018-10-10T21:34:01
56,220,114
0
0
null
null
null
null
UTF-8
Java
false
false
497
java
package de.uniba.wiai.dsg.ajp.assignment4.issuetracking.logic; import java.util.LinkedList; import java.util.List; import javax.xml.bind.annotation.XmlElement; import javax.xml.bind.annotation.XmlRootElement; @XmlRootElement public class Project { private List<Issue> issues = new LinkedList<>(); public Project() { super(); } @XmlElement(name = "issue") public List<Issue> getIssues() { return issues; } public void setIssues(List<Issue> issues) { this.issues = issues; } }
[ "frank-phillip.kessler@stud.uni-bamberg.de" ]
frank-phillip.kessler@stud.uni-bamberg.de
203fa4f7251de2d96c7fdae357fd8d408fe0ac70
ef6b1db102352cd3969a840054cbd31804a4a972
/src/main/java/com/sishuok/jiangzh/archi/designs/abstrct_factory/impl/ProductB1.java
e9d895e1579ca88755e634ce38f5cef79cf98484
[]
no_license
woaijiadanoo/archi-project
c3217a20144c215d6970fcee657e86b0f1acc247
9acbd6bc7ff99f9a439e8849fd51a1918a143229
refs/heads/master
2023-01-01T06:58:41.585813
2020-10-25T14:41:38
2020-10-25T14:41:38
288,897,676
0
0
null
null
null
null
UTF-8
Java
false
false
118
java
package com.sishuok.jiangzh.archi.designs.abstrct_factory.impl; public class ProductB1 implements AbstrctProductB{ }
[ "jiangzh@sina.com" ]
jiangzh@sina.com
9976299ea1cf3c596ac20aa623ff02a8327385d3
288094cee11dbafabe84fe9c6d0427ccabc5d035
/src/main/java/com/community/util/AES256Util.java
f14b35d202aaf27a0aa203b918ce1615178d7e33
[]
no_license
yougtack/community_server
8256ce24d24e5e89663bbdc3caf50f0a82d73274
0d0bdb102c14ea499bcff0aa419833f173ac289b
refs/heads/master
2023-03-02T08:11:07.754289
2021-02-09T06:00:46
2021-02-09T06:00:46
322,440,671
0
0
null
null
null
null
UTF-8
Java
false
false
2,378
java
package com.community.util; import org.apache.tomcat.util.codec.binary.Base64; import javax.crypto.BadPaddingException; import javax.crypto.Cipher; import javax.crypto.IllegalBlockSizeException; import javax.crypto.NoSuchPaddingException; import javax.crypto.spec.IvParameterSpec; import javax.crypto.spec.SecretKeySpec; import java.io.UnsupportedEncodingException; import java.security.InvalidAlgorithmParameterException; import java.security.InvalidKeyException; import java.security.Key; import java.security.NoSuchAlgorithmException; public class AES256Util { private static String iv; private static Key keySpec; public AES256Util() throws UnsupportedEncodingException { String key = "PBKDF2WithHmacSH"; this.iv = key.substring(0, 16); byte[] keyBytes = new byte[16]; byte[] b = key.getBytes("UTF-8"); int len = b.length; if (len > keyBytes.length) { len = keyBytes.length; } System.arraycopy(b, 0, keyBytes, 0, len); SecretKeySpec keySpec = new SecretKeySpec(keyBytes, "AES"); this.keySpec = keySpec; } // 암호화 public static String aesEncode(String str) throws java.io.UnsupportedEncodingException, NoSuchAlgorithmException, NoSuchPaddingException, InvalidKeyException, InvalidAlgorithmParameterException, IllegalBlockSizeException, BadPaddingException { Cipher c = Cipher.getInstance("AES/CBC/PKCS5Padding"); c.init(Cipher.ENCRYPT_MODE, keySpec, new IvParameterSpec(iv.getBytes())); byte[] encrypted = c.doFinal(str.getBytes("UTF-8")); String enStr = new String(Base64.encodeBase64(encrypted)); return enStr; } //복호화 public static String aesDecode(String str) throws java.io.UnsupportedEncodingException, NoSuchAlgorithmException, NoSuchPaddingException, InvalidKeyException, InvalidAlgorithmParameterException, IllegalBlockSizeException, BadPaddingException { Cipher c = Cipher.getInstance("AES/CBC/PKCS5Padding"); c.init(Cipher.DECRYPT_MODE, keySpec, new IvParameterSpec(iv.getBytes("UTF-8"))); byte[] byteStr = Base64.decodeBase64(str.getBytes()); return new String(c.doFinal(byteStr),"UTF-8"); } }
[ "yt.kim@how2marry.com" ]
yt.kim@how2marry.com
90071b77086ee10d3c57c0263dec41f2e36d7567
ef03146bcda02dbaaa070d8ee74c73daa5369ee6
/src/main/java/de/root1/rooteventbus/RootEventBus.java
f8b24c6de1228d7f5af7e21664876aea4a01d2b0
[]
no_license
tuxedo0801/RootEventBus
cd1e7dca8bfff240d76bb31a6dea283d78ffc143
b47b0ab0824877da032e80412b1ecca54fb29ee4
refs/heads/master
2021-01-10T03:02:15.230119
2019-05-29T13:01:34
2019-05-29T13:01:34
44,320,188
0
0
null
null
null
null
UTF-8
Java
false
false
10,000
java
/* * Copyright (C) 2015 Alexander Christian <alex(at)root1.de>. All rights reserved. * * This file is part of RootEventBus (REB). * * REB 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. * * REB 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 REB. If not, see <http://www.gnu.org/licenses/>. */ package de.root1.rooteventbus; import java.lang.reflect.Method; import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Map; import java.util.concurrent.ExecutorService; import java.util.concurrent.Executors; import java.util.concurrent.ThreadFactory; import java.util.concurrent.atomic.AtomicInteger; import org.slf4j.Logger; import org.slf4j.LoggerFactory; /** * An Event Bus implementation, inspired by greenrobot (http://greenrobot.de) */ public class RootEventBus { private final static Logger log = LoggerFactory.getLogger(RootEventBus.class); private final Map<Class, List<Listener>> listeners = new HashMap<>(); private final Map<Class, List<Listener>> backgroundThreadListeners = new HashMap<>(); private final Map<Class, List<Listener>> asyncBackgroundThreadListeners = new HashMap<>(); private final Map<Class<?>, Object> stickyEvents = new HashMap<>(); private final ExecutorService backgroundThreadPool = Executors.newCachedThreadPool(new ThreadFactory() { AtomicInteger i = new AtomicInteger(0); @Override public Thread newThread(Runnable r) { Thread thread = new Thread(r, "EventBus#BackgroundThreadPool(" + i.getAndIncrement() + ")"); thread.setDaemon(true); return thread; } }); private static final RootEventBus defaultInstance = new RootEventBus(); /** * Returns default singleton instance */ public static RootEventBus getDefault() { return defaultInstance; } /** * Post an event * @param event event object * @param sticky sticky-flag * @see RootEventBus#getStickyEvent(java.lang.Class) */ private void post(Object event, boolean sticky) { Class<? extends Object> eventType = event.getClass(); boolean subscriberFound = false; if (sticky) { synchronized (stickyEvents) { stickyEvents.put(eventType, event); } } List<Listener> listener = listeners.get(eventType); if (listener != null) { subscriberFound = listener.size() > 0; // crazy shit from Java8 ;-) listener.stream().forEach((l) -> { l.post(event); }); } List<Listener> backgroundListener = backgroundThreadListeners.get(eventType); if (backgroundListener != null) { subscriberFound = backgroundListener.size() > 0; backgroundThreadPool.execute(() -> { backgroundListener.stream().forEach((l) -> { l.post(event); }); }); } List<Listener> asyncListener = asyncBackgroundThreadListeners.get(eventType); if (asyncListener != null) { subscriberFound = asyncListener.size() > 0; asyncListener.stream().forEach((l) -> { backgroundThreadPool.execute(() -> { l.post(event); }); }); } if (!subscriberFound && event.getClass() != NoSubscriberEvent.class) { post(new NoSubscriberEvent(this, event)); } } /** * Post an event * @param event event object */ public void post(Object event) { post(event, false); } /** * Post an event as an sticky event * @param event event object * @see RootEventBus#getStickyEvent(java.lang.Class) */ public void postSticky(Object event) { post(event, true); } /** * Unregister a subscriber * @param subscriber subscriber to unregister */ public void unregister(Object subscriber) { List<SubscriberMethod> subscriberMethods = SubscriberMethod.getSubscriberMethods(subscriber); for (SubscriberMethod subscriberMethod : subscriberMethods) { Class eventType = subscriberMethod.getEventType(); Method method = subscriberMethod.getMethod(); String methodName = subscriberMethod.getMethod().getName(); /* * Check if method is a "onEvent..." method and set the target listener map */ Map<Class, List<Listener>> targetMap = null; switch (methodName) { case "onEvent": log.debug("Found 'onEvent' for {} in {}", eventType, subscriber.getClass()); targetMap = listeners; break; case "onEventBackgroundThread": log.debug("Found 'onEventBackgroundThread' for {} in {}", eventType, subscriber.getClass()); targetMap = backgroundThreadListeners; break; case "onEventAsync": log.debug("Found 'onEventAsync' for {} in {}", eventType, subscriber.getClass()); targetMap = asyncBackgroundThreadListeners; break; } // if target listener map is set, method is a onEvent method, otherwise skip if (targetMap != null) { Listener l = new Listener(subscriber, method); List<Listener> listenerList = targetMap.get(eventType); listenerList.remove(l); } } } /** * Register an object as an sticky event receiver * @param subscriber subscriber object * @see RootEventBus#getStickyEvent(java.lang.Class) */ public void registerSticky(Object subscriber) { register(subscriber, true); } /** * Register an object as an event receiver * @param subscriber subscriber object */ public void register(Object subscriber) { register(subscriber, false); } /** * Register an object as an receiver * @param subscriber subscriber object * @param sticky register as sticky receiver as well. * @see RootEventBus#getStickyEvent(java.lang.Class) */ private void register(Object subscriber, boolean sticky) { List<SubscriberMethod> subscriberMethods = SubscriberMethod.getSubscriberMethods(subscriber); for (SubscriberMethod subscriberMethod : subscriberMethods) { Class eventType = subscriberMethod.getEventType(); Method method = subscriberMethod.getMethod(); String methodName = subscriberMethod.getMethod().getName(); /* * Check if method is a "onEvent..." method and set the target listener map */ Map<Class, List<Listener>> targetMap = null; switch (methodName) { case "onEvent": log.debug("Found 'onEvent' for {} in {}", eventType, subscriber.getClass()); targetMap = listeners; break; case "onEventBackgroundThread": log.debug("Found 'onEventBackgroundThread' for {} in {}", eventType, subscriber.getClass()); targetMap = backgroundThreadListeners; break; case "onEventAsync": log.debug("Found 'onEventAsync' for {} in {}", eventType, subscriber.getClass()); targetMap = asyncBackgroundThreadListeners; break; } // if target listener map is set, method is a onEvent method, otherwise skip if (targetMap != null) { log.trace("eventType: {}", eventType); Listener l = new Listener(subscriber, method); List<Listener> listenerList = targetMap.get(eventType); if (listenerList == null) { listenerList = new ArrayList<>(); targetMap.put(eventType, listenerList); } listenerList.add(l); if (sticky) { synchronized (stickyEvents) { Object event = stickyEvents.get(eventType); if (event != null) { l.post(event); } } } } } } /** * Returns last sticky event for given event type * * @param <T> type of event * @param eventType event class * @return event instance */ public <T> T getStickyEvent(Class<T> eventType) { synchronized (stickyEvents) { return eventType.cast(stickyEvents.get(eventType)); } } /** * Just for testing * @param args */ public static void main(String[] args) { Object o = new Object() { public void onEventAsync(NoSubscriberEvent event) { System.out.println("Do nothing: " + event.toString()); } }; RootEventBus.getDefault().postSticky(new NoSubscriberEvent(defaultInstance, null)); RootEventBus.getDefault().registerSticky(o); RootEventBus.getDefault().post(new NoSubscriberEvent(defaultInstance, null)); RootEventBus.getDefault().unregister(o); RootEventBus.getDefault().post(new NoSubscriberEvent(defaultInstance, null)); } }
[ "alex@root1.de" ]
alex@root1.de
52ad3ef727953f0a4841205ad37a66b649b648a6
0105643594df7298bf2652afa06eb865371f1864
/Ever/src/com/widget/xlvfresh/XListViewFooter.java
05fefcf8411209cea8df261cb22109a7ff253d0b
[]
no_license
ForeverTeam/PRO
2697e277cf59363a8056b22cb9af6474d086d6cb
378e0d0f95e0ef97575255661bd039dfc2ea2e30
refs/heads/master
2021-01-13T02:18:28.355299
2015-01-11T15:06:43
2015-01-11T15:06:43
29,006,461
0
0
null
null
null
null
UTF-8
Java
false
false
3,226
java
package com.widget.xlvfresh; /** * @create Mar 31, 2012 9:33:43 PM * @author Maxwin * @description XListView's footer */ import android.content.Context; import android.util.AttributeSet; import android.view.LayoutInflater; import android.view.View; import android.widget.LinearLayout; import android.widget.TextView; import com.ft.ever.R; public class XListViewFooter extends LinearLayout { public final static int STATE_NORMAL = 0; public final static int STATE_READY = 1; public final static int STATE_LOADING = 2; private Context mContext; private View mContentView; private View mProgressBar; private TextView mHintView; public XListViewFooter(Context context) { super(context); initView(context); } public XListViewFooter(Context context, AttributeSet attrs) { super(context, attrs); initView(context); } public void setState(int state) { mHintView.setVisibility(View.INVISIBLE);// 开始底部控件都隐藏 mProgressBar.setVisibility(View.INVISIBLE); mHintView.setVisibility(View.INVISIBLE); if (state == STATE_READY) {// 如果是第一页状态,那么“查看更多”显示 mHintView.setVisibility(View.VISIBLE); mHintView.setText(R.string.xlistview_footer_hint_ready);// 松开显示更多 } else if (state == STATE_LOADING) {// 当加载的时候 mProgressBar.setVisibility(View.VISIBLE);// 加载进度条显示 } else { mHintView.setVisibility(View.VISIBLE); mHintView.setText(R.string.xlistview_footer_hint_normal);// 查看更多 } } public void setBottomMargin(int height) { if (height < 0) return; LinearLayout.LayoutParams lp = (LinearLayout.LayoutParams) mContentView .getLayoutParams(); lp.bottomMargin = height; mContentView.setLayoutParams(lp); } public int getBottomMargin() { LinearLayout.LayoutParams lp = (LinearLayout.LayoutParams) mContentView .getLayoutParams(); return lp.bottomMargin; } /** * normal status */ public void normal() { mHintView.setVisibility(View.VISIBLE); mProgressBar.setVisibility(View.GONE); } /** * loading status */ public void loading() { mHintView.setVisibility(View.GONE); mProgressBar.setVisibility(View.VISIBLE); } /** * 当禁用拉加载更多隐藏底部视图 */ public void hide() { LinearLayout.LayoutParams lp = (LinearLayout.LayoutParams) mContentView .getLayoutParams(); lp.height = 0; mContentView.setLayoutParams(lp); } /** * 显示底部视图 */ public void show() { LinearLayout.LayoutParams lp = (LinearLayout.LayoutParams) mContentView .getLayoutParams(); lp.height = LayoutParams.WRAP_CONTENT; mContentView.setLayoutParams(lp); } private void initView(Context context) { mContext = context; LinearLayout moreView = (LinearLayout) LayoutInflater.from(mContext) .inflate(R.layout.xlistview_footer, null); addView(moreView); moreView.setLayoutParams(new LinearLayout.LayoutParams( LayoutParams.FILL_PARENT, LayoutParams.WRAP_CONTENT)); mContentView = moreView.findViewById(R.id.xlistview_footer_content); mProgressBar = moreView.findViewById(R.id.xlistview_footer_progressbar); mHintView = (TextView) moreView .findViewById(R.id.xlistview_footer_hint_textview); } }
[ "hook.dengzwre@gmail.com" ]
hook.dengzwre@gmail.com
50e1eb1d9b3eb75c6def7917070be2491cedf547
05f8742d00fddaba3acbd24776992912a568175e
/er_ci_yuan/service/service_acl/src/main/java/cn/antigenmhc/otaku/service/acl/pojo/Role.java
4c0a315a59cc9084bf2b4edb98d8647a407462c6
[]
no_license
iwakura-lain/ErCiYuan
50c7d91567d553b8023e226886d1870e717a20fb
9614849b956278120376a3326399288c6081a0d6
refs/heads/master
2023-04-22T19:14:46.147123
2021-05-08T00:01:04
2021-05-08T00:01:04
325,428,148
27
4
null
null
null
null
UTF-8
Java
false
false
1,169
java
package cn.antigenmhc.otaku.service.acl.pojo; import cn.antigenmhc.otaku.service.base.pojo.BasePojo; import com.baomidou.mybatisplus.annotation.TableName; import com.baomidou.mybatisplus.annotation.IdType; import java.util.Date; import com.baomidou.mybatisplus.annotation.TableId; 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 antigenmhc * @since 2021-02-07 */ @Data @EqualsAndHashCode(callSuper = false) @Accessors(chain = true) @TableName("acl_role") @ApiModel(value="Role对象", description="") public class Role extends BasePojo implements Serializable { private static final long serialVersionUID = 1L; @ApiModelProperty(value = "角色名称") private String roleName; @ApiModelProperty(value = "角色编码") private String roleCode; @ApiModelProperty(value = "备注") private String remark; @ApiModelProperty(value = "逻辑删除 1(true)已删除, 0(false)未删除") private Boolean isDeleted; }
[ "5342263+antigenmhc@user.noreply.gitee.com" ]
5342263+antigenmhc@user.noreply.gitee.com
dceebc502e76dfa7a27dbf2bf11a4e0ce1a7293e
6028e115b09b0d04792291dc205615c6fdd47ba4
/src/com/woniuxy/shopping/listener/LoginListener.java
9eafc7cd7f13540796112d73aa43fcbeea635f4c
[]
no_license
renqiang666/ShoppingMall
24ae1e30fa5f76ccc207402637df0825e2c187c5
1891e902e4f42435fd470a674d2331eb7324efbb
refs/heads/master
2020-03-30T03:20:44.285395
2018-09-28T03:59:35
2018-09-28T03:59:35
150,683,563
0
0
null
null
null
null
UTF-8
Java
false
false
2,062
java
package com.woniuxy.shopping.listener; import java.util.Hashtable; import javax.servlet.annotation.WebListener; import javax.servlet.http.HttpSession; import javax.servlet.http.HttpSessionAttributeListener; import javax.servlet.http.HttpSessionBindingEvent; /** * Application Lifecycle Listener implementation class LoginListener * */ @WebListener public class LoginListener implements HttpSessionAttributeListener { Hashtable<String,HttpSession> map=new Hashtable<String,HttpSession>(); /** * Default constructor. */ public LoginListener() { // TODO Auto-generated constructor stub } /** * @see HttpSessionAttributeListener#attributeAdded(HttpSessionBindingEvent) */ public void attributeAdded(HttpSessionBindingEvent arg0) { //获取当前事件的属性名和属性值 String key=arg0.getName(); Object value=arg0.getValue(); //判断当前属性是否是account if(key.equals("account")){ //获取当前的session HttpSession currentSession=arg0.getSession(); //将属性值强转为String类型 String account=(String)value; //获取旧session HttpSession oldSession=map.get(account); //判断新旧session是否一致 if((oldSession!=null)&& !(oldSession.getId().equals(currentSession.getId()))){ //将oldSession里的登录状态删除 oldSession.removeAttribute("account"); } //将新session存放到map里 //System.out.println("account为"+account); map.put(account, currentSession); } } /** * @see HttpSessionAttributeListener#attributeRemoved(HttpSessionBindingEvent) */ public void attributeRemoved(HttpSessionBindingEvent arg0) { // TODO Auto-generated method stub } /** * @see HttpSessionAttributeListener#attributeReplaced(HttpSessionBindingEvent) */ public void attributeReplaced(HttpSessionBindingEvent arg0) { // TODO Auto-generated method stub } }
[ "652081631@qq.com" ]
652081631@qq.com
422778c3f4e805ccf690a0bb8a4a0dc77a133af2
208339e78b3e7ed5272cf6f6bd6ee4d1be321196
/CoreJava/src/com/generics/Gold.java
e882d6554ab47bfc590343ff8e991bafeed7709e
[]
no_license
rsrai1992/CoreJavaCode
8ca4ee788468df7ceac3d4f86ac44f5ffed09c26
99eaabfa4de4fcfdcaf3875e676d46e1cfe912c0
refs/heads/master
2022-12-12T07:47:04.145307
2019-11-23T18:58:18
2019-11-23T18:58:18
223,636,930
0
0
null
2022-11-24T09:19:57
2019-11-23T18:45:43
Java
UTF-8
Java
false
false
287
java
package com.generics; public class Gold { String accountType; public Gold(String accountType) { this.accountType = accountType; } public String getAccountType() { return accountType; } public void setAccountType(String accountType) { this.accountType = accountType; } }
[ "ravi.rai@novopay.in" ]
ravi.rai@novopay.in
14832629ec5536481f729c920679c0778dc409f4
d9cfa9c2ee885107f118a43700711e9d3978ae68
/app/src/test/java/com/royale/preferencescreen/ExampleUnitTest.java
da426fa8d97e7006d9dce14e89f67d614e170594
[]
no_license
KostyaGig/PreferenceScreen
1d17ac3b073836de10b925548f0c74b32033040e
954011c3ec97eafa35bbf21acaaf88ac327ef237
refs/heads/master
2022-11-30T12:50:02.995645
2020-08-10T14:43:50
2020-08-10T14:43:50
286,502,806
0
0
null
null
null
null
UTF-8
Java
false
false
388
java
package com.royale.preferencescreen; import org.junit.Test; import static org.junit.Assert.*; /** * Example local unit test, which will execute on the development machine (host). * * @see <a href="http://d.android.com/tools/testing">Testing documentation</a> */ public class ExampleUnitTest { @Test public void addition_isCorrect() { assertEquals(4, 2 + 2); } }
[ "k.gig@list.ru" ]
k.gig@list.ru
90f5a79d34fff94f79af315ec64582f353945108
2896e00f5a8b8c32b843965cd65527655d610b08
/spring-cloud-play-consumer1/src/main/java/com/eale/consumer1/remote/CloudProducerRemote.java
2222cfe8f06c28973b2a5993f0ceb425caea5a5f
[]
no_license
Eale001/spring-cloud-play-demo
87b183d2c4c529bcfee5bffda7720e96d5f52ea2
ba17108822d19d3cd137255f0f1a94d899bdac90
refs/heads/master
2023-03-14T16:25:45.050991
2021-04-02T09:06:35
2021-04-02T09:06:35
322,481,896
0
0
null
null
null
null
UTF-8
Java
false
false
764
java
package com.eale.consumer1.remote; import org.springframework.cloud.openfeign.FeignClient; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RequestParam; import java.util.Map; /** * @Author Admin * @Date 2020/12/17 * @Description // 远程调用 * @Version 1.0 **/ @FeignClient(name = "cloud-producer",fallback = CloudProducerRemoteHystrix.class) public interface CloudProducerRemote { @GetMapping("/hello/test") public String hello(@RequestParam("name") String name); @PostMapping("/order/add") public String addOrder(@RequestBody Map<String,Object> map); }
[ "Wg2qKUUpnt1EzNugcJbZ" ]
Wg2qKUUpnt1EzNugcJbZ
90d15c2c6db4f50a32a622c1d73f1c159be40208
2f90dcc192593777f1eaf07a84b23dfd22d65d11
/msa2-svc-member/src/main/java/com/msa_sample02/svc/member/config/RibbonConfig.java
16af336f1dab1be9bbb61dbd824cefcb5902891b
[]
no_license
Sokju/msa_sample02
562a04674bf25bd1529df1506d7aef7f8a09277f
0d671ca8a955cfa8ceb988b3a525681f93029692
refs/heads/master
2021-01-01T14:05:52.071566
2020-06-28T12:57:23
2020-06-28T12:57:23
239,311,815
0
0
null
null
null
null
UTF-8
Java
false
false
678
java
package com.msa_sample02.svc.member.config; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.context.annotation.Bean; import com.netflix.client.config.IClientConfig; import com.netflix.loadbalancer.AvailabilityFilteringRule; import com.netflix.loadbalancer.IPing; import com.netflix.loadbalancer.IRule; import com.netflix.loadbalancer.PingUrl; public class RibbonConfig { @Autowired IClientConfig ribbonClientConfig; @Bean public IPing ribbonPing(IClientConfig config) { return new PingUrl(); } @Bean public IRule ribbonRule(IClientConfig config) { return new AvailabilityFilteringRule(); } }
[ "sjuhwang@sjuhwang" ]
sjuhwang@sjuhwang
25b4b9c05c10bccb135056abd7d12bf6179eda97
0dae46977a1a944d9997edf4944238830b914112
/Spid/app/src/main/java/com/sumit/spid/mydelivery/adapter/TrackAdapter.java
dd06972330972dbff516189cc464611a17995f09
[]
no_license
sumit1206/Spid
be60a58aa11691190ceb0fcdbe1d1d3a82c5201a
c5dfd0a6f4c2f2a13c8497cd18b66dcb04214d40
refs/heads/master
2022-06-23T06:58:25.788559
2020-05-09T15:18:57
2020-05-09T15:18:57
262,599,115
0
0
null
null
null
null
UTF-8
Java
false
false
2,092
java
package com.sumit.spid.mydelivery.adapter; import android.content.Context; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; import android.widget.TextView; import androidx.annotation.NonNull; import androidx.recyclerview.widget.RecyclerView; import com.github.vipulasri.timelineview.TimelineView; import com.sumit.spid.R; import com.sumit.spid.mydelivery.MyDeliveryDetails; import com.sumit.spid.mydelivery.data.TrackData; import java.util.List; public class TrackAdapter extends RecyclerView.Adapter<TrackAdapter.MyViewHolder> { private Context deliveryTrackContext; private List<TrackData> deliveryTrackArryList; public TrackAdapter(MyDeliveryDetails deliveryTrackContext, List<TrackData> deliveryTrackArryList) { this.deliveryTrackArryList = deliveryTrackArryList; this.deliveryTrackContext = deliveryTrackContext; } public class MyViewHolder extends RecyclerView.ViewHolder { TextView dateTime,parcel_position; TimelineView timelineView; public MyViewHolder(@NonNull View itemView) { super(itemView); dateTime = itemView.findViewById(R.id.date_time); parcel_position = itemView.findViewById(R.id.parcel_position); // timelineView = itemView.findViewById(R.id.timeline); } } @NonNull @Override public TrackAdapter.MyViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) { View itemView = LayoutInflater.from(parent.getContext()).inflate(R.layout.custom_tracking_details, parent, false); return new TrackAdapter.MyViewHolder(itemView); } @Override public void onBindViewHolder(@NonNull TrackAdapter.MyViewHolder holder, int position) { TrackData trackData = deliveryTrackArryList.get(position); holder.dateTime.setText(trackData.getTimeStamp()); holder.parcel_position.setText(trackData.getPacketPosition()); } @Override public int getItemCount() { return deliveryTrackArryList.size(); } }
[ "sumit.goghat2016@gmail.com" ]
sumit.goghat2016@gmail.com
79105c73626be953b8a37d7f3f910a5fa3b88300
3be882fcb951546f6676e2038f7e89d913367911
/src/main/java/com/example/demo/model/AyUser.java
77e4aaf702c8ec8517b075f2cadd48702f1f58fd
[]
no_license
quanlidavid/springbootEXP
8c740b62fe6260fc3c644f9c6d6102f94a340645
acfa0cb9aadb3be35ca351ed8ee4f013db6ac026
refs/heads/master
2020-04-23T12:51:39.311518
2019-02-19T22:20:53
2019-02-19T22:20:53
171,183,083
0
0
null
null
null
null
UTF-8
Java
false
false
735
java
package com.example.demo.model; import javax.persistence.Entity; import javax.persistence.Id; import javax.persistence.Table; /** * 用户表 */ @Entity @Table(name = "ay_user") public class AyUser { //主键 @Id private String id; //用户名 private String name; //密码 private String password; public String getId() { return id; } public void setId(String id) { this.id = id; } public String getName() { return name; } public void setName(String name) { this.name = name; } public String getPassword() { return password; } public void setPassword(String password) { this.password = password; } }
[ "quanlidavid@gmail.com" ]
quanlidavid@gmail.com
57886cabae518634c64160ed95b0b2d641ab69dd
c4bbace6bf09e90556c188d77a3f515621276323
/src/main/java/com/agroknow/schema/agrisap/AgsRelationIsTranslationOf.java
a0c56177ed8061a8d3fae27ed8bd9db75cca8c25
[]
no_license
agroknow/FremeEnricher
8b370926654eaa8303a17f6a37bf52e395f98293
256836265d225c842b0054602a6f5fba386e60da
refs/heads/master
2021-01-10T14:58:50.102870
2016-04-04T15:15:17
2016-04-04T15:15:17
52,283,026
0
0
null
null
null
null
UTF-8
Java
false
false
2,069
java
// // This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.8-b130911.1802 // See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a> // Any modifications to this file will be lost upon recompilation of the source schema. // Generated on: 2016.01.28 at 02:35:22 PM EET // package com.agroknow.schema.agrisap; import javax.xml.bind.annotation.XmlAccessType; import javax.xml.bind.annotation.XmlAccessorType; import javax.xml.bind.annotation.XmlAttribute; import javax.xml.bind.annotation.XmlRootElement; import javax.xml.bind.annotation.XmlType; import javax.xml.bind.annotation.XmlValue; import javax.xml.bind.annotation.adapters.CollapsedStringAdapter; import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter; /** * */ @XmlAccessorType(XmlAccessType.FIELD) @XmlType(name = "", propOrder = { "value" }) @XmlRootElement(name = "ags:relationIsTranslationOf") public class AgsRelationIsTranslationOf { @XmlAttribute(name = "scheme", required = true) @XmlJavaTypeAdapter(CollapsedStringAdapter.class) protected String scheme; @XmlValue protected String value; /** * Gets the value of the scheme property. * * @return * possible object is * {@link String } * */ public String getScheme() { return scheme; } /** * Sets the value of the scheme property. * * @param value * allowed object is * {@link String } * */ public void setScheme(String value) { this.scheme = value; } /** * Gets the value of the value property. * * @return * possible object is * {@link String } * */ public String getvalue() { return value; } /** * Sets the value of the value property. * * @param value * allowed object is * {@link String } * */ public void setvalue(String value) { this.value = value; } }
[ "pankaper@gmail.com" ]
pankaper@gmail.com
cf80edbfd6de6db0b2a3e22c7d5eff0898276934
ffce41949ae3ee7bfd06e366d0351408268d0e0a
/src/main/java/RSPracticeExamples/Employee.java
8ee26fa3f4c1a65f81cca01891a20b35c7b3221e
[]
no_license
VijaySwamyGit/vidalProject
ea1dd184875181642e495ae86a4c0296f3752f16
171d69726d538cbf87968311ddb6637691fd7733
refs/heads/main
2023-06-06T03:39:58.515060
2021-07-05T11:15:23
2021-07-05T11:15:23
383,112,077
0
0
null
null
null
null
UTF-8
Java
false
false
944
java
package RSPracticeExamples; import java.util.HashMap; import java.util.Iterator; import java.util.Map; import java.util.Set; class Employee { String name=""; int age=0; String address=""; public Employee(String name, int age, String address) { this.name=name; this.age=age; this.address=address; } public static void main(String [] args) { HashMap<Integer, Employee> hp = new HashMap<Integer, Employee>(); Employee e1 = new Employee("vijay", 39,"#379 sm heritage"); Employee e2 = new Employee("vijay2", 39,"#379 sm heritage2"); hp.put(1, e1); hp.put(2, e2); System.out.println(hp); Set entry = hp.entrySet(); Iterator itr = entry.iterator(); while(itr.hasNext()) { Map.Entry mp =(Map.Entry)itr.next(); System.out.println(mp.getKey()+"--"+mp.getValue()); System.out.println(mp.getKey()+"--"+mp.getValue()); //Employee ee = mp.getValue(); } } }
[ "vijay@mediclaim.com" ]
vijay@mediclaim.com
1513ef06987ef9c62d6d232db2954e75d2a177b8
a8a5c37e0b07361c0685e0a5f755ce3648338ffd
/BaseLib/src/main/java/com/fec/baselib/ShowToast.java
74363c9e74ebef0a48e8e152b95b3080db9d28ee
[]
no_license
longforus/FlavorsDemo
d2a83e81bea6943549ecb87cf179ff5b939d35ad
32a8f4142b3afc66830d8bdbe041ff80df9ec550
refs/heads/master
2021-01-19T15:08:31.350549
2017-08-22T10:05:17
2017-08-22T10:05:17
100,946,002
0
0
null
null
null
null
UTF-8
Java
false
false
270
java
package com.fec.baselib; import android.content.Context; import com.alibaba.android.arouter.facade.template.IProvider; /** * Created by XQ Yang on 2017/8/21 11:25. * Description : */ public interface ShowToast extends IProvider { void show(Context context); }
[ "longforus@126.com" ]
longforus@126.com
7665d99160431a3b16df1ad19d735586def384ff
a0af1f2f20a3fd423e86ee6eb21336cf4f743abe
/src/it/unisa/metric/metrics/CBO.java
5a577d0140fe1f2df58a13363dcc97d5af0efa2e
[]
no_license
alexminichino/unisa_metric3.0_web_edition
af75e5c4a410b695d369173b896a0e638325cc9b
9ec2c6e87715ca988919fd791611579f0e2c82fe
refs/heads/master
2023-01-13T07:01:18.952507
2020-11-16T17:39:55
2020-11-16T17:39:55
198,198,306
0
0
null
null
null
null
UTF-8
Java
false
false
1,224
java
package it.unisa.metric.metrics; import java.util.Stack; import org.jgrapht.graph.DefaultWeightedEdge; import org.jgrapht.graph.DirectedWeightedMultigraph; import it.unisa.metric.struct.graph.ClassInfo; import it.unisa.metric.struct.graph.MethodVertex; //class complete /* Conteggio di quante classi sono accoppiate alla classe in esame. * Contiamo gli archi entrati nei metodi della classe, provenienti da altre classi e gli archi uscenti dai metodi della classe, che puntano in metodi di un'altra classe. */ public class CBO { public int classCbo(ClassInfo classInf, DirectedWeightedMultigraph<MethodVertex, DefaultWeightedEdge> graph){ Stack<ClassInfo> bucket = new Stack<ClassInfo>(); for(MethodVertex v : classInf.getMethods()){ //outgoing edge parsing for(DefaultWeightedEdge e : graph.outgoingEdgesOf(v)){ if(!bucket.contains(graph.getEdgeTarget(e).getClassInfo())){ bucket.push(graph.getEdgeTarget(e).getClassInfo()); } } //incoming edge parsing for(DefaultWeightedEdge e : graph.incomingEdgesOf(v)){ if(!bucket.contains(graph.getEdgeTarget(e).getClassInfo())){ bucket.push(graph.getEdgeTarget(e).getClassInfo()); } } } return bucket.size(); } }
[ "alexminichino@gmail.com" ]
alexminichino@gmail.com