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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
b749389b94f0cb330dcb25aa20091bcdab2b1359 | e159e3f2063a381caf2444be7aabb9620e4aff0c | /AgroAdvisoryWebServices/src/com/bkc/model/NutrientDetailsHindiId.java | f63aac80b053270d13cb7da1735b4d91e3b53f81 | [] | no_license | sksingh27/repo | 32b911893d56cd87e60ec2151f351798c1b945cc | fa4ebd67212990bd0c5d5c7d123cf92c54140725 | refs/heads/master | 2021-08-08T11:34:53.408716 | 2017-11-10T07:47:55 | 2017-11-10T07:47:55 | 110,214,363 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 794 | java | package com.bkc.model;
import java.io.Serializable;
import javax.persistence.Column;
import javax.persistence.Embeddable;
import javax.persistence.Table;
@Table(name="nutrientDetailsHindi")
@Embeddable
public class NutrientDetailsHindiId implements Serializable {
@Column(name="cropId")
int cropId;
@Column(name="nutrientId")
int nutrientId;
@Column(name="languageId")
String languageId;
public String getLanguageId() {
return languageId;
}
public void setLanguageId(String languageId) {
this.languageId = languageId;
}
public int getCropId() {
return cropId;
}
public void setCropId(int cropId) {
this.cropId = cropId;
}
public int getNutrientId() {
return nutrientId;
}
public void setNutrientId(int nutrientId) {
this.nutrientId = nutrientId;
}
}
| [
"dmdd@SudhirSingh"
] | dmdd@SudhirSingh |
2e4f74a5e937a9cefe37984adc9581fc923f19b0 | e9f749599a49b350446cbefade0111dfb5c0634d | /chocoshop_service/src/main/java/com/chocoshop/service/MemberService.java | 2a2f0d498318fa07f88f0817e57a3ff8f4e54fca | [] | no_license | bbc539ff/chocoshop | f6c1ac6edcbceb5a37aacc72d69b1d048bc7bd3d | 1daa8b55262f8f328ab645d3842d841734a12fa8 | refs/heads/master | 2022-02-27T08:28:01.563459 | 2019-10-09T02:02:29 | 2019-10-09T02:02:29 | 204,428,187 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,932 | java | package com.chocoshop.service;
import com.chocoshop.mapper.MemberMapper;
import com.chocoshop.model.Member;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.web.multipart.MultipartFile;
import utils.Utils;
import java.io.FileNotFoundException;
import java.util.Date;
import java.util.List;
import java.util.UUID;
@Service
public class MemberService {
@Autowired
MemberMapper memberMapper;
public List<Member> showAllMembers(){
return memberMapper.selectAll();
}
public Member findByMemberName(String memberUserName){
Member member = new Member();
member.setMemberUserName(memberUserName);
return memberMapper.selectOne(member);
}
public int addMember(Member member, MultipartFile file){
member.setMemberUuid(UUID.randomUUID().toString());
if(member.getMemberPassword() != null) {
String pwd = member.getMemberPassword();
String salt = Utils.generateSalt(pwd);
String newPwd = Utils.generatePwd(pwd, salt);
member.setMemberPassword(newPwd);
member.setMemberSalt(salt);
}
// set imgurl
String path = Utils.uploadSingle(file, "/upload/member/member_image/", member.getMemberUuid(), false);
member.setMemberImageurl(path);
if(member.getMemberState() != null) member.setMemberState(0);
if(member.getMemberCreateTime() != null) member.setMemberCreateTime(new Date());
if(member.getMemberUpdateTime() != null) member.setMemberUpdateTime(new Date());
return memberMapper.insert(member);
}
public int deleteMember(Member member){
return memberMapper.delete(member);
}
public int updateMember(Member member, MultipartFile file){
if(member.getMemberPassword() != null) {
String pwd = member.getMemberPassword();
String salt = Utils.generateSalt(pwd);
String newPwd = Utils.generatePwd(pwd, salt);
member.setMemberPassword(newPwd);
member.setMemberSalt(salt);
}
// set imgurl
String path = Utils.uploadSingle(file, "/upload/member/member_image", member.getMemberUuid(), false);
member.setMemberImageurl(path);
member.setMemberUpdateTime(new Date());
System.out.println(member);
int returnVal = 0;
try{
returnVal = memberMapper.updateByPrimaryKeySelective(member);
} catch (Exception e){
e.printStackTrace();
}
return returnVal;
}
public List<Member> search(Member member){
try {
return memberMapper.search(member);
}catch (Exception e){
e.printStackTrace();
}
return null;
}
public int countMember(){
return memberMapper.selectCount(new Member());
}
}
| [
"bbc539ff@protonmail.com"
] | bbc539ff@protonmail.com |
3f4681811c48d2be415bf3feaaa0b490d6120400 | ad5cd983fa810454ccbb8d834882856d7bf6faca | /platform/ext/platformservices/testsrc/de/hybris/platform/catalog/KeywordServiceTest.java | 9e8ddc83415e8cd143533f56fc45bdedec03f99a | [] | no_license | amaljanan/my-hybris | 2ea57d1a4391c9a81c8f4fef7c8ab977b48992b8 | ef9f254682970282cf8ad6d26d75c661f95500dd | refs/heads/master | 2023-06-12T17:20:35.026159 | 2021-07-09T04:33:13 | 2021-07-09T04:33:13 | 384,177,175 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 4,180 | java | /*
* Copyright (c) 2020 SAP SE or an SAP affiliate company. All rights reserved.
*/
package de.hybris.platform.catalog;
import static org.assertj.core.api.Assertions.assertThatThrownBy;
import de.hybris.bootstrap.annotations.UnitTest;
import de.hybris.platform.catalog.daos.KeywordDao;
import de.hybris.platform.catalog.impl.DefaultKeywordService;
import de.hybris.platform.catalog.model.CatalogVersionModel;
import de.hybris.platform.catalog.model.KeywordModel;
import de.hybris.platform.servicelayer.exceptions.AmbiguousIdentifierException;
import de.hybris.platform.servicelayer.exceptions.UnknownIdentifierException;
import java.util.Arrays;
import java.util.Collections;
import org.assertj.core.api.Assertions;
import org.junit.Before;
import org.junit.Test;
import org.mockito.Mock;
import org.mockito.Mockito;
import org.mockito.MockitoAnnotations;
/**
* tests {@link DefaultKeywordService}
*/
@UnitTest
public class KeywordServiceTest
{
String keyword = "keyword";
String typecode = "Typecode";
CatalogVersionModel catalogVersion = new CatalogVersionModel();
private DefaultKeywordService keywordService;
@Mock
private KeywordDao keywordDao;
@Before
public void setUp()
{
MockitoAnnotations.initMocks(this);
keywordService = new DefaultKeywordService();
keywordService.setKeywordDao(keywordDao);
}
@Test
public void testGetKeyward()
{
final KeywordModel keywordModel = new KeywordModel();
Mockito.when(keywordDao.getKeywords(catalogVersion, keyword)).thenReturn(Collections.singletonList(keywordModel));
Assertions.assertThat(keywordService.getKeyword(catalogVersion, keyword)).isSameAs(keywordModel);
}
@Test
public void testGetKeywardFailToMany()
{
Mockito.when(keywordDao.getKeywords(catalogVersion, keyword)).thenReturn(
Arrays.asList(new KeywordModel(), new KeywordModel()));
assertThatThrownBy(() -> keywordService.getKeyword(catalogVersion, keyword))
.isInstanceOf(AmbiguousIdentifierException.class);
}
@Test
public void testGetKeywardFailNullArg()
{
assertThatThrownBy(() -> keywordService.getKeyword(null, keyword)).isInstanceOf(IllegalArgumentException.class);
assertThatThrownBy(() -> keywordService.getKeyword(catalogVersion, null)).isInstanceOf(IllegalArgumentException.class);
}
@Test
public void testGetKeywardFailEmpty()
{
Mockito.when(keywordDao.getKeywords(catalogVersion, keyword)).thenReturn(Collections.emptyList());
assertThatThrownBy(() -> keywordService.getKeyword(catalogVersion, keyword)).isInstanceOf(
UnknownIdentifierException.class);
}
@Test
public void testTypecodeGetKeyward()
{
final KeywordModel keywordModel = new KeywordModel();
Mockito.when(keywordDao.getKeywords(typecode, catalogVersion, keyword)).thenReturn(
Collections.singletonList(keywordModel));
Assertions.assertThat(keywordService.getKeyword(typecode, catalogVersion, keyword)).isSameAs(keywordModel);
}
@Test
public void testTypecodeGetKeywardFailToMany()
{
Mockito.when(keywordDao.getKeywords(typecode, catalogVersion, keyword)).thenReturn(
Arrays.asList(new KeywordModel(), new KeywordModel()));
assertThatThrownBy(() -> keywordService.getKeyword(typecode, catalogVersion, keyword))
.isInstanceOf(AmbiguousIdentifierException.class);
}
@Test
public void testTypecodeGetKeywardFailEmpty()
{
Mockito.when(keywordDao.getKeywords(typecode, catalogVersion, keyword)).thenReturn(Collections.emptyList());
assertThatThrownBy(() -> keywordService.getKeyword(typecode, catalogVersion, keyword)).isInstanceOf(
UnknownIdentifierException.class);
}
@Test
public void testTypecodeGetKeywardFailNullArg()
{
assertThatThrownBy(() -> keywordService.getKeyword(null, catalogVersion, keyword)).isInstanceOf(
IllegalArgumentException.class);
assertThatThrownBy(() -> keywordService.getKeyword(typecode, null, keyword)).isInstanceOf(IllegalArgumentException.class);
assertThatThrownBy(() -> keywordService.getKeyword(typecode, catalogVersion, null)).isInstanceOf(
IllegalArgumentException.class);
}
}
| [
"amaljanan333@gmail.com"
] | amaljanan333@gmail.com |
a4320f7814c7cb1fb1152bef2b7774e1a85e6ec8 | 000798d2e261cb9702f01f15863f76f5391c4983 | /main/java/io/github/vexytal/ModerationMechanics/commands/CommandDRTPPos.java | 4b2ba3f5a6ec9d4cd9ec54dd0d33fd11e43348bd | [] | no_license | VexyTal/vexytal.github.io | daea2f71fe2b6a0b9b9bffc51766ace5b555ad7c | 0cc633a27ea26db094db5a3599f4d2947e07f246 | refs/heads/master | 2021-01-10T15:26:04.331730 | 2015-12-18T23:30:43 | 2015-12-18T23:30:43 | 47,913,894 | 0 | 2 | null | null | null | null | UTF-8 | Java | false | false | 821 | java | package io.github.vexytal.ModerationMechanics.commands;
import org.bukkit.Location;
import org.bukkit.command.Command;
import org.bukkit.command.CommandExecutor;
import org.bukkit.command.CommandSender;
import org.bukkit.entity.Player;
public class CommandDRTPPos implements CommandExecutor {
@Override
public boolean onCommand(CommandSender sender, Command cmd, String label, String[] args) {
Player p = null;
if(sender instanceof Player) {
p = (Player) sender;
}
if(p != null && !p.isOp()) { return true; }
if(args.length != 3) {
p.sendMessage("/drtppos X Y Z");
return true;
}
double x = Double.parseDouble(args[0]);
double y = Double.parseDouble(args[1]);
double z = Double.parseDouble(args[2]);
p.teleport(new Location(p.getWorld(), x, y, z));
return true;
}
}
| [
"noga.austin@gmail.com"
] | noga.austin@gmail.com |
f1fc4552ca36b5659bdce3148906c96473bd27ff | c7b562398937f4bd6c3a28af5b3203aca2512b70 | /app/src/main/java/com/example/swisstool/MainActivity.java | 711e697895cfd8981cee2a04239ec83153601d25 | [] | no_license | NicholasHeilman/SwissTool | ef4659e6c0be09fcd9a5cbb2900e1ebedb6f78e8 | a96237d166d4d802e54394da72d4529e1448621a | refs/heads/master | 2020-12-27T09:01:54.269609 | 2020-02-02T22:08:55 | 2020-02-02T22:08:55 | 237,844,317 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 335 | java | package com.example.swisstool;
import androidx.appcompat.app.AppCompatActivity;
import android.os.Bundle;
public class MainActivity extends AppCompatActivity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
}
}
| [
"Nicholas.Heilman@gmail.com"
] | Nicholas.Heilman@gmail.com |
92c5e044e65012368057749888c9c31a15ab875c | 41be826ea88e8ca8ade16bebaf7e1e6df8236e9b | /mvp_cou/app/src/androidTest/java/com/example/lenovo/mvp_cou/ExampleInstrumentedTest.java | c398bf103e07f1fa3962bfbf86edbef2f51ac640 | [] | no_license | wz170416/ZhiHu | 261bf9b03d2d13617100d4b3364be961e82de54f | 4465e48fe0e56308084585e01efb99eb56ff92d7 | refs/heads/master | 2020-05-16T02:52:34.103017 | 2019-04-22T06:59:32 | 2019-04-22T06:59:32 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 736 | java | package com.example.lenovo.mvp_cou;
import android.content.Context;
import android.support.test.InstrumentationRegistry;
import android.support.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.example.lenovo.mvp_cou", appContext.getPackageName());
}
}
| [
"2993139792@qq.com"
] | 2993139792@qq.com |
1e284a8ceced2e0cf5328e4ad611d1203118bb93 | a4053823ca8d14099892f3f95565b0a45eeef4ce | /acarreos-app-android/nfchelper/src/main/java/com/mx/vise/nfc/mifareclassic/Block.java | 922f1f2af5da3454daeaeb8937aff651b051110c | [] | no_license | zesteros/MaterialTransportControl | dfc6d1c612edc6a21373ebe143c48ed3d7a15c81 | a939c1c5d1c016f91ce2dd70dec0d6256b06bd61 | refs/heads/main | 2023-05-06T04:28:45.708882 | 2021-06-02T19:31:48 | 2021-06-02T19:31:48 | 373,274,593 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 393 | java | package com.mx.vise.nfc.mifareclassic;
public class Block {
private int position;
private String data;
public int getPosition() {
return position;
}
public void setPosition(int position) {
this.position = position;
}
public String getData() {
return data;
}
public void setData(String data) {
this.data = data;
}
}
| [
"angelo.loza@bp.com"
] | angelo.loza@bp.com |
47074ec7a26acb3f7179bd692800073163007dc5 | f36e682fd2c8528d522513c27bd9149c08da335e | /src/edu/missouri/isocial/foundation/simple/DraggableAddToOne.java | 2771ac5b8354d67e823e586cd3370b0103a8cfdc | [] | no_license | SwethaV7/Flowgramming | 8b21e0cbfc8223db3c828b75d53296ef2d109fc7 | db048cb2035582c917eedb51c37f33a33140926a | refs/heads/master | 2021-12-02T22:34:44.613431 | 2013-08-01T19:15:13 | 2013-08-01T19:15:13 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 816 | java | /*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package edu.missouri.isocial.foundation.simple;
import edu.missouri.isocial.basic.components.actions.AddToOneNode;
import edu.missouri.isocial.foundation.components.core.model.DraggableComponentModel;
import edu.missouri.isocial.foundation.components.core.model.DraggableWidget;
/**
*
* @author Ryan
*/
@DraggableWidget(AddToOneNode.class)
public class DraggableAddToOne extends DraggableComponentModel {
public void default_properties() {
displayText = "n+1";
ObjName = "N Plus 1";
ObjCategory = "Math";
left(0, link().withCaption("input").expectingType(Integer.class).build());
right(0, link().withCaption("output").expectingType(Integer.class).build());
}
}
| [
"babiuchr@missouri.edu"
] | babiuchr@missouri.edu |
eb00772dc463c77b33512c0508a0a715e410e714 | 83306779ce67d3d9ff3d5e7c1e5d8c31bba22f8f | /Desktop/java/java programs/strint.java | 96314bd26c9caa8e344d9d21d20966ce41225d21 | [] | no_license | Rishab427/MyFirstProject | 3262d891fbf821fb8a47dacfc3221eb55d619c71 | 2ee1b3aa813c28f72f15ca29ef0377b5bb182e97 | refs/heads/master | 2021-04-12T01:44:34.328409 | 2018-03-19T17:19:01 | 2018-03-19T17:19:01 | 125,893,548 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 171 | java | class strint
{
public static void main(String [] at)
{
int a =Integer.parseInt(at[0]);
int b=Integer.parseInt(at[1]);
int c=a+b;
System.out.println("addition is "+c);
}
} | [
"rishabkumar427@gmail.com"
] | rishabkumar427@gmail.com |
58484a31c84eda134128c44f4bcc9bbb9a3cc871 | 7bb7041ffbf42b0d0308ea8ef208bc4efe7b1c71 | /ssm_crud/ssm_crud_dao/src/main/java/com/itheima/crud/domain/QueryVo.java | 76401fcc84b754afb85162eb5da592859147a871 | [] | no_license | einstein01/repo | 15242b1a4a0f4838a102384c3f416e7ce151881e | b015664787efc37b97270857fc6e2d6cb2940dfc | refs/heads/master | 2020-05-09T22:27:59.328251 | 2019-04-15T11:42:34 | 2019-04-15T11:42:34 | 181,472,442 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,481 | java | package com.itheima.crud.domain;
/**
* @author Davis
* @date 2019/4/14 21:58
*/
public class QueryVo {
private String custName;
private String custSource;
private String custIndustry;
private String custLevel;
// 当前页码数
private Integer page = 1;
// 数据库从哪一条数据开始查
private Integer start;
// 每页显示数据条数
private Integer rows = 10;
public String getCustName() {
return custName;
}
public void setCustName(String custName) {
this.custName = custName;
}
public String getCustSource() {
return custSource;
}
public void setCustSource(String custSource) {
this.custSource = custSource;
}
public String getCustIndustry() {
return custIndustry;
}
public void setCustIndustry(String custIndustry) {
this.custIndustry = custIndustry;
}
public String getCustLevel() {
return custLevel;
}
public void setCustLevel(String custLevel) {
this.custLevel = custLevel;
}
public Integer getPage() {
return page;
}
public void setPage(Integer page) {
this.page = page;
}
public Integer getStart() {
return start;
}
public void setStart(Integer start) {
this.start = start;
}
public Integer getRows() {
return rows;
}
public void setRows(Integer rows) {
this.rows = rows;
}
}
| [
"13207178516@163.com"
] | 13207178516@163.com |
c99273d4705a1d57a7ca6b2a1fb107ab4c750a97 | c6d933d17b18120b4fd7d7f95ee15c96dd480f60 | /app/src/main/java/com/movements/and/buzzerbuzzer/FollowFragment.java | 4bcf62f13950f2e8e6c0c7ad9a91e42aaf10faa3 | [] | no_license | BuzzerBuzzer/buzzerbuzzer_android | 042ee18927fdc1a4bf18a596d97d985fa4f3fc56 | 04c23959e5f3bc8aea14dce9f428b31a323e9b79 | refs/heads/master | 2020-03-15T09:34:24.042808 | 2018-05-04T02:55:54 | 2018-05-04T02:55:54 | 132,078,369 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 16,955 | java | package com.movements.and.buzzerbuzzer;
import android.content.Intent;
import android.content.SharedPreferences;
import android.os.Build;
import android.os.Bundle;
import android.os.SystemClock;
import android.support.v4.app.Fragment;
import android.support.v4.content.ContextCompat;
import android.support.v4.widget.SwipeRefreshLayout;
import android.support.v7.widget.DividerItemDecoration;
import android.support.v7.widget.LinearLayoutManager;
import android.support.v7.widget.RecyclerView;
import android.util.Log;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ProgressBar;
import android.widget.TextView;
import android.widget.Toast;
import com.android.volley.Request;
import com.android.volley.RequestQueue;
import com.android.volley.Response;
import com.android.volley.VolleyError;
import com.android.volley.toolbox.StringRequest;
import com.android.volley.toolbox.Volley;
import com.movements.and.buzzerbuzzer.Adapter.FriendsAdapter;
import com.movements.and.buzzerbuzzer.Encrypt.PasswordEn;
import com.movements.and.buzzerbuzzer.Model.Friend;
import com.movements.and.buzzerbuzzer.Utill.Config;
import com.movements.and.buzzerbuzzer.Utill.ConfirmDialog;
import com.movements.and.buzzerbuzzer.Utill.JsonConverter;
import com.sendbird.android.GroupChannel;
import com.sendbird.android.GroupChannelListQuery;
import com.sendbird.android.SendBirdException;
import org.json.JSONException;
import org.json.JSONObject;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
/**
* Created by samkim on 2017. 3. 10..
*/
//팔로우화면
public class FollowFragment extends Fragment implements SwipeRefreshLayout.OnRefreshListener {
private static final int TAB_ID = 2;
private RecyclerView recycler;
private ProgressBar mProgressbar;
private DividerItemDecoration dividerItemDecoration;
private FriendsAdapter mAdapter;
private ArrayList<Friend> mFriendList;
private int currentIndex;
private SwipeRefreshLayout mSwipeRefreshLayout;
private SharedPreferences setting;
private SharedPreferences.Editor editor;
private PasswordEn passwordEn;
private String id, mPassword, password;
private JsonConverter jc;
private ConfirmDialog dialog;
//private ArrayList<String> friendsList;
//private ArrayList<String> followingList;
private ArrayList<String> followList;
private final String TAG = "FollowFragment";
GroupChannelListQuery filteredQuery;
List<String> userIds;
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
View view = inflater.inflate(R.layout.follow, container, false);
filteredQuery = GroupChannel.createMyGroupChannelListQuery();
userIds = new ArrayList<>();
followList = getArguments().getStringArrayList("followList");
jc = new JsonConverter();
recycler = (RecyclerView) view.findViewById(R.id.recyclerview_fr);
mSwipeRefreshLayout = (SwipeRefreshLayout) view.findViewById(R.id.swipeRefresh);
mProgressbar = (ProgressBar) view.findViewById(R.id.progressBar4);
mSwipeRefreshLayout.setOnRefreshListener(new SwipeRefreshLayout.OnRefreshListener() {
@Override
public void onRefresh() {
((FriendList) getActivity()).getFriendList(id,2);
((FriendList) getActivity()).getFollowingList(id,2);
((FriendList) getActivity()).getFollowList(id,2);
((FriendList) getActivity()).loadingMainList(id,2);
mSwipeRefreshLayout.setRefreshing(false);
}
});
dividerItemDecoration = new DividerItemDecoration(recycler.getContext(), new LinearLayoutManager(getActivity()).getOrientation());
dividerItemDecoration.setDrawable(ContextCompat.getDrawable(getActivity(), R.drawable.lin_gray));
recycler.addItemDecoration(dividerItemDecoration);
mFriendList = new ArrayList<>();
recycler.setLayoutManager(new LinearLayoutManager(getActivity()));
mAdapter = new FriendsAdapter(getActivity(), mFriendList, new FriendsAdapter.RecyclerItemClickListener() {
@Override
public void onClickListener(Friend friends, int position) {
//changeSelected(position);//setSelectedPosition 8
Intent intentfr = new Intent(getContext(), Followprofile.class);
intentfr.putExtra("id", friends.getFr_id());
// Log.d("test",friends.getFr_id());
startActivity(intentfr);
getActivity().overridePendingTransition(R.anim.bottom_up, R.anim.bottom_exit);
}
}, new FriendsAdapter.RecyclerItemLongClickListener() {
@Override
public void onLongClickListener(final Friend friend, final int position, View itemView) {
((FriendList)getActivity()).addbtnOff();
final TextView red = (TextView)itemView.findViewById(R.id.red);
final TextView grey = (TextView)itemView.findViewById(R.id.grey);
grey.setOnClickListener(new View.OnClickListener() {
public void onClick(View v) {
Log.e("차단버튼","클릭됨");
gpsblock(friend.getFr_id(), 0);//gps 블락
red.setVisibility(View.GONE);
grey.setVisibility(View.GONE);
((FriendList)getActivity()).addbtnOn();
}
});
red.setOnClickListener(new View.OnClickListener() {
public void onClick(View v) {
Log.e("삭제버튼","클릭됨");
userIds.add(friend.getFr_id());
filteredQuery.setUserIdsExactFilter(userIds);
filteredQuery.next(new GroupChannelListQuery.GroupChannelListQueryResultHandler() {
@Override
public void onResult(List<GroupChannel> list, SendBirdException e) {
Log.e("롱클릭 일때 임","해당 친구와 채널 갯수 " + list.size());
if(list.size() != 0) {
list.get(0).hide(new GroupChannel.GroupChannelHideHandler() {
@Override
public void onResult(SendBirdException e) {
if (e != null) {
// Error!
return;
}
}
});
}
}
});
Delete(friend, position);//친구삭제
dialog = new ConfirmDialog(getActivity(),
"삭제되었습니다.", "확인");
dialog.setCancelable(true);
dialog.show();
((FriendList)getActivity()).addbtnOn();
}
});
// 다른 롱클릭시 이전 다른 버튼을 없애준다
mAdapter.setSelectedPosition(position);
for(int i=0; i < mFriendList.size(); i++){
if(i == position){
}else{
mAdapter.notifyItemChanged(i);
}
}
}
});
passwordEn = new PasswordEn();
recycler.setAdapter(mAdapter);
setting = getActivity().getSharedPreferences("setting", getActivity().MODE_PRIVATE);
editor = setting.edit();
id = setting.getString("user_id", "");
password = setting.getString("user_pw","");
mPassword = passwordEn.PasswordEn(password);
getFollowList();//팔로우리스트호출
return view;
}
private void Delete(final Friend friend, final int position) {
final String in_id = id;
final String user_id = friend.getFr_id();
StringRequest stringRequest = new StringRequest(Request.Method.POST, Config.REGISTER_URL,
new Response.Listener<String>() {
@Override
public void onResponse(String response) {
//Toast.makeText(getActivity(), response, Toast.LENGTH_SHORT).show();
try {
JSONObject json = new JSONObject(response);
if (json.getString("result").equals("success")) {//성공시
mFriendList.remove(position);
mAdapter.notifyDataSetChanged();
//mAdapter.setSelectedPosition(0);//현재 위치유지하고 싶으면 postion-1을 파라미터에...//문제 있으면 if처리
} else {//json.getString("result").equals("fail")시
//Toast.makeText((FriendList) getActivity(), "확인 후 다시 시도해주세요", Toast.LENGTH_SHORT).show();
return;
}
} catch (JSONException e) {
e.printStackTrace();
}
}
},
new Response.ErrorListener() {
@Override
public void onErrorResponse(VolleyError error) {//서버에러
Log.e(TAG, " delete_user_friend_list Error :" + error);
//Toast.makeText(getActivity(), "Error!", Toast.LENGTH_LONG).show();
}
}) {
@Override
protected Map<String, String> getParams() {
Map<String, String> params = new HashMap<String, String>();
//params.put("param", jc.createJsonParam("201", new String[]{in_id, user_id}));//서버 서비코드
params.put("param", jc.createJsonParam(id, mPassword, "android", Build.VERSION.RELEASE, Build.MODEL,"proc_32_delete_user", new String[]{in_id, user_id}));
return params;
}
};
RequestQueue requestQueue = Volley.newRequestQueue(getActivity());
requestQueue.add(stringRequest);
SystemClock.sleep(500);
((FriendList) getActivity()).getFriendList(id, 2);
((FriendList) getActivity()).getFollowingList(id, 2);
((FriendList) getActivity()).getFollowList(id, 2);
((FriendList) getActivity()).loadingMainList(id, 2);
}
private void gpsblock(String fid, int i) {
final String user_id = fid;
final String in_location_release_yn = String.valueOf(i);
StringRequest stringRequest = new StringRequest(Request.Method.POST, Config.REGISTER_URL,
new Response.Listener<String>() {
@Override
public void onResponse(String response) {
try {
JSONObject json = new JSONObject(response);
if (json.getString("result").equals("success")) {
//Toast.makeText(getActivity(), "내위치 차단 하였습니다.", Toast.LENGTH_SHORT).show();
dialog = new ConfirmDialog(getActivity(),
"내 위치가 차단되었습니다.", "확인");
dialog.setCancelable(true);
dialog.show();
/*
new android.support.v7.app.AlertDialog.Builder(getActivity())
.setMessage("내 위치가 차단되었습니다.")
.setPositiveButton("확인", null)
.show(); */
} else {//json.getString("result").equals("fail")시
//Toast.makeText(getActivity(), "확인 후 다시 시도해주세요", Toast.LENGTH_SHORT).show();
return;
}
} catch (JSONException e) {
e.printStackTrace();
}
}
},
new Response.ErrorListener() {
@Override
public void onErrorResponse(VolleyError error) {//서버에러
//Toast.makeText(getActivity(), "Error!", Toast.LENGTH_LONG).show();
Log.e(TAG, " block_gps_friend Error :" + error);
}
}) {
@Override
protected Map<String, String> getParams() {
Map<String, String> params = new HashMap<String, String>();
params.put("param", jc.createJsonParam(id, mPassword, "android", Build.VERSION.RELEASE, Build.MODEL,"proc_31_block_gps_individual_user", new String[]{id, user_id, in_location_release_yn}));//서버 서비코드
Log.i("개별유저차단", String.valueOf(params));
return params;
}
};
RequestQueue requestQueue = Volley.newRequestQueue(getActivity());
requestQueue.add(stringRequest);
}
// private void Gpsblock(String fr_id1) {
// final String fr_id = fr_id1;
// StringRequest stringRequest = new StringRequest(Request.Method.POST, Config.REGISTER_URL,
// new Response.Listener<String>() {
// @Override
// public void onResponse(String response) {
// //Toast.makeText(getActivity(), response, Toast.LENGTH_SHORT).show();
// try {
// JSONObject json = new JSONObject(response);
// if (json.getString("result").equals("success")) {//성공시
// Toast.makeText(getActivity(), "삭제하였습니다.", Toast.LENGTH_SHORT).show();
// //((FriendList) getActivity()).CallVolley();
// ((FriendList) getActivity()).getData(id, TAB_ID);
// } else {//json.getString("result").equals("fail")시
// Toast.makeText(getActivity(), "확인 후 다시 시도해주세요", Toast.LENGTH_SHORT).show();
// return;
// }
// } catch (JSONException e) {
// e.printStackTrace();
// }
// }
// },
// new Response.ErrorListener() {
// @Override
// public void onErrorResponse(VolleyError error) {//서버에러
// //Toast.makeText(getActivity(), "Error!", Toast.LENGTH_LONG).show();
// Log.e(TAG, "block_gps_follow Error :" + error);
// }
// }) {
// @Override
// protected Map<String, String> getParams() {
// Map<String, String> params = new HashMap<String, String>();
// params.put("param", jc.createJsonParam("block_gps_follow", new String[]{id, fr_id, "0", ""}));//서버 서비코드
// return params;
// }
// };
// RequestQueue requestQueue = Volley.newRequestQueue(getActivity());
// requestQueue.add(stringRequest);
// }
private void getFollowList() {
JSONObject row;
try {
if(followList == null){
return;
}else {
for (int i = 0; i < followList.size(); i++) {
row = new JSONObject(followList.get(i));
Friend friend = new Friend(
row.getString("pic_src"),
row.getString("nickname"),
row.getString("fr_id"),
row.getString("condition_msg"),
row.getInt("location_release_yn")
);
mFriendList.add(friend);
}
}
} catch (JSONException e) {
e.printStackTrace();
}
mProgressbar.setVisibility(View.GONE);
mAdapter.notifyDataSetChanged();
mAdapter.setSelectedPosition(0);//setSelectedPosition 4
}
@Override
public void onRefresh() {
FriendFragment.check_real = false;
((FriendList) getActivity()).getFollowList(id, 2);
}
} | [
"newstar3014@gmail.com"
] | newstar3014@gmail.com |
8b610220ad71b70b566bb14084d80874f2d7aa75 | a6e8838a49f728ee849a0777ee4de7ed33f0dfd4 | /src/main/java/org/hotswap/agent/example/deltaspike/repository/Repository264.java | 379a61a6554c09af3d615293ff6dffb70a0db527 | [] | no_license | skybber/expensive-300-ds-repositories | 71547f1005b34e459f05d65b713fb4020fc2e0cb | 65a6d687b8ffd560e267eaa3a879f4bd7deca2ab | refs/heads/main | 2023-04-02T20:21:34.553756 | 2021-03-30T19:26:14 | 2021-03-30T19:26:14 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 414 | java |
import java.io.Serializable;
import org.apache.deltaspike.data.api.AbstractEntityRepository;
import org.apache.deltaspike.data.api.criteria.CriteriaSupport;
import org.hotswap.agent.example.deltaspike.entity.Entity264;
public abstract class Repository264 extends AbstractEntityRepository<Entity264, Long> implements CriteriaSupport<Long>, Serializable
{
public abstract Entity264 findByName(String name);
}
| [
"vladimir.dvorak@mailprofiler.com"
] | vladimir.dvorak@mailprofiler.com |
8b48591e4710023ba942603a16a23d9a88262391 | 52b15e976976d664d4a82c7d5df412ad759abc76 | /src/water/Water.java | dd2351e044f3c76936c85791630135f1794d752d | [] | no_license | Gwen-Fay/PolyJump | ead1f0dd3bee5e9692161eb388afdc19415065ae | 2d20e3fe2829cbdc843f93b0b43a9375cca18436 | refs/heads/master | 2023-03-24T06:00:12.054630 | 2021-03-16T19:58:20 | 2021-03-16T19:58:20 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,141 | java | package water;
import org.lwjgl.util.vector.Matrix4f;
import org.lwjgl.util.vector.Vector2f;
import org.lwjgl.util.vector.Vector3f;
import render.Loader;
public class Water {
public Vector3f position;
public Vector3f rotation= new Vector3f(-90,0,0);
public Vector2f scale;
public static final String DUDV_PNG = "water/waterDUDV";
public static final int DUDV_TEX = Loader.loadTexture(DUDV_PNG);
public static final float WAVE_SPEED = 0.03f;
public static float move = 0;
public Water(Vector3f position, Vector2f scale) {
super();
this.position = position;
this.scale = scale;
}
/**
* returns world transformation
* @return Matrix4f World transformation
*
*/
public Matrix4f getWorldMatrix(){
Matrix4f m = new Matrix4f();
m.setIdentity();
Matrix4f.translate(position,m,m);
Matrix4f.rotate((float)Math.toRadians(rotation.x),new Vector3f(1,0,0), m, m);
Matrix4f.rotate((float)Math.toRadians(rotation.y),new Vector3f(0,1,0), m, m);
Matrix4f.rotate((float)Math.toRadians(rotation.z),new Vector3f(0,0,1), m, m);
Matrix4f.scale(new Vector3f(scale.x/2.0f,scale.y/2.0f,1), m, m);
return m;
}
}
| [
"gwenbenzschawel0777@gmail.com"
] | gwenbenzschawel0777@gmail.com |
cad689a6ae5307ccca3c4d6078b08ee7f657abf1 | 69e6cf3aac069db9e62b0f3609f5760da391c656 | /src/main/java/RAMPServer/RAMPServer.java | 8ba5da3e3a26702146161787a41ccc5b8876530c | [
"MIT"
] | permissive | mattprice/RAMP-Server | fdf85dfa56db9f061b15de83897d0315192ee400 | bfdea5f2864a263652b5b5fb49aeef819b9311e7 | refs/heads/master | 2016-08-08T11:22:52.655233 | 2014-04-16T19:00:04 | 2014-04-16T19:00:04 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,511 | java | package RAMPServer;
import java.io.IOException;
import io.undertow.Undertow;
import io.undertow.server.HttpHandler;
import io.undertow.server.HttpServerExchange;
import io.undertow.server.handlers.resource.ClassPathResourceManager;
import io.undertow.util.Headers;
import io.undertow.websockets.core.AbstractReceiveListener;
import io.undertow.websockets.core.BufferedTextMessage;
import io.undertow.websockets.core.WebSocketChannel;
import io.undertow.websockets.core.WebSockets;
import io.undertow.websockets.spi.WebSocketHttpExchange;
import io.undertow.websockets.WebSocketConnectionCallback;
import org.puredata.core.PdBase;
import static io.undertow.Handlers.path;
import static io.undertow.Handlers.resource;
import static io.undertow.Handlers.websocket;
public class RAMPServer {
public static void main(final String[] args) {
// Use port 8080 if $PORT is not set.
int port = 8080;
if (System.getenv("PORT") != null) {
port = Integer.valueOf(System.getenv("PORT"));
}
// Build and start an Undertow server.
Undertow server = Undertow.builder().addListener(port, "0.0.0.0")
.setHandler(path()
.addPath("/", new RootPageHandler())
.addPath("/echo", websocket(new EchoHandler()))
.addPath("/stream", websocket(new StreamingHandler()))
).build();
server.start();
System.out.println();
System.out.println(">> Started server at http://localhost:" + port + "/");
System.out.println(">> Press Ctrl+C to exit.");
}
}
class RootPageHandler implements HttpHandler {
@Override
public void handleRequest(final HttpServerExchange exchange) throws Exception {
exchange.getResponseHeaders().put(Headers.CONTENT_TYPE, "text/plain");
exchange.getResponseSender().send("OK");
}
}
class EchoHandler implements WebSocketConnectionCallback {
@Override
public void onConnect(WebSocketHttpExchange exchange, WebSocketChannel channel) {
channel.getReceiveSetter().set(new AbstractReceiveListener() {
@Override
protected void onFullTextMessage(WebSocketChannel channel, BufferedTextMessage message) {
WebSockets.sendText(message.getData(), channel, null);
}
});
channel.resumeReceives();
}
}
class StreamingHandler implements WebSocketConnectionCallback {
@Override
public void onConnect(WebSocketHttpExchange exchange, WebSocketChannel channel) {
// Listen for OSC commands.
channel.getReceiveSetter().set(new AbstractReceiveListener() {
@Override
protected void onFullTextMessage(WebSocketChannel channel, BufferedTextMessage message) {
// Parse the OSC message and forward it onto Libpd.
String[] oscMessage = message.getData().split(" ");
if (oscMessage.length > 1) {
try {
Float f = new Float(oscMessage[1]);
PdBase.sendMessage("osc", oscMessage[0], f);
} catch (NumberFormatException e) {
PdBase.sendMessage("osc", oscMessage[0], oscMessage[1]);
}
} else {
PdBase.sendMessage("osc", oscMessage[0]);
}
}
});
channel.resumeReceives();
RAMPThread thread = new RAMPThread(channel);
thread.start();
}
} | [
"hello@mattprice.me"
] | hello@mattprice.me |
887a6e5fa09af9bf7619d2e56ad0af23a9a5c94e | 34500103e8e299a09ea194b122598c05fc1d3984 | /src/com/company/MinCoins.java | 50325c7c6df70854103bd96a21bc2c08876fd129 | [] | no_license | veronrythm/interviewbits | 9106d5b39925bd86926b31e109eeac252ffd568c | ac0cb967f2b22d3eaf6636c048ed3a8194e606ec | refs/heads/main | 2023-02-19T05:28:55.196230 | 2021-01-13T10:44:40 | 2021-01-13T10:44:40 | 329,269,673 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,604 | java | public class MinCoins {
public static void dynamic(int[] d, int amount) {
int[][] V = new int[amount + 1][d.length + 1];
// if amount=0 then you don't need any coin to pay for 0
for (int j = 0; j <= d.length; j++) {
V[0][j] = 0;
}
// if you are supposed to use the first coin only then you have to give so many coins, as first coin has value 1
for (int i = 0; i <= amount; i++) {
V[i][0] = i;
}
// now fill rest of the matrix.
for (int j = 1; j <= d.length; j++) {
for (int i = 1; i <= amount; i++) {
// check if the coin value is less than the amount needed
if (d[j - 1] <= i && V[i][j - 1] > V[i - d[j - 1]][j] + 1) {
V[i][j] = 1 + V[i - d[j - 1]][j];
} else {
V[i][j] = V[i][j - 1];
}
}
}
System.out.println("Minimum number of coins used is :" + V[amount][d.length]);
int i = amount;
int j = d.length;
while (j > 0 && i > 0) {
if (V[i][j] == V[i][j - 1]) {
j = j - 1;
} else {
System.out.println("Picked coin :" + d[j - 1]);
i = i - d[j - 1];
}
}
while (i > 0) {
System.out.println("Picked coin :" + d[0]);
i = i - 1;
}
}
public static void main(String[] args) {
int amount = 1291 ;
int[] d = {1, 2, 5, 8, 10, 14};
dynamic(d, amount);
}
}
| [
"virenrdeshpande@gmail.com"
] | virenrdeshpande@gmail.com |
15d7ebca0bdbcc4a5a415f0da9d1f0c23c1c1e2e | 19156214d3c456e7aa9b34183a928ef144b3c206 | /src/test-suite-dependencies/geotk-xml-base-3.21-sources/src/main/java/org/geotoolkit/internal/jaxb/gml/CodeListProxy.java | 553755d84206a8b47ec97f2dce89fce8ac8fb1c1 | [] | no_license | opengeospatial/teamengine-offline | 85549dbab9ff681c4f6b09dfabce1e4b85ce4206 | 6b81fc3fc4647e8f68ba433701199b0e68fc36d2 | refs/heads/master | 2021-01-01T19:24:08.817030 | 2014-12-18T17:35:06 | 2014-12-18T17:35:06 | 21,212,109 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,900 | java | /*
* Geotoolkit.org - An Open Source Java GIS Toolkit
* http://www.geotoolkit.org
*
* (C) 2008-2012, Open Source Geospatial Foundation (OSGeo)
* (C) 2009-2012, Geomatys
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation;
* version 2.1 of the License.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*/
package org.geotoolkit.internal.jaxb.gml;
import javax.xml.bind.annotation.XmlValue;
import javax.xml.bind.annotation.XmlAttribute;
import org.opengis.util.CodeList;
import org.geotoolkit.internal.CodeLists;
/**
* JAXB adapter for {@link GMLCodeList}, in order to integrate the value in an element
* complying with OGC/ISO standard.
* <p>
* This implementation can not be merged with {@link GMLCodeList} because we are not
* allowed to use {@code @XmlValue} annotation in a class that extend an other class.
*
* @author Guilhem Legal (Geomatys)
* @version 3.20
*
* @since 3.20 (derived from 3.00)
* @module
*/
public final class CodeListProxy {
/**
* The code space of the {@linkplain #identifier} as an URI, or {@code null}.
*/
@XmlAttribute
String codeSpace;
/**
* The code list identifier.
*/
@XmlValue
String identifier;
/**
* Empty constructor for JAXB only.
*/
public CodeListProxy() {
}
/**
* Creates a new adapter for the given value.
*/
CodeListProxy(final String codeSpace, final CodeList<?> value) {
this.codeSpace = codeSpace;
this.identifier = CodeLists.identifier(value);
}
}
| [
"rjmartell@computer.org"
] | rjmartell@computer.org |
5d8a82cc3162aa132f2c2e46781e7abbe671add0 | 6a0ccf76967da32decd14814af3d99ab3316e7e6 | /app/src/main/java/com/chikong/ordercalculation/utils/ToastUtil.java | 4b3679a52114a38ab90cd82725aaff7b1c0c24ac | [] | no_license | ChiKongLao/OrderCalculation | 0b7dff73f07bcb923497d232b13c436ef806db59 | 0baa7c7fa1842daa73444307693c8d13bc5abfde | refs/heads/master | 2021-05-03T19:16:57.310720 | 2016-09-25T09:44:06 | 2016-09-25T09:44:06 | 69,155,946 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,117 | java | package com.chikong.ordercalculation.utils;
import android.content.Context;
import android.widget.Toast;
/**
* 解决Toast重复弹出
* Created by Administrator on 16/02/14.
*/
public class ToastUtil {
private static String oldMsg;
protected static Toast toast = null;
private static long oneTime = 0;
private static long twoTime = 0;
public static void showToast(Context context, String s) {
if (toast == null) {
toast = Toast.makeText(context, s, Toast.LENGTH_SHORT);
toast.show();
oneTime = System.currentTimeMillis();
} else {
twoTime = System.currentTimeMillis();
if (s.equals(oldMsg)) {
if (twoTime - oneTime > Toast.LENGTH_SHORT) {
toast.show();
}
} else {
oldMsg = s;
toast.setText(s);
toast.show();
}
}
oneTime = twoTime;
}
// public static void showToast(Context context, int resId) {
// showToast(context, context.getString(resId));
// }
}
| [
"a450167984@163.com"
] | a450167984@163.com |
193a7fc02518e9eb8e593c3c7365f1edf661e485 | 90a644e64154b1add5a32fefa95809d8aa110ebe | /introducao/Exemplo4.java | 14ba264b491825e976cae470c7fd0e769d36c51b | [] | no_license | joanmelo89/LP2-2018.1 | 46745631a91ce18dc7eef659874fa62763bf36de | 9390955261ea5b349fbe31815c573e22258b9a8f | refs/heads/master | 2021-04-03T01:08:29.667080 | 2018-06-29T23:01:13 | 2018-06-29T23:01:13 | 124,603,379 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 900 | java | /*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package introducao;
/**
*
* @author joan-
*/
import java.util.Scanner;
public class Exemplo4 {
public static void main(String[] args) {
Scanner input = new Scanner(System.in);
double qtdLitros;
double desconto;
double valorLitro;
valorLitro = 3.50;
System.out.println("Digite a quantidade desejada");
qtdLitros = input.nextDouble();
if(qtdLitros <= 20){
desconto = ((3.50 * qtdLitros) * 3)/100;
System.out.printf("O valor do desconto é: R$ %.2f",desconto);
}else{
desconto = ((3.50 * qtdLitros) * 5)/100;
System.out.printf("O valor do desconto é: R$ %.2f",desconto);
}
}
}
| [
"joanmelo89@gmail.com"
] | joanmelo89@gmail.com |
18f159bb45618020b1130dc4f7445f5e38e98432 | 7519647506b9758dbacb027edcedde3265dbac41 | /code-samples/03-Design-Patterns/01-singleton/src/main/java/com/algogrit/java/ThreadSafeLazyLoadedIvoryTower.java | 582e649d39a8d1ec93b8b31ee9ae755d0d40eedf | [] | no_license | AgarwalConsulting/java-training | 4c609e34fb942f47323000cc1d45e9011437793d | 0226d3f8860aaef0b71e386dd15e1ad3f9318074 | refs/heads/master | 2022-12-03T04:48:22.053352 | 2022-11-24T12:13:19 | 2022-11-24T12:13:19 | 190,865,039 | 0 | 4 | null | 2020-10-13T14:19:35 | 2019-06-08T08:40:55 | Java | UTF-8 | Java | false | false | 2,038 | java | /**
* The MIT License Copyright (c) 2014-2016 Ilkka Seppälä
*
* Permission is hereby granted, free of charge, to any person obtaining a copy of this software and
* associated documentation files (the "Software"), to deal in the Software without restriction,
* including without limitation the rights to use, copy, modify, merge, publish, distribute,
* sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all copies or
* substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT
* NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
* DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
package com.algogrit.java;
/**
* Thread-safe Singleton class. The instance is lazily initialized and thus needs synchronization
* mechanism.
*
* Note: if created by reflection then a singleton will not be created but multiple options in the
* same classloader
*/
public final class ThreadSafeLazyLoadedIvoryTower {
private static ThreadSafeLazyLoadedIvoryTower instance;
private ThreadSafeLazyLoadedIvoryTower() {
// protect against instantiation via reflection
if (instance == null) {
instance = this;
} else {
throw new IllegalStateException("Already initialized.");
}
}
/**
* The instance gets created only when it is called for first time. Lazy-loading
*/
public static synchronized ThreadSafeLazyLoadedIvoryTower getInstance() {
if (instance == null) {
instance = new ThreadSafeLazyLoadedIvoryTower();
}
return instance;
}
}
| [
"algogrit@gmail.com"
] | algogrit@gmail.com |
e0b2c8466fcdd1bc50e0558fd97317ea0b170e2b | 26329674f2474c35d1825dd1766264492730f8bf | /CleanWaterPhilly/app/src/main/java/com/cleanwater/axp/cleanwaterphilly/LatLong.java | 1a4fe63f7fdb9826f48b44ca658de3306a23e79b | [] | no_license | Maxcoh/Codefest2016AXP | d2a4de82063c62ad5e11142ed60a3bf8faf4c7c7 | f4b3df038be6a914fe54553a72b5fa7df52ea3a9 | refs/heads/master | 2016-08-12T17:18:47.229513 | 2016-02-21T17:07:09 | 2016-02-21T17:07:09 | 52,156,617 | 0 | 1 | null | 2016-02-20T17:15:41 | 2016-02-20T14:13:15 | Java | UTF-8 | Java | false | false | 379 | java | package com.cleanwater.axp.cleanwaterphilly;
/**
* Created by brendanbarnes on 2/20/16.
*/
public class LatLong {
private double lat;
private double lon;
public LatLong(double lat, double lon) {
this.lat = lat;
this.lon = lon;
}
public double getLat() {
return lat;
}
public double getLon() {
return lon;
}
}
| [
"blb98@drexel.edu"
] | blb98@drexel.edu |
f5ba610d712f18b1b1fa89f1b1b629313a33d24d | 36faf01ef4217ca350fdb962e11d626fdf55b060 | /app/src/main/java/Utils/Realnameauthentication.java | 1df4ea0dfa312f19277caac29519e26f012f8006 | [] | no_license | Mr-LB1/Smart_parking | 733b6a43c95a5b294f281cac365d036651f79649 | 7bdccf5d767627654b2574de09b664369abbc25a | refs/heads/master | 2020-06-10T06:42:54.268507 | 2019-06-25T02:23:32 | 2019-06-25T02:23:32 | 193,610,543 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 391 | java | package Utils;
import android.app.Application;
public class Realnameauthentication extends Application {
private boolean isRealnameauthentication;
public boolean isRealnameauthentication() {
return isRealnameauthentication;
}
public void setRealnameauthentication(boolean realnameauthentication) {
isRealnameauthentication = realnameauthentication;
}
}
| [
"827399738@qq.com"
] | 827399738@qq.com |
45a102e6a6d8a787e6d5517d251377f1ee1efd85 | 8d0ecfafa0fcb23503b9448c6879395f16949a6c | /src/main/java/rushi/controllers/MainController.java | 357c23f096daaf4e032862c7ae7ecab93bfd2079 | [] | no_license | KLiuCSUN/ESCalculator | a1f33c91a344125fcef317f82d4afc764638fb9c | e81c3e5b597900233c1ec4ece8bbf05b00ef9d4d | refs/heads/master | 2021-07-09T23:12:07.682633 | 2017-10-11T03:33:49 | 2017-10-11T03:33:49 | 106,463,593 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 605 | java | package rushi.controllers;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
@Controller
public class MainController {
public MainController() {
super();
// TODO Auto-generated constructor stub
}
//Returns list of all chips.
@RequestMapping(value="/", method=RequestMethod.GET, produces = "application/json")
public String goToLogin() {
String responseJSON = "";
try {
} catch(Exception e) {
e.printStackTrace();
}
return responseJSON;
}
}
| [
"kevin.liu.149@my.csun.edu"
] | kevin.liu.149@my.csun.edu |
6393fd45a446dfdd3d42af6c8bb365f89173872f | 1cc37d0c499026e114aab3a16381433ef3ca34f9 | /extended/src/test/java/io/kubernetes/client/extended/workqueue/ratelimiter/MaxOfRateLimiterTest.java | 5bfcf655625b8144b4e3bb9fbd9c431aa5757a4a | [
"Apache-2.0"
] | permissive | Netflix-Skunkworks/kubernetes-client-java | 29935e61ba840bb9e6b67a4ab52c7c47f37857df | 5e778c52e68c05e3f22ce06a96991e021df555dc | refs/heads/master | 2023-08-24T17:28:14.931079 | 2019-08-16T15:55:30 | 2019-08-16T15:55:30 | 202,430,562 | 3 | 5 | Apache-2.0 | 2022-11-08T04:59:20 | 2019-08-14T21:46:53 | Java | UTF-8 | Java | false | false | 1,999 | java | package io.kubernetes.client.extended.workqueue.ratelimiter;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertTrue;
import java.time.Duration;
import org.junit.Test;
public class MaxOfRateLimiterTest {
@Test
public void testMaxOfRateLimiter() {
RateLimiter<String> rateLimiter =
new MaxOfRateLimiter<>(
new ItemFastSlowRateLimiter<>(Duration.ofMillis(5), Duration.ofSeconds(3), 3),
new ItemExponentialFailureRateLimiter<>(Duration.ofMillis(1), Duration.ofSeconds(1)));
assertEquals(Duration.ofMillis(5), rateLimiter.when("one"));
assertEquals(Duration.ofMillis(5), rateLimiter.when("one"));
assertEquals(Duration.ofMillis(5), rateLimiter.when("one"));
assertEquals(Duration.ofSeconds(3), rateLimiter.when("one"));
assertEquals(Duration.ofSeconds(3), rateLimiter.when("one"));
assertEquals(5, rateLimiter.numRequeues("one"));
assertEquals(Duration.ofMillis(5), rateLimiter.when("two"));
assertEquals(Duration.ofMillis(5), rateLimiter.when("two"));
assertEquals(2, rateLimiter.numRequeues("two"));
rateLimiter.forget("one");
assertEquals(0, rateLimiter.numRequeues("one"));
assertEquals(Duration.ofMillis(5), rateLimiter.when("one"));
}
@Test
public void testDefaultRateLimiter() {
RateLimiter<String> rateLimiter = new DefaultControllerRateLimiter<>();
assertEquals(Duration.ofMillis(5), rateLimiter.when("one"));
assertEquals(Duration.ofMillis(10), rateLimiter.when("one"));
assertEquals(Duration.ofMillis(20), rateLimiter.when("one"));
for (int i = 0; i < 20; i++) {
rateLimiter.when("one");
}
assertEquals(Duration.ofSeconds(1000), rateLimiter.when("one"));
assertEquals(Duration.ofSeconds(1000), rateLimiter.when("one"));
for (int i = 0; i < 75; i++) {
rateLimiter.when("one");
}
assertTrue(rateLimiter.when("one").getSeconds() > 0);
assertTrue(rateLimiter.when("two").getSeconds() > 0);
}
}
| [
"zsy19980307@gmail.com"
] | zsy19980307@gmail.com |
c874ffea2e8f132b5d1bafc18083b161828d31cc | 3a20aa56899db02c806d0e167c1b84b443460c3d | /src/main/java/com/deepiq/web/rest/util/PaginationUtil.java | dcfa5be862fe87bf0515c39276244e029503ad38 | [] | no_license | santosh6969/gateway-app | 493b8342797481034ce383f9bcf03347711b94ec | 8a9e1ca21ed06a44a89d3db5f94e981bb3fa0557 | refs/heads/master | 2021-07-02T22:09:09.394338 | 2019-02-14T06:21:15 | 2019-02-14T06:21:15 | 170,638,392 | 0 | 1 | null | 2020-09-18T12:00:01 | 2019-02-14T06:19:59 | Java | UTF-8 | Java | false | false | 1,740 | java | package com.deepiq.web.rest.util;
import org.springframework.data.domain.Page;
import org.springframework.http.HttpHeaders;
import org.springframework.web.util.UriComponentsBuilder;
/**
* Utility class for handling pagination.
*
* <p>
* Pagination uses the same principles as the <a href="https://developer.github.com/v3/#pagination">GitHub API</a>,
* and follow <a href="http://tools.ietf.org/html/rfc5988">RFC 5988 (Link header)</a>.
*/
public final class PaginationUtil {
private PaginationUtil() {
}
public static <T> HttpHeaders generatePaginationHttpHeaders(Page<T> page, String baseUrl) {
HttpHeaders headers = new HttpHeaders();
headers.add("X-Total-Count", Long.toString(page.getTotalElements()));
String link = "";
if ((page.getNumber() + 1) < page.getTotalPages()) {
link = "<" + generateUri(baseUrl, page.getNumber() + 1, page.getSize()) + ">; rel=\"next\",";
}
// prev link
if ((page.getNumber()) > 0) {
link += "<" + generateUri(baseUrl, page.getNumber() - 1, page.getSize()) + ">; rel=\"prev\",";
}
// last and first link
int lastPage = 0;
if (page.getTotalPages() > 0) {
lastPage = page.getTotalPages() - 1;
}
link += "<" + generateUri(baseUrl, lastPage, page.getSize()) + ">; rel=\"last\",";
link += "<" + generateUri(baseUrl, 0, page.getSize()) + ">; rel=\"first\"";
headers.add(HttpHeaders.LINK, link);
return headers;
}
private static String generateUri(String baseUrl, int page, int size) {
return UriComponentsBuilder.fromUriString(baseUrl).queryParam("page", page).queryParam("size", size).toUriString();
}
}
| [
"jhipster-bot@jhipster.tech"
] | jhipster-bot@jhipster.tech |
669b5f74e49c28d36a81bb3b36ee881dd735313b | 0f95f50be23e409c083dd8562452cd8ca55b743c | /boss/src/com/tstar/callcenter/pub/tools/ParamUtil.java | 1e9135c1d81d43f5ac219e6d6c48457252a55fb6 | [] | no_license | RisingStar20/yan | 727d467bb43fb6fd911de9dcd73621376e5dc9c4 | 7002f62eac5872788715760f9af20af1d71173f3 | refs/heads/master | 2020-05-09T12:21:42.681959 | 2018-04-12T15:01:00 | 2018-04-12T15:01:00 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 364 | java | package com.tstar.callcenter.pub.tools;
import java.util.Map;
public class ParamUtil {
public static Map<String,String[]> USER_NO_TEL_MAP;
public static Map<String, String[]> getUSER_NO_TEL_MAP() {
return USER_NO_TEL_MAP;
}
public static void setUSER_NO_TEL_MAP(Map<String, String[]> uSER_NO_TEL_MAP) {
USER_NO_TEL_MAP = uSER_NO_TEL_MAP;
}
}
| [
"250739104@qq.com"
] | 250739104@qq.com |
bd20e586822c5b325e9159583ad34e25bc761766 | 43c9b06cbbe024ef6158b1e351b041ca83803fa3 | /src/main/java/br/com/namastetecnologia/cursomc/repositories/CidadeRepository.java | af022e1387643b50be503474db71f656a1dd6fd9 | [] | no_license | rcruznit1980/spring-boot-ionic-backend | 15352d2c75b4cc93ff785641f94d334bb48c52e8 | e3645971930a5ee68cb69f29b204c3b08241862e | refs/heads/master | 2020-03-27T05:40:30.377871 | 2018-09-06T17:09:32 | 2018-09-06T17:09:32 | 146,038,671 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 708 | java | package br.com.namastetecnologia.cursomc.repositories;
import java.util.List;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.query.Param;
import org.springframework.stereotype.Repository;
import org.springframework.transaction.annotation.Transactional;
import br.com.namastetecnologia.cursomc.domain.Cidade;
@Repository
public interface CidadeRepository extends JpaRepository<Cidade, Integer> {
@Transactional(readOnly=true)
@Query("SELECT obj from Cidade obj WHERE obj.estado.id = :estadoId Order by obj.nome")
public List<Cidade> findCidades(@Param("estadoId") Integer estado_id);
}
| [
"rodrigo@namastetecnologia.com.br"
] | rodrigo@namastetecnologia.com.br |
ee3a2ef2870b6c68f977a0f0eb6b861f970534f6 | 72debeb7548088e12c1db34475f5f750cff542d1 | /UbibusOcorrencias/src/java/br/com/ubibus/model/facade/LinhaFacade.java | 4f9202d913ab249422f862743b26ccc23575ca81 | [] | no_license | anamaciel/ColaborativeRoutes | 720aaac3bb5768ed2903b190b84bd6184b61bfe9 | 7f5f29942bb1ef8b2c5cec9f86a709f26653646f | refs/heads/master | 2016-09-05T17:40:23.182342 | 2013-09-13T12:41:37 | 2013-09-13T12:41:37 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,407 | java | package br.com.ubibus.model.facade;
import br.com.ubibus.model.pojo.Linha;
import br.com.ubibus.model.pojo.Trecho;
import java.util.List;
import javax.annotation.security.PermitAll;
import javax.ejb.Stateless;
import javax.persistence.EntityManager;
import javax.persistence.PersistenceContext;
import javax.persistence.Query;
import org.postgis.PGgeometry;
/**
*
* @author <a href="mailto:marvas1987@gmail.com">Marcelo F. Vasconcelos</a>
*/
@Stateless
public class LinhaFacade extends AbstractFacade<Linha> {
@PersistenceContext(unitName = "ubibusPU")
private EntityManager em;
@Override
protected EntityManager getEntityManager() {
return em;
}
public LinhaFacade() {
super(Linha.class);
}
@PermitAll
public List<Linha> findByLocation(PGgeometry location) {
return findByLocation(location, 0.005);
}
@PermitAll
public List<Linha> findByLocation(PGgeometry location, Double precision) {
// String jpql = "SELECT DISTINCT l FROM Linha l,"
// + " IN(l.linhasParadasList) lt WHERE"
// + " FUNC('ST_DWITHIN', lt.parada.localizacao, :location, :precision) = true;";
String jpql = "SELECT DISTINCT l FROM Linha l,"
+ " IN(l.linhasTrechoList) lt WHERE"
+ " FUNC('ST_DWITHIN', lt.trecho.pontosRota, :location, :precision) = true";
// String jpql = "SELECT DISTINCT p FROM Parada p "
// + " IN(p.linhasParadasList) lt WHERE"
// + "where FUNC('ST_DWITHIN', p.localizacao, :location, :precision, true)";
Query q = em.createQuery(jpql)
.setParameter("location", location)
.setParameter("precision", precision);
return q.getResultList();
}
@PermitAll
public List<Linha> findByTrecho(Trecho trecho) {
String jpql = "SELECT DISTINCT l FROM Linha l,"
+ " IN(l.linhasTrechoList) lt"
+ " WHERE lt.trecho = :trecho";
Query q = em.createQuery(jpql).setParameter("trecho", trecho);
return q.getResultList();
}
@PermitAll
public List<Linha> findByNumber(String lineNumber) {
String jpql = "SELECT l FROM Linha l WHERE l.numero = :numero";
Query q = em.createQuery(jpql).setParameter("numero", lineNumber);
return q.getResultList();
}
}
| [
"anacm.maciel@gmail.com"
] | anacm.maciel@gmail.com |
6ca6c7b290514e60d6828bf35fd852116e7781c6 | ab755edaecbc30622384ca560a769d947e8592a8 | /app/src/main/java/com/qin/love/AddTimeActivity.java | f0e40cf31ec114dec1c3f640051e86770e519ded | [] | no_license | dashuaiqin/Love | 722c06683533ba2a4f960f3458e613a81f17942d | cabbdbbcb2833a96bf094e3f2df939c6738d3dce | refs/heads/master | 2021-11-13T11:39:47.875525 | 2017-09-03T14:48:28 | 2017-09-03T14:48:28 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 14,511 | java | package com.qin.love;
import android.app.Activity;
import android.content.Intent;
import android.graphics.Color;
import android.graphics.drawable.ColorDrawable;
import android.os.Bundle;
import android.support.annotation.NonNull;
import android.text.Editable;
import android.text.TextWatcher;
import android.util.Log;
import android.view.View;
import android.widget.AdapterView;
import android.widget.EditText;
import android.widget.ImageView;
import android.widget.TextView;
import com.amap.api.services.core.PoiItem;
import com.qin.Application.MyApplication;
import com.qin.Utils.ImageUtils;
import com.qin.Utils.LoveUtils;
import com.qin.Utils.PermissionUtils;
import com.qin.Utils.StringUtils;
import com.qin.adapter.AddTimePhotoAdapter;
import com.qin.cons.IntegerCons;
import com.qin.cons.StringCons;
import com.qin.model.Time;
import com.qin.myinterface.GetpathJepgListener;
import com.qin.view.ActionSheetDialog;
import com.qin.view.NoScrollGridView;
import java.util.List;
import cn.bmob.v3.datatype.BmobFile;
import cn.bmob.v3.exception.BmobException;
import cn.bmob.v3.listener.SaveListener;
import cn.bmob.v3.listener.UploadBatchListener;
public class AddTimeActivity extends BaseActivity {
private TextView txtTitle;
private TextView txtWordCount;
private EditText editContent;//内容
private NoScrollGridView nsgvPicture;//显示照片的GridView
private AddTimePhotoAdapter photoAdapter;//照片适配器
private String photoName;//拍照的图片的名字
private ImageView ivBack;//返回按钮
private TextView txtRight;//完成按钮
private TextView txtGetLocation;//获取地点
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_add_time);
initView();
}
/**
* 初始化界面
*/
private void initView() {
ivBack = (ImageView) findViewById(R.id.iv_back);
ivBack.setVisibility(View.VISIBLE);
ivBack.setOnClickListener(listener);
txtRight = (TextView) findViewById(R.id.txt_title_right);
txtRight.setText(StringCons.FINISH);
txtRight.setOnClickListener(listener);
txtTitle = (TextView) findViewById(R.id.txt_title);
txtTitle.setText(StringCons.TITLE_TIME);
txtGetLocation = (TextView) findViewById(R.id.txt_get_location);
txtGetLocation.setOnClickListener(listener);
txtWordCount = (TextView) findViewById(R.id.txt_word_count);
editContent = (EditText) findViewById(R.id.edit_content);
editContent.addTextChangedListener(new TextWatcher() {
@Override
public void beforeTextChanged(CharSequence s, int start, int count, int after) {
}
@Override
public void onTextChanged(CharSequence s, int start, int before, int count) {
}
@Override
public void afterTextChanged(Editable s) {
txtWordCount.setText(800 - s.length() + "");
}
});
nsgvPicture = (NoScrollGridView) findViewById(R.id.nsgv_picture);
nsgvPicture.setSelector(new ColorDrawable(Color.TRANSPARENT));// 去掉点击时的背景
nsgvPicture.setOnItemClickListener(itemListener);
photoAdapter = new AddTimePhotoAdapter(this, null);
nsgvPicture.setAdapter(photoAdapter);
}
/**
* 点击的监听事件
*/
private View.OnClickListener listener = new View.OnClickListener() {
@Override
public void onClick(View v) {
switch (v.getId()) {
case R.id.iv_back:
finish();
break;
case R.id.txt_title_right:
uploadImages();
break;
case R.id.txt_get_location:
PermissionUtils.requestPermission(AddTimeActivity.this, PermissionUtils.CODE_ACCESS_FINE_LOCATION, mPermissionGrant);
break;
default:
break;
}
}
};
/**
* gv的单项点击监听
*/
AdapterView.OnItemClickListener itemListener = new AdapterView.OnItemClickListener() {
@Override
public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
if (photoAdapter.getItemViewType(position) == 1) {
PermissionUtils.requestPermission(AddTimeActivity.this, PermissionUtils.CODE_WRITE_EXTERNAL_STORAGE, mPermissionGrant);
}
}
};
/**
* 显示获取照片的对话框
*/
private void showPhotoDialog() {
new ActionSheetDialog(this)
.builder()
.setCancelable(true)
.setCanceledOnTouchOutside(true)
.addSheetItem("拍照获取图片", ActionSheetDialog.SheetItemColor.Blue,
new ActionSheetDialog.OnSheetItemClickListener() {
@Override
public void onClick(int which) {
PermissionUtils.requestPermission(AddTimeActivity.this, PermissionUtils.CODE_CAMERA, mPermissionGrant);
}
})
.addSheetItem("去相册选择图片", ActionSheetDialog.SheetItemColor.Blue,
new ActionSheetDialog.OnSheetItemClickListener() {
@Override
public void onClick(int which) {
PermissionUtils.requestPermission(AddTimeActivity.this, PermissionUtils.CODE_READ_EXTERNAL_STORAGE, mPermissionGrant);
}
}).show();
}
/**
* 权限获取回调
*/
private PermissionUtils.PermissionGrant mPermissionGrant = new PermissionUtils.PermissionGrant() {
@Override
public void onPermissionGranted(int requestCode) {
switch (requestCode) {
case PermissionUtils.CODE_CAMERA:
photoName = ImageUtils.getInstance(AddTimeActivity.this).doTakePhoto();
break;
case PermissionUtils.CODE_READ_EXTERNAL_STORAGE:
MyApplication.isSetIcon = false;
ImageUtils.getInstance(AddTimeActivity.this).doGetPhoto();
break;
case PermissionUtils.CODE_WRITE_EXTERNAL_STORAGE:
showPhotoDialog();
break;
case PermissionUtils.CODE_ACCESS_FINE_LOCATION:
startActivityForResult(new Intent(AddTimeActivity.this, GetLocationActivity.class), IntegerCons.GET_LOCATION);
break;
default:
break;
}
}
};
@Override
public void onRequestPermissionsResult(final int requestCode, @NonNull String[] permissions,
@NonNull int[] grantResults) {
PermissionUtils.requestPermissionsResult(this, requestCode, permissions, grantResults, mPermissionGrant);
}
/**
* 接收传回的数据
*
* @param requestCode
* @param resultCode
* @param data
*/
@Override
public void onActivityResult(int requestCode, int resultCode, Intent data) {
super.onActivityResult(requestCode, resultCode, data);
if (resultCode == Activity.RESULT_OK) {
switch (requestCode) {
case IntegerCons.PHOTO_WITH_ALBUM:
String paths = data.getStringExtra("filePath");
photoAdapter.addPaths(paths);
break;
case IntegerCons.PHOTO_WITH_CAMERA:
photoAdapter.addPaths(StringCons.PHOTO_DIR + "/" + photoName);
break;
case IntegerCons.GET_LOCATION:
txtGetLocation.setText(((PoiItem) data.getParcelableExtra("location")).getTitle());
break;
default:
break;
}
}
}
/**
* 批量上传图片
*/
private void uploadImages() {
startProgressDialog("解析中,准备上传...");
photoAdapter.getPaths(new GetpathJepgListener() {
@Override
public void finishGetPaths(final String[] ps) {
if (ps.length < 1) {
stopProgressDialog();
addTime(null);
return;
}
//详细示例可查看BmobExample工程中BmobFileActivity类
BmobFile.uploadBatch( ps, new UploadBatchListener() {
@Override
public void onSuccess(List<BmobFile> files, List<String> urls) {
//1、files-上传完成后的BmobFile集合,是为了方便大家对其上传后的数据进行操作,例如你可以将该文件保存到表中
//2、urls-上传文件的完整url地址
if (urls.size() == ps.length) {//如果数量相等,则代表文件全部上传完成
String imUrls = "";
for (int i = 0; i < urls.size(); i++) {
if (i == urls.size() - 1) {
imUrls += urls.get(i);
} else {
imUrls += urls.get(i) + "\0";
}
}
addTime(imUrls);
}
}
@Override
public void onError(int statuscode, String errormsg) {
shortToast("批量上传出错:" + statuscode + "--" + errormsg);
stopProgressDialog();
}
@Override
public void onProgress(int curIndex, int curPercent, int total, int totalPercent) {
//1、curIndex--表示当前第几个文件正在上传
//2、curPercent--表示当前上传文件的进度值(百分比)
//3、total--表示总的上传文件数
//4、totalPercent--表示总的上传进度(百分比)
setProDiaMessage("上传第" + curIndex + "张图片..." + curPercent + "%");
}
});
/*BmobProFile.getInstance(AddTimeActivity.this).uploadBatch(ps, new UploadBatchListener() {
@Override
public void onSuccess(boolean isFinish, String[] fileNames, String[] urls, BmobFile[] files) {
if (isFinish) {
String imUrls = "";
for (int i = 0; i < files.length; i++) {
if (i == files.length - 1) {
imUrls += files[i].getUrl();
} else {
imUrls += files[i].getUrl() + "\0";
}
}
addTime(imUrls);
}
// isFinish :批量上传是否完成
// fileNames:文件名数组
// urls : url:文件地址数组
// files : BmobFile文件数组,`V3.4.1版本`开始提供,用于兼容新旧文件服务。
// 注:若上传的是图片,url(s)并不能直接在浏览器查看(会出现404错误),需要经过`URL签名`得到真正的可访问的URL地址,当然,`V3.4.1`版本可直接从BmobFile中获得可访问的文件地址。
}
@Override
public void onProgress(int curIndex, int curPercent, int total, int totalPercent) {
// curIndex :表示当前第几个文件正在上传
// curPercent :表示当前上传文件的进度值(百分比)
// total :表示总的上传文件数
// totalPercent:表示总的上传进度(百分比)
Log.i("bmob", "onProgress :" + curIndex + "---" + curPercent + "---" + total + "----" + totalPercent);
setProDiaMessage("上传第" + curIndex + "张图片..." + curPercent + "%");
}
@Override
public void onError(int statuscode, String errormsg) {
// TODO Auto-generated method stub
Log.i("bmob", "批量上传出错:" + statuscode + "--" + errormsg);
shortToast("批量上传出错:" + statuscode + "--" + errormsg);
stopProgressDialog();
}
});*/
}
});
}
/**
* 添加拾光
*/
private void addTime(String imagePaths) {
String content = editContent.getText().toString();
if (imagePaths == null) {
imagePaths = "";
}
if (StringUtils.isBlank(imagePaths) && StringUtils.isBlank(content)) {
shortToast("请输入内容!");
return;
}
Time time = new Time();
String lt = txtGetLocation.getText().toString();
String location = lt.equals("我在...") ? "" : lt;
time.setLocation(location);
time.setLoversId(LoveUtils.getLoversId());
time.setContent(content);
time.setFromId(MyApplication.getInstance().getMyUser().getObjectId());
time.setImagePaths(imagePaths);
time.save(new SaveListener<String>() {
@Override
public void done(String s, BmobException e) {
stopProgressDialog();
if(e==null) {
//数据是使用Intent返回
Intent intent = new Intent();
//设置返回数据
setResult(IntegerCons.TYPE_ADD_TIME, intent);
finish();
shortToast("保存成功");
}else{
shortToast("保存失败:" + s);
}
}
});
}
}
| [
"1121170319@qq.com"
] | 1121170319@qq.com |
fe35438742052ee4d085b3899241b6946e71f6cf | 2a6280c8ace50a1276db77a888878df387519af7 | /dataStructure/src/main/java/queue/ArrayQueueDemo.java | ab25004c6bfc57a5c3b7b31d0fbd53f559c3ec53 | [] | no_license | MrTallon/algorithm | 6e7eb0ad95f14a2ac2514235334736a553d86d87 | 39f0f951f7b708f9c318573ccce78a8f6c770d7e | refs/heads/master | 2021-07-12T02:01:15.360736 | 2020-12-07T10:13:09 | 2020-12-07T10:13:09 | 226,653,971 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 4,332 | java | package queue;
import java.util.Scanner;
/**
* Implement a Queue with Array
*
* @author YangBo
* @date 2019/06/23
*/
public class ArrayQueueDemo {
public static void main(String[] args) {
System.out.println("测试数组实现的队列");
ArrayQueue queue = new ArrayQueue(3);
// 接收用户输入
char key;
Scanner scanner = new Scanner(System.in);
boolean loop = true;
while (loop) {
System.out.println("------------");
System.out.println("s(show):显示队列");
System.out.println("e(exit):退出程序");
System.out.println("a(add):添加数据到队列");
System.out.println("g(get):从队列中取出数据");
System.out.println("h(head):查看队列的第一条数据");
key = scanner.next().charAt(0);
switch (key) {
case 's':
queue.showQueue();
break;
case 'a':
System.out.println("输入一个数字");
int value = scanner.nextInt();
queue.addQueue(value);
break;
case 'g':
try {
int res = queue.getQueue();
System.out.printf("取出的数据是%d\n", res);
} catch (Exception e) {
System.out.println(e.getMessage());
}
break;
case 'h':
try {
int res = queue.headQueue();
System.out.printf("队列头的数据是%d\n", res);
} catch (Exception e) {
System.out.println(e.getMessage());
}
break;
case 'e':
scanner.close();
loop = false;
break;
default:
break;
}
}
System.out.println("程序退出");
}
}
class ArrayQueue {
/**
* 数组最大容量
*/
private int maxSize;
/**
* 队列头
*/
private int front;
/**
* 队列尾
*/
private int rear;
/**
* 该数组用于存放数据
*/
private int[] arr;
/**
* 创建队列的构造方法
*
* @param arrMaxSize
*/
ArrayQueue(int arrMaxSize) {
maxSize = arrMaxSize;
arr = new int[maxSize];
// 指向队列头部(指向队列头的前一个位置)
front = -1;
// 指向队列尾部(指向队列的最后一个数据)
rear = -1;
}
/**
* 判断队列是否已满
*
* @return
*/
private boolean isFull() {
return rear == maxSize - 1;
}
/**
* 判断队列是否为空
*
* @return
*/
private boolean isEmpty() {
return rear == front;
}
/**
* 添加数据到队列中(入队列)
*
* @param n
*/
void addQueue(int n) {
// 判断队列是否已满
if (isFull()) {
System.out.println("队列已满,不能加入数据");
return;
}
// rear后移,赋值n
arr[++rear] = n;
}
/**
* 获取队列的数据(出队列)
*
* @return
*/
int getQueue() {
// 判断队列是否为空
if (isEmpty()) {
throw new RuntimeException("队列已空,不能取出数据");
}
// 取出front后一位的数据
return arr[++front];
}
/**
* 显出队列的所有数据
*/
void showQueue() {
// 判断队列是否为空
if (isEmpty()) {
System.out.println("队列为空,没有数据");
return;
}
for (int i = 0; i < arr.length; i++) {
System.out.printf("arr[%d]=%d\n", i, arr[i]);
}
}
/**
* 显示队列头部数据(不取)
*
* @return
*/
int headQueue() {
// 判断队列是否为空
if (isEmpty()) {
throw new RuntimeException("队列已空,没有数据");
}
return arr[front + 1];
}
} | [
"talloner@qq.com"
] | talloner@qq.com |
9b261e0ff2d6d153a24b645d27af51bd5617dd45 | d81473c47713c687dc0f7cdd6ca27d1a79890435 | /src/main/java/de/kekru/struktogrammeditor/control/OS.java | d60823c7d7728fb333e9f62fa4c276cc80c8ae33 | [
"MIT"
] | permissive | FairyTail2000/struktogrammeditor | b67e54ac08f25792e845a5aa9cba53cf4e477720 | 94c3a4a97386de911f919181f6f6812a618b9ac6 | refs/heads/master | 2020-08-05T01:33:59.963292 | 2020-07-09T20:29:39 | 2020-07-09T20:29:39 | 212,349,107 | 0 | 0 | MIT | 2019-10-02T13:29:23 | 2019-10-02T13:29:23 | null | UTF-8 | Java | false | false | 365 | java | package de.kekru.struktogrammeditor.control;
public class OS {
public static boolean windows = false, linux = false, mac = false;
static {
if (System.getProperty("os.name").toLowerCase().contains("windows")) {
windows = true;
} else if (System.getProperty("os.name").toLowerCase().contains("mac")) {
mac = true;
} else {
linux = true;
}
}
}
| [
"unconfigured@null.spigotmc.org"
] | unconfigured@null.spigotmc.org |
0caad42c3a9a4a0a6cd166df837370fab70bb1d9 | ff79e46531d5ad204abd019472087b0ee67d6bd5 | /server-chat/src/och/chat/web/servlet/api/GetUpdatesResp.java | dc610ec48fd13e6ee8a4f536c1fde71761465394 | [
"Apache-2.0"
] | permissive | Frankie-666/live-chat-engine | 24f927f152bf1ef46b54e3d55ad5cf764c37c646 | 3125d34844bb82a34489d05f1dc5e9c4aaa885a0 | refs/heads/master | 2020-12-25T16:36:00.156135 | 2015-08-16T09:16:57 | 2015-08-16T09:16:57 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 829 | java | /*
* Copyright 2015 Evgeny Dolganov (evgenij.dolganov@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 och.chat.web.servlet.api;
import och.chat.web.model.ChatLogResp;
public class GetUpdatesResp {
public ChatLogResp log;
public GetUpdatesResp(ChatLogResp log) {
this.log = log;
}
}
| [
"evgenij.dolganov@gmail.com"
] | evgenij.dolganov@gmail.com |
58d392e6bc24bb18939d90a33f1ac5369c9a136d | 08a1993ce6f6c25e4b0554d8ee73bb8788f49b41 | /mtx-admin/src/test/java/com/mtx/study/mq/Producter.java | b260ef9e21f45dc59641009eeecb4421b6c64b22 | [
"MIT"
] | permissive | yudinggood/mtx | 417f08f3933e52ecdc1a873b7e71cd41247e07e9 | a444d9ce34f9685e56dfbdf9ff98aa6b2a15ef9b | refs/heads/master | 2022-12-20T03:14:34.425352 | 2019-12-25T01:37:08 | 2019-12-25T01:37:08 | 206,483,910 | 2 | 0 | MIT | 2022-12-16T11:35:27 | 2019-09-05T05:43:58 | JavaScript | UTF-8 | Java | false | false | 2,037 | java | package com.mtx.study.mq;
import org.apache.activemq.ActiveMQConnection;
import org.apache.activemq.ActiveMQConnectionFactory;
import javax.jms.*;
public class Producter {
public static void main(String[] args) throws JMSException {
// ConnectionFactory :连接工厂,JMS 用它创建连接
ConnectionFactory connectionFactory = new ActiveMQConnectionFactory(ActiveMQConnection.DEFAULT_USER,
ActiveMQConnection.DEFAULT_PASSWORD, "tcp://127.0.0.1:61616");
// JMS 客户端到JMS Provider 的连接
Connection connection = connectionFactory.createConnection();
connection.start();
// Session: 一个发送或接收消息的线程 false是不带事务
//AUTO_ACKNOWLEDGE 消息自动签收 CLIENT_ACKNOWLEDGE 手动签收
Session session = connection.createSession(false, Session.AUTO_ACKNOWLEDGE);
// Destination :消息的目的地;消息发送给谁.
// 获取session注意参数值my-queue是Query的名字
Destination destination = session.createQueue("my-queue");
// MessageProducer:消息生产者
MessageProducer producer = session.createProducer(destination);
// 设置不持久化
producer.setDeliveryMode(DeliveryMode.NON_PERSISTENT);
// 发送一条消息
for (int i = 1; i <= 5; i++) {
sendMsg(session, producer, i);
}
//session.commit();
session.close();
connection.close();
}
/**
* 在指定的会话上,通过指定的消息生产者发出一条消息
*
* @param session
* 消息会话
* @param producer
* 消息生产者
*/
public static void sendMsg(Session session, MessageProducer producer, int i) throws JMSException {
// 创建一条文本消息
TextMessage message = session.createTextMessage("Hello ActiveMQ!" + i);
// 通过消息生产者发出消息
producer.send(message);
}
}
| [
"1965390348@qq.com"
] | 1965390348@qq.com |
575994a12cb06740d247b722da6cd8f90dfd5197 | 7611ea06973ee9e538f0424702a9219ead6114a6 | /src/main/java/org/lfs/App.java | d9e69030ccbf0d665712cb0db3e51d447ea3f0d3 | [
"Apache-2.0"
] | permissive | ksangabriel/Large-File-Sorter | e68af71d07fe3db6699133e2ef0b0fc3ea191104 | b9ac1a73e76c25285809e86c06274d47337d65b7 | refs/heads/master | 2021-01-17T17:01:04.296343 | 2011-05-30T15:21:12 | 2011-05-30T15:21:12 | 1,729,754 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,030 | 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.lfs;
public class App {
public static void main( String[] args ) throws Exception {
// the application starts here
// need singletons
Main lfs = new Main();
lfs.process();
}
}
| [
"karl.sangabriel@gmail.com"
] | karl.sangabriel@gmail.com |
b985cd9703fcdd331b0f6821e97e233baf5ffb62 | 6151534f7b1f7627ebf95520adf85c382b613cee | /core/src/com/goldbytes/utils/Constants.java | 114ea76407f8b235b7d94146060bfb78e5640cac | [] | no_license | dobrodeyJ/Spaar | 10e1653cfd8a8aa7685534df4c2fa647a7b23fbc | 78c959a330b7d5d8e0bc441f43b9d39ddd505e1e | refs/heads/master | 2021-01-13T01:48:15.967122 | 2015-02-02T18:45:24 | 2015-02-02T18:45:24 | 30,150,760 | 0 | 1 | null | null | null | null | UTF-8 | Java | false | false | 322 | java | package com.goldbytes.utils;
import com.badlogic.gdx.Gdx;
public class Constants {
public final static float DISPLAY_WIDTH = Gdx.graphics.getWidth();
public final static float DISPLAY_HEIGHT = Gdx.graphics.getHeight();
public final static float GAME_WIDTH = 360;
public final static float GAME_HEIGHT = 480;
}
| [
"dobrode@bigmir.net"
] | dobrode@bigmir.net |
021c70750a2e8dd141ef8e9f5d9c8f78168a8c30 | d83bdaa62c7d2d5e867339002b44ed6bf6136a9b | /src/main/java/org/arthan/hotels/domain/entity/Hotel.java | 26d301fc8d1687e6a1988018c97dbb3858708d00 | [] | no_license | arthan1011/cv-test-hotels | 7359e67d23a56df5a1e37ef6e3ea49c0a11f491c | 20fa46d6dcccf92c2773d2c0a86a33a168a0eddb | refs/heads/master | 2020-04-17T15:11:17.749463 | 2019-01-20T17:18:23 | 2019-01-20T17:18:23 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 987 | java | package org.arthan.hotels.domain.entity;
import org.arthan.hotels.domain.Identifiable;
import org.hibernate.annotations.GenericGenerator;
import javax.persistence.*;
@Entity
@Table(name = "hotel")
public class Hotel implements Identifiable {
@Id
@GenericGenerator(
name = "hotel-generator",
strategy = "org.arthan.hotels.domain.HotelIdentityGenerator"
)
@GeneratedValue(generator = "hotel-generator")
public String id;
@Column
public String name;
@Column(name = "catid")
public String catalogId;
@Column(name = "addr")
public String address;
@Column(name = "img")
public String image;
@Column(name = "first_coordinate")
public Double firstCoordinate;
@Column(name = "second_coordinate")
public Double secondCoordinate;
@Column(name = "site_label")
public String siteLabel;
@Column(name = "site_url")
public String siteUrl;
@Column
public String services;
}
| [
"brainburns@protonmail.com"
] | brainburns@protonmail.com |
047641bc967539c8d2ea70bdba0e0ef8f78bdee5 | 0e0dae718251c31cbe9181ccabf01d2b791bc2c2 | /SCT2/tags/BEFORE_TYPE_SYSTEM/plugins/org.yakindu.sct.model.stext/emf-gen/org/yakindu/sct/model/stext/stext/impl/EventSpecImpl.java | afb0d221d120c9cfea490396f9bce7918102b0d3 | [] | no_license | huybuidac20593/yakindu | 377fb9100d7db6f4bb33a3caa78776c4a4b03773 | 304fb02b9c166f340f521f5e4c41d970268f28e9 | refs/heads/master | 2021-05-29T14:46:43.225721 | 2015-05-28T11:54:07 | 2015-05-28T11:54:07 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 862 | java | /**
*/
package org.yakindu.sct.model.stext.stext.impl;
import org.eclipse.emf.ecore.EClass;
import org.eclipse.emf.ecore.impl.MinimalEObjectImpl;
import org.yakindu.sct.model.stext.stext.EventSpec;
import org.yakindu.sct.model.stext.stext.StextPackage;
/**
* <!-- begin-user-doc -->
* An implementation of the model object '<em><b>Event Spec</b></em>'.
* <!-- end-user-doc -->
* <p>
* </p>
*
* @generated
*/
public class EventSpecImpl extends MinimalEObjectImpl.Container implements EventSpec {
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
protected EventSpecImpl() {
super();
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
protected EClass eStaticClass() {
return StextPackage.Literals.EVENT_SPEC;
}
} //EventSpecImpl
| [
"a.muelder@googlemail.com"
] | a.muelder@googlemail.com |
12f41487f4268290bc7ad244794831355676a5f4 | fd94100afbad434d14f074cda39faf4627c7f507 | /src/main/java/com/person/PersonApplication.java | 46bc0bc542d9ef2cdd29401d69814ce5fdd313e6 | [] | no_license | tonygits/person | 1b0d714432536081f3a9012ed876ed3d4ba79577 | 547b8ae87f25429085e112cf7b73cb89e0141148 | refs/heads/master | 2020-08-24T02:27:52.696931 | 2019-10-22T07:32:32 | 2019-10-22T07:32:32 | 216,748,051 | 0 | 0 | null | 2020-01-31T18:24:20 | 2019-10-22T07:17:56 | Java | UTF-8 | Java | false | false | 315 | java | package com.person;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
@SpringBootApplication
public class PersonApplication {
public static void main(String[] args) {
SpringApplication.run(PersonApplication.class, args);
}
}
| [
"gitau.ag@gmail.com"
] | gitau.ag@gmail.com |
1b0ac62646d96d2e0949bd08da831508efe09694 | 4dc293e80be43dd06ad9fc1e3fa7e6e9a58e3fd1 | /src/main/java/com/websystique/springmvc/HelloWorldRestController.java | 13ff44679377c3fafa6e5ce4f44e337f4ddf555f | [] | no_license | sivaiswarya/AppBRepo | e5993bbb881b4879afc17a8ce9c1e785d50ccbe0 | a3baa031bf2fcbc53b291f2b380f93d5bdd0d3e1 | refs/heads/master | 2021-04-12T12:32:05.279386 | 2016-06-30T06:12:13 | 2016-06-30T06:12:13 | 62,283,684 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 5,443 | java | package com.websystique.springmvc;
import java.util.List;
import javax.mail.MessagingException;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.HttpHeaders;
import org.springframework.http.HttpStatus;
import org.springframework.http.MediaType;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.util.UriComponentsBuilder;
import com.websystique.springmvc.model.User;
import com.websystique.springmvc.service.UserService;
@RestController
public class HelloWorldRestController {
@Autowired
UserService userService; //Service which will do all data retrieval/manipulation work
@Autowired
private SendSimpleMail ssm;
private static final Logger logger = LoggerFactory.getLogger(HelloWorldRestController.class);
//-------------------Retrieve All Users--------------------------------------------------------
@RequestMapping(value = "/user/", method = RequestMethod.GET)
public ResponseEntity<List<User>> listAllUsers() {
logger.info("AppBLogger: Retrieve All Users");
List<User> users = userService.findAllUsers();
if(users.isEmpty()){
return new ResponseEntity<List<User>>(HttpStatus.NO_CONTENT);//You many decide to return HttpStatus.NOT_FOUND
}
return new ResponseEntity<List<User>>(users, HttpStatus.OK);
}
//-------------------Retrieve Single User--------------------------------------------------------
@RequestMapping(value = "/user/{id}", method = RequestMethod.GET, produces = MediaType.APPLICATION_JSON_VALUE)
public ResponseEntity<User> getUser(@PathVariable("id") int id) {
logger.info("AppBLogger: Retrieve Single User");
// System.out.println("Fetching User with id " + id);
User user = userService.findById(id);
if (user == null) {
System.out.println("User with id " + id + " not found");
return new ResponseEntity<User>(HttpStatus.NOT_FOUND);
}
return new ResponseEntity<User>(user, HttpStatus.OK);
}
//-------------------Create a User--------------------------------------------------------
@RequestMapping(value = "/user/", method = RequestMethod.POST)
public ResponseEntity<Void> createUser(@RequestBody User user, UriComponentsBuilder ucBuilder) {
//System.out.println("Creating User " + user.getId());
logger.info("AppBLogger: Creating User");
userService.saveUser(user);
String toMail = user.getEmail();
int userid = user.getId();
String pass = user.getPassword();
try {
ssm.Mail(userid, pass, toMail);
} catch (MessagingException e) {
System.out.println("error sending email " + e);
e.printStackTrace();
}
HttpHeaders headers = new HttpHeaders();
headers.setLocation(ucBuilder.path("/user/{id}").buildAndExpand(user.getId()).toUri());
return new ResponseEntity<Void>(headers, HttpStatus.CREATED);
}
//------------------- Update a User --------------------------------------------------------
@RequestMapping(value = "/user/{id}", method = RequestMethod.PUT)
public ResponseEntity<User> updateUser(@PathVariable("id") int id, @RequestBody User user) {
//System.out.println("Updating User " + id);
logger.info("AppBLogger: Updating User"+ user.getId());
User currentUser = userService.findById(id);
if (currentUser==null) {
System.out.println("User with id " + id + " not found");
return new ResponseEntity<User>(HttpStatus.NOT_FOUND);
}
// currentUser.setUsername(user.getUsername());
currentUser.setFirstName(user.getFirstName());
currentUser.setLastName(user.getLastName());
currentUser.setPassword(user.getPassword());
currentUser.setRole(user.getRole());
currentUser.setAddress(user.getAddress());
currentUser.setEmail(user.getEmail());
userService.updateUser(currentUser);
return new ResponseEntity<User>(currentUser, HttpStatus.OK);
}
//------------------- Delete a User --------------------------------------------------------
@RequestMapping(value = "/user/{id}", method = RequestMethod.DELETE)
public ResponseEntity<User> deleteUser(@PathVariable("id") int id) {
// System.out.println("Fetching & Deleting User with id " + id);
logger.info("AppBLogger: Deleting User"+ id);
User user = userService.findById(id);
if (user == null) {
System.out.println("Unable to delete. User with id " + id + " not found");
return new ResponseEntity<User>(HttpStatus.NOT_FOUND);
}
userService.deleteUserById(id);
return new ResponseEntity<User>(HttpStatus.NO_CONTENT);
}
} | [
"sivaiswarya@gmail.com"
] | sivaiswarya@gmail.com |
52ad896dabc35235556d1f9d06d1eef283998a81 | 367d92dd52871e4089bb794e8384b9c9a5a81f25 | /Karat/FirstAndLastIndex.java | 76ad37807710765d6352784cc1de32365534277d | [] | no_license | SpicyZinc/underestimate | 54cfd10e3202e4bce5b8cb5d8b03481d295c308c | dbe9caffb41f153d5e23a583a1abe2c66e4bdf4b | refs/heads/master | 2023-03-09T01:31:43.867486 | 2023-02-28T10:05:14 | 2023-02-28T10:05:14 | 20,214,984 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 799 | java | class FirstAndLastIndex {
// good method
// (target + 1)'s position - 1
// use same function binarySearch is enough
public int[] searchRange(int[] nums, int target) {
int left = binarySearch(nums, target);
if (left >= nums.length || nums[left] != target) {
return new int[] {-1,-1};
}
return new int[] {left, binarySearch(nums, target + 1) - 1};
}
// first Greater or Equal
public int binarySearch(int[] nums, int target) {
int left = 0;
int right = nums.length;
while (left < right) {
int mid = left + (right - left) / 2;
if (nums[mid] < target) {
left = mid + 1;
} else {
right = mid;
}
}
return left;
}
} | [
"angxin880@gmail.com"
] | angxin880@gmail.com |
3084bff82915c3314e3cedbdab9423472f5bd6b4 | 9e31265c92f989cdbf3b6961671193af271dce3a | /src/main/java/com/mmall/dao/CartMapper.java | c795df354ce698af320fcbe7400198bddc9a76d2 | [
"Apache-2.0"
] | permissive | hinkleung/mmall_learning | 675630a6c9a838e89fbca55383f25ff9e62ca77f | e905d29d6cf96dc75d648c2c1aa8cc61e6abed95 | refs/heads/master | 2021-09-06T21:14:53.992846 | 2018-02-11T14:02:50 | 2018-02-11T14:02:50 | 110,825,213 | 0 | 0 | Apache-2.0 | 2018-02-11T14:02:50 | 2017-11-15T11:33:10 | Java | UTF-8 | Java | false | false | 1,102 | java | package com.mmall.dao;
import com.mmall.pojo.Cart;
import org.apache.ibatis.annotations.Param;
import org.springframework.web.bind.annotation.RequestParam;
import java.util.List;
public interface CartMapper {
int deleteByPrimaryKey(Integer id);
int insert(Cart record);
int insertSelective(Cart record);
Cart selectByPrimaryKey(Integer id);
int updateByPrimaryKeySelective(Cart record);
int updateByPrimaryKey(Cart record);
Cart selectCartByUserIdProductId(@Param("userId") Integer userId, @Param("productId") Integer productId);
List<Cart> selectCartByUserId(Integer userId);
int selectCartProductCheckedStatusByUserId(Integer userId);
int deleteByUserIdProductIds(@Param("userId") Integer userId,@Param("productIdList")List<String> productIdList);
int checkedOrUncheckedProduct(@Param("userId") Integer userId,@Param("productId") Integer productId,@Param("checked")Integer checked);
int selectCartProductCount(@Param("userId") Integer userId);
List<Cart> selectCheckedCartByUserId(Integer userId);
} | [
"394869042@qq.com"
] | 394869042@qq.com |
25b776d3a8268efdcee43179ad3442afe27f4a87 | bfc85fda36ce5223d3a80861ca2b7a30ed00f39e | /src/com/pikachu/activity/RegistersActivity.java | 26b7a2b3a72509665949728edbbfd0633a4b1355 | [] | no_license | Charlesan/PikachuClient | 588a56b171e24303259525d7108104180c152084 | d1267bdb60221fe4b059a597daa0a82277438e5e | refs/heads/master | 2020-03-27T00:02:34.916728 | 2014-06-14T11:06:20 | 2014-06-14T11:08:01 | null | 0 | 0 | null | null | null | null | GB18030 | Java | false | false | 5,393 | java | package com.pikachu.activity;
import java.util.List;
import com.pikachu.bean.LoginUserInfo;
import com.pikachu.bean.UserBean;
import com.pikachu.dao.UserDao;
import com.pikachu.res.R;
import android.app.Activity;
import android.app.AlertDialog;
import android.app.ProgressDialog;
import android.content.DialogInterface;
import android.content.Intent;
import android.os.Bundle;
import android.os.Handler;
import android.os.Message;
import android.view.KeyEvent;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;
import android.widget.EditText;
public class RegistersActivity extends Activity {
private EditText edname1;
private EditText edpassword1;
private EditText ednickname;
private Button btregister1;
private Button btreturn;
public ProgressDialog dialog = null;
private Handler handler = new Handler() {
@Override
public void handleMessage(Message msg) {
if ( msg.what == 1 ) {
dialog.dismiss();
new AlertDialog.Builder(RegistersActivity.this)
.setTitle("注册成功").setMessage("注册成功")
.setPositiveButton("确定", null).show();
// 弹出消息框
AlertDialog.Builder builder = new AlertDialog.Builder(RegistersActivity.this);
builder.setTitle("提示")
.setMessage("恭喜您,注册成功!")
.setCancelable(false)
.setPositiveButton("确定",
new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog, int id) {
// 跳转到登录界面
Intent in = new Intent();
in.setClass(RegistersActivity.this, LoginActivity.class);
startActivity(in);
// 销毁当前activity
RegistersActivity.this.onDestroy();
}
});
builder.show();
}
else if ( msg.what == 0 ) {
dialog.dismiss();
// 弹出消息框
new AlertDialog.Builder(RegistersActivity.this).setTitle("错误")
.setMessage("您输入的账号或昵称已存在!请重新输入。")
.setPositiveButton("确定", null).show();
}
else {
dialog.dismiss();
// 弹出消息框
new AlertDialog.Builder(RegistersActivity.this).setTitle("错误")
.setMessage("注册失败,请检查您的网络!")
.setPositiveButton("确定", null).show();
}
}
};
@Override
protected void onDestroy() {
super.onDestroy();
RegistersActivity.this.finish();
}
@Override
protected void onCreate(Bundle savedInstanceState) {
// TODO Auto-generated method stub
super.onCreate(savedInstanceState);
setContentView(R.layout.register);
edname1 = (EditText) findViewById(R.id.edname1);
edpassword1 = (EditText) findViewById(R.id.edpassword1);
ednickname = (EditText) findViewById(R.id.ednickname);
btregister1 = (Button) findViewById(R.id.btregister1);
btreturn = (Button) findViewById(R.id.btreturn);
btregister1.setOnClickListener(new OnClickListener() {
@Override
public void onClick(View v) {
// TODO Auto-generated method stub
final String name = edname1.getText().toString();
final String password = edpassword1.getText().toString();
final String nickname = ednickname.getText().toString();
if (!name.equals("") && !password.equals("") && !nickname.equals("")) {
if ( hasSpace(name) || hasSpace(password) || hasSpace(nickname) ) {
new AlertDialog.Builder(RegistersActivity.this)
.setTitle("提示").setMessage("帐号密码昵称中不能包含空格")
.setPositiveButton("确定", null).show();
return;
}
dialog = ProgressDialog.show(RegistersActivity.this, "请稍等", "提交数据中...", true);
new Thread() {
public void run() {
UserDao userDao = new UserDao();
int result = userDao.register(name, password, nickname);
Message msg = new Message();
if ( result == 1 ) {
msg.what = 1;
}
else if ( result == 3 ) {
msg.what = 0;
}
else {
msg.what = -1;
}
handler.sendMessage(msg);
}
}.start();
} else {
new AlertDialog.Builder(RegistersActivity.this)
.setTitle("提示").setMessage("帐号密码昵称不能为空")
.setPositiveButton("确定", null).show();
}
}
});
btreturn.setOnClickListener(new OnClickListener() {
@Override
public void onClick(View v) {
// 跳转到登录界面
Intent in = new Intent();
in.setClass(RegistersActivity.this, LoginActivity.class);
startActivity(in);
// 销毁当前activity
RegistersActivity.this.onDestroy();
}
});
}
@Override
public boolean onKeyDown(int keyCode, KeyEvent event) {
if (keyCode == KeyEvent.KEYCODE_BACK && event.getRepeatCount() == 0) {
// 跳转到登录界面
Intent in = new Intent();
in.setClass(RegistersActivity.this, LoginActivity.class);
startActivity(in);
// 销毁当前activity
RegistersActivity.this.onDestroy();
return false;
}
return false;
}
private boolean hasSpace(String str) {
for ( int i = 0; i < str.length(); i++ ) {
if ( str.charAt(i) == ' ' ) {
return true;
}
}
return false;
}
}
| [
"ccmaster58@gmail.com"
] | ccmaster58@gmail.com |
73c36764c7aa99969399d7fff7dba1a29ec47ef8 | 9765c3bd4057e3487ec3d42d2762166c32ee3947 | /app/src/androidTest/java/com/example/yasirbilici/android_ses_ile_yazi_yazdirma/ApplicationTest.java | 4b2ed6497c031d2616c6b8286822ac8117ecd39a | [] | no_license | yasirbilici/Android_ses_ile_yazi_yazdirma | 81e7ba2d84d16505506fe586575cd806b504045a | 3159a2dfbdfd97bbe22e4b38a45bd03f2e99d178 | refs/heads/master | 2021-07-08T06:40:18.437377 | 2017-10-07T06:31:03 | 2017-10-07T06:31:03 | 106,075,922 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 384 | java | package com.example.yasirbilici.android_ses_ile_yazi_yazdirma;
import android.app.Application;
import android.test.ApplicationTestCase;
/**
* <a href="http://d.android.com/tools/testing/testing_android.html">Testing Fundamentals</a>
*/
public class ApplicationTest extends ApplicationTestCase<Application> {
public ApplicationTest() {
super(Application.class);
}
} | [
"info@yasirbilici.com"
] | info@yasirbilici.com |
527a7c01c663e65c9d46d151e706b57d61223992 | 8c85b56cc769031fc2e9ed7e62e49eb9b693e4f4 | /flyme_android/app/src/main/java/me/smart/flyme/bean/computer/Responce.java | 6bd2e6be2838c58467f7ee9c4886c6ff04837e53 | [] | no_license | iceleeyo/FlyIM | 48a1e242bce6a30f95a20f554975846f38579a65 | adad01b7874678ed73d202da3ef306c46a0603be | refs/heads/master | 2020-06-22T10:57:32.003802 | 2016-09-07T13:11:29 | 2016-09-07T13:11:29 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 843 | java | package me.smart.flyme.bean.computer;
import com.alibaba.fastjson.JSON;
import java.io.Serializable;
/**
* author:wypx on 2016/7/31 15:21
* blog:smarting.me
*/
public class Responce implements Serializable
{
private int cmdID;
private int responce;
public static Responce decode(String json) {
if (null == json)
return null;
Responce responce = JSON.parseObject(json, Responce.class);
System.out.println(responce.getCmdID());
System.out.println(responce.getResponce());
return responce;
}
public Responce(int cmdDriverList, String s)
{
}
public int getResponce() {
return responce;
}
public void setResponce(int reponce) {
this.responce = reponce;
}
public int getCmdID() {
return cmdID;
}
public void setCmdID(int cmdID) {
this.cmdID = cmdID;
}
}
| [
"1067939689@qq.com"
] | 1067939689@qq.com |
77abf3b54151a014906cb298db2c3545f4ff7151 | 2ae07922eef48981551818867c7af91bc84df417 | /app/src/main/java/com/flatshare/domain/interactors/matchingoverview/MatchesInteractor.java | fbbaa1e7b23fc816ce98e96d5ace90e75314999c | [] | no_license | dheuss/FlatShare | 5382630c6196e7a7a4d6e3d1a36875daf2b9c4bd | 42df73ece870b35e83f849876d639200bf21ddc2 | refs/heads/master | 2020-07-30T19:32:44.786200 | 2017-02-04T06:58:18 | 2017-02-04T06:58:18 | 74,959,160 | 0 | 1 | null | null | null | null | UTF-8 | Java | false | false | 727 | java | package com.flatshare.domain.interactors.matchingoverview;
import android.graphics.Bitmap;
import com.flatshare.domain.datatypes.db.common.MatchEntry;
import com.flatshare.domain.datatypes.db.profiles.ApartmentProfile;
import com.flatshare.domain.datatypes.db.profiles.TenantProfile;
import com.flatshare.domain.datatypes.pair.Pair;
import com.flatshare.domain.interactors.base.Interactor;
import java.util.List;
public interface MatchesInteractor extends Interactor {
interface Callback {
void onApartmentMatchesFound(final List<Pair<ApartmentProfile, Bitmap>> apMatches);
void onTenantMatchesFound(final List<Pair<TenantProfile, Bitmap>> tenMatches);
void onFailure(String error);
}
}
| [
"sandro-gauss@web.de"
] | sandro-gauss@web.de |
6a50480565c8d01f00579690c949528304c385e6 | 419662614ce28a3b4ad3241ec234fad19352feda | /src/com/java/development/five/thiseg/ThisDemo08.java | bb552b2063fbb15c3dc97a8ec0bddaf7cb054130 | [] | no_license | zxsn/JavaDevelopmentPracticeClassic | 224e29a1b371103e85d536e20a46238f5503b172 | cfbb4ff0756a4462270cadaa7a73e234296dee34 | refs/heads/master | 2020-03-28T12:24:18.925411 | 2018-11-13T07:57:44 | 2018-11-27T09:32:22 | 148,294,255 | 1 | 1 | null | null | null | null | UTF-8 | Java | false | false | 1,926 | java | /**
* projectName:Java开发实战经典
* fileName:ThisDemo08.java
* packageName:com.java.development.five.thiseg
* date:2018年9月14日上午11:31:58
* copyright(c) 2017-2020 xxx公司
*/
package com.java.development.five.thiseg;
/**
* @title: ThisDemo08.java
* @package com.java.development.five.thiseg
* @description: TODO
* @author: zxsn
* @date: 2018年9月14日 上午11:31:58
* @version: V1.0
*/
class Person8 {
private String name;
private int age;
public Person8(String name, int age) {
super();
this.name = name;
this.age = age;
}
public boolean compare(Person8 per) {
Person8 p1 = this;
Person8 p2 = per;
if (p1 == p2) { //首先比较两个对象地址是否相同
return true;
}
if (p2 == null) { //判断对象是否为空
return false;
}
//分别判断每一个属性是否相等
if (p1.name.equals(p2.name) && p1.age == p2.age) {
return true;
} else
return false;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public int getAge() {
return age;
}
public void setAge(int age) {
this.age = age;
}
}
public class ThisDemo08 {
/**
*@title main
*@description: TODO
*@author: zxsn
*@date: 2018年9月14日 上午11:31:58
*@param args
*@throws
*/
public static void main(String[] args) {
Person8 per1 = new Person8("张三", 33);
Person8 per2 = new Person8("张三", 33);
if (per1.compare(per2)) {
System.out.println("两个对象相等!");
} else
System.out.println("两个对象不想等!");
}
}
| [
"Administrator@DESKTOP-6ODSTVM.lan"
] | Administrator@DESKTOP-6ODSTVM.lan |
dcfe707eb4a5674ffe165f4d897ce1846b3ea3ba | 61e1dd73579e4587ada4512a5281d89ed3160ff4 | /src/main/java/cc/bukkit/item/ChainItemMeta.java | 27947e0802ad0cb98e6578fa0f88b625b6901f8a | [
"MIT"
] | permissive | bukkitcommons/BukkitCommons | ed504dc4a8a4399a1736ea94819184ddd0459418 | c59c64b4602698e5a0db09634018af26c8a92cf0 | refs/heads/master | 2020-05-17T18:44:05.323496 | 2019-05-25T14:52:01 | 2019-05-25T14:52:01 | 183,893,344 | 7 | 0 | null | null | null | null | UTF-8 | Java | false | false | 5,986 | java | package cc.bukkit.item;
import java.util.List;
import java.util.Map;
import java.util.Set;
import org.bukkit.attribute.Attribute;
import org.bukkit.attribute.AttributeModifier;
import org.bukkit.enchantments.Enchantment;
import org.bukkit.inventory.EquipmentSlot;
import org.bukkit.inventory.ItemFlag;
import org.bukkit.inventory.ItemStack;
import org.bukkit.inventory.meta.ItemMeta;
import org.bukkit.inventory.meta.tags.CustomItemTagContainer;
import com.google.common.collect.Multimap;
import cc.bukkit.item.interfaces.ItemMetaSupplier;
import cc.bukkit.item.interfaces.ItemStackSupplier;
import lombok.RequiredArgsConstructor;
@RequiredArgsConstructor
public class ChainItemMeta implements ItemStackSupplier, ItemMetaSupplier {
protected final ItemStack item;
protected final ItemMeta meta;
@Override
public ItemMeta toItemMeta() {
return meta;
}
@Override
public ItemStack toItemStack() {
return item;
}
/**
*
* @return
*/
public ItemMetaReference reference() {
return new ItemMetaReference(item, meta);
}
// Performance things
/**
*
* @param itemStack
* @return
*/
public ChainItemMeta setMetaFor(ItemStack itemStack) {
itemStack.setItemMeta(meta);
return this;
}
/**
*
* @param itemStacks
* @return
*/
public ChainItemMeta setMetaFor(ItemStack... itemStacks) {
for (ItemStack itemStack : itemStacks)
itemStack.setItemMeta(meta);
return this;
}
/**
*
* @param clip
* @return
*/
public ChainItemMeta applyMetaClip(ItemMetaClip clip) {
clip.applyFor(meta);
return this;
}
// ------------------------------
// Setter
// ------------------------------
public ChainItemMeta addEnchant(Enchantment ench, int level, boolean ignoreLevelRestriction) {
meta.addEnchant(ench, level, ignoreLevelRestriction);
return this;
}
public ChainItemMeta removeEnchant(Enchantment ench) {
meta.removeEnchant(ench);
return this;
}
public ChainItemMeta getAttributeModifiers(EquipmentSlot slot) {
meta.getAttributeModifiers(slot);
return this;
}
public ChainItemMeta getAttributeModifiers(Attribute attribute) {
meta.getAttributeModifiers(attribute);
return this;
}
public ChainItemMeta addAttributeModifier(Attribute attribute, AttributeModifier modifier) {
meta.addAttributeModifier(attribute, modifier);
return this;
}
public ChainItemMeta removeAttributeModifier(Attribute attribute) {
meta.removeAttributeModifier(attribute);
return this;
}
public ChainItemMeta removeAttributeModifier(EquipmentSlot slot) {
meta.removeAttributeModifier(slot);
return this;
}
public ChainItemMeta removeAttributeModifier(Attribute attribute, AttributeModifier modifier) {
meta.removeAttributeModifier(attribute, modifier);
return this;
}
public ChainItemMeta setAttributeModifiers(Multimap<Attribute, AttributeModifier> attributeModifiers) {
meta.setAttributeModifiers(attributeModifiers);
return this;
}
public ChainItemMeta setDisplayName(String name) {
meta.setDisplayName(name);
return this;
}
public ChainItemMeta setLore(List<String> lore) {
meta.setLore(lore);
return this;
}
public ChainItemMeta setLocalizedName(String name) {
meta.setLocalizedName(name);
return this;
}
public ChainItemMeta addItemFlags(ItemFlag... itemFlags) {
meta.addItemFlags(itemFlags);
return this;
}
public ChainItemMeta removeItemFlags(ItemFlag... itemFlags) {
meta.removeItemFlags(itemFlags);
return this;
}
public ChainItemMeta setUnbreakable(boolean unbreakable) {
meta.setUnbreakable(unbreakable);
return this;
}
// ------------------------------
// Getter
// ------------------------------
public Map<String, Object> serialize() {
return meta.serialize();
}
public boolean hasDisplayName() {
return meta.hasDisplayName();
}
public String getDisplayName() {
return meta.getDisplayName();
}
public boolean hasLocalizedName() {
return meta.hasLocalizedName();
}
public String getLocalizedName() {
return meta.getLocalizedName();
}
public boolean hasLore() {
return meta.hasLore();
}
public List<String> getLore() {
return meta.getLore();
}
public boolean hasEnchants() {
return meta.hasEnchants();
}
public boolean hasEnchant(Enchantment ench) {
return meta.hasEnchant(ench);
}
public int getEnchantLevel(Enchantment ench) {
return meta.getEnchantLevel(ench);
}
public Map<Enchantment, Integer> getEnchants() {
return meta.getEnchants();
}
public boolean hasConflictingEnchant(Enchantment ench) {
return meta.hasConflictingEnchant(ench);
}
public Set<ItemFlag> getItemFlags() {
return meta.getItemFlags();
}
public boolean hasItemFlag(ItemFlag flag) {
return meta.hasItemFlag(flag);
}
public boolean isUnbreakable() {
return meta.isUnbreakable();
}
public boolean hasAttributeModifiers() {
return meta.hasAttributeModifiers();
}
public Multimap<Attribute, AttributeModifier> getAttributeModifiers() {
return meta.getAttributeModifiers();
}
public CustomItemTagContainer getCustomTagContainer() {
return meta.getCustomTagContainer();
}
public ItemMeta clone() {
return meta.clone();
}
public org.bukkit.inventory.meta.ItemMeta.Spigot spigot() {
return meta.spigot();
}
}
| [
"i@omc.hk"
] | i@omc.hk |
aa909c3f3763b1792bf8f6d27bb7dcdfe53370b4 | dbf7175ff161d23aa1a66395ad2cfb18eeb4fdce | /src/main/java/com/example/demo/services/MaterialServices.java | a868679d83cd161ebea9f5d7b924a96f43d525b6 | [] | no_license | xandenunes/-LixeiraEcologicaHubBackend | 4e71868c5394f82861f04aad7909caaf059336b8 | 639135525ba1354582f6d5837923d51e27b589f4 | refs/heads/main | 2023-07-17T10:15:11.959464 | 2021-09-11T02:05:33 | 2021-09-11T02:05:33 | 402,084,239 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 614 | java | package com.example.demo.services;
import java.util.ArrayList;
import java.util.Optional;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.example.demo.models.Material;
import com.example.demo.repository.MaterialRepository;
@Service
public class MaterialServices {
@Autowired
MaterialRepository repository;
public ArrayList<Material> findAll() {
return (ArrayList<Material>) repository.findAll();
}
public Optional<Material> get(Integer id) {
Optional<Material> material = repository.findById(id);
return material;
}
}
| [
"fellipeum@hotmail.com"
] | fellipeum@hotmail.com |
5113d81c863d6680109defef5a9fdc34c5d2f2c5 | 0405bba760cbfae27ad84cbcc5510a3cc138f293 | /src/com/proyecto/petdroid/vo/ConsultaVo.java | 40c8d9edc15d5595805d99e5b9b1a2e1714ad01e | [] | no_license | Fabho/soft_2 | 1b67575d6a5eb40f56f873acb8838f837b82e693 | 142a88724a8999f6c70b7b9f70931a751b0219fe | refs/heads/master | 2021-01-20T20:53:28.171279 | 2016-06-03T13:09:12 | 2016-06-03T13:09:12 | 60,345,345 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,523 | java | package com.proyecto.petdroid.vo;
public class ConsultaVo {
private int consulta_id;
private int tipo;
private String patologia;
private long fecha;
private String tratamiento;
private String observaciones;
private int mascota;
public ConsultaVo(){}
public ConsultaVo(int consulta_id, int tipo, String patologia,
long fecha, String tratamiento,String observaciones,int mascota){
this.consulta_id = consulta_id;
this.tipo = tipo;
this.patologia = patologia;
this.fecha = fecha;
this.tratamiento = tratamiento;
this.observaciones = observaciones;
this.mascota = mascota;
}
public int getConsulta_id() {
return consulta_id;
}
public void setConsulta_id(int consulta_id) {
this.consulta_id = consulta_id;
}
public int getTipo() {
return tipo;
}
public void setTipo(int tipo) {
this.tipo = tipo;
}
public String getPatologia() {
return patologia;
}
public void setPatologia(String patologia) {
this.patologia = patologia;
}
public long getFecha() {
return fecha;
}
public void setFecha(long fecha) {
this.fecha = fecha;
}
public String getTratamiento() {
return tratamiento;
}
public void setTratamiento(String tratamiento) {
this.tratamiento = tratamiento;
}
public String getObservaciones() {
return observaciones;
}
public void setObservaciones(String observaciones) {
this.observaciones = observaciones;
}
public int getMascota() {
return mascota;
}
public void setMascota(int mascota) {
this.mascota = mascota;
}
}
| [
"fabian.calsina@tierconnect.com"
] | fabian.calsina@tierconnect.com |
d8fa2cd79e6c7ffa2be4c863d8d69e66b93d3e2e | ab5ce0728238ec6aa59542643dc62e113ccd2e14 | /src/main/java/com/github/dreamsmoke/ocr/jna/Kernel32.java | 4fefd6b45b8590759212124a686fcfc3da3c2b2f | [] | no_license | MoonshineBucket/OCR | 9dd52331e6abccf8d5a8fc70c65b06081bc59cc2 | e685da60800ed842223c74976eeb70aa89e3d9ae | refs/heads/master | 2023-08-20T23:37:22.894750 | 2021-10-25T13:03:25 | 2021-10-25T13:03:25 | 419,908,343 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 349 | java | package com.github.dreamsmoke.ocr.jna;
import com.sun.jna.Native;
import com.sun.jna.platform.win32.WinDef;
import com.sun.jna.win32.StdCallLibrary;
public interface Kernel32 extends StdCallLibrary {
Kernel32 INSTANCE = Native.loadLibrary("kernel32", Kernel32.class, JNA.UNICODE_OPTIONS);
WinDef.HMODULE GetModuleHandle(String name);
}
| [
"dmitriy.arta@gmail.com"
] | dmitriy.arta@gmail.com |
d83bb4f129260fe76024aee4aa98dc05b5317f96 | 31f03550d7a80a4eaa356f19fd62c8332b94483d | /KimSeWon/week5/BOJ_3184_양.java | e971aaac2360149905a8c6672f019824e244f07b | [] | no_license | sewonkimm/SSAFY-algo | 80e3f86d9052145674c98b31a7e8a9cfed5c6524 | 4910c55d4c5391bd276394ba0acf907d3b511810 | refs/heads/master | 2023-01-22T05:41:59.511859 | 2020-11-20T23:23:35 | 2020-11-20T23:23:35 | 283,392,207 | 2 | 3 | null | 2020-11-20T23:23:36 | 2020-07-29T03:51:33 | Java | UTF-8 | Java | false | false | 1,997 | java | package com.week5;
import java.awt.Point;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.LinkedList;
import java.util.Queue;
import java.util.StringTokenizer;
public class BOJ_3184_양 {
static int R, C, sheep, wolf;
static char[][] map;
static boolean[][] visited;
static int[][] dir = { {-1,0}, {1,0}, {0,-1}, {0,1} };
public static void main(String[] args) throws IOException {
// input
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
StringTokenizer st = new StringTokenizer(br.readLine(), " ");
R = Integer.parseInt(st.nextToken());
C = Integer.parseInt(st.nextToken());
map = new char[R][C];
visited = new boolean[R][C];
for(int i=0; i<R; i++) {
String str = br.readLine();
for(int j=0; j<C; j++) {
map[i][j] = str.charAt(j);
}
}
// 탐색
for(int i=0; i<R; i++) {
for(int j=0; j<C; j++) {
if(map[i][j] != '#' && !visited[i][j]) {
int o = 0; // 구역 안 양의 수
int v = 0; // 구역 안 늑대 수
Queue<Point> q = new LinkedList<>();
q.offer(new Point(i, j));
visited[i][j] = true;
while(!q.isEmpty()) {
Point now = q.poll();
if(map[now.x][now.y] == 'o') o++;
else if(map[now.x][now.y] == 'v') v++;
for(int k=0; k<4; k++) { // 4방 탐색
int nx = now.x + dir[k][0];
int ny = now.y + dir[k][1];
if(nx >= 0 && nx < R && ny >= 0 && ny <C && !visited[nx][ny] && map[nx][ny] != '#') {
visited[nx][ny] = true;
q.offer(new Point(nx, ny));
}
}
}
if(o > v) { // 구역안에 양의 수가 늑대보다 많을 때
sheep += o;
}
else { // 구역안에 늑대의 수가 양보다 많을 때
wolf += v;
}
}
}
}
// output
System.out.println(sheep+" "+wolf);
}
}
| [
"swon962@gmail.com"
] | swon962@gmail.com |
6d4fd4a9732f268c5ed9593022a38e67f25f409b | 7ccfc8133c223be32c9a36a54e3d3511805019b4 | /Week3/GRAY_A03Q02.java | a62431a1720baf3461bdde251637659d7594fef3 | [] | no_license | jd-gray/java_foundations | 96d8ca758ff4ccdf23223b3c1134cef76c475249 | b8cb23d7288fdb186ef26f3496c77c1160e43042 | refs/heads/master | 2020-04-19T09:16:12.320953 | 2016-10-03T00:31:20 | 2016-10-03T00:31:20 | 67,447,447 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,504 | java | /**
* Assignment 3 Question 2: A class to simulate rolling many dice and finding the ratio of snake eyes.
*
* Completion time: 30 minutes
*
* @author Jared Gray and Lewis et al., CST200 team.
* @version 1.0
*/
package Week3;
public class GRAY_A03Q02 {
//Note: you should not need to change the Die class.
public static class Die {
private final int MAX = 6;
private int faceValue;
public Die() {
faceValue = 1;
}
public int roll() {
faceValue = (int)(Math.random() * MAX) + 1;
return faceValue;
}
public void setFaceValue(int value) {
if(value > 0 && value <= MAX)
faceValue = value;
}
public int getFaceValue() {
return faceValue;
}
public String toString() {
String result = Integer.toString(faceValue);
return result;
}
}
public static class PairOfDice {
private Die die1, die2;
private int sum;
public PairOfDice() {
// Two Die objects
this.die1 = new Die();
this.die2 = new Die();
}
// Getters for Die values
public int getDie1() {
return die1.getFaceValue();
}
public int getDie2() {
return die2.getFaceValue();
}
// Setters for Die values
public void setDie1(int num) {
die1.setFaceValue(num);
}
public void setDie2(int num) {
die2.setFaceValue(num);
}
public void roll() {
die1.roll();
die2.roll();
}
public String toString() {
sum = getDie1() + getDie2();
return "The current sum of the two die values is " + sum;
}
}
public static void main(String[] args) {
final int ROLLS = 500;
int count = 0;
// Initialize the pair of dice method
PairOfDice diePair = new PairOfDice();
for(int roll = 1; roll <= ROLLS; roll++){
// Roll the die pair and count the number of snake eyes.
// snake eyes occur when both dice roll one.
diePair.roll();
if (diePair.getDie1() == 1 && diePair.getDie2() == 1) {
count++;
}
}
System.out.println("Number of rolls: " + ROLLS);
System.out.println("Number of snake eyes: " + count);
System.out.println("Ratio: " + (double)count / ROLLS);
}
} | [
"jared@jaredgray.us"
] | jared@jaredgray.us |
7852422fe5dfa1bc76b528532cfad51061537f01 | 22250bf6bfad72c8d18c86a4a6e211a5d9f95cb9 | /src/tests/AllTests.java | 8ec35cdc0239b9d447dd8c870000f639f87c455d | [] | no_license | tylerj9010/Week-2-Assessment-JUnit | 134d8de33ff210d5a7274bb49a3d634298d610b9 | 10031aa39a8112ee9ff2a41e5f0d831b9668ab32 | refs/heads/master | 2020-12-23T23:57:57.341574 | 2020-01-30T22:10:51 | 2020-01-30T22:10:51 | 237,315,724 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 233 | java | package tests;
import org.junit.runner.RunWith;
import org.junit.runners.Suite;
import org.junit.runners.Suite.SuiteClasses;
@RunWith(Suite.class)
@SuiteClasses({ TestCircle.class, TestRectangle.class })
public class AllTests {
}
| [
"54857917+tylerj9010@users.noreply.github.com"
] | 54857917+tylerj9010@users.noreply.github.com |
2c0ef913949898f39c96d98f7b063d121bdc26a0 | b2104a8e1d6777831d77bba882b44bde69210710 | /src/main/java/com/wotif/schema/ota/_2007b/soap/ReservationRequestEnvelope.java | 8d4415e3c086bc297ae99c98d14c468c94359f50 | [] | no_license | wotifgroup/ota-schema | 57dda9dc7d3b5d2f98326d3518f28f062d5e94d4 | 66c4353247fbfdadc0e6f49f2b75b2020c064ecb | refs/heads/master | 2020-04-04T05:20:42.359125 | 2014-09-03T05:55:23 | 2014-09-03T05:55:23 | 28,319,242 | 2 | 0 | null | null | null | null | UTF-8 | Java | false | false | 887 | java | ////////////////////////////////////////////////////////////////////////////////
//
// Copyright (c) 2013, Wotif.com. All rights reserved.
//
// This is unpublished proprietary source code of Wotif.com.
// The copyright notice above does not evidence any actual or intended
// publication of such source code.
//
////////////////////////////////////////////////////////////////////////////////
package com.wotif.schema.ota._2007b.soap;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlRootElement;
@XmlRootElement(name = "Envelope")
public class ReservationRequestEnvelope {
@XmlElement(name = "Header")
private Header header;
@XmlElement(name = "Body")
private ReservationRequestBody body;
public Header getHeader() {
return header;
}
public ReservationRequestBody getBody() {
return body;
}
}
| [
"pete.capra@wotifgroup.com"
] | pete.capra@wotifgroup.com |
87d8f5fd89031dc01a12c2bc47be6101d1bedc7a | 58d2677532103d3fb04a612c4d4c01411982c81e | /src/main/java/Fetcher.java | fc73d95169307ceb3c1305a54fed91350090888d | [] | no_license | SeemannMx/Ameco | 61db52d8fd05c946d68ccad8214e87e71c76a8c8 | 8d48a27a66931cc7859fe3dc8a10cfd38d1fb70c | refs/heads/master | 2021-09-18T19:19:29.165649 | 2018-07-18T08:39:32 | 2018-07-18T08:39:32 | 141,406,408 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,672 | java | import org.apache.commons.io.FileUtils;
import java.io.File;
import java.io.IOException;
import java.net.MalformedURLException;
import java.net.URL;
public class Fetcher {
private final String TAG = "FETCHER ";
public void fetchAllDataFromAmeco(){
String baseUrlasString = "http://ec.europa.eu/economy_finance/db_indicators/ameco/documents/ameco";
String baseDestination = "/Users/tkallinich/DashboardProjectResources/dashboard_ameco";
String zip = ".zip";
StringBuilder sb = new StringBuilder();
String urlAsString = "";
String destination = "";
int elementsToFetch = 19;
for(int i = 1; i < elementsToFetch; i++){
try {
urlAsString = baseUrlasString + i + zip;
System.out.println("URL : " + urlAsString);
destination = baseDestination + i + zip;
System.out.println("DESTINATION: " + destination);
URL url = new URL(urlAsString);
File file = new File(destination);
FileUtils.copyURLToFile(url, file);
} catch (MalformedURLException e) {
e.printStackTrace();
} catch (IOException e) {
e.printStackTrace();
}
}
System.out.println("fetched all data");
}
}
/**
Population and Employment
href="http://ec.europa.eu/economy_finance/db_indicators/ameco/documents/ameco1.zip"
Consumption
href="http://ec.europa.eu/economy_finance/db_indicators/ameco/documents/ameco2.zip"
**/
// String destination = "/Users/tkallinich/DashboardProjectResources/dashboard_ameco1.zip";
| [
"tkallinich@inovex.de"
] | tkallinich@inovex.de |
e4e1f4b4b730c445d1a35edc929458d6f5271b17 | 359d7e0faff5100c3314f35ddcad1d7644142ee3 | /ggp-code-base/src/main/java/org/ggp/base/util/ui/GameSelector.java | 3bfadebc85d1b7f25f08c5ef8150117d94426511 | [] | no_license | amilich/monte_carlo_forest_fire | 7bc181ba1971ff8f21e537d7c8a3744eedc2e15a | ad2fc5b1d7c58bf909638572034cf3d832bfa9dd | refs/heads/master | 2021-03-24T12:13:22.544594 | 2018-08-11T01:08:27 | 2018-08-11T01:08:27 | 87,489,065 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,986 | java | package org.ggp.base.util.ui;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.util.ArrayList;
import java.util.Collections;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import javax.swing.JComboBox;
import org.ggp.base.util.game.CloudGameRepository;
import org.ggp.base.util.game.Game;
import org.ggp.base.util.game.GameRepository;
import org.ggp.base.util.game.LocalGameRepository;
/**
* GameSelector is a pair of widgets for selecting a game repository
* and then choosing a game from that game repository. Currently this
* is a little rough, and could use some polish, but it provides all
* of the important functionality: you can load games both from local
* storage and from game repositories on the web.
*
* @author Sam Schreiber
*/
public class GameSelector implements ActionListener {
JComboBox<NamedItem> theGameList;
JComboBox<String> theRepositoryList;
GameRepository theSelectedRepository;
Map<String, GameRepository> theCachedRepositories;
class NamedItem {
public final String theKey;
public final String theName;
public NamedItem(String theKey, String theName) {
this.theKey = theKey;
this.theName = theName;
}
@Override
public String toString() {
return theName;
}
}
public GameSelector() {
theGameList = new JComboBox<NamedItem>();
theGameList.addActionListener(this);
theRepositoryList = new JComboBox<String>();
theRepositoryList.addActionListener(this);
theCachedRepositories = new HashMap<String, GameRepository>();
theRepositoryList.addItem("games.ggp.org/base");
theRepositoryList.addItem("games.ggp.org/dresden");
theRepositoryList.addItem("games.ggp.org/stanford");
theRepositoryList.addItem("Local Game Repository");
}
@Override
public void actionPerformed(ActionEvent e) {
if (e.getSource() == theRepositoryList) {
String theRepositoryName = theRepositoryList.getSelectedItem().toString();
if (theCachedRepositories.containsKey(theRepositoryName)) {
theSelectedRepository = theCachedRepositories.get(theRepositoryName);
} else {
if (theRepositoryName.equals("Local Game Repository")) {
theSelectedRepository = new LocalGameRepository();
} else {
theSelectedRepository = new CloudGameRepository(theRepositoryName);
}
theCachedRepositories.put(theRepositoryName, theSelectedRepository);
}
repopulateGameList();
}
}
public GameRepository getSelectedGameRepository() {
return theSelectedRepository;
}
public void repopulateGameList() {
GameRepository theRepository = getSelectedGameRepository();
List<String> theKeyList = new ArrayList<String>(theRepository.getGameKeys());
Collections.sort(theKeyList);
theGameList.removeAllItems();
for (String theKey : theKeyList) {
Game theGame = theRepository.getGame(theKey);
if (theGame == null) {
continue;
}
String theName = theGame.getName();
if (theName == null) {
theName = theKey;
}
if (theName.length() > 24)
theName = theName.substring(0, 24) + "...";
theGameList.addItem(new NamedItem(theKey, theName));
}
}
public JComboBox<String> getRepositoryList() {
return theRepositoryList;
}
public JComboBox<NamedItem> getGameList() {
return theGameList;
}
public Game getSelectedGame() {
try {
return getSelectedGameRepository().getGame(((NamedItem)theGameList.getSelectedItem()).theKey);
} catch(Exception e) {
return null;
}
}
} | [
"milichab@gmail.com"
] | milichab@gmail.com |
49df5c9a7d77d36bb6fd66a35e53217a3d45b595 | 80118d2f7b75395c4484d73989fde2a0bb1bd614 | /src/GeralFunctions.java | d8b804a941fbbc89b9184fc7154e8f1c44e43676 | [] | no_license | fonsofernandes/Facul-Projeto-Integrado | 3e54acbb98b09947ed89e3a139663d26acab2654 | e1019ee65b72c6586e2ed019187b8176062a100c | refs/heads/master | 2021-05-27T07:02:09.812344 | 2014-03-20T03:33:43 | 2014-03-20T03:33:43 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,252 | java | import java.text.DateFormat;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Date;
public class GeralFunctions
{
public static Boolean IsDate( String date, String mask )
{
SimpleDateFormat format = new SimpleDateFormat( mask );
Date data;
try
{
data = format.parse( date );
return true;
}
catch ( Exception ex )
{
data = null;
return false;
}
}
public static Date now()
{
return new Date();
}
public static Date formataData( String data, String format )
{
if ( data == null || data.equals( "" ) )
return null;
Date date = null;
try
{
DateFormat formatter = new SimpleDateFormat( format );
date = (java.util.Date) formatter.parse( data );
}
catch ( Exception e )
{
}
return date;
}
public static Boolean IsInteger( String value )
{
try
{
int valueTemp = Integer.parseInt( value );
return true;
}
catch ( Exception ex )
{
return false;
}
}
public static Boolean IsDouble( String value )
{
try
{
Double valueTemp = Double.parseDouble( value );
return true;
}
catch ( Exception ex )
{
return false;
}
}
public static Boolean IsEmpty( String text )
{
return text.equals( "" );
}
}
| [
"afonso.fernandes@msn.com"
] | afonso.fernandes@msn.com |
130a259ab9c8a5820ef7e09f2d7e4c4c72f403bb | 5e95cea8faf044c6f535005b9a2a2095d3329f49 | /src/dao/AluguelDAO.java | b776ffdd863d665ade06413bc3a0e5efc3834129 | [] | no_license | luizaalves/java-postgres | b7af6878ba5e0aa3a66a5bb17f747f18c43cf212 | 64cda50bc1860d166680f8823e77eee45a50be03 | refs/heads/master | 2022-11-30T14:40:43.945222 | 2020-08-12T22:17:01 | 2020-08-12T22:17:01 | 285,873,767 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 454 | java | package dao;
import entidades.Aluguel;
import java.sql.Connection;
import java.util.Collection;
public interface AluguelDAO {
void insert(Aluguel aluguel) throws Exception;
Integer getNextId() throws Exception;
void edit(Aluguel aluguel) throws Exception;
void delete(Aluguel aluguel) throws Exception;
Aluguel find(Integer idAluguel) throws Exception;
Collection<Aluguel> list() throws Exception;
} | [
"l.uhzinha@hotmail.com"
] | l.uhzinha@hotmail.com |
317b8d63a417e29342fa201c4056a187ef9eb783 | 4a11672b367d9eabc14cc0d4f920f685aeb80180 | /AutonomesFahrzeug/app/src/main/java/com/example/autonomesfahrzeug/ActivityAutoMode.java | 614cdeb6c129658ad832b57602b09ac496db84ee | [
"MIT"
] | permissive | aSmartVehicle/app-android | 967832ec30bf40a60df86f23fcfbfde73fd63bae | 7087aa6122c6dd46b0f49e9dc3bf5c815db49b23 | refs/heads/master | 2022-12-14T21:26:32.648999 | 2020-09-16T10:03:04 | 2020-09-16T10:03:04 | 262,261,604 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 15,618 | java | package com.example.autonomesfahrzeug;
import android.content.Context;
import android.content.Intent;
import android.graphics.Bitmap;
import android.graphics.BitmapFactory;
import android.graphics.Color;
import android.graphics.Matrix;
import android.graphics.drawable.BitmapDrawable;
import android.graphics.drawable.Drawable;
import android.os.Build;
import android.os.Bundle;
import android.util.Size;
import android.view.InputDevice;
import android.view.KeyEvent;
import android.view.MotionEvent;
import android.view.TextureView;
import android.view.View;
import android.widget.Button;
import android.widget.CompoundButton;
import android.widget.ImageView;
import android.widget.Switch;
import android.widget.TextView;
import android.widget.Toast;
import androidx.appcompat.app.ActionBar;
import androidx.appcompat.app.AppCompatActivity;
import com.google.android.material.snackbar.Snackbar;
import java.io.File;
import java.io.FileWriter;
import java.io.IOException;
import java.text.DecimalFormat;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Date;
import org.json.JSONObject;
import org.tensorflow.lite.Interpreter;
public class ActivityAutoMode extends AppCompatActivity {
private int counter = 0;
public static int loLeft;
public static int loTop;
public static int ruLeft;
public static int ruTop;
private static float steering;
private static float throttle;
private final float secondInMilliseconds = 1000;
public static final float minValue = -1f;
public static final float maxValue = 1f;
float ypos;
private long frameRate;
public static boolean running = false;
private boolean checking = true;
private static DecimalFormat df = new DecimalFormat("0.00");
// Camera 2 API
private Camera2 camera2;
private Button startStopButton;
Context context;
// TensorFlow Lite Modell
private Interpreter tflite;
// UI Elements
private static TextView steeringText;
private static TextView steeringDirectionTect;
private TextView throttleText;
private TextView numberOfPictures;
private TextView connectedWithCarText;
private TextView lenseName;
private Switch enableConfigurationSwitch;
private ImageView configurationImage;
private static AppCompatActivity activity;
private TextureView textureView;
//ArrayLists
private static ArrayList<JsonEntry> jsonEntriesStop = new ArrayList<>();
private static ArrayList<JsonEntry> jsonEntriesSend = new ArrayList<>();
public ArrayList<String[]> values = new ArrayList<>();
//JsonEntries
JsonEntry<Float> steeringNullJsonEntry = new JsonEntry<>(JsonKey.steering, new Float(0.0f));
JsonEntry<Float> throttleNullJsonEntry = new JsonEntry<>(JsonKey.throttle, new Float(0.0f));
private static JsonEntry<Float> steeringJsonEntry = new JsonEntry<>(JsonKey.steering, new Float(0.0f));
private static JsonEntry<Float> throttleJsonEntry = new JsonEntry<>(JsonKey.throttle, new Float(0.0f));
JsonEntry<String> modeJsonEntry = new JsonEntry<>(JsonKey.mode, Mode.auto.toString());
private ControllerConnection controllerConnection;
public static UdpClient udpClient;
private CurrentSettings currentSettings;
private Mode mode = Mode.auto;
private Bitmap calibrationBitmap;
static SimpleDateFormat datumsformat = new SimpleDateFormat("yyyyMMdd-HHmmss-SSS");
private String valuesToString() {
String s = "";
for (String[] stringArr: values) {
for (int i = 0; i < stringArr.length; i++) {
if (i == stringArr.length - 1) {
s += stringArr[i] + "\n";
} else {
s += stringArr[i] + ",";
}
}
}
return s;
}
public File getChosenNeuronalNetwork() {
return SaveManagement.getChossenNn(currentSettings.getChosenNN(), this);
}
public void setBackButton(boolean b) {
ActionBar actionBar = getSupportActionBar();
actionBar.setDisplayHomeAsUpEnabled(b);
}
public boolean setNNFile(File folder){
File[] files = folder.listFiles();
for (File file: files) {
if(file.getName().contains(".tflite")) {
currentSettings.setFileChosenNN(file);
return true;
}
if (file.isDirectory()){
if (setNNFile(file)) {
return true;
}
}
}
return false;
}
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
getSupportActionBar().setTitle(getString(R.string.btn_autonom));
setContentView(R.layout.activity_auto_mode);
setBackButton(true);
currentSettings = CurrentSettings.getCurrentSettings(this);
currentSettings.loadAutoModeSettings();
setNNFile(currentSettings.getFolderChosenNN());
frameRate = (long) secondInMilliseconds / (long) currentSettings.getPicturesPerSecond();
loLeft = currentSettings.getLoLeftMargin();
loTop = currentSettings.getLoTopMargin();
ruLeft = currentSettings.getRuLeftMargin();
ruTop = currentSettings.getRuTopMargin();
udpClient = new UdpClient(currentSettings.getAppPort(),
currentSettings.getBoardPort(),
currentSettings.getIpAdress());
findViewById(R.id.textureView).setVisibility(View.VISIBLE);
byte[] tmpByte = SaveManagement.loadFile(SaveManagement
.loadFileContainingString(".jpg", currentSettings.getFolderChosenNN()).toString());
Bitmap tmpBitmap = BitmapFactory.decodeByteArray(tmpByte, 0, tmpByte.length);
Matrix matrix = new Matrix();
//matrix.postRotate(90);
calibrationBitmap = Bitmap.createBitmap(tmpBitmap, 0,
0, tmpBitmap.getWidth(), tmpBitmap.getHeight(), matrix, true);
context = this;
activity = this;
steeringText = findViewById(R.id.textView_Lenkwinkel);
steeringDirectionTect = findViewById(R.id.textView_lenkrichtung);
throttleText = findViewById(R.id.textView_geschwindigkeit);
enableConfigurationSwitch = findViewById(R.id.switch_configuration);
configurationImage = findViewById(R.id.imageView_calibrate);
textureView = findViewById(R.id.textureView);
numberOfPictures = findViewById(R.id.textView_bilder_die_sekunde);
connectedWithCarText = findViewById(R.id.textView_connectedWithCar);
lenseName = findViewById(R.id.lenseNameAuto);
enableConfigurationSwitch.setOnCheckedChangeListener(onCheckedChangeListener());
lenseName.setText(getString(R.string.lenseName) + ": " + currentSettings.getLenseName());
numberOfPictures.setText(getString(R.string.picturesTaken) + ": " + counter);
if (currentSettings.getFileChosenNN() != null) {
configurationImage.setVisibility(View.VISIBLE);
} else {
configurationImage.setVisibility(View.INVISIBLE);
}
jsonEntriesStop.add(steeringNullJsonEntry);
jsonEntriesStop.add(throttleNullJsonEntry);
jsonEntriesStop.add(modeJsonEntry);
jsonEntriesSend = new ArrayList<>();
jsonEntriesSend.add(steeringJsonEntry);
jsonEntriesSend.add(throttleJsonEntry);
jsonEntriesSend.add(modeJsonEntry);
startStopButton = findViewById(R.id.buttonStartStop);
startStopButton.setText("Start");
try {
tflite = new Interpreter(currentSettings.getFileChosenNN());
} catch (Exception ex) {
ex.printStackTrace();
}
camera2 = new Camera2(this, mode, new Size(currentSettings.getWidth(),
currentSettings.getHeight()), currentSettings.getCameraID(), tflite, currentSettings.getPicturesPerSecond());
new Thread(new Runnable() {
@Override
public void run() {
checkConnectionWithCar();
}
}).start();
startStopButton.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
startenStoppen();
}
});
configurationImage.setImageBitmap(camera2.takePicture());
controllerConnection = new ControllerConnection(this);
}
@Override
protected void onStart() {
super.onStart();
if(!checking) {
checking = true;
new Thread(new Runnable() {
@Override
public void run() {
checkConnectionWithCar();
}
}).start();
}
}
@Override
protected void onStop() {
super.onStop();
udpClient.close();
}
@Override
protected void onResume() {
super.onResume();
controllerConnection.start();
udpClient.open();
}
@Override
protected void onPause() {
super.onPause();
checking = false;
controllerConnection.stop();
udpClient.close();
}
private Switch.OnCheckedChangeListener onCheckedChangeListener() {
return new Switch.OnCheckedChangeListener() {
@Override
public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {
if (isChecked) {
Drawable d = new BitmapDrawable(getResources(),
ImageEditing.changeAlpha(calibrationBitmap, 125));
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {
configurationImage.setForeground(d);
}
} else {
Drawable d = new BitmapDrawable(getResources(), camera2.takePicture());
d.setAlpha(0);
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {
configurationImage.setForeground(d);
}
}
}
};
}
@Override
public boolean onKeyDown(int keyCode, KeyEvent event) {
switch (keyCode) {
case KeyEvent.KEYCODE_BUTTON_B: // stop capture
if (running) {
startenStoppen();
} else {
Intent intent = new Intent(this, ActivityMainMenu.class);
startActivity(intent);
}
break;
case KeyEvent.KEYCODE_BUTTON_A: // start capture
if (!running) {
startenStoppen();
}
break;
case KeyEvent.KEYCODE_BUTTON_Y: // change mode
Intent intent = new Intent(this, ActivityManualMode.class);
startActivity(intent);
break;
default:
break;
}
return true;
}
public static void stop() {
JSONObject json = JsonFile.createJsonObject(jsonEntriesStop);
new Thread(new Runnable() {
@Override
public void run() {
udpClient.send(json);
}
}).start();
}
private void startenStoppen() {
running = !running;
if (running && tflite != null) {
camera2.setPictureCounter(0);
enableConfigurationSwitch.setChecked(false);
setBackButton(false);
startStopButton.setText(R.string.btn_stop_text);
} else if (running && tflite == null) {
running = false;
Snackbar.make(activity.getWindow().getCurrentFocus(), getString(R.string.noNeuronalNetwork), Snackbar.LENGTH_LONG)
.setAction("Action", null).show();
} else {
setBackButton(true);
startStopButton.setText(R.string.btn_start_text);
stop();
}
}
public static float interpretValues(float[] werte) {
float max = 0.0f;
int index = 0;
for (int counter = 0; counter < werte.length; counter++) {
if (Float.compare(werte[counter], max) > 0) {
index = counter;
max = werte[counter];
}
}
float wert = 0;
float diff = maxValue - minValue;
wert = minValue + ((diff / (werte.length - 1)) * index);
return wert;
}
public static JSONObject createJSONObject() {
steeringJsonEntry.setData(-steering);
throttleJsonEntry.setData(throttle);
return JsonFile.createJsonObject(jsonEntriesSend);
}
public static void sendControlValues() {
JSONObject jsonObject = createJSONObject();
new Thread(new Runnable() {
@Override
public void run() {
udpClient.send(jsonObject);
}
}).start();
}
@Override
public boolean onGenericMotionEvent(MotionEvent event) {
// Check that the event came from a game controller
if ((event.getSource() & InputDevice.SOURCE_JOYSTICK)
== InputDevice.SOURCE_JOYSTICK
&& event.getAction() == MotionEvent.ACTION_MOVE) {
// Process all historical movement samples in the batch
final int historySize = event.getHistorySize();
// Process the movements starting from the
// earliest historical position in the batch
for (int i = 0; i < historySize; i++) {
// Process the event at historical position i
processJoystickInput(event, i);
}
// Process the current movement sample in the batch (position -1)
processJoystickInput(event, -1);
return true;
}
return super.onGenericMotionEvent(event);
}
private void processJoystickInput(MotionEvent event,
int historyPos) {
InputDevice inputDevice = event.getDevice();
// Calculate the horizontal distance to move by
// using the input value from one of these physical controls:
// the left control stick, hat axis, or the right control stick.
ypos = getCenteredAxis(event, inputDevice, MotionEvent.AXIS_Y, historyPos);
runOnUiThread(new Runnable() {
@Override
public void run() {
setThrottle(ypos);
}
});
setText();
}
private void setThrottle(float y) {
throttle = -y;
throttleText.setText(activity.getString(R.string.throttle) + ": " + df.format(throttle));
}
public static void steeringToDirection(float x) {
if (x <= -0.1) {
steeringDirectionTect.setText(activity.getString(R.string.steeringDirection) + ": " + activity.getString(R.string.left));
} else if (x < 0.1 && x > -0.1) {
steeringDirectionTect.setText(activity.getString(R.string.steeringDirection) + ": " + activity.getString(R.string.straight));
} else if (x >= 0.1) {
steeringDirectionTect.setText(activity.getString(R.string.steeringDirection) + ": " + activity.getString(R.string.right));
}
}
private static float getCenteredAxis(MotionEvent event,
InputDevice device, int axis, int historyPos) {
final InputDevice.MotionRange range =
device.getMotionRange(axis, event.getSource());
// A joystick at rest does not always report an absolute position of
// (0,0). Use the getFlat() method to determine the range of values
// bounding the joystick axis center.
if (range != null) {
final float flat = range.getFlat();
final float value =
historyPos < 0 ? event.getAxisValue(axis) :
event.getHistoricalAxisValue(axis, historyPos);
// Ignore axis values that are within the 'flat' region of the
// joystick axis center.
if (Math.abs(value) > flat) {
return value;
}
}
return 0;
}
private void setText() {
runOnUiThread(() -> updateValues());
}
private void updateValues() {
steeringText.setText(getString(R.string.steering) + ": " + steering);
throttleText.setText(getString(R.string.throttle) + ": " + df.format(throttle));
steeringToDirection(steering);
}
private void checkConnectionWithCar() {
checking = true;
boolean status;
while (checking) {
status = udpClient.checkConnection();
if (!status) {
runOnUiThread(new Runnable() {
@Override
public void run() {
connectedWithCarText.setText(getString(R.string.notConnectedESP));
connectedWithCarText.setTextColor(Color.RED);
}
});
} else {
runOnUiThread(new Runnable() {
@Override
public void run() {
connectedWithCarText.setText(getString(R.string.connectedESP));
connectedWithCarText.setTextColor(Color.GREEN);
}
});
}
}
}
}
| [
"n.roeske@ostfalia.de"
] | n.roeske@ostfalia.de |
2875a9cc87644f257e9c2dd34b011cd1400eef9d | dd80a584130ef1a0333429ba76c1cee0eb40df73 | /external/oauth/core/src/main/java/net/oauth/signature/RSA_SHA1.java | 0aa99f10d5d3302bc013fa87e5e5c83343ff9700 | [
"MIT",
"Apache-2.0"
] | permissive | karunmatharu/Android-4.4-Pay-by-Data | 466f4e169ede13c5835424c78e8c30ce58f885c1 | fcb778e92d4aad525ef7a995660580f948d40bc9 | refs/heads/master | 2021-03-24T13:33:01.721868 | 2017-02-18T17:48:49 | 2017-02-18T17:48:49 | 81,847,777 | 0 | 2 | MIT | 2020-03-09T00:02:12 | 2017-02-13T16:47:00 | null | UTF-8 | Java | false | false | 10,469 | java | /*
* Copyright 2007 Google, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package net.oauth.signature;
import java.io.ByteArrayInputStream;
import java.io.UnsupportedEncodingException;
import java.security.GeneralSecurityException;
import java.security.KeyFactory;
import java.security.PrivateKey;
import java.security.PublicKey;
import java.security.Signature;
import java.security.cert.CertificateFactory;
import java.security.cert.X509Certificate;
import java.security.spec.EncodedKeySpec;
import java.security.spec.PKCS8EncodedKeySpec;
import java.security.spec.X509EncodedKeySpec;
import net.oauth.OAuth;
import net.oauth.OAuthAccessor;
import net.oauth.OAuthException;
/**
* Class to handle RSA-SHA1 signatures on OAuth requests. A consumer
* that wishes to use public-key signatures on messages does not need
* a shared secret with the service provider, but it needs a private
* RSA signing key. You create it like this:
*
* OAuthConsumer c = new OAuthConsumer(callback_url, consumer_key,
* null, provider);
* c.setProperty(RSA_SHA1.PRIVATE_KEY, consumer_privateRSAKey);
*
* consumer_privateRSAKey must be an RSA signing key and
* of type java.security.PrivateKey, String, or byte[]. In the latter two
* cases, the key must be PKCS#8-encoded (byte[]) or PKCS#8-encoded and
* then Base64-encoded (String).
*
* A service provider that wishes to verify signatures made by such a
* consumer does not need a shared secret with the consumer, but it needs
* to know the consumer's public key. You create the necessary
* OAuthConsumer object (on the service provider's side) like this:
*
* OAuthConsumer c = new OAuthConsumer(callback_url, consumer_key,
* null, provider);
* c.setProperty(RSA_SHA1.PUBLIC_KEY, consumer_publicRSAKey);
*
* consumer_publicRSAKey must be the consumer's public RSAkey and
* of type java.security.PublicKey, String, or byte[]. In the latter two
* cases, the key must be X509-encoded (byte[]) or X509-encoded and
* then Base64-encoded (String).
*
* Alternatively, a service provider that wishes to verify signatures made
* by such a consumer can use a X509 certificate containing the consumer's
* public key. You create the necessary OAuthConsumer object (on the service
* provider's side) like this:
*
* OAuthConsumer c = new OAuthConsumer(callback_url, consumer_key,
* null, provider);
* c.setProperty(RSA_SHA1.X509_CERTIFICATE, consumer_cert);
*
* consumer_cert must be a X509 Certificate containing the consumer's public
* key and be of type java.security.cert.X509Certificate, String,
* or byte[]. In the latter two cases, the certificate must be DER-encoded
* (byte[]) or PEM-encoded (String).
*
* @author Dirk Balfanz
* @hide
*
*/
public class RSA_SHA1 extends OAuthSignatureMethod {
final static public String PRIVATE_KEY = "RSA-SHA1.PrivateKey";
final static public String PUBLIC_KEY = "RSA-SHA1.PublicKey";
final static public String X509_CERTIFICATE = "RSA-SHA1.X509Certificate";
private PrivateKey privateKey = null;
private PublicKey publicKey = null;
@Override
protected void initialize(String name, OAuthAccessor accessor)
throws OAuthException {
super.initialize(name, accessor);
Object privateKeyObject = accessor.consumer.getProperty(PRIVATE_KEY);
try {
if (privateKeyObject != null) {
if (privateKeyObject instanceof PrivateKey) {
privateKey = (PrivateKey)privateKeyObject;
} else if (privateKeyObject instanceof String) {
privateKey = getPrivateKeyFromPem((String)privateKeyObject);
} else if (privateKeyObject instanceof byte[]) {
privateKey = getPrivateKeyFromDer((byte[])privateKeyObject);
} else {
throw new IllegalArgumentException(
"Private key set through RSA_SHA1.PRIVATE_KEY must be of " +
"type PrivateKey, String, or byte[], and not " +
privateKeyObject.getClass().getName());
}
}
Object publicKeyObject = accessor.consumer.getProperty(PUBLIC_KEY);
if (publicKeyObject != null) {
if (publicKeyObject instanceof PublicKey) {
publicKey = (PublicKey)publicKeyObject;
} else if (publicKeyObject instanceof String) {
publicKey = getPublicKeyFromPem((String)publicKeyObject);
} else if (publicKeyObject instanceof byte[]) {
publicKey = getPublicKeyFromDer((byte[])publicKeyObject);
} else {
throw new IllegalArgumentException(
"Public key set through RSA_SHA1.PRIVATE_KEY must be of " +
"type PublicKey, String, or byte[], and not " +
publicKeyObject.getClass().getName());
}
} else { // public key was null. perhaps they gave us a X509 cert.
Object certObject = accessor.consumer.getProperty(X509_CERTIFICATE);
if (certObject != null) {
if (certObject instanceof X509Certificate) {
publicKey = ((X509Certificate) certObject).getPublicKey();
} else if (certObject instanceof String) {
publicKey = getPublicKeyFromPemCert((String)certObject);
} else if (certObject instanceof byte[]) {
publicKey = getPublicKeyFromDerCert((byte[])certObject);
} else {
throw new IllegalArgumentException(
"X509Certificate set through RSA_SHA1.X509_CERTIFICATE" +
" must be of type X509Certificate, String, or byte[]," +
" and not " + certObject.getClass().getName());
}
}
}
} catch (GeneralSecurityException e) {
throw new OAuthException(e);
}
}
private PublicKey getPublicKeyFromPemCert(String certObject)
throws GeneralSecurityException {
CertificateFactory fac = CertificateFactory.getInstance("X509");
ByteArrayInputStream in = new ByteArrayInputStream(certObject.getBytes());
X509Certificate cert = (X509Certificate)fac.generateCertificate(in);
return cert.getPublicKey();
}
private PublicKey getPublicKeyFromDerCert(byte[] certObject)
throws GeneralSecurityException {
CertificateFactory fac = CertificateFactory.getInstance("X509");
ByteArrayInputStream in = new ByteArrayInputStream(certObject);
X509Certificate cert = (X509Certificate)fac.generateCertificate(in);
return cert.getPublicKey();
}
private PublicKey getPublicKeyFromDer(byte[] publicKeyObject)
throws GeneralSecurityException {
KeyFactory fac = KeyFactory.getInstance("RSA");
EncodedKeySpec pubKeySpec = new X509EncodedKeySpec(publicKeyObject);
return fac.generatePublic(pubKeySpec);
}
private PublicKey getPublicKeyFromPem(String publicKeyObject)
throws GeneralSecurityException {
return getPublicKeyFromDer(decodeBase64(publicKeyObject));
}
private PrivateKey getPrivateKeyFromDer(byte[] privateKeyObject)
throws GeneralSecurityException {
KeyFactory fac = KeyFactory.getInstance("RSA");
EncodedKeySpec privKeySpec = new PKCS8EncodedKeySpec(privateKeyObject);
return fac.generatePrivate(privKeySpec);
}
private PrivateKey getPrivateKeyFromPem(String privateKeyObject)
throws GeneralSecurityException {
return getPrivateKeyFromDer(decodeBase64(privateKeyObject));
}
@Override
protected String getSignature(String baseString) throws OAuthException {
try {
byte[] signature = sign(baseString.getBytes(OAuth.ENCODING));
return base64Encode(signature);
} catch (UnsupportedEncodingException e) {
throw new OAuthException(e);
} catch (GeneralSecurityException e) {
throw new OAuthException(e);
}
}
@Override
protected boolean isValid(String signature, String baseString)
throws OAuthException {
try {
return verify(decodeBase64(signature),
baseString.getBytes(OAuth.ENCODING));
} catch (UnsupportedEncodingException e) {
throw new OAuthException(e);
} catch (GeneralSecurityException e) {
throw new OAuthException(e);
}
}
private byte[] sign(byte[] message) throws GeneralSecurityException {
if (privateKey == null) {
throw new IllegalStateException("need to set private key with " +
"OAuthConsumer.setProperty when " +
"generating RSA-SHA1 signatures.");
}
Signature signer = Signature.getInstance("SHA1withRSA");
signer.initSign(privateKey);
signer.update(message);
return signer.sign();
}
private boolean verify(byte[] signature, byte[] message)
throws GeneralSecurityException {
if (publicKey == null) {
throw new IllegalStateException("need to set public key with " +
" OAuthConsumer.setProperty when " +
"verifying RSA-SHA1 signatures.");
}
Signature verifier = Signature.getInstance("SHA1withRSA");
verifier.initVerify(publicKey);
verifier.update(message);
return verifier.verify(signature);
}
}
| [
"karun.matharu@gmail.com"
] | karun.matharu@gmail.com |
057a0b755818e280ee0a369652c3461eb409d53b | 0eab05c66e28c7d29b39e76019996f52da157e7d | /src/android/optimization/SAXChangeMultiLineSupple.java | b620a4901b4b9ddc3377b2ed908437ee812b6b0d | [] | no_license | danhan/msr_andriod | aa582377cea6cbd396c717817cddd9faa9e31330 | ea7bc188f45e713ac2c2cf5f62201aaab0152877 | refs/heads/master | 2021-01-22T23:57:51.328093 | 2012-02-13T19:01:20 | 2012-02-13T19:01:20 | 3,432,981 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 6,112 | java | package android.optimization;
import java.io.IOException;
import java.util.ArrayList;
import java.util.Collections;
import javax.xml.parsers.ParserConfigurationException;
import javax.xml.parsers.SAXParser;
import javax.xml.parsers.SAXParserFactory;
import mysql.MySQLOperation;
import org.xml.sax.Attributes;
import org.xml.sax.SAXException;
import org.xml.sax.helpers.DefaultHandler;
public class SAXChangeMultiLineSupple extends DefaultHandler {
ArrayList<Integer> changeIDs = null;
ArrayList<Integer> numOfMsgLine = null;
ArrayList<Integer> numOfTargetLine = null;
ArrayList<String> msgLine = null;
ArrayList<String> targetLine = null;
int numOfChange = 0;
MySQLOperation dao = null;
String[] columns = {"changeid","line_of_msg","line_of_target","message","target"};
int[] types = {0,0,0,2,2};
String delimiter = "|*|";
String database = "";
String tableName = "";
public ArrayList<Integer> parse(String filename,String database, String tableName)
throws ParserConfigurationException, SAXException, IOException {
SAXParserFactory factory = SAXParserFactory.newInstance();
SAXParser saxParser = factory.newSAXParser();
this.database = database;
this.tableName = tableName;
changeIDs = new ArrayList<Integer>();
numOfMsgLine = new ArrayList<Integer>();
numOfTargetLine = new ArrayList<Integer>();
msgLine = new ArrayList<String>();
targetLine = new ArrayList<String>();
saxParser.parse(filename, this);
return numOfTargetLine;
}
private boolean isMsgLine = false;
private String msg_str = "";
private String target_str = "";
// Catch the start of an XML element
public void startElement(String uri, String localName, String qName,
Attributes attributes) throws SAXException {
if (qName.equals("change")) {
if(numOfChange>0 && numOfChange % 1000 ==0){
System.out.println("write . endElement......");
this.writeToDatabase();
}
numOfChange++;
changeIDs.add(new Integer(numOfChange));
numOfMsgLine.add(new Integer(0));
numOfTargetLine.add(new Integer(0));
}else if (qName.equals("message")) {
isMsgLine = true;
}else if (qName.equals("line")) {
if(isMsgLine){
numOfMsgLine.set(numOfMsgLine.size()-1, numOfMsgLine.get(numOfMsgLine.size()-1).intValue()+1);
}else{
numOfTargetLine.set(numOfTargetLine.size()-1, numOfTargetLine.get(numOfTargetLine.size()-1).intValue()+1);
}
}else if (qName.equals("target")) {
isMsgLine = false;
}
}
// Catch the content of an XML element <bugid>content</bugid>
public void characters(char[] ch, int start, int length)
throws SAXException {
if (isMsgLine) {
msg_str += new String(ch, start, length);
msg_str += delimiter;
}else if (!isMsgLine) {
target_str += new String(ch, start, length);
target_str += delimiter;
}
}
@Override
public void endElement(String uri, String localName, String qName)
throws SAXException {
if(qName.equals("changes")){
System.out.println("write .......");
this.writeToDatabase();
}else if (qName.equals("message")){
msgLine.add(msg_str);
msg_str = "";
}else if (qName.equals("target")){
targetLine.add(target_str);
target_str = "";
}
}
private void clearObjects(){
this.changeIDs.clear();
this.numOfMsgLine.clear();
this.numOfTargetLine.clear();
this.msgLine.clear();
this.targetLine.clear();
}
/*
"changeid","line_of_msg","line_of_target","message","target"
*/
private void writeToDatabase(){
ArrayList<String> values = new ArrayList<String>();
try{
System.out.println("change number is : "+changeIDs.size());
if(changeIDs.get(0).intValue() == 1767001){
try{
dao = new MySQLOperation();
dao.preConnect(this.database,this.tableName);
}catch(Exception e){
if(null != dao) dao.close();
e.printStackTrace();
}
}
if(changeIDs.get(0).intValue() > 1767000){
System.out.println("start to write into database: change id: "+changeIDs.get(0));
for(int i=0;i<changeIDs.size();i++){
values.add(changeIDs.get(i).toString());
values.add(numOfMsgLine.get(i).toString());
values.add(numOfTargetLine.get(i).toString());
values.add(msgLine.get(i));
values.add(targetLine.get(i));
dao.insert(this.columns, values,this.types);
values.clear();
}
}else{
System.out.println("change id: "+changeIDs.get(0));
}
}catch(Exception e){
e.printStackTrace();
}
//clean all objects
this.clearObjects();
}
static public void main(String[] args) {
double start = System.currentTimeMillis();
SAXChangeMultiLineSupple sbi = new SAXChangeMultiLineSupple();
String database = "msr";
String tableName = "change_message";
try {
String filename = (args.length > 0) ? args[1]
: "/home/dan/Downloads/git.log.xml";
ArrayList<Integer> numOfTargetLine = sbi.parse(filename,database,tableName);
int total = 0;
for (Integer num : numOfTargetLine) {
//System.out.println(num);
total += num;
}
System.out.println("change number: "+sbi.numOfChange);
System.out.println("change number: "+sbi.changeIDs.size());
System.out.println("numOfMsgLine: "+sbi.numOfMsgLine.size());
System.out.println("numOfTargetLine: "+sbi.numOfTargetLine.size());
System.out.println("msgLine: "+sbi.msgLine.size());
System.out.println("targetLine: "+sbi.targetLine.size());
System.out.println("target line total: "+total);
System.out.println("execution time: "
+ (System.currentTimeMillis() - start) / 1000);
} catch (ParserConfigurationException e) {
// TODO Auto-generated catch block
e.printStackTrace();
} catch (SAXException e) {
// TODO Auto-generated catch block
e.printStackTrace();
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
} | [
"dhan3@ualberta.ca"
] | dhan3@ualberta.ca |
101b6efdddaf1e9ab567c49c01e988bffb956057 | 917104c59a4e3d59d10ce7cb02692dfdba1054ec | /e-book-lcn/e-book-product-service/src/main/java/com/book/product/service/ProductService.java | 755aa0777db340c51e0f1400fc7526c328b5462b | [] | no_license | kosamino/springcloud | c71cf71f628c67bb0e51ba7052fbf24802c676f6 | 5f0a0c45423592d5a77e8a99e82eb91925a88c2b | refs/heads/master | 2022-02-27T06:13:10.003404 | 2019-09-18T17:41:05 | 2019-09-18T17:41:05 | 209,367,658 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 691 | java | package com.book.product.service;
import java.util.List;
import org.springframework.http.MediaType;
import org.springframework.util.MimeType;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import com.book.product.pojo.Product;
/**
* Product服务接口
* @author Administrator
*
*/
@RequestMapping("/product")
public interface ProductService {
//查询所有商品
@RequestMapping(value="/findAll",method=RequestMethod.GET)
public List<Product> findAll();
}
| [
"370507035@qq.com"
] | 370507035@qq.com |
b892817e38fdc1ab7359f913356a44230654cddd | c27f418a440690feb17d1a45fb030a100eb985be | /src/main/java/kurtis/chudasama/service/StockService.java | 99e8e7a0069132dc8615247fdb50418b74271859 | [] | no_license | KurtisChudasama/electronicstore | b9aa6cbb739ac2431769dcc50733c8c360c145e1 | c23cd515ef8d4ab8cab4045098b8cb1295408516 | refs/heads/master | 2020-05-14T17:19:54.444695 | 2019-04-25T19:42:34 | 2019-04-25T19:42:34 | 181,890,817 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 766 | java | package kurtis.chudasama.service;
import kurtis.chudasama.entity.CartItems;
import kurtis.chudasama.entity.Item;
import kurtis.chudasama.repository.ItemRepository;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.ArrayList;
@Service("stockService")
public class StockService {
public StockService() {
}
public boolean isAvailable(ArrayList<CartItems> cart_items) {
for (int i = 0; i < cart_items.size(); i++) {
CartItems cartItem = cart_items.get(i);
Item item = cart_items.get(i).getItem();
if (cartItem.getQuantity() > item.getStock()) {
return false;
}
}
return true;
}
}
| [
"c15711231@mydit.ie"
] | c15711231@mydit.ie |
cdd0422f0a0c053032a5e3e9586bd9fbb583d7a5 | e7a6d8a81a045bb49565868cd587fd005cf21b64 | /src/main/java/it/polimi/ingsw/ps16/server/model/ParseStreamXML.java | 3d45e91689177e7841011d5cccd163d23ab5621f | [] | no_license | GiovanniGianola/Aleph-CouncilOfFour | ea323b72bdaae977d6706a79e12251de3cae7237 | 55e04d759c5b64573a183ebc2f9f9ce8a10957ca | refs/heads/master | 2022-12-28T16:11:05.541489 | 2020-05-07T16:52:58 | 2020-05-07T16:52:58 | 262,107,367 | 0 | 0 | null | 2020-10-13T21:48:46 | 2020-05-07T16:51:09 | Java | UTF-8 | Java | false | false | 22,112 | java | /*****************************************
* *
* Council Of Four *
* *
* Software Engineering Project *
* *
* Politecnico di Milano *
* *
* Academic Year: 2015 - 2016 *
* *
* Authors: Gianola Giovanni *
* Leveni Filippo *
* Ionata Valentina *
* *
****************************************/
package it.polimi.ingsw.ps16.server.model;
import java.io.PrintStream;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import java.util.Random;
import java.util.logging.Level;
import java.util.logging.Logger;
import javax.xml.parsers.DocumentBuilder;
import javax.xml.parsers.DocumentBuilderFactory;
import org.w3c.dom.Document;
import org.w3c.dom.Element;
import org.w3c.dom.Node;
import org.w3c.dom.NodeList;
import it.polimi.ingsw.ps16.server.model.bonus.Bonus;
import it.polimi.ingsw.ps16.server.model.bonus.BonusFactory;
import it.polimi.ingsw.ps16.server.model.bonus.BonusTile;
import it.polimi.ingsw.ps16.server.model.deck.BusinessPermitCard;
import it.polimi.ingsw.ps16.server.model.deck.StandardDecksFactory;
import it.polimi.ingsw.ps16.server.model.gameboard.City;
import it.polimi.ingsw.ps16.server.model.gameboard.CityType;
import it.polimi.ingsw.ps16.server.model.gameboard.GameBoard;
import it.polimi.ingsw.ps16.server.model.gameboard.KingBoard;
import it.polimi.ingsw.ps16.server.model.gameboard.NobilityCell;
import it.polimi.ingsw.ps16.server.model.gameboard.NobilityTrack;
import it.polimi.ingsw.ps16.server.model.gameboard.RegionBoard;
/*
* Configurations Files:
* map1.xml coast [a] + hill [a] + mountain [a]
* map2.xml coast [a] + hill [a] + mountain [b]
* map3.xml coast [a] + hill [b] + mountain [a]
* map4.xml coast [a] + hill [b] + mountain [b]
* map5.xml coast [b] + hill [a] + mountain [a]
* map6.xml coast [b] + hill [a] + mountain [b]
* map7.xml coast [b] + hill [b] + mountain [a]
* map8.xml coast [b] + hill [b] + mountain [b]
*/
/**
* The Class ParseStreamXML read and parse every information about game settings<br>
* from XML files located in the resources folder.<br>
* is possible to modifies the XML files in the folder to create some new game configures
*/
public class ParseStreamXML
{
/** The Constant log. */
private static final Logger log = Logger.getLogger( ParseStreamXML.class.getName() );
/** The Constant MAP_PATH. */
private static final String MAP_PATH = "/XML/map";
/** The Constant CITY_BONUS_PATH. */
private static final String CITY_BONUS_PATH = "/XML/cityBonus.xml";
/** The Constant BUSINESS_PERMIT_CARD_PATH. */
private static final String BUSINESS_PERMIT_CARD_PATH = "/XML/businessPermitCard.xml";
/** The Constant BONUS_TILE_PATH. */
private static final String BONUS_TILE_PATH = "/XML/bonusTile.xml";
/** The Constant NOBILITY_TRACK_PATH. */
private static final String NOBILITY_TRACK_PATH = "/XML/nobilityTrack.xml";
/** The Constant TAG_REGION_NAME. */
private static final String TAG_REGION_NAME = "RegionName";
/** The Constant TAG_QUANTITY. */
private static final String TAG_QUANTITY = "Quantity";
/** The std err. */
private PrintStream stdErr;
/** The game board. */
private GameBoard gameBoard;
/**
* Instantiates a new parses the stream XML.
*
* @param gameBoard
* the game board that will be fill with the informations of XML files
*/
public ParseStreamXML(GameBoard gameBoard)
{
this.gameBoard = gameBoard;
this.stdErr = new PrintStream(System.err);
}
/////////////////////////////////////////////////////////////////////////////////////////////////
/**
* Inits the game board.
*
* @param mapNumber
* the map number
* @param numPlayers
* the num players
* @return the game board
*/
public GameBoard initGameBoard(String mapNumber, int numPlayers)
{
List<RegionBoard> aRegions = new ArrayList<>();
List<CityType> aTypes = new ArrayList<>();
KingBoard kingBoard = new KingBoard();
parseMap(mapNumber, numPlayers, aRegions, aTypes, kingBoard);
gameBoard = new GameBoard();
gameBoard.setRegionBoard(aRegions);
gameBoard.setCityTypes(aTypes);
gameBoard.setKingBoard(kingBoard);
return gameBoard;
}
/////////////////////////////////////////////////////////////////////////////////////////////////
/**
* Given the map number, this method read and parse the corresponding XML file.<br>
* then fill the game board for the match
*
* @param mapNumber
* the map number chosen by the host of the match
* @param numPlayers
* the number of players in the current match
* @param aRegions
* the list of regions
* @param aTypes
* the list of city types
* @param kingBoard
* the king board
*/
private void parseMap(String mapNumber, int numPlayers, List<RegionBoard> aRegions, List<CityType> aTypes, KingBoard kingBoard)
{
try
{
DocumentBuilderFactory documentFactory = DocumentBuilderFactory.newInstance();
DocumentBuilder builder = documentFactory.newDocumentBuilder();
Document document = builder.parse(this.getClass().getResourceAsStream(MAP_PATH + mapNumber + ".xml"));
// region.getLength() give the number of regions
NodeList regions = document.getElementsByTagName("Region");
NodeList cityTypes = document.getElementsByTagName("CityType");
NodeList cities = document.getElementsByTagName("City");
/** Support ArrayLists */
List<City> aCities = new ArrayList<>();
/** Create Empty Regions with just the given name by XML file */
for(int i = 0; i < regions.getLength(); i++)
{
Node nodo = regions.item(i);
Element region = (Element)nodo;
aRegions.add(new RegionBoard(region.getAttribute(TAG_REGION_NAME)));
}
/** Create Empty CityType with just the given name by XML file */
for(int i = 0; i < cityTypes.getLength(); i++)
{
Node nodo = cityTypes.item(i);
Element cityType = (Element)nodo;
aTypes.add(new CityType(cityType.getElementsByTagName("TypeC").item(0).getFirstChild().getNodeValue()));
}
/** Create Empty City with just the given name, number of players and a boolean value that say if that city has a bonus by XML file */
String cityName;
String cityRegName;
String cityTypeName;
String cityBonus;
for(int i = 0; i < cities.getLength(); i++)
{
Node nodo = cities.item(i);
Element city = (Element)nodo;
/** get region name and city type name of the current city */
cityName = city.getElementsByTagName("Name").item(0).getFirstChild().getNodeValue();
cityRegName = city.getAttribute(TAG_REGION_NAME);
cityTypeName = city.getElementsByTagName("Type").item(0).getFirstChild().getNodeValue();
cityBonus = city.getElementsByTagName("Bonus").item(0).getFirstChild().getNodeValue();
aCities.add(new City(cityName, numPlayers, cityBonus));
/** add to every city his own region board
* add to every region a node of arrayList of city */
for(int j = 0; j < regions.getLength(); j++)
{
if(aRegions.get(j).getName().equals(cityRegName))
{
aCities.get(i).setRegionBoard(aRegions.get(j));
aRegions.get(j).getCities().add(aCities.get(i));
}
}
/** add to every city his own city type
* add to every city type a node of arrayList of city */
for(int j = 0; j < cityTypes.getLength(); j++)
{
if(aTypes.get(j).getName().equals(cityTypeName))
{
aCities.get(i).setType(aTypes.get(j));
aTypes.get(j).getCities().add(aCities.get(i));
}
}
}
/** let assign bonus to every city from XML */
parseCityBonus(aCities);
/** let create an adjacency list to every city from XML */
parseCityAdjacencyList(aCities, document);
/** let create business permit card list to every region from XML */
parseBusinessPermitCard(aRegions, aCities);
/** let create bonus tile to every region, city type and king reward from XML */
parseBonusTile(aRegions, aTypes, kingBoard);
/** let create nobility track to the kingBoard from XML */
parseNobilityTrack(kingBoard);
}
catch(Exception e)
{
log.log( Level.SEVERE, e.toString(), e );
}
}
/////////////////////////////////////////////////////////////////////////////////////////////////
/**
* Parses the cityBonus.xml, and assign to cities every bonus
*
* @param aCities
* the full list of cities
*/
private void parseCityBonus(List<City> aCities)
{
try
{
DocumentBuilderFactory documentFactory = DocumentBuilderFactory.newInstance();
DocumentBuilder builder = documentFactory.newDocumentBuilder();
Document document = builder.parse(this.getClass().getResourceAsStream(CITY_BONUS_PATH));
NodeList bonuses = document.getElementsByTagName("Bonus");
BonusFactory bFactory = new BonusFactory();
/** Support ArrayLists using polimorphism */
List<Bonus> aBonuses = new ArrayList<>();
String type;
String quantity;
/** Create Bonuses with the given type and quantity by XML file using Factory Pattern */
for(int i = 0; i < bonuses.getLength(); i++)
{
Node nodo = bonuses.item(i);
Element bonus = (Element)nodo;
type = bonus.getElementsByTagName("Type").item(0).getFirstChild().getNodeValue();
quantity = bonus.getElementsByTagName(TAG_QUANTITY).item(0).getFirstChild().getNodeValue();
aBonuses.add(bFactory.createBonus(type, Integer.parseInt(quantity)));
}
Collections.shuffle(aBonuses);
/** add to every city his own bonus randomly */
for(City city: aCities)
{
if(("true").equalsIgnoreCase(city.getBonusBoolean()))
city.getBonus().add(aBonuses.remove(0));
else if(!("false").equalsIgnoreCase(city.getBonusBoolean()))
this.stdErr.println("Error in XML file: map.xml wrong format field");
}
if(!aBonuses.isEmpty())
{
int k = aBonuses.size();
Random r = new Random();
int random;
/** add remaining bonuses to cities randomly */
for(int i = 0; i < k; i++)
{
random = r.nextInt(aCities.size());
if(("true").equalsIgnoreCase(aCities.get(random).getBonusBoolean()))
aCities.get(random).addBonus(aBonuses.remove(0));
else if(("false").equalsIgnoreCase(aCities.get(random).getBonusBoolean()))
/*check possible loop*/
i--;
else this.stdErr.println("Error in XML file: map.xml wrong format field");
}
}
}
catch(Exception e)
{
log.log( Level.SEVERE, e.toString(), e );
}
}
/////////////////////////////////////////////////////////////////////////////////////////////////
/**
* create for each city his adjacency list.
*
* @param aCities
* the list of cities
* @param document
* the XML document
*/
private void parseCityAdjacencyList(List<City> aCities, Document document)
{
NodeList cities = document.getElementsByTagName("City");
String neigh;
String[] nearCity;
List<City> cityTemp;
for(int i = 0; i < aCities.size(); i++)
{
Node nodo = cities.item(i);
Element city = (Element)nodo;
neigh = city.getElementsByTagName("Near").item(0).getFirstChild().getNodeValue();
nearCity = neigh.split(",");
for(City c: aCities) // cicla tutte le città
{
cityTemp = aCities.get(i).getNearCities();
for(int x = 0; x < nearCity.length; x++)
{
if(c.getName().equalsIgnoreCase(nearCity[x]))
{
cityTemp.add(c);
}
}
}
}
}
/////////////////////////////////////////////////////////////////////////////////////////////////
/**
* Parses the businessPermitCard.xml, and create business permit card deck each regions of the game
*
* @param aRegions
* the list of regions
* @param aCities
* the list of cities
*/
private void parseBusinessPermitCard(List<RegionBoard> aRegions, List<City> aCities)
{
try
{
DocumentBuilderFactory documentFactory = DocumentBuilderFactory.newInstance();
DocumentBuilder builder = documentFactory.newDocumentBuilder();
Document document = builder.parse(this.getClass().getResourceAsStream(BUSINESS_PERMIT_CARD_PATH));
NodeList regions = document.getElementsByTagName("Region");
NodeList businessPermitCard = document.getElementsByTagName("BusinessPermitCard");
String[] letters;
String[] bonusTypes;
String[] bonusQuantities;
String letter;
String bonusType;
String bonusQuantity;
List<BusinessPermitCard> bPC;
List<City> bPCCities;
List<Bonus> bPCBonuses;
StandardDecksFactory dFactory = new StandardDecksFactory();
for(int i = 0; i < aRegions.size(); i++)
{
Node nodo = regions.item(i);
Element region = (Element)nodo;
bPC = new ArrayList<>();
//controllo regione per regione
if(aRegions.get(i).getName().equalsIgnoreCase(region.getAttribute(TAG_REGION_NAME)))
{
//ciclo sugli elementi regione per regione
for(int j = 0; j < (businessPermitCard.getLength()) / (aRegions.size()); j++)
{
letter = region.getElementsByTagName("Letter").item(j).getFirstChild().getNodeValue();
bonusType = region.getElementsByTagName("Type").item(j).getFirstChild().getNodeValue();
bonusQuantity = region.getElementsByTagName(TAG_QUANTITY).item(j).getFirstChild().getNodeValue();
letters = letter.split(",");
bPCCities = new ArrayList<>();
/* create a list of city according to the letters read on the cards*/
//ciclo sugli elementi dell array di lettere lette
for(int x = 0; x <letters.length; x++)
{
//ciclo sulle città
for(int y = 0; y < aCities.size(); y++)
{
//controllo se la città è presente
if(letters[x].equalsIgnoreCase(aCities.get(y).getName().substring(0, 1)))
{
bPCCities.add(aCities.get(y));
}
}
}
bonusTypes = bonusType.split(",");
bonusQuantities = bonusQuantity.split(",");
bPCBonuses = new ArrayList<>();
BonusFactory bFactory = new BonusFactory();
/* create a list of bonus according to the bonuses read on the cards */
/* ciclo sugli elementi dell array di bonus letti */
for(int x = 0; x <bonusTypes.length; x++)
{
bPCBonuses.add(bFactory.createBonus(bonusTypes[x], Integer.parseInt(bonusQuantities[x])));
}
bPC.add(new BusinessPermitCard(bPCBonuses,bPCCities));
}
aRegions.get(i).setBusinessPermitCardsDeck(dFactory.createBusinessPermitCardDeck(bPC));
}
}
}
catch(Exception e)
{
log.log( Level.SEVERE, e.toString(), e );
}
}
/////////////////////////////////////////////////////////////////////////////////////////////////
/**
* Parses the bonusTile.xml document, and assign to each region his own bonus tile<br>
* then provide a bonus tile for each city type
*
* @param aRegions
* the list of regions
* @param aTypes
* the list of city types
* @param kingBoard
* the king board
*/
private void parseBonusTile(List<RegionBoard> aRegions, List<CityType> aTypes, KingBoard kingBoard)
{
try
{
DocumentBuilderFactory documentFactory = DocumentBuilderFactory.newInstance();
DocumentBuilder builder = documentFactory.newDocumentBuilder();
Document document = builder.parse(this.getClass().getResourceAsStream(BONUS_TILE_PATH));
NodeList bonusTileRegions = document.getElementsByTagName("BonusRegion");
NodeList bonusTileCityType = document.getElementsByTagName("BonusCityType");
NodeList bonusTileKing = document.getElementsByTagName("BonusKing");
BonusFactory bFactory = new BonusFactory();
String type;
String quantity;
String bonusType = "victorypointbonus";
int numCityType = 0;
List<BonusTile> kBonuses = new ArrayList<>();
/** add to every regions his own bonus */
for(int i = 0; i < aRegions.size(); i++)
{
Node nodo = bonusTileRegions.item(i);
Element bonus = (Element)nodo;
type = bonus.getElementsByTagName("Type").item(0).getFirstChild().getNodeValue();
quantity = bonus.getElementsByTagName(TAG_QUANTITY).item(0).getFirstChild().getNodeValue();
/** add to every regions his own bonus */
for(int j = 0; j < aRegions.size(); j++)
{
if(aRegions.get(j).getName().equalsIgnoreCase(bonus.getAttribute(TAG_REGION_NAME))
&& (bonusType).equalsIgnoreCase(type))
aRegions.get(j).setBonusTile(new BonusTile(bFactory.createBonus(type, Integer.parseInt(quantity))));
else if(!(bonusType).equalsIgnoreCase(type))
this.stdErr.println("Error: wrong type of bonus, it must be a victory point bonus");
}
}
/** calculate number of citytype set true */
for(int i = 0; i < aTypes.size(); i++)
{
if(("true").equalsIgnoreCase(aTypes.get(i).getCities().get(0).getBonusBoolean()))
numCityType++;
}
/** add to every citytype his own bonus */
for(int i = 0; i < numCityType; i++)
{
Node nodo = bonusTileCityType.item(i);
Element bonus = (Element)nodo;
type = bonus.getElementsByTagName("Type").item(0).getFirstChild().getNodeValue();
quantity = bonus.getElementsByTagName(TAG_QUANTITY).item(0).getFirstChild().getNodeValue();
/** add to every regions his own bonus */
for(int j = 0; j < numCityType; j++)
{
if((aTypes.get(j).getName().equalsIgnoreCase(bonus.getAttribute("CityType")))
&& ("true").equalsIgnoreCase(aTypes.get(j).getCities().get(0).getBonusBoolean())
&& (bonusType).equalsIgnoreCase(type))
aTypes.get(j).setBonusTile(new BonusTile(bFactory.createBonus(type, Integer.parseInt(quantity))));
else if(!(bonusType).equalsIgnoreCase(type))
this.stdErr.println("Error: wrong type of bonus, must be a victory point bonus");
}
}
/** add to every kingboard his own list of bonuses */
for(int i = 0; i < bonusTileKing.getLength(); i++)
{
Node nodo = bonusTileKing.item(i);
Element bonus = (Element)nodo;
type = bonus.getElementsByTagName("Type").item(0).getFirstChild().getNodeValue();
quantity = bonus.getElementsByTagName(TAG_QUANTITY).item(0).getFirstChild().getNodeValue();
/** add to every regions his own bonus */
if((bonusType).equalsIgnoreCase(type))
kBonuses.add(new BonusTile(bFactory.createBonus(type, Integer.parseInt(quantity))));
else if(!(bonusType).equalsIgnoreCase(type))
this.stdErr.println("Error: wrong type of bonus, must be a victory point bonus");
}
kingBoard.setBonusTiles(kBonuses);
}
catch(Exception e)
{
log.log( Level.SEVERE, e.toString(), e );
}
}
/////////////////////////////////////////////////////////////////////////////////////////////////
/**
* Parses the nobilityTrack.xml, and create the nobility track according to the file XML read<br>
* then provide it to the king board
*
* @param kingBoard
* the king board
*/
private void parseNobilityTrack(KingBoard kingBoard)
{
try
{
DocumentBuilderFactory documentFactory = DocumentBuilderFactory.newInstance();
DocumentBuilder builder = documentFactory.newDocumentBuilder();
Document document = builder.parse(this.getClass().getResourceAsStream(NOBILITY_TRACK_PATH));
NodeList nobilityTrackCells = document.getElementsByTagName("Cell");
List<NobilityCell> nC = new ArrayList<>();
List<Bonus> cellBonuses = new ArrayList<>();
BonusFactory bFactory = new BonusFactory();
String[] bonusTypes;
String[] bonusQuantities;
String type;
String quantity;
for(int i = 0; i < nobilityTrackCells.getLength(); i++)
{
Node nodo = nobilityTrackCells.item(i);
Element cell = (Element)nodo;
if(("true").equalsIgnoreCase(cell.getAttribute("BonusBool")))
{
type = cell.getElementsByTagName("Type").item(0).getFirstChild().getNodeValue();
quantity = cell.getElementsByTagName(TAG_QUANTITY).item(0).getFirstChild().getNodeValue();
bonusTypes = type.split(",");
bonusQuantities = quantity.split(",");
for(int x = 0; x <bonusTypes.length; x++)
{
cellBonuses.add(bFactory.createBonus(bonusTypes[x], Integer.parseInt(bonusQuantities[x])));
}
nC.add(new NobilityCell(cellBonuses));
}
else if(("false").equalsIgnoreCase(cell.getAttribute("BonusBool")))
nC.add(new NobilityCell(null));
else
this.stdErr.println("Error in XML file: nobilityTrack.xml wrong format field");
cellBonuses = new ArrayList<>();
}
kingBoard.setNobilityTrack(new NobilityTrack(nC));
}
catch(Exception e)
{
log.log( Level.SEVERE, e.toString(), e );
}
}
}
| [
"10451768@polimi.it"
] | 10451768@polimi.it |
a09b06619022696eebc2e5177114d08481e85210 | 39bbbd6dec129cb98e295b1fa99203811cfdeaa7 | /plugins/kotlin/idea/tests/test/org/jetbrains/kotlin/formatter/EnterHandlerTestGenerated.java | a750484634d2f5c20fa4e9a642a07887247b6dd2 | [
"Apache-2.0",
"LicenseRef-scancode-unknown-license-reference"
] | permissive | EsolMio/intellij-community | 7b9b808c914c683a1aa90ea10691700761e50157 | 4eb05cb6127f4dd6cbc09814b76b80eced9e4262 | refs/heads/master | 2022-08-21T05:39:13.256969 | 2022-08-11T11:53:18 | 2022-08-14T13:20:04 | 169,598,741 | 0 | 0 | Apache-2.0 | 2019-02-07T16:00:25 | 2019-02-07T16:00:25 | null | UTF-8 | Java | false | false | 143,824 | java | // Copyright 2000-2022 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license.
package org.jetbrains.kotlin.formatter;
import com.intellij.testFramework.TestDataPath;
import org.jetbrains.kotlin.idea.test.JUnit3RunnerWithInners;
import org.jetbrains.kotlin.idea.test.KotlinTestUtils;
import org.jetbrains.kotlin.test.TestMetadata;
import org.jetbrains.kotlin.idea.test.TestRoot;
import org.junit.runner.RunWith;
/**
* This class is generated by {@link org.jetbrains.kotlin.testGenerator.generator.TestGenerator}.
* DO NOT MODIFY MANUALLY.
*/
@SuppressWarnings("all")
@TestRoot("idea/tests")
@TestDataPath("$CONTENT_ROOT")
@RunWith(JUnit3RunnerWithInners.class)
public abstract class EnterHandlerTestGenerated extends AbstractEnterHandlerTest {
@RunWith(JUnit3RunnerWithInners.class)
@TestMetadata("testData/editor/enterHandler")
public abstract static class DirectSettings extends AbstractEnterHandlerTest {
@RunWith(JUnit3RunnerWithInners.class)
@TestMetadata("testData/editor/enterHandler/afterUnmatchedBrace")
public static class AfterUnmatchedBrace extends AbstractEnterHandlerTest {
private void runTest(String testDataFilePath) throws Exception {
KotlinTestUtils.runTest(this::doNewlineTest, this, testDataFilePath);
}
@TestMetadata("AtEndOfFile.after.kt")
public void testAtEndOfFile() throws Exception {
runTest("testData/editor/enterHandler/afterUnmatchedBrace/AtEndOfFile.after.kt");
}
@TestMetadata("LambdaArgumentBeforeFunctionInitializer.after.kt")
public void testLambdaArgumentBeforeFunctionInitializer() throws Exception {
runTest("testData/editor/enterHandler/afterUnmatchedBrace/LambdaArgumentBeforeFunctionInitializer.after.kt");
}
@TestMetadata("LambdaArgumentBeforeLocalPropertyInitializer.after.kt")
public void testLambdaArgumentBeforeLocalPropertyInitializer() throws Exception {
runTest("testData/editor/enterHandler/afterUnmatchedBrace/LambdaArgumentBeforeLocalPropertyInitializer.after.kt");
}
@TestMetadata("LambdaArgumentBeforeMemberPropertyInitializer.after.kt")
public void testLambdaArgumentBeforeMemberPropertyInitializer() throws Exception {
runTest("testData/editor/enterHandler/afterUnmatchedBrace/LambdaArgumentBeforeMemberPropertyInitializer.after.kt");
}
@TestMetadata("LambdaArgumentBeforeTopLevelPropertyInitializer.after.kt")
public void testLambdaArgumentBeforeTopLevelPropertyInitializer() throws Exception {
runTest("testData/editor/enterHandler/afterUnmatchedBrace/LambdaArgumentBeforeTopLevelPropertyInitializer.after.kt");
}
@TestMetadata("NotApplicableOnInitializer.after.kt")
public void testNotApplicableOnInitializer() throws Exception {
runTest("testData/editor/enterHandler/afterUnmatchedBrace/NotApplicableOnInitializer.after.kt");
}
@TestMetadata("NotApplicableOnInitializer2.after.kt")
public void testNotApplicableOnInitializer2() throws Exception {
runTest("testData/editor/enterHandler/afterUnmatchedBrace/NotApplicableOnInitializer2.after.kt");
}
@TestMetadata("UnfinishedLambdaInCode.after.kt")
public void testUnfinishedLambdaInCode() throws Exception {
runTest("testData/editor/enterHandler/afterUnmatchedBrace/UnfinishedLambdaInCode.after.kt");
}
@TestMetadata("UnfinishedLambdaInCodeAsVarInitiailzer.after.kt")
public void testUnfinishedLambdaInCodeAsVarInitiailzer() throws Exception {
runTest("testData/editor/enterHandler/afterUnmatchedBrace/UnfinishedLambdaInCodeAsVarInitiailzer.after.kt");
}
@TestMetadata("UnfinishedLambdaIsLastElement.after.kt")
public void testUnfinishedLambdaIsLastElement() throws Exception {
runTest("testData/editor/enterHandler/afterUnmatchedBrace/UnfinishedLambdaIsLastElement.after.kt");
}
@TestMetadata("UnfinishedLambdaWithCommentInCode.after.kt")
public void testUnfinishedLambdaWithCommentInCode() throws Exception {
runTest("testData/editor/enterHandler/afterUnmatchedBrace/UnfinishedLambdaWithCommentInCode.after.kt");
}
@TestMetadata("WhenBeforeLocalPropertyInitializer.after.kt")
public void testWhenBeforeLocalPropertyInitializer() throws Exception {
runTest("testData/editor/enterHandler/afterUnmatchedBrace/WhenBeforeLocalPropertyInitializer.after.kt");
}
@TestMetadata("WhenBeforeMemberPropertyInitializer.after.kt")
public void testWhenBeforeMemberPropertyInitializer() throws Exception {
runTest("testData/editor/enterHandler/afterUnmatchedBrace/WhenBeforeMemberPropertyInitializer.after.kt");
}
@TestMetadata("WhenBeforeTopLevelPropertyInitializer.after.kt")
public void testWhenBeforeTopLevelPropertyInitializer() throws Exception {
runTest("testData/editor/enterHandler/afterUnmatchedBrace/WhenBeforeTopLevelPropertyInitializer.after.kt");
}
}
@RunWith(JUnit3RunnerWithInners.class)
@TestMetadata("testData/editor/enterHandler/arrayAccess")
public static class ArrayAccess extends AbstractEnterHandlerTest {
private void runTest(String testDataFilePath) throws Exception {
KotlinTestUtils.runTest(this::doNewlineTest, this, testDataFilePath);
}
@TestMetadata("ListAccess.after.kt")
public void testListAccess() throws Exception {
runTest("testData/editor/enterHandler/arrayAccess/ListAccess.after.kt");
}
}
@RunWith(JUnit3RunnerWithInners.class)
@TestMetadata("testData/editor/enterHandler/beforeDot")
public static class BeforeDot extends AbstractEnterHandlerTest {
private void runTest(String testDataFilePath) throws Exception {
KotlinTestUtils.runTest(this::doNewlineTest, this, testDataFilePath);
}
@TestMetadata("ArrayAccessInFirstPosition.after.kt")
public void testArrayAccessInFirstPosition() throws Exception {
runTest("testData/editor/enterHandler/beforeDot/ArrayAccessInFirstPosition.after.kt");
}
@TestMetadata("ArrayAccessInNonFirstPositionOnFirstLine.after.kt")
public void testArrayAccessInNonFirstPositionOnFirstLine() throws Exception {
runTest("testData/editor/enterHandler/beforeDot/ArrayAccessInNonFirstPositionOnFirstLine.after.kt");
}
@TestMetadata("ArrayAccessInNonFirstPositionOnNonFirstLine.after.kt")
public void testArrayAccessInNonFirstPositionOnNonFirstLine() throws Exception {
runTest("testData/editor/enterHandler/beforeDot/ArrayAccessInNonFirstPositionOnNonFirstLine.after.kt");
}
@TestMetadata("ArrayAccessWithCommentInFirstPosition.after.kt")
public void testArrayAccessWithCommentInFirstPosition() throws Exception {
runTest("testData/editor/enterHandler/beforeDot/ArrayAccessWithCommentInFirstPosition.after.kt");
}
@TestMetadata("ArrayAccessWithMultilineComment2InFirstPosition.after.kt")
public void testArrayAccessWithMultilineComment2InFirstPosition() throws Exception {
runTest("testData/editor/enterHandler/beforeDot/ArrayAccessWithMultilineComment2InFirstPosition.after.kt");
}
@TestMetadata("ArrayAccessWithMultilineCommentInFirstPosition.after.kt")
public void testArrayAccessWithMultilineCommentInFirstPosition() throws Exception {
runTest("testData/editor/enterHandler/beforeDot/ArrayAccessWithMultilineCommentInFirstPosition.after.kt");
}
@TestMetadata("ArrayAccessWithSeveralArgumentsInFirstPosition.after.kt")
public void testArrayAccessWithSeveralArgumentsInFirstPosition() throws Exception {
runTest("testData/editor/enterHandler/beforeDot/ArrayAccessWithSeveralArgumentsInFirstPosition.after.kt");
}
@TestMetadata("CallInFirstPosition.after.kt")
public void testCallInFirstPosition() throws Exception {
runTest("testData/editor/enterHandler/beforeDot/CallInFirstPosition.after.kt");
}
@TestMetadata("CallInFirstPositionAfterOpenParenthesis.after.kt")
public void testCallInFirstPositionAfterOpenParenthesis() throws Exception {
runTest("testData/editor/enterHandler/beforeDot/CallInFirstPositionAfterOpenParenthesis.after.kt");
}
@TestMetadata("CallInFirstPositionAfterReturn.after.kt")
public void testCallInFirstPositionAfterReturn() throws Exception {
runTest("testData/editor/enterHandler/beforeDot/CallInFirstPositionAfterReturn.after.kt");
}
@TestMetadata("CallInNonFirstPositionAfterOpenParenthesis.after.kt")
public void testCallInNonFirstPositionAfterOpenParenthesis() throws Exception {
runTest("testData/editor/enterHandler/beforeDot/CallInNonFirstPositionAfterOpenParenthesis.after.kt");
}
@TestMetadata("CallInNonFirstPositionAfterReturn.after.kt")
public void testCallInNonFirstPositionAfterReturn() throws Exception {
runTest("testData/editor/enterHandler/beforeDot/CallInNonFirstPositionAfterReturn.after.kt");
}
@TestMetadata("CallInNonFirstPositionAfterReturnOnNonFirstLine.after.kt")
public void testCallInNonFirstPositionAfterReturnOnNonFirstLine() throws Exception {
runTest("testData/editor/enterHandler/beforeDot/CallInNonFirstPositionAfterReturnOnNonFirstLine.after.kt");
}
@TestMetadata("CallInNonFirstPositionOnFirstLine.after.kt")
public void testCallInNonFirstPositionOnFirstLine() throws Exception {
runTest("testData/editor/enterHandler/beforeDot/CallInNonFirstPositionOnFirstLine.after.kt");
}
@TestMetadata("CallInNonFirstPositionOnNonFirstLine.after.kt")
public void testCallInNonFirstPositionOnNonFirstLine() throws Exception {
runTest("testData/editor/enterHandler/beforeDot/CallInNonFirstPositionOnNonFirstLine.after.kt");
}
@TestMetadata("CallWithArgumentsInFirstPosition.after.kt")
public void testCallWithArgumentsInFirstPosition() throws Exception {
runTest("testData/editor/enterHandler/beforeDot/CallWithArgumentsInFirstPosition.after.kt");
}
@TestMetadata("CallWithCommentsInFirstPosition.after.kt")
public void testCallWithCommentsInFirstPosition() throws Exception {
runTest("testData/editor/enterHandler/beforeDot/CallWithCommentsInFirstPosition.after.kt");
}
@TestMetadata("CallWithLambdaInFirstPosition.after.kt")
public void testCallWithLambdaInFirstPosition() throws Exception {
runTest("testData/editor/enterHandler/beforeDot/CallWithLambdaInFirstPosition.after.kt");
}
@TestMetadata("CallWithLambdaInNonFirstPositionOnFirstLine.after.kt")
public void testCallWithLambdaInNonFirstPositionOnFirstLine() throws Exception {
runTest("testData/editor/enterHandler/beforeDot/CallWithLambdaInNonFirstPositionOnFirstLine.after.kt");
}
@TestMetadata("CallWithLambdaInNonFirstPositionOnNonFirstLine.after.kt")
public void testCallWithLambdaInNonFirstPositionOnNonFirstLine() throws Exception {
runTest("testData/editor/enterHandler/beforeDot/CallWithLambdaInNonFirstPositionOnNonFirstLine.after.kt");
}
@TestMetadata("CharLiteralInFirstPosition.after.kt")
public void testCharLiteralInFirstPosition() throws Exception {
runTest("testData/editor/enterHandler/beforeDot/CharLiteralInFirstPosition.after.kt");
}
@TestMetadata("CharLiteralInFirstPosition2.after.kt")
public void testCharLiteralInFirstPosition2() throws Exception {
runTest("testData/editor/enterHandler/beforeDot/CharLiteralInFirstPosition2.after.kt");
}
@TestMetadata("FirstPositionOnNewLineInsideCall.after.kt")
public void testFirstPositionOnNewLineInsideCall() throws Exception {
runTest("testData/editor/enterHandler/beforeDot/FirstPositionOnNewLineInsideCall.after.kt");
}
@TestMetadata("FloatLiteralInFirstPosition.after.kt")
public void testFloatLiteralInFirstPosition() throws Exception {
runTest("testData/editor/enterHandler/beforeDot/FloatLiteralInFirstPosition.after.kt");
}
@TestMetadata("FloatLiteralInFirstPosition2.after.kt")
public void testFloatLiteralInFirstPosition2() throws Exception {
runTest("testData/editor/enterHandler/beforeDot/FloatLiteralInFirstPosition2.after.kt");
}
@TestMetadata("FloatLiteralInFirstPositionAfterParenthesis.after.kt")
public void testFloatLiteralInFirstPositionAfterParenthesis() throws Exception {
runTest("testData/editor/enterHandler/beforeDot/FloatLiteralInFirstPositionAfterParenthesis.after.kt");
}
@TestMetadata("InsideCall.after.kt")
public void testInsideCall() throws Exception {
runTest("testData/editor/enterHandler/beforeDot/InsideCall.after.kt");
}
@TestMetadata("IntegerLiteralInFirstPosition.after.kt")
public void testIntegerLiteralInFirstPosition() throws Exception {
runTest("testData/editor/enterHandler/beforeDot/IntegerLiteralInFirstPosition.after.kt");
}
@TestMetadata("IntegerLiteralInFirstPosition2.after.kt")
public void testIntegerLiteralInFirstPosition2() throws Exception {
runTest("testData/editor/enterHandler/beforeDot/IntegerLiteralInFirstPosition2.after.kt");
}
@TestMetadata("MultilineCallWithLambdaInFirstPosition.after.kt")
public void testMultilineCallWithLambdaInFirstPosition() throws Exception {
runTest("testData/editor/enterHandler/beforeDot/MultilineCallWithLambdaInFirstPosition.after.kt");
}
@TestMetadata("MultilineCallWithLambdaInNonFirstPositionOnFirstLine.after.kt")
public void testMultilineCallWithLambdaInNonFirstPositionOnFirstLine() throws Exception {
runTest("testData/editor/enterHandler/beforeDot/MultilineCallWithLambdaInNonFirstPositionOnFirstLine.after.kt");
}
@TestMetadata("MultilineCallWithLambdaInNonFirstPositionOnNonFirstLine.after.kt")
public void testMultilineCallWithLambdaInNonFirstPositionOnNonFirstLine() throws Exception {
runTest("testData/editor/enterHandler/beforeDot/MultilineCallWithLambdaInNonFirstPositionOnNonFirstLine.after.kt");
}
@TestMetadata("NonFirstPositionOnNewLineInsideCall.after.kt")
public void testNonFirstPositionOnNewLineInsideCall() throws Exception {
runTest("testData/editor/enterHandler/beforeDot/NonFirstPositionOnNewLineInsideCall.after.kt");
}
@TestMetadata("NonFirstPositionOnNonFirstLineOnNewLineInsideCall.after.kt")
public void testNonFirstPositionOnNonFirstLineOnNewLineInsideCall() throws Exception {
runTest("testData/editor/enterHandler/beforeDot/NonFirstPositionOnNonFirstLineOnNewLineInsideCall.after.kt");
}
@TestMetadata("ReferenceInFirstPosition.after.kt")
public void testReferenceInFirstPosition() throws Exception {
runTest("testData/editor/enterHandler/beforeDot/ReferenceInFirstPosition.after.kt");
}
@TestMetadata("ReferenceInFirstPositionAfterProperty.after.kt")
public void testReferenceInFirstPositionAfterProperty() throws Exception {
runTest("testData/editor/enterHandler/beforeDot/ReferenceInFirstPositionAfterProperty.after.kt");
}
@TestMetadata("ReferenceInNonFirstPositionAfterProperty.after.kt")
public void testReferenceInNonFirstPositionAfterProperty() throws Exception {
runTest("testData/editor/enterHandler/beforeDot/ReferenceInNonFirstPositionAfterProperty.after.kt");
}
@TestMetadata("ReferenceInNonFirstPositionAfterPropertyOnNonFirstLine.after.kt")
public void testReferenceInNonFirstPositionAfterPropertyOnNonFirstLine() throws Exception {
runTest("testData/editor/enterHandler/beforeDot/ReferenceInNonFirstPositionAfterPropertyOnNonFirstLine.after.kt");
}
@TestMetadata("ReferenceInNonFirstPositionOnFirstLine.after.kt")
public void testReferenceInNonFirstPositionOnFirstLine() throws Exception {
runTest("testData/editor/enterHandler/beforeDot/ReferenceInNonFirstPositionOnFirstLine.after.kt");
}
@TestMetadata("ReferenceInNonFirstPositionOnNonFirstLine.after.kt")
public void testReferenceInNonFirstPositionOnNonFirstLine() throws Exception {
runTest("testData/editor/enterHandler/beforeDot/ReferenceInNonFirstPositionOnNonFirstLine.after.kt");
}
@TestMetadata("ReferenceInNonFirstPositionOnNonFirstLineAfterProperty.after.kt")
public void testReferenceInNonFirstPositionOnNonFirstLineAfterProperty() throws Exception {
runTest("testData/editor/enterHandler/beforeDot/ReferenceInNonFirstPositionOnNonFirstLineAfterProperty.after.kt");
}
@TestMetadata("StringLiteralInFirstPosition.after.kt")
public void testStringLiteralInFirstPosition() throws Exception {
runTest("testData/editor/enterHandler/beforeDot/StringLiteralInFirstPosition.after.kt");
}
@TestMetadata("StringLiteralInFirstPosition2.after.kt")
public void testStringLiteralInFirstPosition2() throws Exception {
runTest("testData/editor/enterHandler/beforeDot/StringLiteralInFirstPosition2.after.kt");
}
@TestMetadata("StringLiteralInFirstPositionAfterOpenParenthesis.after.kt")
public void testStringLiteralInFirstPositionAfterOpenParenthesis() throws Exception {
runTest("testData/editor/enterHandler/beforeDot/StringLiteralInFirstPositionAfterOpenParenthesis.after.kt");
}
}
@RunWith(JUnit3RunnerWithInners.class)
@TestMetadata("testData/editor/enterHandler/commenter")
public static class Commenter extends AbstractEnterHandlerTest {
private void runTest(String testDataFilePath) throws Exception {
KotlinTestUtils.runTest(this::doNewlineTest, this, testDataFilePath);
}
@TestMetadata("AfterLineComment.after.kt")
public void testAfterLineComment() throws Exception {
runTest("testData/editor/enterHandler/commenter/AfterLineComment.after.kt");
}
@TestMetadata("GenerateBlockComment.after.kt")
public void testGenerateBlockComment() throws Exception {
runTest("testData/editor/enterHandler/commenter/GenerateBlockComment.after.kt");
}
@TestMetadata("GenerateDocComment.after.kt")
public void testGenerateDocComment() throws Exception {
runTest("testData/editor/enterHandler/commenter/GenerateDocComment.after.kt");
}
@TestMetadata("InBlockComment.after.kt")
public void testInBlockComment() throws Exception {
runTest("testData/editor/enterHandler/commenter/InBlockComment.after.kt");
}
@TestMetadata("InBlockCommentBeforeText.after.kt")
public void testInBlockCommentBeforeText() throws Exception {
runTest("testData/editor/enterHandler/commenter/InBlockCommentBeforeText.after.kt");
}
@TestMetadata("InDocComment.after.kt")
public void testInDocComment() throws Exception {
runTest("testData/editor/enterHandler/commenter/InDocComment.after.kt");
}
@TestMetadata("InDocCommentBeforeText.after.kt")
public void testInDocCommentBeforeText() throws Exception {
runTest("testData/editor/enterHandler/commenter/InDocCommentBeforeText.after.kt");
}
@TestMetadata("InLineComment.after.kt")
public void testInLineComment() throws Exception {
runTest("testData/editor/enterHandler/commenter/InLineComment.after.kt");
}
@TestMetadata("InTag.after.kt")
public void testInTag() throws Exception {
runTest("testData/editor/enterHandler/commenter/InTag.after.kt");
}
}
@RunWith(JUnit3RunnerWithInners.class)
@TestMetadata("testData/editor/enterHandler/contextReceivers")
public static class ContextReceivers extends AbstractEnterHandlerTest {
private void runTest(String testDataFilePath) throws Exception {
KotlinTestUtils.runTest(this::doNewlineTest, this, testDataFilePath);
}
@TestMetadata("MemberFunctionWithContextReceiver.after.kt")
public void testMemberFunctionWithContextReceiver() throws Exception {
runTest("testData/editor/enterHandler/contextReceivers/MemberFunctionWithContextReceiver.after.kt");
}
@TestMetadata("MemberFunctionWithContextReceiverNoModifiers.after.kt")
public void testMemberFunctionWithContextReceiverNoModifiers() throws Exception {
runTest("testData/editor/enterHandler/contextReceivers/MemberFunctionWithContextReceiverNoModifiers.after.kt");
}
@TestMetadata("MemberPropertyWithContextReceiver.after.kt")
public void testMemberPropertyWithContextReceiver() throws Exception {
runTest("testData/editor/enterHandler/contextReceivers/MemberPropertyWithContextReceiver.after.kt");
}
@TestMetadata("MemberPropertyWithContextReceiverNoModifiers.after.kt")
public void testMemberPropertyWithContextReceiverNoModifiers() throws Exception {
runTest("testData/editor/enterHandler/contextReceivers/MemberPropertyWithContextReceiverNoModifiers.after.kt");
}
@TestMetadata("TopLevelFunctionWithContextReceiver.after.kt")
public void testTopLevelFunctionWithContextReceiver() throws Exception {
runTest("testData/editor/enterHandler/contextReceivers/TopLevelFunctionWithContextReceiver.after.kt");
}
@TestMetadata("TopLevelFunctionWithContextReceiverNoModifiers.after.kt")
public void testTopLevelFunctionWithContextReceiverNoModifiers() throws Exception {
runTest("testData/editor/enterHandler/contextReceivers/TopLevelFunctionWithContextReceiverNoModifiers.after.kt");
}
@TestMetadata("TopLevelPropertyWithContextReceiver.after.kt")
public void testTopLevelPropertyWithContextReceiver() throws Exception {
runTest("testData/editor/enterHandler/contextReceivers/TopLevelPropertyWithContextReceiver.after.kt");
}
@TestMetadata("TopLevelPropertyWithContextReceiverNoModifiers.after.kt")
public void testTopLevelPropertyWithContextReceiverNoModifiers() throws Exception {
runTest("testData/editor/enterHandler/contextReceivers/TopLevelPropertyWithContextReceiverNoModifiers.after.kt");
}
}
@RunWith(JUnit3RunnerWithInners.class)
@TestMetadata("testData/editor/enterHandler/controlFlowConstructions")
public static class ControlFlowConstructions extends AbstractEnterHandlerTest {
private void runTest(String testDataFilePath) throws Exception {
KotlinTestUtils.runTest(this::doNewlineTest, this, testDataFilePath);
}
@TestMetadata("BetweenOpenBraceAndParenthesis.after.kt")
public void testBetweenOpenBraceAndParenthesis() throws Exception {
runTest("testData/editor/enterHandler/controlFlowConstructions/BetweenOpenBraceAndParenthesis.after.kt");
}
@TestMetadata("Catch.after.kt")
public void testCatch() throws Exception {
runTest("testData/editor/enterHandler/controlFlowConstructions/Catch.after.kt");
}
@TestMetadata("Catch2.after.kt")
public void testCatch2() throws Exception {
runTest("testData/editor/enterHandler/controlFlowConstructions/Catch2.after.kt");
}
@TestMetadata("Catch3.after.kt")
public void testCatch3() throws Exception {
runTest("testData/editor/enterHandler/controlFlowConstructions/Catch3.after.kt");
}
@TestMetadata("Catch4.after.kt")
public void testCatch4() throws Exception {
runTest("testData/editor/enterHandler/controlFlowConstructions/Catch4.after.kt");
}
@TestMetadata("Do2.after.kt")
public void testDo2() throws Exception {
runTest("testData/editor/enterHandler/controlFlowConstructions/Do2.after.kt");
}
@TestMetadata("DoInFun.after.kt")
public void testDoInFun() throws Exception {
runTest("testData/editor/enterHandler/controlFlowConstructions/DoInFun.after.kt");
}
@TestMetadata("DoWhile.after.kt")
public void testDoWhile() throws Exception {
runTest("testData/editor/enterHandler/controlFlowConstructions/DoWhile.after.kt");
}
@TestMetadata("DoWhile2.after.kt")
public void testDoWhile2() throws Exception {
runTest("testData/editor/enterHandler/controlFlowConstructions/DoWhile2.after.kt");
}
@TestMetadata("DoWhile3.after.kt")
public void testDoWhile3() throws Exception {
runTest("testData/editor/enterHandler/controlFlowConstructions/DoWhile3.after.kt");
}
@TestMetadata("DoWhile4.after.kt")
public void testDoWhile4() throws Exception {
runTest("testData/editor/enterHandler/controlFlowConstructions/DoWhile4.after.kt");
}
@TestMetadata("DoWhile5.after.kt")
public void testDoWhile5() throws Exception {
runTest("testData/editor/enterHandler/controlFlowConstructions/DoWhile5.after.kt");
}
@TestMetadata("DoWhile6.after.kt")
public void testDoWhile6() throws Exception {
runTest("testData/editor/enterHandler/controlFlowConstructions/DoWhile6.after.kt");
}
@TestMetadata("DoWhile7.after.kt")
public void testDoWhile7() throws Exception {
runTest("testData/editor/enterHandler/controlFlowConstructions/DoWhile7.after.kt");
}
@TestMetadata("DoWithBraces.after.kt")
public void testDoWithBraces() throws Exception {
runTest("testData/editor/enterHandler/controlFlowConstructions/DoWithBraces.after.kt");
}
@TestMetadata("DoWithBraces2.after.kt")
public void testDoWithBraces2() throws Exception {
runTest("testData/editor/enterHandler/controlFlowConstructions/DoWithBraces2.after.kt");
}
@TestMetadata("ElseIf.after.kt")
public void testElseIf() throws Exception {
runTest("testData/editor/enterHandler/controlFlowConstructions/ElseIf.after.kt");
}
@TestMetadata("ElseInWhenWithOption.after.kt")
public void testElseInWhenWithOption() throws Exception {
runTest("testData/editor/enterHandler/controlFlowConstructions/ElseInWhenWithOption.after.kt");
}
@TestMetadata("ElseInWhenWithoutOption.after.kt")
public void testElseInWhenWithoutOption() throws Exception {
runTest("testData/editor/enterHandler/controlFlowConstructions/ElseInWhenWithoutOption.after.kt");
}
@TestMetadata("ElseWithBrace.after.kt")
public void testElseWithBrace() throws Exception {
runTest("testData/editor/enterHandler/controlFlowConstructions/ElseWithBrace.after.kt");
}
@TestMetadata("ElseWithBraceAndComment.after.kt")
public void testElseWithBraceAndComment() throws Exception {
runTest("testData/editor/enterHandler/controlFlowConstructions/ElseWithBraceAndComment.after.kt");
}
@TestMetadata("ElseWithBraceAndComment2.after.kt")
public void testElseWithBraceAndComment2() throws Exception {
runTest("testData/editor/enterHandler/controlFlowConstructions/ElseWithBraceAndComment2.after.kt");
}
@TestMetadata("ElseWithoutBrace.after.kt")
public void testElseWithoutBrace() throws Exception {
runTest("testData/editor/enterHandler/controlFlowConstructions/ElseWithoutBrace.after.kt");
}
@TestMetadata("ElseWithoutBrace2.after.kt")
public void testElseWithoutBrace2() throws Exception {
runTest("testData/editor/enterHandler/controlFlowConstructions/ElseWithoutBrace2.after.kt");
}
@TestMetadata("Finally.after.kt")
public void testFinally() throws Exception {
runTest("testData/editor/enterHandler/controlFlowConstructions/Finally.after.kt");
}
@TestMetadata("Finally2.after.kt")
public void testFinally2() throws Exception {
runTest("testData/editor/enterHandler/controlFlowConstructions/Finally2.after.kt");
}
@TestMetadata("Finally3.after.kt")
public void testFinally3() throws Exception {
runTest("testData/editor/enterHandler/controlFlowConstructions/Finally3.after.kt");
}
@TestMetadata("Finally4.after.kt")
public void testFinally4() throws Exception {
runTest("testData/editor/enterHandler/controlFlowConstructions/Finally4.after.kt");
}
@TestMetadata("For.after.kt")
public void testFor() throws Exception {
runTest("testData/editor/enterHandler/controlFlowConstructions/For.after.kt");
}
@TestMetadata("ForWithBlock.after.kt")
public void testForWithBlock() throws Exception {
runTest("testData/editor/enterHandler/controlFlowConstructions/ForWithBlock.after.kt");
}
@TestMetadata("ForWithCondition.after.kt")
public void testForWithCondition() throws Exception {
runTest("testData/editor/enterHandler/controlFlowConstructions/ForWithCondition.after.kt");
}
@TestMetadata("ForWithoutCondition.after.kt")
public void testForWithoutCondition() throws Exception {
runTest("testData/editor/enterHandler/controlFlowConstructions/ForWithoutCondition.after.kt");
}
@TestMetadata("If.after.kt")
public void testIf() throws Exception {
runTest("testData/editor/enterHandler/controlFlowConstructions/If.after.kt");
}
@TestMetadata("IfBeforeCondition.after.kt")
public void testIfBeforeCondition() throws Exception {
runTest("testData/editor/enterHandler/controlFlowConstructions/IfBeforeCondition.after.kt");
}
@TestMetadata("IfBeforeCondition2.after.kt")
public void testIfBeforeCondition2() throws Exception {
runTest("testData/editor/enterHandler/controlFlowConstructions/IfBeforeCondition2.after.kt");
}
@TestMetadata("IfBeforeCondition3.after.kt")
public void testIfBeforeCondition3() throws Exception {
runTest("testData/editor/enterHandler/controlFlowConstructions/IfBeforeCondition3.after.kt");
}
@TestMetadata("IfBeforeCondition4.after.kt")
public void testIfBeforeCondition4() throws Exception {
runTest("testData/editor/enterHandler/controlFlowConstructions/IfBeforeCondition4.after.kt");
}
@TestMetadata("IfWithBraces.after.kt")
public void testIfWithBraces() throws Exception {
runTest("testData/editor/enterHandler/controlFlowConstructions/IfWithBraces.after.kt");
}
@TestMetadata("IfWithBraces2.after.kt")
public void testIfWithBraces2() throws Exception {
runTest("testData/editor/enterHandler/controlFlowConstructions/IfWithBraces2.after.kt");
}
@TestMetadata("Try.after.kt")
public void testTry() throws Exception {
runTest("testData/editor/enterHandler/controlFlowConstructions/Try.after.kt");
}
@TestMetadata("Try2.after.kt")
public void testTry2() throws Exception {
runTest("testData/editor/enterHandler/controlFlowConstructions/Try2.after.kt");
}
@TestMetadata("WhenWithCondition.after.kt")
public void testWhenWithCondition() throws Exception {
runTest("testData/editor/enterHandler/controlFlowConstructions/WhenWithCondition.after.kt");
}
@TestMetadata("WhenWithCondition2.after.kt")
public void testWhenWithCondition2() throws Exception {
runTest("testData/editor/enterHandler/controlFlowConstructions/WhenWithCondition2.after.kt");
}
@TestMetadata("WhenWithoutCondition.after.kt")
public void testWhenWithoutCondition() throws Exception {
runTest("testData/editor/enterHandler/controlFlowConstructions/WhenWithoutCondition.after.kt");
}
@TestMetadata("While.after.kt")
public void testWhile() throws Exception {
runTest("testData/editor/enterHandler/controlFlowConstructions/While.after.kt");
}
@TestMetadata("While2.after.kt")
public void testWhile2() throws Exception {
runTest("testData/editor/enterHandler/controlFlowConstructions/While2.after.kt");
}
@TestMetadata("While3.after.kt")
public void testWhile3() throws Exception {
runTest("testData/editor/enterHandler/controlFlowConstructions/While3.after.kt");
}
@TestMetadata("WhileWithBlock.after.kt")
public void testWhileWithBlock() throws Exception {
runTest("testData/editor/enterHandler/controlFlowConstructions/WhileWithBlock.after.kt");
}
@TestMetadata("WhileWithCondition.after.kt")
public void testWhileWithCondition() throws Exception {
runTest("testData/editor/enterHandler/controlFlowConstructions/WhileWithCondition.after.kt");
}
@TestMetadata("WhileWithoutCondition.after.kt")
public void testWhileWithoutCondition() throws Exception {
runTest("testData/editor/enterHandler/controlFlowConstructions/WhileWithoutCondition.after.kt");
}
}
@RunWith(JUnit3RunnerWithInners.class)
@TestMetadata("testData/editor/enterHandler/elvis")
public static class Elvis extends AbstractEnterHandlerTest {
private void runTest(String testDataFilePath) throws Exception {
KotlinTestUtils.runTest(this::doNewlineTest, this, testDataFilePath);
}
@TestMetadata("AfterElvis.after.kt")
public void testAfterElvis() throws Exception {
runTest("testData/editor/enterHandler/elvis/AfterElvis.after.kt");
}
@TestMetadata("AfterElvis2.after.kt")
public void testAfterElvis2() throws Exception {
runTest("testData/editor/enterHandler/elvis/AfterElvis2.after.kt");
}
@TestMetadata("AfterElvisInBinaryExpression.after.kt")
public void testAfterElvisInBinaryExpression() throws Exception {
runTest("testData/editor/enterHandler/elvis/AfterElvisInBinaryExpression.after.kt");
}
@TestMetadata("BeforeElvis.after.kt")
public void testBeforeElvis() throws Exception {
runTest("testData/editor/enterHandler/elvis/BeforeElvis.after.kt");
}
@TestMetadata("BeforeElvisInBinaryExpression.after.kt")
public void testBeforeElvisInBinaryExpression() throws Exception {
runTest("testData/editor/enterHandler/elvis/BeforeElvisInBinaryExpression.after.kt");
}
}
@RunWith(JUnit3RunnerWithInners.class)
@TestMetadata("testData/editor/enterHandler/emptyBraces")
public static class EmptyBraces extends AbstractEnterHandlerTest {
private void runTest(String testDataFilePath) throws Exception {
KotlinTestUtils.runTest(this::doNewlineTest, this, testDataFilePath);
}
@TestMetadata("ClassWithConstructor.after.kt")
public void testClassWithConstructor() throws Exception {
runTest("testData/editor/enterHandler/emptyBraces/ClassWithConstructor.after.kt");
}
@TestMetadata("ClassWithConstructor2.after.kt")
public void testClassWithConstructor2() throws Exception {
runTest("testData/editor/enterHandler/emptyBraces/ClassWithConstructor2.after.kt");
}
@TestMetadata("ClassWithoutConstructor.after.kt")
public void testClassWithoutConstructor() throws Exception {
runTest("testData/editor/enterHandler/emptyBraces/ClassWithoutConstructor.after.kt");
}
@TestMetadata("FunctionBlock.after.kt")
public void testFunctionBlock() throws Exception {
runTest("testData/editor/enterHandler/emptyBraces/FunctionBlock.after.kt");
}
@TestMetadata("FunctionBlock2.after.kt")
public void testFunctionBlock2() throws Exception {
runTest("testData/editor/enterHandler/emptyBraces/FunctionBlock2.after.kt");
}
@TestMetadata("FunctionBody3.after.kt")
public void testFunctionBody3() throws Exception {
runTest("testData/editor/enterHandler/emptyBraces/FunctionBody3.after.kt");
}
@TestMetadata("FunctionBody4.after.kt")
public void testFunctionBody4() throws Exception {
runTest("testData/editor/enterHandler/emptyBraces/FunctionBody4.after.kt");
}
@TestMetadata("FunctionBodyInsideClass.after.kt")
public void testFunctionBodyInsideClass() throws Exception {
runTest("testData/editor/enterHandler/emptyBraces/FunctionBodyInsideClass.after.kt");
}
@TestMetadata("FunctionBodyInsideClass2.after.kt")
public void testFunctionBodyInsideClass2() throws Exception {
runTest("testData/editor/enterHandler/emptyBraces/FunctionBodyInsideClass2.after.kt");
}
}
@RunWith(JUnit3RunnerWithInners.class)
@TestMetadata("testData/editor/enterHandler/emptyParameters")
public static class EmptyParameters extends AbstractEnterHandlerTest {
private void runTest(String testDataFilePath) throws Exception {
KotlinTestUtils.runTest(this::doNewlineTest, this, testDataFilePath);
}
@TestMetadata("EmptyArgumentInCallByArrayAccess.after.kt")
public void testEmptyArgumentInCallByArrayAccess() throws Exception {
runTest("testData/editor/enterHandler/emptyParameters/EmptyArgumentInCallByArrayAccess.after.kt");
}
@TestMetadata("EmptyArgumentInCallByArrayAccess2.after.kt")
public void testEmptyArgumentInCallByArrayAccess2() throws Exception {
runTest("testData/editor/enterHandler/emptyParameters/EmptyArgumentInCallByArrayAccess2.after.kt");
}
@TestMetadata("EmptyArgumentInCallByDeclaration.after.kt")
public void testEmptyArgumentInCallByDeclaration() throws Exception {
runTest("testData/editor/enterHandler/emptyParameters/EmptyArgumentInCallByDeclaration.after.kt");
}
@TestMetadata("EmptyArgumentInCallByDeclaration2.after.kt")
public void testEmptyArgumentInCallByDeclaration2() throws Exception {
runTest("testData/editor/enterHandler/emptyParameters/EmptyArgumentInCallByDeclaration2.after.kt");
}
@TestMetadata("EmptyArgumentInCallByReference.after.kt")
public void testEmptyArgumentInCallByReference() throws Exception {
runTest("testData/editor/enterHandler/emptyParameters/EmptyArgumentInCallByReference.after.kt");
}
@TestMetadata("EmptyArgumentInCallByReference2.after.kt")
public void testEmptyArgumentInCallByReference2() throws Exception {
runTest("testData/editor/enterHandler/emptyParameters/EmptyArgumentInCallByReference2.after.kt");
}
@TestMetadata("EmptyArgumentInCallByReferenceInSuperType.after.kt")
public void testEmptyArgumentInCallByReferenceInSuperType() throws Exception {
runTest("testData/editor/enterHandler/emptyParameters/EmptyArgumentInCallByReferenceInSuperType.after.kt");
}
@TestMetadata("EmptyArgumentInCallByReferenceInSuperType2.after.kt")
public void testEmptyArgumentInCallByReferenceInSuperType2() throws Exception {
runTest("testData/editor/enterHandler/emptyParameters/EmptyArgumentInCallByReferenceInSuperType2.after.kt");
}
@TestMetadata("EmptyArgumentInCallByReferenceInSuperTypeWithTypeArguments.after.kt")
public void testEmptyArgumentInCallByReferenceInSuperTypeWithTypeArguments() throws Exception {
runTest("testData/editor/enterHandler/emptyParameters/EmptyArgumentInCallByReferenceInSuperTypeWithTypeArguments.after.kt");
}
@TestMetadata("EmptyArgumentInCallByReferenceInSuperTypeWithTypeArguments2.after.kt")
public void testEmptyArgumentInCallByReferenceInSuperTypeWithTypeArguments2() throws Exception {
runTest("testData/editor/enterHandler/emptyParameters/EmptyArgumentInCallByReferenceInSuperTypeWithTypeArguments2.after.kt");
}
@TestMetadata("EmptyArgumentInCallByReferenceWithTypeArguments.after.kt")
public void testEmptyArgumentInCallByReferenceWithTypeArguments() throws Exception {
runTest("testData/editor/enterHandler/emptyParameters/EmptyArgumentInCallByReferenceWithTypeArguments.after.kt");
}
@TestMetadata("EmptyArgumentInCallByReferenceWithTypeArguments2.after.kt")
public void testEmptyArgumentInCallByReferenceWithTypeArguments2() throws Exception {
runTest("testData/editor/enterHandler/emptyParameters/EmptyArgumentInCallByReferenceWithTypeArguments2.after.kt");
}
@TestMetadata("EmptyArgumentInThisAsClassicFunction.after.kt")
public void testEmptyArgumentInThisAsClassicFunction() throws Exception {
runTest("testData/editor/enterHandler/emptyParameters/EmptyArgumentInThisAsClassicFunction.after.kt");
}
@TestMetadata("EmptyArgumentInThisAsConstructor.after.kt")
public void testEmptyArgumentInThisAsConstructor() throws Exception {
runTest("testData/editor/enterHandler/emptyParameters/EmptyArgumentInThisAsConstructor.after.kt");
}
@TestMetadata("EmptyArgumentInThisAsConstructor2.after.kt")
public void testEmptyArgumentInThisAsConstructor2() throws Exception {
runTest("testData/editor/enterHandler/emptyParameters/EmptyArgumentInThisAsConstructor2.after.kt");
}
@TestMetadata("EmptyConditionInCatch.after.kt")
public void testEmptyConditionInCatch() throws Exception {
runTest("testData/editor/enterHandler/emptyParameters/EmptyConditionInCatch.after.kt");
}
@TestMetadata("EmptyConditionInCatch2.after.kt")
public void testEmptyConditionInCatch2() throws Exception {
runTest("testData/editor/enterHandler/emptyParameters/EmptyConditionInCatch2.after.kt");
}
@TestMetadata("EmptyConditionInDoWhile.after.kt")
public void testEmptyConditionInDoWhile() throws Exception {
runTest("testData/editor/enterHandler/emptyParameters/EmptyConditionInDoWhile.after.kt");
}
@TestMetadata("EmptyConditionInFor.after.kt")
public void testEmptyConditionInFor() throws Exception {
runTest("testData/editor/enterHandler/emptyParameters/EmptyConditionInFor.after.kt");
}
@TestMetadata("EmptyConditionInIf.after.kt")
public void testEmptyConditionInIf() throws Exception {
runTest("testData/editor/enterHandler/emptyParameters/EmptyConditionInIf.after.kt");
}
@TestMetadata("EmptyConditionInWhen.after.kt")
public void testEmptyConditionInWhen() throws Exception {
runTest("testData/editor/enterHandler/emptyParameters/EmptyConditionInWhen.after.kt");
}
@TestMetadata("EmptyConditionInWhile.after.kt")
public void testEmptyConditionInWhile() throws Exception {
runTest("testData/editor/enterHandler/emptyParameters/EmptyConditionInWhile.after.kt");
}
@TestMetadata("EmptyParameterInAnnonymousFunction.after.kt")
public void testEmptyParameterInAnnonymousFunction() throws Exception {
runTest("testData/editor/enterHandler/emptyParameters/EmptyParameterInAnnonymousFunction.after.kt");
}
@TestMetadata("EmptyParameterInAnnonymousFunction2.after.kt")
public void testEmptyParameterInAnnonymousFunction2() throws Exception {
runTest("testData/editor/enterHandler/emptyParameters/EmptyParameterInAnnonymousFunction2.after.kt");
}
@TestMetadata("EmptyParameterInAnnonymousFunctionWithNullableReceiver.after.kt")
public void testEmptyParameterInAnnonymousFunctionWithNullableReceiver() throws Exception {
runTest("testData/editor/enterHandler/emptyParameters/EmptyParameterInAnnonymousFunctionWithNullableReceiver.after.kt");
}
@TestMetadata("EmptyParameterInAnnonymousFunctionWithNullableReceiver2.after.kt")
public void testEmptyParameterInAnnonymousFunctionWithNullableReceiver2() throws Exception {
runTest("testData/editor/enterHandler/emptyParameters/EmptyParameterInAnnonymousFunctionWithNullableReceiver2.after.kt");
}
@TestMetadata("EmptyParameterInAnnonymousFunctionWithReceiver.after.kt")
public void testEmptyParameterInAnnonymousFunctionWithReceiver() throws Exception {
runTest("testData/editor/enterHandler/emptyParameters/EmptyParameterInAnnonymousFunctionWithReceiver.after.kt");
}
@TestMetadata("EmptyParameterInAnnonymousFunctionWithReceiver2.after.kt")
public void testEmptyParameterInAnnonymousFunctionWithReceiver2() throws Exception {
runTest("testData/editor/enterHandler/emptyParameters/EmptyParameterInAnnonymousFunctionWithReceiver2.after.kt");
}
@TestMetadata("EmptyParameterInDestructuringDeclaration.after.kt")
public void testEmptyParameterInDestructuringDeclaration() throws Exception {
runTest("testData/editor/enterHandler/emptyParameters/EmptyParameterInDestructuringDeclaration.after.kt");
}
@TestMetadata("EmptyParameterInDestructuringDeclaration2.after.kt")
public void testEmptyParameterInDestructuringDeclaration2() throws Exception {
runTest("testData/editor/enterHandler/emptyParameters/EmptyParameterInDestructuringDeclaration2.after.kt");
}
@TestMetadata("EmptyParameterInDestructuringDeclaration3.after.kt")
public void testEmptyParameterInDestructuringDeclaration3() throws Exception {
runTest("testData/editor/enterHandler/emptyParameters/EmptyParameterInDestructuringDeclaration3.after.kt");
}
@TestMetadata("EmptyParameterInExplicitPrimaryConstructor.after.kt")
public void testEmptyParameterInExplicitPrimaryConstructor() throws Exception {
runTest("testData/editor/enterHandler/emptyParameters/EmptyParameterInExplicitPrimaryConstructor.after.kt");
}
@TestMetadata("EmptyParameterInExplicitPrimaryConstructor2.after.kt")
public void testEmptyParameterInExplicitPrimaryConstructor2() throws Exception {
runTest("testData/editor/enterHandler/emptyParameters/EmptyParameterInExplicitPrimaryConstructor2.after.kt");
}
@TestMetadata("EmptyParameterInFunction.after.kt")
public void testEmptyParameterInFunction() throws Exception {
runTest("testData/editor/enterHandler/emptyParameters/EmptyParameterInFunction.after.kt");
}
@TestMetadata("EmptyParameterInFunction2.after.kt")
public void testEmptyParameterInFunction2() throws Exception {
runTest("testData/editor/enterHandler/emptyParameters/EmptyParameterInFunction2.after.kt");
}
@TestMetadata("EmptyParameterInFunctionWithReceiver.after.kt")
public void testEmptyParameterInFunctionWithReceiver() throws Exception {
runTest("testData/editor/enterHandler/emptyParameters/EmptyParameterInFunctionWithReceiver.after.kt");
}
@TestMetadata("EmptyParameterInFunctionWithReceiver2.after.kt")
public void testEmptyParameterInFunctionWithReceiver2() throws Exception {
runTest("testData/editor/enterHandler/emptyParameters/EmptyParameterInFunctionWithReceiver2.after.kt");
}
@TestMetadata("EmptyParameterInFunctionWithTypeParameters.after.kt")
public void testEmptyParameterInFunctionWithTypeParameters() throws Exception {
runTest("testData/editor/enterHandler/emptyParameters/EmptyParameterInFunctionWithTypeParameters.after.kt");
}
@TestMetadata("EmptyParameterInFunctionWithTypeParameters2.after.kt")
public void testEmptyParameterInFunctionWithTypeParameters2() throws Exception {
runTest("testData/editor/enterHandler/emptyParameters/EmptyParameterInFunctionWithTypeParameters2.after.kt");
}
@TestMetadata("EmptyParameterInFunctionWithTypeParametersAndReceiver.after.kt")
public void testEmptyParameterInFunctionWithTypeParametersAndReceiver() throws Exception {
runTest("testData/editor/enterHandler/emptyParameters/EmptyParameterInFunctionWithTypeParametersAndReceiver.after.kt");
}
@TestMetadata("EmptyParameterInFunctionWithTypeParametersAndReceiver2.after.kt")
public void testEmptyParameterInFunctionWithTypeParametersAndReceiver2() throws Exception {
runTest("testData/editor/enterHandler/emptyParameters/EmptyParameterInFunctionWithTypeParametersAndReceiver2.after.kt");
}
@TestMetadata("EmptyParameterInFunctionWithTypeParametersAndReceiver3.after.kt")
public void testEmptyParameterInFunctionWithTypeParametersAndReceiver3() throws Exception {
runTest("testData/editor/enterHandler/emptyParameters/EmptyParameterInFunctionWithTypeParametersAndReceiver3.after.kt");
}
@TestMetadata("EmptyParameterInFunctionWithTypeParametersAndReceiver4.after.kt")
public void testEmptyParameterInFunctionWithTypeParametersAndReceiver4() throws Exception {
runTest("testData/editor/enterHandler/emptyParameters/EmptyParameterInFunctionWithTypeParametersAndReceiver4.after.kt");
}
@TestMetadata("EmptyParameterInGetter.after.kt")
public void testEmptyParameterInGetter() throws Exception {
runTest("testData/editor/enterHandler/emptyParameters/EmptyParameterInGetter.after.kt");
}
@TestMetadata("EmptyParameterInGetter2.after.kt")
public void testEmptyParameterInGetter2() throws Exception {
runTest("testData/editor/enterHandler/emptyParameters/EmptyParameterInGetter2.after.kt");
}
@TestMetadata("EmptyParameterInImplicitPrimaryConstructor.after.kt")
public void testEmptyParameterInImplicitPrimaryConstructor() throws Exception {
runTest("testData/editor/enterHandler/emptyParameters/EmptyParameterInImplicitPrimaryConstructor.after.kt");
}
@TestMetadata("EmptyParameterInImplicitPrimaryConstructor2.after.kt")
public void testEmptyParameterInImplicitPrimaryConstructor2() throws Exception {
runTest("testData/editor/enterHandler/emptyParameters/EmptyParameterInImplicitPrimaryConstructor2.after.kt");
}
@TestMetadata("EmptyParameterInImplicitPrimaryConstructorWithTypeParameters.after.kt")
public void testEmptyParameterInImplicitPrimaryConstructorWithTypeParameters() throws Exception {
runTest("testData/editor/enterHandler/emptyParameters/EmptyParameterInImplicitPrimaryConstructorWithTypeParameters.after.kt");
}
@TestMetadata("EmptyParameterInImplicitPrimaryConstructorWithTypeParameters2.after.kt")
public void testEmptyParameterInImplicitPrimaryConstructorWithTypeParameters2() throws Exception {
runTest("testData/editor/enterHandler/emptyParameters/EmptyParameterInImplicitPrimaryConstructorWithTypeParameters2.after.kt");
}
@TestMetadata("EmptyParameterInInnerAnnonymousFunction.after.kt")
public void testEmptyParameterInInnerAnnonymousFunction() throws Exception {
runTest("testData/editor/enterHandler/emptyParameters/EmptyParameterInInnerAnnonymousFunction.after.kt");
}
@TestMetadata("EmptyParameterInInnerAnnonymousFunction2.after.kt")
public void testEmptyParameterInInnerAnnonymousFunction2() throws Exception {
runTest("testData/editor/enterHandler/emptyParameters/EmptyParameterInInnerAnnonymousFunction2.after.kt");
}
@TestMetadata("EmptyParameterInSecondaryConstructor.after.kt")
public void testEmptyParameterInSecondaryConstructor() throws Exception {
runTest("testData/editor/enterHandler/emptyParameters/EmptyParameterInSecondaryConstructor.after.kt");
}
@TestMetadata("EmptyParameterInSecondaryConstructor2.after.kt")
public void testEmptyParameterInSecondaryConstructor2() throws Exception {
runTest("testData/editor/enterHandler/emptyParameters/EmptyParameterInSecondaryConstructor2.after.kt");
}
@TestMetadata("EmptyParameterInSetter.after.kt")
public void testEmptyParameterInSetter() throws Exception {
runTest("testData/editor/enterHandler/emptyParameters/EmptyParameterInSetter.after.kt");
}
@TestMetadata("EmptyParameterInSetter2.after.kt")
public void testEmptyParameterInSetter2() throws Exception {
runTest("testData/editor/enterHandler/emptyParameters/EmptyParameterInSetter2.after.kt");
}
@TestMetadata("EmptyParameters.after.kt")
public void testEmptyParameters() throws Exception {
runTest("testData/editor/enterHandler/emptyParameters/EmptyParameters.after.kt");
}
@TestMetadata("EmptyParameters2.after.kt")
public void testEmptyParameters2() throws Exception {
runTest("testData/editor/enterHandler/emptyParameters/EmptyParameters2.after.kt");
}
}
@RunWith(JUnit3RunnerWithInners.class)
@TestMetadata("testData/editor/enterHandler/emptyParenthesisInBinaryExpression")
public static class EmptyParenthesisInBinaryExpression extends AbstractEnterHandlerTest {
private void runTest(String testDataFilePath) throws Exception {
KotlinTestUtils.runTest(this::doNewlineTest, this, testDataFilePath);
}
@TestMetadata("AssignmentAfterEq.after.kt")
public void testAssignmentAfterEq() throws Exception {
runTest("testData/editor/enterHandler/emptyParenthesisInBinaryExpression/AssignmentAfterEq.after.kt");
}
@TestMetadata("BinaryWithTypeExpressions.after.kt")
public void testBinaryWithTypeExpressions() throws Exception {
runTest("testData/editor/enterHandler/emptyParenthesisInBinaryExpression/BinaryWithTypeExpressions.after.kt");
}
@TestMetadata("EmptyArgumentInCallByArrayAccess.after.kt")
public void testEmptyArgumentInCallByArrayAccess() throws Exception {
runTest("testData/editor/enterHandler/emptyParenthesisInBinaryExpression/EmptyArgumentInCallByArrayAccess.after.kt");
}
@TestMetadata("EmptyArgumentInCallByDeclaration.after.kt")
public void testEmptyArgumentInCallByDeclaration() throws Exception {
runTest("testData/editor/enterHandler/emptyParenthesisInBinaryExpression/EmptyArgumentInCallByDeclaration.after.kt");
}
@TestMetadata("InBinaryExpressionInMiddle.after.kt")
public void testInBinaryExpressionInMiddle() throws Exception {
runTest("testData/editor/enterHandler/emptyParenthesisInBinaryExpression/InBinaryExpressionInMiddle.after.kt");
}
@TestMetadata("InBinaryExpressionUnfinished.after.kt")
public void testInBinaryExpressionUnfinished() throws Exception {
runTest("testData/editor/enterHandler/emptyParenthesisInBinaryExpression/InBinaryExpressionUnfinished.after.kt");
}
@TestMetadata("InBinaryExpressionUnfinishedInIf.after.kt")
public void testInBinaryExpressionUnfinishedInIf() throws Exception {
runTest("testData/editor/enterHandler/emptyParenthesisInBinaryExpression/InBinaryExpressionUnfinishedInIf.after.kt");
}
@TestMetadata("InBinaryExpressionsBeforeCloseParenthesis.after.kt")
public void testInBinaryExpressionsBeforeCloseParenthesis() throws Exception {
runTest("testData/editor/enterHandler/emptyParenthesisInBinaryExpression/InBinaryExpressionsBeforeCloseParenthesis.after.kt");
}
@TestMetadata("InExpressionsParentheses.after.kt")
public void testInExpressionsParentheses() throws Exception {
runTest("testData/editor/enterHandler/emptyParenthesisInBinaryExpression/InExpressionsParentheses.after.kt");
}
@TestMetadata("InExpressionsParentheses2.after.kt")
public void testInExpressionsParentheses2() throws Exception {
runTest("testData/editor/enterHandler/emptyParenthesisInBinaryExpression/InExpressionsParentheses2.after.kt");
}
@TestMetadata("InExpressionsParentheses3.after.kt")
public void testInExpressionsParentheses3() throws Exception {
runTest("testData/editor/enterHandler/emptyParenthesisInBinaryExpression/InExpressionsParentheses3.after.kt");
}
@TestMetadata("InExpressionsParentheses4.after.kt")
public void testInExpressionsParentheses4() throws Exception {
runTest("testData/editor/enterHandler/emptyParenthesisInBinaryExpression/InExpressionsParentheses4.after.kt");
}
@TestMetadata("InExpressionsParenthesesBeforeOperand.after.kt")
public void testInExpressionsParenthesesBeforeOperand() throws Exception {
runTest("testData/editor/enterHandler/emptyParenthesisInBinaryExpression/InExpressionsParenthesesBeforeOperand.after.kt");
}
@TestMetadata("IsExpressionAfterIs.after.kt")
public void testIsExpressionAfterIs() throws Exception {
runTest("testData/editor/enterHandler/emptyParenthesisInBinaryExpression/IsExpressionAfterIs.after.kt");
}
}
@RunWith(JUnit3RunnerWithInners.class)
@TestMetadata("testData/editor/enterHandler/expressionBody")
public static class ExpressionBody extends AbstractEnterHandlerTest {
private void runTest(String testDataFilePath) throws Exception {
KotlinTestUtils.runTest(this::doNewlineTest, this, testDataFilePath);
}
@TestMetadata("AfterFunctionWithExplicitType.after.kt")
public void testAfterFunctionWithExplicitType() throws Exception {
runTest("testData/editor/enterHandler/expressionBody/AfterFunctionWithExplicitType.after.kt");
}
@TestMetadata("AfterFunctionWithInference.after.kt")
public void testAfterFunctionWithInference() throws Exception {
runTest("testData/editor/enterHandler/expressionBody/AfterFunctionWithInference.after.kt");
}
@TestMetadata("AfterFunctionWithTypeParameter.after.kt")
public void testAfterFunctionWithTypeParameter() throws Exception {
runTest("testData/editor/enterHandler/expressionBody/AfterFunctionWithTypeParameter.after.kt");
}
@TestMetadata("AfterMultideclaration.after.kt")
public void testAfterMultideclaration() throws Exception {
runTest("testData/editor/enterHandler/expressionBody/AfterMultideclaration.after.kt");
}
@TestMetadata("AfterMutableProperty.after.kt")
public void testAfterMutableProperty() throws Exception {
runTest("testData/editor/enterHandler/expressionBody/AfterMutableProperty.after.kt");
}
@TestMetadata("AfterPropertyWithExplicitType.after.kt")
public void testAfterPropertyWithExplicitType() throws Exception {
runTest("testData/editor/enterHandler/expressionBody/AfterPropertyWithExplicitType.after.kt");
}
@TestMetadata("AfterPropertyWithInference.after.kt")
public void testAfterPropertyWithInference() throws Exception {
runTest("testData/editor/enterHandler/expressionBody/AfterPropertyWithInference.after.kt");
}
@TestMetadata("AfterPropertyWithReceiver.after.kt")
public void testAfterPropertyWithReceiver() throws Exception {
runTest("testData/editor/enterHandler/expressionBody/AfterPropertyWithReceiver.after.kt");
}
@TestMetadata("AfterPropertyWithTypeParameterReceiver.after.kt")
public void testAfterPropertyWithTypeParameterReceiver() throws Exception {
runTest("testData/editor/enterHandler/expressionBody/AfterPropertyWithTypeParameterReceiver.after.kt");
}
@TestMetadata("FunctionWithExplicitType.after.kt")
public void testFunctionWithExplicitType() throws Exception {
runTest("testData/editor/enterHandler/expressionBody/FunctionWithExplicitType.after.kt");
}
@TestMetadata("FunctionWithInference.after.kt")
public void testFunctionWithInference() throws Exception {
runTest("testData/editor/enterHandler/expressionBody/FunctionWithInference.after.kt");
}
@TestMetadata("FunctionWithTypeParameter.after.kt")
public void testFunctionWithTypeParameter() throws Exception {
runTest("testData/editor/enterHandler/expressionBody/FunctionWithTypeParameter.after.kt");
}
@TestMetadata("Multideclaration.after.kt")
public void testMultideclaration() throws Exception {
runTest("testData/editor/enterHandler/expressionBody/Multideclaration.after.kt");
}
@TestMetadata("MutableProperty.after.kt")
public void testMutableProperty() throws Exception {
runTest("testData/editor/enterHandler/expressionBody/MutableProperty.after.kt");
}
@TestMetadata("PropertyWithExplicitType.after.kt")
public void testPropertyWithExplicitType() throws Exception {
runTest("testData/editor/enterHandler/expressionBody/PropertyWithExplicitType.after.kt");
}
@TestMetadata("PropertyWithInference.after.kt")
public void testPropertyWithInference() throws Exception {
runTest("testData/editor/enterHandler/expressionBody/PropertyWithInference.after.kt");
}
@TestMetadata("PropertyWithReceiver.after.kt")
public void testPropertyWithReceiver() throws Exception {
runTest("testData/editor/enterHandler/expressionBody/PropertyWithReceiver.after.kt");
}
@TestMetadata("PropertyWithTypeParameterReceiver.after.kt")
public void testPropertyWithTypeParameterReceiver() throws Exception {
runTest("testData/editor/enterHandler/expressionBody/PropertyWithTypeParameterReceiver.after.kt");
}
}
@RunWith(JUnit3RunnerWithInners.class)
@TestMetadata("testData/editor/enterHandler/multilineString")
public abstract static class MultilineString extends AbstractEnterHandlerTest {
@RunWith(JUnit3RunnerWithInners.class)
@TestMetadata("testData/editor/enterHandler/multilineString/spaces")
public static class Spaces extends AbstractEnterHandlerTest {
private void runTest(String testDataFilePath) throws Exception {
KotlinTestUtils.runTest(this::doNewlineTest, this, testDataFilePath);
}
@TestMetadata("DontAddMarginCharWhenMultilineWithoutMargins.after.kt")
public void testDontAddMarginCharWhenMultilineWithoutMargins() throws Exception {
runTest("testData/editor/enterHandler/multilineString/spaces/DontAddMarginCharWhenMultilineWithoutMargins.after.kt");
}
@TestMetadata("DontAddMarginWhenItIsUnused.after.kt")
public void testDontAddMarginWhenItIsUnused() throws Exception {
runTest("testData/editor/enterHandler/multilineString/spaces/DontAddMarginWhenItIsUnused.after.kt");
}
@TestMetadata("DontAddMarginWhenItIsUnusedWithEmptyPrevious.after.kt")
public void testDontAddMarginWhenItIsUnusedWithEmptyPrevious() throws Exception {
runTest("testData/editor/enterHandler/multilineString/spaces/DontAddMarginWhenItIsUnusedWithEmptyPrevious.after.kt");
}
@TestMetadata("DontAddTrimCallWhenAlreadyMultiline.after.kt")
public void testDontAddTrimCallWhenAlreadyMultiline() throws Exception {
runTest("testData/editor/enterHandler/multilineString/spaces/DontAddTrimCallWhenAlreadyMultiline.after.kt");
}
@TestMetadata("DontAddTrimCallWhenAlreadyMultilineFirstLine.after.kt")
public void testDontAddTrimCallWhenAlreadyMultilineFirstLine() throws Exception {
runTest("testData/editor/enterHandler/multilineString/spaces/DontAddTrimCallWhenAlreadyMultilineFirstLine.after.kt");
}
@TestMetadata("DontInsertTrimMargin1.after.kt")
public void testDontInsertTrimMargin1() throws Exception {
runTest("testData/editor/enterHandler/multilineString/spaces/DontInsertTrimMargin1.after.kt");
}
@TestMetadata("DontInsertTrimMargin2.after.kt")
public void testDontInsertTrimMargin2() throws Exception {
runTest("testData/editor/enterHandler/multilineString/spaces/DontInsertTrimMargin2.after.kt");
}
@TestMetadata("DontInsertTrimMargin3.after.kt")
public void testDontInsertTrimMargin3() throws Exception {
runTest("testData/editor/enterHandler/multilineString/spaces/DontInsertTrimMargin3.after.kt");
}
@TestMetadata("DontInsertTrimMargin4.after.kt")
public void testDontInsertTrimMargin4() throws Exception {
runTest("testData/editor/enterHandler/multilineString/spaces/DontInsertTrimMargin4.after.kt");
}
@TestMetadata("EnterAfterOpenningBrace.after.kt")
public void testEnterAfterOpenningBrace() throws Exception {
runTest("testData/editor/enterHandler/multilineString/spaces/EnterAfterOpenningBrace.after.kt");
}
@TestMetadata("EnterBeforeLongEntryOneLine.after.kt")
public void testEnterBeforeLongEntryOneLine() throws Exception {
runTest("testData/editor/enterHandler/multilineString/spaces/EnterBeforeLongEntryOneLine.after.kt");
}
@TestMetadata("EnterBeforeMarginChar.after.kt")
public void testEnterBeforeMarginChar() throws Exception {
runTest("testData/editor/enterHandler/multilineString/spaces/EnterBeforeMarginChar.after.kt");
}
@TestMetadata("EnterBeforeShortEntryOneLine.after.kt")
public void testEnterBeforeShortEntryOneLine() throws Exception {
runTest("testData/editor/enterHandler/multilineString/spaces/EnterBeforeShortEntryOneLine.after.kt");
}
@TestMetadata("EnterInInfixMargin.after.kt")
public void testEnterInInfixMargin() throws Exception {
runTest("testData/editor/enterHandler/multilineString/spaces/EnterInInfixMargin.after.kt");
}
@TestMetadata("EnterInInjectedFragment.after.kt")
public void testEnterInInjectedFragment() throws Exception {
runTest("testData/editor/enterHandler/multilineString/spaces/EnterInInjectedFragment.after.kt");
}
@TestMetadata("EnterInLineWithMarginOnNotMargedLine.after.kt")
public void testEnterInLineWithMarginOnNotMargedLine() throws Exception {
runTest("testData/editor/enterHandler/multilineString/spaces/EnterInLineWithMarginOnNotMargedLine.after.kt");
}
@TestMetadata("EnterInMethodCallMargin.after.kt")
public void testEnterInMethodCallMargin() throws Exception {
runTest("testData/editor/enterHandler/multilineString/spaces/EnterInMethodCallMargin.after.kt");
}
@TestMetadata("EnterInOneLineAfterSpaces.after.kt")
public void testEnterInOneLineAfterSpaces() throws Exception {
runTest("testData/editor/enterHandler/multilineString/spaces/EnterInOneLineAfterSpaces.after.kt");
}
@TestMetadata("EnterInTwoLinesNoMarginCall.after.kt")
public void testEnterInTwoLinesNoMarginCall() throws Exception {
runTest("testData/editor/enterHandler/multilineString/spaces/EnterInTwoLinesNoMarginCall.after.kt");
}
@TestMetadata("EnterInsideBraces.after.kt")
public void testEnterInsideBraces() throws Exception {
runTest("testData/editor/enterHandler/multilineString/spaces/EnterInsideBraces.after.kt");
}
@TestMetadata("EnterInsideBraces1.after.kt")
public void testEnterInsideBraces1() throws Exception {
runTest("testData/editor/enterHandler/multilineString/spaces/EnterInsideBraces1.after.kt");
}
@TestMetadata("EnterInsideBraces2.after.kt")
public void testEnterInsideBraces2() throws Exception {
runTest("testData/editor/enterHandler/multilineString/spaces/EnterInsideBraces2.after.kt");
}
@TestMetadata("EnterInsideTextMargin.after.kt")
public void testEnterInsideTextMargin() throws Exception {
runTest("testData/editor/enterHandler/multilineString/spaces/EnterInsideTextMargin.after.kt");
}
@TestMetadata("EnterMLSimpleMargin.after.kt")
public void testEnterMLSimpleMargin() throws Exception {
runTest("testData/editor/enterHandler/multilineString/spaces/EnterMLSimpleMargin.after.kt");
}
@TestMetadata("EnterMLStartOnSameLineMargin.after.kt")
public void testEnterMLStartOnSameLineMargin() throws Exception {
runTest("testData/editor/enterHandler/multilineString/spaces/EnterMLStartOnSameLineMargin.after.kt");
}
@TestMetadata("EnterOnFirstLineWithPresentTrimMargin.after.kt")
public void testEnterOnFirstLineWithPresentTrimMargin() throws Exception {
runTest("testData/editor/enterHandler/multilineString/spaces/EnterOnFirstLineWithPresentTrimMargin.after.kt");
}
@TestMetadata("EnterOnFirstLineWithPresentTrimMarginAndLine.after.kt")
public void testEnterOnFirstLineWithPresentTrimMarginAndLine() throws Exception {
runTest("testData/editor/enterHandler/multilineString/spaces/EnterOnFirstLineWithPresentTrimMarginAndLine.after.kt");
}
@TestMetadata("EnterOnFirstNonEmptyLineWithPresentTrimMargin.after.kt")
public void testEnterOnFirstNonEmptyLineWithPresentTrimMargin() throws Exception {
runTest("testData/editor/enterHandler/multilineString/spaces/EnterOnFirstNonEmptyLineWithPresentTrimMargin.after.kt");
}
@TestMetadata("EnterOnNewLine.after.kt")
public void testEnterOnNewLine() throws Exception {
runTest("testData/editor/enterHandler/multilineString/spaces/EnterOnNewLine.after.kt");
}
@TestMetadata("EnterSimple.after.kt")
public void testEnterSimple() throws Exception {
runTest("testData/editor/enterHandler/multilineString/spaces/EnterSimple.after.kt");
}
@TestMetadata("EnterWithTextMargin.after.kt")
public void testEnterWithTextMargin() throws Exception {
runTest("testData/editor/enterHandler/multilineString/spaces/EnterWithTextMargin.after.kt");
}
@TestMetadata("EnterWithTextOnNewLineMargin.after.kt")
public void testEnterWithTextOnNewLineMargin() throws Exception {
runTest("testData/editor/enterHandler/multilineString/spaces/EnterWithTextOnNewLineMargin.after.kt");
}
@TestMetadata("InsertCustomMargin.after.kt")
public void testInsertCustomMargin() throws Exception {
runTest("testData/editor/enterHandler/multilineString/spaces/InsertCustomMargin.after.kt");
}
@TestMetadata("InsertCustomMarginInLineStart.after.kt")
public void testInsertCustomMarginInLineStart() throws Exception {
runTest("testData/editor/enterHandler/multilineString/spaces/InsertCustomMarginInLineStart.after.kt");
}
@TestMetadata("InsertDefaultMargin.after.kt")
public void testInsertDefaultMargin() throws Exception {
runTest("testData/editor/enterHandler/multilineString/spaces/InsertDefaultMargin.after.kt");
}
@TestMetadata("NoTrimIndentInAnnotations.after.kt")
public void testNoTrimIndentInAnnotations() throws Exception {
runTest("testData/editor/enterHandler/multilineString/spaces/NoTrimIndentInAnnotations.after.kt");
}
@TestMetadata("NoTrimIndentInConst.after.kt")
public void testNoTrimIndentInConst() throws Exception {
runTest("testData/editor/enterHandler/multilineString/spaces/NoTrimIndentInConst.after.kt");
}
@TestMetadata("RestoreIndentFromEmptyLine.after.kt")
public void testRestoreIndentFromEmptyLine() throws Exception {
runTest("testData/editor/enterHandler/multilineString/spaces/RestoreIndentFromEmptyLine.after.kt");
}
}
@RunWith(JUnit3RunnerWithInners.class)
@TestMetadata("testData/editor/enterHandler/multilineString/withTabs")
public abstract static class WithTabs extends AbstractEnterHandlerTest {
@RunWith(JUnit3RunnerWithInners.class)
@TestMetadata("testData/editor/enterHandler/multilineString/withTabs/tabs2")
public static class Tabs2 extends AbstractEnterHandlerTest {
private void runTest(String testDataFilePath) throws Exception {
KotlinTestUtils.runTest(this::doNewlineTest, this, testDataFilePath);
}
@TestMetadata("DontInsertTrimMarginCall.after.kt")
public void testDontInsertTrimMarginCall() throws Exception {
runTest("testData/editor/enterHandler/multilineString/withTabs/tabs2/DontInsertTrimMarginCall.after.kt");
}
@TestMetadata("EnterInMethodCallMargin.after.kt")
public void testEnterInMethodCallMargin() throws Exception {
runTest("testData/editor/enterHandler/multilineString/withTabs/tabs2/EnterInMethodCallMargin.after.kt");
}
@TestMetadata("EnterInTwoLinesNoMarginCall.after.kt")
public void testEnterInTwoLinesNoMarginCall() throws Exception {
runTest("testData/editor/enterHandler/multilineString/withTabs/tabs2/EnterInTwoLinesNoMarginCall.after.kt");
}
@TestMetadata("EnterInsideBraces.after.kt")
public void testEnterInsideBraces() throws Exception {
runTest("testData/editor/enterHandler/multilineString/withTabs/tabs2/EnterInsideBraces.after.kt");
}
@TestMetadata("EnterInsideText.after.kt")
public void testEnterInsideText() throws Exception {
runTest("testData/editor/enterHandler/multilineString/withTabs/tabs2/EnterInsideText.after.kt");
}
@TestMetadata("EnterMLSimpleMargin.after.kt")
public void testEnterMLSimpleMargin() throws Exception {
runTest("testData/editor/enterHandler/multilineString/withTabs/tabs2/EnterMLSimpleMargin.after.kt");
}
@TestMetadata("EnterMLStartOnSameLineMargin.after.kt")
public void testEnterMLStartOnSameLineMargin() throws Exception {
runTest("testData/editor/enterHandler/multilineString/withTabs/tabs2/EnterMLStartOnSameLineMargin.after.kt");
}
@TestMetadata("EnterOnNewLineMargin.after.kt")
public void testEnterOnNewLineMargin() throws Exception {
runTest("testData/editor/enterHandler/multilineString/withTabs/tabs2/EnterOnNewLineMargin.after.kt");
}
@TestMetadata("EnterSimpleMargin.after.kt")
public void testEnterSimpleMargin() throws Exception {
runTest("testData/editor/enterHandler/multilineString/withTabs/tabs2/EnterSimpleMargin.after.kt");
}
@TestMetadata("EnterWithTextMargin.after.kt")
public void testEnterWithTextMargin() throws Exception {
runTest("testData/editor/enterHandler/multilineString/withTabs/tabs2/EnterWithTextMargin.after.kt");
}
@TestMetadata("EnterWithTextOnNewLineMargin.after.kt")
public void testEnterWithTextOnNewLineMargin() throws Exception {
runTest("testData/editor/enterHandler/multilineString/withTabs/tabs2/EnterWithTextOnNewLineMargin.after.kt");
}
}
@RunWith(JUnit3RunnerWithInners.class)
@TestMetadata("testData/editor/enterHandler/multilineString/withTabs/tabs4")
public static class Tabs4 extends AbstractEnterHandlerTest {
private void runTest(String testDataFilePath) throws Exception {
KotlinTestUtils.runTest(this::doNewlineTest, this, testDataFilePath);
}
@TestMetadata("DontInsertTrimMarginCall.after.kt")
public void testDontInsertTrimMarginCall() throws Exception {
runTest("testData/editor/enterHandler/multilineString/withTabs/tabs4/DontInsertTrimMarginCall.after.kt");
}
@TestMetadata("EnterInMethodCallMargin.after.kt")
public void testEnterInMethodCallMargin() throws Exception {
runTest("testData/editor/enterHandler/multilineString/withTabs/tabs4/EnterInMethodCallMargin.after.kt");
}
@TestMetadata("EnterInsideBraces.after.kt")
public void testEnterInsideBraces() throws Exception {
runTest("testData/editor/enterHandler/multilineString/withTabs/tabs4/EnterInsideBraces.after.kt");
}
@TestMetadata("EnterInsideText.after.kt")
public void testEnterInsideText() throws Exception {
runTest("testData/editor/enterHandler/multilineString/withTabs/tabs4/EnterInsideText.after.kt");
}
@TestMetadata("EnterMLSimpleMargin.after.kt")
public void testEnterMLSimpleMargin() throws Exception {
runTest("testData/editor/enterHandler/multilineString/withTabs/tabs4/EnterMLSimpleMargin.after.kt");
}
@TestMetadata("EnterMLStartOnSameLineMargin.after.kt")
public void testEnterMLStartOnSameLineMargin() throws Exception {
runTest("testData/editor/enterHandler/multilineString/withTabs/tabs4/EnterMLStartOnSameLineMargin.after.kt");
}
@TestMetadata("EnterOnNewLineMargin.after.kt")
public void testEnterOnNewLineMargin() throws Exception {
runTest("testData/editor/enterHandler/multilineString/withTabs/tabs4/EnterOnNewLineMargin.after.kt");
}
@TestMetadata("EnterSimpleMargin.after.kt")
public void testEnterSimpleMargin() throws Exception {
runTest("testData/editor/enterHandler/multilineString/withTabs/tabs4/EnterSimpleMargin.after.kt");
}
@TestMetadata("EnterWithTabsAfterMarginChar.after.kt")
public void testEnterWithTabsAfterMarginChar() throws Exception {
runTest("testData/editor/enterHandler/multilineString/withTabs/tabs4/EnterWithTabsAfterMarginChar.after.kt");
}
@TestMetadata("EnterWithTextMargin.after.kt")
public void testEnterWithTextMargin() throws Exception {
runTest("testData/editor/enterHandler/multilineString/withTabs/tabs4/EnterWithTextMargin.after.kt");
}
@TestMetadata("EnterWithTextOnNewLineMargin.after.kt")
public void testEnterWithTextOnNewLineMargin() throws Exception {
runTest("testData/editor/enterHandler/multilineString/withTabs/tabs4/EnterWithTextOnNewLineMargin.after.kt");
}
}
}
}
@RunWith(JUnit3RunnerWithInners.class)
@TestMetadata("testData/editor/enterHandler/script")
public static class Script extends AbstractEnterHandlerTest {
private void runTest(String testDataFilePath) throws Exception {
KotlinTestUtils.runTest(this::doNewlineTest, this, testDataFilePath);
}
@TestMetadata("ScriptAfterClosingBrace.after.kts")
public void testScriptAfterClosingBrace() throws Exception {
runTest("testData/editor/enterHandler/script/ScriptAfterClosingBrace.after.kts");
}
@TestMetadata("ScriptAfterExpression.after.kts")
public void testScriptAfterExpression() throws Exception {
runTest("testData/editor/enterHandler/script/ScriptAfterExpression.after.kts");
}
@TestMetadata("ScriptAfterFun.after.kts")
public void testScriptAfterFun() throws Exception {
runTest("testData/editor/enterHandler/script/ScriptAfterFun.after.kts");
}
@TestMetadata("ScriptAfterImport.after.kts")
public void testScriptAfterImport() throws Exception {
runTest("testData/editor/enterHandler/script/ScriptAfterImport.after.kts");
}
@TestMetadata("ScriptBetweenFunctionCalls.after.kts")
public void testScriptBetweenFunctionCalls() throws Exception {
runTest("testData/editor/enterHandler/script/ScriptBetweenFunctionCalls.after.kts");
}
@TestMetadata("ScriptInsideFun.after.kts")
public void testScriptInsideFun() throws Exception {
runTest("testData/editor/enterHandler/script/ScriptInsideFun.after.kts");
}
}
@RunWith(JUnit3RunnerWithInners.class)
@TestMetadata("testData/editor/enterHandler/templates")
public static class Templates extends AbstractEnterHandlerTest {
private void runTest(String testDataFilePath) throws Exception {
KotlinTestUtils.runTest(this::doNewlineTest, this, testDataFilePath);
}
@TestMetadata("LargeFileWithStringTemplate.after.kt")
public void testLargeFileWithStringTemplate() throws Exception {
runTest("testData/editor/enterHandler/templates/LargeFileWithStringTemplate.after.kt");
}
@TestMetadata("TemplateEntryClose.after.kt")
public void testTemplateEntryClose() throws Exception {
runTest("testData/editor/enterHandler/templates/TemplateEntryClose.after.kt");
}
@TestMetadata("TemplateEntryClose2.after.kt")
public void testTemplateEntryClose2() throws Exception {
runTest("testData/editor/enterHandler/templates/TemplateEntryClose2.after.kt");
}
@TestMetadata("TemplateEntryClose3.after.kt")
public void testTemplateEntryClose3() throws Exception {
runTest("testData/editor/enterHandler/templates/TemplateEntryClose3.after.kt");
}
@TestMetadata("TemplateEntryClose4.after.kt")
public void testTemplateEntryClose4() throws Exception {
runTest("testData/editor/enterHandler/templates/TemplateEntryClose4.after.kt");
}
@TestMetadata("TemplateEntryClose5.after.kt")
public void testTemplateEntryClose5() throws Exception {
runTest("testData/editor/enterHandler/templates/TemplateEntryClose5.after.kt");
}
@TestMetadata("TemplateEntryClose6.after.kt")
public void testTemplateEntryClose6() throws Exception {
runTest("testData/editor/enterHandler/templates/TemplateEntryClose6.after.kt");
}
@TestMetadata("TemplateEntryClose7.after.kt")
public void testTemplateEntryClose7() throws Exception {
runTest("testData/editor/enterHandler/templates/TemplateEntryClose7.after.kt");
}
@TestMetadata("TemplateEntryCloseInMultilineString.after.kt")
public void testTemplateEntryCloseInMultilineString() throws Exception {
runTest("testData/editor/enterHandler/templates/TemplateEntryCloseInMultilineString.after.kt");
}
@TestMetadata("TemplateEntryCloseInMultilineString2.after.kt")
public void testTemplateEntryCloseInMultilineString2() throws Exception {
runTest("testData/editor/enterHandler/templates/TemplateEntryCloseInMultilineString2.after.kt");
}
@TestMetadata("TemplateEntryCloseInMultilineString3.after.kt")
public void testTemplateEntryCloseInMultilineString3() throws Exception {
runTest("testData/editor/enterHandler/templates/TemplateEntryCloseInMultilineString3.after.kt");
}
@TestMetadata("TemplateEntryOpen.after.kt")
public void testTemplateEntryOpen() throws Exception {
runTest("testData/editor/enterHandler/templates/TemplateEntryOpen.after.kt");
}
@TestMetadata("TemplateEntryOpen2.after.kt")
public void testTemplateEntryOpen2() throws Exception {
runTest("testData/editor/enterHandler/templates/TemplateEntryOpen2.after.kt");
}
@TestMetadata("TemplateEntryOpenInMultilineString.after.kt")
public void testTemplateEntryOpenInMultilineString() throws Exception {
runTest("testData/editor/enterHandler/templates/TemplateEntryOpenInMultilineString.after.kt");
}
@TestMetadata("TemplateEntryOpenInMultilineString2.after.kt")
public void testTemplateEntryOpenInMultilineString2() throws Exception {
runTest("testData/editor/enterHandler/templates/TemplateEntryOpenInMultilineString2.after.kt");
}
@TestMetadata("TemplateEntryOpenInMultilineString3.after.kt")
public void testTemplateEntryOpenInMultilineString3() throws Exception {
runTest("testData/editor/enterHandler/templates/TemplateEntryOpenInMultilineString3.after.kt");
}
@TestMetadata("TemplateEntryOpenWithComment.after.kt")
public void testTemplateEntryOpenWithComment() throws Exception {
runTest("testData/editor/enterHandler/templates/TemplateEntryOpenWithComment.after.kt");
}
@TestMetadata("TemplateEntryOpenWithComment2.after.kt")
public void testTemplateEntryOpenWithComment2() throws Exception {
runTest("testData/editor/enterHandler/templates/TemplateEntryOpenWithComment2.after.kt");
}
@TestMetadata("TemplateEntryOpenWithoutContent.after.kt")
public void testTemplateEntryOpenWithoutContent() throws Exception {
runTest("testData/editor/enterHandler/templates/TemplateEntryOpenWithoutContent.after.kt");
}
@TestMetadata("TemplateEntryOpenWithoutContent2.after.kt")
public void testTemplateEntryOpenWithoutContent2() throws Exception {
runTest("testData/editor/enterHandler/templates/TemplateEntryOpenWithoutContent2.after.kt");
}
@TestMetadata("TemplateEntryOpenWithoutContent3.after.kt")
public void testTemplateEntryOpenWithoutContent3() throws Exception {
runTest("testData/editor/enterHandler/templates/TemplateEntryOpenWithoutContent3.after.kt");
}
@TestMetadata("TemplateEntryOpenWithoutContent4.after.kt")
public void testTemplateEntryOpenWithoutContent4() throws Exception {
runTest("testData/editor/enterHandler/templates/TemplateEntryOpenWithoutContent4.after.kt");
}
@TestMetadata("TemplateEntryOpenWithoutContent5.after.kt")
public void testTemplateEntryOpenWithoutContent5() throws Exception {
runTest("testData/editor/enterHandler/templates/TemplateEntryOpenWithoutContent5.after.kt");
}
}
@RunWith(JUnit3RunnerWithInners.class)
@TestMetadata("testData/editor/enterHandler")
public static class Uncategorized extends AbstractEnterHandlerTest {
private void runTest(String testDataFilePath) throws Exception {
KotlinTestUtils.runTest(this::doNewlineTest, this, testDataFilePath);
}
@TestMetadata("AfterCatch.after.kt")
public void testAfterCatch() throws Exception {
runTest("testData/editor/enterHandler/AfterCatch.after.kt");
}
@TestMetadata("AfterClassNameBeforeFun.after.kt")
public void testAfterClassNameBeforeFun() throws Exception {
runTest("testData/editor/enterHandler/AfterClassNameBeforeFun.after.kt");
}
@TestMetadata("AfterExtensionPropertyGetter.after.kt")
public void testAfterExtensionPropertyGetter() throws Exception {
runTest("testData/editor/enterHandler/AfterExtensionPropertyGetter.after.kt");
}
@TestMetadata("AfterExtensionPropertySetter.after.kt")
public void testAfterExtensionPropertySetter() throws Exception {
runTest("testData/editor/enterHandler/AfterExtensionPropertySetter.after.kt");
}
@TestMetadata("AfterFinally.after.kt")
public void testAfterFinally() throws Exception {
runTest("testData/editor/enterHandler/AfterFinally.after.kt");
}
@TestMetadata("AfterImport.after.kt")
public void testAfterImport() throws Exception {
runTest("testData/editor/enterHandler/AfterImport.after.kt");
}
@TestMetadata("AfterPropertyGetter.after.kt")
public void testAfterPropertyGetter() throws Exception {
runTest("testData/editor/enterHandler/AfterPropertyGetter.after.kt");
}
@TestMetadata("AfterPropertySetter.after.kt")
public void testAfterPropertySetter() throws Exception {
runTest("testData/editor/enterHandler/AfterPropertySetter.after.kt");
}
@TestMetadata("AfterTry.after.kt")
public void testAfterTry() throws Exception {
runTest("testData/editor/enterHandler/AfterTry.after.kt");
}
@TestMetadata("Annotation.after.kt")
public void testAnnotation() throws Exception {
runTest("testData/editor/enterHandler/Annotation.after.kt");
}
@TestMetadata("AnnotationInDeclaration.after.kt")
public void testAnnotationInDeclaration() throws Exception {
runTest("testData/editor/enterHandler/AnnotationInDeclaration.after.kt");
}
@TestMetadata("ArgumentListNormalIndent.after.kt")
public void testArgumentListNormalIndent() throws Exception {
runTest("testData/editor/enterHandler/ArgumentListNormalIndent.after.kt");
}
@TestMetadata("AutoIndentInWhenClause.after.kt")
public void testAutoIndentInWhenClause() throws Exception {
runTest("testData/editor/enterHandler/AutoIndentInWhenClause.after.kt");
}
@TestMetadata("BeforePropertyGetter.after.kt")
public void testBeforePropertyGetter() throws Exception {
runTest("testData/editor/enterHandler/BeforePropertyGetter.after.kt");
}
@TestMetadata("BeforePropertySetter.after.kt")
public void testBeforePropertySetter() throws Exception {
runTest("testData/editor/enterHandler/BeforePropertySetter.after.kt");
}
@TestMetadata("BlockCommentAfterCatch.after.kt")
public void testBlockCommentAfterCatch() throws Exception {
runTest("testData/editor/enterHandler/BlockCommentAfterCatch.after.kt");
}
@TestMetadata("ConsecutiveCallsAfterDot.after.kt")
public void testConsecutiveCallsAfterDot() throws Exception {
runTest("testData/editor/enterHandler/ConsecutiveCallsAfterDot.after.kt");
}
@TestMetadata("ConsecutiveCallsInSaeCallsMiddle.after.kt")
public void testConsecutiveCallsInSaeCallsMiddle() throws Exception {
runTest("testData/editor/enterHandler/ConsecutiveCallsInSaeCallsMiddle.after.kt");
}
@TestMetadata("ConsecutiveCallsInSafeCallsEnd.after.kt")
public void testConsecutiveCallsInSafeCallsEnd() throws Exception {
runTest("testData/editor/enterHandler/ConsecutiveCallsInSafeCallsEnd.after.kt");
}
@TestMetadata("EnterInFunctionWithExpressionBody.after.kt")
public void testEnterInFunctionWithExpressionBody() throws Exception {
runTest("testData/editor/enterHandler/EnterInFunctionWithExpressionBody.after.kt");
}
@TestMetadata("EnterInMultiDeclaration.after.kt")
public void testEnterInMultiDeclaration() throws Exception {
runTest("testData/editor/enterHandler/EnterInMultiDeclaration.after.kt");
}
@TestMetadata("EnterInVariableDeclaration.after.kt")
public void testEnterInVariableDeclaration() throws Exception {
runTest("testData/editor/enterHandler/EnterInVariableDeclaration.after.kt");
}
@TestMetadata("EoLCommentAfterCatch.after.kt")
public void testEoLCommentAfterCatch() throws Exception {
runTest("testData/editor/enterHandler/EoLCommentAfterCatch.after.kt");
}
@TestMetadata("EoLCommentAfterFor.after.kt")
public void testEoLCommentAfterFor() throws Exception {
runTest("testData/editor/enterHandler/EoLCommentAfterFor.after.kt");
}
@TestMetadata("EoLCommentAfterIf.after.kt")
public void testEoLCommentAfterIf() throws Exception {
runTest("testData/editor/enterHandler/EoLCommentAfterIf.after.kt");
}
@TestMetadata("FunctionBlock.after.kt")
public void testFunctionBlock() throws Exception {
runTest("testData/editor/enterHandler/FunctionBlock.after.kt");
}
@TestMetadata("HigherOrderFunction.after.kt")
public void testHigherOrderFunction() throws Exception {
runTest("testData/editor/enterHandler/HigherOrderFunction.after.kt");
}
@TestMetadata("HigherOrderFunction2.after.kt")
public void testHigherOrderFunction2() throws Exception {
runTest("testData/editor/enterHandler/HigherOrderFunction2.after.kt");
}
@TestMetadata("HigherOrderFunction3.after.kt")
public void testHigherOrderFunction3() throws Exception {
runTest("testData/editor/enterHandler/HigherOrderFunction3.after.kt");
}
@TestMetadata("InDelegationListAfterColon.after.kt")
public void testInDelegationListAfterColon() throws Exception {
runTest("testData/editor/enterHandler/InDelegationListAfterColon.after.kt");
}
@TestMetadata("InDelegationListAfterComma.after.kt")
public void testInDelegationListAfterComma() throws Exception {
runTest("testData/editor/enterHandler/InDelegationListAfterComma.after.kt");
}
@TestMetadata("InDelegationListNotEmpty.after.kt")
public void testInDelegationListNotEmpty() throws Exception {
runTest("testData/editor/enterHandler/InDelegationListNotEmpty.after.kt");
}
@TestMetadata("InElseBlockBeforeParenthesis.after.kt")
public void testInElseBlockBeforeParenthesis() throws Exception {
runTest("testData/editor/enterHandler/InElseBlockBeforeParenthesis.after.kt");
}
@TestMetadata("InEnumAfterSemicolon.after.kt")
public void testInEnumAfterSemicolon() throws Exception {
runTest("testData/editor/enterHandler/InEnumAfterSemicolon.after.kt");
}
@TestMetadata("InEnumInitializerListAfterComma.after.kt")
public void testInEnumInitializerListAfterComma() throws Exception {
runTest("testData/editor/enterHandler/InEnumInitializerListAfterComma.after.kt");
}
@TestMetadata("InEnumInitializerListNotEmpty.after.kt")
public void testInEnumInitializerListNotEmpty() throws Exception {
runTest("testData/editor/enterHandler/InEnumInitializerListNotEmpty.after.kt");
}
@TestMetadata("InIfBlockBeforeParenthesis.after.kt")
public void testInIfBlockBeforeParenthesis() throws Exception {
runTest("testData/editor/enterHandler/InIfBlockBeforeParenthesis.after.kt");
}
@TestMetadata("InLabmdaAfterArrow.after.kt")
public void testInLabmdaAfterArrow() throws Exception {
runTest("testData/editor/enterHandler/InLabmdaAfterArrow.after.kt");
}
@TestMetadata("InLambdaAfterArrowWithSpaces.after.kt")
public void testInLambdaAfterArrowWithSpaces() throws Exception {
runTest("testData/editor/enterHandler/InLambdaAfterArrowWithSpaces.after.kt");
}
@TestMetadata("InLambdaBeforeParams.after.kt")
public void testInLambdaBeforeParams() throws Exception {
runTest("testData/editor/enterHandler/InLambdaBeforeParams.after.kt");
}
@TestMetadata("InLambdaInsideChainCallSameLine.after.kt")
public void testInLambdaInsideChainCallSameLine() throws Exception {
runTest("testData/editor/enterHandler/InLambdaInsideChainCallSameLine.after.kt");
}
@TestMetadata("InLambdaInsideChainCallSameLineWithSpaces.after.kt")
public void testInLambdaInsideChainCallSameLineWithSpaces() throws Exception {
runTest("testData/editor/enterHandler/InLambdaInsideChainCallSameLineWithSpaces.after.kt");
}
@TestMetadata("InLambdaInsideChainCallWithNewLine.after.kt")
public void testInLambdaInsideChainCallWithNewLine() throws Exception {
runTest("testData/editor/enterHandler/InLambdaInsideChainCallWithNewLine.after.kt");
}
@TestMetadata("InLambdaInsideChainCallWithNewLineWithSpaces.after.kt")
public void testInLambdaInsideChainCallWithNewLineWithSpaces() throws Exception {
runTest("testData/editor/enterHandler/InLambdaInsideChainCallWithNewLineWithSpaces.after.kt");
}
@TestMetadata("InMultilineLambdaAfterArrow.after.kt")
public void testInMultilineLambdaAfterArrow() throws Exception {
runTest("testData/editor/enterHandler/InMultilineLambdaAfterArrow.after.kt");
}
@TestMetadata("IndentBeforeElseWithBlock.after.kt")
public void testIndentBeforeElseWithBlock() throws Exception {
runTest("testData/editor/enterHandler/IndentBeforeElseWithBlock.after.kt");
}
@TestMetadata("IndentBeforeElseWithoutBlock.after.kt")
public void testIndentBeforeElseWithoutBlock() throws Exception {
runTest("testData/editor/enterHandler/IndentBeforeElseWithoutBlock.after.kt");
}
@TestMetadata("IndentNotFinishedVariableEndAfterEquals.after.kt")
public void testIndentNotFinishedVariableEndAfterEquals() throws Exception {
runTest("testData/editor/enterHandler/IndentNotFinishedVariableEndAfterEquals.after.kt");
}
@TestMetadata("IndentOnFinishedVariableEndAfterEquals.after.kt")
public void testIndentOnFinishedVariableEndAfterEquals() throws Exception {
runTest("testData/editor/enterHandler/IndentOnFinishedVariableEndAfterEquals.after.kt");
}
@TestMetadata("KT20783.after.kt")
public void testKT20783() throws Exception {
runTest("testData/editor/enterHandler/KT20783.after.kt");
}
@TestMetadata("LambdaInArguments.after.kt")
public void testLambdaInArguments() throws Exception {
runTest("testData/editor/enterHandler/LambdaInArguments.after.kt");
}
@TestMetadata("LambdaInArguments2.after.kt")
public void testLambdaInArguments2() throws Exception {
runTest("testData/editor/enterHandler/LambdaInArguments2.after.kt");
}
@TestMetadata("LargeFile.after.kt")
public void testLargeFile() throws Exception {
runTest("testData/editor/enterHandler/LargeFile.after.kt");
}
@TestMetadata("LiteralExpression.after.kt")
public void testLiteralExpression() throws Exception {
runTest("testData/editor/enterHandler/LiteralExpression.after.kt");
}
@TestMetadata("LiteralExpression2.after.kt")
public void testLiteralExpression2() throws Exception {
runTest("testData/editor/enterHandler/LiteralExpression2.after.kt");
}
@TestMetadata("LiteralExpression3.after.kt")
public void testLiteralExpression3() throws Exception {
runTest("testData/editor/enterHandler/LiteralExpression3.after.kt");
}
@TestMetadata("ModifierListInUnfinishedDeclaration.after.kt")
public void testModifierListInUnfinishedDeclaration() throws Exception {
runTest("testData/editor/enterHandler/ModifierListInUnfinishedDeclaration.after.kt");
}
@TestMetadata("NotFirstParameter.after.kt")
public void testNotFirstParameter() throws Exception {
runTest("testData/editor/enterHandler/NotFirstParameter.after.kt");
}
@TestMetadata("ReindentOnUnmatchedBrace.after.kt")
public void testReindentOnUnmatchedBrace() throws Exception {
runTest("testData/editor/enterHandler/ReindentOnUnmatchedBrace.after.kt");
}
@TestMetadata("ReturnContinue.after.kt")
public void testReturnContinue() throws Exception {
runTest("testData/editor/enterHandler/ReturnContinue.after.kt");
}
@TestMetadata("Semicolon.after.kt")
public void testSemicolon() throws Exception {
runTest("testData/editor/enterHandler/Semicolon.after.kt");
}
@TestMetadata("Semicolon2.after.kt")
public void testSemicolon2() throws Exception {
runTest("testData/editor/enterHandler/Semicolon2.after.kt");
}
@TestMetadata("SettingAlignMultilineParametersInCalls.after.kt")
public void testSettingAlignMultilineParametersInCalls() throws Exception {
runTest("testData/editor/enterHandler/SettingAlignMultilineParametersInCalls.after.kt");
}
@TestMetadata("SmartEnterBetweenOpeningAndClosingBrackets.after.kt")
public void testSmartEnterBetweenOpeningAndClosingBrackets() throws Exception {
runTest("testData/editor/enterHandler/SmartEnterBetweenOpeningAndClosingBrackets.after.kt");
}
@TestMetadata("SmartEnterBetweenOpeningAndClosingBracketsWithInvertedAlignWhenMultiline.after.kt")
public void testSmartEnterBetweenOpeningAndClosingBracketsWithInvertedAlignWhenMultiline() throws Exception {
runTest("testData/editor/enterHandler/SmartEnterBetweenOpeningAndClosingBracketsWithInvertedAlignWhenMultiline.after.kt");
}
@TestMetadata("SmartEnterWithTabsInMethodParameters.after.kt")
public void testSmartEnterWithTabsInMethodParameters() throws Exception {
runTest("testData/editor/enterHandler/SmartEnterWithTabsInMethodParameters.after.kt");
}
@TestMetadata("SmartEnterWithTabsOnConstructorParameters.after.kt")
public void testSmartEnterWithTabsOnConstructorParameters() throws Exception {
runTest("testData/editor/enterHandler/SmartEnterWithTabsOnConstructorParameters.after.kt");
}
@TestMetadata("SmartEnterWithTabsOnConstructorParametersWithInvertedAlignWhenMultiline.after.kt")
public void testSmartEnterWithTabsOnConstructorParametersWithInvertedAlignWhenMultiline() throws Exception {
runTest("testData/editor/enterHandler/SmartEnterWithTabsOnConstructorParametersWithInvertedAlignWhenMultiline.after.kt");
}
@TestMetadata("SmartEnterWithTrailingCommaAndWhitespaceBeforeLineBreak.after.kt")
public void testSmartEnterWithTrailingCommaAndWhitespaceBeforeLineBreak() throws Exception {
runTest("testData/editor/enterHandler/SmartEnterWithTrailingCommaAndWhitespaceBeforeLineBreak.after.kt");
}
@TestMetadata("SmartEnterWithoutLineBreakBeforeClosingBracketInMethodParameters.after.kt")
public void testSmartEnterWithoutLineBreakBeforeClosingBracketInMethodParameters() throws Exception {
runTest("testData/editor/enterHandler/SmartEnterWithoutLineBreakBeforeClosingBracketInMethodParameters.after.kt");
}
@TestMetadata("SplitStringByEnter.after.kt")
public void testSplitStringByEnter() throws Exception {
runTest("testData/editor/enterHandler/SplitStringByEnter.after.kt");
}
@TestMetadata("SplitStringByEnterAddParentheses.after.kt")
public void testSplitStringByEnterAddParentheses() throws Exception {
runTest("testData/editor/enterHandler/SplitStringByEnterAddParentheses.after.kt");
}
@TestMetadata("SplitStringByEnterBeforeEscapeSequence.after.kt")
public void testSplitStringByEnterBeforeEscapeSequence() throws Exception {
runTest("testData/editor/enterHandler/SplitStringByEnterBeforeEscapeSequence.after.kt");
}
@TestMetadata("SplitStringByEnterBeforeSubstitution.after.kt")
public void testSplitStringByEnterBeforeSubstitution() throws Exception {
runTest("testData/editor/enterHandler/SplitStringByEnterBeforeSubstitution.after.kt");
}
@TestMetadata("SplitStringByEnterEmpty.after.kt")
public void testSplitStringByEnterEmpty() throws Exception {
runTest("testData/editor/enterHandler/SplitStringByEnterEmpty.after.kt");
}
@TestMetadata("SplitStringByEnterExistingParentheses.after.kt")
public void testSplitStringByEnterExistingParentheses() throws Exception {
runTest("testData/editor/enterHandler/SplitStringByEnterExistingParentheses.after.kt");
}
}
}
@RunWith(JUnit3RunnerWithInners.class)
@TestMetadata("testData/editor/enterHandler")
public abstract static class InvertedSettings extends AbstractEnterHandlerTest {
@RunWith(JUnit3RunnerWithInners.class)
@TestMetadata("testData/editor/enterHandler/beforeDot")
public static class BeforeDot extends AbstractEnterHandlerTest {
private void runTest(String testDataFilePath) throws Exception {
KotlinTestUtils.runTest(this::doNewlineTestWithInvert, this, testDataFilePath);
}
@TestMetadata("ArrayAccessInFirstPosition.after.inv.kt")
public void testArrayAccessInFirstPosition() throws Exception {
runTest("testData/editor/enterHandler/beforeDot/ArrayAccessInFirstPosition.after.inv.kt");
}
@TestMetadata("ArrayAccessInNonFirstPositionOnFirstLine.after.inv.kt")
public void testArrayAccessInNonFirstPositionOnFirstLine() throws Exception {
runTest("testData/editor/enterHandler/beforeDot/ArrayAccessInNonFirstPositionOnFirstLine.after.inv.kt");
}
@TestMetadata("ArrayAccessInNonFirstPositionOnNonFirstLine.after.inv.kt")
public void testArrayAccessInNonFirstPositionOnNonFirstLine() throws Exception {
runTest("testData/editor/enterHandler/beforeDot/ArrayAccessInNonFirstPositionOnNonFirstLine.after.inv.kt");
}
@TestMetadata("ArrayAccessWithCommentInFirstPosition.after.inv.kt")
public void testArrayAccessWithCommentInFirstPosition() throws Exception {
runTest("testData/editor/enterHandler/beforeDot/ArrayAccessWithCommentInFirstPosition.after.inv.kt");
}
@TestMetadata("ArrayAccessWithMultilineComment2InFirstPosition.after.inv.kt")
public void testArrayAccessWithMultilineComment2InFirstPosition() throws Exception {
runTest("testData/editor/enterHandler/beforeDot/ArrayAccessWithMultilineComment2InFirstPosition.after.inv.kt");
}
@TestMetadata("ArrayAccessWithMultilineCommentInFirstPosition.after.inv.kt")
public void testArrayAccessWithMultilineCommentInFirstPosition() throws Exception {
runTest("testData/editor/enterHandler/beforeDot/ArrayAccessWithMultilineCommentInFirstPosition.after.inv.kt");
}
@TestMetadata("ArrayAccessWithSeveralArgumentsInFirstPosition.after.inv.kt")
public void testArrayAccessWithSeveralArgumentsInFirstPosition() throws Exception {
runTest("testData/editor/enterHandler/beforeDot/ArrayAccessWithSeveralArgumentsInFirstPosition.after.inv.kt");
}
@TestMetadata("CallInFirstPosition.after.inv.kt")
public void testCallInFirstPosition() throws Exception {
runTest("testData/editor/enterHandler/beforeDot/CallInFirstPosition.after.inv.kt");
}
@TestMetadata("CallInFirstPositionAfterOpenParenthesis.after.inv.kt")
public void testCallInFirstPositionAfterOpenParenthesis() throws Exception {
runTest("testData/editor/enterHandler/beforeDot/CallInFirstPositionAfterOpenParenthesis.after.inv.kt");
}
@TestMetadata("CallInFirstPositionAfterReturn.after.inv.kt")
public void testCallInFirstPositionAfterReturn() throws Exception {
runTest("testData/editor/enterHandler/beforeDot/CallInFirstPositionAfterReturn.after.inv.kt");
}
@TestMetadata("CallInNonFirstPositionAfterOpenParenthesis.after.inv.kt")
public void testCallInNonFirstPositionAfterOpenParenthesis() throws Exception {
runTest("testData/editor/enterHandler/beforeDot/CallInNonFirstPositionAfterOpenParenthesis.after.inv.kt");
}
@TestMetadata("CallInNonFirstPositionAfterReturn.after.inv.kt")
public void testCallInNonFirstPositionAfterReturn() throws Exception {
runTest("testData/editor/enterHandler/beforeDot/CallInNonFirstPositionAfterReturn.after.inv.kt");
}
@TestMetadata("CallInNonFirstPositionAfterReturnOnNonFirstLine.after.inv.kt")
public void testCallInNonFirstPositionAfterReturnOnNonFirstLine() throws Exception {
runTest("testData/editor/enterHandler/beforeDot/CallInNonFirstPositionAfterReturnOnNonFirstLine.after.inv.kt");
}
@TestMetadata("CallInNonFirstPositionOnFirstLine.after.inv.kt")
public void testCallInNonFirstPositionOnFirstLine() throws Exception {
runTest("testData/editor/enterHandler/beforeDot/CallInNonFirstPositionOnFirstLine.after.inv.kt");
}
@TestMetadata("CallInNonFirstPositionOnNonFirstLine.after.inv.kt")
public void testCallInNonFirstPositionOnNonFirstLine() throws Exception {
runTest("testData/editor/enterHandler/beforeDot/CallInNonFirstPositionOnNonFirstLine.after.inv.kt");
}
@TestMetadata("CallWithArgumentsInFirstPosition.after.inv.kt")
public void testCallWithArgumentsInFirstPosition() throws Exception {
runTest("testData/editor/enterHandler/beforeDot/CallWithArgumentsInFirstPosition.after.inv.kt");
}
@TestMetadata("CallWithCommentsInFirstPosition.after.inv.kt")
public void testCallWithCommentsInFirstPosition() throws Exception {
runTest("testData/editor/enterHandler/beforeDot/CallWithCommentsInFirstPosition.after.inv.kt");
}
@TestMetadata("CallWithLambdaInFirstPosition.after.inv.kt")
public void testCallWithLambdaInFirstPosition() throws Exception {
runTest("testData/editor/enterHandler/beforeDot/CallWithLambdaInFirstPosition.after.inv.kt");
}
@TestMetadata("CallWithLambdaInNonFirstPositionOnNonFirstLine.after.inv.kt")
public void testCallWithLambdaInNonFirstPositionOnNonFirstLine() throws Exception {
runTest("testData/editor/enterHandler/beforeDot/CallWithLambdaInNonFirstPositionOnNonFirstLine.after.inv.kt");
}
@TestMetadata("CharLiteralInFirstPosition.after.inv.kt")
public void testCharLiteralInFirstPosition() throws Exception {
runTest("testData/editor/enterHandler/beforeDot/CharLiteralInFirstPosition.after.inv.kt");
}
@TestMetadata("CharLiteralInFirstPosition2.after.inv.kt")
public void testCharLiteralInFirstPosition2() throws Exception {
runTest("testData/editor/enterHandler/beforeDot/CharLiteralInFirstPosition2.after.inv.kt");
}
@TestMetadata("FirstPositionOnNewLineInsideCall.after.inv.kt")
public void testFirstPositionOnNewLineInsideCall() throws Exception {
runTest("testData/editor/enterHandler/beforeDot/FirstPositionOnNewLineInsideCall.after.inv.kt");
}
@TestMetadata("FloatLiteralInFirstPosition.after.inv.kt")
public void testFloatLiteralInFirstPosition() throws Exception {
runTest("testData/editor/enterHandler/beforeDot/FloatLiteralInFirstPosition.after.inv.kt");
}
@TestMetadata("FloatLiteralInFirstPosition2.after.inv.kt")
public void testFloatLiteralInFirstPosition2() throws Exception {
runTest("testData/editor/enterHandler/beforeDot/FloatLiteralInFirstPosition2.after.inv.kt");
}
@TestMetadata("FloatLiteralInFirstPositionAfterParenthesis.after.inv.kt")
public void testFloatLiteralInFirstPositionAfterParenthesis() throws Exception {
runTest("testData/editor/enterHandler/beforeDot/FloatLiteralInFirstPositionAfterParenthesis.after.inv.kt");
}
@TestMetadata("IntegerLiteralInFirstPosition.after.inv.kt")
public void testIntegerLiteralInFirstPosition() throws Exception {
runTest("testData/editor/enterHandler/beforeDot/IntegerLiteralInFirstPosition.after.inv.kt");
}
@TestMetadata("IntegerLiteralInFirstPosition2.after.inv.kt")
public void testIntegerLiteralInFirstPosition2() throws Exception {
runTest("testData/editor/enterHandler/beforeDot/IntegerLiteralInFirstPosition2.after.inv.kt");
}
@TestMetadata("MultilineCallWithLambdaInFirstPosition.after.inv.kt")
public void testMultilineCallWithLambdaInFirstPosition() throws Exception {
runTest("testData/editor/enterHandler/beforeDot/MultilineCallWithLambdaInFirstPosition.after.inv.kt");
}
@TestMetadata("MultilineCallWithLambdaInNonFirstPositionOnFirstLine.after.inv.kt")
public void testMultilineCallWithLambdaInNonFirstPositionOnFirstLine() throws Exception {
runTest("testData/editor/enterHandler/beforeDot/MultilineCallWithLambdaInNonFirstPositionOnFirstLine.after.inv.kt");
}
@TestMetadata("MultilineCallWithLambdaInNonFirstPositionOnNonFirstLine.after.inv.kt")
public void testMultilineCallWithLambdaInNonFirstPositionOnNonFirstLine() throws Exception {
runTest("testData/editor/enterHandler/beforeDot/MultilineCallWithLambdaInNonFirstPositionOnNonFirstLine.after.inv.kt");
}
@TestMetadata("NonFirstPositionOnNewLineInsideCall.after.inv.kt")
public void testNonFirstPositionOnNewLineInsideCall() throws Exception {
runTest("testData/editor/enterHandler/beforeDot/NonFirstPositionOnNewLineInsideCall.after.inv.kt");
}
@TestMetadata("NonFirstPositionOnNonFirstLineOnNewLineInsideCall.after.inv.kt")
public void testNonFirstPositionOnNonFirstLineOnNewLineInsideCall() throws Exception {
runTest("testData/editor/enterHandler/beforeDot/NonFirstPositionOnNonFirstLineOnNewLineInsideCall.after.inv.kt");
}
@TestMetadata("ReferenceInFirstPosition.after.inv.kt")
public void testReferenceInFirstPosition() throws Exception {
runTest("testData/editor/enterHandler/beforeDot/ReferenceInFirstPosition.after.inv.kt");
}
@TestMetadata("ReferenceInFirstPositionAfterProperty.after.inv.kt")
public void testReferenceInFirstPositionAfterProperty() throws Exception {
runTest("testData/editor/enterHandler/beforeDot/ReferenceInFirstPositionAfterProperty.after.inv.kt");
}
@TestMetadata("ReferenceInNonFirstPositionAfterProperty.after.inv.kt")
public void testReferenceInNonFirstPositionAfterProperty() throws Exception {
runTest("testData/editor/enterHandler/beforeDot/ReferenceInNonFirstPositionAfterProperty.after.inv.kt");
}
@TestMetadata("ReferenceInNonFirstPositionAfterPropertyOnNonFirstLine.after.inv.kt")
public void testReferenceInNonFirstPositionAfterPropertyOnNonFirstLine() throws Exception {
runTest("testData/editor/enterHandler/beforeDot/ReferenceInNonFirstPositionAfterPropertyOnNonFirstLine.after.inv.kt");
}
@TestMetadata("ReferenceInNonFirstPositionOnFirstLine.after.inv.kt")
public void testReferenceInNonFirstPositionOnFirstLine() throws Exception {
runTest("testData/editor/enterHandler/beforeDot/ReferenceInNonFirstPositionOnFirstLine.after.inv.kt");
}
@TestMetadata("ReferenceInNonFirstPositionOnNonFirstLine.after.inv.kt")
public void testReferenceInNonFirstPositionOnNonFirstLine() throws Exception {
runTest("testData/editor/enterHandler/beforeDot/ReferenceInNonFirstPositionOnNonFirstLine.after.inv.kt");
}
@TestMetadata("ReferenceInNonFirstPositionOnNonFirstLineAfterProperty.after.inv.kt")
public void testReferenceInNonFirstPositionOnNonFirstLineAfterProperty() throws Exception {
runTest("testData/editor/enterHandler/beforeDot/ReferenceInNonFirstPositionOnNonFirstLineAfterProperty.after.inv.kt");
}
@TestMetadata("StringLiteralInFirstPosition.after.inv.kt")
public void testStringLiteralInFirstPosition() throws Exception {
runTest("testData/editor/enterHandler/beforeDot/StringLiteralInFirstPosition.after.inv.kt");
}
@TestMetadata("StringLiteralInFirstPosition2.after.inv.kt")
public void testStringLiteralInFirstPosition2() throws Exception {
runTest("testData/editor/enterHandler/beforeDot/StringLiteralInFirstPosition2.after.inv.kt");
}
@TestMetadata("StringLiteralInFirstPositionAfterOpenParenthesis.after.inv.kt")
public void testStringLiteralInFirstPositionAfterOpenParenthesis() throws Exception {
runTest("testData/editor/enterHandler/beforeDot/StringLiteralInFirstPositionAfterOpenParenthesis.after.inv.kt");
}
}
@RunWith(JUnit3RunnerWithInners.class)
@TestMetadata("testData/editor/enterHandler/elvis")
public static class Elvis extends AbstractEnterHandlerTest {
private void runTest(String testDataFilePath) throws Exception {
KotlinTestUtils.runTest(this::doNewlineTestWithInvert, this, testDataFilePath);
}
@TestMetadata("AfterElvis.after.inv.kt")
public void testAfterElvis() throws Exception {
runTest("testData/editor/enterHandler/elvis/AfterElvis.after.inv.kt");
}
@TestMetadata("AfterElvis2.after.inv.kt")
public void testAfterElvis2() throws Exception {
runTest("testData/editor/enterHandler/elvis/AfterElvis2.after.inv.kt");
}
@TestMetadata("AfterElvisInBinaryExpression.after.inv.kt")
public void testAfterElvisInBinaryExpression() throws Exception {
runTest("testData/editor/enterHandler/elvis/AfterElvisInBinaryExpression.after.inv.kt");
}
@TestMetadata("BeforeElvis.after.inv.kt")
public void testBeforeElvis() throws Exception {
runTest("testData/editor/enterHandler/elvis/BeforeElvis.after.inv.kt");
}
@TestMetadata("BeforeElvisInBinaryExpression.after.inv.kt")
public void testBeforeElvisInBinaryExpression() throws Exception {
runTest("testData/editor/enterHandler/elvis/BeforeElvisInBinaryExpression.after.inv.kt");
}
}
@RunWith(JUnit3RunnerWithInners.class)
@TestMetadata("testData/editor/enterHandler/emptyParameters")
public static class EmptyParameters extends AbstractEnterHandlerTest {
private void runTest(String testDataFilePath) throws Exception {
KotlinTestUtils.runTest(this::doNewlineTestWithInvert, this, testDataFilePath);
}
@TestMetadata("EmptyConditionInDoWhile.after.inv.kt")
public void testEmptyConditionInDoWhile() throws Exception {
runTest("testData/editor/enterHandler/emptyParameters/EmptyConditionInDoWhile.after.inv.kt");
}
@TestMetadata("EmptyConditionInFor.after.inv.kt")
public void testEmptyConditionInFor() throws Exception {
runTest("testData/editor/enterHandler/emptyParameters/EmptyConditionInFor.after.inv.kt");
}
@TestMetadata("EmptyConditionInIf.after.inv.kt")
public void testEmptyConditionInIf() throws Exception {
runTest("testData/editor/enterHandler/emptyParameters/EmptyConditionInIf.after.inv.kt");
}
@TestMetadata("EmptyConditionInWhen.after.inv.kt")
public void testEmptyConditionInWhen() throws Exception {
runTest("testData/editor/enterHandler/emptyParameters/EmptyConditionInWhen.after.inv.kt");
}
@TestMetadata("EmptyConditionInWhile.after.inv.kt")
public void testEmptyConditionInWhile() throws Exception {
runTest("testData/editor/enterHandler/emptyParameters/EmptyConditionInWhile.after.inv.kt");
}
@TestMetadata("EmptyParameterInDestructuringDeclaration.after.inv.kt")
public void testEmptyParameterInDestructuringDeclaration() throws Exception {
runTest("testData/editor/enterHandler/emptyParameters/EmptyParameterInDestructuringDeclaration.after.inv.kt");
}
@TestMetadata("EmptyParameterInDestructuringDeclaration2.after.inv.kt")
public void testEmptyParameterInDestructuringDeclaration2() throws Exception {
runTest("testData/editor/enterHandler/emptyParameters/EmptyParameterInDestructuringDeclaration2.after.inv.kt");
}
@TestMetadata("EmptyParameterInDestructuringDeclaration3.after.inv.kt")
public void testEmptyParameterInDestructuringDeclaration3() throws Exception {
runTest("testData/editor/enterHandler/emptyParameters/EmptyParameterInDestructuringDeclaration3.after.inv.kt");
}
}
@RunWith(JUnit3RunnerWithInners.class)
@TestMetadata("testData/editor/enterHandler/emptyParenthesisInBinaryExpression")
public static class EmptyParenthesisInBinaryExpression extends AbstractEnterHandlerTest {
private void runTest(String testDataFilePath) throws Exception {
KotlinTestUtils.runTest(this::doNewlineTestWithInvert, this, testDataFilePath);
}
@TestMetadata("AssignmentAfterEq.after.inv.kt")
public void testAssignmentAfterEq() throws Exception {
runTest("testData/editor/enterHandler/emptyParenthesisInBinaryExpression/AssignmentAfterEq.after.inv.kt");
}
@TestMetadata("BinaryWithTypeExpressions.after.inv.kt")
public void testBinaryWithTypeExpressions() throws Exception {
runTest("testData/editor/enterHandler/emptyParenthesisInBinaryExpression/BinaryWithTypeExpressions.after.inv.kt");
}
@TestMetadata("EmptyArgumentInCallByArrayAccess.after.inv.kt")
public void testEmptyArgumentInCallByArrayAccess() throws Exception {
runTest("testData/editor/enterHandler/emptyParenthesisInBinaryExpression/EmptyArgumentInCallByArrayAccess.after.inv.kt");
}
@TestMetadata("EmptyArgumentInCallByDeclaration.after.inv.kt")
public void testEmptyArgumentInCallByDeclaration() throws Exception {
runTest("testData/editor/enterHandler/emptyParenthesisInBinaryExpression/EmptyArgumentInCallByDeclaration.after.inv.kt");
}
@TestMetadata("InBinaryExpressionInMiddle.after.inv.kt")
public void testInBinaryExpressionInMiddle() throws Exception {
runTest("testData/editor/enterHandler/emptyParenthesisInBinaryExpression/InBinaryExpressionInMiddle.after.inv.kt");
}
@TestMetadata("InBinaryExpressionUnfinished.after.inv.kt")
public void testInBinaryExpressionUnfinished() throws Exception {
runTest("testData/editor/enterHandler/emptyParenthesisInBinaryExpression/InBinaryExpressionUnfinished.after.inv.kt");
}
@TestMetadata("InBinaryExpressionUnfinishedInIf.after.inv.kt")
public void testInBinaryExpressionUnfinishedInIf() throws Exception {
runTest("testData/editor/enterHandler/emptyParenthesisInBinaryExpression/InBinaryExpressionUnfinishedInIf.after.inv.kt");
}
@TestMetadata("InBinaryExpressionsBeforeCloseParenthesis.after.inv.kt")
public void testInBinaryExpressionsBeforeCloseParenthesis() throws Exception {
runTest("testData/editor/enterHandler/emptyParenthesisInBinaryExpression/InBinaryExpressionsBeforeCloseParenthesis.after.inv.kt");
}
@TestMetadata("InExpressionsParenthesesBeforeOperand.after.inv.kt")
public void testInExpressionsParenthesesBeforeOperand() throws Exception {
runTest("testData/editor/enterHandler/emptyParenthesisInBinaryExpression/InExpressionsParenthesesBeforeOperand.after.inv.kt");
}
@TestMetadata("IsExpressionAfterIs.after.inv.kt")
public void testIsExpressionAfterIs() throws Exception {
runTest("testData/editor/enterHandler/emptyParenthesisInBinaryExpression/IsExpressionAfterIs.after.inv.kt");
}
}
@RunWith(JUnit3RunnerWithInners.class)
@TestMetadata("testData/editor/enterHandler/expressionBody")
public static class ExpressionBody extends AbstractEnterHandlerTest {
private void runTest(String testDataFilePath) throws Exception {
KotlinTestUtils.runTest(this::doNewlineTestWithInvert, this, testDataFilePath);
}
@TestMetadata("AfterFunctionWithExplicitType.after.inv.kt")
public void testAfterFunctionWithExplicitType() throws Exception {
runTest("testData/editor/enterHandler/expressionBody/AfterFunctionWithExplicitType.after.inv.kt");
}
@TestMetadata("AfterFunctionWithInference.after.inv.kt")
public void testAfterFunctionWithInference() throws Exception {
runTest("testData/editor/enterHandler/expressionBody/AfterFunctionWithInference.after.inv.kt");
}
@TestMetadata("AfterFunctionWithTypeParameter.after.inv.kt")
public void testAfterFunctionWithTypeParameter() throws Exception {
runTest("testData/editor/enterHandler/expressionBody/AfterFunctionWithTypeParameter.after.inv.kt");
}
@TestMetadata("AfterMultideclaration.after.inv.kt")
public void testAfterMultideclaration() throws Exception {
runTest("testData/editor/enterHandler/expressionBody/AfterMultideclaration.after.inv.kt");
}
@TestMetadata("AfterMutableProperty.after.inv.kt")
public void testAfterMutableProperty() throws Exception {
runTest("testData/editor/enterHandler/expressionBody/AfterMutableProperty.after.inv.kt");
}
@TestMetadata("AfterPropertyWithExplicitType.after.inv.kt")
public void testAfterPropertyWithExplicitType() throws Exception {
runTest("testData/editor/enterHandler/expressionBody/AfterPropertyWithExplicitType.after.inv.kt");
}
@TestMetadata("AfterPropertyWithInference.after.inv.kt")
public void testAfterPropertyWithInference() throws Exception {
runTest("testData/editor/enterHandler/expressionBody/AfterPropertyWithInference.after.inv.kt");
}
@TestMetadata("AfterPropertyWithReceiver.after.inv.kt")
public void testAfterPropertyWithReceiver() throws Exception {
runTest("testData/editor/enterHandler/expressionBody/AfterPropertyWithReceiver.after.inv.kt");
}
@TestMetadata("AfterPropertyWithTypeParameterReceiver.after.inv.kt")
public void testAfterPropertyWithTypeParameterReceiver() throws Exception {
runTest("testData/editor/enterHandler/expressionBody/AfterPropertyWithTypeParameterReceiver.after.inv.kt");
}
@TestMetadata("FunctionWithExplicitType.after.inv.kt")
public void testFunctionWithExplicitType() throws Exception {
runTest("testData/editor/enterHandler/expressionBody/FunctionWithExplicitType.after.inv.kt");
}
@TestMetadata("FunctionWithInference.after.inv.kt")
public void testFunctionWithInference() throws Exception {
runTest("testData/editor/enterHandler/expressionBody/FunctionWithInference.after.inv.kt");
}
@TestMetadata("FunctionWithTypeParameter.after.inv.kt")
public void testFunctionWithTypeParameter() throws Exception {
runTest("testData/editor/enterHandler/expressionBody/FunctionWithTypeParameter.after.inv.kt");
}
@TestMetadata("Multideclaration.after.inv.kt")
public void testMultideclaration() throws Exception {
runTest("testData/editor/enterHandler/expressionBody/Multideclaration.after.inv.kt");
}
@TestMetadata("MutableProperty.after.inv.kt")
public void testMutableProperty() throws Exception {
runTest("testData/editor/enterHandler/expressionBody/MutableProperty.after.inv.kt");
}
@TestMetadata("PropertyWithExplicitType.after.inv.kt")
public void testPropertyWithExplicitType() throws Exception {
runTest("testData/editor/enterHandler/expressionBody/PropertyWithExplicitType.after.inv.kt");
}
@TestMetadata("PropertyWithInference.after.inv.kt")
public void testPropertyWithInference() throws Exception {
runTest("testData/editor/enterHandler/expressionBody/PropertyWithInference.after.inv.kt");
}
@TestMetadata("PropertyWithReceiver.after.inv.kt")
public void testPropertyWithReceiver() throws Exception {
runTest("testData/editor/enterHandler/expressionBody/PropertyWithReceiver.after.inv.kt");
}
@TestMetadata("PropertyWithTypeParameterReceiver.after.inv.kt")
public void testPropertyWithTypeParameterReceiver() throws Exception {
runTest("testData/editor/enterHandler/expressionBody/PropertyWithTypeParameterReceiver.after.inv.kt");
}
}
@RunWith(JUnit3RunnerWithInners.class)
@TestMetadata("testData/editor/enterHandler")
public static class Uncategorized extends AbstractEnterHandlerTest {
private void runTest(String testDataFilePath) throws Exception {
KotlinTestUtils.runTest(this::doNewlineTestWithInvert, this, testDataFilePath);
}
@TestMetadata("ArgumentListNormalIndent.after.inv.kt")
public void testArgumentListNormalIndent() throws Exception {
runTest("testData/editor/enterHandler/ArgumentListNormalIndent.after.inv.kt");
}
@TestMetadata("ConsecutiveCallsInSaeCallsMiddle.after.inv.kt")
public void testConsecutiveCallsInSaeCallsMiddle() throws Exception {
runTest("testData/editor/enterHandler/ConsecutiveCallsInSaeCallsMiddle.after.inv.kt");
}
@TestMetadata("HigherOrderFunction2.after.inv.kt")
public void testHigherOrderFunction2() throws Exception {
runTest("testData/editor/enterHandler/HigherOrderFunction2.after.inv.kt");
}
@TestMetadata("InDelegationListAfterColon.after.inv.kt")
public void testInDelegationListAfterColon() throws Exception {
runTest("testData/editor/enterHandler/InDelegationListAfterColon.after.inv.kt");
}
@TestMetadata("InDelegationListAfterComma.after.inv.kt")
public void testInDelegationListAfterComma() throws Exception {
runTest("testData/editor/enterHandler/InDelegationListAfterComma.after.inv.kt");
}
@TestMetadata("InDelegationListNotEmpty.after.inv.kt")
public void testInDelegationListNotEmpty() throws Exception {
runTest("testData/editor/enterHandler/InDelegationListNotEmpty.after.inv.kt");
}
@TestMetadata("InEnumAfterSemicolon.after.inv.kt")
public void testInEnumAfterSemicolon() throws Exception {
runTest("testData/editor/enterHandler/InEnumAfterSemicolon.after.inv.kt");
}
@TestMetadata("InEnumInitializerListAfterComma.after.inv.kt")
public void testInEnumInitializerListAfterComma() throws Exception {
runTest("testData/editor/enterHandler/InEnumInitializerListAfterComma.after.inv.kt");
}
@TestMetadata("InEnumInitializerListNotEmpty.after.inv.kt")
public void testInEnumInitializerListNotEmpty() throws Exception {
runTest("testData/editor/enterHandler/InEnumInitializerListNotEmpty.after.inv.kt");
}
@TestMetadata("NotFirstParameter.after.inv.kt")
public void testNotFirstParameter() throws Exception {
runTest("testData/editor/enterHandler/NotFirstParameter.after.inv.kt");
}
@TestMetadata("SettingAlignMultilineParametersInCalls.after.inv.kt")
public void testSettingAlignMultilineParametersInCalls() throws Exception {
runTest("testData/editor/enterHandler/SettingAlignMultilineParametersInCalls.after.inv.kt");
}
@TestMetadata("SmartEnterWithoutLineBreakBeforeClosingBracketInMethodParameters.after.inv.kt")
public void testSmartEnterWithoutLineBreakBeforeClosingBracketInMethodParameters() throws Exception {
runTest("testData/editor/enterHandler/SmartEnterWithoutLineBreakBeforeClosingBracketInMethodParameters.after.inv.kt");
}
}
}
}
| [
"intellij-monorepo-bot-no-reply@jetbrains.com"
] | intellij-monorepo-bot-no-reply@jetbrains.com |
25bfeac9c093069857c4bfbe41580b9bf7598959 | 650c4cf2ff66cd9b7addc79c299aff5778951cfc | /src/java/Duoc/Portafolio/Dao/DaoClienteArrendador.java | 59359adbd08e36e271cc695e0d688d78ff9dba27 | [] | no_license | matias96rivas/Arriendo | fa3a1567f992cba6838b3611c80c3e16781e99c5 | 44848b93fa8dfa2e9ae664be9dda87f5c80a281e | refs/heads/master | 2020-04-02T08:24:39.271135 | 2018-10-23T01:50:13 | 2018-10-23T01:50:13 | 154,243,364 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 6,418 | java | /*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package Duoc.Portafolio.Dao;
import Duoc.Portafolio.Clases.ClienteArrendador;
import Duoc.Portafolio.Clases.Tarjeta;
import Duoc.Portafolio.Clases.Usuario;
import java.sql.CallableStatement;
import java.sql.Connection;
import java.sql.Date;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.sql.Timestamp;
import java.util.ArrayList;
import java.util.List;
import java.util.logging.Level;
import java.util.logging.Logger;
import oracle.jdbc.OracleTypes;
/**
*
* @author Matias
*/
public class DaoClienteArrendador {
Connection cone;
private String mensaje;
public String getMensaje() {
return mensaje;
}
public void setMensaje(String mensaje) {
this.mensaje = mensaje;
}
public List<ClienteArrendador> listarClienteArrendador(){
//Creo una lista vacia
List<ClienteArrendador> clientes = null;
//Guardo el procedimiento en la variable sql
String sql = "{call sp_listar_cliente_arrendador(?)}";
//Si la conexion no es nula se ejecuta el metodo
if (this.cone != null) {
try {
//se prepara la llamada al procedimiento
CallableStatement cs = cone.prepareCall(sql);
//le paso un cursor a la sentencia
cs.registerOutParameter(1, OracleTypes.CURSOR);
//ejecuto la consulta guardada en sql
cs.executeQuery();
//
ResultSet rs = (ResultSet) cs.getObject(1);
//Convierto la lista en un Array
clientes = new ArrayList<>();
while (rs.next()) {
//se crea un nuevo cliente
ClienteArrendador ca = new ClienteArrendador();
//paso los datos desde la DB
ca.setRut_arrendador(rs.getString(1));
//Se crea un usuario
Usuario u = new Usuario();
u.setId_usuario(rs.getInt(2));
ca.setId_usuario(u);
ca.setNombre(rs.getString(3));
ca.setApellido(rs.getString(4));
//le doy formato a la fecha
Timestamp tsFechaN = rs.getTimestamp(5);
ca.setFecha_nacimiento(tsFechaN);
ca.setCorreo_electronico(rs.getString(6));
//Se crean una tarjeta pra pasar su id
Tarjeta t = new Tarjeta();
t.setId_tarjeta(rs.getInt(7));
ca.setId_tarjeta(t);
clientes.add(ca);
}
cone.close();
} catch (SQLException ex) {
setMensaje("Error al listar. "+ex.getMessage());
Logger.getLogger(DaoClienteArrendador.class.getName()).log(Level.SEVERE, null, ex);
}finally{
try {
cone.close();
} catch (Exception e) {
e.getMessage();
}
}
}else{
setMensaje("Error en la conexion");
}
return clientes;
}
public void agregarClienteArrendador(ClienteArrendador cliente){
//Llamo al procedimiento
String sql = "{call sp_agregar_cliente_arrendador(?,?,?,?,?,?,?)}";
//Si la conexion en distinta de null ejecuto el metodo
if (this.cone != null) {
try {
//preparo la llamada
CallableStatement cs = cone.prepareCall(sql);
cs.setString(1, cliente.getRut_arrendador());
cs.setInt(2, cliente.getId_usuario().getId_usuario());
cs.setString(3, cliente.getNombre());
cs.setString(4, cliente.getApellido());
cs.setDate(5, (Date) cliente.getFecha_nacimiento());
cs.setString(6, cliente.getCorreo_electronico());
cs.setInt(7, cliente.getId_tarjeta().getId_tarjeta());
//variable para verificar si se completo el registro
int exe = cs.executeUpdate();
//si no se completo el registro, la varible quedará en 0
if (exe == 0) {
throw new SQLException();
}
setMensaje("Registro realizado con exito.");
cone.close();
} catch (SQLException ex) {
setMensaje("Problema al agregar cliente Arrendador. "+ex.getMessage());
Logger.getLogger(DaoClienteArrendador.class.getName()).log(Level.SEVERE, null, ex);
}finally{
try {
cone.close();
} catch (Exception e) {
setMensaje(e.getMessage());
}
}
}else{
setMensaje("Error en la conexion. ");
}
}
public void modificarCliente(ClienteArrendador cliente){
//guardo el procedimiento en la variable sql
String sql = "{call sp_modificar_cliente_arrend(?)}";
//si la conexion no es nula, se ejevuta el metodo
if (this.cone != null) {
try {
//preparo la llamada
CallableStatement cs = cone.prepareCall(sql);
cs.setString(1, cliente.getRut_arrendador());
int exe = cs.executeUpdate();
if (exe == 0) {
throw new SQLException();
}
cone.close();
} catch (SQLException ex) {
setMensaje("Error al modificar. "+ex.getMessage());
Logger.getLogger(DaoClienteArrendador.class.getName()).log(Level.SEVERE, null, ex);
}finally{
try {
cone.close();
} catch (Exception e) {
setMensaje(e.getMessage());
}
}
}else{
setMensaje("Error en la conexion.");
}
}
}
| [
"mat.rivas@alumnos.duoc.cl"
] | mat.rivas@alumnos.duoc.cl |
c36833d3d2253a997aa629d4983512a7712bb36a | c95fa388ac358410d8212aa73de9e521a803b2a4 | /app/src/main/java/com/ventrux/eazetalk/Activity/OtpVerifyActivity.java | 1cabd042be785daf7bba5c9d9f72bee0dd5817ee | [] | no_license | krishnakanthpps/Eazy-talk | 183d9b41b38bf3fd69cb7f78f285ba63e431462f | a68b2d9be642e008593a7ee877944c3d485910eb | refs/heads/master | 2023-02-06T02:36:22.480061 | 2020-12-30T14:25:59 | 2020-12-30T14:25:59 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,068 | java | package com.ventrux.eazetalk.Activity;
import androidx.appcompat.app.AppCompatActivity;
import android.content.Intent;
import android.os.Bundle;
import android.text.Editable;
import android.text.TextWatcher;
import android.view.View;
import android.widget.Toast;
import com.ventrux.eazetalk.MainActivity;
import com.ventrux.eazetalk.PinEntryEditText;
import com.ventrux.eazetalk.R;
public class OtpVerifyActivity extends AppCompatActivity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_otp_verify);
findViewById(R.id.back).setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
finish();
}
});
findViewById(R.id.sendotp).setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
startActivity(new Intent(getApplicationContext(), MainActivity.class));
}
});
final PinEntryEditText txtPinEntry = (PinEntryEditText) findViewById(R.id.txt_pin_entry);
txtPinEntry.addTextChangedListener(new TextWatcher() {
@Override
public void beforeTextChanged(CharSequence s, int start, int count, int after) {
}
@Override
public void onTextChanged(CharSequence s, int start, int before, int count) {
}
@Override
public void afterTextChanged(Editable s) {
/* if (s.toString().equals("1234")) {
Toast.makeText(getApplicationContext(), "Success", Toast.LENGTH_SHORT).show();
startActivity(new Intent(OtpVerifyActivity.this, Login.class));
} else if (s.length() == "1234".length()) {
Toast.makeText(getApplicationContext(), "Incorrect", Toast.LENGTH_SHORT).show();
txtPinEntry.setText(null);
}*/
}
});
}
}
| [
"mannu13896@gmail.com"
] | mannu13896@gmail.com |
e5f6504c40326b2c9f84d285916460ab7d075866 | 978061807a58833d03da548638e2a67c2fc07ed2 | /src/main/java/managers/PageObjectManager.java | 1b9d79f2ae1921d789c2d471c1c0f650348949c2 | [] | no_license | mbachvarov13/SeleniumJUnit | bcdfbed05556d0bcb902c16baeaa29ba0be26110 | ae40979dde296f79b9ec3ea55eaeee43c8fd442a | refs/heads/main | 2023-08-28T14:02:05.912792 | 2021-10-20T07:49:29 | 2021-10-20T07:49:29 | 419,108,329 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 727 | java | package managers;
import org.openqa.selenium.WebDriver;
import pageObjects.Common;
import pageObjects.HomePage;
import pageObjects.TodayDeals;
public class PageObjectManager {
WebDriver driver;
HomePage homePage;
TodayDeals todayDeals;
Common common;
public PageObjectManager(WebDriver driver) {
this.driver = driver;
}
public HomePage getHomePage() {
return (homePage == null) ? homePage = new HomePage(driver) : homePage;
}
public TodayDeals getTodayDeals() {
return (todayDeals == null) ? todayDeals = new TodayDeals(driver) : todayDeals;
}
public Common getCommon() {
return (common == null) ? common = new Common(driver) : common;
}
}
| [
"Martin_Bachvarov@epam.com"
] | Martin_Bachvarov@epam.com |
f2d9f30406eeeca49409471c36c2ec6b5641bf83 | d235f9cb0f4674b257deef26435a88f9e359936a | /app/src/main/java/com/toranj/tyke/adapters/DashboardAdapter.java | bba5fdb5b95947a18b96c99bdca4ce298290244e | [] | no_license | arashzz/Tyke-Android | 958c1c5c67503d2687b40d61558f4446993cd3bb | 26cd82f60702d05694f0e798f5264c0769dc6b8e | refs/heads/master | 2020-04-02T03:29:59.282551 | 2016-08-09T14:00:29 | 2016-08-09T14:00:29 | 64,288,273 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,012 | java | package com.toranj.tyke.adapters;
import android.support.v7.widget.RecyclerView;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.TextView;
import com.toranj.tyke.R;
import com.toranj.tyke.models.Lottery;
import java.util.ArrayList;
import java.util.List;
/**
* Created by arash on 7/28/16.
*/
public class DashboardAdapter extends RecyclerView.Adapter<DashboardAdapter.AdapterViewHolder> {
private List<Lottery> lotteryList;
public DashboardAdapter(List<Lottery> lotteryList) {
this.lotteryList = new ArrayList<>();
if(lotteryList != null) {
this.lotteryList = lotteryList;
}
}
public void addItems(List<Lottery> lotteryList) {
if(this.lotteryList == null) {
this.lotteryList = new ArrayList<>();
}
if(lotteryList != null) {
this.lotteryList.addAll(lotteryList);
notifyDataSetChanged();
}
}
public void addItem(Lottery lottery) {
if(lotteryList == null) {
this.lotteryList = new ArrayList<>();
}
lotteryList.add(lottery);
notifyDataSetChanged();
}
@Override
public AdapterViewHolder onCreateViewHolder(ViewGroup parent, int viewType) {
View view = LayoutInflater.from(parent.getContext())
.inflate(R.layout.list_item_lottery, parent, false);
return new AdapterViewHolder(view);
}
@Override
public void onBindViewHolder(AdapterViewHolder holder, int position) {
Lottery lottery = lotteryList.get(position);
holder.name.setText(lottery.getName());
}
@Override
public int getItemCount() {
return lotteryList.size();
}
public class AdapterViewHolder extends RecyclerView.ViewHolder {
public TextView name;
public AdapterViewHolder(View view) {
super(view);
name = (TextView) view.findViewById(R.id.name);
}
}
}
| [
"arash.moeen.j@gmail.com"
] | arash.moeen.j@gmail.com |
d3ce3b9f830be312ef44603b9fd6295962404293 | a7c012fa73d8f279c6b157adbe0ef68e637db9a7 | /src/main/java/br/com/workmade/exceptions/ProdutoNaoEncontradoException.java | fbf22dd5eecf90d7d009197380c7f4189ee4a1f9 | [] | no_license | marcosradix/algafood-api | eb9f89bd33fe531cbac1790a25a2b24ee27de7a7 | 11fdefe1211357fc5a40c20ad00318d898887509 | refs/heads/master | 2023-02-07T10:53:37.671136 | 2020-12-29T09:59:00 | 2020-12-29T09:59:00 | 285,667,798 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 489 | java | package br.com.workmade.exceptions;
public class ProdutoNaoEncontradoException extends EntidadeNaoEncontradaException {
private static final long serialVersionUID = -5310311961324041391L;
public ProdutoNaoEncontradoException(String msg) {
super(msg);
}
public ProdutoNaoEncontradoException(Long cidadeId) {
this(String.format("Produto não encontrado com id: %d",cidadeId));
}
public ProdutoNaoEncontradoException(String msg, Throwable cause) {
super(msg, cause);
}
}
| [
"marcosradix@gmail.com"
] | marcosradix@gmail.com |
ec7059b02181382deaf0ecc1aa1886fc5823eee4 | e7ae4523d2c4ad822ca3e5ce4c1e56dd394cb530 | /src/com/microsoft/azure/documentdb/PathParser.java | 05e231b801844cfa1e6a85d82be7542aba1a5115 | [
"MIT"
] | permissive | adwhite03/azure-documentdb-java | 643acc6a364f6709be8904987950ba5ad6a2029e | 7d7a6ab86dc8d2a119c10a30e89f11f4aeb70efc | refs/heads/master | 2021-01-23T13:41:47.528472 | 2017-07-21T00:13:15 | 2017-07-21T00:13:15 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,598 | java | package com.microsoft.azure.documentdb;
import java.util.ArrayList;
import java.util.Collection;
final class PathParser {
private static final char segmentSeparator = '/';
private static final String errorMessageFormat = "Invalid path, failed at index {0}.";
public static Collection<String> getPathParts(String path) {
ArrayList<String> tokens = new ArrayList<String>();
int currentIndex = 0;
while (currentIndex < path.length()) {
if (path.charAt(currentIndex) != segmentSeparator) {
throw new IllegalArgumentException(String.format(errorMessageFormat, currentIndex));
}
if (++currentIndex == path.length())
break;
if (path.charAt(currentIndex) == '\"' || path.charAt(currentIndex) == '\'') {
char quote = path.charAt(currentIndex);
int newIndex = ++currentIndex;
while (true) {
newIndex = path.indexOf(quote, newIndex);
if (newIndex == -1) {
throw new IllegalArgumentException(String.format(errorMessageFormat, currentIndex));
}
if (path.charAt(newIndex - 1) != '\\') {
break;
}
++newIndex;
}
String token = path.substring(currentIndex, newIndex);
tokens.add(token);
currentIndex = newIndex + 1;
} else {
int newIndex = path.indexOf(segmentSeparator, currentIndex);
String token = null;
if (newIndex == -1) {
token = path.substring(currentIndex);
currentIndex = path.length();
} else {
token = path.substring(currentIndex, newIndex);
currentIndex = newIndex;
}
token = token.trim();
tokens.add(token);
}
}
return tokens;
}
}
| [
"shellyg@microsoft.com"
] | shellyg@microsoft.com |
28668e18b7c14e374f76add02f775432777b1215 | 82854b1f018f93878a1e22ddda069d4ec2ed8b36 | /src/android/rest/RestCall.java | 3e9e379844b086d53afa58ac5446581550f9e7d9 | [
"Apache-2.0"
] | permissive | pinishlomi/hpe-android-plugin-backgroundservice | 2c3feb6ab79e771f432cbd1d0a3a214586ee3218 | b2ff75f3342e13f8a0044781cb5c424c21c0a9b6 | refs/heads/master | 2021-03-08T19:30:32.107582 | 2016-05-18T12:07:23 | 2016-05-18T12:07:23 | 58,351,175 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,229 | java | package com.hpe.android.plugin.backgroundservice.rest;
import org.json.JSONException;
import org.json.JSONObject;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.net.MalformedURLException;
import java.net.URL;
import java.net.URLConnection;
/**
*
*/
public class RestCall {
public static JSONObject getJSONFromUrl(String targetUrl) throws JSONException {
JSONObject jObj = new JSONObject();
try {
URL url = new URL(targetUrl);
URLConnection urlConnection = url.openConnection();
urlConnection.setRequestProperty("Authorization", "Basic YWRtaW46YWRtaW4=");
InputStream is = urlConnection.getInputStream();
InputStreamReader isr = new InputStreamReader(is);
int numCharsRead;
char[] charArray = new char[1024];
StringBuffer sb = new StringBuffer();
while ((numCharsRead = isr.read(charArray)) > 0) {
sb.append(charArray, 0, numCharsRead);
}
String result = sb.toString();
jObj = new JSONObject(result);
} catch (MalformedURLException e) {
jObj.put("ErrorMsg from MalformedURLException : ", e.getMessage());
} catch (IOException e) {
jObj.put("ErrorMsg from IOException : ",e.getMessage());
}
return jObj;
}
}
| [
"shlomi@hpe.com"
] | shlomi@hpe.com |
034e2e23762a46da770369bcbc085b09896d05d4 | b74216fc400788cfa3b65a0058eab95928df30f2 | /src/java/EcoServidor.java | 5743ee112e9c18a1955474fb9889c8e57b94fe2a | [] | no_license | ricardonect/ecoServidor | 4b8601f9e210f4e7db7188dd48104b2d86cfcd16 | 6c6ac938094fff6ebb37beaf8a9a8c55925b8902 | refs/heads/master | 2020-12-24T18:42:15.022972 | 2016-09-14T22:09:58 | 2016-09-14T22:09:58 | 58,946,210 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,825 | java | /*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
/**
*
* @author Ricardo Marín
*/
import java.io.*;
import java.net.*;
import java.util.logging.Level;
import java.util.logging.Logger;
public class EcoServidor implements Runnable {
public static final int PORT = 1134;
public String adios;
public void procedimiento() throws IOException {
}
@Override
public void run() {
try {
// Establece el puerto en el que escucha peticiones
ServerSocket socketServidor = null;
try {
socketServidor = new ServerSocket(PORT);
} catch (IOException e) {
System.out.println("No puede escuchar en el puerto: " + PORT);
System.exit(-1);
}
int cont = 0;
Socket socketCliente = null;
BufferedReader entrada = null;
PrintWriter salida = null;
System.out.println("Escuchando: " + socketServidor);
try {
// Se bloquea hasta que recibe alguna petición de un cliente
// abriendo un socket para el cliente
socketCliente = socketServidor.accept();
System.out.println("Connexión acceptada: " + socketCliente);
// Establece canal de entrada
entrada = new BufferedReader(new InputStreamReader(socketCliente.getInputStream()));
// Establece canal de salida
salida = new PrintWriter(new BufferedWriter(new OutputStreamWriter(socketCliente.getOutputStream())), true);
// Hace eco de lo que le proporciona el cliente, hasta que recibe "Adios"
while (true) {
cont = cont + 5;
String str = entrada.readLine();
System.out.println("Cliente: " + str);
salida.println(cont);
if (cont == 60) {
cont = 0;
}
if (adios.equals("adios")) {
break;
}
}
} catch (IOException e) {
System.out.println("IOException: " + e.getMessage());
}
salida.close();
entrada.close();
socketCliente.close();
socketServidor.close();
} catch (IOException ex) {
Logger.getLogger(EcoServidor.class.getName()).log(Level.SEVERE, null, ex);
}
}
}
| [
"ricardonect@gmail.com"
] | ricardonect@gmail.com |
bd35acfa4c493415e86693ce2e442ec1eb048061 | 77745f2f33fb34fce439f21e5895b5b0ad0c010a | /src/test/java/com/application/exception/GenericFunctionException.java | 2791337e942705b94a9f8ba0a342c06f9dfff772 | [] | no_license | amolsinare123/AppiumFramwork | 2d8b92abece5841f2ffda2d5bd9e90997eee1704 | 0524673792e6b9b3ca0a2017cb9e64c881b37e48 | refs/heads/master | 2020-03-17T05:19:29.361942 | 2018-05-14T07:15:25 | 2018-05-14T07:15:25 | 133,311,599 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 784 | java | package com.application.exception;
public class GenericFunctionException extends Exception {
public GenericFunctionException() {
// TODO Auto-generated constructor stub
}
public GenericFunctionException(String message) {
super(message);
// TODO Auto-generated constructor stub
}
public GenericFunctionException(Throwable cause) {
super(cause);
// TODO Auto-generated constructor stub
}
public GenericFunctionException(String message, Throwable cause) {
super(message, cause);
// TODO Auto-generated constructor stub
}
public GenericFunctionException(String message, Throwable cause, boolean enableSuppression,
boolean writableStackTrace) {
super(message, cause, enableSuppression, writableStackTrace);
// TODO Auto-generated constructor stub
}
}
| [
"amol.sinare@gmail.com"
] | amol.sinare@gmail.com |
e451a7bab261f7274220ee1b14b243c20ffd6637 | d6c2ed9ad150cf13c55a2be0979375d8692dd35f | /IA_Project_Test2/app/src/test/java/edu/cis/ia_project_test/ExampleUnitTest.java | c852288821be5dcd97b003f83ae80dae4204bd23 | [
"MIT"
] | permissive | gleong21/IA_Project_REDO | 67eff5d6b07954551e946be5dbbc32dbd5a2235b | ed16cee1a225fa03c49947f60da855a44e75ece9 | refs/heads/main | 2023-06-01T14:39:46.342409 | 2021-06-17T13:10:29 | 2021-06-17T13:10:29 | 370,863,390 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 388 | java | package edu.cis.ia_project_test;
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);
}
} | [
"gl5242@student.cis.edu.hk"
] | gl5242@student.cis.edu.hk |
42be9a1830c8ba6cd2796cb52e0e8389712d2db8 | 385e3414ccb7458bbd3cec326320f11819decc7b | /frameworks/opt/telephony/src/java/com/android/internal/telephony/uicc/EFResponseData.java | c9e9b416913c5acb5c5c87c9bb9997f2146e8bde | [] | no_license | carlos22211/Tango_AL813 | 14de7f2693c3045b9d3c0cb52017ba2bb6e6b28f | b50b1b7491dc9c5e6b92c2d94503635c43e93200 | refs/heads/master | 2020-03-28T08:09:11.127995 | 2017-06-26T05:05:29 | 2017-06-26T05:05:29 | 147,947,860 | 1 | 0 | null | 2018-09-08T15:55:46 | 2018-09-08T15:55:45 | null | UTF-8 | Java | false | false | 3,183 | java | /* Copyright Statement:
*
* This software/firmware and related documentation ("MediaTek Software") are
* protected under relevant copyright laws. The information contained herein
* is confidential and proprietary to MediaTek Inc. and/or its licensors.
* Without the prior written permission of MediaTek inc. and/or its licensors,
* any reproduction, modification, use or disclosure of MediaTek Software,
* and information contained herein, in whole or in part, shall be strictly prohibited.
*/
/* MediaTek Inc. (C) 2010. All rights reserved.
*
* BY OPENING THIS FILE, RECEIVER HEREBY UNEQUIVOCALLY ACKNOWLEDGES AND AGREES
* THAT THE SOFTWARE/FIRMWARE AND ITS DOCUMENTATIONS ("MEDIATEK SOFTWARE")
* RECEIVED FROM MEDIATEK AND/OR ITS REPRESENTATIVES ARE PROVIDED TO RECEIVER ON
* AN "AS-IS" BASIS ONLY. MEDIATEK EXPRESSLY DISCLAIMS ANY AND ALL WARRANTIES,
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE OR NONINFRINGEMENT.
* NEITHER DOES MEDIATEK PROVIDE ANY WARRANTY WHATSOEVER WITH RESPECT TO THE
* SOFTWARE OF ANY THIRD PARTY WHICH MAY BE USED BY, INCORPORATED IN, OR
* SUPPLIED WITH THE MEDIATEK SOFTWARE, AND RECEIVER AGREES TO LOOK ONLY TO SUCH
* THIRD PARTY FOR ANY WARRANTY CLAIM RELATING THERETO. RECEIVER EXPRESSLY ACKNOWLEDGES
* THAT IT IS RECEIVER'S SOLE RESPONSIBILITY TO OBTAIN FROM ANY THIRD PARTY ALL PROPER LICENSES
* CONTAINED IN MEDIATEK SOFTWARE. MEDIATEK SHALL ALSO NOT BE RESPONSIBLE FOR ANY MEDIATEK
* SOFTWARE RELEASES MADE TO RECEIVER'S SPECIFICATION OR TO CONFORM TO A PARTICULAR
* STANDARD OR OPEN FORUM. RECEIVER'S SOLE AND EXCLUSIVE REMEDY AND MEDIATEK'S ENTIRE AND
* CUMULATIVE LIABILITY WITH RESPECT TO THE MEDIATEK SOFTWARE RELEASED HEREUNDER WILL BE,
* AT MEDIATEK'S OPTION, TO REVISE OR REPLACE THE MEDIATEK SOFTWARE AT ISSUE,
* OR REFUND ANY SOFTWARE LICENSE FEES OR SERVICE CHARGE PAID BY RECEIVER TO
* MEDIATEK FOR SUCH MEDIATEK SOFTWARE AT ISSUE.
*
* The following software/firmware and/or related documentation ("MediaTek Software")
* have been modified by MediaTek Inc. All revisions are subject to any receiver's
* applicable license agreements with MediaTek Inc.
*/
/*
* Copyright (C) 2008 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.android.internal.telephony;
public class EFResponseData {
private static final int RESPONSE_DATA_FILE_STATUS = 11;
private int mFileStatus;
public EFResponseData(byte[] data) {
mFileStatus = data[RESPONSE_DATA_FILE_STATUS] & 0xFF;
}
public int getFileStatus() {
return mFileStatus;
}
} | [
"zhangjinqiang@huaqin.com"
] | zhangjinqiang@huaqin.com |
062744a3fc12b38b316ef3b1acab49ec7df93d99 | c915e7a2d2bc4013ec8e85f3c3bfec1b6edaf81d | /app/src/androidTest/java/peru/volcanes/volcanesper/ExampleInstrumentedTest.java | 20c68e6b8a65f17d3d7460325e8bc454a1f6ec4a | [] | no_license | kerlis/VOLCANESENPERU28022020 | a76ec816b921f940895813b1f26045d0a73dfd40 | 6014691b3de84a75d50f31bca44a5099c8bf6a9f | refs/heads/master | 2021-02-06T02:55:25.035659 | 2020-02-28T22:45:01 | 2020-02-28T22:45:01 | 243,867,798 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 751 | java | package peru.volcanes.volcanesper;
import android.content.Context;
import android.support.test.InstrumentationRegistry;
import android.support.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() throws Exception {
// Context of the app under test.
Context appContext = InstrumentationRegistry.getTargetContext();
assertEquals("peru.volcanes.volcanesper", appContext.getPackageName());
}
}
| [
"warriorerlis24@hotmail.com"
] | warriorerlis24@hotmail.com |
3cc17495ab90283f6029dac0bb0dd89b88461b11 | 4d292f8d749fc2c84a6ee75643d9a1dc57c0ea4b | /MongoDB/MongoDBService/src/com/mongodb/service/MongoDBService.java | 0da4768e44cc297b7e5341c5a87c14a04ee78c27 | [] | no_license | hughbrien/docker-frameworks-demo | cfc22c7cd1142c82c9aa686c0097c5a6c26a3aee | fd5100e54a98037613bc1199ae39e44dfe12acae | refs/heads/master | 2021-01-17T05:04:47.218416 | 2015-02-26T12:12:49 | 2015-02-26T12:12:49 | 31,478,519 | 1 | 0 | null | 2015-02-28T22:10:50 | 2015-02-28T22:10:50 | null | UTF-8 | Java | false | false | 3,108 | java | package com.mongodb.service;
import java.net.UnknownHostException;
import java.util.Date;
import javax.ws.rs.GET;
import javax.ws.rs.Path;
import javax.ws.rs.Produces;
import javax.ws.rs.core.MediaType;
import com.mongodb.BasicDBObject;
import com.mongodb.DB;
import com.mongodb.DBCollection;
import com.mongodb.DBCursor;
import com.mongodb.MongoClient;
import com.mongodb.MongoException;
@Path("mongoDBService")
public class MongoDBService {
@GET
@Path("/mongoDBOperation")
@Produces(MediaType.APPLICATION_XML)
public String mongodbTest() throws InterruptedException {
try {
System.out
.println("CRUD OPeration begins on MongoDB");
/**** Connect to MongoDB ****/
MongoClient mongo = new MongoClient("localhost", 27017);
/**** Get database ****/
// if database doesn't exists, MongoDB will create it for you
DB db = mongo.getDB("testdb");
/**** Get collection / table from 'testdb' ****/
// if collection doesn't exists, MongoDB will create it for you
DBCollection table = db.getCollection("user");
/**** Insert ****/
// create a document to store key and value
BasicDBObject document = new BasicDBObject();
document.put("name", "Jack");
document.put("age", 30);
document.put("createdDate", new Date());
table.insert(document);
System.out
.println("****************** Done with inserting Document **********************");
/**** Find and display ****/
BasicDBObject searchQuery = new BasicDBObject();
searchQuery.put("name", "Jack");
DBCursor cursor = table.find(searchQuery);
System.out
.println("------------------ Search for inserting Document ----------------------");
Thread.sleep(1000);
while (cursor.hasNext()) {
System.out.println("Document:" +cursor.next());
}
System.out
.println("------------------ Done with Search of insereted Document --------------");
/**** Update ****/
// search document where name="docker" and update it with new values
BasicDBObject query = new BasicDBObject();
query.put("name", "Jack");
BasicDBObject newDocument = new BasicDBObject();
newDocument.put("name", "Jack-updated");
BasicDBObject updateObj = new BasicDBObject();
updateObj.put("$set", newDocument);
table.update(query, updateObj);
Thread.sleep(1000);
System.out
.println("****************** Done with Update of Document **********************");
/**** Find and display ****/
BasicDBObject searchQuery2 = new BasicDBObject().append("name",
"Jack-updated");
DBCursor cursor2 = table.find(searchQuery2);
System.out
.println("------------------ Search for Update Document ----------------------");
Thread.sleep(1000);
while (cursor2.hasNext()) {
System.out.println(cursor2.next());
}
System.out
.println("------------------ Done with Search of Update Document --------------");
/**** Done ****/
System.out
.println("CRUD Operation end on MongoDB");
} catch (UnknownHostException e) {
e.printStackTrace();
} catch (MongoException e) {
e.printStackTrace();
}
return "sucess";
}
}
| [
"udaya@neevtech.com"
] | udaya@neevtech.com |
bfb0b442806ae743fca0667832733a6dc814001c | f0df1e21caa3e812bc2a28972c78c52fc39dc18b | /Trabalhos - 05 - Quinto Periodo/GBC055 - POO2/AulaPratica05/src/aulapratica05/Caixa10.java | b9816552c792899a43c3450d72940391baf0ce29 | [] | no_license | marcelomborges/university-projects | 32503dfdb3313e847798382dbc18df49ea311f34 | 6d1d939e519e619696b46e0f7aea8033717568e5 | refs/heads/master | 2023-01-23T10:14:22.248204 | 2020-12-11T02:40:46 | 2020-12-11T02:40:46 | 308,711,920 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 759 | java | package aulapratica05;
public class Caixa10 extends CaixaChain
{
public Caixa10(int q)
{
super(IDCaixa.C10,q);
}
protected int efetuaPagamento(int valor)
{
if((qntnotas > 0) && (valor/10 < qntnotas))
{
qntnotas -= valor/10;
System.out.println("Notas de 10 : " + valor/10);
return (valor % 10);
}
else
{
if(qntnotas > 0)
{
System.out.println("Notas de 10 : " + qntnotas);
valor = valor - 10*qntnotas;
qntnotas = 0;
return valor;
}
}
System.out.println("Nenhuma nota de 10 disponivel");
return (valor);
}
}
| [
"marcelomborges@outlook.com"
] | marcelomborges@outlook.com |
3b4b48f11d25a51c7746abb44147f19c434b6fde | c6845f7cd9deb960f4953528f2bacb1a4113aadb | /src/main/java/Entities/Repositories/ClientRepo.java | 9830613b579678ab9922ce1678199a96614362ac | [] | no_license | SeanWallach/SYSC-4806 | 6125e6a5be4e6150c4b039dcea9b710fbcaab3d9 | e35b6fcd4d51220ee357b158e7c79760f9bf8221 | refs/heads/main | 2023-04-12T15:11:19.767339 | 2021-05-06T16:06:31 | 2021-05-06T16:06:31 | 344,672,564 | 0 | 0 | null | 2021-04-09T15:36:20 | 2021-03-05T02:36:35 | Java | UTF-8 | Java | false | false | 260 | java | package Entities.Repositories;
import Entities.Client;
import org.springframework.data.repository.CrudRepository;
public interface ClientRepo extends CrudRepository<Client, Long> {
Client findById(long id);
Client findByUsername(String username);
} | [
"adybka10@gmail.com"
] | adybka10@gmail.com |
9d2a7c98d17b11798a43371a712d561679ed2435 | 0cb3b9e8c83918f7516dd15154179fe2efa0df72 | /Leetcode100/leetcode100/src/main/java/com/jiang/leetcode100/target_sum/TargetSum3.java | 81a1d1a1222a32d11c86a9edac3e9b641b7cb0df | [] | no_license | jiangshen95/PasaPrepareRepo | 74e39afb6c0c1133ab8998381135f1fea0a979ac | ea7c34816f5586ef7248581f47d68ddfe0f308ee | refs/heads/master | 2022-12-28T15:42:34.435119 | 2020-08-15T03:15:31 | 2020-08-15T03:15:31 | 276,589,914 | 0 | 0 | null | 2020-10-13T23:20:53 | 2020-07-02T08:22:15 | Java | UTF-8 | Java | false | false | 1,148 | java | package main.java.com.jiang.leetcode100.target_sum;
import java.util.Scanner;
class Solution3 {
public int findTargetSumWays(int[] nums, int S) {
int[] dp = new int[2001];
dp[nums[0] + 1000] = 1;
dp[-nums[0] + 1000] += 1;
for(int i = 1; i < nums.length; i++) {
int[] temp = new int[2001];
for(int j = -1000; j <= 1000; j++) {
if(dp[j + 1000] > 0) {
temp[j + nums[i] + 1000] += dp[j + 1000];
temp[j - nums[i] + 1000] += dp[j + 1000];
}
}
dp = temp;
}
return S > 1000 ? 0 : dp[S + 1000];
}
}
public class TargetSum3 {
public static void main(String[] args) {
Scanner scanner = new Scanner(System.in);
String str = scanner.nextLine();
int S = scanner.nextInt();
scanner.close();
String[] nums_str = str.split(" ");
int[] nums = new int[nums_str.length];
for(int i = 0; i < nums.length; i++) nums[i] = Integer.parseInt(nums_str[i]);
System.out.println(new Solution3().findTargetSumWays(nums, S));
}
} | [
"jiangshen95@163.com"
] | jiangshen95@163.com |
c8d00b499594a7c43bb919ffcab04c19b5b875de | a735a57eaa585658175a929e205998c68274cb84 | /src/Ynzc/YnzcAms/Service/Impl/CarCheckServiceImpl.java | 48c06641a19b195f37c270ece67cba48a86e95b9 | [] | no_license | liuxiaoqiang/test2 | 9617c9d4bb4476ae46b4a409ceaab253342a3899 | 269fd31702a3a69a7d70dad2685188ddf61542a2 | refs/heads/master | 2016-08-09T23:04:03.234229 | 2016-03-25T07:43:24 | 2016-03-25T08:00:38 | 54,703,219 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,199 | java | package Ynzc.YnzcAms.Service.Impl;
import java.util.List;
import Ynzc.YnzcAms.Dao.CarCheckDao;
import Ynzc.YnzcAms.Model.CarCheck;
import Ynzc.YnzcAms.Model.CarCheckView;
import Ynzc.YnzcAms.Model.Page;
import Ynzc.YnzcAms.Model.TractorRegistrationRecordProcessSource;
import Ynzc.YnzcAms.Service.CarCheckService;
public class CarCheckServiceImpl implements CarCheckService {
private CarCheckDao carCheckDao;
public CarCheckDao getCarCheckDao() {
return carCheckDao;
}
public void setCarCheckDao(CarCheckDao carCheckDao) {
this.carCheckDao = carCheckDao;
}
public List<CarCheck> getAllModelList(Page page, String conditions) {
// TODO Auto-generated method stub
return this.carCheckDao.getAllModelList(page, conditions);
}
public List<CarCheck> getAllModelList() {
// TODO Auto-generated method stub
return this.carCheckDao.getAllModelList();
}
public CarCheck findModelById(int id) {
// TODO Auto-generated method stub
return this.carCheckDao.findModelById(id);
}
public boolean addCarCheck(CarCheck model) {
// TODO Auto-generated method stub
return this.carCheckDao.addModel(model);
}
public boolean delModel(CarCheck model) {
// TODO Auto-generated method stub
return this.carCheckDao.delModel(model);
}
public boolean updateCarCheck(CarCheck model) {
// TODO Auto-generated method stub
return this.carCheckDao.updateModel(model);
}
public List<CarCheckView> getCarCheckViewList(Page page, String conditions,
int userid) {
// TODO Auto-generated method stub
return this.carCheckDao.getCarCheckViewList(page, conditions, userid);
}
public List<CarCheck> findCarCheckingByTractorinfoId(String tractorids) {
// TODO Auto-generated method stub
return this.carCheckDao.findCarCheckingByTractorinfoId(tractorids);
}
public boolean delCarCheckByIds(String ids) {
// TODO Auto-generated method stub
return this.carCheckDao.delCarCheckByIds(ids);
}
public boolean updateCarCheckStateByIds(int state, String ids) {
// TODO Auto-generated method stub
return this.carCheckDao.updateCarCheckStateByIds(state, ids);
}
public boolean auditCarCheck(int state, String checkuser, String checkip,
String checkcontext, String ids) {
// TODO Auto-generated method stub
return this.carCheckDao.auditCarCheck(state, checkuser, checkip, checkcontext, ids);
}
public List<CarCheckView> getCarCheckViewListByIds(String ids){
return this.carCheckDao.getCarCheckViewListByIds(ids);
}
public List<TractorRegistrationRecordProcessSource> recordReport(int id){
return carCheckDao.recordReport(id);
}
public List<CarCheckView> getCarCheckViewList(Page page, String conditions,
String regionid) {
// TODO Auto-generated method stub
return carCheckDao.getCarCheckViewList(page, conditions, regionid);
}
public List<CarCheckView> getFilingList(Page page, String conditions,
String regionid) {
// TODO Auto-generated method stub
return carCheckDao.getFilingList(page, conditions, regionid);
}
public List<CarCheckView> getFilingListQuery(Page page, String conditions,
String regionid) {
// TODO Auto-generated method stub
return carCheckDao.getFilingListQuery(page, conditions, regionid);
}
}
| [
"liuxiaoqiang_0625@163.com"
] | liuxiaoqiang_0625@163.com |
5c9b090161fe5a99e0430f9545b6716f0edf7f27 | 58c7ad1b3f1ec789d7d1b5eae81f42b78c4182b8 | /app/src/androidTest/java/net/ddns/suyashbakshi/smarthome/ExampleInstrumentedTest.java | 819cd459d36c7cbe2e978b276d1bfeed3e038ab3 | [] | no_license | suyashbakshi/P1_COSC6377 | f32655d24143b1219d5b432de75db7f3753b5141 | 11f680624e1f38abfee7a08fc2861e1ecac394de | refs/heads/master | 2021-01-13T08:57:06.337524 | 2016-11-01T03:59:31 | 2016-11-01T03:59:31 | 72,490,234 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 766 | java | package net.ddns.suyashbakshi.smarthome;
import android.content.Context;
import android.support.test.InstrumentationRegistry;
import android.support.test.runner.AndroidJUnit4;
import org.junit.Test;
import org.junit.runner.RunWith;
import static org.junit.Assert.*;
/**
* Instrumentation 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() throws Exception {
// Context of the app under test.
Context appContext = InstrumentationRegistry.getTargetContext();
assertEquals("net.ddns.suyashbakshi.smarthome", appContext.getPackageName());
}
}
| [
"suyashbakshi301995@gmail.com"
] | suyashbakshi301995@gmail.com |
af2dd0b9eee4136cc6ce5710df10fbe36a85af0d | 977d5af8d832b9a8a1cb01352ec75b88dcca10fb | /kieker-tools/kdb/src/kieker/tools/bridge/package-info.java | 98693ec3d015fb4ad84af5e97e87c8e421248e0b | [
"Apache-2.0"
] | permissive | Zachpocalypse/kieker | 14fdced218c605d95ae40d674af62dae4386957d | 64c8a74422643362da92bb107ae94f892fa2cbf9 | refs/heads/master | 2023-04-08T19:10:56.067115 | 2020-03-06T10:18:45 | 2020-03-06T10:18:45 | 257,434,588 | 0 | 0 | Apache-2.0 | 2020-04-21T00:02:40 | 2020-04-21T00:02:39 | null | UTF-8 | Java | false | false | 805 | java | /***************************************************************************
* Copyright 2018 Kieker Project (http://kieker-monitoring.net)
*
* 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 kieker.tools.bridge; | [
"reiner.jung@email.uni-kiel.de"
] | reiner.jung@email.uni-kiel.de |
0f1c8208d32f8461b444614bbcd1a978ff0f27ce | 58cd96d8a734f2964c1bf1336f4645996c3a0382 | /src/domain/Lista.java | 8a0225f546575eae2091c1e04c8f02b403082ff5 | [] | no_license | RamonVillagrasaBenages/MyBasket | 8aa48c7b602b677cc5d1f6a09e794005ef9ef238 | 7b3d1439d6c22d29d2b8324df2d8cc997f3de5be | refs/heads/main | 2023-02-06T11:26:04.254016 | 2020-12-26T16:57:27 | 2020-12-26T16:57:27 | 300,713,002 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 960 | java | package domain;
import java.io.Serializable;
import java.util.ArrayList;
public class Lista implements Serializable {
private static final long serialVersionUID = 1L;
String correo;
String nombre_lista;
ArrayList<Product> productos;
public Lista(String correo, String nombre_lista, ArrayList<Product> productos){
this.correo = correo;
this.nombre_lista = nombre_lista;
this.productos = productos;
}
public String getCorreo() {
return correo;
}
public void setCorreo(String correo) {
this.correo = correo;
}
public String getNombre_lista() {
return nombre_lista;
}
public void setNombre_lista(String nombre_lista) {
this.nombre_lista = nombre_lista;
}
public ArrayList<Product> getProductos() {
return productos;
}
public void setProductos(ArrayList<Product> productos) {
this.productos = productos;
}
}
| [
"luca2510ml@gmail.com"
] | luca2510ml@gmail.com |
68001aeb6f1b8827f719558d2d6da294c9059601 | 9021430ed3796926cce4afc035851dbab9997fc6 | /app/src/main/java/com/ionexplus/titu/viewmodel/CameraViewModel.java | 1755cb0f58185973cc7b2e538eec7caa5bf298a9 | [] | no_license | imarabinda/TituVideo | 98361c0fd862f6c88e1e49c182e0f585b84123a7 | 353d41548cb2c721f771bfe9b91951b9c7491605 | refs/heads/master | 2023-06-04T03:32:55.453218 | 2021-06-18T09:48:02 | 2021-06-18T09:48:02 | 330,473,755 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,147 | java | package com.ionexplus.titu.viewmodel;
import android.hardware.Camera;
import android.media.MediaPlayer;
import android.util.Log;
import android.view.View;
import androidx.camera.core.CameraX;
import androidx.camera.core.Preview;
import androidx.camera.core.PreviewConfig;
import androidx.camera.core.VideoCapture;
import androidx.camera.core.VideoCaptureConfig;
import androidx.databinding.ObservableBoolean;
import androidx.databinding.ObservableInt;
import androidx.lifecycle.MutableLiveData;
import androidx.lifecycle.ViewModel;
import com.ionexplus.titu.R;
import com.ionexplus.titu.model.music.Musics;
import java.io.File;
import java.io.IOException;
import java.util.ArrayList;
import java.util.List;
public class CameraViewModel extends ViewModel {
public boolean isBack = false;
public ObservableBoolean isRecording = new ObservableBoolean(false);
public int shortTime = 15;
public int longTime = 30;
public ObservableBoolean isFlashOn = new ObservableBoolean(false);
public ObservableBoolean isFacingFront = new ObservableBoolean(false);
public ObservableBoolean isEnabled = new ObservableBoolean(false);
public ObservableBoolean isStartRecording = new ObservableBoolean(false);
public ObservableBoolean is15sSelect = new ObservableBoolean(true);
public ObservableInt soundTextVisibility = new ObservableInt(View.INVISIBLE);
public MutableLiveData<Long> onDurationUpdate = new MutableLiveData<>(shortTime*1000L);
public MutableLiveData<Integer> onItemClick = new MutableLiveData<>();
public MutableLiveData<Musics.SoundList> onSoundSelect = new MutableLiveData<>();
public CameraX.LensFacing lensFacing = CameraX.LensFacing.BACK;
public Preview preview;
public VideoCapture videoCapture;
public VideoCaptureConfig videoCaptureConfig;
public PreviewConfig previewConfig;
public VideoCaptureConfig.Builder builder1;
public PreviewConfig.Builder builder;
public List<String> videoPaths = new ArrayList<>();
public int count = 0;
public String parentPath = "";
public long duration = 15000;
public String soundId = "";
public MediaPlayer audio;
// public void onClickFlash() {
// isFlashOn.set(!isFlashOn.get());
// }
public void setOnItemClick(int type) {
onItemClick.setValue(type);
}
public void onSelectSecond(boolean isSelected15s) {
is15sSelect.set(isSelected15s);
onDurationUpdate.setValue(isSelected15s ? shortTime*1000L : longTime*1000L);
}
public void createAudioForCamera() {
File file = new File(parentPath.concat("/recordSound.aac"));
if (file.exists()) {
audio = new MediaPlayer();
try {
audio.setDataSource(parentPath.concat("/recordSound.aac"));
audio.prepare();
soundTextVisibility.set(View.VISIBLE);
onDurationUpdate.setValue((long) audio.getDuration());
} catch (IOException e) {
e.printStackTrace();
}
}
}
@Override
protected void onCleared() {
super.onCleared();
}
}
| [
"arabinda.gamerx@gmail.com"
] | arabinda.gamerx@gmail.com |
c17ebc2957c508eb44cc51d35102682a7e62801e | 1f92bfa50199ca8b548791177b31f1c8f74ecd07 | /src/main/java/ru/netology/StatisticsService.java | 3ba791cf3e2197cff3fca0af2a61b53410a0c77e | [] | no_license | ESE58/Java-Homework-CI-2 | 57cb8308121e72c0ae633ea301c93c3fc32f8e57 | 22354da17ef5c7aa531e995151bc44e9ac47d49f | refs/heads/master | 2023-08-23T13:29:47.171200 | 2021-11-06T19:19:31 | 2021-11-06T19:19:31 | 424,929,607 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 463 | java | package ru.netology;
public class StatisticsService {
/**
* Calculate index of max income
*
* @param incomes - array of incomes
* @return - index of first max value
*/
public long findMax(long[] incomes) {
long current_max_index = 0;
long current_max = incomes[0];
for (long income : incomes)
if (current_max < income)
current_max = income;
return current_max;
}
}
| [
"shepshop@ya.ru"
] | shepshop@ya.ru |
b4d06f25dba6d8186c1a6d8f279c11eaeafea7ae | 95768266d19caaddb3cd05300494c3db6c5524ac | /src/test/java/com/uniovi/tests/pageobjects/PO_View.java | 4abd1633aa24385470b93262b44bf79be43c7467 | [] | no_license | samuelmorenov/SDI-2021-Red-Social-Spring | 4694247279235748f2ee8d5012607857cea4f14d | 296f55dd3fce6acbbfce25cbfbbb4125d5121b38 | refs/heads/main | 2023-02-19T12:30:49.581390 | 2021-01-10T18:53:38 | 2021-01-10T18:53:38 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,956 | java | package com.uniovi.tests.pageobjects;
import java.util.List;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.WebElement;
import com.uniovi.tests.DriverSingleton;
import com.uniovi.tests.util.SeleniumUtils;
public class PO_View {
protected static PO_Properties p = new PO_Properties("messages");
protected static int timeout = 2;
protected static WebDriver driver = DriverSingleton.getDriver();
public static int getTimeout() {
return timeout;
}
public static void setTimeout(int timeout) {
PO_View.timeout = timeout;
}
public static PO_Properties getP() {
return p;
}
public static void setP(PO_Properties p) {
PO_View.p = p;
}
/**
* Espera por la visibilidad de un texto correspondiente a la propiedad key en
* el idioma locale en la vista actualmente cargandose en driver..
*
* @param driver: apuntando al navegador abierto actualmente.
* @param key: clave del archivo de propiedades.
* @param locale: Retorna el índice correspondient al idioma. 0 p.SPANISH y 1
* p.ENGLISH.
* @return Se retornará la lista de elementos resultantes de la búsqueda.
*/
static public List<WebElement> checkKey(String key, int locale) {
List<WebElement> elementos = SeleniumUtils.EsperaCargaPagina("text", p.getString(key, locale),
getTimeout());
return elementos;
}
static public void checkNoKey(String key, int locale) {
SeleniumUtils.EsperaCargaPaginaNoTexto(p.getString(key, locale), getTimeout());
}
/**
* Espera por la visibilidad de un elemento/s en la vista actualmente cargandose
* en driver..
*
* @param driver: apuntando al navegador abierto actualmente.
* @param type:
* @param text:
* @return Se retornará la lista de elementos resultantes de la búsqueda.
*/
static public List<WebElement> checkElement(String type, String text) {
List<WebElement> elementos = SeleniumUtils.EsperaCargaPagina(type, text, getTimeout());
return elementos;
}
}
| [
"xamelsamuel@gmail.com"
] | xamelsamuel@gmail.com |
fdfb929ef212d556eeaa051750ba9634c8b99ca5 | 05bd228f6fd74fcf706835975e8f2aa72b9fe649 | /app/src/main/java/com/lwd/qjtv/view/RaceNumView.java | 33928326359e276849b6577008bf83ff90077ba5 | [
"Apache-2.0"
] | permissive | 541660139/qjtv | a17163763fdebe7574d4b3811e4590b169eee554 | a2aed5aca0e7a4211226e1a8a6f5e63c4f401fc5 | refs/heads/master | 2020-03-30T07:26:03.479686 | 2018-09-30T06:48:49 | 2018-09-30T06:48:49 | 150,939,249 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 684 | java | package com.lwd.qjtv.view;
import android.content.Context;
import android.util.AttributeSet;
import android.view.View;
import android.widget.LinearLayout;
import com.lwd.qjtv.R;
/**
* Email:wwwiiivip@yeah.net
* Created by ZhengQian on 2017/5/19.
*/
public class RaceNumView extends LinearLayout {
public RaceNumView(Context context) {
this(context,null);
}
public RaceNumView(Context context, AttributeSet attrs) {
this(context, attrs,0);
}
public RaceNumView(Context context, AttributeSet attrs, int defStyleAttr) {
super(context, attrs, defStyleAttr);
View.inflate(context, R.layout.item_race_view_layout, this);
}
}
| [
"541660139@qq.com"
] | 541660139@qq.com |
d71022506f64df1e4d2329762155f67d71dff9fe | d463e82f8f9c71213f95e8744d2316d0adfb9755 | /scan-lead-tools/lib/leadtools.src/leadtools/LeadFileStream.java | 9c15bb76baebddbda8dba03b4f2a8c3ec5841306 | [] | no_license | wahid-nwr/docArchive | b3a7d7ecf5d69a7483786fc9758e3c4d1520134d | 058e58bb45d91877719c8f9b560100ed78e6746d | refs/heads/master | 2020-03-14T07:06:09.629722 | 2018-05-01T18:23:55 | 2018-05-01T18:23:55 | 131,496,664 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,757 | java | /* */ package leadtools;
/* */
/* */ public final class LeadFileStream
/* */ implements ILeadStream
/* */ {
/* */ private String _fileName;
/* */
/* */ public LeadFileStream(String fileName)
/* */ {
/* 5 */ if (fileName == null) {
/* 6 */ throw new ArgumentNullException("fileName");
/* */ }
/* 8 */ this._fileName = fileName;
/* */ }
/* */
/* */ public String getFileName()
/* */ {
/* 14 */ return this._fileName;
/* */ }
/* */
/* */ public boolean canSeek() {
/* 18 */ return true;
/* */ }
/* */
/* */ public boolean canRead() {
/* 22 */ return true;
/* */ }
/* */
/* */ public boolean canWrite() {
/* 26 */ return true;
/* */ }
/* */
/* */ public boolean isStarted() {
/* 30 */ return false;
/* */ }
/* */
/* */ public boolean start() {
/* 34 */ return true;
/* */ }
/* */
/* */ public void stop(boolean resetPosition) {
/* */ }
/* */
/* */ public boolean openFile(String fileName, LeadStreamMode mode, LeadStreamAccess access, LeadStreamShare share) {
/* 41 */ return false;
/* */ }
/* */
/* */ public int read(byte[] buffer, int count) {
/* 45 */ return 0;
/* */ }
/* */
/* */ public int write(byte[] buffer, int count) {
/* 49 */ return 0;
/* */ }
/* */
/* */ public long seek(LeadSeekOrigin origin, long offset) {
/* 53 */ return -1L;
/* */ }
/* */
/* */ public void closeFile()
/* */ {
/* */ }
/* */ }
/* Location: /home/wahid/Downloads/docArchive/scan/lib/leadtools.jar
* Qualified Name: leadtools.LeadFileStream
* JD-Core Version: 0.6.2
*/ | [
"wahid_nwr@yahoo.com"
] | wahid_nwr@yahoo.com |
8a1e7fcb7c488c7814f72d77fcdd66b55bd3cbc8 | 9a1f626b45bc4493f8ea04f21b31131f798f79ea | /m-provider-elevator/src/main/java/com/radlly/mapper/ElevatorMapper.java | 74bdcdce3041574149d2d95d58a6280549c7a748 | [] | no_license | nobody165/spring-cloud-study | 582adf2b3a114c2843eb14e5959002a9f6ce7274 | 5038d445eb43fe88bb15da212ab22d6b80e87295 | refs/heads/master | 2021-01-24T11:27:46.737499 | 2018-12-24T06:28:51 | 2018-12-24T06:28:51 | 123,084,371 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 587 | java | package com.radlly.mapper;
import java.util.List;
import org.apache.ibatis.annotations.Param;
import com.radlly.model.ElevatorInfo;
public interface ElevatorMapper {
int insert(ElevatorInfo e);
ElevatorInfo get(long uuid);
/**
*
* @param elevatorInfo must extends BaseObject int pageStart,int pageEnd.
* @return
*/
List<ElevatorInfo> getPage(ElevatorInfo elevatorInfo);
List<ElevatorInfo> findUseForEvs(@Param("usefor")String usefor,@Param("pageStart")int pageStart,@Param("pageEnd")int pageEnd);
void insertBatch(@Param("list")List<ElevatorInfo> evs);
}
| [
"xh@mwteck.com"
] | xh@mwteck.com |
56ebfb8c79fb786d946126798f94488db1f67a05 | eaf45d18e4289a95ee3f5aba274f0791140bc99d | /Systemバックアップ/Awamiyage/src/servlet/UserEntry.java | 11d76dd5077de04e441aee592e14f74d261555f9 | [] | no_license | yogomi/Awamiyage | cd1f89ec0b1c288cdc975c8022d30e91d73a9d01 | 2e3d619c9f60ef6f0dba3f2a9ff67c3bf645cd55 | refs/heads/master | 2023-01-31T18:26:46.765081 | 2020-12-19T03:52:03 | 2020-12-19T03:52:03 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,112 | java | package servlet;
import java.io.IOException;
import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;
import bean.Users;
import dao.UsersDAO;
/**
* Servlet implementation class Insert
*/
@WebServlet("/UserEntry")
public class UserEntry extends HttpServlet {
private static final long serialVersionUID = 1L;
public UserEntry() {
super();
}
protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
//セッションを取得
HttpSession session = request.getSession();
//ログイン状態の確認、
//ログイン状態でなければ、ログイン画面に移動
LoginCheck.isLogin(session, request, response);
int count = 0; //登録処理した件数
//入力データを取得する
//会社名
String users_name = "";
if ((request.getParameter("users_name")!=null)){
users_name = request.getParameter("users_name");
}
//住所
String users_nickname = "";
if ((request.getParameter("users_nickname")!=null)){
users_nickname = request.getParameter("users_nickname");
}
//TEL
String users_password = "";
if ((request.getParameter("users_password")!=null)){
users_password = request.getParameter("users_password");
};
Users users = new Users();
//Beanインスタンスに値を代入する
users.setUsers_name(users_name);
users.setUsers_nickname(users_nickname);
users.setUsers_password(users_password);
//データベースに商品を挿入する
UsersDAO dao = new UsersDAO();
count = dao.insert(users);
//画面に出力
if (count == 1) {
request.setAttribute("message", "人のユーザーを追加しました");
}else {
request.setAttribute("message", "ユーザー追加が失敗しました");
}
//ユーザー一覧画面にフォワード
request.getRequestDispatcher("PageControlBack?pg_id=524").forward(request, response);
}
}
| [
""
] | |
14a94d9429ce4abc409ecae11d5420e3d3a4c4bb | 29e0c238be07722c4bf612992d196d732f521e68 | /src/ui/Menu.java | f9d8191864e129d099fe98f510193d5f45bf12d1 | [] | no_license | jose-2001/lasers-and-mirrors | 873f858c455c3ebd1119846da33aa4376f209434 | 5373cb8dc710eb79f6149ae07ac91efb9ba6fbd4 | refs/heads/master | 2023-01-05T12:55:20.234335 | 2020-11-04T14:13:48 | 2020-11-04T14:13:48 | 306,992,015 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,220 | java | package ui;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.util.Scanner;
import exceptions.GameQuitException;
import exceptions.InvalidShootingCellException;
import model.MirrorMatrix;
public class Menu {
// constants
public static final int EXIT_OPTION = 4;
// attributes
private Scanner sc;
private MirrorMatrix mm ;
// methods
public Menu() {
sc = new Scanner(System.in);
try {
mm = new MirrorMatrix();
} catch (IOException ioe) {
System.err.println("Score data could not be loaded properly");
ioe.printStackTrace();
} catch (ClassNotFoundException cnfe) {
System.err.println("The class was not found");
}
}
public String getMenuText() {
String menu = "";
menu += "==============\n" + " MENU\n" + "==============\n";
menu += "Type the option you want\n";
menu += "1. Play\n"
+ "2. Show Scores\n"
+ "3. Toggle cheat mode\n"
+ "4. Exit\n";
return menu;
}
public void startMenu() {
String msg = getMenuText();
int dec;
System.out.print(msg);
dec = Integer.parseInt(sc.nextLine());
decisionSwitch(dec);
if(dec!=EXIT_OPTION)
startMenu();
}
public void decisionSwitch(int dec) {
switch (dec) {
case 1:
play();
break;
case 2:
showScores();
break;
case 3:
toggleCheat();
break;
case 4:
System.out.println("Goodbye!");
break;
default:
System.out.println("Type a valid option");
break;
}
}
public void play() {
System.out.println("Input game parameters");
System.out.println("<username> <number of rows> <number of columns> <number of mirrors>");
String line=sc.nextLine();
String[] parts=line.split(" ");
String un= parts[0];
int n= Integer.parseInt(parts[1]);
int m= Integer.parseInt(parts[2]);
int k= Integer.parseInt(parts[3]);
mm.startGame(n,m,k,un);
playing(n,m,un);
finishGame(un,n,m,k);
}
public void playing(int n, int m, String un) {
System.out.println(un + ": " + mm.getMirrorsLeft() + " mirrors remaining");
System.out.println(mm.printMatrix());
System.out.println("Input move");
String line = sc.nextLine();
line = line.toUpperCase();
boolean cont = false;
try {
cont = mm.action(n, m, un, line);
} catch (InvalidShootingCellException e) {
System.err.println("You must shoot from a bordering cell and specify direction if corner cell");
playing(n, m, un);
// e.printStackTrace();
}catch(GameQuitException gqe) {
System.err.println("You will have a 100 point penalization for every mirror not found");
cont=false;
}
if(mm.isFinished()) {
cont=false;
}
if (cont) {
playing(n, m, un);
}
}
public void finishGame(String un, int n, int m, int k) {
System.out.println("Finished game!");
try {
System.out.println(mm.calculateScore(un,n,m,k));
} catch (FileNotFoundException e) {
System.err.println("The file where the Restaurant data is to be saved could not be found");
} catch (IOException e) {
System.err.println("Restaurant data could not be saved properly");
}
}
public void showScores() {
System.out.println(mm.showScores());
}
public void toggleCheat() {
mm.toggleCheatMode();
System.out.println("Cheat mode: "+mm.isCheatMode());
}
}
| [
"jose.garcia12@correo.icesi.edu.co"
] | jose.garcia12@correo.icesi.edu.co |
37c8a67e40ebe1f544431daf04dd5903dd5529d8 | e7c02b26e6da1b0652203285071edef433fae4cb | /rest-annotations/src/main/java/one/xingyi/restAnnotations/javascript/XingYiDomain.java | d9ae10a37453bb172e463faab29413c4f20446ea | [] | no_license | phil-rice/rest | 155af53fe32e6571001a4b640fcb546896e24dc8 | 3a31ce94c04871faded6fea645c2da0d99e342bb | refs/heads/master | 2020-04-15T19:11:11.276133 | 2019-01-18T00:58:20 | 2019-01-18T00:58:20 | 164,940,369 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 196 | java | package one.xingyi.restAnnotations.javascript;
abstract public class XingYiDomain {
public final Object mirror;
public XingYiDomain(Object mirror) {
this.mirror = mirror;
}
}
| [
"phil.rice@iee.org"
] | phil.rice@iee.org |
4dca5da4d347343f209548e69367e83d29a82e55 | 4d0395ff9e1e81e57da39e8048207b93dc79fa74 | /app/src/main/java/com/project/thamani/adapter/NotesAdapter.java | 4be174cb39519b738c8cdb2bc1c7f068a8263481 | [] | no_license | tyshchenko/Thamani | 760f0b64f6b318a9b742df8c96d4cabbf4a6c8d9 | 7d24a92644ae963f7b13399bb920be8f1d973fcf | refs/heads/master | 2020-05-01T15:31:46.053148 | 2019-03-21T11:20:48 | 2019-03-21T11:20:48 | 177,548,907 | 1 | 0 | null | 2019-03-25T08:52:40 | 2019-03-25T08:52:39 | null | UTF-8 | Java | false | false | 2,661 | java | package com.project.thamani.adapter;
/**
* Created by ravi on 20/02/18.
*/
import android.content.Context;
import android.support.v7.widget.RecyclerView;
import android.text.Html;
import android.util.Log;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.TextView;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.List;
import com.project.thamani.R;
import com.project.thamani.model.Note;
public class NotesAdapter extends RecyclerView.Adapter<NotesAdapter.MyViewHolder> {
private Context context;
private List<Note> notesList;
public class MyViewHolder extends RecyclerView.ViewHolder {
public TextView product,items,price,code;
public MyViewHolder(View view) {
super(view);
product = view.findViewById(R.id.product);
items = view.findViewById(R.id.itemss);
price = view.findViewById(R.id.price);
code = view.findViewById(R.id.code);
}
}
public NotesAdapter(Context context, List<Note> notesList) {
this.context = context;
this.notesList = notesList;
}
@Override
public MyViewHolder onCreateViewHolder(ViewGroup parent, int viewType) {
View itemView = LayoutInflater.from(parent.getContext())
.inflate(R.layout.note_list_row, parent, false);
return new MyViewHolder(itemView);
}
@Override
public void onBindViewHolder(MyViewHolder holder, int position) {
Note note = notesList.get(position);
holder.product.setText(note.getItem());
// Displaying dot from HTML character code
holder.code.setText("#"+note.getGTIN());
holder.items.setText("1x1");
// double prices=Double.parseDouble(note.getPrice());
// double itemss=Double.parseDouble(note.getItems());
// double tprice=itemss*prices;
// String final_price=Double.toString(tprice);
holder.price.setText("Ksh."+note.getPrice());
}
@Override
public int getItemCount() {
return notesList.size();
}
/**
* Formatting timestamp to `MMM d` format
* Input: 2018-02-21 00:15:42
* Output: Feb 21
*/
private String formatDate(String dateStr) {
try {
SimpleDateFormat fmt = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
Date date = fmt.parse(dateStr);
SimpleDateFormat fmtOut = new SimpleDateFormat("MMM d");
return fmtOut.format(date);
} catch (ParseException e) {
}
return "";
}
}
| [
"softneerdeveloper@gmail.com"
] | softneerdeveloper@gmail.com |
66801dc58084f983fbc9615d748c7cf7115415e4 | ffeaf567e9b1aadb4c00d95cd3df4e6484f36dcd | /Talagram/com/google/android/gms/internal/phenotype/zzb.java | c5fd9200882d52c480f4b20c24ff49e0d9702baf | [] | no_license | danielperez9430/Third-party-Telegram-Apps-Spy | dfe541290c8512ca366e401aedf5cc5bfcaa6c3e | f6fc0f9c677bd5d5cd3585790b033094c2f0226d | refs/heads/master | 2020-04-11T23:26:06.025903 | 2018-12-18T10:07:20 | 2018-12-18T10:07:20 | 162,166,647 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 128 | java | package com.google.android.gms.internal.phenotype;
import android.os.IInterface;
public interface zzb extends IInterface {
}
| [
"dpefe@hotmail.es"
] | dpefe@hotmail.es |
326141aada3f60abe0a9dd9213b28a0184f09bde | 8e34d281e9e334f64973ee5a062d042dc207a2e0 | /tVChatForPhone/src/main/java/com/bizcom/vo/enums/NetworkStateCode.java | 1e5fee3420444764a9c14fcca11c38a018f2c4e1 | [] | no_license | fengxiang1990/tvchat4edu | 8a3a3a90b0466b195dc315692a7cd04331ad0a96 | 88bca8a43f525cf36035383a8ddebb9cd8c1fe81 | refs/heads/master | 2021-01-21T21:10:31.506053 | 2017-06-19T14:41:44 | 2017-06-19T14:41:45 | 94,785,628 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,113 | java | package com.bizcom.vo.enums;
import android.os.Parcel;
import android.os.Parcelable;
public enum NetworkStateCode implements Parcelable {
CONNECTED(0), INCORRECT_INFO(1), TIME_OUT(-1), CONNECTED_ERROR(301), UNKNOW_CODE(
-3);
private int code;
private NetworkStateCode(int code) {
this.code = code;
}
public int intValue() {
return code;
}
public static NetworkStateCode fromInt(int code) {
switch (code) {
case 0:
return CONNECTED;
case 1:
return INCORRECT_INFO;
case -1:
return TIME_OUT;
case 301:
return CONNECTED_ERROR;
default:
return UNKNOW_CODE;
}
}
@Override
public int describeContents() {
return 0;
}
@Override
public void writeToParcel(Parcel dest, int flags) {
dest.writeInt(code);
}
public static final Parcelable.Creator<NetworkStateCode> CREATOR = new Parcelable.Creator<NetworkStateCode>() {
@Override
public NetworkStateCode createFromParcel(Parcel source) {
return NetworkStateCode.fromInt(source.readInt());
}
@Override
public NetworkStateCode[] newArray(int size) {
return new NetworkStateCode[size];
}
};
} | [
"fengxiang"
] | fengxiang |
ccdd1b3a34e659259f15241b401fef2731feac0c | 34221f3f7738d7a33c693e580dc6a99789349cf3 | /app/src/main/java/defpackage/dis.java | 90710cc23e10bc23712af4b7cdac862100e2568a | [] | no_license | KobeGong/TasksApp | 0c7b9f3f54bc4be755b1f605b41230822d6f9850 | aacdd5cbf0ba073460797fa76f1aaf2eaf70f08e | refs/heads/master | 2023-08-16T07:11:13.379876 | 2021-09-25T17:38:57 | 2021-09-25T17:38:57 | 374,659,931 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 279 | java | package defpackage;
/* renamed from: dis reason: default package */
/* compiled from: PG */
public final class dis extends defpackage.dir {
public static final long serialVersionUID = 3283890091615336259L;
public dis(java.lang.String str) {
super(str);
}
}
| [
"droidevapp1023@gmail.com"
] | droidevapp1023@gmail.com |
57740e50076b2cc61fd2cbaaf9033cd28eafcc9c | 3f1957d6b8672711e58bff07cb3e24f342831c92 | /lvlistenkeyboardevent/src/main/java/com/lv/listenkeyboardevent/SimpleUnregistrar.java | 60cccf787f793d0e381a75ca1e1ad8111da4edd8 | [] | no_license | vihahb/xMec | 782391a959d07b4a5a7747fe9173e9aad932d218 | 9da3333246aa1d0881b516777cedbb47aecf31b8 | refs/heads/master | 2021-03-27T12:42:23.427401 | 2017-08-11T12:19:14 | 2017-08-11T12:19:14 | 79,198,020 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,578 | java | package com.lv.listenkeyboardevent;
import android.app.Activity;
import android.os.Build;
import android.view.View;
import android.view.ViewTreeObserver;
import java.lang.ref.WeakReference;
/**
* Created by Vulcl on 3/24/2017
*/
public class SimpleUnregistrar implements Unregistrar {
private WeakReference<Activity> mActivityWeakReference;
private WeakReference<ViewTreeObserver.OnGlobalLayoutListener> mOnGlobalLayoutListenerWeakReference;
public SimpleUnregistrar(Activity activity, ViewTreeObserver.OnGlobalLayoutListener globalLayoutListener) {
mActivityWeakReference = new WeakReference<>(activity);
mOnGlobalLayoutListenerWeakReference = new WeakReference<>(globalLayoutListener);
}
@Override
public void unregister() {
Activity activity = mActivityWeakReference.get();
ViewTreeObserver.OnGlobalLayoutListener globalLayoutListener = mOnGlobalLayoutListenerWeakReference.get();
if (null != activity && null != globalLayoutListener) {
View activityRoot = KeyboardVisibilityEvent.getActivityRoot(activity);
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN) {
activityRoot.getViewTreeObserver()
.removeOnGlobalLayoutListener(globalLayoutListener);
} else {
activityRoot.getViewTreeObserver()
.removeGlobalOnLayoutListener(globalLayoutListener);
}
}
mActivityWeakReference.clear();
mOnGlobalLayoutListenerWeakReference.clear();
}
}
| [
"vihahb@gmail.com"
] | vihahb@gmail.com |
f03da82094c206c0415e257d4347f5c8a517d101 | 60cbfbbab770ea947b1589b5168d35a89673c213 | /src/main/java/com/tq/netty/learnnetty/model/packets/LogoutRequestPacket.java | d16ae31425c99a538f5816f8fca0ba131daa4813 | [] | no_license | Tianqi-Dotes/learnnetty | 4ca98e0edbbe0f996651cc430c7545d357b49915 | 7c7520e8c49fef3ddd88dbfe6b51de2e3974c6c8 | refs/heads/master | 2022-06-23T07:16:22.377433 | 2020-10-26T16:03:45 | 2020-10-26T16:03:45 | 188,011,438 | 1 | 0 | null | 2022-06-17T02:08:45 | 2019-05-22T09:57:26 | Java | UTF-8 | Java | false | false | 363 | java | package com.tq.netty.learnnetty.model.packets;
import com.tq.netty.learnnetty.model.Command;
import com.tq.netty.learnnetty.model.Packet;
import lombok.Data;
@Data
public class LogoutRequestPacket extends Packet {
private String userId;
private String username;
@Override
public Byte getCommand() {
return Command.LOGOUT_REQ;
}
}
| [
"594043616@QQ.COM"
] | 594043616@QQ.COM |
3b79d84ff36227d2c9f8cc962ca203bf0deb1b0d | 8cdacbe42ac603f3ba154bd7122753e41a8120e5 | /src/main/java/appLogic/DashboardPageHelper.java | 8f3ce22781f5f46477575d90460fb7f3c38efe2a | [] | no_license | aramdor/somePractice | 85b54ec8c4721e2b77571b3746f94b5e19fef616 | d0e5bab3a946c3c1a4d66b7b932cd0005c4dea4e | refs/heads/master | 2023-05-10T21:55:22.213150 | 2023-01-10T17:18:22 | 2023-01-10T17:18:22 | 189,898,675 | 0 | 0 | null | 2023-05-01T20:20:12 | 2019-06-02T21:49:36 | Java | UTF-8 | Java | false | false | 1,020 | java | package appLogic;
import io.qameta.allure.Step;
import testData.DashboardTestData;
import testData.UserObject;
import utils.ApplicationManager;
public class DashboardPageHelper extends PageWithTopToolbarHelper {
public DashboardPageHelper(ApplicationManager app) {
super(app);
}
@Step("Check page URL and wait until JS is loaded")
public DashboardPageHelper isPageLoaded() {
checkUrlAndWaitForJs(DashboardTestData.URL_DASHBOARD);
return this;
}
public DashboardPageHelper openAdminDropdown() {
super.openAdminDropdown();
return this;
}
public DashboardPageHelper openUserNameDropdown() {
super.openUserNameDropdown();
return this;
}
public DashboardPageHelper clickOnFieldInDropdown(String fieldName) {
super.clickOnFieldInDropdown(fieldName);
return this;
}
public DashboardPageHelper checkUserName (UserObject user) {
super.checkCurrentUserName(user);
return this;
}
}
| [
"iaroslav.stepanov@t-systems.com"
] | iaroslav.stepanov@t-systems.com |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.